xdraw_wave: update

This commit is contained in:
Vince Weaver 2022-01-23 22:38:50 -05:00
parent d279760889
commit d287261534
6 changed files with 83 additions and 137 deletions

View File

@ -1,9 +1,8 @@
5 HOME
10 PRINT "COMETSONG - 256B INTRO AT LOVEBYTE 2022"
15 PRINT " BY DEATER / DSR"
15 PRINT " CODE BY DEATER, MUSIC BY MA2E / DSR"
20 PRINT CHR$(4);"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN COMETSONG'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN COMETSONG"

View File

@ -4,25 +4,25 @@ DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
EMPTYDISK = ../../../empty_disk/empty.dsk
all: xdraw2_16.dsk
all: xdraw_wave_16.dsk
xdraw2_16.dsk: HELLO XDRAW2
cp $(EMPTYDISK) xdraw2_16.dsk
$(DOS33) -y xdraw2_16.dsk SAVE A HELLO
$(DOS33) -y xdraw2_16.dsk BSAVE -a 0xE7 XDRAW2
xdraw_wave_16.dsk: HELLO XDRAW_WAVE
cp $(EMPTYDISK) xdraw_wave_16.dsk
$(DOS33) -y xdraw_wave_16.dsk SAVE A HELLO
$(DOS33) -y xdraw_wave_16.dsk BSAVE -a 0xE7 XDRAW_WAVE
###
submit: xdraw16.zip
xdraw16.zip: XDRAW2 xdraw2.s file_id.diz xdraw2_16.dsk
mkdir -p lovebyte2021_xdraw2_16
cp XDRAW2 ./lovebyte2021_xdraw2_16
cp xdraw2.s ./lovebyte2021_xdraw2_16
cp file_id.diz ./lovebyte2021_xdraw2_16
cp xdraw2_16.dsk ./lovebyte2021_xdraw2_16
cp xdraw2_720p.mp4 ./lovebyte2021_xdraw2_16
zip -r xdraw16.zip lovebyte2021_xdraw2_16
xdraw16.zip: XDRAW_WAVE xdraw_wave.s file_id.diz xdraw_wave_16.dsk
mkdir -p lovebyte2021_xdraw_wave_16
cp XDRAW_WAVE ./lovebyte2021_xdraw_wave_16
cp xdraw_wave.s ./lovebyte2021_xdraw_wave_16
cp file_id.diz ./lovebyte2021_xdraw_wave_16
cp xdraw_wave_16.dsk ./lovebyte2021_xdraw_wave_16
cp xdraw_wave_720p.mp4 ./lovebyte2021_xdraw_wave_16
zip -r xdraw16.zip lovebyte2021_xdraw_wave_16
####
@ -34,13 +34,13 @@ HELLO: hello.bas
###
XDRAW2: xdraw2.o
ld65 -o XDRAW2 xdraw2.o -C ./apple2_e7_zp.inc
XDRAW_WAVE: xdraw_wave.o
ld65 -o XDRAW_WAVE xdraw_wave.o -C ./apple2_e7_zp.inc
xdraw2.o: xdraw2.s
ca65 -o xdraw2.o xdraw2.s -l xdraw2.lst
xdraw_wave.o: xdraw_wave.s
ca65 -o xdraw_wave.o xdraw_wave.s -l xdraw_wave.lst
####
clean:
rm -f *~ *.o *.lst HELLO XDRAW2 *.zip
rm -f *~ *.o *.lst HELLO XDRAW_WAVE *.zip

View File

@ -1,5 +1,5 @@
Tiny Xdraw
Xdraw Wave
-
Hi-res Xdraw Pattern
16-byte Intro for Apple II, Lovebyte 2021
Hi-res Xdraw Pattern / Sound
16-byte Intro for Apple II, Lovebyte 2022
by Deater / dSr

View File

@ -1,8 +1,8 @@
5 HOME
10 PRINT "TINY XDRAW -- A 16 BYTE APPLE II INTRO"
10 PRINT " XDRAW WAVE -- A 16 BYTE APPLE II INTRO"
15 PRINT " BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN TINY_XDRAW'"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN XDRAW_WAVE'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN XDRAW2"
40 PRINT CHR$(4)"BRUN XDRAW_WAVE"

View File

@ -1,111 +0,0 @@
; Tiny Xdraw
; repeatedly draws an image from an Apple II shape table
; can arbitrarily point to any memory location as a source of these
; some look amazing but depend on random machine state
; to be deterministic you should probably stick to
; $E7-$F0 (the program itself)
; $D000-$FFFF (the ROMs)
; shapetables are a bit complicated to explain here, but they are a
; series of bytes ending with a $00
; (note if you point to a zero, it will be interpreted as an
; action not an end)
; each byte specifies up to 3 actions, DRAW + UP DOWN LEFT RIGHT or
; NODRAW + UP DOWN LEFT RIGHT
; It is vector scaling with SCALE we hardcode to $20 and rotation
; which gets set to 0 after the first iteration, (which is
; why the first shape has arbitrary rotation and gets left)
; we are xdrawing so it will XOR with the current pixels on the screen
; NUP=0 UP=4 zz yyy xxx , does xxx yyy zz
; NRT=1 RT=5
; NDN=2 DN=6
; NLT=3 LT=7
; zero page locations
HGR_SHAPE = $1A
HGR_SHAPE2 = $1B
HGR_BITS = $1C
GBASL = $26
GBASH = $27
A5H = $45
XREG = $46
YREG = $47
; C0-CF should be clear
; D0-DF?? D0-D5 = HGR scratch?
HGR_DX = $D0 ; HGLIN
HGR_DX2 = $D1 ; HGLIN
HGR_DY = $D2 ; HGLIN
HGR_QUADRANT = $D3
HGR_E = $D4
HGR_E2 = $D5
HGR_X = $E0
HGR_X2 = $E1
HGR_Y = $E2
HGR_COLOR = $E4
HGR_HORIZ = $E5
HGR_SCALE = $E7
HGR_SHAPE_TABLE = $E8
HGR_SHAPE_TABLE2= $E9
HGR_COLLISIONS = $EA
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HGR = $F3E2
HPOSN = $F411
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
.globalzp rot_smc
tiny_xdraw:
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; we load at $E7 which is HGR_SCALE, so HGR_SCALE gets
; the value of the above JSR instruction ($20)
; A and Y are 0 here.
; X is left behind by the boot process?
tax
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
; saves X,Y,A to zero page
; after Y= orig X/7
; A and X are ??
tiny_loop:
; values for shape table
; Y X
; 00 E7 = neat
; 00 EB = OK
; 00 EF = good
; F0 01 = cool, let's go with it
; ldx #$01 ; point to bottom byte of shape address
ldy #$f0 ; point to top byte of shape address
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
lda #5 ; ROT=0
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
beq tiny_loop ; bra

View File

@ -0,0 +1,58 @@
; Xdraw Wave
; repeatedly draws an image from an Apple II shape table
; this time we rotate a bit
; we also go for a bit of sound
; loads at $E7 which sets the HGR_SCALE zero-page value for free
; zero page locations
; ROM calls
HGR2 = $F3D8
HPOSN = $F411
XDRAW0 = $F65D
.zeropage
.globalzp rot_smc
xdraw_wave:
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; we load at $E7 which is HGR_SCALE, so HGR_SCALE gets
; the value of the above JSR instruction ($20)
; A and Y are 0 here.
; X is left behind by the boot process?
tax
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
; saves X,Y,A to zero page
; after Y= orig X/7
; A and X are ??
tiny_loop:
; values for shape table
; Y X
; 00 E7 = neat
; 00 EB = OK
; 00 EF = good
; F0 01 = cool, let's go with it
; ldx #$01 ; point to bottom byte of shape address
ldy #$f0 ; point to top byte of shape address
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
lda #5 ; ROT=0
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
beq tiny_loop ; bra