forked from jfalmeida/mib3_sound_dataset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path5F_MIB3_Dataset_0x007206.BIN.bt
133 lines (117 loc) · 4.17 KB
/
5F_MIB3_Dataset_0x007206.BIN.bt
1
//------------------------------------------------//--- 010 Editor v12.0 Binary Template//// File: 0x007206.BIN// Authors: Alex Strelets, Joao Almeida// Version: 0.1// Purpose: Parse the contents of the Sound Settings of MIB2// Category: // File Mask: // ID Bytes: // History: 0.1 - Initial version//// Considering the following structure:// Version - 0-3 bytes (values from 0x00000000 to 0x7F7F7F7F).// Data is 4-145 bytes in hexadecimal format (each byte has values from 0x00 to 0xFF).// Checksum - 146-149 bytes according to CRC-32 (values from 0x00000000 to 0xFFFFFFFF).//////------------------------------------------------//------------------------------------------------// legend: // yellow/aqua = uncertain// red = checksum// green = confirmed// gray = seemingly irrelevant// blue = specialLittleEndian();char DatasetVersion[4];typedef struct { byte min <bgcolor=cDkGreen>; byte center <bgcolor=cGreen>; byte max <bgcolor=cLtGreen>;} Knob;struct { byte min <bgcolor=cDkYellow>; byte unknown <bgcolor=cYellow>; byte max <bgcolor=cLtYellow>;} VolumeBar;struct { Knob Balance; Knob Fade; Knob Trebble; Knob Higher; Knob Middle; Knob Lower; Knob Bass; Knob Subwoofer;} ToneControls;string getEffect(int type) { switch(type) { case 1: return "All"; case 2: return "Driver"; case 4: return "Movie"; case 8: return "Front"; case 16: return "Back"; default: return "Unknown"; }}ubyte Clicks <bgcolor=cDkAqua>;ubyte ToneBands <bgcolor=cAqua>;ubyte unknown_6 <bgcolor=cLtAqua>;ubyte FocusEffect1 <bgcolor=cDkAqua, read=getEffect>;ubyte FocusEffect2 <bgcolor=cAqua, read=getEffect>;struct { ubyte value[19] <bgcolor=cDkGray>;} UnknownGain;FSeek(51);struct { char major <bgcolor=cDkBlue>; char minor <bgcolor=cDkBlue>;} DatasetVersion;ushort checksum <bgcolor=cDkRed>;local int i;local int j;Printf("\nVOLUME\n");Printf("Bar:\t [%2g .. %2g .. %3g ]\n", VolumeBar.min, VolumeBar.unknown, VolumeBar.max);Printf("\nKNOBS\n");Printf("Balance:\t [%3g .. %1g .. %1g ]\n", ToneControls.Balance.min, ToneControls.Balance.center, ToneControls.Balance.max);Printf("Fade:\t [%3g .. %1g .. %1g ]\n", ToneControls.Fade.min, ToneControls.Fade.center, ToneControls.Fade.max);Printf("Trebble:\t [%3g .. %1g .. %1g ]\n", ToneControls.Trebble.min, ToneControls.Trebble.center, ToneControls.Trebble.max);Printf("Higher:\t [%3g .. %1g .. %1g ]\n", ToneControls.Higher.min, ToneControls.Higher.center, ToneControls.Higher.max);Printf("Middle:\t [%3g .. %1g .. %1g ]\n", ToneControls.Middle.min, ToneControls.Middle.center, ToneControls.Middle.max);Printf("Lower:\t [%3g .. %1g .. %1g ]\n", ToneControls.Lower.min, ToneControls.Lower.center, ToneControls.Lower.max);Printf("Bass:\t [%3g .. %1g .. %1g ]\n", ToneControls.Bass.min, ToneControls.Bass.center, ToneControls.Bass.max);Printf("Subwoofer:\t [%3g .. %1g .. %1g ]\n", ToneControls.Subwoofer.min, ToneControls.Subwoofer.center, ToneControls.Subwoofer.max);Printf("\nFocusing:\t [ %s\t> ]\n\t [ %s\t ]\n", getEffect(FocusEffect1), getEffect(FocusEffect2));Printf("\nUNKNOWN GAIN\n");for (j = 0; j < 19; j++) { Printf("%4g ", UnknownGain.value[j]);}/*Printf("\nGLOBAL EQUALIZER\n");Printf(" 0Hz\t 10Hz\t 20Hz\t 30Hz\t 40Hz\t 50Hz\t 100Hz\t 200Hz\t 300Hz\t 400Hz\t 500Hz\t 1kHz\t 2kHz\t 3kHz\t 4kHz\t 5kHz\t 10kHz\t 15kHz\t 20kHz\t\n");local int k;for (i = 21; i > -1; i--) { for (j = 0; j < 19; j++) { k = UnknownGain.value[j] / (j+1) - 10; if (k == i-10) { if (k < 0) { if (k < -9) { Printf(" =%i=\t", k); } else { Printf(" =%i==\t", k); } } else { Printf(" ==%i==\t", k); } } else { Printf(" |\t"); } } Printf("\n");}Printf("\n");*/local int file_checksum = Checksum(CHECKSUM_CRCCCITT, 0, FileSize() - 2, -1, -1); // algo, size, length, poly, init Printf("\n\nFILE CHECKSUM: %.04X", file_checksum);