ShadPS4 – PlayStation 4 emulator
github.com
github.com
Since the PS4 is more or less an x86 computer, I imagine most of the hard work would be implementing the system/graphics APIs of the PS4. Or are there major hardware differences between an x86 PC and the PS4 that also need to be handled?
There are also some considerations regarding texture compression, I believe, which is a function usually performed in dedicated GPU hardware, and not all GPUs support all formats.
In any case, that intermediate representation is probably still easier to compile to hardware-specific code, especially if the hardware has a Direct3D implementation. That's what it's designed for, after all!
Everyone ships either shader code or intermediate languages instead.
I've seen several people online discover what the idea of an emulator is, and then they'll say in amazement "so we could do this and that and the other?", and the answer, no matter what it is they propose, is "yes, someone's done that". Recompile the code entirely into another assembler? Partially do so? JIT it? Ship specific patches for specific content? Emulate gates? Rewrite on the fly? Shim things slightly to change what functions are loaded? All that and more has been done. And even if you draw a sharp line through those things, all the combinations you can think of have also been done, and how will you draw the line through that?
I think one of the best ways of thinking about it is that there really isn't any such thing as an emulator. There's just numbers, and they need an interpreter and the ability to reach out to some set of externally-defined functionality, and there is a profound sense in which you have to have some particular hardware manifestation of an interpreter and some functionality to get anywhere, but that particular manifestation is a lot less important than people think. This has only become more true in a world where your CPUs are already not actually executing assembler opcodes anymore, and your OS is already shimmed away from the hardware in another level, and the OS is wrapping your program in yet more abstraction before it even runs a single instruction, which may well include providing a choice of which sets of "externally-defined functionality" the numbers can ask for (different Windows subsystems, etc.). Even the "base system" has a lot of "emulators" in it nowadays. It's emulators almost all the way down! Which suggests that rather than being special, they're actually quite fundamental, and sure, sometimes you need a greater translation layer between this program written with these numbers and this particular chunk of hardware and sometimes you need less, but it's a lot less a distinction of "kind" than you might think.
This is not the only way to think about it; there are certainly valid perspectives from which "emulators" exist, e.g. as a distinct category in a software catalog they're sensible. We all know what that means. But for your own understanding of how the world works, the previous paragraph has a lot to recommend it.
If its on your screen, it can and will be cracked / decompiled.
Wine doesn't emulate hardware, but it absolutely does emulate the Windows runtime environment. (In fact, it wouldn't work very well if it merely implemented APIs based on a spec instead of emulating observed behavior, since some of the bits required for compatibility are undocumented.)
Unfortunately, that phrase was in fashion at a time when a lot of people first discovered Wine, so there is now a generation of enthusiasts incorrectly chiding people who refer to Wine as emulation. And, of course, others who see this happen and don't know any better sometimes go on to perpetuate it themselves. Makes me sad every time it crosses my path.
Most emulators need to implement/compile a whole different architecture to x86, even if similar to x86 it causes issues because cache gets filled faster, more memory lookups, etc.
PS4 doesn't need to emulate almost anything hardware wise, the CPU is a standard x86 and the GPU is a modified radeon. Similar to how wine can get the same or better performance on linux than windows, the ps4 "emulators" will achieve performance parity because they're not emulating anything, they're just reimplementing the core PS4 libraries. That said there are some differences in hardware, the big one being the PS4s unified memory, but it shouldn't be much of a problem, there's also the usual shaders need to be recompiled, etc.
So it's ok to get hyped for high performing bloodborne gameplay on PC with affordable PCs :)
If you got an old PS4 Pro lying around, and haven't updated it in a year, it's more than likely hackable.
It's pretty simple, really.
Source: Me and my hacked PS4 Pro and PS5.
Even though it's only 30fps the game is quite beautiful for being 9 years old and running on a previous gen console.
I haven't played a single remaster that I preferred to the original game. I'm fine with remasters existing, but only if faithful ports are made available as well.
Same with the Demon's Souls remaster.
The trouble with remasters is they're usually farmed out to third-party devs who don't always give it the same attention to detail as the original developers. A prime example would be Dark Souls Remastered, which actually makes some of the graphics worse compared to the original PC version.
Nier Replicant ver.1.22... isn't officially called either a remake or a remaster, and a convincing case could be made for either. Yet it changes more than Demon's Souls PS5 does.
Regardless of any person's opinion on the changes, being substantially different is enough reason that it isn't a suitable substitute for the original.
I wouldn't be running patched pirated game on devkit.
SCE certainly get logs of everything you run on it.
1. Emulate the whole system. 2. Emulate the system API.
The first one you write the code to emulate the CPU of target system like OP code interpreter (e.g. NES). The second one you write the code to re-implement the API of the target system (e.g. Wine). For the second one you may need to write a JIT compiler if the target system use a different CPU architecture (e.g. PS3).
Most modern console emulator are the later one because how the modern console work is similar to how the PC work. It have an OS kernel and a user-mode libraries for applications.
For the latter one there are 2 kind of it. The first one is emulate the user-mode libraries and the second one is re-implement the console kernel and reuse the system libraries from the console itself.
And additionally because the past couple of console generations have had x86-64 CPUs, there's no need to do full instruction translation/emulation—something like Wine would suffice.
http://www.emulator101.com/introduction-to-chip-8.html
An average programmer can probably get an emulator for that running in a weekend, and there are lots of guides and documetnation out there for the opcodes and similar.
NES / Gameboy / GameGear / similar are probably well-documented, but they will be harder at least because the processors have more opcodes you have to care about.
Also somehow for some reason i was convinced back then that mobile phones in the future will have a CHIP8 emulator to play games :-P. Sadly(?) they got Java instead.
You are bound to have an awesome game you can find on an 8-bit system and it's really fun trying to get to the point where you can play the game: getting the logo to appear, getting the title screen up, getting the sprites working, adding controls etc.
The "big league" emulators work differently. They may be simple compilers. Instead of compiling C code or java code, they compile machine code from system A to system B. A transpiler. This affords speed beyond the simple case. Speed, however, is only necessary if the machine running the emulator is weak, or if the machine being emulated is strong.
0: https://www.reddit.com/r/SteamDeck/comments/wodw8x/i_tested_...
I'd expect running x86 code written to run on an AMD APU with a Unix-based OS in another AMD APU with a Unix-based OS to be a bit easier, probably with some VM involved (even Xemu, the original Xbox emulator, is basically a QEMU PC configuration with some Xbox-specific hardware for the GPU and audio).
They have custom graphics APIs (and semi custom GPUs) which makes graphics translation one of the hardest parts.
The graphics systems also assume shared memory which is not a given elsewhere.
There are sometimes also some extra CPU instructions if it benefits the console that may not be prevalent, and require some translation.
And it’s even more different when you get to the PS5 era where the systems have some very critical hardware systems like kraken decompression and direct storage which don’t have super prevalent equivalents.
Do you think a PS4 emulator should be 90% of the way to a PS5 emulator being that they both use x86, AMD GPU and NVM/X?
ps. I argued with you here[0] about Vulkan on MacOS, and after reading more about graphics APIs and game engines I can say I was wrong about some of what I said eg. "studios are generally using modified versions of UE so my guess is that means they are generally making low level changes sometimes, and so it makes sense to me that they sometimes may write their Dx/ Vulkan code for different things sometimes" which after researching, studios do heavily modify Unreal, but they do not seem to touch the rendering APIs. (with some exceptions like here[1]). Also "Adding an extra platform like MacOS [on UE] is not simply clicking a button" which I simply assumed is true but have no evidence for.
[0] https://news.ycombinator.com/item?id=40586991
[1] https://www.youtube.com/watch?v=WGv_BjxvJ8M&t=2027s (A Taste of Chocolate: Adding a Rendering Fast Path without Breaking Unreal Engine | Unreal Fest 2024)
They use very different generations of CPU, and GPU. So shader libraries will be different for the most part. Also custom hardware on top of that for decoding and direct storage access, as well as a fairly updated SDK.
It’ll certainly help because the underlying systems have the same thread of design running through them but I think it’s the same way a 3DS emulator can help with the switch or how Dolphin can’t really do Wii U games. They’re similar but not quite.
And I’m surprised that conversation was remembered :-) thanks for bringing it up.
Can you expound on this? Why do the shader libraries change due to new hardware? I get that the compiled shaders would change, but why would the libraries themselves change? The other points I understand.
>I’m surprised that conversation was remembered
I remembered the conversation because I spent some time trying to prove I was right about gamedevs using raw vulkan/directx (they seemingly do not, I was wrong) and then learning more about graphics APIs in general. I realized you were the the one I had had that conversation with because when I searched hn.algolia for Gnm earlier to answer my question elsewhere in this thread your name kept popping up, making roughly the same arguments from that thread I responded to you in.
To your question, consider that console games ship precompiled shader libraries that target the known GPU of that console. This prevents shader compile hitches etc.
So the PS5 is effectively a superset of the PS4, with a significant new set of capabilities. There’s no opportunity to take an intermediate language like Proton etc does to transpile it first.
PS4 (and PS5, iirc) both use a custom OS built out of FreeBSD with specialized variant of an AMD APU using GDDR memory, plus PS5 got few extra coprocessors for handling things like decompression in line with storage access
Retail games running on the PS4 don't care about the PCIe topology, they just use Sony's function call APIs.
I’d take that bet. Given a million years of concentrated effort, I’m feeling confident we’d find a way. Even if it takes a hobbyist replacing some internal components on the Steam Deck.
and also for the PS4
and also for the PS5
and fpPS4 is compatibility layer
check this wiki for more info : https://emulation.gametechwiki.com/index.php/PlayStation_4_e...
[0] https://en.wikipedia.org/wiki/PlayStation_4_system_software#...
This is the dev's youtube: https://www.youtube.com/watch?v=wC6s0avpQRE
I wonder what the hell Sony is doing still neglecting, almost vindictively, this S-tier culturally significant game. Are they waiting to use it for a launch PS6 title or what?
There will always be a demand for playing older games, hence emulators like this.
Now we know how the console run the game. The next step is how to use this information run the game outside the console. The good news is PS4 system is just a modified version of FreeBSD, which mean how it works is very similar to the PC. A PS4 executable is just a custom ELF file. So to run a PS4 game outside the console we need to manually map the game executable and provide the symbol it needed somehow (e.g. a custom implementation or reuse the PS4 library).
Generally speaking there's been a lot of good work in the industry for binary translation too, cf. Rosetta 2. That's another tool in the box for hoisting a binary on to a different host environment.
https://github.com/devofspine/spine
(No source code. Just binaries.)
maybe we can play gt2 remastered online
Complexity. I'm amazed that anyone would even be able to single-handedly emulate such a different architecture like PS3
A case study in favor of UBI
Read my profile, next up is a ban
And we go agane
Five Eyes or not
https://news.ycombinator.com/item?id=26222361
https://old.reddit.com/r/Games/comments/fnl0o1/why_playstati...
Care to share them?
I can't say much about his videos linked in another post (about PS1 shimmering) as I haven't touched graphics programming / APIs (beyond coding a very basic 3d rendering engine which ran on the CPU).
After reading some of the linked discussions - yes he does appear to have posted some bullshit. That doesn't make all of his content bullshit though, and doesn't make him "non technical". The fact that he has shipped several games on constrained platforms is proof that he is technical.
He does now go into the same box as I put 99.9% of content creators in - entertaining but don't trust them on the details.
I think maybe he just comes off that way because of how he presents things in videos.
Perhaps ironically, over the years I’ve found it’s those who cannot look past the tech-jargon to be the lesser experienced because they learn the words without fully understanding the concepts.
it can also be the case that the 'laymen explanation' is actually patently wrong -- not just over-simplified or 'dumbed-down'; wrong.
some things just require a certain level of background knowledge; this is why generally any 'celebrity scientist' explanation of anything with the word 'quantum' in the subject line is generally just down-right wrong.
there is no decent metaphor by which to onboard a laymen in certain technical topics.
that isn't to say that the 'wrong' answers don't have value in educating the laymen, but the liberties that some experts take in 'wrongness allowance' is quite different from one another.
personally I think it's the responsibility of the explainer to step aside at some point and say : "Look, this is wrong, but without the background this is as close as I can get you to understanding this thing, so just don't take what I say as gospel from this point forward." -- the reason this is important is simply due to the fact that the laymen doesn't stand a chance at finding out which parts are wishy-washy by themselves without some further guidance.
not mentioning where the fairy tale begins is what leads people into thinking that there is actually an alive/dead cat out there somewhere. they grasp the metaphor itself rather than the statistics concept that is being explored.
The point of videos like the aforementioned isn’t to give people a background into game development. It’s to give people who have no experience an overview for entertainment purposes.
The issue here is that many youtubers have sold factual correctness for a view count.
It’s such a common behavioural tendency with general audience publications that someone coined a law for it (the name of which I forget but I’m sure someone else on here can reply with it).
Also interesting and only tangentially related is that MAME used to have a rule about not supporting games within 2 years of release.