32 Commits

Author SHA1 Message Date
Alex Duchesne
bd22070c93 Enable the psram-cache-issue fix for all components
Cherry-pick:  06433c152c067f6c94c8ae7fd16d91edb087b812

Previously it was only enabled in DOOM and the launcher because they write to PSRAM a lot, triggering the bug often.

Other emulators tend to use it only to store their ROM in PSRAM, so the write bug doesn't usually occur. Which is why the fix was disabled until now.

But it definitely causes instability regardless. In this commit it is now enabled for all emulators, but not for the esp-idf side or libretro-go.

This should be a reasonable compromise. More testing is needed to see if it makes any emulator unusably slow...

So far I'm seeing 10-15% higher CPU usage which is... not great. Thankfully most emulators were at 50-60% usage, so there's headroom...
2025-11-07 15:21:02 -05:00
Alex Duchesne
dcc2e17943 Updated build options to improve performance on esp-idf 4.4/5.x
Starting with esp-idf 4.4, build options `-fno-jump-tables -fno-tree-switch-conversion` are always used. [1]

This is very bad for us because most emulators rely on switches being converted to jump tables.

This patch brings performance back to parity with 4.3.

1. https://github.com/espressif/esp-idf/releases/tag/v4.4:

> Always compile with -fno-jump-tables -fno-tree-switch-conversion by default. This could results in performance regression for code that relies heavily on this optimization. See api-guides/memory-types.rst for how to enable it for specific source files if necessary.
2024-08-27 11:52:19 -04:00
Alex Duchesne
376e45da32 Fixed warnings when building gnuboy 2024-08-25 13:06:51 -04:00
Alex Duchesne
2f3e9941e2 Improved cmake info output 2024-08-24 15:31:09 -04:00
Tom Van Braeckel
4f7d72500f
rg_network: Fix networking on esp idf v5.x (#128)
* Fix networking on ESP-IDF v5.x

Untested with ESP-IDF v4.x

I had to set the launcher LOG_DEFAULT_LEVEL to LOG_DEFAULT_LEVEL_ERROR to
prevent it from defaulting to LOG_DEFAULT_LEVEL_INFO, otherwise the
launcher.bin size would be > 1MB, which only fits if
PARTITION_TABLE_SINGLE_APP_LARGE (1.5MB) is set instead of the default
PARTITION_TABLE_SINGLE_APP (1MB).

To change this:

cd launcher/
idf.py menuconfig # use the / key to search

* rg_network: log IP address assignments to clients

Handle the IP_EVENT_AP_STAIPASSIGNED and log the IP
addresses that are assigned to Access Point clients.

* Limit events to WIFI and IP
2024-07-10 16:12:04 -04:00
Alex Duchesne
05a2bef381 Fixed networking not being fully disabled for esp-idf 5.x (#126) 2024-07-08 21:22:02 -04:00
Alex Duchesne
07f1fafa39 Added fMSX 6.0 emulator
The emulator source is unmodified but it is dynamically patched at compile time (by forcing an include file).

Both keyboard and joystick are emulated. For keyboard I looked up the most used keys in games. With feedback I'll be able to tweak that, but the virtual keyboard also works if other keys are needed.

Save states work through the in-game menu but not yet through retro-go's menu.

Launcher images are also missing.
2024-03-02 17:22:15 -05:00
Alex Duchesne
08c19bc0e0 Use CMake variables instead of environment
That way idf.py will trigger a rebuild when flags change.
2024-01-29 17:09:39 -05:00
Alex Duchesne
52020b4004 retro-go: Moved sdkconfig to the targets folder
Most targets have almost identical needs, but sometimes they differ.

So I think it's best to just maintain one sdkconfig file per target.
2024-01-13 15:15:16 -05:00
Alex Duchesne
771aea0c54 retro-go: Removed rg_printf, trying newlib's again
I don't like having two parallel printf implementations. Hopefully avoiding conversions will resolve the crashes that caused me to move to Marco Paland's printf.
2023-03-25 18:48:34 -04:00
Alex Duchesne
c26d56a407 Fixed building with networking 2022-10-01 14:57:57 -04:00
Alex Duchesne
63613c6a18 rg_network: Added network support
rg_network is responsible for establishing and maintaining a connection to an access point, or to a peer when running in AP mode.

It provides a simple interface: One local IP to represent us, One remote IP to represent our peer (there can be only one).

This commit also draws a cute radio icon when it's connecting and connected
2022-09-22 21:31:01 -04:00
FantasyGmm
14f4ee403d add new hardware port 2022-08-27 15:47:02 +08:00
Alex Duchesne
469fcaa91e Namespaced some build env variables
Some older (and mostly unused) environment variables weren't prefixed with RG_
2022-07-19 16:34:55 -04:00
Alex Duchesne
6a07051137 Updated some build scripts to fix linkage issues with rg_printf
Some apps still end up important rg_printf and newlib's nano version, but this isn't really an issue.

Eventually I'd like to find a clean way to always intercept printf calls...
2022-07-03 20:48:15 -04:00
Alex Duchesne
33104aa248 Removed remaining get_elapsed_time references 2022-04-07 15:52:21 -04:00
Alex Duchesne
b6a5261d82 Make all apps default to little endian, instead of requiring a flag
There is now a flag for big-endian instead
2022-02-15 19:02:06 -05:00
Alex Duchesne
b11c86bfa9 PCE: Fixed possible issues when loading state
A mismatch might happen in the future if we resize an integer or increase the system memory.

Now we check that block.len is what we expect.
- If it is smaller than expected, we pad the rest with zeroes (little endian casting).
- If it is bigger, we crop it.
2022-02-02 16:23:44 -05:00
Alex Duchesne
0e80bad8a6 DOOM: Fixed some very hard to debug freezes and glitches
This was my own fault, I disabled a fix for a bug in the ESP32 (for performance reasons)

But clearly prboom seems to trigger the bug it in a few places...

Inserting memw instructions manually do fix it but I'm worried that it occurs in more places, so I'm enabling the fix for the whole module instead.

Seems to cause 5-10% overhead :(
2021-11-23 15:12:04 -05:00
Alex Duchesne
b218de0ea9 Added DOOM support (new PrBoom port)
I used my old port as reference but this is a new port using PrBoom 2.5.0 source.

It has significantly lower memory usage, allowing for mods and DOOM 2 to work better.

At the moment the framerate worse than my old port but it should be fixable.
2021-11-08 16:10:54 -05:00
Alex Duchesne
0733dbfe61 Fixed some issues from previous commit, RG_TARGET_ is now set correctly 2021-09-13 21:05:04 -04:00
Alex Duchesne
bb6427e6f1 Added support for the mrgc-g32 to the build scripts
It's not great but it works...
2021-09-13 20:51:00 -04:00
Alex Duchesne
8a90be0052 Cleaning up the build code to eventually allow multiple target devices 2021-06-19 11:33:11 -04:00
Alex Duchesne
21762bf683 Launcher app is now called "launcher". I is annoying to have the project+launcher+shared library all be named retro-go 2021-02-13 15:33:39 -05:00
Alex Duchesne
f69f238732 Adjusted partition sizes, fw is now 3MB 2021-02-04 18:05:14 -05:00
Alex Duchesne
aa05cdc78b Fixed some types not being optimized by the compiler 2020-12-24 16:20:25 -05:00
Alex Duchesne
6076e36636 Fixed build on esp-idf 3.3, faster build, spiffs support 2020-12-18 05:26:35 -05:00
Alex Duchesne
e8f0da3ea3 Reduced compiled code size (removed some inlines, reorganized sms z80) 2020-09-17 16:51:26 -04:00
Alex Duchesne
543c93c8df Improved build scripts + monitor no longer dumps raw profile data 2020-09-13 16:24:16 -04:00
Alex Duchesne
8a54709688 Improved the profiler and its compilation 2020-09-11 19:33:56 -04:00
Alex Duchesne
e49b0e6cc3 Addded basic profiling and fixed sd card init status being inverted 2020-09-09 20:38:10 -04:00
Alex Duchesne
7deffaa718 Moved all sdkconfig to a shared base.sdkconfig 2020-08-17 20:45:12 -04:00