From 4acb1d16c8c2c1cb16f49e3939bd816e1cdfdd16 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 6 Feb 2013 01:18:55 -0500 Subject: [PATCH] snes: better enemy movement --- tb1_snes/checksum.inc | 4 ++-- tb1_snes/level_1.s | 31 +++++++++++++------------------ 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/tb1_snes/checksum.inc b/tb1_snes/checksum.inc index 524c4b1..5c63b88 100644 --- a/tb1_snes/checksum.inc +++ b/tb1_snes/checksum.inc @@ -1,2 +1,2 @@ - .word $e6b2 ; Complement of checksum - .word $194d ; Unsigned 16-bit sum of ROM + .word $d328 ; Complement of checksum + .word $2cd7 ; Unsigned 16-bit sum of ROM diff --git a/tb1_snes/level_1.s b/tb1_snes/level_1.s index e8266c8..7f395dc 100644 --- a/tb1_snes/level_1.s +++ b/tb1_snes/level_1.s @@ -1110,11 +1110,11 @@ move_enemy_x: lsr A -; cmp ENEMY_XMIN ; are we less than xmin? -; bmi switch_dir_enemy_x ; if so, switch direction + cmp ENEMY_XMIN ; are we less than xmin? + bmi switch_dir_enemy_x ; if so, switch direction -; cmp ENEMY_XMAX ; are we greater than xmax? -; bpl switch_dir_enemy_x ; if so, switch direction + cmp ENEMY_XMAX ; are we greater than xmax? + bpl switch_dir_enemy_x ; if so, switch direction jmp move_enemy_y @@ -1164,26 +1164,21 @@ no_y_special_case: lsr A lsr A -; cmp #$12 ; is y<=12? -; bmi done_enemy_y ; if so no need to do anything -; beq done_enemy_y + cmp #50 ; is y<=12? + bmi done_enemy_y ; if so no need to do anything + beq done_enemy_y ; off screen -; pla ; pop saved Y off stack -; tay -; pha ; push y back on stack + jsr deactivate_sprite ; set enemy[i].out=0 -; lda #$0 -; sta (ENEMY_PL),Y ; set enemy[i].out=0 + dec TOTAL_ENEMIES_OUT -; dec TOTAL_ENEMIES_OUT + lda BONUS_FLAGS + and #<(~PERFECT_KILLS) + sta BONUS_FLAGS -; lda BONUS_FLAGS -; and #<(~PERFECT_KILLS) -; sta BONUS_FLAGS - -; jmp skip_to_next_enemy ; skip to next enemy + jmp skip_to_next_enemy ; skip to next enemy done_enemy_y: