retro-emulation-engineering
Skill0 starsChanged 3 months agoMITView on GitHub
Retro console emulator architecture, hardware coprocessor simulation (CPU/RSP/RDP/APU), frame timing, audio dynamic resampling, ROM format validation, and cartridge save persistence. Use when developing, optimizing, or debugging browser-based or native video game emulators.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- core/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- avoid-ai-writingSkill
- c-cpp-systemsSkill
- doubt-driven-developmentSkill
- marketing-copywritingSkill
- mempalace-recallSkill
- mempalaceSkill
- mempalace-taskSkill
- seo-optimization-and-auditSkill
- skill-ai-mlSkill
- skill-backend-architectSkill
- skill-codebase-onboardingSkill
- skill-code-reviewSkill
- skill-context-engineeringSkill
- skill-creative-designSkill
- skill-data-analysisSkill
- skill-data-scienceSkill
- skill-design-engineeringSkill
- skill-devops-cloudSkill
- skill-emulator-wasmSkill
- skill-frontend-architectSkill
- skill-graph-analyticsSkill
- skill-graphics-webglSkill
- skill-low-level-programmingSkill
- skill-master-orchestratorSkill
- skill-mcp-builderSkill
- skill-monorepo-architectSkill
- skill-osint-engineeringSkill
- skill-plugin-architectureSkill
- skill-qa-engineerSkill
- skill-researchSkill
- skill-resume-tailorSkill
- skill-stealth-scrapingSkill
- skill-system-diagnosticsSkill
- skill-web-architectureSkill
- skill-web-performanceSkill
- spec-driven-developmentSkill
- spec-minerSkill
- wasm-emscriptenSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 86
Audio-Throttled Main Loop: Use the audio output buffer capacity to throttle emulation steps instead of setInterval or unbounded …
- Distinctive: line 87
If buffer fill level < 20%: run extra emulation tick to prevent underflow (crackling).
- Distinctive: line 88
If buffer fill level > 80%: pause emulation tick to prevent overflow and latency buildup.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Retro Emulation Engineering Skill
Specialist in console hardware simulation, CPU interpretation and dynamic recompilation (Dynarec), coprocessor command buffers (RSP/RDP), audio ring buffer synchronization, and ROM format manipulation.
1. Emulation Core Subsystems Topology
An emulator simulates hardware components communicating over virtual buses:
[ MIPS R4300i CPU ] <─── System Bus ───> [ RDRAM (4MB / 8MB Expansion) ]
│ │
▼ ▼
[ Reality Co-Processor (RCP) ] [ Serial Interface (SI) ]
├── RSP (Vector DSP / Geometry) └── Controllers & Memory Paks
├── RDP (Rasterizer & Blending) [ Audio Interface (AI) ]
├── Video Interface (VI / WebGL) └── PCM Audio Buffer / DMA
└── Audio Interface (AI / Web Audio) [ Peripheral Interface (PI) ]
└── Cartridge ROM & Save Media2. ROM Header Validation & Auto-Detection Table
Nintendo 64 ROMs exist in three physical endian formats. The first 4 bytes indicate format:
| Format | Magic Bytes (Hex) | Description | Normalization Action |
.z64 | 80 37 12 40 | Big-Endian (Native N64 bus order) | Native format; no swap needed. |
.v64 | 37 80 40 12 | Byte-Swapped (Doctor V64 copier) | Swap every 2 adjacent bytes (swap16). |
.n64 | 40 12 37 80 | Little-Endian (Z64 copier / PC) | Swap every 4 bytes (swap32). |
In-Place ROM Normalizer (JavaScript / TypeScript)
export function normalizeN64Rom(data: Uint8Array): Uint8Array {
if (data.length < 4) return data;
const b0 = data[0], b1 = data[1], b2 = data[2], b3 = data[3];
// Already Big-Endian .z64
if (b0 === 0x80 && b1 === 0x37 && b2 === 0x12 && b3 === 0x40) {
return data;
}
// Byte-swapped .v64 -> swap 16-bit words
if (b0 === 0x37 && b1 === 0x80 && b2 === 0x40 && b3 === 0x12) {
const len = data.length - (data.length % 2);
for (let i = 0; i < len; i += 2) {
const tmp = data[i];
data[i] = data[i + 1];
data[i + 1] = tmp;
}
return data;
}
// Little-endian .n64 -> swap 32-bit dwords
if (b0 === 0x40 && b1 === 0x12 && b2 === 0x37 && b3 === 0x80) {
const len = data.length - (data.length % 4);
for (let i = 0; i < len; i += 4) {
const t0 = data[i], t1 = data[i + 1], t2 = data[i + 2], t3 = data[i + 3];
data[i] = t3;
data[i + 1] = t2;
data[i + 2] = t1;
data[i + 3] = t0;
}
return data;
}
return data;
}3. Audio Rate Matching & Frame Pacing
- Sample Pacing Problem: Emulators generate audio at non-integer rates relative to the 60Hz display refresh cycle.
- Audio-Throttled Main Loop: Use the audio output buffer capacity to throttle emulation steps instead of
setIntervalor unboundedrequestAnimationFrame:- If buffer fill level < 20%: run extra emulation tick to prevent underflow (crackling).
- If buffer fill level > 80%: pause emulation tick to prevent overflow and latency buildup.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

