rodrigo
September 14
New online emulator RAZE
Hi!
I would like to share my latest projects, a ZX Spectrum emulator for WebAssembly, that is it runs inside your web browser, at near native speed.
Here is the live version: https://rodrigorc.github.io/raze/
And here is the documentation and source code (100% written in Rust, Open Source, MIT license): https://github.com/rodrigorc/raze
Any suggestions for improvements, bugs reports or comments are welcome, just write down here or open an issue in the github page.
Thanks!
Due to unusually high levels of website traffic you will be presenting with regular Cloudflare checks for the time being.
New online emulator RAZE (100% written in Rust, Open Source, MIT license)
New online emulator RAZE (100% written in Rust, Open Source, MIT license)
As seen on: https://worldofspectrum.org/forums/disc ... lator-raze
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
People with giant brains will be momentarily along to suggest important timing options and things but for me, any emulator needs a pop-out keyboard map so I can see where BEEP and FLASH are.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
I tried to type
Code: Select all
BEEP 1,0
Maybe there's some keyboard trickery I couldn't find?
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
- Ast A. Moore
- Rick Dangerous
- Posts: 2643
- Joined: Mon Nov 13, 2017 3:16 pm
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Yep. Timing-wise, it’s very inaccurate. Don’t have time to do any extensive testing at the moment, though.
Audio lag is very small, though. Which is excellent!
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Hi, developer of RAZE here, greetings!
Unless you are on Apple... See, I'm using the web browser audio stream to get high resolution timer events. And to get the timing rights I have to use non-standard audio frequencies (20833 for 48k, 21112 for 128k). No big deal, the browser or the OS will do the resampling, unless you are on an Apple device, then it will not work, I have to go up to 22050 Hz. That is a speed up of 6% for the 48k. I'm sure it can be fixed, but I have limited access to Apple devices, and they are... weird, from a WebAssembly point of view.
Well, I don't think it is so inaccurate, although I admit that perfect timing was never a priority. Memory contention timing is only an approximation, but CPU timing should be mostly accurate, although I probably have some bugs here and there. If you have some code with gross miss-timing I'd like to have a look.Ast A. Moore wrote: ↑Wed Sep 15, 2021 10:41 pm Yep. Timing-wise, it’s very inaccurate. Don’t have time to do any extensive testing at the moment, though.
Unless you are on Apple... See, I'm using the web browser audio stream to get high resolution timer events. And to get the timing rights I have to use non-standard audio frequencies (20833 for 48k, 21112 for 128k). No big deal, the browser or the OS will do the resampling, unless you are on an Apple device, then it will not work, I have to go up to 22050 Hz. That is a speed up of 6% for the 48k. I'm sure it can be fixed, but I have limited access to Apple devices, and they are... weird, from a WebAssembly point of view.
You are right. Ctrl-N will not work . I admit I didn't test the 48K BASIC too much. I'll map "Alt" to "SymbolShift", too, as a workaround. Later, I'll take your advice and add an online keyboard.dfzx wrote: ↑Wed Sep 15, 2021 1:05 pm I tried to typebut since Ctrl-N is caught by Firefox (for new window) I couldn't get the comma. So I didn't get very far.Code: Select all
BEEP 1,0
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Greetings yourself! Good to have you onboard, you clearly have excellent and unusual skills. Good to see you're not taking feedback as criticism, we can be a tough crowd.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
- Ast A. Moore
- Rick Dangerous
- Posts: 2643
- Joined: Mon Nov 13, 2017 3:16 pm
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Yes, I tested your emulator on my MacBook Pro.
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
That is weird... I've just borrowed an iPad and the audio works perfectly even disabling the Safari specific hacks. Maybe previously I was using a very old iPad or something, I don't know, but the speed here should be correct.
Would you help me debug this issue? Can you tell me your Safari version? Also, can you open a Safari console and type "window.AudioContext" and then "window.webkitAudioContext" and copy the output here?
Thank you!
- Ast A. Moore
- Rick Dangerous
- Posts: 2643
- Joined: Mon Nov 13, 2017 3:16 pm
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Sure (see below).
Though, my issue isn’t so much with the sound as it is with the screen update timing. (Could be just the floating bus not detected correctly, though.)
Safari 13.1.2 (14609.3.5.1.5)
macOS 10.14.6
Though, my issue isn’t so much with the sound as it is with the screen update timing. (Could be just the floating bus not detected correctly, though.)
Safari 13.1.2 (14609.3.5.1.5)
macOS 10.14.6
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Ah, floating bus is tricky to get right. I tested a few games that depend on it (Terra Cresta comes to mind) and I managed to get them to run. But if it is an emulator issue maybe you could share the program so that I could test and debug the issue?Ast A. Moore wrote: ↑Thu Sep 16, 2021 9:32 pm ...my issue isn’t so much with the sound as it is with the screen update timing. (Could be just the floating bus not detected correctly, though.)
Oh, that is interesting! although I admit that I know nothing about Apple release scheduling. According to MDN proper AudioContext is supported in Safari 14.1 or later. And according to Wikipedia. "Safari 14 was released as a standalone update to macOS Catalina [10.15] and Mojave [10.14] users on September 16, 2020", just saying...Safari 13.1.2 (14609.3.5.1.5)
macOS 10.14.6
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Thanks for your emulator. Seems really fast on my slow PCs.
I leave here two sketches that I made as a suggestion for touch screen keyboards
https://i.postimg.cc/sD847TRL/gui3.png
https://i.postimg.cc/Prc0JbVX/gui2.png
I leave here two sketches that I made as a suggestion for touch screen keyboards
https://i.postimg.cc/sD847TRL/gui3.png
https://i.postimg.cc/Prc0JbVX/gui2.png
- Ast A. Moore
- Rick Dangerous
- Posts: 2643
- Joined: Mon Nov 13, 2017 3:16 pm
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Sure. Grab my Yankee (link in my sig).
I know. I rolled back to v13, because v14 force-switched my laptop to use the discrete graphics chip.
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
-
- Manic Miner
- Posts: 401
- Joined: Fri Jan 03, 2020 10:00 am
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Waiting for TR-DOS and ATM-Turbo My dream is to run NedoOS online
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Oh wow! I was just writing to request an onscreen d pad as a feature. when I realised you already have it! But it only appears on the page when I'm on android. Not on a PC. Which makes sense.
I would like the option to have the d pad and fire either side of the screen when in landscape mode. I've wanted something like this for a while and holding it horizontal is how I imagined it. But it is very usable in game boy style vertical mode. with room for the keyboard this way.
Perhaps this is just me being daft but it took me a minute to work out that the cursor keys & lctrl bit was actually the control to select the joystick mode. But I got there in the end.
Great job, Thanks
I would like the option to have the d pad and fire either side of the screen when in landscape mode. I've wanted something like this for a while and holding it horizontal is how I imagined it. But it is very usable in game boy style vertical mode. with room for the keyboard this way.
Perhaps this is just me being daft but it took me a minute to work out that the cursor keys & lctrl bit was actually the control to select the joystick mode. But I got there in the end.
Great job, Thanks
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Yes, it is not very discoverable, developed as an afterthought, actually. I have plans to make D-pad overlay when in full screen, let's see how it goes...
Many people say that this control is not very intuitive. They are probably right, but I guess you get used to it.... it took me a minute to work out that the cursor keys & lctrl bit was actually the control to select the joystick mode. But I got there in the end.
Thank you, I'm happy you liked it.Great job, Thanks
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Oh! Nice game! And indeed it flickers terribly. I have also read you explanation of the floating bus... very helpful, but basically this is what I had implemented, only that I cut a lot of corners to make it fast. Except that... oh, my!!! I'm using the pixel row number to compute the memory of the attribute byte. It should be divided by 8, of course.
I have fixed the bug and pushed the new version. Now the Yankee is flicker free, as it should be.
Now, the Yankee TZX does not load, because you have some weird blocks... but don't worry, it will, eventually.
Thank you so much for helping me with this.
- Ast A. Moore
- Rick Dangerous
- Posts: 2643
- Joined: Mon Nov 13, 2017 3:16 pm
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Awesome! I just checked the new version and it works brilliantly! As far as I’m concerned, this is the best ZX Spectrum emulator I’ve seen. Most don’t produce any sound on macOS.
Ah, that’s probably because of the Generalized Data Block (ID 19) I use.
You’re most welcome!
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Suggestion: How about support for USB-Joysticks? Would be nice.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
This is great!
An idea: I don't want to appear greedy ... but if it'd be possible to a 'load tap/snapshot' from a URL, I'd appreciate that.
And - I'm not sure if this is possible - it'd be cool if I could embed the file load a tap/snap into an extended URL query/similar so I could potentially have a URL like: razeemulator.com/load?ht tp://filehoast.com/myfile.tap
... if you see what I mean.
(It'd mean it'd be able to send spectrum illiterate friends a URL and have them straight into testing something I'd written).
An idea: I don't want to appear greedy ... but if it'd be possible to a 'load tap/snapshot' from a URL, I'd appreciate that.
And - I'm not sure if this is possible - it'd be cool if I could embed the file load a tap/snap into an extended URL query/similar so I could potentially have a URL like: razeemulator.com/load?ht tp://filehoast.com/myfile.tap
... if you see what I mean.
(It'd mean it'd be able to send spectrum illiterate friends a URL and have them straight into testing something I'd written).
CLEAR 23855
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
"Qaop/JS – ZX Spectrum emulator" seems to support loading via URL: http://torinak.com/qaop/infouglifruit wrote: ↑Sat Nov 06, 2021 9:58 pm This is great!
An idea: I don't want to appear greedy ... but if it'd be possible to a 'load tap/snapshot' from a URL, I'd appreciate that.
And - I'm not sure if this is possible - it'd be cool if I could embed the file load a tap/snap into an extended URL query/similar so I could potentially have a URL like: razeemulator.com/load?ht tp://filehoast.com/myfile.tap
... if you see what I mean.
(It'd mean it'd be able to send spectrum illiterate friends a URL and have them straight into testing something I'd written).
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
It already have a somewhat experimental support for the JS gamepad API. It works for my gamepad, but YMMV, particularly because every gamepad/joystick is different, and currently there is no way to configure anything.
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
It already has this functionality, there is a note somewhere in the documentation (https://github.com/rodrigorc/raze#what-can-it-do).
Basically, for a tape you link :
https://rodrigorc.github.io/raze/?tape= ... myfile.tap
Or for a snapshot:
https://rodrigorc.github.io/raze/?snaps ... myfile.z80
If you link a tape it will load in 128K mode by default, you can force 48K (snapshots do not need that option):
https://rodrigorc.github.io/raze/?tape= ... .tap&48k=Y
HTH
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Amazing. Thank you very much.
CLEAR 23855
Re: New online emulator RAZE (100% written in Rust, Open Source, MIT license)
Dear @rodrigo,
can your Emulator (written in Rust) working in Offline-Mode? Or can you build a Windows or MacOS-Executable from it?
Are there special needs to run RAZE as WebAssembly in Browsers or should every modern browser (Google Chrome, Microsoft Edge, Mozilla Firefox, Chromium) run it?
I ask because I´m in search for a crossplatform programming language which should feature:
Are you building it under MacOS?
Regards
Luzie
can your Emulator (written in Rust) working in Offline-Mode? Or can you build a Windows or MacOS-Executable from it?
Are there special needs to run RAZE as WebAssembly in Browsers or should every modern browser (Google Chrome, Microsoft Edge, Mozilla Firefox, Chromium) run it?
I ask because I´m in search for a crossplatform programming language which should feature:
- TUI or GUI with Mouse-Support
- Full Portability
- Run Offline in Browsers
- Has access to files on local harddisk (to call sub-programs or change bits in config-files) - This maybe a problem with all things "running in a browser/Browser sandbox"?!
Code: Select all
error: failed to run custom build command for `openssl-sys v0.9.72`
Regards
Luzie
Last edited by Luzie on Tue Apr 19, 2022 5:53 pm, edited 1 time in total.