Close

ESP8266 little game engine by Igor on ESPboy

A project log for ESPboy: beyond the games platform with WiFi

for games, IoT experiments, education and fun Arduino ecosystem compatible, 30x70mm, ESP8266-80Mhz-4Mb, display, RGBled, buttons, HQspeaker

RomanSRomanS 06/17/2019 at 12:060 Comments

Port of wonderful Igor's ESP little game engine (ESP-LGE) to ESPboy, thanks Igor!

Game making SDK for easy rogramming the games directly from the browser. There are compiler of the subset C into bytecode and the virtual machine written in js. VM has access to 65,534 bytes of memory, only 20,000 bytes are available on the device itself, since the remaining memory goes to the screen buffer and library. The screen has a size of 128x128 pixels, each pixel can take one of the 16 colors of the palette. The first color is transparent. There are 32 soft sprites available. The compiler supports int and unsigned char types, one-dimensional arrays, debugging.

Original ESP-LGE: https://github.com/corax89/esp8266_game_engine

Fork: https://github.com/ESPboy-edu/esp8266_game_engine

Hackaday: https://hackaday.io/project/164205-esp-little-game-engine

Article: https://hackaday.com/2019/03/11/esp8266-gets-its-game-on-with-open-source-engine/

User Guide: https://corax89.github.io/esp8266Game/user_guide/index.html

Games sources: https://github.com/corax89/game_engine_for_esp8266_with_compiler/tree/master/example

Compiler sources: https://github.com/corax89/game_engine_for_esp8266_with_compiler

Online ESP-LGE SDK, compiler, emulator: https://corax89.github.io/esp8266Game/index.html

How to upload firmware to ESPboy:
1. Install Arduino IDE
2. Clone and download "ESPboy_little_game_engine" and rename the folder "ESPboy_little_game_engine-master" to "ESPboy_little_game_engine"  https://github.com/ESPboy-edu/ESPboy_little_game_engine
3. Unpack two libraries (a_coos and TFT_eSPI) from file "libraries.7z" of "esp8266_game_engine" to the Arduino/Libraries folder https://github.com/Bodmer/TFT_eSPI
4. Change settings in file «User_Setup.h» of TFT_eSPI library
  - 50  #define TFT_WIDTH  128
  - 53  #define TFT_HEIGHT 128
  - 67  #define ST7735_GREENTAB3
  - 149 #define TFT_CS   -1
  - 150 #define TFT_DC   PIN_D8
  - 152 #define TFT_RST  -1  
  - 224 #define LOAD_GLCD
  - 255 #define SPI_FREQUENCY  27000000
5. Open "esp8266_game_engine.ino" in Arduino IDE and compile it for "Lolin/WeMos D1 mini ESP8266" board
6. Compile and upload the games to your ESPboy SPIFFS https://www.youtube.com/watch?v=25eLIdLKgHs
7. Enjoy )

How to upload "bin" file games to SPIFFS: 

https://www.youtube.com/watch?v=25eLIdLKgHs

How to compile original LGE games from "c" to "bin":

1. Use source file https://github.com/corax89/game_engine_for_esp8266_with_compiler/blob/master/example/chip8.c

2. Put your CHIP8 bit code to char "Memory[3583] = {};" at string №58
3. Check buttons remap at strings №9-20
4. Compile this .c to .bin with "Online ESP-LGE SDK, compiler, emulator" https://corax89.github.io/esp8266Game/index.html
5. Upload .bit to your ESPboy SPIFFS


How to recompile CHIP8 games:

1. Use game source file https://github.com/corax89/game_engine_for_esp8266_with_compiler/tree/master/example
2. Copypast "c" code to the "source" window of the online compiler and compile it with "Compile" option  https://corax89.github.io/esp8266Game
3. Compile the source using "Compile" and save the compiled binary with "Save"
5. Upload .bin to your ESPboy SPIFFS

Games in package:

  1. Original ESP-LGE by Igor: FourInaRow, NinjaEscape, 1916, WormBlast, ESProgue, Galaxies, CityRunner, Memories, MarsAttack, Columns, Mines, Breackout, TowerDefense, ZombieDefender...
  2. Classical Chip8: 2048, airplane, blinky, down8, gravedigger, invaders, puzzle, slipperyslope, spacejam, submarine, ...

Discussions