![]() |
Routines |
Prev: 67A9 | Up: Map | Next: 67F6 |
Handler_Score | 67B6 | LD A,($66F3) | Jump to AddToScore if *Flag_ActiveDemoMode is not active. | |
67B9 | OR A | |||
67BA | JR Z,AddToScore | |||
Demo mode is active, so just reset the score.
|
||||
67BC | LD DE,$6528 | DE=ScoreBuffer. | ||
67BF | LD B,$00 | B=00. | ||
67C1 | JR Reset_ScoreBuffer | Jump to Reset_ScoreBuffer. | ||
AddToScore | 67C3 | LD HL,$6519 | Point HL at 6519 (the current score). | |
67C6 | LD DE,$652E | Point DE at 652E (the points to add). | ||
67C9 | LD B,$06 | Set a counter in B for 06 score digits. | ||
AddToScore_Loop | 67CB | LD A,(DE) | Fetch the points digit and add it to the corresponding score digit. | |
67CC | ADD A,(HL) | |||
67CD | SUB $30 | Convert the value from ASCII by subtracing 30. | ||
67CF | CP $3A | Jump to AddToScore_Store if A is less than 3A. | ||
67D1 | JR C,AddToScore_Store | |||
67D3 | SUB $0A | A-=0A. | ||
67D5 | DEC HL | Decrease HL by one. | ||
67D6 | INC (HL) | Increment *HL by one. | ||
67D7 | INC HL | Increment HL by one. | ||
AddToScore_Store | 67D8 | LD (HL),A | Write A to *HL. | |
67D9 | DEC DE | Decrease DE by one. | ||
67DA | DEC HL | Decrease HL by one. | ||
67DB | DJNZ AddToScore_Loop | Decrease counter by one and loop back to AddToScore_Loop until counter is zero. | ||
Reset_ScoreBuffer | 67DD | PUSH DE | Copy the score buffer pointer to HL (using the stack). | |
67DE | POP HL | |||
67DF | INC DE | Increment the score buffer destination pointer by one. | ||
67E0 | LD C,$06 | Set a counter in C for 06 score digits. | ||
67E2 | LD (HL),$30 | Write 30 ("0") to the score buffer. | ||
67E4 | LDIR | Copy 30 ("0") across the remaining five score buffer digits. | ||
Check if the score is at least "10,000".
|
||||
67E6 | LD A,($6515) | Return if *6515 is not equal to 31 ("1"). | ||
67E9 | CP $31 | |||
67EB | RET NZ | |||
67EC | LD HL,$66EF | Return if Flag_ExtraLife says that no extra life should be awarded. | ||
67EF | LD A,(HL) | |||
67F0 | OR A | |||
67F1 | RET Z | |||
Award an extra life to the player.
|
||||
67F2 | DEC (HL) | Reset Flag_ExtraLife as an extra life has been "awarded". | ||
67F3 | INC HL | Move to the lives counter at Player_Lives. | ||
67F4 | INC (HL) | Award one extra life. | ||
67F5 | RET | Return. |
Prev: 67A9 | Up: Map | Next: 67F6 |