Implement HBlank OAM staging behaviour to match hardware#3756
Implement HBlank OAM staging behaviour to match hardware#3756felixjones wants to merge 9 commits into
Conversation
|
This probably also fixes #2048. Please cross-check. fwiw, I'm not sure how I feel about this approach. I also don't intend to merge this before 0.11 regardless, but it is something I was targeting for fixing in 0.12 regardless. |
Yes can confirm #2048 is also fixed
I struggled to think of a better approach, considering real OAM writes still need to happen. Double buffering them was all I could think of |
|
The way I was planning on implementing this is by doing what actually happens on hardware: it renders the OAM to another buffer a frame early and then compositing into the final image, then rendering the current state of OAM to that buffer. This may require another buffer to do efficiently, but so be it. |
|
That way I believe does not require modifying the API, which is something I want to avoid here since it would break mVLs |
… next line of OAM at the start of HBlank
Looked into rendering the incoming line of OAM at HBlank start with the goal of not modifying the API, feels much cleaner as it's shuffling existing code around, but what do you think? |

Encountered the same issue in a game project I am working on where 1px thick lines rendered with OAM sprites are rendered on the wrong scanline
Fixes #1871 by staging OAM to the renderer 1 scanline earlier
This is similar to how NanoBoyAdvance solved it nba-emu/NanoBoyAdvance@eda1af7
A lot of this is a copy-paste of
*WriteOAMand then modified for the staging concept, so the approach might be a bit unwieldyAnd I couldn't for the life of me get the cinema locally set up, so that cinema test I added was a guess and uses a screenshot from this particular change