ZXBaremulator 3.2

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

Re: ZXBaremulator 3.2

Post by zx81 »

Hi Jokin,

No, I'm sorry, the Zero have reserved all GPIOs to keyboard handling.

Really, a Zero isn't the best option to run ZXBaremulator. The best choice is 3A+ or the cheaper A+. With 3A+ you have HDMI sound, and with A+ you have PWM sound.

Thanks by test my humble emulator.
jokin
Drutt
Posts: 2
Joined: Fri Apr 24, 2020 3:47 pm

Re: ZXBaremulator 3.2

Post by jokin »

Hi zx81,
thanks for reply.
Sorry but i don't understand, spectrum keyboard use 12 GPIO pins (there are 28 pins available in wiringpi), GPIO12, 16, 20 are free no? (GPIO21 can be free if we remove the button for alternate keyboard)
am i wrong?
I found many tutos to use GPIO 13, 18 for sound in Pi Zero.

I know that Zero is not the best for emulation but it's fits perfectly in the spectrum keyboard case and i like that.

I’ll test it later with the zxscanner (cf MagPI 67) in python by modifying the pins and see if it’s possible.

Thanks for your time.
zx81
Microbot
Posts: 138
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

From the start, the idea was to use the same pins that printed in MagPi #67. Many people have his circuits wired like these, so I can't rewire the pins without cause problems to some users.
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: ZXBaremulator 3.2

Post by MonkZy »

jokin wrote: Fri Apr 24, 2020 9:19 pm I know that Zero is not the best for emulation but it's fits perfectly in the spectrum keyboard case and i like that.
Take a look at the A+ boards. They will fit quite neatly in a 16/48k case, due to the removal of Ethernet and USB ports. You can get the audio from the headphone socket.

Image

Adafruit Link to the Model 3:
https://www.adafruit.com/product/4027

https://www.adafruit.com/product/4027#Slide3

Model 2 boards can be found on eBay quite cheaply.

I am about to make a 3D printed harness to attach an A+ to the 48k case, without any case cutting. The HDMI, audio and 5v ports will be exposed via the edge connector opening. Should be quite neat.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

Is this a Pi3 A+ model (I have one), which normally sends audio and video through hdmi?
What makes it necessary to take sound/video from audio jack or GPIO connector from it, then?
What's the difference between Pi3 A+ and Pi1 A+ in that audio/video part anyway?
When it comes to Baremulator, I agree that Pi3 A+ is now the best solution with a very decent price of $25.

btw, I have a couple suggestions for zx81 to consider, if possible to implement it in the future.
I think it would be nice if we could save the user custom settings in some .ini file, for example.
Then the emulator could boot directly into 128K mode by default, instead of 48K mode.
Or we can save the location of our Games folder or last used games, making normal tape loading as default choice, etc.

The other thing is already mentioned earlier in the thread and I also wonder if its technically possible, to hook up a real tape recorder to Pi and load games in the old-fashioned way?

Also, Is it possible to add support for another model, say Russian Pentagon clone, to cover almost all existing Spectrum software?
zx81
Microbot
Posts: 138
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

Pegaz wrote: Sat Apr 25, 2020 10:27 am Is this a Pi3 A+ model (I have one), which normally sends audio and video through hdmi?
What makes it necessary to take sound/video from audio jack or GPIO connector from it, then?
The PI firmware chooses one when the board boots. When don't find a TV on the HDMI connector, switch the image/sound to 3.5mm jack. But a PI 3A+ should send the audio through HDMI without any problem.
Pegaz wrote: Sat Apr 25, 2020 10:27 am What's the difference between Pi3 A+ and Pi1 A+ in that audio/video part anyway?
When it comes to Baremulator, I agree that Pi3 A+ is now the best solution with a very decent price of $25.
The PI 3A+ can send video/audio through HDMI or composite/pwm, at your wishes or needs. The PI A+ only can send audio through 3.5mm jack. In the A+/B+ the PWM sound is using the GPIOs 40/45, not exposed on the board connector, so you can have GPIOs and PWM sound. Anyway, the 3A+ is an ARMv8 quad-core CPU, and ZXBaremulator uses only two CPUs by now. The A+ is an ARMv6 one core CPU. Sooner or later I could need to use another CPU from the PI-2/3 and the ARMv6 boards will be unsupported again and forever.

The most crazy for me with the Zero models is that you need to build a really complex circuit to have acceptable sound quality, see the A+/B+ audio circuit here: https://learn.adafruit.com/introducing- ... io-outputs
For me, it's easy to buy an 3A+ and you get HDMI sound for free.
Pegaz wrote: Sat Apr 25, 2020 10:27 am btw, I have a couple suggestions for zx81 to consider, if possible to implement it in the future.
I think it would be nice if we could save the user custom settings in some .ini file, for example.
Then the emulator could boot directly into 128K mode by default, instead of 48K mode.
Or we can save the location of our Games folder or last used games, making normal tape loading as default choice, etc.
Any emulator can't be a "decent" emulator without some user settings, save snapshots/tapes, a tape browser and other bunch of options. The problem is that's a one man project. In a bare-metal project the hardest part to understand by the users is that I have nothing to program a GUI for the user, with a file dialog, menus, checkboxes, radio buttons and other graphical widgets usually found in popular libraries. I can't use SDL, Qt, GTK, WxWidgets or any other. I should to program all I can need, and these tasks consumes many time and work. ZXBaremulator can't save snapshots because I need to program first a box to take the file name to save (I don't want to mention a full save dialog...).
Pegaz wrote: Sat Apr 25, 2020 10:27 am The other thing is already mentioned earlier in the thread and I also wonder if its technically possible, to hook up a real tape recorder to Pi and load games in the old-fashioned way?
Read a tape is a realtime task and no emulator works like this. I can't envision a method that works with all tape loader types and not only with standard ROM loader. Anyway, you need too some adapter level circuit, you can't attach directly an analog tape output to the GPIO pins. Design and build this circuit is far beyond my capabilities.
Pegaz wrote: Sat Apr 25, 2020 10:27 am Also, Is it possible to add support for another model, say Russian Pentagon clone, to cover almost all existing Spectrum software?
By now, I'm not interested in Russian models or other variants as Sam Coupe.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

Thanks for the answer, it's all much clearer to me now.
Regarding the choice of Pi model for Baremulator, its now more than obvious that Pi3 A+ is the best solution for the hardware project due to its size and future support.
btw, it was not my intention to look for some fancy options, I just wish we could choose a different model to boot by default, as well as saving location of the software folder, nothing more.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

[mention]zx81[/mention]

Today I was playing a little more with Baremulator and I think we might be one step closer to locating the cause of that sound issue.
I plugged the small speaker into the audio jack, disconnected the hdmi cable and got that crackling sound again.
The easiest procedure I can almost always reproduce this sound is this.
Just press any key, then go to the menu with F1 and go back after a few seconds.
I did all this blindly, without any connection between my Pi3 A+ and TV.
Does this mean that maybe this is not a problem in some conflict with my TV and what else could cause something like this. :?
btw, is it possible to use hdmi just for video output and pwm audio for sound at the same time?
I tried adding the command amixer cset numid=3 1 (and force pwm through audio jack) to config.txt, but still got sound through hdmi output.
Only when I disconnect the hdmi cable, I get sound through the audio jack...
zx81
Microbot
Posts: 138
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

Thanks by your investigations, Pegaz. The 'amixer' command is an ALSA command, so only works under Linux.

As I said before, all the video/audio management is done by the PI firmware at boot.With a HDMI TV connected, sound outputs through HDMI. When no HDMI TV is connected audio/video are redirected to 3.5mm jack.

I don't know any method to change the audio output.

I'll investigate the sound problem. Thanks again.
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

Hi [mention]zx81[/mention],

Very many thanks for ZXBaremulator 3.2. I tried it for the first time today, and I'm very impressed! Nice work.

Can I ask a few questions. As I say, I have not been following the project, so sorry if these have been answered elsewhere:
  • Would it possible to allow SSH connectivity into the Pi so I can upload files from my PC?
  • Would it be possible to set a default machine type rather than having to set each time you switch on
  • On the tape loader screen is it possible to have some indication there that the file has loaded. I know it appears when you go back to the emulator screen.
  • I can't seem to use Keyboards with a USB dongle such as the one below. Is that what you mean by no USB hot-plug?
    https://www.logitech.com/en-gb/product/ ... us?crid=27
  • I like the full screen 16:19 stretched format rather than 4:3 (Sorry [mention]Ast A. Moore[/mention]!) Is this possible?
Many thanks in advance.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: ZXBaremulator 3.2

Post by Ast A. Moore »

PeterJ wrote: Tue Apr 28, 2020 12:23 pm I like the full screen 16:19 stretched format rather than 4:3 (Sorry @Ast A. Moore!)
:evil:




:D
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.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

[mention]PeterJ[/mention]

Most of these things have been discussed before, BM is not based on Linux or any other OS.
In fact the emulator acts like an OS itself and replace original kernel.
I use my USB dongle and WIFI keyboard successfully, maybe not all are supported...
Actually I like the minimalist approach and I don't like having too much OSD content over the Spectrum screen.
As for me, I would also exclude that info message that there is no GPIO keyboard.
I agree that it would be a good to set default model at startup, I mentioned it a few days ago.
zx81
Microbot
Posts: 138
Joined: Sat Feb 17, 2018 9:33 pm

Re: ZXBaremulator 3.2

Post by zx81 »

PeterJ wrote: Tue Apr 28, 2020 12:23 pm Hi @zx81,

Very many thanks for ZXBaremulator 3.2. I tried it for the first time today, and I'm very impressed! Nice work.
Thanks.
PeterJ wrote: Tue Apr 28, 2020 12:23 pm Can I ask a few questions. As I say, I have not been following the project, so sorry if these have been answered elsewhere:
  • Would it possible to allow SSH connectivity into the Pi so I can upload files from my PC?
  • Would it be possible to set a default machine type rather than having to set each time you switch on
  • On the tape loader screen is it possible to have some indication there that the file has loaded. I know it appears when you go back to the emulator screen.
  • I can't seem to use Keyboards with a USB dongle such as the one below. Is that what you mean by no USB hot-plug?
    https://www.logitech.com/en-gb/product/ ... us?crid=27
  • I like the full screen 16:19 stretched format rather than 4:3 (Sorry @Ast A. Moore!) Is this possible?
Many thanks in advance.
About your questions:

1.- ZXBaremulator don't uses an O.S., so you don't have all the bells & whistles associated to it. No, you don't have any network connectivity.

2.- That question was answered to Pegaz a few posts ago. Not now, but it's a planned feature.

3.- When you press SPACE over a file name, the line changes his color to indicate that the file was loaded, and is shown in red when you moves the cursor to remember what's the last file loaded.

4.- Some keyboards works, others not. The USB hot-plug isn't supported by the Circle library, I'm sorry. But you can try with your keyboard. :)

5.- On my TV, when I use the default HDMI mode I watch a 16:9 image (goooosshhhh!). I need to force image on the TV options to reduce size to 4:3. The default HDMI mode, on my TV, is 1080p@60Hz 16:9.

Thanks to you by try the emulator.
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

Many thanks for the quick reply [mention]zx81[/mention]

What I'm trying to get with the display is full screen (stretched), rather than this:

Image

Image
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: ZXBaremulator 3.2

Post by MonkZy »

PeterJ wrote: Tue Apr 28, 2020 12:23 pm Would it possible to allow SSH connectivity into the Pi so I can upload files from my PC?
As explained by [mention]zx81[/mention] this would be beyond the scope of the Circle baremetal library.

I have been looking at wifi enabled SD cards (e.g. Toshiba FlashAir) to solve this issue of adding files. They are quite pricey, £20-30 for a 16GB Toshiba card, plus you will need a micro-SD -> SD adapter as the wifi cards are all the larger SD card sized, but I have seen old pi-zero builds using FlashAir successfully to overcome lack of network.
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: ZXBaremulator 3.2

Post by MonkZy »

User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

Yes, by the time you have spend £30 on a Toshiba card, then purchased one if these it starts getting expensive.

Image

Does the library recognise USB devices plugged in? As I have one of these?

Image

A slight aside, but look on the price range of this on Amazon via CamelCamelCamel (Great site). I purchased it when it was just over £15.

https://uk.camelcamelcamel.com/product/B00ZCFYDLA
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

Yes, I know. I have discussed my feelings on this elsewhere [mention]MonkZy[/mention] :-)
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: ZXBaremulator 3.2

Post by MonkZy »

[mention]PeterJ[/mention] , There is an adapter with a ribbon cable, which can be really useful if you put the PI into a speccy case. I would actually say essential , if you don't want to open up the speccy for an SD card update. They are about a fiver on ebay.

A slightly cheaper wifi option is a wifi enabled microSD card adapter. They are about £17 from China. I cannot find any Raspberry PI projects that have tested them though, so I am less inclined to take a punt.
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

Thank [mention]MonkZy[/mention]. All good advice. Will wait and hear about the wide-screen before I spend anymore. Cheers.
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

MonkZy wrote: Tue Apr 28, 2020 3:03 pm @PeterJ , There is an adapter with a ribbon cable, which can be really useful if you put the PI into a speccy case. I would actually say essential , if you don't want to open up the speccy for an SD card update. They are about a fiver on ebay.

A slightly cheaper wifi option is a wifi enabled microSD card adapter. They are about £17 from China. I cannot find any Raspberry PI projects that have tested them though, so I am less inclined to take a punt.
Something like these two?

https://www.aliexpress.com/item/3273117 ... web201603_

https://www.aliexpress.com/item/3283589 ... web201603_
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: ZXBaremulator 3.2

Post by Pegaz »

Personally, I have no particular need for ssh connectivity, here.
I already have the whole Spectrum collection on my sd card, from time to time I add a some new games, just a few minutes job on pc.

Also, I always like the picture to be as authentic as possible, so the 4:3 aspect ratio is always something I set first with the emulator.
Spectrum with a stretched screen looks really strange to me.
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: ZXBaremulator 3.2

Post by PeterJ »

It's very much down to personal preference in regard to 4:3 or 16:9 [mention]Pegaz[/mention]. I'm interested to know if it's possible.
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: ZXBaremulator 3.2

Post by MonkZy »

PeterJ wrote: Tue Apr 28, 2020 3:18 pm Something like these two?
Yes, the one extender I have has a longer ribbon tho'. I may take a shot with the chinesium wifi adapter...if it is no good on a PI I can put it in my missus's digital camera.
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: ZXBaremulator 3.2

Post by MonkZy »

PeterJ wrote: Tue Apr 28, 2020 3:23 pm I'm interested to know if it's possible.
You can edit the config.txt on the ZXBME Sd card..

use

Code: Select all

hdmi_mode=6
If you are on hdmi_group=1, mode 6 is a 480i (4:3) mode.

You may find the stretch on your TV will work properly then.

More info of HDMI modes here :

https://www.raspberrypi.org/documentati ... t/video.md
Post Reply