![]() |
Routines |
| Prev: 52190 | Up: Map | Next: 53806 |
|
|
||||
| DemoEntryPoint | 53674 | DI | Disable interrupts. | |
| 53675 | LD (53806),SP | Stash the current stack pointer at *Storage_StackPointer. | ||
| 53679 | LD SP,65530 | SP=65530. | ||
|
Write 253 from InterruptLowOrderByteJumpTable for 256 bytes. All will become clear soon...
|
||||
| 53682 | LD HL,65024 | HL=65024. | ||
| 53685 | 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 | 53688 | LD (HL),C | Write 253 to *HL. | |
| 53689 | INC HL | Increment HL by one. | ||
| 53690 | DJNZ WriteInterruptJumpAddress_Loop | Decrease counter by one and loop back to WriteInterruptJumpAddress_Loop until counter is zero. | ||
|
One more for luck...
|
||||
| 53692 | 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 62586.
|
||||
| 53693 | LD A,254 | Set 254 as the high-order byte in I. | ||
| 53695 | LD I,A | |||
| 53697 | IM 2 | Interrupt mode 2. | ||
|
This entry point is used by the routine at StartGame.
|
||||
| DemoEntryPoint_0 | 53699 | DI | Disable interrupts. | |
| 53700 | LD HL,25000 | Write 25000 to *54704. | ||
| 53703 | LD (54704),HL | |||
| 53706 | LD BC,0 | Write 0000 to: | ||
| 53709 | LD (54672),BC | |||
| 53713 | LD (54673),BC | |||
| 53717 | LD (57552),BC | |||
| 53721 | XOR A | Write 0 to *54665. | ||
| 53722 | LD (54665),A | |||
|
Print the in-game surround.
|
||||
| 53725 | LD A,5 | Set border colour to CYAN. | ||
| 53727 | OUT (254),A | |||
| 53729 | LD HL,49830 | HL=Data_PlayareaSurround. | ||
| 53732 | CALL UnpackScreenData | Call UnpackScreenData. | ||
|
Set the starting lives.
|
||||
| 53735 | LD A,4 | Write 4 to *Lives. | ||
| 53737 | LD (54595),A | |||
| 53740 | LD HL,23258 | Write 23258 (attribute buffer location) to *54670. | ||
| 53743 | LD (54670),HL | |||
|
Initialise the new game with the level 1 data.
|
||||
| 53746 | LD HL,53810 | Write Table_LevelData to *Pointer_CurrentLevelData. | ||
| 53749 | LD (53808),HL | |||
|
Note, this level counter counts down instead of up.
|
||||
| 53752 | LD B,1 | Set a counter in B for the total number of levels (1). | ||
|
This level counter is used for display purposes.
|
||||
| 53754 | XOR A | Write 0 to *Level. | ||
| 53755 | LD (54666),A | |||
|
The game loops here in-game to begin a new level.
|
||||
| DemoEntryPoint_1 | 53758 | PUSH BC | Stash the level counter on the stack. | |
| 53759 | LD HL,(53808) | HL=*Pointer_CurrentLevelData. | ||
| 53762 | LD E,(HL) | DE=current level data pointer. | ||
| 53763 | INC HL | |||
| 53764 | LD D,(HL) | |||
| 53765 | INC HL | Increment the level data pointer by one to point to the next level. | ||
| 53766 | LD (53808),HL | Write the next level pointer to *Pointer_CurrentLevelData. | ||
| 53769 | EX DE,HL | Exchange the DE and HL registers. | ||
| 53770 | LD A,(54666) | A=*Level. | ||
| 53773 | INC A | Increment A by one. | ||
| 53774 | DAA | DAA. | ||
| 53775 | LD (54666),A | Write A to *Level. | ||
| 53778 | CALL Game_Initialisation | Call Game_Initialisation. | ||
| 53781 | LD A,1 | A=1. | ||
| 53783 | POP BC | Restore BC from the stack. | ||
| 53784 | PUSH BC | Stash BC on the stack. | ||
| 53785 | CALL Print_HelperPreviewImage | Call Print_HelperPreviewImage. | ||
| 53788 | CALL Colourise_PreviewGrid | Call Colourise_PreviewGrid. | ||
| 53791 | EI | Enable interrupts. | ||
| 53792 | CALL StartGame | Call StartGame. | ||
| 53795 | POP BC | Restore BC from the stack. | ||
| 53796 | DJNZ DemoEntryPoint_1 | Decrease counter by one and loop back to DemoEntryPoint_1 until counter is zero. | ||
| 53798 | LD SP,(53806) | Restore the original stack pointer from *Storage_StackPointer. | ||
| 53802 | IM 1 | Interrupt mode 1. | ||
| 53804 | EI | Enable interrupts. | ||
| 53805 | RET | Return. | ||
| Prev: 52190 | Up: Map | Next: 53806 |