B-Em

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
Coeus
Posts: 777
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: B-Em

Post by Coeus » Mon Apr 23, 2018 8:28 pm

tricky wrote:...I have a config file with several layouts for each of several joysticks and then select the appropriate one...
Do you have an example config file, please?

User avatar
tricky
Posts: 2458
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: B-Em

Post by tricky » Mon Apr 23, 2018 10:29 pm

I'm not putting it forward as a candidate, it was just a proof of concept, but the one in the linked thread is a basic one for two controllers.

Code: Select all

robably change this for myself as I don't really like allegro)

joymaps.txt
CODE: SELECT ALL
-joymap zx2 Controller (XBOX 360 For Windows)

LEFT  = Z
RIGHT = X
UP    = QUOTE
DOWN  = SLASH
0         = ENTER
1         = SHIFT
10        = QUIT


-joymap zx2

POV_LEFT  = Z
POV_RIGHT = X
POV_UP    = QUOTE
POV_DOWN  = SLASH
0         = ENTER
3         = SHIFT
12        = QUIT
A new config is started with -joymap, followed by its name and optionally the name of a controller (no name is used if name cannot be matched).
Numbers are button indices.
My hori stick has its joystick mapped to the POV hat for some reason!

User avatar
pau1ie
Posts: 512
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Re: B-Em

Post by pau1ie » Tue Apr 24, 2018 7:55 am

Comparing this version of b-em with the previous one, I notice it uses much less CPU. The previous one uses 1 1/4 core, mostly X, Sound is choppy, presumably because it is running slightly slower than full speed. The new version uses about 75% of a core on my aging laptop. I suspect this is caused by the newer version of allegro being more efficient, either not updating the screen if it hasn't changed, or taking advantage of hardware acceleration. There is the occasional blip in sound, but I suspect this wouldn't happen on newer hardware, or on the type of sounds in most games.

Together with the vastly improved interface and incorporation of new hardware, I am really excited. Thanks to all who have contributed to this effort!
I'm working on http://bbcmicro.co.uk

User avatar
BigEd
Posts: 1826
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: B-Em

Post by BigEd » Tue Apr 24, 2018 8:16 am

That does sound promising! Is a Raspberry Pi up to the task of running this latest version with good performance? A Pi configured to boot directly into a full-screen emulator would be quite a thing, I think.

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

Re: B-Em

Post by Elminster » Tue Apr 24, 2018 8:44 am

I have Raspberry pi version of B-Em Allegro 5.2. It is a bit sluggish on a 3 B+ (lthough quicker than B2). But I also have the over heard of running it in docker and using vnc to view it. It maybe a bit quicker if run directly on the hardware.

KaleviKolttonen
Posts: 5
Joined: Mon Apr 23, 2018 12:16 pm
Contact:

Re: B-Em

Post by KaleviKolttonen » Tue Apr 24, 2018 8:58 am

My /opt/b-em/resourcedir/joymaps/boulder_dash_joymap looks like this:

Code: Select all

# KEY_Z
left 6 1

# KEY_X
right 4 2

# KEY_QUOTE
up 4 8

# KEY_SLASH
down 6 8

# KEY_SPACE
button 6 2
So the format is not that user friendly, because you have to enter the raw BBC Micro keycodes as values.

I don't remember my C code, but probably I mapped all controller buttons with "button", thinking that old style Atari-joysticks had only one Fire-button. I only have Logitech Rumblepad 2 and Logitech Precision USB controllers, I haven't tested my code with more complicated controllers.

Coeus
Posts: 777
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: B-Em

Post by Coeus » Sun Apr 29, 2018 4:50 pm

I suddenly had the idea that I might be able to attach a game controller as joystick and, sure enough, my wife's Xbox One controller has a micro-USB port. It does seem a little quirky as a controller but for testing it does have the advantage of multiple sticks and buttons including physical sticks that seem to drive more than one logical stick axis. Anyway, from that I got joysticks working, at least on Linux so far - it should work the same on Windows - and included enough flexibility to completely re-map the stick if you so desire. The latest commit for that is https://github.com/stardot/b-em/commit/ ... db3e25bbb6, the Wiki page is at https://github.com/stardot/b-em/wiki/Joysticks

User avatar
myelin
Posts: 410
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: B-Em

Post by myelin » Sat May 26, 2018 8:05 pm

I've been under the impression that the only Acorn emulator that worked on macOS was Clock Signal, but I just built the sf/allegro5 branch of b-em, and it ran just fine, with only minor tweaks (here's the PR) to get it to build!

Nice work :D
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

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

Re: B-Em

Post by Elminster » Sat May 26, 2018 8:40 pm

myelin wrote:
Sat May 26, 2018 8:05 pm
I've been under the impression that the only Acorn emulator that worked on macOS was Clock Signal, but I just built the sf/allegro5 branch of b-em, and it ran just fine, with only minor tweaks (here's the PR) to get it to build!

Nice work :D
B2 works on Mac

But will have a play with B-Em when merged

Coeus
Posts: 777
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: B-Em

Post by Coeus » Mon May 28, 2018 7:26 pm

myelin wrote:
Sat May 26, 2018 8:05 pm
I've been under the impression that the only Acorn emulator that worked on macOS was Clock Signal, but I just built the sf/allegro5 branch of b-em, and it ran just fine, with only minor tweaks (here's the PR) to get it to build!
That's good news. It has not been my intention to break Mac compatibility but I don't have one to test on, so good to hear such small changes suffice.

BTW, does static assert occur in Mac-specific headers because I didn't think B-Em used it itself.

I'll check that the changed version still builds on Linux and Windows.

Coeus
Posts: 777
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: B-Em

Post by Coeus » Mon May 28, 2018 11:59 pm

And further to my last message I have made a copy of the previous master in branch allegro4 and merged the sf/allegro5 branch into master.

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

Re: B-Em

Post by Elminster » Tue May 29, 2018 9:27 am

I can confirm that B-EM with Allegro 5 builds straight out of the box on the master branch on Mac High Sierra. (Thanks Coeus & Myelin). Although I havent done any more testing than running 'hello world' in basic.

Only thing that is missing is build instructions, which is basically the same as Linux except I did a

Code: Select all

brew install allegro
to get allegro 5.

Post Reply