A board · sheet 6/8 · manual page 28

The character video RAM sheet

The score, the lives, the word COMMANDO on the title screen. A fixed grid of text that never scrolls, and a neat answer to the problem of two things wanting the same memory.

This sheet is part ofHow a frame is drawn

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

What this sheet is for

The text layer is 8-by-8 tiles at D000 to D7FF, two bits per pixel, sitting on top of everything else on screen. This sheet holds that memory, at 7F, and builds the address that reads it.

The address comes from the screen counters, not from the CPU: 7J, 7K and 6K assemble it from the H and V counts arriving from sheet 5/8, with the '86 packs at 4J, 5J and 6J exclusive-ORing those counts when the cabinet flip is on. Walk the counters and you walk the screen.

Each cell is two bytes, fetched one after the other: a character number and an attribute. 6E and 6D catch the number and pass it to the shape ROM on the next sheet; 7E and 7D unpack the attribute into the colour and the per-character flips.

Sharing the memory, cheaply

The interesting problem here is not graphics, it is contention. The display must read this memory continuously, and the CPU wants to write to it whenever the score changes.

The answer is to alternate on H4, a single bit of the horizontal counter. Half of every character cell belongs to the display and half to the CPU, forever, whether or not either side wants it. 4K supplies that tick, 6F times the display's grab, 3E notices when the CPU is reaching for the memory and 4H grants it its turn.

There is one concession to reality. If the CPU asks at exactly the wrong moment it cannot be made to wait by the schedule alone, so 5H stretches its clock for a beat. That is the whole arbitration scheme: a counter bit, a few multiplexers, and one gate that can slow the processor down. No arbiter chip, no wait-state logic, no bus protocol.

6H is the doorway the CPU's data passes through and 3F opens the write, but only inside the CPU's sliver of time.

ONE CHARACTER CELL = 8 PIXELS = 8 DOT CLOCKSDISPLAYCPUDISPLAYCPUDISPLAYCPUDISPLAYCPUH4 - one bit of the horizontal counter - is the only thing decidingno arbiter, no wait request, no handshake

The text memory is shared by alternating on a single counter bit. The display gets one half of every character cell and the CPU gets the other. Neither side asks permission, because the schedule is fixed and both are clocked from the same crystal.

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