-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e113f08
commit 5630fc3
Showing
4 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,38 +16,33 @@ async function gbc() { | |
} | ||
|
||
async function launchNestopia() { | ||
const abortController = new AbortController() | ||
setTimeout(() => { | ||
abortController.abort() | ||
}, 500) | ||
nostalgist = await Nostalgist.launch({ | ||
core: 'nestopia', | ||
rom: 'pong1k.nes', | ||
signal: abortController.signal, | ||
}) | ||
} | ||
|
||
async function launchFceummWithCoreConfig() { | ||
nostalgist = await Nostalgist.launch({ | ||
core: 'fceumm', | ||
rom: 'flappybird.nes', | ||
shader: 'crt/crt-easymode', | ||
retroarchCoreConfig: { | ||
fceumm_turbo_enable: 'Both', | ||
}, | ||
rom: 'flappybird.nes', | ||
shader: 'crt/crt-easymode', | ||
}) | ||
} | ||
|
||
async function launchFceummWithRaLegacy() { | ||
nostalgist = await Nostalgist.launch({ | ||
core: 'fceumm', | ||
rom: 'flappybird.nes', | ||
resolveCoreJs(core) { | ||
return `https://cdn.jsdelivr.net/gh/arianrhodsandlot/[email protected]/retroarch/${core}_libretro.js` | ||
}, | ||
resolveCoreWasm(core) { | ||
return `https://cdn.jsdelivr.net/gh/arianrhodsandlot/[email protected]/retroarch/${core}_libretro.wasm` | ||
}, | ||
rom: 'flappybird.nes', | ||
}) | ||
} | ||
|
||
|
@@ -87,7 +82,7 @@ function restart() { | |
} | ||
|
||
function resize() { | ||
nostalgist.resize({ width: 400, height: 400 }) | ||
nostalgist.resize({ height: 400, width: 400 }) | ||
} | ||
|
||
async function screenshot() { | ||
|
@@ -107,30 +102,30 @@ function getCurrentNostalgist() { | |
} | ||
|
||
Nostalgist.configure({ | ||
style: { width: '800px', height: '600px', position: 'static' }, | ||
style: { height: '600px', position: 'static', width: '800px' }, | ||
}) | ||
|
||
document.body.addEventListener('click', async function listener({ target }) { | ||
if (!(target instanceof HTMLButtonElement)) { | ||
return | ||
} | ||
const handlers = { | ||
nes, | ||
megadrive, | ||
exit, | ||
gbc, | ||
launchNestopia, | ||
launchCustomRom, | ||
launchFceummWithCoreConfig, | ||
launchFceummWithRaLegacy, | ||
launchCustomRom, | ||
launchNestopia, | ||
launchState, | ||
saveState, | ||
loadState, | ||
megadrive, | ||
nes, | ||
pause, | ||
resume, | ||
restart, | ||
resize, | ||
restart, | ||
resume, | ||
saveState, | ||
screenshot, | ||
exit, | ||
} | ||
const textContent = target.textContent || '' | ||
if (textContent in handlers) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "nostalgist", | ||
"description": "Nostalgist.js is a JavaScript library that allows you to run emulators of retro consoles within web browsers.", | ||
"version": "0.9.2", | ||
"version": "0.10.0", | ||
"author": { | ||
"name": "arianrhodsandlot", | ||
"email": "[email protected]" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.