Vita2hos (running PS Vita games on Nintendo Switch) 0.2 alpha released
Vita scene veteran developer xerpi has released an update to his tool vita2hos (Vita to Horizon OS), an interface library that allows running Vita executables on the Nintendo Switch. This new version 0.2 brings improvements to 3D graphics and shaders in particular.
This remains an alpha release with limited compatibility for now, 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.2
Here’s what Xerpi has to say about this new release:
This is still in very early stages and therefore it can only run very simple CPU-rendered PlayStation Vita homebrews.
There is very initial 3D graphics support (it can run vitasdk’s GXM triangle and cube samples by hardcoding vita2hos’s GLSL shaders to match the Cg shaders the samples use).
vita2hos uses Vita3K’s shader recompiler, and some parts of vita2hos’s code are based on Vita3K’s implementation. Please, consider donating and contributing to Vita3K!
vita2hos uses UAM (deko3d‘s shader compiler) to compile shaders. Please, also consider contributing to that project and donating to the developers!
Changelog:
- Initial Vita3K shader recompiler support: it translates from GXP (PSVita’s SceGxm shader format) to SPIR-V/GLSL shaders
- Uses UAM – deko3d shader compiler to compile the shaders generated by Vita3K’s shader compiler (GLSL for now) to the Switch’s GPU format
- 3D graphics: Initial depth and stencil support
- Changed PSVita executable path from
sd:/test.elf
→sd:/vita2hos/test.elf
- Fixed inverted vertical analog sticks axis
- 3D graphics performance improvements
- General code improvements
Download vita2hos Alpha 0.2
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 at the link below.
How can I use it?
Check the instructions on the github readme, here.
Sample PSVita homebrew:
- gxmfun (modified): download
- vitasdk GXM cube sample (modified): download
- vitasdk GXM triangle sample (modified): download
- VITA-8: download
- vitasdk touch sample: download
Vita2Hoes Baby!!!
Unfortunately (or fortunately) I own a Vita, and I think it is way more portable than Switch so I will stay with him, but is a good thing, maybe we could play play Persona 4 on Switch. I think this game and maybe Uncharted is worthy too (I bought my Vita only for P4 and PSP/PSX games), the majjority of the Vita games already run on Switch but with better performance.
An Nintendo Switch is more capable and powerful than a PS Vita, so you would get better performance. If you have an OLED switch, you basically have an upgraded PS Vita
Lmao, vita it still much better than garbage switch, because it has a glass screen. It’s complete fail for Nintendo
Actually Nintendo did that on purpose, so they can sell the temper glass protector as an accessory.
L2 + R2 + L3 + R3 > Glass screen
Deal with it, I’m glad that I’ll finally be able to play those damn vita games that required you to use the damn rear pad
To the interest of buyers, people would like to “deal with” the best deal.
SONY GANG. NINTENDO SUCKS.
Imagiene playing with sony after they cennsor anime games
Well, the fact is Sony quit the handheld market after PSV, leaving Switch being the only surviving device in the market. Steam Deck is the new comer who wants in on this game, but I doubt it could really hit it off…
I hate swinech
Can this be ported to Android?
Can it be ported to Ndroid?
Vita2Ho’s