About This File
BigBoxProfile is an app that allows you to alter how Launchbox/BigBox and each of the emulators works, adding a profile system and tons of features that allow you to alter/customize how emulators work.
What is BigBoxProfile ?
This app is made of two parts that work together but can be used independently.
1- There is a part that alters how Launchbox/BigBox works and add a new command line parameter “--profile=” that will trigger users' configured settings.
It allow you to bind a specific monitor, sound card for a profile or even use a specifics launchbox profile settings (for example make a bigbox profile that only show some of the platform/playlists)
2- The other part allow you to alter how emulators works, change the command line that they receive on the fly and do tons of stuff (change monitor settings, execute ahk code, use fallback path for rom, copy rom from distant path to local drive or ramdisk, extract archive, executes pre/post command lines, including command line as admin, force the game to be run as admin …)
How does it works ?
The app makes extensive use of a hidden feature of windows called the “Image File Execution” injection.
If you edit the registry at “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\” you can register a key with the name of an executable to target and an app that will replace it.
So, in my case, it create this kind of keys :
That way, when you launch an executable called BigBox.exe, instead of launching it, it will call BigboxProfile.exe. My app will do actions and call bigbox (or launchbox) itself.
So, it’s like an exe wrapper, but from an user standpoint, it’s invisible.
As for emulator, it works the same, once a emulator exe is registered inside BigboxProfile the app will register a registry key to hijack it, do some user configured actions and then launch it.
I’ve written modules that you can chain and order the way you want.
Technically each module have 3 functions, ExecuteBefore, ExecuteAfter and AlterCommandLine
If you chain Module1, Module2, Module3, it will do something like that when you launch the emulator :
Execute ExecuteBefore for module 1, 2, 3.
Pass the command line to module1 and alter it with the AlterCommandLine, then pass it to module2, and then pass it to module3, launch the game with the altered command line.
On game close, execute ExecuteAfter on module 3, 2, 1.
There is a slight subtlety when using launchbox auto-generated m3u for multidisc, but i will get to that later.
I- Altering BigBox / Launchbox
Ok, so first you can create BigBoxProfile Profiles
Beware, here i’m talking about profile for BigBoxProfile (my app), it’s not related to Launchbox/BigBox settings (xml files inside the Launchbox/Data folder).
You can actually alter how and witch xml files launchbox will use with a specific BigboxUtils program, but i will get to that point later.
So BigBoxUtils is shipped with a “default” profile, you can add as many as you want. For example, you can add a profile called “tv” when you plan to use your BigBox on your TV
Once a profile is made, you can call launchbox/bigbox to use this profile when you add –profile=<profilename> to the command line. Like BigBox.exe –profile=tv
This use case is actually what made me code this app. I use bigbox on a computer that’s plugged to both my PC monitor in my room, and to my TV on the living room. I play mostly on my PC monitor, but i wanted to also be able to launch BigBox on my tv from a simple shortcut.
The basic options for a BigBox Profile are here :
Monitor Priority
Set the monitor on witch BigBox (and eventually Launchbox if click on the checkbox) will launch.
It change the monitor option in BigBoxSettings.xml before Bigbox start. (And for launchbox, it will try to move the window)
By default it use as default “main”, and myself, i only use that.
Main means “Main Display”, it’s a primary monitor, the one with that checkbox enabled :
So, with the option set a Main, you are sure that you will not encounter weird Bigbox bug when the monitor change, it will always use the primary one, and if you change the primary Bigbox will launch on it, that’s really handy.
But you can also specify an other display if you want.
I actually wanted to show the real monitor name alongside DISPLAYX, but i ran into technical limitations.
Use Monitor Disposition :
So, here is the game changer, here you can register and set monitor layout.
It actually use code from this excellent software : https://sourceforge.net/projects/monitorswitcher/
But it’s slightly altered to also manage DPI change/restoration.
So, if i go back to my exemple with my TV profile, i will register a monitor layout where my TV is set as main monitor and since my monitor priority is set as main, when i launch bigbox.exe –profile=tv, it set my TV as main display, launch bigbox on it, and once bigbox is close it will restore my usual monitor layout.
As a side note, on the last version of the app, in the bottom of the main form, i added a quick combo list : Quick Monitor Disposition Switch. You can use that to manually switch between saved monitor layouts.
Set Primary SoundCard :
It’s straightforward, once set, it will change the main playback device.
Like with my tv profile, i will force the sound to use the TV HDMI.
Use Specific Launchbox Data profile :
It’s an hidden and experimental feature, please backup your data LaunchBox\Data before !!!
So, with this features you can use a copy of some or all xml files of the Launchbox/Data folder for a BigBoxProfile.
Restriction : It use hardlinks, so that only works if Launchbox/BigBox is used on a NTFS drive, not gonna work if launchbox is used from a network drive.
Like, let says that for some reason, you want a custom InputBindings.xml for your tv profile.
You create a folder called “Profile_tv” and put a copy of InputBindings.xml inside and that’s it.
Now when you launch bigbox, if you use –profile=tv, it will replace the InputBindings.xml with that one.
Now, to go on a more practical use case, if you create a folder inside Profile_tv called Platforms and you put only a copy of Nintendo 64.xml from your original Platforms folder, if you launch with –profile=tv, you will see that’s now it only show the N64 platform.
Same goes with the Playlists folder.
As a side note, if your end goal is to do something like kid profile with a subset of platform and playlist, instead of copy the original files, you should hardlink them (mklink /H linkName target) so in the future, if you change something in the Plateform/Playlist, the change will apply to your kid profile too.
II - Emulator Hijacking
So, if you didn’t do it yet, to understand how it works, you should read the explanation at the start of my documents.
So, basically, you can add modules and order them, when you launch the app, it will do the action of all module, one by one, altering the command line if needed and pass it to the next module until it launch the emulator.
A simple (and totally useless) exemple :
With this configuration, i chain 4 modules, a Prefix, a Replace and two Suffix.
You can play with the Exemple Command IN Textbox to get an idea of how the command line would be impacted.
Once saved, if i use a cmd prompt and execute :
CalculatorApp.exe "C:\MyRomDir\MyRom.bin"
It will go to the first Prefix module and add a -f before, so the second module Replace will receive as input :
CalculatorApp.exe -f "C:\MyRomDir\MyRom.bin"
This module will replace .bin with .rom so the next module will receive :
CalculatorApp.exe -f "C:\MyRomDir\MyRom.rom"
It will add -extraarg so the last module receive :
CalculatorApp.exe -f "C:\MyRomDir\MyRom.bin" -extraarg.
And since the filter condition match and the command line contains -extraarg, it will add -otherarg.
So, bigboxProfile will execute :
CalculatorApp.exe -f C:\MyRomDir\MyRom.rom -extraarg -otherarg
If you want some more real exemple, that whati’m currently using for retroarch and tecknoparrot :
Quick Module list review :
Prefix : Add some argument before the rest of the command line
Suffix : The same, but after the rest of the command line
Replace : Replace something in the command line, support regex
ChangeExe : change the target Exe
FixRetroarchMonitor : Will force Retroarch to use main monitor
FixMameMonitor : Will force Mame to use the main monitor
UseFileContent : Let say you run emulator.exe “D:/ps3/metalgearsolid.txt” and inside this text file you have D:/ps3/metagear/eboot.bin, it will execute emulator.exe “D:/ps3/metagear/eboot.bin”
ChangeRomPath : You can do stuff like, if the file is not on your hard disk anymore, use another path (your NAS for exemple)
CopyFile : You can run something like emulator.exe “\\nas\mygame.bin” and it will copy the file locally before launching. Support Ramdisk and show a progress bar. Great for games stored on cloud like Google Drive.
ChangeDisposition : Use a specific monitor layout
FakeFullScreen : Turn a windowed windows into a fake full screen, removing borders and maximize.
RunAsAdminTask : Execute the emulator.exe as admin.
ExecutePrePostCmdAsAdmin : Execute extra command as admin before and after the emulator launch (like for example, start and stop DS4Windows)
ExecuteAHK : Make your own custom module in AHK
RomExtractor : Show a GUI to choose and extract a game inside an archive that contains multiple versions of the same rom.
About Launchbox Auto-Generated M3U :
There is a special case when BigBoxProfile receive a m3u generated by launchbox (like for Multi-Disc games)
In the command that will be received by nearly all modules, the m3u file will be replaced by the first file in the m3u. Module then will not be allowed to alter the file path in the command line (but they can still alter the rest of the command line, just not the file argument.
Why this design choice ? Because often, you will do stuff like filter on specific rom path, so that way, even when you use a launchbox auto-generated m3u, if you have a trigger on let say D:/roms/n64, that will still trigger it.
Also, there is two modules that will behave differently, CopyFile and ChangeRomPath.
They will run for each element in the m3u.
Modules Deep Dive :
Prefix :
Add some argument before the rest of the command line
You can use a filter to only do that if the cmd line contain something
Suffix : The same thing but as Suffix
Replace :
The thing to not here is that Replace support Regex, the format is similar than those used for Notepad++
ChangeExe :
Nothing to say here, it change the exe, i should add a filter condition when i have some free time
UseFileContents :
Let say you run emulator.exe “D:/ps3/metalgearsolid.txt” and inside this text file you have D:/ps3/metagear/eboot.bin, it will execute emulator.exe “D:/ps3/metagear/eboot.bin”
You can use relative path inside the file too, and use one of the two option in the radiobox
ChangeRomPath
Ok, so this one is a little more tricky. It will trigger when you launch a file as argument to your emulator that match path to replace.
You have two side : Hight Priority Path and Low Priority Path.
Hight Priority path is when you have an extra copy of your file on a quicker drive. Like you launch emulator.exe D:/rom/plateform/mygame.bin , D:/ is a slow hdd mecanical drive.
If you have set C:/rom/ as Hight priority path and C:/rom/plateform/mygame.bin exist, it will use this one instead and your final command line will be
emulator.exe C:/rom/plateform/mygame.bin
Low Priority Path is triggered when the file passed as argument does not exist
Like if i remove the file D:\rom\mygame.bin and i launch
emulator.exe D:/rom/plateform/mygame.bin
Since, the file does not exist, it will search in my low priority path if Z:\home\mehdi\coffre\sf_POOL_JEUX\Roms\mygame.bin exist, and if yes, it will launch
emulator.exe Z:\home\mehdi\coffre\sf_POOL_JEUX\Roms\mygame.bin
Side note : By default, launchbox does not allow you to launch games where the file is missing, you get :
To solve that issue, you can use this addon here :
CopyFile :
You can view a demo here where is use ChangeRomPath to point the file to my cloud drive if the file is missing, and then CopyFile to copy from Gdrive to my local storage before launching the game :
https://www.youtube.com/watch?v=KI64EIPFmxk
Note : It does support Ramdisk if you don’t want to keep the file and preserve your ssd.
For that you need to install this app : http://www.ltr-data.se/files/imdiskinst.exe
ChangeDisposition :
Use a specific monitor layout
Note : the button to create new screen disposition do not work, to create disposition, use the option on the main window config.
Btw, here you have an use case i do regularly, when i want to apply a filter for a bunch of games, instead to use a filter with the rom name inside, i use a new argument (here –2k) and then i add this extra argument in launchbox
This changeDisposition feature is really handy with tecknoparrot when you have game that can be very picky with monitor framerate and resolution.
FakeFullScreen
Turn a windowed windows into a fake full screen, removing borders and maximize.
It only support search by executable name, you can use emulator.exe, but you can also set one or search in the command line by regex. (i do that because i have a case of instead using the emulator.exe directly i use an application wrapper that do something like launcher.exe emulator.exe argos. )
Timeout is the time to wait for the application.
RunTaskAsAdmin :
I have a few games on tecknoparrot that actually requiere admins rights to be launch. And since launchbox/bigbox is launched without thoses rights, i have an issue and i don’t want to be bother by UAC prompt.
So, how does it works ? When the condition to launch as admin is fufill, it will register a shreduled task (only asking once with UAC).
In my exemple, instead of triggering by some element in the command line, i check into the file passed in the command line if it contain a specific string.
ExecutePrePostCmdAsAdmin
Execute extra command as admin before and after the emulator launch (like for example, start and stop DS4Windows)
ExecuteAHK
This one is tricky, it’s for power users. It allow you to make custom module in AHK.
Execute Before is the code that will execute before emulator launch,
Execute After will execute on emulator close.
And in Modify command line you can alter an array variable called Args
Modify Command Line Exemple only only apply to the exemple command line, so it’s used only for test.
With this module you can create stuff like append specific config if you are remote playing and do a lot of stuff.
https://www.youtube.com/watch?v=NxezepuAkLI
RomExtractor
So, i’m using the Hackset with 8bits/16 bits era consoles. Instead of using roms, i have archives filled with alternative versions of the same game.
So, it’s vital for me to have a way to select and launch a game within the archive. As of today, i was using the awesome plugin ArchiveCacheManager ( https://github.com/fraganator/archive-cache-manager ) but i wanted something more suited for my own need, and be able to chain it at the end of my module list.
Also, since BigBoxUtils is a third party application and not a plugin, that allow me to use it outside launchbox/bigbox and do not fear that a future update would break the plugin.
So, if you used ArchiveCacheManager before, this module is straightforward. Some of the feature of ArchiveCacheManager are missing, it only manage archives (zip, rar, 7z), not iso, chd and don’t have a batch extract feature.
On the other side, it have a few features and supports the metadata files packed with the Hackset. (you should put them either in a metadata subfolder on the Bigbox profile install dir or on the parent directory of your rom files)
So, the config :
If you set a max size of the Cache Dir, oldest files inside will be removed if the total size go over the threshold.
You can set multiple priority profile
SmartExtract is similar than ArchiveCacheManager, if a file contains only files with extensions that match the standalone rom extensions and the metadata extensions, when you select a file to extract, it only extract this one. If SmartExtract is not enabled or the archive contains files with unknow extensions, it will extract the whole archive.
If ImDisk is installed, you can use ramdisk to receive the extracted rom file.
The priority list allow you to automatically select witch file should be extracted by default.
On execute, you will see a windows like that :
The file selected by default will be either the first one that match a priority rule or the last played files. It also feature a short list of games (Your favorites games, up to 5 games that match your priority rules and up to 5 last games played)
It does support gamepad, but only Xinput on controller 1.
If you press F1 and have metadata files, you will see something like that allow you to browse the whole archive and show the metadata files.
If you press F2, you will have a desktop version that go a little deeper.
Note : if you use the muppen core or Project64 V3, it will also manage htc/hts texture for N64.
Yellow star is the file that is the first to match one of your priority list.
Blue star are other files (up to 5) that match your priority list
Red star are files that you set as favorite
If the file name is written in dark red, it’s because you launched them recently.
Right click menu allow some extra stuff :
You can filter roms, set favorite, Copy/paste savestate across roms (only for retroarch) and extract them.
https://www.youtube.com/watch?v=z3SGPnVr8SU
Edited by Nixx
What's New in Version 1.7 See changelog
Released
Important : Fix a bug that made emulator always use custom actions from the default profile, even if LB/BB was launched with an other profile.
When a BB profile need to change the monitor layout prior to launch BB, check every second and wait up to 10 sec to change the soundcard. Because if you activate a monitor, like a TV from a desactivate state and want to use his HDMI for audio, you need to wait a little before being able to switch to his soundcard.
RomExtractor and CopyFile windows should resize according to your screen resolution.
Some UI Fix
After an emulator close, BB Profile force back focus to BB/LB.
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.