Browse code

Port: Add override keyword.

Clarissa Walker authored on 2024/09/16 22:14:51
Showing 1 changed files
... ...
@@ -30,7 +30,7 @@ struct INFOEntrySEQ : INFOEntry
30 30
 
31 31
 	INFOEntrySEQ();
32 32
 
33
-	void Read(PseudoFile &file);
33
+	void Read(PseudoFile &file) override;
34 34
 };
35 35
 
36 36
 struct INFOEntryBANK : INFOEntry
... ...
@@ -40,7 +40,7 @@ struct INFOEntryBANK : INFOEntry
40 40
 
41 41
 	INFOEntryBANK();
42 42
 
43
-	void Read(PseudoFile &file);
43
+	void Read(PseudoFile &file) override;
44 44
 };
45 45
 
46 46
 struct INFOEntryWAVEARC : INFOEntry
... ...
@@ -49,7 +49,7 @@ struct INFOEntryWAVEARC : INFOEntry
49 49
 
50 50
 	INFOEntryWAVEARC();
51 51
 
52
-	void Read(PseudoFile &file);
52
+	void Read(PseudoFile &file) override;
53 53
 };
54 54
 
55 55
 struct INFOEntryPLAYER : INFOEntry
... ...
@@ -58,5 +58,5 @@ struct INFOEntryPLAYER : INFOEntry
58 58
 
59 59
 	INFOEntryPLAYER();
60 60
 
61
-	void Read(PseudoFile &file);
61
+	void Read(PseudoFile &file) override;
62 62
 };
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 1 changed files
... ...
@@ -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
 
Browse code

Various changes:

* Use enum class instead of enum (except for the enums for the resource IDs, not really necessary there).
* For NCSF specifically, included a function to convert an enum class to its underlying integral type (as this is needed for use with the std::bitset class).
* Cleanup headers so all the ones needed in a file are explicitly included even if they may possibly be included in another header.
* Used forward declarations in a few spots.
* Explicitly namespaced all (u)int*_t uses (this might seem like overkill, but it helps me see when the standard types are being used with a simple search for std::).
* Made sure it all builds with MinGW-w64 as well (both gcc and clang).
* Removed some std::move from DialogBuilder.cpp based on clang's warnings for that.
* Replaced use of std::copy_n on strings in DialogBuilder.cpp with my CopyToString functions that use wcscpy.
* Replaced CHAR_MIN/CHAR_MAX in eqstr.h and ltstr.h with std::numeric_limits<char>::min/max().

Naram Qashat authored on 2021/03/21 03:16:45
Showing 1 changed files
... ...
@@ -8,7 +8,9 @@
8 8
 
9 9
 #pragma once
10 10
 
11
-#include "common.h"
11
+#include <cstdint>
12
+
13
+struct PseudoFile;
12 14
 
13 15
 struct INFOEntry
14 16
 {
... ...
@@ -21,10 +23,10 @@ struct INFOEntry
21 23
 
22 24
 struct INFOEntrySEQ : INFOEntry
23 25
 {
24
-	uint32_t fileID;
25
-	uint16_t bank;
26
-	uint8_t vol;
27
-	uint8_t ply;
26
+	std::uint32_t fileID;
27
+	std::uint16_t bank;
28
+	std::uint8_t vol;
29
+	std::uint8_t ply;
28 30
 
29 31
 	INFOEntrySEQ();
30 32
 
... ...
@@ -33,8 +35,8 @@ struct INFOEntrySEQ : INFOEntry
33 35
 
34 36
 struct INFOEntryBANK : INFOEntry
35 37
 {
36
-	uint32_t fileID;
37
-	uint16_t waveArc[4];
38
+	std::uint32_t fileID;
39
+	std::uint16_t waveArc[4];
38 40
 
39 41
 	INFOEntryBANK();
40 42
 
... ...
@@ -43,7 +45,7 @@ struct INFOEntryBANK : INFOEntry
43 45
 
44 46
 struct INFOEntryWAVEARC : INFOEntry
45 47
 {
46
-	uint32_t fileID;
48
+	std::uint32_t fileID;
47 49
 
48 50
 	INFOEntryWAVEARC();
49 51
 
... ...
@@ -52,7 +54,7 @@ struct INFOEntryWAVEARC : INFOEntry
52 54
 
53 55
 struct INFOEntryPLAYER : INFOEntry
54 56
 {
55
-	uint16_t channelMask;
57
+	std::uint16_t channelMask;
56 58
 
57 59
 	INFOEntryPLAYER();
58 60
 
Browse code

Correct size of file ID in INFOEntry structures to 32-bit.

Naram Qashat authored on 2021/03/20 17:57:33
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ struct INFOEntry
21 21
 
22 22
 struct INFOEntrySEQ : INFOEntry
23 23
 {
24
-	uint16_t fileID;
24
+	uint32_t fileID;
25 25
 	uint16_t bank;
26 26
 	uint8_t vol;
27 27
 	uint8_t ply;
... ...
@@ -33,7 +33,7 @@ struct INFOEntrySEQ : INFOEntry
33 33
 
34 34
 struct INFOEntryBANK : INFOEntry
35 35
 {
36
-	uint16_t fileID;
36
+	uint32_t fileID;
37 37
 	uint16_t waveArc[4];
38 38
 
39 39
 	INFOEntryBANK();
... ...
@@ -43,7 +43,7 @@ struct INFOEntryBANK : INFOEntry
43 43
 
44 44
 struct INFOEntryWAVEARC : INFOEntry
45 45
 {
46
-	uint16_t fileID;
46
+	uint32_t fileID;
47 47
 
48 48
 	INFOEntryWAVEARC();
49 49
 
Browse code

Remove last modification date from files.

(I never remember to update these and besides, GitHub history can show when they were last modified.)

Naram Qashat authored on 2021/03/19 10:58:12
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 /*
2 2
  * SSEQ Player - SDAT INFO Entry structures
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-25
5 4
  *
6 5
  * Nintendo DS Nitro Composer (SDAT) Specification document found at
7 6
  * http://www.feshrine.net/hacking/doc/nds-sdat.html
Browse code

[NCSF] Utilize the PLAYER blocks in the SDAT if they exist.

Backwards compatibility is kept by treating the lack of PLAYER info as
if all channels are able to be allocated.

Naram Qashat authored on 2014/10/25 23:12:53
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * SSEQ Player - SDAT INFO Entry structures
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-08
4
+ * Last modification on 2014-10-25
5 5
  *
6 6
  * Nintendo DS Nitro Composer (SDAT) Specification document found at
7 7
  * http://www.feshrine.net/hacking/doc/nds-sdat.html
... ...
@@ -25,6 +25,7 @@ struct INFOEntrySEQ : INFOEntry
25 25
 	uint16_t fileID;
26 26
 	uint16_t bank;
27 27
 	uint8_t vol;
28
+	uint8_t ply;
28 29
 
29 30
 	INFOEntrySEQ();
30 31
 
... ...
@@ -49,3 +50,12 @@ struct INFOEntryWAVEARC : INFOEntry
49 50
 
50 51
 	void Read(PseudoFile &file);
51 52
 };
53
+
54
+struct INFOEntryPLAYER : INFOEntry
55
+{
56
+	uint16_t channelMask;
57
+
58
+	INFOEntryPLAYER();
59
+
60
+	void Read(PseudoFile &file);
61
+};
Browse code

Use #pragma once instead of include guards.

Naram Qashat authored on 2014/09/08 14:47:36
Showing 1 changed files
... ...
@@ -1,14 +1,13 @@
1 1
 /*
2 2
  * SSEQ Player - SDAT INFO Entry structures
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-21
4
+ * Last modification on 2014-09-08
5 5
  *
6 6
  * Nintendo DS Nitro Composer (SDAT) Specification document found at
7 7
  * http://www.feshrine.net/hacking/doc/nds-sdat.html
8 8
  */
9 9
 
10
-#ifndef SSEQPLAYER_INFOENTRY_H
11
-#define SSEQPLAYER_INFOENTRY_H
10
+#pragma once
12 11
 
13 12
 #include "common.h"
14 13
 
... ...
@@ -50,5 +49,3 @@ struct INFOEntryWAVEARC : INFOEntry
50 49
 
51 50
 	void Read(PseudoFile &file);
52 51
 };
53
-
54
-#endif
Browse code

Utilize SSEQ's volume from it's INFO section, plus some minor optimizations.

Naram Qashat authored on 2013/04/07 16:39:00
Showing 1 changed files
... ...
@@ -25,6 +25,7 @@ struct INFOEntrySEQ : INFOEntry
25 25
 {
26 26
 	uint16_t fileID;
27 27
 	uint16_t bank;
28
+	uint8_t vol;
28 29
 
29 30
 	INFOEntrySEQ();
30 31
 
Browse code

Import actual code.

Naram Qashat authored on 2013/03/26 02:41:19
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,53 @@
1
+/*
2
+ * SSEQ Player - SDAT INFO Entry structures
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ * Last modification on 2013-03-21
5
+ *
6
+ * Nintendo DS Nitro Composer (SDAT) Specification document found at
7
+ * http://www.feshrine.net/hacking/doc/nds-sdat.html
8
+ */
9
+
10
+#ifndef SSEQPLAYER_INFOENTRY_H
11
+#define SSEQPLAYER_INFOENTRY_H
12
+
13
+#include "common.h"
14
+
15
+struct INFOEntry
16
+{
17
+	virtual ~INFOEntry()
18
+	{
19
+	}
20
+
21
+	virtual void Read(PseudoFile &file) = 0;
22
+};
23
+
24
+struct INFOEntrySEQ : INFOEntry
25
+{
26
+	uint16_t fileID;
27
+	uint16_t bank;
28
+
29
+	INFOEntrySEQ();
30
+
31
+	void Read(PseudoFile &file);
32
+};
33
+
34
+struct INFOEntryBANK : INFOEntry
35
+{
36
+	uint16_t fileID;
37
+	uint16_t waveArc[4];
38
+
39
+	INFOEntryBANK();
40
+
41
+	void Read(PseudoFile &file);
42
+};
43
+
44
+struct INFOEntryWAVEARC : INFOEntry
45
+{
46
+	uint16_t fileID;
47
+
48
+	INFOEntryWAVEARC();
49
+
50
+	void Read(PseudoFile &file);
51
+};
52
+
53
+#endif