Advertisement
dragonbane

DTM

Jan 20th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.10 KB | None | 0 0
  1. #pragma pack(push,1)
  2. struct DTMHeader
  3. {
  4.     u8 filetype[4];         // Unique Identifier (always "DTM"0x1A)
  5.  
  6.     u8 gameID[6];           // The Game ID
  7.     bool bWii;              // Wii game
  8.  
  9.     u8  numControllers;     // The number of connected controllers (1-4)
  10.  
  11.     bool bFromSaveState;    // false indicates that the recording started from bootup, true for savestate
  12.     u64 frameCount;         // Number of frames in the recording
  13.     u64 inputCount;         // Number of input frames in recording
  14.     u64 lagCount;           // Number of lag frames in the recording
  15.     u64 uniqueID;           // (not implemented) A Unique ID comprised of: md5(time + Game ID)
  16.     u32 numRerecords;       // Number of rerecords/'cuts' of this TAS
  17.     u8  author[32];         // Author's name (encoded in UTF-8)
  18.  
  19.     u8  videoBackend[16];   // UTF-8 representation of the video backend
  20.     u8  audioEmulator[16];  // UTF-8 representation of the audio emulator
  21.     u8  md5[16];            // MD5 of game iso
  22.  
  23.     u64 recordingStartTime; // seconds since 1970 that recording started (used for RTC)
  24.  
  25.     bool bSaveConfig;       // Loads the settings below on startup if true
  26.     bool bSkipIdle;
  27.     bool bDualCore;
  28.     bool bProgressive;
  29.     bool bDSPHLE;
  30.     bool bFastDiscSpeed;
  31.     u8   CPUCore;           // 0 = interpreter, 1 = JIT, 2 = JITIL
  32.     bool bEFBAccessEnable;
  33.     bool bEFBCopyEnable;
  34.     bool bCopyEFBToTexture;
  35.     bool bEFBCopyCacheEnable;
  36.     bool bEFBEmulateFormatChanges;
  37.     bool bUseXFB;
  38.     bool bUseRealXFB;
  39.     u8   memcards;
  40.     bool bClearSave;        // Create a new memory card when playing back a movie if true
  41.     u8   bongos;
  42.     u8   numGBAs;           //Dragonbane
  43.     bool bSyncGPU;
  44.     bool bNetPlay;
  45.     u8   reserved[12];      // Padding for any new config options
  46.     u8   discChange[40];    // Name of iso file to switch to, for two disc games.
  47.     u8   revision[20];      // Git hash
  48.     u32  DSPiromHash;
  49.     u32  DSPcoefHash;
  50.     u64  tickCount;         // Number of ticks in the recording
  51.     u8   reserved2[11];     // Make heading 256 bytes, just because we can
  52. };
  53. static_assert(sizeof(DTMHeader) == 256, "DTMHeader should be 256 bytes");
  54.  
  55.  
  56.  
  57. // GameCube Controller State
  58. #pragma pack(push,1)
  59. struct ControllerState
  60. {
  61.     bool Start:1, A:1, B:1, X:1, Y:1, Z:1; // Binary buttons, 6 bits
  62.     bool DPadUp:1, DPadDown:1,             // Binary D-Pad buttons, 4 bits
  63.          DPadLeft:1, DPadRight:1;
  64.     bool L:1, R:1;                         // Binary triggers, 2 bits
  65.     bool disc:1;                           // Checks for disc being changed
  66.     bool reset:1;                          // Console reset button
  67.     bool loading:1;                        // Dragonbane: Loading status flag, 1 bit
  68.     bool reserved:1;                       // Reserved bits used for padding, 1 bit
  69.  
  70.     u8   TriggerL, TriggerR;               // Triggers, 16 bits
  71.     u8   AnalogStickX, AnalogStickY;       // Main Stick, 16 bits
  72.     u8   CStickX, CStickY;                 // Sub-Stick, 16 bits
  73.  
  74.     u8 tunerEvent;                         // Dragonbane: Tuner Event, 8 bits
  75.  
  76.     float LinkX, LinkZ;                    // Dragonbane: Used to detect desyncs, 64 bits
  77. };
  78. static_assert(sizeof(ControllerState) == 17, "ControllerState should be 17 bytes"); //Dragonbane
  79. #pragma pack(pop)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement