deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
276 stars 35 forks source link

Prince of Persia - some flickering garbage rendered in the upper few lines of the screen #73

Open ESPboy-edu opened 1 year ago

ESPboy-edu commented 1 year ago

Prince of Persia - some flickering garbage rendered in the upper few lines of the screen used last release - peanut_gb.h gb: fix BG over OBJ with colour 0

deltabeard commented 1 year ago

Confirmed. Do you know if this flickering occured in a previous version or did a recent change cause this?

deltabeard commented 1 year ago

I think the issue is that the VRAM address mode is not being switched back to 0x8800 mode in time after switching to 0x8000 mode for the text on the bottom of the screen. This seems to only occur on screens where there are animations (so the flicker stops when the game is paused).

Maybe the VRAM address mode change is initiated after the LCD begins drawing the line? This will require some investigation.

deltabeard commented 1 year ago

Please try the latest commit (bbf094a2c75178e5b2e3962d3d0c1d783e8848c0).

ESPboy-edu commented 1 year ago

Using last 88aacda I see one blinking line at the bottom between main game screen and bottom status line (blinking somehow connected to the torches on the walls)

deltabeard commented 1 year ago

This issue still persists on the ppu-fix branch with commit fcb42682129243e34e6446eadb5e654778b35933. The flickering is still on the bottom of the screen. No doubt because the timing of the PPU is still poor. PRINCE_OF_PERSIA