2021-07-12 05:16:18 +00:00
|
|
|
MoveLeft
|
|
|
|
clc
|
2021-10-06 12:10:09 +00:00
|
|
|
adc StartX ; Increment the virtual X-position
|
|
|
|
jsl SetBG0XPos
|
2021-07-16 22:05:29 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
lda StartX
|
2021-08-19 06:22:36 +00:00
|
|
|
lsr
|
2021-10-06 12:10:09 +00:00
|
|
|
jsl SetBG1XPos
|
2021-07-16 22:05:29 +00:00
|
|
|
|
2021-10-08 04:54:45 +00:00
|
|
|
; jsl Render
|
2021-07-12 05:16:18 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
MoveRight
|
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
lda StartX
|
2021-07-12 05:16:18 +00:00
|
|
|
sec
|
2021-10-06 12:10:09 +00:00
|
|
|
sbc 1,s
|
|
|
|
bpl *+5
|
|
|
|
lda #0
|
|
|
|
jsl SetBG0XPos
|
2021-07-17 04:09:08 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
lda StartX
|
2021-08-19 06:22:36 +00:00
|
|
|
lsr
|
2021-10-06 12:10:09 +00:00
|
|
|
jsl SetBG1XPos
|
2021-07-17 04:09:08 +00:00
|
|
|
|
2021-10-08 04:54:45 +00:00
|
|
|
; jsl Render
|
2021-07-12 05:16:18 +00:00
|
|
|
pla
|
|
|
|
rts
|
|
|
|
|
2021-07-18 02:00:46 +00:00
|
|
|
MoveUp
|
2021-07-12 05:16:18 +00:00
|
|
|
clc
|
2021-10-06 12:10:09 +00:00
|
|
|
adc StartY ; Increment the virtual Y-position
|
2021-08-09 11:08:09 +00:00
|
|
|
pha
|
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
lda #240 ; virtual play field height
|
2021-08-09 11:08:09 +00:00
|
|
|
sec
|
2021-10-06 12:10:09 +00:00
|
|
|
sbc ScreenHeight
|
2021-08-09 11:08:09 +00:00
|
|
|
tax
|
2021-10-06 12:10:09 +00:00
|
|
|
cmp 1,s
|
|
|
|
bcc *+4
|
|
|
|
lda 1,s
|
|
|
|
jsl SetBG0YPos
|
2021-08-09 11:08:09 +00:00
|
|
|
pla
|
2021-07-17 04:09:08 +00:00
|
|
|
|
2021-08-09 11:08:09 +00:00
|
|
|
; lda StartY
|
|
|
|
; lsr
|
2021-08-26 13:52:43 +00:00
|
|
|
; jsl SetBG1YPos
|
2021-07-17 04:09:08 +00:00
|
|
|
|
2021-10-08 04:54:45 +00:00
|
|
|
; jsl Render
|
2021-07-12 05:16:18 +00:00
|
|
|
rts
|
|
|
|
|
2021-07-18 02:00:46 +00:00
|
|
|
MoveDown
|
2021-07-12 05:16:18 +00:00
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
lda StartY
|
2021-07-12 05:16:18 +00:00
|
|
|
sec
|
2021-10-06 12:10:09 +00:00
|
|
|
sbc 1,s
|
|
|
|
bpl *+5
|
|
|
|
lda #0
|
|
|
|
jsl SetBG0YPos
|
2021-07-17 04:09:08 +00:00
|
|
|
|
2021-08-10 12:59:14 +00:00
|
|
|
; lda StartY
|
|
|
|
; lsr
|
2021-08-26 13:52:43 +00:00
|
|
|
; jsl SetBG1YPos
|
2021-07-17 04:09:08 +00:00
|
|
|
|
2021-10-08 04:54:45 +00:00
|
|
|
; jsl Render
|
2021-07-12 05:16:18 +00:00
|
|
|
pla
|
|
|
|
rts
|
|
|
|
|
|
|
|
; Very simple, scroll as fast as possible
|
2021-10-06 12:10:09 +00:00
|
|
|
oldOneSecondCounter ds 2
|
|
|
|
frameCount ds 2
|
|
|
|
|
2021-07-12 05:16:18 +00:00
|
|
|
Demo
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal OneSecondCounter
|
|
|
|
sta oldOneSecondCounter
|
|
|
|
stz frameCount
|
2021-07-20 03:42:51 +00:00
|
|
|
|
2021-07-20 17:42:21 +00:00
|
|
|
; Every 3 ticks (20 fps) cycle some colors
|
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
; lda #DoColorCycle
|
|
|
|
; ldx #^DoColorCycle
|
|
|
|
; ldy #3
|
|
|
|
; jsl AddTimer
|
2021-08-26 13:52:43 +00:00
|
|
|
|
2021-07-12 05:16:18 +00:00
|
|
|
:loop
|
2021-10-06 12:10:09 +00:00
|
|
|
jsl DoTimers
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-07-20 17:42:21 +00:00
|
|
|
; lda #1
|
|
|
|
; jsr MoveLeft
|
2021-10-06 12:10:09 +00:00
|
|
|
jsr UpdateBG1Rotation
|
2021-07-29 10:35:09 +00:00
|
|
|
; jsr DoColorCycle
|
2021-10-06 12:10:09 +00:00
|
|
|
jsl Render
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
inc frameCount
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal KBD_STROBE_REG
|
|
|
|
bit #$0080
|
|
|
|
beq :nokey
|
|
|
|
and #$007F
|
|
|
|
cmp #'s'
|
|
|
|
bne :nokey
|
2021-07-20 03:42:51 +00:00
|
|
|
|
2021-07-12 05:16:18 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
:nokey
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal OneSecondCounter
|
|
|
|
cmp oldOneSecondCounter
|
|
|
|
beq :loop
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
sta oldOneSecondCounter
|
|
|
|
lda ScreenWidth
|
|
|
|
cmp #150
|
|
|
|
bcs :loop
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
lda #FPSStr
|
|
|
|
ldx #0 ; top-left corner
|
|
|
|
ldy #$7777
|
|
|
|
jsr DrawString
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
lda frameCount
|
|
|
|
ldx #4*4
|
|
|
|
jsr DrawWord
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
stz frameCount
|
|
|
|
bra :loop
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
FPSStr str 'FPS'
|
2021-07-20 05:02:20 +00:00
|
|
|
|
2021-07-29 10:35:09 +00:00
|
|
|
; Move some colors around color (6 - 11) address 12 - 22
|
2021-07-20 17:42:21 +00:00
|
|
|
DoColorCycle
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal $E19E0C
|
2021-07-29 10:35:09 +00:00
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal $E19E0E
|
2021-07-29 10:35:09 +00:00
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal $E19E10
|
2021-07-29 10:35:09 +00:00
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal $E19E12
|
2021-07-29 10:35:09 +00:00
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal $E19E14
|
2021-07-29 10:35:09 +00:00
|
|
|
pha
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal $E19E16
|
|
|
|
stal $E19E0C
|
2021-07-29 10:35:09 +00:00
|
|
|
pla
|
2021-10-06 12:10:09 +00:00
|
|
|
stal $E19E16
|
2021-07-29 10:35:09 +00:00
|
|
|
pla
|
2021-10-06 12:10:09 +00:00
|
|
|
stal $E19E14
|
2021-07-29 10:35:09 +00:00
|
|
|
pla
|
2021-10-06 12:10:09 +00:00
|
|
|
stal $E19E12
|
2021-07-29 10:35:09 +00:00
|
|
|
pla
|
2021-10-06 12:10:09 +00:00
|
|
|
stal $E19E10
|
2021-07-29 10:35:09 +00:00
|
|
|
pla
|
2021-10-06 12:10:09 +00:00
|
|
|
stal $E19E0E
|
2021-07-20 17:42:21 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
; Triggered timer to sway the background
|
|
|
|
UpdateBG1Offset
|
2021-10-06 12:10:09 +00:00
|
|
|
lda BG1OffsetIndex
|
2021-07-20 17:42:21 +00:00
|
|
|
inc
|
|
|
|
inc
|
2021-10-06 12:10:09 +00:00
|
|
|
cmp #32 ; 16 entries x 2 for indexing
|
|
|
|
bcc *+5
|
|
|
|
sbc #32
|
|
|
|
sta BG1OffsetIndex
|
2021-07-20 17:42:21 +00:00
|
|
|
rts
|
|
|
|
|
2021-07-24 14:00:52 +00:00
|
|
|
AngleUp
|
2021-10-06 12:10:09 +00:00
|
|
|
lda angle
|
2021-07-24 14:00:52 +00:00
|
|
|
inc
|
2021-10-06 12:10:09 +00:00
|
|
|
cmp #64
|
|
|
|
bcc *+5
|
|
|
|
sbc #64
|
|
|
|
sta angle
|
|
|
|
jsr _ApplyAngle
|
|
|
|
jsl Render
|
2021-07-24 14:00:52 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
AngleDown
|
2021-10-06 12:10:09 +00:00
|
|
|
lda angle
|
2021-07-24 14:00:52 +00:00
|
|
|
dec
|
2021-10-06 12:10:09 +00:00
|
|
|
bpl *+6
|
2021-07-24 14:00:52 +00:00
|
|
|
clc
|
2021-10-06 12:10:09 +00:00
|
|
|
adc #64
|
|
|
|
sta angle
|
|
|
|
jsr _ApplyAngle
|
|
|
|
jsl Render
|
2021-07-24 14:00:52 +00:00
|
|
|
rts
|
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
angle dw 0
|
2021-07-24 14:00:52 +00:00
|
|
|
UpdateBG1Rotation
|
2021-10-06 12:10:09 +00:00
|
|
|
jsr _ApplyAngle
|
2021-07-24 14:00:52 +00:00
|
|
|
; Increment the angle
|
2021-10-06 12:10:09 +00:00
|
|
|
lda angle
|
2021-07-24 14:00:52 +00:00
|
|
|
inc
|
2021-10-06 12:10:09 +00:00
|
|
|
cmp #64
|
|
|
|
bcc *+5
|
|
|
|
lda #0
|
|
|
|
sta angle
|
2021-07-24 14:00:52 +00:00
|
|
|
rts
|
|
|
|
|
2021-07-30 13:01:16 +00:00
|
|
|
x_angles EXT
|
|
|
|
y_angles EXT
|
2021-07-24 14:00:52 +00:00
|
|
|
_ApplyAngle
|
2021-10-06 12:10:09 +00:00
|
|
|
lda angle ; debug with angle = 0
|
2021-07-24 14:00:52 +00:00
|
|
|
asl
|
|
|
|
tax
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal x_angles,x ; load the address of addressed for this angle
|
2021-07-24 14:00:52 +00:00
|
|
|
tay
|
|
|
|
phx
|
2021-10-06 12:10:09 +00:00
|
|
|
jsl ApplyBG1XPosAngle
|
2021-07-24 14:00:52 +00:00
|
|
|
plx
|
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
ldal y_angles,x ; load the address of addresses for this angle
|
2021-07-24 14:00:52 +00:00
|
|
|
tay
|
2021-10-06 12:10:09 +00:00
|
|
|
jsl ApplyBG1YPosAngle
|
2021-07-24 14:00:52 +00:00
|
|
|
|
2021-07-20 17:42:21 +00:00
|
|
|
rts
|
2021-08-09 11:08:09 +00:00
|
|
|
|
|
|
|
|
2021-10-06 12:10:09 +00:00
|
|
|
|
|
|
|
|