Prev: 7302 Up: Map Next: 7358
7343: Initialize tank shell state
Sets up shell with orientation from tank and pseudo-random speed from interrupt counter.
Input
D Object definition byte (bit 6 = orientation)
Output
A Shell state with orientation and speed bits
init_tank_shell_state 7343 BIT 4,D If SLOT_BIT_ALT_SHELL_INIT is set, use alternate initialization via check_shell_init_condition.
7345 JP NZ,check_shell_init_condition
7348 LD A,D Copy orientation bit from object definition to shell state.
7349 AND $40
734B LD D,A
734C LD A,($5C78) Derive speed from interrupt counter (pseudo-random 1-4).
734F AND $03
7351 LD E,A Store in E, load D into A.
7352 LD A,D
7353 INC E Ensure speed >= 1, combine with orientation, continue to fire shell.
7354 ADD A,E
7355 JP tank_fire_shell_entry
Prev: 7302 Up: Map Next: 7358