
So the conclusion was the sprite aren't display in some lines because the vdp don't have time to fetch all sprite data because of the display is re-enabled too late?
So there is no sprite masking effect in this game?
Moderator: BigEvilCorporation
It appears the recently released Overdrive demo is somehow using similar feature to hide some sprites (the infamous "your emulator suxx" textTascoDlx wrote: However, since the VDP fetches the majority of the sprite patterns during this time, and since any scheduled fetching is NOT performed while the display is disabled, this severely reduces the number of sprite pixels that can be displayed on each line. Mickey Mania uses this effect to mask background sprites on these lines.
From experimentation, it appears the number of sprite pixels that may be displayed on each effective line is around 120-128. The limit is not that noticeable during gameplay as it usually only occurs on a few lines for a short time. For lines that don't have foreground sprites on them, the limit is hit by the masking sprites (160 sprite pixels).
TascoDlx wrote:In the sprite table, the ypos and size of the "masking" sprites are irrelevant. The only item I'd expect to be relevant is the link. That would indicate that the number of "masking" sprites is what's important.
Based on where rendering resumes after VBLANK, I'm fairly certain SAT cache scanning starts on the 4th sprite rendering slot. It needs to be complete (or at least mostly complete) before the first slot that reads the uncached portion of the SAT (slot 53 if you consider the first sprite render slot as 0). My current assumption is that the VDP can scan 2 sprites per slot, but I've been meaning to test that and try to verify exactly which slots have sprite scanning.Eke wrote:
My theory is that there is something more going on during HBLANK than just filling sprite line buffer and that this is actually sprite Ypos/Size pre-processing from internal cached SAT. The sprites that are supposed to be masked are indeed located at the end of the linked sprite list and it seems that disabling display during the start of HBLANK not only reduce the number of sprite pixels rendered for the upcoming line but also reduces the number of sprites (usually 80) that can be parsed from the internal SAT cache for the next line.
Correct, but there's something else worth mentioning. There is an important difference between the methods of Overdrive and Mickey Mania. Overdrive actually aligns the DMA operation. It fills the VDP FIFO and then NOPs a bit so it basically knows at what pixel the transfer occurs. (In MM, if you move the transfer period into the active display, you can see the starting position varies wildly from line to line.) Also, during the "YOUR EMULATOR SUXX" scene, the number of sprites is fixed, so the break occurs at the same point in the list every time (though there are a couple buffer sprites, so it could vary a little).Eke wrote:The difference however is that, contrary to Mickey Mania, twhen there are preceding sprites on the same line (the "spinning" titan message), the amount of rendered sprite pixels does not hit the sprite "pixel" limit resulting from the display off period (~128 pixels according to TascoDLX tests, 144-160 pixels theoretically when using Nemesis timings table). Also, there are lines where the only sprites are the ones that should be masked !
Indeed, though the number of "masking" sprites is not entirely irrelevant. It's just part of a solution for this particular case.Eke wrote:My theory is that there is something more going on during HBLANK than just filling sprite line buffer and that this is actually sprite Ypos/Size pre-processing from internal cached SAT. The sprites that are supposed to be masked are indeed located at the end of the linked sprite list and it seems that disabling display during the start of HBLANK not only reduce the number of sprite pixels rendered for the upcoming line but also reduces the number of sprites (usually 80) that can be parsed from the internal SAT cache for the next line.
Note that this also fits with this initial observation from TascoDLX, except the number of "masking" sprites is not relevant, the indexes of the "masked" sprites in parsed internal SAT are.
There's a bit of latency between when the write happens and when the display is actually disabled. I doesn't matter whether the FIFO is full or emtpy.Kabuto wrote:* It appears that on real MD the "display enable" has to wait until the FIFO is empty (or is it queued in as well?).
Because DMA transfers go through the FIFO, it's possible for the DMA to complete before all the data is actually written to the target RAM. Between the latency on the display enable and the slowness of the 68K relative to the VDP its hard to re-enable the display too early. Maybe you can run into trouble with VRAM since it's byte-wide (and thus the FIFO takes at least twice as long to empty), but for CRAM (and presumably VSRAM) I haven't seen it be an issue on real hardware.Kabuto wrote:In Exodus, re-enabling the display after the DMA causes the last few DMA words to be written as if the display wasn't disabled. Inserting NOPs before re-enabling the display gave an improvement in Exodus but not on real hardware (only made it worse IIRC).