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.
* 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
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.
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.
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
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...
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.
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 :(
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.