Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
use_cmake: false

# (Optional) cppcheck args
cppcheck_args: -i$GITHUB_WORKSPACE/components/gbc/gnuboy -i$GITHUB_WORKSPACE/components/nes/nofrendo -i$GITHUB_WORKSPACE/components/msx/fmsx -i$GITHUB_WORKSPACE/components/doom/prboom -i$GITHUB_WORKSPACE/components/sms/smsplus -i$GITHUB_WORKSPACE/components/genesis/gwenesis -i$GITHUB_WORKSPACE/components/darkforces/tfe -i$GITHUB_WORKSPACE/components/gui/generated -i$GITHUB_WORKSPACE/components/menu/generated -i$GITHUB_WORKSPACE/components/jpegdec -i$GITHUB_WORKSPACE/components/pico8/femto8 --check-level=exhaustive --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt
cppcheck_args: -i$GITHUB_WORKSPACE/components/gbc/gnuboy -i$GITHUB_WORKSPACE/components/nes/nofrendo -i$GITHUB_WORKSPACE/components/msx/fmsx -i$GITHUB_WORKSPACE/components/doom/prboom -i$GITHUB_WORKSPACE/components/sms/smsplus -i$GITHUB_WORKSPACE/components/genesis/gwenesis -i$GITHUB_WORKSPACE/components/darkforces/TheForceEngine -i$GITHUB_WORKSPACE/components/gui/generated -i$GITHUB_WORKSPACE/components/menu/generated -i$GITHUB_WORKSPACE/components/jpegdec -i$GITHUB_WORKSPACE/components/pico8/femto8 --check-level=exhaustive --force --enable=all --inline-suppr --inconclusive --platform=mips32 --std=c++17 --suppressions-list=$GITHUB_WORKSPACE/suppressions.txt
24 changes: 24 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,27 @@
path = components/pico8/femto8
url = https://github.com/esp-cpp/femto8.git
branch = esp32
[submodule "components/nes/nofrendo"]
path = components/nes/nofrendo
url = https://github.com/esp-cpp/nofrendo.git
branch = main
[submodule "components/gbc/gnuboy"]
path = components/gbc/gnuboy
url = https://github.com/esp-cpp/gnuboy.git
branch = main
[submodule "components/msx/fmsx"]
path = components/msx/fmsx
url = https://github.com/esp-cpp/fmsx.git
branch = main
[submodule "components/sms/smsplus"]
path = components/sms/smsplus
url = https://github.com/esp-cpp/smsplus.git
branch = main
[submodule "components/doom/prboom"]
path = components/doom/prboom
url = https://github.com/esp-cpp/prboom.git
branch = main
[submodule "components/darkforces/TheForceEngine"]
path = components/darkforces/TheForceEngine
url = https://github.com/esp-cpp/TheForceEngine.git
branch = main
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ that removes the frame-rate cap for maximum speed.
| Dark Forces | [The Force Engine](https://theforceengine.github.io/) (via [BSzili's Amiga port](https://github.com/BSzili/TheForceEngine/tree/amiga)) | — | Software renderer, iMuse sound effects and OPL3 music; see [Dark Forces setup](#dark-forces-setup) |
| PICO-8 | [femto8](https://github.com/benbaker76/femto8) | — | `.p8` and `.p8.png` carts; D-Pad, A/Y = O, B/X = X, START = PICO-8 pause menu; save states; cartdata saves to `pico8/cdata/`; see [PICO-8 setup](#pico-8-setup) |

Every core is a submodule ([esp-cpp/nofrendo](https://github.com/esp-cpp/nofrendo),
[gnuboy](https://github.com/esp-cpp/gnuboy), [smsplus](https://github.com/esp-cpp/smsplus),
[gwenesis](https://github.com/esp-cpp/gwenesis), [fmsx](https://github.com/esp-cpp/fmsx),
[prboom](https://github.com/esp-cpp/prboom), [TheForceEngine](https://github.com/esp-cpp/TheForceEngine),
[femto8](https://github.com/esp-cpp/femto8)): the core plus its `port/` glue to
`BoxEmu`, shared with [tab5-emu](https://github.com/esp-cpp/tab5-emu). Each
`components/<core>/CMakeLists.txt` here is the board's wrapper for it
(requirements, compile flags, linker fragment).

> 🧬 **Full-speed Genesis on the S3.** The Genesis core ships with a custom
> **dual-core** modification of gwenesis that spreads the workload across both of
> the ESP32-S3's CPU cores: **core 0** runs the 68000 CPU and VDP (video), while
Expand Down
82 changes: 42 additions & 40 deletions components/darkforces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
# Dark Forces for esp-box-emu, built on The Force Engine (TFE).
#
# tfe/ contains a vendored subset of BSzili's Amiga branch of TFE (based on
# TFE v1.09.410) with the __AMIGA__ platform guards renamed to TFE_ESPBOX.
# src/platform/ provides the ESP32 implementations of the platform interfaces
# (system timers, render backend, audio, threads, memory regions, stubs).
# From the esp-cpp/TheForceEngine submodule: TheForceEngine/tfe is a subset of
# BSzili's Amiga branch of TFE (based on TFE v1.09.410) with the __AMIGA__
# platform guards renamed to TFE_ESPBOX (see TheForceEngine/VENDOR.md);
# TheForceEngine/port/platform provides the ESP32 implementations of the
# platform interfaces (system timers, render backend, audio, threads, memory
# regions, stubs).
set(TFE_SRC_DIRS
"tfe/TFE_System"
"tfe/TFE_Memory"
"tfe/TFE_FileSystem"
"tfe/TFE_Archive"
"tfe/TFE_Asset"
"tfe/TFE_Audio"
"tfe/TFE_Audio/MidiSynth"
"tfe/TFE_Input"
"tfe/TFE_Settings"
"tfe/TFE_Game"
"tfe/TFE_Outlaws"
"tfe/TFE_Jedi/Collision"
"tfe/TFE_Jedi/IMuse"
"tfe/TFE_Jedi/InfSystem"
"tfe/TFE_Jedi/Level"
"tfe/TFE_Jedi/Math"
"tfe/TFE_Jedi/Memory"
"tfe/TFE_Jedi/Serialization"
"tfe/TFE_Jedi/Task"
"tfe/TFE_Jedi/Renderer"
"tfe/TFE_Jedi/Renderer/RClassic_Fixed"
"tfe/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed"
"tfe/TFE_DarkForces"
"tfe/TFE_DarkForces/Actor"
"tfe/TFE_DarkForces/GameUI"
"tfe/TFE_DarkForces/Landru"
"TheForceEngine/tfe/TFE_System"
"TheForceEngine/tfe/TFE_Memory"
"TheForceEngine/tfe/TFE_FileSystem"
"TheForceEngine/tfe/TFE_Archive"
"TheForceEngine/tfe/TFE_Asset"
"TheForceEngine/tfe/TFE_Audio"
"TheForceEngine/tfe/TFE_Audio/MidiSynth"
"TheForceEngine/tfe/TFE_Input"
"TheForceEngine/tfe/TFE_Settings"
"TheForceEngine/tfe/TFE_Game"
"TheForceEngine/tfe/TFE_Outlaws"
"TheForceEngine/tfe/TFE_Jedi/Collision"
"TheForceEngine/tfe/TFE_Jedi/IMuse"
"TheForceEngine/tfe/TFE_Jedi/InfSystem"
"TheForceEngine/tfe/TFE_Jedi/Level"
"TheForceEngine/tfe/TFE_Jedi/Math"
"TheForceEngine/tfe/TFE_Jedi/Memory"
"TheForceEngine/tfe/TFE_Jedi/Serialization"
"TheForceEngine/tfe/TFE_Jedi/Task"
"TheForceEngine/tfe/TFE_Jedi/Renderer"
"TheForceEngine/tfe/TFE_Jedi/Renderer/RClassic_Fixed"
"TheForceEngine/tfe/TFE_Jedi/Renderer/RClassic_Fixed/robj3d_fixed"
"TheForceEngine/tfe/TFE_DarkForces"
"TheForceEngine/tfe/TFE_DarkForces/Actor"
"TheForceEngine/tfe/TFE_DarkForces/GameUI"
"TheForceEngine/tfe/TFE_DarkForces/Landru"
)

idf_component_register(
INCLUDE_DIRS "include"
SRC_DIRS "src" "src/platform" ${TFE_SRC_DIRS}
PRIV_INCLUDE_DIRS "tfe" "src/platform"
INCLUDE_DIRS "TheForceEngine/port/include"
SRC_DIRS "TheForceEngine/port" "TheForceEngine/port/platform" ${TFE_SRC_DIRS}
PRIV_INCLUDE_DIRS "TheForceEngine/tfe" "TheForceEngine/port/platform"
REQUIRES box-emu statistics pool_allocator esp_timer pthread heap esp_system
LDFRAGMENTS "linker.lf"
)
Expand Down Expand Up @@ -82,20 +84,20 @@ target_compile_options(${COMPONENT_LIB} PRIVATE

# The renderer and the OPL3 synthesizer are the hot paths: optimize those for speed.
file(GLOB_RECURSE DF_HOT_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/tfe/TFE_Jedi/Renderer/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/tfe/TFE_Jedi/Math/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/tfe/TFE_Audio/MidiSynth/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/tfe/TFE_Audio/MidiSynth/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/tfe/TFE_Jedi/IMuse/imDigitalSound.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TheForceEngine/tfe/TFE_Jedi/Renderer/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TheForceEngine/tfe/TFE_Jedi/Math/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TheForceEngine/tfe/TFE_Audio/MidiSynth/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/TheForceEngine/tfe/TFE_Audio/MidiSynth/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/TheForceEngine/tfe/TFE_Jedi/IMuse/imDigitalSound.cpp"
)
set_source_files_properties(${DF_HOT_SOURCES} PROPERTIES COMPILE_OPTIONS "-O2")

# Everything Dark Forces allocates lives in BoxEmu's 4MB ROM block while it runs
# (src/platform/esp_alloc.cpp): rename the allocation functions referenced by
# (TheForceEngine/port/platform/esp_alloc.cpp): rename the allocation functions referenced by
# this library to the df_* replacements, and route free()/realloc() of block
# pointers made anywhere in the firmware back to the block.
add_custom_command(TARGET ${COMPONENT_LIB} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} --redefine-syms=${CMAKE_CURRENT_SOURCE_DIR}/alloc_redirect.syms $<TARGET_FILE:${COMPONENT_LIB}>
COMMAND ${CMAKE_OBJCOPY} --redefine-syms=${CMAKE_CURRENT_SOURCE_DIR}/TheForceEngine/port/alloc_redirect.syms $<TARGET_FILE:${COMPONENT_LIB}>
COMMENT "Redirecting Dark Forces allocations to the ROM block"
VERBATIM)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=free" "-Wl,--wrap=realloc")
1 change: 1 addition & 0 deletions components/darkforces/TheForceEngine
Submodule TheForceEngine added at 12d2a3
61 changes: 0 additions & 61 deletions components/darkforces/VENDOR.md

This file was deleted.

13 changes: 0 additions & 13 deletions components/darkforces/alloc_redirect.syms

This file was deleted.

21 changes: 0 additions & 21 deletions components/darkforces/include/darkforces.hpp

This file was deleted.

Loading
Loading