| Previous | 199869 Revisions | Next |
| r40701 Sunday 13th September, 2015 at 10:27:46 UTC by Miodrag Milanović |
|---|
| Remove direct zlib dependency in code (nw) |
| [scripts/src] | devices.lua emu.lua |
| [scripts/target/ldplayer] | ldplayer.lua |
| [scripts/target/mame] | arcade.lua dummy.lua mess.lua nl.lua tiny.lua |
| [src/emu] | output.c rendfont.c save.c |
| [src/emu/debug] | debugcpu.c |
| [src/lib/util] | coreutil.c coreutil.h |
| [src/mess/drivers] | psx.c |
| r249212 | r249213 | |
|---|---|---|
| 34 | 34 | MAME_DIR .. "3rdparty/expat/lib", |
| 35 | 35 | } |
| 36 | 36 | end |
| 37 | if _OPTIONS["with-bundled-zlib"] then | |
| 38 | includedirs { | |
| 39 | MAME_DIR .. "3rdparty/zlib", | |
| 40 | } | |
| 41 | end | |
| 42 | 37 | if _OPTIONS["with-bundled-lua"] then |
| 43 | 38 | includedirs { |
| 44 | 39 | MAME_DIR .. "3rdparty/lua/src", |
| r249212 | r249213 | |
| 81 | 76 | MAME_DIR .. "3rdparty/expat/lib", |
| 82 | 77 | } |
| 83 | 78 | end |
| 84 | if _OPTIONS["with-bundled-zlib"] then | |
| 85 | includedirs { | |
| 86 | MAME_DIR .. "3rdparty/zlib", | |
| 87 | } | |
| 88 | end | |
| 89 | 79 | if _OPTIONS["with-bundled-lua"] then |
| 90 | 80 | includedirs { |
| 91 | 81 | MAME_DIR .. "3rdparty/lua/src", |
| r249212 | r249213 | |
| 119 | 109 | MAME_DIR .. "3rdparty/expat/lib", |
| 120 | 110 | } |
| 121 | 111 | end |
| 122 | if _OPTIONS["with-bundled-zlib"] then | |
| 123 | includedirs { | |
| 124 | MAME_DIR .. "3rdparty/zlib", | |
| 125 | } | |
| 126 | end | |
| 127 | 112 | if _OPTIONS["with-bundled-lua"] then |
| 128 | 113 | includedirs { |
| 129 | 114 | MAME_DIR .. "3rdparty/lua/src", |
| r249212 | r249213 | |
|---|---|---|
| 24 | 24 | MAME_DIR .. "3rdparty/expat/lib", |
| 25 | 25 | } |
| 26 | 26 | end |
| 27 | if _OPTIONS["with-bundled-zlib"] then | |
| 28 | includedirs { | |
| 29 | MAME_DIR .. "3rdparty/zlib", | |
| 30 | } | |
| 31 | end | |
| 32 | 27 | if _OPTIONS["with-bundled-lua"] then |
| 33 | 28 | includedirs { |
| 34 | 29 | MAME_DIR .. "3rdparty/lua/src", |
| r249212 | r249213 | |
|---|---|---|
| 71 | 71 | MAME_DIR .. "3rdparty", |
| 72 | 72 | GEN_DIR .. "mame/layout", |
| 73 | 73 | } |
| 74 | if _OPTIONS["with-bundled-zlib"] then | |
| 75 | includedirs { | |
| 76 | MAME_DIR .. "3rdparty/zlib", | |
| 77 | } | |
| 78 | end | |
| 79 | 74 | |
| 80 | 75 | files{ |
| 81 | 76 | MAME_DIR .. "src/emu/drivers/emudummy.c", |
| r249212 | r249213 | |
|---|---|---|
| 780 | 780 | MAME_DIR .. "3rdparty", |
| 781 | 781 | GEN_DIR .. "mame/layout", |
| 782 | 782 | } |
| 783 | ||
| 784 | if _OPTIONS["with-bundled-zlib"] then | |
| 785 | includedirs { | |
| 786 | MAME_DIR .. "3rdparty/zlib", | |
| 787 | } | |
| 788 | 783 | end |
| 789 | end | |
| 790 | 784 | |
| 791 | 785 | function createProjects_mame_arcade(_target, _subtarget) |
| 792 | 786 | -------------------------------------------------- |
| r249212 | r249213 | |
|---|---|---|
| 32 | 32 | MAME_DIR .. "3rdparty", |
| 33 | 33 | GEN_DIR .. "mess/layout", |
| 34 | 34 | } |
| 35 | if _OPTIONS["with-bundled-zlib"] then | |
| 36 | includedirs { | |
| 37 | MAME_DIR .. "3rdparty/zlib", | |
| 38 | } | |
| 39 | end | |
| 40 | 35 | |
| 41 | 36 | files{ |
| 42 | 37 | MAME_DIR .. "src/mess/drivers/coleco.c", |
| r249212 | r249213 | |
|---|---|---|
| 893 | 893 | GEN_DIR .. "mame/layout", |
| 894 | 894 | MAME_DIR .. "src/devices/cpu/m68000", |
| 895 | 895 | } |
| 896 | if _OPTIONS["with-bundled-zlib"] then | |
| 897 | includedirs { | |
| 898 | MAME_DIR .. "3rdparty/zlib", | |
| 899 | } | |
| 900 | end | |
| 901 | 896 | end |
| 902 | 897 | |
| 903 | 898 | function createProjects_mame_mess(_target, _subtarget) |
| r249212 | r249213 | |
|---|---|---|
| 101 | 101 | GEN_DIR .. "mame/layout", |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | if _OPTIONS["with-bundled-zlib"] then | |
| 105 | includedirs { | |
| 106 | MAME_DIR .. "3rdparty/zlib", | |
| 107 | } | |
| 108 | end | |
| 109 | ||
| 110 | 104 | files{ |
| 111 | 105 | MAME_DIR .. "src/mame/drivers/pong.c", |
| 112 | 106 | MAME_DIR .. "src/mame/drivers/nl_pong.c", |
| r249212 | r249213 | |
|---|---|---|
| 95 | 95 | MAME_DIR .. "3rdparty", |
| 96 | 96 | GEN_DIR .. "mame/layout", |
| 97 | 97 | } |
| 98 | if _OPTIONS["with-bundled-zlib"] then | |
| 99 | includedirs { | |
| 100 | MAME_DIR .. "3rdparty/zlib", | |
| 101 | } | |
| 102 | end | |
| 103 | 98 | |
| 104 | 99 | files{ |
| 105 | 100 | MAME_DIR .. "src/mame/machine/ticket.c", |
| r249212 | r249213 | |
|---|---|---|
| 19 | 19 | #include "debugger.h" |
| 20 | 20 | #include "uiinput.h" |
| 21 | 21 | #include "xmlfile.h" |
| 22 | #include "coreutil.h" | |
| 22 | 23 | #include <ctype.h> |
| 23 | #include <zlib.h> | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | /*************************************************************************** |
| r249212 | r249213 | |
| 2746 | 2746 | UINT32 numbytes = disassemble(diasmbuf, pc, opbuf, argbuf) & DASMFLAG_LENGTHMASK; |
| 2747 | 2747 | |
| 2748 | 2748 | // return a CRC of the exact count of opcode bytes |
| 2749 | return crc32(0, opbuf, numbytes); | |
| 2749 | return core_crc32(0, opbuf, numbytes); | |
| 2750 | 2750 | } |
| 2751 | 2751 | |
| 2752 | 2752 |
| r249212 | r249213 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | #include | |
| 11 | #include "coreutil.h" | |
| 12 | 12 | |
| 13 | ||
| 14 | ||
| 15 | 13 | /*************************************************************************** |
| 16 | 14 | CONSTANTS |
| 17 | 15 | ***************************************************************************/ |
| r249212 | r249213 | |
| 82 | 80 | |
| 83 | 81 | INLINE UINT32 get_hash(const char *string) |
| 84 | 82 | { |
| 85 | return crc32(0, (UINT8 *)string, (UINT32)strlen(string)); | |
| 83 | return core_crc32(0, (UINT8 *)string, (UINT32)strlen(string)); | |
| 86 | 84 | } |
| 87 | 85 | |
| 88 | 86 |
| r249212 | r249213 | |
|---|---|---|
| 12 | 12 | #include "rendfont.h" |
| 13 | 13 | #include "rendutil.h" |
| 14 | 14 | #include "emuopts.h" |
| 15 | #include | |
| 15 | #include "coreutil.h" | |
| 16 | 16 | |
| 17 | 17 | #include "osdepend.h" |
| 18 | 18 | #include "uismall.fh" |
| r249212 | r249213 | |
| 389 | 389 | return false; |
| 390 | 390 | |
| 391 | 391 | // has the chunk |
| 392 | UINT32 hash = crc32(0, (const UINT8 *)&m_rawdata[0], bytes) ^ (UINT32)m_rawsize; | |
| 392 | UINT32 hash = core_crc32(0, (const UINT8 *)&m_rawdata[0], bytes) ^ (UINT32)m_rawsize; | |
| 393 | 393 | |
| 394 | 394 | // create the cached filename, changing the 'F' to a 'C' on the extension |
| 395 | 395 | std::string cachedname(filename); |
| r249212 | r249213 | |
|---|---|---|
| 23 | 23 | ***************************************************************************/ |
| 24 | 24 | |
| 25 | 25 | #include "emu.h" |
| 26 | #include "coreutil.h" | |
| 26 | 27 | |
| 27 | #include <zlib.h> | |
| 28 | 28 | |
| 29 | ||
| 30 | 29 | //************************************************************************** |
| 31 | 30 | // DEBUGGING |
| 32 | 31 | //************************************************************************** |
| r249212 | r249213 | |
| 333 | 332 | for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next()) |
| 334 | 333 | { |
| 335 | 334 | // add the entry name to the CRC |
| 336 | crc = crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.length()); | |
| 335 | crc = core_crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.length()); | |
| 337 | 336 | |
| 338 | 337 | // add the type and size to the CRC |
| 339 | 338 | UINT32 temp[2]; |
| 340 | 339 | temp[0] = LITTLE_ENDIANIZE_INT32(entry->m_typecount); |
| 341 | 340 | temp[1] = LITTLE_ENDIANIZE_INT32(entry->m_typesize); |
| 342 | crc = crc32(crc, (UINT8 *)&temp[0], sizeof(temp)); | |
| 341 | crc = core_crc32(crc, (UINT8 *)&temp[0], sizeof(temp)); | |
| 343 | 342 | } |
| 344 | 343 | return crc; |
| 345 | 344 | } |
| r249212 | r249213 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "coreutil.h" |
| 12 | #include <zlib.h> | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | /*************************************************************************** |
| r249212 | r249213 | |
| 115 | 116 | bytes[i] = (UINT8) (seed >> 16); |
| 116 | 117 | } |
| 117 | 118 | } |
| 119 | ||
| 120 | ||
| 121 | UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len) | |
| 122 | { | |
| 123 | return crc32(crc, buf, len); | |
| 124 | } | |
| No newline at end of file |
| r249212 | r249213 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | void rand_memory(void *memory, size_t length); |
| 41 | 41 | |
| 42 | UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len); | |
| 42 | 43 | |
| 43 | 44 | #endif /* __COREUTIL_H__ */ |
| r249212 | r249213 | |
|---|---|---|
| 17 | 17 | #include "imagedev/chd_cd.h" |
| 18 | 18 | #include "sound/spu.h" |
| 19 | 19 | #include "debugger.h" |
| 20 | #include <zlib.h> | |
| 21 | 20 | #include "machine/psxcd.h" |
| 22 | 21 | #include "bus/psx/ctlrport.h" |
| 23 | 22 |
| https://github.com/mamedev/mame/commit/05c7edb1996be46465f3cb6e56d545776053528b |
| Previous | 199869 Revisions | Next |