mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 19:02:19 -05:00
Added XML attributes and fixed odd crash
This commit is contained in:
parent
bff206e30b
commit
9e313dd18b
@ -11,9 +11,10 @@ REGISTER_ZFILENODE(Audio, ZAudio);
|
||||
|
||||
ZAudio::ZAudio(ZFile* nParent) : ZResource(nParent)
|
||||
{
|
||||
//RegisterRequiredAttribute("CodeOffset");
|
||||
//RegisterOptionalAttribute("LangOffset", "0");
|
||||
|
||||
RegisterRequiredAttribute("SoundFontTableOffset");
|
||||
RegisterRequiredAttribute("SequenceTableOffset");
|
||||
RegisterRequiredAttribute("SampleBankTableOffset");
|
||||
RegisterRequiredAttribute("SequenceFontTableOffset");
|
||||
}
|
||||
|
||||
void ZAudio::ParseXML(tinyxml2::XMLElement* reader)
|
||||
@ -156,11 +157,6 @@ SampleEntry* ZAudio::ParseSampleEntry(std::vector<uint8_t> audioBank,
|
||||
sample->loop.end = BitConverter::ToInt32BE(audioBank, loopOffset + 4);
|
||||
sample->loop.count = BitConverter::ToInt32BE(audioBank, loopOffset + 8);
|
||||
|
||||
if (sample->loop.start == 0x3ADB)
|
||||
{
|
||||
int bp = 0;
|
||||
}
|
||||
|
||||
if (sample->loop.count != 0)
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
@ -341,30 +337,30 @@ void ZAudio::ParseRawData()
|
||||
audioSeqData = Globals::Instance->GetBaseromFile(Globals::Instance->baseRomPath.string() +
|
||||
"Audioseq");
|
||||
|
||||
//codeData = File::ReadAllBytes("baserom/code_ntsc");
|
||||
//audioTableData = File::ReadAllBytes("baserom/Audiotable_ntsc");
|
||||
//audioSeqData = File::ReadAllBytes("baserom/Audioseq_ntsc");
|
||||
//audioBankData = File::ReadAllBytes("baserom/Audiobank_ntsc");
|
||||
|
||||
// TABLE PARSING
|
||||
|
||||
// GC PAL
|
||||
//int gSoundFontTableOffset = 0x138270; // OTRTODO: Make this an XML Param
|
||||
//int gSequenceTableOffset = 0x1386A0; // OTRTODO: Make this an XML Param
|
||||
//int gSampleBankTableOffset = 0x138D90; // OTRTODO: Make this an XML Param
|
||||
//int gSequenceFontTableOffset = 0x1384E0; // OTRTODO: Make this an XML Param
|
||||
//int gSoundFontTableOffset = 0x138270;
|
||||
//int gSequenceTableOffset = 0x1386A0;
|
||||
//int gSampleBankTableOffset = 0x138D90;
|
||||
//int gSequenceFontTableOffset = 0x1384E0;
|
||||
|
||||
// NMQ DBG ROM
|
||||
int gSoundFontTableOffset = 0x138290; // OTRTODO: Make this an XML Param
|
||||
int gSequenceTableOffset = 0x1386C0; // OTRTODO: Make this an XML Param
|
||||
int gSampleBankTableOffset = 0x138DB0; // OTRTODO: Make this an XML Param
|
||||
int gSequenceFontTableOffset = 0x138500; // OTRTODO: Make this an XML Param
|
||||
//int gSoundFontTableOffset = 0x138290;
|
||||
//int gSequenceTableOffset = 0x1386C0;
|
||||
//int gSampleBankTableOffset = 0x138DB0;
|
||||
//int gSequenceFontTableOffset = 0x138500;
|
||||
|
||||
// NTSC 1.0
|
||||
//int gSoundFontTableOffset = 0x1026A0; // OTRTODO: Make this an XML Param
|
||||
//int gSequenceTableOffset = 0x102AD0; // OTRTODO: Make this an XML Param
|
||||
//int gSampleBankTableOffset = 0x1031C0; // OTRTODO: Make this an XML Param
|
||||
//int gSequenceFontTableOffset = 0x102910; // OTRTODO: Make this an XML Param
|
||||
//int gSoundFontTableOffset = 0x1026A0;
|
||||
//int gSequenceTableOffset = 0x102AD0;
|
||||
//int gSampleBankTableOffset = 0x1031C0;
|
||||
//int gSequenceFontTableOffset = 0x102910;
|
||||
|
||||
int gSoundFontTableOffset = StringHelper::StrToL(registeredAttributes.at("SoundFontTableOffset").value, 16);
|
||||
int gSequenceTableOffset = StringHelper::StrToL(registeredAttributes.at("SequenceTableOffset").value, 16);
|
||||
int gSampleBankTableOffset = StringHelper::StrToL(registeredAttributes.at("SampleBankTableOffset").value, 16);
|
||||
int gSequenceFontTableOffset = StringHelper::StrToL(registeredAttributes.at("SequenceFontTableOffset").value, 16);
|
||||
|
||||
soundFontTable = ParseAudioTable(codeData, gSoundFontTableOffset);
|
||||
sequenceTable = ParseAudioTable(codeData, gSequenceTableOffset);
|
||||
|
@ -64,8 +64,8 @@ namespace SohImGui {
|
||||
bool p_open = false;
|
||||
bool needs_save = false;
|
||||
std::vector<const char*> CustomTexts;
|
||||
int SelectedLanguage = CVar_GetS32("gLanguages", 0); //Default Language to 0=English 1=German 2=French
|
||||
int SelectedHUD = CVar_GetS32("gHudColors", 1); //Default colors to GameCube.
|
||||
//int SelectedLanguage = CVar_GetS32("gLanguages", 0); //Default Language to 0=English 1=German 2=French
|
||||
//int SelectedHUD = CVar_GetS32("gHudColors", 1); //Default colors to GameCube.
|
||||
ImVec4 hearts_colors;
|
||||
ImVec4 hearts_dd_colors;
|
||||
ImVec4 a_btn_colors;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<Root>
|
||||
<File Name="code" OutName="audio" RangeStart="0x0" RangeEnd="0x12CBB0">
|
||||
<Audio Name="audio" Offset="0x00">
|
||||
<Audio Name="audio" Offset="0x00" SoundFontTableOffset="0x138290" SequenceTableOffset="0x1386C0" SampleBankTableOffset="0x138DB0" SequenceFontTableOffset="0x138500">
|
||||
<Sequences>
|
||||
<Sequence Name="000_Sound_Effects"/>
|
||||
<Sequence Name="001_Ambient_Effects"/>
|
||||
|
Loading…
Reference in New Issue
Block a user