C board · sheet 1/3 · manual page 20

The horizontal scroll sheet

Sixteen chips, and about half of them exist to perform one addition fast enough to keep up with the beam.

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

The main CPU writes a horizontal scroll position to C808 and C809 - two bytes, because the world is wider than 256 pixels. 2A watches for those writes and wakes the right register; 4C holds the number and 6C carries its ninth bit.

Then the adders. 3D, 4D and 5D add that scroll position to the raw horizontal count coming from the sync sheet, and the sum is what addresses the map. This is the entire mechanism of scrolling, and its cost per pixel is zero.

The '86 packs at 1D, 2D and 6D mirror the horizontal position for a cocktail cabinet, coarse and fine, and 9E distributes the flip signal so every corner of the board flips together.

THE ONE PIECE OF ARITHMETIC THAT MAKES THE WORLD MOVEH COUNTERwhere the beam is4C / 6Cscroll register3D 4D 5D'283 addersSH BUSinto the map

Nothing is copied and nothing moves. The scroll position is added to the beam position before the sum reaches the map memory, so the hardware simply looks somewhere else than it did last frame.

Fetching a tile in eight steps

A tile is eight pixels wide, so the machine gets eight dot clocks to look up which tile is here, what colour it wears and what its pixels are. 7D counts off those eight steps and marks the moment for each lookup; 8D lines those moments up against the pixel clock.

9D is the referee for the map memory, handing the CPU a brief window to edit the world and then giving it straight back to the display - the same alternating-turns idea used for the character memory on the A board, implemented differently.

7E patches the horizontal count where the scan line runs longer than the visible picture, which stops a seam appearing at the edge of the screen.

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