skill-emulator-wasm
Skill0 starsChanged 3 months agoMITView on GitHub
WebAssembly emulation engineering, Emscripten runtime bridging, retro hardware simulation (CPU/RSP/RDP/APU), ROM header parsing, save state serialization, WebGL rendering, and Web Audio synchronization. Use when developing, analyzing, or debugging WebAssembly emulators, ROM managers, and retro gaming web platforms.
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
- retro-emulation-engineeringSkill
- 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-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
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 70
HTML5 Gamepad API: Must be polled inside requestAnimationFrame using navigator.getGamepads().
- Distinctive: line 72
Touch Controls: Use multi-touch virtual joysticks (e.g.
≈ “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
WebAssembly & Retro Emulation Engineering Skill
This skill provides architectural patterns, performance optimization, and operational guidelines for browser-based emulation, WebAssembly bridging, and ROM manipulation.
1. Emulator Architecture & Emscripten Bridge
Browser-based emulators (like N64Wasm, RetroArch WASM cores, Mupen64Plus-WASM) bridge compiled C/C++ core engines with browser subsystem APIs:
[ JavaScript / Web Frontend ]
├── Input Controller (Gamepad API, Keyboard, Touch/NippleJS)
├── Display Manager (WebGL / Canvas context binding)
├── Audio Subsystem (Web Audio API / ScriptProcessor / AudioWorklet)
└── Persistence Layer (IndexedDB / LocalStorage / Cloud Saves)
│
Emscripten C-Bridge (`ccall`, `cwrap`, `Module._*`, `FS`)
│
[ WebAssembly Core Engine (Compiled C/C++) ]
├── CPU Interpreter / Dynarec Recompiler
├── Reality Co-Processor (RSP / RDP Graphics Engine)
├── Memory-Mapped I/O & Memory Controller
└── Save System (SRAM / FlashRAM / EEPROM 4k/16k / Save States)2. ROM Header Parsing & Identification (Nintendo 64 Standard)
The first 64 bytes (0x00 - 0x3F) of any N64 ROM contain critical metadata:
| Byte Offset | Size (Bytes) | Field Name | Description |
0x00 | 4 | Magic Number | 0x80371240 (Big Endian .z64), 0x37804012 (Byte Swapped .v64), 0x40123780 (Little Endian .n64) |
0x04 | 4 | Clock Rate | Clock rate seed |
0x08 | 4 | Program Counter | Boot entry address (default 0x80000400) |
0x0C | 4 | Release Address | Library version |
0x10 | 4 | CRC1 | Checksum 1 (boot verification) |
0x14 | 4 | CRC2 | Checksum 2 (boot verification) |
0x18 | 8 | Reserved | Unused |
0x20 | 20 | Internal Name | ASCII title padded with spaces |
0x34 | 4 | Reserved | Unused |
0x38 | 4 | Media Format | Cartridge format code |
0x3C | 2 | Cartridge ID | Game ID (e.g. SM for Super Mario, ZL for Zelda) |
0x3E | 1 | Country Code | E (USA), P (Europe), J (Japan), U (Australia), D (Germany), F (France) |
0x3F | 1 | Version | ROM revision version |
3. Audio Synchronization & Rate Matching
Emulated retro consoles produce audio at non-standard sample rates (e.g., 32000Hz, 44100Hz, 48000Hz) tied to CPU cycles.
Browser AudioContext typically operates at the hardware host rate (usually 44100Hz or 48000Hz).
- Buffer Starvation / Underrun: Causes audio clicks, pops, and stutter.
- Buffer Overflow / High Latency: Causes sound delay and video desync.
- Dynamic Resampling: Monitor the audio ring buffer fill level. If the buffer is depleting, slightly slow down playback or duplicate samples; if overflowing, skip or interpolate samples to keep latency < 50ms.
- Audio-to-Video Timing: Emulation frame loops (
requestAnimationFrame) should be throttled by the audio buffer consumption to prevent video tearing or erratic speedups.
4. Input Polling & Virtual Controller
- HTML5 Gamepad API: Must be polled inside
requestAnimationFrameusingnavigator.getGamepads(). Do not rely on event listeners for stick axes. - Deadzone Filtering: Apply radial or axial deadzones (typically 0.15 - 0.20) to analog sticks to prevent stick drift.
- Touch Controls: Use multi-touch virtual joysticks (e.g. NippleJS) with decoupled canvas rendering to prevent blocking touch event processing.
5. Save Data Management & Integrity
- EEPROM (512B or 2KB): 4Kbit or 16Kbit serial EEPROM used for lightweight saves.
- SRAM (32KB): Battery-backed Static RAM (
.sra). - FlashRAM (128KB): High-capacity flash memory (
.fla). - Save States (
.state): Full serialized snapshot of CPU registers, RDRAM, RSP/RDP status, and timer interrupts. - IndexedDB over LocalStorage: For ROM caching and save states (>5MB), always prefer
IndexedDBoverlocalStoragedue to synchronous 5MB quota limitations.
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.

