![]() |
Routines |
| Prev: 54098 | Up: Map | Next: 54486 |
|
Used by the routine at Game_Loop.
|
|||||
|
The game always starts with the cursor inside the home box.
This is position 2/ 2:
|
|||||
| StartGame | 54377 | LD A,2 | Write 2 to: | ||
| 54379 | LD (55344),A | ||||
| 54382 | LD (55345),A | ||||
| 54385 | LD (55342),A | ||||
| 54388 | LD (55343),A | ||||
|
Tile 9 is the home box:
Set the players starting tile.
|
|||||
| 54391 | LD A,9 | Write 9 to *PlayerCursor_TileID. | |||
| 54393 | LD (55348),A | ||||
|
Spend a life to play the game.
|
|||||
| 54396 | LD HL,55335 | HL=Lives. | |||
| 54399 | DEC (HL) | Decrease *HL by one. | |||
| 54400 | JP Z,GameOver | Jump to GameOver if the player is out of lives. | |||
| 54403 | LD HL,55354 | Write 0 to *Time. | |||
| 54406 | LD (HL),0 | ||||
| 54408 | CALL Draw_TimeBar | Call Draw_TimeBar. | |||
|
The life icons are static, drawn from Data_PlayareaSurround, in order to display the correct number of lives - we paint them to be the same PAPER/ INK colour as their background.
|
|||||
| 54411 | LD HL,(55410) | HL=*LifeIcons_ScreenPosition. | |||
|
First; hide the top part of the icon.
|
|||||
| 54414 | LD (HL),45 | Write INK: CYAN, PAPER: CYAN to *HL. | |||
| 54416 | INC HL | Increment HL by one. | |||
| 54417 | LD (HL),45 | Write INK: CYAN, PAPER: CYAN to *HL. | |||
| 54419 | INC HL | Increment HL by one. | |||
| 54420 | LD (55410),HL | Update the icon position marker at *LifeIcons_ScreenPosition. | |||
|
Move down one line, and left two character blocks.
|
|||||
| 54423 | LD DE,30 | HL+=0030. | |||
| 54426 | ADD HL,DE | ||||
|
Lastly; colour the bottom part of the icon.
|
|||||
| 54427 | LD (HL),45 | Write INK: CYAN, PAPER: CYAN to *HL. | |||
| 54429 | INC HL | Increment HL by one. | |||
| 54430 | LD (HL),45 | Write INK: CYAN, PAPER: CYAN to *HL. | |||
| 54432 | LD HL,55354 | HL=Time. | |||
| 54435 | SET 0,(HL) | Set bit 0 of *HL. | |||
|
This entry point is used by the routine at 54098.
|
|||||
| StartGame_0 | 54437 | LD A,(55354) | A=*Time. | ||
| 54440 | AND %11110001 | Keep only bits 0, 4-7. | |||
| 54442 | LD (55354),A | Write A to *Time. | |||
| 54445 | LD A,(55344) | Write *StorageCursor_Y_Position to *DestinationCursor_Y_Position. | |||
| 54448 | LD (55340),A | ||||
| 54451 | LD A,(55345) | Write *StorageCursor_X_Position to *DestinationCursor_X_Position. | |||
| 54454 | LD (55341),A | ||||
| 54457 | LD A,(55332) | Write *Timer_Crack_13 to *55346. | |||
| 54460 | LD (55346),A | ||||
| 54463 | LD A,(55349) | Jump to StartGame_1 if *PlayerCursor_Flag is not equal to 0. | |||
| 54466 | CP 0 | ||||
| 54468 | JR NZ,StartGame_1 | ||||
| 54470 | LD A,(55348) | Jump to StartGame_1 if *PlayerCursor_TileID is equal to 9. | |||
| 54473 | CP 9 | ||||
| 54475 | JR Z,StartGame_1 | ||||
| 54477 | CALL Display_PlayerCursor | Call Display_PlayerCursor. | |||
| StartGame_1 | 54480 | CALL Handler_IsLevelComplete | Call Handler_IsLevelComplete. | ||
| 54483 | JP 54098 | Jump to 54098. | |||
| Prev: 54098 | Up: Map | Next: 54486 |