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: OK to cut the power on MAME instead of shutdown?  (Read 4016 times)

0 Members and 1 Guest are viewing this topic.

Marsupial

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 511
  • Last login:April 17, 2024, 09:00:56 pm
  • I am teh Mars!
OK to cut the power on MAME instead of shutdown?
« on: March 11, 2012, 11:26:31 am »
I figure it is like a time bomb to do so, but I wonder what others do about it instead...

I would like to have a simple ON/OFF switch for my MAME machines.

Right now  they run XP  /  MALA  and  log  straight  into  the arcade account,  loading MALA  right ahead.   I  heard  about instant  sheller  but  haven't  tried it  yet  (is it worth it?)

Anyway,  I  would  like to  power  the machines  up/down with a  simple button.  My machine  have  mains  cut-off switch for  when not in use, but I  believe  it  would  become  harmful  to the hard  drive  if  always  powered  off  "the hard way"

What  are  people  doing  for  that?
« Last Edit: March 11, 2012, 11:41:48 am by Marsupial »
-Mars

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: OK to cut the power on MAME instead of shutdown?
« Reply #1 on: March 11, 2012, 11:37:26 am »
Generally speaking, it's not a good idea to just power off a windows machine. Windows tends to load things into caches that don't constantly get flushed to disk, so you might end up shuttiing the machine off right in the middle of one of the flush processes and scramble a file necessary for proper operation.

That said, as far as I know, neither mame nor any of the frontends do anything that would likely be harmed by powering off at any arbitrary point.

Generally, if you want to power off the machine via an external button, most typically, you wire a small button into the "power on" jumper on your motherboard, then configure windows power settings to "shutdown" when the power button is pressed.

And finally, put everything in the cab on a "smartstrip" powerstrip, with the PC power supply connected to the "Master" plug on the smartstrip.

That way, when you power down the PC, everthing else will be powered down automatically by the smartstrip.

That's how I've got both my arcade cab and jukebox wired up. Works a treat.

Eddie_Brock

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 147
  • Last login:February 26, 2014, 12:00:34 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #2 on: March 11, 2012, 02:41:54 pm »
wire a small button into the "power on" jumper on your motherboard, then configure windows power settings to "shutdown" when the power button is pressed.

And finally, put everything in the cab on a "smartstrip" powerstrip, with the PC power supply connected to the "Master" plug on the smartstrip. That way, when you power down the PC, everthing else will be powered down automatically by the smartstrip.
+1. Exactly.

This is what I have done too, and it works great. I created a simple windows background that says something to the effect of "Please Wait, system loading" so there is a nice looking screen while MAME is loading up or shutting down.

FYI: If you are adding a power button directly connected to your motherboard, it will need to be a momentary switch. (like an acade button, not like an on/off switch)

mgb

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3500
  • Last login:August 03, 2025, 07:25:14 pm
  • North East, US
Re: OK to cut the power on MAME instead of shutdown?
« Reply #3 on: March 11, 2012, 07:45:23 pm »
+2 on what drventure said. I also just have the power button set to shutdown windows although I sometimes just hit my switch which I have to completely kill power to the smart strip.

Well Fed Games

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1884
  • Last login:January 07, 2025, 04:42:47 pm
  • Delicious!
Re: OK to cut the power on MAME instead of shutdown?
« Reply #4 on: March 11, 2012, 09:20:46 pm »


FYI: If you are adding a power button directly connected to your motherboard, it will need to be a momentary switch. (like an acade button, not like an on/off switch)

Yeah, I wired my MB to the original switch on my Ms. Pac Cab and it threw me for a loop... thankfully I had a momentary one lying around to switch in!
Completed projects: Pac bartop (Plug & Play), 30th Anniversary Pac cab (MAME), Point Blank (PS1), Centipede (arcade hardware- light restore), VS. Super Mario Bros (arcade hardware- light restore) Tetris Cocktail (SNES), Arcade Classics upright (60-in-1, then MAME), Multi-Raiden (arcade hardware). Pac Man vs.(Gamecube),

Working on: Pinball Re-theme, Homebrew arcade arena shooter

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: OK to cut the power on MAME instead of shutdown?
« Reply #5 on: March 12, 2012, 09:23:49 am »
You can load "Embedded XP" disk management drivers into your XP, and then "LOCK" the drives.  When XP boots after that, it will put all possible "changes" to the operating system in a RAM drive, and unless you commit them to the hard drive, nothing will ever write to your harddrive again.

It's the reason that Embedded XP kiosks are so bullet proof, they never write anything to it's harddrive after it has been "LOCKED"

FYI, if you are making LOTS of changes to the OS and it's up for a long time, it will eventually need to be rebooted, as the RAM drive will fill up.

I used to use this for honeypots, virus diagnostic machines, and machines that need to be killed without shutting down nicely.  It's been awhile, but if I remember correctly, it was only about 3 files to replace and adding 1 for utilities (locking, unlocking).


rCadeGaming

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1256
  • Last login:April 13, 2025, 12:14:40 pm
  • Just call me Rob!
Re: OK to cut the power on MAME instead of shutdown?
« Reply #6 on: March 12, 2012, 02:05:19 pm »
wire a small button into the "power on" jumper on your motherboard, then configure windows power settings to "shutdown" when the power button is pressed.

+1

FYI: If you are adding a power button directly connected to your motherboard, it will need to be a momentary switch. (like an arcade button, not like an on/off switch)

+1.  On my cab I'm going to add a power button on my control panel.  Inline with the button will be a SPST (on/off switch) to enable/disable the button from inside the cab.  Alternatively just hide the button inside somewhere.

Dawgz Rule

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 737
  • Last login:August 22, 2024, 07:18:55 pm
  • The more people I meet, the more I like my dogs
Re: OK to cut the power on MAME instead of shutdown?
« Reply #7 on: March 12, 2012, 03:36:52 pm »
Agreed on all of the above.   I have a pushbutton power switch for my cab so hitting it once will force a Windows shutdown.  The smart strip does the rest.

keysta75

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:July 26, 2012, 07:38:36 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #8 on: March 22, 2012, 02:14:55 pm »
is there like a tutorial on how to connect the wires from the motherboard to the arcade button for this start up and shut down process? just want to see exactly how to mod the wires to the buttons. ;D

Necro

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1031
  • Last login:November 29, 2022, 08:22:22 pm
  • Building a 'Classic' MAME Cab
Re: OK to cut the power on MAME instead of shutdown?
« Reply #9 on: March 22, 2012, 03:16:32 pm »
Get a switch from a computer case w/MB header, cut the wires between the switch and the header, and then add additional wire to run it where you want.  Put MB header back on MB like you normally would. 

You can also replace the switch, just make sure it's a momentary switch or you'll have major issues.

Turambar

  • And I don't watch Fox news or use Happ joysticks.
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 122
  • Last login:October 03, 2021, 11:10:13 pm
  • Owner of Wayback's Arcade
    • Wayback's Arcade
Re: OK to cut the power on MAME instead of shutdown?
« Reply #10 on: March 22, 2012, 03:24:24 pm »
Every motherboard has a place for front panel connectors.  That is where the computer case's power button, reset button, power switch, and HD led hook up to the motherboard.



If you look at the above image, you can see the power switch of the case hooked into the front panel connector on the motherboard.  To have a single button turn on everything, you will use a smartstrip like everyone has said.  The computer will be in the control switch.  

Take the power switch front panel connector on the case your or using (or another one if you don't want to damage the case you are using) and cut it.  Make sure to give yourself 6 inches - a foot to work with.  You now have a wire that has a front panel connector on one end and cut wire on the other.  Then hook up an arcade button (most people put it on the back of their machine or on top, and wire it normally splicing it into the front panel connector wire.  Make sure you wire ground to ground and hot to hot.  

With your computer in the control plug of a smartstrip, you can now power on your whole arcade cab with the push of a single arcade button.

« Last Edit: March 22, 2012, 03:30:45 pm by Turambar »

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: OK to cut the power on MAME instead of shutdown?
« Reply #11 on: March 22, 2012, 03:32:19 pm »
In the old days when we had RLL (mine had the spring) and MFM drives shutting the computer off was considered a bad thing to do as the drives did not automatically park the heads on the platter, it needed a shutdown sequence to park the heads prior to system shutdown.  So that is where you get the old advice against turning off your computer without proper shutdown.  Hard drives of today do not have that limitation.

Now before I get flamed, Windows does not really like power off shutdowns.  The Microsoft purists out there like to think your hardware is software and software is hardware, mumbo jumbo aside,  if you configure windows not to use a swapfile or if you are keen enough to use the Win2K ramdisk and swap it in RAM in XP then you can power off to your hearts content.  Just be aware anything you have open will be lost unless you save.  :blah:

Since we are talking emulators it is no biggie, and you can flip that switch with impunity.  ;D

I have a setup that swaps to memory in XP that works in the similar method.  I might defrag it twice a year yet it chugs away quite happily.

If I had only one wish, it would be for three more wishes.

EightBySix

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 523
  • Last login:April 25, 2021, 01:50:16 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #12 on: March 22, 2012, 04:05:19 pm »
In the old days when we had RLL (mine had the spring) and MFM drives shutting the computer off was considered a bad thing to do as the drives did not automatically park the heads on the platter, it needed a shutdown sequence to park the heads prior to system shutdown.  So that is where you get the old advice against turning off your computer without proper shutdown.  Hard drives of today do not have that limitation.

Now before I get flamed, Windows does not really like power off shutdowns.  The Microsoft purists out there like to think your hardware is software and software is hardware, mumbo jumbo aside,  if you configure windows not to use a swapfile or if you are keen enough to use the Win2K ramdisk and swap it in RAM in XP then you can power off to your hearts content.  Just be aware anything you have open will be lost unless you save.  :blah:

Since we are talking emulators it is no biggie, and you can flip that switch with impunity.  ;D

I have a setup that swaps to memory in XP that works in the similar method.  I might defrag it twice a year yet it chugs away quite happily.



... Making smart strips redundant?

ChrisK

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 96
  • Last login:April 23, 2017, 12:06:50 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #13 on: March 22, 2012, 05:14:03 pm »
Disabling the swap file does not make Windows OK to shut off without a proper Windows shutdown.  You still have:

* The hard drive write caches.  Changes you made to a file that were in the system's RAM write cache or the write cache on the HD itself will disappear if power is yanked.  Since file operations aren't guaranteed to be transactional in Windows, even if you don't corrupt a file, you can corrupt a system this way.  (hypothetical example: update one INI but not the other, in a way that makes an app unusable)

* The file tables.  With FAT the file tables were pretty fragile.  NTFS is more reliable, but I can tell you it's not 100% reliable, because I've seen corruption in the real world.

* USB storage devices.  Want to corrupt a USB hard drive?  Pull the power while it's doing something!

* Apps behaving badly.  Some apps have their own shutdown procedure.  Pull the plug while Word is open and it'll present you with a recovery screen the next time it starts.  That's a harmless example, but some apps are worse.  For example, some only write their preference data on shutdown (ie: a front end that remembers the last game you selected).

I power off Windows systems by cutting power all the time and I'm VERY rarely bit.  I think the last time at work was last year.  But to be accurate, with standard hardware (ie: no battery-backed hard drive controller) Windows is NOT 100% safe to shut down by cutting AC power.  You'll probably be OK, but take appropriate backup measures if you plan to make it a habit.  (Actually, take appropriate backup measures ANYWAY! :) )

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: OK to cut the power on MAME instead of shutdown?
« Reply #14 on: March 22, 2012, 05:53:01 pm »
Disabling the swap file does not make Windows OK to shut off without a proper Windows shutdown.  You still have:

* The hard drive write caches.  Changes you made to a file that were in the system's RAM write cache or the write cache on the HD itself will disappear if power is yanked.  Since file operations aren't guaranteed to be transactional in Windows, even if you don't corrupt a file, you can corrupt a system this way.  (hypothetical example: update one INI but not the other, in a way that makes an app unusable)

* The file tables.  With FAT the file tables were pretty fragile.  NTFS is more reliable, but I can tell you it's not 100% reliable, because I've seen corruption in the real world.

* USB storage devices.  Want to corrupt a USB hard drive?  Pull the power while it's doing something!

* Apps behaving badly.  Some apps have their own shutdown procedure.  Pull the plug while Word is open and it'll present you with a recovery screen the next time it starts.  That's a harmless example, but some apps are worse.  For example, some only write their preference data on shutdown (ie: a front end that remembers the last game you selected).

I power off Windows systems by cutting power all the time and I'm VERY rarely bit.  I think the last time at work was last year.  But to be accurate, with standard hardware (ie: no battery-backed hard drive controller) Windows is NOT 100% safe to shut down by cutting AC power.  You'll probably be OK, but take appropriate backup measures if you plan to make it a habit.  (Actually, take appropriate backup measures ANYWAY! :) )


So pretty much what I typed above.   ::)

For an arcade box that has one job to do, not a problem.  Your £1000 home machine... never in a million years, that is why you should have a UPS.

Quote
Drives have parked themselves for at least 23 years.

Fixt

If I had only one wish, it would be for three more wishes.

ChrisK

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 96
  • Last login:April 23, 2017, 12:06:50 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #15 on: March 22, 2012, 09:35:59 pm »
Well, not only might you "lose anything you have open unless you save", you can also lose the files, or the whole OS.  It's not a common problem, especially if you're using NTFS, but it's a possibility, and playing the odds over time may eventually bite you.

IMHO the best solution is to use a soft power button to tell Windows to shut down.  Using the ATX power switch header is probably the easiest way.  Personally I use a power button on my keyboard, but I know most people don't want an ugly keyboard visible all the time.

SammyLJ

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:January 21, 2018, 02:49:22 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #16 on: June 21, 2012, 11:25:05 pm »
this may be a dumb question but, where on the motherboard am i wiring a switch to make it shutdown and not take any chances?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9676
  • Last login:Today at 09:55:25 pm
  • Designated spam hunter
Re: OK to cut the power on MAME instead of shutdown?
« Reply #17 on: June 22, 2012, 12:18:20 am »
this may be a dumb question but, where on the motherboard am i wiring a switch to make it shutdown and not take any chances?

 :dunno  What motherboard are you using?  (Manufacturer and model#)


Scott

capsule

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:June 22, 2013, 12:05:13 pm
    • caps:arcade
Re: OK to cut the power on MAME instead of shutdown?
« Reply #18 on: June 22, 2012, 09:14:29 am »
this may be a dumb question but, where on the motherboard am i wiring a switch to make it shutdown and not take any chances?

Check the MB manual to find on which pins of the control panel connector you should connect the power switch.
Sometimes it's also indicated on the MB itself.

Peja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 225
  • Last login:June 09, 2015, 04:48:22 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #19 on: June 22, 2012, 12:01:06 pm »
So just to clarify for myself, If I wanted to use an old arcade button and microswitch as my startup and shut down.....the ground wire will attach to the common and the "positive" wire will attach to the Normally Open?

My computer is already setup to use a regular pc switch that will start it up and shut it down when pushing it, but never thought about using an arcade switch.  (I really need to learn to think outside of the box)

Peja

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9676
  • Last login:Today at 09:55:25 pm
  • Designated spam hunter
Re: OK to cut the power on MAME instead of shutdown?
« Reply #20 on: June 22, 2012, 12:21:28 pm »
So just to clarify for myself, If I wanted to use an old arcade button and microswitch as my startup and shut down.....the ground wire will attach to the common and the "positive" wire will attach to the Normally Open?

My computer is already setup to use a regular pc switch that will start it up and shut it down when pushing it, but never thought about using an arcade switch.  (I really need to learn to think outside of the box)

Peja

Don't worry about which wire is ground, since you don't daisy-chain the ground for this switch.

Just make sure you're on the Normally Open and Common contacts and it will work exactly like the original computer switch.


Scott

SammyLJ

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 31
  • Last login:January 21, 2018, 02:49:22 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #21 on: June 22, 2012, 11:06:04 pm »
so are you guys just saying that you shut down your mame pc by essentially just pushing the power button again? Isnt that a bad way of doing it?

capsule

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:June 22, 2013, 12:05:13 pm
    • caps:arcade
Re: OK to cut the power on MAME instead of shutdown?
« Reply #22 on: June 23, 2012, 04:33:12 am »
so are you guys just saying that you shut down your mame pc by essentially just pushing the power button again? Isnt that a bad way of doing it?

Why would it be bad if pushing the power button initiates the proper shutdown sequence?

MonMotha

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2378
  • Last login:February 19, 2018, 05:45:54 pm
Re: OK to cut the power on MAME instead of shutdown?
« Reply #23 on: June 23, 2012, 05:57:03 am »
The "proper" answer to how one makes it possible to RELIABLY hard-power Windows XP is to use what Microsoft calls the "enhanced write filter".  Basically, this is a copy-on-write ramdisk.

What you do here is set everything up, then tell Windows to overlay a ramdisk (or, I think, a separate partition on the drive that's basically just used as scratch space) on top of the main filesystem upon next boot.  Any and all writes that would go to the hard drive instead go to the ramdisk.  When you power off, it's all lost, and when you power back up, the system is exactly 100% like it was the last time.  The hard drive never gets written to.  There is precisely zero chance of filesystem corruption.

You can still use a swapfile.  It doesn't matter.  Windows will happily ignore the contents when it starts back up.

If you want some non-volatile storage where reliability isn't a huge deal (e.g. for high scores), you can dump them on a separate partition.  There's a way to overlay this back into the main C: filesystem if you really want to.

If you do need to make changes, you can just disable EWF for that session (make sure you shut down properly, then), or there's also a way to "commit" the changes that have been placed in the scratch area back to the original backing filesystem.

In practice, NTFS's journaling is decent enough that you're unlikely to toast the whole filesystem on hard power down, but you may lose data.  The data loss should be limited to things that have actually been changed, but if that occurs in, say, your registry, your Windows install is probably hosed.

EWF is technically only included with XP embedded, but there are tutorials out there on how to make it work on normal XP Pro.

I assume Vista/7 has a similar option.  Windows PE may also be usable for this, though it's probably against the EULA, and WinPE typically takes a long time to boot.


You can do something similar on Linux using unionfs and tmpfs if you want to.  The LVM can also be used to snapshot the block device against a ramdisk (or just drop the snapshot and make a new one on each startup, still backing it with the disk).