BeebEm Mac - Info

discuss bbc micro and electron emulators (including mame) here!
SteveBagley
Posts: 256
Joined: Sun Mar 15, 2015 8:44 pm
Contact:

Re: BeebEm Mac - Info

Post by SteveBagley » Thu Apr 02, 2020 11:24 pm

camsoft2000 wrote:
Thu Apr 02, 2020 5:31 pm
I guess it will need porting to Apple's Metal framework to future proof it for years to come.
Yea — although I doubt OpenGL will disappear for a long while…

Steve

kesterlester
Posts: 2
Joined: Sun Apr 12, 2020 5:21 pm
Contact:

Re: BeebEm Mac - Info

Post by kesterlester » Sun Apr 12, 2020 7:44 pm

SteveBagley wrote:
Thu Apr 02, 2020 5:12 pm

The compiled app (unsigned -- you'll need to right-click and select open to force macOS to run it) is jhere. With the Xcode project, here. Please bear in mind this was a hack I put together and not intended for release but people might find the source interesting. The UI is minimal, you can Load a disk image using the menu item, and click 'Start GL emulator' to start the emulator.
...
Steve
Is it expected that _BEEmulator.h is not in the xcode project you posted? See attached image of what x-code says after build is clicked ...
Attachments
moo.png

User avatar
camsoft2000
Posts: 39
Joined: Sun Mar 29, 2020 10:44 am
Contact:

Re: BeebEm Mac - Info

Post by camsoft2000 » Sun Apr 12, 2020 7:52 pm

kesterlester wrote:
Sun Apr 12, 2020 7:44 pm
SteveBagley wrote:
Thu Apr 02, 2020 5:12 pm

The compiled app (unsigned -- you'll need to right-click and select open to force macOS to run it) is jhere. With the Xcode project, here. Please bear in mind this was a hack I put together and not intended for release but people might find the source interesting. The UI is minimal, you can Load a disk image using the menu item, and click 'Start GL emulator' to start the emulator.
...
Steve
Is it expected that _BEEmulator.h is not in the xcode project you posted? See attached image of what x-code says after build is clicked ...
Compiles for me okay, it's actually `BEEmulator.h` that it's saying is not found, the underscore is just Xcode showing where the error relates to.

`BEEmulator.h` should be in the "BeebEmX" -> "Emulator" -> "OSX Support" Xcode group in the Project navigator. If it's missing you might need to re-add it to the Project as it's probably still on the filesystem.

SteveBagley
Posts: 256
Joined: Sun Mar 15, 2015 8:44 pm
Contact:

Re: BeebEm Mac - Info

Post by SteveBagley » Sun Apr 12, 2020 8:12 pm

kesterlester wrote:
Sun Apr 12, 2020 7:44 pm


Is it expected that _BEEmulator.h is not in the xcode project you posted? See attached image of what x-code says after build is clicked ...
It should be there -- it's certainly in the tar on the website. It should be found in: BeebEmX/BeebEmX/Emulator/BEEmulator.h

Steve

kesterlester
Posts: 2
Joined: Sun Apr 12, 2020 5:21 pm
Contact:

Re: BeebEm Mac - Info

Post by kesterlester » Sun Apr 12, 2020 11:48 pm

Thank you (both of you). It seems I had two problems. As one of you pointed out (which was helpful!) the underscore at the beginning of the file was debugger highlighting not really part of the filename. So, indeed, all files were present. The second problem I had was that none of the default include directories were being searched, apparently (and rather confusingly for me) because the "Signing->DevelopmentTeam" was set to "KLXRWJ9553" rather than to my developer account. The fact that I was not "KLXRWJ9553" had been flagged up in a third error message, however I didn't realise that fixing it would help the include paths. In most of the coding I do (which is not in xcode) there is no crosstalk between ability to search include paths and developer signing issues --- mainly because here is no such thing as developer signing in my day-to-day coding.

In case anyone else is (like me) not an xcode expert, and sees the same issue, you need to change the the "Development Team" line in the xcode settings page shown in the attached image. (NB: make sure BeebEmX TARGET not the BeenEmX PROJECT is shown in the dropdown near top left. The view defaults to showing the BeebEmX PROJECT settings, which don't seem to contain the developer view - at least for me.) In my case I changed the team to my own identity. When I'd done that, BEEmulator.h and other include files were correctly found, and the application built and ran for me. I checked this by re-downloading the supplied tar file, checking it didn't compile for me, making that one change, and then checking that it does compile. FWIW I am running XCode 11.3.1 in Catalina 10.15.3.

Sorry if this information is obvious to everyone else. It was not obvious to me.
Attachments
moo2.png

User avatar
camsoft2000
Posts: 39
Joined: Sun Mar 29, 2020 10:44 am
Contact:

Re: BeebEm Mac - Info

Post by camsoft2000 » Mon Apr 13, 2020 8:51 am

It’s generally easier to let Xcode manage code signing and on the General tab you can select your personal team and Xcode will take care of the rest so you don’t need to fiddle with the build settings.

AJW
Posts: 798
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: BeebEm Mac - Info

Post by AJW » Mon May 18, 2020 1:35 pm

Elminster wrote:
Mon Sep 03, 2018 1:34 pm
Might be interesting to know who is, might or would use BeebEm on Mac. i.e. for testing purposes. Currently we know of

Code: Select all

- Jon Welch (primary maintainer)
- You (guddler, maintainer helper in training?)
- Me (elminster)
- Lurkio
- Dave Hitchins
- geraldholdsworth
- Danielj
- mlouka
Anyone else?
I am too.

User avatar
Yrrah2
Posts: 448
Joined: Tue Feb 06, 2007 6:06 pm
Location: Netherlands
Contact:

Re: BeebEm Mac - Info

Post by Yrrah2 » Mon May 18, 2020 3:38 pm

Elminster wrote:
Mon Sep 03, 2018 1:34 pm
Might be interesting to know who is, might or would use BeebEm on Mac. i.e. for testing purposes. Currently we know of

Code: Select all

- Jon Welch (primary maintainer)
- You (guddler, maintainer helper in training?)
- Me (elminster)
- Lurkio
- Dave Hitchins
- geraldholdsworth
- Danielj
- mlouka
Anyone else?
Love to. In these coronda days I have almost plenty of time. (not a xcode programmer, but pure testing as a user)
Happy with my BBC Master
www.mybbcmaster.nl

User avatar
roland
Posts: 3862
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: BeebEm Mac - Info

Post by roland » Mon May 18, 2020 7:15 pm

I also want to test it. As a matter of fact I tried to install it last Friday but it was not compatible with the latest version of Mac OS.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:

User avatar
Elminster
Posts: 4112
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: BeebEm Mac - Info

Post by Elminster » Mon May 18, 2020 7:42 pm

Just to clarify the bit I am being quoted on above was taking a straw poll of users back in 2018, Mojave’s days, and not related to the work SteveBagley and Camsoft2000 have been doing to fix for 64bit on Catalina more recently.

To get a copy of the 64bit app I think you just need to scroll up a bit and click the download link. Not got around to testing it myself yet.

User avatar
lurkio
Posts: 2681
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BeebEm Mac - Info

Post by lurkio » Mon May 18, 2020 7:50 pm

Elminster wrote:
Mon May 18, 2020 7:42 pm
To get a copy of the 64bit app I think you just need to scroll up a bit and click the download link. Not got around to testing it myself yet.
It works well -- many thanks, Steve! -- but as Steve suggested, his emulator should probably be seen more as a foundation to build on, for anyone trying to create a native Mac version of BeebEm that will have a nice UI and be compatible with the latest version of macOS (10.15 Catalina):
SteveBagley wrote:
Thu Apr 02, 2020 4:39 pm
About five years ago, I hacked around with the windows BeebEm source code to compile a version that runs purely in Cocoa and doesn’t rely on any non-native libraries (video is via OpenGL, audio via OpenAL — well they were native then). The downside is I was rather liberal in editing the BeebEm source (I think I may have rewritten the memory model to be more OO-based — and it’s currently limited to emulating a Model B with 1770 DFS, and lots of the Inbuilt peripherals are disabled), so it’d probably be easier to start again, but you're welcome to a copy if you want to see how I handled the video side of things and threading.
[-o<

User avatar
CommanderCoder
Posts: 37
Joined: Wed Nov 06, 2019 5:50 pm
Location: Royal Leamington Spa
Contact:

Re: BeebEm Mac - Info

Post by CommanderCoder » Sat Jun 06, 2020 11:32 am

After getting to a point where I'm happy with the JSATOM emulator (http://jsatom.web.app) I thought I'd have a go at getting BeebEM working on the Catalina too. It looks quite a task. I've had a little think about it and I've not spent much time looking at the codebase yet. I've got BeebEmX compiling and running.

It seems to me that the link from BeebEm to the Mac Interface needs to be disconnected. This means that the Swift/AppKit interface can be separate and use the C++ code as a library. This might also help future maintenance when Apple changes its SDKs again. I can't see C/C++ disappearing too soon.

Those working on getting this working, point me at any github repos and I'll gladly support with code and testing. I don't want to duplicate any work that's already been done.

User avatar
lurkio
Posts: 2681
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BeebEm Mac - Info

Post by lurkio » Sat Jun 06, 2020 12:09 pm

CommanderCoder wrote:
Sat Jun 06, 2020 11:32 am
I thought I'd have a go at getting BeebEM working on the Catalina too. It looks quite a task. I've had a little think about it and I've not spent much time looking at the codebase yet.
From one Mac BeebEm user who's clinging doggedly to Mojave for as long as possible because it's the last version of macOS that'll support the existing version of BeebEm -- many, many thanks for having a go at this!

CommanderCoder wrote:
Sat Jun 06, 2020 11:32 am
It seems to me that the link from BeebEm to the Mac Interface needs to be disconnected. This means that the Swift/AppKit interface can be separate and use the C++ code as a library. This might also help future maintenance when Apple changes its SDKs again. I can't see C/C++ disappearing too soon.
I'm massively ignorant of the technical details of the code, so please ignore me if this is a silly/misconceived question, but I wonder which of the following two approaches would be more immediately useful and/or practicable -- (a) building a modern UI for the old C++(?) BeebEm "engine", or (b) building a modern (BeebEm-like) UI for Steve Bagley's BeebEmX? What are the pros and cons of each approach?

CommanderCoder wrote:
Sat Jun 06, 2020 11:32 am
Those working on getting this working, point me at any github repos and I'll gladly support with code and testing. I don't want to duplicate any work that's already been done.
I'm extremely happy to be corrected if I'm wrong, but -- beyond what's already been reported in previous posts in this thread -- I don't think anyone's made much progress so far..? :(

:?:

User avatar
richardtoohey
Posts: 3900
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: BeebEm Mac - Info

Post by richardtoohey » Sun Jun 07, 2020 12:21 am

lurkio wrote:
Sat Jun 06, 2020 12:09 pm
I'm extremely happy to be corrected if I'm wrong, but -- beyond what's already been reported in previous posts in this thread -- I don't think anyone's made much progress so far..? :(

:?:
It's a mission-and-a-half ... I'm going down the emulation route with Virtual Box (free) and then install another OS (I'm using Linux Mint, don't want to pay the Windows tax) and then run your 8-bit emulator on that. Got Elkulator starting up and will try Beeb-em next.

It's a lot more long-winded ... but it seems to work. Virtual Box is Oracle, though, and it calls home. Think Apple has Boot Camp but never looked at that.

AJW
Posts: 798
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: BeebEm Mac - Info

Post by AJW » Sun Jun 07, 2020 2:38 pm

Im using on Mojave. Is that some way behind catalina?

User avatar
richardtoohey
Posts: 3900
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: BeebEm Mac - Info

Post by richardtoohey » Mon Jun 08, 2020 6:26 am

In terms of what still works - yes. Upgrade to Catalina and older applications get the chop (or was that the previous Mac upgrade?)

I just dust off some other machine/OS and carry on, but appreciate that's not an option for everyone, so would be good to have a modern solution for Macs.

User avatar
Yrrah2
Posts: 448
Joined: Tue Feb 06, 2007 6:06 pm
Location: Netherlands
Contact:

Re: BeebEm Mac - Info

Post by Yrrah2 » Mon Jun 08, 2020 7:33 am

richardtoohey wrote:
Mon Jun 08, 2020 6:26 am
In terms of what still works - yes. Upgrade to Catalina and older applications get the chop (or was that the previous Mac upgrade?)
Yep Catalina is the first system that chops all 32 bits applications.
Happy with my BBC Master
www.mybbcmaster.nl

iancr77
Posts: 19
Joined: Mon Aug 20, 2018 11:16 am
Location: Swansea, UK
Contact:

Re: BeebEm Mac - Info

Post by iancr77 » Sun Jun 28, 2020 1:02 pm

Hi Everyone,

I got a new Mac recently, and of course discovered that BeebEm4 doesn't run on Catalina. Just for my own amusement, I've been having a bit of a play around with the BeebEm Mac sources from https://github.com/stardot/beebem-mac, and have managed to cobble something together which works on Catalina. The basic interface works (video output, keyboard input), and a few of the most important menu items have been implemented.

However, I doubt I'll have time to do any more with it at the moment, and wanted to share it in case you'd find it useful.

One big caveat: before starting work on this, I had minimal practical C/C++ experience (mainly theoretical knowledge), and no Objective-C/Cocoa experience. My previous programming experience was mainly Python and (whisper it quietly...) Fortran. I went for Obj-C instead of Swift in part because of the commonality between it and C, though I'm aware that Swift would be more future-proof. However, the Swift and Obj-C APIs are AFAIK very similar, so a translation to Swift should be relatively simple.

I've tried to separate the core (platform-independent) emulator from the GUI. The emulator runs in a separate process, and exchanges video frames, keyboard events, menu clicks, etc, with the GUI via a glue object. The glue object contains a set of standard C++ queues, each of which handle a different type of information.

I've also made a small start on making the emulator more 'objectified'. Some of the common variables have been made static elements of a BeebEmCommon class, and the 6502 core has also been turned into a class. Everything else has been left as-is.

The overall architecture is very naive. I've no idea whether an experienced C/C++/Obj-C developer would think it OK, or a crazy pile of junk. Memory management is also done on a wing+prayer basis.I don't really understand how ARC works in Obj-C, and I'm sure I've missed out some object deletions on the C++ side.

Even for the parts of the implementation which work, they are not necessarily complete. e.g. the code which puts video frames on the GUI can't cope with games which muck around with screen (e.g. Clogger, UIM). The keyboard support is also very cludgy - currently, though the letter/number keys all work, only the right-hand shift key works, and none of the other modifier keys are implemented.

On the plus side, I think the code I've added is probably relatively easy to understand, and shouldn't present too much difficult to anyone who wants to take it further.

If this sounds at all useful, I'm very happy to share it. I don't have a Github account at the moment, but given a bit of instruction, I could probably merge my changes into a branch beebem-mac repository (or whatever it is you do).

All the best,
Ian

User avatar
lurkio
Posts: 2681
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BeebEm Mac - Info

Post by lurkio » Sun Jun 28, 2020 3:13 pm

iancr77 wrote:
Sun Jun 28, 2020 1:02 pm
If this sounds at all useful, I'm very happy to share it. I don't have a Github account at the moment, but given a bit of instruction, I could probably merge my changes into a branch beebem-mac repository (or whatever it is you do).
Hi, Ian. Many thanks for looking into this. Please do share the code in whatever way is convenient.

I'm not competent to comment on the technicalities of the coding that you and others have done, as should be obvious from my previous posts in this thread(!), but I'm a keen Mac BeebEm user -- for various reasons it's my main Beeb emulator -- and I've refrained from upgrading to Catalina largely because Mac BeebEm won't run on it.

I'm just hoping that the more info and code-examples that are out there, the more likely it'll be that somehow, some day, there'll be a version of BeebEm that will run on Catalina and possibly even eventually on the new "Apple Silicon" (ARM) Macs, if only under Rosetta 2 initially.

A man can dream... :wink:

Thanks again.

=D> =D> =D>

iancr77
Posts: 19
Joined: Mon Aug 20, 2018 11:16 am
Location: Swansea, UK
Contact:

Re: BeebEm Mac - Info

Post by iancr77 » Sun Jun 28, 2020 4:53 pm

Thanks Lurkio!

I've uploaded the repository to my own Github account - anyone who's interested can clone it from here:

https://github.com/icrutt/beebem-mac.git

There's one dependency to mention - it uses TinyXML2 to read the plist configuration file. I chose to do this because I wanted to make the emulator core as cross-platform as possible. You can install TinyXML2 with Homebrew, and then you will need to configure the build to point to the header file and library.

I'd be happy to have some feedback from anyone who gives it a go...

:D

AJW
Posts: 798
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: BeebEm Mac - Info

Post by AJW » Mon Jun 29, 2020 12:41 pm

Sorry for being ignorant but is the code open source? Has Jon Welch given up developing it?

User avatar
lurkio
Posts: 2681
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BeebEm Mac - Info

Post by lurkio » Mon Jun 29, 2020 12:51 pm

AJW wrote:
Mon Jun 29, 2020 12:41 pm
Sorry for being ignorant but is the code open source? Has Jon Welch given up developing it?
Yes:
g7jjf wrote:
Thu Apr 18, 2019 7:00 am
I have always included the source code as part of the distribution so have no problems putting the latest code on GitHub.

I just don't have the time or skills anymore to upgrade BeebEm to 64 bits.

Let's hope someone else will take on the task of keeping BeebEm alive in the future.
:idea:

User avatar
lurkio
Posts: 2681
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BeebEm Mac - Info

Post by lurkio » Mon Jun 29, 2020 9:24 pm

iancr77 wrote:
Sun Jun 28, 2020 4:53 pm
I've uploaded the repository to my own Github account - anyone who's interested can clone it from here: https://github.com/icrutt/beebem-mac.git There's one dependency to mention - it uses TinyXML2
So, in theory -- and I've never done something like this before, so I've no idea what I'm talking about, really! -- would I be able to load your project into Xcode and build it on Mojave?

:?:

AJW
Posts: 798
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: BeebEm Mac - Info

Post by AJW » Tue Jun 30, 2020 8:32 am

g7jjf wrote:
Tue Mar 31, 2020 2:51 pm
Sorry but you are on your own regarding catalina and 64 bit.

I know zilch about how things work nowadays, which is why I haven't been able to do the upgrade myself :(
Just wondering why when you must be exceptionally good to have made an emulator in the first place?

iancr77
Posts: 19
Joined: Mon Aug 20, 2018 11:16 am
Location: Swansea, UK
Contact:

Re: BeebEm Mac - Info

Post by iancr77 » Tue Jun 30, 2020 9:01 am

AJW wrote:
Tue Jun 30, 2020 8:32 am
Just wondering why when you must be exceptionally good to have made an emulator in the first place?
I can't speak for anyone else, but it's certainly true that Carbon is very different from Cocoa, in terms of paradigm and indeed programming language. And Apple's documentation is... well, it's both voluminous and terse. Not a good combination if you want to get to grips with a new way of doing things.

iancr77
Posts: 19
Joined: Mon Aug 20, 2018 11:16 am
Location: Swansea, UK
Contact:

Re: BeebEm Mac - Info

Post by iancr77 » Tue Jun 30, 2020 9:05 am

lurkio wrote:
Mon Jun 29, 2020 9:24 pm
So, in theory -- and I've never done something like this before, so I've no idea what I'm talking about, really! -- would I be able to load your project into Xcode and build it on Mojave?

:?:
In theory, yes. You will undoubtedly need to change some of the build settings, though... Best thing is to give it a try and see what errors it comes up with.

g7jjf
Posts: 372
Joined: Sun Aug 07, 2005 8:29 pm
Location: Notts, England
Contact:

Re: BeebEm Mac - Info

Post by g7jjf » Tue Jun 30, 2020 12:51 pm

AJW wrote:
Tue Jun 30, 2020 8:32 am
g7jjf wrote:
Tue Mar 31, 2020 2:51 pm
Sorry but you are on your own regarding catalina and 64 bit.

I know zilch about how things work nowadays, which is why I haven't been able to do the upgrade myself :(
Just wondering why when you must be exceptionally good to have made an emulator in the first place?
I just don't have the time anymore to learn something new. I got married about 12 years ago which is when all development stopped as I had more interesting things to play with :D

AJW
Posts: 798
Joined: Sun Feb 15, 2004 2:01 pm
Contact:

Re: BeebEm Mac - Info

Post by AJW » Tue Jun 30, 2020 6:33 pm

Understandable :)

User avatar
CommanderCoder
Posts: 37
Joined: Wed Nov 06, 2019 5:50 pm
Location: Royal Leamington Spa
Contact:

Re: BeebEm Mac - Info

Post by CommanderCoder » Wed Jul 01, 2020 8:19 am

Hi Ian,

I've also been working on an update to BeebEm4. I went down the Swift wrapper route although I have no Swift or MacOS development experience so it has been fun to learn how to avoid using semicolons for a change. Much like you, I got the original BeebEm C++ code running on a separate thread with the input and output going through a small Swift framework. I assume you noticed that sound compiles and runs without any problems although all the calls are deprecated so that will stop working in a few years. I've not made any changes to the core structure of BeebEm. The project for me is to get the original emulator working on Catalina. I was just starting to recreate the menus and windows in 'storyboard' when I spotted your post.

I'll continue with it as it is an interesting way to learn more about Swift and AppKit, and I'll upload something that approaches the original to GitHub in a few weeks time. I'd be interested to see how you implemented your video update. I couldn't figure out how BeebEm4 rendered when the window was 'fullscreen' in blitbuffer() so I just bypassed it.

Andrew
iancr77 wrote:
Sun Jun 28, 2020 1:02 pm
Hi Everyone,

I got a new Mac recently, and of course discovered that BeebEm4 doesn't run on Catalina. Just for my own amusement, I've been having a bit of a play around with the BeebEm Mac sources from https://github.com/stardot/beebem-mac, and have managed to cobble something together which works on Catalina. The basic interface works (video output, keyboard input), and a few of the most important menu items have been implemented.

(snip...)

iancr77
Posts: 19
Joined: Mon Aug 20, 2018 11:16 am
Location: Swansea, UK
Contact:

Re: BeebEm Mac - Info

Post by iancr77 » Thu Jul 02, 2020 12:19 pm

CommanderCoder wrote:
Wed Jul 01, 2020 8:19 am
I'll continue with it as it is an interesting way to learn more about Swift and AppKit, and I'll upload something that approaches the original to GitHub in a few weeks time. I'd be interested to see how you implemented your video update. I couldn't figure out how BeebEm4 rendered when the window was 'fullscreen' in blitbuffer() so I just bypassed it.
Hi Andrew,

That's good to hear - and interesting to compare notes! I was quite surprised the sound worked, though I hadn't investigated how or why.

I've only got the app to work in a window at the moment, not full-screen. The video code just passes the pointer to the m_screen (wrapped in a C++ object) through a queue to the GUI, which then works out what to do with it. I was working on the assumption that fullscreen and other window sizes would be handled by the GUI code rather than within beebwin.

I think Swift is a much better route to go down - good luck!

Ian

Post Reply

Return to “8-bit acorn emulators”