Coder Social home page Coder Social logo

binbashbanana / webretro Goto Github PK

View Code? Open in Web Editor NEW
236.0 24.0 334.0 34.52 MB

RetroArch in your browser

Home Page: https://binbashbanana.github.io/webretro/

License: MIT License

CSS 2.23% JavaScript 15.86% Python 0.06% HTML 9.14% GLSL 72.71%
emulator retroarch libretro

webretro's People

Contributors

binbashbanana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webretro's Issues

DS Emulator

Ok so basically I Love DS games and I was wondering if you can add in your emulator the DS games and while I understand it's laggy, I was wondering if its possible for the DS games to run more faster (I play on Chromebook) and an idea I had was to make it were you can make the frames go higher or lower as an option

Webretro Cores

Is the file for the cores the .js or .wasm? And how did you find the buildable cores?

Angrylion RDP N64 and general libretro builds

I got to about where you are building mupen64 for web. Another project you might be interested in is https://github.com/nbarkhina/N64Wasm/ they took the old parallel libretro code and used SDL openGL baked into emsdk.

My question is if it is possible to basically go back in time just forget about Glide and use CPU cycles to get something working for N64? It looks like in the most current versions everything is tied to threading and as far as I can tell with all the building I have done enabling PTHREAD in retroarch and using workers is a big overhaul to the codebase to enable shared memory arrays.
I got the interface to load using proxy-to-worker, but any core launching from there will just crash.

I have not had any luck getting the parallel core building and working with angrylion RDP on my own, just wondering if it is something you have looked into? I am mostly interested to see if it produces something playable with a modern CPU despite the lack of threading.

Also unrelated to this issue, it looks like to get mobile compatibility the missing piece is overlay support in:
https://github.com/libretro/RetroArch/blob/master/input/drivers/rwebinput_input.c
It needs touch mapped like they do for mouse:
https://emscripten.org/docs/api_reference/html5.h.html#touch
https://github.com/libretro/RetroArch/blob/master/input/drivers/rwebinput_input.c#L261-L279
Then referenced properly in input_overlay.
Alternatively elements can be rendered in the page separate from the canvas.

Basically I have gotten as far as I believe I am technically capable of porting cores over for self hosted web and seeing if you may have anymore insight on continuing to fork off some of these cores to something usable for web.

Could you possibly add a Gamecube core?

Hello there BinBashBanana!
I’m back from the dead and to suggest a core!
Pokemon Colosseum is really taking the title as the hardest Pokemon spinoff game.
Not much here to say really.
Thanks for reading this and I hope you add it in for 6.6 or possibly 6.7.
-ChaoticDX

unable to set bios for sega CD emulation

Sega CD emulation doesn't work because its impossible (as far as i am aware) to add a Sega CD bios to the Genesis Plus GX core. It's possible to load an image of the Sega CD bios but I can't load the bios image into the core before playing the game. Is there something im missing here?

Stream from the Cloud

I heard that you don't plan on adding 3DS games and while that sucks an idea came up in my head I was wondering if you could stream it by the Cloud and while we're at it could you make an alpha for a 3ds Core and we can test how it runs,

Btw do you think you can add local or online multiplayer on MelonDS

Thanks for reading this :D

Regarding Usage on Chromebook

Attempting to use the emulators on chromebooks, and even though online versions of the emulators work, downloading the file and using a core from index.hmtl does not work. Any help on this?

This happens when ever I start on safari

it says cannot push null or empty core path this is on safari mac and prolly says the same thing on safari mobile
then it just never loads

[Log] LS: injection -> https://snailygames.netlify.app/games/loz.html (inject.js, line 3)
[Log] LS: logging -> {"url":"https://snailygames.netlify.app/games/loz.html","tabId":3.445920203844066} (inject.js, line 22)
[Error] SyntaxError: Unexpected token '<'
	(anonymous function) (block_screen.html:1)
[Log] Got core: nestopia (base.js, line 429)
[Log] Succesfully fetched ROM from https://snailygames.netlify.app/webretro/roms/loz.nes (base.js, line 429)
[Log] WASM ready (base.js, line 429)
[Log] Starting bundle fetch (base.js, line 429)
[Log] Finished bundle fetch in 0.4 seconds, 0 errors (base.js, line 429)
[Log] Initializing with 128.02 KiB of data (base.js, line 429)
[Log] Calling main... (base.js, line 429)
[Log] stderr: [INFO] === Build ======================================= (base.js, line 429)
[Log] stderr: [INFO] Capabilities:  (base.js, line 429)
[Log] stderr: [INFO] Built: Jul 16 2022 (base.js, line 429)
[Log] stderr: [INFO] Version: 1.9.0 (base.js, line 429)
[Log] stderr: [INFO] ================================================= (base.js, line 429)
[Log] stderr: [INFO] [Input]: Found input driver: "rwebinput". (base.js, line 429)
[Log] stderr: [INFO] [Overrides]: No core-specific overrides found at "/home/web_user/retroarch/userdata/config/Nestopia/Nestopia.cfg". (base.js, line 429)
[Log] stderr: [INFO] [Overrides]: No content-dir-specific overrides found at "/home/web_user/retroarch/userdata/config/Nestopia/rom.cfg". (base.js, line 429)
[Log] stderr: [INFO] [Overrides]: No game-specific overrides found at "/home/web_user/retroarch/userdata/config/Nestopia/rom.cfg". (base.js, line 429)
[Log] stderr: [INFO] [Environ]: GET_CORE_OPTIONS_VERSION. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: SET_CONTROLLER_INFO. (base.js, line 429)
[Log] stderr: [INFO] [Remaps]: Remap directory: "/home/web_user/retroarch/userdata/config/remaps". (base.js, line 429)
[Log] stderr: [INFO] [Overrides]: Redirecting save file to "/home/web_user/retroarch/userdata/saves/rom.srm". (base.js, line 429)
[Log] stderr: [INFO] [Overrides]: Redirecting save state to "/home/web_user/retroarch/userdata/states/rom.state". (base.js, line 429)
[Log] stderr: [INFO] [Environ]: GET_LOG_INTERFACE. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: PERFORMANCE_LEVEL: 6. (base.js, line 429)
[Log] stderr: [INFO] [CONTENT LOAD]: Loading content file: /rom/rom.nes. (base.js, line 429)
[Log] stderr: [INFO] Did not find a valid content patch. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: SET_INPUT_DESCRIPTORS: (base.js, line 429)
[Log] stderr: [INFO] [Environ]: SYSTEM_DIRECTORY: "/home/web_user/retroarch/userdata/system". (base.js, line 429)
[Log] stderr: [libretro INFO] Custom palette path: /home/web_user/retroarch/userdata/system/custom.pal (base.js, line 429)
[Log] stderr: [libretro INFO] custom.pal not found in system directory. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: SET_PIXEL_FORMAT: XRGB8888. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: GET_SAVE_DIRECTORY. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: SET_GEOMETRY: 256x224, aspect: 1.306. (base.js, line 429)
[Log] stderr: [INFO] [Environ]: SET_GEOMETRY. (base.js, line 429)
[Log] stderr: [libretro INFO] [Nestopia]: Machine is NTSC. (base.js, line 429)
[Log] stderr: [INFO] [SRAM]: Skipping SRAM load.. (base.js, line 429)
[Log] stderr: [INFO] Version of libretro API: 1 (base.js, line 429)
[Log] stderr: [INFO] Compiled against API: 1 (base.js, line 429)
[Log] stderr: [INFO] [Cheats]: Load game-specific cheatfile: /home/web_user/retroarch/userdata/cheats/Nestopia/rom.cht (base.js, line 429)
[Log] stderr: [INFO] [Audio]: Set audio input rate to: 48000.00 Hz. (base.js, line 429)
[Log] stderr: [INFO] [Video]: Video @ 879x672 (base.js, line 429)
[Log] stderr: [INFO] [EGL] Falling back to eglGetDisplay (base.js, line 429)
[Log] stderr: [INFO] [EGL]: EGL version: 1.4 (base.js, line 429)
[Log] stderr: [INFO] [EGL]: Current context: 0xf234. (base.js, line 429)
[Log] stderr: [INFO] [EMSCRIPTEN/EGL]: Dimensions: 800x555 (base.js, line 429)
[Log] stderr: [INFO] [GL]: Found GL context: egl_emscripten (base.js, line 429)
[Log] stderr: [INFO] [GL]: Detecting screen resolution 800x555. (base.js, line 429)
[Log] stderr: [INFO] [GL]: Vendor: WebKit, Renderer: WebKit WebGL. (base.js, line 429)
[Log] stderr: [INFO] [GL]: Version: OpenGL ES 2.0 (WebGL 1.0). (base.js, line 429)
[Log] stderr: [WARN] [GL]: GLES implementation does not have BGRA8888 extension. (base.js, line 429)
[Log] stderr: [GL]: 32-bit path will require conversion. (base.js, line 429)
[Log] stderr: [INFO] [GL]: Using resolution 800x555 (base.js, line 429)
[Log] stderr: [INFO] [GL]: Default shader backend found: glsl. (base.js, line 429)
[Log] stderr: [INFO] [Shader driver]: Using GLSL shader backend. (base.js, line 429)
[Log] stderr: [WARN] [GL]: Stock GLSL shaders will be used. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Found GLSL vertex shader. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Found GLSL fragment shader. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Linking GLSL program. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Found GLSL vertex shader. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Found GLSL fragment shader. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Linking GLSL program. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Found GLSL vertex shader. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Found GLSL fragment shader. (base.js, line 429)
[Log] stderr: [INFO] [GLSL]: Linking GLSL program. (base.js, line 429)
[Log] stderr: [INFO] [GL]: Using 4 textures. (base.js, line 429)
[Log] stderr: [INFO] [GL]: Loaded 1 program(s). (base.js, line 429)
[Log] stderr: [INFO] [Joypad]: Found joypad driver: "rwebpad". (base.js, line 429)
[Log] stderr: [INFO] [Font]: Using font rendering backend: bitmap. (base.js, line 429)
[Log] stderr: [INFO] [Video]: Found display server: null (base.js, line 429)
[Log] stderr: [INFO] [Display]: Found display driver: "gl". (base.js, line 429)
[Log] stderr: [INFO] [Font]: Using font rendering backend: stb. (base.js, line 429, x3)
[Log] stderr: [INFO] [Font]: Using font rendering backend: stb. (base.js, line 429, x6)
[Log] stderr: [INFO] [MIDI]: Input disabled. (base.js, line 429)
[Log] stderr: [INFO] [MIDI]: Output disabled. (base.js, line 429)
[Log] stderr: [INFO] [MIDI]: Initialized "null" driver. (base.js, line 429)
[Log] stderr: [INFO] [Playlist]: Loading history file: [/home/web_user/retroarch/userdata/content_history.lpl]. (base.js, line 429)
[Log] stderr: [INFO] [Playlist]: Loading history file: [/home/web_user/retroarch/userdata/content_music_history.lpl]. (base.js, line 429)
[Log] stderr: [INFO] [Playlist]: Loading favorites file: [/home/web_user/retroarch/userdata/content_favorites.lpl]. (base.js, line 429)
[Log] stderr: [INFO] [GL]: VSync => ON (base.js, line 429)
[Log] stderr: [ERROR] cannot push NULL or empty core path into the playlist. (base.js, line 429)
[Log] Main completed... (base.js, line 429)

Having problems with my PS1 games.

I downloaded a rom for "Final Fantasy 7" from the site "CDromance" and whenever I upload the directory to webretro, it does not load, however my tekken 2 from for ps1 does load which has a larger file size does load. CDRomance is pretty reliable so it does not seem to be the issue.

PS1 Support

I was wondering if you could add ps1 support to webretro? Really wanting to play Metal Gear Solid

Not really an issue but a question.

So my school has recently blocked all access to github pages, which means I won't be able to use any sort of github related item. I was wondering if you could download the entire webpage and view it offline? If someone knows how, please tell me. Thank you

IS IT POSSIBLE TO ADD X CORE?

BEFORE MAKING AN ISSUE, READ THIS

Arcade cores (planned for v6.6)

  • MAME 2003 Plus (Arcade)
  • FB Neo (Arcade)

PC cores (planned for v6.6)

  • DOSBox and/or DOSBox Pure (MS-DOS)
  • PUAE or FS-UAE (Amiga)
  • Caprice32 (Amstrad CPC)
  • Hatari (Atari ST/TT)
  • VICE x64 (Commodore 64)
  • BK (Electronika BK)
  • fMSX (MSX)
  • Beetle PCE-Fast (PC Engine)
  • Beetle SuperGrafx (PC Engine SuperGrafx)
  • QUASI88 (PC-8000/8800)
  • NP2kai (PC-98) (May not be possible due to #142)
  • Beetle PCFX (PC-FX)
  • X Millennium (Sharp X1)
  • px68k (Sharp X68000) (May not be possible due to #150 and #151)
  • EightyOne (Sinclair ZX81)
  • Fuse (Sinclair ZX Spectrum)
  • ep128emu (Enterprise 64/128)
  • Theodore (Thomson MO/TO)

High-end cores (don't count on these being implemented)

  • Citra (Nintendo 3DS)
  • Dolphin (Nintendo GC/Wii)
  • Play! (PlayStation 2)
  • PPSSPP (PSP)
  • Flycast (Sega Dreamcast)

Non-Emulation cores are not currently planned.


For more information, refer to my libretro emscripten support tracker.

Suggestion

i've been a great fan of this emulator but theres one thing that makes me want to kill myself
i can't play pokemon nds games because they're too laggy
can you add bigger file support
the game still works but at like 10 frames
thanks
pokemon is life

can you update the build.sh?make it support mobile?

I test your more system-cores,they only run in Microsoft Edge/Chromium

can not run in mobile (ios)!

in the js ,here nothing retrun.

  • WebAssembly.instantiate(binary, info)

    function instantiateArrayBuffer(receiver) {
        return getBinaryPromise().then(function (binary) {
            return WebAssembly.instantiate(binary, info)
        }).then(receiver, function (reason) {
            err("failed to asynchronously prepare wasm: " + reason);
            abort(reason)
        })
    }

mobile support?

would it be possible to detect if you're on mobile and then have some controls overlayed?

reconfiguration

Hi! Is there any way to change configuration after starting emulation? I need to change gamepad configuration. I know that this can be done through the menu, but can it be done through javascript?

Embedding

I'm trying to embed it, and I can't figure it out. if you can help me because it just shows the 404 error as it can't find the file.

A couple questions

  1. Is it possible to make this as a chrome extension?
  2. How do you remove/add cores

some problems

I test the "mednafen_psx_hw_libretro" not well

can you can bulid the "pcsx_rearmed_libretro" ?

Uploading 录像recorder (3).webm…

lost method.
Module._cmd not have Module["cwrap"] to call run.
Module.cwrap('cmd_cheat_get_code', '', [])();

//such as
// Module["cwrap"] = cwrap;
function cwrap(ident, returnType, argTypes, opts) {
        return function () {
          return ccall(ident, returnType, argTypes, arguments, opts)
        }
      }

      function ccall(ident, returnType, argTypes, args, opts) {
        var toC = {
          "string": function (str) {
            var ret = 0;
            if (str !== null && str !== undefined && str !== 0) {
              var len = (str.length << 2) + 1;
              ret = stackAlloc(len);
              stringToUTF8(str, ret, len)
            }
            return ret
          },
          "array": function (arr) {
            var ret = stackAlloc(arr.length);
            writeArrayToMemory(arr, ret);
            return ret
          }
        };

        function convertReturnValue(ret) {
          if (returnType === "string") return UTF8ToString(ret);
          if (returnType === "boolean") return Boolean(ret);
          return ret
        }
        var func = getCFunc(ident);
        var cArgs = [];
        var stack = 0;
        assert(returnType !== "array", 'Return type should not be "array".');
        if (args) {
          for (var i = 0; i < args.length; i++) {
            var converter = toC[argTypes[i]];
            if (converter) {
              if (stack === 0) stack = stackSave();
              cArgs[i] = converter(args[i])
            } else {
              cArgs[i] = args[i]
            }
          }
        }
        var ret = func.apply(null, cArgs);
        ret = convertReturnValue(ret);
        if (stack !== 0) stackRestore(stack);
        return ret
      }

Mupen64Plus-Next stack overflow errors

Not sure if this can be solved/answered here, but: Paper Mario crashes (the emulator, not the game itself) due to a "null function or function signature mismatch" . Based on a bit of testing, the time at which it does this seems to vary based on settings, but is consistently no later than the beginning of the very first intro cutscene. Is there any change that can be made to settings or the core to fix this? Failing that, is there some way to compile another core (i.e. parallel-n64) and drop it in here to see if it works, or is there support that needs to be manually added to each core? (I really don't know much about libretro or emscripten for that matter)

Headless mode

Random request, I'm currently working on a Discord bot to play emulated games in a co-op fashion. I'm integrated WasmBoy, and currently digging through the source code here. Any pointers on how to get thise running in a headless mode, i.e., as a Node.js service?

touch pointer problem

Please allow me to express better in my native language!

花费我了一天,仍未解决

下面代码是原来的鼠标"mousedown,mouseup,mousemove"

mednafen_psx_hw_libretro.js

    function fillMouseEventData(eventStruct, e, target) {
        var idx = eventStruct >> 2;
        HEAP32[idx + 0] = e.screenX;
        HEAP32[idx + 1] = e.screenY;
        HEAP32[idx + 2] = e.clientX;
        HEAP32[idx + 3] = e.clientY;
        HEAP32[idx + 4] = e.ctrlKey;
        HEAP32[idx + 5] = e.shiftKey;
        HEAP32[idx + 6] = e.altKey;
        HEAP32[idx + 7] = e.metaKey;
        HEAP16[idx * 2 + 16] = e.button;
        HEAP16[idx * 2 + 17] = e.buttons;
        HEAP32[idx + 9] = e["movementX"];
        HEAP32[idx + 10] = e["movementY"];
        var rect = getBoundingClientRect(target);
        HEAP32[idx + 11] = e.clientX - rect.left;
        HEAP32[idx + 12] = e.clientY - rect.top
    }

由于我使用了

  • <canvas id="canvas" width="960" height="720"></canvas>
  • widthNative:960
  • heightNative:720
  • getBoundingClientRect:{width:414,height:896}
  • 因为"canvas "越大越清晰!

导致问题

因为大小不一致,会导致鼠标指针异常!所以使用以下代码修复.

  • 但是移动端出现问题
    • F12
    • edge浏览器,
    • 移动端模式
    • 指针异常,不论我如何调整总有差异,不准确.
    function fillMouseEventData(eventStruct, e, target) {
        var idx = eventStruct >> 2;
        HEAP32[idx + 0] = e.screenX;
        HEAP32[idx + 1] = e.screenY;
        HEAP32[idx + 2] = e.clientX;
        HEAP32[idx + 3] = e.clientY;
        HEAP32[idx + 4] = e.ctrlKey;
        HEAP32[idx + 5] = e.shiftKey;
        HEAP32[idx + 6] = e.altKey;
        HEAP32[idx + 7] = e.metaKey;
        HEAP16[idx * 2 + 16] = e.button;
        HEAP16[idx * 2 + 17] = e.buttons;
        HEAP32[idx + 9] = e["movementX"];
        HEAP32[idx + 10] = e["movementY"];
        var rect = getBoundingClientRect(target);
        if(target.widthNative!=rect.width){
            let sacl = target.widthNative/rect.width;
            HEAP32[idx + 11] = Math.ceil((e.clientX - rect.left)*sacl);
            HEAP32[idx + 12] = Math.ceil((e.clientY - rect.top)*sacl);
        }
        HEAP32[idx + 11] = e.clientX - rect.left;
        HEAP32[idx + 12] = e.clientY - rect.top
    }

Ps1 issues on a chromebook

Whenever I upload the rom for Metal Gear Solid on my Chromebook, it crashes and I have to power refresh. Sometimes it gets to the "Select Master ROM screen" before crashing, and when I select a .cue or .m3u file it crashes. Can my Chromebook just not run games made on the Playstation, or is there a fix for this? I really want to emulate the Playstation on my Chromebook.

fast forward does not work in v6.5

Ever since 6.4v, when I play fast forward on mGBA (haven't tested it out on other systems), it won't, well, go fast. It plays at normal speed with, or without fast forward toggled. This may be a problem on my end.

embedding question

you know how in the embed example html file it has a small embed? how do i make it just the game and nothing else?

get save files and/or savestates from JS

I'm interested in launching a rom and when the user navigates back to the main page, I want to send either a save file or savestate back with them to do further processing. Is this possible or something that can be added without much difficulty?

broken shaders

It seems the commit 65ab91cfc5db110d3236ac8b6148e7e935b46d18 (link) broke some shaders for the n64.

I tried running mario kart 64, It seemed to run fine until it had to render the level screen and it seemed that the entire UI just crashed, nothing would render. I backtracked to see what broke it and it was in this commit. It worked in the commit before this (last working commit - 526f18b06058a68b405488549773fe47ebf4af61 (link)

I tested using githack: https://raw.githack.com/BinBashBanana/webretro/526f18b06058a68b405488549773fe47ebf4af61/index.html?core=mupen64plus_next

I ran some testing - webgl2 did not break this

PSP core

Could it be possible to have the PlayStation portable core in the future?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.