Kibbey93

Autozip in MAME

Aug 25th, 2021 (edited)
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.32 KB | None | 0 0
  1. --------------------------------
  2. 1. Install 7-zip and copy the "7-Zip" folder from Program Files to your MAME directory
  3. https://www.7-zip.org/download.html
  4. --------------------------------
  5.  
  6. --------------------------------
  7. 2. Copy below and save as 'zip.bat' in your MAME directory
  8. --------------------------------
  9. SET CURRENTDATE=%DATE:~10,4%%DATE:~7,2%%DATE:~4,2%
  10. SET CURRENTTIME=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
  11. SET ZIP="%cd%\inp\%1-%CURRENTDATE%-%CURRENTTIME%.zip"
  12. "%cd%\7-Zip\7z.exe" a -tzip %ZIP% "%cd%\inp\%1.inp" > nul
  13.  
  14. --------------------------------
  15. 3. Add the following to the bottom for your 'record.bat' file
  16. --------------------------------
  17. zip.bat %1
  18.  
  19.  
  20. ---------------------------------
  21. Example record.bat file
  22. Note. I change the %2 in the line that calls MAME to %1 (after -record)
  23. This means I don't need two arguments from command line (i.e. record dkong, instead of record dkong dkong)
  24. ---------------------------------
  25. @echo off
  26. if exist hi\%1.hi move hi\%1.hi hi\%1.bak
  27. if exist nvram\%1.nv move nvram\%1.nv nvram\%1.bak
  28. if exist diff\%1.dif move diff\%1.dif diff\%1.bak
  29.  
  30. mame %1 -record %1.inp %3 %4 %5 %6 %7 %8 %9 -nvram_directory NUL
  31.  
  32. if exist hi\%1.bak move hi\%1.bak hi\%1.hi
  33. if exist nvram\%1.bak move nvram\%1.bak nvram\%1.nv
  34. if exist diff\%1.bak move diff\%1.bak diff\%1.dif
  35.  
  36. zip.bat %1
Add Comment
Please, Sign In to add comment