Nostalgist.js
Nostalgist.js is a JavaScript library that lets you run emulators of retro consoles like NES and Sega Genesis, inside net browsers.
A Fast Look
Nostalgist.js is a JavaScript library that lets you run emulators of retro consoles like NES and Sega Genesis, inside net browsers.
Open the DevTools of your browser(Ctrl/⌘ + Shift + J), then kind this code and press Enter, an NES emulator will seem in your browser like above (although it’s not Tremendous Mario Bros. ????)!
const { Nostalgist } = await import('https://esm.run/nostalgist')
await Nostalgist.nes('flappybird.nes')
Controls:
D-Pad: ↑ ↓ ← →
Begin: Enter
Choose: Shift
B: Z
A: X
Options
Launch
Launch a retro recreation with RetroArch emulator in a browser
import { Nostalgist } from 'nostalgist'
await Nostalgist.launch({
core: 'fceumm',
rom: 'flappybird.nes',
})
Save & Load
Save the state of the sport, then load it later
import { Nostalgist } from 'nostalgist'
const nostalgist = await Nostalgist.nes('flappybird.nes')
const { state } = await nostalgist.saveState()
nostalgist.loadState(state)
Customise
Customise any RetroArch config earlier than launching
import { Nostalgist } from 'nostalgist'
const nostalgist = await Nostalgist.launch({
core: 'nestopia',
rom: 'flappybird.nes',
retroarchConfig: {
rewind_enable: true,
}
})
Hack
Entry low degree APIs of Emscripten
import { Nostalgist } from 'nostalgist'
const rom = 'https://instance.com/zelda.sfc'
const nostalgist = await Nostalgist.snes(rom)
const FS = nostalgist.getEmscriptenFS()
FS.readdir('/dwelling/web_user/retroarch/userdata/saves/Snes9x/zelda.srm')
Right here is an easy stay instance.
Motivation
Nostalgist.js is constructed on high of RetroArch Emscripten builds. Though there may be an official RetroArch’s web player, and a few third-party ones like webretro, it’s nonetheless not that simple to launch RetroArch in a browser programmatically.
The aim of Nostalgist.js is to simplify the method of launching an emulator to play a recreation, through RetroArch, in browsers. Given a ROM and a core, the sport needs to be launched with none extra configuration.