Gamebuino Library for Arduboy


Arduboy can play Gamebuino. But probably all game don’t work.
It support Gamebuino library.
unsupport is SD card Library and etc.


I tested few games. thank you awesome game! :slight_smile:

  • 101 STARSHIPS by zoglu(sketch size is too big. I del sound. sry.)
  • CRABATOR by rodot
  • UFO-RACE by rodot
  • INVADERS by yoda
  • PAQMAN by yoda
  • WHG by sorunome


Gamebuino exist C Button. C Button of Arduboy is Left + Right.

Technical information

Game source code change #include.


#include <Gamebuino.h>


#include "Gamebuino/Gamebuino.h"

probably it can running.


compiler : windows Arduino IDE 1.6.9


Nice, so even more games are available for Arduboy. And one more option for the game lib :slight_smile:


1 Like

yes. arduboy added new one library. :grin:
good function is menu, messagebox.

I will steal it. and add my original library.


I wonder why. You’d think the compile size shouldn’t be much bigger than for the Gamebuino… was it CLOSE?

Gamebuino of Max Flash Size is 32256. Arduboy is 28672.

I tried compile.(Windows Arduino IDE 1.8.0)
_101starships + my library : 28910. bit over.:confounded:

by the way…
I deled game logo(title image). result : 28638

oops. sound can play game.
It was impossible in the past. probably…

I changed github. Thank you for talking about library.

Would Gambuino games work on the Arduboy or would they have to coded for it to work on the Arduboy?

They’d need to at the very least be recompiled with a library such as this one, etc.

Oh wow! I was not aware of this. So awesome!

I can add at least 20 more games to :smiley:

Thanks @akkera102


Hey @akkera102 2 questions:

  1. Why uint8_t _displayBuffer[512]; in lib_Display.cpp is not uint8_t _displayBuffer[504];?
  2. How can I expand the display area? for example to improve some Gameduino games to use the whole screen?

Just a heads up: the aspect ratio of the gamebuino is different, so attempting to increase the amount of screen it uses will mean some pixels will end up taking up more screen space than others.

Arduino: 128x64 = 2:1 = 2
Gamebuino: 84x48 = 16:9 (roughly) = 1.75

You could move it to the centre of the screen though, instead of it being shoved to the top-left of the screen.

1 Like

Sure, I do not want an automatic improvement but edit the original game to adapt everything to a bigger screen. In some cases it is quite easy, for example Digger (check it -> ) uses only 1 function to draw the game :smiley:


Oh, I thought you meant trying to scale the contents of the buffer to fit the 84x48 resolution on a 128x64 screen.

Editing the game behaviour to target a larger screen makes much more sense :P.

(This is why when I write games I try to make my drawing calculations relative to screen width/height, so that if the screen resolution changes, my drawing code adapts.)


@eried, @Pharap
thank you for comment. im glad. :wink:

yes! 512 is bad number. I think 504 is correct too. 84*48 / 8 = 504.
original gamebuino library use 512.
For that reason, i copyed my library from original. i will fix my library.

It is a difficult problem. plan is…

  1. library use Arduboy and gamebuino display buffer.
    but very big size!(504 + 1024). Gamebuino games almost use memory.

  2. library use only gamebuino display buffer + rewrite display SPI function code.
    I think fps don’t keep 30fps. but It does not have to try.

  3. library use only Arduboy display buffer + All draw function rewrite Arduboy version.
    It’s too much bother to do the rewrite.
    I think code size is too big.

  4. Gamebuino games rewrite Arduboy version.
    no comment.

my library looked like the current situation.
It may be possible if a new Arduboy(fast cpu and big memory) comes out.

aspect ratio. not simple.:sob:


Yes, I understand. I have only 1 question, how to increase the HEIGHT?

I am trying to adapt

With few changes, it works really well. For example after increasing the buffer to 124 as WIDTH, the game is much wider with small changes as:

uint8_t _displayBuffer[(LCDWIDTH*LCDHEIGHT)/8];

void Display::update(void)

	for(uint8_t page=0; page<6; page++)

		SPI.transfer(1 + page);

		SPI.transfer(((128 - LCDWIDTH) / 2) - 1); // based on WIDTH


		for(uint8_t col=0; col<=LCDWIDTH-1; col++)
			SPI.transfer(_displayBuffer[(LCDWIDTH * page) + col]);

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.

I know nothing about the Gamebuino library but shouldn’t this line>

for(uint8_t page=0; page<6; page++)


for(uint8_t page=0; page<8; page++)

to account for the difference between 48 pixels versus 64?

Also, what’s this line doing ((128 - 128) / 2) - 1) always equals -1. What did the original line do / say?

1 Like

I have pulled these lines from the Arduboy library …

#define COLUMN_ADDRESS_END (WIDTH - 1) & 127   // 128 pixels wide
#define PAGE_ADDRESS_END ((HEIGHT/8)-1) & 7    // 8 pages high

// set col address range
// 0x21, 0x00, COLUMN_ADDRESS_END,

// set page address range
// 0x22, 0x00, PAGE_ADDRESS_END

In which case, should your code be:

SPI.transfer(0x22);  // Set page address

SPI.transfer(0x21);  // Set column address

Its also clear I know nothing about the SSD1306 as well :astonished:


Perfect, conversion is almost done, thanks a lot @filmote, I played with those values but it makes more sense after your post about the pages

1 Like

Ah good. As I said, I am just guessing how the SSD1306 works.

What settings did you end up with?

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 :confused: 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?

1 Like

Your challenge is very very interesting.

The max and min value of coordinate are
0-63 in the height. 0-127 in the width.

void Display::drawFastHLine(int8_t x, int8_t y, int8_t w)
	for(int8_t i=0; i<w; i++)

it use int8_t (“char” variable). this variable use only -128 - 127.
128 is not made to be usable.

1 Like