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 --- Bug Reports --- Site News

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

  

Author Topic: Better bath script to start a mame game  (Read 315 times)

0 Members and 1 Guest are viewing this topic.

lllll44

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 129
  • Last login:October 24, 2020, 02:06:01 pm
  • I want to build my own arcade controls!
Better bath script to start a mame game
« on: October 05, 2020, 10:41:16 am »
hi,
i use this script for mame games:

@echo off

Type :
d:
cd \
cd emulators
cd mame
mameui64.exe roms\alien3.zip

exit

is there a shorter/better way to start a mame game?

Drnick

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1614
  • Last login:Today at 04:06:49 am
  • Plodding Through Life
Re: Better bath script to start a mame game
« Reply #1 on: October 05, 2020, 10:55:18 am »
I'm betting that you have tried rolling it all together to get d:\emulators\mame\mameui64.exe roms\alien3.zip and it failed,  I believe the reason for this is it does not know where the INI file is located without being in relative path,  thus using d:\ cd\ cd emulators etc puts the system in the right relative folder.   Try adjusting the command line to something like this.

d:\Emulators\mame\mameui64.exe"-inipath d:\Emulators\mame\" d:\Emulators\mame\roms\alien3.z

Is it shorter, No, Is it easier to script, possibly :) :) :)



lllll44

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 129
  • Last login:October 24, 2020, 02:06:01 pm
  • I want to build my own arcade controls!
Re: Better bath script to start a mame game
« Reply #2 on: October 05, 2020, 12:58:36 pm »
thank you. will try:)

nexusmtz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 454
  • Last login:Today at 03:26:29 pm
Re: Better bath script to start a mame game
« Reply #3 on: October 06, 2020, 12:21:34 am »
pushd d:\emulators\mame
mameui64.exe alien3

(as long as d:\emulators\mame\mame.ini includes "rompath roms")

lllll44

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 129
  • Last login:October 24, 2020, 02:06:01 pm
  • I want to build my own arcade controls!
Re: Better bath script to start a mame game
« Reply #4 on: October 08, 2020, 09:12:00 am »
pushd d:\emulators\mame
mameui64.exe alien3

(as long as d:\emulators\mame\mame.ini includes "rompath roms")

thanks man...works great.
but why its "pushd" and not "start?"

nexusmtz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 454
  • Last login:Today at 03:26:29 pm
Re: Better bath script to start a mame game
« Reply #5 on: October 08, 2020, 11:24:01 pm »
pushd changes the drive and current directory at the same time.

pushd also tells the command processor to remember where you were, so you can popd back later.

ex:
C:\>pushd u:\games\mame0219b_64bit
u:\games\mame0219b_64bit>mame64 dkong
u:\games\mame0219b_64bit>popd
C:\>

The command processor memorizes c:\ (pushes it onto a stack) before it switches to u:\games\mame0219b_64bit, then it recalls c:\ (pops it off the stack) when you say popd.

You don't need to use popd in your case, because you're ending the batch file anyway, so it doesn't matter where you end up.

"Start" is used when you want the command processor to run a command with specific options in a new instance of the command processor. One option (/D) is the starting directory. You certainly could use Start instead of Pushd, and do it all with one command, but there's little reason to kick off another command processor when all you wanted to do was set the working directory. Anyway, that would be:

start /d d:\emulators\mame /min /wait mameui64.exe alien3

Drnick

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1614
  • Last login:Today at 04:06:49 am
  • Plodding Through Life
Re: Better bath script to start a mame game
« Reply #6 on: October 10, 2020, 10:35:56 am »
pushd changes the drive and current directory at the same time.

pushd also tells the command processor to remember where you were, so you can popd back later.

ex:
C:\>pushd u:\games\mame0219b_64bit
u:\games\mame0219b_64bit>mame64 dkong
u:\games\mame0219b_64bit>popd
C:\>

The command processor memorizes c:\ (pushes it onto a stack) before it switches to u:\games\mame0219b_64bit, then it recalls c:\ (pops it off the stack) when you say popd.

You don't need to use popd in your case, because you're ending the batch file anyway, so it doesn't matter where you end up.

"Start" is used when you want the command processor to run a command with specific options in a new instance of the command processor. One option (/D) is the starting directory. You certainly could use Start instead of Pushd, and do it all with one command, but there's little reason to kick off another command processor when all you wanted to do was set the working directory. Anyway, that would be:

start /d d:\emulators\mame /min /wait mameui64.exe alien3

Why am I just now learning about Pushd :) :) :) I'm going to be using that one in the future.  So so many Powershell commands I have yet to learn :)