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!