Advertisement
Guest User

Untitled

a guest
Aug 24th, 2010
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 13.69 KB | None | 0 0
  1. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/Changelog z80ex/Changelog
  2. --- z80ex-1.1.18/Changelog  2009-09-12 15:01:52.000000000 +0300
  3. +++ z80ex/Changelog 2010-08-21 04:56:11.249178060 +0300
  4. @@ -1,3 +1,7 @@
  5. +20.08.2010 - 1.1.18-mm
  6. +- switched to cmake
  7. +- made compilation with MSVC possible
  8. +
  9.  12.09.2009 - 1.1.18
  10.  - HALT/NMI bugfix (by Kalvis)
  11.  - some code were optimized for speed (by Mastermind)
  12. @@ -62,4 +66,4 @@
  13.  11.02.2006
  14.  - minor API changes
  15.  
  16. -10.02.2006 - release 0.1
  17. \ No newline at end of file
  18. +10.02.2006 - release 0.1
  19. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/CMakeLists.txt z80ex/CMakeLists.txt
  20. --- z80ex-1.1.18/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
  21. +++ z80ex/CMakeLists.txt    2010-08-21 03:33:01.215421486 +0300
  22. @@ -0,0 +1,70 @@
  23. +cmake_minimum_required (VERSION 2.8)
  24. +project (z80ex)
  25. +
  26. +set (API_REVISION 1)
  27. +set (VERSION_MAJOR 1)
  28. +set (VERSION_MINOR 18)
  29. +set (RELEASE_TYPE "")
  30. +set (VERSION_STR "${API_REVISION}.${VERSION_MAJOR}.${VERSION_MINOR}${RELEASE_TYPE}")
  31. +
  32. +option (OPSTEP_FAST_AND_ROUGH "Fast and rough opcode step emulation mode" Off)
  33. +
  34. +#ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
  35. +if (CMAKE_COMPILER_IS_GNUCC)
  36. +    set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
  37. +endif ()
  38. +
  39. +include_directories(BEFORE . include)
  40. +
  41. +include (TestBigEndian)
  42. +test_big_endian(BIG_ENDIAN)
  43. +#endianness (one of: WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN)
  44. +if (BIG_ENDIAN)
  45. +    set (ENDIANNESS WORDS_BIG_ENDIAN)
  46. +else ()
  47. +    set (ENDIANNESS WORDS_LITTLE_ENDIAN)
  48. +endif ()
  49. +
  50. +add_definitions (-D${ENDIANNESS} -DZ80EX_VERSION_STR=${VERSION_STR} -DZ80EX_API_REVISION=${API_REVISION} -DZ80EX_VERSION_MAJOR=${VERSION_MAJOR} -DZ80EX_VERSION_MINOR=${VERSION_MINOR} -DZ80EX_RELEASE_TYPE=${RELEASE_TYPE})
  51. +
  52. +if (OPSTEP_FAST_AND_ROUGH)
  53. +    add_definitions (-DZ80EX_OPSTEP_FAST_AND_ROUGH)
  54. +endif ()
  55. +
  56. +set (z80ex_sources z80ex.c)
  57. +add_library (z80ex-static STATIC ${z80ex_sources})
  58. +set_target_properties (z80ex-static PROPERTIES OUTPUT_NAME z80ex)
  59. +if (NOT DEFINED Z80EX_STATIC_ONLY)
  60. +    add_library (z80ex SHARED ${z80ex_sources})
  61. +# Affects Win32 only: avoid dynamic/static *.lib files naming conflict
  62. +    set_target_properties (z80ex-static PROPERTIES PREFIX "lib")
  63. +endif ()
  64. +
  65. +set (z80ex_dasm_sources z80ex_dasm.c)
  66. +add_library (z80ex_dasm-static STATIC ${z80ex_dasm_sources})
  67. +set_target_properties (z80ex_dasm-static PROPERTIES OUTPUT_NAME z80ex_dasm)
  68. +if (NOT DEFINED Z80EX_STATIC_ONLY)
  69. +    add_library (z80ex_dasm SHARED ${z80ex_dasm_sources})
  70. +# Affects Win32 only: avoid dynamic/static *.lib files naming conflict
  71. +    set_target_properties (z80ex_dasm-static PROPERTIES PREFIX "lib")
  72. +endif ()
  73. +
  74. +if (NOT DEFINED Z80EX_STATIC_ONLY)
  75. +    set_target_properties(z80ex z80ex_dasm
  76. +        PROPERTIES VERSION ${VERSION_STR} SOVERSION ${API_REVISION}
  77. +    )
  78. +endif ()
  79. +set_target_properties(z80ex-static z80ex_dasm-static
  80. +    PROPERTIES VERSION ${VERSION_STR} SOVERSION ${API_REVISION}
  81. +)
  82. +
  83. +if ("${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}" MATCHES "lib64")
  84. +    set (LIB_DIR "lib64")
  85. +else ()
  86. +    set (LIB_DIR "lib")
  87. +endif ()
  88. +if (NOT DEFINED Z80EX_STATIC_ONLY)
  89. +    install (TARGETS z80ex z80ex_dasm LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION ${LIB_DIR})
  90. +endif ()
  91. +install (TARGETS z80ex-static z80ex_dasm-static LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION ${LIB_DIR})
  92. +install (DIRECTORY include/ DESTINATION include/z80ex PATTERN "*.h" )
  93. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/include/z80ex.h z80ex/include/z80ex.h
  94. --- z80ex-1.1.18/include/z80ex.h    2009-09-12 17:14:40.000000000 +0300
  95. +++ z80ex/include/z80ex.h   2009-10-31 15:00:53.000000000 +0200
  96. @@ -13,7 +13,7 @@
  97.  #include "z80ex_common.h"
  98.  
  99.  typedef
  100. -enum {regAF,regBC,regDE,regHL,regAF_,regBC_,regDE_,regHL_,regIX,regIY,regPC,regSP,regI,regR,regR7,regIM/*0,1 ЙМЙ 2*/,regIFF1,regIFF2}
  101. +enum {regAF,regBC,regDE,regHL,regAF_,regBC_,regDE_,regHL_,regIX,regIY,regPC,regSP,regI,regR,regR7,regIM/*0,1 or 2*/,regIFF1,regIFF2}
  102.  Z80_REG_T;
  103.  
  104.  typedef struct {
  105. Binary files z80ex-1.1.18/lib/libz80ex.a and z80ex/lib/libz80ex.a differ
  106. Binary files z80ex-1.1.18/lib/libz80ex_dasm.a and z80ex/lib/libz80ex_dasm.a differ
  107. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/macros.h z80ex/macros.h
  108. --- z80ex-1.1.18/macros.h   2009-09-12 17:16:05.000000000 +0300
  109. +++ z80ex/macros.h  2010-08-21 03:33:01.216421685 +0300
  110. @@ -116,7 +116,7 @@
  111.  for using outside of certain opcode execution)*/
  112.  #define TSTATES(amount) \
  113.  {\
  114. -   int nn;\
  115. +   unsigned nn;\
  116.     if(cpu->tstate_cb == NULL) { \
  117.         cpu->tstate += amount; \
  118.     } \
  119. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/Makefile z80ex/Makefile
  120. --- z80ex-1.1.18/Makefile   2009-07-26 00:11:47.000000000 +0300
  121. +++ z80ex/Makefile  1970-01-01 02:00:00.000000000 +0200
  122. @@ -1,96 +0,0 @@
  123. -# Z80ex Makefile
  124. -# (for GNU make)
  125. -#
  126. -
  127. -#################################################################
  128. -# You may tune these values to feet your setup:
  129. -#################################################################
  130. -INSTALL_PREFIX := /usr/local
  131. -CC := gcc
  132. -ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
  133. -LINKER := gcc
  134. -
  135. -#endianness (one of: WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN)
  136. -ENDIANNESS := WORDS_LITTLE_ENDIAN
  137. -#ENDIANNESS := WORDS_BIG_ENDIAN
  138. -
  139. -#fast and rough opcode step emulation mode (0 - off, 1 - on)
  140. -OPSTEP_FAST_AND_ROUGH := 0
  141. -
  142. -
  143. -#################################################################
  144. -# Do not change these writings. the world sanity depends on them:
  145. -#################################################################
  146. -PROJ := z80ex
  147. -EMU := libz80ex
  148. -DASM := libz80ex_dasm
  149. -API_REVISION := 1
  150. -VERSION_MAJOR:=1
  151. -VERSION_MINOR:=18
  152. -RELEASE_TYPE :=
  153. -VERSION_STR:= ${API_REVISION}.${VERSION_MAJOR}.${VERSION_MINOR}${RELEASE_TYPE}
  154. -
  155. -OS=${shell uname -s}
  156. -
  157. -ALL_CFLAGS += -D${ENDIANNESS} -DZ80EX_VERSION_STR=${VERSION_STR} -DZ80EX_API_REVISION=${API_REVISION} -DZ80EX_VERSION_MAJOR=${VERSION_MAJOR} -DZ80EX_VERSION_MINOR=${VERSION_MINOR} -DZ80EX_RELEASE_TYPE=${RELEASE_TYPE}
  158. -
  159. -ifneq (${OPSTEP_FAST_AND_ROUGH},0)
  160. -ALL_CFLAGS += -DZ80EX_OPSTEP_FAST_AND_ROUGH
  161. -endif
  162. -
  163. -c_files := z80ex.c z80ex_dasm.c
  164. -
  165. -%.o : %.c
  166. -   ${CC} ${ALL_CFLAGS} ${CFLAGS} -c -o $@ $<  
  167. -
  168. -.PHONY : all
  169. -all:: static shared
  170. -
  171. -z80ex.o: include/z80ex.h include/z80ex_common.h ptables.c typedefs.h macros.h opcodes/opcodes_base.c\
  172. -opcodes/opcodes_dd.c opcodes/opcodes_fd.c opcodes/opcodes_cb.c\
  173. -opcodes/opcodes_ed.c opcodes/opcodes_ddcb.c opcodes/opcodes_fdcb.c
  174. -
  175. -z80ex_dasm.o: include/z80ex_dasm.h include/z80ex_common.h opcodes/opcodes_dasm.c
  176. -
  177. -clean:
  178. -   rm -f *.o
  179. -   rm -f ./lib/*
  180. -   rm -rf ./z80ex-${VERSION_STR}.tar.gz
  181. -
  182. -static: z80ex.o z80ex_dasm.o
  183. -   ar rs ./lib/${EMU}.a z80ex.o
  184. -   ar rs ./lib/${DASM}.a z80ex_dasm.o
  185. -  
  186. -shared: z80ex.o z80ex_dasm.o
  187. -ifeq (${OS},Darwin)
  188. -   ${LINKER} -dynamiclib -compatibility_version ${API_REVISION} -current_version ${VERSION_STR} -install_name ${INSTALL_PREFIX}/lib/${EMU}.${API_REVISION}.dylib -o ./lib/${EMU}.${VERSION_STR}.dylib z80ex.o
  189. -   ${LINKER} -dynamiclib -compatibility_version ${API_REVISION} -current_version ${VERSION_STR} -install_name ${INSTALL_PREFIX}/lib/${DASM}.${API_REVISION}.dylib -o ./lib/${DASM}.${VERSION_STR}.dylib z80ex_dasm.o
  190. -else
  191. -   ${LINKER} -shared -Wl,-soname,${EMU}.so.${API_REVISION} -o ./lib/${EMU}.so.${VERSION_STR} z80ex.o
  192. -   ${LINKER} -shared -Wl,-soname,${DASM}.so.${API_REVISION} -o ./lib/${DASM}.so.${VERSION_STR} z80ex_dasm.o   
  193. -endif
  194. -  
  195. -install:
  196. -   install -d ${INSTALL_PREFIX}/lib
  197. -   install ./lib/* ${INSTALL_PREFIX}/lib
  198. -   install -d ${INSTALL_PREFIX}/include/z80ex
  199. -   install -m 0664 ./include/* ${INSTALL_PREFIX}/include/z80ex
  200. -ifeq (${OS},Darwin)
  201. -   ln -sf ${EMU}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${EMU}.${API_REVISION}.dylib
  202. -   ln -sf ${EMU}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${EMU}.dylib
  203. -   ln -sf ${DASM}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${DASM}.${API_REVISION}.dylib
  204. -   ln -sf ${DASM}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${DASM}.dylib
  205. -else
  206. -   ln -sf ${EMU}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${EMU}.so.${API_REVISION}
  207. -   ln -sf ${EMU}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${EMU}.so
  208. -   ln -sf ${DASM}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${DASM}.so.${API_REVISION}
  209. -   ln -sf ${DASM}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${DASM}.so      
  210. -endif 
  211. -
  212. -dist: clean
  213. -   rm -rf ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}
  214. -   ln -s ./ ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}
  215. -   tar --exclude z80ex.geany --exclude obsolete --exclude ${PROJ}-${VERSION_STR}${RELEASE_TYPE}/${PROJ}-${VERSION_STR}${RELEASE_TYPE} --exclude ${PROJ}-${VERSION_STR}${RELEASE_TYPE}/${PROJ}-${VERSION_STR}${RELEASE_TYPE}.tar.gz -hcf - ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}/ | gzip -f9 > ${PROJ}-${VERSION_STR}${RELEASE_TYPE}.tar.gz
  216. -   rm -rf ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}
  217. -
  218. -#EOF
  219. \ No newline at end of file
  220. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/README z80ex/README
  221. --- z80ex-1.1.18/README 2009-09-12 17:26:12.000000000 +0300
  222. +++ z80ex/README    2010-08-21 05:46:23.842420491 +0300
  223. @@ -14,19 +14,39 @@
  224.  - builds as a library with simple callback-based API
  225.  - disassembler included  
  226.  
  227. -Building (only GNU toolset is supported out of the box):
  228. +Building:
  229.  --------------------------------------------------------
  230.  
  231. -for build using GNU C (GCC,mingw,cygwin,DJGPP),
  232. -issue 'gmake'. static and shared libraries will appear in "./lib".
  233. -alternatively you may do "gmake static" for building static library only
  234. -(use that with DJGPP 'coz it doesn't support shared libs),
  235. -or "gmake shared" for building shared library only.
  236. -
  237. -you may override some build parameters by editing the Makefile, or by
  238. -giving command line arguments to gmake, e.g. "gmake parameter=value"
  239. -these are:
  240. -* ENDIANNESS -- CPU endianness, one of WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN
  241. +If you only want to use this library as a part of an emulator or other
  242. +project and link it statically and your project uses CMake (recommended)
  243. +then skip this section and go directly to "Usage".
  244. +
  245. +CMake (http://www.cmake.org/) is required to build the library.
  246. +If you use a popular Linux distribuion chances are that you already have
  247. +it if not installed than in the stock repository.
  248. +Out-of-source-tree building is recommended.
  249. +
  250. +To build on Unix and Unix-like environments (GCC,mingw,cygwin,DJGPP):
  251. +    mkdir build
  252. +    cd build
  253. +    cmake ..
  254. +To build everything (static and shared z80ex and z80ex_dasm libraries):
  255. +    gmake
  256. +To build only specific libraries and flavors:
  257. +    gmake z80ex (shared z80ex)
  258. +    gmake z80ex-static (static z80ex)
  259. +    gmake z80ex_dasm (shared dasm)
  260. +    gmake z80ex_dasm-static (static z80ex_dasm)
  261. +
  262. +To build using MSVC (Visual Studio):
  263. +    - create a folder inside the source tree (e.g. "build")
  264. +    - start cmd.exe and go to the created folder and issue:
  265. +        cmake ..
  266. +    - double-click z80ex.sln to open it in Visual Studio
  267. +    - build ALL_BUILD or only necessary target(s) in Visual Studio
  268. +    (choose Release/Debug configuration as required)
  269. +
  270. +You may override some build parameters by using ccmake or cmake-gui or other means CMake provides (see CMake documentation and relevant man pages):
  271.  * OPSTEP_FAST_AND_ROUGH -- fast and rough opcode step emulation mode (0 - off, 1 - on)
  272.     when this mode is on, timings of internal I/O operations are ignored,
  273.     and tstate callback feature is disabled
  274. @@ -36,7 +56,8 @@
  275.  --------------------------
  276.  
  277.  issue "gmake install" as superuser.
  278. -(default install prefix is /usr/local, which may be changed in Makefile.)
  279. +(default install prefix is /usr/local, which may be changed using ccmake or
  280. +cmake-gui)
  281.  then do "/sbin/ldconfig" as superuser to update DSO links and cache
  282.  
  283.  
  284. @@ -58,6 +79,18 @@
  285.  for API documentation see "z80ex_dasm.h".
  286.  also look at the "dasm.c" from the "examples" directory
  287.  
  288. +If your project uses CMake here is an example (copy these lines into your
  289. +project's CMakeLists.txt):
  290. +
  291. +    set (Z80EX_PATH "${PROJECT_SOURCE_DIR}/../z80ex"
  292. +             CACHE PATH "Path to Z80Ex library")
  293. +    include_directories("${Z80EX_PATH}/include")
  294. +    set (Z80EX_BINARY_DIR "${PROJECT_BINARY_DIR}/lib_z80ex")
  295. +    make_directory (${Z80EX_BINARY_DIR})
  296. +    set (Z80EX_STATIC_ONLY true)
  297. +    add_subdirectory (${Z80EX_PATH} ${Z80EX_BINARY_DIR})
  298. +    link_directories (${Z80EX_BINARY_DIR})
  299. +    target_link_libraries (my_cool_emulator_exexutable z80ex-static z80ex_dasm-static)
  300.  
  301.  _____________________
  302.  yours, Boo-boo
  303. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/z80ex.c z80ex/z80ex.c
  304. --- z80ex-1.1.18/z80ex.c    2009-09-12 17:22:53.000000000 +0300
  305. +++ z80ex/z80ex.c   2010-08-21 03:33:01.217421186 +0300
  306. @@ -30,8 +30,7 @@
  307.  #include "opcodes/opcodes_ddcb.c"
  308.  #include "opcodes/opcodes_fdcb.c"
  309.  
  310. -#define _DOQUOTE(x) #x
  311. -#define DOQUOTE(x) _DOQUOTE(x)
  312. +#define DOQUOTE(x) #x
  313.  
  314.  static char revision_type[]=DOQUOTE(Z80EX_RELEASE_TYPE);
  315.  static char ver_str[]=DOQUOTE(Z80EX_VERSION_STR);
  316. diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/z80ex_dasm.c z80ex/z80ex_dasm.c
  317. --- z80ex-1.1.18/z80ex_dasm.c   2008-09-09 02:04:05.000000000 +0300
  318. +++ z80ex/z80ex_dasm.c  2010-08-21 03:33:01.217421186 +0300
  319. @@ -16,6 +16,10 @@
  320.  #define __Z80EX_SELF_INCLUDE
  321.  #include "z80ex_dasm.h"
  322.  
  323. +#ifdef _MSC_VER
  324. +#define snprintf _snprintf
  325. +#endif
  326. +
  327.  typedef struct {
  328.     const char *mnemonic;
  329.     int t_states;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement