Really weird AdvMESS/BBC micro config bug
I thought yesterday I'd finally totally nailed BBC Micro emulation and configuration through AdvMESS:
...but that fiendish trickster of an emulator had one last curveball up its sleeve.
While all the control-mapping configs outlined in my post work a treat, there's one exception - the Shift key. Annoyingly a lot of BBC games chose to use Shift as a fire button, and for some reason AdvMESS simply WILL NOT retain any configuration information for either of the Shift keys alone.
So if you set configs for games like Eagle Empire or Tempest, which both use Shift as a secondary fire button, they'll work fine while you're using them, but if you quit out and reload the game, all the maps you set will still be there EXCEPT the one for the Shift key, which you'll have to reconfigure every time you load the game.
(To be more precise, both of the Shift keys in the MESS menu will be set to whatever you last set either one of them to, and when they're both set to the same thing they weirdly cancel each other out so you've got no fire button.)
I spent six hours yesterday trying to defeat this bug, without success. I tried mapping through the in-game menu, I tried doing it manually through the .RC file, I tried editing the .RC file to force the Shift keys always to be a certain joystick button, and the emulator just shrugs it all off.
(One of the issues might be that the emulator lists both LShift and RShift keys AND a generic Shift. It also doesn't help that many of the games which used Shift as a control key also used CapsLock, and that the BBC had both a CapsLock and a ShiftLock key, which MESS also treats as being one and the same.)
This one's got me flummoxed. Clearly it's not the worst problem in the world to have to remap one key every time you play certain games, but those of you who enjoy bug-hunting for its own sake might have fun with it.
So for example, one of the things I've tried is setting both generic Shift and RShift to actually be specifically RShift at the start of the .RC file:
input_map[key_rshift] keyboard[0,rshift] or joystick_button[0079_0011,4] input_map[key_shift] keyboard[0,rshift] or joystick_button[0079_0011,4]
But that didn't work - MESS still treated both Shifts as one. It was even the same when I told it to regard LShift as another key altogether, in this case F:
And nothing changed when I added these game-specific mapping lines setting the two Shifts to different keys either:
bbcb[home_pi_retropie_roms_bbcmicro_eagle]/input_map[key_rshift] keyboard[0,rshift] or joystick_button[0079_0011,4] bbcb[home_pi_retropie_roms_bbcmicro_eagle]/input_map[key_lshift] keyboard[0,f]
No matter what I do, as soon as I quit out of the game and reload, both Shift settings revert to being whatever the last thing I set either one of them to was:
I WILL SOLVE THIS PROBLEM OR DIE.
@SpudsMcToole In my own notes, I have also referred to this problem with the game Thrust, which uses the shift key by default.
This is what I wrote to myself:
"There appears to be a problem with Advmess not mapping the shift key accurately for the BBC Micro. I found that in the
advmess.rcfile, Advmess did not separate the left shift key from the right shift key as follows:
bbcbp128[home_pi_retropie_roms_bbcmicro_thrust]/input_map[key_shift] joystick_button[0079_0006_3,2] or keyboard[0,lshift]
The above would not work.
Instead, I replaced the above line in the
advmess.rcfile with the following 2 lines:
bbcbp128[home_pi_retropie_roms_bbcmicro_thrust]/input_map[key_lshift] joystick_button[0079_0006_3,2] or keyboard[0,lshift] bbcbp128[home_pi_retropie_roms_bbcmicro_thrust]/input_map[key_rshift] joystick_button[0079_0006_3,2] or keyboard[0,lshift]
Try the above code instead and see if it works. Seems to work for me for Thrust and I don't need to change it each time.
bbcbp128[home_pi_retropie_roms_bbcmicro_thrust]/input_map[key_lshift] joystick_button[0079_0006_3,2] or keyboard[0,lshift]
bbcbp128[home_pi_retropie_roms_bbcmicro_thrust]/input_map[key_rshift] joystick_button[0079_0006_3,2] or keyboard[0,lshift]
The MESS menu still shows that they're both set to the same Shift key and they cancel each other out.
I wondered if it might somehow be related to Caps Lock and Shift Lock being set (because so many BBC games insist on confusing the hell out of the emulator by using shift-function keys as controls and being case-sensitive), but I tried changing both of those at the end of the script_play line and it made no odds.
spud11 last edited by
bbcbp128/input_map[key_lshift] joystick_button[0079_0006_3,2] or keyboard[0,lshift] bbcbp128/input_map[key_rshift] joystick_button[0079_0006_3,2] or keyboard[0,lshift]
What about the more generic version above?
If that doesn't work, in the second line replace the second lshift with rshift.
@spud11 Nope, neither of those :(
I swear I've tried every imaginable combination for the three Shift options both in the per-game settings and the generic settings at the start of the .RC file. I must have been through literally at least 50 tries yesterday and nothing worked.
@SpudsMcToole Did you delete the line that just has shift from your advmess.rc (ie the one without the 'l' or the 'r')? The generic shift key needs to be deleted, I think.
Also, I previously posted my whole advmess.rc file in one of your threads yesterday. I recommend replacing your's with mine and test it and see. That advmess.rc works with Thrust so the shift key works fine.
Also try making any changes to the bottom of the .rc file rather than the top, just in case advmess gives priority to lines further down the file if there are conflicts.
Did you delete the line that just has shift from your advmess.rc (ie the one without the 'l' or the 'r')? The generic shift key needs to be deleted, I think.
Yup, tried that too.
(I also tried it all with and without the "bbcp128" prefix. My .RC file just looks like this, no prefix.)
input_map[key_pgup] auto input_map[key_play] auto input_map[key_plus] auto input_map[key_pound] auto input_map[key_print] auto input_map[key_q] auto input_map[key_quickload] auto input_map[key_quote] auto input_map[key_r] auto
spud11 last edited by
@SpudsMcToole Okay. Try my advmess.rc file which I posted yesterday.
@spud11 Nope, with yours in the emulator just crashes straight back to EmulationStation.
That advmess.rc works with Thrust so the shift key works fine.
The annoying thing is that MESS clearly IS capable of distinguishing between the Shift keys, because when you set the controls through the menu they work fine. Something's just going wrong in saving the settings out.
There has to be a simple solution here, but I'm up to about 70 permutations of every line that could possibly be involved and still not finding the gremlin.
Okay, here's what I've found with some more methodical experimenting.
Up at the top of the .RC file we have all the input_map commands that apply to everything. The three we're concerned with are these:
input_map[key_lshift] auto input_map[key_rshift] auto input_map[key_shift] auto
The first two don't seem to affect anything. Whatever you set them to will be overwritten by what's in the third one (the generic Shift). And whatever you put in the generic-Shift entry will show up in the MESS menu for both of the Shift options, and neither of them will work in the game because they somehow cancel each other.
If you delete the generic Shift line, the other two are still ignored. The MESS menu will revert to the generic default, which is to show "rshift" and "lshift" for the two SHIFT entries, and both keys will work independently of each other. Good news!
BUT, if you manually assign a joystick button to either of them in the MESS menu, it'll work fine until you quit the game, but the mapping won't be saved and you'll have to re-map it every time you boot the game up. And if you add it into the .RC file yourself it'll be totally ignored/overwritten by the default option.
So for example if you delete the input_map[key_shift] line and add this line to the game-specific mapping:
bbcb[home_pi_retropie_roms_bbcmicro_tempest]/input_map[key_rshift] keyboard[0,rshift] or joystick_button[0079_0011,4]
...MESS just acts like it isn't there. If I open up the menus, the two SHIFT options still just read "rshift" and "lshift", with no joystick buttons selected.
If I swap it to a generic-Shift line:
bbcb[home_pi_retropie_roms_bbcmicro_tempest]/input_map[key_shift] keyboard[0,rshift] or joystick_button[0079_0011,4]
...MESS treats it as if I'd restored the original generic Shift mapping, ie it applies it to both of the SHIFT options in the menu, which means it doesn't work.
You can delete all three of the input_map lines referring to Shift keys from the top part of the .RC file and it won't make any difference. Whether you have them up there or as part of game-specific lines further down, MESS treats them identically - generic Shift overwrites anything you put in the others, and applies it to both Shifts in the menu, cancelling both of them out.
All I need to do now is work out how the hell you fooled it for Thrust.
All I need to do now is work out how the hell you fooled it for Thrust.
I'm lost. I've cloned your settings from your ADVMESS.RC exactly (swapping in my joystick button for yours, but no other changes), so the relevant lines are:
input_map[key_lshift] keyboard[0,lshift] or joystick_button[0079_0011,4] input_map[key_rshift] keyboard[0,rshift] input_map[key_shift] auto bbcb[home_pi_retropie_roms_bbcmicro_tempest]/input_map[key_lshift] joystick_button[0079_0011,4] or keyboard[0,lshift] bbcb[home_pi_retropie_roms_bbcmicro_tempest]/input_map[key_rshift] joystick_button[0079_0011,4] or keyboard[0,lshift]
And it's just ignoring everything and using the default generic-Shift settings, ie the two Shift options in the MESS menu show up as "lshift" and "rshift", no joystick buttons assigned at all.
I've been right through your ADVMESS.RC trying to find another line that could be changing anything, and drawn a blank.
A Former User last edited by
Have you thought of trying a different keyboard ?
All of your problems seem seem to stem from the keyboard.
For what it's worth, I tried Thrust - the filename is "Thrust (EU).ssd", and it worked perfectly. The shift key operated thrust, the spacebar for shields, Return for fire, caps lock for rotate left, ctrl for right. All worked fine on my little Rii X8 wireless keyboard.
@John_RM_70 How could it possibly be the keyboard? The keyboard works fine, it's only assigning a control to a joystick button and keeping it assigned that's failing.
edmaul69 last edited by
On another note, in the advmess.rc, if you removed the game name part in the config (ie: _Thrust, _Tempest) it becomes a universal control for all bbc micro games
@edmaul69 Yeah, I figured that, but sadly the BBC didn't even nearly have uniform game controls. Might still be a timesaver to set up a default of ZX*/ and Enter, though.
@SpudsMcToole So keyboard shift works but 'joystick' shift does not for you.
The only difference that I can see between your setup and mine is that I use xboxdrv. That means that once I got the shift key on my keyboard to work, I was home and hosed. Using xboxdrv meant that my joystick button was 'tied' to the keyboard shift key and I wasn't reliant on advmess' joystick implementation for the shift key.
If you are desperate for the BBC Micro to work, you could set up xboxdrv to work just for the BBC Micro or even just for individual BBC Micro games that hardwire/use the shift key.
It is a reasonable amount of work to set up, but you've demonstrated the perseverance so far that suggests to me that you are an ideal candidate for the xboxdrv program!
What kind of joystick are you using?
@spud11 Haha. I'm willing to wade through quite a lot of code for Pi stuff generally, but xboxdrv is a league too far for me. Have tried a couple of times in the past and run away screaming. I've never seen anything so incomprehensible in my life.
(I'm using a double arcade joystick.)
At the worst, what I've got so far means having to manually set one key every time I load one of a small handful of games. Annoying as it is not to be able to solve this logic conundrum, with BBC emulation having been a total pipedream a week ago I can live with that as the price of being able to play most of the classics, plus VIC-20 and Astrocade and Arcadia and maybe more :)
(Although this is still driving me batty:)
OneSwitch last edited by
I'm finding that the BBC Micro emulator is working well following most of the above, but it's forgetting a number of joypad controls (I'm using an Xbox controller with a Raspberry Pi). Does feel close though....