MoonbitNES
A NES emulator in MoonBit
Install / Use
/learn @moonbit-community/MoonbitNESREADME
MoonBitNES: NES emulator and playground in MoonBit
This projects started as a personal experiment for the MoonBit language in Oct. 2023 and luckily became a showcase in IDEA conference in Nov. 2023.
Based on Dennis Felsing's Exellent nimes, which itself is based on fogleman's excellent NES emulator in Go.
Compared to the nim/go versions, this version implements enough unofficial opcodes to pass the nestest suggested in nesdev wiki.
This version is very different (changed ~800 lines) from the original version because MoonBit has evolved a loooot since then. At that time, there was no for loops, no pipes, and we can define methods for built-in types etc.
We make it open-source to encourage people mess with it. PRs are welcome!
Usage
To build the project, one will need
moon build --target wasm-gc # for the wasm-gc backend
# or
moon build --target js # for the js backend
To run the project, one will need
python3 -m http.server 8080 # or other ways to start a static server
Notice that the wasm-gc backend uses GC proposal of WebAssembly, thus requiring Chrome 119 and later, Firefox 120 and later. One may check if it's available with feature extensions. One may configure the backend at the beginning of main.mjs.
Known issues & future work:
- Refactor to more idiomatic moonbit (remember that most codes are written in Oct. 2023 and they're better described as ported than written!)
- Fix broken audio for some games (e.g. Kage, Batman)
- More mappers beyond 0,1,2,3,4,7
- Cycle-accurate CPU emulation
- Debugger GUI (the current instruction formatter is already close to Mesen2's trace logger)
Contributors
Thanks
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
