Page 1 of 1

A quick front-end / launcher that I just wrote

Posted: Thu Mar 16, 2017 8:19 pm
by tricky
I am planning on building a MAME cabinet and would like it to run BBC emulators from the joystick and play as many games as possible.
The GameSelector uses games.CSV to list games and their: sorting group (0 is hidden), title, description, exe and command line arguments.
I have been testing with the info from and using their screen shots. Admins, if this is not OK, please let me know.
The launcher is windows only and looks for any joysticks and then lets you scroll around and select a game with the stick(s) and launch with button 0, any other button quits. You can also use the cursor keys and RETURN to launch as I quite like it :lol:

I have also been adding similar support to b-em, so that any stick found can map any direction or button to any key on the keyboard.
The additional joystick code that I have added to b-em is windows only (as I don't "do" linux), but is fairly straight forward.
I have added joymaps.txt, which is read if -joymap config is found on the command line.
In the joymaps.txt file, there are section headings which are processed in order -joymap config <optional joystick name>
If a config with matching joystick name is found, this is mapped, otherwise, the one matching config will be mapped to the first unmapped joystick.
The code actually maps the "prefered" joystick to stick 0, so that will be mapped first if not already mapped (this isn't necessary now).

This is a demo of me running the launcher and using the joystick in-game by driving the emulated keys, sorry about the colour quality.
The flickering when launching b-em seems to be down to allegro, as everything else I tried is fine, but full-screen has always been a bit tricky on windows :(


games.csv - if first column is a 0, then the game is hidden, other numbers are sorted and then alphabetically within those groups.

Code: Select all

0,Wordmaster ,ASP Software 1983  (Word Games (Mastermind) P:1),..\b-em-joymap\b-em.exe,-autoboot 15 -joymap hori_zx2 discs\Disc090-Wordmaster.ssd,screenshots\Disc090-Wordmaster.png
1,Carnival,Retro Software 2015 Richard Broadhurst (Shooter (Gallery) P:1),..\b-em-joymap\b-em.exe,-autoboot 15 -joymap hori_zx2 discs\Disc107-CarnivalSTD.ssd,screenshots\Disc107-CarnivalSTD.png
3,Grand Prix Construction Set ,Superior Software 1987 A. Bradley (Add On P:1 to 2),..\b-em-joymap\b-em.exe,-autoboot 15 -joymap hori_zx2 discs\Disc033-GrandPrixConstructionSetSTD.ssd,screenshots\GrandPrixConstructionSet-Superior.png
3,Kastle ,Tynesoft 1986 Martin Sykes (Adventure P:1),..\b-em-joymap\b-em.exe,-autoboot 15 -joymap hori_zx2 discs\Disc108-KastleE.ssd,screenshots\Kastle-Tynesoft.png
3,Yes Prime Minister ,Mosaic Publishing Ltd. 1988  (Adventure P:1),..\b-em-joymap\b-em.exe,-autoboot 15 -joymap hori_zx2 discs\Disc108-YesPrimeMinisterSTD.ssd,screenshots\Disc108-YesPrimeMinisterSTD.png
As my changes to b-em weren't appreciated before, I am just uploading to show what I did.
I think this is a good feature to have in an emulator and this is one example (windows only) of how it could be implemented.

I haven't tested the custom controller name mapping, but it should work :shock:
The button names are those used by allegro4 (I will probably change this for myself as I don't really like allegro)


Code: Select all

-joymap zx2 Controller (XBOX 360 For Windows)

0         = ENTER
1         = SHIFT
10        = QUIT

-joymap zx2

0         = ENTER
3         = SHIFT
12        = QUIT

Re: A quick front-end / launcher that I just wrote

Posted: Thu Mar 16, 2017 9:38 pm
by FourthStone
Looks bloody amazing, well done! Would love to include beeb games in a mame cabinet someday so please post regular updates about the whole process as I think it will be useful for us tinkerers out there :D

Re: A quick front-end / launcher that I just wrote

Posted: Fri Mar 17, 2017 2:01 am
by Arcadian
Wow, have been waiting years to see something like this! I've always wanted a custom beeb-cade bartop - this might just spur me into ordering something!! Brilliant work Tricky!!

Re: A quick front-end / launcher that I just wrote

Posted: Fri Mar 17, 2017 7:49 am
by tricky
Thanks, your video of Carnival in an arcade cab was one of the things that inspired me.

The biggest chunk of work is to go through each game and choose which keys need mapping.

Re: A quick front-end / launcher that I just wrote

Posted: Fri Mar 17, 2017 9:46 pm
by FourthStone
Thinking out loud and knowing how these things can spiral out of scope... would be awesome to have a load screen for each game to show which joystick buttons are mapped to which keys just before launching a game, it could be pretty generic and doesn't have to be tied to the game, just when reading the keyboard mapping when loading a game, maybe have an extra column in the csv for a button description?

Hope you post lots of updates on progress, this project is a really awesome effort =D>

Re: A quick front-end / launcher that I just wrote

Posted: Fri Mar 17, 2017 10:51 pm
by tricky
I was thinking that myself, i was going to display the mapping at the bottom of the screen for the currently selected game. I'm not sure how useful some of the info is, button 3 is space.

Re: A quick front-end / launcher that I just wrote

Posted: Sat Mar 18, 2017 11:36 am
by tricky
Tidied things up a bit and added joymaps to beebem, the speech version.
In the zip are the tidied up source joymap.h and joymap.c along with a text file listing the changes I made to integrate joymaps.
As the game sees both joystick and keyboard, mapping the first button to RETURN can be unpredictable in game as the game will see both RETURN (if that is start with keyboard) and FIRE.
To avoid this, when there is an issue, I use a preferences file with joysticks disabled.
Obviously, this could be better integrated into the emulator if someone wants to, but this work well for me.

I also added a timer to turn off the SHIFT key which is left pressed by the emulator if a disc is auto booted.

Normal beebem next and then tidy up the b-em integration.