Bare Metal Emulation - ZX Spectrum on a Raspberry Pi

Ғылым және технология

Bare metal emulation gets you closer to the real retro computer experience. With the ability to embed the emulator inside original hardware you can also turn a old keyboard and case into a fully modernised replica machine.
In this video I'll show you how to install and set up the ZXBaremulator to create a bare metal replica ZX Spectrum.
Don't forget to check out the project page at
bytesnbits.co.uk/zx-spectrum-...
ZXBaremulator - zxmini.speccy.org/en/index.html
Elecrow screen - www.elecrow.com/catalogsearch...
Elecrow speaker connector : amzn.to/3utOPrf
Elecrow speakers : amzn.to/47rctDt
Other LCD screens : amzn.to/3GgsrV2
Raspberry Pi Zero 2W : amzn.to/3FXfGhZ
Keyboards : amzn.to/3RegHbJ
0:00 Introduction
1:46 Bare metal emulation
3:56 Hardware
6:42 Installing ZXBaremulator
15:37 Booting and using ZXBaremulator
19:09 Configuring the emulator and RPi
27:08 Conclusion

Пікірлер: 76

  • @ThePeter7071
    @ThePeter70714 ай бұрын

    Really well explained video, thanks for making it. This will help me with my Speccy pi.

  • @BytesNBits

    @BytesNBits

    4 ай бұрын

    Glad it helped

  • @byronneedham529
    @byronneedham5297 ай бұрын

    Many thanks for this video, I built something similar a while ago but your instructions are much better 👍

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Glad it helped

  • @johnvirgin405
    @johnvirgin4055 ай бұрын

    Great content. Many thanks. So well explained.

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    Thanks. Glad you enjoyed it.

  • @johnvirgin405

    @johnvirgin405

    5 ай бұрын

    I've got my pi zero 2 running with the baremetal emulator. However, it won't recognise the keyboard I have attached via usb. It displays a message telling me to attach a keyboard via my gpio (I have a spare empty spectrum case, keyboard and membrane, and I intend to do this like your second video but I would like to get the "os" all up and running correctly first) I've tried several usb keyboards that I have kicking around and none work. Any guesses what I'm doing wrong. Any advice is much appreciated@@BytesNBits

  • @gartmorn
    @gartmorn7 ай бұрын

    Looking forward to the next episode as I have a reproduction spectrum case and keyboard in my workroom! Interested to see how you transition / interface the original keyboard to the pi!

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    I've just uploaded a KZread Short of the project on breadboard. Working great (after a bit of fiddling).

  • @gartmorn

    @gartmorn

    7 ай бұрын

    @@BytesNBits looks good!

  • @mattjackson9859
    @mattjackson98597 ай бұрын

    Had a Pi Zero W for a while, never got round to installing BareEmulator on it, this video would have been a great help. Bit moot now as I should be getting my Next in the next week or two!

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Have fun with the Next!

  • @umutkayacan7659
    @umutkayacan76597 ай бұрын

    Very cool!❤

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Thanks again :)

  • @Rick_Todd
    @Rick_Todd7 ай бұрын

    Looking forward to the real machine case install.

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Me too!!

  • @terrydaktyllus1320
    @terrydaktyllus13207 ай бұрын

    Thanks for another excellent video, Bob. As it happens, I just finished a major study and exam qualification a couple of weeks ago so have my free time back to "mess around" with computers again. Earlier this week I hooked out my box of old SBCs with the intention of doing some Linux builds on them and was thinking about turning an old RPi 1 into a ZX Spectrum emulator - so I will give this "bare metal" stuff a try because I've never installed it before. With that said, I like to have network connectivity and file transfer capabilities available to me on each box I build but even a Pi 1 should be able to run a Spectrum emulator over the top of a command line only Linux OS. I am interested in looking at how the graphical support was done in "bare metal", presumably it's through the Linux kernel frame buffer driver given that there's no sign of xorg (or wayland) running.

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Thanks. Definitely give it a go. The ZXBaremulator isn't open source, at least I can't find any source repo for it. I did look at another unfinished version, github.com/doraemoncito/zx-raspberry, which does give access to the source code. You could also look at the BMC64 emulator, github.com/randyrossi/bmc64, which I think uses the Circle framework - github.com/rsta2/circle. Hope this helps!

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Just noticed that the ZXBaremulator is based on the Circle framework as well.

  • @yogibear2k220
    @yogibear2k2207 ай бұрын

    This is a good project for many, but not for me. It is too costly a project for me. I prefer Spectaculator running on my PC. OK, it is paid for software, but definitely worth it. I have not found a Speccy that is does not emulate apart from the QL. And you can listen to the tape noise as you are loading things from a virtual ZX Spectrum tape format. I love that option, Especially on 128k games. I can just listen to it and zone out in nostalgia. I have nearly 28,000 pieces of software for it so it is well stocked with anything I want to do with it. But, I am glad you had fun making yours. Maybe in the future you could do a BBC Model B one. That is the one I would be really interested in. Thank you.

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Thanks for your comment. Great to hear you're enjoying the old machines. BBC Micro is something I'm looking into at the moment but not found a good solution other than the standard Linux / Windows emulators.

  • @another3997

    @another3997

    6 ай бұрын

    There are many options for Spectrum emulation, and most emulators are free, so use whatever you want. But a brand new Raspberry pi Zero costs about £5. The emulator is free, and most people have a suitable SD card lying around. If not, they are dirt cheap to buy new, and they can be used in many other devices, so they are a useful purchase. Unless you don't have an HDMI equipped TV or monitor, all you need is an HDMI cable and a keyboard. If you have a desktop PC, not a laptop, you must already have a keyboard. But a cheap keyboard costs between £5 and £10, and they're usable on lots of devices, including many phones, tablets, laptops etc. I doubt cost is an issue, as you can afford a computer, paid software and an internet connection with enough data allowance to watch KZread videos.

  • @yogibear2k220

    @yogibear2k220

    6 ай бұрын

    @@another3997 Yea I get that, but that's only for a Spectrum. I am looking for a multi emulator for Dreamcast, Nintendo, etc. but thanks anyway.

  • @JoseLuisSanchez-kx7fj
    @JoseLuisSanchez-kx7fj5 ай бұрын

    Thanks by your video about my humble emulator. I don't have any Zero model, so I can't try to boot with a Zero 2 W. But the *.dtb files are loaded by the firmware using the board info. So, is strange that doesn't work with others dtb present. Best regards

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    The emulator will work with any model other the Pi4 or 5.

  • @richiemills7
    @richiemills75 ай бұрын

    Great video! Having lots of fun with this. Do you have any idea if there is a "safe shutdown" feature within the software here, rather than just pulling power? I'd hate to corrupt my SD card. I am running a Pi Zero 2 W. Cheers...Richie.

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    This one is safe to just power down. I think everything gets loaded into memory so it's never in the middle of writing to the SD card to corrupt it.

  • @arnolduk123
    @arnolduk1237 ай бұрын

    Retro Speccy gaming with Gary Lineker! Next video to be presented by Gazza.

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Thanks, I think.

  • @namesurname6583
    @namesurname65833 ай бұрын

    please add the ZX_Spectrum memory. 128kb is not enough. this would give the development of this platform. it can still develop. She's interesting.

  • @BytesNBits

    @BytesNBits

    3 ай бұрын

    Unfortunately this is not my software and the source code is not available.

  • @richyb7375
    @richyb73756 ай бұрын

    Sorry put my comment in the wrong video.....Great video, this has rejuvinated my Pi hobbie... I cannot seem to get the v3.2 ARMv7 working without it asking to connect a gpio keyboard. It works ok with the Kernel7 img file supplied with the zxmini download but is an older version 2017 without the ability to load my own games and load in real time with sounds. Am I missing something? Thanks 🙂

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    The message to connect a gpio keyboard suggests it can't recognise your usb keyboard. It's strange that it works with the other image. Make sure the keyboard is connected before turning on the RPi - these devices don't support hot plugging. If that doesn't work try another wired keyboard if you have one. Hope this helps.

  • @richyb7375

    @richyb7375

    6 ай бұрын

    @@BytesNBits Fixed it, I had the Wi-Fi dongle plugged in the USB port and the keyboard plugged in the one below which it wouldn’t recognise. Unplugged the dongle and plugged to keyboard in and worked perfectly

  • @dusthillresident
    @dusthillresident7 ай бұрын

    How do you connect a real tape recorder to load your old cassettes?

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    It's a bit of a work around that I plan to cover in a video very soon. Basically you need to record the tape as a digital file and then covert it into a TZX file for the emulator. I'll be coming at it from the angle of saving files from the emulator as it outputs the tape signal over the loudspeaker so you can record that. It's a bit fidlly but it works OK and you can test with Fuse on your PC without having to go back and forward to the ZXBaremultor. If you want to have a look yourself try web.archive.org/web/20080126131352/www.ramsoft.bbk.org/maketzx.html The downloads still work. Use the command maketzx "my_program.wav" my_program.tzx This turns the wav file into a TZX file. I found you need to record at quite a high sound level but make sure you don't get any clipping. A 96000 samples per second, 16 bit, uncompressed, mono recording worked best for me. Have fun!

  • @TheSlowstick
    @TheSlowstick6 ай бұрын

    I did it with my Pi3 and it worked. I switched to. Zero now I can’t get sound out the hdmi. Not sure why. But it’s annoying as there is no audio socket on the pi zero

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    You'll probably have to have a play with the settings in config.txt. Make sure you force sound output on the HDMI signal and force the HDMI to take priority (hotplug option I think). Hope this helps.

  • @TheSlowstick

    @TheSlowstick

    6 ай бұрын

    @@BytesNBits nope it’s impossible to get sound on the pi zero. I checked with the developer. It’s not possible so what is trick. If you can’t do it I would sooner know as I don’t want to waste anymore time and money. .

  • @TheSlowstick

    @TheSlowstick

    6 ай бұрын

    @@BytesNBits please can you confirm if sound works with zero. As developer says not

  • @user-Limaa
    @user-Limaa7 ай бұрын

    amazing but the ESP32 is so more cheaper and do the same! what do you think? also you can choise the TVGA ESP32 TTIGO, cames with vga and ps2 connector

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Thanks for the tip. The ESP and Pi Pico emulators look great and something I'll have a go with in the future. I wanted to use the raspberry Pi version to easily get the combined HDMI with sound output and USB gameport connection.

  • @another3997

    @another3997

    6 ай бұрын

    A Raspberry Pi Zero costs £6. An ESP32 cannot do all the same things as a Pi Zero. They are very different devices, aimed at different use cases. Use whatever hardware and software you want, as long as they do what you want it to do. Just make sure you know what you're buying and what it can and cannot do.

  • @user-Limaa

    @user-Limaa

    5 ай бұрын

    depend what raspberry pi 0 are you talking about @@another3997

  • @taiga1295
    @taiga12957 ай бұрын

    ...but you still have all the spectrum overscan! (but not the black bars at least)

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Mostly the disable_overscan option will work fine, but if not just play with the settings until you get the desired look.

  • @another3997

    @another3997

    6 ай бұрын

    That will always be a problem on any monitor that isn't a 4:3 ratio, which is what the Spectrum produces.

  • @zxspectrum16KB
    @zxspectrum16KB6 ай бұрын

    What happens if your trying to load rtype it was multiload each level loading separately? Are you aware of the rzx archive? This archive has games but also all the keyboard and joystik inputs so you can just watch someone complete the game. Also I want to use tasword +2 128k emulator how do I load and save a text file?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I haven't actually tried a multi load game. I'll have to give it a go. Thanks for the tip on the rzx archive. The emulator allows you to attach tape files which it can then read. Saving is possible but a bit awkward. The emulator outputs the same data via the sound channel. You have to record it, convert it to a tap file and then save it back on to the SD card so you can reload it. Probably not a useful solution. Overall this replica spectrum is really good to get a feel for the system and enjoying using it as a computer but it does have it's limitations.

  • @zxspectrum16KB

    @zxspectrum16KB

    5 ай бұрын

    @@BytesNBits kzread.info/dash/bejne/h5qEvMaYg8ickpM.htmlsi=aFfdlA4HjcPyVuZq

  • @zxspectrum16KB

    @zxspectrum16KB

    5 ай бұрын

    @@BytesNBits I ended up using zx spin

  • @EnjoySynthSounds
    @EnjoySynthSoundsАй бұрын

    Will it support Bluetooth instead of usb keyboard?

  • @BytesNBits

    @BytesNBits

    Ай бұрын

    No. I don't think Bluetooth is connected up in the code.

  • @petercaspari680
    @petercaspari6807 ай бұрын

    Amazing timing. I just got the Bare Metal emulation running on a PI 3 and connected to one of those recreated ZX Spectrums that came out some years ago. I just can't figure out how to save basic programs I created. Any idea's anyone?

  • @terrydaktyllus1320

    @terrydaktyllus1320

    7 ай бұрын

    I've not yet played with this particular emulator, but if it's based on something like the FUSE (Free Unix Spectrum Emulator) core, then saving and loading is usually accessible through a function key, possibly? As far as the emulator is concerned, it will have to emulate loading and saving from a cassette tape so presumably there's an option somewhere to save to a TAP, TZX or some other appropriate format.

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    I'm not sure if the emulator supports saving. I haven't found any reference or menu options to hint at how to do it. Plus I don't think it lets you take a snapshot of the complete system. I'm still playing with it myself and will let you know if I find anything.

  • @terrydaktyllus1320

    @terrydaktyllus1320

    7 ай бұрын

    @@BytesNBits I think this project was last updated about 3 years ago and he has few YT videos on his channel going back about 6 years, but I think both seem abandoned now.

  • @petercaspari680

    @petercaspari680

    7 ай бұрын

    Thanks everyone. I found a few forum comments that also suggest that saving and snapshots are not supported. I might try fuse but I don't think it has support for the recreated spectrum which baremetal has. Very disappointing.

  • @terrydaktyllus1320

    @terrydaktyllus1320

    7 ай бұрын

    @@petercaspari680 I am not sure why you'd be disappointed in that scenario. FUSE will let you load and save programs with the added advantage that you can run it on a "lite" Linux OS like Armbian that will also let you run some network services in the background. If you are spending a lot of time programming the ZX Spectrum then the last thing that you want is to lose your work - and therefore it's surely much better to have some built-in Linux command line capability to copy off your saves to another machine, or onto a USB stick, rather than just have a copy on the SD card that could fail at any point.

  • @user-Limaa
    @user-Limaa7 ай бұрын

    could you write save and load sd programs games?

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    This emulator doesn't have an actual save function. It can output the sound signal that needs to be saved to the tape but you need to capture that and encode it separately.

  • @Rikky2000
    @Rikky20007 ай бұрын

    Can you please do a bare metal for the BBC Micro?

  • @terrydaktyllus1320

    @terrydaktyllus1320

    7 ай бұрын

    That may not be possible, I am not aware of any BBC Micro emulators that support "bare metal" functionality. It's still a Linux kernel being booted here and that kernel has to have the capability of providing graphics without relying on an external xorg (or wayland) GUI graphics driver being loaded - in which case it will either use a built-in kernel driver or an appropriate "frame buffer" driver in the kernel. I assume that is what the "bear metal" ZX emulator does here but that's because it supports low-level kernel graphics. I am not aware of any BBC Micro emulator that supports low-level graphics.

  • @Rikky2000

    @Rikky2000

    7 ай бұрын

    Ah ok - maybe there is a way to set up a Raspberry Pi 4 to boot into a BBC emulator? @@terrydaktyllus1320

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    As @terrydaktyllus1320 says I can't find a bare metal version for the Raspberry Pi. There is one for the Pi Pico but that needs a bit more tinkering to get set up. I have been looking at booting straight into BeebEm or something as a work around but still playing with the idea.

  • @tubeDude48
    @tubeDude487 ай бұрын

    Is PacMan available for this?

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Yes. There are quite a few PacMan style games on the Spectrum.

  • @tubeDude48

    @tubeDude48

    7 ай бұрын

    @@BytesNBits - Thanks!

  • @Victor_Wire
    @Victor_Wire5 ай бұрын

    If it doesn't have the ability to save a program, it's not a real ZX Spectrum, just a regular games console. A unique project that lacks basic functionality.

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    I get what you're saying. I have been looking at the save issue and it is possible - though one hell of a round about method. For me this setup works well if not perfectly. I'll be looking at a linux / Fuse setup in a while to get the full functionality and hopefully a similar boot speed.

  • @Victor_Wire

    @Victor_Wire

    5 ай бұрын

    I wouldn't mind saving to tape if it was possible to load from tape.

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    @@Victor_Wire The work around is to use the emulator sound output during save. This comes over the HDMI channel. Capture this, transform the WAV file into a TAP file then copy it back onto the SD card. Not exactly an easy or user friendly method but it can be made to work. I'm still working out if I can simply play the recording back into the emulator.

  • @umutkayacan7659
    @umutkayacan76597 ай бұрын

    Very cool!❤

  • @BytesNBits

    @BytesNBits

    7 ай бұрын

    Thanks

Келесі