Difference between revisions of "Launcher"
Line 48: | Line 48: | ||
[[File:Pixel perfect face.png|frameless|Pixel Perfect]] | [[File:Pixel perfect face.png|frameless|Pixel Perfect]] | ||
'''Regular DOSBox: Aspect Ratio On''' | '''Regular DOSBox: Aspect Ratio On'''<br> | ||
[[File:Normal face.png|frameless|Aspect Ratio On]] | [[File:Normal face.png|frameless|Aspect Ratio On]] | ||
'''Regular DOSBox: Aspect Ratio Off''' | '''Regular DOSBox: Aspect Ratio Off'''<br> | ||
[[File:Normal aspect off face.png|frameless|Aspect Ratio Off]] | [[File:Normal aspect off face.png|frameless|Aspect Ratio Off]] | ||
Revision as of 13:09, 11 November 2021
Overview
The launcher is a script which allows the user to easily start any game included in the projects. Each game has a launcher folder, and within this folder is a batch file with the same name as the game's zip file.
Process
Initial Launch
The file in the game's launch folder primarily reads data into variables to pass on to the universal launcher. The current folder of the launcher and the launcher's name are both read into memory. These are important, as they relate directly to the folder the decompressed game resides in as well as the name of the game in for checking the dosbox index.
Launch.bat
At this point the game's launch file calls Launch.bat, which resides .\eXo\util\
(note: this is the name of the file for eXoDOS. Each project uses it's own universal launcher, also found in this folder)
Language Check
The first step is to check for the presence of any lang files. lang files are written to the dosbox folder to note which language packs have been installed. If one is detected, the launcher checks for the presence of this game in each of the various possible language folders.
Installation
The second step is to ensure the game is installed. If no language choice is presented, then this is the standard included eXoDOS version it checks for. If any language was chosen above, it checks to ensure that particular version has been installed. In the event the game has not been installed yet, the universal launcher will pass to the game's Installer. Upon competition, control is passed back to the universal launcher and the process continues.
Index Checks
The name of the game is now checked against 2 indexes. The first index, dosbox.txt, resides in the util folder. This file is a complete list of ever game in the project, along with the version of DOSBox that has been chosen for it. The chosen version is not random. Depending on the capabilities or needs of the game, the most compatible version of DOSBox has been selected and stored here. However, this file also makes it easy to wholesale change a particular version of DOSBox from one to another with out individually editing each game's launch file.
The second index file is the multiplayer.txt index, which also reside in the util folder. This is an index of every game which support Remote Multiplayer. If the launched game is on this list, the universal launcher will call the ip.bat file. This checks the computers IP address (both local network and external network) and writes them to tetx files in the game's folder. These will be referenced at launch if the user chooses to start a host or client game.
Exception.bat
The universal launcher now checks for the presence of a file called exception.bat in the game's launch folder. If this file does not exist, the process proceeds as normal. If it does exist, the universal launcher calls it, thereby skipping the normal launch procedure. The exception.bat file exists for games that have a choice at launch. This is most commonly to choose between DOSBox and ScummVM versions of a game. It may also be used, however, to give an option to launch between two different machine types. Such as a game that exists on both Tandy and IBM PC.
Game Launch
At this point all information is gathered and all checks are complete. The game is launched by calling the following variables, in this order:
- the dosbox version specified by the dosbox.txt index
- the game's DOSBox Configuration File, from it's launch folder
- the global options configuration file, defined by the Installer
It also includes flags to suppress the DOSBox console, any menus (DOSBox-X for example has a menu bar across the top normally), and to fully close DOSBox once the exit command is stated within the game.
Game Exit
On exit the universal launcher does minor clean-up, removing the DOSBox log files (stdout.txt and stderr.txt), along with any leftover glide or cwsdpmi swap files.
Alternate Launcher
Each game's launch folder has an Extras folder. Within this folder will always be at least one file, the Alternate Launcher.bat. This file is linked under additional applications within LaunchBox. Here it is named Pixel Perfect & Shader Options.
When this file is launched, the user is presented with a choice for:
Pixel Perfect Mode
Regular DOSBox: Aspect Ratio On
Regular DOSBox: Aspect Ratio Off
Curved CRT Mode
The Curved CRT Shader emulated the style of an old CRT monitor. This includes curvature near the corners of the screens as well as scan lines.