I'm trying to print some rows of a char from the top and bottom, first row turns out as expected but next one doesn't print. I add 40 chars to "Currentline" to get the prog to print the next row, well - that was what I thought would work. It won't print, but if I set "Currentline" to 40 from the start it prints on the next row.
What am I doing wrong?
/*
****************************************
* Really awesome code by Cri33e - 2022 *
****************************************
*/
*=$2000 // Startas med sys8192
.var ScreenCTop_Adress = $d7ff
.var ScreenCBottom_Adress = $dbbf
.var ScreenTop_Adress = $03ff
.var ScreenBottom_Adress = $07bf
.var Currentline = 0
.var Char_color = 3
.var HowManyRows = 4
Next_row:
lda #Char_color
ldy #20
ldx #40
loop1:
sta ScreenCTop_Adress+Currentline,x
sta ScreenCBottom_Adress-Currentline,x
tya
sta ScreenTop_Adress+Currentline,x
sta ScreenBottom_Adress-Currentline,x
lda #Char_color
dex
bne loop1
lda Currentline + 40
sta Currentline
ldx HowManyRows
dex
stx HowManyRows
bne Next_row
rts
enter code here