summaryrefslogtreecommitdiff
path: root/src/Dolphin/dvd/dvdidutils.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-02-01 18:45:02 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-02-01 18:50:25 -0400
commit9fa0a7f1da1b70bee995f53c6c96c43189018772 (patch)
tree114548896790eaff23cdca84a025281de86bbb51 /src/Dolphin/dvd/dvdidutils.c
parent2ba3289286bbfcf9fcc13fd135d976058d8b6c2e (diff)
global: Import Dolphin SDK
This version comes from the Metroid Prime decompilation project. https://github.com/PrimeDecomp/prime
Diffstat (limited to 'src/Dolphin/dvd/dvdidutils.c')
-rw-r--r--src/Dolphin/dvd/dvdidutils.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Dolphin/dvd/dvdidutils.c b/src/Dolphin/dvd/dvdidutils.c
new file mode 100644
index 0000000..3c58e98
--- /dev/null
+++ b/src/Dolphin/dvd/dvdidutils.c
@@ -0,0 +1,27 @@
+#include <dolphin/DVDPriv.h>
+#include <dolphin/dvd.h>
+#include <dolphin/dvd_regs.h>
+
+#include <string.h>
+
+BOOL DVDCompareDiskID(DVDDiskID* id1, DVDDiskID* id2) {
+
+ if (id1->gameName[0] && id2->gameName[0] && strncmp(&id1->gameName[0], &id2->gameName[0], 4)) {
+ return FALSE;
+ }
+
+ if (!id1->company[0] || !id2->company[0] || strncmp(&id1->company[0], &id2->company[0], 2)) {
+ return FALSE;
+ }
+
+ if (id1->diskNumber != 0xff && id2->diskNumber != 0xff && id1->diskNumber != id2->diskNumber) {
+ return FALSE;
+ }
+
+ if (id1->gameVersion != 0xff && id2->gameVersion != 0xff &&
+ id1->gameVersion != id2->gameVersion) {
+ return FALSE;
+ }
+
+ return TRUE;
+}