RP2040/Pico beeb emulator

discuss bbc micro and electron emulators (including mame) here!
User avatar
lushprojects
Posts: 148
Joined: Mon Jan 18, 2021 4:02 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by lushprojects »

billbates wrote: Wed Mar 22, 2023 1:18 am I've gone through some of the code myself but it all seems patched together which makes it much more difficult to work on. I think if the code could be spilt between cores then the pico would be more than capable of "spinning the plates" so to speak.

...

For what it's worth I certainly appreciate your effort to improve the functionality of the USB side of things.
Yes, I got the same impression it was done quickly for a demo, and not with a view to long-term support. I never tried to figure out architecturally how things were split between the cores and the PIOs, but I suspect if optimized there was a lot more performance that could be obtained.

I went back and read my own post (http://www.lushprojects.com/beebemulation/) and the reason for not working further was that I couldn't fathom the strange bug I had on modifier keys.

Thanks for the appreciation. It would be really nice if someone has the time and skills to really get this going.
billbates
Posts: 5
Joined: Mon Mar 20, 2023 6:05 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by billbates »

Well I have the skills but unfortunately my time is limited as I work full time and need more sleep now I'm pushing the 40's :cry:
I've written a few keyboard controller libraries in the past, my last one was a USB HID controller running directly on a vanilla ATMega328 using bit-banging functions. I'm sure I can have a look at the modifier problem in your code and have a go at fixing it. I'm thinking of porting all the video and graphical code over to PicoVGA to seperate the USB and Video conflicts.
User avatar
lushprojects
Posts: 148
Joined: Mon Jan 18, 2021 4:02 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by lushprojects »

I can't recall if the modifier problem was fixed in the latest tinyUSB library. I think it might have been.

You're a young'un compared to me, but I understand!
billbates
Posts: 5
Joined: Mon Mar 20, 2023 6:05 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by billbates »

Yeah, seems to work ok for me, SHIFT and CTRL work as expected but keyboard LED's don't.
I thought I was "old" when I hit 30! I got tired of listening to people telling me it was all down hill when I hit 40. :(
I guess you're old or young as you feel :P

BTW. when i said all the code seemed patched together, this by no way was a negative comment to the work done by kilograham porting it to pico. Thought I'd make that clear in case he reads it.
User avatar
lushprojects
Posts: 148
Joined: Mon Jan 18, 2021 4:02 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by lushprojects »

billbates wrote: Wed Mar 22, 2023 8:58 pm Yeah, seems to work ok for me, SHIFT and CTRL work as expected but keyboard LED's don't.
I thought I was "old" when I hit 30! I got tired of listening to people telling me it was all down hill when I hit 40. :(
I guess you're old or young as you feel :P
Yes, the LEDs don't work. I did try and implement that, but it never did anything.
BTW. when i said all the code seemed patched together, this by no way was a negative comment to the work done by kilograham porting it to pico. Thought I'd make that clear in case he reads it.
+1 it's a really cool project
billbates
Posts: 5
Joined: Mon Mar 20, 2023 6:05 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by billbates »

Reading through this topic I see quite an old post about the HSYNC and VSYNC lines affecting the stability of the video and usb. I have found that building this emulator on a breadboad will cause a few stability issues with stray capacitance and not so good connections. The circuit also needs a very clean power supply as some 5V USB power adapters and cables introduce lots of noise in the power rail. I was having constant video drop outs and could not understand why, after a few hours of fault finding I finally found the cause to be the wall outlet usb socket I was using.
Thought I'd mention this for anyone else experiencing these issues.
kilog
Posts: 51
Joined: Mon Jul 13, 2020 2:58 am
Contact:

Re: RP2040/Pico beeb emulator

Post by kilog »

billbates wrote: Wed Mar 22, 2023 8:58 pm BTW. when i said all the code seemed patched together, this by no way was a negative comment to the work done by kilograham porting it to pico. Thought I'd make that clear in case he reads it.
Ha - yes getting it running (and at speed) was the only goal ;-)

I haven't been here in a while; i should update the code with proper keyboard support now that TinyUSB host mode works!
lchile
Posts: 6
Joined: Thu Jan 25, 2024 11:33 am
Contact:

Re: RP2040/Pico beeb emulator

Post by lchile »

kilog wrote: Tue Apr 04, 2023 11:29 pm
billbates wrote: Wed Mar 22, 2023 8:58 pm BTW. when i said all the code seemed patched together, this by no way was a negative comment to the work done by kilograham porting it to pico. Thought I'd make that clear in case he reads it.
Ha - yes getting it running (and at speed) was the only goal ;-)

I haven't been here in a while; i should update the code with proper keyboard support now that TinyUSB host mode works!
Please can I vote that it would be fantastic if you have the time to do this. Thanks for what you have done already.
mbernardi
Posts: 19
Joined: Wed Sep 20, 2017 11:14 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by mbernardi »

Since this version also works as a bare metal edition on the Raspberry Pi family, is there any chance that a bootable image ccould be created, so for example a RPi400 could boot up as a BBC. With the SD card (or usb stick) acting as a drive for programs.
User avatar
scruss
Posts: 653
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: RP2040/Pico beeb emulator

Post by scruss »

mbernardi wrote: Thu Feb 15, 2024 3:15 pm Since this version also works as a bare metal edition on the Raspberry Pi family, ...
It does? I haven't seen any mention of bare metal Raspberry Pi compatibility. Pico compatibility, yes, but everything's bar metal on the Pico.
mbernardi
Posts: 19
Joined: Wed Sep 20, 2017 11:14 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by mbernardi »

From the readme.md on https://github.com/kilograham/b-em

The sole reason for this project's existence was to get a BBC B/Master 128 emulator running on the Raspberry Pi Pico. It supports building on other platforms (particularly Pi) however that was not the initial intent, and the Pi version may be missing features you would like (since it has the same feature set as the Pico version). This may be addressed in the future, but is not high on my priority list at least, since most games can already be played.
User avatar
scruss
Posts: 653
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: RP2040/Pico beeb emulator

Post by scruss »

mbernardi wrote: Fri Feb 23, 2024 10:48 am From the readme.md on https://github.com/kilograham/b-em
Ah, that's not what most people would consider “a bare metal edition on the Raspberry Pi family”. The Raspberry Pi Pico is a micro-controller board, it's not a Raspberry Pi computer. True, it has no OS, so it is running pretty close to the metal.

A bare-metal emulator on the Raspberry Pi would be something like bmc64, which runs on a Raspberry Pi computer, but without Linux, so it's bare metal.
mbernardi
Posts: 19
Joined: Wed Sep 20, 2017 11:14 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by mbernardi »

Maybe it isn't currently, but could it be made to be?
User avatar
scruss
Posts: 653
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: RP2040/Pico beeb emulator

Post by scruss »

It might, but it would be a lot of work for not a lot of gain. bmc64 is based on the Vice emulator, which has surprisingly few system dependencies. Raspberry Pi b-em relies on libraries that are pretty Linux-centric: tearing them out would require a lot of new code. Posting from Cortex-M0+ back to a Raspberry Pi wouldn't be trivial, if one went that route

I remember when some Raspberry Pi users considered Raspberry Pi OS (then called Raspbian) a stop-gap until RISC OS was properly ported and could run natively. It turns out that people grew to like Raspberry Pi OS, and RISC OS remained niche.
BitSeeker
Posts: 73
Joined: Fri Mar 30, 2018 2:18 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by BitSeeker »

Manged to get the project to compile and beeb.uf2 uploaded to a Pico. The Pico was then plugged into the Pimoroni VGA Demo board which was then connected via VGA cable to an LCD monitor. Upon power up, it produced the BBC banner and > prompt. So far so good! Thank you for making the project available.

I then tried it in a Pimoroni DV board connected via HDMI but there was no output from that board. I dare say the video output probably has to be driven differently so perhaps its not supported yet?

I intend to try it with the Sony PVM 1371QM monitor I have at some point once it is properly checked and confirmed to be working. In the meantime, I would like to ask which resolution I would need? Also, in order to test it further using the LCD monitor, how do I hook up the keyboard and mouse/controller?
BitSeeker
Posts: 73
Joined: Fri Mar 30, 2018 2:18 pm
Contact:

Re: RP2040/Pico beeb emulator

Post by BitSeeker »

Did a bit of digging regading the Pimoroni DV board and it seems this is not very well supported. Looking at the Pico SDK, as we already know, this does have a config parameter for the vgaboard (-DPICO_BOARD vgaboard) but no equivalent seems to exist for the DV (HDMI version) board. I guess its not going to work on that board without some deeper investigation into how HDMI output works on that board.
Post Reply

Return to “8-bit acorn emulators”