However, if I increase the HEIGHT, everything is messed (even the Gamebuino bootscreen that should be resized properly). I am sure that is something related with SPI commands but with a hint I could save the time required reading the full display controller documentation.
Basically I want to draw vertically more pixels than 48. I need a hint where that happens, or which command is related with that.
Several changes (basically making the screen size determine everything, the buffer, drawing, etc), I will post it in github or something later. The game is looking awesome, so much screen now compared to the Gamebuino.
But… I cannot draw a big rectangle now 128 as width fails, but 127 works well… there is a visible line at the end:
There is something wrong with the fillRectangle, or drawFastHLine or drawPixel when x is near the right side of the screen, maybe @akkera102 has a hint?
Basically use uint8_t or int16_t for drawing.
Frankly signed numbers make no sense for drawing absolute pixel coordinates unless you really want to accept coordinates outside the screen.
Technically speaking drawFastVLine could be made faster by filling in a whole column at once instead of filling in individual pixels (which would be a lot of unnecessary shifting and masking), though that might increase code size, I’m not sure.
Also it might be worth looking at how the Arduboy2 does drawHLine, it does it differently, which I assume means faster or smaller.
I’m guessing the original was ((ArduboyScreenWidth - GamebuinoScreenWidth) / 2) - 1, which is incorrect because of the -1, but that’s the equation for finding the X of the Gamebuino screen if centred. (I know this well because I have a helper function for calculating that that I wrote after realising how often I was trying to centre things.)
Arm yourself with knowledge:
Page 28 has some neat little tables describing some of the commands.
Page 34 onwards describe the commands individually in more detail.
Despite being the official datasheet some of the commands are very poorly described.
If you’re using a different screen or pin arrangement then it possibly won’t. It’s using low level commands that likely only work with certain screen and pin arrangements. E.g. it probably won’t work for SSD1309 screens.