Routines |
Prev: D2DE | Up: Map | Next: D47D |
Used by the routine at DemoEntryPoint.
|
|||||
The game always starts with the cursor inside the home box.
This is position 02/ 02:
|
|||||
StartGame | D3F5 | LD A,$02 | Write 02 to: | ||
D3F7 | LD ($D54C),A | ||||
D3FA | LD ($D54D),A | ||||
D3FD | LD ($D54A),A | ||||
D400 | LD ($D54B),A | ||||
D403 | LD A,$09 | Write 09 to *D550. | |||
D405 | LD ($D550),A | ||||
D408 | LD HL,$D543 | HL=Lives. | |||
D40B | DEC (HL) | Decrease *HL by one. | |||
D40C | JP Z,StartGame_2 | Jump to StartGame_2 until *HL is equal to 00. | |||
D40F | LD HL,$D556 | HL=D556. | |||
D412 | LD (HL),$00 | Write 00 to *HL. | |||
D414 | CALL $EF3B | Call EF3B. | |||
D417 | LD HL,($D58E) | HL=*D58E. | |||
D41A | LD (HL),$2D | Write INK: CYAN, PAPER: CYAN to *HL. | |||
D41C | INC HL | Increment HL by one. | |||
D41D | LD (HL),$2D | Write INK: CYAN, PAPER: CYAN to *HL. | |||
D41F | INC HL | Increment HL by one. | |||
D420 | LD ($D58E),HL | Write HL to *D58E. | |||
D423 | LD DE,$001E | HL+=001E. | |||
D426 | ADD HL,DE | ||||
D427 | LD (HL),$2D | Write INK: CYAN, PAPER: CYAN to *HL. | |||
D429 | INC HL | Increment HL by one. | |||
D42A | LD (HL),$2D | Write INK: CYAN, PAPER: CYAN to *HL. | |||
D42C | LD HL,$D556 | HL=D556. | |||
D42F | SET 0,(HL) | Set bit 0 of *HL. | |||
This entry point is used by the routine at D2DE.
|
|||||
StartGame_0 | D431 | LD A,($D556) | A=*D556. | ||
D434 | AND %11110001 | Keep only bits 0, 4-7. | |||
D436 | LD ($D556),A | Write A to *D556. | |||
D439 | LD A,($D54C) | Write *D54C to *D548. | |||
D43C | LD ($D548),A | ||||
D43F | LD A,($D54D) | Write *D54Dto *D549. | |||
D442 | LD ($D549),A | ||||
D445 | LD A,($D540) | Write *D540to *D54E. | |||
D448 | LD ($D54E),A | ||||
D44B | LD A,($D551) | Jump to StartGame_1 if *D551 is not equal to 00. | |||
D44E | CP $00 | ||||
D450 | JR NZ,StartGame_1 | ||||
D452 | LD A,($D550) | Jump to StartGame_1 if *D550 is equal to 09. | |||
D455 | CP $09 | ||||
D457 | JR Z,StartGame_1 | ||||
D459 | CALL Display_PlayerCursor | Call Display_PlayerCursor. | |||
StartGame_1 | D45C | CALL $D789 | Call D789. | ||
D45F | JP $D2DE | Jump to D2DE. | |||
StartGame_2 | D462 | LD HL,$D555 | HL=D555. | ||
D465 | SET 7,(HL) | Set bit 7 of *HL. | |||
D467 | LD B,$4B | B=4B. | |||
StartGame_3 | D469 | HALT | Halt operation (suspend CPU until the next interrupt). | ||
D46A | DJNZ StartGame_3 | Decrease counter by one and loop back to StartGame_3 until counter is zero. | |||
D46C | DI | Disable interrupts. | |||
D46D | CALL $E901 | Call E901. | |||
D470 | LD BC,$0000 | BC=0000. | |||
StartGame_4 | D473 | DEC BC | Decrease BC by one. | ||
D474 | LD A,B | Jump to StartGame_4 until BC is equal to 00. | |||
D475 | OR C | ||||
D476 | JR NZ,StartGame_4 | ||||
D478 | POP IY | Restore IY from the stack. | |||
D47A | JP DemoEntryPoint_0 | Jump to DemoEntryPoint_0. |
Prev: D2DE | Up: Map | Next: D47D |