Retro-go port

I have ported retro-go to the Byteboi. For now, you can find it here: Release Retro-Go 1.43 for Byteboi · birefringence/retro-go · GitHub

I will try to have it integrated upstream.

Unfortunately, I can’t seem to fit all of retro-go into the 4MB flash. So you may want to build it yourself if you want to have a different selection of emulators.

Important: It will only work with the first revision of the hardware. Since I only have rev.1, I do not know if there is an easy way to distinguish rev.1 and rev.2. From the official CircuitMess firmware, I conclude that the second revision has a different display and the buttons are connected differently, so my port will not work on it at all!

2 Likes

Thank you for sharing with community!

BTW: If someone actually wants use this to play games, I highly recommend replacing all of the switches by a model with a shorter bounce time (e.g. Omron B3F-4050 works very well). This improves the game play feeling a lot!

Can you make a .bin, I want to add it to sd.

P.S if ur using circuitblocks then press export binary

This would be an interesting challenge, but it is not trivial. Apart from size constraints that might be an issue, Retro-Go consists itself of multiple binaries that are started individually (launcher and emulators). This approach is not compatible with the Byteboi firmware and would require modifications.

I mean yeah, you have to include the CircuitOs.h and from smth import byteboi

Hello, I have a Byteboi rev.2 and I would like to know exactly how you ported it to the rev.1 so I could try porting it myself to the rev.2. I tried following the porting instructions on the github but I run into errors almost every time I try to build it. If you are interested in helping me out, please dm me (I’m not actually sure if you can do it in here or not, first time posting), thank you.

I’ll be glad to help. Currently, I don’t have a lot of free time, so it may take some time until I get back to you, but I will eventually.
I would suggest to discuss this publicly, as it may be useful for others as well.
The first step is to get the unmodified version to compile. Did you try to follow the build instructions at retro-go/BUILDING.md at master · ducalex/retro-go · GitHub ?
At a first glance, I was not able to identify which ISP-IDF version was used for the latest retro-go version, but 4.4.8 may be a good starting point. You can try different versions as well.
Until which point in BUILDING.md do you get and what ist the exact error message you run into?

Thanks for getting back to me and I agree with your idea of keeping it public. I did build an unmodified version using esp-idf 5.3 to verified it worked. I was going to use esp-idf 4.4.8 but I saw 5.3 was supported and I figured I would use the later version. I have been working on this for the past couple of days and have gotten it to build and flash successfully but I get the errors mentioned below when running idf.py monitor. A few things I should mention, the speaker makes a short crackle when turning on and although the display says it initialized I’m still getting a completely black screen. Thanks again for your help and let me know if you need anything else. EDIT: I’ve worked on it some more and updated the idf.py monitor output. Also I’m no longer getting a black screen but rather a completely white screen.

rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6072
load:0x40078000,len:15404
ho 0 tail 12 room 4
load:0x40080400,len:4
— 0x40080400: _init at ??:?
load:0x40080404,len:3832
entry 0x40080628
I (30) boot: ESP-IDF v5.3.4 2nd stage bootloader
I (30) boot: compile time Aug 24 2025 09:23:37
I (31) boot: Multicore bootloader
I (35) boot: chip revision: v1.1
I (38) boot.esp32: SPI Speed : 40MHz
I (43) boot.esp32: SPI Mode : DIO
I (47) boot.esp32: SPI Flash Size : 4MB
I (52) boot: Enabling RNG early entropy source…
I (57) boot: Partition Table:
I (61) boot: ## Label Usage Type ST Offset Length
I (68) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (76) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (83) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (91) boot: 3 launcher OTA app 00 10 00010000 000f0000
I (98) boot: 4 retro-core OTA app 00 11 00100000 000f0000
I (106) boot: 5 prboom-go OTA app 00 12 001f0000 000c0000
I (113) boot: 6 fmsx OTA app 00 13 002b0000 00090000
I (121) boot: End of partition table
I (125) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2f140h (192832) map
I (200) esp_image: segment 1: paddr=0003f168 vaddr=3ffb0000 size=00eb0h ( 3760) load
I (201) esp_image: segment 2: paddr=00040020 vaddr=400d0020 size=a69e0h (682464) map
I (439) esp_image: segment 3: paddr=000e6a08 vaddr=3ffb0eb0 size=02b10h ( 11024) load
I (444) esp_image: segment 4: paddr=000e9520 vaddr=40080000 size=11194h ( 70036) load
I (481) boot: Loaded app from partition at offset 0x10000
I (481) boot: Disabling RNG early entropy source…
W (504) i2s(legacy): legacy i2s driver is deprecated, please migrate to use driver/i2s_std.h, driver/i2s_pdm.h or driver/i2s_tdm.h
W (505) DAC: legacy driver is deprecated, please migrate to driver/dac_oneshot.h, driver/dac_cosine.h or driver/dac_continuous.h instead
W (519) ADC: legacy driver is deprecated, please migrate to esp_adc/adc_oneshot.h

========================================================
launcher 1.45-2-g619e7-dirty (Aug 24 2025 09:20:07)
built for: BYTEBOI-REV2. type: dev

[info] rg_storage_init: Using host (stdlib) for storage.
[info] rg_storage_init: Storage mounted at /sd.
[info] rg_input_init: Initializing ADC battery driver…
[info] _input_init: Input ready. state=00000000 00000000
[error] rg_storage_read_file: Fopen failed (2): ‘/sd/retro-go/config/global.json’
[error] rg_storage_read_file: Fopen failed (2): ‘/sd/retro-go/config/boot.json’
[info] rg_display_init: Initialization…
[error] rg_storage_read_file: Fopen failed (2): ‘/sd/retro-go/config/launcher.json’
[info] rg_alloc: SIZE=2560, CAPS=DMA|8BIT, PTR=0x3ffbdec0
[info] rg_alloc: SIZE=2560, CAPS=DMA|8BIT, PTR=0x3ffbe8c4
[info] rg_alloc: SIZE=2560, CAPS=DMA|8BIT, PTR=0x3ffbf2c8
[info] rg_alloc: SIZE=2560, CAPS=DMA|8BIT, PTR=0x3ffbfccc
[info] rg_alloc: SIZE=2560, CAPS=DMA|8BIT, PTR=0x3ffc06d0
[info] lcd_set_backlight: backlight set to 80%
[info] rg_display_init: Display ready.
[warn] rg_alloc: SIZE=11520, CAPS=SPIRAM|8BIT, PTR=0x3ffc2e5c << CAPS not fully met! (available: 0)
[info] rg_gui_set_language_id: Language set to: English (0)
[info] rg_gui_set_font: Font set to: VeraBold 11 (height=13, scaling=1.00)
[info] rg_gui_set_theme: Using built-in theme!
[info] rg_audio_init: Audio ready. sink=‘Speaker’, samplerate=32000, volume=50
[error] rg_storage_read_file: Fopen failed (2): ‘/sd/retro-go/cache/clock.bin’
[info] rg_system_load_time: Time is now: Sun Aug 24 08:19:41 2025

[debug] rg_gui_draw_text: Texbox (pos: 278x15, size: 96x0) will be truncated!
[debug] rg_gui_draw_text: Texbox (pos: 278x15, size: 96x0) will be truncated!

OK great, this is already looking quite good, as you have worked out the prerequisites: building and flashing works. It is to be expected that you only see a blank screen, as there are three things, you will need to adjust for the rev 2 hardware:

  1. Some GPIOs are connected differently
  2. A different display is used, which requires a specific driver
  3. Input from the buttons is read via a shift register rather than an I2C GPIO expander, which also requires a new driver

It is very helpful to look at the Byteboy firmware, which detects the hardware revision it is running on and then handles this as two different cases (recently also a third hardware version was added):

If this is too high level, I will be able to give more detailed pointers later.

Thanks for the repo, I thought I had all the pins correct but this’ll definitely help. I’ll take a better look at this tomorrow when I have more time.

The ST7789 display seems to be used by other targets too, so looking at those config.h files might help with getting it to work. The Byteboi firmware is using this library

which you can look at as well, but I am not sure how much this helps. It contains a lot of complexity, which is not needed for Retro-Go.

For the button inputs, I expect some additions to

are required, because I don’t see any code that can read a shift register.
Fortunately, from the Firmware file

it looks quite simple to implement.

1 Like

Also, just be clear: The idf.py monitor output you posted looks fine. You currently don’t see anything on the screen, because it is not initialized/accessed correctly yet. Retro-Go otherwise is starting up fully.

So my advice would be to double check that all of the GPIOs are configured correctly and then look at the the linked Byteboi firmware as well as other targets using the same display for information on how to initialize and configure the display. You can also google for an ST7789 datasheet, but this will contain a lot of stuff and it is probably hard to find the useful parts.

The extra info helped out a lot! I seemingly got inputs to work but I still can’t get anything to display on the screen. I’ll keep digging through the stuff you sent and let you know if anything changes.

I forgot to do this earlier but here’s a quick update. I finally got the screen and inputs working properly. But I’m still having trouble with the sd card. It keeps failing to initialize or something.

E (618) sdmmc_sd: sdmmc_init_spi_crc: sdmmc_send_cmd_crc_on_off returned 0x106
E (618) vfs_fat_sdmmc: sdmmc_card_init failed (0x106).

Anyways, I’ll keep chipping away at it and I’ll post another update if anything changes.

Great! For the SD card I don’t have any good hints, unfortunately … This part worked for me immediately after adjusting GPIOs as documented here:

(But I assume that you have seen all of this if you got this far)

I got it working, turns out it was just a bad SD card. That was the last I thing needed to fix so it’s complete now. Thank you very much for your help, I truly appreciate it. I’ll probably post it on GitHub and a topic here if anyone else is interested in this.

Nice, congratulations! You could also try to get it merged into the upstream repository. The maintainer is very helpful. Basically all you need to do is to send him a pull request against the “dev” branch.

1 Like