vita2hos release: Running PS Vita games on Nintendo Switch could soon become a reality

Vita scene veteran developer xerpi has released vita2hos (Vita to Horizon OS), an interface library that allows running Vita executables on the Nintendo Switch.
This is in very early development phase, and this first release only works with simple homebrew software such as the “cube sample” provided in the homebrew Vita SDK. (video below), but this could ultimately allow to run Vita Games on the Nintendo Switch, likely full speed performance out of the box.
What is Vita2hos for Nintendo Switch
Vita2hos is a “translation layer”, an API that reroutes Vita routine calls to Native Switch equivalents.
In other words, it is not an “emulator” in the technical sense, as it is not trying to mimic the Vita CPU/GPU, but instead reroutes libraries with native Switch counterparts. This is very similar to what Wine does for running Windows on Linux, or to what some recent Android game ports on vita have been doing. (And for what it’s worth, similar to what we were doing with PSP’s HBL/VHBL in some cases when some specific modules could not be accessed)
According to vita2hos readme, Vita executables are ARM7 based, and can be run natively on the Switch’s ARM8 processor. This means that overall the binary code is interpreted the same, and as such there is no need to emulate the Vita CPU on Switch via binary recompilation. The routines from modules loaded by the game however, need a native equivalent on the Switch, and vita2hos is required to “reroute” the functionality, sometimes with additional changes for compatibility.
PlayStation Vita (ARMv7 CPU) executables can be run natively on Nintendo Switch ARMv8 CPU in 32-bit execution mode.
When loading a PlayStation Vita executable, vita2hos redirects the module imports of said executable to jump to routines that implement the same behavior, by using native Horizon OS services, like the one exposed by the original PlayStation Vita OS modules.
A simple example from the source code is the thread creation functionality:
SceUID sceKernelCreateThread(const char *name, SceKernelThreadEntry entry, int initPriority,
SceSize stackSize, SceUInt attr, int cpuAffinityMask,
const SceKernelThreadOptParam *option)
{
return create_thread(name, entry, initPriority, stackSize);
}
This converts a pretty common Vita routine, into something that will work on the Switch. Notice how some of the parameters of the function (such as cpuAffinityMask) are dropped. This means the functionality will not always be 100% equivalent to that of the Vita, but that kind of approximation might be sufficient to run the majority of games.
The cons of going with such a path are that the results are (at least initially) going to be an approximation of how the Vita behaves. In many cases this might be enough, but for some games this might result in glitches, missing functionality (for example no sound as long as e.g. the mp3 library is not properly “translated”), or simply the game not working.
The pros are that this is only a thin translation layer on top of the executables, meaning that Vita games should be able to run at full speed on the Switch, once vita2hos has matured enough to run more games.
About Vita2hos Alpha 0.1
Here’s what Xerpi has to say about this first release:
Keep in mind this is still in the “proof of concept” stage. While it can run some simple CPU-rendered homebrews (such as VITA-8), there’s still very initial 3D graphics support (it can run vitasdk’s GXM triangle and cube samples by hardcoding vita2hos’s shaders to match the ones the sample uses).
The most difficult task is shader translation from PSVita’s SGX USSE bytecode to Nvidia Maxwell instructions. Ideally, I’d like to use Vita3K’s shader recompiler, or even turn Vita3K into a translation layer (other than also acting as an emulator on x86 systems) so that we don’t have to duplicate a lot of the code.
I have very hacky and PoC support for shader translation using copy-pasted Vita3K and UAM (open source shader compiler for the open-source Switch 3D graphics library: deko3d) code in the
vita3k-shader-recompiler-uambranch.Video showing vitasdk’s GXM cube sample running on the Switch via vita2hos: https://i.imgur.com/w9HPluo.mp4
Download vita2hos Alpha 0.1
In its current state, vita2hos only runs a small subset of very simple Vita homebrew (examples below), but those of you who want to try it can follow the instructions below.
How can I use it?
-
Copy
vita2hos.nspto your microSD card (i.e. to:atmosphere/vita2hos.nsp) -
Create atmosphere/config/override_config.ini and add the following lines to it:
[hbl_config] override_any_app=true override_any_app_key=R override_any_app_address_space=32_bit ; adjust the path according to the location of your file path=atmosphere/vita2hos.nsp
-
Note: As long as this file exists you won’t be able to use the homebrew menu and instead will always run vita2hos.
A quick workaround would be to rename the file and restart your Switch. Unfortunately
override_config.inidoesn’t allow multiplepathentries which is why it has to be done this way.
-
-
Copy a PlayStation Vita executable (
.velfor.self/eboot.bin) to the root of your microSD card and rename it totest.elf -
Boot (or reboot) your Switch and start any game while holding down
R- Attempting to use vita2hos via applet mode (album button) will currently result in a fatal error and wouldn’t be recommended anyway.
-
Enjoy!
Cool! We’d like to see linux in psvita. Or support for rinne / libretto to have a faster Sega Saturn, 3DO and Flycast running with better performance in psvita, now that we have a new video driver in vita. But congratulations on the achievement
This could be epic. I could finally retire my 3G Vita if they can pull this off.
BTW: FIRST
BTW: WRONG!!!!!
Amazing.
First?
First! Okay, nope
can this be use on ps4 aswell?
I want to see Metal Gear S 3 running on the switch
WooT! That’s amazing!!!
This would actually be amazing, there’s a couple of Vita titles I miss playing and think would be perfect for the Switch.
Neat, I’ll be able to play the best Vita titles on Switch!
Chains of Olympus, Monster Hunter Freedom Unite, Wipeout Pure, Patapon, Persona 3 . . .
Oh, wait. What games came out on Vita again? Borderlands 2, but not Skyrim, so confusing…
I don’t think so, PSP games run on a dedicated hardware (PSP CPU), instead of PSVita ARM7. Probably Persona 4, and some Sony exclusives could be worth.
love my ps vita 256gb I dont have swinech
Does this mean Vita should be able to run Switch executables (i.e. simple homebrews) with like-wise translation layer in place theoratically?
No, this is not the case.
ARM7 is a 32-bit architecture, whereas ARM8 is 64-bit.
ARM8 maintains backwards compatibility for 32-bit instructions, so it can quite easily handle code written for the ARM7 instruction set.
You can not run 64-bit instructions on a 32bit microprocessor. The code would need to be re-written with this processor in mind.
Even if this wasn’t the case, the PSVita does not have enough computer power to be able to handle switch software.
If only can Play Mario kart tour on switch … Mii incoming..
lol
Instead of losing HBL support, you can easily make a HomeBrew Menu forwarder (something that I’ve supplied in my packs for years). This way no matter what Atmosphere is routed to, all you need to do is start the HBL forwarder from your home screen.
Now you can run both HBL and vita2hos without issue. No renames, no reboots.
An incredible achievement, catering only to Nintendo Switch owners…
No disrespect intended.
Off coarse this is way to awesome. But unfortunately I could not make it work. The vito2hos.nsp crashed with me. I did everything they said… Hope this will come soon with a easy tutorial
Where is the first guy? Does he get a life?
Well now, that is very interesting. This is something that always seemed possible (especially on the CPU side of matters), but I wasn’t really expecting anyone to try.
I am very curious how they’re going to handle the GPU differences. The TX1 is not a tile based deferred renderer like the Vita’s SGX543MP4+ is. Games are going to be making a lot of assumptions about the underlying GPU which won’t be true on a Switch. If nothing else, some kind of binary recompiler is going to be needed for the shader code, I’d reckon.