Close

ESP8266 little game engine by Igor on ESPboy

A project log for ESPboy - RetroGaming&Software development MuliTool

For IT geeks, retro game fans, makers. Open source, portable, modular to explore, create, learn, code & play

romansRomanS 06/17/2019 at 12:060 Comments

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

It's an virtual machine with fantasy CPU, "C like" online compiler and onlime emulator with one more ported emulator to ESPboy

LGE virtual machine description

LGE C like language guide

Online LGE IDE with compiler and emulator with sample games (press "compile" than "run")

LGE is a fantasy console for making, sharing and playing tiny games and other computer programs. 
You can make you game or program using online "C"-like SDK with compiler, debugger and VM and  then run compiled binary on portable ESPboy console thouse feels like a regular gaming console. 

Check few, colored, nostalgic LGE games from the package, by uploading them to SPIFFS.

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 is 128x128, the 16 colors of the palette for each pixel, the first color is transparent. 32 soft sprites available. 

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