From fe2e5f3959e9ce0c2b996a49e1b057187c7d7550 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 16 Aug 2019 13:53:37 -0400 Subject: [PATCH] ootw: can now shoot while crouching --- ootw/blast.s | 10 ++++++++++ ootw/gun.s | 15 +++++++++++---- ootw/keyboard.s | 2 +- ootw/laser.s | 8 ++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/ootw/blast.s b/ootw/blast.s index 86dd64ea..e7f0629b 100644 --- a/ootw/blast.s +++ b/ootw/blast.s @@ -37,6 +37,16 @@ fire_blast: lda PHYSICIST_Y clc adc #4 + + ldx PHYSICIST_STATE + cpx #P_CROUCH_SHOOTING + bne blast_ypos_done + +blast_crouch: + clc + adc #4 +blast_ypos_done: + sta blast0_y ; set direction diff --git a/ootw/gun.s b/ootw/gun.s index 596dfa03..38b8a304 100644 --- a/ootw/gun.s +++ b/ootw/gun.s @@ -11,9 +11,9 @@ handle_gun: ;=================== - ; ??? + ; check_gun_firing ;=================== - jsr handle_gun2 + jsr check_gun_firing ;======================= ; draw gun charge effect @@ -54,7 +54,13 @@ handle_gun: ; rts -handle_gun2: + ;==================== + ;==================== + ; check gun firing + ;==================== + ;==================== + +check_gun_firing: lda HAVE_GUN ; no gun, do nothing beq no_have_gun @@ -168,7 +174,8 @@ done_zap: ldy PHYSICIST_STATE cpy #P_CROUCH_SHOOTING bne done_zap_ypos - adc #2 + clc + adc #4 done_zap_ypos: sta YPOS diff --git a/ootw/keyboard.s b/ootw/keyboard.s index 801e6898..c7e0ca2c 100644 --- a/ootw/keyboard.s +++ b/ootw/keyboard.s @@ -319,7 +319,7 @@ not_already_firing: lda PHYSICIST_STATE and #STATE_CROUCHING - bne crouch_charge + beq crouch_charge ldy #P_CROUCH_SHOOTING bne crouch_charge_go ; bra crouch_charge: diff --git a/ootw/laser.s b/ootw/laser.s index bee5d510..4294ded6 100644 --- a/ootw/laser.s +++ b/ootw/laser.s @@ -43,6 +43,14 @@ fire_laser: lda PHYSICIST_Y clc adc #4 + + ldx PHYSICIST_STATE + cpx #P_CROUCH_SHOOTING + bne laser_crouch_done +laser_crouch: + clc + adc #4 +laser_crouch_done: sta laser0_y ; set direction