Browse code

NCSF: Revert uint32_t change as it violates spec and breaks a few NCSF game rip albums

Clarissa Walker authored on 2024/08/22 19:57:00
Showing 3 changed files
... ...
@@ -17,7 +17,8 @@ INFOEntrySEQ::INFOEntrySEQ() : fileID(0), bank(0), vol(0), ply(0)
17 17
 
18 18
 void INFOEntrySEQ::Read(PseudoFile &file)
19 19
 {
20
-	this->fileID = file.ReadLE<std::uint32_t>();
20
+	this->fileID = file.ReadLE<std::uint16_t>();
21
+	file.ReadLE<std::uint16_t>(); // unknown
21 22
 	this->bank = file.ReadLE<std::uint16_t>();
22 23
 	this->vol = file.ReadLE<std::uint8_t>();
23 24
 	if (!this->vol)
... ...
@@ -34,7 +35,8 @@ INFOEntryBANK::INFOEntryBANK() : fileID(0)
34 35
 
35 36
 void INFOEntryBANK::Read(PseudoFile &file)
36 37
 {
37
-	this->fileID = file.ReadLE<std::uint32_t>();
38
+	this->fileID = file.ReadLE<std::uint16_t>();
39
+	file.ReadLE<std::uint16_t>(); // unknown
38 40
 	file.ReadLE(this->waveArc);
39 41
 }
40 42
 
... ...
@@ -44,7 +46,8 @@ INFOEntryWAVEARC::INFOEntryWAVEARC() : fileID(0)
44 46
 
45 47
 void INFOEntryWAVEARC::Read(PseudoFile &file)
46 48
 {
47
-	this->fileID = file.ReadLE<std::uint32_t>();
49
+	this->fileID = file.ReadLE<std::uint16_t>();
50
+	file.ReadLE<std::uint16_t>(); // unknown
48 51
 }
49 52
 
50 53
 INFOEntryPLAYER::INFOEntryPLAYER() : channelMask(0)
... ...
@@ -23,7 +23,7 @@ struct INFOEntry
23 23
 
24 24
 struct INFOEntrySEQ : INFOEntry
25 25
 {
26
-	std::uint32_t fileID;
26
+	std::uint16_t fileID;
27 27
 	std::uint16_t bank;
28 28
 	std::uint8_t vol;
29 29
 	std::uint8_t ply;
... ...
@@ -35,7 +35,7 @@ struct INFOEntrySEQ : INFOEntry
35 35
 
36 36
 struct INFOEntryBANK : INFOEntry
37 37
 {
38
-	std::uint32_t fileID;
38
+	std::uint16_t fileID;
39 39
 	std::uint16_t waveArc[4];
40 40
 
41 41
 	INFOEntryBANK();
... ...
@@ -45,7 +45,7 @@ struct INFOEntryBANK : INFOEntry
45 45
 
46 46
 struct INFOEntryWAVEARC : INFOEntry
47 47
 {
48
-	std::uint32_t fileID;
48
+	std::uint16_t fileID;
49 49
 
50 50
 	INFOEntryWAVEARC();
51 51
 
... ...
@@ -53,7 +53,7 @@ SDAT::SDAT(PseudoFile &file, std::uint32_t sseqToLoad) : sseq(), sbnk(), player(
53 53
 	// Read SSEQ
54 54
 	if (infoSection.SEQrecord.entries.count(sseqToLoad))
55 55
 	{
56
-		std::uint32_t fileID = infoSection.SEQrecord.entries[sseqToLoad].fileID;
56
+		std::uint16_t fileID = infoSection.SEQrecord.entries[sseqToLoad].fileID;
57 57
 		std::string name = "SSEQ" + NumToHexString(fileID).substr(2);
58 58
 		if (SYMBOffset)
59 59
 			name = NumToHexString(sseqToLoad).substr(6) + " - " + symbSection.SEQrecord.entries[sseqToLoad];