News for hackers. Stuff that matters.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by bArray on Sunday February 16, 2020 @05:27PM (#22344136)
Impressive stuff, this will be massive for archive efforts. I am still yet to find a good performance emulation experience for the Play Station 2 console.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by monocasa on Sunday February 16, 2020 @05:53PM (#22344241)
PS2 is legitimately really hard. It's both just fast enough that cycle accurate is off the table and probably always will be on conventional processors, and is just barely old enough that it has tons of little special instruction streams that need to be in close sync with each other, sometimes without explicit synchronization in their code.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by lostgame on Sunday February 16, 2020 @06:01PM (#22344276)
PCSX3 exists, now, and while I understand the underlying complexities of the PS2’s architecture, I am very curious about the challenges, in particular, of PS3 emulation, especially with regards to the Cell processor.

Anyone with more knowledge that myself with regards to emulation care to chip in? I’d love some insight, or related articles.

Saturn emulation has been a fascination of mine for 15-some years.

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by ZirconiumX on Monday February 17, 2020 @04:49AM (#22346584)
There are three killers here: self-modifying code, synchronisation, and parallelism, all of which are major headaches for a JIT.

The PS3 does not have self-modifying PPC code (SCEI forbade it), which means the PPE blob can be compiled ahead-of-time (RPCS3 converts it into LLVM). The SPE data can self-modify, however, but (to my knowledge) does not require extensive synchronisation, therefore each SPE core can be put on a thread.

The PS2 code has fairly extensive use of self-modifying code; Naughty Dog in particular will frequently load parts of the executable in and out of memory on both the PS2 main processor (the EE) and the PS1 processor (the IOP), and rely on the synchronisation between these two separate processors to be fairly tight. Trying to make the EE and IOP separate threads running simultaneously breaks this synchronisation, so the EE and IOP have to run on the same thread.

Additionally, the PS2 has two vector units; VU0 is associated with the EE (it can be used as a floating-point SIMD unit in the EE instruction stream) and VU1 is associated with the GS [the PS2's GPU, the Graphics Synthesizer] Interface (GIF) (it can directly output primitives to the GS). This means that VU0 needs to run on the same thread that the EE runs on (because there is instruction stream interlocking), and VU1 needs relatively tight synchronisation to the GS (it is feasible to put it on its own thread, but games can be quite picky with timings)

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by w0utert on Monday February 17, 2020 @06:34AM (#22346956)
Very interesting, thanks for the writeup!

Sony did manage to ship a PS2 emulator that ran on the second-generation PS3 though (1st generation PS3 had actual PS2 hardware inside, but the second generation was software-only emulation if I recall correctly?). Besides knowing exactly about every hardware detail, any idea how they pulled that off on hardware that was much weaker relative to a PS2, compared to a modern PC?

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by garaetjjte on Monday February 17, 2020 @08:06AM (#22347377)
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by jacobush on Monday February 17, 2020 @07:49AM (#22347291)
Not saying this is how, but they could have a white list of games they patched slightly.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by monocasa on Monday February 17, 2020 @12:43PM (#22349202)
Doesn't the PS3 support the concept of overlays, which is essentially self modifying code from the emulator's perspective?
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by monocasa on Sunday February 16, 2020 @06:19PM (#22344339)
So I guess there's a couple levels to emulation where the answer is different in each.

For sort of 80/20 compat the PS2 is easier. You can HLE a couple of the processors, the GPU side of things is from the fixed function days, and has a split VRAM like your PC. The PS3 also has a nasty habit of making the SPEs make up for the anemic GPU and what would traditionally be pixel shader post processing tasks.

For Dolphin level full compat, IMO the PS3 is easier. The complexity memory subsystem and just plain number of jobs in flight meant that synchronization was very explicit between the components, as you couldn't really get away with "I'm just going to assume some happens before relationship is valid because I counted the requisite number of cycles". So you can rely quite a bit more as an emulator author that the game authors will make their intentions clearer. There's also more legacy in the PS2; the IO processor is itself a full PS1, that's how backwards compat worked. So you're really looking at all the work to make two emulators in one.

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by ac29 on Sunday February 16, 2020 @06:15PM (#22344325)
Are you maybe actually refereeing to RPCS3? If not, check it out. Their progress reports contain a lot of interesting technical details on the PS3 and its emulation: https://rpcs3.net/blog/
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by favorited on Sunday February 16, 2020 @06:37PM (#22344420)
If I recall correctly, the PS2 didn't follow IEEE-747 for floating point, which makes things much less efficient to emulate.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by monocasa on Sunday February 16, 2020 @07:08PM (#22344558)
Yeah, I forgot about that; they aren't 754. I'd be curious to see what a modern JIT taking some cues from dynamic language VMs that have multiple internal primitive formats hidden from the guest code like V8 could do with that. It'll never be 1 to 1, but I could see it getting pretty damn close.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by lostgame on Sunday February 16, 2020 @05:54PM (#22344243)
PCSX2 doesn't do the trick for you? Works great on my 2017 MacBook Pro and decently on my 2012, even.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by bArray on Sunday February 16, 2020 @07:32PM (#22344667)
On my relatively modern machine the emulation is everywhere - sound is off, emulation running 1.25 times slow-down. Graphics are all over the place in terms of quality. I can't play many of the high-end games (at the time) reasonably.

Try emulating any of the "Need For Speed" games, which made tonnes of use of graphics tricks.

That said I do appreciate their efforts, it's just we're still a way off until it could be considered complete.

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by karatestomp on Sunday February 16, 2020 @09:27PM (#22345103)
Luckily the PS2's still hanging on at the edge of "pretty easy to play with real games and real hardware", outside a handful of very expensive games. And the discs aren't old enough that tons of them have been lost to damage and rot yet, though I've seen several of mine rot to death in the last 5 years or so, even always being stored indoors, so that's changing fast. By 2025 I expect this to have joined most of the consoles before it in being easier to get an OK experience through emulation than to play on real hardware.

Timing remains my main problem with emulation. Input and output lag have gotten really bad and so hard to predict until you start actually messing with the equipment you'll be using, and even then little config quirks or the way things are hooked up (adding a receiver to the mix, for instance) can throw it all over the place. Lots of games become unplayable or unreasonably hard with just a little extra lag, so it's a real problem.

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by ohithereyou on Sunday February 16, 2020 @11:14PM (#22345552)
Not only that, but it's easy to set up loading games from a hard drive with a broadband adapter and memory card exploit. From there, you can rip your own games or download rips and load to the external hard drive and play that way.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by 0xcde4c3db on Sunday February 16, 2020 @09:16PM (#22345046)
Have you tried a recent build? 1.4.0 is pretty outdated by now, and it's also worth noting that the snapshot currently in Debian/Ubuntu is significantly broken.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by bArray on Monday February 17, 2020 @03:17AM (#22346281)
Not for a few months, but it was out of the Ubuntu repo. If that's the case I'll give it another go, you would hope it improves after all. Thanks for the heads up.
Re:Dreamcast Emulator Redream 1.5.0 Progress Report by snvzz on Monday February 17, 2020 @10:23AM (#22348276)
Are you using any of the speed up features?

For most games, VU borrowing "cycles" from CPU can help a great deal, so can enabling the threading. The defaults are the most compatible, but also slowest.

Also, GSDX is the only gpu plugin that works semi-decently, and only with actual DirectX. Opengl is all over the place.

Most games work fine even on a ten year old computer, with these settings, as long as you're on Windows.

Linux support could be better, but there's no manpower for that. It is kept alive by one or two developers who use Linux, most of the team being on Windows.

Re:Dreamcast Emulator Redream 1.5.0 Progress Report by nonbirithm on Monday February 17, 2020 @04:24PM (#22350924)
> this will be massive for archive efforts

It's not open source, though. That means whatever improvements for preserving Dreamcast games will be taken to the author's grave. A lot of emulator development revolves around people sharing knowledge about how things work and making incremental improvements.

Taken to an extreme, if you were trying to fully map out a system from top to bottom for the explicit purpose of preservation like byuu's higan[1], it would make no sense to keep the source closed. There's an article[2] describing his request for help mapping the SNES PPU at the transistor level for the purpose of perfectly emulating it. The kind of effort moving in the direction of preseration requires is nontrivial and open source would be a massive benefit. And if there are any flaws there's no need to rely on the motivations of a single contributor to fix them.

I don't believe such a goal is compatible with a profit motive.

[1] https://byuu.org/higan

[2] https://byuu.org/articles/edge-of-emulation