Hi all!
A few weeks ago I started working on a SDL2 port for the Wii and GameCube. The current status is this:
Audio
Send audio to wiimote
Joysticks
Gamepads
Rumble support
Keyboard
Mouse
Wiimote IR as mouse
Mouse cursors
USB Mouse
Power
Sensors
Time
Threads
Video
Framebuffer
2D acceleration
The source code is available at https://github.com/mardy/SDL/tree/ogc-sdl2-2.28 (be sure to checkout the correct branch!), and instructions on how to build it are in docs/README-ogc.md. Once ready, I'll submit it for inclusion in devkitPro (and I wonder, if libSDL itself would accept it, or if they don't support out-of-market devices), but for the time being I'll be happy to get early feedback and bug reports.
UPDATE 2024-01-28: libSDL2 is now available from the devkitPro repository. It's still under works, but most things are working.
Hi all!
A few weeks ago I started working on a SDL2 port for the Wii and GameCube. The current status is this:
Audio
Joysticks
Gamepads
Rumble support
Keyboard
Mouse
Power
Sensors
Time
Threads
Video
Framebuffer
2D acceleration
The source code is available at https://github.com/mardy/SDL/tree/ogc-sdl2-2.28 (be sure to checkout the correct branch!), and instructions on how to build it are in docs/README-ogc.md. Once ready, I'll submit it for inclusion in devkitPro (and I wonder, if libSDL itself would accept it, or if they don't support out-of-market devices), but for the time being I'll be happy to get early feedback and bug reports.
Today I added support the using the Wiimote infrared pointing device as a mouse; it's not something that was implemented in the SDL1 port, but it seems potentially useful, since it would allow us to run some programs that require a mouse.
For the time being I mapped only two buttons (A and B, as right and left respectively), supporting more would not be hard at all, but I'm not sure it would be helpful (reaching the other buttons while pointing the Wiimote at the screen is not very comfortable).
I updated the first post: SDL2 is now in the devkitPro repositories, we've got 2D acceleration working, support for mouse cursors, and I will be very happy to help if people are trying to use it and encounter some issues. :-)
I decided to test it out with l'Abbaye des Morts today.
It took me a while to figure out which library dependencies I needed to add to the makefile. I think this is normal for SDL but it should probably be documented somewhere (maybe it was and I didn't see it?)
The project compiled for me with these libs:
Hi Jeff, I'm sorry that I didn't see your message before. Have you solved the input issues already? If not, could you please link to your source code repo, so that I can try it?
Hi Jeff, I'm sorry that I didn't see your message before. Have you solved the input issues already? If not, could you please link to your source code repo, so that I can try it?
I've uploaded a .zip because apparently I can't fork a repository on github twice?
It's pretty much identical to the original except for the makefile, and some minor tweaks to main.c. At line 29 I changed fullscreen to 1, and at line 67 I added a line that skips the menu and jumps into gameplay.
Also for the game to work you need the "data", "graphics", and "sounds" folders in the same location as the .dol file, or on the root of the virtual SD card if you're using dolphin.
Another thing I noticed: this game calls "SDL_ShowCursor(SDL_DISABLE);" however the wiimote pointer still displays on screen.
Hi Jeff, some updates:
- I've submitted a PR on Abbaye to support the wiimote directional keys: https://github.com/nevat/abbayedesmorts-gpl/pull/19
- Yesterday we merged a change in SDL to translate the directional movements for a Wiimote held sideways: you'll need to call
Code:
setenv("SDL_WII_JOYSTICK_SIDEWAYS", "1", 1);
before calling SDL_Init() for this to work.
- The cursor should now be gone, too :-)
Hi Jeff, some updates:
- I've submitted a PR on Abbaye to support the wiimote directional keys: https://github.com/nevat/abbayedesmorts-gpl/pull/19
- Yesterday we merged a change in SDL to translate the directional movements for a Wiimote held sideways: you'll need to call
Code:
setenv("SDL_WII_JOYSTICK_SIDEWAYS", "1", 1);
before calling SDL_Init() for this to work.
- The cursor should now be gone, too :-)
That's awesome, excellent work!
Is there a full list of variables that can be changed for SDL on the Wii?
Also I wanted to ask about 240p support. Is there a way to enable it through SDL? I'm not sure if it needs to be SDL's responsibility, maybe there's a way to expose the current display mode and it can be changed externally.
Might as well dig up this old account to sing my praises. I was going to port one of my games, SuDokuL, to SDL1 so I could get it on Wii, but it had some graphical issues. But then I found out about this SDL2 port, and that works like a charm! 60 FPS at 480p while constantly re-rendering everything. The pointer controls work great as well, especially with the built-in pointer graphic. I kinda wish it would rotate as you rotate the remote, but that's definitely a nitpick. https://github.com/Mode8fx/SuDokuL
I also tried moving Trogdor: Reburninated from SDL1 to SDL2 (it supports both). To put the performance increase into perspective, the original SDL1 version hit 60 FPS at 240p but only went up to 25 FPS on 480p, while the SDL2 version is a constant 60 no matter what. However, changing the screen scaling mid-game, which involves recreating sprites and text at a different size, immediately crashes for the SDL2 version while SDL1 and other consoles' SDL2's handle it fine. It's probably something specific to how this game handles textures, I haven't looked into why it happens. https://github.com/Mode8fx/Trogdor-Reburninated
Amazing work on this port! Are you also planning to port SDL2_image to Gamecube?
Also I wanted to ask about 240p support. Is there a way to enable it through SDL? I'm not sure if it needs to be SDL's responsibility, maybe there's a way to expose the current display mode and it can be changed externally.
It should work like SDL1's port where setting width to 320 and height to 240 via SDL_SetVideoMode() should automatically set the framebuffer to use 240p. That's what happens with SuDokuL.
No, but you can run a "git grep" in the SDL repo to see them. Here are the current ones we support; others might be added tn the future:
- SDL_WII_JOYSTICK_SIDEWAYS: this you know :-)
- SDL_WII_JOYSTICK_SPLIT: The wiimote and its expansion will be reported as separate joysticks
Then there's a standard SDL hint, SDL_HINT_ACCELEROMETER_AS_JOYSTICK, which, if set, makes it so that the wiimote accelerometer is reported as additional axes on the Wiimote joystick.
Also I wanted to ask about 240p support. Is there a way to enable it through SDL? I'm not sure if it needs to be SDL's responsibility, maybe there's a way to expose the current display mode and it can be changed externally.
We don't currently support any window modes other than 640x480, but I think we should. I recently made a small app wii-screen (you can find it in the OpenShop), to study the available video modes. If you are willing to create a branch of Abbaye which calls SDL_SetWindowDisplayMode to set the video mode, then it will be easier for me to add the missing support.
The pointer controls work great as well, especially with the built-in pointer graphic. I kinda wish it would rotate as you rotate the remote, but that's definitely a nitpick.
Please file it as a feature request, I'm not sure if I'll get into that soon (I'm afraid that the amount of work might not be worth the benefit), but it's nice to have it tracked -- maybe someone else will jump in and implement it before I do
I also tried moving Trogdor: Reburninated from SDL1 to SDL2 (it supports both). To put the performance increase into perspective, the original SDL1 version hit 60 FPS at 240p but only went up to 25 FPS on 480p, while the SDL2 version is a constant 60 no matter what. However, changing the screen scaling mid-game, which involves recreating sprites and text at a different size, immediately crashes for the SDL2 version while SDL1 and other consoles' SDL2's handle it fine. It's probably something specific to how this game handles textures, I haven't looked into why it happens. https://github.com/Mode8fx/Trogdor-Reburninated
I'll give it a try. It may be that it uses SDL_LockTexture, which I haven't yet implemented. But if it's so, now I have a strong motivation to work on it https://github.com/Mode8fx/Trogdor-Reburninated
It should work like SDL1's port where setting width to 320 and height to 240 via SDL_SetVideoMode() should automatically set the framebuffer to use 240p. That's what happens with SuDokuL.
Please file it as a feature request, I'm not sure if I'll get into that soon (I'm afraid that the amount of work might not be worth the benefit), but it's nice to have it tracked -- maybe someone else will jump in and implement it before I do
https://github.com/devkitPro/SDL/issues
Please specify that this is specific to the Wii, since we support many different ports in different branches of that repo.
Thank you so much for this great work, I've been waiting for that so long. Can't wait to integrate and distribute this in my projects including my Engine (https://leapengine.idpowered.com)!
As each year passes, retro games become harder and harder to play, as the physical media begins to fall apart and becomes more difficult and expensive to obtain. The...
After several months of work, the Harbour Masters 64 team have released their first public build of 2Ship2Harkinian, a feature-rich Majora's Mask PC port. This comes...
Retro handheld manufacturer Anbernic has revealed its first clamshell device: the Anbernic RG35XXSP. As the suffix indicates, this handheld's design is inspired by...
With the vast success of Super Mario Maker and its Switch sequel Super Mario Maker 2, Nintendo fans have long been calling for "Maker" titles for other iconic genres...
Palmer Luckey is known for his pursuits into the world of virtual reality, having founded Oculus and designed the Rift VR headset. Prior to the $2 billion dollar...
Ubisoft has today officially revealed the next installment in the Assassin's Creed franchise: Assassin's Creed Shadows. This entry is set in late Sengoku-era Japan...
Another day, another great emulator that makes its way into the Apple Store for more users to enjoy. With Apple opening its store up to videogame emulators earlier...
After a little more than three years of exclusivity with the Epic Games Store, Square Enix has decided to bring their beloved Kingdom Hearts franchise to Steam. The...
Another day, another Nintendo DMCA takedown against fan-made content.
Just a few minutes ago, Nintendo issued a DMCA takedown notice against a widely known and...
Continuing with the number of available retro emulators found in the Apple Store, after Apple's decision to finally allow videogame emulators on their store, another...
Palmer Luckey is known for his pursuits into the world of virtual reality, having founded Oculus and designed the Rift VR headset. Prior to the $2 billion dollar...
As each year passes, retro games become harder and harder to play, as the physical media begins to fall apart and becomes more difficult and expensive to obtain. The...
After several months of work, the Harbour Masters 64 team have released their first public build of 2Ship2Harkinian, a feature-rich Majora's Mask PC port. This comes...
Ubisoft has today officially revealed the next installment in the Assassin's Creed franchise: Assassin's Creed Shadows. This entry is set in late Sengoku-era Japan...
After a little more than three years of exclusivity with the Epic Games Store, Square Enix has decided to bring their beloved Kingdom Hearts franchise to Steam. The...
Another day, another Nintendo DMCA takedown against fan-made content.
Just a few minutes ago, Nintendo issued a DMCA takedown notice against a widely known and...
Sony is once more attempting to reintroduce players to their older library of games by re-releasing classic PlayStation 2 titles onto the PlayStation Store. During...
Retro handheld manufacturer Anbernic has revealed its first clamshell device: the Anbernic RG35XXSP. As the suffix indicates, this handheld's design is inspired by...
With the vast success of Super Mario Maker and its Switch sequel Super Mario Maker 2, Nintendo fans have long been calling for "Maker" titles for other iconic genres...
The latest State of Play is here. This is PlayStation's Summer showcase, providing updates to new updates on upcoming games and brand new reveals. The 35-minute...