Let me explain a bit more about what is happening when you see "Rolling Start":
1. The tile generator has 4 layers each of size 512x512 pixels: A, A', B, B'.
2. Imagine the 496 pixel display area (in fact, the entire 512 pixel display line, too) can be divided into 32-pixel wide columns. Each tile is 8 pixels wide. So if hscroll=0, each column contains 4 tiles. If hscroll&7 != 0, the tiles are shifted and a column might contain 4 tiles plus a partial tile.
3. For a given scan line, within any of these columns, only
two of the 4 layers may be displayed at a time. Tiles from
either A
or A' (but never both), and tiles from
either B
or B'.
3a. Put another way, for any pixel on the screen, only
two tile layers were drawn: a bottom layer and a top layer (the bottom layer is visible only if the top layer pixel is transparent). These two layers are one of A/A' and one of B/B'.
4. The selection between e.g. A or A' is determined by a bit mask layer that I call the "stencil mask" or simply "mask" (in the giant comment at the top of the file, I have a section describing it). There is a mask for each of the 512 lines (384 visible lines). The mask is 512/32 = 16 bits.
5. The mask is
not affected by scrolling. It operates on the screen after scrolling has been performed.
What is happening with "Rolling Start" is that this text is being scrolled across the screen but, without the masking logic, it would wrap and repeat. So it would look like two banners repeating closely one after another. The mask is used to hide part of it and only display one instance. If you print out the mask values for one of the banner lines, you will see bits shifting across the screen in sync with scrolling, something like:
- Code: Select all
Frame 0: 0000 0000 0000 0000
Frame 1: 0000 0000 0000 0001
Frame 2: 0000 0000 0000 0011
Frame 3: 0000 0000 0000 0111
Frame 4: 0000 0000 0000 1111
Frame 5: 0000 0000 0001 1111
...
Frame N: 0001 1111 1100 0000
Frame M: 0011 1111 1000 0000
...
Here I've pretended that the banner is 7 columns wide -- I don't remember the actual value. It's longer, though. As "Rolling Start" scrolls across the screen, every 32 pixels or so, the game should be updating this mask. Somehow it's off.
At the edge of the banner, the mask doesn't line up. It is pretty easy to modify the tilegen code to draw the mask and you'll see the misalignment. This could be due to frame timing or it could be that there is some sort of fixed pixel offset applied to the mask. I can't remember if MAME applied a fixed offset. I also can't remember what Charles MacDonald's excellent System 24 document said about this topic. But I did at one point dig into both and couldn't find anything that worked correctly. If I fix the problem by adding a fixed offset, Magical Truck Adventure or some other game breaks (the attract mode has some scrolling text and I *think* it also uses masking).
I hope that made sense.