snes: another step closer to moving enemies

This commit is contained in:
Vince Weaver 2013-02-05 23:31:53 -05:00
parent b99f48b7d5
commit a6a8904c1c
2 changed files with 11 additions and 16 deletions

View File

@ -1,2 +1,2 @@
.word $190 ; Complement of checksum
.word $fe6f ; Unsigned 16-bit sum of ROM
.word $f93f ; Complement of checksum
.word $6c0 ; Unsigned 16-bit sum of ROM

View File

@ -1068,17 +1068,13 @@ move_enemies:
; Move Enemies! (first thing, if no new added)
;==============================================
; ldy #$0 ; point to enemies[0]
ldy #$20 ; point to enemies[0]
handle_enemies:
; tya
; pha ; store y on stack
; lda (ENEMY_PL),Y ; get enemy[y].out
; bne load_enemy_zero_page ; if enemy.out then we are good
; jmp skip_to_next_enemy ; enemy is not out, so skip to next
jsr is_sprite_active ; set if enemy[y].out
bcs load_enemy_zero_page ; if enemy.out then we are good
jmp skip_to_next_enemy ; enemy is not out, so skip to next
;==========================================
@ -1452,13 +1448,12 @@ save_from_zero_page:
skip_to_next_enemy:
; pla ; get saved value of Y
; clc
; adc #$9 ; add 9 to point to next
; tay
; cpy #NUM_ENEMIES*9 ; have we looped through them all?
; beq draw_the_boss ; if not, loop
; jmp handle_enemies
iny
cpy #($20+NUM_ENEMIES) ; have we looped through them all?
beq draw_the_boss ; if not, loop
jmp handle_enemies
;===================================================