hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.01k stars 2.14k forks source link

Xlink kai support #14395

Closed Puentee closed 3 years ago

Puentee commented 3 years ago

the Xlink kai plugins for PSP are continuously receiving new updates for more compatibility in its games, if PPSSPP were to support it, it would enhance the potential games that could be played cross play with real hardware.

Protocol needed: https://www.teamxlink.co.uk/wiki/DDS_Protocol

JPCSP with xlink kai support: https://github.com/jpcsp/jpcsp/releases/tag/XLinkKai-v1.0

Panderner commented 3 years ago

Duplicate of #12886 i guess?

anr2me commented 3 years ago

Yes, it's a duplicate.

And with current adhoc implementation PPSSPP can't generate packets compatible with PSP (without ProOnline plugin), thus can't communicate with PSP, unless PPSSPP is able to get prx files from official firmware to work (LLE) in the future, just like JPCSP.

So it's not about protocols used by XLinkKai (DDS), but because the packets generated by PPSSPP is only compatible with ProOnline, so on PSP side will also need ProOnline, so if ProOnline is mandatory, XLinkKai won't be needed anymore. And the only way to generate compatible packet is by using LLE (prx files from firmware), or by implementing a lot of drivers HLE (which is still WIP on JPCSP) thus will take much longer time on PPSSPP since we don't even implement drivers HLE as of now.

unknownbrackets commented 3 years ago

This issue is being closed as a duplicate of #12886.

This is an issue tracker - there's a forum if you want to discuss things. You wouldn't add another "bread" item to a grocery list every time you thought about it, right? We do the same here - we already have "bread" (this issue) on our list.

By keeping the list clean, we can also make sure all the information a developer needs to fix the issue is at their finger tips. When there are multiple issues, information gets lost and it becomes hard to fix things, so they are fixed more slowly. Duplicates won't make fixes appear faster.

And remember - PPSSPP is open source. Try to find new and useful information, and add it to the original issue. If you can't wait any longer, muster up your courage and try fixing it yourself. PPSSPP gets better the more people contribute. You could be that amazing person who solves this problem for everyone.

-[Unknown]

unknownbrackets commented 3 years ago

And the only way to generate compatible packet is by using LLE (prx files from firmware), or by implementing a lot of drivers HLE (which is still WIP on JPCSP) thus will take much longer time on PPSSPP since we don't even implement drivers HLE as of now.

Whether or not LLE is implemented, it's not going to make it so that raw socket packets are sent to the operating system libraries (Windows, Android, Linux, etc.) Some of those have security restrictions preventing you from sending raw packets, and may require you to send TCP/UDP. I'm not convinced Android would allow that in the first place, LLE, HLE, or anything but magical level emulation.

If it is over TCP/UDP, then in theory it's just a reverse engineering problem. Although there's a lot of annoying state with the Net functions in general, in the end the system does behave like a function - if you do certain things, in a certain order, it will output specific packets. If certain packets come in, it will do certain things. You can always HLE something that behaves in such a way, although it may take significant effort. There's nothing that makes it impossible without LLE, at most impractical.

Also when considering an LLE PSP emulator, remember that the SNES runs at 3.58 MHz. The PSP runs at 333 MHz. Therefore, take whatever speed you get running bsnes with fast forward enabled, and divide that by 93. That will be your speed in a proper PSP LLE system. For example, if you are able to fast forward to 200% speed in bsnes, you can expect 2.15% speed in a "bpsp".

-[Unknown]

anr2me commented 3 years ago

For transmitting the raw packets XLinkKai will be handling it through their DDS protocol, we just need to generate a compatible packet just like what generated by JPCSP when using prx files (including the WLAN beacon packets).

Well, currently it's still WIP for implementing it on HLE on JPCSP, while LLE using prx files from firmware worked fine with XLinkKai.

But yeah, it probably won't work on Android due to port restriction under 1024, not sure whether XLinkKai can map the port to a different port or not, locally.

Personally i prefer HLE over LLE due to performance reason, but there are too many internal prx (ie. drivers) being involved and most of them undocumented, thus taking a long time to reverse engineering them. And having prx files from firmware to be able to run on an emulators going to help a lot in figuring out how they use those syscalls internally, since it's easier/faster to do tests on emulator than real PSP (eventhough they're less accurate on the timings but the flow of the code should be the same). PS: I was able to make many games to work on adhoc recently due to LLE support on JPCSP, i also findout how GameSharing worked because of this (ie. they use AdhocMatching for transmitting the data), and i also findout that the packets generated by pspnet_adhoc_matching.prx are more complex than what ProOnline use (ie. ProOnline structure is <opcode><optional mac><optional data>, while prx structure is <data type(ie. null/number/string)><data length><data content(ie. opcode)><next data type for the next data> similar to the structure on PSN ticket)

ghost commented 3 years ago

And the only way to generate compatible packet is by using LLE (prx files from firmware), or by implementing a lot of drivers HLE (which is still WIP on JPCSP) thus will take much longer time on PPSSPP since we don't even implement drivers HLE as of now.

Whether or not LLE is implemented, it's not going to make it so that raw socket packets are sent to the operating system libraries (Windows, Android, Linux, etc.) Some of those have security restrictions preventing you from sending raw packets, and may require you to send TCP/UDP. I'm not convinced Android would allow that in the first place, LLE, HLE, or anything but magical level emulation.

When JPCSP does it for xlink kai support it seems like its not using raw sockets to do so. It does use it for the infrastructure though lol. I know that Citra the 3DS emulator also uses HLE for local wireless support (that could be tunnled over the internet) its also decrypted as far as I understand like Pro Online on PSP. There is an unofficial Citra build for Android thats lets you play PC to Android as well but its not supported by the official team. The devs talked about creating a plugin/homebrew on the 3DS side so it could transmit to the Citra emulator but never fully completed it (a plugin similar to pro online I presume). The only part that is (Networking) LLE on Citra is the Download Play support (equivelent to gamesharing) but it's not supported over the 3DS currently as well. I think that are a lot of similarities between how the 3DS and PSP do the networking that might be interesting to explore but what do I know lol (Currently there is no 3DS support on Xlink Kai though). Hopefully things advance in the future.