Session
FOSDEM 2021 Schedule
Emulator Development

The PlayStation 2: From Emotion to Emulation

Celebrating 20 Years of Reverse Engineering
D.emulator
Gauvain Roussel-Tarbouriech
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? 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□.
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
Vasantha Crabb
D.emulator
The open source emulation landscape is littered with abandoned projects. MAME has survived stock market crashes, a pandemic, major internal refactoring, half a dozen leadership changes, and persistent rumours of the project’s imminent death. Why is MAME still here? How does MAME continue to attract contributors? What are some of the issues a project this size faces?
2/6/21
Emulator Development
Steven Goodwin
D.emulator
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.
2/6/21
Emulator Development
Panayiotis Talianos
D.emulator
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. If you also got to play around with your first computer in the early 2000s, chances are that console emulators were amongst the first pieces of software ...
2/6/21
Emulator Development
Thomas Harte
D.emulator
Many emulators offer a CRT filter, an artist's rendition of classic video. 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.
2/6/21
Emulator Development
Rob Loach
D.emulator
RetroArch is a free, open-source and cross-platform frontend for emulators, game engines, video games, media players and other applications. The libretro API is designed to be fast, lightweight, portable, and without dependencies. Due to the number of systems and games it can play under a single user interface, RetroArch has grown immensely over the years, and has been well adopted by the emulation scene.
2/6/21
Emulator Development
Will Hawkins
D.emulator
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
Thomas Harte
D.emulator
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.