ideacipher Posted October 22, 2014 Share Posted October 22, 2014 I pretty much want to add -rec rec.inp to the command line that Hyperspin uses to launch mame when I select a rom. This may be very easy to do and I'm just missing something. The mame config file has the inp path set and works by manually launching. Also another quick question is there an easy way to execute a bat file on mame exit (esc) while using Hyperspin? If I can get the -rec to work I'm interested in archiving mame sessions for highscores without having to bring out the wireless keyboard and stop play every time a file needs to be saved. Thanks Link to comment Share on other sites More sharing options...
boohiss Posted October 22, 2014 Share Posted October 22, 2014 In HyperLaunchHQ: Select MAME on left, modules tab, mame.ahk, edit global module settings button. Select MAME tab, and in parameters type: -record rec.inp Not sure on 2nd thing, but if you find a way please share it as I'd like to know about that as well. Right now when I get a good score I have to grab the keyboard and exit out of HS, then move the inp file for safe keeping before I run another game or I lose it. Perhaps there's a way to name the inp file with a date/time stamp or something in the filename? Link to comment Share on other sites More sharing options...
ideacipher Posted October 22, 2014 Author Share Posted October 22, 2014 That worked perfectly! Thanks Managing on rom exit is another story. I'll let you know if I hear or find anything on the moving/renaming inp files on rom change/mame exit. Link to comment Share on other sites More sharing options...
ideacipher Posted October 23, 2014 Author Share Posted October 23, 2014 boohiss I created a fairly good solution tonight for moving and renaming the inp files on rom switch and exit while using Hyperspin. First I had to brush up on my AHK skills for just a bit and made the following change to \HyperSpin Install v1.3.2.0\Modules\MAME\MAME (MAME .148 djvj 2.0).ahk CloseProcess: FadeOutStart() WinClose("MAME ahk_class MAME") Run, C:\Users\ideacipher\Downloads\mame64\inp\move.bat %romName% Return I started by running all the commands in line in the module ahk file but I would rather just run the batch file and pass the romname as a variable My move.bat file looks like this: move C:\Users\ideacipher\Downloads\mame64\inp\rec.inp C:\Users\ideacipher\Downloads\mame64\inp\holding set filename=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%_%time:~-11,2%%time:~-8,2%%time:~-5,2% set filename=%filename: =% rename C:\Users\ideacipher\Downloads\mame64\inp\holding\rec.inp %1-%filename%.inp So once the module is closing it will move your inp file to a location of your choice and then rename with 'romname'-month-day-year_HourMinuteSecond.inp . I just tried it out with Donkey Kong and the file was moved and renamed to dkong-10-23-2014_05255.inp it was 12:52am There are many ways this could have been done but this way works and made the most since to me while I was working on it. Now I'll be able to archive every game. I know I'll need to add a clean up job down the road but that should be easy and pretty much the same principle. Thanks again for helping with that first step I was stumped. Link to comment Share on other sites More sharing options...
boohiss Posted October 23, 2014 Share Posted October 23, 2014 Awesome! Worked like a charm, changing the directories obviously. I made a .bat file with the standard directory structure for anybody else out there (C:\HyperSpin\Emulators\MAME\inp\holding). The .bat file goes in the inp directory. https://www.dropbox.com/s/kuekbpv4rokf3ga/move.bat?dl=0 Link to comment Share on other sites More sharing options...
ideacipher Posted October 23, 2014 Author Share Posted October 23, 2014 I found an issue on playback and will look into it further in the next couple days. until then I would not use this solution on your inp files. Link to comment Share on other sites More sharing options...
boohiss Posted October 23, 2014 Share Posted October 23, 2014 I found pages on fixing issues regarding inp recording: http://replay.marpirc.net/record.htm http://replay.marpirc.net/random.htm http://tetrisconcept.net/forum/showthread.html?t=1863 Basically they provide batch files to move nvram, hi, and cfg files before and after recording. Apparently all 3 can create issues during inp recording. Link to comment Share on other sites More sharing options...
ideacipher Posted October 24, 2014 Author Share Posted October 24, 2014 This will help a ton. I need to figure out how to fire the batch file prior to recording. After is easy we can just call that before the move line or even in the same batch file. About 95% there it seems. I did some further testing today even without moving the nvram, hi, and cfg files and most recordings played back fine (not sure what was going on last night but it was late probably a ID10t error). I remember hearing stuff especially about hi causing some crazy stuff to happen because of the random numbers a while back but couldn't remember if it screwed up the highscore tracking or the recording itself. If you find a way to run the batch file prior to recording we should be all set. I'll look into it as well and keep everyone posted if I find anything. Link to comment Share on other sites More sharing options...
boohiss Posted October 24, 2014 Share Posted October 24, 2014 Many games will work fine without moving anything, but I know Tapper is one such game that won't play back correctly. Since it didn't work, I did an avi MAME record to save my gameplay when I played it for a competition here. It takes up a ton of space for just 10 minutes of play time though rather than a small inp file. Link to comment Share on other sites More sharing options...
ideacipher Posted October 26, 2014 Author Share Posted October 26, 2014 I really like keeping my configs and love the highscore support so I needed to find a way to auto record while supporting playback while keeping the other settings and files intact. I've added a backup of the current cfg, hi and nvram contents on launch. This was done by adding the following two lines to the MAME module MAME (MAME .148 djvj 2.0).ahk: ; Added to backup current cfg, hi and nvram files for the present rom Run, C:\Users\softice10001\Downloads\mame64\inp\backup.bat %romName% Run(executable . A_Space . romName . A_Space . fullscreen . A_Space . cheatEnabled . A_Space . videomode . A_Space . useBezels . A_Space . useOverlays . A_Space . useBackdrops . A_Space . mameRomPaths . A_Space . sysParams . A_Space . romParams, emuPath, winstate) The new backup.bat file looks like this (non standard install but a quick adjustment in paths will make it work): mkdir C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 copy C:\Users\ideacipher\Downloads\mame64\cfg\%1.cfg C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 copy C:\Users\ideacipher\Downloads\mame64\hi\%1.hi C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 copy C:\Users\ideacipher\Downloads\mame64\nvram\%1\* C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 I kept the end of MAME (MAME .148 djvj 2.0).ahk pretty much the same just added a comment: CloseProcess: FadeOutStart() WinClose("MAME ahk_class MAME") ; added to archive recorded inp, nvram, cfg and hi files Run, C:\Users\softice10001\Downloads\mame64\inp\move.bat %romName% Return The move file needed to be reworked and I changed the way the renaming and structure was handled a bit: set dirname=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%_%time:~-11,2%%time:~-8,2%%time:~-5,2% set dirname=%dirname: =% mkdir C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 mkdir C:\Users\ideacipher\Downloads\mame64\inp\archive\%1 move C:\Users\ideacipher\Downloads\mame64\inp\rec.inp C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 rename C:\Users\ideacipher\Downloads\mame64\inp\holding\%1\rec.inp %1.inp rename C:\Users\ideacipher\Downloads\mame64\inp\holding\%1 %dirname% move C:\Users\ideacipher\Downloads\mame64\inp\holding\%dirname% C:\Users\ideacipher\Downloads\mame64\inp\archive\%1\%dirname% So what you end up with is an archived recording automated using Hyperspin that will playback properly if the backed up files are put back into place (cfg, nvram and hi). Always backup the current files prior to doing this until an automated process is in place. I'm probably going to work on a playback.bat that will do something similar to what is being done here http://replay.marpirc.net/playback.htm only instead of running with no files at all I'll use the ones backed up before the recording was created and revert back to current after playback. This is a good enough for me I think to put this one on the back burner for a while. Let me know what you all think and if any issues are found Thanks Link to comment Share on other sites More sharing options...
brolly Posted October 26, 2014 Share Posted October 26, 2014 Don't edit the modules, the User Functions.ahk lib is where you should be adding any custom code. In this case inside the StopGlobalUserFeatures function. Link to comment Share on other sites More sharing options...
ideacipher Posted September 13, 2015 Author Share Posted September 13, 2015 Wow Brolly very polite there bud. Don't get pissed I moved the code to user space if you read I was starting to figure this stuff out. Ends up very simple and I have made some other changes that were not offered as well. Let me guess the option will be put in production when MAME grows flippers and has a steal ball as the main character LOLAlmost a year later and it's running like a top - one of the best extra features of hyperspin for me compared to other front ends. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.