Remove direct zlib dependency in code (nw)

This commit is contained in:
Miodrag Milanovic 2015-09-13 12:27:46 +02:00
parent 954e900b78
commit 05c7edb199
15 changed files with 17 additions and 65 deletions

View File

@ -34,11 +34,6 @@ function devicesProject(_target, _subtarget)
MAME_DIR .. "3rdparty/expat/lib",
}
end
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
if _OPTIONS["with-bundled-lua"] then
includedirs {
MAME_DIR .. "3rdparty/lua/src",
@ -81,11 +76,6 @@ if (_OPTIONS["DRIVERS"] == nil) then
MAME_DIR .. "3rdparty/expat/lib",
}
end
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
if _OPTIONS["with-bundled-lua"] then
includedirs {
MAME_DIR .. "3rdparty/lua/src",
@ -119,11 +109,6 @@ end
MAME_DIR .. "3rdparty/expat/lib",
}
end
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
if _OPTIONS["with-bundled-lua"] then
includedirs {
MAME_DIR .. "3rdparty/lua/src",

View File

@ -24,11 +24,6 @@ if _OPTIONS["with-bundled-expat"] then
MAME_DIR .. "3rdparty/expat/lib",
}
end
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
if _OPTIONS["with-bundled-lua"] then
includedirs {
MAME_DIR .. "3rdparty/lua/src",

View File

@ -71,11 +71,6 @@ function createProjects_ldplayer_ldplayer(_target, _subtarget)
MAME_DIR .. "3rdparty",
GEN_DIR .. "mame/layout",
}
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
files{
MAME_DIR .. "src/emu/drivers/emudummy.c",

View File

@ -780,12 +780,6 @@ function createMAMEProjects(_target, _subtarget, _name)
MAME_DIR .. "3rdparty",
GEN_DIR .. "mame/layout",
}
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
end
function createProjects_mame_arcade(_target, _subtarget)

View File

@ -32,11 +32,6 @@ function createProjects_mame_dummy(_target, _subtarget)
MAME_DIR .. "3rdparty",
GEN_DIR .. "mess/layout",
}
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
files{
MAME_DIR .. "src/mess/drivers/coleco.c",

View File

@ -893,11 +893,6 @@ function createMESSProjects(_target, _subtarget, _name)
GEN_DIR .. "mame/layout",
MAME_DIR .. "src/devices/cpu/m68000",
}
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
end
function createProjects_mame_mess(_target, _subtarget)

View File

@ -101,12 +101,6 @@ function createProjects_mame_nl(_target, _subtarget)
GEN_DIR .. "mame/layout",
}
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
files{
MAME_DIR .. "src/mame/drivers/pong.c",
MAME_DIR .. "src/mame/drivers/nl_pong.c",

View File

@ -95,11 +95,6 @@ function createProjects_mame_tiny(_target, _subtarget)
MAME_DIR .. "3rdparty",
GEN_DIR .. "mame/layout",
}
if _OPTIONS["with-bundled-zlib"] then
includedirs {
MAME_DIR .. "3rdparty/zlib",
}
end
files{
MAME_DIR .. "src/mame/machine/ticket.c",

View File

@ -19,8 +19,8 @@
#include "debugger.h"
#include "uiinput.h"
#include "xmlfile.h"
#include "coreutil.h"
#include <ctype.h>
#include <zlib.h>
/***************************************************************************
@ -2746,7 +2746,7 @@ UINT32 device_debug::compute_opcode_crc32(offs_t pc) const
UINT32 numbytes = disassemble(diasmbuf, pc, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
// return a CRC of the exact count of opcode bytes
return crc32(0, opbuf, numbytes);
return core_crc32(0, opbuf, numbytes);
}

View File

@ -8,9 +8,7 @@
***************************************************************************/
#include "emu.h"
#include <zlib.h>
#include "coreutil.h"
/***************************************************************************
CONSTANTS
@ -82,7 +80,7 @@ static void output_exit(running_machine &machine);
INLINE UINT32 get_hash(const char *string)
{
return crc32(0, (UINT8 *)string, (UINT32)strlen(string));
return core_crc32(0, (UINT8 *)string, (UINT32)strlen(string));
}

View File

@ -12,7 +12,7 @@
#include "rendfont.h"
#include "rendutil.h"
#include "emuopts.h"
#include <zlib.h>
#include "coreutil.h"
#include "osdepend.h"
#include "uismall.fh"
@ -389,7 +389,7 @@ bool render_font::load_cached_bdf(const char *filename)
return false;
// has the chunk
UINT32 hash = crc32(0, (const UINT8 *)&m_rawdata[0], bytes) ^ (UINT32)m_rawsize;
UINT32 hash = core_crc32(0, (const UINT8 *)&m_rawdata[0], bytes) ^ (UINT32)m_rawsize;
// create the cached filename, changing the 'F' to a 'C' on the extension
std::string cachedname(filename);

View File

@ -23,8 +23,7 @@
***************************************************************************/
#include "emu.h"
#include <zlib.h>
#include "coreutil.h"
//**************************************************************************
@ -333,13 +332,13 @@ UINT32 save_manager::signature() const
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
{
// add the entry name to the CRC
crc = crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.length());
crc = core_crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.length());
// add the type and size to the CRC
UINT32 temp[2];
temp[0] = LITTLE_ENDIANIZE_INT32(entry->m_typecount);
temp[1] = LITTLE_ENDIANIZE_INT32(entry->m_typesize);
crc = crc32(crc, (UINT8 *)&temp[0], sizeof(temp));
crc = core_crc32(crc, (UINT8 *)&temp[0], sizeof(temp));
}
return crc;
}

View File

@ -9,6 +9,7 @@
***************************************************************************/
#include "coreutil.h"
#include <zlib.h>
/***************************************************************************
@ -115,3 +116,9 @@ void rand_memory(void *memory, size_t length)
bytes[i] = (UINT8) (seed >> 16);
}
}
UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len)
{
return crc32(crc, buf, len);
}

View File

@ -39,5 +39,6 @@ int gregorian_days_in_month(int month, int year);
void rand_memory(void *memory, size_t length);
UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len);
#endif /* __COREUTIL_H__ */

View File

@ -17,7 +17,6 @@
#include "imagedev/chd_cd.h"
#include "sound/spu.h"
#include "debugger.h"
#include <zlib.h>
#include "machine/psxcd.h"
#include "bus/psx/ctlrport.h"