From a5547b5c5fb0459eaf61f2cd3a5980d0a3c18d98 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 13 Nov 2024 21:39:03 -0500 Subject: [PATCH] driven: get atrus code going a bit better --- demos/driven/Makefile | 3 - demos/driven/NOTES | 16 ++++- demos/driven/part05_atrus/atrus.s | 13 ++-- demos/driven/part05_atrus/do_plasma.s | 14 ++++- demos/driven/part05_atrus/horiz_scroll.s | 9 +-- demos/driven/part05_atrus/plasma.s | 8 +-- demos/driven/part10_graphics/Makefile | 3 +- demos/driven/part10_graphics/graphics.s | 1 + demos/driven/wipes/fx.hgr.2pass.lr.s | 79 ++++++++++++++++++++++++ demos/driven/zp.inc | 37 ++++++----- 10 files changed, 142 insertions(+), 41 deletions(-) create mode 100644 demos/driven/wipes/fx.hgr.2pass.lr.s diff --git a/demos/driven/Makefile b/demos/driven/Makefile index c10fb2b8..214e01e2 100644 --- a/demos/driven/Makefile +++ b/demos/driven/Makefile @@ -28,9 +28,6 @@ driven.dsk: QBOOT QLOAD \ $(DOS33_RAW) driven.dsk 20 0 ./part10_graphics/GRAPHICS 0 0 $(DOS33_RAW) driven.dsk 26 0 ./part20_credits/CREDITS 0 0 - - - #### part00_intro/INTRO: diff --git a/demos/driven/NOTES b/demos/driven/NOTES index 0b0d1d35..e5c481c9 100644 --- a/demos/driven/NOTES +++ b/demos/driven/NOTES @@ -17,7 +17,21 @@ QLOAD: can be up to 4k, have room GRAPHICS = 16k CREDITS = 8k or so - +Timing: Pattern Going-on + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 0,1,2,3 Intro + 4 Start of Atrus + 5 (rough) Start of Scroll + C (rough) End of Scroll + D (rough) Holds up book + D Plasma starts + F Load maglev image + 10 Maglev start + 16 Graphics Load + 18 Roughly Atrus + 1B Roughly falling guy + 1C Roughly credits start + 1D = end of music Mem usage plan: QLOAD at $1200..$1FFF (3.5k) diff --git a/demos/driven/part05_atrus/atrus.s b/demos/driven/part05_atrus/atrus.s index 0fd9d6b1..9fcc68c1 100644 --- a/demos/driven/part05_atrus/atrus.s +++ b/demos/driven/part05_atrus/atrus.s @@ -23,6 +23,7 @@ atrus_opener: lda #0 + sta PLASMA_GROW bit SET_GR bit HIRES @@ -100,7 +101,7 @@ atrus_opener: lda #$20 jsr zx02_full_decomp - lda #2 + lda #1 jsr wait_seconds ; jsr wait_until_keypress @@ -129,20 +130,20 @@ atrus_opener: ; jsr wait_until_keypress - bit PAGE1 - ;================================= - ; plasma + ; go to overlook graphics ;================================= - lda #overlook_graphics sta zx_src_h+1 lda #$40 jsr zx02_full_decomp - jsr do_wipe_fizzle + jsr do_wipe_fizzle ; wipe rts diff --git a/demos/driven/part05_atrus/do_plasma.s b/demos/driven/part05_atrus/do_plasma.s index 31e5ec9e..729096c8 100644 --- a/demos/driven/part05_atrus/do_plasma.s +++ b/demos/driven/part05_atrus/do_plasma.s @@ -168,10 +168,16 @@ was_page1: done_pageflip: sta DRAW_PAGE ; 3 -plasma_end_smc: - lda #52 +;plasma_end_smc: + lda #$E jsr wait_for_pattern + bcc no_grow_yet ; carry set = done + inc PLASMA_GROW + +no_grow_yet: + lda #$F + jsr wait_for_pattern bcc wasnt_keypress jmp done_plasma @@ -181,6 +187,8 @@ wasnt_keypress: ;==================== ; make size bigger + lda PLASMA_GROW + beq skip_plasma_grow lda top_smc+1 ; cmp #0 bmi top_good @@ -202,7 +210,7 @@ left_good: beq right_good inc right_smc+1 right_good: - +skip_plasma_grow: ; 15? diff --git a/demos/driven/part05_atrus/horiz_scroll.s b/demos/driven/part05_atrus/horiz_scroll.s index ec63d8ef..3ea17551 100644 --- a/demos/driven/part05_atrus/horiz_scroll.s +++ b/demos/driven/part05_atrus/horiz_scroll.s @@ -210,7 +210,7 @@ no_ticker: jsr hgr_page_flip lda SCROLL_OFFSET - cmp #193 + cmp #164 beq done_pan jmp pan_outer_outer_loop @@ -346,9 +346,10 @@ draw_text_page3: scroll_text: ;0123456789012345678901234567890123456789 ; .byte "@@@@@@@@@@@@@@@@@@@@" - .byte "\]^_@I@HAVE@FOUND@A@W" + .byte "@\]^_@I@HAVE@FOUND@A@W" .byte "AY@TO@GET@YOU@HOME[@YOU@MUST@TRAVEL@TO@R" .byte "IVENQ@FREE@THE@PEOPLEQ@SAVE@MY@WIFEQ@AND" .byte "@TRAP@MY@DAD[@OH@ALSO@RIVEN@IS@IMPLODING" - .byte "[@SIGNAL@ME@WHEN@YOU@ARE@DONE[@@@@@@@@@@" - .byte "@@@@@@@@@@@@@@" + .byte "[@@@@@@@@@@@@@@@@@@@@" +; .byte "[@SIGNAL@ME@WHEN@YOU@ARE@DONE[@@@@@@@@@@" +; .byte "@@@@@@@@@@@@@@" diff --git a/demos/driven/part05_atrus/plasma.s b/demos/driven/part05_atrus/plasma.s index 4fd23aaa..9d8b53bb 100644 --- a/demos/driven/part05_atrus/plasma.s +++ b/demos/driven/part05_atrus/plasma.s @@ -61,8 +61,8 @@ div8_loop: ;============================= ; do blue/orange - lda #49 - sta plasma_end_smc+1 +; lda #49 +; sta plasma_end_smc+1 jsr init_plasma_colors jsr do_plasma @@ -132,11 +132,11 @@ change_mono: sta DRAW_PAGE jsr scroll_off -.endif + lda #0 jsr hgr_page1_clearscreen jsr hgr_page2_clearscreen - +.endif rts .include "init_plasma.s" diff --git a/demos/driven/part10_graphics/Makefile b/demos/driven/part10_graphics/Makefile index 83fc264a..b620837c 100644 --- a/demos/driven/part10_graphics/Makefile +++ b/demos/driven/part10_graphics/Makefile @@ -17,7 +17,8 @@ graphics.o: graphics.s \ graphics/riven_233.aux.zx02 \ graphics/riven_233.bin.zx02 \ ../wipes/fx.hgr.center.by.pixel.s \ - ../wipes/fx.hgr.fizzle.s + ../wipes/fx.hgr.fizzle.s \ + ../wipes/fx.hgr.2pass.lr.s ca65 -o graphics.o graphics.s -l graphics.lst ### diff --git a/demos/driven/part10_graphics/graphics.s b/demos/driven/part10_graphics/graphics.s index 3167f91c..9d372b28 100644 --- a/demos/driven/part10_graphics/graphics.s +++ b/demos/driven/part10_graphics/graphics.s @@ -264,5 +264,6 @@ atrus_message2: .byte 0,23,"time before the submission deadline.",0 .include "../wipes/fx.hgr.center.by.pixel.s" +;.include "../wipes/fx.hgr.2pass.lr.s" ;.include "../wipes/fx.hgr.fizzle.s" diff --git a/demos/driven/wipes/fx.hgr.2pass.lr.s b/demos/driven/wipes/fx.hgr.2pass.lr.s new file mode 100644 index 00000000..8b2c7f06 --- /dev/null +++ b/demos/driven/wipes/fx.hgr.2pass.lr.s @@ -0,0 +1,79 @@ +;license:MIT +;(c) 2018 by 4am +; + +; vmw -- Convert to ca65 and de-macroed + +WROW = $D0 + + +do_wipe_lr: + lda #$00 + sta h1_smc+1 + sta h2_smc+1 +outerloop1: + lda #$BF + sta WROW +loop1: + jsr hgr_calc +h1_smc: + ldy #$00 + lda (WIPEL),Y + sta (GBASL),Y + dec WROW + dec WROW + lda WROW + cmp #$FF + bne loop1 + + lda #$10 + jsr WaitForKeyWithTimeout + bmi lrexit + + inc h1_smc+1 + lda h1_smc+1 + cmp #$28 + bne outerloop1 + +outerloop2: + lda #$BE + sta WROW +loop2: + jsr hgr_calc +h2_smc: + ldy #$00 + lda (WIPEL),Y + sta (GBASL),Y + dec WROW + dec WROW + lda WROW + cmp #$FE + bne loop2 + + lda #$10 + jsr WaitForKeyWithTimeout + bmi lrexit + + inc h2_smc+1 + lda h2_smc+1 + cmp #$28 + bne outerloop2 +lrexit: + rts + + +WaitForKeyWithTimeout: +; in: A = timeout length (like standard $FCA8 wait routine) +; out: A clobbered (not always 0 if key is pressed, but also not the key pressed) +; X/Y preserved + sec +wait1: pha +wait2: sbc #1 + bne wait2 + pla + bit KEYPRESS + bmi wfk_exit + sbc #1 + bne wait1 +wfk_exit: + rts diff --git a/demos/driven/zp.inc b/demos/driven/zp.inc index 5de0fcf3..35b56e43 100644 --- a/demos/driven/zp.inc +++ b/demos/driven/zp.inc @@ -183,12 +183,21 @@ SPRITE_LIST = $F9 SCROLL_OFFSET = $F0 SCROLL_START = $F1 SCROLL_ODD = $F2 -SCROLL_SUBSCROLL= $F3 -FONT1 = $F4 -FONT2 = $F5 -SCROLL_ROW = $F6 -SCROLL_COL = $F7 -P2_OFFSET = $F8 +PLASMA_GROW = $F3 +SCROLL_SUBSCROLL= $F4 +FONT1 = $F5 +FONT2 = $F6 +SCROLL_ROW = $F7 +SCROLL_COL = $F8 + + +; PLASMA +COMPT1 = $F4 +COMPT2 = $F5 +PARAM1 = $F6 +PARAM2 = $F7 +PARAM3 = $F8 +PARAM4 = $F9 ; Maglev @@ -196,19 +205,9 @@ TEMP = $F0 LEVEL_OVER = $F1 WHICH_OVERLAY = $F2 -; PLASMACUBE -;OUT1 = $F0 -;OUT1H = $F1 -;OUT2 = $F2 -;OUT2H = $F3 -COMPT1 = $F4 -COMPT2 = $F5 -PARAM1 = $F6 -PARAM2 = $F7 -PARAM3 = $F8 -PARAM4 = $F9 -;GRLINE = $FA -;GRLINEH = $FB + + + ; PLASMA