C board · sheet 2/3 · manual page 21

The scroll video RAM sheet

The world itself: one byte per tile saying what sits there, plus the vertical half of the scrolling arithmetic.

This sheet is part ofHow the background scrolls

The subsystem followed end to end, across every sheet that builds it.

What this sheet is for

2B is the map. Every byte in it names the tile at one spot in the landscape, with a parallel attribute giving that tile its colour set and its mirror flags. It lives at D800 to DFFF in the CPU's address space.

Storing the world as tile numbers rather than pixels is what makes a large landscape affordable. The ground repeats constantly, and each repetition costs a single byte.

The vertical scroll works exactly like the horizontal one on the previous sheet. 5C holds how far the player has advanced, 6C adds its top bit, and the '283 adders at 5E and 4E add that to the current line number. 3E freezes the line number once at the start of each scanline so the whole line is drawn from one steady value.

Sharing the map with the CPU

The display reads this memory constantly and the game needs to write to it as the world scrolls in. The '157s at 1A, 1B and 1C switch its address between the CPU and the display, 2C makes sure a CPU write can only land inside its allotted window, and 3C is the hatch the game code reaches through.

Once a tile number is read, 4A holds it and hands it to the artwork ROMs on the next sheet as an address, while 3A holds what else the map said about it. 3B retimes the colour choice so it arrives at the same instant as the pixels it belongs to, and 4B is the last stop before the picture leaves the board: three pixel bits and four colour bits, stepping out together over the ribbon cable.

Every chip on this sheet

Click any of them to open the schematic with that chip selected in both panels.

← open the schematic for this sheet