← 8EA6 Warp level-skip state Map 8ED3 → Initialize the score and game counters for a new game
8EA8: Reset the play state for a new game or level
Zeroes the three play-state RAM blocks, then re-arms the object pool to serve a ball.
On return every play flag, both ball state records and the brick state map read 0. The re-arm then sets ball A's speed and serve flag. The bat and ball are positioned for the current side.
clear_state_buffers 8EA8 LD HL,ball_a_x_accum Clear both ball state records and every per-frame play-state flag before the pool is re-armed below.
8EAB LD DE,ball_a_y_accum
8EAE LD BC,$00A2
8EB1 LD (HL),$00
8EB3 LDIR
8EB5 LD HL,brick_state_map Clear the brick state map: a new level starts with every slot settled and no break animation in progress. The fill covers the map and the byte after it, the first entry of the durability-class table. The image already holds that entry clear, so the class table survives unchanged.
8EB8 LD DE,brick_state_map+$1
8EBB LD BC,$00A2
8EBE LD (HL),$00
8EC0 LDIR
8EC2 LD HL,obj2_record Clear the logic records for the secondary object and the five inhabitants so none is active when the pool is re-armed below. The fill covers the six records and the byte after them, the first entry of the steer table, which it clears. The wall-avoid probe reads that entry, and nothing restores it.
8EC5 LD DE,obj2_record+$1
8EC8 LD BC,$0060
8ECB LD (HL),$00
8ECD LDIR
8ECF CALL rearm_serve
8ED2 RET
← 8EA6 Warp level-skip state Map 8ED3 → Initialize the score and game counters for a new game
Fork me on GitHub