1-Bit Rogue for Arduboy


(Pharap) #27

It’s possible to use inline assembly in the Arduino IDE because it uses GCC to compile code.

There’s some good guides here:

If AVR Builder can output non-compiled assembly,
it would be possible to translate that into a GCC asm volatile block.

I still do that sometimes if I’m trying to solve a particularly hard problem.


#28

Cool didn’t know about the goto labels. That 2nd link has been very useful for me to get to use inline assembly.


(Evgen) #29

Report on the work done:

1 Added support for ATmega32u4 in the Algorithm Builder (more or less - I hope this will be enough). Has already blinked a LED :yum:
2 Get Arduino pro micro, breadboards, OLED display for homemade Arduboy.


The probability of successful porting is increased :+1:.

If porting is successful - there will be a small but interesting bonus)

p.s. I accidentally erased the bootloader pro micro (.
I forgot that its size is 4kB in contrast to the pro mini, which it has 2kB.
The bootloader returned, but I’ll have to cut the sprites somehow …


#30

I like the way you’ve added a reset button to the Pro Micro.

If you run into space problems maybe some of us here can help you on squeezing down the size. For development or as a very last resort* you could use my Cathy2K bootloader It is also included with the HomeMade Package. Updating the bootloader though the Arduino IDE will also burn the proper fuse settings.

*Some Arduboys do not have a protected bootloader. When someone tries to flash a game/sketch larger than 28K they will corrupt the bootloader and brick their Arduboy.


(Pharap) #31

@GetChiper
To clarify: this is fixable, but it requires uploading a new bootloader with a suitable programming chip.
Quite a lot of the Arduboy’s users aren’t technically skilled enough to be able to do something like that on their own.


(Evgen) #32

About the program size is too early to think.
So far, I’ve removed three mobs.
After a successful port, I’ll think about what to do about it.


(Evgen) #33

I begin assembling arduboy.
Have questions.
I have a display with driver SH1106 - is it OK?
The sound created by the arduboi is formed only by a Timer4 or jointly by a Timer4 and a Timer3?
Is it necessary to connect the second leg of the speaker to the chip (PC7) for a full sound?


#34

The speaker should be connected to 5 port C6.
I think the speaker
DO NOT use a speaker (resistance too low, must add a in-line resistor of…10K.)
Piezo speaker(beeper) are okay.
I assume they are connected to 5 port C6 and GND.


You got pretty much everything you needed.


Now for the display part.
The original display on Arduboy is SSD 1306, so if you want maximum compatibility…
Or, use one of those libraries by @Mr.Blinky


(Scott R) #35

@GetChiper with the pro micro you have you can solder directly to the unused pins for higher compatibility.

If you need anyone to test on actual hardware feel free to ask a few of us have various screens and are able to repair our hardware.


#36

The SSD1306 used in Arduboy also supports the page mode used by SH1106 so it shouldn’t be a problem. Only the display initialisation code needs to be different.

For the sound it depends what library you use.
ArduboyTones and ATMlib use the pin to boost the volume.
IIRC ArduboyPlayTune plays different channel on each pin.

Like @Keyboard_Camper said you can break out the missing pin.

Are you using the Arduino IDE to port the game or that graphical assembler ?


(Evgen) #37

I have a display with the driver ssd1306 only in version I2c.
I will port for the display sh1106, then I’ll make an option for ssd1306 (with your help in testing).
In any case, I need an original Arduboy scheme, since I will be porting the game in my programming environment.
This scheme is correct for the original Arduboy? https://community.arduboy.com/t/production-arduboy-schematic/702
If the circuit is correct, then where is the CS connected to the chip pin?
I will be soldered directly to the crystal pins, if necessary.


(Scott R) #38

CS is PORTD6 this can be connected to the pin on the MCU as per @Mr.Blinky’s image above

For a handy reference I recommend following the Arduboy / Leonardo wiring here

This would be PIN number 26 on the MCU

https://www.arduino.cc/en/Hacking/PinMapping32u4


#39

Sure. I’ll help out where I can.

Yes it’s the schematic of the production Arduboy. But there are a few details missing. CS is connected to Port D6 labeled D12/A10 in the schematic.

During development you can connect the displays CS to GND so you don’t have fragile wires on the breadboard setup. You can do the same for the 2nd speaker pin.


(Evgen) #41

Now everything is clear.
Thanks to all. I begin the assembly.


(Evgen) #42

With the assembly of home-made arduboy and porting the game everything works out well.
The video shows the display sh1106.
I got the display of ssd1306 and will try to make a game on it.
While there is still a problem with the size of the memory, but after I change the sprites (they are now color), the space will be enough.
Work continues!


(Scott R) #43

It’s fantastic to see this making progress :+1:t2:


#44

Great to see you’ve made so much progress :+1:


#45

Actually, @Mr.Blinky say that if your game work fine on SH1106 then it is going to work with SSD1306 without change (because SH 1106 cannot do page mode and need a command, but that commend is OK for SSD 1306.)

Memory is always a issue, for big games.
But not a very big issue. Hope the best.


#46

Without modifications there will be a 2 pixel horizontal shift. That’s why a change in the display initialisation is required.

Building for SSD1306 display is quite easy with the Homemade package though: just select Arduboy or SSD1306 display from the tools menu and do a recompile or a sketch export


#47

But that is essentially the same as any OFFICIAL(not hacked by Blinky) Arduboy library
@GetChiper Are you using the library by Mr.Blinky?