Creating/Modifying Save Game Definitions
Hapsby uses external save game definitions to determine what games and game information it can edit. The files are stored in the \hsd\ folder:

Save game definition files

Step one to adding support for a new game would be creating a new file (or copying an existing one as a template). The file should be named in the following format:

Game_Title_-_Emulator_Name.hsd.xml

Underscores should be used instead of spaces because Hapsby runs on Java which runs on multiple platforms, some of which may not support spaces in file names.

The contents of the file should be in the following format:

<com.huguesjohnson.hapsby.SaveGameDefinition>
  <properties>
    <com.huguesjohnson.hapsby.SaveGameProperty>
      <name>Gold</name>
      <description>Gold. Screen will be updated after next fight.</description>
      <byteOrder>LOW_BYTE_FIRST</byteOrder>
      <dataType>TYPE_INTEGER</dataType>
      <address>998</address>
      <length>3</length>
      <maxValue>9999999</maxValue>
      <minValue>0</minValue>
    </com.huguesjohnson.hapsby.SaveGameProperty>
    <com.huguesjohnson.hapsby.SaveGameProperty>
      <name>Experience Points</name>
      <description>Experience points. Levels will be adjusted after visiting priest.</description>
      <byteOrder>LOW_BYTE_FIRST</byteOrder>
      <dataType>TYPE_INTEGER</dataType>
      <address>996</address>
      <length>2</length>
      <maxValue>65535</maxValue>
      <minValue>0</minValue>
    </com.huguesjohnson.hapsby.SaveGameProperty>
  </properties>
  <gameTitle>Faxanadu</gameTitle>
  <gameDescription>FCE Ultra save state for Faxanadu.</gameDescription>
  <saveFilePattern>*.fc*</saveFilePattern>
</com.huguesjohnson.hapsby.SaveGameDefinition>


Let's look at this in more detail, the first section contains the properties (fields) to edit:


<com.huguesjohnson.hapsby.SaveGameDefinition>
  <properties>
    <com.huguesjohnson.hapsby.SaveGameProperty>
      <name>Gold</name>
      <description>Gold. Screen will be updated after next fight.</description>
      <byteOrder>LOW_BYTE_FIRST</byteOrder>
      <dataType>TYPE_INTEGER</dataType>
      <address>998</address>
      <length>3</length>
      <maxValue>9999999</maxValue>
      <minValue>0</minValue>
    </com.huguesjohnson.hapsby.SaveGameProperty>
      [...next property...]
    </com.huguesjohnson.hapsby.SaveGameProperty>
  </properties>
  [...]
</com.huguesjohnson.hapsby.SaveGameDefinition>


What do all these fields mean? The next section contains the attributes of the save game:


<com.huguesjohnson.hapsby.SaveGameDefinition>
  <properties>
    [...]
  </properties>
  <gameTitle>Faxanadu</gameTitle>
  <gameDescription>FCE Ultra save state for Faxanadu.</gameDescription>
  <saveFilePattern>*.fc*</saveFilePattern>
</com.huguesjohnson.hapsby.SaveGameDefinition>


What do these fields mean? The description fields can also contain html if you want the UI to be all colorful and stuff, html characters must be escaped:


<com.huguesjohnson.hapsby.SaveGameDefinition>
  <properties>
    <com.huguesjohnson.hapsby.SaveGameProperty>
      [...]
      <description>&lt;html&gt;&lt;font color=#666699&gt;&lt;b&gt;&lt;p&gt;Gold.&lt;/p&gt;&lt;p&gt;Screen will be updated after next fight.&lt;/p&gt;&lt;p&gt;Warning: total WILL roll back to zero.&lt;/p&gt;&lt;/b&gt;&lt;/font&gt;&lt;/html&gt;</description>
      [...]
    </com.huguesjohnson.hapsby.SaveGameProperty>
  </properties>
  [...]
  <gameDescription>&lt;html&gt;&lt;font color=#666699&gt;&lt;b&gt;&lt;p&gt;FCE Ultra save state for Faxanadu. &lt;/p&gt;&lt;p&gt;** On screen display doesn&apos;t update immediately **&lt;/p&gt;&lt;/b&gt;&lt;/font&gt;&lt;/html&gt;</gameDescription>
  [...]
</com.huguesjohnson.hapsby.SaveGameDefinition>


<- Tutorial
 




Support
Everything on this site is free. If you've found something here to be especially helpful or entertaining please consider making a small donation, this can be done through a secure PayPal transaction. Thanks for visiting my little web page!
Make a secure donation for any amount via PayPal.







Legal Notes


Unless otherwise noted, all content is copyright (c) 2009 Hugues Johnson and may not be redistributed in any form without express permission.

index
feedback