arianrhodsandlot / nostalgist

A JavaScript library used for running emulators of retro consoles inside browsers.
https://nostalgist.js.org
MIT License
665 stars 19 forks source link

Load Custom Core #36

Closed brunotrevisan closed 3 months ago

brunotrevisan commented 4 months ago

Hi, I've been trying to solve this for days and I can't understand it, using a custom core yesterday I just compiled it and I get the following error

515e234c-212a-49a4-ae62-6c4ca14139b6:7 Uncaught ReferenceError: AL is not defined at getEmscripten (515e234c-212a-49a4-ae62-6c4ca14139b6:7:18) at Emulator.setupEmscripten (nostalgist.js:17498:30) at async Emulator.launch (nostalgist.js:17714:9) at async t.launchEmulator (nostalgist.js:18458:5) at async t.launch (nostalgist.js:18257:23) at async t.launch (nostalgist.js:18083:5) at async :8:17

the error occurs on the following loading line

var shouldRunNow = true;
if (Module["noInitialRun"])
    shouldRunNow = false;
run();
;Module.FS = FS;
Module.PATH = PATH;
Module.ERRNO_CODES = ERRNO_CODES;
return {
    **AL,**
    Browser,
    JSEvents,
    Module,
    exit: _emscripten_force_exit
}

I tried compiling my own systems using the retroarch guide and I also tried using colors that I got from https://web.libretro.com/, they all generate the same error and I don't know why

brunotrevisan commented 4 months ago

in the documentation being reported to send an object like this:

core: { core: 'http://127.0.0.1/demo/fceumm_libretro.js', name: 'fceumm_libretro', wasm: 'http://127.0.0.1/demo/fceumm_libretro.wasm', },

however, this way, nostalgic doesn't even try to read. I modified it to: core: 'fceumm', resolveCoreJs(core) { return http://127.0.0.1/demo/fceumm_libretro.js }, resolveCoreWasm(core) { return http://127.0.0.1/demo/fceumm_libretro.wasm },

but then I get the error mentioned above, I'm lost on how to load a core manually

arianrhodsandlot commented 3 months ago

This seems to be a bug comes from v0.10.0. Could you downgrade to v0.9.2 and have another try?

brunotrevisan commented 3 months ago

Downgrade solved the problem