From 5ded7872de6dde552ee4c755ed9a7b624c73c16c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 1 Jul 2020 19:41:24 +0200 Subject: [PATCH] (libretro-common/libchdr) Backport https://github.com/rtissera/libchdr/commit/2785de84819aceb976ef51f05baf9d770a859ae9 --- libretro-common/formats/libchdr/libchdr_chd.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libretro-common/formats/libchdr/libchdr_chd.c b/libretro-common/formats/libchdr/libchdr_chd.c index 33aad55455..8ad4f6837f 100644 --- a/libretro-common/formats/libchdr/libchdr_chd.c +++ b/libretro-common/formats/libchdr/libchdr_chd.c @@ -266,10 +266,11 @@ static chd_error metadata_find_entry(chd_file *chd, UINT32 metatag, UINT32 metai #define CHD_MAKE_TAG(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) +#define CHD_CODEC_ZLIB CHD_MAKE_TAG('z','l','i','b') /* general codecs with CD frontend */ -#define CHD_CODEC_CD_ZLIB CHD_MAKE_TAG('c','d','z','l') -#define CHD_CODEC_CD_LZMA CHD_MAKE_TAG('c','d','l','z') -#define CHD_CODEC_CD_FLAC CHD_MAKE_TAG('c','d','f','l') +#define CHD_CODEC_CD_ZLIB CHD_MAKE_TAG('c','d','z','l') +#define CHD_CODEC_CD_LZMA CHD_MAKE_TAG('c','d','l','z') +#define CHD_CODEC_CD_FLAC CHD_MAKE_TAG('c','d','f','l') static const codec_interface codec_interfaces[] = { @@ -307,6 +308,17 @@ static const codec_interface codec_interfaces[] = NULL }, + /* V5 zlib compression */ + { + CHD_CODEC_ZLIB, + "zlib (Deflate)", + FALSE, + zlib_codec_init, + zlib_codec_free, + zlib_codec_decompress, + NULL + }, + /* V5 CD zlib compression */ { CHD_CODEC_CD_ZLIB,