logo

mGalaxy Help Center

Adding/Editing an emulator definition

You may want to edit an emulator, or add an emulator to the list of systems recognized by mGalaxy. The easiest way to do this is to make a request on the forum but if you want to do it by yourself we will see in the following how to proceed. These tutorials will deal with the creation of an emulator, but if you know the principle, you should also be able to edit an emulator with full knowledge.

Creating an emulator #

The list of emulators is in the file “mGalaxy\Data\Definition\Emulators.xml” This file is to be opened with a text editor. Here is how an emulator is defined:
<Emulator name="Atari800Win" hidden="false">
	<Systems>
		<System name="Atari 800" option="" script="true" cmd="-atari -run &quot;%path\%file%ext&quot;" extensions="a52|bin|car|zip"/>
		<System name="Atari 5200" option="" script="true" cmd="-5200 -cart &quot;%path\%file%ext&quot;" extensions="a52|bin|car|zip"/>
	</Systems>
	<Requirement>
		<b>To quit emulator using the ESC key</b>
This feature is not available in the emulator. mGalaxy will take care of it with a script.
	</Requirement>
</Emulator>

The “Emulator” tag #

<Emulator name="Atari800Win" hidden="false">

In the first line, 2 attributes:

  • name: will receive the name of the emulator.
  • hidden: whose value can be “true” or “false” will allow to define if we want to launch the emulator with its interface non-visible (“true”) or visible (“false”).
    Some emulators allow it, others not, so it is to be tested beforehand.

The “System” tag #

<System name="Atari 800" option="" script="true" cmd="-atari -run &quot;%path\%file%ext&quot;" extensions="a52|bin|car|zip"/>

Included in the “Systems” tag are the system(s) emulated by this emulator, with the following attributes:

  • name: the exact name of the system as defined in the “Systems.xml” file
  • option: additional information, if needed
  • script: whose value can be “true” or “false” will allow to define if you want to launch the emulator through a script (“true”) or not (“false”).
  • cmd: the command line to send to the emulator
  • extensions: the list of file extensions allowed by this emulator, separated by a “|”.

Let’s take a closer look at the command line.
Almost all emulators can be launched from the command line. These commands can be found on the official website or in the documentation of the emulator.

mGalaxy uses this practice and will therefore address the emulator, sending it option requests (such as ‘start in full screen’) as well as the path to the game to launch.

cmd="-atari -run &quot;%path\%file%ext&quot;"
In this particular example, we have as values
-atari : (command specific to this emulator) to specify that it is the Atari 800 which will be emulated
-run : (command specific to this emulator) to tell it to launch the game whose path will follow
&quot; : as we have seen before, we are in XML and this &quot; represents in fact a " (opening quotation mark of the path)
%path : keyword that will be substituted by the folder containing the game, internally
%file : keyword that will be substituted by the name of the game file, internally
%ext : keyword that will be substituted by the game file extension, internally
&quot; : closing quotation mark of the path
For ease of use, the best approach is probably to first test the emulator with a batch file
Atari800Win.exe -atari -run "E:\EMULATION\Atari 800\Roms\Boulder_Dash_(1984)(First_Star).zip"
…and when everything works perfectly, replace what needs to be replaced.
cmd="-atari -run &quot;%path\%file%ext&quot;"

The “Requirement” tag #

<Requirement>
	<b>To quit emulator using the ESC key</b>
This feature is not available in the emulator. mGalaxy will take care of it with a script.
</Requirement>

The value of this tag is a text containing the prerequisite information for launching the emulator.

This text can contain text formatting tags, such as:

<a href="http://www.mgalaxy.com.index.html">Text</a>
<span style="color:#ff7900">Text</span>
<b>Text</b>
<i>Text</i>
<u>Text</u>
<br></br>
<p>Text</p>
<ul></ul>
<li>Text</li>
<img src="image.jpg" alt="Image" width="500" height="600"></img>
On the other hand, it cannot contain any of the special signs reserved for the XML language. These signs will have to be replaced manually or by means of an online tool, such as https://codebeautify.org/xml-escape-unescape
' is replaced with &apos;
" is replaced with &quot;
& is replaced with &amp;
< is replaced with &lt;
> is replaced with &gt;

Inserting the new emulator in the list #

Once your definition block is ready, copy it to the same level as the other definitions.
<?xml version="1.0" encoding="utf-8"?>
<Emulators>
	<Emulator name="Atari800Win" hidden="false">
		<Systems>
			<System name="Atari 800" option="" script="true" cmd="-atari -run &quot;%path\%file%ext&quot;" extensions="a52|bin|car|zip"/>
			<System name="Atari 5200" option="" script="true" cmd="-5200 -cart &quot;%path\%file%ext&quot;" extensions="a52|bin|car|zip"/>
		</Systems>
		<Requirement>
			<b>To quit emulator using the ESC key</b>
This feature is not available in the emulator. mGalaxy will take care of it with a script.</Requirement>
	</Emulator>
	<Emulator name="1964, 1964 UltraFast" hidden="false">
		<Systems>
			<System name="Nintendo 64" option="" script="true" cmd="-f -g &quot;%path\%file%ext&quot;" extensions="n64|z64|zip"/>
		</Systems>
		<Requirement>
			<b>To quit emulator using the ESC key</b>
This feature is not available in the emulator. mGalaxy will take care of it with a script.</Requirement>
	</Emulator>
	<Emulator name="4DO" hidden="false">
		<Systems>
			<System name="Panasonic 3DO" option="" script="false" cmd="--StartFullScreen -StartLoadFile &quot;%path\%file%ext&quot;" extensions="bin|cue|iso"/>
		</Systems>
		<Requirement>
			<b>To quit emulator using the ESC key</b>
Extract the content of <a href="http://www.mgalaxy.com/downloads/4DO_JohnnyInputBindings.zip">4DO_JohnnyInputBindings.zip</a> to your 4DO folder &gt; Settings folder.
Launch 4DO, go to &apos;Options&apos; &gt; &apos;Configure Input...&apos; and configure your other keyboard shortcut.</Requirement>
	</Emulator>