/ESP32_Arduboy

ESP32 port of ESPboy port of the Arduboy2 library to compile, run and play Arduboy games

Primary LanguageCOtherNOASSERTION

ESP32 port adapted to work with DFRobot Transparent OLED and ESP32-C3

Beetle C3: https://www.dfrobot.com/product-2566.html

Transparent OLED: https://www.dfrobot.com/product-2521.html

breakout_2

The buttons are connected to pin 3 following http://www.ignorantofthings.com/2018/07/the-perfect-multi-button-input-resistor.html with resistors 1k Ohm for R1 and 32k, 15k, 8k, 4k, 2k and 1k for the buttons.

Capture

TODO:

  • Implement detection of individual keys
  • Think on sound/RGB led support (maybe on pin 10?)

ESP32 port of the ESPboy Arduboy2 library

ESPboy (ESP8266 gadget) port of the Arduboy2 library

This port of "Arduboy2" and "Arduboy PlayTones" libraries from Arduboy project intendet to run on ESPboy project and thorougly simplified.

It supports ESPboy buttons, LED, sound (thanks to ported "Arduboy PlayTones" library) and TFT display.

This port compiles for ESP8266 ESPboy, existing Arduboy2-compatible games and apps. Some of them can use it as a drop-in replacement for the original "Arduboy2" library, other games will run after the slight modifications.

Migrating the game from Arduboy to ESPboy

  1. replace the "Arduboy2" library and "Arduboy tones" library in your Arduino Studio libraries folder with this versions.
  2. do ingame modifications according to following notes:
  • change "#include arduboy.h" to "#include arduboy2.h"
  • some games use a function pointer arrary to pass control to different part of the codes as the game state changes. In ATMEGA32U4 the memory address are 2 bytes (single word) long, in ESP8266, the memory addresses are 4 bytyes (doube word) long, So you need to change all "pgm_read_word" to "pgm_read_dword"
  • if EEPROM is used by the game to keep configs/high scores, -- add EEPROM.begin(100) at setup() // 100 is just a rough max no. need to check the size -- add EEPROM.commit() after the last EEPROM.put(), EEPORM.write() and EEPROM.update() of each blocks of code.
  • remove any reference to the "ATMlib", "ArduboyPlaytune" that require timers to play back ground musics. That libraries has not yet been ported
  • games that directly control the SPI or I2C bus to write to OLED display need much more work to port instead of the simple steps above.
  • font() array is used in TFT_eSPI display library so you have to chage all "font" to "font_"
  • min() and max() macros are used in TFT_eSPI display library so you have to chage all min() and max() to minVal() and maxVal() correspondenly

Advantages of ESPboy (ESP8266)

  • 8 keys
  • TFT color LCD 128õ128
  • Faster MCU 80Mh/160Mhz
  • RGB neopixel LED
  • More memory for program and data. http://0x04.net/~mwk/doc/xtensa.pdf
  • Internal flash memory mounted as SPIFFS disk 4-16mb for additional data
  • WiFi onboard, opens up possibility for online games, top scores posting online
  • OTA (on the air firmare update) update the firmeare through WiFi from a web site, the same way as Android playstore/ Apple istore.
  • Cheaper overall cost

Credits and Documentation

99% of the work on the library was done by the contributors to the following repositories:

Arduboy2 library:

Arduboy tones library:

And all the ARDUBOY COMMUNITY!

Please do read through the extensive documentation included there.

There are a few games in this package

Check the LICENCE files in every folder!

If authors against posting the code in this repository for the purpose of learning programming and fun, please let me know, i'll remove it.

  • Catacombs of the damned (MIT) by James Howard
  • Mystic Balloon (MIT) by TEAM ARG
  • Sirene (MIT) by TEAM ARG
  • Arduventure (MIT) by TEAM ARG
  • CastleBoy (MIT) by jlauener
  • Dark And Under (BSD-3-Clause) by Garage Collective (Cyril Guichard (Luxregina), Simon Holmes (Filmote), Pharap)
  • HelloCommander (MIT) by Felipe Manga (FManga)
  • Blob Attack (MIT) by TEAM ARG
  • Virus-LQP-79 (MIT) by TEAM ARG
  • Kong-II (MIT) by Vampirics and Filmote
  • LodeRunner (all 154 levels in a single game!) (BSD-3) by Simon Holmes (filmote)
  • MicroCity (GPL-3.0) by James Howard
  • SpaceCab (GPL-3.0) by by Stephane C (vampirics) and Simon Holmes (filmote)
  • The Curse Of Astarok (MIT) by Simon Holmes (filmote)
  • Rayne the rogue (MIT) by shdwwzrd
  • Space Battle - Trench Run (MIT) by Lucas Cardinali (lscardinali)
  • MicroTD (CC0-1.0) by drummyfish
  • Shadow-Runner-1.6.1 (MIT) by TEAM ARG
  • Evade (MIT) by Modus Create
  • Rooftop Rescue (MIT) by Bert van't Veer
  • Crates 3D (MIT) by Badja (original) & Brian (port)
  • JetPac (Proprietary) by Mike McRoberts
  • Squario (Proprietary) Squario by arduboychris
  • Circuit Dude (Proprietary) by Jonathan Holmes
  • Omega Horizon (Proprietary) by shdwwzrd
  • ESP8266_ArduBOYNG - UNKNOWN
  • ESP8266_breakout-v - UNKNOWN
  • ESP8266_picovaders - UNKNOWN

Contributions and Disclaimer

Contributions to the documentation, code or electronics are welcome.

Use this library at your own risk.

ESPboy project links