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
... ...
@@ -7,7 +7,9 @@
7 7
  */
8 8
 
9 9
 #include <stdexcept>
10
+#include <cstdint>
10 11
 #include "FATSection.h"
12
+#include "common.h"
11 13
 
12 14
 FATRecord::FATRecord() : offset(0)
13 15
 {
... ...
@@ -15,9 +17,9 @@ FATRecord::FATRecord() : offset(0)
15 17
 
16 18
 void FATRecord::Read(PseudoFile &file)
17 19
 {
18
-	this->offset = file.ReadLE<uint32_t>();
19
-	file.ReadLE<uint32_t>(); // size
20
-	uint32_t reserved[2];
20
+	this->offset = file.ReadLE<std::uint32_t>();
21
+	file.ReadLE<std::uint32_t>(); // size
22
+	std::uint32_t reserved[2];
21 23
 	file.ReadLE(reserved);
22 24
 }
23 25
 
... ...
@@ -27,13 +29,13 @@ FATSection::FATSection() : records()
27 29
 
28 30
 void FATSection::Read(PseudoFile &file)
29 31
 {
30
-	int8_t type[4];
32
+	std::int8_t type[4];
31 33
 	file.ReadLE(type);
32 34
 	if (!VerifyHeader(type, "FAT "))
33 35
 		throw std::runtime_error("SDAT FAT Section invalid");
34
-	file.ReadLE<uint32_t>(); // size
35
-	uint32_t count = file.ReadLE<uint32_t>();
36
+	file.ReadLE<std::uint32_t>(); // size
37
+	std::uint32_t count = file.ReadLE<std::uint32_t>();
36 38
 	this->records.resize(count);
37
-	for (uint32_t i = 0; i < count; ++i)
39
+	for (std::uint32_t i = 0; i < count; ++i)
38 40
 		this->records[i].Read(file);
39 41
 }
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 FAT (File Allocation Table) Section structures
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-17
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

* Fixes for gcc and clang (while they can compile the code, the DLLs made aren't functional, but oh well).

* [2SF] Used more up-to-date asmjit, despite the ugly looking code.

Naram Qashat authored on 2014/09/17 19:51:45
Showing 1 changed files
... ...
@@ -1,12 +1,13 @@
1 1
 /*
2 2
  * SSEQ Player - SDAT FAT (File Allocation Table) Section structures
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-21
4
+ * Last modification on 2014-09-17
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
+#include <stdexcept>
10 11
 #include "FATSection.h"
11 12
 
12 13
 FATRecord::FATRecord() : offset(0)
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,39 @@
1
+/*
2
+ * SSEQ Player - SDAT FAT (File Allocation Table) Section 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
+#include "FATSection.h"
11
+
12
+FATRecord::FATRecord() : offset(0)
13
+{
14
+}
15
+
16
+void FATRecord::Read(PseudoFile &file)
17
+{
18
+	this->offset = file.ReadLE<uint32_t>();
19
+	file.ReadLE<uint32_t>(); // size
20
+	uint32_t reserved[2];
21
+	file.ReadLE(reserved);
22
+}
23
+
24
+FATSection::FATSection() : records()
25
+{
26
+}
27
+
28
+void FATSection::Read(PseudoFile &file)
29
+{
30
+	int8_t type[4];
31
+	file.ReadLE(type);
32
+	if (!VerifyHeader(type, "FAT "))
33
+		throw std::runtime_error("SDAT FAT Section invalid");
34
+	file.ReadLE<uint32_t>(); // size
35
+	uint32_t count = file.ReadLE<uint32_t>();
36
+	this->records.resize(count);
37
+	for (uint32_t i = 0; i < count; ++i)
38
+		this->records[i].Read(file);
39
+}