Prev: 52193 Up: Map Next: 53712
53674: Game Entry Point
GameEntryPoint 53674 DI Disable interrupts.
53675 LD SP,65530 SP=65530.
Write 253 from InterruptLowOrderByteJumpTable for 256 bytes. All will become clear soon...
53678 LD HL,65024 HL=InterruptLowOrderByteJumpTable.
53681 LD BC,253 Set a counter in B of 0 (as it's a DJNZ this is really 256) and set C to 253 for the value to write.
WriteInterruptJumpAddress_Loop 53684 LD (HL),C Write 253 to *HL.
53685 INC HL Increment HL by one.
53686 DJNZ WriteInterruptJumpAddress_Loop Decrease counter by one and loop back to WriteInterruptJumpAddress_Loop until counter is zero.
One more for luck...
53688 LD (HL),C Write C to *HL.
This sets interrupt mode 2; when the system generates an interrupt, it'll use the high-order byte set here, together with a low-order byte generated from the system to form a 16-bit address to jump to.
As we've just set 253 to every address, this means that every generated interrupt will jump to 65277 which in turn will jump to 63581.
53689 LD A,254 Set 254 as the high-order byte in I.
53691 LD I,A
53693 IM 2 Set interrupt mode 2.
53695 LD HL,22595 Write 22595 (attribute buffer location) to *SelectedMenuItem_ScreenPosition.
53698 LD (55415),HL
53701 LD A,1 Write 1 ("keyboard") to *SelectedMenuItem.
53703 LD (60216),A
53706 LD HL,60260 Write InputHandler_Keyboard to *Pointer_InputControl.
53709 LD (60214),HL
Continue on to Game_Loop.
Prev: 52193 Up: Map Next: 53712