zeta0134 / LuaGB

A gameboy emulator written in pure Lua. Work in progress.
BSD 3-Clause "New" or "Revised" License
410 stars 33 forks source link

Some tiles are incorrectly flipped in the game window, while remaining correct in debug panes #15

Open zeta0134 opened 5 years ago

zeta0134 commented 5 years ago

Occasionally, some background tiles are flipped incorrectly when appearing onscreen, even though the debug view reading the same attribute table displays things correctly. A couple of examples, there may be more:

zoos_intro_flipped_tile smb_toybox_flipped_tiles

Curious observation: These tiles so far appear exclusively on the bottom row of the game screen, but are not always on the bottom row of their respective tilemaps. Might just be a coincidence between the test examples I've produced so far.

I suspect something's getting desynced between the VRAM writes the game is making and the display cache that the graphics module maintains. It feels like an off by one error, or some issue with a bitmask, but I have no idea where it is.