pctation is a PlayStation (PS1/PSX) emulator written in C++17. While quite incomplete, it can run some commercial games.
There's the option of displaying the entire GPU (video) memory.
You can see in the above example (the game is Puzzle Bobble) that on the PS1, everything, including the framebuffer(s) reside in VRAM.
In this case and in most games you can see two framebuffers, because double-buffering is used.
Everything else shown in the above screenshot is either a texture (image applied to surfaces when rendering), or whatever other arbitrary data the game programmers have placed in VRAM.
I prioritized the development of debug tools early on in the project and this helped solve various bugs along with Visual Studio's debugger and some good-old logging.
Debug windows implemented:
- TTY Output Shows any test printed to the TTY console by the BIOS, Shell or app/game.
- BIOS Function Calls Tracks any call to the BIOS and logs it, along with the arguments passed.
- RAM Contents
- RAM viewer. Editable.
- GPU Registers
- Displays the registers/state of the GPU.
- CPU Registers
- Basic CPU register viwer.
- Timers
- Registers/state of all 3 Timers (window not shown here)
- GP0 (Drawing) Command Viewer
- Shows details for every drawing command of every frame (cleared periodically, to preserve memory usage).
- Details include things like draw position, texture coordinates, color, shading type, etc.
- When a command is selected, the associated primitive (triangle/quad) pulses on the screen, so it can be determined without any hassle.
The UI elements other than the debugger windows are the initial Game Select screen and the Settings dialog.
Scans through game dumps or executables in the data/
directory (see "Usage" below).
User-tweakable settings.
Apart from a basic Game Boy emulator, most of my experience in emulation development had been working on relatively HLE [1] emulators like Vita3K and RPCS3. This project stems from my curiosity in making an LLE [2] emulator from scratch.
It's also meant to serve as a thesis project for my BSc in Computer Engineering.
[1,2] The terms HLE/LLE are explained succinctly in this blog post.
I recorded a few short videos as I was making progress, here's the Youtube playlist.
- Hardware implemented (some items are incomplete)
- CPU, with a fairly accurate MIPS I interpreter
- GPU, using a software rasterizer
- Geometry Transform Engine (GTE)
- Memory mapping
- CD-ROM
- Digital Controller
- Timers
- Direct Memory Access (DMA) controller
- UI
- Immediate mode GUI using the excellent dear imgui library
- CD-ROM Explorer (file explorer for CDROM images)
- PSX-EXE Explorer (file explorer for raw executables like tests, homebrew or demoscene demos)
- FPS & Emulation Speed metrics
- Debug UI
- TTY Output
- BIOS Function Calls
- RAM Contents
- GPU Registers
- CPU Registers
- Timers
- GP0 (Drawing) Command Viewer
- Audio
- Sound processing unit (SPU) emulation is not implemented
- Video playback
- Motion Decoder (MDEC) emulation is not implemented
- 24bit Direct display mode
- Used for video playback and a few games while playing (ie. Heart of Darkness)
- Cue sheet parsing
- Metadata files that describe how the tracks of CD image are laid out.
- Lots of more minor things
Put your bios in data/bios
, CD-ROM game dumps (.iso/.bin, etc) in data/cdrom
. Optionally put executables in data/exe
or expansion slot binaries (ie. Caetla) in data/expansion
.
Then simply run the main executable.
Alternatively, run the following command to quickly start up a CD-ROM game dump without going to the Game Select screen.
pctation <cdrom_path>
where cdrom_path
is a path to the main game binary.
Run setup-windows.bat
in the root directory.
Run setup-linux.sh
in the root directory.