• Wiring and Driving the Display

    Cees Meijer04/17/2025 at 07:34 0 comments

    The retro-go project does not have specific instructions on how to wire things for each 'target'. As I have chosen the ESP32S3-DEVKIT-C, the 'config.h' contains all necessary details.

    C:\ESP32\retro-go\components\retro-go\targets\esp32s3-devkit-c\config.h

    Here we find the GPIO numbering for both the LCD screen and the SD-Card:

    // Status LED
    #define RG_GPIO_LED                 GPIO_NUM_38
    
    // SPI Display (back up working)
    #define RG_GPIO_LCD_MISO            GPIO_NUM_NC
    #define RG_GPIO_LCD_MOSI            GPIO_NUM_12
    #define RG_GPIO_LCD_CLK             GPIO_NUM_48
    #define RG_GPIO_LCD_CS              GPIO_NUM_NC
    #define RG_GPIO_LCD_DC              GPIO_NUM_47
    #define RG_GPIO_LCD_BCKL            GPIO_NUM_39
    #define RG_GPIO_LCD_RST             GPIO_NUM_3
    
    #define RG_GPIO_SDSPI_MISO          GPIO_NUM_9
    #define RG_GPIO_SDSPI_MOSI          GPIO_NUM_11
    #define RG_GPIO_SDSPI_CLK           GPIO_NUM_13
    #define RG_GPIO_SDSPI_CS            GPIO_NUM_10
    
    // External I2S DAC
    #define RG_GPIO_SND_I2S_BCK         41
    #define RG_GPIO_SND_I2S_WS          42
    #define RG_GPIO_SND_I2S_DATA        40
    // #define RG_GPIO_SND_AMP_ENABLE      18

    That's simple. Yet it does not work. When booting up, the screen flickers and stays white. Checked the wiring several times, until I suddenly noticed the bag in which the display came. It says 'ILI9488 Driver'. And the code refers to the 'ILI9341', which was also mentioned on the AliExpress page where I ordered the display. So that page is incorrect, and this display is actually based on the ILI9488. And yes, that requires a different setup, not least because it is 320x480 pixels instead of the 240x320 of the ILI9341.

    There is an AdaFruit example library for both displays, so I copied the setup code from the IL9488 to the config.h file. Not knowing what any of these codes do, making it a long shot. And so that did not seem to work, as expected. But, just as I thought I should give up, I switched power off and on to the board, and then suddenly an image appeared on the screen. It is black and white, and the orientation and aspect is wrong, but it shows that the connections are OK, and the setup is at least partially right.

    So now the question arises: will I try and fix the driver code to make it work with this specific display? It will require a deep dive into the details on memory, registers and pixel colors. Not sure If I really want to spend that much time on it.

  • Emulation - Get it Running!

    Cees Meijer04/14/2025 at 19:22 0 comments

    As mentioned, I chose the ESP32-S3-DevKitC-1. Programming requires the ESP-IDF, for which the installation instructions can be found here.

    Of course I rushed it, without reading the whole page and so I missed the note that it is best to install it from the VS Code extension. And when you installed it using the 'Windows Installer', adding it to VSCode simply fails. So I had to uninstall it, and then follow the VSCode way.

    If all goes well ( and why shouldn't it..) you end up with the start screen for ESP-IDF:


    Right. But what next ? First I tried some things like 'import project', or 'new project', but that does not get you anywhere.

    First, make sure your 'retro-go' folder is somewhere in a 'root' folder, like C:\ESP32\retro-go. Then open the folder in VSCode. This will that ask if you want to open a workspace. Answer yes.

    Next, open the ESP-IDF Terminal. Here we can now enter the commands as described in the 'BUILDING.md' file.

    I used this command:

    During the first build I ran into a few issues in the code, but these were easy to fix:

    Issues:

    In 'rg-storage.c' : rom/miniz.h not found. Right, because that is in a different folder:

    #ifdef ESP_PLATFORM
    #include <libs/miniz/miniz.h>
    

     in 'memmap.c' : incorrect modifier in print statement. Argument 5 is a long int.  So you should change the '%dkB' to '%ldkB'

     printf("Rom loaded: name: %s, id: %s, company: %s, size: %ldKB\n", Memory.ROMName, Memory.ROMId, Memory.CompanyId, Memory.CalculatedSize / 1024);
      

     In 'opl.c' :

    static int *mix_buffer = NULL;
    

    Must be:

    static long int *mix_buffer = NULL;

    But that was all. And after a long compilation/ build, it finally started the upload to the connected board.

    And it looks like the program is running, since the 'Tx' LED on the board is now blinking at a regular pace. To see what is going on, start the monitor:

    After the startup messages of the ESP32 (which will show some errors, since I have not connected anything yet) it will start to print [DEBUG] messages. So it looks like it is working.

  • EMULATION

    Cees Meijer04/01/2025 at 20:08 0 comments

    Since I already built a handheld in the past (https://hackaday.io/project/176661-retropie-handheld) that did Atari Lynx emulation, the Raspberry Pi is a logical choice. A drawback of using the Pi though is that it takes quite some time to boot into the emulator, which does not make you feel yo are using a 'real' Lynx.  But while designing the housing it struck me that it might be a great fit for the 'CYD' or 'Cheap Yellow Display'. Unfortunately when placing this unit in the design it is obviously a little too small. Which is correct: this is a 2.8" screen, and the Atari has a 3.5 ". Using an ESP32 based solution would however ( probably) solve the boot problem, and most likely use less power.

    There is an ESP32 based emulator: https://github.com/ducalex/retro-go. It seems that it is only readily available for the Odroid-Go and MRGC-G32, but it should be possible to run it on other devices as well. It supports screens that have a ILI9341 driver, which are available in different sizes at AliExpress. I ordered the 3.5"TFT version, which seems like a nice size for the Lynx.

    And this ESP32-S3 board seems powerful enough to run this application:

    It can be found in the Retro-Go Github as 'ESP32-S3-DevKitC', so there is some support available. Lets try to get it running...

  • Housing

    Cees Meijer04/01/2025 at 19:52 0 comments

    There are a few 3D models of the LYNX available, but I decided to model it myself in DesignSpark Mechanical.

    It's not a perfect 1:1 copy of the original, but it is close enough.
    I'll publish the design files later, since there will definitely be changes when I start to insert the electronics.