Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

:blink::blink::blink::blink::blink:

I'm using a Saitek P2500 rumble pad controller. I've been trying to figure out how to map keys to my controller to exit games that are being executed via bat files (Sega CD games). Many people have found that using the JoyToKill program and taskkill seem to work, but it doesn't for me for some ungodly reason. So in my attempts to find an alternative solution I've found that my controller comes with software to program unused keys/buttons for other functions.. just like the JoyToKey program does. I've made a profile for SegaCD where my left shoulder button does a RESET CONSOLE (the TAB button) and my right shoulder button does an EXIT OF PROGRAM (the ALT+F4 buttons). To load this profile, Saitek was kind enough to also include a program called PrfAct (basically, Profile Activator). You use PrfAct on a command line, and direct it to the profile you want to activate (in my case, the segacd.dat file). Because it takes 2 commands to accomplish this, I've written a simple bat file to execute it. It calls the program, and then the profile. I direct the AlsoLaunch= option in GameEx to created bat file to execute the profile activation. That part works great. Everytime I go to load a game, it executes the profile like it should. However, to de-activate the profile, it's a little different. Apparently, the command "PrfAct -c" is supposed to clear the profile, but it doesn't work. I've already contacted tech support and posted numerous messages on their support forum. I'm still waiting to hear back. In the meanwhile, I've created a dummy profile, that is just a blank canvas with no assignments (since any button with no assignment simply makes the buttons act in their normal way). I then created another bat file to execute that profile. When I test from outside GameEx, the activation of the segacd profile works, and the activation of the default profile works. However, when I try to do this through GameEx, it doesn't. I put the "deactivation" bat file in the LaunchAfter= line. When I exit GameEx to check the status of the profile that's activated, it still shows the segacd profile. I was curious, and ran the process again with the debug turned on. Apparently what is happening is the LaunchAfter= command is being inputted into the basic start up game bat file that GameEx uses, only it's at the end. This would be ok normally, but because the games are being executed by bat files, the LaunchAfter= simply launches after calling the loading rom bat file. The profiler program is kinda slow, so the second activation command doesn't get recognized because it's still in the process of loading the other profile. The end result is that the segacd (first profile) profile remains running until I forcebly clear it.

So to make that long story short, it doesn't work. The LaunchAfter= doesn't really launch after. What I need is an option like the AlsoLaunch= that will launch the command AFTER the emulator exits and returns back to GameEx. Is there anyway to do this? I need the LaunchAfter= to occur after the process has begun to return to GamEx, not after executing the rompath/romfile.

Posted

Hi Hans,

things not going smoothly :)

I've got one suggestion; you can try adding some timed intervals between your commands in the batch file.

save this code as 'WAIT.bat'

@ping 127.0.0.1 -n 2 -w 1000 > nul

@ping 127.0.0.1 -n %1% -w 1000> nul

and place it in the same folder as the bat file your are using. To add timed intervals in the batch file simply type:

CALL WAIT 9

for a nine second delay, (no need to press any buttons to resume or anything). You can use any number up to nine i think. So if you need more time just repeat the 'call wait line'.

Hope it helps, but i'll admit i havent tried it with gameex :)

Posted

Yeah I thought about using a delay like that, but it won't solve my problem. I'd have to only play for 9 seconds. :) I suppose I might be able to throw a PAUSE in there, and have the EXIT button perform not only an ALT+F4, but also an ENTER to unpause... then have it execute the unload. I'll try it and see.

Posted

Ok I finally got it I think.

"Sonic CD.bat" - RomPath=D:\_SEGACDROMS\BAT & RomFilter=*.bat (placed in rom path)

"D:\_SEGACDROMS\gens.exe" "D:\_SEGACDROMS\ROMS\Sonic CD\Sonic CD.iso" -scd -auto
"C:\Program Files\Saitek\Software\Profiles\CLEAR.bat"

"SegaCD.bat" - AlsoLaunch= (activate SegaCD controller profile) (placed in profiler's folder)

prfact -v-f"C:\Program Files\Saitek\Software\SEGACD.dat" -A

"CLEAR.bat" (return to default controller profile) (placed in profiler's folder)

prfact -v-f"C:\Program Files\Saitek\Software\DEFAULT.dat" -A

I tried to use amos' idea with the delay, but it just seemed to sit there forever, so I gave up with that and tried the PAUSE command. That's supposed to give you time to press ENTER before taking the next step. I added the line to the beginning of the CLEAR.bat file, and added the ENTER button after the ALT+F4 assignment in the SEGACD.dat profile. That didn't work either. What that did was cause the game to start back up again once it returned to GameEx. The dos window was still open with the PAUSE command up. So I was about to give up. I then thought about putting the CLEAR.bat call into the end of rom bat file, and it worked! Going down the line, as bat files do, it loads the emu/rom and wait's till it's done. Then it calls CLEAR.bat. Once the call is made, the rom bat file closes and returns to GameEx. It's all about the process the computer takes with the files. When you have a bunch of BAT files being called from a bat file, one after another, they all launch at the same time. So I had to break out of the bat system. Because GameEx uses bat files internally, this was such a hassle. I had a bat file calling the profile, then a bat file calling the rom, then a bat file calling the default profile, all within Tom's automated bat file! So yeah, that don't work. With this little bit of trickery, the process now is the profile is launched the same time the rom is... Once the command to execute the profile is done, that bat file closes. The rom bat file continues to run until the execution of it's command (playing the game) is done, then it goes to the next line, calls the defaulting profile, closes, and loads up GameEx. While GameEx reloads, the defaulting profile is executed, changing the profile back to the other one, and then closes. Ta-Da! Ok now I've got to go try it again and make sure it's still working! LOL :)

Posted

I use the gens emulator and find it usefull to use the joypad mapping that comes with gameex use perform an ALT+F4 with a key combination. I use an PSX to USB converter and when I press a multiple keys this works with 99% of my EMUs

Guest
This topic is now closed to further replies.
×
×
  • Create New...