Prev: 41015 Up: Map Next: 41176
41024: Game Entry Point
Used by the routines at Alias_GameEntryPoint and 41191.
GameEntryPoint 41024 XOR A Write 0 to
41025 LD (54968),A
41028 LD (40987),A
41031 DI Disable interrupts.
41032 CALL DrawDecorativeLine Call DrawDecorativeLine.
41035 LD SP,23936 SP=23936.
41038 CALL WaitForKeypress_Loop Call WaitForKeypress_Loop.
41041 CP 110 Jump to NoMeansNo if the keypress is ASCII code 110 ("n").
41043 JR Z,NoMeansNo
41045 CP 78 Compare the keypress with ASCII code 78 ("N").
41047 LD A,1 A=1.
41049 JR NZ,GameEntryPoint_0 Jump to GameEntryPoint_0 if the keypress was not ASCII code 78 ("N").
The player pressed either "N" or "n".
NoMeansNo 41051 XOR A A=0.
GameEntryPoint_0 41052 LD (40977),A Write A to *40977.
41055 LD A,R Write the contents of the Memory Refresh Register to *41015.
41057 LD (41015),A
This entry point is used by the routine at 41191.
GameEntryPoint_1 41060 XOR A Write 0 to *41178.
41061 LD (41178),A
GameEntryPoint_2 41064 LD A,(41178) Jump to 41191 if *41178 is not zero.
41067 AND A
41068 JR NZ,41191
41070 CALL Handler_GameClock Call Handler_GameClock.
41073 CALL Handler_DateBar Call Handler_DateBar.
41076 LD IY,39008 IY=39008.
41080 LD A,(IY+3) A=*IY+3.
41083 CP 50 Jump to GameEntryPoint_3 if A is not equal to 50.
41085 JR NZ,GameEntryPoint_3
41087 CALL GetKeypress Call GetKeypress.
41090 BIT 7,A Jump to GameEntryPoint_3 if bit 7 of A is not set.
41092 JR Z,GameEntryPoint_3
41094 CP 141 Jump to GameEntryPoint_3 if A is not equal to 141.
41096 JR NZ,GameEntryPoint_3
41098 LD HL,(40925) HL=*CurrentTime_Ticker.
41101 LD (IY+6),L Write L to *IY+6.
41104 LD (IY+7),H Write H to *IY+7.
GameEntryPoint_3 41107 LD IY,39008 IY=39008.
Game_Loop 41111 LD A,(IY+0) A=*IY+0.
41114 INC A Increment A by one.
41115 JR Z,GameEntryPoint_2 Jump to GameEntryPoint_2 if A is equal to 141.
41117 LD HL,(40925) HL=*CurrentTime_Ticker.
41120 CALL 41179 Call 41179.
41123 JR C,GameEntryPoint_5 Jump to GameEntryPoint_5 if A is less than 141.
41125 LD A,(IY+0) A=*IY+0.
41128 PUSH IY Stash IY and AF on the stack.
41130 PUSH AF
41131 CALL 52279 Call 52279.
GameEntryPoint_4 41134 POP AF Restore AF from the stack.
41135 PUSH AF Stash AF on the stack.
41136 CALL ScriptInterpreter Call ScriptInterpreter.
41139 LD HL,(40991) HL=*40991.
41142 LD A,L Jump back to GameEntryPoint_4 until HL is zero.
41143 OR H
41144 JR Z,GameEntryPoint_4
41146 POP AF Restore AF and IY from the stack.
41147 POP IY
41149 LD E,(IY+6) E=*IY+6.
41152 LD D,(IY+7) D=*IY+7.
41155 ADD HL,DE HL+=DE.
41156 LD (IY+6),L Write L to *IY+6.
41159 LD (IY+7),H Write H to *IY+7.
41162 PUSH IY Stash IY on the stack.
41164 CALL 40055 Call 40055.
41167 POP IY Restore IY from the stack.
GameEntryPoint_5 41169 LD DE,8 DE=0008.
41172 ADD IY,DE IY+=DE.
41174 JR Game_Loop Jump to Game_Loop.
Prev: 41015 Up: Map Next: 41176