ThePromethean98
Posts: 4
Joined: Mon Apr 22, 2013 3:36 pm

Programming MAME Emulator to start on boot

Mon Apr 22, 2013 4:25 pm

Hi
I am running wheezy and i don't know much about coding, but i dont know how i can get mame running at start up for my arcade machine. The executable is located in /usr/local/bin/indiecity/installedApps/mame4all_pi/Full and inside is located the executable simply named 'mame' (Without apostrophes) used to start up the emulator.
How can i get wheezy to start the mame emulator on boot?
thanks! :D

EdwinJ85
Posts: 267
Joined: Wed Feb 01, 2012 4:44 pm
Contact: Website

Re: Programming MAME Emulator to start on boot

Tue Apr 23, 2013 3:36 pm

Hmmm, if the program directly addresses the video output device you could always try making it an init.d script / daemon. Copy and change the one at the link below to your liking.

http://www.stuffaboutcode.com/2012/06/r ... rt-up.html.
Hello!

pudding
Posts: 93
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: Programming MAME Emulator to start on boot

Tue Apr 23, 2013 4:10 pm

Here's what I use, warning this can mess up your Pi booting if you get it wrong! It will also automatically login rather than prompt for a login and password!!! Also before doing this make sure MAME4ALL runs OK in the console (not in X-Windows).

Add the following to the end of your $HOME/.profile

Code: Select all

if [ `tty` == "/dev/tty1" ]; then
  /usr/local/bin/indiecity/InstalledApps/mame4all_pi/Full/mame
fi
Then edit /etc/inittab, using "sudo nano /etc/inittab":
Change the line
1:2345:respawn:/sbin/getty --noclear 38400 tty1
to
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

In this I'm using "pi" as the login user.

Then reboot.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

ThePromethean98
Posts: 4
Joined: Mon Apr 22, 2013 3:36 pm

Re: Programming MAME Emulator to start on boot

Tue Apr 23, 2013 4:25 pm

How can i find out if MAME4ALL works in the console?

pudding
Posts: 93
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: Programming MAME Emulator to start on boot

Tue Apr 23, 2013 5:57 pm

Don't run startx (i.e. X-Windows) then just run /usr/local/bin/indiecity/InstalledApps/mame4all_pi/Full/mame
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

ThePromethean98
Posts: 4
Joined: Mon Apr 22, 2013 3:36 pm

Re: Programming MAME Emulator to start on boot

Wed Apr 24, 2013 3:33 pm

Pudding, I have done what you have said but when I rebooted it just loads up normally. Is there another way of doing this?

pudding
Posts: 93
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: Programming MAME Emulator to start on boot

Wed Apr 24, 2013 4:07 pm

Don't know, should work fine. Have a look here http://elinux.org/RPi_Debian_Auto_Login
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

ThePromethean98
Posts: 4
Joined: Mon Apr 22, 2013 3:36 pm

Re: Programming MAME Emulator to start on boot

Thu Apr 25, 2013 4:40 pm

Just got it to work, I just added the directory of the mame executable in the Rc.local file. :D

Return to “Gaming”