{"id":13590361,"url":"https://github.com/harbaum/galagino","last_synced_at":"2025-04-05T18:06:33.081Z","repository":{"id":89283526,"uuid":"589179397","full_name":"harbaum/galagino","owner":"harbaum","description":"A Galaga, Pac-Man and Donkey Kong arcade emulator for the ESP32","archived":false,"fork":false,"pushed_at":"2024-03-11T08:11:18.000Z","size":32467,"stargazers_count":370,"open_issues_count":14,"forks_count":31,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-03-29T17:06:47.134Z","etag":null,"topics":["1942","8048","arcade","arduino","digdug","donkey-kong","emulator","esp32","frogger","galaga","pacman","z80"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-15T10:43:33.000Z","updated_at":"2025-03-20T04:17:22.000Z","dependencies_parsed_at":"2023-04-11T04:47:39.552Z","dependency_job_id":"14a10c29-691f-4fe4-a62a-a36648f10578","html_url":"https://github.com/harbaum/galagino","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2Fgalagino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2Fgalagino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2Fgalagino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2Fgalagino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harbaum","download_url":"https://codeload.github.com/harbaum/galagino/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378140,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["1942","8048","arcade","arduino","digdug","donkey-kong","emulator","esp32","frogger","galaga","pacman","z80"],"created_at":"2024-08-01T16:00:44.246Z","updated_at":"2025-04-05T18:06:33.065Z","avatar_url":"https://github.com/harbaum.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Galagino - ESP32 Arcade Emulator\n\nPlay Galaga, Pac-Man, Donkey Kong, Frogger, Digdug and 1942 on the ESP32\n\n![Cabinet](images/galagino_cabinet.jpg)\n\n![Pac-Man screenshot](images/pacman.gif)\n![Galaga screencast](images/galagino.gif)\n![Donkey Kong screenshot](images/dkong.gif)\n![Frogger screenshot](images/frogger.png)\n![Digdug screenshot](images/digdug.png)\n![1942 screenshot](images/1942.png)\n\n[Pac-Man](https://en.wikipedia.org/wiki/Pac-Man),\n[Galaga](https://en.wikipedia.org/wiki/Galaga) and\n[Donkey Kong](https://en.wikipedia.org/wiki/Donkey_Kong_(video_game)) are three of the most\niconic arcade machines of all times and are listed on places #1 to #3\non the [Killer List of Video Games](http://www.klov.net).\n\nEspecially Pac-Man and Galaga have been remade and emulated many\ntimes. So far the cheapest and smallest system able to do a faithful\nemulation of the original arcade machines was the raspberry pi. But\neven the much cheaper ESP32 should be able to easily emulate a machine\nfrom the early ’80s, shouldn't it?\n\nWell, things are not that easy. The Galaga arcade was driven by three\nZ80 CPUs, each running at 3Mhz. Additionally the arcade machine\nincluded two more CPUs, one for button and coin handling and one for audio\nsupport. And finally the hardware itself had dedicated support\nfor simple wavetable audio, tilemap graphics and up to 64 sprites.\nThe video resultion was 224 by 288 pixels.\n\nThe ESP32 on the other hand\ncomes with two cores running at 240MHz. But it lacks dedicated video\nhardware. Emulating the various CPUs as well as the handling of\naudio and graphics turned out to be challenging for the ESP32.\n\nCheap TFT screens with a resolution of 320 by 240 pixels are avaialable\nin various sizes from 2.0 inch to 3.2 inch allowing for a very small\nand cheap *galagino* setup.\n\nThese small displays usually allow for SPI clock rates of up to 40MHz\nallowing for a max screen refresh rate of ~30Hz. This is exactly half\nthe refresh rate of the original arcade machine. 30Hz is sufficient\nfor a very fluid gameplay. However, with displays coping with 80MHz\nSPI clock, Galagino will run at full 60Hz refresh.\n\n## Youtube videos\n\n* [First Galaga Emulation test ](https://www.youtube.com/shorts/LZRI6izM8XM)\n* [Sound and Starfield working](https://www.youtube.com/shorts/8uNSv0aRtgY)\n* [Galaga is finally playable](https://www.youtube.com/shorts/wqnJzOAAths)\n* [Pac-Man on Galagino](https://www.youtube.com/shorts/F4-XiiPwG1c)\n* [Donkey Kong on Galagino](https://www.youtube.com/shorts/KROFJ0Rtj0w)\n* [Boot menu](https://www.youtube.com/shorts/_PJyn06yrtg)\n* [Cardboard cabinet prototype](https://youtube.com/shorts/vverV4NphlQ)\n* [Finished plywood cabinet](https://youtube.com/shorts/a3-wctRAIds)\n* [John Bradnam's 3D printed case](https://www.youtube.com/watch?v=p29Yvht4jSI)\n* [Frogger on Galagino](https://youtube.com/shorts/LrBkN1pu7yE)\n* [Digdug on Galagino](https://youtube.com/shorts/fmQmfKEhVy4)\n\n## Hardware\n\n### Original Hardware\nThe hardware is built around one of those cheap ESP32 development\nboards like the ESP32 Devkit V4 depicted in the images below. The\ncomponents needed for the breadboard setup are listed below. If you\nplan to build the [cabinet](hardware/cabinet) instead you might want\nto make sure you [order the exact parts](./hardware) that\naren't only electrically compatible but also mechanically.\n\n* ESP32 development board (e.g. [Devkit V4](https://www.espressif.com/en/products/devkits/esp32-devkitc))\n* A 320x240 SPI TFT screen (no touch needed)\n  * Either a ILI9341 based screen as depicted, or\n  * a ST7789 based screen with 320x240 pixels\n* An audio amplifier and speaker\n  * e.g. a [PAM8302A](https://www.adafruit.com/product/2130) and a 3W speaker (as seen in the photos), or\n  * a [Keyestudio SC8002B](https://www.keyestudio.com/products/keyestudio-sc8002b-audio-power-amplifier-speaker-module-for-arduino-player), or similar \n* five push buttons, or\n* one push button and a five way joystick breakout (for Pac-Man and Donkey Kong)\n* breadboard and wires\n\nThe entire setup should be connected as depicted below. The Devkit is\ntoo wide for the breadboard leaving no space above it to connect\nwires. Thus the wires going to the top pin row of the Devkit are\nplaced underneath the DevKit with the connections done as shown in the\nimage below. See [galagino/config.h](galagino/config.h) for the button\nmappings.\n\n![Breadboard scheme](images/galagino_bb.png)\n\n[PDF](images/galagino_bb.pdf)\n\n![Breadboard photo](images/galagino_breadboard.jpeg)\n\nThis setup with five buttons works fine for Galaga since there is no\nvertical movement in the game that requires a joystick. A joystick is\nneeded for Pac-Man and Donkey Kong. The joystick based setup would\nthen be wired in the following way:\n\n![Breadboard scheme with 5 way joystick](images/galagino_5way_bb.png)\n\n[PDF](images/galagino_5way_bb.pdf)\n\n### \"Cheap Yellow Display\"\nThe ESP32-2432S028R A.K.A. the [Cheap Yellow Display](https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display) is an ESP32 Board that comes with the majority of hardware required to build a Galagino device.\n\n![Cheap Yellow Display](images/CheapYellowDisplay.png)\n\nHardware Needed:\n- Cheap Yellow Display\n- [A Nintendo Wii nunchuck and adaptor](hardware/NUNCHUCK.MD) - This can be connected to the JST connector labled \"CN1\" with the cable included with the display\n- A speaker - This can be attached to the display with a 1.25mm JST connector to the connector labled \"SPEAK\" (or soldered)\n\nNote: The `Start` button is connected to the \"boot\" button on the board.\n\nTo get the project working on the Cheap Yellow Display, just uncomment the `#define CHEAP_YELLOW_DISPLAY_CONF` line in [galagino/config.h](galagino/config.h)\n\n## Software\n\n**Important notice 1:** You really need to use the Arduino IDE as it\nprovides the optimization settings required for sufficient\nperfgormance of Galaga and Digdug by default. E.g. PlatformIO doesn't\nseem to enable enough optimization.\n\n**Important notice 2:** I2S/DAC support seems to be [broken in the\nESP32 board package version 2.0.10 and\nup](https://github.com/espressif/arduino-esp32/issues/8467). Please\nuse ESP32 board package 2.0.9 or older for a clean sound.\n\nThe software consists of three parts:\n\n* The [Galagino specific code](galagino/) contained in this repository\n* The orignal ROM files\n    * [Galaga (Namco Rev. B ROM)](https://www.bing.com/search?q=galaga+namco+b+rom)\n    * [Pac-Man (Midway)](https://www.bing.com/search?q=pacman+midway+arcade+rom)\n    * [Donkey Kong (US set 1)](https://www.bing.com/search?q=donkey+kong+arcade+rom)\n    * [Frogger](https://www.bing.com/search?q=frogger+arcade+rom)\n    * [Digdug](https://www.bing.com/search?q=digdug+arcade+rom)\n    * [1942](https://www.bing.com/search?q=1942+arcade+rom)\t\n* A [Z80 software emulation](https://fms.komkon.org/EMUL8/Z80-081707.zip) by [Marat Fayzullin](https://fms.komkon.org/)\n\nGalagino uses code that is not freely available and thus not included in this\nrepository. Preparing the firmware thus consists of a few additional steps:\n\n* The ROM files have to be placed in the [roms directory](roms/), together with the ZIP file containing the Z80 emulator.\n* A set of [python scripts](romconv/) is then being used to convert and\n patch the ROM data and emulator code and to include the resulting code into the\ngalagino sketch directory.\n* The same scripts are afterwards being used to convert [audio sample files](./samples) into the desired format.\n\nThe [ROM conversion](./romconv) as well as the [audio sample\nconversion](./samples) create a whole bunch of additional files in the\n[galagino directory](./galagino). Please check the README's in the\n[romconv](./romconv) and [samples](./samples) directories for further\ninstructions.\n\nWith all these files in place, the galagino.ino sketch can be loaded\ninto the [Arduino IDE](https://docs.arduino.cc/software/ide-v2). The\nArduino IDE must have the [ESP32 board support](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html)\ninstalled and the appropriate board like e.g. the\n*ESP32 Dev Module* should be selected. Finally the default core used\nby Arduino should be 1 (this is the default) as Galagino will use core 0\nfor audio and video emulation. Furthermore the FastLED library should\nbe installed to support the LEDs in the [cabinets marquee](./hardware/cabinet).\nLED support can be disabled in the configuration if no LEDs are going to be installed.\n\n## Configuration\n\nThe Galagino code can be configured through the [galagino/config.h](galagino/config.h)\nfile. This is also the place where it's possible to choose between the ILI9341\ncontroller (default) and the ST7789.\n\nAlso the pin assignment can be adjusted as well as the TFT SPI clock or the\nuse of LEDs for the marquee.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharbaum%2Fgalagino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharbaum%2Fgalagino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharbaum%2Fgalagino/lists"}