GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mert574/psp-js: PSP emulator in TypeScript (HLE)

BranchesTags
Open more actions menu

Latest commit

 

History

82 Commits
82 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
LICENSES
LICENSES
 
 
docs
docs
 
 
ppsspp-reference @ ab1ee21
ppsspp-reference @ ab1ee21
 
 
public
public
 
 
scripts
scripts
 
 
src
src
 
 
test
test
 
 
tools
tools
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
ASSETS.md
ASSETS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
LICENSING.md
LICENSING.md
 
 
README.md
README.md
 
 
ROADMAP.md
ROADMAP.md
 
 
THIRD_PARTY_NOTICES.md
THIRD_PARTY_NOTICES.md
 
 
assets.json
assets.json
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
ppsspp_niddb.xml
ppsspp_niddb.xml
 
 
tsconfig.app.json
tsconfig.app.json
 
 
tsconfig.json
tsconfig.json
 
 
vite.config.ts
vite.config.ts
 
 

Repository files navigation

PSP.js

A PSP emulator written in TypeScript that runs in the browser. It uses HLE (High-Level Emulation) like PPSSPP, so there's no BIOS ROM. PSP syscalls are reimplemented in TypeScript instead.

Try the emulator · Documentation · Compatibility list

It boots real games: decrypts KIRK-encrypted EBOOTs, loads ISO/PBP, runs the MIPS Allegrex CPU and VFPU, renders the GE over WebGL, decodes ATRAC3+ audio and MPEG/PSMF video, and saves game data in the browser.

Work in progress. Several commercial games boot to their menus and render, and the pspautotests CPU/kernel suite passes. Per-game status is on the compatibility list.

Demos

Click a thumbnail to play (video only, no audio).

Ridge Racer Metal Slug Cladun
Ridge Racer (60s replay) Metal Slug (software renderer) Cladun (overworld)

Documentation

The full documentation covers the user guide, architecture, and a per-subsystem and per-HLE-module reference. Run it locally with npm run docs:dev, or npm run dev:all to serve the app and docs side by side.

Quick start

git submodule update --init --recursive   # pulls ppsspp-reference (and its nested pspautotests)
npm install
npm run dev

If you cloned without --recurse-submodules, run the submodule line first. The PPSSPP reference and the pspautotests it carries are needed for the test suite, not for running the emulator.

Open the printed localhost URL, pick a game, and load an ISO or PBP. Keyboard controls are in the in-app input settings.

The dev server sends COOP/COEP headers so SharedArrayBuffer works. The GE worker needs it, so a plain static file server won't do.

Commands

npm run dev          # dev server (browser frontend)
npm run build:web    # production build to dist-web/
npm run typecheck    # tsc --noEmit
npx vitest run       # all tests
npx vitest run src/  # unit tests only (skip the ones that need ISOs)

Headless tools, run with npx tsx:

npx tsx tools/boot-iso.ts test/fixtures/puzzle-bobble.iso 100   # boot an ISO for N frames in node
npx tsx tools/game-diag.ts test/fixtures/gta.iso                # game diagnostics
npx tsx tools/find-dup-nids.ts                                  # check for duplicate NIDs

The node path has no GE worker, so it's for CPU/kernel/boot diagnostics, not rendering.

Layout

How one frame runs (the CPU runs in slices, the GE draws inline, and CoreTiming fires the VBlank that presents). Animated version of the architecture page:

How one frame runs

PSPEmulator (src/emulator.ts)
├── AllegrexCPU   MIPS CPU + VFPU, branch delay slots   (src/cpu/)
├── MemoryBus     64MB RAM, 2MB VRAM, BlockAllocator     (src/memory/)
├── HLEKernel     syscall dispatch, thread scheduler     (src/kernel/)
├── CoreTiming    cycle-accurate event scheduler         (src/timing/)
└── GEProcessor   GE command processing, runs inline     (src/gpu/)
Path What's there
src/cpu/ Allegrex CPU and VFPU (decoder, executor, registers).
src/memory/ MemoryBus routing plus a port of PPSSPP's BlockAllocator.
src/kernel/ HLEKernel and per-module hle-*.ts handlers. NID values live in nids.ts.
src/gpu/ The GE: command processor, vertex/lighting/texture pipeline, WebGL and software renderers. Runs inline on the main thread (the off-thread worker exists but is dead code).
src/loader/ ELF loader, PBP parser, and the PRX decrypter for encrypted EBOOTs.
src/crypto/ AES, SHA1, KIRK, AMCTRL.
src/iso/ ISO9660 reader, param.sfo parser, ISO metadata.
src/audio/ AudioWorklet engine and ATRAC3+ decode (via ffmpeg/libav).
src/media/ MPEG/PSMF video demux and decode (WebCodecs).
src/storage/ Browser-persisted savedata and file stores.
src/frontend/ The browser UI. Entry point is main.ts, loaded by index.html.

Testing

Tests run under vitest. npx vitest run src/ covers the units (CPU, crypto, timing, parsers). test/ boots real ISOs from test/fixtures/ and runs the pspautotests harness in test/pspautotests/, which uses compiled .prx programs from the ppsspp-reference/ submodule.

PPSSPP reference

ppsspp-reference/ is a submodule with the PPSSPP source. It's the ground truth for PSP behavior. When fixing a syscall, read the matching Core/HLE/sce*.cpp and match it instead of guessing. ppsspp_niddb.xml is generated from the project's NID constants with npm run nids:generate. Check hardware behavior against the reference source when needed.

See CLAUDE.md for the deeper architecture notes and conventions.

About

PSP emulator in TypeScript (HLE)

mert.js.org/psp-js/docs

Topics

browser-emulatoremulationemulatorhlemipsplaystation-portablepsppsp-emulatorretro-gamingtypescriptweb-emulatorwebgl

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

1 star

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.