Skip to content

Commit

Permalink
"Add" support for Wii SDL2. (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR authored Feb 1, 2024
1 parent 977ea6b commit aecf657
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 4 deletions.
4 changes: 4 additions & 0 deletions arch/wii/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
59 changes: 59 additions & 0 deletions arch/wii/pad.config.sdl2
Original file line number Diff line number Diff line change
@@ -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
10 changes: 6 additions & 4 deletions docs/platform_matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -956,9 +956,11 @@ <h2>Platform Notes</h2>
SDL significantly increases the size of the MZX executable.
</li>

<li id="note9">Building MZX with SDL Wii is viable, but produces larger
binaries than desired, relies on the software renderer, and SDL Wii is
considered unstable.
<li id="note9">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).
</li>

<li id="note10">Layer rendering is supported on this platform by as it
Expand Down

0 comments on commit aecf657

Please sign in to comment.