Routines
Prev:
B08A
Up:
Map
Next:
B0A9
B09A: Add To Score
Used by the routines at
Process_EnterForestPath
,
Process_CongratulationsGameOver
,
Process_EnterLugsCavern
,
Process_EnterValeOfCuchulainn
,
Process_EnterInnerCourtyard
,
Process_EnterEnchantedHills
,
Process_EnterDeepPoolOfWater
,
Process_EnterBleakMoorland
,
Process_EnterCrystalCavern
,
Process_EnterValeOfRhia
,
Process_EnterCauseway
,
Process_GetUrn
,
Process_GetRope
,
Process_GetCloak
,
Process_ThrowMeatToWolves
,
Process_GiveSaltToGuard
,
Process_BuyMeatFromTraderWithIron
,
Process_GiveRomanToDruid
,
Process_ThrowUrnIntoFire
,
Process_CaptureRoman
,
Process_PlaceLadderAgainstPlatform
,
Process_PlaceSwordOnSlab
,
Process_KillBear
,
Process_KillOxWithSword
and
Action_Sleep
.
Input
A
Points to add
AddToScore
B09A
PUSH HL
Stash
HL
on the stack.
B09B
LD HL,($A7C4)
Load *
Score
into
HL
.
B09E
ADD A,L
Add the points to the low byte.
B09F
DAA
Decimal adjust for BCD (Binary Coded Decimal).
B0A0
LD L,A
Store the adjusted result.
B0A1
JR NC,
SaveScore
Jump to
SaveScore
if there was no carry from the addition.
If there was carry, increment the high byte.
B0A3
INC H
Increment the high byte by one.
SaveScore
B0A4
LD ($A7C4),HL
Write the updated score back to *
Score
.
B0A7
POP HL
Restore
HL
from the stack.
B0A8
RET
Return.
Prev:
B08A
Up:
Map
Next:
B0A9