| Prev: 74E4 | Up: Map | Next: 7546 |
74EE: Handle tank after bridge destruction
|
Called each frame when a road tank's bridge has been destroyed (state_bridge_destroyed != 0). Normal movement is skipped (no rendering), so the tank's sprite stays frozen on screen as a ghost image. This routine checks whether the tank's X position overlaps the river gap ($70-$90). If yes, the slot is cleared, 1 explosion fragment is spawned, and POINTS_TANK are awarded. If no overlap, the slot is either cleared (bridge <= 7) or converted to a bank-tank (bridge > 7); in the cleared case the ghost image persists on screen with no explosion.
|
||||
| handle_tank_at_boundary | 74EE | LD HL,($5F60) | Load current_slot_ptr, navigate to X position in current slot. | |
| 74F1 | DEC HL | |||
| 74F2 | DEC HL | |||
| 74F3 | DEC HL | |||
| 74F4 | LD C,(HL) | |||
| 74F5 | LD H,$00 | If X+10 <= $70 (112): tank is on the left bank, convert to bank-tank. | ||
| 74F7 | LD L,$70 | |||
| 74F9 | LD D,$00 | |||
| 74FB | LD A,C | |||
| 74FC | ADD A,$0A | |||
| 74FE | LD E,A | |||
| 74FF | OR A | |||
| 7500 | SBC HL,DE | |||
| 7502 | JP P,convert_tank_to_bank | |||
| 7505 | LD H,$00 | If X > $90 (144): tank is on the right bank, convert to bank-tank. | ||
| 7507 | LD L,$90 | |||
| 7509 | LD D,$00 | |||
| 750B | LD E,C | |||
| 750C | OR A | |||
| 750D | SBC HL,DE | |||
| 750F | JP M,convert_tank_to_bank | |||
| 7512 | LD HL,($5F60) | Tank destroyed: clear X position, set D=$80 (explosion marker). | ||
| 7515 | DEC HL | |||
| 7516 | DEC HL | |||
| 7517 | LD B,(HL) | Add explosion and award POINTS_TANK. | ||
| 7518 | DEC HL | |||
| 7519 | LD (HL),$00 | |||
| 751B | LD D,$80 | |||
| 751D | CALL spawn_explosion_fragment | |||
| 7520 | LD A,$25 | |||
| 7522 | CALL add_points | |||
| convert_tank_to_bank | 7525 | LD HL,($5F60) | Reload current_slot_ptr and convert to bank-tank (SLOT_BIT_ALT_SHELL_INIT + SLOT_BIT_TANK_ON_BANK). | |
| 7528 | DEC HL | |||
| 7529 | SET 4,(HL) | |||
| 752B | SET 5,(HL) | |||
| 752D | DEC HL | Check active player at state_player. If player 1, use state_bridge_player_1. | ||
| 752E | DEC HL | |||
| 752F | LD A,($923D) | |||
| 7532 | CP $01 | |||
| 7534 | JP Z,get_bridge_number_player_1 | Load bridge number from state_bridge_player_2. | ||
| 7537 | LD A,($5F6B) | |||
|
This entry point is used by the routine at get_bridge_number_player_1.
|
||||
| tank_bridge_check | 753A | LD B,A | Check if bridge_number > 7. | |
| 753B | LD A,$07 | |||
| 753D | SUB B | |||
| 753E | JP M,operate_viewport_slots | If so, keep the slot (bank-tank bits already set at convert_tank_to_bank). | ||
| 7541 | LD (HL),$00 | Otherwise, clear slot X byte (ghost image remains on screen). | ||
| 7543 | JP operate_viewport_slots | |||
| Prev: 74E4 | Up: Map | Next: 7546 |