Prev: AD79 Up: Map Next: AE0D
ADA1: Game Start
Used by the routine at GameEntryPoint.
GameStart ADA1 LD HL,$9F88 HL=Table_ItemLocations.
ADA4 LD BC,$0181 BC=0181.
GameStart_0 ADA7 LD (HL),$00 Write 00 to *HL.
ADA9 INC HL Move HL on to the next byte to clear.
ADAA DEC BC Count down the 0181 bytes and loop back to GameStart_0 until all are cleared.
ADAB LD A,B
ADAC OR C
ADAD JR NZ,GameStart_0
ADAF LD HL,$BB0B Copy 0088 bytes of data (count is via *Count_Objects_1) from Table_InitialItemLocations to Table_ItemLocations.
ADB2 LD DE,$9F88
ADB5 LD BC,($BBC7)
ADB9 LDIR
ADBB LD A,($BBD7) Write *InitialCarryingLimit to *CarryingLimit.
ADBE LD ($A0D3),A
ADC1 LD IX,$BAF9 IX=Table_SavedStateAddresses.
ADC5 LD DE,$BB05 DE=InitialSavedStateBytes.
ADC8 LD A,($BBD1) B=*Count_SavedStateBytes.
ADCB LD B,A
GameStart_1 ADCC LD L,(IX+$00) L=*IX+00.
ADCF LD H,(IX+$01) H=*IX+01.
ADD2 LD A,(DE) A=*DE.
ADD3 LD (HL),A Write that initial-state byte through the address from Table_SavedStateAddresses.
ADD4 INC IX Move IX on to the next initial-state address.
ADD6 INC IX
ADD8 INC DE Move DE on to the next initial-state byte.
ADD9 DJNZ GameStart_1 Decrease the init counter and loop back to GameStart_1 until every saved-state address is primed.
ADDB CALL JustReturn Call JustReturn.
ADDE LD A,($BBD3) Write *StartingRoom to *CurrentRoom.
ADE1 LD ($A106),A
ADE4 CALL ChangeRoom Call ChangeRoom.
GameStart_2 ADE7 CALL Handler_GameEvents Call Handler_GameEvents.
ADEA CALL Handler_ScenicEvents Call Handler_ScenicEvents.
ADED LD A,$00 A=00.
ADEF CALL TestFlag Call TestFlag.
ADF2 JR NZ,GameOver End the game when the player is dead.
ADF4 LD A,$01 A=01.
ADF6 CALL TestFlag Call TestFlag.
ADF9 JR NZ,GameOver_Score End the game and show the score.
ADFB LD A,$02 A=02.
ADFD CALL TestFlag Call TestFlag.
AE00 JR NZ,WantAnotherGameInput End the game and ask for another one.
AE02 CALL Handler_UserInput Call Handler_UserInput.
AE05 CALL Parser_ProcessItem Call Parser_ProcessItem.
AE08 CALL NC,Handler_DispatchVerb Call Handler_DispatchVerb if C is greater than 02.
AE0B JR GameStart_2 Jump to GameStart_2.
Prev: AD79 Up: Map Next: AE0D