Skip to content

Commit

Permalink
Added IDE section to BUILDING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ducalex committed Oct 30, 2024
1 parent eda3077 commit 53092ff
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Table of contents
- [Building Retro-Go](#prerequisites)
- [Porting Retro-Go](#porting-retro-go)
- [IDE Support](#ide-support)


# Building Retro-Go

## Prerequisites
Expand All @@ -24,21 +30,21 @@ There are generally two active git branches on retro-go:

## Build everything and generate .fw:
- Generate a .fw file to be installed with odroid-go-firmware or odroid-go-multi-firmware from SD Card:\
`./rg_tool.py build-fw` or `./rg_tool.py release` (clean build)
`python rg_tool.py build-fw` or `python rg_tool.py release` (clean build)
- Generate a .img to be flashed with esptool.py (Serial):\
`./rg_tool.py build-img` or `./rg_tool.py release` (clean build)
`python rg_tool.py build-img` or `python rg_tool.py release` (clean build)

For a smaller build you can also specify which apps you want, for example the launcher + DOOM only:
1. `./rg_tool.py build-fw launcher prboom-go`
1. `python rg_tool.py build-fw launcher prboom-go`

Note that the app named `retro-core` contains the following emulators: NES, PCE, G&W, Lynx, and SMS/GG/COL. As such, these emulators cannot be selected individually. The reason for the bundling is simply size, together they account for a mere 700KB instead of almost 3MB when they were built separately.


## Build, flash, and monitor individual apps for faster development:
It would be tedious to build, move to SD, and flash a full .fw all the time during development. Instead you can:
1. Flash: `./rg_tool.py --port=COM3 flash prboom-go`
2. Monitor: `./rg_tool.py --port=COM3 monitor prboom-go`
3. Flash then monitor: `./rg_tool.py --port=COM3 run prboom-go`
1. Flash: `python rg_tool.py --port=COM3 flash prboom-go`
2. Monitor: `python rg_tool.py --port=COM3 monitor prboom-go`
3. Flash then monitor: `python rg_tool.py --port=COM3 run prboom-go`


## Environment variables
Expand All @@ -63,11 +69,33 @@ When a panic occurs, Retro-Go has the ability to save debugging information to `
To resolve the backtrace you will need the application's elf file. If lost, you can recreate it by building the app again **using the same esp-idf and retro-go versions**. Then you can run `xtensa-esp32-elf-addr2line -ifCe app-name/build/app-name.elf`.


## Porting

# Porting Retro-Go

## ESP32
Instructions to port to new ESP32 devices can be found in [PORTING.md](PORTING.md).

## Other architectures
I don't want to maintain non-ESP32 ports in this repository but let me know if I can make small changes to make your own port easier! The absolute minimum requirements for Retro-Go are roughly:
- Processor: 200Mhz 32bit little-endian
- Memory: 2MB
- Compiler: C99 (and C++03 for handy-go)

Whilst all applications were heavily modified or even redesigned for our constrained needs, special care is taken to keep
Retro-Go and ESP32-specific code exclusively in their port file (main.c). This makes reusing them in your own codebase very easy!



# IDE Support

## VS Code
Retro-Go comes with a VS Code workspace file that contains configuration for the C/C++ extension.

To get intellisense working properly you have to define some paths in your *global* configuration file:

````json
"retro-go.sdk-path": "C:/espressif/frameworks/esp-idf-v5.0.4",
"retro-go.tools-path": "C:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf",
````

Clangd is not supported at this time because I have not found a way to make it work well in our multi-folder workspace.

0 comments on commit 53092ff

Please sign in to comment.