Skip to content

Optimize Switch port performance, logging, and build process#185

Open
wel97459 wants to merge 8 commits into
JRickey:mainfrom
wel97459:dev-switch
Open

Optimize Switch port performance, logging, and build process#185
wel97459 wants to merge 8 commits into
JRickey:mainfrom
wel97459:dev-switch

Conversation

@wel97459

Copy link
Copy Markdown
Contributor

This pull request adds support for building and deploying the project on the Nintendo Switch, including cross-compilation, packaging, and platform-specific controller fixes. It introduces new CMake logic for Switch builds, updates documentation with detailed Switch instructions, and resolves a Switch-specific multiplayer input bug. The submodule for decomp is also updated.

Nintendo Switch platform support:

  • Added Nintendo Switch as a supported build target in CMakeLists.txt, including ARM64 cross-compilation, aggressive optimization flags, and packaging steps to generate .nro files using devkitPro tools (nacptool, elf2nro). Switch-specific source files and defines are now included as needed. [1] [2] [3]
  • Introduced a BundleSwitch CMake target to bundle the .nro, asset files, and deployment helpers into an SD card–ready directory structure for Switch.

Build system and deployment improvements:

  • Ensured that host-only build steps (e.g., Torch asset extraction, custom targets) are excluded from Switch builds, and post-build steps are properly separated by platform. [1] [2] [3] [4]

Documentation:

  • Added a comprehensive section to README.md detailing prerequisites, build steps, and deployment instructions for the Nintendo Switch port, including both scripted and manual workflows.

Bug fixes and submodule updates:

  • Documented and resolved a Switch-specific multiplayer input routing bug where all controllers defaulted to player 1; added platform-specific controller mapping fixes for Joy-Con variants. [1] [2]
  • Updated the decomp submodule to the latest commit.

vinvirile and others added 8 commits May 17, 2026 09:19
… fixes

libultraship:
- Fix inverted frame limiter on Switch (SyncFramerateWithTime before swap)
- Cap internal resolution multiplier to 1.5x for stable 60fps in docked
- Add switch.cmake with GLES3/glad/Switch-specific dependencies

Port layer:
- Buffer SD-card logging in 64KB RAM ring to eliminate fflush stalls
- Fix CPU boost for modern firmware (appletSetCpuBoostMode >= 8.0.0)
- Disable hot-path display list/frame logs on Switch
- Switch platform implementation (display sizing, CPU boost, system fonts)
- Coroutine support for Switch (ARM64 context switching)

Build system:
- Add -O3 -mtune=cortex-a57 -ffast-math -flto for Switch game code
- Guard TORCH_EXECUTABLE copy in POST_BUILD for Switch (cmake 4.3.0 compat)
- Bundle shader_cache/ directory in Switch deployment target
- .gitignore: exclude *.elf, *.nro, switch_sd/ build artifacts
- README: add Nintendo Switch build section with prerequisites and instructions
- scripts/build-switch.sh: one-command Switch build pipeline
- docs/switch_port.md: Switch-specific port architecture reference
- Organized namespace declarations for clarity.
- Enhanced atomic flag management for update checks and downloads.
- Added OS-specific handling for update checks and downloads.
- Introduced new functions for opening the release page and retrieving update statuses.
- Improved string handling with mutex locks for thread safety.

Add static variable for download submission count in gameloop.cpp

- Introduced sDLSubmitCount to track the number of download submissions.

Update build-switch.sh to include devkitPro in PATH

- Added export command to ensure devkitPro toolchain is accessible during the build process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants