Espozo wrote:
do you know if there's a way to stop the SNES from trying to look for sprites to render prematurely (limiting the number of sprites per line, but hopefully not sprite pixels which is more important) to guarantee you can send over data?
The problem is the rendering itself, which is done during HBlank. And from fullsnes I get the impression that the behaviour is unknown. If the PPU caches the data it picks up while checking the 128 sprites during the active scanline, OAM should be free during HBlank (but the address doesn't work and cannot be rewritten, according to
byuu). If the PPU re-fetches OAM data for the 32 sprites/34 tiles during HBlank, OAM can only be freed by having fewer sprites on the following line (ie: either a fortuitous lull or a reduction in the per-line limits, which is not what you want). However, based on what byuu says I suspect it does cache the data; if this is true, the key question is whether it auto-increments when writing during HBlank.
Quote:
We aren't sure it auto-increments at all?
No, it auto-increments when in VBlank or forced blank. During HBlank, though, the CPU-side OAM address is invalid, and it's not known what the internal behaviour is.
Quote:
93143 wrote:
but that's... really extreme.
How?
DMA alignment is not trivial to cope with (it kicks the timing slightly depending on the length of the most recent instruction cycle and on how long it's been since reset), and if you're running HDMA you have to deal with it happening every line on top of whatever else you're doing... This means that (a) if you're using HDMA you can't rely on having 1324 cycles per line (1364 minus 40 for DRAM refresh), because the HDMA will eat a variable amount, and (b) you can't pick an arbitrary line to do your DMA on, because it will snap to a dot-pair boundary and you have to keep track of the alignment pattern (which flips every two frames) to decide what to write when.
If the OAM requires half-dot timing precision to target a particular byte/word, you'd have to do the writes manually because DMA can't do that. And since IINM there's no way to directly get half-dot position on the CPU side, you'd have to figure out a way to test with actual writes in the middle of an active frame, which may be impossible.
If it requires quarter-dot precision (which I doubt), you're out of luck, because there's no way to do that at all; nothing the S-CPU ca do takes an odd number of master cycles...
That's not even getting into DRAM refresh, which seems to have some weirdness around the edges that's different between revisions...
Quote:
I do see one problem with this though, and that's DMA during active display, which means you can't use HDMA if you're trying to target a 1/1/1 console.
Nah, that's not an issue. Probably. The timing requirements for this (assuming it's even possible, which has not been established) would be so stringent that for a programmer capable of pulling it off, failing to avoid the lockup bug as described would be like a veteran bus driver crashing into a house. Now, if there's another way to trigger the bug that isn't known yet,
that could give you trouble...