Jump to content
LaunchBox Community Forums

Zaphod54

Members
  • Posts

    30
  • Joined

  • Last visited

Zaphod54's Achievements

8-Bit Processor

8-Bit Processor (3/7)

10

Reputation

  1. The PowerShell script is below. Save those contents to a file named anything you want as long as it has a .ps1 extension. I call mine "MAME_CHD_CLEANUP.ps1". If you've never worked with PowerShell scripts before, you'll want to research how to run PS scripts separately. PS takes a bit of initial config and tricks to run scripts manually. You can't simply double-click on the file and run it. Change the $mamepath and $CHDpath variables in the script to point to your mame.exe and the directory where your CHD files are located. NOTE: This will also KEEP (i.e., not move to the ~NONWORKING subdirectory) CHD files associated with the various Sega platforms that have their own emulators. I.e., Flycast (Naomi, Naomi2, and Atomiswave), Model 2, and Supermodel (Model 3). I keep a separate copy of my mame roms and CHDs from the "working" copy that I actually use to run the games. I also keep my rom files and my CHD files in separate subdirectories. So I run this script on that raw, original copy of the CHD files. The script doesn't "delete" anything. It just moves CHD files associated with non-working MAME games into a subdirectory called "~NONWORKING". Then I copy the remaining CHD files (the ones that did NOT get moved to the ~NONWORKING subdirectory) over to the directory location where they're used to actually play the games. I do this for two reasons. 1) If I find I'm missing a CHD that I really do need, I can copy it back out of the ~NONWORKING subdirectory. 2) It makes it easier to update the MAME set when I want to. If I'm missing files when I update the set, the update has to redownload them all again. So when I update, I move the non-working CHDs back to the main directory, update the set, then re-run the script. Also note, this script does not do anything with the base MAME rom files. By comparison to the CHD files, the rom files for non-working games takes up little enough space that I don't care about cleaning them up. #Script to determine only working MAME games that require CHDs #so my actual MAME PC doesn't need to have so much hard drive #space taken up by CHD files for non-working games. #Also KEEPS CHD files needed by Sega platforms that have other emulators. #I.e., Naomi, Naomi2, Atomiswave, Model 2, Model 3 #This script will create a "~NONWORKING" subdirectory under the specified #CHDs path and move the CHDs for non-working games to that subdirectory. #Set the path of the mame.exe file $mamepath = "C:\EMULATOR\mame\mame.exe" #Set CHD directory path $CHDpath = "C:\MAME_Torrents\MAME 0.271 CHDs (merged)" Clear-Host "`n`n`n" if (-not (Test-Path $mamepath)) { "MAME path does not exist. Quitting.`n$mamepath`n`n" Exit } if (-not (Test-Path $CHDpath)) { "CHD path does not exist. Quitting.`n$CHDpath`n`n" Exit } "Please wait. Generating listxml from mame.exe...`n`n" Get-Date #Generate listxml.xml from mame.exe and import as a PowerShell object # Out-String is needed to keep the output as a single string rather than an array of strings for each line of text, to then convert to the xml object [xml]$listxml = & "$mamepath" -listxml | Out-String #Select machines that use a disk file, that are "imperfect" status $machines = $listxml.mame.machine | Where-Object {$_.disk -ne $null -and (($_.driver.status -eq 'preliminary' -or $_driver.emulation -eq 'preliminary') -and -not (($_.sourcefile -eq 'sega/naomi.cpp') -or ($_.sourcefile -eq 'sega/dc_atomiswav.cpp') -or ($_.sourcefile -eq 'sega/model2.cpp') -or ($_.sourcefile -eq 'sega/model3.cpp')))} #Create the ~NONWORKING subdirectory New-Item -ItemType Directory -Force -Path "$CHDpath\~NONWORKING" | Out-Null "Moving nonworking CHDs to ~NONWORKING subdirectory...`n`n" #Loop through and move the selected CHD files. foreach ($machine in $machines) { if (Test-Path $CHDpath\$($machine.name)) { "Moving $CHDpath\$($machine.name)" Move-Item -Path $CHDpath\$($machine.name) -Destination $CHDpath\~NONWORKING } } Get-Date "FINISHED.`n`n`n"
  2. Thanks for the update! Haven't had a chance to try the new version yet, but.. I did want to let you know that the Flycast difference was my error. I had several games that I had flagged as Flycast with my custom field (back to my original forum post that sparked this plugin) because they are naomi games, but I hadn't actually changed the configs on the games to use Flycast instead of MAME.
  3. Thanks for creating this! Love it!! I've got 3 minor issues to report. Flycast, I haven't figured out why, but the list from the plugin shows 185 games, while I show 196 across all of the "Sega" varieties that it emulates. I need to look closer to see if I can figure out what games are missing from the plugin list that I have in my list. I just haven't had time yet, but once I do, I'll post back what I find. I have a couple of games that are PC games and DON'T have any emulator. I do see a "<< Unassigned Emulator >>" entry at the top of the emulator list, but there are no games listed under it. I wasn't sure if you intended to handle this scenario, or I'd also understand if this wasn't a scenario you thought of since the original conversation that sparked this plugin was specifically about emulators. But if you could make this work for games that don't have an associated emulator, that would be great! I have 2 instances of Star Wars Trilogy with Supermodel. The original instance, and then a copy for playing with a light gun. In the main plugin interface I see both instances. But when I create a playlist from it, only the original instance is added to the playlist. (You can read here the details of why I have this setup with SW Trilogy.)
  4. Thanks again! I think we're ultimately on the same page. Just a little confusion about phrasing or terminology. My comment about the "Force importing duplicate games" was in reply to your previous comment of "You probably won't be able to get it to appear with an import, since LaunchBox will think you've got it in your library already" in your previous reply. So I thought you were implying that there was NO way to get a duplicate even by reimporting the rom.
  5. Adding the custom field did work. I'm not sure what I did wrong the first time. But thank you for the plugin! I'm excited to give that a try!! Unfortunately, it'll be a few days before I'm able to try it out.
  6. Good info! Thanks!! When I created my playlists for these, I based it all on Genre. So like... Genre Contains Puzzle / Genre Contains Quiz / etc., etc. I don't think the game type that you're parsing from the Mame.xml gets imported as a field in Launchbox. Or at least it it's not a field that can be used for auto-populate with a playlist. So yeah, I'll be curious how my playlists compare to yours. It'll probably be a few days before I get a chance to try the plugin though.
  7. Ok, thank you! Like I said, I did somehow manage to duplicate my Star Wars Trilogy entry, but I can't remember how I did it. For duplicating with import, there is that option for "Force importing duplicate games". Wouldn't that do the trick?
  8. Thanks to both of you! I did try the custom field, but the custom field didn't appear in the criteria list for auto-populate after I added it. Maybe I did something wrong. I'll try it again. I DO have playlists created by using the source: tag for Model 2, Model 3, Naomi, etc. I just don't always remember which emulator goes with which "source", so I was thinking about also creating playlists based on emulator. I mean, yeah, Model 2 is obvious, Supermodel is kind of obvious, but Flycast isn't so much. It's mainly for ongoing management and curating the list. The playlists based on "source" are the ones I leave visible within BigBox. The playlist by emulator would be hidden from BigBox but let me easily know and manage games associated with a specific emulator without having to remember which "source" goes with which emulator.
  9. Thanks for considering adding the "automatically mark games as Hide" option. Exactly! That's why I did exactly that, but I created all the playlists manually back when I first set mine up a year ago. So when I reimport things in the future, I can use this plugin now and save me a bunch of time! I'm also curious to see how this plugin creates the playlists compared to what I did manually, to see if I missed anything when I created mine. Yes, absolutely. Especially if someone is setting it up for the first time. Certainly, the option to automatically mark as hide should be an "option" and probably default it to off for exactly that reason. But now that I know what I'm doing and essentially trust it, if I ever want to regenerate those playlists for some reason, or maybe I'm setting up a new LB on another computer, or just starting over from scratch, it would save me the time of going through each playlist manually, doing CTRL-A, and bulk edit to mark Hide on all of them. AND if I do want to actually look through the list, it's easy enough to temporarily turn off the View option to hide games marked as hidden so I can view what's in them.
  10. I do understand what you're saying, I'm familiar with how LB manages different versions or clones of a game through Additional Apps, but I don't think that will accomplish what I want, for 2 reasons. It's not like having different "versions" of a game, like clones. It's different configurations of the SAME version of a game. I want a physically separate entry for the duplicate game. I use BigBox in an arcade cabinet and I want it easy for non-technical user to easily be able to choose either. I'm already running multiple Additional Apps before the game launches, like starting DemulShooter, possibly a game specific AHK script, and sometimes one or two other things. I still need to run Additional Apps in both instances, but the commands for those Additional Apps might be different for each instance. I don't see an option with Additional Apps to configure each line item to run only with a specific "version". If there is such an option and you can point me to it, I'll take a 2nd look at this idea. Here is my most obvious example. Star Wars Trilogy, running in the Supermodel emulator. It's originally designed for an analog joystick, but it also plays well with a light gun. I want a separate "Star Wars Trilogy (Joystick)" entry and a "Star Wars Trilogy (Light gun)" entry easily selectable in BigBox. Within Supermodel itself, the controls configuration for the joystick are different from the light gun. So, in Additional Applications I have a command to copy in the appropriate Supermodel control .ini file before launching the game. But also, with the light gun instance I need to send serial commands to configure my Gun4IR before launching the game, so that's another Additional Applications line item for the light gun instance. Funny enough, I already DID do this for SWT, but for the life of me I can't remember how I created the copy. It was a year ago. But now I want to do the same thing for some other games.
  11. Is there an easy way to duplicate or copy a game entry in Launchbox? I see lots of posts and info about merging or cleaning up duplicates, but can't find anything about CREATING a duplicate. I want to have 2 entries for some games with slightly different configs for a different play experience. So I'd like to copy the existing entry, which I can then edit and tweak the copy. Or do I just have to reimport the rom again and use the option to import duplicates to make it create a 2nd copy?
  12. Oh, wow! I just found, and can't wait to try this plugin!! I wish this existed back when I first set up my Launchbox. I did exactly what this plugin does, but did it all manually. This would have saved me a bunch of time! More specifically, I purposely did not check any of the boxes during the import and then manually created playlists for them, and manually selected all games in each playlist (CTRL-A) and marked them as Hide. Just personal preference, I like to have more control over things to know exactly what items are being hidden than letting the system do it automatically and never knowing what those items were. Actually, that could be a feature request for this plugin. Add an option when creating playlists to automatically mark the games as Hide.
  13. "Emulator" is not an available criteria to use for auto-populate playlists. Does anyone know of some other way to create an auto-populate playlist based on emulator? I was able to do one for TeknoParrot since the "application/rom path" is the .xml files under the UserProfiles directory where the TP program is. But that won't work for my other emulators that use the same MAME roms as MAME (Model 2, Supermodel, Flycast). At least not unless I wanted to have separate copies of the MAME roms for each emulator, but I'd rather keep them all in one place to make it easier to update the MAME rom set periodically. "Platform" also won't work in my case. I have a dedicated arcade cabinet and the only games I put in it are "Arcade" games, so everything is under the Arcade Platform. Then after importing the full MAME rom set, I created playlists for all the Sega stuff and simply updated the emulator on those for the appropriate emulator. I didn't create a separate Platform for each emulator. But for ongoing management, I'd like to have Playlists for each emulator. I wouldn't have them show in BigBox, but they'd help me organize things.
  14. I doubt there's anything built into Launchbox for this but you're right that there are a lot of useless CHD files for non-working games that takes up a LOT of hard drive space. I wrote a PowerShell script that uses the -listxml output from mame.exe to filter non-working CHD files and moves them to a subdirectory. It could probably be adapted to move non-working roms too, but I'm not concerned with the rom hard drive space. Space taken up by roms is nothing compared to CHDs. I run the script every time I update my MAME rom and CHD set to a new version.
  15. Thanks! It'd be nice if an event under SystemEventTypes of something like AttractModeBeginning could be added, with a way to cancel the built in Attract Mode to handle it another way. I've found lots of posts asking for more options or flexibility with Attract Mode. This would be one way to provide at least some customizability for Attract Mode without having to add options to the built in Attract Mode.
×
×
  • Create New...