While that would technically work, the screen linked to claims to be a regular SSD1309,
and if that’s the case then there’s actually a much simpler way to invert it.
Looking at the datasheet:
Based on the diagrams on page 42 and 43, it seems that the “Set COM Output Scan Direction” command (either
0xC8) will invert the order in which the data is displayed on the screen.
So all you’d have to do, @ewhizz, is to insert that command into the screen boot sequence (
Arduboy2Core::lcdBootProgram), or if either
0xC8 is already present, simply replace it with the command you need.
Do you know which port of the Arduboy2 library you’ll need to use yet?
I know that with an SSD1306 it’s possible to invert both the vertical and horizontal axis because a long time ago when I was writing a port of Arduboy2 for a different console I discovered that Arduboy2 does actually provide
flipHorizontal functions, so I had to work out how those function so I could port them.
I can’t remember which way around it is, but one works based on the data already sent to the screen and the other actually won’t do anything until you send another frame of data to the display. That’s unlikely to matter in 99% of circumstances, but it’s worth noting just because it’s somewhat surprising.
Note that the source for
flipVertical reveals that
0xC8, so SSD1306 clearly shares those two commands with SSD1309.
0xC8 is included in the screen boot sequence, I’m not sure whether that means that the Arduboy’s screen is actually ‘upside down’ as well.