Beeb emulator on Raspberry Pi

discuss bbc micro and electron emulators (including mame) here!
User avatar
ash73
Posts: 223
Joined: Wed Feb 03, 2016 10:51 pm
Location: Cheshire, UK
Contact:

Beeb emulator on Raspberry Pi

Post by ash73 »

Was thinking of getting a Pi 400 to run a BBC Model B emulator, among other things.

What emulator is best?
User avatar
JasonStonier
Posts: 451
Joined: Mon Dec 10, 2018 8:10 pm
Location: Dorset
Contact:

Re: Beeb emulator on Raspberry Pi

Post by JasonStonier »

If you're talking Linux on the Pi then nothing is particularly great, unfortunately.

Beebem works ok-ish if you compile it yourself, but I've never got sound working properly.

I've had most success with B-Em, which isn't designed to run on the Pi but does - however for reasons unknown I had to set the speed to about 400% to get it to run at 2MHz.

However if you run RiscOS 5, I've heard good things about BeebIT - haven't tried it myself, but intend to when I get a spare moment to play with RiscOS.
User avatar
ash73
Posts: 223
Joined: Wed Feb 03, 2016 10:51 pm
Location: Cheshire, UK
Contact:

Re: Beeb emulator on Raspberry Pi

Post by ash73 »

Seems strange, given the rPi is the Beeb's spiritual successor you'd expect there to be a good emulator.

I tried MAME earlier on but couldn't get it to compile (but I don't really know what I'm doing).

I also tried BeebIt on Arculator (PC) too, but couldn't get it to work. Didn't try it on the Pi.
User avatar
BigEd
Posts: 6281
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Beeb emulator on Raspberry Pi

Post by BigEd »

It does seem like an oddity - and now that the Pi 4 is out, even more of an oddity than with the Pi 1, so many years ago.

Is jsbeeb any good, in a browser, on the Pi 4?
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by scarybeasts »

JasonStonier wrote: Wed Dec 02, 2020 6:50 pm If you're talking Linux on the Pi then nothing is particularly great, unfortunately.
What would make a great emulator for Linux? beebjit is developed primarily on Linux, so I'm interested in how it can be better.

Regarding the Pi, beebjit won't compile yet on ARM64 (because JIT!) but that is something I'm excited to look into in order. Assuming I get it compiling (and even JIT'ing natively on ARM64), what else would be useful?


Cheers
Chris
User avatar
ash73
Posts: 223
Joined: Wed Feb 03, 2016 10:51 pm
Location: Cheshire, UK
Contact:

Re: Beeb emulator on Raspberry Pi

Post by ash73 »

scarybeasts wrote: Wed Dec 02, 2020 8:23 pm What would make a great emulator for Linux?
Something that works?
User avatar
BigEd
Posts: 6281
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Beeb emulator on Raspberry Pi

Post by BigEd »

Hmm, a bit harsh, I think. Linux is fine, arguably the Pi is fine, but Linux on Pi is a platform which doesn't seem to offer the performance.

If a Beeb emulator on RISC OS works fine, and it sounds like it does, then there's certainly hope. But - if you can't do it yourself - you need to get someone, or some people, interested in trying to solve the problem. Best not to use harsh words, in that case.
User avatar
KenLowe
Posts: 4703
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Beeb emulator on Raspberry Pi

Post by KenLowe »

How about getting Android running on the PI, and then getting this version of B-Em running on it:

viewtopic.php?f=4&t=17470&p=242139

TBH, I have no idea if this is remotely possible!
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by scarybeasts »

BigEd wrote: Wed Dec 02, 2020 9:04 pm Hmm, a bit harsh, I think. Linux is fine, arguably the Pi is fine, but Linux on Pi is a platform which doesn't seem to offer the performance.
Apparently, beebjit non-JIT mode (interpreter) runs at about 1GHz on a Pi4. That's 500x speed of a real beeb, so I don't think Linux on a modern Pi is struggling.
I need to get a Pi 400, try it myself, make it compile without a headache, and add the JIT "for a laugh".


Cheers
Chris
User avatar
ash73
Posts: 223
Joined: Wed Feb 03, 2016 10:51 pm
Location: Cheshire, UK
Contact:

Re: Beeb emulator on Raspberry Pi

Post by ash73 »

BigEd wrote: Wed Dec 02, 2020 9:04 pm Hmm, a bit harsh, I think.
Sorry I didn't mean to be rude, obviously very grateful for work done to date e.g. BeebEm is fab on the PC.

It would be nice if you could buy the Pi 400 in a Beeb livery running a decent emulator, rather than cluttering up the house with old hardware... Maybe a business opportunity for someone?

If developers are looking for ideas, why not go beyond emulation to enhancement? 80 column teletext mode? 16 proper colours? GPIO pins I/O? Variable speed / fixed fps, for games like Elite?

It must be possible to get the performance out of a Pi, given it runs multiple times faster as a second processor? Says he who knows nothing... :)
User avatar
JasonStonier
Posts: 451
Joined: Mon Dec 10, 2018 8:10 pm
Location: Dorset
Contact:

Re: Beeb emulator on Raspberry Pi

Post by JasonStonier »

scarybeasts wrote: Wed Dec 02, 2020 10:18 pm
BigEd wrote: Wed Dec 02, 2020 9:04 pm Hmm, a bit harsh, I think. Linux is fine, arguably the Pi is fine, but Linux on Pi is a platform which doesn't seem to offer the performance.
Apparently, beebjit non-JIT mode (interpreter) runs at about 1GHz on a Pi4.
I did not know that. I've got a feeling I tried to get beebjit going a while back and had no success - probably says more about me than it says about beebjit, though.

As you say: BBC emulators on Linux are fine (and actually beebem compiled in Linux on x86 is fine - sound and all), but my clumsy point was that I've struggled with BBC emulation on Linux on a Pi 4.
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by scarybeasts »

JasonStonier wrote: Wed Dec 02, 2020 10:48 pm
scarybeasts wrote: Wed Dec 02, 2020 10:18 pm
BigEd wrote: Wed Dec 02, 2020 9:04 pm Hmm, a bit harsh, I think. Linux is fine, arguably the Pi is fine, but Linux on Pi is a platform which doesn't seem to offer the performance.
Apparently, beebjit non-JIT mode (interpreter) runs at about 1GHz on a Pi4.
I did not know that. I've got a feeling I tried to get beebjit going a while back and had no success - probably says more about me than it says about beebjit, though.
No, I think it's beebjit, not you :-) beebjit should reasonably be expected to "just compile" on non-x86_64 targets. I'll get to it shortly. Have to decide between buying a Pi 400 or using a free-tier AWS Graviton.....


Cheers
Chris
User avatar
scruss
Posts: 653
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: Beeb emulator on Raspberry Pi

Post by scruss »

JasonStonier wrote: Wed Dec 02, 2020 6:50 pm I've had most success with B-Em, which isn't designed to run on the Pi but does - however for reasons unknown I had to set the speed to about 400% to get it to run at 2MHz.
b-em is polished if not super-fast on a Raspberry Pi. It seems to struggle with updating the screen quickly under Linux. There may be some config possible in the Allegro libraries it uses to use the screen display more efficiently.
User avatar
richardtoohey
Posts: 4075
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Beeb emulator on Raspberry Pi

Post by richardtoohey »

scarybeasts wrote: Wed Dec 02, 2020 10:58 pmHave to decide between buying a Pi 400 or using a free-tier AWS Graviton.....
Decisions are too hard - just do both! :D :wink:
kilog
Posts: 51
Joined: Mon Jul 13, 2020 2:58 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by kilog »

I have been slowly working on a b-em derived emu for Pi (obviously there was some major tinkering under the hood).. seems like I really should hint at its existence. here is a little video from a Pi Model 2B

https://streamable.com/cts3qh

Not that you don't really need to run multiple at once, but just doing so to give an idea for speed. Frame rate is good even with larger expanded windows.

I'm not releasing this until early in the New Year for various reasons, at which point it'll be available source code and all, but wanted to let y'all know it is coming!

Works great except on a Pi 1 or Pi zero.

P.S. shout out to bithsifters for the great demos!
User avatar
ash73
Posts: 223
Joined: Wed Feb 03, 2016 10:51 pm
Location: Cheshire, UK
Contact:

Re: Beeb emulator on Raspberry Pi

Post by ash73 »

That's fab, thanks for sharing the news! 8)
User avatar
JasonStonier
Posts: 451
Joined: Mon Dec 10, 2018 8:10 pm
Location: Dorset
Contact:

Re: Beeb emulator on Raspberry Pi

Post by JasonStonier »

kilog wrote: Thu Dec 03, 2020 2:03 am I have been slowly working on a b-em derived emu for Pi...
You can't see it, but I'm currently displaying my happy face.
Deleted User 9295

Re: Beeb emulator on Raspberry Pi

Post by Deleted User 9295 »

ash73 wrote: Wed Dec 02, 2020 10:32 pmIf developers are looking for ideas, why not go beyond emulation to enhancement?
Indeed why not abandon 6502 emulation entirely and run a modern native version of BBC BASIC? :lol:

Sadly no Elite though!
User avatar
BigEd
Posts: 6281
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Beeb emulator on Raspberry Pi

Post by BigEd »

kilog wrote: Thu Dec 03, 2020 2:03 am I have been slowly working on a b-em derived emu for Pi ... wanted to let y'all know it is coming!
Sounds excellent!

(I had a couple of thoughts... one was that just maybe browsers on the Pi run WASM well, in which case that's a possible technology. And another was, if screen updates are a major bottleneck, maybe a direct to framebuffer application would be a winner. And another was, if twizzling the screen memory addresses is a major obstacle to getting pixels on the screen, maybe the Pi's GPU can be brought into play. And another was, on a multi-core Pi you can tell Linux to leave one core alone and dedicate it to a single application, or even run baremetal code on it.)
Deleted User 9295

Re: Beeb emulator on Raspberry Pi

Post by Deleted User 9295 »

BigEd wrote: Thu Dec 03, 2020 11:18 amif screen updates are a major bottleneck, maybe a direct to framebuffer application would be a winner.
There's no problem updating the screen via SDL2 (which is what my BASIC uses); it's GPU accelerated too. I can't speak for Allegro, the other major abstraction layer, but I wouldn't have expected that to be any different. Alternatively one could go straight to OpenGL or OpenGLES and bypass the middleman.

Honestly I don't think there is any screen update "bottleneck" on the Pi running Linux (Raspbian) if it can do this, programmed in BBC BASIC (no assembler):



If the embedded video doesn't play for you, here's a direct link.
User avatar
BigEd
Posts: 6281
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: Beeb emulator on Raspberry Pi

Post by BigEd »

That is very impressive!

As ever with performance questions, a guess (like all my guesses) isn't worth nearly as much as a measurement. Ever since the Pi came out I've hoped we could have a boot-to-fullscreen-Beeb emulation for it - and that was when all we had was a Pi 1!

I see that BMC64 is a baremetal port of the VICE model of four Commodore machines, and works well on Pi2 and up. Maybe that's a possible way forwards?
Last edited by BigEd on Thu Dec 03, 2020 1:06 pm, edited 1 time in total.
User avatar
tricky
Posts: 7716
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by tricky »

That has nearly tipped me over the edge with a Pi 400.
Does it have the NuLA code? (colour not scrolling)
two buttons on a joystick?
two sticks with a button each?
mouse as analogue stick?

Hey it's nearly xmas, might as well get your wish list in early :)
User avatar
JasonStonier
Posts: 451
Joined: Mon Dec 10, 2018 8:10 pm
Location: Dorset
Contact:

Re: Beeb emulator on Raspberry Pi

Post by JasonStonier »

BigEd wrote: Thu Dec 03, 2020 12:52 pm Ever since the Pi came out I've hoped we could have a boot-to-fullscreen-Beeb emulation for it - and that was a Pi 1!
I've kind-of got that on my Cherry Pi (homebuilt equivalent to Pi 400) - I boot to a minimal Openbox environment with an Openbox startup script which starts B-Em. Courtesy of a mate with skillz, there's a version of B-Em that takes a speed variable inline with the terminal command, so I start B-Em at 400% which makes it hover around 2MHz. It's usable, but the speed variability thing is frustrating with things like Chuckie Egg which depend on pretty precise reaction to the user input.
User avatar
JasonStonier
Posts: 451
Joined: Mon Dec 10, 2018 8:10 pm
Location: Dorset
Contact:

Re: Beeb emulator on Raspberry Pi

Post by JasonStonier »

kilog wrote: Thu Dec 03, 2020 2:03 am I have been slowly working on a b-em derived emu for Pi
By the way - if you were to get this out and working, I'd happily pay for a licence or make a donation.

I use an Amiga Emulator called Amibian, and I donated to the author of that in a similar way - I believe in recognising the efforts of people who do things I can't do myself :D
kilog
Posts: 51
Joined: Mon Jul 13, 2020 2:58 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by kilog »

tricky wrote: Thu Dec 03, 2020 1:05 pm Does it have the NuLA code? (colour not scrolling)
Yes... given this and some of the questions here, I'm not sure that people are able to watch the video above? (https://streamable.com/cts3qh)

Yup frogger looks correct :-)
two buttons on a joystick?
two sticks with a button each?
mouse as analogue stick?
Hey it's nearly xmas, might as well get your wish list in early :)
These should be easy enough to add.

I forgot to give a shout out to b-em which my emu is based on; thanks to its author(s). I do need to do a little work to add back joystick support, just because of the way 6502 execution/hardware interaction now works.
Last edited by kilog on Thu Dec 03, 2020 2:57 pm, edited 2 times in total.
kilog
Posts: 51
Joined: Mon Jul 13, 2020 2:58 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by kilog »

color, not scrolling, correct :-) no scrolling, or weird video modes
kilog
Posts: 51
Joined: Mon Jul 13, 2020 2:58 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by kilog »

User avatar
tricky
Posts: 7716
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by tricky »

Thanks, I did watch the video, but the colours didn't register! #-o
User avatar
ash73
Posts: 223
Joined: Wed Feb 03, 2016 10:51 pm
Location: Cheshire, UK
Contact:

Re: Beeb emulator on Raspberry Pi

Post by ash73 »

kilog wrote: Thu Dec 03, 2020 2:14 pm A little frogger & scramble:

https://streamable.com/yqva5g
https://streamable.com/mylum9
Looking great.

The mode 7 font looks good, it's so much nicer than pixelated text in other modes; people underestimate how important it is. Never understood why they didn't emulate it better on the Archie.

One thing I'd like to ask if I may, can you copy and paste from the desktop into your emulator? This is important for developers. With BeebEm on the PC I edit my programs in Notepad++ and paste them into BeebEm to run, either with line numbers already in the text or using AUTO.
kilog
Posts: 51
Joined: Mon Jul 13, 2020 2:58 am
Contact:

Re: Beeb emulator on Raspberry Pi

Post by kilog »

Not right now, I was just trying to get games playable, so have added some build defines to disable some bits of b-em i haven't gotten around to making work in the new world. Paste is not a very invasive feature... don't expect a debugger any time soon tho! (though the code base can still build as regular vanilla b-em - even on Pi, so you can always use that!)
Post Reply

Return to “8-bit acorn emulators”