I thought I would explain a little and realized I change even the slow star character every frame, even though it only moves every other frame. Maybe I should have implemented it differently.
Anyway, this code:
Code: Select all
ldx #0 ; Edit slow character
ml4:
lda #0
cpx slowchar
bne ml5
lda #8
ml5:
sta VDP_Data_Write
inx
cpx #8
bne ml4
fills the character for the slow star with zero except on the row specified by slowchar, where it puts 8 instead (the star).
So, by increasing slowchar the star moves down one pixel.
The routine is exactly the same for the fast star.
Then, this code:
Code: Select all
ldx fastchar ; Change vertical position of star inside fast character
inx
cpx #8
bne lo3$
ldy #16
jsr move_stars ; Move fast character
ldx #0
lo3$:
stx fastchar
increases the value of fastchar by one every frame, until it reaches eight, when it resets to zero (so the star will be in the top of the character again).
When it resets to zero, I also call the routine move_stars, which moves the character down on the screen.
I hope that explains it a little.