From 504ae805e7a3750a0ca8d1376bd5de6ab4ab84b0 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 5 May 2021 14:51:11 -0400 Subject: [PATCH] xdraw: shimmer: make it for the bot --- basic/appleiibot/shimmer.bas | 2 + graphics/hgr/tiny_triangles/Makefile | 13 ++- graphics/hgr/xdraw/Makefile | 11 +- graphics/hgr/xdraw/shimmer_bot.s | 149 +++++++++++++++++++++++++++ 4 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 basic/appleiibot/shimmer.bas create mode 100644 graphics/hgr/xdraw/shimmer_bot.s diff --git a/basic/appleiibot/shimmer.bas b/basic/appleiibot/shimmer.bas new file mode 100644 index 00000000..634e1bd9 --- /dev/null +++ b/basic/appleiibot/shimmer.bas @@ -0,0 +1,2 @@ +1FORI=0TO138:POKE1013+I,4*PEEK(2126+I)-192+(PEEK(2265+I/3)-35)/4^(I-INT(I/3)*3):NEXT +2&",clV/QPX3JnZ#NiV7QfX5PoX*XoVo8,kXKX1Z08=kiXYY71l-Xo5IoPoC/0Yb?o=J0MnYk5J'No`_d`X0_0@>OW0@j[kk:/k?0[>0b@biV?S>0SC1CA1CF02.l?09=:5?=9=H??58;0S4G@Z4G(;0D#$L'09'(3W'46W,+$4#GC43C43$#4aGS7Y3# diff --git a/graphics/hgr/tiny_triangles/Makefile b/graphics/hgr/tiny_triangles/Makefile index 0bd6dc9e..c53c8d30 100644 --- a/graphics/hgr/tiny_triangles/Makefile +++ b/graphics/hgr/tiny_triangles/Makefile @@ -9,7 +9,7 @@ all: triangles.dsk triangles.dsk: HELLO TINY_TRIANGLES XOR MOD9 MOD9_64 WRITING MOVE_RIGHT \ SIER_HGR SIER_HPLOT SIER_MOVERIGHT SIER_INLINE SIER_INTERLACE \ - RAINBOW_SQUARES + RAINBOW_SQUARES FEATHERS cp $(EMPTY_DISK) triangles.dsk $(DOS33) -y triangles.dsk SAVE A HELLO $(DOS33) -y triangles.dsk BSAVE -a 0x070 TINY_TRIANGLES @@ -24,6 +24,7 @@ triangles.dsk: HELLO TINY_TRIANGLES XOR MOD9 MOD9_64 WRITING MOVE_RIGHT \ $(DOS33) -y triangles.dsk BSAVE -a 0x300 SIER_HPLOT $(DOS33) -y triangles.dsk BSAVE -a 0x300 SIER_INTERLACE $(DOS33) -y triangles.dsk BSAVE -a 0x300 RAINBOW_SQUARES + $(DOS33) -y triangles.dsk BSAVE -a 0x300 FEATHERS ### @@ -88,6 +89,16 @@ SIER_HPLOT: sier_hplot.o sier_hplot.o: sier_hplot.s ca65 -o sier_hplot.o sier_hplot.s -l sier_hplot.lst + +### + +FEATHERS: feathers.o + ld65 -o FEATHERS feathers.o -C $(LINKER_SCRIPTS)/apple2_300.inc + +feathers.o: feathers.s + ca65 -o feathers.o feathers.s -l feathers.lst + + ### SIER_MOVERIGHT: sier_moveright.o diff --git a/graphics/hgr/xdraw/Makefile b/graphics/hgr/xdraw/Makefile index fbef8c71..9ebb14ca 100644 --- a/graphics/hgr/xdraw/Makefile +++ b/graphics/hgr/xdraw/Makefile @@ -8,7 +8,7 @@ LINKERSCRIPTS = ../../../linker_scripts all: xdraw.dsk -xdraw.dsk: HELLO TINY_XDRAW TINY_COOL TINY_LINES TINY_CENTER NYAN XDRAW_TEST SHIMMER +xdraw.dsk: HELLO TINY_XDRAW TINY_COOL TINY_LINES TINY_CENTER NYAN XDRAW_TEST SHIMMER SHIMMER_BOT cp $(EMPTYDISK) xdraw.dsk $(DOS33) -y xdraw.dsk SAVE A HELLO $(DOS33) -y xdraw.dsk BSAVE -a 0xE7 TINY_XDRAW @@ -18,6 +18,7 @@ xdraw.dsk: HELLO TINY_XDRAW TINY_COOL TINY_LINES TINY_CENTER NYAN XDRAW_TEST SHI $(DOS33) -y xdraw.dsk BSAVE -a 0xC00 NYAN $(DOS33) -y xdraw.dsk BSAVE -a 0xE7 XDRAW_TEST $(DOS33) -y xdraw.dsk BSAVE -a 0xC00 SHIMMER + $(DOS33) -y xdraw.dsk BSAVE -a 0x3f5 SHIMMER_BOT ### @@ -83,6 +84,14 @@ SHIMMER: shimmer.o shimmer.o: shimmer.s ca65 -o shimmer.o shimmer.s -l shimmer.lst +### + +SHIMMER_BOT: shimmer_bot.o + ld65 -o SHIMMER_BOT shimmer_bot.o -C $(LINKERSCRIPTS)/apple2_3f5.inc + +shimmer_bot.o: shimmer_bot.s + ca65 -o shimmer_bot.o shimmer_bot.s -l shimmer_bot.lst + diff --git a/graphics/hgr/xdraw/shimmer_bot.s b/graphics/hgr/xdraw/shimmer_bot.s new file mode 100644 index 00000000..57bca53f --- /dev/null +++ b/graphics/hgr/xdraw/shimmer_bot.s @@ -0,0 +1,149 @@ + +; zero page locations +HGR_SHAPE = $1A +SEEDL = $4E +FRAME = $A4 +OUR_ROT = $A5 +RND_EXP = $C9 +HGR_PAGE = $E6 +HGR_SCALE = $E7 +HGR_ROTATION = $F9 +DIRECTION = $FC +XPOS = $FD +YPOS = $FF + +; Soft Switches +KEYPRESS = $C000 +KEYRESET = $C010 +SPEAKER = $C030 +PAGE0 = $C054 +PAGE1 = $C055 + +; ROM calls +RND = $EFAE +HGR2 = $F3D8 +HCLR = $F3F2 +HCLR_COLOR = $F3F4 +HPOSN = $F411 +XDRAW0 = $F65D +TEXT = $FB36 ; Set text mode +WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us + + +shimmer: + + ;========================================= + ; SETUP + ;========================================= + + + jsr HGR2 + + lda #0 + sta FRAME + + lda #14 + sta YPOS + + lda #3 + sta HGR_SCALE + + lda #32 + sta DIRECTION + + lda #22 ; only set once, we wrap + sta XPOS + +y_loop: + + +x_loop: + +main_loop: + + ;======================= + ; xdraw + ;======================= + +xdraw: + ; setup X and Y co-ords + + ldy #0 ; XPOSH always 0 for us + ldx XPOS + lda YPOS + jsr HPOSN ; X= (y,x) Y=(a) + + ldx #shape_dsr + + lda #0 ; set rotation + + jsr XDRAW0 ; XDRAW 1 AT X,Y + ; Both A and X are 0 at exit + + + inc FRAME + lda FRAME + and #$7 + beq reverse + +add_x: + lda XPOS + clc + adc DIRECTION + sta XPOS + jmp x_loop + +reverse: + lda DIRECTION ; switch direction + eor #$ff + sec + adc #0 + sta DIRECTION + + lda YPOS + clc + adc #16 + sta YPOS + cmp #190 + bne y_loop + + +do_shimmer_y: + + ldx #0 +do_shimmer_x: + +blargh: + lda $4000,X + eor #$80 +blargh2: + sta $4000,X + inx + bne do_shimmer_x + + + inc blargh+2 + inc blargh2+2 + + lda blargh+2 + cmp #$60 + bne do_shimmer_y + + lda #$40 + sta blargh+2 + sta blargh2+2 + jmp do_shimmer_y + +end: + jmp end + +;shape_dsr: +;.byte $2d,$36,$ff,$3f +;.byte $24,$ad,$22,$24,$94,$21,$2c,$4d +;.byte $91,$3f,$36,$00 + +shape_dsr: +.byte $09,$36,$ff,$3f +.byte $24,$2d,$36,$58,$20,$3f,$48,$29 +.byte $35,$96,$49,$3f,$24,$24,$2d,$00