summaryrefslogtreecommitdiff
path: root/src/Dolphin/dvd/dvdidutils.c
blob: 3c58e98ded370ba06ffd1e21af298b43475696cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
}