![]() |
Routines |
| Prev: 71BE | Up: Map | Next: 7249 |
|
Used by the routine at SpawnBonusItem.
Updates the bonus item. It sits in a cubby hole and flashes, and when Robbie touches it the cubby hole is changed (see Robbie_EmptyHanded_Pickup) and so the bonus item is collected by CollectBonusItem. It goes back to the start of the main loop at MainLoop_NewPass.
|
||||
| UpdateBonusItem | 721A | LD IX,$5E3C | IX=State_BonusItem. | |
| 721E | CALL StoreEntity | Remember the position and state using StoreEntity. | ||
| 7221 | LD C,(IX+$05) | C=the cubby hole number from IX+05. | ||
| 7224 | LD B,$00 | B=00. | ||
| 7226 | LD HL,$5E23 | HL=CubbyHoles. | ||
| 7229 | ADD HL,BC | Add the cubby hole number. | ||
| 722A | LD A,(HL) | A=the contents of the cubby hole. | ||
| 722B | CP (IX+$04) | Compare it with IX+04. | ||
| 722E | JR NZ,CollectBonusItem | Jump to CollectBonusItem if it has changed. | ||
| 7230 | CALL DisplayEntity | Erase the sprite at the previous position and draw it at the new position using DisplayEntity. | ||
| 7233 | CALL ColouriseSprite | Colour the sprite using ColouriseSprite. | ||
| 7236 | LD A,($5E17) | A=the game timer from GameTimer. | ||
| 7239 | AND %00000011 | Keep only bits 0-1 (every fourth update). | ||
| 723B | JP NZ,MainLoop_NewPass | Jump to MainLoop_NewPass unless the result is zero. | ||
| 723E | LD A,(IX+$03) | A=the colour of the bonus item. | ||
| 7241 | XOR %00000100 | Flip bit 2 (so the item flashes). | ||
| 7243 | LD (IX+$03),A | Write it back to the colour of the bonus item. | ||
| 7246 | JP MainLoop_NewPass | Jump to MainLoop_NewPass. | ||
| Prev: 71BE | Up: Map | Next: 7249 |