From c6624744a45d0ebf71bce707eaa50d14a8bf3f70 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Fri, 8 May 2015 10:06:43 +0200 Subject: [PATCH 01/54] Added 'show clock' command to be able to count clock cycles between two breakpoints --- src/emu/debug/debugcmd.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 8e76f3b3b2b..51590b373cb 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -93,6 +93,7 @@ static UINT64 execute_if(symbol_table &table, void *ref, int params, const UINT6 static UINT64 global_get(symbol_table &table, void *ref); static void global_set(symbol_table &table, void *ref, UINT64 value); +static void execute_show(running_machine &machine, int ref, int params, const char **param); static void execute_help(running_machine &machine, int ref, int params, const char **param); static void execute_print(running_machine &machine, int ref, int params, const char **param); static void execute_printf(running_machine &machine, int ref, int params, const char **param); @@ -267,6 +268,7 @@ void debug_command_init(running_machine &machine) } /* add all the commands */ + debug_console_register_command(machine, "show", CMDFLAG_NONE, 0, 0, 1, execute_show); debug_console_register_command(machine, "help", CMDFLAG_NONE, 0, 0, 1, execute_help); debug_console_register_command(machine, "print", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_print); debug_console_register_command(machine, "printf", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_printf); @@ -669,6 +671,34 @@ static int debug_command_parameter_command(running_machine &machine, const char COMMAND HELPERS ***************************************************************************/ +/*------------------------------------------------- + show infos of various kind +-------------------------------------------------*/ + +static void execute_show(running_machine &machine, int ref, int params, const char *param[]) +{ + class cpu_device *cpu; + static long long unsigned int last = 0uLL; + + /* CPU is implicit */ + if (!debug_command_parameter_cpu(machine, NULL, (device_t **) &cpu)) + return; + + if (params == 0) + { + debug_console_printf(machine, "Show what?\n"); + } + else if (params == 1) + { + if (!strcmp(param[0], "clock")) + { + debug_console_printf(machine, "The clock is: %lld(%08llx) and that is %lld(%08llx) CPU clock cycles since last 'show clock' command\n", + cpu->total_cycles(), cpu->total_cycles(), cpu->total_cycles() - last, cpu->total_cycles() - last); + last = cpu->total_cycles(); + } + } +} + /*------------------------------------------------- execute_help - execute the help command -------------------------------------------------*/ From 0bc1ad02c3f276c791514723ffbe5fa2009eafdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 9 May 2015 00:15:06 +0200 Subject: [PATCH 02/54] Added Bouncer entry to Vectrex hash list --- hash/vectrex.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hash/vectrex.xml b/hash/vectrex.xml index 69ff7c689a8..8b72670b12a 100644 --- a/hash/vectrex.xml +++ b/hash/vectrex.xml @@ -13,6 +13,18 @@ guys + + Bouncer - things bouncing in a box + 2015 + Joakim Larsson Edstrom + + + + + + + + 3D Mine Storm 1983 From 815266283005256940e97721de19a0b6a921c279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 9 May 2015 00:16:24 +0200 Subject: [PATCH 03/54] Added help section for 'show' command --- src/emu/debug/debughlp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/emu/debug/debughlp.c b/src/emu/debug/debughlp.c index 1dcb7a31477..14b68f588eb 100644 --- a/src/emu/debug/debughlp.c +++ b/src/emu/debug/debughlp.c @@ -1457,6 +1457,19 @@ static const help_item static_help_list[] = "\n" "unmount cart\n" " Unmounts any file mounted on device named cart.\n" + }, + { + "show", + "\n" + " show \n" + "\n" + "Shows the value(s) of a property.\nValid properties are:\n" + " clock - prints the total number of clockcycles consumed from reset and the diff from last time the command was issued.\n" + "\n" + "Examples:\n" + "\n" + "show clock\n" + " The clock is: 4816918(0x00498016) and that is 3(0x3) CPU clock cycles since last 'show clock' command\n\n" } }; From 4dfd383240bbd1ebde92b824d10e0d6adc01c5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 9 May 2015 00:19:21 +0200 Subject: [PATCH 04/54] Fixed formatting and added help text for 'show' command --- src/emu/debug/debugcmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 51590b373cb..73a7514c633 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -692,10 +692,15 @@ static void execute_show(running_machine &machine, int ref, int params, const ch { if (!strcmp(param[0], "clock")) { - debug_console_printf(machine, "The clock is: %lld(%08llx) and that is %lld(%08llx) CPU clock cycles since last 'show clock' command\n", + debug_console_printf(machine, "The clock is: %lld(0x%llx) and that is %lld(0x%llx) CPU clock cycles since last 'show clock' command\n", cpu->total_cycles(), cpu->total_cycles(), cpu->total_cycles() - last, cpu->total_cycles() - last); last = cpu->total_cycles(); } + else + { + debug_console_printf(machine, "Unknown property %s. ", param[0]); + debug_console_printf(machine, "Valid properties are: 'clock'\n"); + } } } From 923b78aa719c46d320d71ce73a05d2a7ee801279 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Tue, 14 Jul 2015 21:50:06 +0200 Subject: [PATCH 05/54] Implement missing osd_truncate(). Fixes linking on Unix when SDL is disabled. Signed-off-by: Thomas Klausner --- src/osd/osdmini/minifile.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/osd/osdmini/minifile.c b/src/osd/osdmini/minifile.c index f2f899744fc..c933238e710 100644 --- a/src/osd/osdmini/minifile.c +++ b/src/osd/osdmini/minifile.c @@ -101,6 +101,25 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 l } +//============================================================ +// osd_truncate +//============================================================ + +file_error osd_truncate(osd_file *file, UINT64 offset) +{ + UINT32 result; + + if (!file) + return FILERR_FAILURE; + + result = ftruncate(fileno((FILE *)file), offset); + if (!result) + return FILERR_FAILURE; + + return FILERR_NONE; +} + + //============================================================ // osd_rmfile //============================================================ From 257a18502c0c554d9395d270a80fd4a59224d383 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Tue, 14 Jul 2015 21:51:00 +0200 Subject: [PATCH 06/54] Fix build using a patch from upstream. https://github.com/bkaradzic/bgfx/commit/e1a564ca720ae66298b61928e6ef0e9d1ee40d30#diff-d51370988baf340d4de0bc2861591415 Signed-off-by: Thomas Klausner --- 3rdparty/bgfx/src/renderer_null.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/3rdparty/bgfx/src/renderer_null.cpp b/3rdparty/bgfx/src/renderer_null.cpp index ce5f812448b..5a86523fc57 100644 --- a/3rdparty/bgfx/src/renderer_null.cpp +++ b/3rdparty/bgfx/src/renderer_null.cpp @@ -33,7 +33,7 @@ namespace bgfx { namespace noop { } - void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint8_t /*_flags*/) BX_OVERRIDE + void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint16_t /*_flags*/) BX_OVERRIDE { } @@ -49,7 +49,7 @@ namespace bgfx { namespace noop { } - void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint8_t /*_flags*/) BX_OVERRIDE + void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint16_t /*_flags*/) BX_OVERRIDE { } @@ -57,7 +57,7 @@ namespace bgfx { namespace noop { } - void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE + void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE { } @@ -69,7 +69,7 @@ namespace bgfx { namespace noop { } - void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE + void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE { } From 24bfd3e8e85e5415ea9569ccc34ce81f89888fca Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Tue, 14 Jul 2015 21:52:03 +0200 Subject: [PATCH 07/54] Add NetBSD support to bx. Will try sending this upstream as well. Signed-off-by: Thomas Klausner --- 3rdparty/bx/include/bx/os.h | 5 +++-- 3rdparty/bx/include/bx/platform.h | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h index 4fcd2c08079..5daae404b8c 100644 --- a/3rdparty/bx/include/bx/os.h +++ b/3rdparty/bx/include/bx/os.h @@ -17,11 +17,12 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_OSX \ || BX_PLATFORM_RPI # include // sched_yield -# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_OSX +# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD || BX_PLATFORM_OSX # include // mach_port_t # endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL @@ -93,7 +94,7 @@ namespace bx return (pid_t)::syscall(SYS_gettid); #elif BX_PLATFORM_IOS || BX_PLATFORM_OSX return (mach_port_t)::pthread_mach_thread_np(pthread_self() ); -#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL +#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD // Casting __nc_basic_thread_data*... need better way to do this. return *(uint32_t*)::pthread_self(); #else diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h index 08b31bf787f..962a8a6fc6d 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h @@ -18,6 +18,7 @@ #define BX_PLATFORM_IOS 0 #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 +#define BX_PLATFORM_NETBSD 0 #define BX_PLATFORM_OSX 0 #define BX_PLATFORM_PS4 0 #define BX_PLATFORM_QNX 0 @@ -187,6 +188,9 @@ #elif defined(__FreeBSD__) # undef BX_PLATFORM_FREEBSD # define BX_PLATFORM_FREEBSD 1 +#elif defined(__NetBSD__) +# undef BX_PLATFORM_NETBSD +# define BX_PLATFORM_NETBSD 1 #else # error "BX_PLATFORM_* is not defined!" #endif // @@ -198,6 +202,7 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ + || BX_PLATFORM_NETBSD \ || BX_PLATFORM_OSX \ || BX_PLATFORM_QNX \ || BX_PLATFORM_RPI \ @@ -250,6 +255,8 @@ #elif BX_PLATFORM_NACL # define BX_PLATFORM_NAME "NaCl " \ BX_STRINGIZE(BX_PLATFORM_NACL) +#elif BX_PLATFORM_NETBSD +# define BX_PLATFORM_NAME "NetBSD" #elif BX_PLATFORM_OSX # define BX_PLATFORM_NAME "OSX" #elif BX_PLATFORM_PS4 From 910f0215e82c19cbd0c007f77ec007528e3eb3d0 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Tue, 14 Jul 2015 21:52:52 +0200 Subject: [PATCH 08/54] Add NetBSD support. Signed-off-by: Thomas Klausner --- makefile | 24 ++++++++++++++++++++++++ scripts/src/3rdparty.lua | 12 ++++++++++++ scripts/toolchain.lua | 29 ++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 04d0a748baf..499d4ace282 100644 --- a/makefile +++ b/makefile @@ -296,6 +296,10 @@ ifeq ($(TARGETOS),freebsd) OSD := sdl endif +ifeq ($(TARGETOS),netbsd) +OSD := sdl +endif + ifeq ($(TARGETOS),solaris) OSD := sdl endif @@ -1004,6 +1008,26 @@ freebsd_x86: generate $(PROJECTDIR)/gmake-freebsd/Makefile $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-freebsd config=$(CONFIG)32 +#------------------------------------------------- +# gmake-netbsd +#------------------------------------------------- + + +$(PROJECTDIR)/gmake-netbsd/Makefile: makefile $(SCRIPTS) $(GENIE) + $(SILENT) $(GENIE) $(PARAMS) --gcc=netbsd --gcc_version=$(GCC_VERSION) gmake + +.PHONY: netbsd_x64 +netbsd_x64: generate $(PROJECTDIR)/gmake-netbsd/Makefile + $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)64 + +.PHONY: netbsd +netbsd: netbsd_x86 + +.PHONY: netbsd_x86 +netbsd_x86: generate $(PROJECTDIR)/gmake-netbsd/Makefile + $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)32 + + #------------------------------------------------- # Clean/bootstrap #------------------------------------------------- diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 889a6737cd5..5247517dce0 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -534,6 +534,13 @@ project "portmidi" MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c", } end + if _OPTIONS["targetos"]=="netbsd" then + files { + MAME_DIR .. "3rdparty/portmidi/pm_linux/pmlinux.c", + MAME_DIR .. "3rdparty/portmidi/pm_linux/finddefault.c", + MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c", + } + end if _OPTIONS["targetos"]=="macosx" then files { MAME_DIR .. "3rdparty/portmidi/pm_mac/pmmac.c", @@ -591,6 +598,11 @@ project "bgfx" MAME_DIR .. "3rdparty/bx/include/compat/freebsd", } + configuration { "netbsd" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/freebsd", + } + configuration { "gmake" } buildoptions { "-Wno-uninitialized", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 91d1f29884e..589db7bc6fa 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -24,6 +24,7 @@ newoption { { "mingw-clang", "MinGW (clang compiler)" }, { "nacl", "Native Client" }, { "nacl-arm", "Native Client - ARM" }, + { "netbsd", "NetBSD" }, { "osx", "OSX (GCC compiler)" }, { "osx-clang", "OSX (Clang compiler)" }, { "pnacl", "Native Client - PNaCl" }, @@ -147,6 +148,10 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-freebsd") end + if "netbsd" == _OPTIONS["gcc"] then + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-netbsd") + end + if "ios-arm" == _OPTIONS["gcc"] then premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" @@ -590,7 +595,29 @@ function toolchain(_buildDir, _subDir) configuration { "freebsd", "x64", "Debug" } targetdir (_buildDir .. "freebsd" .. "/bin/x64/Debug") - + + configuration { "netbsd", "x32" } + objdir (_buildDir .. "netbsd" .. "/obj") + buildoptions { + "-m32", + } + configuration { "netbsd", "x32", "Release" } + targetdir (_buildDir .. "netbsd" .. "/bin/x32/Release") + + configuration { "netbsd", "x32", "Debug" } + targetdir (_buildDir .. "netbsd" .. "/bin/x32/Debug") + + configuration { "netbsd", "x64" } + objdir (_buildDir .. "netbsd" .. "/obj") + buildoptions { + "-m64", + } + configuration { "netbsd", "x64", "Release" } + targetdir (_buildDir .. "netbsd" .. "/bin/x64/Release") + + configuration { "netbsd", "x64", "Debug" } + targetdir (_buildDir .. "netbsd" .. "/bin/x64/Debug") + configuration { "android-*" } includedirs { "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include", From 456590ce3ead192a4e21f89824e38d6a3dac255b Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Tue, 14 Jul 2015 21:54:21 +0200 Subject: [PATCH 09/54] Switch from ftime() to gettimeofday(). Even the Linux man page recommends avoiding ftime(). gettimeofday is in POSIX.1-2001 and more portable. Signed-off-by: Thomas Klausner --- 3rdparty/portmidi/porttime/ptlinux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/3rdparty/portmidi/porttime/ptlinux.c b/3rdparty/portmidi/porttime/ptlinux.c index 768dd4847f7..c58107c36ad 100644 --- a/3rdparty/portmidi/porttime/ptlinux.c +++ b/3rdparty/portmidi/porttime/ptlinux.c @@ -38,7 +38,7 @@ CHANGE LOG #define FALSE 0 static int time_started_flag = FALSE; -static struct timeb time_offset = {0, 0, 0, 0}; +static struct timeval time_offset = {0, 0}; static pthread_t pt_thread_pid; static int pt_thread_created = FALSE; @@ -79,7 +79,7 @@ static void *Pt_CallbackProc(void *p) PtError Pt_Start(int resolution, PtCallback *callback, void *userData) { if (time_started_flag) return ptNoError; - ftime(&time_offset); /* need this set before process runs */ + gettimeofday(&time_offset, NULL); /* need this set before process runs */ if (callback) { int res; pt_callback_parameters *parms = (pt_callback_parameters *) @@ -121,10 +121,10 @@ int Pt_Started() PtTimestamp Pt_Time() { long seconds, milliseconds; - struct timeb now; - ftime(&now); - seconds = now.time - time_offset.time; - milliseconds = now.millitm - time_offset.millitm; + struct timeval now; + gettimeofday(&now, NULL); + seconds = now.tv_sec - time_offset.tv_sec; + milliseconds = now.tv_usec - time_offset.tv_usec; return seconds * 1000 + milliseconds; } From 7769689bd7625289fe2416a21d8971060f17fe2b Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Tue, 14 Jul 2015 23:41:06 +0200 Subject: [PATCH 10/54] Fix error handling of osd_truncate. Noted by startaq in https://github.com/mamedev/mame/pull/257. Signed-off-by: Thomas Klausner --- src/osd/osdmini/minifile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/osdmini/minifile.c b/src/osd/osdmini/minifile.c index c933238e710..86b816d3ce2 100644 --- a/src/osd/osdmini/minifile.c +++ b/src/osd/osdmini/minifile.c @@ -113,7 +113,7 @@ file_error osd_truncate(osd_file *file, UINT64 offset) return FILERR_FAILURE; result = ftruncate(fileno((FILE *)file), offset); - if (!result) + if (result) return FILERR_FAILURE; return FILERR_NONE; From 13254b740a5353185235e37a2364240c6e5799a7 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Sat, 13 Jun 2015 23:23:58 +0200 Subject: [PATCH 11/54] Adding first stab at force68k driver Conflicts: scripts/target/mame/my.lua src/mame/my.lst --- src/mess/drivers/force68k.c | 102 ++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/mess/drivers/force68k.c diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c new file mode 100644 index 00000000000..b6be10b73d3 --- /dev/null +++ b/src/mess/drivers/force68k.c @@ -0,0 +1,102 @@ +// license:BSD-3-Clause +// copyright-holders:Joamim Larsson Edström +/*************************************************************************** + + Force SYS68K/CPU-1 VME SBC driver + + 13/06/2015 + + http://... + +Based on the 68ksbc.c + + TODO: + - Memory map + - Dump ROM:s + - Add 3 ACIA6850 + - Add serial connector between ACIA:s and real terminal emulator + - VME bus driver + + +****************************************************************************/ + +#include "bus/rs232/rs232.h" +#include "cpu/m68000/m68000.h" +#include "machine/6850acia.h" +#include "machine/clock.h" + +class force68k_state : public driver_device +{ +public: + force68k_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_acia1(*this, "acia1") + m_acia2(*this, "acia2") + m_acia3(*this, "acia3") + { + } + + DECLARE_WRITE_LINE_MEMBER(write_acia_clock); + +private: + required_device m_maincpu; + required_device m_acia1; + required_device m_acia2; + required_device m_acia3; +}; + +static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) + AM_RANGE(0x000000, 0x000007) AM_ROM /* Vectors mapped from System EPROM */ + AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ + AM_RANGE(0x080008, 0x09ffff) AM_ROM /* System EPROM Area */ +// AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ +// AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ +// AM_RANGE(0x0e0000, 0x0e0001) AM_DEVREADWRITE8("acia", acia6850_device, status_r, control_w, 0x00ff) +// AM_RANGE(0x0e0002, 0x0e0003) AM_DEVREADWRITE8("acia", acia6850_device, data_r, data_w, 0x00ff) +// AM_RANGE(0x0e0004, 0x0e0005) AM_DEVREADWRITE8("acia", acia6850_device, data_r, data_w, 0x00ff) +// AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ +// AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ +ADDRESS_MAP_END + + +/* Input ports */ +static INPUT_PORTS_START( force68k ) +INPUT_PORTS_END + + +WRITE_LINE_MEMBER(force68k_state::write_acia_clock) +{ + m_acia->write_txc(state); + m_acia->write_rxc(state); +} + +static MACHINE_CONFIG_START( force68k, force68k_state ) + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", M68000, 8000000) + MCFG_CPU_PROGRAM_MAP(force68k_mem) + +/* + MCFG_DEVICE_ADD("acia", ACIA6850, 0) + MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) + MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) + + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) + MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) + + MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) + MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_acia_clock)) +*/ +MACHINE_CONFIG_END + +/* ROM definition */ +ROM_START( forcecpu1 ) + ROM_REGION(0x1000000, "maincpu", 0) +// ROM_LOAD( "forcecpu1.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) +ROM_END + +/* Driver */ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1983, forcecpu1, 0, 0, force68k, force68k, driver_device, 0, "Force Computers", "SYS68K/CPU-1", GAME_NO_SOUND_HW) From 9e543a09eacc468b1bff6e068d10defde4ee3d8c Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Sun, 14 Jun 2015 10:14:00 +0200 Subject: [PATCH 12/54] Added info about the Force CPU-1 board --- src/mess/drivers/force68k.c | 53 +++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index b6be10b73d3..05ac104973f 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -6,14 +6,63 @@ 13/06/2015 - http://... + The info found on the link below is for a later revision of the board I have + but I hope it is compatible, My board is has proms from 1983 and no rev markings + so probably the original. + + http://bitsavers.trailing-edge.com/pdf/forceComputers/1988_Force_VMEbus_Products.pdf + + Some info from that document: + +Address Range +---------------------------------------------------------- +000 000 - 000 007 Initialisation vectors from system EPROM +000 008 - 01F FFF Dynamic RAM on CPU-1 B +000 008 - 07F FFF Dynamic RAM on CPU-1 D +080 008 - 09F FFF SYSTEM EPROM Area +OAO 000 - OBF FFF USER EPROMArea +OEO 000 - OFF FFF I/O Interfaces +100 000 - FEF FFF VMEbus addresses (A24) +FFO 000 - FFF FFF VMEbus Short I/O (A16) +---------------------------------------------------------- + +Description Device Lvl IRQ Vector No. +---------------------------------------------------------- + ABORT Switch 7 31 + Real Time Clock 58167A 6 30 + Parallel Interface and Timer 68230 5 29 + Terminal ACIA 6850 4 28 + Remote ACIA 6850 3 27 + Host ACIA 6850 2 26 +---------------------------------------------------------- + +10. The VMEbus +--------------- +The implemented VMEbus Interface includes 24 address, 16 data, +6 address modifier and the asynchronous control signals. +A single level bus arbiter is provided to build multi master +systems. In addition to the bus arbiter, a separate slave bus +arbitration allows selection of the arbitration level (0-3). + +The address modifier range .,Short 110 Access« can be selected +via a jumper for variable system generation. The 7 interrupt +request levels of the VMEbus are fully supported from the +SYS68K1CPU-1 B/D. For multi-processing, each IRQ signal can be +enabled/disabled via a jumper field. + +Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET, +SYSFAIL and SYSCLK signal (16 MHz). + Based on the 68ksbc.c TODO: - Memory map - Dump ROM:s - - Add 3 ACIA6850 + - Add 3 x ACIA6850 + - Add 1 x 68230 Motorola, Parallel Interface / Timer + - Add 1 x MM58167A RTC + - Add 1 x Abort Switch - Add serial connector between ACIA:s and real terminal emulator - VME bus driver From b9edf7956c864d8859d2cd1c7b5300ee6a10eb99 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Sun, 14 Jun 2015 15:33:00 +0200 Subject: [PATCH 13/54] commented out all but cpu, ram and rom load as a first step to get something to work --- src/mess/drivers/force68k.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 05ac104973f..96945fd8dba 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -69,10 +69,10 @@ Based on the 68ksbc.c ****************************************************************************/ -#include "bus/rs232/rs232.h" +//#include "bus/rs232/rs232.h" #include "cpu/m68000/m68000.h" -#include "machine/6850acia.h" -#include "machine/clock.h" +//#include "machine/6850acia.h" +//#include "machine/clock.h" class force68k_state : public driver_device { @@ -80,19 +80,19 @@ public: force68k_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_acia1(*this, "acia1") - m_acia2(*this, "acia2") - m_acia3(*this, "acia3") +// m_acia1(*this, "acia1") +// m_acia2(*this, "acia2") +// m_acia3(*this, "acia3") { } - DECLARE_WRITE_LINE_MEMBER(write_acia_clock); +// DECLARE_WRITE_LINE_MEMBER(write_acia_clock); private: required_device m_maincpu; - required_device m_acia1; - required_device m_acia2; - required_device m_acia3; +// required_device m_acia1; +// required_device m_acia2; +// required_device m_acia3; }; static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) @@ -114,11 +114,13 @@ static INPUT_PORTS_START( force68k ) INPUT_PORTS_END +#if 0 WRITE_LINE_MEMBER(force68k_state::write_acia_clock) { m_acia->write_txc(state); m_acia->write_rxc(state); } +#endif static MACHINE_CONFIG_START( force68k, force68k_state ) /* basic machine hardware */ From bde2e8cc5125b1ac0a7d79f58c265046588709a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sun, 14 Jun 2015 22:28:38 +0200 Subject: [PATCH 14/54] First compling forcecpu1 driver, just bare CPU and memory Conflicts: scripts/target/mame/my.lua src/mame/my.lst --- src/mess/drivers/force68k.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 96945fd8dba..79b91e78039 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -69,6 +69,7 @@ Based on the 68ksbc.c ****************************************************************************/ +#include "emu.h" //#include "bus/rs232/rs232.h" #include "cpu/m68000/m68000.h" //#include "machine/6850acia.h" @@ -79,7 +80,7 @@ class force68k_state : public driver_device public: force68k_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), + m_maincpu(*this, "maincpu") // m_acia1(*this, "acia1") // m_acia2(*this, "acia2") // m_acia3(*this, "acia3") @@ -96,6 +97,7 @@ private: }; static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) + ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x000000, 0x000007) AM_ROM /* Vectors mapped from System EPROM */ AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ AM_RANGE(0x080008, 0x09ffff) AM_ROM /* System EPROM Area */ @@ -108,7 +110,6 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ ADDRESS_MAP_END - /* Input ports */ static INPUT_PORTS_START( force68k ) INPUT_PORTS_END From 96cc9cb25be6b69bd55785829548e783b091cdb7 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Tue, 16 Jun 2015 20:34:28 +0200 Subject: [PATCH 15/54] Added more info and enabled RTC, does not compile yet --- src/mess/drivers/force68k.c | 101 ++++++++++++++++++++++++++++-------- 1 file changed, 79 insertions(+), 22 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 79b91e78039..392b59cdaa8 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -1,39 +1,60 @@ // license:BSD-3-Clause -// copyright-holders:Joamim Larsson Edström +// copyright-holders:Joakim Larsson Edström /*************************************************************************** - Force SYS68K/CPU-1 VME SBC driver + Force SYS68K CPU-1/CPU-6 VME SBC drivers 13/06/2015 - The info found on the link below is for a later revision of the board I have - but I hope it is compatible, My board is has proms from 1983 and no rev markings - so probably the original. + The info found on the links below is for a later revisions of the board I have + but I hope it is somewhat compatible so I can get it up and running at least. + My CPU-1 board has proms from 1983 and no rev markings so probably the original. http://bitsavers.trailing-edge.com/pdf/forceComputers/1988_Force_VMEbus_Products.pdf + http://www.artisantg.com/info/P_wUovN.pdf - Some info from that document: + Some info from those documents: -Address Range +Address Map +---------------------------------------------------------- +Address Range Description ---------------------------------------------------------- 000 000 - 000 007 Initialisation vectors from system EPROM 000 008 - 01F FFF Dynamic RAM on CPU-1 B 000 008 - 07F FFF Dynamic RAM on CPU-1 D 080 008 - 09F FFF SYSTEM EPROM Area OAO 000 - OBF FFF USER EPROMArea -OEO 000 - OFF FFF I/O Interfaces +0C0 041 - 0C0 043 ACIA (P3) Host +0C0 080 - 0C0 082 ACIA (P4) Terminal +0C0 101 - 0C0 103 ACIA (P3) Remote +0C0 401 - 0C0 42F RTC +OEO 001 - 0E0 035 PI/T +OEO 200 - 0E0 2FF FPU +OEO 300 - 0E0 300 Reset Off +OEO 380 - 0E0 380 Reset On 100 000 - FEF FFF VMEbus addresses (A24) FFO 000 - FFF FFF VMEbus Short I/O (A16) ---------------------------------------------------------- -Description Device Lvl IRQ Vector No. +Interrupt sources ---------------------------------------------------------- +Description Device Lvl IRQ VME board + /Board Vector Address +---------------------------------------------------------- +On board Sources ABORT Switch 7 31 - Real Time Clock 58167A 6 30 - Parallel Interface and Timer 68230 5 29 + Real Time Clock (RTC) 58167A 6 30 + Parallel/Timer (PI/T) 68230 5 29 Terminal ACIA 6850 4 28 Remote ACIA 6850 3 27 Host ACIA 6850 2 26 + ACFAIL, SYSFAIL VME 5 29 +Off board Sources (other VME boards) + 6 Port Serial I/O board SIO 4 64-75 0xb00000 + 8 Port Serial I/O board ISIO 4 76-83 0x960000 + Disk Controller WFC 3 119 0xb01000 + SCSI Controller ISCSI 4 119 0xa00000 + Slot 1 Controller Board ASCU 7 31 0xb02000 ---------------------------------------------------------- 10. The VMEbus @@ -63,7 +84,9 @@ Based on the 68ksbc.c - Add 1 x 68230 Motorola, Parallel Interface / Timer - Add 1 x MM58167A RTC - Add 1 x Abort Switch - - Add serial connector between ACIA:s and real terminal emulator + - Add configurable serial connector between ACIA:s and + - Real terminal emulator + - Debug console - VME bus driver @@ -71,7 +94,8 @@ Based on the 68ksbc.c #include "emu.h" //#include "bus/rs232/rs232.h" -#include "cpu/m68000/m68000.h" +#include "cpu/m68000/m68000.h"/ +#include "machine/mm58167.h" //#include "machine/6850acia.h" //#include "machine/clock.h" @@ -80,7 +104,8 @@ class force68k_state : public driver_device public: force68k_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu") + m_maincpu(*this, "maincpu"), + m_rtc(*this, "rtc") // m_acia1(*this, "acia1") // m_acia2(*this, "acia2") // m_acia3(*this, "acia3") @@ -91,6 +116,7 @@ public: private: required_device m_maincpu; + required_device m_rtc; // required_device m_acia1; // required_device m_acia2; // required_device m_acia3; @@ -101,11 +127,11 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) AM_RANGE(0x000000, 0x000007) AM_ROM /* Vectors mapped from System EPROM */ AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ AM_RANGE(0x080008, 0x09ffff) AM_ROM /* System EPROM Area */ -// AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ -// AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ + AM_RANGE(0x0e0401, 0x0e0421) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0x00ff) // AM_RANGE(0x0e0000, 0x0e0001) AM_DEVREADWRITE8("acia", acia6850_device, status_r, control_w, 0x00ff) // AM_RANGE(0x0e0002, 0x0e0003) AM_DEVREADWRITE8("acia", acia6850_device, data_r, data_w, 0x00ff) -// AM_RANGE(0x0e0004, 0x0e0005) AM_DEVREADWRITE8("acia", acia6850_device, data_r, data_w, 0x00ff) +// AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ +// AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ ADDRESS_MAP_END @@ -123,7 +149,7 @@ WRITE_LINE_MEMBER(force68k_state::write_acia_clock) } #endif -static MACHINE_CONFIG_START( force68k, force68k_state ) +static MACHINE_CONFIG_START( forcecpu1, force68k_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 8000000) MCFG_CPU_PROGRAM_MAP(force68k_mem) @@ -142,13 +168,44 @@ static MACHINE_CONFIG_START( force68k, force68k_state ) */ MACHINE_CONFIG_END +static MACHINE_CONFIG_START( forcecpu6, force68k_state ) + MCFG_CPU_ADD("maincpu", M68000, 8000000) /* Jumper B10 Mode B */ + MCFG_CPU_PROGRAM_MAP(force68k_mem) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_START( forcecpu6a, force68k_state ) + MCFG_CPU_ADD("maincpu", M68000, 12500000) /* Jumper B10 Mode A */ + MCFG_CPU_PROGRAM_MAP(force68k_mem) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_START( forcecpu6v, force68k_state ) + MCFG_CPU_ADD("maincpu", M68010, 8000000) /* Jumper B10 Mode B */ + MCFG_CPU_PROGRAM_MAP(force68k_mem) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_START( forcecpu6va, force68k_state ) + MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ + MCFG_CPU_PROGRAM_MAP(force68k_mem) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_START( forcecpu6vb, force68k_state ) + MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ + MCFG_CPU_PROGRAM_MAP(force68k_mem) + +MACHINE_CONFIG_END + /* ROM definition */ -ROM_START( forcecpu1 ) +ROM_START( force68k_rom ) ROM_REGION(0x1000000, "maincpu", 0) -// ROM_LOAD( "forcecpu1.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) +// ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) ROM_END /* Driver */ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1983, forcecpu1, 0, 0, force68k, force68k, driver_device, 0, "Force Computers", "SYS68K/CPU-1", GAME_NO_SOUND_HW) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1983, force68k_rom, 0, 0, forcecpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_IS_SKELETON ) +COMP( 1989, force68k_rom, 0, 0, forcecpu6, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6", GAME_IS_SKELETON ) +COMP( 1989, force68k_rom, 0, 0, forcecpu6a, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6a", GAME_IS_SKELETON ) +COMP( 1989, force68k_rom, 0, 0, forcecpu6v, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6v", GAME_IS_SKELETON ) +COMP( 1989, force68k_rom, 0, 0, forcecpu6va, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6va", GAME_IS_SKELETON ) +COMP( 1989, force68k_rom, 0, 0, forcecpu6vb, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6vb", GAME_IS_SKELETON ) From 705458fd1fb78c356f72055a512d3d814ce3313a Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Tue, 16 Jun 2015 20:36:32 +0200 Subject: [PATCH 16/54] started implementation of a Motorola 68230 PI/T (Parallell Interface / Timer) device --- src/emu/machine/68230pit.c | 44 ++++++++++++++++++++++++++++++++++++++ src/emu/machine/68230pit.h | 34 +++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 src/emu/machine/68230pit.c create mode 100644 src/emu/machine/68230pit.h diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c new file mode 100644 index 00000000000..c31dcf2b36b --- /dev/null +++ b/src/emu/machine/68230pit.c @@ -0,0 +1,44 @@ +// license:BSD-3-Clause +// copyright-holders:Joakim Larsson Edström +/********************************************************************** + + Motorola MC68230 PI/T Parallell Interface and Timer + +**********************************************************************/ + +/* + Registers +----------------------------------------------------------------------- + Offset Reset R/W + RS1-RS5 Name Value Reset Description +----------------------------------------------------------------------- + 0x00 RW PGCR No Port General Control register + 0x01 RW PSRR No Port Service Request register + 0x02 RW PADDR No Port A Data Direction register + 0x03 RW PBDDR No Port B Data Direction register + 0x04 RW PCDDR No Port C Data Direction register + 0x05 RW PIVR No Port Interrupt vector register + 0x06 RW PACR No Port A Control register + 0x07 RW PBCR No Port B Control register + 0x08 RW PADR May Port A Data register + 0x09 RW PBDR May Port B Data register + 0x0a RO PAAR No Port A Alternate register + 0x0b RO PBAR No Port B Alternate register + 0x0c RW PCDR No Port C Data register + 0x0d RW PSR May Port Status register + 0x0e n/a + 0x0f n/a + 0x10 RW TCR No Timer Control Register + 0x11 RW TIVR No Timer Interrupt Vector Register + 0x12 n/a + 0x13 RW CPRH No Counter Preload Register High + 0x14 RW CPRM No Counter Preload Register Middle + 0x15 RW CPRL No Counter Preload Register Low + 0x17 RO CNTRH No Counter Register High + 0x18 RO CNTRM No Counter Register Middle + 0x19 RO CNTRL No Counter Register Low + 0x1A RW TSR May Timer Status Register + +*/ + + diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h new file mode 100644 index 00000000000..6bae0fd63a4 --- /dev/null +++ b/src/emu/machine/68230pit.h @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:Joakim Larsson Edström +/********************************************************************** + + Motorola MC68230 PI/T Parallell Interface and Timer + +**********************************************************************/ + +#define PGCR 0x00 /* Port General Control register */ +#define PSRR 0x01 /* Port Service Request register */ +#define PADDR 0x02 /* Port A Data Direction register */ +#define PBDDR 0x03 /* Port B Data Direction register */ +#define PCDDR 0x04 /* Port C Data Direction register */ +#define PIVR 0x05 /* Port Interrupt vector register */ +#define PACR 0x06 /* Port A Control register */ +#define PBCR 0x07 /* Port B Control register */ +#define PADR 0x08 /* Port A Data register */ +#define PBDR 0x09 /* Port B Data register */ +#define PAAR 0x0a /* Port A Alternate register */ +#define PBAR 0x0b /* Port B Alternate register */ +#define PCDR 0x0c /* Port C Data register */ +#define PSR 0x0d /* Port Status register */ +#define TCR 0x10 /* Timer Control Register */ +#define TIVR 0x11 /* Timer Interrupt Vector Register */ +#define CPRH 0x13 /* Counter Preload Register High */ +#define CPRM 0x14 /* Counter Preload Register Middle */ +#define CPRL 0x15 /* Counter Preload Register Low */ +#define CNTRH 0x17 /* Counter Register High */ +#define CNTRM 0x18 /* Counter Register Middle */ +#define CNTRL 0x19 /* Counter Register Low */ +#define TSR 0x1A /* Timer Status Register */ + + + From 6df19efcdd984b0d26f049933b64e0598de28dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 16 Jun 2015 22:49:01 +0200 Subject: [PATCH 17/54] got it to compile and then disabled CPU-6 variants for now Conflicts: scripts/target/mame/my.lua --- src/mess/drivers/force68k.c | 46 +++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 392b59cdaa8..1812c9fe7a9 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -82,7 +82,6 @@ Based on the 68ksbc.c - Dump ROM:s - Add 3 x ACIA6850 - Add 1 x 68230 Motorola, Parallel Interface / Timer - - Add 1 x MM58167A RTC - Add 1 x Abort Switch - Add configurable serial connector between ACIA:s and - Real terminal emulator @@ -94,7 +93,7 @@ Based on the 68ksbc.c #include "emu.h" //#include "bus/rs232/rs232.h" -#include "cpu/m68000/m68000.h"/ +#include "cpu/m68000/m68000.h" #include "machine/mm58167.h" //#include "machine/6850acia.h" //#include "machine/clock.h" @@ -168,6 +167,8 @@ static MACHINE_CONFIG_START( forcecpu1, force68k_state ) */ MACHINE_CONFIG_END +#if 0 + static MACHINE_CONFIG_START( forcecpu6, force68k_state ) MCFG_CPU_ADD("maincpu", M68000, 8000000) /* Jumper B10 Mode B */ MCFG_CPU_PROGRAM_MAP(force68k_mem) @@ -191,21 +192,42 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_START( forcecpu6vb, force68k_state ) MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) - MACHINE_CONFIG_END +#endif -/* ROM definition */ -ROM_START( force68k_rom ) +/* ROM definitions */ +ROM_START( forcecpu1 ) ROM_REGION(0x1000000, "maincpu", 0) // ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) ROM_END -/* Driver */ +#if 0 +ROM_START( forcecpu6 ) + ROM_REGION(0x1000000, "maincpu", 0) +ROM_END +ROM_START( forcecpu6a ) + ROM_REGION(0x1000000, "maincpu", 0) +ROM_END + +ROM_START( forcecpu6v ) + ROM_REGION(0x1000000, "maincpu", 0) +ROM_END + +ROM_START( forcecpu6va ) + ROM_REGION(0x1000000, "maincpu", 0) +ROM_END + +ROM_START( forcecpu6vb ) + ROM_REGION(0x1000000, "maincpu", 0) +ROM_END +#endif + +/* Driver */ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1983, force68k_rom, 0, 0, forcecpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_IS_SKELETON ) -COMP( 1989, force68k_rom, 0, 0, forcecpu6, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6", GAME_IS_SKELETON ) -COMP( 1989, force68k_rom, 0, 0, forcecpu6a, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6a", GAME_IS_SKELETON ) -COMP( 1989, force68k_rom, 0, 0, forcecpu6v, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6v", GAME_IS_SKELETON ) -COMP( 1989, force68k_rom, 0, 0, forcecpu6va, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6va", GAME_IS_SKELETON ) -COMP( 1989, force68k_rom, 0, 0, forcecpu6vb, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6vb", GAME_IS_SKELETON ) +COMP( 1983, forcecpu1, 0, 0, forcecpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_IS_SKELETON ) +//COMP( 1989, forcecpu6, 0, 0, forcecpu6, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6", GAME_IS_SKELETON ) +//COMP( 1989, forcecpu6a, 0, 0, forcecpu6a, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6a", GAME_IS_SKELETON ) +//COMP( 1989, forcecpu6v, 0, 0, forcecpu6v, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6v", GAME_IS_SKELETON ) +//COMP( 1989, forcecpu6va, 0, 0, forcecpu6va, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6va", GAME_IS_SKELETON ) +//COMP( 1989, forcecpu6vb, 0, 0, forcecpu6vb, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6vb", GAME_IS_SKELETON ) From d7685ca35c6eb911c707bd04f8f344bb3484b0cf Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Wed, 17 Jun 2015 22:26:57 +0200 Subject: [PATCH 18/54] 68230 device improvements, not yet compiling --- src/emu/machine/68230pit.c | 67 +++++++++++++++ src/emu/machine/68230pit.h | 161 +++++++++++++++++++++++++++++++------ 2 files changed, 205 insertions(+), 23 deletions(-) diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c index c31dcf2b36b..7ad79764bf5 100644 --- a/src/emu/machine/68230pit.c +++ b/src/emu/machine/68230pit.c @@ -42,3 +42,70 @@ */ +#include "emu.h" +#include "68230pit.h" + +/*************************************************************************** + IMPLEMENTATION +***************************************************************************/ + +// device type definition +const device_type PIT68230 = &device_creator; + +//------------------------------------------------- +// pit68230_device - constructor +//------------------------------------------------- + +pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, PIT68230, "68230 PI/T", tag, owner, clock, "pit68230", __FILE__), + m_internal_clock(0.0), + m_out0_cb(*this), + m_out1_cb(*this), + m_out2_cb(*this), + m_irq_cb(*this) +{ + m_external_clock = 0.0; +} + +//------------------------------------------------- +// tick +//------------------------------------------------- + +void ptm6840_device::tick(int counter, int count) +{ + if (counter == 2) + { + m_t3_scaler += count; + + if ( m_t3_scaler > m_t3_divisor - 1) + { + subtract_from_counter(counter, 1); + m_t3_scaler = 0; + } + } + else + { + subtract_from_counter(counter, count); + } +} + + +//------------------------------------------------- +// set_clock - set clock status (0 or 1) +//------------------------------------------------- + +void ptm6840_device::set_clock(int idx, int state) +{ + m_clk[idx] = state; + + if (!(m_control_reg[idx] & 0x02)) + { + if (state) + { + tick(idx, 1); + } + } +} + +WRITE_LINE_MEMBER( pit68230_device::set_c1 ) { set_clock(state); } + diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h index 6bae0fd63a4..412b4af1979 100644 --- a/src/emu/machine/68230pit.h +++ b/src/emu/machine/68230pit.h @@ -5,30 +5,145 @@ Motorola MC68230 PI/T Parallell Interface and Timer **********************************************************************/ +#pragma once -#define PGCR 0x00 /* Port General Control register */ -#define PSRR 0x01 /* Port Service Request register */ -#define PADDR 0x02 /* Port A Data Direction register */ -#define PBDDR 0x03 /* Port B Data Direction register */ -#define PCDDR 0x04 /* Port C Data Direction register */ -#define PIVR 0x05 /* Port Interrupt vector register */ -#define PACR 0x06 /* Port A Control register */ -#define PBCR 0x07 /* Port B Control register */ -#define PADR 0x08 /* Port A Data register */ -#define PBDR 0x09 /* Port B Data register */ -#define PAAR 0x0a /* Port A Alternate register */ -#define PBAR 0x0b /* Port B Alternate register */ -#define PCDR 0x0c /* Port C Data register */ -#define PSR 0x0d /* Port Status register */ -#define TCR 0x10 /* Timer Control Register */ -#define TIVR 0x11 /* Timer Interrupt Vector Register */ -#define CPRH 0x13 /* Counter Preload Register High */ -#define CPRM 0x14 /* Counter Preload Register Middle */ -#define CPRL 0x15 /* Counter Preload Register Low */ -#define CNTRH 0x17 /* Counter Register High */ -#define CNTRM 0x18 /* Counter Register Middle */ -#define CNTRL 0x19 /* Counter Register Low */ -#define TSR 0x1A /* Timer Status Register */ +#ifndef __68230PTI_H__ +#define __68230PTI_H__ + +#include "emu.h" + +#define PIT_68230_PGCR 0x00 /* Port General Control register */ +#define PIT_68230_PSRR 0x01 /* Port Service Request register */ +#define PIT_68230_PADDR 0x02 /* Port A Data Direction register */ +#define PIT_68230_PBDDR 0x03 /* Port B Data Direction register */ +#define PIT_68230_PCDDR 0x04 /* Port C Data Direction register */ +#define PIT_68230_PIVR 0x05 /* Port Interrupt vector register */ +#define PIT_68230_PACR 0x06 /* Port A Control register */ +#define PIT_68230_PBCR 0x07 /* Port B Control register */ +#define PIT_68230_PADR 0x08 /* Port A Data register */ +#define PIT_68230_PBDR 0x09 /* Port B Data register */ +#define PIT_68230_PAAR 0x0a /* Port A Alternate register */ +#define PIT_68230_PBAR 0x0b /* Port B Alternate register */ +#define PIT_68230_PCDR 0x0c /* Port C Data register */ +#define PIT_68230_PSR 0x0d /* Port Status register */ +#define PIT_68230_TCR 0x10 /* Timer Control Register */ +#define PIT_68230_TIVR 0x11 /* Timer Interrupt Vector Register */ +#define PIT_68230_CPRH 0x13 /* Counter Preload Register High */ +#define PIT_68230_CPRM 0x14 /* Counter Preload Register Middle */ +#define PIT_68230_CPRL 0x15 /* Counter Preload Register Low */ +#define PIT_68230_CNTRH 0x17 /* Counter Register High */ +#define PIT_68230_CNTRM 0x18 /* Counter Register Middle */ +#define PIT_68230_CNTRL 0x19 /* Counter Register Low */ +#define PIT_68230_TSR 0x1A /* Timer Status Register */ + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> pit68230_device + +class pit68230_device : public device_t +{ +public: + // construction/destruction + pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + static void set_internal_clock(device_t &device, double clock) { downcast(device).m_internal_clock = clock; } + static void set_external_clock(device_t &device, double clock) { downcast(device).m_external_clock = clock; } + + template static devcb_base &set_out0_callback(device_t &device, _Object object) { return downcast(device).m_out0_cb.set_callback(object); } + template static devcb_base &set_out1_callback(device_t &device, _Object object) { return downcast(device).m_out1_cb.set_callback(object); } + template static devcb_base &set_out2_callback(device_t &device, _Object object) { return downcast(device).m_out2_cb.set_callback(object); } + template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } + + int status(int clock) const { return m_enabled[clock]; } // get whether timer is enabled + int irq_state() const { return m_IRQ; } // get IRQ state + UINT16 count(int counter) const { return compute_counter(counter); } // get counter value + void set_ext_clock(int counter, double clock); // set clock frequency + int ext_clock(int counter) const { return m_external_clock[counter]; } // get clock frequency + + DECLARE_WRITE8_MEMBER( write ); + void write(offs_t offset, UINT8 data) { write(machine().driver_data()->generic_space(), offset, data); } + DECLARE_READ8_MEMBER( read ); + UINT8 read(offs_t offset) { return read(machine().driver_data()->generic_space(), offset); } + + void set_gate(int idx, int state); + DECLARE_WRITE_LINE_MEMBER( set_g1 ); + DECLARE_WRITE_LINE_MEMBER( set_g2 ); + DECLARE_WRITE_LINE_MEMBER( set_g3 ); + + void set_clock(int idx, int state); + DECLARE_WRITE_LINE_MEMBER( set_c1 ); + DECLARE_WRITE_LINE_MEMBER( set_c2 ); + DECLARE_WRITE_LINE_MEMBER( set_c3 ); + + void update_interrupts(); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + +private: + void subtract_from_counter(int counter, int count); + void tick(int counter, int count); + void timeout(int idx); + + UINT16 compute_counter(int counter) const; + void reload_count(int idx); + +/* + enum + { + PTM_6840_CTRL1 = 0, + PTM_6840_CTRL2 = 1, + PTM_6840_STATUS = 1, + PTM_6840_MSBBUF1 = 2, + PTM_6840_LSB1 = 3, + PTM_6840_MSBBUF2 = 4, + PTM_6840_LSB2 = 5, + PTM_6840_MSBBUF3 = 6, + PTM_6840_LSB3 = 7, + }; +*/ + double m_internal_clock; + double m_external_clock[3]; + + devcb_write8 m_out0_cb; + devcb_write8 m_out1_cb; + devcb_write8 m_out2_cb; + devcb_write_line m_irq_cb; // function called if IRQ line changes + + UINT8 m_control_reg[3]; + UINT8 m_output[3]; // Output states + UINT8 m_gate[3]; // Input gate states + UINT8 m_clk; // Clock states + UINT8 m_enabled[3]; + UINT8 m_mode[3]; + UINT8 m_fired[3]; + UINT8 m_t3_divisor; + UINT8 m_t3_scaler; + UINT8 m_IRQ; + UINT8 m_status_reg; + UINT8 m_status_read_since_int; + UINT8 m_lsb_buffer; + UINT8 m_msb_buffer; + + // Each PTM has 3 timers + emu_timer *m_timer[3]; + + UINT16 m_latch[3]; + UINT16 m_counter[3]; + + static const char *const opmode[]; +}; + + +// device type definition +extern const device_type PIT68230; + +#endif // __68230PTI__ From 08e1a1db38e35ca57a38d607d5287cf4918c1257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 27 Jun 2015 11:51:02 +0200 Subject: [PATCH 19/54] Added serial ports and changed names to the less than 8 chars fccpu --- src/mess/drivers/force68k.c | 119 +++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 44 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 1812c9fe7a9..30c848993b2 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -26,7 +26,7 @@ Address Range Description OAO 000 - OBF FFF USER EPROMArea 0C0 041 - 0C0 043 ACIA (P3) Host 0C0 080 - 0C0 082 ACIA (P4) Terminal -0C0 101 - 0C0 103 ACIA (P3) Remote +0C0 101 - 0C0 103 ACIA (P5) Remote 0C0 401 - 0C0 42F RTC OEO 001 - 0E0 035 PI/T OEO 200 - 0E0 2FF FPU @@ -95,40 +95,47 @@ Based on the 68ksbc.c //#include "bus/rs232/rs232.h" #include "cpu/m68000/m68000.h" #include "machine/mm58167.h" -//#include "machine/6850acia.h" -//#include "machine/clock.h" +#include "machine/6850acia.h" +#include "machine/clock.h" class force68k_state : public driver_device { public: force68k_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_rtc(*this, "rtc") -// m_acia1(*this, "acia1") -// m_acia2(*this, "acia2") -// m_acia3(*this, "acia3") + // m_rtc(*this, "rtc") + m_maincpu(*this, "maincpu"), + m_aciahost(*this, "aciahost"), + m_aciaterm(*this, "aciaterm"), + m_aciaremt(*this, "aciaremt") { } -// DECLARE_WRITE_LINE_MEMBER(write_acia_clock); + DECLARE_WRITE_LINE_MEMBER(write_aciahost_clock); + DECLARE_WRITE_LINE_MEMBER(write_aciaterm_clock); + DECLARE_WRITE_LINE_MEMBER(write_aciaremt_clock); private: required_device m_maincpu; - required_device m_rtc; -// required_device m_acia1; -// required_device m_acia2; -// required_device m_acia3; + // required_device m_rtc; + required_device m_aciahost; + required_device m_aciaterm; + required_device m_aciaremt; }; static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x000000, 0x000007) AM_ROM /* Vectors mapped from System EPROM */ - AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ - AM_RANGE(0x080008, 0x09ffff) AM_ROM /* System EPROM Area */ - AM_RANGE(0x0e0401, 0x0e0421) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0x00ff) -// AM_RANGE(0x0e0000, 0x0e0001) AM_DEVREADWRITE8("acia", acia6850_device, status_r, control_w, 0x00ff) -// AM_RANGE(0x0e0002, 0x0e0003) AM_DEVREADWRITE8("acia", acia6850_device, data_r, data_w, 0x00ff) +// AM_RANGE(0x000000, 0x000000) AM_ROM /* Vectors mapped from System EPROM */ +// AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ + AM_RANGE(0x000000, 0x01ffff) AM_RAM /* All DRAM for debug */ + AM_RANGE(0x080000, 0x09ffff) AM_ROM /* System EPROM Area */ +// AM_RANGE(0x0e0400, 0x0e0420) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) + AM_RANGE(0x0c0040, 0x0c0041) AM_DEVREADWRITE8("aciahost", acia6850_device, status_r, control_w, 0x00ff) + AM_RANGE(0x0c0042, 0x0c0043) AM_DEVREADWRITE8("aciahost", acia6850_device, data_r, data_w, 0x00ff) + AM_RANGE(0x0c0080, 0x0c0081) AM_DEVREADWRITE8("aciaterm", acia6850_device, status_r, control_w, 0xff00) + AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("aciaterm", acia6850_device, data_r, data_w, 0xff00) + AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff) + AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff) // AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ // AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ @@ -140,21 +147,45 @@ static INPUT_PORTS_START( force68k ) INPUT_PORTS_END -#if 0 -WRITE_LINE_MEMBER(force68k_state::write_acia_clock) -{ - m_acia->write_txc(state); - m_acia->write_rxc(state); +WRITE_LINE_MEMBER(force68k_state::write_aciahost_clock) +{ + m_aciahost->write_txc(state); + m_aciahost->write_rxc(state); } -#endif -static MACHINE_CONFIG_START( forcecpu1, force68k_state ) +WRITE_LINE_MEMBER(force68k_state::write_aciaterm_clock) +{ + m_aciaterm->write_txc(state); + m_aciaterm->write_rxc(state); +} + +WRITE_LINE_MEMBER(force68k_state::write_aciaremt_clock) +{ + m_aciaremt->write_txc(state); + m_aciaremt->write_rxc(state); +} + +static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 8000000) MCFG_CPU_PROGRAM_MAP(force68k_mem) + /* P3/Host Port config */ + MCFG_DEVICE_ADD("aciahost", ACIA6850, 0) + MCFG_DEVICE_ADD("aciahost_clock", CLOCK, 153600) /* 9600 x 16 */ + MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciahost_clock)) + + /* P4/Terminal Port config */ + MCFG_DEVICE_ADD("aciaterm", ACIA6850, 0) + MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, 153600) /* 9600 x 16 */ + MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) + + /* P5/Host Port config */ + MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0) + MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, 153600) /* 9600 x 16 */ + MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) + /* - MCFG_DEVICE_ADD("acia", ACIA6850, 0) MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) @@ -169,65 +200,65 @@ MACHINE_CONFIG_END #if 0 -static MACHINE_CONFIG_START( forcecpu6, force68k_state ) +static MACHINE_CONFIG_START( fccpu6, force68k_state ) MCFG_CPU_ADD("maincpu", M68000, 8000000) /* Jumper B10 Mode B */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( forcecpu6a, force68k_state ) +static MACHINE_CONFIG_START( fccpu6a, force68k_state ) MCFG_CPU_ADD("maincpu", M68000, 12500000) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( forcecpu6v, force68k_state ) +static MACHINE_CONFIG_START( fccpu6v, force68k_state ) MCFG_CPU_ADD("maincpu", M68010, 8000000) /* Jumper B10 Mode B */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( forcecpu6va, force68k_state ) +static MACHINE_CONFIG_START( fccpu6va, force68k_state ) MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( forcecpu6vb, force68k_state ) +static MACHINE_CONFIG_START( fccpu6vb, force68k_state ) MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END #endif /* ROM definitions */ -ROM_START( forcecpu1 ) +ROM_START( fccpu1 ) ROM_REGION(0x1000000, "maincpu", 0) // ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) ROM_END #if 0 -ROM_START( forcecpu6 ) +ROM_START( fccpu6 ) ROM_REGION(0x1000000, "maincpu", 0) ROM_END -ROM_START( forcecpu6a ) +ROM_START( fccpu6a ) ROM_REGION(0x1000000, "maincpu", 0) ROM_END -ROM_START( forcecpu6v ) +ROM_START( fccpu6v ) ROM_REGION(0x1000000, "maincpu", 0) ROM_END -ROM_START( forcecpu6va ) +ROM_START( fccpu6va ) ROM_REGION(0x1000000, "maincpu", 0) ROM_END -ROM_START( forcecpu6vb ) +ROM_START( fccpu6vb ) ROM_REGION(0x1000000, "maincpu", 0) ROM_END #endif /* Driver */ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1983, forcecpu1, 0, 0, forcecpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_IS_SKELETON ) -//COMP( 1989, forcecpu6, 0, 0, forcecpu6, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6", GAME_IS_SKELETON ) -//COMP( 1989, forcecpu6a, 0, 0, forcecpu6a, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6a", GAME_IS_SKELETON ) -//COMP( 1989, forcecpu6v, 0, 0, forcecpu6v, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6v", GAME_IS_SKELETON ) -//COMP( 1989, forcecpu6va, 0, 0, forcecpu6va, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6va", GAME_IS_SKELETON ) -//COMP( 1989, forcecpu6vb, 0, 0, forcecpu6vb, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6vb", GAME_IS_SKELETON ) +COMP( 1983, fccpu1, 0, 0, fccpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_IS_SKELETON ) +//COMP( 1989, fccpu6, 0, 0, fccpu6, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6", GAME_IS_SKELETON ) +//COMP( 1989, fccpu6a, 0, 0, fccpu6a, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6a", GAME_IS_SKELETON ) +//COMP( 1989, fccpu6v, 0, 0, fccpu6v, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6v", GAME_IS_SKELETON ) +//COMP( 1989, fccpu6va, 0, 0, fccpu6va, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6va", GAME_IS_SKELETON ) +//COMP( 1989, fccpu6vb, 0, 0, fccpu6vb, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6vb", GAME_IS_SKELETON ) From 207970b65ad0cba3e92288f9d477a940f6370bbc Mon Sep 17 00:00:00 2001 From: Joakim Larsson Edstrom Date: Tue, 30 Jun 2015 15:11:47 +0200 Subject: [PATCH 20/54] Support for Terminal and Zbug (from 68ksbc) firmware added, not completed but works --- src/mess/drivers/force68k.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 30c848993b2..e8dbfa824db 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -74,13 +74,13 @@ enabled/disabled via a jumper field. Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET, SYSFAIL and SYSCLK signal (16 MHz). - Based on the 68ksbc.c TODO: - Memory map - Dump ROM:s - - Add 3 x ACIA6850 + - Finish 3 x ACIA6850, terminal serial interface first + - Add 1 x 14411 Motorola, Baudrate Generator - Add 1 x 68230 Motorola, Parallel Interface / Timer - Add 1 x Abort Switch - Add configurable serial connector between ACIA:s and @@ -92,7 +92,7 @@ Based on the 68ksbc.c ****************************************************************************/ #include "emu.h" -//#include "bus/rs232/rs232.h" +#include "bus/rs232/rs232.h" #include "cpu/m68000/m68000.h" #include "machine/mm58167.h" #include "machine/6850acia.h" @@ -127,7 +127,7 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) ADDRESS_MAP_UNMAP_HIGH // AM_RANGE(0x000000, 0x000000) AM_ROM /* Vectors mapped from System EPROM */ // AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ - AM_RANGE(0x000000, 0x01ffff) AM_RAM /* All DRAM for debug */ + AM_RANGE(0x000000, 0x01ffff) AM_ROM /* All DRAM for debug */ AM_RANGE(0x080000, 0x09ffff) AM_ROM /* System EPROM Area */ // AM_RANGE(0x0e0400, 0x0e0420) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) AM_RANGE(0x0c0040, 0x0c0041) AM_DEVREADWRITE8("aciahost", acia6850_device, status_r, control_w, 0x00ff) @@ -139,6 +139,7 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) // AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ // AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ + AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for Zbug */ // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ ADDRESS_MAP_END @@ -177,10 +178,18 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* P4/Terminal Port config */ MCFG_DEVICE_ADD("aciaterm", ACIA6850, 0) + + MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232trm", rs232_port_device, write_txd)) + MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232trm", rs232_port_device, write_rts)) + + MCFG_RS232_PORT_ADD("rs232trm", default_rs232_devices, "terminal") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd)) + MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts)) + MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, 153600) /* 9600 x 16 */ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) - /* P5/Host Port config */ + /* P5/Remote Port config */ MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0) MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, 153600) /* 9600 x 16 */ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) @@ -229,6 +238,7 @@ MACHINE_CONFIG_END /* ROM definitions */ ROM_START( fccpu1 ) ROM_REGION(0x1000000, "maincpu", 0) + ROM_LOAD( "zbug4.bin", 0x0000, 0x3000, CRC(670d96ee) SHA1(57fbe38ae4fb06b8d9afe21d92fdd981adbf1bb1) ) // ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) ROM_END From 4f4433902094c6464db394af99dda46ff1860022 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Edstrom Date: Thu, 2 Jul 2015 10:49:08 +0200 Subject: [PATCH 21/54] Moved ROM to right place and converted crystal values to XTAL_* defines --- src/mess/drivers/force68k.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index e8dbfa824db..e2b160899de 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -168,12 +168,12 @@ WRITE_LINE_MEMBER(force68k_state::write_aciaremt_clock) static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 8000000) + MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) MCFG_CPU_PROGRAM_MAP(force68k_mem) /* P3/Host Port config */ MCFG_DEVICE_ADD("aciahost", ACIA6850, 0) - MCFG_DEVICE_ADD("aciahost_clock", CLOCK, 153600) /* 9600 x 16 */ + MCFG_DEVICE_ADD("aciahost_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciahost_clock)) /* P4/Terminal Port config */ @@ -186,12 +186,12 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts)) - MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, 153600) /* 9600 x 16 */ + MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) /* P5/Remote Port config */ MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0) - MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, 153600) /* 9600 x 16 */ + MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) /* @@ -210,35 +210,35 @@ MACHINE_CONFIG_END #if 0 static MACHINE_CONFIG_START( fccpu6, force68k_state ) - MCFG_CPU_ADD("maincpu", M68000, 8000000) /* Jumper B10 Mode B */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) /* Jumper B10 Mode B */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END static MACHINE_CONFIG_START( fccpu6a, force68k_state ) - MCFG_CPU_ADD("maincpu", M68000, 12500000) /* Jumper B10 Mode A */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_12_5MHz) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END static MACHINE_CONFIG_START( fccpu6v, force68k_state ) - MCFG_CPU_ADD("maincpu", M68010, 8000000) /* Jumper B10 Mode B */ + MCFG_CPU_ADD("maincpu", M68010, XTAL_8MHz) /* Jumper B10 Mode B */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END static MACHINE_CONFIG_START( fccpu6va, force68k_state ) - MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ + MCFG_CPU_ADD("maincpu", M68010, XTAL_12_5MHz) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END static MACHINE_CONFIG_START( fccpu6vb, force68k_state ) - MCFG_CPU_ADD("maincpu", M68010, 12500000) /* Jumper B10 Mode A */ + MCFG_CPU_ADD("maincpu", M68010, XTAL_12_5MHz) /* Jumper B10 Mode A */ MCFG_CPU_PROGRAM_MAP(force68k_mem) MACHINE_CONFIG_END #endif /* ROM definitions */ ROM_START( fccpu1 ) - ROM_REGION(0x1000000, "maincpu", 0) - ROM_LOAD( "zbug4.bin", 0x0000, 0x3000, CRC(670d96ee) SHA1(57fbe38ae4fb06b8d9afe21d92fdd981adbf1bb1) ) + ROM_REGION(0x100000, "maincpu", 0) + ROM_LOAD( "zbug4.bin", 0x080000, 0x3000, CRC(670d96ee) SHA1(57fbe38ae4fb06b8d9afe21d92fdd981adbf1bb1) ) // ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) ROM_END From 5d2f322c96286256cf57d39298e54a6060c95163 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Edstrom Date: Thu, 2 Jul 2015 11:09:09 +0200 Subject: [PATCH 22/54] Added fake read driver for boot vector mirroring --- src/mess/drivers/force68k.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index e2b160899de..8418d2c07df 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -110,7 +110,7 @@ public: m_aciaremt(*this, "aciaremt") { } - + DECLARE_READ16_MEMBER(bootvect_r); DECLARE_WRITE_LINE_MEMBER(write_aciahost_clock); DECLARE_WRITE_LINE_MEMBER(write_aciaterm_clock); DECLARE_WRITE_LINE_MEMBER(write_aciaremt_clock); @@ -124,22 +124,21 @@ private: }; static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) - ADDRESS_MAP_UNMAP_HIGH -// AM_RANGE(0x000000, 0x000000) AM_ROM /* Vectors mapped from System EPROM */ -// AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ - AM_RANGE(0x000000, 0x01ffff) AM_ROM /* All DRAM for debug */ - AM_RANGE(0x080000, 0x09ffff) AM_ROM /* System EPROM Area */ -// AM_RANGE(0x0e0400, 0x0e0420) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x000000, 0x000007) AM_ROM AM_READ(bootvect_r) /* Vectors mapped from System EPROM */ + AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */ + AM_RANGE(0x080000, 0x09ffff) AM_ROM /* System EPROM Area */ +// AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ AM_RANGE(0x0c0040, 0x0c0041) AM_DEVREADWRITE8("aciahost", acia6850_device, status_r, control_w, 0x00ff) AM_RANGE(0x0c0042, 0x0c0043) AM_DEVREADWRITE8("aciahost", acia6850_device, data_r, data_w, 0x00ff) AM_RANGE(0x0c0080, 0x0c0081) AM_DEVREADWRITE8("aciaterm", acia6850_device, status_r, control_w, 0xff00) AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("aciaterm", acia6850_device, data_r, data_w, 0xff00) AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff) AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff) -// AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area */ +// AM_RANGE(0x0e0400, 0x0e0420) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) // AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ + AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for bin patched bug, remove once not needed */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ - AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for Zbug */ // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ ADDRESS_MAP_END @@ -147,6 +146,11 @@ ADDRESS_MAP_END static INPUT_PORTS_START( force68k ) INPUT_PORTS_END +READ16_MEMBER(force68k_state::bootvect_r) +{ + UINT16 ret[] = {0x0000, 0x0000, 0x0008, 0x2000}; // Fake reset values + return ret[offset]; +} WRITE_LINE_MEMBER(force68k_state::write_aciahost_clock) { From faa58f590908d7e99f51d9763711aa931db5e677 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Edstrom Date: Thu, 2 Jul 2015 23:03:49 +0200 Subject: [PATCH 23/54] Added correct read handler for bootvector and changed zbug (now defunct) values --- src/mess/drivers/force68k.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 8418d2c07df..4aef8496501 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -111,6 +111,7 @@ public: { } DECLARE_READ16_MEMBER(bootvect_r); + virtual void machine_start(); DECLARE_WRITE_LINE_MEMBER(write_aciahost_clock); DECLARE_WRITE_LINE_MEMBER(write_aciaterm_clock); DECLARE_WRITE_LINE_MEMBER(write_aciaremt_clock); @@ -121,6 +122,8 @@ private: required_device m_aciahost; required_device m_aciaterm; required_device m_aciaremt; + // Pointer to ROM0 + UINT16 *m_sysrom; }; static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) @@ -146,10 +149,14 @@ ADDRESS_MAP_END static INPUT_PORTS_START( force68k ) INPUT_PORTS_END +void force68k_state::machine_start() +{ + m_sysrom = (UINT16*)(memregion("maincpu")->base() + 0x080000); +} + READ16_MEMBER(force68k_state::bootvect_r) { - UINT16 ret[] = {0x0000, 0x0000, 0x0008, 0x2000}; // Fake reset values - return ret[offset]; + return m_sysrom[offset]; } WRITE_LINE_MEMBER(force68k_state::write_aciahost_clock) @@ -241,8 +248,8 @@ MACHINE_CONFIG_END /* ROM definitions */ ROM_START( fccpu1 ) - ROM_REGION(0x100000, "maincpu", 0) - ROM_LOAD( "zbug4.bin", 0x080000, 0x3000, CRC(670d96ee) SHA1(57fbe38ae4fb06b8d9afe21d92fdd981adbf1bb1) ) + ROM_REGION(0x1000000, "maincpu", 0) + ROM_LOAD( "zbug5.bin", 0x080000, 0x3000, CRC(04445fe1) SHA1(d59214171385aead05279e31fe9d354c63fb893a) ) // ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) ROM_END From 760066a3b33bfa26e717ed05c5c2aeca683d97b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Mon, 6 Jul 2015 19:40:35 +0200 Subject: [PATCH 24/54] Added support for dumped ROM:s from the cpu1 PCB --- src/mess/drivers/force68k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 4aef8496501..c6e877c6a7d 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -78,7 +78,6 @@ Based on the 68ksbc.c TODO: - Memory map - - Dump ROM:s - Finish 3 x ACIA6850, terminal serial interface first - Add 1 x 14411 Motorola, Baudrate Generator - Add 1 x 68230 Motorola, Parallel Interface / Timer @@ -249,8 +248,9 @@ MACHINE_CONFIG_END /* ROM definitions */ ROM_START( fccpu1 ) ROM_REGION(0x1000000, "maincpu", 0) - ROM_LOAD( "zbug5.bin", 0x080000, 0x3000, CRC(04445fe1) SHA1(d59214171385aead05279e31fe9d354c63fb893a) ) -// ROM_LOAD( "forcesys68kV1.0L.bin", 0x0000, 0x2f78, CRC(20a8d0d0) SHA1(544fd8bd8ed017115388c8b0f7a7a59a32253e43) ) +// ROM_LOAD( "zbug5.bin", 0x080000, 0x3000, CRC(04445fe1) SHA1(d59214171385aead05279e31fe9d354c63fb893a) ) + ROM_LOAD16_BYTE( "fccpu1V1.0L.j8.bin", 0x080001, 0x2000, CRC(3ac6f08f) SHA1(502f6547b508d8732bd68bbbb2402d8c30fefc3b) ) + ROM_LOAD16_BYTE( "fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC(035315fb) SHA1(90dc44d9c25d28428233e6846da6edce2d69e440) ) ROM_END #if 0 From 27d9db181114af3ebe999c5420243603e997342b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Thu, 9 Jul 2015 21:28:59 +0200 Subject: [PATCH 25/54] Removed legacy RAM from address map and added correct baud generator crystal --- src/mess/drivers/force68k.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index c6e877c6a7d..a41db851f22 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -80,8 +80,9 @@ Based on the 68ksbc.c - Memory map - Finish 3 x ACIA6850, terminal serial interface first - Add 1 x 14411 Motorola, Baudrate Generator + - Add switches to strap baudrate configuration - Add 1 x 68230 Motorola, Parallel Interface / Timer - - Add 1 x Abort Switch + - Add 1 x Abort Switch - Add configurable serial connector between ACIA:s and - Real terminal emulator - Debug console @@ -97,6 +98,8 @@ Based on the 68ksbc.c #include "machine/6850acia.h" #include "machine/clock.h" +#define BAUDGEN_CLOCK XTAL_1_8432MHz + class force68k_state : public driver_device { public: @@ -138,8 +141,8 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff) AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff) // AM_RANGE(0x0e0400, 0x0e0420) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) -// AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* IO interfaces */ - AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for bin patched bug, remove once not needed */ +// AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* PI/T 68230 IO interfaces */ +// AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for bin patched bug, remove once not needed */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ ADDRESS_MAP_END @@ -178,7 +181,7 @@ WRITE_LINE_MEMBER(force68k_state::write_aciaremt_clock) static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) + MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz / 2) MCFG_CPU_PROGRAM_MAP(force68k_mem) /* P3/Host Port config */ @@ -196,7 +199,8 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts)) - MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ + //MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ + MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, BAUDGEN_CLOCK / 2) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) /* P5/Remote Port config */ From 338f3b14350164d118f973e43a103f973f0e0f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 11 Jul 2015 21:10:00 +0200 Subject: [PATCH 26/54] Compiles but produces printouts only when used from fccpu1 driver for needed registers only --- src/emu/machine/68230pit.c | 150 ++++++++++++++++++------------------ src/emu/machine/68230pit.h | 151 +++++++++---------------------------- 2 files changed, 112 insertions(+), 189 deletions(-) diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c index 7ad79764bf5..161fe414490 100644 --- a/src/emu/machine/68230pit.c +++ b/src/emu/machine/68230pit.c @@ -4,41 +4,30 @@ Motorola MC68230 PI/T Parallell Interface and Timer +Revisions + 2015-07-15 JLE initial + +Todo + - Add clock and timers + - Add all missing registers + - Add configuration **********************************************************************/ /* - Registers ------------------------------------------------------------------------ - Offset Reset R/W - RS1-RS5 Name Value Reset Description ------------------------------------------------------------------------ - 0x00 RW PGCR No Port General Control register - 0x01 RW PSRR No Port Service Request register - 0x02 RW PADDR No Port A Data Direction register - 0x03 RW PBDDR No Port B Data Direction register - 0x04 RW PCDDR No Port C Data Direction register - 0x05 RW PIVR No Port Interrupt vector register - 0x06 RW PACR No Port A Control register - 0x07 RW PBCR No Port B Control register - 0x08 RW PADR May Port A Data register - 0x09 RW PBDR May Port B Data register - 0x0a RO PAAR No Port A Alternate register - 0x0b RO PBAR No Port B Alternate register - 0x0c RW PCDR No Port C Data register - 0x0d RW PSR May Port Status register - 0x0e n/a - 0x0f n/a - 0x10 RW TCR No Timer Control Register - 0x11 RW TIVR No Timer Interrupt Vector Register - 0x12 n/a - 0x13 RW CPRH No Counter Preload Register High - 0x14 RW CPRM No Counter Preload Register Middle - 0x15 RW CPRL No Counter Preload Register Low - 0x17 RO CNTRH No Counter Register High - 0x18 RO CNTRM No Counter Register Middle - 0x19 RO CNTRL No Counter Register Low - 0x1A RW TSR May Timer Status Register +Force CPU-1 init sequence +0801EA 0E0000 W 0000 PGCR data_w: 0000 -> 0000 & 00ff +0801EA 0E0002 W 0000 PSRR data_w: 0000 -> 0001 & 00ff +0801EA 0E0004 W FFFF PADDR data_w: 00ff -> 0002 & 00ff +0801EA 0E0006 W 0000 PBDDR data_w: 0000 -> 0003 & 00ff +0801F0 0E000C W 6060 PACR data_w: 0060 -> 0006 & 00ff +0801F6 0E000E W A0A0 PBCR data_w: 00a0 -> 0007 & 00ff +0801FC 0E0000 W 3030 PGCR data_w: 0030 -> 0000 & 00ff +080202 0E000E W A8A8 PBCR data_w: 00a8 -> 0007 & 00ff +080210 0E000E W A0A0 PBCR data_w: 00a0 -> 0007 & 00ff +Force CPU-1 after one keypress in terminal +081DC0 0E000C W 6868 PACR +081DC8 0E000C W 6060 PACR */ @@ -57,55 +46,66 @@ const device_type PIT68230 = &device_creator; //------------------------------------------------- pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, PIT68230, "68230 PI/T", tag, owner, clock, "pit68230", __FILE__), - m_internal_clock(0.0), - m_out0_cb(*this), - m_out1_cb(*this), - m_out2_cb(*this), - m_irq_cb(*this) + : device_t(mconfig, PIT68230, "Motorola 68230 PI/T", tag, owner, clock, "pit68230", __FILE__), + m_internal_clock(0.0) { - m_external_clock = 0.0; } -//------------------------------------------------- -// tick -//------------------------------------------------- - -void ptm6840_device::tick(int counter, int count) +void pit68230_device::device_start() { - if (counter == 2) - { - m_t3_scaler += count; + printf("PIT68230 device started\n"); +} - if ( m_t3_scaler > m_t3_divisor - 1) - { - subtract_from_counter(counter, 1); - m_t3_scaler = 0; - } - } - else - { - subtract_from_counter(counter, count); - } +void pit68230_device::device_reset() +{ + printf("PIT68230 device reseted\n"); + m_pgcr = 0; + m_psrr = 0; + m_paddr = 0; + m_pbddr = 0; + m_pacr = 0; + m_pbcr = 0; +} + +WRITE8_MEMBER( pit68230_device::data_w ) +{ + printf("data_w: %04x -> ", data); + switch (offset) + { + case PIT_68230_PGCR: + printf("PGCR"); + m_pgcr = data; + break; + case PIT_68230_PSRR: + printf("PSRR"); + m_psrr = data; + break; + case PIT_68230_PADDR: + printf("PADDR"); + m_paddr = data; + break; + case PIT_68230_PBDDR: + printf("PBDDR"); + m_pbddr = data; + break; + case PIT_68230_PACR: + printf("PACR"); + m_pacr = data; + break; + case PIT_68230_PBCR: + printf("PBCR"); + m_pbcr = data; + break; + default: + printf("unhandled register %02x", offset); + } + printf("\n"); +} + +READ8_MEMBER( pit68230_device::data_r ) +{ + printf("data_r: %04x & %04x\n", offset, mem_mask); + return (UINT8) 0; } -//------------------------------------------------- -// set_clock - set clock status (0 or 1) -//------------------------------------------------- - -void ptm6840_device::set_clock(int idx, int state) -{ - m_clk[idx] = state; - - if (!(m_control_reg[idx] & 0x02)) - { - if (state) - { - tick(idx, 1); - } - } -} - -WRITE_LINE_MEMBER( pit68230_device::set_c1 ) { set_clock(state); } - diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h index 412b4af1979..84d5d667510 100644 --- a/src/emu/machine/68230pit.h +++ b/src/emu/machine/68230pit.h @@ -7,143 +7,66 @@ **********************************************************************/ #pragma once -#ifndef __68230PTI_H__ -#define __68230PTI_H__ +#ifndef __68230PIT_H__ +#define __68230PIT_H__ #include "emu.h" -#define PIT_68230_PGCR 0x00 /* Port General Control register */ -#define PIT_68230_PSRR 0x01 /* Port Service Request register */ -#define PIT_68230_PADDR 0x02 /* Port A Data Direction register */ -#define PIT_68230_PBDDR 0x03 /* Port B Data Direction register */ -#define PIT_68230_PCDDR 0x04 /* Port C Data Direction register */ -#define PIT_68230_PIVR 0x05 /* Port Interrupt vector register */ -#define PIT_68230_PACR 0x06 /* Port A Control register */ -#define PIT_68230_PBCR 0x07 /* Port B Control register */ -#define PIT_68230_PADR 0x08 /* Port A Data register */ -#define PIT_68230_PBDR 0x09 /* Port B Data register */ -#define PIT_68230_PAAR 0x0a /* Port A Alternate register */ -#define PIT_68230_PBAR 0x0b /* Port B Alternate register */ -#define PIT_68230_PCDR 0x0c /* Port C Data register */ -#define PIT_68230_PSR 0x0d /* Port Status register */ -#define PIT_68230_TCR 0x10 /* Timer Control Register */ -#define PIT_68230_TIVR 0x11 /* Timer Interrupt Vector Register */ -#define PIT_68230_CPRH 0x13 /* Counter Preload Register High */ -#define PIT_68230_CPRM 0x14 /* Counter Preload Register Middle */ -#define PIT_68230_CPRL 0x15 /* Counter Preload Register Low */ -#define PIT_68230_CNTRH 0x17 /* Counter Register High */ -#define PIT_68230_CNTRM 0x18 /* Counter Register Middle */ -#define PIT_68230_CNTRL 0x19 /* Counter Register Low */ -#define PIT_68230_TSR 0x1A /* Timer Status Register */ +/*----------------------------------------------------------------------- + Registers RS1-RS5 R/W Description +-------------------------------------------------------------------------*/ +#define PIT_68230_PGCR 0x00 /* RW Port General Control register */ +#define PIT_68230_PSRR 0x01 /* RW Port Service Request register */ +#define PIT_68230_PADDR 0x02 /* RW Port A Data Direction register */ +#define PIT_68230_PBDDR 0x03 /* RW Port B Data Direction register */ +#define PIT_68230_PCDDR 0x04 /* RW Port C Data Direction register */ +#define PIT_68230_PIVR 0x05 /* RW Port Interrupt vector register */ +#define PIT_68230_PACR 0x06 /* RW Port A Control register */ +#define PIT_68230_PBCR 0x07 /* RW Port B Control register */ +#define PIT_68230_PADR 0x08 /* RW Port A Data register */ +#define PIT_68230_PBDR 0x09 /* RW Port B Data register */ +#define PIT_68230_PAAR 0x0a /* RO Port A Alternate register */ +#define PIT_68230_PBAR 0x0b /* RO Port B Alternate register */ +#define PIT_68230_PCDR 0x0c /* RW Port C Data register */ +#define PIT_68230_PSR 0x0d /* RW Port Status register */ +#define PIT_68230_TCR 0x10 /* RW Timer Control Register */ +#define PIT_68230_TIVR 0x11 /* RW Timer Interrupt Vector Register */ +#define PIT_68230_CPRH 0x13 /* RW Counter Preload Register High */ +#define PIT_68230_CPRM 0x14 /* RW Counter Preload Register Middle */ +#define PIT_68230_CPRL 0x15 /* RW Counter Preload Register Low */ +#define PIT_68230_CNTRH 0x17 /* RO Counter Register High */ +#define PIT_68230_CNTRM 0x18 /* RO Counter Register Middle */ +#define PIT_68230_CNTRL 0x19 /* RO Counter Register Low */ +#define PIT_68230_TSR 0x1A /* RW Timer Status Register */ //************************************************************************** // TYPE DEFINITIONS //************************************************************************** - -// ======================> pit68230_device - class pit68230_device : public device_t { public: // construction/destruction pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - - static void set_internal_clock(device_t &device, double clock) { downcast(device).m_internal_clock = clock; } - static void set_external_clock(device_t &device, double clock) { downcast(device).m_external_clock = clock; } - - template static devcb_base &set_out0_callback(device_t &device, _Object object) { return downcast(device).m_out0_cb.set_callback(object); } - template static devcb_base &set_out1_callback(device_t &device, _Object object) { return downcast(device).m_out1_cb.set_callback(object); } - template static devcb_base &set_out2_callback(device_t &device, _Object object) { return downcast(device).m_out2_cb.set_callback(object); } - template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } - - int status(int clock) const { return m_enabled[clock]; } // get whether timer is enabled - int irq_state() const { return m_IRQ; } // get IRQ state - UINT16 count(int counter) const { return compute_counter(counter); } // get counter value - void set_ext_clock(int counter, double clock); // set clock frequency - int ext_clock(int counter) const { return m_external_clock[counter]; } // get clock frequency - - DECLARE_WRITE8_MEMBER( write ); - void write(offs_t offset, UINT8 data) { write(machine().driver_data()->generic_space(), offset, data); } - DECLARE_READ8_MEMBER( read ); - UINT8 read(offs_t offset) { return read(machine().driver_data()->generic_space(), offset); } - - void set_gate(int idx, int state); - DECLARE_WRITE_LINE_MEMBER( set_g1 ); - DECLARE_WRITE_LINE_MEMBER( set_g2 ); - DECLARE_WRITE_LINE_MEMBER( set_g3 ); - - void set_clock(int idx, int state); - DECLARE_WRITE_LINE_MEMBER( set_c1 ); - DECLARE_WRITE_LINE_MEMBER( set_c2 ); - DECLARE_WRITE_LINE_MEMBER( set_c3 ); - - void update_interrupts(); + DECLARE_WRITE8_MEMBER( data_w ); + DECLARE_READ8_MEMBER( data_r ); protected: // device-level overrides virtual void device_start(); virtual void device_reset(); - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: - void subtract_from_counter(int counter, int count); - void tick(int counter, int count); - void timeout(int idx); - - UINT16 compute_counter(int counter) const; - void reload_count(int idx); - -/* - enum - { - PTM_6840_CTRL1 = 0, - PTM_6840_CTRL2 = 1, - PTM_6840_STATUS = 1, - PTM_6840_MSBBUF1 = 2, - PTM_6840_LSB1 = 3, - PTM_6840_MSBBUF2 = 4, - PTM_6840_LSB2 = 5, - PTM_6840_MSBBUF3 = 6, - PTM_6840_LSB3 = 7, - }; -*/ double m_internal_clock; - double m_external_clock[3]; - - devcb_write8 m_out0_cb; - devcb_write8 m_out1_cb; - devcb_write8 m_out2_cb; - devcb_write_line m_irq_cb; // function called if IRQ line changes - - UINT8 m_control_reg[3]; - UINT8 m_output[3]; // Output states - UINT8 m_gate[3]; // Input gate states - UINT8 m_clk; // Clock states - UINT8 m_enabled[3]; - UINT8 m_mode[3]; - UINT8 m_fired[3]; - UINT8 m_t3_divisor; - UINT8 m_t3_scaler; - UINT8 m_IRQ; - UINT8 m_status_reg; - UINT8 m_status_read_since_int; - UINT8 m_lsb_buffer; - UINT8 m_msb_buffer; - - // Each PTM has 3 timers - emu_timer *m_timer[3]; - - UINT16 m_latch[3]; - UINT16 m_counter[3]; - - static const char *const opmode[]; + UINT8 m_pgcr; // Port General Control register + UINT8 m_psrr; // Port Service Request register + UINT8 m_paddr; // Port A Data Direction register + UINT8 m_pbddr; // Port B Data Direction register + UINT8 m_pacr; // Port A Control register + UINT8 m_pbcr; // Port B Control register }; // device type definition extern const device_type PIT68230; - - - -#endif // __68230PTI__ +#endif // __68230PIT__ From 19117955e8bce60b66d7b0228f8f2f4fad4627a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 11 Jul 2015 21:13:00 +0200 Subject: [PATCH 27/54] Added PIT68230 to available machines and enabled it for my configuration Conflicts: scripts/src/machine.lua scripts/target/mame/my.lua --- scripts/src/machine.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index cc729cd11bc..efb4f8f7cef 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -188,7 +188,19 @@ end --------------------------------------------------- -- ---@src/emu/machine/68561mpcc.h,MACHINES["68561MPCC"] = true +--@src/emu/machine/6850acia.h,MACHINES += PIT68230 +--------------------------------------------------- + +if (MACHINES["PIT68230"]~=null) then + files { + MAME_DIR .. "src/emu/machine/68230pit.c", + MAME_DIR .. "src/emu/machine/68230pit.h", + } +end + +--------------------------------------------------- +-- +--@src/emu/machine/68561mpcc.h,MACHINES += 68561MPCC --------------------------------------------------- if (MACHINES["68561MPCC"]~=null) then From 8e3cd0b016030cbab0ae7c9a59d7ee1fc06ccb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Sat, 11 Jul 2015 21:28:41 +0200 Subject: [PATCH 28/54] Added PIT68230 device to driver and removed support for Zbug/68ksbc --- src/mess/drivers/force68k.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index a41db851f22..b258e06866c 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -77,17 +77,16 @@ SYSFAIL and SYSCLK signal (16 MHz). Based on the 68ksbc.c TODO: - - Memory map - Finish 3 x ACIA6850, terminal serial interface first - Add 1 x 14411 Motorola, Baudrate Generator - Add switches to strap baudrate configuration - - Add 1 x 68230 Motorola, Parallel Interface / Timer + - figure our why rs232 "terminal" is not working as for 68ksbc + - Finish 1 x 68230 Motorola, Parallel Interface / Timer - Add 1 x Abort Switch - Add configurable serial connector between ACIA:s and - - Real terminal emulator + - Real terminal emulator, ie rs232 "socket" - Debug console - - VME bus driver - + - Add VME bus driver ****************************************************************************/ @@ -95,6 +94,7 @@ Based on the 68ksbc.c #include "bus/rs232/rs232.h" #include "cpu/m68000/m68000.h" #include "machine/mm58167.h" +#include "machine/68230pit.h" #include "machine/6850acia.h" #include "machine/clock.h" @@ -107,11 +107,13 @@ public: driver_device(mconfig, type, tag), // m_rtc(*this, "rtc") m_maincpu(*this, "maincpu"), + m_pit(*this, "pit"), m_aciahost(*this, "aciahost"), m_aciaterm(*this, "aciaterm"), m_aciaremt(*this, "aciaremt") { } + DECLARE_READ16_MEMBER(bootvect_r); virtual void machine_start(); DECLARE_WRITE_LINE_MEMBER(write_aciahost_clock); @@ -121,10 +123,12 @@ public: private: required_device m_maincpu; // required_device m_rtc; + required_device m_pit; required_device m_aciahost; required_device m_aciaterm; required_device m_aciaremt; - // Pointer to ROM0 + + // Pointer to System ROMs needed by bootvect_r UINT16 *m_sysrom; }; @@ -140,8 +144,9 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("aciaterm", acia6850_device, data_r, data_w, 0xff00) AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff) AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff) -// AM_RANGE(0x0e0400, 0x0e0420) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) -// AM_RANGE(0x0e0000, 0x0fffff) AM_READWRITE_PORT /* PI/T 68230 IO interfaces */ +// AM_RANGE(0x0c0401, 0x0c042f) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) + AM_RANGE(0x0e0000, 0x0e0035) AM_DEVREADWRITE8("pit", pit68230_device, data_r, data_w, 0x00ff) +// AM_RANGE(0x0e0200, 0x0e0380) AM_READWRITE(fpu_r, fpu_w) /* optional FPCP 68881 FPU interface */ // AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for bin patched bug, remove once not needed */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ @@ -199,7 +204,6 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts)) - //MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, BAUDGEN_CLOCK / 2) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) @@ -208,17 +212,9 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) -/* - MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) - MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) + /* PIT Parallel Interface and Timer device */ + MCFG_DEVICE_ADD("pit", PIT68230, 0) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") - MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) - MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) - - MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_acia_clock)) -*/ MACHINE_CONFIG_END #if 0 @@ -252,7 +248,7 @@ MACHINE_CONFIG_END /* ROM definitions */ ROM_START( fccpu1 ) ROM_REGION(0x1000000, "maincpu", 0) -// ROM_LOAD( "zbug5.bin", 0x080000, 0x3000, CRC(04445fe1) SHA1(d59214171385aead05279e31fe9d354c63fb893a) ) + ROM_LOAD16_BYTE( "fccpu1V1.0L.j8.bin", 0x080001, 0x2000, CRC(3ac6f08f) SHA1(502f6547b508d8732bd68bbbb2402d8c30fefc3b) ) ROM_LOAD16_BYTE( "fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC(035315fb) SHA1(90dc44d9c25d28428233e6846da6edce2d69e440) ) ROM_END From a98d75d5ea154b4d00239c24ed2464af62aaa23e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 14 Jul 2015 17:29:05 +0200 Subject: [PATCH 29/54] Fixed clocks, FORCE SYS68K MONITOR V 1.0 now works in terminal, removed RAM definitions for Zbug no longer needed --- src/mess/drivers/force68k.c | 80 +++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index b258e06866c..be36eabd66a 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -99,6 +99,37 @@ Based on the 68ksbc.c #include "machine/clock.h" #define BAUDGEN_CLOCK XTAL_1_8432MHz +/* + The baudrate on the Force68k CPU-1 to CPU-6 is generated by a + Motorola 14411 bitrate generator, the CPU-6 documents matches the circuits + that I could find on the CPU-1 board. Here how I calculated the clock for + the factory settings. No need to add selectors until terminal.c supports + configurable baudrates. Fortunality CPU-1 was shipped with 9600N8! + + From the documents: + + 3 RS232C interfaces, strap selectable baud rate from 110-9600 or 600-19200 baud + + Default Jumper Settings of B7: + -------------------------------- + GND 10 - 11 RSA input on 14411 + F1 on 14411 1 - 20 Baud selector of the terminal port + F1 on 14411 3 - 18 Baud selector of the host port + F1 on 14411 5 - 16 Baud selector of the remote port + + The RSB input on the 14411 is kept high always so RSA=0, RSB=1 and a 1.8432MHz crystal + generates 153600 on the F1 output pin which by default strapping is connected to all + three 6850 acias on the board. These can be strapped separatelly to speedup downloads. + + The selectable outputs from 14411, F1-F16: + X16 RSA=0,RSB=1: 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 3200, 2153.3, 1758.8, 1200, 921600, 1843000 + X64 RSA=1,RSB=1: 614400, 460800, 307200, 230400, 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 921600, 1843000 + + However, the datasheet says baudrate is strapable for 110-9600 but the output is 153600 + so the system rom MUST setup the acia to divide by 16 to generate the correct baudrate. + +*/ +#define ACIA_CLOCK (BAUDGEN_CLOCK / 12) class force68k_state : public driver_device { @@ -147,7 +178,6 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) // AM_RANGE(0x0c0401, 0x0c042f) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) AM_RANGE(0x0e0000, 0x0e0035) AM_DEVREADWRITE8("pit", pit68230_device, data_r, data_w, 0x00ff) // AM_RANGE(0x0e0200, 0x0e0380) AM_READWRITE(fpu_r, fpu_w) /* optional FPCP 68881 FPU interface */ -// AM_RANGE(0x100000, 0x1fffff) AM_RAM /* DRAM for bin patched bug, remove once not needed */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ // AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */ ADDRESS_MAP_END @@ -191,7 +221,7 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* P3/Host Port config */ MCFG_DEVICE_ADD("aciahost", ACIA6850, 0) - MCFG_DEVICE_ADD("aciahost_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ + MCFG_DEVICE_ADD("aciahost_clock", CLOCK, ACIA_CLOCK) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciahost_clock)) /* P4/Terminal Port config */ @@ -204,12 +234,12 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts)) - MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, BAUDGEN_CLOCK / 2) + MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, ACIA_CLOCK) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) /* P5/Remote Port config */ MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0) - MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, XTAL_15_36MHz) /* 9600 x 16 */ + MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, ACIA_CLOCK) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) /* PIT Parallel Interface and Timer device */ @@ -251,6 +281,48 @@ ROM_START( fccpu1 ) ROM_LOAD16_BYTE( "fccpu1V1.0L.j8.bin", 0x080001, 0x2000, CRC(3ac6f08f) SHA1(502f6547b508d8732bd68bbbb2402d8c30fefc3b) ) ROM_LOAD16_BYTE( "fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC(035315fb) SHA1(90dc44d9c25d28428233e6846da6edce2d69e440) ) +/* COMMAND SUMMARY DESCRIPTION (From CPU-1B datasheet, ROMs were dumped + from a CPU-1 board so some features might be missing or different) +--------------------------------------------------------------------------- + BF Block Fill memory - from addr1 through addr2 with data + BM
Block Move - move from addr1 through addr2to addr3 + BR [
[; ] ... ] Set/display Breakpoint + BS Block Search - search addr1 through addr2 for data + BT Block Test of memory + DC Data Conversion + DF Display Formatted registers + DU [n] [] Dump memory to object file + GO [ Execute program + GD [ Go Direct + GT
Exec prog: temporary breakpoint + HE Help; display monitor commands + LO [n] [; Load Object file + MD
[ Memory Display + MM
[ Memory Modify + MS
< ... Memory Set - starting at addr with data 1. data 2 ... + NOBR [
... ] Remove Breakpoint + NOPA Printer Detach + OF Offset + PA Printer Attach + PF[n] Set/display Port Format + RM Register Modify + TM [ Transparent Mode + TR [ Trace + TT
Trace: temporary breakpoint + VE [n] [ Verify memory/object file +---------------------------------------------------------------------------- + .AO - .A7 [ Display/set address register + .00 - .07 [ Display/set data register + .RO - .R6 [ Display/set offset register + .PC [ Display/set program counter + .SR [ Display/set status register + .SS [ Display/set supervisor stack + .US [ Display/set user stack +---------------------------------------------------------------------------- + MD
[]; D1 Disassemble memory location + MM
; DI Disassemble/Assemble memory location +---------------------------------------------------------------------------- +*/ ROM_END #if 0 From a103a7c91bad75badcf45e111732c5c80f934d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 14 Jul 2015 18:05:37 +0200 Subject: [PATCH 30/54] Added PBDR register needed for printer on CPU-1, still need to add handshake wiring to the data port to get it to work --- src/emu/machine/68230pit.c | 42 ++++++++++++++++++++++++++++++++++++-- src/emu/machine/68230pit.h | 1 + 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c index 161fe414490..2c48fcac314 100644 --- a/src/emu/machine/68230pit.c +++ b/src/emu/machine/68230pit.c @@ -65,6 +65,7 @@ void pit68230_device::device_reset() m_pbddr = 0; m_pacr = 0; m_pbcr = 0; + m_pbdr = 0; } WRITE8_MEMBER( pit68230_device::data_w ) @@ -104,8 +105,45 @@ WRITE8_MEMBER( pit68230_device::data_w ) READ8_MEMBER( pit68230_device::data_r ) { - printf("data_r: %04x & %04x\n", offset, mem_mask); - return (UINT8) 0; + UINT8 data = 0; + + printf("data_r: "); + switch (offset) + { + case PIT_68230_PGCR: + printf("PGCR"); + data = m_pgcr; + break; + case PIT_68230_PSRR: + printf("PSRR"); + data = m_psrr; + break; + case PIT_68230_PADDR: + printf("PADDR"); + data = m_paddr; + break; + case PIT_68230_PBDDR: + printf("PBDDR"); + data = m_pbddr; + break; + case PIT_68230_PACR: + printf("PACR"); + data = m_pacr; + break; + case PIT_68230_PBCR: + printf("PBCR"); + data = m_pbcr; + break; + case PIT_68230_PBDR: + printf("PBDR"); + data = m_pbdr; + break; + default: + printf("unhandled register %02x", offset); + } + printf("\n"); + + return data; } diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h index 84d5d667510..e9986a79357 100644 --- a/src/emu/machine/68230pit.h +++ b/src/emu/machine/68230pit.h @@ -63,6 +63,7 @@ private: UINT8 m_pbddr; // Port B Data Direction register UINT8 m_pacr; // Port A Control register UINT8 m_pbcr; // Port B Control register + UINT8 m_pbdr; // Port B Data register }; From 13ebb53b1a3b464d4360e1f57b07a9df0d60bf31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 14 Jul 2015 18:19:25 +0200 Subject: [PATCH 31/54] More registers added, should probably just add them all at once... --- src/emu/machine/68230pit.c | 5 +++++ src/emu/machine/68230pit.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c index 2c48fcac314..8c7385c5f69 100644 --- a/src/emu/machine/68230pit.c +++ b/src/emu/machine/68230pit.c @@ -65,6 +65,7 @@ void pit68230_device::device_reset() m_pbddr = 0; m_pacr = 0; m_pbcr = 0; + m_padr = 0; m_pbdr = 0; } @@ -134,6 +135,10 @@ READ8_MEMBER( pit68230_device::data_r ) printf("PBCR"); data = m_pbcr; break; + case PIT_68230_PADR: + printf("PADR"); + data = m_padr; + break; case PIT_68230_PBDR: printf("PBDR"); data = m_pbdr; diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h index e9986a79357..5d9eb1463d8 100644 --- a/src/emu/machine/68230pit.h +++ b/src/emu/machine/68230pit.h @@ -61,8 +61,10 @@ private: UINT8 m_psrr; // Port Service Request register UINT8 m_paddr; // Port A Data Direction register UINT8 m_pbddr; // Port B Data Direction register + UINT8 m_pcddr; // Port C Data Direction register UINT8 m_pacr; // Port A Control register UINT8 m_pbcr; // Port B Control register + UINT8 m_padr; // Port A Data register UINT8 m_pbdr; // Port B Data register }; From db5c5425fb6a74524f0479e5614bd8f60e5200bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 14 Jul 2015 18:20:23 +0200 Subject: [PATCH 32/54] Fixed some comments --- src/mess/drivers/force68k.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index be36eabd66a..e776e58c59f 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -77,10 +77,7 @@ SYSFAIL and SYSCLK signal (16 MHz). Based on the 68ksbc.c TODO: - - Finish 3 x ACIA6850, terminal serial interface first - - Add 1 x 14411 Motorola, Baudrate Generator - - Add switches to strap baudrate configuration - - figure our why rs232 "terminal" is not working as for 68ksbc + - Finish 2 x ACIA6850, host and remote interface left, terminal works - Finish 1 x 68230 Motorola, Parallel Interface / Timer - Add 1 x Abort Switch - Add configurable serial connector between ACIA:s and From 8ed221e77d8b8ef52e89dbb9a875d051a29a3737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Wed, 15 Jul 2015 23:45:40 +0200 Subject: [PATCH 33/54] Added 58167 RTC, works but no support for it in current system rom, verified through mame debugger --- src/mess/drivers/force68k.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index e776e58c59f..f165b97b1c8 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -135,6 +135,7 @@ public: driver_device(mconfig, type, tag), // m_rtc(*this, "rtc") m_maincpu(*this, "maincpu"), + m_rtc(*this, "rtc"), m_pit(*this, "pit"), m_aciahost(*this, "aciahost"), m_aciaterm(*this, "aciaterm"), @@ -150,7 +151,7 @@ public: private: required_device m_maincpu; - // required_device m_rtc; + required_device m_rtc; required_device m_pit; required_device m_aciahost; required_device m_aciaterm; @@ -172,7 +173,7 @@ static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state) AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("aciaterm", acia6850_device, data_r, data_w, 0xff00) AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff) AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff) -// AM_RANGE(0x0c0401, 0x0c042f) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0xff00) + AM_RANGE(0x0c0400, 0x0c042f) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0x00ff) AM_RANGE(0x0e0000, 0x0e0035) AM_DEVREADWRITE8("pit", pit68230_device, data_r, data_w, 0x00ff) // AM_RANGE(0x0e0200, 0x0e0380) AM_READWRITE(fpu_r, fpu_w) /* optional FPCP 68881 FPU interface */ // AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */ @@ -239,6 +240,9 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, ACIA_CLOCK) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) + /* RTC Real Time Clock device */ + MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz) + /* PIT Parallel Interface and Timer device */ MCFG_DEVICE_ADD("pit", PIT68230, 0) From 3c731cd6b882bcff399688e00a084b1579eb3e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Mon, 20 Jul 2015 15:28:01 +0200 Subject: [PATCH 34/54] started FORCE SYS68K MONITOR V 1.0 printer support --- src/mess/drivers/force68k.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index f165b97b1c8..81f37d874a6 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -2,7 +2,7 @@ // copyright-holders:Joakim Larsson Edström /*************************************************************************** - Force SYS68K CPU-1/CPU-6 VME SBC drivers + Force SYS68K CPU-1/CPU-6 VME SBC drivers, initially based on the 68ksbc.c 13/06/2015 @@ -26,7 +26,7 @@ Address Range Description OAO 000 - OBF FFF USER EPROMArea 0C0 041 - 0C0 043 ACIA (P3) Host 0C0 080 - 0C0 082 ACIA (P4) Terminal -0C0 101 - 0C0 103 ACIA (P5) Remote +0C0 101 - 0C0 103 ACIA (P5) Remote device (eg printer) 0C0 401 - 0C0 42F RTC OEO 001 - 0E0 035 PI/T OEO 200 - 0E0 2FF FPU @@ -74,7 +74,6 @@ enabled/disabled via a jumper field. Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET, SYSFAIL and SYSCLK signal (16 MHz). -Based on the 68ksbc.c TODO: - Finish 2 x ACIA6850, host and remote interface left, terminal works @@ -237,6 +236,17 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* P5/Remote Port config */ MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0) + +#define PRINTER 0 +#if PRINTER + MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232rmt", rs232_port_device, write_txd)) + MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232rmt", rs232_port_device, write_rts)) + + MCFG_RS232_PORT_ADD("rs232rmt", default_rs232_devices, "printer") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaremt", acia6850_device, write_rxd)) + MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaremt", acia6850_device, write_cts)) +#endif + MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, ACIA_CLOCK) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock)) From e436f2a3a3dac9155b3445bfc18c2f8e83111afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Mon, 20 Jul 2015 22:51:35 +0200 Subject: [PATCH 35/54] Added driver for CPU-1 VME SBC from Force Computers and a skeleton 68230 device driver --- scripts/target/mame/mess.lua | 7 +++++++ src/mame/mess.lst | 1 + 2 files changed, 8 insertions(+) diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 9b21024d72d..0bbeb1915ef 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -485,6 +485,7 @@ MACHINES["PCCARD"] = true MACHINES["PCF8593"] = true MACHINES["PCKEYBRD"] = true MACHINES["PIC8259"] = true +MACHINES["PIT68230"] = true MACHINES["PIT8253"] = true MACHINES["PLA"] = true --MACHINES["PROFILE"] = true @@ -722,6 +723,7 @@ function linkProjects_mame_mess(_target, _subtarget) "exidy", "fairch", "fidelity", + "force", "fujitsu", "funtech", "galaxy", @@ -1509,6 +1511,11 @@ files { MAME_DIR .. "src/mess/drivers/fidelz80.c", } +createMESSProjects(_target, _subtarget, "force") +files { + MAME_DIR .. "src/mess/drivers/force68k.c", +} + createMESSProjects(_target, _subtarget, "fujitsu") files { MAME_DIR .. "src/mess/drivers/fmtowns.c", diff --git a/src/mame/mess.lst b/src/mame/mess.lst index d66b03e9bd9..36cf2a7b6e5 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -2585,6 +2585,7 @@ prose2ko eacc argo applix +fccpu1 68ksbc lcmate2 cm1800 From 8a504b93fb87c9967aba24dbc887ab7236508890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Mon, 20 Jul 2015 23:00:24 +0200 Subject: [PATCH 36/54] updated driver status --- src/mess/drivers/force68k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 81f37d874a6..515d54ff82b 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -360,7 +360,7 @@ ROM_END /* Driver */ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1983, fccpu1, 0, 0, fccpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_IS_SKELETON ) +COMP( 1983, fccpu1, 0, 0, fccpu1, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-1", GAME_NO_SOUND_HW | GAME_TYPE_COMPUTER ) //COMP( 1989, fccpu6, 0, 0, fccpu6, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6", GAME_IS_SKELETON ) //COMP( 1989, fccpu6a, 0, 0, fccpu6a, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6a", GAME_IS_SKELETON ) //COMP( 1989, fccpu6v, 0, 0, fccpu6v, force68k, driver_device, 0, "Force Computers Gmbh", "SYS68K/CPU-6v", GAME_IS_SKELETON ) From 307d82b06acc1e5026938fda0df9cda14a4e863a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Mon, 20 Jul 2015 23:10:08 +0200 Subject: [PATCH 37/54] fixed c&p typo --- scripts/src/machine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index efb4f8f7cef..55467f69264 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -188,7 +188,7 @@ end --------------------------------------------------- -- ---@src/emu/machine/6850acia.h,MACHINES += PIT68230 +--@src/emu/machine/68230pit.h,MACHINES["PIT68230"] = true --------------------------------------------------- if (MACHINES["PIT68230"]~=null) then From 776915947deabc358786fc8f3db1689abc7b6053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 21 Jul 2015 02:04:25 +0200 Subject: [PATCH 38/54] Figured out that ROM:s support a Centronics printer on P2 --- src/mess/drivers/force68k.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mess/drivers/force68k.c b/src/mess/drivers/force68k.c index 515d54ff82b..7bbf42b6b70 100644 --- a/src/mess/drivers/force68k.c +++ b/src/mess/drivers/force68k.c @@ -26,9 +26,9 @@ Address Range Description OAO 000 - OBF FFF USER EPROMArea 0C0 041 - 0C0 043 ACIA (P3) Host 0C0 080 - 0C0 082 ACIA (P4) Terminal -0C0 101 - 0C0 103 ACIA (P5) Remote device (eg printer) +0C0 101 - 0C0 103 ACIA (P5) Remote device (eg serial printer) 0C0 401 - 0C0 42F RTC -OEO 001 - 0E0 035 PI/T +OEO 001 - 0E0 035 PI/T (eg centronics printer) OEO 200 - 0E0 2FF FPU OEO 300 - 0E0 300 Reset Off OEO 380 - 0E0 380 Reset On @@ -78,6 +78,7 @@ SYSFAIL and SYSCLK signal (16 MHz). TODO: - Finish 2 x ACIA6850, host and remote interface left, terminal works - Finish 1 x 68230 Motorola, Parallel Interface / Timer + - Connect Port B to a Centronics printer interface - Add 1 x Abort Switch - Add configurable serial connector between ACIA:s and - Real terminal emulator, ie rs232 "socket" @@ -253,8 +254,8 @@ static MACHINE_CONFIG_START( fccpu1, force68k_state ) /* RTC Real Time Clock device */ MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz) - /* PIT Parallel Interface and Timer device */ - MCFG_DEVICE_ADD("pit", PIT68230, 0) + /* PIT Parallel Interface and Timer device, assuming strapped for on board clock */ + MCFG_DEVICE_ADD("pit", PIT68230, XTAL_16MHz / 2) MACHINE_CONFIG_END @@ -312,9 +313,9 @@ ROM_START( fccpu1 ) MM
[ Memory Modify MS
< ... Memory Set - starting at addr with data 1. data 2 ... NOBR [
... ] Remove Breakpoint - NOPA Printer Detach + NOPA Printer Detach (Centronics on PIT/P2) OF Offset - PA Printer Attach + PA Printer Attach (Centronics on PIT/P2) PF[n] Set/display Port Format RM Register Modify TM [ Transparent Mode From 06f46524f9fb257ba660857937b351545b18a8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 21 Jul 2015 02:30:04 +0200 Subject: [PATCH 39/54] started support for CPU-1 Centronics port on Port B --- src/emu/machine/68230pit.c | 23 ++++++++++++++++++++++- src/emu/machine/68230pit.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c index 8c7385c5f69..647bd7884bb 100644 --- a/src/emu/machine/68230pit.c +++ b/src/emu/machine/68230pit.c @@ -67,6 +67,7 @@ void pit68230_device::device_reset() m_pbcr = 0; m_padr = 0; m_pbdr = 0; + m_psr = 0; } WRITE8_MEMBER( pit68230_device::data_w ) @@ -98,6 +99,14 @@ WRITE8_MEMBER( pit68230_device::data_w ) printf("PBCR"); m_pbcr = data; break; + case PIT_68230_PADR: + printf("PADR"); + m_padr = data; + break; + case PIT_68230_PSR: + printf("PSR"); + m_padr = data; + break; default: printf("unhandled register %02x", offset); } @@ -139,12 +148,24 @@ READ8_MEMBER( pit68230_device::data_r ) printf("PADR"); data = m_padr; break; - case PIT_68230_PBDR: + case PIT_68230_PBDR: + /* 4.6.2. PORT B DATA REGISTER (PBDR). The port B data register is a holding register for moving data +to and from port B pins. The port B data direction register determines whether each pin is an input (zero) +or an output (one). This register is readable and writable at all times. Depending on the chosen mode/submode, +reading or writing may affect the double-buffered handshake mechanism. The port B data register is not affected +by the assertion of the RESET pin. PB0-PB7 sits on pins 17-24 on a 48 pin DIP package */ printf("PBDR"); data = m_pbdr; + // data = (m_pbdr & 0xfc) | 1; // CPU-1 centronics interface expects to see 2 lowest bits equal 1 for printer + break; + case PIT_68230_PSR: + printf("PSR"); + data = m_psr; + // data = m_psr | 1; // CPU-1 centronics interface expects status to be non zero break; default: printf("unhandled register %02x", offset); + data = 0; } printf("\n"); diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h index 5d9eb1463d8..a79999a2395 100644 --- a/src/emu/machine/68230pit.h +++ b/src/emu/machine/68230pit.h @@ -66,6 +66,7 @@ private: UINT8 m_pbcr; // Port B Control register UINT8 m_padr; // Port A Data register UINT8 m_pbdr; // Port B Data register + UINT8 m_psr; // Port Status Register }; From ab64ca8b0cae04ce48af21f5199b3a70e39997c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Tue, 21 Jul 2015 23:27:52 +0200 Subject: [PATCH 40/54] reverted some commits not needed for this pull request --- hash/vectrex.xml | 12 ------------ src/emu/debug/debugcmd.c | 35 ----------------------------------- src/emu/debug/debughlp.c | 13 ------------- 3 files changed, 60 deletions(-) diff --git a/hash/vectrex.xml b/hash/vectrex.xml index 8b72670b12a..69ff7c689a8 100644 --- a/hash/vectrex.xml +++ b/hash/vectrex.xml @@ -13,18 +13,6 @@ guys - - Bouncer - things bouncing in a box - 2015 - Joakim Larsson Edstrom - - - - - - - - 3D Mine Storm 1983 diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 85966bf1b5d..d7e5f48f79c 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -93,7 +93,6 @@ static UINT64 execute_if(symbol_table &table, void *ref, int params, const UINT6 static UINT64 global_get(symbol_table &table, void *ref); static void global_set(symbol_table &table, void *ref, UINT64 value); -static void execute_show(running_machine &machine, int ref, int params, const char **param); static void execute_help(running_machine &machine, int ref, int params, const char **param); static void execute_print(running_machine &machine, int ref, int params, const char **param); static void execute_printf(running_machine &machine, int ref, int params, const char **param); @@ -268,7 +267,6 @@ void debug_command_init(running_machine &machine) } /* add all the commands */ - debug_console_register_command(machine, "show", CMDFLAG_NONE, 0, 0, 1, execute_show); debug_console_register_command(machine, "help", CMDFLAG_NONE, 0, 0, 1, execute_help); debug_console_register_command(machine, "print", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_print); debug_console_register_command(machine, "printf", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_printf); @@ -671,39 +669,6 @@ static int debug_command_parameter_command(running_machine &machine, const char COMMAND HELPERS ***************************************************************************/ -/*------------------------------------------------- - show infos of various kind --------------------------------------------------*/ - -static void execute_show(running_machine &machine, int ref, int params, const char *param[]) -{ - class cpu_device *cpu; - static long long unsigned int last = 0uLL; - - /* CPU is implicit */ - if (!debug_command_parameter_cpu(machine, NULL, (device_t **) &cpu)) - return; - - if (params == 0) - { - debug_console_printf(machine, "Show what?\n"); - } - else if (params == 1) - { - if (!strcmp(param[0], "clock")) - { - debug_console_printf(machine, "The clock is: %lld(0x%llx) and that is %lld(0x%llx) CPU clock cycles since last 'show clock' command\n", - cpu->total_cycles(), cpu->total_cycles(), cpu->total_cycles() - last, cpu->total_cycles() - last); - last = cpu->total_cycles(); - } - else - { - debug_console_printf(machine, "Unknown property %s. ", param[0]); - debug_console_printf(machine, "Valid properties are: 'clock'\n"); - } - } -} - /*------------------------------------------------- execute_help - execute the help command -------------------------------------------------*/ diff --git a/src/emu/debug/debughlp.c b/src/emu/debug/debughlp.c index 14b68f588eb..1dcb7a31477 100644 --- a/src/emu/debug/debughlp.c +++ b/src/emu/debug/debughlp.c @@ -1457,19 +1457,6 @@ static const help_item static_help_list[] = "\n" "unmount cart\n" " Unmounts any file mounted on device named cart.\n" - }, - { - "show", - "\n" - " show \n" - "\n" - "Shows the value(s) of a property.\nValid properties are:\n" - " clock - prints the total number of clockcycles consumed from reset and the diff from last time the command was issued.\n" - "\n" - "Examples:\n" - "\n" - "show clock\n" - " The clock is: 4816918(0x00498016) and that is 3(0x3) CPU clock cycles since last 'show clock' command\n\n" } }; From bb9f5a3e15d01669f118803023d739fc3d040d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Larsson=20Edstr=C3=B6m?= Date: Wed, 22 Jul 2015 00:54:52 +0200 Subject: [PATCH 41/54] Removed/initialized class members to fix compile problems at travis etc --- src/emu/machine/68230pit.c | 4 ++-- src/emu/machine/68230pit.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/emu/machine/68230pit.c b/src/emu/machine/68230pit.c index 647bd7884bb..9c99baa4f16 100644 --- a/src/emu/machine/68230pit.c +++ b/src/emu/machine/68230pit.c @@ -46,8 +46,7 @@ const device_type PIT68230 = &device_creator; //------------------------------------------------- pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, PIT68230, "Motorola 68230 PI/T", tag, owner, clock, "pit68230", __FILE__), - m_internal_clock(0.0) + : device_t(mconfig, PIT68230, "Motorola 68230 PI/T", tag, owner, clock, "pit68230", __FILE__) { } @@ -63,6 +62,7 @@ void pit68230_device::device_reset() m_psrr = 0; m_paddr = 0; m_pbddr = 0; + m_pcddr = 0; m_pacr = 0; m_pbcr = 0; m_padr = 0; diff --git a/src/emu/machine/68230pit.h b/src/emu/machine/68230pit.h index a79999a2395..b299ca868f9 100644 --- a/src/emu/machine/68230pit.h +++ b/src/emu/machine/68230pit.h @@ -56,7 +56,6 @@ protected: virtual void device_reset(); private: - double m_internal_clock; UINT8 m_pgcr; // Port General Control register UINT8 m_psrr; // Port Service Request register UINT8 m_paddr; // Port A Data Direction register From 437b4a615b42cdb961a960ff6f573674a9c64e8d Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 22 Jul 2015 00:59:44 +0100 Subject: [PATCH 42/54] new clones Shinobi (Datsu bootleg, set 2) [Andrew Welburn] --- src/mame/arcade.lst | 1 + src/mame/drivers/system16.c | 146 ++++++++++++++++++++++++++--------- src/mame/includes/system16.h | 3 +- 3 files changed, 110 insertions(+), 40 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index bc2586d356b..54669fba9e4 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -4688,6 +4688,7 @@ passht4b // bootleg passshtb // bootleg shinoblb // (c) 1987 (but bootleg) shinobld // (c) 1987 (but bootleg) +shinoblda // tetrisbl // (c) 1988 (but bootleg) beautyb // (c) 1991 AMT iqpipe // (c) 1991 AMT diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c index 2c0723f6f18..0bfd4123ccb 100644 --- a/src/mame/drivers/system16.c +++ b/src/mame/drivers/system16.c @@ -97,6 +97,7 @@ #include "sound/2612intf.h" #include "sound/rf5c68.h" #include "video/segaic16.h" +#include "sound/2203intf.h" #define SHADOW_COLORS_MULTIPLIER 3 @@ -118,6 +119,15 @@ WRITE16_MEMBER(segas1x_bootleg_state::sound_command_nmi_w) } } +WRITE16_MEMBER(segas1x_bootleg_state::sound_command_irq_w) +{ + if (ACCESSING_BITS_0_7) + { + soundlatch_byte_w(space, 0, data & 0xff); + m_soundcpu->set_input_line(0, HOLD_LINE); + } +} + static ADDRESS_MAP_START( shinobib_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM @@ -127,7 +137,10 @@ static ADDRESS_MAP_START( shinobib_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x412000, 0x412fff) AM_RAM AM_SHARE("bg1_tileram") AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites") AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") - AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w) +// AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_irq_w) + AM_RANGE(0xC42006, 0xC42007) AM_WRITE(sound_command_irq_w) + + AM_RANGE(0xC44000, 0xC44001) AM_READNOP AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE") AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1") AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2") @@ -146,15 +159,6 @@ ADDRESS_MAP_END /***************************************************************************/ -WRITE16_MEMBER(segas1x_bootleg_state::sound_command_w) -{ - if (ACCESSING_BITS_0_7) - { - soundlatch_byte_w(space, 0, data & 0xff); - m_soundcpu->set_input_line(0, HOLD_LINE); - } -} - WRITE16_MEMBER(segas1x_bootleg_state::sys16_coinctrl_w) { if (ACCESSING_BITS_0_7) @@ -187,7 +191,7 @@ static ADDRESS_MAP_START( passshtb_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE") AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1") AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2") - AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w) + AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w) AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w) AM_RANGE(0xc46004, 0xc46005) AM_WRITE(s16a_bootleg_fgscrolly_w) @@ -265,7 +269,7 @@ static ADDRESS_MAP_START( passht4b_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0xc41006, 0xc41007) AM_READ(passht4b_io3_r) AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2") AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1") - AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w) + AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xc43000, 0xc43001) AM_READ_PORT("P1") // test mode only AM_RANGE(0xc43002, 0xc43003) AM_READ_PORT("P2") AM_RANGE(0xc43004, 0xc43005) AM_READ_PORT("P3") @@ -313,7 +317,7 @@ static ADDRESS_MAP_START( wb3bbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2") AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2") AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1") - AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w) + AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w) AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w) @@ -422,6 +426,24 @@ static ADDRESS_MAP_START( tturfbl_sound_io_map, AS_IO, 8, segas1x_bootleg_state AM_RANGE(0x80, 0x80) AM_NOP ADDRESS_MAP_END +/*******************************************************************************/ + +static ADDRESS_MAP_START(shinobi_datsu_sound_map, AS_PROGRAM, 8, segas1x_bootleg_state ) + AM_RANGE(0x0000, 0x7fff) AM_ROM + + AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ym1", ym2203_device, read, write) + AM_RANGE(0xe400, 0xe401) AM_DEVREADWRITE("ym2", ym2203_device, read, write) + AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r) + + AM_RANGE(0xf800, 0xffff) AM_RAM +ADDRESS_MAP_END + +static ADDRESS_MAP_START( shinobi_datsu_sound_io, AS_IO, 8, segas1x_bootleg_state ) + ADDRESS_MAP_GLOBAL_MASK(0xff) +ADDRESS_MAP_END + + + /*******************************************************************************/ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_bootleg_state ) @@ -504,7 +526,7 @@ static ADDRESS_MAP_START( bayroute_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1") AM_RANGE(0x902000, 0x902001) AM_READ_PORT("DSW2") - AM_RANGE(0xff0006, 0xff0007) AM_WRITE(sound_command_w) + AM_RANGE(0xff0006, 0xff0007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xff0020, 0xff003f) AM_WRITENOP // config regs ADDRESS_MAP_END #endif @@ -691,7 +713,7 @@ static ADDRESS_MAP_START( bayrouteb2_map, AS_PROGRAM, 16, segas1x_bootleg_state AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1") AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2") - AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_w) + AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_irq_w) AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w) AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1") AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2") @@ -705,7 +727,7 @@ static ADDRESS_MAP_START( dduxbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites") AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w) - AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w) + AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1") AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2") AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE") @@ -825,7 +847,7 @@ static ADDRESS_MAP_START( fpointbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram") AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites") - AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w) + AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_irq_w) AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE") AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1") AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2") @@ -879,7 +901,7 @@ static ADDRESS_MAP_START( eswatbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE") AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1") AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2") - AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w) + AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram ADDRESS_MAP_END @@ -906,7 +928,7 @@ static ADDRESS_MAP_START( tetrisbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2") AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2") AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1") - AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w) + AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP AM_RANGE(0xc80000, 0xc80001) AM_NOP AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram @@ -943,7 +965,7 @@ static ADDRESS_MAP_START( beautyb_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE") AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1") AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2") - AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w) + AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w) AM_RANGE(0xc40000, 0xc40001) AM_WRITENOP AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP // vblank irq ack @@ -963,7 +985,7 @@ static ADDRESS_MAP_START( tturfbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w) AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2") AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1") - AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w) + AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_irq_w) AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE") AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1") AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2") @@ -1083,14 +1105,6 @@ ADDRESS_MAP_END ***************************************************************************/ -WRITE16_MEMBER(segas1x_bootleg_state::sound_command_irq_w) -{ - if (ACCESSING_BITS_0_7) - { - soundlatch_byte_w(space, 0, data & 0xff); - m_soundcpu->set_input_line(0, HOLD_LINE); - } -} static ADDRESS_MAP_START( shdancbl_map, AS_PROGRAM, 16, segas1x_bootleg_state ) AM_RANGE(0x000000, 0x07ffff) AM_ROM @@ -2016,16 +2030,12 @@ GFXDECODE_END *************************************/ /* System 16A/B Bootlegs */ -static MACHINE_CONFIG_START( system16, segas1x_bootleg_state ) +static MACHINE_CONFIG_START( system16_base, segas1x_bootleg_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 10000000) MCFG_CPU_VBLANK_INT_DRIVER("screen", segas1x_bootleg_state, sys16_interrupt) - MCFG_CPU_ADD("soundcpu", Z80, 4000000) - MCFG_CPU_PROGRAM_MAP(sound_map) - MCFG_CPU_IO_MAP(sound_io_map) - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -2039,6 +2049,13 @@ static MACHINE_CONFIG_START( system16, segas1x_bootleg_state ) MCFG_PALETTE_ADD("palette", 2048*SHADOW_COLORS_MULTIPLIER) MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state,system16) +MACHINE_CONFIG_END + +static MACHINE_CONFIG_DERIVED( system16, system16_base ) + + MCFG_CPU_ADD("soundcpu", Z80, 4000000) + MCFG_CPU_PROGRAM_MAP(sound_map) + MCFG_CPU_IO_MAP(sound_io_map) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -2048,7 +2065,6 @@ static MACHINE_CONFIG_START( system16, segas1x_bootleg_state ) MCFG_SOUND_ROUTE(1, "rspeaker", 0.32) MACHINE_CONFIG_END - WRITE_LINE_MEMBER(segas1x_bootleg_state::sound_cause_nmi) { /* upd7759 callback */ @@ -2094,8 +2110,7 @@ static MACHINE_CONFIG_FRAGMENT( system16_datsu_sound ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80) MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( shinobib, system16 ) +static MACHINE_CONFIG_DERIVED( shinobi_datsu, system16_base ) /* basic machine hardware */ MCFG_CPU_MODIFY("maincpu") @@ -2107,8 +2122,33 @@ static MACHINE_CONFIG_DERIVED( shinobib, system16 ) MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state, s16a_bootleg_shinobi ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(segas1x_bootleg_state, screen_update_s16a_bootleg) + + MCFG_CPU_ADD("soundcpu", Z80, 4000000) + MCFG_CPU_PERIODIC_INT_DRIVER(segas1x_bootleg_state, nmi_line_pulse, 3000) // or from the YM2203? + MCFG_CPU_PROGRAM_MAP(shinobi_datsu_sound_map) + MCFG_CPU_IO_MAP(shinobi_datsu_sound_io) + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + + // 2x YM2203C, one at U57, one at U56 + MCFG_SOUND_ADD("ym1", YM2203, 4000000) +// MCFG_YM2203_IRQ_HANDLER(WRITELINE(segas1x_bootleg_state, datsu_irq_handler)) + MCFG_SOUND_ROUTE(0, "mono", 0.50) + MCFG_SOUND_ROUTE(1, "mono", 0.50) + MCFG_SOUND_ROUTE(2, "mono", 0.50) + MCFG_SOUND_ROUTE(3, "mono", 0.80) + + MCFG_SOUND_ADD("ym2", YM2203, 4000000) + MCFG_SOUND_ROUTE(0, "mono", 0.50) +// MCFG_YM2203_IRQ_HANDLER(WRITELINE(segas1x_bootleg_state, datsu_irq_handler)) + MCFG_SOUND_ROUTE(1, "mono", 0.50) + MCFG_SOUND_ROUTE(2, "mono", 0.50) + MCFG_SOUND_ROUTE(3, "mono", 0.80) + MACHINE_CONFIG_END + static MACHINE_CONFIG_DERIVED( passshtb, system16_7759 ) /* basic machine hardware */ @@ -2431,6 +2471,32 @@ ROM_START( shinobld ) ROM_LOAD( "16.bin", 0x0000, 0x10000, CRC(52c8364e) SHA1(01d30b82f92498d155d2e31d43d58dff0285cce3) ) ROM_END +ROM_START( shinoblda ) + ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "12.bin", 0x000001, 0x10000, CRC(68c91fd5) SHA1(54dc1d26711c73b30cbb5387dde27ba21cc102f4) ) // sldh + ROM_LOAD16_BYTE( "14.bin", 0x000000, 0x10000, CRC(9e887c80) SHA1(798a3dc499ef14b362bc37ff91b247e367f42ab9) ) // sldh + ROM_LOAD16_BYTE( "13.bin", 0x020001, 0x10000, CRC(c4334bcd) SHA1(ea1dd23ca6fbf632d8e10bbb9ced6515a69bd14a) ) + ROM_LOAD16_BYTE( "15.bin", 0x020000, 0x10000, CRC(b70a6ec1) SHA1(79db41c36d6a053bcdc355b46b19ae938a7755a9) ) + + ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */ + ROM_LOAD( "9.bin", 0x00000, 0x10000, CRC(565e11c6) SHA1(e063400b3d0470b932d75da0be9cd4b446189dea) ) + ROM_LOAD( "10.bin", 0x10000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) ) + ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) ) + + ROM_REGION16_BE( 0x080000, "sprites", ROMREGION_ERASEFF ) /* sprites */ + ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) ) + ROM_LOAD16_BYTE( "3.bin", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) ) + ROM_LOAD16_BYTE( "8.bin", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) ) + ROM_LOAD16_BYTE( "2.bin", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) ) + ROM_LOAD16_BYTE( "6.bin", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) ) + ROM_LOAD16_BYTE( "4.bin", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) ) + ROM_LOAD16_BYTE( "7.bin", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) ) + ROM_LOAD16_BYTE( "1.bin", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU + data */ + ROM_LOAD( "16.bin", 0x0000, 0x10000, CRC(52c8364e) SHA1(01d30b82f92498d155d2e31d43d58dff0285cce3) ) +ROM_END + /* Passing Shot Bootleg is a decrypted version of Passing Shot Japanese (passshtj). It has been heavily modified */ ROM_START( passshtb ) ROM_REGION( 0x020000, "maincpu", 0 ) /* 68000 code */ @@ -3702,7 +3768,11 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,astormbl) *************************************/ /* System 16A based bootlegs (less complex tilemap system) */ -GAME( 1987, shinobld, shinobi, shinobib, shinobi, segas1x_bootleg_state, shinobl, ROT0, "bootleg (Datsu)", "Shinobi (Datsu bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) +GAME( 1987, shinobld, shinobi, shinobi_datsu, shinobi, segas1x_bootleg_state, shinobl, ROT0, "bootleg (Datsu)", "Shinobi (Datsu bootleg, set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) +GAME( 1987, shinoblda, shinobi, shinobi_datsu, shinobi, segas1x_bootleg_state, shinobl, ROT0, "bootleg (Datsu)", "Shinobi (Datsu bootleg, set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) + + + GAME( 1988, passshtb, passsht, passshtb, passsht, segas1x_bootleg_state, passsht, ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1988, passht4b, passsht, passsht4b, passht4b, segas1x_bootleg_state, shinobl, ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) GAME( 1988, wb3bbl, wb3, wb3bb, wb3b, segas1x_bootleg_state, wb3bbl, ROT0, "bootleg", "Wonder Boy III - Monster Lair (bootleg)", GAME_NOT_WORKING ) diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h index 91ad78b88d8..087258bcc84 100644 --- a/src/mame/includes/system16.h +++ b/src/mame/includes/system16.h @@ -125,7 +125,7 @@ public: optional_shared_ptr m_decrypted_opcodes; DECLARE_WRITE16_MEMBER(sound_command_nmi_w); - DECLARE_WRITE16_MEMBER(sound_command_w); + DECLARE_WRITE16_MEMBER(sound_command_irq_w); DECLARE_WRITE16_MEMBER(sys16_coinctrl_w); DECLARE_READ16_MEMBER(passht4b_service_r); DECLARE_READ16_MEMBER(passht4b_io1_r); @@ -159,7 +159,6 @@ public: DECLARE_WRITE16_MEMBER(sys18_tilebank_w); DECLARE_READ8_MEMBER(system18_bank_r); DECLARE_WRITE8_MEMBER(sys18_soundbank_w); - DECLARE_WRITE16_MEMBER(sound_command_irq_w); DECLARE_WRITE8_MEMBER(shdancbl_msm5205_data_w); DECLARE_READ8_MEMBER(shdancbl_soundbank_r); DECLARE_WRITE8_MEMBER(shdancbl_bankctrl_w); From c8421ed31dd4d273e0b6c4ce44780d638d9bf49e Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 22 Jul 2015 01:58:18 +0100 Subject: [PATCH 43/54] new clones Midnight Resistance (Joystick bootleg) dump is from a few years ago, had the following readme (what's the correct credit??) These ROMs come from a very large long twin-board bootleg of Midnight Resistance. The board uses only common off-the-shelf parts such as TTL logic, SRAM, 68000/6502 etc. Some of these ROMs match a version in MAME with a 68705 but this board doesn't have a 68705 or other protection devices although the PCB does have a location for a 40-pin 68705. An almost identical board runs a bootleg version of Heavy Barrel and Bad Dudes vs Dragon Ninja. --- src/mame/arcade.lst | 3 ++- src/mame/drivers/dec0.c | 50 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 54669fba9e4..983d169b0cf 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -6021,7 +6021,8 @@ secretab // bootleg midres // (c) 1989 Data East Corporation (World) midresu // (c) 1989 Data East USA (US) midresj // (c) 1989 Data East Corporation (Japan) -midresb // (c) 1989 Data East Corporation (Japan) +midresb // bootleg +midresbj // bootleg bouldash // (c) 1990 Data East Corporation (World) bouldashj // (c) 1990 Data East Corporation (Japan) // end of similar hardware diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c index f5342dfe926..f844ba735b3 100644 --- a/src/mame/drivers/dec0.c +++ b/src/mame/drivers/dec0.c @@ -2941,6 +2941,53 @@ ROM_START( midresb ) ROM_END +ROM_START( midresbj ) + ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "14", 0x00000, 0x10000, CRC(6b3bc886) SHA1(998ef6ae89565148bcb8909f21acbec378ed5f4f) ) + ROM_LOAD16_BYTE( "11", 0x00001, 0x10000, CRC(9b6faab3) SHA1(b60e41972f52df910bfa09accd5fde7d858b55bf) ) + ROM_LOAD16_BYTE( "13", 0x20000, 0x10000, CRC(d1bb2cd6) SHA1(6d4afd8dd8c4c3e90de199358da27108286637e2) ) + ROM_LOAD16_BYTE( "10", 0x20001, 0x10000, CRC(42ccdd0d) SHA1(ef17cc984a8d57e9c52877f4e9b78e9976f99033) ) + ROM_LOAD16_BYTE( "12", 0x40000, 0x10000, CRC(258b10b2) SHA1(f0849801ab2c72bc6e929b230d0c6d41823f18ae) ) + ROM_LOAD16_BYTE( "9", 0x40001, 0x10000, CRC(dd6985d5) SHA1(bd58a1da2c5152464d7660f5b931d6257cb87c4e) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 6502 sound */ + ROM_LOAD( "15", 0x0000, 0x10000, CRC(99d47166) SHA1(a9a1adfe47be8dd3e4d6f8c783447e09be1747b2) ) + + ROM_REGION( 0x10000, "cpu2", ROMREGION_ERASE00 ) /* 68705 MCU */ + //ROM_LOAD( "68705r3.bin", 0x00000, 0x1000, CRC(ad5b1c13) SHA1(3616dc5969323a54e3e171d169f76250ae4e711a) ) // unpopulated socket + + ROM_REGION( 0x20000, "gfx1", 0 ) /* chars */ + ROM_LOAD( "23", 0x08000, 0x08000, CRC(d75aba06) SHA1(cb3b969db3dd8e0c5c3729482f7461cde3a961f3) ) + ROM_CONTINUE( 0x00000, 0x08000 ) /* the two halves are swapped */ + ROM_LOAD( "24", 0x18000, 0x08000, CRC(8f5bbb79) SHA1(cb10f68787606111ba5e9967bf0b0cd21269a902) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x80000, "gfx2", 0 ) /* tiles */ + ROM_LOAD( "19", 0x00000, 0x20000, CRC(fd9ba1bd) SHA1(a105a4335eeed19662c89ab0f90485f1029cf03f) ) + ROM_LOAD( "18", 0x20000, 0x20000, CRC(a936c03c) SHA1(293e69874ce9b2dfb1d605c9f988fa736b12bbcf) ) + ROM_LOAD( "20", 0x40000, 0x20000, CRC(4d8e3cf1) SHA1(db804a608f6ba9ce4cedfec2581bcbb00de3f2ba) ) + ROM_LOAD( "17", 0x60000, 0x20000, CRC(b7241ab9) SHA1(3e83f9285ff4c476f1287bf73b514eace482dccc) ) + + ROM_REGION( 0x40000, "gfx3", 0 ) /* tiles */ + ROM_LOAD( "22", 0x10000, 0x10000, CRC(35a54bb4) SHA1(1869eb77a060e9df42b761b02e7fa5ecb7c414d1) ) + ROM_CONTINUE(0x00000,0x10000) + ROM_LOAD( "21", 0x30000, 0x10000, CRC(4b9227b3) SHA1(7059f2d07fffa0468a45a42b87bf561da5e9c5a4) ) + ROM_CONTINUE(0x20000,0x10000) + + ROM_REGION( 0x80000, "gfx4", 0 ) /* sprites */ + ROM_LOAD( "4", 0x00000, 0x10000, CRC(3f499acb) SHA1(1a22cfeed0497ddc2d571114d9f246b3ae18ede9) ) + ROM_LOAD( "8", 0x10000, 0x10000, CRC(5e7a6800) SHA1(8dd5c9005b6804a30627644053f14e4477fe0074) ) + ROM_LOAD( "2", 0x20000, 0x10000, CRC(897ba6e4) SHA1(70fd9cba3922751cb317770d6effdc2fb94c1324) ) + ROM_LOAD( "6", 0x30000, 0x10000, CRC(9fefb810) SHA1(863a81540261e78de5c612dea807ba29b12054d4) ) + ROM_LOAD( "3", 0x40000, 0x10000, CRC(ebafe720) SHA1(b9f76d2f1b59f1d028e6156b831c5c8ada033641) ) + ROM_LOAD( "7", 0x50000, 0x10000, CRC(bb8cf641) SHA1(a22e47a15d38d4f33e5a2c90f3a90a16a4231d2c) ) // slight changes, check (equivalent to 3.bin in above) + ROM_LOAD( "1", 0x60000, 0x10000, CRC(fd0bd8d3) SHA1(d6b19869ddc2a8ed4f38ba9d613b71853f2d13c0) ) + ROM_LOAD( "5", 0x70000, 0x10000, CRC(fc46d5ed) SHA1(20ddf3f67f0dfb222ad8d3fd464b892ec9c9e4f5) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "16", 0x00000, 0x10000, CRC(ccf24b52) SHA1(39b2663c548b30684197284cb8e7a6ca803330c9)) +ROM_END + ROM_START( bouldash ) ROM_REGION( 0x60000, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "fw-15-2.17l", 0x00000, 0x10000, CRC(ca19a967) SHA1(b9dc2b1323f19b6239e550ed020943bf13de8db0) ) @@ -3082,7 +3129,8 @@ GAME( 1988, robocopb, robocop, robocopb, robocop, dec0_state, robocop, ROT0 GAME( 1988, drgninjab, baddudes, baddudes, drgninja, dec0_state, baddudes, ROT0, "bootleg", "Dragonninja (bootleg)", GAME_SUPPORTS_SAVE ) // this is a common bootleg board -GAME( 1989, midresb, midres, midresb, midresb, dec0_state, midresb, ROT0, "bootleg", "Midnight Resistance (bootleg with 68705)", GAME_SUPPORTS_SAVE ) // need to hook up 68705? +GAME( 1989, midresb, midres, midresb, midresb, dec0_state, midresb, ROT0, "bootleg", "Midnight Resistance (bootleg with 68705)", GAME_SUPPORTS_SAVE ) // need to hook up 68705? (probably unused) +GAME( 1989, midresbj, midres, midresb, midresb, dec0_state, midresb, ROT0, "bootleg", "Midnight Resistance (Joystick bootleg)", GAME_SUPPORTS_SAVE ) GAME( 1989, ffantasybl, hippodrm, ffantasybl, ffantasybl, dec0_state, ffantasybl, ROT0, "bootleg", "Fighting Fantasy (bootleg with 68705)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 68705 not dumped, might be the same as midresb /* A Bad Dudes bootleg with 68705 like the midres and ffantasy ones exists, but is not dumped */ From fb2bbd300fa811323e8fce68f17110616e9fdb46 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Tue, 21 Jul 2015 20:58:58 -0400 Subject: [PATCH 44/54] Fixed validation error "6300__d7.p7 out of memory region space" (nw) --- src/mess/drivers/sdk80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/drivers/sdk80.c b/src/mess/drivers/sdk80.c index 5cc076252fe..1937a0a878f 100644 --- a/src/mess/drivers/sdk80.c +++ b/src/mess/drivers/sdk80.c @@ -197,7 +197,7 @@ ROM_START( sdk80 ) ROM_LOAD("s2513.d2", 0x0000, 0x0200, CRC(a7e567fc) SHA1(b18aae0a2d4f92f5a7e22640719bbc4652f3f4ee)) /* 256x4 PROM located on the video board, schematic location P7, to be moved into separate device later */ - ROM_REGION( 0x0100, "proms", 0 ) + ROM_REGION( 0x0120, "proms", 0 ) ROM_LOAD( "6300__d7.p7", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) ROM_END From 8ccbebacd15ffc1dd4bafe5419721f90b6674449 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 22 Jul 2015 10:55:49 +0200 Subject: [PATCH 45/54] ok, much more responsive now --- src/mess/drivers/tb303.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/tb303.c b/src/mess/drivers/tb303.c index 89792375329..a1df54dc7e3 100644 --- a/src/mess/drivers/tb303.c +++ b/src/mess/drivers/tb303.c @@ -9,7 +9,8 @@ * 3*uPD444C 1024x4 Static CMOS SRAM * board is packed with discrete components - x + TODO: + - still too much to list here ***************************************************************************/ @@ -162,7 +163,7 @@ WRITE8_MEMBER(tb303_state::switch_w) // MCU G: leds state // MCU H: input/led mux if (offset == NEC_UCOM4_PORTH) - m_inp_mux = data; + m_inp_mux = data = data ^ 0xf; m_port[offset] = data; update_leds(); @@ -304,7 +305,7 @@ MACHINE_CONFIG_END ROM_START( tb303 ) ROM_REGION( 0x0800, "maincpu", 0 ) - ROM_LOAD( "d650c-133.ic8", 0x0000, 0x0800, CRC(0805b37a) SHA1(9a0c1891b56446535cef66a11b8366e1b22cc23f) ) + ROM_LOAD( "d650c-133.ic8", 0x0000, 0x0800, CRC(268a8d8b) SHA1(7a4236b2bc9a5cd4c80c63ca1a193e03becfcb4c) ) ROM_END From 4415c403d7cb649cc190434b89951aaa5a2d7786 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 22 Jul 2015 11:55:09 +0100 Subject: [PATCH 46/54] (nw) --- src/mame/arcade.lst | 1 + src/mame/drivers/fcrash.c | 48 +++++++++++++++++++++++++++++++++++---- src/mame/drivers/xyonix.c | 7 +++++- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 983d169b0cf..68f877dfe3b 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -3279,6 +3279,7 @@ megamana // 06/10/1995 (c) 1995 (Asia) rockmanj // 22/09/1995 (c) 1995 (Japan) fcrash // bootleg of Final Fight ffightbl // bootleg +ffightbla // bootleg ganbare // 11/04/2000 (c) 2000 (Japan) diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c index f05c5dfaaef..d1b47cc8d9d 100644 --- a/src/mame/drivers/fcrash.c +++ b/src/mame/drivers/fcrash.c @@ -1782,10 +1782,10 @@ ROM_START( fcrash ) ROMX_LOAD( "12.bin", 0x080001, 0x20000, CRC(25055642) SHA1(578cf6a436489cc1f2d1acdb0cba6c1cbee2e21f) , ROM_SKIP(3) ) ROMX_LOAD( "14.bin", 0x080002, 0x20000, CRC(b77d0328) SHA1(42eb1ebfda301f2b09f3add5932e8331f4790706) , ROM_SKIP(3) ) ROMX_LOAD( "16.bin", 0x080003, 0x20000, CRC(ea111a79) SHA1(1b86aa984d2d6c527e96b61274a82263f34d0d89) , ROM_SKIP(3) ) - ROMX_LOAD( "19.bin", 0x100000, 0x20000, CRC(b3aa1f48) SHA1(411f3855739992f5967e915f2a5255afcedeac2e) , ROM_SKIP(3) ) - ROMX_LOAD( "21.bin", 0x100001, 0x20000, CRC(04d175c9) SHA1(33e6e3fefae4e3977c8c954fbd7feff36e92d723) , ROM_SKIP(3) ) - ROMX_LOAD( "23.bin", 0x100002, 0x20000, CRC(e592ba4f) SHA1(62559481e0da3954a90da0ab0fb51f87f1b3dd9d) , ROM_SKIP(3) ) - ROMX_LOAD( "25.bin", 0x100003, 0x20000, CRC(b89a740f) SHA1(516d73c772e0a904dfb0bd84874919d78bbbd200) , ROM_SKIP(3) ) + ROMX_LOAD( "19.bin", 0x100000, 0x20000, CRC(b3aa1f48) SHA1(411f3855739992f5967e915f2a5255afcedeac2e) , ROM_SKIP(3) ) // only these 4 differ from ffightbla (new title logo) + ROMX_LOAD( "21.bin", 0x100001, 0x20000, CRC(04d175c9) SHA1(33e6e3fefae4e3977c8c954fbd7feff36e92d723) , ROM_SKIP(3) ) // ^ + ROMX_LOAD( "23.bin", 0x100002, 0x20000, CRC(e592ba4f) SHA1(62559481e0da3954a90da0ab0fb51f87f1b3dd9d) , ROM_SKIP(3) ) // ^ + ROMX_LOAD( "25.bin", 0x100003, 0x20000, CRC(b89a740f) SHA1(516d73c772e0a904dfb0bd84874919d78bbbd200) , ROM_SKIP(3) ) // ^ ROMX_LOAD( "11.bin", 0x180000, 0x20000, CRC(d4457a60) SHA1(9e956efafa81a81aca92837df03968f5670ffc15) , ROM_SKIP(3) ) ROMX_LOAD( "13.bin", 0x180001, 0x20000, CRC(3b26a37d) SHA1(58d8d0cdef81c938fb1a5595f2d02b228865893b) , ROM_SKIP(3) ) ROMX_LOAD( "15.bin", 0x180002, 0x20000, CRC(6d837e09) SHA1(b4a133ab96c35b689ee692bfcc04981791099b6f) , ROM_SKIP(3) ) @@ -1814,7 +1814,46 @@ ROM_START( ffightbl ) ROM_COPY( "gfx", 0x000000, 0x000000, 0x8000 ) /* stars */ ROM_END +// this is identical to the Final Crash bootleg but without the modified gfx. +// it's less common than Final Crash, but is either the original bootleg, or the bootleggers wanted to restore the +// original title. +ROM_START( ffightbla ) + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "9.bin", 0x00000, 0x20000, CRC(c6854c91) SHA1(29f01cc65be5eaa3f86e99eebdd284104623abb0) ) + ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x20000, CRC(77f7c2b3) SHA1(feea48d9555824a2e5bf5e99ce159edc015f0792) ) + ROM_LOAD16_BYTE( "8.bin", 0x40000, 0x20000, CRC(1895b3df) SHA1(415a26050c50ed79a7ee5ddd1b8d61593b1ce876) ) + ROM_LOAD16_BYTE( "4.bin", 0x40001, 0x20000, CRC(bbd411ee) SHA1(85d50ca72ec46d627f9c88ff0809aa30e164821a) ) + ROM_LOAD16_BYTE( "7.bin", 0x80000, 0x20000, CRC(5b23ebf2) SHA1(8c28c21a72a28ad249170026891c6bb865943f84) ) + ROM_LOAD16_BYTE( "3.bin", 0x80001, 0x20000, CRC(aba2aebe) SHA1(294109b5929ed63859a55bef16643e3ade7da16f) ) + ROM_LOAD16_BYTE( "6.bin", 0xc0000, 0x20000, CRC(d4bf37f6) SHA1(f47e1cc9aa3b3019ee57f59715e3a611acf9fe3e) ) + ROM_LOAD16_BYTE( "2.bin", 0xc0001, 0x20000, CRC(07ac8f43) SHA1(7a41b003c76adaabd3f94929cc163461b70e0ed9) ) + //ROM_FILL(0x2610, 1, 7) // temporary patch to fix transitions + ROM_REGION( 0x30000, "audiocpu", 0 ) /* Audio CPU + Sample Data */ + ROM_LOAD( "1.bin", 0x00000, 0x20000, CRC(5b276c14) SHA1(73e53c077d4e3c1b919eee28b29e34176ee204f8) ) + ROM_RELOAD( 0x10000, 0x20000 ) + + ROM_REGION( 0x200000, "gfx", 0 ) + ROMX_LOAD( "18.bin", 0x000000, 0x20000, CRC(f1eee6d9) SHA1(bee95efbff49c582cff1cc6d9bb5ef4ea5c4a074) , ROM_SKIP(3) ) + ROMX_LOAD( "20.bin", 0x000001, 0x20000, CRC(675f4537) SHA1(acc68822da3aafbb62f76cbffa5f3389fcc91447) , ROM_SKIP(3) ) + ROMX_LOAD( "22.bin", 0x000002, 0x20000, CRC(db8a32ac) SHA1(b95f73dff291acee239e22e5fd7efe15d0de23be) , ROM_SKIP(3) ) + ROMX_LOAD( "24.bin", 0x000003, 0x20000, CRC(f4113e57) SHA1(ff1f443c13494a169b9be24abc361d27a6d01c09) , ROM_SKIP(3) ) + ROMX_LOAD( "10.bin", 0x080000, 0x20000, CRC(d478853e) SHA1(91fcf8eb022ccea66d291bec84ace557181cf861) , ROM_SKIP(3) ) + ROMX_LOAD( "12.bin", 0x080001, 0x20000, CRC(25055642) SHA1(578cf6a436489cc1f2d1acdb0cba6c1cbee2e21f) , ROM_SKIP(3) ) + ROMX_LOAD( "14.bin", 0x080002, 0x20000, CRC(b77d0328) SHA1(42eb1ebfda301f2b09f3add5932e8331f4790706) , ROM_SKIP(3) ) + ROMX_LOAD( "16.bin", 0x080003, 0x20000, CRC(ea111a79) SHA1(1b86aa984d2d6c527e96b61274a82263f34d0d89) , ROM_SKIP(3) ) + ROMX_LOAD( "ff-19.bin", 0x100000, 0x20000, CRC(7bc03747) SHA1(6964e5c562d6af5b4327ff828f3d0522c34911bc) , ROM_SKIP(3) ) // only these 4 differ from fcrash + ROMX_LOAD( "ff-21.bin", 0x100001, 0x20000, CRC(0c248e2b) SHA1(28731fe25a8eb39c1e0822cf9074a7a32c6b2978) , ROM_SKIP(3) ) // ^ + ROMX_LOAD( "ff-23.bin", 0x100002, 0x20000, CRC(53949d0e) SHA1(1b11134005a47c323917b9892fe44819c36c6ee2) , ROM_SKIP(3) ) // ^ + ROMX_LOAD( "ff-25.bin", 0x100003, 0x20000, CRC(8d34a67d) SHA1(69e9f52efb73952313848a6d54dbdc17a2275c59) , ROM_SKIP(3) ) // ^ + ROMX_LOAD( "11.bin", 0x180000, 0x20000, CRC(d4457a60) SHA1(9e956efafa81a81aca92837df03968f5670ffc15) , ROM_SKIP(3) ) + ROMX_LOAD( "13.bin", 0x180001, 0x20000, CRC(3b26a37d) SHA1(58d8d0cdef81c938fb1a5595f2d02b228865893b) , ROM_SKIP(3) ) + ROMX_LOAD( "15.bin", 0x180002, 0x20000, CRC(6d837e09) SHA1(b4a133ab96c35b689ee692bfcc04981791099b6f) , ROM_SKIP(3) ) + ROMX_LOAD( "17.bin", 0x180003, 0x20000, CRC(c59a4d6c) SHA1(59e49c7d24dd333007de4bb621050011a5392bcc) , ROM_SKIP(3) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_COPY( "gfx", 0x000000, 0x000000, 0x8000 ) /* stars */ +ROM_END @@ -2903,6 +2942,7 @@ GAME( 1993, dinopic2, dino, dinopic, dino, cps_state, dinopic, ROT0, GAME( 1990, fcrash, ffight, fcrash, fcrash, cps_state, cps1, ROT0, "bootleg (Playmark)", "Final Crash (bootleg of Final Fight)", GAME_SUPPORTS_SAVE ) GAME( 1990, ffightbl, ffight, fcrash, fcrash, cps_state, cps1, ROT0, "bootleg", "Final Fight (bootleg)", GAME_SUPPORTS_SAVE ) +GAME( 1990, ffightbla, ffight, fcrash, fcrash, cps_state, cps1, ROT0, "bootleg", "Final Fight (bootleg on Final Crash PCB)", GAME_SUPPORTS_SAVE ) // same as Final Crash without the modified gfx GAME( 1991, kodb, kod, kodb, kodb, cps_state, kodb, ROT0, "bootleg (Playmark)", "The King of Dragons (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 910731 "ETC" GAME( 1991, knightsb, knights, knightsb, knights, cps_state, dinopic, ROT0, "bootleg", "Knights of the Round (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // 911127 - based on World version diff --git a/src/mame/drivers/xyonix.c b/src/mame/drivers/xyonix.c index d491ef98cb1..7a8e5af4528 100644 --- a/src/mame/drivers/xyonix.c +++ b/src/mame/drivers/xyonix.c @@ -13,7 +13,8 @@ prom, the 2x 256k roms, and the 1x 6264 ram. Dip SW is 1 x 8-position on the PCB is an empty socket. written next to the socket is 68705P3. "oh no" you -say..... well, its unpopulated, so maybe it was never used? +say..... well, its unpopulated, so maybe it was never used? (another PCB was +found with the 68705 populated) TODO: @@ -259,6 +260,9 @@ ROM_START( xyonix ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xyonix3.bin", 0x00000, 0x10000, CRC(1960a74e) SHA1(5fd7bc31ca2f5f1e114d3d0ccf6554ebd712cbd3) ) + ROM_REGION( 0x10000, "mcu", 0 ) + ROM_LOAD( "mc68705p3s.e7", 0x00000, 0x780, BAD_DUMP CRC(f60cdd86) SHA1(e18cc598153b3e108942328ee9c5b9f83b034c41) ) // FIXED BITS (xxxxxx0x) + ROM_REGION( 0x10000, "gfx1", 0 ) ROM_LOAD( "xyonix1.bin", 0x00000, 0x08000, CRC(3dfa9596) SHA1(52cdbbe18f83cea7248c29588ea3a18c4bb7984f) ) ROM_LOAD( "xyonix2.bin", 0x08000, 0x08000, CRC(db87343e) SHA1(62bc30cd65b2f8976cd73a0b349a9ccdb3faaad2) ) @@ -270,3 +274,4 @@ ROM_END /* GAME drivers **************************************************************/ GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", GAME_SUPPORTS_SAVE ) + \ No newline at end of file From 4300b5685298ff8373e7e393db4de028ba337e65 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 22 Jul 2015 12:48:42 +0100 Subject: [PATCH 47/54] correct sound rom for 1942p set [mastercello] --- src/mame/drivers/1942.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c index c9418fe9ad5..d87fd200e0c 100644 --- a/src/mame/drivers/1942.c +++ b/src/mame/drivers/1942.c @@ -168,6 +168,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(_1942_state::c1942_scanline) } + + static ADDRESS_MAP_START( c1942_map, AS_PROGRAM, 8, _1942_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") @@ -203,6 +205,12 @@ WRITE8_MEMBER(_1942_state::c1942p_palette_w) m_palette->set_indirect_color(offset, rgb_t(r<<5,g<<5,b<<6)); } +WRITE8_MEMBER(_1942_state::c1942p_soundlatch_w) +{ + soundlatch_byte_w(space, 0, data); + m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); +} + static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") @@ -221,7 +229,7 @@ static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state ) AM_RANGE(0xf000, 0xf3ff) AM_RAM AM_WRITE(c1942p_palette_w) AM_SHARE("protopal") AM_RANGE(0xf400, 0xf400) AM_WRITE(c1942_bankswitch_w) - AM_RANGE(0xf500, 0xf500) AM_WRITE(soundlatch_byte_w) + AM_RANGE(0xf500, 0xf500) AM_WRITE(c1942p_soundlatch_w) AM_RANGE(0xf600, 0xf600) AM_WRITE(c1942p_f600_w) AM_RANGE(0xf700, 0xf700) AM_READ_PORT("DSWA") @@ -231,6 +239,23 @@ static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state ) AM_RANGE(0xf704, 0xf704) AM_READ_PORT("P2") ADDRESS_MAP_END + +static ADDRESS_MAP_START(c1942p_sound_map, AS_PROGRAM, 8, _1942_state ) + AM_RANGE(0x0000, 0x3fff) AM_ROM + AM_RANGE(0x4000, 0x47ff) AM_RAM + + AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) +ADDRESS_MAP_END + +static ADDRESS_MAP_START( c1942p_sound_io, AS_IO, 8, _1942_state ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x0000, 0x0000) AM_WRITENOP + AM_RANGE(0x0014, 0x0015) AM_DEVWRITE("ay1", ay8910_device, address_data_w) + AM_RANGE(0x0018, 0x0019) AM_DEVWRITE("ay2", ay8910_device, address_data_w) +ADDRESS_MAP_END + + + static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _1942_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_RANGE(0x4000, 0x47ff) AM_RAM @@ -600,7 +625,8 @@ static MACHINE_CONFIG_START( 1942p, _1942_state ) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", _1942_state, c1942_scanline, "screen", 0, 1) MCFG_CPU_ADD("audiocpu", Z80, SOUND_CPU_CLOCK) /* 3 MHz ??? */ - MCFG_CPU_PROGRAM_MAP(sound_map) + MCFG_CPU_PROGRAM_MAP(c1942p_sound_map) + MCFG_CPU_IO_MAP(c1942p_sound_io) MCFG_CPU_PERIODIC_INT_DRIVER(_1942_state, irq0_line_hold, 4*60) @@ -891,8 +917,7 @@ ROM_START( 1942p ) ROM_LOAD( "3.bin", 0x14000, 0x4000, CRC(108fda63) SHA1(6ffdf57a04bcfae9fdb2343f30cff50926188cbf) ) // sldh ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "snd.bin", 0x0000, 0x4000, BAD_DUMP CRC(43d6df9f) SHA1(c34579c73faa7e9552a6721ef8050b33ca158588) ) // sldh - looks bad, window was smashed, likely dead. - ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) ) // works but we can't be 100% sure it was the same. + ROM_LOAD( "04.bin", 0x0000, 0x4000, CRC(b4efd1af) SHA1(015b687b1714f892c3b2528bceb2df8ca48b6b8e) ) ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "8.bin", 0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) ) /* characters */ // sldh @@ -926,4 +951,4 @@ GAME( 1984, 1942abl, 1942, 1942, 1942, _1942_state, 1942, ROT270, "bootleg", "1 GAME( 198?, 1942h, 1942, 1942, 1942, _1942_state, 1942, ROT270, "hack (Two Bit Score?)", "42", GAME_SUPPORTS_SAVE ) GAME( 1984, 1942b, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (First Version)", GAME_SUPPORTS_SAVE ) GAME( 1985, 1942w, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", GAME_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */ -GAME( 1984, 1942p, 1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1984, 1942p, 1942, 1942p,1942p,_1942_state, 1942, ROT270, "bootleg", "1942 (Tecfri PCB, bootleg?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) From 9836806a468e53d42269e1dce42c86c8133d9e89 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 22 Jul 2015 12:58:50 +0100 Subject: [PATCH 48/54] (nw) --- src/mame/drivers/mcr3.c | 5 ++++- src/mame/includes/1942.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c index a9357396409..b47b431d74e 100644 --- a/src/mame/drivers/mcr3.c +++ b/src/mame/drivers/mcr3.c @@ -2033,6 +2033,9 @@ GAME( 1987, stargrds, 0, mono_sg, stargrds, mcr3_state, stargrds, ROT0, /* MCR scrolling games */ GAMEL(1983, spyhunt, 0, mcrsc_csd, spyhunt, mcr3_state, spyhunt, ROT90, "Bally Midway", "Spy Hunter", GAME_SUPPORTS_SAVE, layout_spyhunt ) GAMEL(1983, spyhuntp, spyhunt, mcrsc_csd, spyhunt, mcr3_state, spyhunt, ROT90, "Bally Midway (Playtronic license)", "Spy Hunter (Playtronic license)", GAME_SUPPORTS_SAVE, layout_spyhunt ) -GAME (1983, spyhuntpr,spyhunt, spyhuntpr, spyhuntpr,mcr3_state, spyhuntpr,ROT90, "Bally Midway (Recreativos Franco S.A. license)", "Spy Hunter (Spain, Recreativos Franco S.A. PCB)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // PCB made by Recreativos Franco S.A. in Spain, has Bally Midway logo, board is dated '85' so seems to be a low-cost rebuild? it is unclear if it made it to market. GAME( 1984, crater, 0, mcrscroll, crater, mcr3_state, crater, ORIENTATION_FLIP_X, "Bally Midway", "Crater Raider", GAME_SUPPORTS_SAVE ) GAMEL(1985, turbotag, 0, mcrsc_csd, turbotag, mcr3_state, turbotag, ROT90, "Bally Midway", "Turbo Tag (prototype)", GAME_SUPPORTS_SAVE, layout_turbotag ) + +// very different hardware, probably bootleg despite the license text printed on the PCB, similar to '1942p' in 1942.c. Probably should be put in separate driver. +// PCB made by Tecfri for Recreativos Franco S.A. in Spain, has Bally Midway logo, and licensing text on the PCB. Board is dated '85' so seems to be a low-cost rebuild? it is unclear if it made it to market. +GAME (1983, spyhuntpr,spyhunt, spyhuntpr, spyhuntpr,mcr3_state, spyhuntpr,ROT90, "Bally Midway (Recreativos Franco S.A. license)", "Spy Hunter (Spain, Tecfri / Recreativos Franco S.A. PCB)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/1942.h b/src/mame/includes/1942.h index 7f07408261a..d8db88bc9d4 100644 --- a/src/mame/includes/1942.h +++ b/src/mame/includes/1942.h @@ -45,6 +45,7 @@ public: DECLARE_WRITE8_MEMBER(c1942_scroll_w); DECLARE_WRITE8_MEMBER(c1942_c804_w); DECLARE_WRITE8_MEMBER(c1942p_f600_w); + DECLARE_WRITE8_MEMBER(c1942p_soundlatch_w); DECLARE_DRIVER_INIT(1942); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); From 97236de577b470dceeaeca3cc718301623ed9044 Mon Sep 17 00:00:00 2001 From: Cesare Falco Date: Wed, 22 Jul 2015 16:26:46 +0200 Subject: [PATCH 49/54] Bump *nix man pages version --- src/osd/sdl/man/castool.1 | 2 +- src/osd/sdl/man/chdman.1 | 2 +- src/osd/sdl/man/floptool.1 | 2 +- src/osd/sdl/man/imgtool.1 | 2 +- src/osd/sdl/man/jedutil.1 | 2 +- src/osd/sdl/man/ldresample.1 | 2 +- src/osd/sdl/man/ldverify.1 | 2 +- src/osd/sdl/man/mame.6 | 2 +- src/osd/sdl/man/romcmp.1 | 2 +- src/osd/sdl/man/testkeys.1 | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osd/sdl/man/castool.1 b/src/osd/sdl/man/castool.1 index 81a3cbdad5e..1dd96b6eb3f 100644 --- a/src/osd/sdl/man/castool.1 +++ b/src/osd/sdl/man/castool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco , February 2011 .\" .\" -.TH CASTOOL 1 2015-05-20 0.162 "MESS Generic cassette manipulation tool" +.TH CASTOOL 1 2015-07-22 0.164 "MESS Generic cassette manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/chdman.1 b/src/osd/sdl/man/chdman.1 index 99b45645515..f81b48abdea 100644 --- a/src/osd/sdl/man/chdman.1 +++ b/src/osd/sdl/man/chdman.1 @@ -6,7 +6,7 @@ .\" Ashley T. Howes , February 2005 .\" updated by Cesare Falco , February 2007 .\" -.TH CHDMAN 1 2015-05-20 0.162 "MAME Compressed Hunks of Data (CHD) manager" +.TH CHDMAN 1 2015-07-22 0.164 "MAME Compressed Hunks of Data (CHD) manager" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/floptool.1 b/src/osd/sdl/man/floptool.1 index 6b17f52cbf6..24d8e97c46a 100644 --- a/src/osd/sdl/man/floptool.1 +++ b/src/osd/sdl/man/floptool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco , April 2014 .\" .\" -.TH FLOPTOOL 1 2015-05-20 0.162 "MESS Generic floppy manipulation tool" +.TH FLOPTOOL 1 2015-07-22 0.164 "MESS Generic floppy manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/imgtool.1 b/src/osd/sdl/man/imgtool.1 index 4f80ecb5414..819da84de06 100644 --- a/src/osd/sdl/man/imgtool.1 +++ b/src/osd/sdl/man/imgtool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco , February 2011 .\" .\" -.TH IMGTOOL 1 2015-05-20 0.162 "MESS media image manipulation tool" +.TH IMGTOOL 1 2015-07-22 0.164 "MESS media image manipulation tool" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/jedutil.1 b/src/osd/sdl/man/jedutil.1 index 23b48b280e1..e93d07a8e22 100644 --- a/src/osd/sdl/man/jedutil.1 +++ b/src/osd/sdl/man/jedutil.1 @@ -8,7 +8,7 @@ .\" References .\" http://aarongiles.com/?p=159 .\" -.TH JEDUTIL 1 2015-05-20 0.162 "MAME JEDEC file utilities" +.TH JEDUTIL 1 2015-07-22 0.164 "MAME JEDEC file utilities" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/ldresample.1 b/src/osd/sdl/man/ldresample.1 index 79c6b7ef391..c56b8af2c06 100644 --- a/src/osd/sdl/man/ldresample.1 +++ b/src/osd/sdl/man/ldresample.1 @@ -3,7 +3,7 @@ .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .\" -.TH LDRESAMPLE 1 2015-05-20 0.162 "MAME laserdisc audio manipulation tool" +.TH LDRESAMPLE 1 2015-07-22 0.164 "MAME laserdisc audio manipulation tool" .\" .\" Please adjust this date whenever revising the manpage. .\" diff --git a/src/osd/sdl/man/ldverify.1 b/src/osd/sdl/man/ldverify.1 index 3fc2b471cee..aae404164cb 100644 --- a/src/osd/sdl/man/ldverify.1 +++ b/src/osd/sdl/man/ldverify.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information by .\" Cesare Falco , August 2008 .\" -.TH LDVERIFY 1 2015-05-20 0.162 "MAME laserdisc data checker" +.TH LDVERIFY 1 2015-07-22 0.164 "MAME laserdisc data checker" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/mame.6 b/src/osd/sdl/man/mame.6 index 736b0a2f8d4..de5b6216041 100644 --- a/src/osd/sdl/man/mame.6 +++ b/src/osd/sdl/man/mame.6 @@ -13,7 +13,7 @@ .\" and updated by Andrew Burton , July 2003 .\" .\" -.TH MAME 6 2015-05-20 0.162 "MAME \- The Multiple Arcade Machine Emulator" +.TH MAME 6 2015-07-22 0.164 "MAME \- The Multiple Arcade Machine Emulator" .\" .\" .\" NAME chapter diff --git a/src/osd/sdl/man/romcmp.1 b/src/osd/sdl/man/romcmp.1 index 16328e2086c..d7a89f92e80 100644 --- a/src/osd/sdl/man/romcmp.1 +++ b/src/osd/sdl/man/romcmp.1 @@ -9,7 +9,7 @@ .\" References .\" http://www.mame.net/mamefaq.html .\" -.TH ROMCMP 1 2015-05-20 0.162 "MAME romset checking tool" +.TH ROMCMP 1 2015-07-22 0.164 "MAME romset checking tool" .\" .\" NAME chapter .SH NAME diff --git a/src/osd/sdl/man/testkeys.1 b/src/osd/sdl/man/testkeys.1 index a357e81cfd0..91ddd1eb93d 100644 --- a/src/osd/sdl/man/testkeys.1 +++ b/src/osd/sdl/man/testkeys.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information .\" Cesare Falco , February 2007 .\" -.TH TESTKEYS 1 2015-05-20 0.162 "MAME SDL keycode scanner" +.TH TESTKEYS 1 2015-07-22 0.164 "MAME SDL keycode scanner" .\" .\" NAME chapter .SH NAME From 8b5d4c31e003a88387d7b808cfc3e547082bc128 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 22 Jul 2015 19:47:17 +0200 Subject: [PATCH 50/54] moved calcs from hh_tms1k derivatives down the list --- src/mame/mess.lst | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/mame/mess.lst b/src/mame/mess.lst index 36cf2a7b6e5..853c9f85461 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -327,7 +327,6 @@ mu100r // 1997 MU-100 Rackable version fb01 // 1986 FB-01 // Roland -tb303 mt32 cm32l d110 @@ -1043,16 +1042,6 @@ avigo_es // 1997 Avigo (Spanish) avigo_it // 1997 Avigo (Italian) // Texas Instruments Calculators -tisr16 // 1974 SR-16 -tisr16ii -ti1270 -ti1000 -ti30 // 1976 TI-30 -tiprog -tibusan1 -wizatron -lilprof -lilprof78 ti73 // 1990 TI-73 ti74 // 1985 TI-74 ti95 // 1986 TI-95 @@ -2235,7 +2224,7 @@ tbreakup // Tomy elecbowl // Marx mbdtower // Milton Bradley -// TI snspell +// hh_tms1k snspell.c snspell snspella snspellb @@ -2248,6 +2237,18 @@ snmathp snread lantutor +// hh_tms1k ticalc1x.c +tisr16 +tisr16ii +ti1270 +ti1000 +ti30 +tiprog +tibusan1 +wizatron +lilprof +lilprof78 + // hh_ucom4 ufombs // Bambino ssfball // Bambino @@ -2267,6 +2268,9 @@ tmscramb // Tomy tcaveman // Tomy alnchase // Tomy +// hh_ucom4 derivatives +tb303 // Roland + // other tama // Bandai advision // Entex From f141aa777058dc14125244b01e20f2dba21406f2 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 22 Jul 2015 20:25:46 +0200 Subject: [PATCH 51/54] namcona1.c: added save state support (nw) --- src/emu/sound/c140.c | 20 +++++++++ src/emu/sound/c140.h | 28 ++++++------- src/mame/drivers/namcona1.c | 80 ++++++++++++++++++++---------------- src/mame/includes/namcona1.h | 27 +++++++----- src/mame/video/namcona1.c | 47 ++++++++++++--------- 5 files changed, 121 insertions(+), 81 deletions(-) diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index 0c0d9405098..da659b1cad1 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -134,6 +134,26 @@ void c140_device::device_start() /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ m_mixer_buffer_left = auto_alloc_array(machine(), INT16, 2 * m_sample_rate); m_mixer_buffer_right = m_mixer_buffer_left + m_sample_rate; + + save_item(NAME(m_REG)); + + for (int i = 0; i < C140_MAX_VOICE; i++) + { + save_item(NAME(m_voi[i].ptoffset), i); + save_item(NAME(m_voi[i].pos), i); + save_item(NAME(m_voi[i].key), i); + save_item(NAME(m_voi[i].lastdt), i); + save_item(NAME(m_voi[i].prevdt), i); + save_item(NAME(m_voi[i].dltdt), i); + save_item(NAME(m_voi[i].rvol), i); + save_item(NAME(m_voi[i].lvol), i); + save_item(NAME(m_voi[i].frequency), i); + save_item(NAME(m_voi[i].bank), i); + save_item(NAME(m_voi[i].mode), i); + save_item(NAME(m_voi[i].sample_start), i); + save_item(NAME(m_voi[i].sample_end), i); + save_item(NAME(m_voi[i].sample_loop), i); + } } diff --git a/src/emu/sound/c140.h b/src/emu/sound/c140.h index c3879e8257e..13b6bfbcc7c 100644 --- a/src/emu/sound/c140.h +++ b/src/emu/sound/c140.h @@ -51,23 +51,23 @@ struct C140_VOICE sample_end(0), sample_loop(0) {} - long ptoffset; - long pos; - long key; + INT32 ptoffset; + INT32 pos; + INT32 key; //--work - long lastdt; - long prevdt; - long dltdt; + INT32 lastdt; + INT32 prevdt; + INT32 dltdt; //--reg - long rvol; - long lvol; - long frequency; - long bank; - long mode; + INT32 rvol; + INT32 lvol; + INT32 frequency; + INT32 bank; + INT32 mode; - long sample_start; - long sample_end; - long sample_loop; + INT32 sample_start; + INT32 sample_end; + INT32 sample_loop; }; diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c index 1d1f2fdb006..3bfd04c7092 100644 --- a/src/mame/drivers/namcona1.c +++ b/src/mame/drivers/namcona1.c @@ -319,15 +319,15 @@ int namcona1_state::transfer_dword( UINT32 dest, UINT32 source ) } if( dest>=0xf00000 && dest<0xf02000 ) { - namcona1_paletteram_w(space, (dest-0xf00000)/2, data, 0xffff ); + paletteram_w(space, (dest-0xf00000)/2, data, 0xffff ); } else if( dest>=0xf40000 && dest<0xf80000 ) { - namcona1_gfxram_w(space, (dest-0xf40000)/2, data, 0xffff ); + gfxram_w(space, (dest-0xf40000)/2, data, 0xffff ); } else if( dest>=0xff0000 && dest<0xffc000 ) { - namcona1_videoram_w(space, (dest-0xff0000)/2, data, 0xffff ); + videoram_w(space, (dest-0xff0000)/2, data, 0xffff ); } else if( dest>=0xfff000 && dest<0x1000000 ) { @@ -412,7 +412,7 @@ static void blit_setup( int format, int *bytes_per_row, int *pitch, int mode ) } } /* blit_setup */ -void namcona1_state::namcona1_blit() +void namcona1_state::blit() { int src0 = m_vreg[0x0]; int src1 = m_vreg[0x1]; @@ -487,16 +487,16 @@ void namcona1_state::namcona1_blit() src_offset = 0; } } -} /* namcona1_blit */ +} /* blit */ -WRITE16_MEMBER(namcona1_state::namcona1_vreg_w) +WRITE16_MEMBER(namcona1_state::vreg_w) { COMBINE_DATA( &m_vreg[offset] ); switch( offset ) { case 0x18/2: - namcona1_blit(); + blit(); /* see also 0x1e */ break; @@ -505,7 +505,7 @@ WRITE16_MEMBER(namcona1_state::namcona1_vreg_w) /* interrupt enable mask; 0 enables INT level */ break; } -} /* namcona1_vreg_w */ +} /* vreg_w */ /***************************************************************/ @@ -546,10 +546,10 @@ static ADDRESS_MAP_START( namcona1_main_map, AS_PROGRAM, 16, namcona1_state ) AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("maincpu", 0) // code AM_RANGE(0xe00000, 0xe00fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff) AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w) - AM_RANGE(0xefff00, 0xefffff) AM_RAM_WRITE(namcona1_vreg_w) AM_SHARE("vreg") - AM_RANGE(0xf00000, 0xf01fff) AM_RAM_WRITE(namcona1_paletteram_w) AM_SHARE("paletteram") - AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w) AM_SHARE("cgram") - AM_RANGE(0xff0000, 0xffbfff) AM_RAM_WRITE(namcona1_videoram_w) AM_SHARE("videoram") + AM_RANGE(0xefff00, 0xefffff) AM_RAM_WRITE(vreg_w) AM_SHARE("vreg") + AM_RANGE(0xf00000, 0xf01fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") + AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(gfxram_r, gfxram_w) AM_SHARE("cgram") + AM_RANGE(0xff0000, 0xffbfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0xffd000, 0xffdfff) AM_RAM /* unknown */ AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_SHARE("scroll") /* scroll registers */ AM_RANGE(0xfff000, 0xffffff) AM_RAM AM_SHARE("spriteram") /* spriteram */ @@ -694,6 +694,14 @@ void namcona1_state::machine_start() m_maskrom = (UINT16 *)memregion("maskrom")->base(); m_mEnableInterrupts = 0; m_c140->set_base(m_workram); + + save_item(NAME(m_mEnableInterrupts)); + save_item(NAME(m_count)); + save_item(NAME(m_mcu_mailbox)); + save_item(NAME(m_mcu_port4)); + save_item(NAME(m_mcu_port5)); + save_item(NAME(m_mcu_port6)); + save_item(NAME(m_mcu_port8)); } // the MCU boots the 68000 @@ -893,7 +901,7 @@ GFXDECODE_END // IRQ 1 => // IRQ 2 => -TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::namcona1_interrupt) +TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::interrupt) { int scanline = param; int enabled = m_mEnableInterrupts ? ~m_vreg[0x1a/2] : 0; @@ -933,7 +941,7 @@ static MACHINE_CONFIG_START( namcona1, namcona1_state ) MCFG_CPU_PROGRAM_MAP(namcona1_mcu_map) MCFG_CPU_IO_MAP( namcona1_mcu_io_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_main", namcona1_state, namcona1_interrupt, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_main", namcona1_state, interrupt, "screen", 0, 1) MCFG_EEPROM_2816_ADD("eeprom") @@ -943,7 +951,7 @@ static MACHINE_CONFIG_START( namcona1, namcona1_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(38*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(8, 38*8-1-8, 4*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(namcona1_state, screen_update_namcona1) + MCFG_SCREEN_UPDATE_DRIVER(namcona1_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x2000) @@ -992,7 +1000,7 @@ DRIVER_INIT_MEMBER(namcona1_state,knckhead) { m_gametype = NAMCO_KNCKHEAD; } DRIVER_INIT_MEMBER(namcona1_state,numanath) { m_gametype = NAMCO_NUMANATH; } DRIVER_INIT_MEMBER(namcona1_state,quiztou) { m_gametype = NAMCO_QUIZTOU; } DRIVER_INIT_MEMBER(namcona1_state,swcourt) { m_gametype = NAMCO_SWCOURT; } -DRIVER_INIT_MEMBER(namcona1_state,tinklpit) { m_gametype = NAMCO_TINKLPIT; } +DRIVER_INIT_MEMBER(namcona1_state,tinklpit) { m_gametype = NAMCO_TINKLPIT; save_item(NAME(m_keyval)); } DRIVER_INIT_MEMBER(namcona1_state,xday2) { m_gametype = NAMCO_XDAY2; } ROM_START( bkrtmaq ) @@ -1301,25 +1309,25 @@ ROM_START( xday2 ) ROM_END // NA-1 (C69 MCU) -GAME( 1992, bkrtmaq, 0, namcona1w, namcona1_quiz, namcona1_state,bkrtmaq, ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", 0 ) -GAME( 1992, cgangpzl, 0, namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 ) -GAME( 1992, cgangpzlj, cgangpzl, namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 ) -GAME( 1992, exvania, 0, namcona1, namcona1_joy, namcona1_state, exbania, ROT0, "Namco", "Exvania (World)", 0 ) -GAME( 1992, exvaniaj, exvania, namcona1, namcona1_joy, namcona1_state, exbania, ROT0, "Namco", "Exvania (Japan)", 0 ) -GAME( 1992, fghtatck, 0, namcona1, namcona1_joy, namcona1_state, fa, ROT90,"Namco", "Fighter & Attacker (US)", 0 ) -GAME( 1992, fa, fghtatck, namcona1, namcona1_joy, namcona1_state, fa, ROT90,"Namco", "F/A (Japan)", 0 ) -GAME( 1992, swcourt, 0, namcona1w, namcona1_joy, namcona1_state, swcourt, ROT0, "Namco", "Super World Court (World)", 0 ) -GAME( 1992, swcourtj, swcourt, namcona1w, namcona1_joy, namcona1_state, swcourt, ROT0, "Namco", "Super World Court (Japan)", 0 ) -GAME( 1993, emeraldaj, emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */ -GAME( 1993, emeraldaja, emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */ -GAME( 1993, tinklpit, 0, namcona1w, namcona1_joy, namcona1_state, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 ) +GAME( 1992, bkrtmaq, 0, namcona1w, namcona1_quiz, namcona1_state,bkrtmaq, ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, cgangpzl, 0, namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", GAME_SUPPORTS_SAVE ) +GAME( 1992, cgangpzlj, cgangpzl, namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, exvania, 0, namcona1, namcona1_joy, namcona1_state, exbania, ROT0, "Namco", "Exvania (World)", GAME_SUPPORTS_SAVE ) +GAME( 1992, exvaniaj, exvania, namcona1, namcona1_joy, namcona1_state, exbania, ROT0, "Namco", "Exvania (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, fghtatck, 0, namcona1, namcona1_joy, namcona1_state, fa, ROT90,"Namco", "Fighter & Attacker (US)", GAME_SUPPORTS_SAVE ) +GAME( 1992, fa, fghtatck, namcona1, namcona1_joy, namcona1_state, fa, ROT90,"Namco", "F/A (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, swcourt, 0, namcona1w, namcona1_joy, namcona1_state, swcourt, ROT0, "Namco", "Super World Court (World)", GAME_SUPPORTS_SAVE ) +GAME( 1992, swcourtj, swcourt, namcona1w, namcona1_joy, namcona1_state, swcourt, ROT0, "Namco", "Super World Court (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1993, emeraldaj, emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", GAME_SUPPORTS_SAVE ) /* Parent is below on NA-2 Hardware */ +GAME( 1993, emeraldaja, emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", GAME_SUPPORTS_SAVE ) /* Parent is below on NA-2 Hardware */ +GAME( 1993, tinklpit, 0, namcona1w, namcona1_joy, namcona1_state, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", GAME_SUPPORTS_SAVE ) // NA-2 (C70 MCU) -GAME( 1992, knckhead, 0, namcona2, namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (World)", 0 ) -GAME( 1992, knckheadj, knckhead, namcona2, namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", 0 ) -GAME( 1992, knckheadjp, knckhead, namcona2, namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan, Prototype?)", 0 ) -GAME( 1993, emeralda, 0, namcona2, namcona1_joy, namcona1_state, emeralda, ROT0, "Namco", "Emeraldia (World)", 0 ) -GAME( 1993, numanath, 0, namcona2, namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (World)", 0 ) -GAME( 1993, numanathj, numanath, namcona2, namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (Japan)", 0 ) -GAME( 1993, quiztou, 0, namcona2, namcona1_quiz, namcona1_state,quiztou, ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", 0 ) -GAME( 1995, xday2, 0, namcona2, namcona1_joy, namcona1_state, xday2, ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1992, knckhead, 0, namcona2, namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (World)", GAME_SUPPORTS_SAVE ) +GAME( 1992, knckheadj, knckhead, namcona2, namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, knckheadjp, knckhead, namcona2, namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan, Prototype?)", GAME_SUPPORTS_SAVE ) +GAME( 1993, emeralda, 0, namcona2, namcona1_joy, namcona1_state, emeralda, ROT0, "Namco", "Emeraldia (World)", GAME_SUPPORTS_SAVE ) +GAME( 1993, numanath, 0, namcona2, namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (World)", GAME_SUPPORTS_SAVE ) +GAME( 1993, numanathj, numanath, namcona2, namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1993, quiztou, 0, namcona2, namcona1_quiz, namcona1_state,quiztou, ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1995, xday2, 0, namcona2, namcona1_joy, namcona1_state, xday2, ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/namcona1.h b/src/mame/includes/namcona1.h index 94d99cffefb..74b5fd888ee 100644 --- a/src/mame/includes/namcona1.h +++ b/src/mame/includes/namcona1.h @@ -85,7 +85,7 @@ public: DECLARE_READ16_MEMBER(custom_key_r); DECLARE_WRITE16_MEMBER(custom_key_w); - DECLARE_WRITE16_MEMBER(namcona1_vreg_w); + DECLARE_WRITE16_MEMBER(vreg_w); DECLARE_READ16_MEMBER(mcu_mailbox_r); DECLARE_WRITE16_MEMBER(mcu_mailbox_w_68k); DECLARE_WRITE16_MEMBER(mcu_mailbox_w_mcu); @@ -105,18 +105,19 @@ public: void simulate_mcu(); void write_version_info(); int transfer_dword(UINT32 dest, UINT32 source); - void namcona1_blit(); + void blit(); void UpdatePalette(int offset); - DECLARE_WRITE16_MEMBER(namcona1_videoram_w); - DECLARE_WRITE16_MEMBER(namcona1_paletteram_w); - DECLARE_READ16_MEMBER(namcona1_gfxram_r); - DECLARE_WRITE16_MEMBER(namcona1_gfxram_w); + DECLARE_WRITE16_MEMBER(videoram_w); + DECLARE_WRITE16_MEMBER(paletteram_w); + DECLARE_READ16_MEMBER(gfxram_r); + DECLARE_WRITE16_MEMBER(gfxram_w); void pdraw_tile( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, UINT32 code, int color, int sx, int sy, int flipx, int flipy, int priority, int bShadow, int bOpaque, int gfx_region ); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int primask ); DECLARE_READ16_MEMBER(snd_r); DECLARE_WRITE16_MEMBER(snd_w); + DECLARE_DRIVER_INIT(bkrtmaq); DECLARE_DRIVER_INIT(quiztou); DECLARE_DRIVER_INIT(emeralda); @@ -129,16 +130,20 @@ public: DECLARE_DRIVER_INIT(xday2); DECLARE_DRIVER_INIT(exbania); DECLARE_DRIVER_INIT(emeraldj); + virtual void machine_start(); + virtual void machine_reset(); + virtual void video_start(); + TILE_GET_INFO_MEMBER(tilemap_get_info0); TILE_GET_INFO_MEMBER(tilemap_get_info1); TILE_GET_INFO_MEMBER(tilemap_get_info2); TILE_GET_INFO_MEMBER(tilemap_get_info3); TILE_GET_INFO_MEMBER(roz_get_info); - virtual void machine_start(); - virtual void machine_reset(); - virtual void video_start(); - UINT32 screen_update_namcona1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(namcona1_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + void postload(); private: void tilemap_get_info(tile_data &tileinfo, int tile_index, const UINT16 *tilemap_videoram, bool use_4bpp_gfx); diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c index db20eadddf6..9b37ca88f40 100644 --- a/src/mame/video/namcona1.c +++ b/src/mame/video/namcona1.c @@ -36,26 +36,22 @@ void namcona1_state::tilemap_get_info( TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info0) { - UINT16 *videoram = m_videoram; - tilemap_get_info(tileinfo,tile_index,0*0x1000+videoram,m_vreg[0xbc/2]&1); + tilemap_get_info(tileinfo,tile_index,0*0x1000+m_videoram,m_vreg[0xbc/2]&1); } TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info1) { - UINT16 *videoram = m_videoram; - tilemap_get_info(tileinfo,tile_index,1*0x1000+videoram,m_vreg[0xbc/2]&2); + tilemap_get_info(tileinfo,tile_index,1*0x1000+m_videoram,m_vreg[0xbc/2]&2); } TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info2) { - UINT16 *videoram = m_videoram; - tilemap_get_info(tileinfo,tile_index,2*0x1000+videoram,m_vreg[0xbc/2]&4); + tilemap_get_info(tileinfo,tile_index,2*0x1000+m_videoram,m_vreg[0xbc/2]&4); } TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info3) { - UINT16 *videoram = m_videoram; - tilemap_get_info(tileinfo,tile_index,3*0x1000+videoram,m_vreg[0xbc/2]&8); + tilemap_get_info(tileinfo,tile_index,3*0x1000+m_videoram,m_vreg[0xbc/2]&8); } TILE_GET_INFO_MEMBER(namcona1_state::roz_get_info) @@ -82,10 +78,9 @@ TILE_GET_INFO_MEMBER(namcona1_state::roz_get_info) /*************************************************************************/ -WRITE16_MEMBER(namcona1_state::namcona1_videoram_w) +WRITE16_MEMBER(namcona1_state::videoram_w) { - UINT16 *videoram = m_videoram; - COMBINE_DATA( &videoram[offset] ); + COMBINE_DATA( &m_videoram[offset] ); if( offset<0x8000/2 ) { m_bg_tilemap[offset/0x1000]->mark_tile_dirty(offset&0xfff); @@ -94,7 +89,7 @@ WRITE16_MEMBER(namcona1_state::namcona1_videoram_w) { m_bg_tilemap[4]->mark_all_dirty(); } -} /* namcona1_videoram_w */ +} /* videoram_w */ /*************************************************************************/ @@ -113,9 +108,9 @@ void namcona1_state::UpdatePalette( int offset ) m_palette->set_pen_color(offset+0x1000, r, g, b); m_palette->set_pen_color(offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0)); -} /* namcona1_paletteram_w */ +} -WRITE16_MEMBER(namcona1_state::namcona1_paletteram_w) +WRITE16_MEMBER(namcona1_state::paletteram_w) { COMBINE_DATA( &m_paletteram[offset] ); if( m_vreg[0x8e/2] ) @@ -129,7 +124,7 @@ WRITE16_MEMBER(namcona1_state::namcona1_paletteram_w) } -READ16_MEMBER(namcona1_state::namcona1_gfxram_r) +READ16_MEMBER(namcona1_state::gfxram_r) { UINT16 type = m_vreg[0x0c/2]; if( type == 0x03 ) @@ -145,9 +140,9 @@ READ16_MEMBER(namcona1_state::namcona1_gfxram_r) return m_cgram[offset]; } return 0x0000; -} /* namcona1_gfxram_r */ +} /* gfxram_r */ -WRITE16_MEMBER(namcona1_state::namcona1_gfxram_w) +WRITE16_MEMBER(namcona1_state::gfxram_w) { UINT16 type = m_vreg[0x0c/2]; UINT16 old_word; @@ -174,7 +169,7 @@ WRITE16_MEMBER(namcona1_state::namcona1_gfxram_w) m_gfxdecode->gfx(1)->mark_dirty(offset/0x20); } } -} /* namcona1_gfxram_w */ +} /* gfxram_w */ void namcona1_state::video_start() { @@ -190,7 +185,19 @@ void namcona1_state::video_start() m_shaperam.resize(0x8000); m_gfxdecode->gfx(2)->set_source(&m_shaperam[0]); -} /* namcona1_vh_start */ + + save_item(NAME(m_shaperam)); + save_item(NAME(m_palette_is_dirty)); + + machine().save().register_postload(save_prepost_delegate(FUNC(namcona1_state::postload), this)); +} /* video_start */ + +void namcona1_state::postload() +{ + for (int i = 0; i < 3; i++) + m_gfxdecode->gfx(i)->mark_all_dirty(); +} + /*************************************************************************/ @@ -510,7 +517,7 @@ void namcona1_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap } } /* draw_background */ -UINT32 namcona1_state::screen_update_namcona1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 namcona1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int which; int priority; From f31867c303efeb3bf39dea09b72c5a46ce1e01ee Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 22 Jul 2015 20:39:57 +0200 Subject: [PATCH 52/54] destroyr.c: killed anonymous timers, enabled save state support (nw) --- src/mame/drivers/destroyr.c | 86 ++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c index 4461a9ca70b..83fb3f551a8 100644 --- a/src/mame/drivers/destroyr.c +++ b/src/mame/drivers/destroyr.c @@ -29,13 +29,19 @@ public: destroyr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_alpha_num_ram(*this, "alpha_nuram"), - m_major_obj_ram(*this, "major_obj_ram"), - m_minor_obj_ram(*this, "minor_obj_ram"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_alpha_num_ram(*this, "alpha_nuram"), + m_major_obj_ram(*this, "major_obj_ram"), + m_minor_obj_ram(*this, "minor_obj_ram") { } + + /* devices */ + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; /* memory pointers */ required_shared_ptr m_alpha_num_ram; @@ -52,32 +58,31 @@ public: int m_attract; int m_motor_speed; int m_noise; + emu_timer *m_dial_timer; + emu_timer *m_frame_timer; - /* devices */ - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; + DECLARE_WRITE8_MEMBER(misc_w); + DECLARE_WRITE8_MEMBER(cursor_load_w); + DECLARE_WRITE8_MEMBER(interrupt_ack_w); + DECLARE_WRITE8_MEMBER(output_w); + DECLARE_READ8_MEMBER(input_r); + DECLARE_READ8_MEMBER(scanline_r); - DECLARE_WRITE8_MEMBER(destroyr_misc_w); - DECLARE_WRITE8_MEMBER(destroyr_cursor_load_w); - DECLARE_WRITE8_MEMBER(destroyr_interrupt_ack_w); - DECLARE_WRITE8_MEMBER(destroyr_output_w); - DECLARE_READ8_MEMBER(destroyr_input_r); - DECLARE_READ8_MEMBER(destroyr_scanline_r); virtual void machine_start(); virtual void machine_reset(); DECLARE_PALETTE_INIT(destroyr); - UINT32 screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(destroyr_dial_callback); - TIMER_CALLBACK_MEMBER(destroyr_frame_callback); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_CALLBACK_MEMBER(dial_callback); + TIMER_CALLBACK_MEMBER(frame_callback); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); }; -UINT32 destroyr_state::screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, j; @@ -149,10 +154,10 @@ void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int para switch (id) { case TIMER_DESTROYR_DIAL: - destroyr_dial_callback(ptr, param); + dial_callback(ptr, param); break; case TIMER_DESTROYR_FRAME: - destroyr_frame_callback(ptr, param); + frame_callback(ptr, param); break; default: assert_always(FALSE, "Unknown id in destroyr_state::device_timer"); @@ -160,7 +165,7 @@ void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int para } -TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_dial_callback) +TIMER_CALLBACK_MEMBER(destroyr_state::dial_callback) { int dial = param; @@ -180,14 +185,14 @@ TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_dial_callback) } -TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_frame_callback) +TIMER_CALLBACK_MEMBER(destroyr_state::frame_callback) { m_potsense[0] = 0; m_potsense[1] = 0; /* PCB supports two dials, but cab has only got one */ - timer_set(m_screen->time_until_pos(ioport("PADDLE")->read()), TIMER_DESTROYR_DIAL); - timer_set(m_screen->time_until_pos(0), TIMER_DESTROYR_FRAME); + m_dial_timer->adjust(m_screen->time_until_pos(ioport("PADDLE")->read())); + m_frame_timer->adjust(m_screen->time_until_pos(0)); } @@ -207,7 +212,7 @@ void destroyr_state::machine_reset() } -WRITE8_MEMBER(destroyr_state::destroyr_misc_w) +WRITE8_MEMBER(destroyr_state::misc_w) { /* bits 0 to 2 connect to the sound circuits */ m_attract = data & 0x01; @@ -222,22 +227,22 @@ WRITE8_MEMBER(destroyr_state::destroyr_misc_w) } -WRITE8_MEMBER(destroyr_state::destroyr_cursor_load_w) +WRITE8_MEMBER(destroyr_state::cursor_load_w) { m_cursor = data; watchdog_reset_w(space, offset, data); } -WRITE8_MEMBER(destroyr_state::destroyr_interrupt_ack_w) +WRITE8_MEMBER(destroyr_state::interrupt_ack_w) { m_maincpu->set_input_line(0, CLEAR_LINE); } -WRITE8_MEMBER(destroyr_state::destroyr_output_w) +WRITE8_MEMBER(destroyr_state::output_w) { - if (offset & 8) destroyr_misc_w(space, 8, data); + if (offset & 8) misc_w(space, 8, data); else switch (offset & 7) { @@ -269,7 +274,7 @@ WRITE8_MEMBER(destroyr_state::destroyr_output_w) } -READ8_MEMBER(destroyr_state::destroyr_input_r) +READ8_MEMBER(destroyr_state::input_r) { if (offset & 1) { @@ -290,7 +295,7 @@ READ8_MEMBER(destroyr_state::destroyr_input_r) } -READ8_MEMBER(destroyr_state::destroyr_scanline_r) +READ8_MEMBER(destroyr_state::scanline_r) { return m_screen->vpos(); } @@ -299,14 +304,14 @@ READ8_MEMBER(destroyr_state::destroyr_scanline_r) static ADDRESS_MAP_START( destroyr_map, AS_PROGRAM, 8, destroyr_state ) ADDRESS_MAP_GLOBAL_MASK(0x7fff) AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0xf00) AM_RAM - AM_RANGE(0x1000, 0x1fff) AM_READWRITE(destroyr_input_r, destroyr_output_w) + AM_RANGE(0x1000, 0x1fff) AM_READWRITE(input_r, output_w) AM_RANGE(0x2000, 0x2fff) AM_READ_PORT("IN2") AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0xf00) AM_WRITEONLY AM_SHARE("alpha_nuram") AM_RANGE(0x4000, 0x401f) AM_MIRROR(0xfe0) AM_WRITEONLY AM_SHARE("major_obj_ram") - AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xff8) AM_WRITE(destroyr_cursor_load_w) - AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xff8) AM_WRITE(destroyr_interrupt_ack_w) + AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xff8) AM_WRITE(cursor_load_w) + AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xff8) AM_WRITE(interrupt_ack_w) AM_RANGE(0x5002, 0x5007) AM_MIRROR(0xff8) AM_WRITEONLY AM_SHARE("minor_obj_ram") - AM_RANGE(0x6000, 0x6fff) AM_READ(destroyr_scanline_r) + AM_RANGE(0x6000, 0x6fff) AM_READ(scanline_r) AM_RANGE(0x7000, 0x7fff) AM_ROM ADDRESS_MAP_END @@ -469,6 +474,9 @@ PALETTE_INIT_MEMBER(destroyr_state, destroyr) void destroyr_state::machine_start() { + m_dial_timer = timer_alloc(TIMER_DESTROYR_DIAL); + m_frame_timer = timer_alloc(TIMER_DESTROYR_FRAME); + save_item(NAME(m_cursor)); save_item(NAME(m_wavemod)); save_item(NAME(m_attract)); @@ -491,7 +499,7 @@ static MACHINE_CONFIG_START( destroyr, destroyr_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(256, 262) MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239) - MCFG_SCREEN_UPDATE_DRIVER(destroyr_state, screen_update_destroyr) + MCFG_SCREEN_UPDATE_DRIVER(destroyr_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", destroyr) @@ -552,5 +560,5 @@ ROM_START( destroyr1 ) ROM_END -GAMEL( 1977, destroyr, 0, destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O2)", GAME_NO_SOUND, layout_destroyr ) -GAMEL( 1977, destroyr1, destroyr, destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O1)", GAME_NO_SOUND, layout_destroyr ) +GAMEL( 1977, destroyr, 0, destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_destroyr ) +GAMEL( 1977, destroyr1, destroyr, destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_destroyr ) From f395bf7dd363ba8fbae3e5ff1bf10e5ee48ca882 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 22 Jul 2015 20:55:17 +0200 Subject: [PATCH 53/54] ttchamp.c: added save state support (nw) --- src/mame/drivers/ttchamp.c | 149 ++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 68 deletions(-) diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c index cf85d0a47e8..36500399d30 100644 --- a/src/mame/drivers/ttchamp.c +++ b/src/mame/drivers/ttchamp.c @@ -31,7 +31,7 @@ _| 74LS244 74LS14N 74HC74 16MHz |D70116C-10 | | |__________________________________________________| -The PCB is Spanish and manufacured by Gamart. +The PCB is Spanish and manufactured by Gamart. Table tennis Championships by Gamart 1995 @@ -46,7 +46,7 @@ Rom files definition: ttennis2/3 main program ttennis1 adpcm data ttennis4/5 graphics -*there is a pic16c84 that i cannot dump because my programmer doesn't support it. +*there is a pic16c84 that I cannot dump because my programmer doesn't support it. Dumped by tirino73 @@ -59,7 +59,7 @@ Dumped by tirino73 - A bunch of spurious RAM writes to ROM area (genuine bug? left-overs?) Notes -I think the PIC is used to interface with battry backed RAM instead of an EEPROM, +I think the PIC is used to interface with battery backed RAM instead of an EEPROM, we currently simulate this as the PIC is read protected. @@ -71,6 +71,7 @@ we currently simulate this as the PIC is read protected. #include "sound/okim6295.h" #include "machine/nvram.h" + class ttchamp_state : public driver_device { public: @@ -79,37 +80,15 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT16* m_peno_mainram; - + required_device m_maincpu; + required_device m_palette; + UINT16 m_paloff; - DECLARE_WRITE16_MEMBER(paloff_w); - DECLARE_WRITE16_MEMBER(pcup_prgbank_w); - DECLARE_WRITE16_MEMBER(paldat_w); - - DECLARE_WRITE16_MEMBER(port10_w); - - DECLARE_WRITE16_MEMBER(port20_w); - DECLARE_WRITE16_MEMBER(port62_w); - - DECLARE_READ16_MEMBER(port1e_r); - - DECLARE_READ16_MEMBER(ttchamp_pic_r); - DECLARE_WRITE16_MEMBER(ttchamp_pic_w); - UINT16 m_port10; UINT8 m_rombank; - - DECLARE_DRIVER_INIT(ttchamp); - - DECLARE_READ16_MEMBER(ttchamp_blit_start_r); - - DECLARE_READ16_MEMBER(ttchamp_mem_r); - DECLARE_WRITE16_MEMBER(ttchamp_mem_w); - UINT16 m_videoram0[0x10000 / 2]; UINT16 m_videoram2[0x10000 / 2]; - enum picmode { PIC_IDLE = 0, @@ -118,8 +97,9 @@ public: PIC_SET_WRITELATCH = 3, PIC_SET_READLATCH = 4 - } picmodex; + }; + picmode m_picmodex; int m_pic_readaddr; int m_pic_writeaddr; @@ -133,27 +113,63 @@ public: int m_spritesinit; int m_spriteswidth; int m_spritesaddr; - - virtual void machine_start(); UINT16* m_rom16; UINT8* m_rom8; + DECLARE_WRITE16_MEMBER(paloff_w); + DECLARE_WRITE16_MEMBER(pcup_prgbank_w); + DECLARE_WRITE16_MEMBER(paldat_w); + + DECLARE_WRITE16_MEMBER(port10_w); + + DECLARE_WRITE16_MEMBER(port20_w); + DECLARE_WRITE16_MEMBER(port62_w); + + DECLARE_READ16_MEMBER(port1e_r); + + DECLARE_READ16_MEMBER(pic_r); + DECLARE_WRITE16_MEMBER(pic_w); + + DECLARE_READ16_MEMBER(blit_start_r); + + DECLARE_READ16_MEMBER(mem_r); + DECLARE_WRITE16_MEMBER(mem_w); + + virtual void machine_start(); virtual void video_start(); - UINT32 screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(ttchamp_irq); - required_device m_maincpu; - required_device m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + INTERRUPT_GEN_MEMBER(irq); }; +ALLOW_SAVE_TYPE(ttchamp_state::picmode); + + void ttchamp_state::machine_start() { m_rom16 = (UINT16*)memregion("maincpu")->base(); m_rom8 = memregion("maincpu")->base(); - picmodex = PIC_IDLE; + m_picmodex = PIC_IDLE; m_bakram = auto_alloc_array(machine(), UINT8, 0x100); machine().device("backram")->set_base(m_bakram, 0x100); + + save_item(NAME(m_paloff)); + save_item(NAME(m_port10)); + save_item(NAME(m_rombank)); + save_item(NAME(m_videoram0)); + save_item(NAME(m_videoram2)); + save_item(NAME(m_picmodex)); + save_item(NAME(m_pic_readaddr)); + save_item(NAME(m_pic_writeaddr)); + save_item(NAME(m_pic_latched)); + save_item(NAME(m_pic_writelatched)); + save_item(NAME(m_mainram)); + save_item(NAME(m_spritesinit)); + save_item(NAME(m_spriteswidth)); + save_item(NAME(m_spritesaddr)); } @@ -161,7 +177,7 @@ void ttchamp_state::video_start() { } -UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { logerror("update\n"); int y,x,count; @@ -261,13 +277,13 @@ WRITE16_MEMBER(ttchamp_state::paldat_w) m_palette->set_pen_color(m_paloff & 0x3ff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10)); } -READ16_MEMBER(ttchamp_state::ttchamp_pic_r) +READ16_MEMBER(ttchamp_state::pic_r) { // printf("%06x: read from PIC (%04x)\n", space.device().safe_pc(),mem_mask); - if (picmodex == PIC_SET_READLATCH) + if (m_picmodex == PIC_SET_READLATCH) { // printf("read data %02x from %02x\n", m_pic_latched, m_pic_readaddr); - picmodex = PIC_IDLE; + m_picmodex = PIC_IDLE; return m_pic_latched << 8; @@ -276,29 +292,29 @@ READ16_MEMBER(ttchamp_state::ttchamp_pic_r) } -WRITE16_MEMBER(ttchamp_state::ttchamp_pic_w) +WRITE16_MEMBER(ttchamp_state::pic_w) { -// printf("%06x: write to PIC %04x (%04x) (%d)\n", space.device().safe_pc(),data,mem_mask, picmodex); - if (picmodex == PIC_IDLE) +// printf("%06x: write to PIC %04x (%04x) (%d)\n", space.device().safe_pc(),data,mem_mask, m_picmodex); + if (m_picmodex == PIC_IDLE) { if (data == 0x11) { - picmodex = PIC_SET_READADDRESS; + m_picmodex = PIC_SET_READADDRESS; // printf("state = SET_READADDRESS\n"); } else if (data == 0x12) { - picmodex = PIC_SET_WRITELATCH; + m_picmodex = PIC_SET_WRITELATCH; // printf("latch write data.. \n" ); } else if (data == 0x20) { - picmodex = PIC_SET_WRITEADDRESS; + m_picmodex = PIC_SET_WRITEADDRESS; // printf("state = PIC_SET_WRITEADDRESS\n"); } else if (data == 0x21) // write latched data { - picmodex = PIC_IDLE; + m_picmodex = PIC_IDLE; m_bakram[m_pic_writeaddr] = m_pic_writelatched; // printf("wrote %02x to %02x\n", m_pic_writelatched, m_pic_writeaddr); } @@ -309,33 +325,33 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_pic_w) m_pic_latched = m_bakram[m_pic_readaddr>>1]; // printf("latch read data %02x from %02x\n",m_pic_latched, m_pic_readaddr ); - picmodex = PIC_SET_READLATCH; // waiting to read... + m_picmodex = PIC_SET_READLATCH; // waiting to read... } else { // printf("unknown\n"); } } - else if (picmodex == PIC_SET_READADDRESS) + else if (m_picmodex == PIC_SET_READADDRESS) { m_pic_readaddr = data; - picmodex = PIC_IDLE; + m_picmodex = PIC_IDLE; } - else if (picmodex == PIC_SET_WRITEADDRESS) + else if (m_picmodex == PIC_SET_WRITEADDRESS) { m_pic_writeaddr = data; - picmodex = PIC_IDLE; + m_picmodex = PIC_IDLE; } - else if (picmodex == PIC_SET_WRITELATCH) + else if (m_picmodex == PIC_SET_WRITELATCH) { m_pic_writelatched = data; - picmodex = PIC_IDLE; + m_picmodex = PIC_IDLE; } } -READ16_MEMBER(ttchamp_state::ttchamp_mem_r) +READ16_MEMBER(ttchamp_state::mem_r) { // bits 0xf0 are used too, so this is likely wrong. @@ -367,7 +383,7 @@ READ16_MEMBER(ttchamp_state::ttchamp_mem_r) } } -WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) +WRITE16_MEMBER(ttchamp_state::mem_w) { // this is very strange, we use the offset (address bits) not data bits to set values.. // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? @@ -484,7 +500,7 @@ WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w) static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state ) - AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) + AM_RANGE(0x00000, 0xfffff) AM_READWRITE(mem_r, mem_w) ADDRESS_MAP_END /* Re-use same parameters as before (one-shot) */ @@ -494,7 +510,7 @@ READ16_MEMBER(ttchamp_state::port1e_r) return 0xff; } -READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r) +READ16_MEMBER(ttchamp_state::blit_start_r) { m_spritesinit = 1; return 0xff; @@ -533,7 +549,7 @@ static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) AM_RANGE(0x0006, 0x0007) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) - AM_RANGE(0x0018, 0x0019) AM_READ(ttchamp_blit_start_r) // read before using bus write offset as blit parameters + AM_RANGE(0x0018, 0x0019) AM_READ(blit_start_r) // read before using bus write offset as blit parameters AM_RANGE(0x001e, 0x001f) AM_READ(port1e_r) // read before some blit operations (but not all) AM_RANGE(0x0008, 0x0009) AM_WRITE(paldat_w) @@ -543,7 +559,7 @@ static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) AM_RANGE(0x0020, 0x0021) AM_WRITE(port20_w) - AM_RANGE(0x0034, 0x0035) AM_READWRITE(ttchamp_pic_r, ttchamp_pic_w) + AM_RANGE(0x0034, 0x0035) AM_READWRITE(pic_r, pic_w) AM_RANGE(0x0062, 0x0063) AM_WRITE(port62_w) @@ -616,7 +632,7 @@ static INPUT_PORTS_START(ttchamp) INPUT_PORTS_END -INTERRUPT_GEN_MEMBER(ttchamp_state::ttchamp_irq)/* right? */ +INTERRUPT_GEN_MEMBER(ttchamp_state::irq)/* right? */ { device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); } @@ -626,7 +642,7 @@ static MACHINE_CONFIG_START( ttchamp, ttchamp_state ) MCFG_CPU_ADD("maincpu", V30, 8000000) MCFG_CPU_PROGRAM_MAP(ttchamp_map) MCFG_CPU_IO_MAP(ttchamp_io) - MCFG_CPU_VBLANK_INT_DRIVER("screen", ttchamp_state, ttchamp_irq) + MCFG_CPU_VBLANK_INT_DRIVER("screen", ttchamp_state, irq) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -634,7 +650,7 @@ static MACHINE_CONFIG_START( ttchamp, ttchamp_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(1024,1024) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) - MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update_ttchamp) + MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 0x400) @@ -676,10 +692,7 @@ ROM_START( ttchampa ) ROM_LOAD( "27c020.1", 0x000000, 0x040000, CRC(e2c4fe95) SHA1(da349035cc348db220a1e12b4c2a6021e2168425) ) ROM_END -DRIVER_INIT_MEMBER(ttchamp_state,ttchamp) -{ -} // only the graphics differ between the two sets, code section is the same -GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions", 0 ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' -GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", 0 ) // this only has Palencia Elektronik advertising boards +GAME( 1995, ttchamp, 0, ttchamp, ttchamp, driver_device, 0, ROT0, "Gamart", "Table Tennis Champions", GAME_SUPPORTS_SAVE ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' +GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, driver_device, 0, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", GAME_SUPPORTS_SAVE ) // this only has Palencia Elektronik advertising boards From 81a83258203c49a66adc41725092841b6c77638c Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 22 Jul 2015 21:48:58 +0200 Subject: [PATCH 54/54] wrong name --- src/mame/mess.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/mess.lst b/src/mame/mess.lst index 853c9f85461..894cd124e80 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -2224,7 +2224,7 @@ tbreakup // Tomy elecbowl // Marx mbdtower // Milton Bradley -// hh_tms1k snspell.c +// hh_tms1k tispeak.c snspell snspella snspellb