Me starting out with scrolling tiles
Posted: Thu Jul 07, 2022 12:45 am
@ZeroByte recommended I start playing with tiles by writing a BASIC program. Which turns out to be a pretty good idea!
I also dug into my Rogue Forest code, which uses Layer 0 to emulate a fog of war situation.
Et voila', my first scrolling code.
200 REM ------------------------
201 REM SET UP VIDEO REGISTERS
202 REM ------------------------
210 POKE $9F2D, %01100000 :REM MAP HEIGHT=1, WIDTH=2 = 64X128 TILES
220 POKE $9F2E, %10000000 :REM MAP BASE ADDR = 128 X512 = $10000.
230 POKE $9F2F, %11111000 :REM TILE BASE ADDR = $1F000.
240 REM ALSO, TILE HT=0, WD=0, SO 8 PIXELS X 8 PIXELS
300 REM -----------------------------------
301 REM NO SCROLLING YET, PLEASE ($9F30-$9F33)
302 REM -----------------------------------
310 POKE $9F30, 0
320 POKE $9F31, 0
330 POKE $9F32, 0
340 POKE $9F33, 0
400 COLOR 1,0 :CLS :REM 0=TRANSPARENT
500 POKE $9F29, %00110001 :REM $31=LAYERS 1,0. OUTPUT MODE=1 (VGA)
600 REM -----------------------------------
601 REM NOW SCROLL, ETERNALLY
602 REM -----------------------------------
610 FOR X = 1 TO 255
620 POKE $9F30, X
630 NEXT
640 GOTO 610