Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/Changelog z80ex/Changelog
- --- z80ex-1.1.18/Changelog 2009-09-12 15:01:52.000000000 +0300
- +++ z80ex/Changelog 2010-08-21 04:56:11.249178060 +0300
- @@ -1,3 +1,7 @@
- +20.08.2010 - 1.1.18-mm
- +- switched to cmake
- +- made compilation with MSVC possible
- +
- 12.09.2009 - 1.1.18
- - HALT/NMI bugfix (by Kalvis)
- - some code were optimized for speed (by Mastermind)
- @@ -62,4 +66,4 @@
- 11.02.2006
- - minor API changes
- -10.02.2006 - release 0.1
- \ No newline at end of file
- +10.02.2006 - release 0.1
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/CMakeLists.txt z80ex/CMakeLists.txt
- --- z80ex-1.1.18/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200
- +++ z80ex/CMakeLists.txt 2010-08-21 03:33:01.215421486 +0300
- @@ -0,0 +1,70 @@
- +cmake_minimum_required (VERSION 2.8)
- +project (z80ex)
- +
- +set (API_REVISION 1)
- +set (VERSION_MAJOR 1)
- +set (VERSION_MINOR 18)
- +set (RELEASE_TYPE "")
- +set (VERSION_STR "${API_REVISION}.${VERSION_MAJOR}.${VERSION_MINOR}${RELEASE_TYPE}")
- +
- +option (OPSTEP_FAST_AND_ROUGH "Fast and rough opcode step emulation mode" Off)
- +
- +#ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
- +if (CMAKE_COMPILER_IS_GNUCC)
- + set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2")
- +endif ()
- +
- +include_directories(BEFORE . include)
- +
- +include (TestBigEndian)
- +test_big_endian(BIG_ENDIAN)
- +#endianness (one of: WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN)
- +if (BIG_ENDIAN)
- + set (ENDIANNESS WORDS_BIG_ENDIAN)
- +else ()
- + set (ENDIANNESS WORDS_LITTLE_ENDIAN)
- +endif ()
- +
- +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})
- +
- +if (OPSTEP_FAST_AND_ROUGH)
- + add_definitions (-DZ80EX_OPSTEP_FAST_AND_ROUGH)
- +endif ()
- +
- +set (z80ex_sources z80ex.c)
- +add_library (z80ex-static STATIC ${z80ex_sources})
- +set_target_properties (z80ex-static PROPERTIES OUTPUT_NAME z80ex)
- +if (NOT DEFINED Z80EX_STATIC_ONLY)
- + add_library (z80ex SHARED ${z80ex_sources})
- +# Affects Win32 only: avoid dynamic/static *.lib files naming conflict
- + set_target_properties (z80ex-static PROPERTIES PREFIX "lib")
- +endif ()
- +
- +set (z80ex_dasm_sources z80ex_dasm.c)
- +add_library (z80ex_dasm-static STATIC ${z80ex_dasm_sources})
- +set_target_properties (z80ex_dasm-static PROPERTIES OUTPUT_NAME z80ex_dasm)
- +if (NOT DEFINED Z80EX_STATIC_ONLY)
- + add_library (z80ex_dasm SHARED ${z80ex_dasm_sources})
- +# Affects Win32 only: avoid dynamic/static *.lib files naming conflict
- + set_target_properties (z80ex_dasm-static PROPERTIES PREFIX "lib")
- +endif ()
- +
- +if (NOT DEFINED Z80EX_STATIC_ONLY)
- + set_target_properties(z80ex z80ex_dasm
- + PROPERTIES VERSION ${VERSION_STR} SOVERSION ${API_REVISION}
- + )
- +endif ()
- +set_target_properties(z80ex-static z80ex_dasm-static
- + PROPERTIES VERSION ${VERSION_STR} SOVERSION ${API_REVISION}
- +)
- +
- +if ("${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}" MATCHES "lib64")
- + set (LIB_DIR "lib64")
- +else ()
- + set (LIB_DIR "lib")
- +endif ()
- +if (NOT DEFINED Z80EX_STATIC_ONLY)
- + install (TARGETS z80ex z80ex_dasm LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION ${LIB_DIR})
- +endif ()
- +install (TARGETS z80ex-static z80ex_dasm-static LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION ${LIB_DIR})
- +install (DIRECTORY include/ DESTINATION include/z80ex PATTERN "*.h" )
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/include/z80ex.h z80ex/include/z80ex.h
- --- z80ex-1.1.18/include/z80ex.h 2009-09-12 17:14:40.000000000 +0300
- +++ z80ex/include/z80ex.h 2009-10-31 15:00:53.000000000 +0200
- @@ -13,7 +13,7 @@
- #include "z80ex_common.h"
- typedef
- -enum {regAF,regBC,regDE,regHL,regAF_,regBC_,regDE_,regHL_,regIX,regIY,regPC,regSP,regI,regR,regR7,regIM/*0,1 ЙМЙ 2*/,regIFF1,regIFF2}
- +enum {regAF,regBC,regDE,regHL,regAF_,regBC_,regDE_,regHL_,regIX,regIY,regPC,regSP,regI,regR,regR7,regIM/*0,1 or 2*/,regIFF1,regIFF2}
- Z80_REG_T;
- typedef struct {
- Binary files z80ex-1.1.18/lib/libz80ex.a and z80ex/lib/libz80ex.a differ
- Binary files z80ex-1.1.18/lib/libz80ex_dasm.a and z80ex/lib/libz80ex_dasm.a differ
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/macros.h z80ex/macros.h
- --- z80ex-1.1.18/macros.h 2009-09-12 17:16:05.000000000 +0300
- +++ z80ex/macros.h 2010-08-21 03:33:01.216421685 +0300
- @@ -116,7 +116,7 @@
- for using outside of certain opcode execution)*/
- #define TSTATES(amount) \
- {\
- - int nn;\
- + unsigned nn;\
- if(cpu->tstate_cb == NULL) { \
- cpu->tstate += amount; \
- } \
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/Makefile z80ex/Makefile
- --- z80ex-1.1.18/Makefile 2009-07-26 00:11:47.000000000 +0300
- +++ z80ex/Makefile 1970-01-01 02:00:00.000000000 +0200
- @@ -1,96 +0,0 @@
- -# Z80ex Makefile
- -# (for GNU make)
- -#
- -
- -#################################################################
- -# You may tune these values to feet your setup:
- -#################################################################
- -INSTALL_PREFIX := /usr/local
- -CC := gcc
- -ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include
- -LINKER := gcc
- -
- -#endianness (one of: WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN)
- -ENDIANNESS := WORDS_LITTLE_ENDIAN
- -#ENDIANNESS := WORDS_BIG_ENDIAN
- -
- -#fast and rough opcode step emulation mode (0 - off, 1 - on)
- -OPSTEP_FAST_AND_ROUGH := 0
- -
- -
- -#################################################################
- -# Do not change these writings. the world sanity depends on them:
- -#################################################################
- -PROJ := z80ex
- -EMU := libz80ex
- -DASM := libz80ex_dasm
- -API_REVISION := 1
- -VERSION_MAJOR:=1
- -VERSION_MINOR:=18
- -RELEASE_TYPE :=
- -VERSION_STR:= ${API_REVISION}.${VERSION_MAJOR}.${VERSION_MINOR}${RELEASE_TYPE}
- -
- -OS=${shell uname -s}
- -
- -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}
- -
- -ifneq (${OPSTEP_FAST_AND_ROUGH},0)
- -ALL_CFLAGS += -DZ80EX_OPSTEP_FAST_AND_ROUGH
- -endif
- -
- -c_files := z80ex.c z80ex_dasm.c
- -
- -%.o : %.c
- - ${CC} ${ALL_CFLAGS} ${CFLAGS} -c -o $@ $<
- -
- -.PHONY : all
- -all:: static shared
- -
- -z80ex.o: include/z80ex.h include/z80ex_common.h ptables.c typedefs.h macros.h opcodes/opcodes_base.c\
- -opcodes/opcodes_dd.c opcodes/opcodes_fd.c opcodes/opcodes_cb.c\
- -opcodes/opcodes_ed.c opcodes/opcodes_ddcb.c opcodes/opcodes_fdcb.c
- -
- -z80ex_dasm.o: include/z80ex_dasm.h include/z80ex_common.h opcodes/opcodes_dasm.c
- -
- -clean:
- - rm -f *.o
- - rm -f ./lib/*
- - rm -rf ./z80ex-${VERSION_STR}.tar.gz
- -
- -static: z80ex.o z80ex_dasm.o
- - ar rs ./lib/${EMU}.a z80ex.o
- - ar rs ./lib/${DASM}.a z80ex_dasm.o
- -
- -shared: z80ex.o z80ex_dasm.o
- -ifeq (${OS},Darwin)
- - ${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
- - ${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
- -else
- - ${LINKER} -shared -Wl,-soname,${EMU}.so.${API_REVISION} -o ./lib/${EMU}.so.${VERSION_STR} z80ex.o
- - ${LINKER} -shared -Wl,-soname,${DASM}.so.${API_REVISION} -o ./lib/${DASM}.so.${VERSION_STR} z80ex_dasm.o
- -endif
- -
- -install:
- - install -d ${INSTALL_PREFIX}/lib
- - install ./lib/* ${INSTALL_PREFIX}/lib
- - install -d ${INSTALL_PREFIX}/include/z80ex
- - install -m 0664 ./include/* ${INSTALL_PREFIX}/include/z80ex
- -ifeq (${OS},Darwin)
- - ln -sf ${EMU}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${EMU}.${API_REVISION}.dylib
- - ln -sf ${EMU}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${EMU}.dylib
- - ln -sf ${DASM}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${DASM}.${API_REVISION}.dylib
- - ln -sf ${DASM}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${DASM}.dylib
- -else
- - ln -sf ${EMU}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${EMU}.so.${API_REVISION}
- - ln -sf ${EMU}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${EMU}.so
- - ln -sf ${DASM}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${DASM}.so.${API_REVISION}
- - ln -sf ${DASM}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${DASM}.so
- -endif
- -
- -dist: clean
- - rm -rf ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}
- - ln -s ./ ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}
- - 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
- - rm -rf ./${PROJ}-${VERSION_STR}${RELEASE_TYPE}
- -
- -#EOF
- \ No newline at end of file
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/README z80ex/README
- --- z80ex-1.1.18/README 2009-09-12 17:26:12.000000000 +0300
- +++ z80ex/README 2010-08-21 05:46:23.842420491 +0300
- @@ -14,19 +14,39 @@
- - builds as a library with simple callback-based API
- - disassembler included
- -Building (only GNU toolset is supported out of the box):
- +Building:
- --------------------------------------------------------
- -for build using GNU C (GCC,mingw,cygwin,DJGPP),
- -issue 'gmake'. static and shared libraries will appear in "./lib".
- -alternatively you may do "gmake static" for building static library only
- -(use that with DJGPP 'coz it doesn't support shared libs),
- -or "gmake shared" for building shared library only.
- -
- -you may override some build parameters by editing the Makefile, or by
- -giving command line arguments to gmake, e.g. "gmake parameter=value"
- -these are:
- -* ENDIANNESS -- CPU endianness, one of WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN
- +If you only want to use this library as a part of an emulator or other
- +project and link it statically and your project uses CMake (recommended)
- +then skip this section and go directly to "Usage".
- +
- +CMake (http://www.cmake.org/) is required to build the library.
- +If you use a popular Linux distribuion chances are that you already have
- +it if not installed than in the stock repository.
- +Out-of-source-tree building is recommended.
- +
- +To build on Unix and Unix-like environments (GCC,mingw,cygwin,DJGPP):
- + mkdir build
- + cd build
- + cmake ..
- +To build everything (static and shared z80ex and z80ex_dasm libraries):
- + gmake
- +To build only specific libraries and flavors:
- + gmake z80ex (shared z80ex)
- + gmake z80ex-static (static z80ex)
- + gmake z80ex_dasm (shared dasm)
- + gmake z80ex_dasm-static (static z80ex_dasm)
- +
- +To build using MSVC (Visual Studio):
- + - create a folder inside the source tree (e.g. "build")
- + - start cmd.exe and go to the created folder and issue:
- + cmake ..
- + - double-click z80ex.sln to open it in Visual Studio
- + - build ALL_BUILD or only necessary target(s) in Visual Studio
- + (choose Release/Debug configuration as required)
- +
- +You may override some build parameters by using ccmake or cmake-gui or other means CMake provides (see CMake documentation and relevant man pages):
- * OPSTEP_FAST_AND_ROUGH -- fast and rough opcode step emulation mode (0 - off, 1 - on)
- when this mode is on, timings of internal I/O operations are ignored,
- and tstate callback feature is disabled
- @@ -36,7 +56,8 @@
- --------------------------
- issue "gmake install" as superuser.
- -(default install prefix is /usr/local, which may be changed in Makefile.)
- +(default install prefix is /usr/local, which may be changed using ccmake or
- +cmake-gui)
- then do "/sbin/ldconfig" as superuser to update DSO links and cache
- @@ -58,6 +79,18 @@
- for API documentation see "z80ex_dasm.h".
- also look at the "dasm.c" from the "examples" directory
- +If your project uses CMake here is an example (copy these lines into your
- +project's CMakeLists.txt):
- +
- + set (Z80EX_PATH "${PROJECT_SOURCE_DIR}/../z80ex"
- + CACHE PATH "Path to Z80Ex library")
- + include_directories("${Z80EX_PATH}/include")
- + set (Z80EX_BINARY_DIR "${PROJECT_BINARY_DIR}/lib_z80ex")
- + make_directory (${Z80EX_BINARY_DIR})
- + set (Z80EX_STATIC_ONLY true)
- + add_subdirectory (${Z80EX_PATH} ${Z80EX_BINARY_DIR})
- + link_directories (${Z80EX_BINARY_DIR})
- + target_link_libraries (my_cool_emulator_exexutable z80ex-static z80ex_dasm-static)
- _____________________
- yours, Boo-boo
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/z80ex.c z80ex/z80ex.c
- --- z80ex-1.1.18/z80ex.c 2009-09-12 17:22:53.000000000 +0300
- +++ z80ex/z80ex.c 2010-08-21 03:33:01.217421186 +0300
- @@ -30,8 +30,7 @@
- #include "opcodes/opcodes_ddcb.c"
- #include "opcodes/opcodes_fdcb.c"
- -#define _DOQUOTE(x) #x
- -#define DOQUOTE(x) _DOQUOTE(x)
- +#define DOQUOTE(x) #x
- static char revision_type[]=DOQUOTE(Z80EX_RELEASE_TYPE);
- static char ver_str[]=DOQUOTE(Z80EX_VERSION_STR);
- diff -urN --exclude='.git*' --exclude='build*' --exclude='.*project' --exclude '*.mingw32' z80ex-1.1.18/z80ex_dasm.c z80ex/z80ex_dasm.c
- --- z80ex-1.1.18/z80ex_dasm.c 2008-09-09 02:04:05.000000000 +0300
- +++ z80ex/z80ex_dasm.c 2010-08-21 03:33:01.217421186 +0300
- @@ -16,6 +16,10 @@
- #define __Z80EX_SELF_INCLUDE
- #include "z80ex_dasm.h"
- +#ifdef _MSC_VER
- +#define snprintf _snprintf
- +#endif
- +
- typedef struct {
- const char *mnemonic;
- int t_states;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement