Prev: 81AB Up: Map Next: 8209
81BB: Start Game
Queues the start-game tune, clears planet RAM and then walks every actor through JumpTable.
Queue the start-game tune and clear planet RAM.
StartGame 81BB LD DE,$BA35 Set the tune pointer to Tune_Start_Game.
81BE CALL QueueTune Queue the start-game tune.
Reset the planet and player state.
81C1 LD HL,$5E50 Set the start address to PlanetData.
81C4 LD BC,$6000 Set the end address to Laser_Parameter_1.
81C7 CALL ResetScreen_Fill Call ResetScreen_Fill.
81CA CALL ResetPlanet Call ResetPlanet.
81CD CALL NewGame Call NewGame.
81D0 CALL ResetModifiedCode Call ResetModifiedCode.
81D3 CALL LevelNew Call LevelNew.
Ready the stack and restore Jetman after a teleport.
StartGame_ReadyStack 81D6 LD SP,$5E00 Set the stack pointer to GameOptions.
81D9 LD A,($5E68) Call FinishTeleport if TeleportRestore is set.
81DC AND A
81DD CALL NZ,FinishTeleport
81E0 EI Enable interrupts.
Dispatch the current actor through the jump table.
StartGame_DispatchActor 81E1 XOR A Write 00 to AlienCount.
81E2 LD ($5E5E),A
81E5 LD IX,$6078 Point IX at Jetman_Slot.
This entry point is used by the routines at FrameUpdate and NextObjectSlot.
StartGame_NextActor 81E9 LD A,($5C78) C=FRAMES.
81EC LD C,A
81ED LD A,($5E53) Call FrameUpdate if LastFrame does not match.
81F0 CP C
81F1 CALL NZ,FrameUpdate
81F4 LD HL,$8259 Push NextObjectSlot as the return address.
81F7 PUSH HL
81F8 LD BC,$82C5 Set the jump-table pointer to JumpTable.
81FB LD L,(IX+$00) Fetch the actor type from *IX+00.
This entry point is used by the routine at DispatchObjectState.
StartGame_AfterActor 81FE LD H,$00 Fetch the handler address from JumpTable.
8200 ADD HL,HL
8201 ADD HL,BC
8202 LD A,(HL)
8203 INC HL
8204 LD H,(HL)
8205 LD L,A
8206 JP IndirectJump Jump to IndirectJump.
View the equivalent code in;
Prev: 81AB Up: Map Next: 8209