diff --git a/demos/second/TODO b/demos/second/TODO index 081ebc45..019d027a 100644 --- a/demos/second/TODO +++ b/demos/second/TODO @@ -1,3 +1,6 @@ +TODO OVERALL ++ See if can squeeze into 64k RAM + TODO MUSIC + be sure to mute channels when pausing @@ -24,6 +27,13 @@ DISK I have it reverse course? - tunnel (for real) - cirles / interference pattern (for real) + scroll off to right at end + ++ gorilla + scroll on, better TV effect + ++ leaves + better animation? + Lens / Rotozoom - add lo-res LENS sprite to bounce around @@ -33,10 +43,10 @@ DISK I + Plasma - switch to purple green - - do the weird vertical wipe + - do the weird vertical wipe while still running + Plasmacube - - have cube mask with different color sides + + bump up to 16 frames instead of just 8 + Dot Bounce @@ -52,6 +62,7 @@ DISK I + ocean / voxels - probably too big, reduce the size + - at end, scroll back off screen + polar diff --git a/demos/second/audio.s b/demos/second/audio.s new file mode 100644 index 00000000..e6193a09 --- /dev/null +++ b/demos/second/audio.s @@ -0,0 +1,204 @@ +; Based on BTC.SYSTEM by Oliver Schmidt + +; How to generate proper audio for this: + +; -Open MP3 in Audacity +; -Change Project Rate (Hz) to 33,000 (bottom left box) +; -Tracks --> Mix... --> Mix Stereo Down to Mono +; -File --> Export --> Export as WAV +; - Select "WAV (Microsoft) signed 16-bit PCM" +; - Under "Edit Metadata Tags" hit "Clear", then "Okay" +; -Open saved WAV file in BTc Sound Encoder 3.0 +; -Change Algorithm to "1 bit" (leave fineness as BTc16) +; -File --> Export binary file .BTC format + + +spkr = $C030 + +;**************************************************************** +;* Audio playback * +;**************************************************************** +; audio file in BTC_L/BTC_H +; pages to play in X + + +play_audio: + ldy #0 + + ; loop here as long as BITs are [F]alse (aka 0) +F_NX: NOP ; 2 2 + NOP ; 2 2 + NOP ; 2 2 + BIT $00 ; 3 3 +F_RD: LDA (BTC_L),y ; 5 5 5 + ASL ; 2 2 2 + BCS T_1_SW ; 2/3 2 + NOP ; 2 2 + NOP ; 2 2 + NOP ; 2 2 + NOP ; 2 2 +F_1: JSR delay ; 6 (+13) 19 + ASL ; 2 2 = 31 + BCS T_2_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +F_2: JSR delay ; 6 (+13) + ASL ; 2 + BCS T_3_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +F_3: JSR delay ; 6 (+13) + ASL ; 2 + BCS T_4_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +F_4: JSR delay ; 6 (+13) + ASL ; 2 + BCS T_5_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +F_5: JSR delay ; 6 (+13) + ASL ; 2 + BCS T_6_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +F_6: JSR delay ; 6 (+13) + ASL ; 2 + BCS T_7_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +F_7: JSR delay ; 6 (+13) + ASL ; 2 + BCS T_8_SW ; 2/3 2 2 + NOP ; 2 2 2 + NOP ; 2 2 2 + NOP ; 2 2 2 + NOP ; 2 2 2 +F_8: INY ; 2 2 2 + BNE F_NX ; 2/3 3 = 31 2 + INC BTC_H ; 5 5 + DEX ; 2 2 + BNE F_RD ; 2/3 3 = 31 + RTS + ; click speaker on transitions +T_1_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [1] + BCS T_1 ; 3 (always) +T_2_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [2] + BCS T_2 ; 3 (always) +T_3_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [3] + BCS T_3 ; 3 (always) +T_4_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [4] + BCS T_4 ; 3 (always) +T_5_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [5] + BCS T_5 ; 3 (always) +T_6_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [6] + BCS T_6 ; 3 (always) +T_7_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [7] + BCS T_7 ; 3 (always) +T_8_SW: STA spkr ; 4 [SW]itch to [T]rue on BIT [8] + BCS T_8 ; 3 (always) + +F_1_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [1] + BCC F_1 ; 3 (always) +F_2_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [2] + BCC F_2 ; 3 (always) +F_3_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [3] + BCC F_3 ; 3 (always) +F_4_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [4] + BCC F_4 ; 3 (always) +F_5_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [5] + BCC F_5 ; 3 (always) +F_6_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [6] + BCC F_6 ; 3 (always) +F_7_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [7] + BCC F_7 ; 3 (always) +F_8_SW: STA spkr ; 4 [SW]itch to [F]alse on BIT [8] + BCC F_8 ; 3 (always) + + ; loop here as long as BITs are [T]rue (aka 1) +T_NX: NOP ; 2 + NOP ; 2 + NOP ; 2 + BIT $00 ; 3 +T_RD: LDA (BTC_L),y ; 5 + ASL ; 2 + BCC F_1_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_1: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_2_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_2: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_3_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_3: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_4_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_4: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_5_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_5: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_6_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_6: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_7_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_7: JSR delay ; 6 (+13) + ASL ; 2 + BCC F_8_SW ; 2/3 + NOP ; 2 + NOP ; 2 + NOP ; 2 + NOP ; 2 +T_8: INY ; 2 + BNE T_NX ; 2/3 + INC BTC_H ; 5 + DEX ; 2 + BNE T_RD ; 2/3 + RTS + +delay: + nop ; 2 + nop ; 2 + BIT $00 ; 3 + RTS ; 6 = 13 + + diff --git a/demos/second/part08_gorilla/tv_effect.s b/demos/second/part08_gorilla/tv_effect.s index 6b30b4bb..9d4979b8 100644 --- a/demos/second/part08_gorilla/tv_effect.s +++ b/demos/second/part08_gorilla/tv_effect.s @@ -122,12 +122,12 @@ zappo_inner_loop: sta (OUTL),Y sta (GBASL),Y - lda #150 + lda #250 jsr wait ldy #19 - lda $00 + lda #$00 sta (OUTL),Y sta (GBASL),Y iny diff --git a/demos/second/part12_plasma/Makefile b/demos/second/part12_plasma/Makefile index e8f402fa..e292d56e 100644 --- a/demos/second/part12_plasma/Makefile +++ b/demos/second/part12_plasma/Makefile @@ -15,7 +15,7 @@ PLASMA: plasma.o ld65 -o PLASMA plasma.o -C $(LINKER_SCRIPTS)/apple2_8000.inc plasma.o: plasma.s \ - do_plasma.s init_plasma.s \ + do_plasma.s init_plasma.s scroll_off.s \ ../zp.inc ../hardware.inc ../qload.inc ca65 -o plasma.o plasma.s -l plasma.lst diff --git a/demos/second/part12_plasma/plasma.s b/demos/second/part12_plasma/plasma.s index d1baebc4..9ac2700f 100644 --- a/demos/second/part12_plasma/plasma.s +++ b/demos/second/part12_plasma/plasma.s @@ -86,7 +86,14 @@ div8_loop: jsr do_plasma ; drop + lda DRAW_PAGE + eor #$20 + sta DRAW_PAGE + jsr scroll_off + + lda #25 + jsr wait_ticks ;============================= ; do purple/green @@ -108,7 +115,14 @@ change_purple: jsr do_plasma ; drop + lda DRAW_PAGE + eor #$20 + sta DRAW_PAGE + jsr scroll_off + + lda #25 + jsr wait_ticks ;============================= @@ -129,13 +143,19 @@ change_mono: jsr do_plasma + ; drop + lda DRAW_PAGE + eor #$20 + sta DRAW_PAGE + jsr scroll_off rts .include "init_plasma.s" .include "do_plasma.s" .include "../hgr_clear_screen.s" +.include "scroll_off.s" .include "../irq_wait.s" ;.include "hgr_table.s" diff --git a/demos/second/part12_plasma/scroll_off.s b/demos/second/part12_plasma/scroll_off.s new file mode 100644 index 00000000..c51fca05 --- /dev/null +++ b/demos/second/part12_plasma/scroll_off.s @@ -0,0 +1,30 @@ +; note, this should scroll while still moving +; don't have time to do that + +scroll_off: + + ldx #0 +scroll_off_outer_loop: + + lda hposn_low,X + sta GBASL + lda hposn_high,X + clc + adc DRAW_PAGE + sta GBASH + + ldy #39 + lda #00 +scroll_off_inner_loop: + sta (GBASL),Y + dey + bpl scroll_off_inner_loop + + lda #50 + jsr wait + + inx + cpx #192 + bne scroll_off_outer_loop + + rts