make layer y position follow hardware vstop behavior better #378
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The emulator doesn't correctly set the layer y position with relating to VSTOP changes done in line irqs halfway through the screen. Found when the following test program didn't work correctly on emulator but worked fine on hardware:
split.zip
The goal of this program is to "split open" the screen from the middle and scroll the upper part upwards and the lower part downwards. In the emulator, the layer y scroll of the lower part is not updated correctly and the effect is shown wrong (the text is not "pushed down").
note: morphinejh also found another difference in the relevant code in the emulator when compared to the Vera FPGA code where the check against VSTART seemed to be 1 off. (>= vs >) this has been changed as well.
Solution from this PR as discussed on discord: https://discord.com/channels/547559626024157184/1029612422807433269/1455760243442188373
note2: Box16 also exhibits incorrect behavior here, It is unclear to me how this solution must be ported to it because the rendering code seems to be different than in the official emulator...