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
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
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
x86 emulator on Raspberry Pi Pico

picox86 x86 emulator on Raspberry Pi Pico https://user-images.githubusercontent.com/10139098/110543817-13299080-812b-11eb-9c88-674cdae919fc.mp4 PCB fr

null 39 Nov 9, 2022
I2C hardware test terminal/master mode emulator.

I2C Master Mode Emulator The I2C master mode emulator allows communication with I2C devices by sending or receiving data to/from the I2C bus. To issue

Dilshan R Jayakody 19 Nov 5, 2022
a little hobby raspberry pi pico emulator

PICO-EMU a little raspberry pi pico emulator note: we use the provided bootrom from raspberry pi at the repo: https://github.com/raspberrypi/pico-boot

supercyp 26 Nov 5, 2022
Emulator for EvE Online Crucible expansion

EVEmu - An EVE Online Emulator Introduction EVEmu is a work-in-progress server emulator for the space MMO EVE Online. This is an educational project.

EvEmu Project 111 Dec 5, 2022
a Blue Pill Neopixel Emulator

NeoPill a Blue Pill Neopixel Emulator, firmware for STM32F103C8T6. To build with STM32CubeMX (6.1.1), open bluepill_neoemu_clk.ioc, generate code in a

null 21 Aug 30, 2022
BK0010/BK0011 Emulator for Linux

<html><head> <meta http-equiv="content-type" content="text/html;charset=koi8-r"> </head> <body><pre> Этот эмулятор БК-0010 (пока только БК-0010, у мен

Yaroslav Salnikov 8 Oct 9, 2022
A VERY simple Chip8 emulator

Chip8-Emu A VERY simple Chip8 emulator

null 4 Nov 7, 2021