From c6624744a45d0ebf71bce707eaa50d14a8bf3f70 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Fri, 8 May 2015 10:06:43 +0200 Subject: [PATCH 01/35] 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/35] 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/35] 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/35] 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 13254b740a5353185235e37a2364240c6e5799a7 Mon Sep 17 00:00:00 2001 From: Joakim Larsson Date: Sat, 13 Jun 2015 23:23:58 +0200 Subject: [PATCH 05/35] 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 06/35] 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 07/35] 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 08/35] 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 09/35] 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 10/35] 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 11/35] 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 12/35] 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 13/35] 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 14/35] 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 15/35] 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 16/35] 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 17/35] 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 18/35] 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 19/35] 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 20/35] 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 21/35] 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 22/35] 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 23/35] 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 24/35] 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 25/35] 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 26/35] 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 27/35] 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 28/35] 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 29/35] 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 30/35] 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 31/35] 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 32/35] 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 33/35] 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 34/35] 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 35/35] 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