![]() |
Routines |
| D | y-coordinate of location to check |
| E | 128 + x-coordinate of location to check |
| H | 170 (BOY WANDER's pellet) or 171 (ERIC's pellet) |
| 28143 | LD A,(32746) | 32746 holds the shield status |
| 28146 | RRCA | Are the shields hittable at the moment? |
| 28147 | RET NC | Return if not (ERIC's looking for the safe combination) |
| 28148 | RRCA | Now bit 7 of C is reset if we're in "flash the shields" mode, or set if in "unflash the shields" mode |
| 28149 | LD C,A | |
| 28150 | LD B,10 | 100 points for hitting a shield on the top floor |
| 28152 | LD A,D | A=y-coordinate of potential target |
| 28153 | CP 154 | 154=y-coordinate of shields on top floor |
| 28155 | JR Z,28171 | Jump if the pellet is here |
| 28157 | CP 160 | 160=y-coordinate of shields on middle floor |
| 28159 | LD B,20 | 200 points for hitting a shield on the middle floor |
| 28161 | JR Z,28171 | Jump to check shields on middle floor |
| 28163 | LD B,40 | 400 points for hitting a shield on the bottom floor |
| 28165 | CP 166 | 166=y-coordinate of shields on bottom floor |
| 28167 | JR Z,28171 | Jump to check shields on bottom floor |
| 28169 | AND A | Reset carry flag to indicate no shield was hit |
| 28170 | RET |
| 28171 | CALL 62674 | Is the pellet's potential target on-screen? |
| 28174 | CCF | |
| 28175 | RET NC | Return with the carry flag reset if not |
| 28176 | LD A,(DE) | A=attribute of the potential target |
| 28177 | AND 56 | Return if the potential target is drawn in black paper or black ink (which is true only if it's not a shield) |
| 28179 | RET Z | |
| 28180 | LD A,(DE) | |
| 28181 | AND 7 | |
| 28183 | RET Z | |
| 28184 | LD A,(DE) | A=attribute of the shield |
| 28185 | XOR C | Check whether we should be make the shields flash or not flash, and return unless the flash status of the shield should be toggled |
| 28186 | RLCA | |
| 28187 | RET C | |
| 28188 | LD A,(DE) | A=attribute of the shield |
| 28189 | XOR 128 | Toggle the FLASH status of the shield |
| 28191 | LD (DE),A | Insert the new attribute byte into the skool graphic data |
| 28192 | LD (HL),A | Apply the new attribute on-screen |
| 28193 | LD A,B | A=10 (top floor), 20 (middle) or 40 (bottom) |
| 28194 | CALL 27389 | Add 100, 200 or 400 to the score and print it |
| 28197 | CALL 58604 | Play the 'hit a shield' sound effect |
| 28200 | LD HL,32747 | 32747=shield counter |
| 28203 | DEC (HL) | One more shield hit |
| 28204 | SCF | Set the carry flag to indicate that a shield was hit |
| 28205 | RET NZ | Return unless the last shield was hit |
| 28206 | CALL 63668 | All the shields have been hit; take appropriate action |
| 28209 | SCF | Set the carry flag to indicate that a shield was hit |
| 28210 | RET |