From e55c0301765bf06b83cf7ed1696be1861702eafc Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 20 Jan 2019 01:02:41 -0500 Subject: [PATCH] ootw: start making cave engine more generic --- ootw/ootw.s | 1 + ootw/ootw_cavern.s | 22 +++++++++++++++++----- ootw/zp.inc | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ootw/ootw.s b/ootw/ootw.s index 3c72cb49..a7e904a4 100644 --- a/ootw/ootw.s +++ b/ootw/ootw.s @@ -16,6 +16,7 @@ ootw: sta EARTH_OFFSET sta KICKING sta CROUCHING + sta WHICH_CAVE lda #22 sta PHYSICIST_Y diff --git a/ootw/ootw_cavern.s b/ootw/ootw_cavern.s index 5be5f4d9..95995ec1 100644 --- a/ootw/ootw_cavern.s +++ b/ootw/ootw_cavern.s @@ -1,4 +1,4 @@ -; Cavern scene (with the slugs) +; Cavern scenes (with the slugs) ootw_cavern: ;=========================== @@ -11,13 +11,12 @@ ootw_cavern: ;================== ; setup drawing - lda #0 sta DRAW_PAGE lda #1 sta DISP_PAGE - ;=================== + ;====================== ; setup room boundaries lda #0 @@ -33,20 +32,33 @@ ootw_cavern: lda #$00 sta BASL ; load image off-screen $c00 + + lda WHICH_CAVE + +cave_bg0: lda #>(cavern_rle) sta GBASH lda #<(cavern_rle) sta GBASL + jmp cave_bg_done + +cave_bg1: + lda #>(cavern2_rle) + sta GBASH + lda #<(cavern2_rle) + sta GBASL +cave_bg_done: jsr load_rle_gr - ;============================= + + ;================================ ; Load quake background to $1000 jsr gr_make_quake ;================================= - ; copy to both pages $400/$800 + ; copy $c00 background to both pages $400/$800 jsr gr_copy_to_current jsr page_flip diff --git a/ootw/zp.inc b/ootw/zp.inc index be17fb92..84f8ace5 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -132,7 +132,7 @@ CURSOR = $9D LEFT_LIMIT = $E0 RIGHT_LIMIT = $E1 WHICH_SLUG = $E2 -XX = $E3 +WHICH_CAVE = $E3 YY = $E4 HGR_COLOR = $E4 GAME_OVER = $E5