From ea53b9f1370fe486bdbf49168d545e17d077c8bf Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 14 Aug 2019 09:45:13 -0400 Subject: [PATCH] ootw: c4: action sequence hooked up --- ootw/ootw_c4_action.s | 25 +++++++++++-- ootw/ootw_c4_city.s | 81 +++++++++++++++++-------------------------- ootw/zp.inc | 2 ++ 3 files changed, 55 insertions(+), 53 deletions(-) diff --git a/ootw/ootw_c4_action.s b/ootw/ootw_c4_action.s index 8f920497..8817c923 100644 --- a/ootw/ootw_c4_action.s +++ b/ootw/ootw_c4_action.s @@ -7,14 +7,33 @@ ; action sequence ;================= ;================= +; A has the sequence step+1 action_sequence: + tax ; it's actually one higher + dex + + lda FRAMEL ; slow it down a bit + and #$3 + bne not_done_action + + inc ACTION_COUNT + lda ACTION_COUNT + cmp #69 + bne not_done_action + + lda #0 + sta ACTION_COUNT + + rts + +not_done_action: ; draw both lines in the hlin lda #$00 sta hlin_mask_smc+1 - ldx #65 +; ldx #65 lda action_list_lo,x sta ac_jump lda action_list_hi,x @@ -868,7 +887,7 @@ action_frame59: ldy #28 jsr action_draw_alien2 - ldx #254 + ldx #250 ldy #24 jmp action_draw_alien1 @@ -933,7 +952,7 @@ action_frame63: ; frame64: (125) ; alien_eye@28,30 (-12,-4) action_frame64: - ldx #26 + ldx #16 ldy #26 jmp action_draw_alien1 diff --git a/ootw/ootw_c4_city.s b/ootw/ootw_c4_city.s index f53413f5..e936077b 100644 --- a/ootw/ootw_c4_city.s +++ b/ootw/ootw_c4_city.s @@ -14,6 +14,14 @@ ootw_city_init: sta LASER_OUT sta ALIEN_OUT + sta ACTION_TRIGGERED + sta ACTION_COUNT + +; lda #1 +; sta ACTION_COUNT + + + ;=============== ; set up aliens @@ -94,6 +102,10 @@ alien_room_continue: cpx #MAX_ALIENS bne alien_room_loop + lda #0 + sta FRAMEL ; reset frame count for action timer + sta FRAMEH + ;============================== ; setup per-room variables @@ -672,63 +684,32 @@ c4_room4_cover: c4_no_fg_cover: + ;======================== + ; handle cinematic action + ;======================== -;c2_draw_doorway: -; -; lda CART_X -; sta XPOS -; lda #36 -; sta YPOS -; lda #cart_sprite -; sta INH -; jsr put_sprite_crop -; jmp c2_no_fg_action + lda WHICH_ROOM ; only on causeway1 + cmp #2 + bne no_action_movie -c4_no_fg_action: + lda FRAMEH + cmp #1 + bne action_no_trigger - ;==================== - ; activate fg objects - ;==================== -;c2_fg_check_jail1: -; lda WHICH_JAIL -; cmp #1 -; bne c2_fg_check_jail2 -; -; lda CART_OUT -; bne c2_fg_check_jail2 -; -; inc CART_OUT + lda ACTION_TRIGGERED ; already triggered + bne action_no_trigger +action_trigger: + lda #1 + sta ACTION_COUNT + sta ACTION_TRIGGERED +action_no_trigger: - ;================ - ; move fg objects - ;================ -c4_move_fg_objects: - -; lda CART_OUT -; cmp #1 -; bne cart_not_out - - ; move cart - -; lda FRAMEL -; and #$3 -; bne cart_not_out -; -; inc CART_X -; lda CART_X -; cmp #39 -; bne cart_not_out -; inc CART_OUT - - - ;=============== - ; make pink (where applicable) - ;=============== + lda ACTION_COUNT + beq no_action_movie jsr action_sequence +no_action_movie: ;=============== ; page flip diff --git a/ootw/zp.inc b/ootw/zp.inc index bf0480ff..3db5c6d1 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -125,8 +125,10 @@ LASER_OUT = $DB ; 2+ GUN_CHARGE = $DC ; 2+ MONSTER_AI = $DD ; C1 underwater +ACTION_COUNT = $DD ; C4 BG_BEAST = $DE ; C1 +ACTION_TRIGGERED= $DE ; C4 ON_ELEVATOR = $DF ; ALL