dos33fsprogs/demos/unused/ticktock2_16/tick_tock.s
2024-02-11 00:06:03 -05:00

92 lines
1.5 KiB
ArmAsm

; Square Wave Gear Pattern
; by Vince `deater` Weaver / dsr
; Lovebyte 2024
; 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
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?
; but doesn't matter as any 0..255 value should work
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
tay ; shape table in zero page
; ROT in A
inc rot_smc+1
rot_smc:
lda #1 ; ROT
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
beq pattern_loop ; bra
pattern_table:
.byte 37,53,0