From fe45c8cee1be79b849ee7b645ec8220bda0b6ce2 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 16 Jan 2019 23:16:11 -0500 Subject: [PATCH] ootw: add pool ripples not sure how I feel about them also added left-edge detection --- ootw/ootw.s | 77 +++++++++++++++++++++++++++++++++++++++++++ ootw/ootw_sprites.inc | 7 +++- ootw/zp.inc | 4 +-- 3 files changed, 84 insertions(+), 4 deletions(-) diff --git a/ootw/ootw.s b/ootw/ootw.s index 784cc598..f6670bad 100644 --- a/ootw/ootw.s +++ b/ootw/ootw.s @@ -78,8 +78,71 @@ game_loop: jsr gr_copy_to_current + ;======================= ; draw pool ripples + lda FRAMEL + and #$30 ; 0110 1100 + lsr + lsr + lsr + tax + + lda pool_ripples,X + sta INL + lda pool_ripples+1,X + sta INH + + lda #9 + sta XPOS + lda #30 + sta YPOS + + jsr put_sprite + + + lda FRAMEL + and #$30 ; 0110 1100 + lsr + lsr + lsr + clc + adc #2 + and #$6 + tax + + lda pool_ripples,X + sta INL + lda pool_ripples+1,X + sta INH + + + lda #27 + sta XPOS + lda #30 + sta YPOS + + jsr put_sprite + + + lda FRAMEL + and #$30 ; 0110 1100 + lsr + lsr + lsr + clc + adc #4 + and #$6 + tax + + lda #18 + sta XPOS + lda #28 + sta YPOS + + jsr put_sprite + + ; draw physicist @@ -108,6 +171,15 @@ game_loop: jsr page_flip + + ; inc frame count + + inc FRAMEL + bne frame_no_oflo + inc FRAMEH + +frame_no_oflo: + ; pause? ; loop forever @@ -146,6 +218,11 @@ left: bne face_left dec PHYSICIST_X + bpl just_fine_left +too_far_left: + inc PHYSICIST_X +just_fine_left: + inc GAIT inc GAIT diff --git a/ootw/ootw_sprites.inc b/ootw/ootw_sprites.inc index 68195a5f..e8520138 100644 --- a/ootw/ootw_sprites.inc +++ b/ootw/ootw_sprites.inc @@ -125,11 +125,12 @@ pool_ripples: .word ripple1 .word ripple2 .word ripple3 + .word ripple4 ripple1: .byte $3,$1 - .byte $5a,$5a,$5a + .byte $5a,$5a,$aa ripple2: .byte $3,$1 @@ -139,6 +140,10 @@ ripple3: .byte $3,$1 .byte $aa,$aa,$aa +ripple4: + .byte $3,$1 + .byte $aa,$aa,$aa + ;========================= diff --git a/ootw/zp.inc b/ootw/zp.inc index 6d7a054b..f7607773 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -1,7 +1,5 @@ ;; Zero Page -FRAMEBUFFER = $00 ; $00 - $0F - ;; LZ4 addresses LZ4_SRC = $00 @@ -42,7 +40,7 @@ FILEML = $64 FILEMH = $65 -FRAME = $60 +FRAMEL = $60 FRAMEH = $61 WAITING = $62 LETTERL = $63