Skip to content

A PlayStation emulator written in C++

Notifications You must be signed in to change notification settings

UnsafePointer/ruby

Repository files navigation

ruby (ルビィ)

Waah! Wh-Wh-Wh-What is it?

ruby (ルビィ) is a PlayStation emulator written in C++.

current_progress.gif current_progress.gif

Progress

  • CPU
  • RAM
  • DMA
  • GPU
  • CDROM
  • Interrupts
  • Timers
  • Controllers and Memory Cards
  • GTE
  • SPU
  • SIO
  • PIO

Known issues

  • Controllers only support one digital joypad.
  • SPU only supports read/writes to registries, there is no sound output.
  • There are a lot of problems with the GPU OpenGL renderer. Notably 24BPP mode and transparent pixel rendering are not working causing many rendering artifacts in some games.
  • CD-ROM is missing a lot of commands and only supports single-track games.

Building

Prerequisites

Linux

  • PlayStation BIOS: SCPH1001 (SHA1: 10155d8d6e6e832d6ea66db9bc098321fb5e8ebf)
  • GCC 9.2.0 (C++17)
  • OpenGL 4.5
  • SDL2

Windows

Compiling

Linux

$ mkdir build
$ cd build
$ cmake ..
$ make -j8

Windows

$ mkdir build
$ cd build
$ cmake -G 'MSYS Makefiles' ..
$ make -j8

Compiling with GDB support

Linux

$ mkdir build
$ cd build
$ cmake -DHANA=ON ..
$ make -j8

GDB support

If compiled with GDB support, pressing the backspace key at any time will stop the emulator until GDB is attached to localhost:2109. You will need a GDB build with support for MIPS little endian.

$ mipsel-unknown-linux-gnu-gdb
$ target remote localhost:2109
$ (gdb) info registers
          zero       at       v0       v1       a0       a1       a2       a3
 R0   00000000 00000001 000022bc 1c42220a 00000001 00000001 00000000 00000260
            t0       t1       t2       t3       t4       t5       t6       t7
 R8   80080000 04000000 050eccf0 5e42220a 40000000 00000008 00008000 00000000
            s0       s1       s2       s3       s4       s5       s6       s7
 R16  00000027 00000027 00000027 0000000d 0000003c 00000003 00000003 00000003
            t8       t9       k0       k1       gp       sp       s8       ra
 R24  000022bc 000022bb 8005aa18 00000f1c a0010ff0 801ffcd8 801fff00 80059d18
            sr       lo       hi      bad    cause       pc
      00000001 00000027 00000000 8005aa14 00000020 80059e00
           fsr      fir
       <unavl>  <unavl>

For a comprehensive list of supported GDB features, see libHana.

Compiling release build

Linux

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j8

Windows

$ mkdir build
$ cd build
$ cmake -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=Release ..
$ make -j8

Running

Linux and Windows

$ ./build/ruby # with SCPH1001.BIN in $PWD

Tests

Running

Linux and Windows

$ ./build/ruby --exe TESTNAME.exe

CPU Tests

amidog CPU tests: psxtest_cpu.exe (SHA1: 023aec8c92aaaf4d3b07956e26dd6c77ff397456)

cpu_tests.png

GPU Tests

PeterLemon/PSX GPU tests:

gpu_tests_quads gpu_tests_textured_quads gpu_tests_polys gpu_tests_textured_polys gpu_tests_lines

GTE Tests

amidog GTE tests: psxtest_gte.exe (SHA1: 1de49e77203d55ae82a04eecc715bf61bbc5ef9b)

gte_tests.png

Acknowledgments

This emulator, like many others, is based on the Nocash PSX Specifications. For ease of access and review purposes, relevant parts of the specification are pasted before the implementation.

About

A PlayStation emulator written in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages