B board · sheet 2/9 · manual page 12

The object controller sheet

The state machine that walks the object table once per scanline and decides which twenty-four make the cut.

Draft. This sheet was read from the original 1985 drawing and cross-checked against MAME, but it has not yet been walked pin by pin against a physical board. The logic described here is what the drawing shows.
This sheet is part ofHow sprites work

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

What this sheet is for

Counters and gates, and almost nothing else. 4H, 5H, 6D, 6E and 7D are 74LS161 counters; the rest of the sheet decides when they count, when they load and when they stop.

The sheet title, 24/96 OBJECT CONTROLLER, is the whole design in four characters: up to 96 objects considered, at most 24 accepted per line.

Where twenty-four comes from

The slot counter is five bits, so it can hold 0 to 31. It is preset to 8 rather than 0 and then counts up until it overflows, which gives exactly 24 counts.

Nobody chose 24 as a nice number. It is what you get when you preset a five-bit counter to 8, and presetting is free on a '161. The visible consequence is the flicker you see when too many enemies land on one line, which is not a bug but the hardware running out of slots.

96 objectsin the shared RAMscan every line/OVER96 stops it24 surviveper scanline/OVER96 = NAND(OB7, OB8): record 96 is 1100000 in binary,so the counter is stopped the moment both bits are higha 5-bit counter preset to 8and run to 31 gives 24 slots

Two separate limits, often confused. The RAM is addressed for 128 records but the scan is stopped at 96 by one NAND gate. Of those 96, at most 24 can land on any single scanline, because the slot counter is preset to 8 and counts to 31.

Restarting every line

/HINIT arrives from the sync sheet on the CPU board and resets the whole scan at the start of every scanline. The controller then has one line's worth of time to walk up to 96 records, fill up to 24 slots, and be ready again.

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