
Regarding those remaining glitches, please check what I wrote here about re-fetching of sprite Y coord and size:
viewtopic.php?f=22&t=2604&start=15#p31287
Looks like it affects your emulator as well
Moderators: BigEvilCorporation, Mask of Destiny
BlastEm had these too and I believe fixing that is what got rid of them.Kabuto wrote:No idea what causes the vertical stripes in the 3rd pic, though, incorrectly emulated illegal plane modes maybe?
The bit about masking the calculated tile row is also important here, though only after re-fetching the Y coordinate works of course. Threw me off a bit at first because the artifacts look somewhat similar in that there are periodic glitched lines, but the re-fetching issue has glitched lines in a fixed position on the screen whereas the latter has them mapped to the surface of the cube/prisms.Kabuto wrote:Regarding those remaining glitches, please check what I wrote here about re-fetching of sprite Y coord and size:
Yes,that was it. Genesis Plus correctly emulated all illegal plane sizes except two ("10 10" and "10 11" in above list) where the row index was not completely masked as it should (which indeed results in 32x1 plane size). Using a different row index shift value for computing VRAM base address (14 instead of 0 in current implementation) indeed fixed that issue.Mask of Destiny wrote:BlastEm had these too and I believe fixing that is what got rid of them.Kabuto wrote:No idea what causes the vertical stripes in the 3rd pic, though, incorrectly emulated illegal plane modes maybe?
Re-fetching next line active sprite attributes when SAT is written mid-line improved this a bit but I still have some (but different) errors, although the 5-bit row masking should be correct: (line-ypos) & 0x1FMask of Destiny wrote:The bit about masking the calculated tile row is also important here, though only after re-fetching the Y coordinate works of course. Threw me off a bit at first because the artifacts look somewhat similar in that there are periodic glitched lines, but the re-fetching issue has glitched lines in a fixed position on the screen whereas the latter has them mapped to the surface of the cube/prisms.Kabuto wrote:Regarding those remaining glitches, please check what I wrote here about re-fetching of sprite Y coord and size:
Are you preserving the list of sprites determined to be on the current line when you do the re-fetch (sounds like maybe that's what you are doing, but it's not 100% clear)? Correct rendering relies on sprites showing on a line based on the old Y value even though the new Y value would cause them to not be displayed on the current line.Eke wrote:I am doing it in a naive way though (re-fetch all found sprites attributes if writes happen after phase 1 and before the start of phase 2, based on the number of active sprites found during phase 1)
Yes, the link value of active sprites is now saved during the sprite "parsing" phase (which, in Genesis Plus - and most line-based emulators - does visible sprite detection and all attributes fetch in a single phase) then, if SAT is modified by VRAM write before the end of the line (or more correctly before active sprite attributes have been evaluated), all attributes are simply fetched again (from internal cache and VRAM).Mask of Destiny wrote: Are you preserving the list of sprites determined to be on the current line when you do the re-fetch (sounds like maybe that's what you are doing, but it's not 100% clear)? Correct rendering relies on sprites showing on a line based on the old Y value even though the new Y value would cause them to not be displayed on the current line.
Yes, by "start of phase 2" I meant the time when the first active sprite for the upcoming line is being evaluated (which would indeed correspond to the end of phase 1 if there were 20 active sprites), this was in reference to Kabuto's post indicating the writes should occur "between " phase 1 and phase 2.Mask of Destiny wrote:Also, this is probably overly pedantic and perhaps already obvious, but the writes technically happen during phase 2 not between the phases. They just manage to stay ahead of when an individual sprite is evaluated through a combination of the unused slots being pushed to the front and the used slots being evaluated in sprite list order. For that reason, you'll probably want to do that re-evaluation fairly late in the line if that is not already the case.