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.
下文将展示如何在 Debian 11 下搭建 N64Wasm
环境
- Debian 11
- Emscripten
参考
步骤
安装 Emscripten 2.0.7
执行
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
安装 N64Wasm
执行
git clone https://github.com/nbarkhina/N64Wasm.git cd N64Wasm/code make
将 code 目录下编译完成的 n64wasm.data、n64wasm.js、n64wasm.wasm 复制到 N64Wasm/dist 目录下
cp code/n64wasm.* dist
配置 Nginx
将 N64Wasm 目录移动到有 Nginx 权限的目录下,并修改权限
mv N64Wasm /var/www chown -R www-data:www-data N64Wasm
在 /etc/nginx/sites-available 下新建配置文件 n64,写入以下内容
server { listen 80; server_name _; root /var/www/N64Wasm/dist; index index.html; }
新建软链接,启动 nginx
ln -s /etc/nginx/sites-available/n64 /etc/nginx/sites-enabled nginx -t # 测试配置 nginx -s reload
浏览器访问即可开始使用
可选:服务器内置 ROM List
N64Wasm 可以通过浏览器上传 ROM 使用,同时也支持服务器内置 ROM:可以将 ROM 上传至服务器,使用的时候直接选择对应 ROM,无需在本地存储 ROM
在 N64Wasm/dist 下新建目录 roms,将 .z64、.n64 等后缀的 ROM 上传至服务器,放置在 roms 目录下,最后编辑 dist 目录下的 romlist.js,如下图
之后浏览器访问 Web 页面,会多出一个下拉菜单用于选择 ROM
效果