A web based N64 Emulator

Overview

N64 Wasm

Thanks for checking out N64 Wasm! An N64 emulator that runs in the browser. It is a port of the excellent RetroArch ParaLLEl Core to WebAssembly. This project started because I wanted to have a well playing open-source N64 emulator designed for the web. I also wanted to learn OpenGL and this was a good way to dive in. Game compatibility is decent with a good portion of the 3D games playable and at full speed on a mid-range computer - Mario 64, Ocarina of Time etc... There is currently an issue with some 2D games such as Dr Mario 64 and Pokemon Puzzle League which I am still investigating. I also tested on the iPhone 13 Pro and Xbox Series X Browser and it works great.

Supports the following features -

  • Gamepad Support (Xbox and PS4 Controller tested)
  • Button and Keyboard Remapping
  • Save States
    • They save in your browser so you can close and come back later
  • Import/Export Save Files (see settings.js)
  • Zoom Controls
  • Full Screen
  • Audio Support
  • Cloud Save States (Host your own server)

You can try it here: https://www.neilb.net/n64wasm/

Build Instructions

I used WSL on Windows but any Linux environment would work as well. First Install Emscripten version 2.0.7

  • create a folder somewhere in your environment to install emscripten
  • git clone https://github.com/emscripten-core/emsdk.git
  • cd emsdk
  • ./emsdk install 2.0.7
  • ./emsdk activate 2.0.7
  • source ./emsdk_env.sh
  • navigate back to the code folder in the N64Wasm repo
  • run make
  • then copy these 3 files from the code\ folder into the dist\ folder
    • n64wasm.data
    • n64wasm.js
    • n64wasm.wasm

Hosting

This emulator supports hosting the app yourself with your own rom list. Create a folder called roms in the dist\ folder and copy them there. Then go into romlist.js and uncomment the code and populate the paths and names of your roms.

var ROMLIST = [
    {url:"roms/rom1.z64",title:"Game 1"},
    {url:"roms/rom2.v64",title:"Game 2"},
    {url:"roms/rom3.v64",title:"Game 3"},
];

This will then display a dropdown on the UI to select a game

romlist

You can also enable Cloud Save States with some additional configuration. See this README for information on how to set that up.

Windows Version

If you want to actually do debugging you will want to get the Windows version working on your machine. Debugging in WebAssembly is practically non-existant other than logging print statements. I did all of my debugging and testing using the Windows version with Visual Studio 2019 and then would compile the web version with Emscripten. Make sure you are on a computer that has a graphics card which supports OpenGL.

  • To get it up and running open up the N64_Wasm.vcxproj file in notepad and update the paths
    • update all the paths for the includes and libraries to where these are on your machine
    • the ones referencing the code folders should be where your source code is
    • now you can open up N64_Wasm.vcxproj using Visual Studio 2019
  • Get the Libraries and headers for the following
    • the actual versions could vary but these were the ones I used
    • SDL2 - version 2.0.14
    • SDL2 Image - version 2.0.5
    • SDL2 TTF - version 2.0.15
    • GLEW - version 2.2.0
  • Copy a rom to your working directory
    • and replace the name of that rom in mymain.cpp
    • sprintf(rom_name, "%s", "game.z64");
  • Note - running in Release mode runs much faster than in Debug though you won't be able to set breakpoints

pcversion

Screenshots

screenshot screenshot screenshot screenshot screenshot

iPhone 13 Pro

screenshot

References

Comments
  • Where is the function named KeyboardEvent to define?

    Where is the function named KeyboardEvent to define?

    Hi As the title explained, I searched (KeyboardEvent) globally, but still, find nothing. Could you just please describe where this function is defined?

    opened by eric183 3
  • Sram dump to indexdb

    Sram dump to indexdb

    Outside of just save states would it be possible to implement "cmd_savefiles" as a callable function to dump sram like you have with Retroarch Emscripten builds?

    opened by thelamer 3
  • SkyEmu iPhone Home Screen bookmarks

    SkyEmu iPhone Home Screen bookmarks

    Skyemu has a cool little feature where if you add a bookmark to the home screen it will remove the search bar.

    I got no clue how it works but it would be nice for mobile users

    (also dark mode would be nice lol)

    opened by wyldcrd 2
  • Compiling a libretro compatible core

    Compiling a libretro compatible core

    Great work here, this really works well. I have been trying to put together a web based emulator frontend and would like to use a libretro based core for n64. Looking over the code it looks like you swapped to SDL2 vs libretros glsym_es #include <SDL2/SDL_opengl.h>. Now I am not sure if this is even possible, but could you give me any pointers as to how to compile this into a bc file compatible with the libretro api/frontend? (standard emmake make -f Makefile platform=emscripten and emmake make -f Makefile.emscripten LIBRETRO=parallel_n64)

    I got https://github.com/libretro/parallel-n64 to compile with some makefile tweaks, but it just aborts after loading a rom.

    [libretro INFO] Microcode 0 - RSP SW 2.0X (Super Mario 64)
    libretro.js:141 [libretro INFO] microcheck: old ucode: 2,  new ucode: 0
    libretro.js:141 exception thrown: RuntimeError: unreachable,RuntimeError: unreachable
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[949]:0x3cdd3
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[3536]:0x122b6e
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[2731]:0xeafed
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[2775]:0xf0035
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[4930]:0x1752b6
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[4931]:0x175351
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[1925]:0x9ffcf
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[1924]:0x9fe42
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[4915]:0x1742fc
        at http://localhost:8000/data/parallel_n64_libretro.wasm:wasm-function[4916]:0x17437c
    

    There is also this https://m4xw.net/retroarch/ based on some old mupen64 code, but it does not really function. I suspect your swap to SDL2 is gonna be needed, but I am not sure how to fit these puzzle pieces together and make a working core. In general in way over my head and wanted to reach out to you to just see if this would even be plausible. The goal being to have your n64 core changes run with the standard module init and interactive menu baked into the current emscripten libretro builds.

    opened by thelamer 2
  • Question about emulator settings

    Question about emulator settings

    Hello, congratulations for such a great project! I was wondering, how can I set the dithering and filtering mode? and how can enabled/disable the sound? I saw on other n64 emulators that are running in a low resolution (I guess for a better performance) is this possible with the n64wasm emulator?

    Best regards, Leonardo

    opened by lrusso 2
  • Hosting my own version

    Hosting my own version

    How can I get it to work when I host it, I'm working on some edits using replit, i have it hosted onto a replit built in subdomain, when I go to the actual emulator html file (your main emulator site) it doesnt display any buttons. I have made changes but they are minor changes (also when i try to download on replit the files come up as 0 kb so that is a bit annoy.) Everything is still pointing to the correct spot but I did remove it from wwwroot as that wasn't working either. See screenshots for more info.

    Screenshot 2022-03-10 9 54 08 AM

    Screenshot 2022-03-10 9 52 34 AM

    Screenshot 2022-03-10 9 54 28 AM

    Screenshot 2022-03-10 9 50 58 AM

    Screenshot 2022-03-10 9 52 46 AM

    opened by JakeGoldmanCode 2
  • chromebook dpad/stick issues

    chromebook dpad/stick issues

    I am currently playing on a chromebook and am trying to play a game called the new tetris, but for some reason it just cant read the stick and dpad inputs (im using a keyboard, i use arrow keys for dapad and nothing happens same for cstick controls), all the other button controls work, just not dpad or stick

    opened by Grumm1291 2
Owner
Neil Barkhina
Software Developer, C#, JavaScript
Neil Barkhina
Play Nintendo Switch using an original N64 controller via an Arduino Uno!

N64 -> Arduino Uno -> Nintendo Switch Description By connecting an original N64 controller to an Arduino UNO R3 running this code, and plugging the US

null 19 Oct 24, 2022
Documenting and preserving the N64, combining official datasheets and homebrew research together

N64-documentation A repository where I try to document everything about the Nintendo 64 to the best of my ability. All the official and homebrew Ninte

Derek 10 Nov 2, 2022
Scrollytroller is a crank-based USB controller, initially inteneded for use with Playdate's Pulp web-based game development tool

Scrollytroller Scrollytroller is a crank-based USB controller, initially inteneded for use with Playdate's Pulp web-based game development tool. This

Scott Lawrence 4 Feb 17, 2022
Web Server based on the Raspberry Pico using an ESP8266 with AT firmware for WiFi

PicoWebServer This program runs on a Raspberry Pico RP2040 to provide a web server when connected to an Espressif ESP8266. This allows the Pico to be

null 52 Jan 7, 2023
Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim.

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.

Daniel Carl 1.2k Dec 30, 2022
The c++ micro framework for building web applications based on workflow

wfrest The c++ micro framework for building web applications based on workflow ⌛️ Build Step 1 : install workflow git clne [email protected]:sogou/workfl

Shiyu Yi 539 Jan 3, 2023
Open source selfhosted web-based wiki/doc/knowledge management and collaboration system

Tsailun - open source online document and collaboration Open source selfhosted web-based wiki/doc/knowledge management and collaboration system Access

null 125 Dec 30, 2022
QtWebKit-based web browser on Linux framebuffer.

FBrowser QtWebKit-based web browser on Linux framebuffer. Security Notes This browser is not intended for visiting untrusted websites. By default, OSB

null 24 Jan 1, 2023
Networked based Atari 2600 emulator.

Cloudtari This is an Atari 2600 emulator that can stream the video over a network, currently using VNC or alternately as a stream of GIFs to a web bro

Michael Kohn 16 Jan 19, 2022
A portable full system emulator of Z280 based boards

z280emu A portable full system emulator of Z280 based boards Motivation There is no working Z280 emulator that I'm aware of so I decided to write one.

Michal Tomek 16 Dec 17, 2022
AVR (atmega328p) based floppy emulator for PC

fddEMU An AVR (atmega328p) based floppy drive emulator for PC fddEMU is a DIY floppy drive emulator. You can immediately begin testing fddEMU on seria

Acemi Elektronikci 100 Dec 24, 2022
Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework, based on QEMU.

Unicorn Engine Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework, based on QEMU. Unicorn offers some unparalleled fe

lazymio 1 Nov 7, 2021
Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.

TF4Micro Motion Kit This repo contains the Arduino Sketch and a Web Bluetooth API for loading models and running inference on the device. Install and

Google Creative Lab 52 Nov 24, 2022
A simple tool that aims to efficiently and quickly parse the outputs of web scraping tools like gau

massurl is a simple tool that aims to parse the outputs of tools like gau, and extract the parameters for each URL, remove duplicates and do it all very quickly. Because web scraping tools' outputs can get very large very quickly, it is nice to have a tool that parses them and and outputs something clean and easy to read.

Fr1nge 13 Jul 24, 2022
A Flutter Web Plugin to display Text Widget as Html for SEO purpose

SEO Renderer A flutter plugin (under development) to render text widgets as html elements for SEO purpose. Created specifically for issue https://gith

Sahdeep Singh 103 Nov 21, 2022
sour is a complete multiplayer Sauerbraten experience in the web delivered as a single Docker image.

sour sour is a complete multiplayer Sauerbraten experience in the web delivered as a single Docker image. Overview I have always loved playing Sauerbr

Caleb Foust 73 Jan 1, 2023
A Minimal Web Browser with Built-in Adblocker in Less Than 100 Lines of Code

A Minimal QtWebEngine Web Browser with Adblocker How Does It Work This is a minimal network filter implementation using QWebEngineUrlRequestIntercepto

Penk Chen 19 Jul 23, 2022
an easy-to-use cross platform web browser controller for C++

WebBrowser++ 这是一个基于C++17的唯头文件跨平台浏览器控制库。 您只需要将本目录下的Include文件夹拷贝至您的项目中即可使用。如果使用CMake编译,则可直接include_directories(Include),也可以模仿本项目的CMakeLists.txt进行编写。 建立该

null 8 Nov 17, 2021
A web application which finds the shortest or quickest path from two points in the city of Rio de Janeiro.

A web application which finds the shortest or quickest path from two points in the city of Rio de Janeiro. Obviously not Waze. (final project for EDA @ EMAp, 2021)

null 2 Nov 17, 2021