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. Thank you for your support. Tom Speirs

Patreon

gameEX and .bat files


romstar

Recommended Posts

hi , i have made some segacd .bat files that work

fine within windows but once i add the rom directory

with my .bat files , the list appears but the emulator

doesnt load up and roms.

the emulator is fusion and everything is set up and

working fine , it's just since i changed to bat files i

cant get roms to load.

any help would be great

thanks

Link to comment
Share on other sites

hi , i have made some segacd .bat files that work

fine within windows but once i add the rom directory

with my .bat files , the list appears but the emulator

doesnt load up and roms.

the emulator is fusion and everything is set up and

working fine , it's just since i changed to bat files i

cant get roms to load.

any help would be great

thanks

hey

i got sega cd working fine using fusion im just wondering what the bat files do??

my guess you are mounting images?? fusion can open iso images without mounting

Link to comment
Share on other sites

  • 3 weeks later...

Re-opening old topic for this question...:

Has anybody come up with a way to use .bat files (with SegaCD of course) and have the emulator exit when BACK or ESCAPE is pressed? I've not been able to do it. According to the GameEx configurator, it explicitly says it won't work. Is there a reason why, and is there a possibility of correcting it?

Perhaps some work could be done on the "Roms in Folders?" option of emulators?

I think I know why it won't work with bat files. GameEX is waiting for a keypress to end the program. If the program is being launched from a bat file, then GameEX is unable to hear it. Is there a way to have a trigger withing a bat file to work in the same way? Like.. "If key pressed, goto line 50" and line 50 says "quit".

Also.. with the newest versions of GameEx, there's an ability to use goodroms/7-zip. I believe I read somewhere that GENS (sega emulator) does support 7-zip. Would this then suggest that if I were to 7-zip all my folders, GameEx would be able to run rom and emu this way? Just have it look for .7z files?

Link to comment
Share on other sites

Im not sure how a batch file will help, you can try using JoyToKey. Pick a button you want to use to exit & map whatever the emulator uses to exit, probably Alt-F4.

Then use the AlsoLaunch option in emu config, and then kill it after the game is over using taskkill.

AlsoLaunch=C:\Emulators\Sega32\JoyToKey.exe

LaunchAfter=taskkill.exe /F /IM JoyToKey.exe

Headkaze deserves the credit on this one. (Its best to just have one cfg file in the same folder as joytokey, so you can be sure the right one loads up) Also set it to 'dont show window at startup time'.

Link to download JoytoKey 3.79 (jtk379en.zip) (307 kb)

Link to comment
Share on other sites

Im confused now aswell :)

If you want to launch joytokey in a batch file then use this code:

@echo off

start "" "C:\Emulators\Sega32\JoyToKey.exe"

Joytokey will allow you to exit with a gamepad, but not the mce remote.

I'll shut up now, because i havent used sega32 before & i could be way off the mark :unsure:

Link to comment
Share on other sites

Ok I gave joytokey a try. I assigned my 2 shoulder buttons. The left one is TAB (to reset the emulator) and the right one is ALT+F4 (to close the emulator). When I try to launch a game, it it seems to load ok, but my Joy2Key buttons aren't working. When I force close everything, it shows the program in the taskbar using a cfg I never created. Any Help?

Link to comment
Share on other sites

GRR!! It works fine on its own.. if I launch the Joy2Key program then launch the bat file. But when I do it through GameEx now, it just goes to a black screen for about 5 seconds then returns to GameEx. UHG! Why won't it work for me?!! :(

Link to comment
Share on other sites

Gameex launches your games through batch files, me thinks. The launch before/after functions just add commands at the start & end of the batch file.

So go to the Gameex/Data folder & open the 'runitgame.bat' with notepad. It'll show you the commands gameex used to launch your last game; hopefully this will help you figure out whats going on.

edit: I think i might know why the black screen is coming up; here's a working batch file:

@echo off
start "" "N:\mega drive\JoyToKey.exe"

N:
CD "N:\mega drive"
gens.exe "N:\mega drive\Games\Addams Family, The (Beta).bin"

taskkill.exe /F /IM JoyToKey.exe

& here's the one from gameex:

N:
CD "N:\mega drive\"
"n:\mega drive\joytokey.exe"
gens.exe "N:\mega drive\Games\Addams Family, The (Beta).bin"
taskkill.exe /f /im joytokey.exe

I think the gameex batch file might be waiting for joytokey to finish, before loading the rom

Link to comment
Share on other sites

Well I looked, and it's all very confusing. When I try to launch j2k before the game in a batch file, the computer just sits there, waiting for j2k to end. Once that happens, then it goes to the next line of the batch file and the rom runs. So I can't have both running at the same time. I guess I'll have to try something else.

Link to comment
Share on other sites

Try starting it from 'also launch'in the gameex confg

Heres what the help text says about the function:

Full path and file name to a file to launch synchronously with

the Emulator. This is usually something like an AutoIT script.

This runs at the same time as emulator. See my vp.aut script for

Visual PinMame. Maybe also possibly a Trainer

It might do the trick

Link to comment
Share on other sites

I dunno, my configuration looks fine:

[Emulator_9]
Enabled=True
STARTPAGENAME=SegaCD Games
TITLETEXT=SegaCD
StartPageLogo=genesis
ROMFilter=*.bat
RomsInFolders=False
RomPath=D:\_SEGACDROMS\BAT
SnapPath=D:\_SEGACDROMS\SNAP
WorkingPath=D:\_SEGACDROMS
MapKeys=True
WaitBeforeKeys=
SendKeys=
ReplaceDash=False
ReplaceUnder=False
Capitals=False
RemoveBrackets=False
ShowDesktop=False
Debug=False
MAPFile=
AlsoLaunch=D:\_SEGACDROMS\1\JoyToKey.exe
Command=""[ROMPath]\[RomFile]""
OLDatZip=
TitlePath=D:\_SEGACDROMS\TITLE
BoxPath=D:\_SEGACDROMS\COVER
LaunchBefore=
LaunchAfter=taskkill.exe /F /IM JoyToKey.exe
CartPath=D:\_SEGACDROMS\DISK
configFile=
ExcludedFiles=
CustomBackground=
PlayMusic=
PCGame=
DATABASE=SEGACD
DumbyValue=
GamesIn7Zips=

Link to comment
Share on other sites

I think the gameex batch file might be waiting for joytokey to finish, before loading the rom

This is exactly what its doing.. because that's how batch files work.. they go down the lines and execute each one at a time, waiting for the previous to stop before going on.

Here's the solution though.. you have to use LINKS/SHORTCUTS instead.

So I created a shortcut to JoyToKey.exe and called it J2K.lnk. I then created a shortcut to Gens.exe and called it go.lnk. I then moved the shortcuts to the same folder as my BAT files. I then created the BAT file:

j2k.lnk 
run.lnk "D:\_SEGACDROMS\ROMS\Sonic CD\Sonic CD.iso" -scd -auto
cls

The cls is a required line. I don't know what its for (going from an online website example) but if it's not their nothing happens. This works perfectly outside of GameEx. The mapped buttons work and everything is A-OK. Now the only problem is getting it to work within GameEx. For some reason, when this BAT file is loaded it gets all goobered. The rom loads up, but the screen is black. When I press the controller button to reset or close, nothing happens and the game continues to run. I believe there is a problem with the stacking windows, and GameEx or J2K is staying on top. So when I DO close, it closes the other program and not the emulator.

Link to comment
Share on other sites

You could be right, try setting the desktop to show, also change the debug mode so you can see whats going on, other than that im all out of ideas.

Also you might need to add quotation marks to this:

AlsoLaunch=D:\_SEGACDROMS\1\JoyToKey.exe

Link to comment
Share on other sites

I'm just getting mad now.. I've tried everything from START to shortcuts, to NOT shortcuts to who knows what else. I can't get this to work. I need somebody else to help. I can't belive nobody but me and amos are trying to make this work (and I don't think he's even trying, just giving suggestions ^_^)

Link to comment
Share on other sites

Ok, I havn't read the whole thread, but here are some quick suggestions that may or may not be relevent.

1. You can use parameters with a batch file, it makes life so much easier. You shouldn't need a batch file for each game.

Eg. myBat.bat "My Game"

-- myBat.bat --

@ECHO OFF

echo %1%

-- end myBat.bat --

As you can see launching myBat.bat with a parameter makes it acessable through the batch file as a variable called %1%. And yes it does work with multiple parameters (ie %2%, %3% etc).

Secondly, hansolo is correct, a batch file will wait for a program to finish before launching the next file in the list. The way around this is to use another batch file and use the "call myNextBat.bat" to launch the second batch file, and it will run concurrently. You can read an example use of this method for Virtua Tennis here

Also, I don't know why your using shortcuts, but a batch file will not wait for a shortcut to finish. Even using the Start /WAIT. I have written a program that will launch a shortcut and wait for it to finish. Not sure if that will be any help. It's called runwaitlnk.

Now I'm not sure why your using bat files in the first place, when you can use AlsoLaunch (not LaunchBefore) and LaunchAfter to kill the JoyToKey process. As given in an example in a post above. I've never had a problem using this method.

Link to comment
Share on other sites

The problem I was having was with the Joy2Key program. Even though it was set to launch with the emulator, it seemed to always be launching second, and therefore was the top window. So when I the game would load, it would be in the background and all I would have is a black screen. If I did the joystick button to close the emulator, it would close the Joy2key program instead. So I would be stuck at a black screen permanently unless I did an ALT+CTRL+DEL. If I ALT-ENTER nothing happens. So I was trying to find a way to launch Joy2Key after the emulator, and BAT files were the only way I could find. I just added the command to the original file to find the rom. It didn't work either.

BUT, I may have found a solution. My game controller comes with special programming software that does what Joy2Key does. I simply map the buttons to do different things. The software stores the settings as profiles. I simply have the AlsoLaunch configured to change the profile from none to SegaCD (in this case). It works perfectly now. Now all I have to do is figure a way to get the profiler software to change back to no profile loaded and I'm set.

Link to comment
Share on other sites

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