VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Anyone knows how to easily add support for the other SDL2 supported platforms while still using the old Makefile format?

Currently it has a basic Makefile.files for the local part of the project (SDL2), with bindings to Android studio directly and most SDL2 platforms having bindings using seperate Makefiles for each platform.

But can this also support the platforms that seem to use CMake? Like PS Vita? And perhaps WII, Switch and other consoles and devices?

Anyone knows how to easily add support for the SDL-supported platforms without too much work on creating specific Makefiles etc. for all of them (which would be the purpose of SDL2)?

Edit: Just added a theoretical Switch (not sure about that one) and PS Vita (should theoretically be a complete Makefile) SDL2 multiplatform Makefile (as new "switch" and "vita" build targets to use). Although stuff like actual handling of it in the souce code (mainly the input controllers afaik? All else is default SDL2 (video, audio etc.)) still need to be added.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just added a basic compatibility layer for PS Vita and Nintendo Switch to UniPCemu (although stuff like paths are still handled as on PC). Mostly everyting is handled like on Android, except the paths (simply current working directory atm).
The PS Vita and Switch builds will assume a static screen atm. Also, currently the joystick interface to them isn't implemented yet (which is afaik the only special thing that needs to be done to the interface code itself(at the common emulator framework level)).

The Makefiles have been made for them, although mostly copy-paste of two other SDL2 sources (with adjustments for different directories being used: https://github.com/carstene1ns/switch-sdl2-demo and https://github.com/vitasdk/samples/blob/maste … _world/Makefile .

Both assume a normal make command being issued with the vita or switch keyword. The vita one will probably work like that, but I'm not quite sure about the Switch builds (both are still untested).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just implemented the Switch joystick inputs (assumed always existing at index #0) based on https://gbatemp.net/threads/sdl2-joycon-bindings.505099/ .
Also implemented the Vita joystick inputs based on comparing the mappings of the vita joystick against the psp joystick.

So they should be properly working now (both inputs), as long as it can compile the files at least (probably on Vita, maybe on Switch. Both are unconfirmed atm, since I don't have any hacked one of those two (nor atm willing to hack my own to verify)).

Perhaps some kind of emulators will do?

Edit: Just confirmed the Switch joystick mappings using https://github.com/devkitPro/SDL/blob/switch- … sjoystick.c#L46 and they match.

So the joysticks etc. should at least work. Now only the compilation itself needs to be verified.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

After a whole afternoon working I've finally managed to get it properly compiled on the VitaSDK. Although I didn't check the Switch or the result of the app running on the Vita yet (in an emulator).

Edit: After some more bugfixing of remaining issues with SDL2 and UniPCemu on the Vita, it's now properly running on the Vita3K emulator, so probably will run fine on a real Vita as well! 😁

Although I didn't check the Switch part yet, as I currently don't know much about it's interface or compiler (is there even a homebrew compiler for the Switch that's non-official)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 4 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just managed to get the Switch build running!

There were still some issues with:
- The compilation process itself, which have now been fixed (the Makefile).
- Application timekeeping (gettimeofday calls) were not handled due to the Switch not being recognized yet.
- Inputs using the incorrect PSP input mappings for SDL instead of the proper Switch input mappings.

Although currently the Switch input mappings are mapped to be the equivalent of the PSP locations (that is B for confirming, A for cancel). Perhaps I'll need to change it to be Switch-specific for the menus only?
Edit: Just modified the Switch builds to have reversed confirm/cancel buttons (thus A for confirm, B for cancel) for them menu's. The debugger still keeps it's old mapping to be PSP-compatible, since it's not quite confirm/cancel in that case (all buttons having different types of actions instead of confirm/cancel type of actions). So with the debugger, A is still the modifier button and B is the single-step button (same mapping as the PSP).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 5 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just gave the Switch and Vita builds the Android treatment: the enter key always confirms, while the escape and backspace key on the OSK cancels. This is now implemented in a platform-agnostic way (automatically mapping to the used confirm(A on Switch, Cross otherwise) and cancel(B on Switch, Circle otherwise) buttons).
The keypad inputs are now still mapped to the bottom input(cross/B to KP2) and right input (circle/A to KP6).

So that should fix any input issues used with the different consoles.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 6 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just a simple question: is it legal to release homebrew for the Switch? I know that homebrew itself is probably a grey area and hacking a Switch is illegal, but I don't know if that's the case for the Switch homebrew as well(regarding Nintendo's aggressivity on it)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 7 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. Made the plunge. Now UniPCemu is available for the Switch on the itch.io page together with a small Vita update for some slight SDL2 bugfixes (some missing events are now properly handled).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 8 of 8, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. Apparently weird issues on real vitas(black screen) but not on a Vita emulator I'm testing with(Vita3K)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io