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:




User Guide:

Games sources:

Compiler sources:

Online ESP-LGE SDK, compiler, emulator:

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"
3. Unpack two libraries (a_coos and TFT_eSPI) from file "libraries.7z" of "esp8266_game_engine" to the Arduino/Libraries folder
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
7. Enjoy )

How to upload "bin" file games to SPIFFS:

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

1. Use source file

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"
5. Upload .bit to your ESPboy SPIFFS

How to recompile CHIP8 games:

1. Use game source file
2. Copypast "c" code to the "source" window of the online compiler and compile it with "Compile" option
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, ...