Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nintendo Switch support #24

Merged
merged 4 commits into from
Oct 28, 2022
Merged

Nintendo Switch support #24

merged 4 commits into from
Oct 28, 2022

Conversation

AGraber
Copy link
Contributor

@AGraber AGraber commented Oct 27, 2022

Hi there, this set of changes adds support for building for Nintendo Switch using the devkitPro homebrew toolchain.

These two changes are mainly for Switch but they might improve compatibility with other exotic platforms too:

  • Add timiditycfg config setting for modifying where TiMidity will look for a midi cfg file. TiMidity is the backend that is used on Switch by SDL_Mixer (as well as other platforms depending on backend availability) for playing midi files. Usually, it looks for /etc/timidity/freepats.cfg but that's not present on the Switch so it has to be configureable for it to look where appropiate.
  • Add SDL_LogError call on NACT::fatal to facilitate debugging on platforms that don't implement SDL_ShowSimpleMessageBox (in this case the Switch).

The Switch-exclusive changes are:

  • Added some CMake code to generate an NACP and NRO file with resources bundled into romfs (NRO is a custom format for the Switchm, preferred for homebrew - Switch can't use elf as is. NACP is a metadata file needed for NRO generation). This is only active on Switch, of course. The used CMake functions are provided by the Switch Homebrew Toolchain's CMake specs.
  • Added icon for Switch
  • Added GitHub actions Switch workflow.
  • Added romfs init/exit code (to make the romfs:/ path containing the resources available)

If you have any questions, please ask! If the Switch build ever breaks, don't hesitate to tag me whenever through an issue so I can take a look an it, although considering the multiplatform nature of the project it would be rare that only the Switch build breaks without other building too.

- Bundle resources folder through romfs
- Added Switch-exclusive romfs init/exit code
- Add icon for NRO
- Add Switch-exclusive CMake code for NACP/NRO generation
- Add GitHub Actions Switch workflow
@AGraber
Copy link
Contributor Author

AGraber commented Oct 27, 2022

This is how Rance 4.1 and Little Vampire looks like on it:

IMG_20221027_193953
IMG_20221027_213707

@kichikuou
Copy link
Owner

This looks great! Sadly I don't have a moddable Switch though.

Are you planning to write documentation on how to build and install (although it doesn't have to be in this repository)?

@AGraber
Copy link
Contributor Author

AGraber commented Oct 28, 2022

Yeah, I forgot about that bit, I just added it. The steps are very similar to Linux other than the pacman & devkitPro CMake stuff. Relatively speaking, the amount of Switch-exclusive code is tiny as well, because of all the Android/Emscripten support already doing the legwork for multiplatform.

The GitHub Actions workflow file also takes care of building for Switch already, just a few seconds longer than the Linux build.

@kichikuou kichikuou merged commit a40d750 into kichikuou:master Oct 28, 2022
@kichikuou
Copy link
Owner

Thanks!

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.

None yet

2 participants