Prev: 8E25 Up: Map Next: 8E89
8E2D: Create or display mines
Used by the routines at main_loop, died and explode.
create_or_display_mines 8E2D LD A,(status_flags) Get flags
8E30 BIT 1,A If all waves completed bit is not set
8E32 JR Z,init_mine_variables Then init variables and return
8E34 LD A,(mines_action) Get mines action (0-2)
8E37 CP $01 If 1
8E39 JP Z,create_mines Then create mines
8E3C JP NC,display_mines If 2 then display mines
8E3F LD A,(status_flags) If died
8E42 BIT 2,A ...
8E44 RET NZ Then return
8E45 LD A,(other_flags) If mines flag is set
8E48 BIT 2,A ...
8E4A RET NZ The return
8E4B LD A,(frame_counter) Frame counter
8E4E AND $0F If not every 16th frame
8E50 RET NZ Then return
8E51 LD HL,mines_time_left Get countdown
8E54 DEC (HL) Decrement it
8E55 RET NZ Return if not zero
8E56 LD A,(center_map_entries) Get center enemies
8E59 CP $03 If < 3
8E5B RET C Then return
8E5C LD A,(stage) Stage
8E5F SRL A Shift out stage within planet bits
8E61 SRL A ...
8E63 LD B,A B = planet
8E64 LD A,$05 A = 5
8E66 SUB B 5 - planet
8E67 JR C,create_or_display_mines_0 If planet > 5 then skip ahead and set to 2
8E69 CP $02 If 5 - planet >= 2 then skip ahead
8E6B JR NC,create_or_display_mines_1 ...
create_or_display_mines_0 8E6D LD A,$02 Set to 2
create_or_display_mines_1 8E6F LD HL,stage_death_count Number of times died within stage
8E72 CP (HL) Return if >= calculated value (2, 3, 4, 5)
8E73 RET C ...
8E74 LD A,(mines_reappear) If stored value is 2
8E77 CP $02 ...
8E79 RET Z Then return
8E7A INC A Else increment calculated value
8E7B LD (mines_reappear),A And store
8E7E LD HL,other_flags Set mines flag
8E81 SET 2,(HL) ...
8E83 LD A,$01 Set action to create mines
8E85 LD (mines_action),A ...
8E88 RET
Prev: 8E25 Up: Map Next: 8E89