Mefiresu / RSDKv5-Decompilation

A complete decompilation of Retro Engine (v5) ported to the Wii
Other
49 stars 6 forks source link

Multiplayer input support for the Wii #47

Closed camthehaxman closed 5 months ago

camthehaxman commented 6 months ago

This small change allows co-op mode to work. If playing as Sonic and Tails, a second Wii remote can be connected and will control Tails.

I still haven't yet figured out how to get competition mode working. Even after connecting multiple Wii remotes the character select screen only responds to the first one.

camthehaxman commented 6 months ago

I've gotten the input to work properly. However, split screen doesn't work in competition mode. It only shows Player 1's screen.

Mefiresu commented 6 months ago

Thanks for the PR!

I've gotten the input to work properly. However, split screen doesn't work in competition mode. It only shows Player 1's screen.

The current code only draws the main (first) framebuffer to the screen. The GX code would require some modifications in order to be able to copy and draw up to 4 framebuffers on the screen with a GX equivalent of: https://github.com/Mefiresu/RSDKv5-Decompilation/blob/7b21415279f0abdbb356688581b46061c2b507a0/RSDKv5/RSDK/Graphics/GLFW/GLFWRenderDevice.cpp#L343 Along with the removal of the SCREEN_COUNT macro redefinition that was done to save RAM: https://github.com/Mefiresu/RSDKv5-Decompilation/blob/7b21415279f0abdbb356688581b46061c2b507a0/platforms/NintendoWii.cmake#L50 I have no idea if there's enough RAM left to fit split screen multiplayer.

camthehaxman commented 6 months ago

I'm kind of confused as to how the drawing actually works. As I understand it, everything is software rendered to a 424x240 framebuffer, and the GX backend converts that framebuffer to a texture and draws it as a quad onto the screen. There's some weird tiling stuff going on here, and I'm not entirely sure why that's necessary. The Wii natively supports RGB565 textures.

Mefiresu commented 6 months ago

The tiling is done to improve widescreen resolution (instead of squishing the texture to 640x480 for anamorphic widescreen, multiple draw calls are used to use the entire 720x480 framebuffer).

camthehaxman commented 6 months ago

Ok, I'll probably investigate split screen in a separate PR, then. This one at least allows co-op to work, which didn't before.

camthehaxman commented 6 months ago

@Mefiresu Any other concerns with this PR, or can it be merged?

Mefiresu commented 5 months ago

Works fine on my end, thank you!