Session
FOSDEM Schedule 2021
Emulator Development

The PlayStation 2: From Emotion to Emulation

Celebrating 20 Years of Reverse Engineering
D.emulator
Gauvain Roussel-Tarbouriech
<p>The PlayStation 2, being the best-selling game console of all time, is a surprisingly complex beast. So, isn't it only fitting that its emulation in software is equally complicated?</p> <p>With PCSX2 developer GovanifY, we carefully peel back the layers of the world's most popular game console, and its most popular emulator. See why, twenty years later, it's now easier than ever to PL△︎Y IN Y◯︎UR W╳︎RL□.</p>

Emotion Engine. Graphics Synthesizer. Built-in DVD player. DualShock. Broadband. Online. $299. Twelve years in production, nearly 4,000 titles, and over 150 million units sold worldwide. The PlayStation 2 is widely heralded as the most popular video game system of all time.

Its unassuming, yet imposing black chassis hides a masterclass in system design. Sony's second-most popular product next to the Walkman, and unquestionably their most successful game console, the PS2 isn't without its faults - chief among them, its complexity. While a vast effort was made on the part of Sony's engineers, ironing out as many quirks as possible to ensure game development was smooth, even seemingly unsophisticated games had required specialized development steps to ensure satisfactory performance, unless they wanted their game to be mocked in the cutthroat sixth-generation-gamer media for having "last-gen" graphics. Why was it so difficult? After all, the CPU is a simple RISC, with a simplified FPU. The GPU, the fabled "Graphics Synthesizer", only draws scenes - no shaders.

PCSX2, the PS2's de facto open-source emulation project, now has the greatest share of tested playable games and working software titles for its console, out of any emulator targeting consoles since then. Unfortunately for us, this compatibility came at the cost of complexity. The long-driven community effort to incrementally improve on it, brought with it legacy code with long, spindly strands which dig deep into the core codebase. Its C-centric codebase, while speedy, was hand-tuned to gain the maximum performance out of contemporary 32-bit Pentium 4 CPUs. The GUI, designed using wxWidgets, aimed for a mythological "middle-ground" of such modern platforms as X11R6, Windows XP, and Mac OS X Aqua.

The project really was a product of its time; emulator development was highly fragmented among incompatible and proprietary video and sound APIs, and to compromise, a plugin interface haphazardly bolted on components, leading to needless headaches over trivial things like joystick input. These remnants of the past have kept coming to haunt us, and we've decided to put our foot down.

Twenty years after the inaugural CVS push, it has come high time to reorganize and transform the shambling heap of code, and with the modernization of such a large project comes many discoveries - not only about the emulator software, but also its target machine.

Points we'll touch on include: The PS2, and its architecture - and the cursed idiosyncrasies that developers and emulator authors have had to battle. Reverse engineering the PS2, and studying its behavior - following a game through, from the DVD, into the I/O subsystem, across the bus, through the cache and memory, across the vector units, and out to the TV. How PCSX2 works - how it is programmed and evolved to take advantage of modern hardware (and why that's a constantly moving target). Finally, we'll conclude with a deep dive into the new x86_64 JIT compilers coming to PCSX2, its clean core/GUI separation being made with portability in mind, notes about refactoring and scope management of a software system at-large with an active user base; new GUI targets, some infrastructure rework, and more!

Additional information

Type devroom

More sessions

2/6/21
Emulator Development
Steven Goodwin
D.emulator
<p>Ever wanted to write an emulator? Or understand how they work? In this talk you learn how to start writing your own emulator from the ground up. You'll see the basic methods used to emulate CPUs, memory, and graphics cards. For the keen, we'll also cover advanced emulation techniques, licensing issues, and history.</p>
2/6/21
Emulator Development
Panayiotis Talianos
D.emulator
<p>Even to this day, there's something utterly captivating about bringing to life a piece of software effectively frozen in time, designed to run on what was originally a black box, by means of a device that one uses to check up on cat facts. Adding to this, it can even be enhanced and possibly perform better than its developers ever hoped for.</p> <p>If you're like me, gaming console emulators were amongst the first pieces of software you've ever run on a computer. Submitting this talk was an ...
2/6/21
Emulator Development
D.emulator
<p>TBA</p>
2/6/21
Emulator Development
Thomas Harte
D.emulator
<p>Many emulators offer a CRT filter, an artist's rendition of classic video.</p> <p>This presentation describes emulation of the an entire NTSC or PAL video device, to produce an engineer's rendition — starting from sync discrimination and separation, through PLLs into scan placement and via QAM to extracting colour.</p>
2/6/21
Emulator Development
Will Hawkins
D.emulator
<p>I will demonstrate how to write a vectorized (parallel) Caesar cipher in RISC-V (in assembler) using the project's emulator. Using the emulator is necessary at this point for such an application because the vectorized extension to the RISC-V ISA is not standardized. I will further demonstrate how the emulator itself is able to emulate the execution of a single user-space application when it is actually designed to emulate an entire system. This will involve a demonstration and explanation of ...
2/6/21
Emulator Development
Ben Widawsky
D.emulator
<p>For years now, driver development has been starting earlier in the product life-cycle. Using QEMU for liberating driver developers from being bound to hardware schedules isn't new. Not so common however, is adding support for new hardware to QEMU while the spec is still being revised. The coupling of driver development and emulation development helped find spec issues early, and allowed us to submit patches for a basic driver on the day that the specification wasreleased.</p> <p>This talk ...
2/6/21
Emulator Development
Thomas Harte
D.emulator
<p>Emulator authors often like to measure themselves by invoking the concept of cycle perfection. In practice that under- or over-samples many real machines. This talk instead floats a bus-centric model of emulation.</p>