Format 2.0 - PKHackers/EBYAML GitHub Wiki

Document 1

Document 1 contains metadata about the game the file describes. The root node should be a simple map. The following keys are currently recognized:

  • CPU: A mapping with the following keys
    • Local Vars: for architectures with multiple ways of handling The Stack, this describes how to access a routine's local variables
    • (65816 only) Default Data Bank: The default value for the DBR register
  • Platform: What platform does this game run on? (SNES, GBA, etc)
  • Title: A human-readable title for the game
  • Country: Where this game was released
  • Series: The series this game belongs to, if any
  • Default Script: The script used if no Charset key is defined
  • Script Tables: Describes bytestream-to-script mappings.
    • Should be a mapping. Each key represents the name of the character set, while the value will be a mapping containing a Lengths map and a Replacements(optional) map.
      • These mappings are recursive. For each byte read, simply follow the key in the current level of the mapping until it terminates to determine the length. If the byte is not defined as a key, then the "default" key will be used.

#Document 2+

Documents 2 and beyond describe data for the game. Document 2 will always be for the main CPU. All following documents will be for other CPUs on the platform. Currently-defined secondary documents are:

  • SNES
    • 3: SPC-700
    • 4+: Expansion chips on the cartridge

These documents contain an array of data block definitions. Each key MUST have an offset defined. Currently-allowed tags are:

  • !int: Integer
  • !script: Script (includes strings)
  • !array: Array
  • !empty: No data
  • !struct: A more-complex structure
  • !pointer: A pointer to some other data
  • !unknown: Unknown data
  • !assembly: Platform-specific assembly
  • !tile: Platform-specific tile data
  • !color: Platform-specific palette colour data

These definitions may contain the following keys (tag-specific keys are in parentheses):

  • Pretty Name: A human-friendly name for display purposes
  • Description: A human-friendly description of the definition
  • Notes: Various notes for the definition
  • Labels (!assembly, !array): An offset->name mapping
  • Arguments (!assembly): Provided values for this routine
  • Initial State (!assembly): Initial CPU state for this routine
  • Final State (!assembly): Final CPU state for this routine
  • Return Values (!assembly): Values returned by this routine
  • Label States (!assembly): CPU State changes associated with labels
  • Signed (!int): Whether or not an integer is signed
  • Base (!int): Number base to display value in
  • Endianness (!int): Endianness of the integer (Big/Little)
  • Bit Values (!int): Values for each bit of the integer
  • Values (!int): Used for giving specific values special meaning
  • BPP (!tile): Bits per pixel for the tile
  • Charset (!script): Character set to use
  • Terminator (!script): Value signalling termination of data
  • Entries (!struct): Sub-entries for this definition, Name->Data Block Definition mapping
  • Item Type (!array): Data Block Definition to use for this array

Example:

MUSIC_DATASET_TABLE: !array
  Size: 573
  Description: Music Dataset Table
  Item Type: !struct
    Entries:
      SAMPLE_SET_1: !int
        Pretty Name: Sample Set 1
        Values:
          255: None
        Size: 1
      SAMPLE_SET_2: !int
        Pretty Name: Sample Set 2
        Values:
          255: None
        Size: 1
      SEQUENCE_SET: !int
        Pretty Name: Sequence Set
        Values:
          255: None
        Size: 1
  Offset: 0xC4F70A