RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Advance Mess and BBC Micro and joystick control

    Scheduled Pinned Locked Moved Help and Support
    advance messjoystickbbc micro
    75 Posts 5 Posters 10.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • caver01C
      caver01 @spud11
      last edited by

      @spud11 AdvanceMAME (mess) does have a scripting function. I once used it to wait a second or two, then automatically type scroll lock to switch keyboard modes. Seems to me you could setup a script that types commands like chain thrust. But I expect your next game will be different, so you’d have to start making separate .rc files.

      My 4-player cocktail style cabinet built as a custom "roadcase"

      S 2 Replies Last reply Reply Quote 0
      • S
        spud11 @caver01
        last edited by

        @caver01 Hi. I reckon I probably will have only about 20 games, so I'd have no issue with doing the script. If you can recall, could you please help me do a script of that kind? Thanks.

        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

        1 Reply Last reply Reply Quote 0
        • S
          spud11 @caver01
          last edited by

          @caver01 Well, I thought I'd have a go. I've added the following to the advmess.rc, but it doesn't work. I'm hoping you might be able to suggest changes please:

          script_emulation \
          	delay(20000); \
          	simulate_key(key_c,100); \
          	delay(200); \
          	simulate_key(key_h,100); \
          	delay(200); \
          	simulate_key(key_a,100); \
          	delay(200); \
          	simulate_key(key_i,100); \
          	delay(200); \
          	simulate_key(key_n,100); \
          	delay(200); \
          	simulate_key(key_space,100); \
          	delay(200); \
          	simulate_key(key_quote,100); \
          	delay(200); \
          	simulate_key(key_t,100); \
          	delay(200); \
          	simulate_key(key_h,100); \
          	delay(200); \
          	simulate_key(key_r,100); \
          	delay(200); \
          	simulate_key(key_u,100); \
          	delay(200); \
          	simulate_key(key_s,100); \
          	delay(200); \
          	simulate_key(key_t,100); \
          	delay(200); \
          	simulate_key(key_quote,100); \
          	delay(200); \
          	simulate_key(key_enter,100);
          	delay(200); \
          

          RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

          caver01C 2 Replies Last reply Reply Quote 0
          • caver01C
            caver01 @spud11
            last edited by caver01

            @spud11 You did what I would have suggested. I expect you looked at the script.txt on the advancemame site? Does MESS even start? If your syntax is off or you have a bad line in the .rc file, as you know, it won't even launch.

            If it is launching, as I look at it, it appears you are starting with the script_emulation which to my interpretation of the docs should run when the emulation starts running. Then, as a precaution against timing issues, looks like you added a 20 second delay, then your keypresses for .1 seconds each, .2 between them. Am I getting this right?

            This is exact what I would have done, hoping to shave off that initial delay once I know it is working. Does the BBC Micro require commands be entered in all caps?

            My 4-player cocktail style cabinet built as a custom "roadcase"

            S 1 Reply Last reply Reply Quote 0
            • S
              spud11 @caver01
              last edited by spud11

              @caver01 Hi. I did look at the advmame script examples and followed them as best I could.

              The timings you've outlined are right.

              However, advmame doesn't start. On the Terminal, the error is: sh: 1: commandline: not found (which is the same error I got whenever I messed up the advmess.rc file).

              If I leave script_emulation in place, but remove all the other stuff below it, advmess will work as per normal. So there is something clearly wrong with the syntax of the script. I've tried replacing script_emulation \ with script_play \, but that doesn't work either. Anyway, I would think the latter would be incorrect anyway as I want the script to operate before the game begins, not afterwards.

              And you are right. The BBC Micro requires capital letters. I haven't done that yet, but not including that isn't preventing the script from running, I think.

              RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

              caver01C 1 Reply Last reply Reply Quote 0
              • caver01C
                caver01 @spud11
                last edited by

                @spud11 Yeah, it is a syntax issue. I lost my config that had the script, so I cannot use my simple example as guidance. Trial and error I think.

                As far as timing, I think you have the right idea. . . delay after emulation starts. MESS probably cannot tell if the game has started, only that you launched a BBC Micro with some image file in the virtual floppy drive.

                My 4-player cocktail style cabinet built as a custom "roadcase"

                S 1 Reply Last reply Reply Quote 0
                • S
                  spud11 @caver01
                  last edited by

                  @caver01 Well, I reckon I've tried almost every syntax permutation I can think of with exactly the same outcome - diddly squat. I found only a couple of scripts on the interwebs that use script_emulation, but none seem to help. I wound up with the following all on one line, but like everything else I've tried it doesn't work sadly:

                  script_emulation delay(20000); simulate_key(key_capslock,100); simulate_key(key_c,100); delay(200); simulate_key(key_h,100); delay(200); simulate_key(key_a,100); delay(200); simulate_key(key_i,100); delay(200); simulate_key(key_n,100); delay(200); simulate_key(key_space,100); delay(200); simulate_key(key_quote,100); delay(200); simulate_key(key_t,100); delay(200); simulate_key(key_h,100); delay(200); simulate_key(key_r,100); delay(200); simulate_key(key_u,100); delay(200); simulate_key(key_s,100); delay(200); simulate_key(key_t,100); delay(200); simulate_key(key_quote,100); delay(200); simulate_key(key_enter,100); delay(200);
                  

                  It's frustrating, especially as Advance Mame's scripting function seems to have been around for a decade or so, so you'd think it'd be pretty well documented and robust by now.

                  At least I can get the BBC Micro to work and with my joystick too. Just a pity I need the keyboard to start games.

                  RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                  caver01C edmaul69E 2 Replies Last reply Reply Quote 0
                  • caver01C
                    caver01 @spud11
                    last edited by

                    @spud11 I will dig around and see if I can find my script example. I thought I looked for that config a year ago and it was lost to a reformat.

                    My 4-player cocktail style cabinet built as a custom "roadcase"

                    S 1 Reply Last reply Reply Quote 1
                    • edmaul69E
                      edmaul69 @spud11
                      last edited by

                      @spud11 i have a question. In the emulators.cfg how do you load a cassette? All the roms i found are cassettes. I know -cart, -floppy, -flop1... but i cant get the cassette roms to run. I tried -cass and -cassette. Everything boots to the bbc commandline.

                      1 Reply Last reply Reply Quote 0
                      • S
                        spud11 @caver01
                        last edited by

                        @caver01 Thanks for having another look. That's really appreciated. I had a look on the Advance Mame forums. Not a lot of guidance there.

                        @edmaul69 I've dug around a bit on the internet, but I couldn't find any guidance for a tape switch like -cart or -floppy for Advance Mess. On the MESS forums, there's reference to tape support being broken and then fixed as of MESS 0.129, with the suggestion being that loading tapes by typing *TAPE and then LOAD "" (or something like that) is the way to go. My recommendation would be to find a repository of floppy (.ssd) files instead. I can't help there given the forum rules but googling will no doubt be of assistance.

                        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                        edmaul69E 2 Replies Last reply Reply Quote 0
                        • edmaul69E
                          edmaul69 @spud11
                          last edited by

                          @spud11 ok i found ssd files but they do the same thing. Did you use -cart or -floppy in the emulatots.cfg?

                          1 Reply Last reply Reply Quote 0
                          • edmaul69E
                            edmaul69 @spud11
                            last edited by

                            @spud11 also does it auto load the games or do i need to type something?

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              spud11 @edmaul69
                              last edited by

                              @edmaul69 You will need the -floppy switch. For example:

                              sudo /opt/retropie/emulators/bbcmicro/advmess bbcb -cfg /opt/retropie/configs/bbcmicro/advmess.rc -floppy /home/pi/RetroPie/roms/bbcmicro/Thrust.ssd
                              

                              (Note that I have installed advmess in a different location from advance mame and I've got a separate advmess.rc.)

                              The -floppyswitch is just like putting the game into the BBC's floppy drive. It does not start the game automatically. You will still need to type CHAIN "THRUST"(or whatever the rom's name is) manually as it won't auto load. The discussion I'm having with @caver01 above is about trying to automate the loading/starting of the games.

                              RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                              edmaul69E 1 Reply Last reply Reply Quote 0
                              • edmaul69E
                                edmaul69 @spud11
                                last edited by

                                @spud11 do i need to type the parenthesisis in bbc micro? The parenthesis key types an asterik

                                S 1 Reply Last reply Reply Quote 0
                                • caver01C
                                  caver01 @spud11
                                  last edited by

                                  @spud11 said in Advance Mess and BBC Micro and joystick control:

                                  script_emulation \
                                  	. . .
                                  	delay(200); \
                                  

                                  Hey, try getting rid of that trailing backslash on the very last delay(200) script command. That character denotes a broken line to be continued on the next line, and as this is the end of your script, you don't want one because whatever is next in your .rc file will be added to the very long script command.

                                  My 4-player cocktail style cabinet built as a custom "roadcase"

                                  S 1 Reply Last reply Reply Quote 1
                                  • S
                                    spud11 @edmaul69
                                    last edited by spud11

                                    @edmaul69 It depends on whether you have a US or UK keyboard. You need the parentheses. Try holding shift and pressing the 2 key.

                                    RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      spud11 @caver01
                                      last edited by

                                      @caver01 Thanks. No, same outcome unfortunately.

                                      RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                      caver01C 1 Reply Last reply Reply Quote 0
                                      • caver01C
                                        caver01 @spud11
                                        last edited by

                                        @spud11 Ok, one more thing, I noticed that in the script you have above, the second to last line does NOT have the backslash, but that one should have it, because your script command continues on the next line with that last delay(200);

                                        My 4-player cocktail style cabinet built as a custom "roadcase"

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          spud11 @caver01
                                          last edited by

                                          @caver01 Hi. I added the \ back in on the second last line, but again it didn't work. There must be something fundamentally flawed with the script or perhaps how I've included it in the advmess.rc file.

                                          RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                          caver01C edmaul69E 3 Replies Last reply Reply Quote 0
                                          • caver01C
                                            caver01 @spud11
                                            last edited by

                                            @spud11 said in Advance Mess and BBC Micro and joystick control:

                                            @caver01 Hi. I added the \ back in on the second last line, but again it didn't work. There must be something fundamentally flawed with the script or perhaps how I've included it in the advmess.rc file.

                                            There is some ambiguity in the documentation about simulate_event() vs. simulate_key(). I wonder if you can use simulate_event? Also, you might troubleshoot using a much smaller script, something that only types C or something shorter at first.

                                            Also, I would probably try a script_play as I think this is what I did to get it to type scroll lock a while back.

                                            It seems like a powerful feature. I wish we could get you up and running with it.

                                            My 4-player cocktail style cabinet built as a custom "roadcase"

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.