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

trunk/scripts/src/devices.lua
r249212r249213
3434         MAME_DIR .. "3rdparty/expat/lib",
3535      }
3636   end
37   if _OPTIONS["with-bundled-zlib"] then
38      includedirs {
39         MAME_DIR .. "3rdparty/zlib",
40      }
41   end
4237   if _OPTIONS["with-bundled-lua"] then
4338      includedirs {
4439         MAME_DIR .. "3rdparty/lua/src",
r249212r249213
8176         MAME_DIR .. "3rdparty/expat/lib",
8277      }
8378   end
84   if _OPTIONS["with-bundled-zlib"] then
85      includedirs {
86         MAME_DIR .. "3rdparty/zlib",
87      }
88   end
8979   if _OPTIONS["with-bundled-lua"] then
9080      includedirs {
9181         MAME_DIR .. "3rdparty/lua/src",
r249212r249213
119109         MAME_DIR .. "3rdparty/expat/lib",
120110      }
121111   end
122   if _OPTIONS["with-bundled-zlib"] then
123      includedirs {
124         MAME_DIR .. "3rdparty/zlib",
125      }
126   end
127112   if _OPTIONS["with-bundled-lua"] then
128113      includedirs {
129114         MAME_DIR .. "3rdparty/lua/src",
trunk/scripts/src/emu.lua
r249212r249213
2424      MAME_DIR .. "3rdparty/expat/lib",
2525   }
2626end
27if _OPTIONS["with-bundled-zlib"] then
28   includedirs {
29      MAME_DIR .. "3rdparty/zlib",
30   }
31end
3227if _OPTIONS["with-bundled-lua"] then
3328   includedirs {
3429      MAME_DIR .. "3rdparty/lua/src",
trunk/scripts/target/ldplayer/ldplayer.lua
r249212r249213
7171      MAME_DIR .. "3rdparty",
7272      GEN_DIR  .. "mame/layout",
7373   }
74   if _OPTIONS["with-bundled-zlib"] then
75      includedirs {
76         MAME_DIR .. "3rdparty/zlib",
77      }
78   end
7974
8075   files{
8176      MAME_DIR .. "src/emu/drivers/emudummy.c",
trunk/scripts/target/mame/arcade.lua
r249212r249213
780780      MAME_DIR .. "3rdparty",
781781      GEN_DIR  .. "mame/layout",
782782   }
783
784   if _OPTIONS["with-bundled-zlib"] then
785      includedirs {
786         MAME_DIR .. "3rdparty/zlib",
787      }
788783end
789end
790784
791785function createProjects_mame_arcade(_target, _subtarget)
792786--------------------------------------------------
trunk/scripts/target/mame/dummy.lua
r249212r249213
3232      MAME_DIR .. "3rdparty",
3333      GEN_DIR  .. "mess/layout",
3434   }
35   if _OPTIONS["with-bundled-zlib"] then
36      includedirs {
37         MAME_DIR .. "3rdparty/zlib",
38      }
39   end
4035
4136   files{
4237      MAME_DIR .. "src/mess/drivers/coleco.c",
trunk/scripts/target/mame/mess.lua
r249212r249213
893893      GEN_DIR  .. "mame/layout",
894894      MAME_DIR .. "src/devices/cpu/m68000",
895895   }
896   if _OPTIONS["with-bundled-zlib"] then
897      includedirs {
898         MAME_DIR .. "3rdparty/zlib",
899      }
900   end
901896end
902897
903898function createProjects_mame_mess(_target, _subtarget)
trunk/scripts/target/mame/nl.lua
r249212r249213
101101      GEN_DIR  .. "mame/layout",
102102   }
103103
104   if _OPTIONS["with-bundled-zlib"] then
105      includedirs {
106         MAME_DIR .. "3rdparty/zlib",
107      }
108   end
109
110104   files{
111105      MAME_DIR .. "src/mame/drivers/pong.c",
112106      MAME_DIR .. "src/mame/drivers/nl_pong.c",
trunk/scripts/target/mame/tiny.lua
r249212r249213
9595      MAME_DIR .. "3rdparty",
9696      GEN_DIR  .. "mame/layout",
9797   }
98   if _OPTIONS["with-bundled-zlib"] then
99      includedirs {
100         MAME_DIR .. "3rdparty/zlib",
101      }
102   end
10398
10499   files{
105100      MAME_DIR .. "src/mame/machine/ticket.c",
trunk/src/emu/debug/debugcpu.c
r249212r249213
1919#include "debugger.h"
2020#include "uiinput.h"
2121#include "xmlfile.h"
22#include "coreutil.h"
2223#include <ctype.h>
23#include <zlib.h>
2424
2525
2626/***************************************************************************
r249212r249213
27462746   UINT32 numbytes = disassemble(diasmbuf, pc, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
27472747
27482748   // return a CRC of the exact count of opcode bytes
2749   return crc32(0, opbuf, numbytes);
2749   return core_crc32(0, opbuf, numbytes);
27502750}
27512751
27522752
trunk/src/emu/output.c
r249212r249213
88***************************************************************************/
99
1010#include "emu.h"
11#include <zlib.h>
11#include "coreutil.h"
1212
13
14
1513/***************************************************************************
1614    CONSTANTS
1715***************************************************************************/
r249212r249213
8280
8381INLINE UINT32 get_hash(const char *string)
8482{
85   return crc32(0, (UINT8 *)string, (UINT32)strlen(string));
83   return core_crc32(0, (UINT8 *)string, (UINT32)strlen(string));
8684}
8785
8886
trunk/src/emu/rendfont.c
r249212r249213
1212#include "rendfont.h"
1313#include "rendutil.h"
1414#include "emuopts.h"
15#include <zlib.h>
15#include "coreutil.h"
1616
1717#include "osdepend.h"
1818#include "uismall.fh"
r249212r249213
389389      return false;
390390
391391   // 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;
393393
394394   // create the cached filename, changing the 'F' to a 'C' on the extension
395395   std::string cachedname(filename);
trunk/src/emu/save.c
r249212r249213
2323***************************************************************************/
2424
2525#include "emu.h"
26#include "coreutil.h"
2627
27#include <zlib.h>
2828
29
3029//**************************************************************************
3130//  DEBUGGING
3231//**************************************************************************
r249212r249213
333332   for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
334333   {
335334      // 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());
337336
338337      // add the type and size to the CRC
339338      UINT32 temp[2];
340339      temp[0] = LITTLE_ENDIANIZE_INT32(entry->m_typecount);
341340      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));
343342   }
344343   return crc;
345344}
trunk/src/lib/util/coreutil.c
r249212r249213
99***************************************************************************/
1010
1111#include "coreutil.h"
12#include <zlib.h>
1213
1314
1415/***************************************************************************
r249212r249213
115116      bytes[i] = (UINT8) (seed >> 16);
116117   }
117118}
119
120
121UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len)
122{
123   return crc32(crc, buf, len);
124}
No newline at end of file
trunk/src/lib/util/coreutil.h
r249212r249213
3939
4040void rand_memory(void *memory, size_t length);
4141
42UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len);
4243
4344#endif /* __COREUTIL_H__ */
trunk/src/mess/drivers/psx.c
r249212r249213
1717#include "imagedev/chd_cd.h"
1818#include "sound/spu.h"
1919#include "debugger.h"
20#include <zlib.h>
2120#include "machine/psxcd.h"
2221#include "bus/psx/ctlrport.h"
2322


Previous 199869 Revisions Next


© 1997-2024 The MAME Team