-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to add more systems #6
Comments
That core requires waaaay too much power for the browser to run, sorry. For more cores, see #5 |
@BinBashBanana Do you think It would be possible to reverse engineer the wasm and asm.js files found in this emulator. This could solve all sorts of UI problems (and add support for nintendo DS) |
@BinBashBanana I just noticed, do you think there would be a performance difference if we compiled to asmjs instead of wasm. Looking at emulatorjs they have no wasm to n64, only asmjs |
There would most likely be a negative difference, wasm is usually faster than asm.js. |
@BinBashBanana Ahh, I see. Would you like to try to help me reverse engineer emulatorjs? I managed to hijack the wasm data before it is run and after it is decoded and I was able to somewhat decode the ds wasm. It's really messy (and I'm a complete noob at C so it's complete chaos.) as suggested by here we could start to try to wrap the wasm, rather than decoding it. What do you think? this zip file contains
The variable that stores this info is set to null right after it is used. To view logs from retroarch, add the line The module element used to run the wasm
to find this in the emulatorjs file, just search I haven't managed to decode any Please let me know if you would like to help reverse it or if you would like me to keep you updated on my findings Edit: I used another wasm decompiler and the results were much more readable. Zip uploaded below |
I tried looking through the decompiled files, I couldn't find anything of use. I also tried using wasmdec, but I had the same results. (Here is the file anyway) I think it is probably a waste of time trying to decompile the cores, but the |
@BinBashBanana Do you think we could try to translate ppsspp? It looks like it has a libretro build target |
Possibly... Again there is the GLES problem, and I'm not even sure if the browser can handle psp emulation. |
I think some computers could handle it, as my chromebook could run windows vista in a virtual machine in the browser (https://copy.sh/v86/). And there is one current (typescript) psp emulator. I think it would be really cool to see it run but yeah, the GLES problem is kinda tricky. |
Ok, I will look into it. Also I didn't know copy.sh had windows vista, that's cool |
Thank you for looking into it. Windows vista works issue - copy/v86#404 |
I think this issue is better than the other one, reopening |
This will (probably) help: |
Those look cool, I will look into those too, though I'm not completely sure they can help. |
@BinBashBanana output: n64-asmjs.zip |
I built a more stable version that includes encryption and decryption. You can edit the files and encrypt a 7z file with the edited files and then place it in place of the old core |
I found this. it seems to run much better than this one. Do you think it would help? There are a lot less graphical problems as far as I can tell. |
@ethanaobrien v6.5 has finally released! I don't think we should continue any efforts to decompile/reverse-engineer anything, future discussion should happen in #9. Can I close this issue now? |
yeah I gave up on reverse engineering a long time ago, I started working on my own cores, “beta” cores, and they currently use about 1/10th of the cpu of the original emulatorjs cores. One question before you close this I saw you increased the stack size of the emscripten compiler, does that have any affect on any systems other than Nintendo 64? Did you use the larger stack size to compile all the systems? I’m wondering if it has a better (or worse) affect on the system. Also, where’d you change this setting/ what flag/edit did you use to compile it, could you send me the link, I’d love to take a look at it But so you rewrote the entire renderer? That’s awesome! Is all the code in this repository? I’d love to look at it and see if I could use it to improve the beta cores (or make a beta core for Nintendo 64.) |
Stack memory is only increased for Mupen64Plus-Next (see here) because it needs to be (see #4). Increasing it shouldn't have any effect on performance for any core. That option goes through into the makefile and adds this to LDFLAGS: And no, I didn't rewrite the renderer lol. I just had to change some things in GLideN64 to get it to work on emscripten GLES3, and also patch emscripten's webgl library (both pretty simple). I did have to do a lot more work for Beetle PSX though. You can see how to apply the patches I made here: Building from source |
Ok, thanks for the info. I’m going to look into all this, thanks! I’ll close this now |
I took a look at the building from source readme, so basically you just compile normally but apply the patches first? you’ve put in a crazy amount of work for this project, thank you! |
That is correct. Thank you too |
Thank you so much for your help! I was able to compile n64 to a beta core! |
Nice! |
Hey @BinBashBanana quick question, have you experienced the bug mentioned here- https://github.com/ethanaobrien/emulatorjs/discussions/305 the Nintendo 64 load state seems to be broken, is this specifically me or have you experienced this too? |
@ethanaobrien N64 save states are quite large, so you could be running into storage problems if you're using localStorage. I used to use localStorage but I switched over to indexedDB which has more capacity (5 MB --> 50+ MB) |
Actually it doesn’t even work when you download and re-upload the state. This is probably just me then, thank you! (and yeah I agree, indexeddb is much better) |
Hey @BinBashBanana i have some advice. I saw in one of the most recently opened issues that a user is complaining because of the time it takes to save the state. I have a solution for that and looked in your patch file and I don’t think I saw it in there. Assuming you write the save files to the disk (I actually read the save states straight from ram) retroarch by default crazily limits the read/save chunk speed. This doesn’t affect us since everything is kept in memory. here is a link to the line I changed that drastically changed the save/load state speed As I said, I just read my save states from memory and I’d be happy to help you implement that if you’d like. I’d recommend it, it’s much faster (but compression is unavailable, but when you actually get used to it I think it’d be better to have no compression then have a 1 minute to save state) If there’s anything you need help with I’d be happy to help you! (I would’ve commented in that issue, but I’ve had a really bad relationship with that user) |
Thank you, I will increase the write chunk size in the next update, but I won't be getting rid of compression. I'll try some other optimizations such as autovectorization which should make it at least a little bit faster. |
Sounds good! If you have any other questions or need help with something I'd be glad to try to help |
Hey @BinBashBanana Theres something I found that might be interesting to you (and I need help on) I was digging though ppsspps code and found out that there is a libretro folder with a make file like every other project. I tried to compile for emscripten (it failed) but I made a few changes (see the patch file). Theyre very loose changes (I was just trying to get the linker file built) and I managed to do it! (I also uploaded that file below), but when trying to link with retroarch I get several type conflict errors. I've seen this before on cores you managed to compile and was wondering if you could get this core to build too! Thanks for all the work you've done! Please note - when compiling ppsspp to the .bc linker file the command would look something like this
for some reason it doesnt up the bc file name in there (As you can see, there are 2 spaces). To get around this I just coppied the command and changed it and then ran the changed code
Note - the ppsspp linker file can take up to 1 hour to build I think psp emulation may be possible (with enough memory), but I may also be entirely wrong. Can you look at this? Have you looked at this before? Thanks for your help! zip file with both the linker file and the patch file: ppsspp.zip |
@BinBashBanana Here is the new zip file with the updated linker file and patch file: ppsspp.zip Also, it looks like it actually compiles with retroarch with this new patch file, it just calls abort when you try to start it, maybe you could trace this down. |
Looks good, I'll see if I can do anything. |
Is it possible that we could add more systems such as the wii / gamecube (dolphin emulator)
The text was updated successfully, but these errors were encountered: