Difference between revisions of "AppSignature"

From MSX Game Library

(Programming)
(Programming)
 
(39 intermediate revisions by the same user not shown)
Line 1: Line 1:
This [[Build tool]] option allow to add an application signature to binary data (right after the header).
+
This [[Build tool]] option allow to add an '''application signature''' to binary data (right after the header).
  
The MSXgl signature format is directly inspired by the meta-data that Konami used to identify their cartridges and add cross-games options.
+
The MSXgl signature format is directly inspired by the meta-data used by '''Konami''' to identify their cartridges and add cross-games options.
  
 
== Definition ==
 
== Definition ==
  
 
Application's signature is 4 bytes long and composed of:
 
Application's signature is 4 bytes long and composed of:
* <tt>AppCompany</tt>: 2 bytes for the creator/group/company code name ([[#Code name|must be reserved]]),
+
* <tt>AppCompany</tt>: 2 bytes for the creator ID ([[#Creator ID|reserve yours!]]),
* <tt>AppID</tt>: 2 bytes for the application number (the numbering of the applications is up to each creator).
+
* <tt>AppID</tt>: 2 bytes for the product ID (the numbering of the applications is up to each creator).
  
<pre>//-- Add application signature to binary data (boolean)
+
<syntaxhighlight lang="js">
 +
//-- Add application signature to binary data (boolean)
 
AppSignature = true;
 
AppSignature = true;
  
//-- Application company (*). Can be 2 character string or 16-bits integer (0~65535)
+
//-- Application creator ID. Can be 2 character string or 16-bits integer (0~65535)
 
AppCompany = "GL";
 
AppCompany = "GL";
  
//-- Application ID. Can be 2 character string or 16-bits integer (0~65535)
+
//-- Application product ID. Can be 2 character string or 16-bits integer (0~65535)
 
AppID = 0;
 
AppID = 0;
</pre>
+
</syntaxhighlight>
  
If 2-character string is recommended for creator code and integer for application number, in fact, both of those parameters can be any of:
+
If 2-character string is recommended for creator ID and integer for product ID, in fact, both of those parameters can be any of:
 
* 2-character string (<tt>"MX"</tt>, <tt>"a7"</tt> for example),
 
* 2-character string (<tt>"MX"</tt>, <tt>"a7"</tt> for example),
* 16-bits decimal unsigned number (<tt>1234</tt> for example),
+
* 16-bits decimal unsigned number (<tt>12345</tt> for example),
 
* 16-bits hexadecimal number starting with <tt>0x</tt> (<tt>0x0750</tt> for example).
 
* 16-bits hexadecimal number starting with <tt>0x</tt> (<tt>0x0750</tt> for example).
 +
 +
For example, the header first 2 words of Konami's ''Penguin Adventure'' are <tt>"CD", 0x4307</tt>. <tt>"CD"</tt> is one of the signature used by Konami to mark there ROM (see next section) and <tt>0x4307</tt> show in binary viewer the number 0743... the serial number of ''Penguin Adventure'' (RC743).
  
 
You can also add extra data using [[AppExtra]] option. {{WIP}}
 
You can also add extra data using [[AppExtra]] option. {{WIP}}
Line 30: Line 33:
  
 
Application signature is put just after the binary header:
 
Application signature is put just after the binary header:
* At ROM start address +0010h (should be 4010h or 8010h),
+
* At ROM header address +0x0010 (should be 0x4010 or 0x8010),
* At Basic binary start address +0007h (should be 8007h),
+
* At Basic binary header address +0x0007 (should be 0x8007),
* At DOS binary start address +0002h (should be 0102h).
+
* At DOS binary start address +0x0002 (should be 0x0102).
  
 
Define an external variable as <tt>g_AppSignature</tt> if you need to access the data from your program.
 
Define an external variable as <tt>g_AppSignature</tt> if you need to access the data from your program.
It can be define as:
+
It can be defined in several ways depending on your needs. For example:
<pre>
+
<syntaxhighlight lang="c">
extern u32 g_AppSignature;
+
extern const u16 g_AppSignature[2];
extern u16 g_AppSignature[2];
+
</syntaxhighlight><syntaxhighlight lang="c">
extern u8 g_AppSignature[4];
+
extern const u8 g_AppSignature[4];
</pre>
+
</syntaxhighlight>
Keep in mind than MSX store data as Less significant bits first (Little endian).
+
Keep in mind than MSX store data as Less significant byte first (Little endian).
 +
 
 +
<u>Note</u>: For ROM targets, if a [[ROM type signature]] is present at offset +0010h, then the application signature is placed just after (header +0x0018)
  
== Code name ==
+
== Creator ID ==
Some creator's code are already reserved:
+
Some creators' ID are already reserved:
{| class="wikitable"
+
{| class="wikitable sortable"
! Code !! Rel !! Creator's name
+
! ID !! Rel !! Creator's name
 
|-
 
|-
 
| <tt>0x00??</tt> ||  || ''Reserved''
 
| <tt>0x00??</tt> ||  || ''Reserved''
 
|-
 
|-
 
| <tt>"AB"</tt> || ✔️ || Konami (''Boxing'' and ''Football'')
 
| <tt>"AB"</tt> || ✔️ || Konami (''Boxing'' and ''Football'')
 +
|-
 +
| <tt>"B5"</tt> || ✔️ || Bik5 (J. Bikker)
 +
|-
 +
| <tt>"CC"</tt> || ✔️ || Casper Croes
 
|-
 
|-
 
| <tt>"CD"</tt> || ✔️ || Konami (many games)
 
| <tt>"CD"</tt> || ✔️ || Konami (many games)
 
|-
 
|-
 
| <tt>"EF"</tt> || ✔️ || Konami (''Pennant Race'' and ''Knightmare 3'')
 
| <tt>"EF"</tt> || ✔️ || Konami (''Pennant Race'' and ''Knightmare 3'')
 +
|-
 +
| <tt>"FD"</tt> ||  || FutureDisk
 
|-
 
|-
 
| <tt>"JP"</tt> ||  || Johan de Punder  
 
| <tt>"JP"</tt> ||  || Johan de Punder  
Line 62: Line 73:
 
| <tt>"GL"</tt> || ✔️ || MSXgl (samples)
 
| <tt>"GL"</tt> || ✔️ || MSXgl (samples)
 
|-
 
|-
| <tt>"PP"</tt> || || Pixel Phenix
+
| <tt>"NB"</tt> ||  || Nicola "8bit"
 +
|-
 +
| <tt>"PH"</tt> ||  || Pixel Phenix
 +
|-
 +
| <tt>"PP"</tt> || ✔️ || Pixel Phenix (obsolete)
 
|-
 
|-
 
| <tt>"RC"</tt> ||  || ''Reserved''
 
| <tt>"RC"</tt> ||  || ''Reserved''
 +
|-
 +
| <tt>"RO"</tt> ||  || ''Reserved for [[ROM type signature]]''
 +
|-
 +
| <tt>"RS"</tt> || ✔️ || RoboSoft
 
|-
 
|-
 
| <tt>"TL"</tt> ||  || Tele-Line
 
| <tt>"TL"</tt> ||  || Tele-Line
 +
|-
 +
| <tt>"TT"</tt> || ✔️ || Thomas ‘Totta’ Lundgren
 
|-
 
|-
 
| <tt>"YZ"</tt> || ✔️ || Konami (''Game Master 2)''
 
| <tt>"YZ"</tt> || ✔️ || Konami (''Game Master 2)''
Line 76: Line 97:
 
| <tt>0xFF??</tt> ||  || ''Reserved''
 
| <tt>0xFF??</tt> ||  || ''Reserved''
 
|}
 
|}
Come on [https://discord.gg/pMeadGfv8E Discord] to reserve your own name.
 
  
Code names are only definitively assigned when an application is published with this code.
+
Note:
 +
* Come on [https://discord.gg/pMeadGfv8E Discord] to reserve your own creator ID.
 +
* Creator ID are only definitively assigned when an application is published with this code.
 +
 
 +
== Known signed applications ==
 +
List of released applications that contain compatible signature.
 +
 
 +
{| class="wikitable sortable"
 +
! C !! App !! Author !! Application
 +
|-
 +
| <tt>"B5"</tt> || <tt>"EM"</tt> || Bik5 (J. Bikker) || ''Eggy's Maze''
 +
|-
 +
| <tt>"CC"</tt> || <tt>"PC"</tt> || Casper Croes || ''Phenix Corrupta''
 +
|-
 +
| <tt>"PP"</tt> || <tt>"CR"</tt> || Pixel Phenix || ''Crawlers (MSXdev'23)''
 +
|-
 +
| <tt>"PH"</tt> || <tt>001</tt> || Pixel Phenix || ''Crawlers (cartridge)''
 +
|-
 +
| <tt>"PH"</tt> || <tt>002</tt> || Pixel Phenix || ''Final Smash''
 +
|-
 +
| <tt>"RS"</tt> || <tt>"PE"</tt> || RoboSoft || ''Attack of the Petscii Robots''
 +
|-
 +
| <tt>"TT"</tt> || <tt>"TP"</tt> || Thomas ‘Totta’ Lundgren || ''Tetpuz''
 +
|-
 +
| <tt>"GL"</tt> || <tt>?</tt> || MSXgl || (samples)
 +
|-
 +
| <tt>"AB"</tt> || <tt>?</tt> || Konami || (''Boxing'' and ''Football'')
 +
|-
 +
| <tt>"CD"</tt> || <tt>?</tt> || Konami || (many games)
 +
|-
 +
| <tt>"EF"</tt> || <tt>?</tt> || Konami || (''Pennant Race'' and ''Knightmare 3'')
 +
|-
 +
| <tt>"YZ"</tt> || <tt>?</tt> || Konami || (''Game Master 2)''
 +
|}

Latest revision as of 20:44, 7 April 2024

This Build tool option allow to add an application signature to binary data (right after the header).

The MSXgl signature format is directly inspired by the meta-data used by Konami to identify their cartridges and add cross-games options.

Definition

Application's signature is 4 bytes long and composed of:

  • AppCompany: 2 bytes for the creator ID (reserve yours!),
  • AppID: 2 bytes for the product ID (the numbering of the applications is up to each creator).
//-- Add application signature to binary data (boolean)
AppSignature = true;

//-- Application creator ID. Can be 2 character string or 16-bits integer (0~65535)
AppCompany = "GL";

//-- Application product ID. Can be 2 character string or 16-bits integer (0~65535)
AppID = 0;

If 2-character string is recommended for creator ID and integer for product ID, in fact, both of those parameters can be any of:

  • 2-character string ("MX", "a7" for example),
  • 16-bits decimal unsigned number (12345 for example),
  • 16-bits hexadecimal number starting with 0x (0x0750 for example).

For example, the header first 2 words of Konami's Penguin Adventure are "CD", 0x4307. "CD" is one of the signature used by Konami to mark there ROM (see next section) and 0x4307 show in binary viewer the number 0743... the serial number of Penguin Adventure (RC743).

You can also add extra data using AppExtra option. WIP

Programming

If AppSignature is set to TRUE in Build tool configuration, then APPSIGN is defined in your C program.

Application signature is put just after the binary header:

  • At ROM header address +0x0010 (should be 0x4010 or 0x8010),
  • At Basic binary header address +0x0007 (should be 0x8007),
  • At DOS binary start address +0x0002 (should be 0x0102).

Define an external variable as g_AppSignature if you need to access the data from your program. It can be defined in several ways depending on your needs. For example:

extern const u16 g_AppSignature[2];
extern const u8 g_AppSignature[4];

Keep in mind than MSX store data as Less significant byte first (Little endian).

Note: For ROM targets, if a ROM type signature is present at offset +0010h, then the application signature is placed just after (header +0x0018)

Creator ID

Some creators' ID are already reserved:

ID Rel Creator's name
0x00?? Reserved
"AB" ✔️ Konami (Boxing and Football)
"B5" ✔️ Bik5 (J. Bikker)
"CC" ✔️ Casper Croes
"CD" ✔️ Konami (many games)
"EF" ✔️ Konami (Pennant Race and Knightmare 3)
"FD" FutureDisk
"JP" Johan de Punder
"GH" Reserved
"GL" ✔️ MSXgl (samples)
"NB" Nicola "8bit"
"PH" Pixel Phenix
"PP" ✔️ Pixel Phenix (obsolete)
"RC" Reserved
"RO" Reserved for ROM type signature
"RS" ✔️ RoboSoft
"TL" Tele-Line
"TT" ✔️ Thomas ‘Totta’ Lundgren
"YZ" ✔️ Konami (Game Master 2)
"WD" Wim Dewijngaert
"XX" Reserved
0xFF?? Reserved

Note:

  • Come on Discord to reserve your own creator ID.
  • Creator ID are only definitively assigned when an application is published with this code.

Known signed applications

List of released applications that contain compatible signature.

C App Author Application
"B5" "EM" Bik5 (J. Bikker) Eggy's Maze
"CC" "PC" Casper Croes Phenix Corrupta
"PP" "CR" Pixel Phenix Crawlers (MSXdev'23)
"PH" 001 Pixel Phenix Crawlers (cartridge)
"PH" 002 Pixel Phenix Final Smash
"RS" "PE" RoboSoft Attack of the Petscii Robots
"TT" "TP" Thomas ‘Totta’ Lundgren Tetpuz
"GL" ? MSXgl (samples)
"AB" ? Konami (Boxing and Football)
"CD" ? Konami (many games)
"EF" ? Konami (Pennant Race and Knightmare 3)
"YZ" ? Konami (Game Master 2)