mirror of
https://github.com/libretro/pcsx2.git
synced 2024-11-28 20:00:44 +00:00
6ebfae8ef1
Added interface.cpp (plugin/pcsx2 interface) and savestate.cpp to SPU2ghz, to help clean up SPU2.cpp. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@463 96395faa-99c1-11dd-bbfe-3dabce05a288
42 lines
918 B
C
42 lines
918 B
C
|
|
#include <stdio.h>
|
|
#include "CDVDlib.h"
|
|
#include "CDVDiso.h"
|
|
#include "CDVDisodrv.h"
|
|
|
|
int CheckDiskType(int baseType){
|
|
int f;
|
|
char buffer[256];//if a file is longer...it should be shorter :D
|
|
char *pos;
|
|
static struct TocEntry tocEntry;
|
|
|
|
CDVDFS_init();
|
|
|
|
// check if the file exists
|
|
if (CDVD_findfile("SYSTEM.CNF;1", &tocEntry) != TRUE){
|
|
if (CDVD_findfile("VIDEO_TS/VIDEO_TS.IFO;1", &tocEntry) != TRUE)
|
|
if (CDVD_findfile("PSX.EXE;1", &tocEntry) != TRUE)
|
|
return CDVD_TYPE_ILLEGAL;
|
|
else
|
|
return CDVD_TYPE_PSCD;
|
|
else
|
|
return CDVD_TYPE_DVDV;
|
|
}
|
|
|
|
f=CDVDFS_open("SYSTEM.CNF;1", 1);
|
|
CDVDFS_read(f, buffer, 256);
|
|
CDVDFS_close(f);
|
|
|
|
buffer[tocEntry.fileSize]='\0';
|
|
|
|
pos=strstr(buffer, "BOOT2");
|
|
if (pos==NULL){
|
|
pos=strstr(buffer, "BOOT");
|
|
if (pos==NULL) {
|
|
return CDVD_TYPE_ILLEGAL;
|
|
}
|
|
return CDVD_TYPE_PSCD;
|
|
}
|
|
return (baseType==CDVD_TYPE_DETCTCD)?CDVD_TYPE_PS2CD:CDVD_TYPE_PS2DVD;
|
|
}
|