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

Wii: Add SDL2 support #3332

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Wii: Add SDL2 support #3332

merged 3 commits into from
Jan 29, 2025

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Jan 16, 2025

When targeting Wii the possible PLAYER_TARGET_PLATFORM are now SDL2 (default) and SDL1. SDL1 is still supported for testing purposes (and the code was already written ^^)

For PLAYER_AUDIO_BACKEND the default is as before AESND, but SDL2/SDL1 can be also selected (I moved the mutex code a bit, hopefully this fixes the random crashes when changing maps).


Besides the build system this is not very invasive, only had to change the button mapping and thats all.

Note: The CMakeLists changes are quite large because this is already the preparation for the SDL3 support. (initially I had Wii SDL2 and PC SDL3 commit combined)


Prebuilt for testing: https://easyrpg.org/downloads/tmp/wii-test.zip (contains both a SDL2 and a SDL1 build)

  • SDL2_Aesnd: The latest build with aesnd audio backend
  • SDL2_Audio: The latest build with sdl2audio backend
  • SDL1

Before you open SDL2 for the first time delete the file /data/easyrpg-player/config.ini on your SD card (or when the file is missing just do nothing) or input will be broken.

- Improve button mapping and comments
- Write SDL1 config in a different file
- Fix OGG playback (Wii uses tremor, playback is fine)
- Prevent Fullscreen toggling via command when the setting is disabled

Allowing fullscreen toggling messes up the rendering on WiiU
@Ghabry Ghabry added this to the 0.8.1 milestone Jan 16, 2025
@Ghabry Ghabry requested a review from carstene1ns January 16, 2025 15:58
@github-actions github-actions bot added Audio Building Wii Settings All about customizable features, storing and applying them Input Input related (gamepads, keyboard mappings, mouse support). For KeyInputProc, add event/interpreter labels Jan 16, 2025
@carstene1ns
Copy link
Member

Since the SDL2 ogc driver uses libaesnd anyway it should not make much difference, because both use our genericaudio class. I have somewhere a custom audio backend like for the 3ds, which can be used when we drop Wii SDL support completely and have a custom video backend (i have some code bitrotting for this as well).

@@ -851,8 +897,7 @@ target_link_libraries(${PROJECT_NAME} PIXMAN::PIXMAN)

# Always enable Wine registry support on non-Windows, but not for console ports
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"
AND NOT ${PLAYER_TARGET_PLATFORM} MATCHES "^(psvita|3ds|switch|wii)$"
AND NOT NINTENDO_WIIU)
AND NOT PLAYER_CONSOLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PLAYER_CONSOLE vs. PLAYER_CONSOLE_PORT.

# if defined(__WIIU__)
// FIXME: This is the endianess of the audio and not of the host but the byteswapping in ov_read does
// not sound like it works
int byte_order = 1; // BE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had this kind of problems when porting as well. Somehow the endianess is broken in the toolchain or the build scripts.

@fdelapena fdelapena merged commit 1093828 into EasyRPG:master Jan 29, 2025
13 of 15 checks passed
@carstene1ns
Copy link
Member

So, do we merge in half broken state now?
Fortunately only the wine registry is enabled, but the builders need some adaptions.

@Ghabry
Copy link
Member Author

Ghabry commented Jan 29, 2025

Also not happy with this situation... I'll add the PLAYER_CONSOLE_PORT part to the SDL3 PR.

And I rushed a quickfix for the CI builders (currently still set to SDL1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Building Input Input related (gamepads, keyboard mappings, mouse support). For KeyInputProc, add event/interpreter Settings All about customizable features, storing and applying them Wii
Development

Successfully merging this pull request may close these issues.

3 participants