Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: How to use Batch routines for Taito X games  (Read 5566 times)

0 Members and 1 Guest are viewing this topic.

romshark

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 389
  • Last login:October 16, 2023, 02:50:59 pm
  • Arcade and Robotics enthusiast
How to use Batch routines for Taito X games
« on: December 31, 2016, 12:43:48 pm »
My testing with this is with Mala, but I've heard that it happens in other front-ends too. So putting it here for more visibility.

Ok, so one problem I've had with my setup is with some of the Taito X games. The problem is the front-end (Mala in my case) having a screwed up layout or other oddities when exiting the game. I even asked about it before, but nobody had the answer.

So what causes this? Well, most of my Taito X games are launched using the command "typex_loader.exe game.exe" or similar. What happens is typex_loader.exe gets game.exe running, and then typex_loader.exe exits while game.exe runs.

The problem is, the front end watches for the executable it called to end, before going back to normal operation. So typex_loader.exe exits and the front-end resumes. The problem is, game.exe is still running.

One way I used to get around it is putting a pause in the batch routine after the game. That way, it keeps the batch routine open, and the front end won't resume until the batch routine closes. (By the way, here the batch routine has the same problem as above: once typex_loader.exe closes, the routine continues.)

Code: [Select]
echo Don't press any joysticks or buttons until the game loads.
echo After you quit the game, pressing any button to return
echo to the Mala Frontend.
pause

Not, the problem is that the big DOS prompt looks out of place on an arcade machine. Kinda looks tacky. Also, because I have to have the prompt open for people to read, I can't have any of the games in that list minimized or hidden (even if they work normally). DOS boxes everywhere.

After some looking, I found what I think is a good solution. Still using batch routines, I found out how to monitor for a specific program, and keep the batch routine running in a loop until that program closes.

Code: [Select]
@echo off
REM [any pre-stuff, like keyboard encoder programming, goes here]

REM /d [path] "[executable only]" "[arguments for executable]"
START "" /d G:\PC_Arcade\BBCS "typex_loader.exe" "game.exe"

REM timeout for game to start
Timeout /T 5 /Nobreak >nul 2>&1

:LOOP

REM Executable to monitor, like "GAME", goes in quotes here.
tasklist | find /i "GAME" >nul 2>&1
IF ERRORLEVEL 1 (
  GOTO CONTINUE
) ELSE (

  Timeout /T 1 /Nobreak >nul 2>&1
 
  GOTO LOOP
)

:CONTINUE

REM [post stuff, like resetting encoder to default, goes here.]

This will run the game as before, but once every second, it checks to see if "game.exe" is running in memory. If it's still running, it waits a second and then returns to the top of the loop, checking again. Once game.exe closes, the routine goes to the "continue" part.

This can be tested by using ALT-TAB while the game is runing. You can then see the batch routine is still open. If you stick a "echo Game Running" in the loop (right before or after the TIMEOUT command), you can see that line displayed again and again once a second. (Please note that most of these games aren't designed for task switching, and the game will have to be closed from task manager if you ALT-TAB out of it.)

If you edit this file for your setup, change the path to your Taito_X game on the "START" line. If the game is one that uses launcher.exe, make sure to change "game" to "launcher" in the "tasklist" line too. I've tried to label everything, so it can be easily modified as needed (such as programming keyboard encoders).

Hopefully this will help people out with not just Taito_X, but any other games or programs that do something like this too.

Uploaded a copy of the batch file (had to change extension to .txt to upload it. Just change it back to .bat)
« Last Edit: December 31, 2016, 12:46:51 pm by romshark »

gdonovan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 05, 2021, 02:37:58 pm
  • I want to build my own arcade controls!
Re: How to use Batch routines for Taito X games
« Reply #1 on: January 01, 2017, 09:12:07 am »
I have been playing with Mala for the first time and trying to setup some old PC games like GLQuake and using the front end to launch them. Noted the same problem! Game launches fine but when game is over and you return to the front end the screen is down and to the right.

haynor666

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1471
  • Last login:April 22, 2024, 03:17:30 am
  • retro maniac
Re: How to use Batch routines for Taito X games
« Reply #2 on: January 01, 2017, 04:03:12 pm »
I'm using pause command, I didn't find any other solution. The only problems is Raiden IV which does not work when I use pause :/

romshark

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 389
  • Last login:October 16, 2023, 02:50:59 pm
  • Arcade and Robotics enthusiast
Re: How to use Batch routines for Taito X games
« Reply #3 on: January 02, 2017, 10:15:10 am »
I have been playing with Mala for the first time and trying to setup some old PC games like GLQuake and using the front end to launch them. Noted the same problem! Game launches fine but when game is over and you return to the front end the screen is down and to the right.

Try the Mala option "Reorder layout after game quit." (In Mala -> Options -> GUI -> Game Start/Quit. At the bottom of that tab.) That should help out.


I'm using pause command, I didn't find any other solution. The only problems is Raiden IV which does not work when I use pause :/

I've never gotten Raiden IV to run. At all (even without a front end, or really anything else running). Hopefully I can get it running one day.

Sky25es

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 160
  • Last login:August 26, 2023, 05:19:21 pm

gdonovan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 05, 2021, 02:37:58 pm
  • I want to build my own arcade controls!
Re: How to use Batch routines for Taito X games
« Reply #5 on: January 03, 2017, 10:09:26 am »

Try the Mala option "Reorder layout after game quit." (In Mala -> Options -> GUI -> Game Start/Quit. At the bottom of that tab.) That should help out.


Thanks but no dice.

Want me to post a pic?

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:April 22, 2024, 09:54:06 am
  • ...
Re: How to use Batch routines for Taito X games
« Reply #6 on: January 03, 2017, 11:04:37 am »
I have been playing with Mala for the first time and trying to setup some old PC games like GLQuake and using the front end to launch them. Noted the same problem! Game launches fine but when game is over and you return to the front end the screen is down and to the right.

If you're running autohotkey, I've found that the gentler Winclose command leaves things in order better than Process, Close.

For me, a few of the Taito Type X games (Like Raiden) would not run if anything else was running.  So I made a crazy AHK script to kill Mala, launch the game, then relaunch Mala after the game is exited.  It works, but is far from ideal.  Not sure if I'll go back and try this solution though.

The problem with the Taito Type X games is there are a bunch of different versions of the same games floating around out there which were released at different points in them being hacked.  Mine are early versions and don't behave as nicely as later versions as far as launching and running at higher resolutions.  All of them have been passed around so much, there's no way to tell what you're getting.  :-\

The version of Raiden I have won't run if there aren't speakers or headhones connected.   ???

« Last Edit: January 03, 2017, 11:06:25 am by BadMouth »

brad808

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:May 22, 2023, 08:18:15 pm
Re: How to use Batch routines for Taito X games
« Reply #7 on: January 03, 2017, 11:36:50 am »
The raiden games have now had the NESiCAxLive dumps released and they are much nicer to work with. No messing around with rotation, hiding stuff, focus, missing graphics, etc.

gdonovan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 05, 2021, 02:37:58 pm
  • I want to build my own arcade controls!
Re: How to use Batch routines for Taito X games
« Reply #8 on: January 03, 2017, 11:55:38 am »
If you're running autohotkey, I've found that the gentler Winclose command leaves things in order better than Process, Close.

Just running Mala, nothing else.

The direct 3d games like Hydro Thunder and Blitz won't do it, the OpenGL Id Software games will every time. If I reduce the desktop resolution to 800 x 600 the problem goes away but then the screen looks.. poor.

Titchgamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4222
  • Last login:December 17, 2023, 08:05:48 am
  • I have a gaming addiction.....
Re: How to use Batch routines for Taito X games
« Reply #9 on: January 03, 2017, 05:29:43 pm »
Have you seen giga pigs tut video for TTX games?
Its aimed at hyperspin but may help you?

Never used mala but I got 90% of them working with his you tube video.
Hes a top bloke to :)

gdonovan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 125
  • Last login:December 05, 2021, 02:37:58 pm
  • I want to build my own arcade controls!
Re: How to use Batch routines for Taito X games
« Reply #10 on: January 03, 2017, 06:27:35 pm »
I'm not too concerned about it.. The front end is up and functioning (just figured out how to get background sound up and going) and its just a minor snit. I don't see myself playing many first person shooters unless I put in a trackball.

Before I do that I see myself building a "driving cabinet" first, especially since I have the PC versions of Hydro Thunder and SF Rush the Rock working on the test rig.