From f25d152e20758efd4538316cc6fbfb34b7657ada Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 20 Jan 2019 01:54:58 -0500 Subject: [PATCH] ootw: have earthquake/boulders happen in rope room --- ootw/earthquake.s | 29 +++++++++++++++++++++++++++++ ootw/ootw_cavern.s | 22 +--------------------- ootw/ootw_rope.s | 20 +++++++++++++++++--- 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/ootw/earthquake.s b/ootw/earthquake.s index 936bce1e..047910b5 100644 --- a/ootw/earthquake.s +++ b/ootw/earthquake.s @@ -60,3 +60,32 @@ done_shake: rts + + ;====================== + ; draw falling boulders +draw_boulder: + lda BOULDER_Y + cmp #38 + bpl no_boulder + + lda #boulder + sta INH + + lda BOULDER_X + sta XPOS + lda BOULDER_Y + sta YPOS + jsr put_sprite + + lda FRAMEL + and #$3 + bne no_boulder + inc BOULDER_Y + inc BOULDER_Y + +no_boulder: + + rts + diff --git a/ootw/ootw_cavern.s b/ootw/ootw_cavern.s index 9a2bbed8..d4bbf0d4 100644 --- a/ootw/ootw_cavern.s +++ b/ootw/ootw_cavern.s @@ -189,28 +189,8 @@ just_slugs: ;====================== ; draw falling boulders - lda BOULDER_Y - cmp #38 - bpl no_boulder + jsr draw_boulder - lda #boulder - sta INH - - lda BOULDER_X - sta XPOS - lda BOULDER_Y - sta YPOS - jsr put_sprite - - lda FRAMEL - and #$3 - bne no_boulder - inc BOULDER_Y - inc BOULDER_Y - -no_boulder: ;======================= ; page flip diff --git a/ootw/ootw_rope.s b/ootw/ootw_rope.s index b2ffe0fc..5bee6157 100644 --- a/ootw/ootw_rope.s +++ b/ootw/ootw_rope.s @@ -38,8 +38,13 @@ ootw_rope: sta GBASL jsr load_rle_gr + ;================================ + ; Load quake background to $1000 + + jsr gr_make_quake + ;================================= - ; copy to both pages $400/$800 + ; copy $c00 to both pages $400/$800 jsr gr_copy_to_current jsr page_flip @@ -59,9 +64,9 @@ ootw_rope: rope_loop: ;================================ - ; copy background to current page + ; handle earthquakes - jsr gr_copy_to_current + jsr earthquake_handler ;=============================== @@ -87,10 +92,18 @@ rope_loop: lda #30 sta XPOS lda #30 + sec + sbc EARTH_OFFSET sta YPOS jsr put_sprite + ;================ + ; draw falling boulder + + jsr draw_boulder + + ;=============== ; page flip @@ -119,6 +132,7 @@ rope_frame_no_oflo: lda #0 sta PHYSICIST_X + sta EARTH_OFFSET jmp ootw_pool