- all platforms compiles with CHD support.
- compile with HAVE_CHD=0 for no chd support.
- CHD fails building for 3DS, not sure its even fast enough for the device. I tried asking in discord channel but haven't got reply. Disabling it till someone familiar with 3ds can fix it.
http://p.0bl.net/123458
OBJS += plugins/cdrcimg/cdrcimg.o
# libchdr
OBJS += plugins/cdrcimg/cdrcimg.o
# libchdr
CFLAGS += -Ideps/libchdr
OBJS += deps/crypto/md5.o
OBJS += deps/crypto/sha1.o
CFLAGS += -Ideps/libchdr
OBJS += deps/crypto/md5.o
OBJS += deps/crypto/sha1.o
endif
CFLAGS += -Ideps/crypto -Ideps/flac-1.3.2/include -Ideps/flac-1.3.2/src/libFLAC/include -Ideps/flac-1.3.2/src/libFLAC/include -Ideps/lzma-16.04/C
endif
CFLAGS += -Ideps/crypto -Ideps/flac-1.3.2/include -Ideps/flac-1.3.2/src/libFLAC/include -Ideps/flac-1.3.2/src/libFLAC/include -Ideps/lzma-16.04/C
-CFLAGS += -D'PACKAGE_VERSION="1.3.2"' -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DFLAC__NO_DLL -D_7ZIP_ST
+CFLAGS += -DHAVE_CHD -D'PACKAGE_VERSION="1.3.2"' -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DFLAC__NO_DLL -D_7ZIP_ST
# dfinput
OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
# dfinput
OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o
DEBUG ?= 0
WANT_ZLIB ?= 1
DEBUG ?= 0
WANT_ZLIB ?= 1
ifeq ($(platform),)
platform = unix
ifeq ($(platform),)
platform = unix
DRC_CACHE_BASE = 0
ARCH = arm
HAVE_NEON = 0
DRC_CACHE_BASE = 0
ARCH = arm
HAVE_NEON = 0
STATIC_LINKING = 1
# Xbox 360
STATIC_LINKING = 1
# Xbox 360
#include <errno.h>
#include <zlib.h>
#include <errno.h>
#include <zlib.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
unsigned int sector_in_blk;
} *compr_img;
unsigned int sector_in_blk;
} *compr_img;
static struct {
unsigned char (*buffer)[CD_FRAMESIZE_RAW + SUB_FRAMESIZE];
chd_file* chd;
static struct {
unsigned char (*buffer)[CD_FRAMESIZE_RAW + SUB_FRAMESIZE];
chd_file* chd;
unsigned int current_hunk;
unsigned int sector_in_hunk;
} *chd_img;
unsigned int current_hunk;
unsigned int sector_in_hunk;
} *chd_img;
int (*cdimg_read_func)(FILE *f, unsigned int base, void *dest, int sector);
int (*cdimg_read_func)(FILE *f, unsigned int base, void *dest, int sector);
static int handlechd(const char *isofile) {
chd_img = calloc(1, sizeof(*chd_img));
if (chd_img == NULL)
static int handlechd(const char *isofile) {
chd_img = calloc(1, sizeof(*chd_img));
if (chd_img == NULL)
// this function tries to get the .sub file of the given .img
static int opensubfile(const char *isoname) {
// this function tries to get the .sub file of the given .img
static int opensubfile(const char *isoname) {
return CD_FRAMESIZE_RAW;
}
return CD_FRAMESIZE_RAW;
}
static int cdread_chd(FILE *f, unsigned int base, void *dest, int sector)
{
int hunk;
static int cdread_chd(FILE *f, unsigned int base, void *dest, int sector)
{
int hunk;
CD_FRAMESIZE_RAW);
return CD_FRAMESIZE_RAW;
}
CD_FRAMESIZE_RAW);
return CD_FRAMESIZE_RAW;
}
static int cdread_2048(FILE *f, unsigned int base, void *dest, int sector)
{
int ret;
static int cdread_2048(FILE *f, unsigned int base, void *dest, int sector)
{
int ret;
return compr_img->buff_raw[compr_img->sector_in_blk] + 12;
}
return compr_img->buff_raw[compr_img->sector_in_blk] + 12;
}
static unsigned char * CALLBACK ISOgetBuffer_chd(void) {
return chd_img->buffer[chd_img->sector_in_hunk] + 12;
}
static unsigned char * CALLBACK ISOgetBuffer_chd(void) {
return chd_img->buffer[chd_img->sector_in_hunk] + 12;
}
static unsigned char * CALLBACK ISOgetBuffer(void) {
return cdbuffer + 12;
static unsigned char * CALLBACK ISOgetBuffer(void) {
return cdbuffer + 12;
CDR_getBuffer = ISOgetBuffer_compr;
cdimg_read_func = cdread_compressed;
}
CDR_getBuffer = ISOgetBuffer_compr;
cdimg_read_func = cdread_compressed;
}
else if (handlechd(GetIsoFile()) == 0) {
SysPrintf("[chd]");
CDR_getBuffer = ISOgetBuffer_chd;
cdimg_read_func = cdread_chd;
}
else if (handlechd(GetIsoFile()) == 0) {
SysPrintf("[chd]");
CDR_getBuffer = ISOgetBuffer_chd;
cdimg_read_func = cdread_chd;
}
if (!subChanMixed && opensubfile(GetIsoFile()) == 0) {
SysPrintf("[+sub]");
if (!subChanMixed && opensubfile(GetIsoFile()) == 0) {
SysPrintf("[+sub]");
if (chd_img != NULL) {
chd_close(chd_img->chd);
free(chd_img->buffer);
free(chd_img);
chd_img = NULL;
}
if (chd_img != NULL) {
chd_close(chd_img->chd);
free(chd_img->buffer);
free(chd_img);
chd_img = NULL;
}
for (i = 1; i <= numtracks; i++) {
if (ti[i].handle != NULL) {
for (i = 1; i <= numtracks; i++) {
if (ti[i].handle != NULL) {