So I'm getting the tile base and map base all mixed up.
100 REM -------------------------
101 REM LOAD TILES AND STUFF
102 REM -------------------------
110 VLOAD "LANDTILES.BIN", 8, 1, $1000 :REM LOAD TO $11XXX
I *THINK* this loads into $11000+ on VERA. Yes?
200 REM ------------------------
201 REM SET UP VIDEO REGISTERS
202 REM ------------------------
210 POKE $9F2D, %00000000 :REM MAP HEIGHT=0, WIDTH=0 = 32X32 MAP
220 POKE $9F2E, %10000000 :REM MAP BASE ADDR = 128 X512 = $10000.
230 POKE $9F2F, %00100011 :REM TILE BASE ADDR = $11000.
240 REM ALSO, TILE H=1, W=1, SO 16 x 16 PIX
Here's where I think my errors are. I *THINK* this sets the Map Base at $10000, and the Tile Base at $11000. HOWEVER, the tiles appear random to me, indicating that I either loaded it to the wrong place, or I set the Tile Base wrong.
400 COLOR 1,0 :CLS :REM 0=TRANSPARENT
500 REM -----------------------------------
501 REM LAYER 0 ENABLE
502 REM -----------------------------------
510 POKE $9F29, %00010001 :REM LAYER 0, OUTPUT MODE=1 (VGA)
That works. At least I'm pretty sure it works.
600 REM ------------------------------------
601 REM WRITE A SIMPLE MAP TO $10000
602 REM ------------------------------------
611 POKE $9F20, 0 :REM VRAM 7:0
612 POKE $9F21, 0 :REM VRAM 15:8
612 POKE $9F22, %00010001 :REM INCR 1, VERA $10000
620 FOR X = 0 TO 1024 :REM 32 X 32
650 POKE $9F23, INT(RND(1)*8) :REM TILE INDEX 7:0
660 POKE $9F23, %00000000 :REM PAL,V,H,IDX 9:8
690 NEXT
OK the map entries are two bytes each. The first byte is the low index of the tile. Since I only have 8 tiles, that's all I need to set.
The second byte sets the palette offset, flips, and upper index to zero.
I have set the auto increment to 1. So, that loop fills the map from $10000 to $10400. Right?
Maybe I'm setting the target address wrong? But it seems OK.
1000 REM -----------------------------------
1001 REM NOW SCROLL, ETERNALLY
1002 REM -----------------------------------
1040 POKE $9F30, 255 AND (PEEK($9F30)+1)
1050 FOR T = 1 TO 5000 : NEXT
1060 GOTO 1040
And we scroll.
So it scrolls, but.... but I'm either loading the tiles to the wrong address, or the map address is wrong, or the tile address is wrong. Or something else is wrong.