Bare Metal Emulation on the Raspberry Pi - Commodore 64

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

If you want to get closer to the feel of the original hardware give bare metal emulation a go. Ditch the operating system and run the emulator code directly on the hardware.
In this video I'll show you how to get everything set up and running to build a replica Commodore 64 with the BMC64 emulator.
BCM64 Emulator
accentual.com/bmc64/
Don't forget to check out the main project page at
bytesnbits.co.uk/bmc64-bare-m...
LCD Screen
amzn.to/48X9BPQ
0:00 Introduction
1:52 What is Bare Metal Emulation?
4:21 Hardware setup
6:01 Setting up a Commodore 64 Emulator = BMC64
18:08 Emulator settings
25:56 Expanding the SD card partition
29:45 Emulating other Commodore computers
32:11 Conclusion

Пікірлер: 126

  • @gabor222
    @gabor2226 ай бұрын

    This is a great project. What I like the most about it are the almost instant boot time (about 4seconds) and that original Commodore 9-pin joysticks can be wired directly to the GPIO port.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Using the original hardware is a great feature of this approach. I have to admit after making the video I took the plunge and bought a C64 keyboard and case. Replica C64 video coming soon!

  • @bern047
    @bern0476 ай бұрын

    Excellent tutorial, I need to set aside one Sundayy morning to have a play with this as it needs carful setting up, thank you for showing us the details

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Have fun!

  • @erroneus00

    @erroneus00

    6 ай бұрын

    Just remember -- not for Pi4 or newer. The project itself hasn't been advanced to support newer Pi versions. But at least Pi3 is cheaper...

  • @bern047

    @bern047

    6 ай бұрын

    Raspberry Pi 3 is more than enough for this project and I have seen the C64 run on a Pico, I have other plans for the Pi 5 when I get the 4 I have ordered@@erroneus00

  • @bern047

    @bern047

    6 ай бұрын

    The Raspberry Pi 3 is fast enough and I have seen the C64 run on a humble Pi Pico by Raspberry Foundation. I have other plans when I get my Pi 5 (4 of them) that I have ordered

  • @erroneus00

    @erroneus00

    6 ай бұрын

    @@bern047 We are beyond speed considerations. This is more about "forward compatibility." Let me put it another way -- this only works on older hardware and if you can't find it any longer, you can't do it unless someone takes up the slack.

  • @slowlymakingsmoke
    @slowlymakingsmoke6 ай бұрын

    Great video. Especially enjoyed your dive into what BM emulation is. Would love to see more of that. Can you set up 4:3 aspect ratios for the screen and is there a CRT emulation system available?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Glad to hear you enjoyed it. Yes. There are a number of display filters in the emulator settings so you can get it looking just the way you want. Just have a play around.

  • @terrylyn
    @terrylyn6 ай бұрын

    This is really cool idea.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Yes. Definitely give it a go.

  • @Shawnsteroz
    @Shawnsteroz6 ай бұрын

    This will be a great add-on for my SX-64 mini, I hope to build one day. I got all the parts in 2020, just need to 3D print the keyboard holder and some small decorations. It has the Pi3 and a HDMI 2.5" screen to squeeze in. I think I saw it on Retro Recipes, always wanted one, but the prices for real ones are so high nowadays.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Looks like a great project. Definitely get it built!

  • @BobIrving2
    @BobIrving23 ай бұрын

    Super cool and helpful! Are you running all the software off an SD card or a USB? You used both terms and we never got to see you putting one in the Pi. Thanks!

  • @BytesNBits

    @BytesNBits

    3 ай бұрын

    Sorry. I'm running everything from the SD card.

  • @raelik777
    @raelik7776 ай бұрын

    The mt32-pi project is another great example of bare metal emulation on an RPi.

  • @ScandalUK

    @ScandalUK

    6 ай бұрын

    I love mine - thanks for the tunes d0pefish

  • @jimbotron70

    @jimbotron70

    6 ай бұрын

    Also MiniDexed.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    These all sound great. Thanks for the tips. I'll have to have a look at these projects. I'm not a musician but I do live in a house full of them.

  • @Reprogrammed_By_SEGA
    @Reprogrammed_By_SEGA6 ай бұрын

    I wish there was a MiSTer FPGA equivalent project that brought all Bare Metal Emulators together for the Raspberry Pi. It would be just as good and far more affordable.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I'm finding more and more bare metal projects as I look. Not all as polished as BMC64 but useable.

  • @Reprogrammed_By_SEGA

    @Reprogrammed_By_SEGA

    6 ай бұрын

    Indeed there are quite a handful out there but the key for me is bringing them together into a unified project/launcher.@@BytesNBits

  • @pad-pd4hl
    @pad-pd4hl6 ай бұрын

    There is also a great bare metal emulator for the Sinclair ZX Spectrum, the ZXBaremulator. I got it running in a real rubber key case.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I did spot that. Just received my Spectrum+ case and keyboard. Keep an eye out for the replica ZX Spectrum video in a couple of weeks - If I can get it to work!

  • @srg0075
    @srg00755 ай бұрын

    Thanks for the clear and interesting video! Do you know if there is a bare metal BASIC emulator that can use more or all of the Pi's memory, without the overhead and complication of a monolithic OS, and without the normal memory limitations of BASIC interpretors whilst using traditional micros?

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    Not that I know of. There is a bare metal IBM PC emulator that will let you use Microsoft Basic with a reasonable amount of memory. I guess your best bet is to use a light version of the RPi OS and run BASIC within that.

  • @CreamPolo
    @CreamPolo6 ай бұрын

    8:10 "Burn" good old 90's Term.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Works for me!

  • @CreamPolo

    @CreamPolo

    6 ай бұрын

    @@BytesNBits Same here I'm also from CD Burning era :)

  • @dazealex
    @dazealex6 ай бұрын

    Neat. Didn't know you could do this... An Atari 800XL kid, but all 8bits are awesome!

  • @maxxdahl6062

    @maxxdahl6062

    6 ай бұрын

    I like the C64 more but I'd have definitely taken an 800 over a vic 20 or an apple 2, as a gamer anyway.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    It's a really good way to get a single system up and running.

  • @another3997

    @another3997

    5 ай бұрын

    ​@@maxxdahl6062I know the C64 gets all the glory, but the Atari hardware was released in 1979, 3 years before the C64... that's a very long time in computer terms. Yet the C64 was not much of an advance on the Atari, and in several ways, demonstrably worse. Half the CPU speed, incredibly slow floppy disks, a rather muted colour pallete and a BASIC without ANY graphics or sound commands? I know, we're well past the point of caring... it was nearly 45 years ago. But Atari for the win! 😁😉

  • @maxxdahl6062

    @maxxdahl6062

    5 ай бұрын

    @@another3997 I'd say the vic 2 and the SID blew any of the atari 8 bit hardware away. the 400/800 didn't look like much of an advancement from the 2600.

  • @mughug9616
    @mughug96164 ай бұрын

    BMC64 uses VICE as it's foundation which in turn uses an underlying OS like Linux. My question is what does the 'Bare Metal' term mean here as it seems no different then something like UAE, etc.? IS BMC64, etc. actually an ARM architecture application?

  • @BytesNBits

    @BytesNBits

    4 ай бұрын

    Hi. I guess it's a fuzzy sort of area. BMC64 and other 'bare metal' applications do still run on a base layer of application code. This is probably a very cut down version of Linux but is not enough to be really considered an operating system as such. From memory I think a lot use the Circle framework - have a look at the codebase. This base layer provides access to all the system hardware. BMC64 is then a reworked version of the VICE code that sits on top of this base layer but I guess the base layer is so thin that we effectively say its running directly on the Pi system. I guess there's scope for a lengthy debate on what bare metal really means, but I'm happy that this runs at a low enough level to get the label.

  • @IanHaver
    @IanHaver6 ай бұрын

    i noticed a *nix style file structure and .elf file which is normally associated with *nix. Is the kernel used similar in design to the *nix flavours?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I think there is a very minimal layer of OS underneath the emulator code. Just enough to get access to the board hardware and provide a platform for the rest of the software. There is a base coding platform that these sorts of applications are built on.

  • @gmichie1
    @gmichie16 ай бұрын

    I am really interested in building out one of these bare metal units. I cannot find the information on the project link you spoke of. The Vice keyboard overlay, and other things mentioned. Please direct me to this location. I have ordered the 10.1 inch monitor. I cannot wait for it to come in. Do you have an Amazon store link for your viewers? Why not get a little side money for pointing to some of the things you use in your videos.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Thanks for the prompt. I'd not really finished off the project page. Please have a look at bytesnbits.co.uk/bmc64-bare-metal-emulation/ The bits you're after should be on there now. Have fun with your new Commodore 64!!

  • @Endelin
    @Endelin6 ай бұрын

    Thanks so much for this! I was trying to follow the Commodore 64 Basic book with an emulator, but I kept accidentally hitting keyboard hotkeys for the emulator or my operating system.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Yes. It's a great emulator for getting back to the basics of the machine.

  • @erroneus00
    @erroneus006 ай бұрын

    Based on the date of this video and the image of the Pi4, I was excited. Previously, BMC64 only works for Pi3 or other less-than-4 models. But I've referenced the resources you indicated and found it still seems to be the case -- that it's not for Pi4 or above. I guess in a way, that's a plus -- the Pi3 is more affordable than Pi4 or above. But over all, EVERY Pi model is more expensive. (we know why) So this is mostly beneficial to people who have an extra Pi3 laying around. It would be BETTER if you had avoided showing a newer Pi than can be used. ALSO you sort of suggested you might do OTHER bare metal emulators... how about Color Computer 3?

  • @pesto12601

    @pesto12601

    6 ай бұрын

    Wait.. so a video he posted 6 days ago showing a pi4 is NOT correct? This will only work with a pi3 and lower still? Poor if so... when was this video ACTUALLY made?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Sorry for the confusion. I simply pulled a stock image of a Raspberry Pi out. Yes it is still for Pi3 and below. Runs great on a Pi Zero 2W. So this does help keep the cost down. I do plan to cover at least the ZX Spectrum as a bare metal machine. I'll also be looking at building replica machines using original cases and keyboards as that is the natural progression for the project.

  • @ddud4966
    @ddud49666 ай бұрын

    I tried to accomplish a similar thing by writing a bare metal GameBoy emulator but the problem with a RaspberryPI you can't really get under 2-3 seconds because the VideoCore chip has to boot this proprietary blob first before you even get to run any code on the ARM core. You're kind of running on the "slave" CPU in the case of a Raspberry PI. But still it's way faster than the Linux distros.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Sounds like a great project. I guess there's always going to be some sort of start up time with the modern electronics. We're a long way from a simple processor hooked up to some logic and memory chips.

  • @networkg
    @networkg3 ай бұрын

    I was just watching a pi pico based usb adapter for an original C64 keyboard . Add that to bare metal emulation and you might have to check the ports before you know if it is real.

  • @BytesNBits

    @BytesNBits

    3 ай бұрын

    The bare metal emulator can read a real keyboard directly - have a look at kzread.info/dash/bejne/qICOrY-pmM2cc6Q.html

  • @BadKarma714
    @BadKarma7142 ай бұрын

    So how can I get my raspberry pie to run MS basic so I can program

  • @BytesNBits

    @BytesNBits

    2 ай бұрын

    The emulator will drop you into the standard C64 basic system.

  • @kebabimpaler
    @kebabimpaler6 ай бұрын

    An interesting video for an interesting approach, though I do wonder how measurable the advantages are for running baremetal vs a stripped down linux based distribution in terms of boot time and latency especially with M.2 HAT support or even running the entire distro off a ramdrive / initrd target. I can imagine trying to get things like bluetooth and wi-fi working is all sorts of fun for the developer when it's not provided out of the box by an off the shelf OS.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    You've got a good point on the speed side. I guess this set up gives you a more minimal set of components - just the Pi and an SD card. Makes it great for embedding into a replica device. As you say. Bluetooth and WiFi you can probably forget about those!

  • @timrichter1980

    @timrichter1980

    6 ай бұрын

    You could measure the latency by just recording with a camera or even a smartphone. Write a short program in basic that makes a beep when pressing a key. Record it, smash a button loud enough so that it gets recorded. Then, when you import the video into an appropiate video editor, you could measure the miliseconds it took between the button press and the sound playback.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I think the 8BitGuy did measure the latency. If you look on the BMC64 website I think they give links to his video.

  • @rkadowns

    @rkadowns

    6 ай бұрын

    It’s a significant difference and carful work has been done to optimize video sync for modern displays. I truly cannot tell I’m not using real hardware when combined with a real case and keyboard until I need to jump into the vice menu or attach devices/disks.

  • @user-tt1py9or9v
    @user-tt1py9or9v5 ай бұрын

    Is it possible to make bare metal emulation on the old netbooks? :)

  • @BytesNBits

    @BytesNBits

    5 ай бұрын

    Bare metal emulation tends to be for single board computers and microcontrollers. For an old netbook you can use a light linux distro and get it to boot through to the emulator to achieve a similar effect.

  • @Okurka.
    @Okurka.6 ай бұрын

    I wish it could emulate CMD's SuperCPU, Harddrive and RAMlink like Vice can.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    It would be great to see the project develop further. But I guess it does most of what you could want it to on the C64 side.

  • @OldAussieAds
    @OldAussieAds6 ай бұрын

    Is there a way to interface a real 1541 disk drive to the Pi?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I don't think so. You'd need to do a bit of research on the web. BMC64 doesn't offer it.

  • @JamesEzell
    @JamesEzell6 ай бұрын

    is there a bare metal emulator for Amiga?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I haven't seen a true bare metal one. But there are a number of Amiga OS emulators such as Amibian, Amiberry, etc. Some come as bootable SD card images so will boot straight into the Amiga, even though they are running on top of a Linux distro.

  • @blooddude

    @blooddude

    5 ай бұрын

    I started one several years ago, called Omega (sources on GitHub)... But I never managed to complete it.

  • @Polydeukes68

    @Polydeukes68

    2 ай бұрын

    Isn't Emu68 a bare metal emulator or at least a one that is very close to one? As far as I know there is no OS below it (?).

  • @blooddude

    @blooddude

    2 ай бұрын

    @@Polydeukes68Emu68 is just a 68k CPU emulator, as far as I know, and still requires either real Amiga hardware or some extra Amiga emulator software.

  • @jhhoward
    @jhhoward6 ай бұрын

    You might be interested in Faux86, my bare metal x86 emulator for Raspberry Pi.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I did have a look at that. Great project. I am planning to give it a go. Especially as I won't need any specialist keyboards / cases to create a replica machine. Can I just ask how good to sound emulation is. I've done a couple of videos on DOS gaming PCs and sound was the biggest issue with native DOS solutions.

  • @jhhoward

    @jhhoward

    6 ай бұрын

    @@BytesNBits Adlib emulation is done using the nuked opl3 library which is pretty good. There is PC speaker and Sound blaster emulation too. EGA/VGA isn't fully implemented but some games work. CGA and text modes should work correctly.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Sounds good to me. I'll definitely give it a go in the next couple of weeks. Thanks.

  • @phil2768
    @phil27686 ай бұрын

    It hasn't been updated for 2 years 😞

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Yes. It's a shame. But using a newer, more powerful Pi would be bit of a waste. Pi3 or 2W works great and halves the cost, especially if you've got one lying in a drawer. Everything works great so not really a need to update the code.

  • @rkadowns

    @rkadowns

    6 ай бұрын

    Let me try this again as it seems the KZread overloads smashed my last post. Version 4.1 has been released on the lemon64 forums. This version adds CMD hard drive support if that is desired. The official release should make its way to the softwares official site soon.

  • @glenhumphrey8822
    @glenhumphrey88226 ай бұрын

    What's windows?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Magical devices that let you see through solid brick walls.

  • @gmichie1
    @gmichie16 ай бұрын

    I'm told it does not work on RP4. That sucks. I'm bummed.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Yes. It's for the Pi3 and below. If you've got an old one lying around it's perfect to get it back in action. Otherwise you can pick up a Pi Zero quite cheaply.

  • @rkadowns

    @rkadowns

    6 ай бұрын

    The 3b+, which is fast enough to support dual/stereo SID playback and decent shaders, are plentiful on the US Amazon storefront. If you’re not in the US, hopefully they are where you are also.

  • @gmichie1
    @gmichie16 ай бұрын

    OK, I built this out on the RP4B 32GB SD card twice now. Following your instructions each time. I do not get any video what so ever. I tried moving the SD card to RP4B with 4 MB RAM. Same thing. No video. I removed the SD card and rebooted. I see the RP boot prom screen. I'm using a HDMI TV for my screen. Any suggestions would be welcomed. Has anyone else got this to work? I'm in the USA and I just found that the default video setting are for HDMI PAL at 50 Hz. I do not see where to change these setting in the machine.txt file to HDMI/NTSC/60 Hz.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I think I answered in your other comment. The BMC64 hasn't yet released a Pi4 or 5 version. Anything else will work. It doesn't list the Pi Zero 2 but that should work using the Pi3 image and give very similar performance. I'll try it out on mine.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Just tested and the Pi Zero 2 works great with the Pi3 image.

  • @gmichie1

    @gmichie1

    6 ай бұрын

    Will the fact that I am in the USA NTSC be a problem? Will I need to change the default from PAL to NTSC in some config file?

  • @gmichie1

    @gmichie1

    6 ай бұрын

    Would this be the same as a Pi Zero 2 W?

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    @@gmichie1 Sorry. Yes. I meant Pi Zero 2W. The NTSC and PAL settings in the emulator are separate from your actual display. You can emulate any machine and any display type you want and it will still work on your Raspberry Pi setup. I think the timings and processor speeds vary a little between NTSC and PAL machines but that's all handled in the emulator. Hope you get it working!

  • @SenileOtaku
    @SenileOtaku6 ай бұрын

    FUCK KZread's ad-blocker blocker. If they didn't slam ads RIGHT IN THE MIDDLE of videos I'd still let them through. So yet ANOTHER video I won't be watching. No loss.

  • @superscatboy

    @superscatboy

    6 ай бұрын

    Don't be such a drama queen.

  • @elmariachi5133
    @elmariachi51336 ай бұрын

    With more performant SBCs bare metal emulation can become a serious competitor to overpriced FPGA solutions. Too bad that after all these crises SBCs still are too expensive either ...

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Things can get costly. I guess you need to find a happy balance between accuracy of emulation and price.

  • @elmariachi5133

    @elmariachi5133

    6 ай бұрын

    @@BytesNBits That'S why I still have retro hardware for the games I like most. Playing them without any annoyances, like stuttering, asychronous sound or other didn't work for me in emulation, yet - even on very performant PC hardware. Geuine retro hardware might be expensive - but it's less expensive than always having the most recent high end hardware :) Still I hope for there to be a all-i-one 'perfect' solution for most or even all retro systems, which would just save a lot of work, time and space one day.

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    I guess I'm at the other end of the spectrum where I've avoided original hardware exactly for the reasons you state. Having said that I did like this bare metal version so I've ordered case/keyboards for a C64 and ZX Spectrum to have a go at building replica machines.

  • @ScandalUK

    @ScandalUK

    6 ай бұрын

    I like using a MiSTer for old TVs, I used an adapter for my original floppy drive too!

  • @Tmhlink
    @Tmhlink6 ай бұрын

    Would have loved to watch, but gave up. KZread inserting commercials every 2 minutes makes it unwatchable. :(

  • @BytesNBits

    @BytesNBits

    6 ай бұрын

    Sorry to hear that. That seems like an unusually high number of ads. My settings are all at KZread's default settings.

  • @Tmhlink

    @Tmhlink

    6 ай бұрын

    @@BytesNBits yeah, I don't that think you did anything wrong. It youtube. I'll try again in a couple of days.

  • @ferrellsl
    @ferrellsl6 ай бұрын

    FFS, bare metal emulation is an oxymoron unless you're using an FPGA.

  • @jimbotron70

    @jimbotron70

    6 ай бұрын

    No, it's not. Take the OS off the equation and you get a substantial performance boost.

  • @ferrellsl

    @ferrellsl

    6 ай бұрын

    @@jimbotron70 What OS do you propose to take off the equation? Linux? Because without Linux, you're not getting ANYTHING. This thing is still running Linux or another OS and it still has all the Linux underpinnings that get started up at boot time along with the emulator that gets run on top. There's no such thing as "bare metal emulation" unless you're emulating with an FPGA.

  • @jimbotron70

    @jimbotron70

    6 ай бұрын

    @@ferrellsl Wrong. Bare metal means running a program bypassing completely the OS. Just as bootdisk games did on the Amiga and on DOS.

  • @ferrellsl

    @ferrellsl

    6 ай бұрын

    @@jimbotron70 This emulation is not bypassing the R Pi''s OS. Linux or an ARmbian kernel is still running underneath with a C64 emulator running on top. This is nothing like a boot disk that takes over an Amiga's hardware. Just because you're not seeing a Gnome/KDE or LXDE desktop doesn't mean that this is some sort of bare metal system. It is not. There is an emulator running on top that emulates the the 6502 and all the other C64 chips. A Linux kernel boots the hardware and instead of loading a desktop environment, it loads the emulator. If not, then how do you explain a C64 accessing an SD card or a hard disk or network interface or USB devices? It can't, not without an underlying OS such as Linux or Armbian to handle that. And how do you think the C64's 6502 instructions get translated to run on the Pi's ARM processor? I'll go ahead and answer that for you. By an emulator.

  • @jimbotron70

    @jimbotron70

    6 ай бұрын

    @@ferrellsl According to a randomly googled page "like a standard emulator a bare metal emulator runs programs intended for one system on another. The difference is that there is no underlying operating system; the emulator runs on the "bare metal" of the computer"

Келесі