Prev: 7290 Up: Map Next: 72E6
7296: Tank operation routine
Operates tanks on the river. Tanks move 2 pixels per frame and signal their center position ($80) to suppress the bank tank shell. Tanks on the river bank are handled separately via operate_tank_on_bank.
  • Skips processing every other frame (tick check)
  • Tanks on bank (bit 5 set) handled via operate_tank_on_bank
  • River tanks move left/right, set TANK_SHELL_ACTIVE at X=$80
  • Uses XOR blending mode for rendering
Input
B Y position
C X position
D Object definition byte
operate_tank 7296 LD A,($5EEF) Skip if odd tick (tanks move on even ticks).
7299 AND $01
729B CP $01
729D JP Z,operate_viewport_slots Store position, check bank bit, handle terrain check.
72A0 LD ($8B0A),BC
72A4 PUSH DE
72A5 PUSH BC
72A6 BIT 5,D If SLOT_BIT_TANK_ON_BANK set, handle via operate_tank_on_bank.
72A8 JP NZ,operate_tank_on_bank
72AB POP BC Pop regs. If state_bridge_destroyed != 0, jump to handle_tank_at_boundary.
72AC POP DE
72AD LD A,($5F6D)
72B0 CP $00
72B2 JP NZ,handle_tank_at_boundary
This entry point is used by the routine at operate_tank_on_bank.
tank_move_entry 72B5 DEC C Move tank: DEC C twice (left), then INC C × 4 if right-facing.
72B6 DEC C
72B7 BIT 6,D
72B9 CALL Z,tank_advance_right
72BC LD A,C If X == $80 (center), signal road tank at center via set_tank_shell_active.
72BD CP $80
72BF CALL Z,set_tank_shell_active
72C2 LD HL,($5F60) Update position in viewport array, store to object_coordinates, get sprite pointer.
72C5 DEC HL
72C6 LD D,(HL)
72C7 DEC HL
72C8 LD (HL),B
72C9 DEC HL
72CA LD (HL),C
72CB LD ($8B0C),BC
72CF CALL ld_enemy_sprites
72D2 LD BC,$0018 Set frame size=$18, enable XOR blending via blending_mode_xor_xor.
72D5 CALL blending_mode_xor_xor
72D8 LD A,$03 Render sprite: width=3, height=8, attributes=$00. Restore blending.
72DA LD DE,$0800
72DD CALL render_sprite
72E0 CALL blending_mode_or_or
72E3 JP operate_viewport_slots
Prev: 7290 Up: Map Next: 72E6