shape_table: more attempts at entries

This commit is contained in:
Vince Weaver 2023-01-12 08:43:01 -05:00
parent 133b550021
commit 08f1049e9c
6 changed files with 366 additions and 14 deletions

View File

@ -22,7 +22,7 @@ shape_table.dsk: HELLO APPLE.BAS GEAR.BAS \
$(DOS33) -y shape_table.dsk BSAVE -a 0xc00 HERRING16
$(DOS33) -y shape_table.dsk BSAVE -a 0xc00 PATTERN
$(DOS33) -y shape_table.dsk BSAVE -a 0x3f5 PATTERN_LOGO
$(DOS33) -y shape_table.dsk BSAVE -a 0xc00 SQUARE_WAVE
$(DOS33) -y shape_table.dsk BSAVE -a 0xe7 SQUARE_WAVE
###
@ -51,7 +51,7 @@ gear.o: gear.s
###
SQUARE_WAVE: square_wave.o
ld65 -o SQUARE_WAVE square_wave.o -C $(LINKERSCRIPTS)/apple2_c00.inc
ld65 -o SQUARE_WAVE square_wave.o -C $(LINKERSCRIPTS)/apple2_e7_zp.inc
square_wave.o: square_wave.s
ca65 -o square_wave.o square_wave.s -l square_wave.lst

View File

@ -0,0 +1,114 @@
; Square Wave Pattern
; by Vince `deater` Weaver
; 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
FRAMEH = $FD
XPOS = $FE
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HGR = $F3E2
HPOSN = $F411
DRAW0 = $F601
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
.globalzp rot_smc
square_wave:
; $E7
.byte $0A ; harmless ASL but also size of HGR_SCALE
; as we load this at $E7
; lda #10
; sta HGR_SCALE
; $E8,$E9,$EA (HGR_COLLISIONS=$F3)
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; A and Y are 0 here.
; X is left behind by the boot process?
; tya
; tax ; load X with 0
; ldy #0
; ldx #00
; lda #00
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 ??
pattern_loop:
ldx #<pattern_table ; point to bottom byte of shape address
ldy #>pattern_table ; point to top byte of shape address
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
rot_smc:
lda #1 ; rotation (ROT=)
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
inc HGR_BITS
; inc HGR_COLLISIONS
bne pattern_loop
inc rot_smc+1
ldx HGR_COLLISIONS
lda $F6F6,X
sta HGR_BITS
jsr $F3F6 ; clear screen to HGR_BITS
; jmp pattern_loop
beq pattern_loop ; bra
pattern_table:
.byte 37,53,0

View File

@ -1,5 +1,11 @@
; 16B weird line pattern
; note this depends on GBASL/GBASH and other values set by HPOSN
; being vaguely reasonable at boot(?) could vary by system
; it also means some garbage on screen for first XDRAW but
; maybe that's OK as otherwise we are 18 bytes
; zero page locations
HGR_SHAPE = $1A
HGR_SHAPE2 = $1B

View File

@ -1,4 +1,4 @@
; Pattern Logo
; Square Wave Pattern
; by Vince `deater` Weaver
@ -44,22 +44,30 @@ XDRAW1 = $F661
RESTORE = $FF3F
gear:
.zeropage
.globalzp rot_smc
square_wave:
; $E7
.byte $0A ; harmless ASL but also size of HGR_SCALE
; as we load this at $E7
; lda #10
; sta HGR_SCALE
; $E8,$E9,$EA (HGR_COLLISIONS=$F3)
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
lda #10
sta HGR_SCALE
; A and Y are 0 here.
; X is left behind by the boot process?
sty HGR_COLLISIONS
tya
tax ; load X with 0
; tya
; tax ; load X with 0
; ldy #0
; ldx #00
; lda #00
@ -75,18 +83,29 @@ pattern_loop:
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
lda #1 ; ROT=0
rot_smc:
lda #1 ; rotation (ROT=)
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
lda HGR_COLLISIONS
inc HGR_BITS
; inc HGR_COLLISIONS
bne pattern_loop
inc rot_smc+1
blah:
jmp blah
; ldx HGR_COLLISIONS
lda $F6F6,Y
sta HGR_BITS
jsr $F3F6 ; clear screen to HGR_BITS
; jmp pattern_loop
beq pattern_loop ; bra

View File

@ -0,0 +1,110 @@
; Square Wave Pattern
; by Vince `deater` Weaver
; 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
FRAMEH = $FD
XPOS = $FE
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HGR = $F3E2
HPOSN = $F411
DRAW0 = $F601
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
.globalzp rot_smc
square_wave:
; $E7
.byte $0A ; harmless ASL but also size of HGR_SCALE
; as we load this at $E7
; lda #10
; sta HGR_SCALE
; $E8,$E9,$EA (HGR_COLLISIONS=$F3)
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; A and Y are 0 here.
; X is left behind by the boot process?
; tya
; tax ; load X with 0
; ldy #0
; ldx #00
; lda #00
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 ??
pattern_loop:
ldx #<pattern_table ; point to bottom byte of shape address
ldy #>pattern_table ; point to top byte of shape address
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
rot_smc:
lda #1 ; rotation (ROT=)
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
inc HGR_BITS
; lda HGR_COLLISIONS
bne pattern_loop
inc rot_smc+1
jsr $F3F6 ; clear screen to HGR_BITS
jmp pattern_loop
pattern_table:
.byte 37,53,0

View File

@ -0,0 +1,103 @@
; Square Wave Pattern
; by Vince `deater` Weaver
; 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
FRAMEH = $FD
XPOS = $FE
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HGR = $F3E2
HPOSN = $F411
DRAW0 = $F601
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
.globalzp rot_smc
square_wave:
.byte $0A ; harmless ASL but also size of HGR_SCALE
; as we load this at $E7
; lda #10
; sta HGR_SCALE
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; A and Y are 0 here.
; X is left behind by the boot process?
; sty HGR_COLLISIONS
tya
tax ; load X with 0
; ldy #0
; ldx #00
; lda #00
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 ??
pattern_loop:
ldx #<pattern_table ; point to bottom byte of shape address
ldy #>pattern_table ; point to top byte of shape address
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
rot_smc:
lda #1 ; ROT=0
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
; lda HGR_COLLISIONS
; bne pattern_loop
inc rot_smc+1
jmp pattern_loop
pattern_table:
.byte 37,53,0