Now Reading
Nostalgist.js

Nostalgist.js

2023-10-12 03:44:16

Nostalgist.js logo

nostalgist.js.org badgeGitHub badgeNPM badge


Nostalgist.js is a JavaScript library that lets you run emulators of retro consoles like NES and Sega Genesis, inside net browsers.

Getting StartedAPI reference


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.

console demo

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

See Also

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.

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top