Jump to content
LaunchBox Community Forums

JoeViking245

Moderators
  • Posts

    4,897
  • Joined

  • Last visited

  • Days Won

    36

Posts posted by JoeViking245

  1. 11 hours ago, skizzosjt said:

    joysticks are proving to be a bit more of a challenge.

    Added left and right Joy.  Also made the left and right Trigger to not be such a 'hair trigger'. ;) 

    #Include Xinput.ahk
    #Persistent
    
    SetKeyDelay, 0, 50 
    SetTimer, checkForJoy1, 10
    
    checkForJoy1:
    
    XInput_Init()
    state := Xinput_GetState(0)
    
    If(state)
    {
        If(state.wButtons & 4096)   ;A button
            Send, k
        If(state.wButtons & 8192)   ;B button
            Send, p
        If(state.wButtons & 16384)  ;X button
            Send, d
        If(state.wButtons & 32768)  ;Y button
            Send, e
    
        If(state.wButtons & 1)      ;D-Pad UP
            Send, D-Pad Up
        If(state.wButtons & 2)      ;D-Pad Down
            Send, D-Pad Down
        If(state.wButtons & 4)      ;D-Pad Left
            Send, D-Pad Left
        If(state.wButtons & 8)      ;D-Pad Right
            Send, D-Pad Right
    
        If(state.wButtons & 16)      ;Start
            Send, Start
        If(state.wButtons & 32)      ;Back
            Send, Back
    
        If(state.wButtons & 256)     ;Left Shoulder
            Send, Left Shoulder
        If(state.wButtons & 512)     ;Right Shoulder
            Send, Right Shoulder
    
        If(state.wButtons & 64)      ;Left Thumb Click
            Send, Left Thumb Click
        If(state.wButtons & 128)     ;Right Thumb Click
            Send, Right Thumb Click
    
        ;If(state.bLeftTrigger)
        If(state.bLeftTrigger > 100)       ;Left Trigger (range 0 - 255)
            Send, Left Trigger
        If(state.bRightTrigger > 100)      ;Right Trigger
            Send, Right Trigger
    
        ;Left Joy Stick (+/- 9000 is the deadzone)
            ; Range between -32768 and 32767. 
            ; 0 = Center
        if(state.sThumbLX < -9000 && state.sThumbLX > -32768)
            Send Left joy moved Left
        if(state.sThumbLX > 9000 && state.sThumbLX < 32767)
            Send Left joy moved Right
        if(state.sThumbLy > 9000 && state.sThumbLX < 32767)
            Send Left joy moved Up
        if(state.sThumbLY < -9000 && state.sThumbLX > -32768)
            Send Left joy moved Down
    
        ;Right Joy Stick
        if(state.sThumbRX < -9000 && state.sThumbLX > -32768)
            Send Right joy moved Left
        if(state.sThumbRX > 9000 && state.sThumbLX < 32767)
            Send Right joy moved Right
        if(state.sThumbRy > 9000 && state.sThumbLX < 32767)
            Send Right joy moved Up
        if(state.sThumbRY < -9000 && state.sThumbLX > -32768)
            Send Right joy moved Down
    
        Sleep, 200
    }

     

    Going back to attempting to not have to use the Xinput.ahk, would you please test 'the other way' by adding a $ at the beginning and see if that "still" doesn't work for you?

    $1Joy1::MsgBox You pressed A

    This is my last-ditch effort to have AHK's built-in method work for others, and not need to #Include Xinput.ahk (and NOT having to have some special window open. lol).  😊  If by chance it does work, we can give you access to the Guide button as well. ;) 

    • Like 1
  2. 1 hour ago, skizzosjt said:

    Here is me testing with adding in additional buttons.

    And here is me helping with a little code clean-up. ;) 

    #Include Xinput.ahk
    #Persistent
    
    SetKeyDelay, 0, 50          ;eliminates need for send {key Down} sleep 50 send {key Up}
    SetTimer, checkForJoy1, 10
    
    checkForJoy1:
    
    XInput_Init()
    state := Xinput_GetState(0)
    if(state) 
    {
       a_pressed := state.wButtons & 4096   ; 4096 = A button
       b_pressed := state.wButtons & 8192   ; 8192 = B button
       x_pressed := state.wButtons & 16384  ; 16384 = X button
       y_pressed := state.wButtons & 32768  ; 32768 = Y button
    
       if(a_pressed)
          Send, k
    
       if(b_pressed)
          Send, p
    
       if(x_pressed)
          Send, d
       
       if(y_pressed)
         Send, e
    
       Sleep, 100   ;helps reduce fast repeat. Increase or decrease as necessary
    }

    Start the script, open Notepad, press buttons.

    • Thanks 1
  3. 2 hours ago, drw4013 said:

    That is exactly what happens with my simple test script.  If the AHK window is open, it detects controller presses.

    When you say the AHK window, are you talking about the AutoHotkey Help window?

    image.thumb.png.57a112c498a41836878e40d1a889b6da.png

    That's just weird. It must be an Xbox One controller issue then.  Is that wired or wireless?  If wireless, is it an Xbox brand wireless receiver or a 3rd party one?

    I ask because mine is just a regular wireless Xbox controller with an Xbox (not 3rd party) receiver and I'm not having those issues.  And using Windows 10.  I have nothing AutoHotkey running, though I do have AHK installed.  But it doesn't run in the background at all.  Just adds right-click options when you select a .ahk file in Windows explorer.

    I can double click my joystick test script "test.ahk" file and it will execute, and everything works.  It also works without issue if I right-click test.ahk and select "Run Script".  Dragging test.ahk onto "AutoHotkey.exe" works as well.  I also tested from the Windows command prompt with "AutoHotkey.exe test.ahk" and that worked too.

    How are you executing your test script? When you start it, is it showing in the taskbar?   image.png.047a26d49165ba013758316d73518a75.png

     

  4. 6 minutes ago, drw4013 said:

    I previously tested a simple script

    When testing, try testing with something that will give you a visual response. 

    1Joy1::MsgBox, you pressed button 1 on your controller

    A message box will always show up (when it works ;)), but depending on what window has focus, "send a" may not always give a response.  I've done that too many times where the window wasn't focused and I'm screaming 'why isn't this working'. lol

     

    Windows 10 is fine, but I can't attest to an Xbox One controller as I don't have 1.  But at the same time, it's xinput. And xinput by any other name is still xinput.  Those things don't have a switch or some sort of button sequence press that switches it to dinput.  Does it?  That would surely mess things up.

    • Like 1
  5. @drw4013 @skizzosjt  If Windows sees your controller, you shouldn't have any issues with AHK detecting it.  With it plugged in and on, press Win + R on your keyboard, type "joy.cpl" (without quotes) and press enter.  

    image.png.58e7a598faaedb2961a39c53a334d9c9.png

     

    Here's a little ditty from the AHK Docs that talks about remapping controllers.  Remapping a Joystick to Keyboard or Mouse | AutoHotkey

    Note that remapping via AHK is one-way.  That is, you can setup a hotkey to detect a controller button press (joy stick, d-pad and even z-trigger) and remap that to send a keyboard input (or do some other task).  But, via AHK you can't setup a hotkey that will send a controller button-press.

    ; Good
    1Joy1::
    MsgBox, you pressed button 1 on your controller
    
    ; Not good (pressing Alt+a will not "press" button 1
    !a::
    Send, 1joy1

    Test the "Good" one outside of LaunchBox like you did the other.  You don't need XInput.dll.  It should just work.  If you read the Doc from the link above, you'll notice their examples don't use the preceding 1 in Joy1.  That 1st "1" is denoting controller #1.  If you have more that 1 controller plugged in and it doesn't work, you may be holding controller #2.  Myself, I only have 1 controller to test with.

    Also note that button numbering may vary between emulators.  Example, the Start button may be "7" in one emulator but "8" in another.

    Now, if you're trying to get your script to work in a Windows game, Steam or some variant there-of, that could be a whole 'nother issue.  And not a good one, I might add.  They can usually be a right PITA.

     

    But back to your original issue... "insert coin doesn't work for some games in MAME/FBNeo".  If MAME (I'm assuming stand-alone MAME) is accepting your other controller inputs, it surely will accept one for Coin Input.  But if it (coin input) works in some games and not others, chances are you have a cfg or ini file associated with that (those) game(s) that's overriding the coin input.  The 'fix' is to get it setup properly in MAME.  Right-Shift is a very odd coin input for MAME.  Also SendKey to MAME can at times be hit-or-miss.  If you're intent on 'fixing' it with an AHK script, you will need to use the one that has the sleep timer ("Sleep, 50") in it between key_down and key_up.  Or it definitely will never work.

    image.png

  6. Bulk Convert cue/gdi/iso files to CHD

    View File

    Bulk Convert cue, gdi or iso ROMs to chd

    This plugin expands the capabilities of the existing Bulk Convert .cue to .chd plugin by adding the options to also convert gdi and iso formats to CHD.  (For cue/bin files, the process is the exact same between the 2 plugins.)

    Using MAME’s chdman.exe (“Compressed Hunks of Data (CHD) Manager”, included with MAME), this plugin will convert CD based game files to a single .chd file in your selected Platform.


    Why convert?
    •    You end up with just a single file per game
    •    A CHD file is, well… compressed. Resulting in less storage space requirements
    •    Most, if not all emulators now support .chd format
    •    chdman applies lossless compression so there should no noticeable difference in load time.


    Requirements

    • This plugin file
    • chdman.exe (included with MAME)
    • ROM sets that are in a .cue, .gdi or .iso format


    What happens after converting?
    After successfully creating a CHD Image, the games application path in LaunchBox will be redirected to the new .chd file.

    Also, after the files have been converted you have the option to
    •    Leave the old files in place (default)
    •    Move the old files to a separate [backup] folder
    •    Delete the old files


    Installing the plugin
    1.    Download the plugin
    2.    Unblock “BulkConvert2CHD (v1.00).zip” by right clicking the file and checking “Unblock” and clicking “OK”.
                     
    image.png.9cb53ba0de6008c8ad17fa7776282d89.png
    3.    Open the zip file and copy the contents (1 folder containing 1 file) into /LaunchBox/Plugins/
                   ../LaunchBox/Plugins/BulkConvert2CHD/BulkConvert2CHD.dll


    Using the plugin
    1.    Start LaunchBox
    2.    Select Tools, Bulk Convert To CHD
    3.    Select a Platform
    4.    Select the file format you’re converting from
    5.    Click Convert
    6.    (Optional)
                   Check Delete old files when complete 
                          This will permanently delete the old files after successfully converting them to .chd.
                   Check Move old files when complete
                          This will move the old files after successfully converting them to .chd to the folder you specify.

     

    Troubleshooting:

    If you are getting errors while attempting to convert the files, make sure you are using chdman.exe that comes with the latest release of MAME.

    If you use multiple versions of MAME in LaunchBox, copy chdman,exe from your latest MAME release folder into the ../LaunchBox/Plugins/BulkConvert2CHD/ folder

     

     

    Special thanks to @faeran for the idea of the original Bulk Convert cue to chd.  Without that, I probably never would have made this.
     
    As always, all comments and suggestions are welcome.

     


     

  7. The several MAME ROM zips I looked in for Vectrex games all had single bin files.  And MAME should be able to play the unzipped, single file ROMs.  Vectrex ROMs can be .bin, .gam and .vec    So your blitz.vec should work.

    image.png.b49fb622fbe4041dcf6d5f4486aeda6b.png

    To use the unzipped ROMs, you'll need to have the command line point to the "full/path/to/the/rom.bin"  Example:  mame.exe vectrex -cart "D:\MAME\roms\vectrex\blitz.vec"

     

    As for the vextrex System file (vextrex.zip), the MAME zip I have has 2 bin files.

    image.png.f1560aea90ea2e820091c99b4246c506.png

    And based on the xml file for Vexctrex, MAME is going to be looking for those 2 files (inside the zip).

    image.thumb.png.4c4417d3ea1c03d1017597f966a84f07.png

     

    You may get lucky and MAME will read your vectrec.vec file as is.  That part I really don't know.  Can you just put that file into a zip?  Don't know that either. 

    • Like 1
  8. First things first is to get them working directly in MAME before attempting to launch them via LaunchBox.  Once you know they work through the emulator, THEN you can work on getting them to work in LaunchBox.

    You should keep the ROMs in their original .zip format.  Example the game "Blitz!" will be "blitz.zip".  This has always been the "special MAME format".

    You also need the System ROM "vectrex.zip".

     

    Now that you know they work directly in MAME:

    Did you setup a Custom Command Line Parameter for the Platform in the emulator settings?

    vectrex -cart

     

  9. 8 minutes ago, drw4013 said:

    could be the same original issue with these games

    You may could just try {Shift}.  Also, try pressing all your buttons, including joystick 'buttons'.  Just in case. ;)  Could you reassign the insert coin (in the emulator) to something that's not a "modifier key"?  Usually it's "5" for player one and "6" for player 2.

    • Thanks 1
  10. 1 hour ago, drw4013 said:

    After reviewing the auothotkey docs, something close to this?

    Joy7::         
    Send {rshift}
    Return

    Except this doesn't work (7 the Select button # for me) and not sure on the formatting of the right shift key...

    Try this:

    1Joy7::
    Send, {RShift}

    Basically just added a "1" in front of the controller.  

    The , (comma) after "Send" and the upper/lower case letters for "RShift" are more for "proper syntax".  The "Return" at the end isn't required because it is implied.  Unless this code is in the middle of a bunch of other code.

     

    Depending on which emulator you're using, you may need to 'exaggerate' the key press:

    SetKeyDelay, 0, 50
    
    1Joy7::
    Send, {RShift}

    Which is the same as 

    1Joy7::
    Send, {RShift down}
    Sleep 50
    Send, {RShift up}

     

    • Thanks 1
  11. 4 hours ago, Retrofrogg said:

    I don't seem able to add videos to playlists - I can add them in the edit playlist window, but when I click OK, the video doesn't appear where it should. It's still there if I go back into the edit window. I can add videos to platforms no problem.

    For the time being, try putting the video for the Playlist inside the /LaunchBox/Videos/Playlists/ folder and make sure the name of the file is the same as the Playlist.  Use either the Playlists Unique Name or Nested Name that you have assigned to it.

  12. 1 hour ago, Warped Polygon said:

    I hate using the cmd remapping tool in Supermodel. Updating the ini directly is my preferred way to remap my controls.

    I'm the same way. ;)  Thanks for the detailed post!  Adding to my notes.

     

    One thing I have different is for Star Wars Trilogy.  My brain works differently for moving left and right (no comments from the peanut gallery please. lol) so I inverted the InputAnalogJoyX

    ; Analog joystick (Star Wars Trilogy)
    
    ;InputAnalogJoyX = "JOY_XAXIS,MOUSE_XAXIS"   ; analog, full X axis
    InputAnalogJoyX = "JOY_XAXIS_INV,MOUSE_XAXIS"   ; analog, full X axis

     

    Another change I have is for Light guns (Lost World).   I made these changes a   l o n g   time ago and don't really play the 3 games affected but do recall it helped with Lost World.

    ; Light guns (Lost World)
    
    ; Add these 2 inputs
    ; Originally listed under "Analog guns". Mouse and joy conflict (so removed mouse)
    InputAnalogGunX = "JOY1_XAXIS"    ; analog, full X axis
    InputAnalogGunY = "JOY1_YAXIS"    ; analog, full Y axis
    
    
    ; Analog guns (Ocean Hunter, LA Machineguns)
    
    ; Comment out the following 2 lines
    ;InputAnalogGunX = "MOUSE_XAXIS,JOY1_XAXIS"    ; analog, full X axis
    ;InputAnalogGunY = "MOUSE_YAXIS,JOY1_YAXIS"    ; analog, full Y axis

     

    • Like 1
  13. 1 hour ago, megashub said:

    Do you happen to remember where you found this?

    I found this particular script in the folder where I saved it after I was done creating it. :D

     

    1 hour ago, megashub said:

    If the script you're referring to handles the pulling of MAME's game-specific controls configs into variables I can reference, that would cut out a lot of the work.

    lol  Don't take this wrong but, dream on.  I'm not saying I have that and won't share.  I'm saying that would be a PITA to incorporate.  Anyway, somewhere 'out there', there is/was a controls.dat (or controls.xml?) that listed button_1 = "Run", button_2="Jump" and so on, for quite a few arcade machines.  But it was created a long time ago, but in a galaxy not so far away.  And as far as I know, hasn't been updated since a long time ago.

    There is more recently "mame-portnames" on GitHub.  It was last updated 4 years ago. (And yes. I did say more recently)  It has the same info but in individual json files for each game.  Either of these can be parsed to gather games-specific controls for reference.

     

    The script I was referring to just shows an existing image.  It doesn't "create" them.  (CPWizard created them for me)  It was written quite a while ago, is kind of cheesy and somewhat primitive.  But was really cool when I wrote it. lol  Oh, and it messes up LB's Pause Screen.  But that didn't matter to me.

    Fow what it's worth, here's that emulator script.

    Spoiler


    ;*****************************************************************************************
    ;       Display an image file full screen corresponding to the selected MAME ROM.
    ;   
    ;       Image name and ROM name must be the same.  
    ;           dkong.zip  and  dkong.png  will work
    ;           dkong.zip  and  dkong_01.png  will not
    ;*****************************************************************************************
    
    #SingleInstance force
    
    ;*****************************************************************************************
    ;       Adjust the following only:
    ;       MAME directory
    ;       The MAME executable file
    ;       ROMS directory
    ;       Images directory
    ;       Duration to show image in seconds.  1000 = 1 sec (Optional)
    ;*****************************************************************************************
    
    SetWorkingDir, F:\Emulators\MAME
    MAMERun = mame.exe -keyboardprovider dinput
    RomDir = G:\Roms\MAME NonMerged
    ImageDir = F:\LaunchBox\Images\Arcade\Arcade - Controls Information
    ShowForSec = 7000
    
    ;*****************************************************************************************
    ;       Save it. Run it. Play.
    ;*****************************************************************************************
    
    Process, Exist, %MAMERun% ; check to see if MAME is running
    If (ErrorLevel = 0) ; If it is not running
        {
            IfExist, %ImageDir%\%1%.png
            {
                Gui, -Caption +ToolWindow
                Gui, Margin, 0, 0
                Gui, Color, Black
                Gui, Add, Picture, w%A_ScreenWidth% h-1, %ImageDir%\%1%.png
                Gui, show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, NA
                
                ;**** Optional****
                ;sleep, %ShowForSec%
    
                ;*** Wait for cab button 1, 2 or 3 press, or joystick movement
                Input, SingleKey, L1, {LControl}{LAlt}{LShift}{Left}{Right}{Up}{Down}
                
                Gui, Destroy
                Run, %MAMERun% "%RomDir%\%1%", , Hide
            }
            Else
            {
                Run, %MAMERun% "%RomDir%\%1%", , Hide
            }
        }
    Exitapp

     

  14. In order to help troubleshoot issues with MAME, please provide the following information:

    • Do the games work when starting them directly through MAME?
      • Start mame.exe, select a game and press Enter. 
        • Does it run?
        • Or do you get error messages? 
          • If so, what game are you trying to run and what exactly is the error? [provide a screenshot if possible])
    • What version is your MAME emulator?  (example “0.246”)
    • Are the ROMs you are using match your version of MAME?  (example “0.246”)
    • What version of LaunchBox are you using?

    Screenshots

    • Go to Tools, Manage, Emulators, select the emulator you’re using for MAME and provide a screenshot of the following sections
      • Details
      • Associated Platforms
    • Select one of your Arcade (MAME) games and click Edit (or press Ctrl+E). Provide a screenshot of the following sections
      • Metadata
      • Launching
      • Emulation

  15. 33 minutes ago, Joe35car said:

    It only wants to import only one game (Marchen Maze)

    Of the 25 games that are in MAME's software list "megaduck", "Marchen Maze" happens to be the only one that also has an arcade machine with the same name.  That's why it imports and none of the rest do.  So basically, you got lucky with the one.  ;)  As you've found, LaunchBox only imports MAME's arcade machines and not any their software lists.  

    It's my understanding the plugin Neil mentioned will do what you're wanting.

    • Thanks 1
  16. 9 hours ago, Error 404 said:

    as an example, i still get two "1942" games.

    Clones are revisions or modifications of the Parent games' ROM set (the physical files of the originally released game).  Though the PlayChoice-10 cart version (the one on the left) is part of the 194x Series, it doesn't use any of the original files.

    So it's not technically a "Clone".  You could almost call it a 'Port' of the game.  Play the PC-10 Arcade version (released 1987).  Then go play the NES Port of the game (released 1985).  You might notice some visual similarities between the 2.  Now play the original Arcade Machine (released 1984) and see 'how it was meant to be'. ;) 

  17. 10 minutes ago, stigzler said:

    isn't this just standard mapping for all games - not game specific mappings?

    I don't recall. I kind of made (modified actually) a pause theme of my own to show the game specific controller image.  But just for Arcade.  The control panel images are stored in \Images\Arcade\Arcade - Controls Information\.   And I bind them using   Source="{Binding SelectedGame.ArcadeControlsInformationImagePath}"

    For all other Platforms I do have a 'standard mapping' image.  But I don't really use those anywhere.   But I do know that you can create (if it doesn't exist) an \Arcade - Controls Information\ folder under any platforms image folder (i.e.  \Images\Nintendo GameCube\Arcade - Controls Information\) and bind the image the same way.

  18. "Favorite" you see in LaunchBox image.png.64bf7ffd8e8177f9e897b3835a5925e9.png

    isn't the same as a Playlist you create.  Unless you actually created a Playlist. 

    If you want to see your Favorites in BigBox, you can either create a Playlist (in LaunchBox) and set the filter to auto populate based on Favorite = True.

    image.png.424e38bb1f08e1132337a475caa36cd2.png image.png.207ebf6509814cadf0b6405b5a414027.png

    Then in BigBox, set to view Playlists.

    image.thumb.png.48708e6920f56e2b2fe536b8520cfbc7.png

    Or

    In BigBox, enter into a Platform, get into the navigation bar (sorry. not sure what it's technically called. But on my test PC I press the Left or right arrow key) and select the Filter Icon.

    image.thumb.png.3df5bd514f752488c24d577d3157f6e0.png

    Once selected, add the filter and apply

    image.thumb.png.2cd1e3388f038fedc59ec768749b1533.png

  19. 7 minutes ago, sgordon777 said:

    I copied mame.exe m1.exe, and am now able to treat it like other emualors, without it trying to "name" the image I'm using.

    I have this wokring both for atari2600, and for apple2gs

    I'm curious.  Between your MAME and M1 emulator settings, does one of them have these 2 boxes checked, and the other doesn't?

    image.png.743114867823db13e6ec7a7fae5f7a04.png 

  20. 3 minutes ago, sgordon777 said:

    mame apple2e -floppydisk1 {path_to_my_disk_image_binary}  # works perfectly fine

    If this works perfectly, then MAME is recognizing it.  Can you show a literal example?  As in the full path and file name plus extension.  

    For Apple IIe floppies, MAME supports  extensions: mfi, dfi, dsk, do, po, rti, edd, woz, nib   For cassettes it's .wav

    Honestly, you're creating more work than necessary by not having an actual MAME softlist ROM set.  You know. .zip files.

    But according to your "works perfectly file" statement, you CAN make it work with what you have.  You NEED to have the afore mention check boxes un-checked in the emulator settings so that it will pass "{path_to_my_disk_image_binary}" at the end of the command line.

     

    15 minutes ago, sgordon777 said:

    Is there simply no way to have LB start mame as a system and not try to interpret the image it's loading?

    Do you mean like, double click a game, and have LB simply just open MAME. And then you navigate to Apple IIe, and then select a game from there?  aka: have the LaunchBox frontend open the MAME frontend.  You can always Right-Click a game and select Open MAME (assuming it's the default emulator for that Platform)

    image.png.11f3e2e4653cb7f84f4a66299c4053d9.png

     

    21 minutes ago, sgordon777 said:

    What if I renamed mame.exe to something else?

    An emulators executable name is simply a name, by any other name.

  21. Scratch that new emulator idea above.  Just ran some tests..

    As stated in your other post about this, put all your Atari 2600 .bin files into the folder "R:\atari2600\a2600\"  

    R:\atari2600\a2600\adventure.bin
    R:\atari2600\a2600\pitfall.bin

    You don't need to add a2600 to the rompath.  Since your command line says to 'go into Atari 2600 mode', MAME knows to look for a subfolder called a2600 within your rompath's you have listed.

    Don't need to change any of your existing MAME setting in LaunchBox.  Just add the subfolder, move the .bin files into it, start LB and play Pitfall (and Adventure).

×
×
  • Create New...