[WebAssembly] Better browser support#100
Conversation
There was a problem hiding this comment.
If someone could take a look at the sdcard_file declarations/imports ... To be honest, I am slightly unsure about the importing (I really should refresh my C knowledge). Reason I am doing it that i got "asm-ld: error: duplicate symbol: sdcard_file" error when compiling with latest WebAssembly llvm.
There was a problem hiding this comment.
Your patch is correct. externed variables should go in the headers.
|
I have tested this on firefox using cmake and emscripten 1.38.29 (I used conan package manager). |
thank you for testing this. |
Webkit, Safari, Chrome on Android and Opera supported now. Removed threading as it is not supported currently on browsers other than Chrome Desktop. Changed Main emulator loop to yield control back to the browser after a complete frame. Setting emscripten main loop fps parameter to 0, as this is highly recommended in emscripten documentation. Lastly, reworked imports for *sdcard_file, due to a compile error using the llvm webassembly backend.
|
I was talking about input lag. |
|
I don't know how, but the emulator at http://www.frank-buss.de/x16/x16emu.html has working copy/paste on firefox. |
|
@Frank-Buss modified getClipboard() function to read the text from the textarea and pass it to the emulator. the original code reads from navigator.clipboard.readText() and that call unfortunately doesn't work on Firefox. |
|
I think an additional textarea would be nice. Not only as a workaround for the clipboard functionality, but if the focus works properly, someone could even develop longer BASIC programs in the textarea and when done, can copy it elsewhere to save it. I guess currently there is no other way to get something out of the emulator, and it is lost when the browser is closed? |
|
I'm working on a simple BASIC web IDE at the moment, the concept being the page is split 50/50 with a basic editor on the left and the emulator on the right. Rather than just pasting in text, you can use the editor and hit "Run". You could add on the ability to save to local disk, or whatever you like using JS. If people would find this useful I can add the basics into this repo, rather than starting my own? My plan is to include some compilers in the long run, allowing you to code in C, ASM or BASIC and have it run instantly on-page using the emulator. (if anyone wants to help with this, I'm just trying to get to grips with the emscr virtual file system) |
|
Excellent, thanks! |
|
BTW, I've fixed the focus / keypress issue and added an extra textinput for entering basic. I've also got it to auto detect the key map from the browser locale. Plus a few other tweaks. I started with the code from this pull request as it already fixed a lot of issues. I'll submit a new pull request this evening. |
|
That’s excellent! I couldn’t figure out the keyboard/ focus issue and detectIng the keyboard Layout is great ! |
Webkit, Safari, Chrome on Android and Opera supported now. Removed threading as it is not supported currently on browsers other than Chrome Desktop. Changed Main emulator loop to yield control back to the browser after a complete frame. Setting emscripten main loop fps parameter to 0, as this is highly recommended in emscripten documentation. Lastly, reworked imports for *sdcard_file, due to a compile error using the llvm webassembly backend.
* [CI/CD] Build README.pdf * CI fixes * CI fixes * CI enhancements * no need to build the ROM anymore * fix paths * include x16-docs PDFs * some additional doc fixes * add dependency tree for workflows * CI fix * Reorganize CI dependency tree * Reorganize CI dependency tree
Webkit, Safari, Chrome on Android and Opera supported now.
Removed threading as it is not supported currently on browsers other than Chrome Desktop.
Changed Main emulator loop to yield control back to the browser after a complete frame.
Setting emscripten main loop fps parameter to 0, as this is highly recommended in emscripten documentation.
Lastly, reworked imports for *sdcard_file, due to a compile error using the llvm webassembly backend.