Skip to content

Instantly share code, notes, and snippets.

@Radfordhound
Last active May 12, 2016 08:12
Show Gist options
  • Save Radfordhound/f194cfa8098d1eb205ee844e24cf7625 to your computer and use it in GitHub Desktop.
Save Radfordhound/f194cfa8098d1eb205ee844e24cf7625 to your computer and use it in GitHub Desktop.
A heavy WIP specification of the Sonic Colors ORC format. Largely based off of Paraxade0's ORC-loading code from his custom modification of SonicGlvl.
//Colors ORC format specification
//Largely based off of the ORC-loading code in Paraxade0's modification of SonicGlvl.
//Variables marked with a "?" comment mean it's not certain that the information regarding it is correct.
//Absolute offsets are marked with a comment saying "ABSOLUTE"
//For these you have to add the root_node_offset (ALWAYS 32 for Colors)
//to their value to get what it's actually referring to. (I.E. offest+32 = absolute offset)
//Header
uint32_be fileSize;
uint32_be finalTableOffset; //?
uint32_be unKnown1; //Literally have no idea what this is for atm
uint32_be padding1 = 0; //ALWAYS in Colors ORCs
uint32_be unKnown2 = 1; //ALWAYS 1 in Colors ORCs for some reason
char oneBin[] = "\0\01B"; //Also read as "1B". \0, of course, indicates NULL.
//SOBJ header
char BINA[] = "BINA"; //ALWAYS present in Colors ORCs.
uint32_be endian_flag = 0; //If the file is big endian, this seems to be "0". For Colors, this is ALWAYS the case.
char SOBJ[] = "SOBJ"; //ALWAYS present in Colors ORCs.
uint32_be unKnown3 = 1; //?
uint32_be numObjectTypes; //The number of "types" of objects in the level.
/*For example, if the level contains 4 "1UP"s and 7 "SuperRing"s, this value would be "2", since
there are two "types" of objects.*/
int32_be typeArrayAddress; //ABSOLUTE - the offset to the array containing the "types" of objects used in the level.
uint32_be padding2; //Padding - ALWAYS present in Colors ORCs.
int32_be objOffsetsAddress //ABSOLUTE - the offset to the array containing offsets to the object data.
uint32_be numObjects; //The number of objects in the level. In the above "numObjectTypes" example, this would be "11" since there are 4 1UPs and 7 SuperRings.
uint32_be padding3; //Padding - ALWAYS present in Colors ORCs.
uint32_be unKnown4; //?
//Object "type" array
uint32_be nameOffset; //ABSOLUTE - the offset to the null-terminated string containing the object's "type".
uint32_be typeCount; //The number of objects in the level of this "type".
uint32_be indicesOffset; //ABSOLUTE - the offset to the array of indicies.
//TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment