From: kub Date: Tue, 9 Mar 2021 22:00:49 +0000 (+0100) Subject: core, chd support X-Git-Tag: v2.00~590 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d1e25231360b0223aa02fa3ecd537af362c720b;p=picodrive.git core, chd support --- diff --git a/.gitmodules b/.gitmodules index 1c07eb7d..23cc3b36 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ url = https://github.com/digital-sound-antiques/emu2413.git [submodule "pico/cd/libchdr"] path = pico/cd/libchdr - url = https://github.com/rtissera/libchdr + url = https://github.com/irixxxx/libchdr-picodrive.git [submodule "platform/common/minimp3"] path = platform/common/minimp3 url = https://github.com/lieff/minimp3 diff --git a/Makefile b/Makefile index 87257926..08f7ee4f 100644 --- a/Makefile +++ b/Makefile @@ -239,7 +239,7 @@ endif ifeq (1,$(use_libchdr)) # yuck, cmake looks like a nightmare to embed in a multi-platform make env :-/ -# Moreover, static library linking isn't working. +# Moreover, libchdr uses -flto which apparently prevents static library linking. # Reference all source files directly and hope for the best. Tested on linux, # might not work on other platforms, and misses autodetected optimizations. CFLAGS += -DUSE_LIBCHDR @@ -249,6 +249,7 @@ CHDR = pico/cd/libchdr CHDR_OBJS += $(CHDR)/src/libchdr_chd.o $(CHDR)/src/libchdr_cdrom.o CHDR_OBJS += $(CHDR)/src/libchdr_flac.o CHDR_OBJS += $(CHDR)/src/libchdr_bitstream.o $(CHDR)/src/libchdr_huffman.o +$(CHDR_OBJS): CFLAGS += -DHAVE_FSEEKO # flac FLAC = $(CHDR)/deps/flac-1.3.3 @@ -258,7 +259,7 @@ FLAC_OBJS += $(FLAC)/src/bitmath.o $(FLAC)/src/bitreader.o $(FLAC)/src/md5.o FLAC_OBJS += $(FLAC)/src/memory.o $(FLAC)/src/fixed.o $(FLAC)/src/crc.o FLAC_OBJS += $(FLAC)/src/window.o $(FLAC)/src/stream_decoder.o $(FLAC_OBJS): CFLAGS += -DPACKAGE_VERSION=\"1.3.3\" -DFLAC__HAS_OGG=0 -$(FLAC_OBJS): CFLAGS += -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H # ugh... +$(FLAC_OBJS): CFLAGS += -DHAVE_FSEEKO -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H # ugh... # lzma LZMA = $(CHDR)/deps/lzma-19.00 @@ -268,8 +269,9 @@ LZMA_OBJS += $(LZMA)/src/Delta.o $(LZMA_OBJS): CFLAGS += -D_7ZIP_ST OBJS += $(CHDR_OBJS) $(FLAC_OBJS) $(LZMA_OBJS) +# ouf... prepend includes to overload headers available in the toolchain CHDR_I = $(shell find $(CHDR) -name 'include') -CFLAGS += $(patsubst %, -I%, $(CHDR_I)) # tsk... +CFLAGS := $(patsubst %, -I%, $(CHDR_I)) $(CFLAGS) endif ifeq "$(PLATFORM_ZLIB)" "1" diff --git a/pico/cd/libchdr b/pico/cd/libchdr index cecbe84e..208212ae 160000 --- a/pico/cd/libchdr +++ b/pico/cd/libchdr @@ -1 +1 @@ -Subproject commit cecbe84eb7ee1b0e5e558d15c2882a9d9be37794 +Subproject commit 208212ae77f5c4fedca11d797e50cb1954b2c837 diff --git a/platform/psp/plat.c b/platform/psp/plat.c index b1e7c612..e8a90694 100644 --- a/platform/psp/plat.c +++ b/platform/psp/plat.c @@ -331,9 +331,5 @@ int _flush_cache (char *addr, const int size, const int op) int chown(const char *pathname, uid_t owner, gid_t group) { return -1; } int chmod(const char *pathname, mode_t mode) { return -1; } int utime(const char *filename, const struct utimbuf *times) { return -1; } -int fseeko64(FILE *stream, _off64_t offset, int whence) - { return fseeko(stream, offset, whence); } -_off64_t ftello64(FILE *stream) - { return ftello(stream); } int posix_memalign(void **memptr, size_t alignment, size_t size) { *memptr = memalign(alignment, size); return 0; }