ZXBaremulator 3.2

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
zx81
Dizzy
Posts: 90
Joined: Sat Feb 17, 2018 9:33 pm

ZXBaremulator 3.2

Post by zx81 »

Hi all,

I've released ZXBaremulator v3.2, at last!.

The images can be downloaded from my project web page: ZXBaremulator

Best regards
José Luis
2 x

User avatar
Pegaz
Manic Miner
Posts: 493
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

First of all, thanks for this new version, it was worth the wait.
I'm very glad, that there's a possibility to connect Pi to a real spectrum keyboard via GPIO pins.
Finally, I won't have to rely on the Arduino as a converter, which I have had no success with it.
I tried the emulator today briefly and am very happy with how everything works.
btw, I noticed just one minor audio issue.
Occasionally, after inserting a tape file with space, and when I return to the emulator, a strange, buzzing sound is heard for a few seconds.
Sometimes this happens, sometimes not, so I can't reproduce it every time.
I tested the latest allfiles.zip archive on a fat32 formated micro card on Pi 3A+.
In the config.txt file I saw audio_pwm_mode=2 line, which was not used before.
Whether it has an effect on sound through an HDMI cable or just for PCM sound on Pi Zero?
Btw, there's now one great c64 bare metal emulator similar to yours, also based on Circle and Vice emulator core.
The author managed to get HDMI sound in the Zero version as well and I wonder if there's any possibility of something like that in the Baremulator?
1 x

zx81
Dizzy
Posts: 90
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

Ho Pegaz

audio_pwm_mode=2 is only for PWM.

Is hard to say what's the reason for your sound problems, I haven't found it in any of my PIs.

I can examine BMC64, but HDMI support isn't easy in ARMv6 based cards. I can't promise anything...
1 x

reesy
Berk
Posts: 2
Joined: Tue Feb 11, 2020 11:05 am

Re: ZXBaremulator 3.2

Post by reesy »

Really impressive emulator, thanks for your hard work.

Have it running in a Spectrum+ case with GPIO keyboard - didn't initially have the extra button to switch keyboard modes, so tried to use the keyboard combo to enter the menu which worked - however I could not then exit the special key mode. Is this a bug or is there a trick to it? I assumed I just use the same combo to exit.

Just worked around it by adding a push button for now which works perfectly and has allowed me to finally enjoy the spectrum case as none of the emulators on linux support the GPIO keyboard correctly (which was most disappointing to find after building the thing... )

Need to sort our PWM sound output for my zero now and it will be perfect

Thanks again!
1 x

zx81
Dizzy
Posts: 90
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

Thanks reesy,

Yes, the key combo (Caps+Symbol+ENTER) is the same to enter in extended mode and exit to standard mode. For my testing I has been using a Spectrum +2 keyboard, but I can't test with a Spectrum+ keyboard.

Sadly, the only one method to have sound using PWM in Zero model is across the GPIOs, and the needed GPIOs are devoted to keyboard handling. The Zero model is a pain in the ass, I can't understand the loyalty to these model. A good audio stage for PWM (as in the A+/B+ models) is really complicated, and inside the Spectrum+ you can put a Raspberry 3A+ model, and get HDMI sound.

Thanks to you by your kind words about ZXBaremulator!. ;)
0 x

Firefox
Microbot
Posts: 128
Joined: Sat Apr 20, 2019 5:08 pm

Re: ZXBaremulator 3.2

Post by Firefox »

zx81 wrote:
Tue Feb 11, 2020 2:42 pm
The Zero model is a pain in the ass, I can't understand the loyalty to these model.
£4.65 :D

Well, apart from that, they're really small and sip current - they'll run for many hours off a USB charge bank. I find them really handy for logging data or adding a wifi interface to things (using the 'W' version) .

I must get into bare metal programming for the Pi. They're so handy, but the boot-up time is a pain for many uses...

Anyway, nice work on you emulator! :)
1 x

reesy
Berk
Posts: 2
Joined: Tue Feb 11, 2020 11:05 am

Re: ZXBaremulator 3.2

Post by reesy »

zx81 wrote:
Tue Feb 11, 2020 2:42 pm
Sadly, the only one method to have sound using PWM in Zero model is across the GPIOs, and the needed GPIOs are devoted to keyboard handling. The Zero model is a pain in the ass, I can't understand the loyalty to these model. A good audio stage for PWM (as in the A+/B+ models) is really complicated, and inside the Spectrum+ you can put a Raspberry 3A+ model, and get HDMI sound.
Yes, didn't research it properly - all of the guides for putting a PI in a speccy case said everything in raspbian would just work but I guess things have moved along since then and the working support has been broken along the way. I then found ZxBaremulator and thought I was on a winner...it was only when I couldn't hear anything via the HDMI that I read your website fully...Zero = v6 arm and no HDMI sound... Zero=pain in ass, correct!

As you say the 3A+ will handle it, so I'll just suck it up and swap it out since the PWM sound is a non starter - thank you for the heads up that has saved me a lot of messing about.
0 x

User avatar
Pegaz
Manic Miner
Posts: 493
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

Pi Zero is a great mini board, extremely convenient for many projects, you can literally put it anywhere, even in one place where it can really become pain in the ass. ;)
As I said before, if a Vice-based BMC emulator (with a bunch of features) can support HDMI sound on Zero, under Circle, then it's not clear to me why it can't Baremulator.
Also, Baremulator boot time is a whole 6 seconds on Pi3+, while on BMC it is only 3.5 seconds?
If optimized Raspbian packages (like Combian, Sedai etc) have a boot time of 5 sec, with a bunch of background processes, then I really don't understand what the problem is.
Again Pi Zero shines here, because Baremulator boots in about 3 seconds, at least on older versions, which I have tested before.
Last but not least, all new Baremulator versions have a certain scroll tearing, which spoil the perfect look & fell of the original machine, except for the old Zero versions already mentioned.
BMC on the other hand has a perfectly smooth scroll, even at the exact refresh rate at 50.125Hz
The differences between the two emulators are understandable (Vice is more matured) but Pi Zero cannot be blamed for everything.
I use often old Baremulator v1.3 on Zero with pwm sound, no scroll tearing, 3 sec boot time and it still a great fun. :)
0 x

zx81
Dizzy
Posts: 90
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

In Spain we have a saying: "cheap is expensive". A Zero can be convenient for some projects but when you need to solder the pins, or build an external circuit to have PWM sound, the cheap board turns expensive. I can't find in Spain a Zero for less than 19.95€. By a few bucks more I can buy a PI 3a+, can't compare it with a Zero.

I can't test BMC64 because I know nothing about C64, so I can't say if can output sound using HDMI or not. I've watched a presentation from his developer talking about BMC64 ans his problems with Armv6 based boards.

What I can understand is that 6 seconds to boot can induce to suicide to any user. Intolerable!. But, if I'm not wrong, the Zero board should be overcloked to cope with the CPU needs for BMC64....

Clearly, the problem is I'm a bad programmer, of course, I never discuss that. ZXBaremulator v1.3 have fewer tasks to execute on boot than later versions. And the USB bus initialization lasts more than a second by himself. And the SD initializacion another half second. Before the multicolour square I can do nothing to speed the boot process and after this, ZXB lasts around 3.5/4 secs to show the Sinclair copyright on my PI-2 at 600 Mhz. The Pi firmware takes his time to execute at boot.

Probably, BMC64 synchronize his time with start of image, but that's something I can't and wan't to do. With 50 Hz or 60 Hz display modes, BMC64 is slower or faster than the real C64. The Spectrum models works with very different CPU frequencies (3.5 or 3.5469 Mhz), and his refresh rates are 50.08 or 50.02 hz. None of those frequencies are standard refresh rates for HDMI modes, so you get tearing at 60 Hz (another small glitches at 50hz). The HDMI refresh rate is configured when PI starts and I can't change his values after boot. Anyway, a 50.125 Hz needs a very special configuration on config.txt file and not all users can do this correctly, specially when a TV set don't work properly with non-standard values.

On ARMv6 models, the PWM sound samples acts as a metronome, but in ARMv7/ARMv8 models I program an interrupt to trigger exactly as in a real Spectrum. The Circle scheduler is cooperative and the HDMI sound needs near to realtime attention to work properly. With emulator blocking up until the audio buffer is empty, I can't attend to VC4 to get HDMI sound in ARMv6 models. On ARMv7/8 models, I have a CPU for emulation and another to handle sound, USB, etc. That's all. Different decisions, different results.

I'm very sure that emulation speed is really precise compared with the real thing. That's a main target to me, more than a few glitches in some horizontal scrolling. Vice is an emulator embedded on a baremetal structure. ZXBaremulator is a new emulator from the start, I don't take anything from other emulators.

But using v1.3 is a shame.

My two cents...
0 x

User avatar
Pegaz
Manic Miner
Posts: 493
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

I understand your point and I can agree with almost everything you wrote except two things:

- You're not a bad programmer (on the contrary, I am)
- Using different versions of the same program, depending on my preferences is certainly not a shame

Cheers
0 x

Post Reply