mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-08 15:29:41 +00:00
spiral: update code comments
This commit is contained in:
parent
f60cb2c1d6
commit
f2f013df67
|
@ -10,10 +10,13 @@
|
||||||
GBASL = $26
|
GBASL = $26
|
||||||
GBASH = $27
|
GBASH = $27
|
||||||
HGR_SCALE = $E7
|
HGR_SCALE = $E7
|
||||||
HGR_COLLISION = $EA
|
HGR_COLLISION = $EA ; overlaps our code, but it's OK
|
||||||
|
; as it's modified after the HGR2
|
||||||
|
; runs
|
||||||
|
|
||||||
HGR_ROTATION = $FE ; IMPORTANT! set this right!
|
HGR_ROTATION = $FE ; IMPORTANT! set this right!
|
||||||
|
; we get this for free by loading
|
||||||
|
; our code into $E9 in zero page
|
||||||
; ROM locations
|
; ROM locations
|
||||||
HGR2 = $F3D8
|
HGR2 = $F3D8
|
||||||
HPOSN = $F411
|
HPOSN = $F411
|
||||||
|
@ -29,10 +32,14 @@ spiraling_shape:
|
||||||
; X is left behind by the boot process?
|
; X is left behind by the boot process?
|
||||||
|
|
||||||
tiny_loop:
|
tiny_loop:
|
||||||
bit $C030
|
bit $C030 ; click the speaker for some sound
|
||||||
|
|
||||||
tay ; ldy #0 ; A always 0 here
|
tay ; ldy #0 ; A always 0 here
|
||||||
ldx #140
|
|
||||||
lda #96
|
ldx #140 ; center spiral on the screen
|
||||||
|
; this is expensive
|
||||||
|
lda #96 ; but otherwise doesn't look right
|
||||||
|
|
||||||
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
|
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
|
||||||
; saves X,Y,A to zero page
|
; saves X,Y,A to zero page
|
||||||
; after Y= orig X/7
|
; after Y= orig X/7
|
||||||
|
@ -40,21 +47,33 @@ tiny_loop:
|
||||||
|
|
||||||
ldx #<our_shape ; load $E2DF
|
ldx #<our_shape ; load $E2DF
|
||||||
ldy #>our_shape ;
|
ldy #>our_shape ;
|
||||||
inc HGR_ROTATION
|
inc HGR_ROTATION ; rotate the line, also make it larger
|
||||||
|
|
||||||
lda #1 ; HGR_ROTATION is HERE ($FE)
|
lda #1 ; HGR_ROTATION is HERE ($FE)
|
||||||
|
; we also use it for scale
|
||||||
|
|
||||||
and #$7f ; cut off before it gets too awful
|
and #$7f ; cut off before it gets too awful
|
||||||
sta HGR_SCALE
|
sta HGR_SCALE
|
||||||
|
|
||||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||||
|
|
||||||
|
; XDRAW does an exclusive-or shape table
|
||||||
|
; draw, so it draws the spiral first, then
|
||||||
|
; undraws it on the second pass
|
||||||
|
|
||||||
; Both A and X are 0 at exit
|
; Both A and X are 0 at exit
|
||||||
; Z flag set on exit
|
; Z flag set on exit
|
||||||
; Y varies
|
; Y varies
|
||||||
|
|
||||||
beq tiny_loop ; bra
|
beq tiny_loop ; bra
|
||||||
|
|
||||||
|
; o/~ No way to stop o/~
|
||||||
our_shape = $E2DF
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
our_shape = $E2DF ; location in the Applesoft ROM
|
||||||
|
; that holds $11,$F0,$03,$20,$00
|
||||||
|
; which makes a nice line in shape table
|
||||||
|
; (it points into the code for the FRE()
|
||||||
|
; BASIC routine but that's not important)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user