Open main menu

Difference between revisions of "MTropolis"

3,780 bytes added ,  03:29, 14 December 2023
Document boot script feature
m
(Document boot script feature)
Line 27: Line 27:
* mTropolis v2.0 Beta 3: December 2 1997 (save-disabled)
* mTropolis v2.0 Beta 3: December 2 1997 (save-disabled)
* mTropolis v2.0: March 1998
* mTropolis v2.0: March 1998
==Running Unknown mTropolis Titles Using Boot Scripts==
The mTropolis engine can attempt to boot unknown mTropolis titles using a boot script.  The boot script indicates what plug-ins to load and provides a virtualized file system workspace to simulate the post-installation state of a title that uses an installer.  Boot scripts are valid C++ code and are designed to be easily transferrable to the boot.cpp file in the mTropolis engine source code to add support for a new title.
To add a boot script, create a text file named "mtropolis_boot_mac.txt" to boot a Macintosh title, or "mtropolis_boot_win.txt" to boot a Windows title.  You must choose one or the other even for a cross-platform title, since the mode determines how resources are loaded from the player application/executable.
You must also include a player executable, which must be co-located with a "resource" or "mPlugIns" directory if it includes one.
===Virtual File System===
The virtual file system consists of a "physical" path space and a "virtual" path space.  The game always loads from virtual paths.  By default, there is a physical path mount point named "fs" that corresponds to the game directory, and nothing in the virtual space.  If, at the end of the boot script execution, there are no junctions, then one is created that links the "fs" physical path to the virtual root path.
Populating the virtual space otherwise can be done via junctions.  A junction maps a path in the virtual space to a path in the physical space.  For example:
addJunction("MyDir", "fs/SomeDir");
... will make the engine act as if there is a directory named "MyDir" that contains the contents of the directory named "SomeDir" in the game directory.
Note that Windows boot scripts must use "/" as the path separator and Macintosh boot scripts must use ":" as the path separator.
===Boot Script Functions===
addPlugIn(plugIn);
Adds a plug-in.  The plug-in must be one of: kPlugInStandard, kPlugInMTI, kPlugInObsidian, kPlugInSPQR
addArchive(archiveType, mountPoint, archivePhysicalPath);
Adds an archive.  Archive type must be one of: kArchiveTypeMacVISE, kArchiveTypeStuffIt, kArchiveTypeInstallShieldV3.  "mountPoint" point is the prefix that the archive becomes accessible under in the physical file space.  "archivePhysicalPath" is the physical path of the archive file.  For example, if you do: addArchive(kArchiveTypeStuffIt, "installer", "fs:Some Game Installer"); ... then that will create a mapping of physical paths starting with "installer:..." to the files inside of the file named "Some Game Installer" in the game directory.
addJunction(virtualPath, physicalPath);
Maps a file or directory in the virtual path space to a file or directory in physical path space.
addSubtitles(linesFile, speakersFile, assetMappingFile, modifierMappingFile);
Adds subtitle files.
addExclusion(virtualPath);
Removes the file or directory specified by "virtualPath" from the file system mapping.  You can use this to remove files that are causing problems, such as main segments for titles that include multiple main segments (which are not yet supported).
setResolution(width, height);
Sets the resolution to run the game at.  If this is not specified, then the boot code will attempt to determine it using the main segment.
setBitDepth(bitDepth);
Sets the bit depth to run the game at, and report to the game's scripts as the bit depth.  Bit depth must be one of: kBitDepthAuto, kBitDepth8, kBitDepth16, kBitDepth32.  If this is not specified, then the boot code will attempt to determine it using the main segment.
setEnhancedBitDepth(bitDepth);
Sets the bit depth to actually run the game at, if possible.  You can use this to run a title at a color depth better than what the title would allow.


==Resources==
==Resources==