Prev: BA2E Up: Map Next: BA8D
BA4D: The next box, the next part, or done
Used by the routines at hit_block and hit_slope.
The loop's tail: after a bounce (bit 6 of piece_ceiling) the test ends; otherwise the next box, then the next part (next_part_boxes), until ground_cell, the parts left, is 0. When the ship has gone through all of them without stopping, ship_on_slope is cleared. The last part is where a test stops early: a shot stops at its first hit; the ship and the objects stop at a bounce, a slope or a block -- except an object once the ship has docked with the rocket or is dying (death_count 10 or more), which goes on to the other boxes.
next_box BA4D LD A,(piece_ceiling) a bounce: stop
BA50 BIT 6,A
BA52 JR NZ,next_box_2
next_box_0 BA54 POP IX the next box
BA56 LD DE,$0005
BA59 ADD IX,DE
BA5B EX AF,AF'
BA5C DEC A
BA5D JR NZ,next_part_boxes_1
This entry point is used by the routine at next_part_boxes.
next_box_1 BA5F LD A,(ground_cell) the next part
BA62 DEC A
BA63 LD (ground_cell),A
BA66 JP NZ,next_part_boxes
BA69 LD IX,(collision_object) all done; IX back; the ship: not on a slope
BA6D LD A,(piece_step_x)
BA70 INC A
BA71 RET NZ
BA72 LD (ship_on_slope),A
BA75 RET
This entry point is used by the routines at hit_block, hit_slope and ship_on_slope_response.
next_box_2 BA76 LD A,(death_count) stop, unless an object after docking or during a death
BA79 CP $0A
BA7B JR C,next_box_3
BA7D LD A,(piece_step_x)
BA80 AND A
BA81 JR NZ,next_box_3
BA83 JP next_box_0
next_box_3 BA86 POP IX IX back
BA88 LD IX,(collision_object)
BA8C RET
Prev: BA2E Up: Map Next: BA8D