| Gyruss | Routines |
| Prev: 8A53 | Up: Map | Next: 8AC0 |
|
Used by the routines at handle_sprite_types_0E_11, create_enemy_shot_and_move and update_sprite_path.
|
||||
| maybe_create_enemy_shot | 8A76 | LD A,(countdown_to_shoot) | Is countdown zero? | |
| 8A79 | OR A | ... | ||
| 8A7A | RET NZ | Return if not | ||
| 8A7B | LD A,(active_enemy_shots) | Get enemy shots | ||
| 8A7E | CP $07 | Return if >= 7 | ||
| 8A80 | RET NC | ... | ||
| 8A81 | LD A,(status_flags) | Flags | ||
| 8A84 | AND $0C | Is chance stage or died? | ||
| 8A86 | RET NZ | Then return | ||
| 8A87 | CALL stage_data_addr | Get stage data address in IY | ||
| 8A8A | LD A,(active_enemy_shots) | Get enemy shots | ||
| 8A8D | CP (IY+$01) | Compare with stage data byte 1 | ||
| 8A90 | RET NC | Return if shots >= max shots | ||
| 8A91 | LD A,($7004) | Ship polar x | ||
| 8A94 | CP (IX+$02) | Compare with sprite polar x | ||
| 8A97 | RET NZ | Return if not equal | ||
| 8A98 | LD A,(IY+$02) | Reset countdown | ||
| 8A9B | LD (countdown_to_shoot),A | ... | ||
| 8A9E | LD HL,active_enemy_shots | Increment enemy shots | ||
| 8AA1 | INC (HL) | ... | ||
| 8AA2 | PUSH IX | Save enemy sprite address | ||
| 8AA4 | RST $28 | Allocate sprite | ||
| 8AA5 | POP IY | Now IY = enemy sprite and IX = shot | ||
| 8AA7 | PUSH IY | Save enemy sprite | ||
| 8AA9 | LD A,(IY+$01) | Set polar y of shot to polar x of enemy | ||
| 8AAC | LD (IX+$01),A | ... | ||
| 8AAF | LD A,(IY+$02) | Set polar x of shot to polar x of enemy | ||
| 8AB2 | LD (IX+$02),A | ... | ||
| 8AB5 | LD (IX+$00),$12 | Set sprite type | ||
| 8AB9 | LD (IX+$0B),$0A | Set color | ||
| 8ABD | POP IX | Restore enemy sprite | ||
| 8ABF | RET | |||
| Prev: 8A53 | Up: Map | Next: 8AC0 |