Giter Club home page Giter Club logo

moonbitnes's Introduction

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

moonbitnes's People

Contributors

peter-jerry-ye avatar jodiemoonlight avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.