Add dvdidutils.c

This commit is contained in:
Phillip Stephens 2022-10-21 22:09:14 -07:00
parent 1b5ee3bee8
commit c4e4352c4f
1 changed files with 27 additions and 0 deletions

View File

@ -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;
}