
A weird mock of a console system made with Arduino/ESP32. It's a hobby build,
not a real product. The eventual idea is a little handheld that plays my own
games, with sound and a colored display. It's nowhere near that yet. It should
comfortably run NES and SNES era games. Pushing to higher resolutions is what
waits on a board with PSRAM.
It comes down to RAM. The Arduino Mega 2560 it runs on today has only 8 KB of
SRAM. That cannot hold a color framebuffer, so on that board it stays text-only.
The next platform is an ESP32 WROOM, which jumps to about 520 KB of SRAM and a
fast dual core. That fits a 240x240 framebuffer (roughly 115 KB) and drives real
games at that resolution. The WROOM has no PSRAM, so it cannot hold the much
larger framebuffers a higher-resolution screen would need. An ESP32-WROVER or
ESP32-S3 covers that later with multi-megabyte PSRAM and onboard storage, which
is what a screen past 240p will need.
Status
Early and unfinished. Right now it boots, reads a power button, plays music
through a non-blocking melody engine, and shows text on the LCD. No games exist
yet.
Today it runs on an Arduino Mega with a 16x2 character LCD, which is what the
code targets. The next platform is decided: an ESP32 WROOM driving a 1.54 inch
240x240 IPS ST7789 display over SPI. Both parts run at 3.3 V and pair without
level-shifting, unlike the current 5 V LCD. Those parts are on the way, and
nothing is being ported until they arrive.
Games will be hosted on lyszt.net and downloaded to the board over WiFi. For the
first version they live in the ESP32's onboard flash.
Hardware
- MCU: Arduino Mega 2560 (ATmega2560) for now
- Display: 16x2 I2C character LCD (address
0x27) - Audio: passive buzzer on pin 3
- Input:
- power button on pin 2 (
INPUT_PULLUP, debounced) - directional buttons: up / down / left / right, just plain buttons so far,
not wired into anything yet - action buttons: A / B, same story, not wired in yet
- power button on pin 2 (
Planned (next platform)
- MCU: ESP32 WROOM (3.3 V, dual core, ~520 KB SRAM)
- Display: 1.54 inch 240x240 IPS ST7789 over SPI
- Storage: games in onboard flash, downloaded over WiFi
- Later: ESP32-WROVER or ESP32-S3 for PSRAM headroom past 240p
Build
PlatformIO project, Arduino framework. The actual project lives underLys Entertainment System/.
platform = atmelavr
board = megaatmega2560
framework = arduino
lib_deps = marcoschwartz/LiquidCrystal_I2C
Layout
Source is under Lys Entertainment System/src/:
main.cpp— entry point: wiring, power button, main loop.system/— theSystemcore; owns power state, the LCD, and audio.sounds/— audio, split into data and logic:notes.h— pitch constants.songs.{h,cpp}— music data (theSongstruct and melody definitions).sounds.{h,cpp}— the non-blocking melody engine and sound API.audio_manager.{h,cpp}— OO wrapper around the engine.
lcd/— LCD text helper.utils/— reusable helpers (e.g. a non-blockingwait).
