# Port a console emulator to the browser with a rulebook, a headless test build and pixel checks

> Two builders used Claude to port the PCSX2 PlayStation 2 emulator core to the browser. They kept a CLAUDE.md and AGENTS.md rulebook, had Claude build a headless version that boots and benchmarks on its own after every change, and required pixel-identical output for every optimisation.

- URL: https://paperchasewebb.ai/bots/marketplace/items/port-a-console-emulator-to-the-browser-with-a-rulebook-a-headless-test-build-and-pixel-checks/
- Type: Agent use case pack
- Category: Games
- By: PaperChaseWebb
- Works with: Claude Code, Claude (named in the listing); Plain .md
- Price: Free USD
- Difficulty: Advanced
- Setup time: 1 hr
- Time to result: One working session
- Format: Markdown (.md) file, port-a-console-emulator-to-the-browser-with-a-rulebook-a-headless-test-build-and-pixel-checks.md
- Version: 1.0, updated 2026-10-29
- License: Personal and commercial use. Credit the original source when you share the workflow.

## What you end up with

Three habits carry over: a rulebook the agent reads every session, a test build the agent can run without you, and an exact-match check before any optimisation is kept.

## What you get

- A plain-language summary of the workflow
- A fill-in prompt template
- What to watch out for
- A link to the original source

## Who it is for

Builders who already use AI agents and want a proven workflow they can copy into their own project.

## Tools needed

- Claude (Opus): wrote most of the code: a WebAssembly recompiler, a WebGPU renderer port and test tools
- PCSX2 (GPL-3.0): the emulator core they started from
- Headless build: boots, runs a few hundred frames and takes a screenshot with no browser
- You need: An AI coding agent or chat model
- You need: A small real task to try it on

Cost to run: Free with the agent plan you already use.

## How it works

1. **Write CLAUDE.md or AGENTS.md with the project, limits, build and test .** Write CLAUDE.md or AGENTS.md with the project, limits, build and test steps, and a rule never to claim untested work. Expected: Done before you move to the next step.
2. **Have the agent build a headless runner that boots, runs and screenshot.** Have the agent build a headless runner that boots, runs and screenshots after every change. Expected: Done before you move to the next step.
3. **Require exact-match output before keeping any optimisation.** Require exact-match output before keeping any optimisation. Expected: Done before you move to the next step.
4. **Log every attempt, including the ones you drop.** Log every attempt, including the ones you drop. Expected: Done before you move to the next step.
5. **Keep users' files on their own machine.** Keep users' files on their own machine. Expected: Done before you move to the next step.

## Sample prompt: Workflow template (Claude (Opus), PCSX2 (GPL-3.0))

```
Apply this workflow to [your project]:
1. Write CLAUDE.md or AGENTS.md with the project, limits, build and test steps, and a rule never to claim untested work.
2. Have the agent build a headless runner that boots, runs and screenshots after every change.
3. Require exact-match output before keeping any optimisation.
4. Log every attempt, including the ones you drop.
5. Keep users' files on their own machine.
Stop and ask me before anything irreversible: deploys, payments, sends or deletes.
```

Adapted by PaperChaseWebb. Not the original author's prompt.

## Free preview of port-a-console-emulator-to-the-browser-with-a-rulebook-a-headless-test-build-and-pixel-checks.md

````markdown
# Port a console emulator to the browser with a rulebook, a headless test build and pixel checks

PaperChase agent use case (free feed entry), version 1.0. Source: [u/yousriii and u/aegyptiacus11](https://www.reddit.com/r/ClaudeAI/comments/1xigpgr/we_used_claude_to_get_a_full_ps2_emulator_running/), 2026-10-28.

## What they did

The rulebook explains the project, browser limits, how to build and test, and two rules: credit PCSX2, and never claim something works without testing it. Because browsers do not allow the usual native code translation, Claude wrote replacements that translate PS2 code into WebAssembly at runtime and tested them against the original code for matching results. Each performance idea was checked for a pixel-identical picture and logged, including the many that were dropped. Players load their own BIOS and disc images, and nothing is uploaded.

## Worth knowing

Three habits carry over: a rulebook the agent reads every session, a test build the agent can run without you, and an exact-match check before any optimisation is kept. Keeping a log of failed attempts stops the agent retrying them. Users must supply their own BIOS and games, which keeps the legal side clean.
````

## Worth knowing

- Three habits carry over: a rulebook the agent reads every session, a test build the agent can run without you, and an exact-match check before any optimisation is kept. Keeping a log of failed attempts stops the agent retrying them. Users must supply their own BIOS and games, which keeps the legal side clean.
- Figures are as reported by the original author and were not re-measured by us.

## Questions

**Where does this come from?** A public post credited to u/yousriii and u/aegyptiacus11. Source: https://www.reddit.com/r/ClaudeAI/comments/1xigpgr/we_used_claude_to_get_a_full_ps2_emulator_running/

**Is it free?** Yes. Feed entries are free to read and download.

## How to get it

Free sample. Download it directly at https://paperchasewebb.ai/bots/marketplace/items/port-a-console-emulator-to-the-browser-with-a-rulebook-a-headless-test-build-and-pixel-checks/, no signup.

Seller: PaperChaseWebb Inc., mgmt@paperchasewebb.com
