agg23 / openfpga-arduboy

Arduboy for Analogue Pocket
GNU General Public License v3.0
57 stars 2 forks source link

101 Starships glitching #4

Open Noname1122 opened 1 year ago

Noname1122 commented 1 year ago

On firmware beta 2, when loading 101 Starships, the title screen flashes and is not comprehensible. Upon pressing A to start the game blindly, you can only see the bottom-most few rows of pixels, but placed way up high towards the top of the display. It almost seems like the whole display is displaced 90% upward (and maybe rightward, and scaled?)

(I so appreciate your efforts, this is so cool!)

uXeBoy commented 1 year ago

@agg23 - 101 Starships is a port from the Gamebuino, and uses page commands when updating the display:

https://github.com/akkera102/08_gamebuino/blob/master/src/_101starships/lib_Display.cpp#L106

Again, like https://github.com/agg23/openfpga-arduboy/issues/8 it seems that the OLED emulation isn't interpreting the commands properly? The visual glitch described above would be because all eight 'pages' are being written over each other at the top of the screen...

agg23 commented 1 year ago

The OLED implementation is missing proper handling of many commands, including the page memory mode that all of these broken games seem to be using. I'm curious @uXeBoy if your OLED controller handles these properly, because I don't understand what your code is doing for the set page address (0x22) command: https://github.com/MiSTer-devel/Arduboy_MiSTer/blob/master/rtl/vgaHdmi.v#L65-L69

uXeBoy commented 1 year ago

I've created a pull request - games in the Arduboy library only use a few OLED commands, and use them in predictable ways. The 0x22 command used by the Gamebuino ports just needs to advance the buffer address to the next 'page' to resolve those glitches.

And the 0xB0-0xB7 page commands are only necessary for a couple of games, like ZooEscape:

https://raw.githubusercontent.com/eried/ArduboyCollection/master/Action%2FZooEscape%2FZooEscape.hex