Routines |
Prev: 52002 | Up: Map | Next: 52069 |
Used by the routine at 45355.
|
||||
Handler_Time | 52032 | LD HL,49778 | HL=Time_Remaining. | |
Fetch the small unit of time (e.g. for "250" this is "50").
|
||||
52035 | LD A,(HL) | A=*HL. | ||
Take off one unit of time (see Infinite Time).
|
||||
52036 | SUB 1 | A-=1 with BCD conversion. | ||
52038 | DAA | |||
52039 | LD (HL),A | Write A to *HL. | ||
52040 | RET NC | Return if A is higher than 0. | ||
We've ticked over the small unit, so move onto the larger unit.
|
||||
52041 | INC HL | Increment HL by one. | ||
Fetch the large unit of time (e.g. for "250" this is "2").
|
||||
52042 | LD A,(HL) | A=*HL. | ||
Take off one unit of time.
|
||||
52043 | SUB 1 | A-=1 with BCD conversion. | ||
52045 | DAA | |||
52046 | LD (HL),A | Write A to *HL. | ||
52047 | JR NZ,Handler_Time_Up | Jump to Handler_Time_Up if A is not zero. | ||
Flash the bonus/ time countdown when the large unit is zero.
|
||||
52049 | LD HL,22587 | HL=22587 (attribute buffer address for the bonus/ time counter). | ||
52052 | LD B,4 | B=4 (counter). | ||
Handler_Time_Flash | 52054 | SET 7,(HL) | Set bit 7 (the flash bit) of *HL. | |
52056 | INC L | Increment L by one. | ||
52057 | DJNZ Handler_Time_Flash | Decrease counter by one and loop back to Handler_Time_Flash until counter is zero. | ||
52059 | RET | Return. | ||
Is there any time left?
|
||||
Handler_Time_Up | 52060 | RET NC | Return if A is higher than 0 (if there is still time left). | |
There's no time left, signify the game is over.
|
||||
52061 | POP HL | Clear the stack. | ||
52062 | POP HL | |||
52063 | LD HL,45064 | HL=45064. | ||
52066 | SET 2,(HL) | Set bit 2 of *HL. | ||
52068 | RET | Return. |
Prev: 52002 | Up: Map | Next: 52069 |