From aecf657c4df816ddbcd7db48af8fc87217af04c9 Mon Sep 17 00:00:00 2001 From: Alice R Date: Wed, 31 Jan 2024 18:15:26 -0700 Subject: [PATCH] "Add" support for Wii SDL2. (#423) --- arch/wii/Makefile.in | 4 +++ arch/wii/pad.config.sdl2 | 59 +++++++++++++++++++++++++++++++++++++++ docs/platform_matrix.html | 10 ++++--- 3 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 arch/wii/pad.config.sdl2 diff --git a/arch/wii/Makefile.in b/arch/wii/Makefile.in index fc5095eff..8f0cf4da7 100644 --- a/arch/wii/Makefile.in +++ b/arch/wii/Makefile.in @@ -78,7 +78,11 @@ build: package ${build} ifeq ($(BUILD_SDL),) ${CP} arch/wii/pad.config ${build} else +ifeq (${BUILD_SDL},1) ${CP} arch/wii/pad.config.sdl ${build}/pad.config +else + ${CP} arch/wii/pad.config.sdl2 ${build}/pad.config +endif endif ${CP} arch/wii/icon.png ${build} ${CP} boot.dol ${build} diff --git a/arch/wii/pad.config.sdl2 b/arch/wii/pad.config.sdl2 new file mode 100644 index 000000000..e76325a7a --- /dev/null +++ b/arch/wii/pad.config.sdl2 @@ -0,0 +1,59 @@ +# Wii Remote (+ nunchuck or classic) +# +# Axis1: -left +right (left stick, nunchuck stick) +# Axis2: -up +down +# Axis3: -left +right (right stick) +# Axis4: -up +down +# +# As of 2024-01-31, no axes are assigned to the triggers for some reason. +# +# Button1: A +# Button2: B +# Button3: 1 +# Button4: 2 +# Button5: - +# Button6: + +# Button7: Home +# Button8: Z (nunchuck) +# Button9: C (nunchuck) +# Button10: X +# Button11: Y +# Button12: L +# Button13: R +# Button14: ZL +# Button15: ZR +# Hat1: dpad + +# Gamecube controller +# +# Axis1: -left +right (left stick, nunchuck stick) +# Axis2: -up +down +# Axis3: -left +right (right stick) +# Axis4: -up +down +# Axis5: +L +# Axis6: +R +# +# Button1: A +# Button2: B +# Button3: X +# Button4: Y +# Button5: L +# Button6: R +# Button7: Z +# Button8: Start +# Hat1: dpad + +# You might need to take the mappings printed in stdout.txt and modify them +# to suit you: + +#gamepad_add = 050000007e0500000305000001000000,Wiimote 0 + Classic,a:b1,b:b0,x:b10,y:b9,back:b4,guide:b6,start:b5,leftshoulder:b13,rightshoulder:b14,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b11,righttrigger:b12, + +# Because this build uses SDL, MZX can generate mappings automatically with +# the SDL gamepad API. However, this API is based on XInput and has +# the face buttons inverted from where they'd be expected on a Nintendo system. +# Uncommenting this "fixes" the classic controller but breaks gamecube controllers. + +#gamepad.a = act_b +#gamepad.b = act_a +#gamepad.x = act_y +#gamepad.y = act_x diff --git a/docs/platform_matrix.html b/docs/platform_matrix.html index 3a4ef359d..bc3fd0784 100644 --- a/docs/platform_matrix.html +++ b/docs/platform_matrix.html @@ -55,7 +55,7 @@ var no_updater = subopt("NO", 6); var no_updater_unix = subopt("NO", 7); var optional_sdl_3ds = std("NO / SDL 1.2 / SDL 2", 8); -var optional_sdl_wii = std("NO / SDL 1.2", 9); +var optional_sdl_wii = std("NO / SDL 1.2 / SDL 2", 9); var yes_but_8bpp = subopt("YES (8bpp)", 10); var no_gl_switch = subopt("NO", 11); var no_gl_fixed_android = subopt("NO", 12); @@ -956,9 +956,11 @@

Platform Notes

SDL significantly increases the size of the MZX executable. -
  • Building MZX with SDL Wii is viable, but produces larger -binaries than desired, relies on the software renderer, and SDL Wii is -considered unstable. +
  • Building MZX with SDL Wii (1.2) or SDL2 is viable, but +produces larger binaries than desired and relies on the software renderer. +SDL Wii (1.2) is also considered unstable. Also, the SDL controller mappings +are far less flexible than MZX's built-in support and may omit features (like +the classic controller's analog triggers).
  • Layer rendering is supported on this platform by as it