Beeb emulator on Raspberry Pi
Beeb emulator on Raspberry Pi
Was thinking of getting a Pi 400 to run a BBC Model B emulator, among other things.
What emulator is best?
What emulator is best?
- JasonStonier
- Posts: 451
- Joined: Mon Dec 10, 2018 8:10 pm
- Location: Dorset
- Contact:
Re: Beeb emulator on Raspberry Pi
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.
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.
Re: Beeb emulator on Raspberry Pi
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.
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.
Re: Beeb emulator on Raspberry Pi
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?
Is jsbeeb any good, in a browser, on the Pi 4?
- scarybeasts
- Posts: 1052
- Joined: Tue Feb 06, 2018 7:44 am
- Contact:
Re: Beeb emulator on Raspberry Pi
What would make a great emulator for Linux? beebjit is developed primarily on Linux, so I'm interested in how it can be better.JasonStonier wrote: ↑Wed Dec 02, 2020 6:50 pm If you're talking Linux on the Pi then nothing is particularly great, unfortunately.
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
Re: Beeb emulator on Raspberry Pi
Something that works?
Re: Beeb emulator on Raspberry Pi
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.
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.
Re: Beeb emulator on Raspberry Pi
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!
viewtopic.php?f=4&t=17470&p=242139
TBH, I have no idea if this is remotely possible!
- scarybeasts
- Posts: 1052
- Joined: Tue Feb 06, 2018 7:44 am
- Contact:
Re: Beeb emulator on Raspberry Pi
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
Re: Beeb emulator on Raspberry Pi
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...
- JasonStonier
- Posts: 451
- Joined: Mon Dec 10, 2018 8:10 pm
- Location: Dorset
- Contact:
Re: Beeb emulator on Raspberry Pi
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.scarybeasts wrote: ↑Wed Dec 02, 2020 10:18 pmApparently, beebjit non-JIT mode (interpreter) runs at about 1GHz on a Pi4.
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.
- scarybeasts
- Posts: 1052
- Joined: Tue Feb 06, 2018 7:44 am
- Contact:
Re: Beeb emulator on Raspberry Pi
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.....JasonStonier wrote: ↑Wed Dec 02, 2020 10:48 pmI 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.scarybeasts wrote: ↑Wed Dec 02, 2020 10:18 pmApparently, beebjit non-JIT mode (interpreter) runs at about 1GHz on a Pi4.
Cheers
Chris
Re: Beeb emulator on Raspberry Pi
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.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.
- richardtoohey
- Posts: 4075
- Joined: Thu Dec 29, 2011 5:13 am
- Location: Tauranga, New Zealand
- Contact:
Re: Beeb emulator on Raspberry Pi
Decisions are too hard - just do both!scarybeasts wrote: ↑Wed Dec 02, 2020 10:58 pmHave to decide between buying a Pi 400 or using a free-tier AWS Graviton.....
Re: Beeb emulator on Raspberry Pi
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!
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!
Re: Beeb emulator on Raspberry Pi
That's fab, thanks for sharing the news!
- JasonStonier
- Posts: 451
- Joined: Mon Dec 10, 2018 8:10 pm
- Location: Dorset
- Contact:
Re: Beeb emulator on Raspberry Pi
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.)
Re: Beeb emulator on Raspberry Pi
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.
Re: Beeb emulator on Raspberry Pi
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?
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.
Re: Beeb emulator on Raspberry Pi
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
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
- JasonStonier
- Posts: 451
- Joined: Mon Dec 10, 2018 8:10 pm
- Location: Dorset
- Contact:
Re: Beeb emulator on Raspberry Pi
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.
- JasonStonier
- Posts: 451
- Joined: Mon Dec 10, 2018 8:10 pm
- Location: Dorset
- Contact:
Re: Beeb emulator on Raspberry 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
Re: Beeb emulator on Raspberry Pi
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
These should be easy enough to add.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
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.
Re: Beeb emulator on Raspberry Pi
color, not scrolling, correct no scrolling, or weird video modes
Re: Beeb emulator on Raspberry Pi
Thanks, I did watch the video, but the colours didn't register!
Re: Beeb emulator on Raspberry Pi
Looking great.kilog wrote: ↑Thu Dec 03, 2020 2:14 pm A little frogger & scramble:
https://streamable.com/yqva5g
https://streamable.com/mylum9
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.
Re: Beeb emulator on Raspberry Pi
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!)