diff --git a/base.cmake b/base.cmake index 2cd315d2..8f1c786e 100644 --- a/base.cmake +++ b/base.cmake @@ -9,6 +9,16 @@ macro(rg_setup_compile_options) ${ARGV} ) + # The PSRAM cache bug is responsible for many subtile bugs and crashes. The workaround has a + # significant performance impact but the alternative is instability... Enabling the fix here + # instead of sdkconfig prevents the new libc and wifi from being linked in which increases + # size and reduces performance further. It's not entirely safe but retro-go has been built + # with the workaround fully disabled for years, so clearly this compromise should be "fine". + # memw seems to have the least impact both in terms of size and performance + if(IDF_TARGET STREQUAL "esp32") + component_compile_options(-mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw) + endif() + if(RG_ENABLE_NETPLAY) component_compile_options(-DRG_ENABLE_NETWORKING -DRG_ENABLE_NETPLAY) elseif(RG_ENABLE_NETWORKING) diff --git a/launcher/main/CMakeLists.txt b/launcher/main/CMakeLists.txt index 46c4dc50..9c7ce562 100644 --- a/launcher/main/CMakeLists.txt +++ b/launcher/main/CMakeLists.txt @@ -1,9 +1,6 @@ set(COMPONENT_SRCDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".") register_component() -if(IDF_TARGET STREQUAL "esp32") - component_compile_options(-mfix-esp32-psram-cache-issue) -endif() rg_setup_compile_options(-O2 -Wno-error=format -Wno-error=char-subscripts) # add_custom_command(OUTPUT images.c diff --git a/prboom-go/components/prboom/CMakeLists.txt b/prboom-go/components/prboom/CMakeLists.txt index acb6cb2d..8079fe4f 100644 --- a/prboom-go/components/prboom/CMakeLists.txt +++ b/prboom-go/components/prboom/CMakeLists.txt @@ -3,13 +3,6 @@ set(COMPONENT_ADD_INCLUDEDIRS ".") set(COMPONENT_REQUIRES "retro-go") register_component() -# The PSRAM cache bug seems responsible for very odd bugs that I spent way too much time -# trying to debug... In retro-go the fix is disabled because of the huge performance overhead -# but I guess we'll have to live with it in at least the prboom-go module... -if(IDF_TARGET STREQUAL "esp32") - component_compile_options(-mfix-esp32-psram-cache-issue) -endif() - rg_setup_compile_options( -Wno-error=address -Wno-misleading-indentation