B board · sheet 5/9 · manual page 15

The first line buffer sheet

One scanline of sprite pixels, being built while the previous one is still on screen.

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

12N, a CXK5808P, and 13N, a TMM2018, hold one line of assembled sprite pixels. The counters at 10L, 10M and 10N walk through it.

This sheet and the next are near-identical twins, and that is the whole point.

Why there have to be two

A single buffer cannot work. You would be writing the pixels you are simultaneously trying to read out, and the beam does not stop to let you finish.

So there are two, and their roles swap every scanline. While one is being read out to the screen, the other is being filled with the next line's sprites. The engine is permanently one line ahead of the beam, which is exactly the amount of time it needs.

Commando does the same thing on its own object board. The idea was clearly considered settled and was carried straight across.

buffer Abeing filled for line n+1buffer Bbeing read out on line nswap every lineroles exchangethe engine is always working one line ahead of the beam

One buffer cannot work: you would be writing the pixels you are simultaneously trying to display. Two buffers, swapping every line, means the sprite engine has a whole scanline of time to build the next line while the current one is read out.

Clearing as you go

A buffer must be blank before it is filled, or last line's sprites bleed into this one. Rather than spend time clearing it, the hardware blanks each location as it reads it out. By the time the buffer swaps roles it is already empty, and the clearing cost nothing.

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