Giter Club home page Giter Club logo

pctation's Introduction

pctation

pctation is a PlayStation (PS1/PSX) emulator written in C++17. While quite incomplete, it can run some commercial games.

Screenshots

Games

Crash Bandicoot

*graphical bug that makes Crash dark, haven't gotten around to fixing that yet

Ridge Racer

*graphical glitch in the game UI on race start

Aeon Flux

Deuce

Puzzle Bobble

Batman Forever - The Arcade Game

Debugger

VRAM view

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.

Debug Windows

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.

UI

The UI elements other than the debugger windows are the initial Game Select screen and the Settings dialog.

Game Select

Scans through game dumps or executables in the data/ directory (see "Usage" below).

Settings Dialog

User-tweakable settings.

Motivation

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.

Devlogs

I recorded a few short videos as I was making progress, here's the Youtube playlist.

Features

  • 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

Unimplemented

  • 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

Usage

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.

Building

Windows

Run setup-windows.bat in the root directory.

Linux

Note: Untested

Run setup-linux.sh in the root directory.

pctation's People

Contributors

velocityra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pctation's Issues

Unable to get the project to build using VS2022

Hello,

I've been trying to get the project to build by launching setup-windows.bat but I'm granted with the following:

Could not find MSBuild version with C++ support. VS2015, VS2017, or VS2019 (with C++) needs to be installed.
At C:\Users\aybe\source\repos\pctation\external\vcpkg\scripts\bootstrap.ps1:195 char:5
+     throw "Could not find MSBuild version with C++ support. VS2015, V ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not find ...o be installed.:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not find MSBuild version with C++ support. VS2015, VS2017, or VS2019 (with C++) ne
   eds to be installed.

I've tried to install the Desktop development with C++ package on Visual Studio 2022 but that didn't have any effect.

Any ideas on how to get the project to build?

Thank you.

Thesis paper available?

Hello friend!
First of all that i was surprised to see we studied in the same university - i was in electronics engineering though.
I saw your work from rpcs3 and i really admire all your work in emulation and RE.

Given i am interested in both LLE, and HLE. And i want to start studying LLE first, is there a chance you make the document of your thesis - concerning pctation available?

Thank you very much and congratulations for your achievements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.