From 136420f6f3190a696386a01ebabeb9e2989d1625 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 29 May 2015 14:02:01 +0200 Subject: [PATCH 001/284] wd_fdc: after a force interrupt command, return status type 1 (fixes sam coupe) --- src/emu/machine/wd_fdc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index 69e75471721..3090656a7d1 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -896,6 +896,9 @@ void wd_fdc_t::interrupt_start() motor_timeout = 0; } + // after a force interrupt command, return status type 1 + status_type_1 = true; + if(!(command & 0x0f)) { intrq_cond = 0; } else { From b940560ccebdfc88416426cfa517a02478daa834 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 29 May 2015 14:12:06 +0200 Subject: [PATCH 002/284] slight update to the previous commit (nw) --- src/emu/machine/wd_fdc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index 3090656a7d1..38b3d2f313b 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -895,9 +895,12 @@ void wd_fdc_t::interrupt_start() drop_drq(); motor_timeout = 0; } - - // after a force interrupt command, return status type 1 - status_type_1 = true; + else + { + // when a force interrupt command is issued and there is no + // currently running command, return the status type 1 bits + status_type_1 = true; + } if(!(command & 0x0f)) { intrq_cond = 0; From 198c77327e08cb6f0dfa2183d6fa226f8908294d Mon Sep 17 00:00:00 2001 From: k2-git Date: Fri, 29 May 2015 21:43:53 +0900 Subject: [PATCH 003/284] machine type attribute added in the xml --- src/emu/emuopts.c | 8 ++++---- src/emu/gamedrv.h | 6 +++++- src/emu/info.c | 10 ++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index c537ce6dc4e..d833c32d5ae 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -421,13 +421,13 @@ void emu_options::parse_standard_inis(std::string &error_string) parse_one_ini("horizont", OPTION_PRIORITY_ORIENTATION_INI, &error_string); if (cursystem->flags & GAME_TYPE_ARCADE) - parse_one_ini("arcade", OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini(GAME_TYPE_STRING_ARCADE, OPTION_PRIORITY_SYSTYPE_INI, &error_string); else if (cursystem->flags & GAME_TYPE_CONSOLE) - parse_one_ini("console", OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini(GAME_TYPE_STRING_CONSOLE, OPTION_PRIORITY_SYSTYPE_INI, &error_string); else if (cursystem->flags & GAME_TYPE_COMPUTER) - parse_one_ini("computer", OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini(GAME_TYPE_STRING_COMPUTER, OPTION_PRIORITY_SYSTYPE_INI, &error_string); else if (cursystem->flags & GAME_TYPE_OTHER) - parse_one_ini("othersys", OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini(GAME_TYPE_STRING_OTHER, OPTION_PRIORITY_SYSTYPE_INI, &error_string); // parse "vector.ini" for vector games { diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h index 36263aec1e1..9299749325f 100644 --- a/src/emu/gamedrv.h +++ b/src/emu/gamedrv.h @@ -49,7 +49,11 @@ const UINT32 GAME_CLICKABLE_ARTWORK = 0x00800000; // marking that artw const UINT32 GAME_IS_SKELETON = GAME_NO_SOUND | GAME_NOT_WORKING; // mask for skelly games const UINT32 GAME_IS_SKELETON_MECHANICAL = GAME_IS_SKELETON | GAME_MECHANICAL | GAME_REQUIRES_ARTWORK; // mask for skelly mechanical games - +// machine type string +#define GAME_TYPE_STRING_ARCADE "arcade" +#define GAME_TYPE_STRING_CONSOLE "console" +#define GAME_TYPE_STRING_COMPUTER "computer" +#define GAME_TYPE_STRING_OTHER "othersys" //************************************************************************** // TYPE DEFINITIONS diff --git a/src/emu/info.c b/src/emu/info.c index 4b5adfab3b1..a7e657782fd 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -39,6 +39,7 @@ const char info_xml_creator::s_dtd_string[] = "\t\t\n" "\t\t\n" "\t\t\n" +"\t\t\n" "\t\t\n" "\t\t\n" "\t\t\n" @@ -273,6 +274,15 @@ void info_xml_creator::output_one() // display sample information and close the game tag output_sampleof(); + // machine type indicator + if (driver.flags & GAME_TYPE_ARCADE) + fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_ARCADE); + else if (driver.flags & GAME_TYPE_CONSOLE) + fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_CONSOLE); + else if (driver.flags & GAME_TYPE_COMPUTER) + fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_COMPUTER); + else if (driver.flags & GAME_TYPE_OTHER) + fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_OTHER); fprintf(m_output, ">\n"); // output game description From 5db0f01e2cec5961b3959ba0bd5878647ff37127 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Fri, 29 May 2015 15:40:29 +0200 Subject: [PATCH 004/284] Revert "machine type attribute added in the xml" Too prone to abuse, we're afraid. This reverts commit 198c77327e08cb6f0dfa2183d6fa226f8908294d. --- src/emu/emuopts.c | 8 ++++---- src/emu/gamedrv.h | 6 +----- src/emu/info.c | 10 ---------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index d833c32d5ae..c537ce6dc4e 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -421,13 +421,13 @@ void emu_options::parse_standard_inis(std::string &error_string) parse_one_ini("horizont", OPTION_PRIORITY_ORIENTATION_INI, &error_string); if (cursystem->flags & GAME_TYPE_ARCADE) - parse_one_ini(GAME_TYPE_STRING_ARCADE, OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini("arcade", OPTION_PRIORITY_SYSTYPE_INI, &error_string); else if (cursystem->flags & GAME_TYPE_CONSOLE) - parse_one_ini(GAME_TYPE_STRING_CONSOLE, OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini("console", OPTION_PRIORITY_SYSTYPE_INI, &error_string); else if (cursystem->flags & GAME_TYPE_COMPUTER) - parse_one_ini(GAME_TYPE_STRING_COMPUTER, OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini("computer", OPTION_PRIORITY_SYSTYPE_INI, &error_string); else if (cursystem->flags & GAME_TYPE_OTHER) - parse_one_ini(GAME_TYPE_STRING_OTHER, OPTION_PRIORITY_SYSTYPE_INI, &error_string); + parse_one_ini("othersys", OPTION_PRIORITY_SYSTYPE_INI, &error_string); // parse "vector.ini" for vector games { diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h index 9299749325f..36263aec1e1 100644 --- a/src/emu/gamedrv.h +++ b/src/emu/gamedrv.h @@ -49,11 +49,7 @@ const UINT32 GAME_CLICKABLE_ARTWORK = 0x00800000; // marking that artw const UINT32 GAME_IS_SKELETON = GAME_NO_SOUND | GAME_NOT_WORKING; // mask for skelly games const UINT32 GAME_IS_SKELETON_MECHANICAL = GAME_IS_SKELETON | GAME_MECHANICAL | GAME_REQUIRES_ARTWORK; // mask for skelly mechanical games -// machine type string -#define GAME_TYPE_STRING_ARCADE "arcade" -#define GAME_TYPE_STRING_CONSOLE "console" -#define GAME_TYPE_STRING_COMPUTER "computer" -#define GAME_TYPE_STRING_OTHER "othersys" + //************************************************************************** // TYPE DEFINITIONS diff --git a/src/emu/info.c b/src/emu/info.c index a7e657782fd..4b5adfab3b1 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -39,7 +39,6 @@ const char info_xml_creator::s_dtd_string[] = "\t\t\n" "\t\t\n" "\t\t\n" -"\t\t\n" "\t\t\n" "\t\t\n" "\t\t\n" @@ -274,15 +273,6 @@ void info_xml_creator::output_one() // display sample information and close the game tag output_sampleof(); - // machine type indicator - if (driver.flags & GAME_TYPE_ARCADE) - fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_ARCADE); - else if (driver.flags & GAME_TYPE_CONSOLE) - fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_CONSOLE); - else if (driver.flags & GAME_TYPE_COMPUTER) - fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_COMPUTER); - else if (driver.flags & GAME_TYPE_OTHER) - fprintf(m_output, " type=\"%s\"", GAME_TYPE_STRING_OTHER); fprintf(m_output, ">\n"); // output game description From f258c865a18a928001018e9e655dec15a2d57b6c Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sat, 30 May 2015 00:03:57 +1000 Subject: [PATCH 005/284] camplynx: Dungeon Adventure now runs on the 48k. --- src/mess/drivers/camplynx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/drivers/camplynx.c b/src/mess/drivers/camplynx.c index c93d60d52f4..1d3b6d6b18a 100644 --- a/src/mess/drivers/camplynx.c +++ b/src/mess/drivers/camplynx.c @@ -363,7 +363,7 @@ READ8_MEMBER( camplynx_state::port80_r ) if BIT(m_port80, 1) { data &= 0xfe; - data |= (m_cass->input() > +0.02) ? 1 : 0; + data |= (m_cass->input() > +0.02) ? 0 : 1; } return data; } From 98102604f9a87ca7ad8ec870a13671feac8e8d8b Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 29 May 2015 16:29:19 +0200 Subject: [PATCH 006/284] cleanups (nw) --- src/emu/bus/cgenie/expansion/floppy.c | 13 ++++++------- src/mess/drivers/cgenie.c | 4 ++-- src/mess/machine/z80ne.c | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/emu/bus/cgenie/expansion/floppy.c b/src/emu/bus/cgenie/expansion/floppy.c index 45d7030f8cb..7f7475a2211 100644 --- a/src/emu/bus/cgenie/expansion/floppy.c +++ b/src/emu/bus/cgenie/expansion/floppy.c @@ -5,8 +5,8 @@ EACA Colour Genie Floppy Disc Controller TODO: - - Only native MESS .mfi files load (some sectors are marked DDM) - - FM mode disks can be formatted but don't work correctly + - Plain sector files are not working (some sectors are marked DDM), + maybe support the .cgd format? - What's the exact FD1793 model? - How does it turn off the motor? - What's the source of the timer and the exact timings? @@ -33,11 +33,10 @@ const device_type CGENIE_FDC = &device_creator; DEVICE_ADDRESS_MAP_START( mmio, 8, cgenie_fdc_device ) AM_RANGE(0xe0, 0xe3) AM_MIRROR(0x10) AM_READWRITE(irq_r, select_w) - AM_RANGE(0xec, 0xef) AM_MIRROR(0x10) AM_DEVREAD("fd1793", fd1793_t, read) - AM_RANGE(0xec, 0xec) AM_MIRROR(0x10) AM_WRITE(command_w) - AM_RANGE(0xed, 0xed) AM_MIRROR(0x10) AM_DEVWRITE("fd1793", fd1793_t, track_w) - AM_RANGE(0xee, 0xee) AM_MIRROR(0x10) AM_DEVWRITE("fd1793", fd1793_t, sector_w) - AM_RANGE(0xef, 0xef) AM_MIRROR(0x10) AM_DEVWRITE("fd1793", fd1793_t, data_w) + AM_RANGE(0xec, 0xec) AM_MIRROR(0x10) AM_DEVREAD("fd1793", fd1793_t, status_r) AM_WRITE(command_w) + AM_RANGE(0xed, 0xed) AM_MIRROR(0x10) AM_DEVREADWRITE("fd1793", fd1793_t, track_r, track_w) + AM_RANGE(0xee, 0xee) AM_MIRROR(0x10) AM_DEVREADWRITE("fd1793", fd1793_t, sector_r, sector_w) + AM_RANGE(0xef, 0xef) AM_MIRROR(0x10) AM_DEVREADWRITE("fd1793", fd1793_t, data_r, data_w) ADDRESS_MAP_END FLOPPY_FORMATS_MEMBER( cgenie_fdc_device::floppy_formats ) diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c index 9771f744502..2c5ecb78546 100644 --- a/src/mess/drivers/cgenie.c +++ b/src/mess/drivers/cgenie.c @@ -108,7 +108,7 @@ static ADDRESS_MAP_START( cgenie_mem, AS_PROGRAM, 8, cgenie_state ) AM_RANGE(0x0000, 0x3fff) AM_ROM // AM_RANGE(0x4000, 0xbfff) AM_RAM // set up in machine_start AM_RANGE(0xc000, 0xefff) AM_NOP // cartridge space - AM_RANGE(0xf000, 0xf3ff) AM_READWRITE(colorram_r, colorram_w ) AM_SHARE("colorram") + AM_RANGE(0xf000, 0xf3ff) AM_READWRITE(colorram_r, colorram_w) AM_SHARE("colorram") AM_RANGE(0xf400, 0xf7ff) AM_RAM AM_SHARE("fontram") AM_RANGE(0xf800, 0xf8ff) AM_MIRROR(0x300) AM_READ(keyboard_r) AM_RANGE(0xfc00, 0xffff) AM_NOP // cartridge space @@ -220,7 +220,7 @@ INPUT_PORTS_END READ8_MEMBER( cgenie_state::keyboard_r ) { - int data = 0; + UINT8 data = 0; for (int i = 0; i < 8; i++) if (BIT(offset, i)) diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c index 7ae31e9afac..4245165c902 100644 --- a/src/mess/machine/z80ne.c +++ b/src/mess/machine/z80ne.c @@ -15,7 +15,6 @@ /* Components */ #include "machine/ay31015.h" -#include "machine/wd17xx.h" /* Devices */ #include "imagedev/flopdrv.h" From db3feb6c5ec187516ec86a2b9fa2b179d7a21999 Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 28 May 2015 10:48:29 +0200 Subject: [PATCH 007/284] Use netlist().log() for logging instead of printf. This avoids the printf issue with I64u (aka SIZETFMT) on win builds. (nw) --- src/emu/netlist/analog/nld_solver.c | 2 +- src/emu/netlist/nl_config.h | 4 ++-- src/emu/netlist/nl_parser.h | 3 +++ src/emu/netlist/nl_setup.c | 14 -------------- src/emu/netlist/nl_setup.h | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/emu/netlist/analog/nld_solver.c b/src/emu/netlist/analog/nld_solver.c index ebabf6e33d7..4f4ea19c79c 100644 --- a/src/emu/netlist/analog/nld_solver.c +++ b/src/emu/netlist/analog/nld_solver.c @@ -156,7 +156,7 @@ ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets break; } } - //NL_VERBOSE_OUT(("added net with %" SIZETFMT " populated connections\n", net->m_core_terms.size())); + NL_VERBOSE_OUT(("added net with %" SIZETFMT " populated connections\n", net->m_core_terms.size())); } } diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index 7d14be13c53..b565f44a997 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -99,9 +99,9 @@ #define NL_KEEP_STATISTICS (0) #if (NL_VERBOSE) - #define NL_VERBOSE_OUT(x) printf x + #define NL_VERBOSE_OUT(x) netlist().log x #else - #define NL_VERBOSE_OUT(x) do { if(0) printf x ; } while (0) + #define NL_VERBOSE_OUT(x) do { if(0) netlist().log x ; } while (0) #endif //============================================================ diff --git a/src/emu/netlist/nl_parser.h b/src/emu/netlist/nl_parser.h index 8a600339981..d275dee35aa 100644 --- a/src/emu/netlist/nl_parser.h +++ b/src/emu/netlist/nl_parser.h @@ -34,6 +34,9 @@ public: void net_truthtable_start(); protected: + /* for debugging messages */ + netlist_base_t &netlist() { return m_setup.netlist(); } + virtual void verror(pstring msg, int line_num, pstring line); private: diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 94673f7d3f0..1367ebc5bbf 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -104,20 +104,6 @@ netlist_device_t *netlist_setup_t::register_dev(const pstring &classname, const return register_dev(dev, name); } -template -static void remove_start_with(T &hm, pstring &sw) -{ - for (std::size_t i = hm.size() - 1; i >= 0; i--) - { - pstring x = hm[i]->name(); - if (sw.equals(x.substr(0, sw.len()))) - { - NL_VERBOSE_OUT(("removing %s\n", hm[i]->name().cstr())); - hm.remove(hm[i]); - } - } -} - void netlist_setup_t::remove_dev(const pstring &name) { netlist_device_t *dev = netlist().m_devices.find(name); diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index 9219ee6581c..df9cebac2ce 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -186,6 +186,20 @@ private: const pstring resolve_alias(const pstring &name) const; nld_base_proxy *get_d_a_proxy(netlist_core_terminal_t &out); + + template + void remove_start_with(T &hm, pstring &sw) + { + for (std::size_t i = hm.size() - 1; i >= 0; i--) + { + pstring x = hm[i]->name(); + if (sw.equals(x.substr(0, sw.len()))) + { + NL_VERBOSE_OUT(("removing %s\n", hm[i]->name().cstr())); + hm.remove(hm[i]); + } + } + } }; #endif /* NLSETUP_H_ */ From e1d1a6b1f2d10d54f9827cc0c7e0c6464bffec63 Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 28 May 2015 22:39:54 +0200 Subject: [PATCH 008/284] Found some cycles. (nw) --- src/emu/netlist/nl_base.c | 9 ------ src/emu/netlist/nl_base.h | 10 +++++++ src/emu/netlist/nl_config.h | 1 + src/emu/netlist/nl_lists.h | 31 ++++++++++++--------- src/emu/netlist/nl_setup.c | 12 ++++---- src/emu/netlist/nl_time.h | 1 + src/mame/drivers/nl_breakout.c | 2 +- src/tools/nltool.c | 50 ++++++++++++++++++++++++---------- 8 files changed, 71 insertions(+), 45 deletions(-) diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index 1bc33ed7e37..8b8ece88a89 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -1088,12 +1088,3 @@ NETLIB_UPDATE(mainclock) net.set_time(netlist().time() + m_inc); } -ATTR_HOT void netlist_base_t::push_to_queue(netlist_net_t &out, const netlist_time &attime) -{ - m_queue.push(netlist_queue_t::entry_t(attime, &out)); -} - -ATTR_HOT void netlist_base_t::remove_from_queue(netlist_net_t &out) -{ - m_queue.remove(&out); -} diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index a20309f7566..55ece175314 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -1419,4 +1419,14 @@ ATTR_HOT inline void netlist_analog_output_t::set_Q(const nl_double newQ) } } +ATTR_HOT inline void netlist_base_t::push_to_queue(netlist_net_t &out, const netlist_time &attime) +{ + m_queue.push(netlist_queue_t::entry_t(attime, &out)); +} + +ATTR_HOT inline void netlist_base_t::remove_from_queue(netlist_net_t &out) +{ + m_queue.remove(&out); +} + #endif /* NLBASE_H_ */ diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index b565f44a997..5235907a0ac 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -125,6 +125,7 @@ //============================================================ #if NL_KEEP_STATISTICS +#include "eminline.h" #define add_to_stat(v,x) do { v += (x); } while (0) #define inc_stat(v) add_to_stat(v, 1) #define begin_timing(v) do { v -= get_profile_ticks(); } while (0) diff --git a/src/emu/netlist/nl_lists.h b/src/emu/netlist/nl_lists.h index 88570dc1269..1a047c3b5aa 100644 --- a/src/emu/netlist/nl_lists.h +++ b/src/emu/netlist/nl_lists.h @@ -27,20 +27,20 @@ public: { public: ATTR_HOT /* inline */ entry_t() - : m_object(), m_exec_time() {} - ATTR_HOT /* inline */ entry_t(const _Time &atime, const _Element &elem) : m_object(elem), m_exec_time(atime) {} - ATTR_HOT /* inline */ const _Time exec_time() const { return m_exec_time; } - ATTR_HOT /* inline */ const _Element object() const { return m_object; } + : m_exec_time(), m_object() {} + ATTR_HOT /* inline */ entry_t(const _Time &atime, const _Element &elem) : m_exec_time(atime), m_object(elem) {} + ATTR_HOT /* inline */ const _Time &exec_time() const { return m_exec_time; } + ATTR_HOT /* inline */ const _Element &object() const { return m_object; } ATTR_HOT /* inline */ entry_t &operator=(const entry_t &right) { - m_object = right.m_object; m_exec_time = right.m_exec_time; + m_object = right.m_object; return *this; } private: - _Element m_object; _Time m_exec_time; + _Element m_object; }; netlist_timed_queue() @@ -49,20 +49,21 @@ public: } ATTR_HOT /* inline */ int capacity() const { return _Size; } - ATTR_HOT /* inline */ bool is_empty() const { return (m_end == &m_list[0]); } - ATTR_HOT /* inline */ bool is_not_empty() const { return (m_end > &m_list[0]); } + ATTR_HOT /* inline */ bool is_empty() const { return (m_end == &m_list[1]); } + ATTR_HOT /* inline */ bool is_not_empty() const { return (m_end > &m_list[1]); } ATTR_HOT void push(const entry_t &e) { + const _Time t = e.exec_time(); entry_t * i = m_end++; - while ((i > &m_list[0]) && (e.exec_time() > (i - 1)->exec_time()) ) + while (t > (i - 1)->exec_time()) { *(i) = *(i-1); i--; inc_stat(m_prof_sortmove); } *i = e; - inc_stat(m_prof_sort); + inc_stat(m_prof_call); //nl_assert(m_end - m_list < _Size); } @@ -98,6 +99,12 @@ public: ATTR_COLD void clear() { m_end = &m_list[0]; + /* put an empty element with maximum time into the queue. + * the insert algo above will run into this element and doesn't + * need a comparison with queue start. + */ + m_list[0] = entry_t(_Time::from_raw(~0), _Element(0)); + m_end++; } // save state support & mame disasm @@ -108,10 +115,8 @@ public: #if (NL_KEEP_STATISTICS) // profiling - INT32 m_prof_start; - INT32 m_prof_end; INT32 m_prof_sortmove; - INT32 m_prof_sort; + INT32 m_prof_call; #endif private: diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 1367ebc5bbf..89406db41c1 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -787,15 +787,13 @@ void netlist_setup_t::print_stats() const { #if (NL_KEEP_STATISTICS) { - for (netlist_core_device_t * const *entry = netlist().m_started_devices.first(); entry != NULL; entry = netlist().m_started_devices.next(entry)) + for (std::size_t i = 0; i < netlist().m_started_devices.size(); i++) { - //entry->object()->s - printf("Device %20s : %12d %12d %15ld\n", (*entry)->name().cstr(), (*entry)->stat_call_count, (*entry)->stat_update_count, (long int) (*entry)->stat_total_time / ((*entry)->stat_update_count + 1)); + netlist_core_device_t *entry = netlist().m_started_devices[i]; + printf("Device %20s : %12d %12d %15ld\n", entry->name().cstr(), entry->stat_call_count, entry->stat_update_count, (long int) entry->stat_total_time / (entry->stat_update_count + 1)); } - printf("Queue Start %15d\n", m_netlist.queue().m_prof_start); - printf("Queue End %15d\n", m_netlist.queue().m_prof_end); - printf("Queue Sort %15d\n", m_netlist.queue().m_prof_sort); - printf("Queue Move %15d\n", m_netlist.queue().m_prof_sortmove); + printf("Queue Pushes %15d\n", m_netlist.queue().m_prof_call); + printf("Queue Moves %15d\n", m_netlist.queue().m_prof_sortmove); } #endif } diff --git a/src/emu/netlist/nl_time.h b/src/emu/netlist/nl_time.h index 7b56b03628a..365fd271c19 100644 --- a/src/emu/netlist/nl_time.h +++ b/src/emu/netlist/nl_time.h @@ -70,6 +70,7 @@ protected: ATTR_HOT inline netlist_time(const INTERNALTYPE val) : m_time(val) {} +private: INTERNALTYPE m_time; }; diff --git a/src/mame/drivers/nl_breakout.c b/src/mame/drivers/nl_breakout.c index c5c6218fd6f..9766a98fcce 100644 --- a/src/mame/drivers/nl_breakout.c +++ b/src/mame/drivers/nl_breakout.c @@ -158,8 +158,8 @@ CIRCUIT_LAYOUT( breakout ) * ^--- Pattern Start * <--------> 3 Clocks Offset */ - EXTCLOCK(Y1, 14318000.0, "4,4,4,4,4,8") EXTCLOCK(Y2, 14318000.0, "2,6,2,6,2,2,2,6") + EXTCLOCK(Y1, 14318000.0, "4,4,4,4,4,8") PARAM(Y2.OFFSET, 3.0 / 14318000.0 + 20.0e-9 ) #define CKBH "Y1", Q #define DICECLOCK "Y2", Q diff --git a/src/tools/nltool.c b/src/tools/nltool.c index 2f9349d8e97..884c6b3c2fc 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -361,6 +361,8 @@ public: // Add gnd net + // FIXME: Parameter + out("NETLIST_START(dummy)\n"); nets.add(palloc(sp_net_t, "0"), false); nets[0]->terminals().add("GND"); @@ -380,6 +382,9 @@ public: } process_line(line); dump_nl(); + // FIXME: Parameter + out("NETLIST_END()\n"); + printf("%s", m_buf.cstr()); } protected: @@ -494,7 +499,7 @@ protected: { sp_net_t *net = nets.find(alias[i]); // use the first terminal ... - printf("ALIAS(%s, %s)\n", alias[i].cstr(), net->terminals()[0].cstr()); + out("ALIAS(%s, %s)\n", alias[i].cstr(), net->terminals()[0].cstr()); // if the aliased net only has this one terminal connected ==> don't dump if (net->terminals().size() == 1) net->set_no_export(); @@ -502,13 +507,13 @@ protected: for (int i=0; ihas_value()) - printf("%s(%s, %s)\n", devs[i]->type().cstr(), + out("%s(%s, %s)\n", devs[i]->type().cstr(), devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); else if (devs[i]->has_model()) - printf("%s(%s, \"%s\")\n", devs[i]->type().cstr(), + out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), devs[i]->name().cstr(), devs[i]->model().cstr()); else - printf("%s(%s)\n", devs[i]->type().cstr(), + out("%s(%s)\n", devs[i]->type().cstr(), devs[i]->name().cstr()); } // print nets @@ -518,12 +523,12 @@ protected: if (!net->is_no_export()) { //printf("Net %s\n", net->name().cstr()); - printf("NET_C(%s", net->terminals()[0].cstr() ); + out("NET_C(%s", net->terminals()[0].cstr() ); for (int j=1; jterminals().size(); j++) { - printf(", %s", net->terminals()[j].cstr() ); + out(", %s", net->terminals()[j].cstr() ); } - printf(")\n"); + out(")\n"); } } devs.clear_and_free(); @@ -540,25 +545,25 @@ protected: switch (tt[0].cstr()[0]) { case ';': - printf("// %s\n", line.substr(1).cstr()); + out("// %s\n", line.substr(1).cstr()); break; case '*': - printf("// %s\n", line.substr(1).cstr()); + out("// %s\n", line.substr(1).cstr()); break; case '.': if (tt[0].equals(".SUBCKT")) { - printf("NETLIST_START(%s)\n", tt[1].cstr()); + out("NETLIST_START(%s)\n", tt[1].cstr()); for (int i=2; i nets; pnamedlist_t devs; plist_t alias; + pstringbuffer m_buf; + static sp_unit m_sp_units[]; + }; convert_t::sp_unit convert_t::m_sp_units[] = { From 84f26ad714a334c787d3867b48d7a4592a2d4a66 Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 29 May 2015 02:40:39 +0200 Subject: [PATCH 009/284] First version of a eagle to netlist converter. (nw) --- src/emu/netlist/plib/poptions.h | 24 +++ src/emu/netlist/plib/pparser.h | 5 +- src/tools/nltool.c | 346 ++------------------------------ 3 files changed, 39 insertions(+), 336 deletions(-) diff --git a/src/emu/netlist/plib/poptions.h b/src/emu/netlist/plib/poptions.h index 7803a315d94..b082504930d 100644 --- a/src/emu/netlist/plib/poptions.h +++ b/src/emu/netlist/plib/poptions.h @@ -59,6 +59,30 @@ private: pstring m_val; }; +class poption_str_limit : public poption +{ +public: + poption_str_limit(pstring ashort, pstring along, pstring defval, pstring limit, pstring help, poptions *parent = NULL) + : poption(ashort, along, help, true, parent), m_val(defval), m_limit(limit, ":") + {} + + virtual int parse(pstring argument) + { + if (m_limit.contains(argument)) + { + m_val = argument; + return 0; + } + else + return 1; + } + + pstring operator ()() { return m_val; } +private: + pstring m_val; + pstring_list_t m_limit; +}; + class poption_bool : public poption { public: diff --git a/src/emu/netlist/plib/pparser.h b/src/emu/netlist/plib/pparser.h index a9f538eeaef..4a3305094aa 100644 --- a/src/emu/netlist/plib/pparser.h +++ b/src/emu/netlist/plib/pparser.h @@ -100,20 +100,21 @@ public: void set_identifier_chars(pstring s) { m_identifier_chars = s; } void set_number_chars(pstring st, pstring rem) { m_number_chars_start = st; m_number_chars = rem; } + void set_string_char(char c) { m_string = c; } void set_whitespace(pstring s) { m_whitespace = s; } void set_comment(pstring start, pstring end, pstring line) { m_tok_comment_start = register_token(start); m_tok_comment_end = register_token(end); m_tok_line_comment = register_token(line); - m_string = '"'; } token_t get_token_internal(); void error(const char *format, ...) ATTR_PRINTF(2,3); -protected: void reset(const char *p) { m_px = p; m_line = 1; m_line_ptr = p; } + +protected: virtual void verror(pstring msg, int line_num, pstring line) = 0; private: diff --git a/src/tools/nltool.c b/src/tools/nltool.c index 884c6b3c2fc..cd0cc5e62ad 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -23,6 +23,7 @@ #include "nl_factory.h" #include "nl_parser.h" #include "devices/net_lib.h" +#include "tools/nl_convert.h" #ifdef PSTANDALONE_PROVIDED @@ -101,6 +102,7 @@ public: opt_name("n", "name", "", "netlist in file to run; default is first one", this), opt_logs("l", "logs", "", "colon separated list of terminals to log", this), opt_file("f", "file", "-", "file to process (default is stdin)", this), + opt_type("y", "type", "spice", "spice:eagle", "type of file to be converted: spice,eagle", this), opt_cmd ("c", "cmd", "run", "run|convert|listdevices", this), opt_verb("v", "verbose", "be verbose - this produces lots of output", this), opt_help("h", "help", "display help", this) @@ -110,6 +112,7 @@ public: poption_str opt_name; poption_str opt_logs; poption_str opt_file; + poption_str_limit opt_type; poption_str opt_cmd; poption_bool opt_verb; poption_bool opt_help; @@ -340,338 +343,6 @@ static void listdevices() } } -/*------------------------------------------------- - convert - convert a spice netlist --------------------------------------------------*/ - -class convert_t -{ -public: - - convert_t() {}; - ~convert_t() - { - nets.clear_and_free(); - devs.clear_and_free(); - } - - void convert(const pstring &contents) - { - pstring_list_t spnl(contents, "\n"); - - // Add gnd net - - // FIXME: Parameter - out("NETLIST_START(dummy)\n"); - nets.add(palloc(sp_net_t, "0"), false); - nets[0]->terminals().add("GND"); - - pstring line = ""; - - for (std::size_t i=0; i < spnl.size(); i++) - { - // Basic preprocessing - pstring inl = spnl[i].trim().ucase(); - if (inl.startsWith("+")) - line = line + inl.substr(1); - else - { - process_line(line); - line = inl; - } - } - process_line(line); - dump_nl(); - // FIXME: Parameter - out("NETLIST_END()\n"); - printf("%s", m_buf.cstr()); - } - -protected: - struct sp_net_t - { - public: - sp_net_t(const pstring &aname) - : m_name(aname), m_no_export(false) {} - - const pstring &name() { return m_name;} - pstring_list_t &terminals() { return m_terminals; } - void set_no_export() { m_no_export = true; } - bool is_no_export() { return m_no_export; } - - private: - pstring m_name; - bool m_no_export; - pstring_list_t m_terminals; - }; - - struct sp_dev_t - { - public: - sp_dev_t(const pstring &atype, const pstring &aname, const pstring &amodel) - : m_type(atype), m_name(aname), m_model(amodel), m_val(0), m_has_val(false) - {} - - sp_dev_t(const pstring &atype, const pstring &aname, double aval) - : m_type(atype), m_name(aname), m_model(""), m_val(aval), m_has_val(true) - {} - - sp_dev_t(const pstring &atype, const pstring &aname) - : m_type(atype), m_name(aname), m_model(""), m_val(0.0), m_has_val(false) - {} - - const pstring &name() { return m_name;} - const pstring &type() { return m_type;} - const pstring &model() { return m_model;} - const double &value() { return m_val;} - - bool has_model() { return m_model != ""; } - bool has_value() { return m_has_val; } - - private: - pstring m_type; - pstring m_name; - pstring m_model; - double m_val; - bool m_has_val; - }; - - struct sp_unit { - pstring sp_unit; - pstring nl_func; - double mult; - }; - - - void add_term(pstring netname, pstring termname) - { - sp_net_t * net = nets.find(netname); - if (net == NULL) - { - net = palloc(sp_net_t, netname); - nets.add(net, false); - } - net->terminals().add(termname); - } - - const pstring get_nl_val(const double val) - { - { - int i = 0; - while (m_sp_units[i].sp_unit != "-" ) - { - if (m_sp_units[i].mult <= nl_math::abs(val)) - break; - i++; - } - return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); - } - } - double get_sp_unit(const pstring &unit) - { - int i = 0; - while (m_sp_units[i].sp_unit != "-") - { - if (m_sp_units[i].sp_unit == unit) - return m_sp_units[i].mult; - i++; - } - fprintf(stderr, "Unit %s unknown\n", unit.cstr()); - return 0.0; - } - - double get_sp_val(const pstring &sin) - { - int p = sin.len() - 1; - while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) - p--; - pstring val = sin.substr(0,p + 1); - pstring unit = sin.substr(p + 1); - - double ret = get_sp_unit(unit) * val.as_double(); - //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret); - return ret; - } - - void dump_nl() - { - for (int i=0; iterminals()[0].cstr()); - // if the aliased net only has this one terminal connected ==> don't dump - if (net->terminals().size() == 1) - net->set_no_export(); - } - for (int i=0; ihas_value()) - out("%s(%s, %s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); - else if (devs[i]->has_model()) - out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), devs[i]->model().cstr()); - else - out("%s(%s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr()); - } - // print nets - for (int i=0; iis_no_export()) - { - //printf("Net %s\n", net->name().cstr()); - out("NET_C(%s", net->terminals()[0].cstr() ); - for (int j=1; jterminals().size(); j++) - { - out(", %s", net->terminals()[j].cstr() ); - } - out(")\n"); - } - } - devs.clear_and_free(); - nets.clear_and_free(); - alias.clear(); - } - - void process_line(const pstring &line) - { - if (line != "") - { - pstring_list_t tt(line, " ", true); - double val = 0.0; - switch (tt[0].cstr()[0]) - { - case ';': - out("// %s\n", line.substr(1).cstr()); - break; - case '*': - out("// %s\n", line.substr(1).cstr()); - break; - case '.': - if (tt[0].equals(".SUBCKT")) - { - out("NETLIST_START(%s)\n", tt[1].cstr()); - for (int i=2; i 5) - devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false); - else - devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false); - add_term(tt[1], tt[0] + ".C"); - add_term(tt[2], tt[0] + ".B"); - add_term(tt[3], tt[0] + ".E"); - } - break; - case 'R': - val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "RES", tt[0], val), false); - add_term(tt[1], tt[0] + ".1"); - add_term(tt[2], tt[0] + ".2"); - break; - case 'C': - val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "CAP", tt[0], val), false); - add_term(tt[1], tt[0] + ".1"); - add_term(tt[2], tt[0] + ".2"); - break; - case 'V': - // just simple Voltage sources .... - if (tt[2].equals("0")) - { - val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false); - add_term(tt[1], tt[0] + ".Q"); - //add_term(tt[2], tt[0] + ".2"); - } - else - fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); - break; - case 'D': - // FIXME: Rewrite resistor value - devs.add(palloc(sp_dev_t, "DIODE", tt[0], tt[3]), false); - add_term(tt[1], tt[0] + ".A"); - add_term(tt[2], tt[0] + ".K"); - break; - case 'U': - case 'X': - { - // FIXME: specific code for KICAD exports - // last element is component type - // FIXME: Parameter - - pstring xname = tt[0].replace(".", "_"); - pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; - devs.add(palloc(sp_dev_t, tname, xname), false); - for (int i=1; i < tt.size() - 1; i++) - { - pstring term = pstring::sprintf("%s.%d", xname.cstr(), i); - add_term(tt[i], term); - } - break; - } - default: - pstring::sprintf("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr()); - } - } - } - - void out(const char *format, ...) ATTR_PRINTF(2,3) - { - va_list ap; - va_start(ap, format); - m_buf += pstring(format).vprintf(ap); - va_end(ap); - } - - -private: - pnamedlist_t nets; - pnamedlist_t devs; - plist_t alias; - - pstringbuffer m_buf; - - static sp_unit m_sp_units[]; - -}; - -convert_t::sp_unit convert_t::m_sp_units[] = { - {"T", "", 1.0e12 }, - {"G", "", 1.0e9 }, - {"MEG", "RES_M(%g)", 1.0e6 }, - {"K", "RES_K(%g)", 1.0e3 }, - {"", "%g", 1.0e0 }, - {"M", "CAP_M(%g)", 1.0e-3 }, - {"U", "CAP_U(%g)", 1.0e-6 }, - {"µ", "CAP_U(%g)", 1.0e-6 }, - {"N", "CAP_N(%g)", 1.0e-9 }, - {"P", "CAP_P(%g)", 1.0e-12}, - {"F", "%ge-15", 1.0e-15}, - - {"MIL", "%e", 25.4e-6}, - - {"-", "%g", 1.0 } -}; /*------------------------------------------------- @@ -709,8 +380,15 @@ int main(int argc, char *argv[]) else if (cmd == "convert") { pstring contents = filetobuf(opts.opt_file()); - convert_t converter; - converter.convert(contents); + nl_convert_base_t *converter = NULL; + if (opts.opt_type().equals("spice")) + converter = palloc(nl_convert_spice_t); + else + converter = palloc(nl_convert_eagle_t); + converter->convert(contents); + /* present result */ + printf("%s\n", converter->result().cstr()); + pfree(converter); } else { From 2edd956f0214258b6ccc7c0859ac79d97296c557 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 29 May 2015 17:08:43 +0200 Subject: [PATCH 010/284] more cleanup (nw) --- src/mess/machine/bbc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index cbfef40e40b..4e3a0a35561 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -17,7 +17,6 @@ #include "cpu/m6502/m6502.h" #include "sound/tms5220.h" #include "machine/6522via.h" -#include "machine/wd17xx.h" #include "imagedev/flopdrv.h" #include "includes/bbc.h" #include "machine/mc146818.h" From abadd747f031ba14d3647192b4a48d0f7b1efe30 Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 29 May 2015 20:35:49 +0200 Subject: [PATCH 011/284] Commit omitted nl_convert.h. Renamed "find" to find_by_name in pnamed_list for clarity. (nw) --- src/emu/netlist/nl_base.c | 2 +- src/emu/netlist/nl_base.h | 2 +- src/emu/netlist/nl_setup.c | 16 +- src/emu/netlist/plib/plists.h | 6 +- src/emu/netlist/tools/nl_convert.h | 581 +++++++++++++++++++++++++++++ 5 files changed, 594 insertions(+), 13 deletions(-) create mode 100644 src/emu/netlist/tools/nl_convert.h diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index 8b8ece88a89..b07e462f4f4 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -679,7 +679,7 @@ ATTR_HOT inline void netlist_net_t::update_devs() //assert(m_num_cons != 0); nl_assert(this->isRailNet()); - const int masks[4] = { 1, 5, 3, 1 }; + const UINT32 masks[4] = { 1, 5, 3, 1 }; const UINT32 mask = masks[ (m_cur_Q << 1) | m_new_Q ]; m_in_queue = 2; /* mark as taken ... */ diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index 55ece175314..b5d547d2fdd 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -482,7 +482,7 @@ public: } /* inline only intended to be called from nl_base.c */ - ATTR_HOT /* inline */ void update_dev(const UINT32 mask); + ATTR_HOT inline void update_dev(const UINT32 mask); protected: /* ATTR_COLD */ virtual void save_register() diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 89406db41c1..5799a8dddcd 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -106,7 +106,7 @@ netlist_device_t *netlist_setup_t::register_dev(const pstring &classname, const void netlist_setup_t::remove_dev(const pstring &name) { - netlist_device_t *dev = netlist().m_devices.find(name); + netlist_device_t *dev = netlist().m_devices.find_by_name(name); pstring temp = name + "."; if (dev == NULL) netlist().error("Device %s does not exist\n", name.cstr()); @@ -201,7 +201,7 @@ void netlist_setup_t::register_object(netlist_device_t &dev, const pstring &name { netlist_param_t ¶m = dynamic_cast(obj); //printf("name: %s\n", name.cstr()); - const pstring val = m_params_temp.find(name).e2; + const pstring val = m_params_temp.find_by_name(name).e2; if (val != "") { switch (param.param_type()) @@ -313,7 +313,7 @@ const pstring netlist_setup_t::resolve_alias(const pstring &name) const /* FIXME: Detect endless loop */ do { ret = temp; - temp = m_alias.find(ret).e2; + temp = m_alias.find_by_name(ret).e2; } while (temp != ""); NL_VERBOSE_OUT(("%s==>%s\n", name.cstr(), ret.cstr())); @@ -325,13 +325,13 @@ netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_ const pstring &tname = resolve_alias(terminal_in); netlist_core_terminal_t *ret; - ret = m_terminals.find(tname); + ret = m_terminals.find_by_name(tname); /* look for default */ if (ret == NULL) { /* look for ".Q" std output */ pstring s = tname + ".Q"; - ret = m_terminals.find(s); + ret = m_terminals.find_by_name(s); } if (ret == NULL && required) netlist().error("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr()); @@ -345,13 +345,13 @@ netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_ const pstring &tname = resolve_alias(terminal_in); netlist_core_terminal_t *ret; - ret = m_terminals.find(tname); + ret = m_terminals.find_by_name(tname); /* look for default */ if (ret == NULL && atype == netlist_object_t::OUTPUT) { /* look for ".Q" std output */ pstring s = tname + ".Q"; - ret = m_terminals.find(s); + ret = m_terminals.find_by_name(s); } if (ret == NULL && required) netlist().error("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr()); @@ -374,7 +374,7 @@ netlist_param_t *netlist_setup_t::find_param(const pstring ¶m_in, bool requi const pstring &outname = resolve_alias(param_in_fqn); netlist_param_t *ret; - ret = m_params.find(outname); + ret = m_params.find_by_name(outname); if (ret == NULL && required) netlist().error("parameter %s(%s) not found!\n", param_in_fqn.cstr(), outname.cstr()); if (ret != NULL) diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h index fb121b798b6..032f123aab1 100644 --- a/src/emu/netlist/plib/plists.h +++ b/src/emu/netlist/plib/plists.h @@ -339,7 +339,7 @@ template class pnamedlist_t : public plist_t<_ListClass> { public: - _ListClass find(const pstring &name) const + _ListClass find_by_name(const pstring &name) const { for (std::size_t i=0; i < this->size(); i++) if (get_name((*this)[i]) == name) @@ -349,7 +349,7 @@ public: void remove_by_name(const pstring &name) { - plist_t<_ListClass>::remove(find(name)); + plist_t<_ListClass>::remove(find_by_name(name)); } bool add(_ListClass dev, bool allow_duplicate) @@ -358,7 +358,7 @@ public: plist_t<_ListClass>::add(dev); else { - if (!(this->find(get_name(dev)) == _ListClass(NULL))) + if (!(this->find_by_name(get_name(dev)) == _ListClass(NULL))) return false; plist_t<_ListClass>::add(dev); } diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h new file mode 100644 index 00000000000..e4726b33314 --- /dev/null +++ b/src/emu/netlist/tools/nl_convert.h @@ -0,0 +1,581 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * nl_convert.h + * + */ + +#pragma once + +#ifndef NL_CONVERT_H_ +#define NL_CONVERT_H_ + +#include + +#include "plib/pstring.h" +#include "plib/plists.h" + +/*------------------------------------------------- + convert - convert a spice netlist +-------------------------------------------------*/ + +class nl_convert_base_t +{ +public: + + nl_convert_base_t() {}; + virtual ~nl_convert_base_t() + { + nets.clear_and_free(); + devs.clear_and_free(); + pins.clear_and_free(); + } + + const pstringbuffer &result() { return m_buf; } + virtual void convert(const pstring &contents) = 0; + +protected: + struct sp_net_t + { + public: + sp_net_t(const pstring &aname) + : m_name(aname), m_no_export(false) {} + + const pstring &name() { return m_name;} + pstring_list_t &terminals() { return m_terminals; } + void set_no_export() { m_no_export = true; } + bool is_no_export() { return m_no_export; } + + private: + pstring m_name; + bool m_no_export; + pstring_list_t m_terminals; + }; + + struct sp_dev_t + { + public: + sp_dev_t(const pstring &atype, const pstring &aname, const pstring &amodel) + : m_type(atype), m_name(aname), m_model(amodel), m_val(0), m_has_val(false) + {} + + sp_dev_t(const pstring &atype, const pstring &aname, double aval) + : m_type(atype), m_name(aname), m_model(""), m_val(aval), m_has_val(true) + {} + + sp_dev_t(const pstring &atype, const pstring &aname) + : m_type(atype), m_name(aname), m_model(""), m_val(0.0), m_has_val(false) + {} + + const pstring &name() { return m_name;} + const pstring &type() { return m_type;} + const pstring &model() { return m_model;} + const double &value() { return m_val;} + + bool has_model() { return m_model != ""; } + bool has_value() { return m_has_val; } + + private: + pstring m_type; + pstring m_name; + pstring m_model; + double m_val; + bool m_has_val; + }; + + struct sp_unit { + pstring sp_unit; + pstring nl_func; + double mult; + }; + + struct sp_pin_alias_t + { + public: + sp_pin_alias_t(const pstring &name, const pstring &alias) + : m_name(name), m_alias(alias) + {} + const pstring &name() { return m_name; } + const pstring &alias() { return m_alias; } + private: + pstring m_name; + pstring m_alias; + }; + + void add_term(pstring netname, pstring termname) + { + sp_net_t * net = nets.find_by_name(netname); + if (net == NULL) + { + net = palloc(sp_net_t, netname); + nets.add(net, false); + } + + /* if there is a pin alias, translate ... */ + sp_pin_alias_t *alias = pins.find_by_name(termname); + + if (alias != NULL) + net->terminals().add(alias->alias()); + else + net->terminals().add(termname); + } + + const pstring get_nl_val(const double val) + { + { + int i = 0; + while (m_sp_units[i].sp_unit != "-" ) + { + if (m_sp_units[i].mult <= nl_math::abs(val)) + break; + i++; + } + return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); + } + } + double get_sp_unit(const pstring &unit) + { + int i = 0; + while (m_sp_units[i].sp_unit != "-") + { + if (m_sp_units[i].sp_unit == unit) + return m_sp_units[i].mult; + i++; + } + fprintf(stderr, "Unit %s unknown\n", unit.cstr()); + return 0.0; + } + + double get_sp_val(const pstring &sin) + { + int p = sin.len() - 1; + while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) + p--; + pstring val = sin.substr(0,p + 1); + pstring unit = sin.substr(p + 1); + + double ret = get_sp_unit(unit) * val.as_double(); + //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret); + return ret; + } + + void dump_nl() + { + for (int i=0; iterminals()[0].cstr()); + // if the aliased net only has this one terminal connected ==> don't dump + if (net->terminals().size() == 1) + net->set_no_export(); + } + for (int i=0; ihas_value()) + out("%s(%s, %s)\n", devs[i]->type().cstr(), + devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); + else if (devs[i]->has_model()) + out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), + devs[i]->name().cstr(), devs[i]->model().cstr()); + else + out("%s(%s)\n", devs[i]->type().cstr(), + devs[i]->name().cstr()); + } + // print nets + for (int i=0; iis_no_export()) + { + //printf("Net %s\n", net->name().cstr()); + out("NET_C(%s", net->terminals()[0].cstr() ); + for (int j=1; jterminals().size(); j++) + { + out(", %s", net->terminals()[j].cstr() ); + } + out(")\n"); + } + } + devs.clear_and_free(); + nets.clear_and_free(); + pins.clear_and_free(); + alias.clear(); + } + + void out(const char *format, ...) ATTR_PRINTF(2,3) + { + va_list ap; + va_start(ap, format); + m_buf += pstring(format).vprintf(ap); + va_end(ap); + } + + pnamedlist_t nets; + pnamedlist_t devs; + pnamedlist_t pins; + plist_t alias; + +private: + + pstringbuffer m_buf; + + static sp_unit m_sp_units[]; + +}; + +nl_convert_base_t::sp_unit nl_convert_base_t::m_sp_units[] = { + {"T", "", 1.0e12 }, + {"G", "", 1.0e9 }, + {"MEG", "RES_M(%g)", 1.0e6 }, + {"k", "RES_K(%g)", 1.0e3 }, /* eagle */ + {"K", "RES_K(%g)", 1.0e3 }, + {"", "%g", 1.0e0 }, + {"M", "CAP_M(%g)", 1.0e-3 }, + {"u", "CAP_U(%g)", 1.0e-6 }, /* eagle */ + {"U", "CAP_U(%g)", 1.0e-6 }, + {"µ", "CAP_U(%g)", 1.0e-6 }, + {"N", "CAP_N(%g)", 1.0e-9 }, + {"P", "CAP_P(%g)", 1.0e-12}, + {"F", "%ge-15", 1.0e-15}, + + {"MIL", "%e", 25.4e-6}, + + {"-", "%g", 1.0 } +}; + +class nl_convert_spice_t : public nl_convert_base_t +{ +public: + + nl_convert_spice_t() : nl_convert_base_t() {}; + ~nl_convert_spice_t() + { + } + + void convert(const pstring &contents) + { + pstring_list_t spnl(contents, "\n"); + + // Add gnd net + + // FIXME: Parameter + out("NETLIST_START(dummy)\n"); + nets.add(palloc(sp_net_t, "0"), false); + nets[0]->terminals().add("GND"); + + pstring line = ""; + + for (std::size_t i=0; i < spnl.size(); i++) + { + // Basic preprocessing + pstring inl = spnl[i].trim().ucase(); + if (inl.startsWith("+")) + line = line + inl.substr(1); + else + { + process_line(line); + line = inl; + } + } + process_line(line); + dump_nl(); + // FIXME: Parameter + out("NETLIST_END()\n"); + } + +protected: + + void process_line(const pstring &line) + { + if (line != "") + { + pstring_list_t tt(line, " ", true); + double val = 0.0; + switch (tt[0].cstr()[0]) + { + case ';': + out("// %s\n", line.substr(1).cstr()); + break; + case '*': + out("// %s\n", line.substr(1).cstr()); + break; + case '.': + if (tt[0].equals(".SUBCKT")) + { + out("NETLIST_START(%s)\n", tt[1].cstr()); + for (int i=2; i 5) + devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false); + else + devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false); + add_term(tt[1], tt[0] + ".C"); + add_term(tt[2], tt[0] + ".B"); + add_term(tt[3], tt[0] + ".E"); + } + break; + case 'R': + val = get_sp_val(tt[3]); + devs.add(palloc(sp_dev_t, "RES", tt[0], val), false); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + break; + case 'C': + val = get_sp_val(tt[3]); + devs.add(palloc(sp_dev_t, "CAP", tt[0], val), false); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + break; + case 'V': + // just simple Voltage sources .... + if (tt[2].equals("0")) + { + val = get_sp_val(tt[3]); + devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false); + add_term(tt[1], tt[0] + ".Q"); + //add_term(tt[2], tt[0] + ".2"); + } + else + fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); + break; + case 'D': + // FIXME: Rewrite resistor value + devs.add(palloc(sp_dev_t, "DIODE", tt[0], tt[3]), false); + add_term(tt[1], tt[0] + ".A"); + add_term(tt[2], tt[0] + ".K"); + break; + case 'U': + case 'X': + { + // FIXME: specific code for KICAD exports + // last element is component type + // FIXME: Parameter + + pstring xname = tt[0].replace(".", "_"); + pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; + devs.add(palloc(sp_dev_t, tname, xname), false); + for (int i=1; i < tt.size() - 1; i++) + { + pstring term = pstring::sprintf("%s.%d", xname.cstr(), i); + add_term(tt[i], term); + } + break; + } + default: + out("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr()); + } + } + } + +private: + +}; + +class nl_convert_eagle_t : public nl_convert_base_t +{ +public: + + nl_convert_eagle_t() : nl_convert_base_t() {}; + ~nl_convert_eagle_t() + { + } + + class eagle_tokenizer : public ptokenizer + { + + public: + eagle_tokenizer(nl_convert_eagle_t &convert) + : ptokenizer(), m_convert(convert) + { + set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"); + set_number_chars(".0123456789", "0123456789eE-."); //FIXME: processing of numbers + char ws[5]; + ws[0] = ' '; + ws[1] = 9; + ws[2] = 10; + ws[3] = 13; + ws[4] = 0; + set_whitespace(ws); + /* FIXME: gnetlist doesn't print comments */ + set_comment("/*", "*/", "//"); + set_string_char('\''); + m_tok_ADD = register_token("ADD"); + m_tok_VALUE = register_token("VALUE"); + m_tok_SIGNAL = register_token("SIGNAL"); + m_tok_SEMICOLON = register_token(";"); + /* currently not used, but required for parsing */ + register_token(")"); + register_token("("); + } + + token_id_t m_tok_ADD; + token_id_t m_tok_VALUE; + token_id_t m_tok_SIGNAL; + token_id_t m_tok_SEMICOLON; + + protected: + + void verror(pstring msg, int line_num, pstring line) + { + m_convert.out("abc"); + } + + + private: + nl_convert_eagle_t &m_convert; + }; + + void convert(const pstring &contents) + { + eagle_tokenizer tok(*this); + tok.reset(contents.cstr()); + + out("NETLIST_START(dummy)\n"); + nets.add(palloc(sp_net_t, "GND"), false); + nets[0]->terminals().add("GND"); + nets.add(palloc(sp_net_t, "VCC"), false); + nets[1]->terminals().add("VCC"); + eagle_tokenizer::token_t token = tok.get_token(); + while (true) + { + if (token.is_type(eagle_tokenizer::ENDOFFILE)) + { + dump_nl(); + // FIXME: Parameter + out("NETLIST_END()\n"); + return; + } + else if (token.is(tok.m_tok_SEMICOLON)) + { + /* ignore empty statements */ + token = tok.get_token(); + } + else if (token.is(tok.m_tok_ADD)) + { + pstring name = tok.get_string(); + /* skip to semicolon */ + do + { + token = tok.get_token(); + } while (!token.is(tok.m_tok_SEMICOLON)); + token = tok.get_token(); + pstring sval = ""; + if (token.is(tok.m_tok_VALUE)) + { + pstring vname = tok.get_string(); + sval = tok.get_string(); + tok.require_token(tok.m_tok_SEMICOLON); + token = tok.get_token(); + } + switch (name.cstr()[0]) + { + case 'Q': + { + devs.add(palloc(sp_dev_t, "QBJT", name, sval), false); +#if 0 + if ((!cerr || tt[4].startsWith("N")) && tt.size() > 5) + devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false); + else + devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false); +#endif + } + break; + case 'R': + { + double val = get_sp_val(sval); + devs.add(palloc(sp_dev_t, "RES", name, val), false); + } + break; + case 'C': + { + double val = get_sp_val(sval); + devs.add(palloc(sp_dev_t, "CAP", name, val), false); + } + break; + case 'P': + if (sval.ucase() == "HIGH") + devs.add(palloc(sp_dev_t, "TTL_INPUT", name, 1), false); + else if (sval.ucase() == "LOW") + devs.add(palloc(sp_dev_t, "TTL_INPUT", name, 0), false); + else + devs.add(palloc(sp_dev_t, "ANALOG_INPUT", name, sval.as_double()), false); + pins.add(palloc(sp_pin_alias_t, name + ".1", name + ".Q"), false); + +#if 0 + // just simple Voltage sources .... + if (tt[2].equals("0")) + { + val = get_sp_val(tt[3]); + devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false); + add_term(tt[1], tt[0] + ".Q"); + //add_term(tt[2], tt[0] + ".2"); + } + else + fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); +#endif + break; + case 'D': + /* Pin 1 = Anode, Pin 2 = Cathode */ + devs.add(palloc(sp_dev_t, "DIODE", name, sval), false); + pins.add(palloc(sp_pin_alias_t, name + ".1", name + ".A"), false); + pins.add(palloc(sp_pin_alias_t, name + ".2", name + ".K"), false); + break; + case 'U': + case 'X': + { + pstring tname = "TTL_" + sval + "_DIP"; + devs.add(palloc(sp_dev_t, tname, name), false); + break; + } + default: + tok.error("// IGNORED %s\n", name.cstr()); + } + + } + else if (token.is(tok.m_tok_SIGNAL)) + { + pstring netname = tok.get_string(); + token = tok.get_token(); + while (!token.is(tok.m_tok_SEMICOLON)) + { + /* fixme: should check for string */ + pstring devname = token.str(); + pstring pin = tok.get_string(); + add_term(netname, devname + "." + pin); + token = tok.get_token(); } + } + else + { + out("Unexpected %s\n", token.str().cstr()); + return; + } + } + + } + +protected: + + +private: + +}; + +#endif /* NL_CONVERT_H_ */ From f9eb5e92b85887cd34bb75db9fe3b70f4debde4e Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 29 May 2015 21:29:16 +0200 Subject: [PATCH 012/284] tms1024/tbreakup update --- src/emu/machine/tms1024.c | 82 ++++++++++++++++++++++++--- src/emu/machine/tms1024.h | 96 ++++++++++++++++++++++--------- src/mess/drivers/hh_tms1k.c | 109 ++++++++++++++++++++++++++++++++++-- 3 files changed, 248 insertions(+), 39 deletions(-) diff --git a/src/emu/machine/tms1024.c b/src/emu/machine/tms1024.c index b5dfd018b87..d728f7dfd28 100644 --- a/src/emu/machine/tms1024.c +++ b/src/emu/machine/tms1024.c @@ -1,36 +1,75 @@ // license:BSD-3-Clause // copyright-holders:hap -/********************************************************************** +/* - Texas Instruments TMS1024, TMS1025 I/O expander emulation + Texas Instruments TMS1024/TMS1025 I/O expander + + No documentation was available, just a pinout. + Other than more port pins, TMS1025 is assumed to be same as TMS1024. + + TODO: + - writes to port 0 + - what's the MS pin? + - strobe is on rising edge? or falling edge? -**********************************************************************/ +*/ #include "machine/tms1024.h" const device_type TMS1024 = &device_creator; +const device_type TMS1025 = &device_creator; //------------------------------------------------- -// tms1024_device - constructor +// constructor //------------------------------------------------- tms1024_device::tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, TMS1024, "TMS1024", tag, owner, clock, "tms1024", __FILE__) + : device_t(mconfig, TMS1024, "TMS1024 I/O Expander", tag, owner, clock, "tms1024", __FILE__), + m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_write_port5(*this), m_write_port6(*this), m_write_port7(*this) { } +tms1024_device::tms1024_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_write_port5(*this), m_write_port6(*this), m_write_port7(*this) +{ +} + +tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms1024_device(mconfig, TMS1025, "TMS1025 I/O Expander", tag, owner, clock, "tms1025", __FILE__) +{ +} + + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void tms1024_device::device_start() { - // resolve callbacks + // resolve callbacks (there is no port 0) + m_write_port1.resolve_safe(); m_write_port[0] = &m_write_port1; + m_write_port2.resolve_safe(); m_write_port[1] = &m_write_port2; + m_write_port3.resolve_safe(); m_write_port[2] = &m_write_port3; + m_write_port4.resolve_safe(); m_write_port[3] = &m_write_port4; + m_write_port5.resolve_safe(); m_write_port[4] = &m_write_port5; + m_write_port6.resolve_safe(); m_write_port[5] = &m_write_port6; + m_write_port7.resolve_safe(); m_write_port[6] = &m_write_port7; + + // zerofill + m_h = 0; + m_s = 0; + m_std = 0; // register for savestates + save_item(NAME(m_h)); + save_item(NAME(m_s)); + save_item(NAME(m_std)); } + //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- @@ -40,4 +79,33 @@ void tms1024_device::device_reset() } -// handlers + +//------------------------------------------------- +// handlers +//------------------------------------------------- + +WRITE8_MEMBER(tms1024_device::write_h) +{ + // H1,2,3,4: data for outputs A,B,C,D + m_h = data & 0xf; +} + +WRITE8_MEMBER(tms1024_device::write_s) +{ + // S0,1,2: select port + m_s = data & 7; +} + +WRITE_LINE_MEMBER(tms1024_device::write_std) +{ + state = (state) ? 1 : 0; + + // output on rising edge + if (state && !m_std) + { + if (m_s != 0) + (*m_write_port[m_s-1])((offs_t)(m_s-1), m_h); + } + + m_std = state; +} diff --git a/src/emu/machine/tms1024.h b/src/emu/machine/tms1024.h index e5afe4ea75e..e91c0ca5a2d 100644 --- a/src/emu/machine/tms1024.h +++ b/src/emu/machine/tms1024.h @@ -1,10 +1,39 @@ // license:BSD-3-Clause // copyright-holders:hap -/********************************************************************** +/* - Texas Instruments TMS1024, TMS1025 I/O expander emulation + Texas Instruments TMS1024/TMS1025 I/O expander -********************************************************************** +*/ + +#ifndef _TMS1024_H_ +#define _TMS1024_H_ + +#include "emu.h" + + +// ports setup + +// 4-bit ports (3210 = DCBA) +// valid ports: 4-7 for TMS1024, 1-7 for TMS1025 +#define MCFG_TMS1024_WRITE_PORT_CB(X, _devcb) \ + tms1024_device::set_write_port##X##_callback(*device, DEVCB_##_devcb); + +enum +{ + TMS1024_PORT1 = 0, + TMS1024_PORT2, + TMS1024_PORT3, + TMS1024_PORT4, + TMS1024_PORT5, + TMS1024_PORT6, + TMS1024_PORT7 +}; + + +// pinout reference + +/* ____ ____ ____ ____ Vss 1 |* \_/ | 28 H2 Vss 1 |* \_/ | 40 H2 @@ -23,48 +52,59 @@ D5 14 |___________| 15 A6 D4 14 | | 27 A7 A5 15 | | 26 D6 B5 16 | | 25 C6 - C5 17 | | 24 B6 - D5 18 | | 23 A6 - A2 19 | | 22 D2 - B2 20 |___________| 21 C2 + CE: Chip Enable C5 17 | | 24 B6 + MS: Master S.? D5 18 | | 23 A6 + STD: STrobe Data? A2 19 | | 22 D2 + S: Select B2 20 |___________| 21 C2 + H: Hold? -**********************************************************************/ +*/ -#ifndef _TMS1024_H_ -#define _TMS1024_H_ - -#include "emu.h" - - -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define MCFG_TMS1024_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TMS1024, 0) - - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> tms1024_device class tms1024_device : public device_t { public: tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1024_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); // static configuration helpers + template static devcb_base &set_write_port1_callback(device_t &device, _Object object) { return downcast(device).m_write_port1.set_callback(object); } + template static devcb_base &set_write_port2_callback(device_t &device, _Object object) { return downcast(device).m_write_port2.set_callback(object); } + template static devcb_base &set_write_port3_callback(device_t &device, _Object object) { return downcast(device).m_write_port3.set_callback(object); } + template static devcb_base &set_write_port4_callback(device_t &device, _Object object) { return downcast(device).m_write_port4.set_callback(object); } + template static devcb_base &set_write_port5_callback(device_t &device, _Object object) { return downcast(device).m_write_port5.set_callback(object); } + template static devcb_base &set_write_port6_callback(device_t &device, _Object object) { return downcast(device).m_write_port6.set_callback(object); } + template static devcb_base &set_write_port7_callback(device_t &device, _Object object) { return downcast(device).m_write_port7.set_callback(object); } + + DECLARE_WRITE8_MEMBER(write_h); + DECLARE_WRITE8_MEMBER(write_s); + DECLARE_WRITE_LINE_MEMBER(write_std); protected: // device-level overrides virtual void device_start(); virtual void device_reset(); + + UINT8 m_h; // 4-bit data latch + UINT8 m_s; // 3-bit port select + UINT8 m_std; // strobe pin + + // callbacks + devcb_write8 m_write_port1, m_write_port2, m_write_port3, m_write_port4, m_write_port5, m_write_port6, m_write_port7; + devcb_write8 *m_write_port[7]; }; -// device type definition + +class tms1025_device : public tms1024_device +{ +public: + tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + + extern const device_type TMS1024; +extern const device_type TMS1025; #endif /* _TMS1024_H_ */ diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index b469d5d11b3..d0eaa7b6ced 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -118,6 +118,7 @@ #include "starwbc.lh" #include "stopthie.lh" #include "tandy12.lh" // clickable +//#include "tbreakup.lh" #include "tc4.lh" #include "einvader.lh" // test-layout(but still playable) @@ -3992,7 +3993,8 @@ MACHINE_CONFIG_END /*************************************************************************** - Tomy(tronics) Break Up + Tomy(tronics) Break Up (manufactured in Japan) + * PCB label TOMY B.O. * TMS1040 MP2726 TOMY WIPE (die labeled MP2726A) * TMS1025N2LL I/O expander * 2-digit 7seg display, 46 other leds, 1bit sound @@ -4002,15 +4004,40 @@ MACHINE_CONFIG_END - Japan: Block Attack - UK: Break-In + lamp translation table: led zz from game PCB = MESS lampyx: + + 00 = - 10 = lamp25 20 = lamp44 + 01 = lamp27 11 = lamp35 21 = lamp53 + 02 = lamp37 12 = lamp45 22 = lamp42 + 03 = lamp47 13 = lamp55 + 04 = lamp57 14 = lamp54 + 05 = lamp26 15 = lamp33 + 06 = lamp36 16 = lamp43 + 07 = lamp46 17 = lamp23 + 08 = lamp56 18 = lamp34 + 09 = lamp24 19 = lamp32 + + the 7seg panel is lamp0x and lamp1x(aka digit0/1), and the + 8(2*4) * 3 rectangular leds panel, where x=0,1,2,3: + + lamp7x lamp6x + lamp9x lamp8x + lamp11x lamp10x + ***************************************************************************/ class tbreakup_state : public hh_tms1k_state { public: tbreakup_state(const machine_config &mconfig, device_type type, const char *tag) - : hh_tms1k_state(mconfig, type, tag) + : hh_tms1k_state(mconfig, type, tag), + m_expander(*this, "expander") { } + required_device m_expander; + UINT8 m_exp_port[7]; + DECLARE_WRITE8_MEMBER(expander_w); + void prepare_display(); DECLARE_WRITE16_MEMBER(write_r); DECLARE_WRITE16_MEMBER(write_o); @@ -4021,33 +4048,89 @@ public: protected: virtual void machine_reset(); + virtual void machine_start(); }; // handlers void tbreakup_state::prepare_display() { + // 7seg leds from R0,R1 and O0-O6 + for (int y = 0; y < 2; y++) + { + m_display_segmask[y] = 0x7f; + m_display_state[y] = (m_r >> y & 1) ? (m_o & 0x7f) : 0; + } + + // 22 round leds from expander port 7 and O2-O7 + for (int y = 0; y < 4; y++) + m_display_state[y+2] = (m_exp_port[6] >> y & 1) ? (m_o & 0xfc) : 0; + + // 24 rectangular leds from expander ports 1-6 (not strobed) + for (int y = 0; y < 6; y++) + m_display_state[y+6] = m_exp_port[y]; + + set_display_size(8, 12); + display_update(); +} + +WRITE8_MEMBER(tbreakup_state::expander_w) +{ + // TMS1025 port 1-7 data + m_exp_port[offset] = data; + prepare_display(); } WRITE16_MEMBER(tbreakup_state::write_r) { + // R6: speaker out + m_speaker->level_w(data >> 6 & 1); + + // R7,R8: input mux + m_inp_mux = data >> 7 & 3; + + // R3-R5: TMS1025 port S + // R2: TMS1025 STD pin + m_expander->write_s(space, 0, data >> 3 & 7); + m_expander->write_std(data >> 2 & 1); + + // R0,R1: select digit + m_r = ~data; prepare_display(); } WRITE16_MEMBER(tbreakup_state::write_o) { + // O0-O3: TMS1025 port H + m_expander->write_h(space, 0, data & 0xf); + + // O0-O7: led state + m_o = data; prepare_display(); } READ8_MEMBER(tbreakup_state::read_k) { - return 0; + // K4: fixed input + // K8: multiplexed inputs + return (m_inp_matrix[2]->read() & 4) | (read_inputs(2) & 8); } // config static INPUT_PORTS_START( tbreakup ) + PORT_START("IN.0") // R7 K8 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Ball") + + PORT_START("IN.1") // R8 K8 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Hit") + + PORT_START("IN.2") // K4 + PORT_CONFNAME( 0x04, 0x00, DEF_STR( Lives ) ) + PORT_CONFSETTING( 0x00, "3" ) + PORT_CONFSETTING( 0x04, "5" ) + PORT_START("IN.3") // fake PORT_CONFNAME( 0x01, 0x00, "Skill Level" ) PORT_CHANGED_MEMBER(DEVICE_SELF, tbreakup_state, skill_switch, NULL) PORT_CONFSETTING( 0x00, "Pro 1" ) @@ -4072,6 +4155,15 @@ void tbreakup_state::machine_reset() set_clock(); } +void tbreakup_state::machine_start() +{ + hh_tms1k_state::machine_start(); + + // zerofill/register for savestates + memset(m_exp_port, 0, sizeof(m_exp_port)); + save_item(NAME(m_exp_port)); +} + static MACHINE_CONFIG_START( tbreakup, tbreakup_state ) /* basic machine hardware */ @@ -4079,9 +4171,18 @@ static MACHINE_CONFIG_START( tbreakup, tbreakup_state ) MCFG_TMS1XXX_READ_K_CB(READ8(tbreakup_state, read_k)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tbreakup_state, write_r)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tbreakup_state, write_o)) + + MCFG_DEVICE_ADD("expander", TMS1025, 0) + MCFG_TMS1024_WRITE_PORT_CB(1, WRITE8(tbreakup_state, expander_w)) + MCFG_TMS1024_WRITE_PORT_CB(2, WRITE8(tbreakup_state, expander_w)) + MCFG_TMS1024_WRITE_PORT_CB(3, WRITE8(tbreakup_state, expander_w)) + MCFG_TMS1024_WRITE_PORT_CB(4, WRITE8(tbreakup_state, expander_w)) + MCFG_TMS1024_WRITE_PORT_CB(5, WRITE8(tbreakup_state, expander_w)) + MCFG_TMS1024_WRITE_PORT_CB(6, WRITE8(tbreakup_state, expander_w)) + MCFG_TMS1024_WRITE_PORT_CB(7, WRITE8(tbreakup_state, expander_w)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) -// MCFG_DEFAULT_LAYOUT(layout_tbreakup) +// MCFG_DEFAULT_LAYOUT(layout_tbreakup) MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test) /* no video! */ From 0624b6efd0665097ef84e8816298aaffeda31d9e Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 29 May 2015 23:46:56 +0200 Subject: [PATCH 013/284] restore my bbc changes (wtf did happen to them?) --- scripts/src/lib.lua | 2 + src/lib/formats/bbc_dsk.c | 53 +++++++++++++++++++++ src/lib/formats/bbc_dsk.h | 33 +++++++++++++ src/mess/drivers/bbc.c | 62 +++++++++++++++++-------- src/mess/includes/bbc.h | 4 +- src/mess/machine/bbc.c | 98 ++++++++++++++++++++++++--------------- 6 files changed, 194 insertions(+), 58 deletions(-) create mode 100644 src/lib/formats/bbc_dsk.c create mode 100644 src/lib/formats/bbc_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index ef809dd5b46..166ab4beddb 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -158,6 +158,8 @@ project "formats" MAME_DIR .. "src/lib/formats/atarist_dsk.h", MAME_DIR .. "src/lib/formats/atom_tap.c", MAME_DIR .. "src/lib/formats/atom_tap.h", + MAME_DIR .. "src/lib/formats/bbc_dsk.c", + MAME_DIR .. "src/lib/formats/bbc_dsk.h", MAME_DIR .. "src/lib/formats/bw2_dsk.c", MAME_DIR .. "src/lib/formats/bw2_dsk.h", MAME_DIR .. "src/lib/formats/bw12_dsk.c", diff --git a/src/lib/formats/bbc_dsk.c b/src/lib/formats/bbc_dsk.c new file mode 100644 index 00000000000..dfa78c0bfd8 --- /dev/null +++ b/src/lib/formats/bbc_dsk.c @@ -0,0 +1,53 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + BBC Micro + + Disk image format + +***************************************************************************/ + +#include "bbc_dsk.h" + +bbc_format::bbc_format() : wd177x_format(formats) +{ +} + +const char *bbc_format::name() const +{ + return "bbc"; +} + +const char *bbc_format::description() const +{ + return "BBC Micro disk image"; +} + +const char *bbc_format::extensions() const +{ + return "bbc,img,ssd,dsd"; +} + +const bbc_format::format bbc_format::formats[] = +{ + { // 100k single sided single density + floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM, + 4000, 10, 40, 1, 256, {}, 0, {}, 16, 11, 19 + }, + { // 200k double sided single density + floppy_image::FF_525, floppy_image::DSSD, floppy_image::FM, + 4000, 10, 40, 2, 256, {}, 0, {}, 16, 11, 19 + }, + { // 200k single sided double density + floppy_image::FF_525, floppy_image::SSQD, floppy_image::FM, + 4000, 10, 80, 1, 256, {}, 0, {}, 16, 11, 19 + }, + { // 400k double sided double density + floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM, + 4000, 10, 80, 2, 256, {}, 0, {}, 16, 11, 19 + }, + {} +}; + +const floppy_format_type FLOPPY_BBC_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/bbc_dsk.h b/src/lib/formats/bbc_dsk.h new file mode 100644 index 00000000000..e2520781a15 --- /dev/null +++ b/src/lib/formats/bbc_dsk.h @@ -0,0 +1,33 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + BBC Micro + + Disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __BBC_DSK_H__ +#define __BBC_DSK_H__ + +#include "wd177x_dsk.h" + +class bbc_format : public wd177x_format +{ +public: + bbc_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_BBC_FORMAT; + +#endif // __BBC_DSK_H__ diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c index aa1ae726ac3..5a4df8785ac 100644 --- a/src/mess/drivers/bbc.c +++ b/src/mess/drivers/bbc.c @@ -57,6 +57,7 @@ /* Devices */ #include "imagedev/flopdrv.h" +#include "formats/bbc_dsk.h" #include "formats/basicdsk.h" #include "imagedev/cassette.h" #include "formats/uef_cas.h" @@ -609,6 +610,19 @@ static const floppy_interface bbc_floppy_interface = "floppy_5_25" }; +FLOPPY_FORMATS_MEMBER( bbc_state::floppy_formats ) + FLOPPY_BBC_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( bbc_floppies ) + SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) + SLOT_INTERFACE("sd", FLOPPY_525_SD) + SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD) + SLOT_INTERFACE("dd", FLOPPY_525_DD) + SLOT_INTERFACE("ssqd", FLOPPY_525_SSQD) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END + WRITE_LINE_MEMBER(bbc_state::econet_clk_w) { m_adlc->rxc_w(state); @@ -760,13 +774,15 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_I8271_IRQ_CALLBACK(WRITELINE(bbc_state, bbc_i8271_interrupt)) MCFG_I8271_FLOPPIES(FLOPPY_0, FLOPPY_1) - MCFG_DEVICE_ADD("wd177x", WD1770, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface) + MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("wd177x:0", bbc_floppies, "qd", bbc_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd177x:1", bbc_floppies, "qd", bbc_state::floppy_formats) + /* software lists */ MCFG_DEVICE_REMOVE("cass_ls_a") MCFG_SOFTWARE_LIST_ADD("cass_ls_b", "bbcb_cass") @@ -822,13 +838,15 @@ static MACHINE_CONFIG_DERIVED( bbcb_us, bbca ) MCFG_I8271_IRQ_CALLBACK(WRITELINE(bbc_state, bbc_i8271_interrupt)) MCFG_I8271_FLOPPIES(FLOPPY_0, FLOPPY_1) - MCFG_DEVICE_ADD("wd177x", WD1770, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface) + MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("wd177x:0", bbc_floppies, "qd", bbc_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd177x:1", bbc_floppies, "qd", bbc_state::floppy_formats) + /* software lists */ MCFG_DEVICE_REMOVE("cass_ls_a") MCFG_SOFTWARE_LIST_ADD("cass_ls_b", "bbcb_cass") @@ -852,6 +870,8 @@ static MACHINE_CONFIG_DERIVED( bbcbp, bbcb ) /* fdc */ MCFG_DEVICE_REMOVE("i8271") + MCFG_DEVICE_REMOVE(FLOPPY_0) + MCFG_DEVICE_REMOVE(FLOPPY_1) MACHINE_CONFIG_END @@ -981,12 +1001,12 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_VIA6522_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_via_user_irq_w)) /* fdc */ - MCFG_DEVICE_ADD("wd177x", WD1770, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) + MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("wd177x:0", bbc_floppies, "qd", bbc_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd177x:1", bbc_floppies, "qd", bbc_state::floppy_formats) /* econet */ MCFG_DEVICE_ADD("mc6854", MC6854, 0) @@ -1068,10 +1088,14 @@ static MACHINE_CONFIG_DERIVED( bbcmc, bbcm ) /* fdc */ MCFG_DEVICE_REMOVE("wd177x") - MCFG_DEVICE_ADD("wd177x", WD1772, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) + +// MCFG_WD1772x_ADD("wd177x", XTAL_16MHz / 2) + MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("wd177x:0", bbc_floppies, "qd", bbc_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd177x:1", bbc_floppies, "qd", bbc_state::floppy_formats) /* software lists */ MCFG_SOFTWARE_LIST_REMOVE("cart_ls_m") diff --git a/src/mess/includes/bbc.h b/src/mess/includes/bbc.h index d86172860b9..499283e8ec3 100644 --- a/src/mess/includes/bbc.h +++ b/src/mess/includes/bbc.h @@ -20,7 +20,7 @@ #include "machine/mc6854.h" #include "machine/ram.h" #include "machine/i8271.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/upd7002.h" #include "video/mc6845.h" #include "video/saa5050.h" @@ -80,6 +80,8 @@ public: m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + DECLARE_WRITE8_MEMBER(bbc_page_selecta_w); DECLARE_WRITE8_MEMBER(bbc_memorya1_w); DECLARE_WRITE8_MEMBER(bbc_page_selectb_w); diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index 4e3a0a35561..1fc4d5c22da 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -17,6 +17,7 @@ #include "cpu/m6502/m6502.h" #include "sound/tms5220.h" #include "machine/6522via.h" +#include "machine/wd_fdc.h" #include "imagedev/flopdrv.h" #include "includes/bbc.h" #include "machine/mc146818.h" @@ -1575,7 +1576,7 @@ void bbc_state::bbc_update_fdq_int(int state) /* do not trigger int */ bbc_state = 0; } - +//printf("bbc_state %d prev %d\n", bbc_state, m_previous_wd177x_int_state); /* nmi is edge triggered, and triggers when the state goes from clear->set. Here we are checking this transition before triggering the nmi */ if (bbc_state!=m_previous_wd177x_int_state) @@ -1593,6 +1594,7 @@ void bbc_state::bbc_update_fdq_int(int state) WRITE_LINE_MEMBER(bbc_state::bbc_wd177x_intrq_w) { +//printf("bbc_wd177x_intrq_w %d \n", state); m_wd177x_irq_state = state; bbc_update_fdq_int(state); } @@ -1605,20 +1607,28 @@ WRITE_LINE_MEMBER(bbc_state::bbc_wd177x_drq_w) WRITE8_MEMBER(bbc_state::bbc_wd177x_status_w) { - wd1770_device *fdc = machine().device("wd177x"); + wd1770_t *fdc = machine().device("wd177x"); + floppy_image_device *floppy0 = machine().device("wd177x:0")->get_device(); + floppy_image_device *floppy1 = machine().device("wd177x:1")->get_device(); + floppy_image_device *floppy = NULL; + m_drive_control = data; - /* set drive */ - if ((data>>0) & 0x01) fdc->set_drive(0); - if ((data>>1) & 0x01) fdc->set_drive(1); + // bit 0, 1: drive select + if (BIT(data, 0)) floppy = floppy0; + if (BIT(data, 1)) floppy = floppy1; - /* set side */ - fdc->set_side((data>>2) & 0x01); + fdc->set_floppy(floppy); - /* set density */ + // bit 2: side select + if (floppy) + floppy->ss_w(BIT(data, 2)); + + // bit 3: density fdc->dden_w(BIT(data, 3)); - m_1770_IntEnabled=(((data>>4) & 0x01)==0); + // bit 4: interrupt enable + m_1770_IntEnabled = !BIT(data, 4); } @@ -1626,7 +1636,7 @@ WRITE8_MEMBER(bbc_state::bbc_wd177x_status_w) READ8_MEMBER(bbc_state::bbc_wd1770_read) { int retval=0xff; - wd1770_device *fdc = machine().device("wd177x"); + wd1770_t *fdc = machine().device("wd177x"); switch (offset) { case 4: @@ -1644,22 +1654,22 @@ READ8_MEMBER(bbc_state::bbc_wd1770_read) default: break; } - logerror("wd177x read: $%02X $%02X\n", offset,retval); + //logerror("wd177x read: $%02X $%02X\n", offset,retval); return retval; } WRITE8_MEMBER(bbc_state::bbc_wd1770_write) { - wd1770_device *fdc = machine().device("wd177x"); - logerror("wd177x write: $%02X $%02X\n", offset,data); + wd1770_t *fdc = machine().device("wd177x"); + //logerror("wd177x write: $%02X $%02X\n", offset,data); switch (offset) { case 0: bbc_wd177x_status_w(space, 0, data); break; case 4: - fdc->command_w(space, 0, data); + fdc->cmd_w(space, 0, data); break; case 5: fdc->track_w(space, 0, data); @@ -1714,26 +1724,34 @@ AM_RANGE(0xfc00, 0xfdff) AM_READWRITE(bbc_opus_read , bbc_opus_write ) WRITE8_MEMBER(bbc_state::bbc_opus_status_w) { - wd1770_device *fdc = machine().device("wd177x"); + wd1770_t *fdc = machine().device("wd177x"); + floppy_image_device *floppy0 = machine().device("wd177x:0")->get_device(); + floppy_image_device *floppy1 = machine().device("wd177x:1")->get_device(); + floppy_image_device *floppy = NULL; + m_drive_control = data; - /* set drive */ - if ((data>>1) & 0x01) fdc->set_drive(0); - if ((data>>2) & 0x01) fdc->set_drive(1); + // bit 1, 2: drive select + if (BIT(data, 1)) floppy = floppy0; + if (BIT(data, 2)) floppy = floppy1; - /* set side */ - fdc->set_side((data>>0) & 0x01); + fdc->set_floppy(floppy); - /* set density */ + // bit 0: side select + if (floppy) + floppy->ss_w(BIT(data, 0)); + + // bit 5: density fdc->dden_w(BIT(data, 5)); - m_1770_IntEnabled=(data>>4) & 0x01; + // bit 4: interrupt enable + m_1770_IntEnabled = BIT(data, 4); } READ8_MEMBER(bbc_state::bbc_opus_read) { - wd1770_device *fdc = machine().device("wd177x"); - logerror("wd177x read: $%02X\n", offset); + wd1770_t *fdc = machine().device("wd177x"); + //logerror("wd177x read: $%02X\n", offset); if (m_DFSType==6) { @@ -1761,8 +1779,8 @@ READ8_MEMBER(bbc_state::bbc_opus_read) WRITE8_MEMBER(bbc_state::bbc_opus_write) { - wd1770_device *fdc = machine().device("wd177x"); - logerror("wd177x write: $%02X $%02X\n", offset,data); + wd1770_t *fdc = machine().device("wd177x"); + //logerror("wd177x write: $%02X $%02X\n", offset,data); if (m_DFSType==6) { @@ -1771,7 +1789,7 @@ WRITE8_MEMBER(bbc_state::bbc_opus_write) switch (offset) { case 0xf8: - fdc->command_w(space, 0, data); + fdc->cmd_w(space, 0, data); break; case 0xf9: fdc->track_w(space, 0, data); @@ -1809,7 +1827,7 @@ BBC MASTER DISC SUPPORT READ8_MEMBER(bbc_state::bbcm_wd1770_read) { int retval=0xff; - wd1770_device *fdc = machine().device("wd177x"); + wd1770_t *fdc = machine().device("wd177x"); switch (offset) { case 0: @@ -1833,12 +1851,12 @@ READ8_MEMBER(bbc_state::bbcm_wd1770_read) WRITE8_MEMBER(bbc_state::bbcm_wd1770_write) { - wd1770_device *fdc = machine().device("wd177x"); + wd1770_t *fdc = machine().device("wd177x"); //logerror("wd177x write: $%02X $%02X\n", offset,data); switch (offset) { case 0: - fdc->command_w(space, 0, data); + fdc->cmd_w(space, 0, data); break; case 1: fdc->track_w(space, 0, data); @@ -1862,22 +1880,26 @@ READ8_MEMBER(bbc_state::bbcm_wd1770l_read) WRITE8_MEMBER(bbc_state::bbcm_wd1770l_write) { - wd1770_device *fdc = machine().device("wd177x"); + wd1770_t *fdc = machine().device("wd177x"); + floppy_image_device *floppy0 = machine().device("wd177x:0")->get_device(); + floppy_image_device *floppy1 = machine().device("wd177x:1")->get_device(); + floppy_image_device *floppy = NULL; + m_drive_control = data; - /* set drive */ - if ((data>>0) & 0x01) fdc->set_drive(0); - if ((data>>1) & 0x01) fdc->set_drive(1); + // bit 0, 1: drive select + if (BIT(data, 0)) floppy = floppy0; + if (BIT(data, 1)) floppy = floppy1; - /* set side */ - fdc->set_side((data>>4) & 0x01); + // bit 4: side select + if (floppy) + floppy->ss_w(BIT(data, 4)); - /* set density */ + // bit 5: density fdc->dden_w(BIT(data, 5)); // m_1770_IntEnabled=(((data>>4) & 0x01)==0); m_1770_IntEnabled=1; - } From b834a345750804ebf1afc80ff47215beffcb939d Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Fri, 29 May 2015 18:19:47 -0400 Subject: [PATCH 014/284] Fixed AY8910 speed to match audio pitch in PCB video. Along with a Jump Bug audio fix for 0.161, this resolves MT#5834 (nw) --- src/mame/drivers/galaxian.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index 9d92e4b41e5..83481bf31af 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -5168,7 +5168,7 @@ static MACHINE_CONFIG_DERIVED( zigzag, galaxian_base ) MCFG_CPU_PROGRAM_MAP(galaxian_map_base) /* no discrete sound */ /* sound hardware */ - MCFG_SOUND_ADD("8910.0", AY8910, 1789750) + MCFG_SOUND_ADD("8910.0", AY8910, GALAXIAN_PIXEL_CLOCK/3/2) /* matches PCB video - unconfirmed */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END From f115ab2dd2fd42c3d90bdbd3ce16e091839df24e Mon Sep 17 00:00:00 2001 From: Cowering Date: Fri, 29 May 2015 17:43:09 -0500 Subject: [PATCH 015/284] Let subtarget MESS (not MAME, yet) compile with Windows GCC 5.1 and lto. I am told 'any' recent GCC for Windows has gcc-ar wrapper, if not, change back the line in toolchain.lua (NW) --- scripts/genie.lua | 23 +++++++++-------------- scripts/toolchain.lua | 3 ++- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 004016c916f..356d4d8d3dc 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -725,24 +725,19 @@ if _OPTIONS["OPTIMIZE"] then } end if _OPTIONS["LTO"]=="1" then +-- -flto=4 -> 4 threads buildoptions { - "-flto", + "-flto=4", + } + buildoptions { + "-fno-fat-lto-objects", } --- buildoptions { --- "-ffat-lto-objects", --- } --- buildoptions { --- "-flto-partition=1to1", --- } linkoptions { - "-flto", + "-flto=4", + } + linkoptions { + "-fno-fat-lto-objects", } --- linkoptions { --- "-flto-partition=1to1", --- } --- linkoptions { --- "-ffat-lto-objects", --- } end diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 91d1f29884e..d86c3d53f8f 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -199,7 +199,8 @@ function toolchain(_buildDir, _subDir) end premake.gcc.cc = "$(MINGW64)/bin/x86_64-w64-mingw32-gcc" premake.gcc.cxx = "$(MINGW64)/bin/x86_64-w64-mingw32-g++" - premake.gcc.ar = "$(MINGW64)/bin/ar" +-- premake.gcc.ar = "$(MINGW64)/bin/ar" + premake.gcc.ar = "$(MINGW64)/bin/gcc-ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc") end From 746bb8aecddfb6458b31bec8823d4f9dc55392c2 Mon Sep 17 00:00:00 2001 From: system11b Date: Sat, 30 May 2015 02:50:19 +0100 Subject: [PATCH 016/284] Added gradius3js - split rom version of Japanese S set Corrected ROM names in madmotor as per dumped board with matching checksums Added two new versions of Turtle Ship --- src/mame/arcade.lst | 15 ++++--- src/mame/drivers/gradius3.c | 52 +++++++++++++++++++++++ src/mame/drivers/madmotor.c | 47 +++++++++++---------- src/mame/drivers/sidearms.c | 83 +++++++++++++++++++++++++++++++++++-- 4 files changed, 165 insertions(+), 32 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 69d5bb2111d..dfd415f1842 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -3012,13 +3012,15 @@ sidearms // 12/1986 (c) 1986 (World) sidearmsu // 12/1986 (c) 1986 + Romstar license (US) sidearmsur1 // 12/1986 (c) 1986 + Romstar license (US) sidearmsj // 12/1986 (c) 1986 (Japan) -turtship // (c) 1988 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -turtshipj // (c) 1988 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -turtshipk // (c) 1988 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -dyger // (c) 1989 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -dygera // (c) 1989 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtship // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtshipj // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtshipk // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtshipko // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtshipkn // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +dyger // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +dygera // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) twinfalc // (c) 1989 Philko (Poara Enterprises license) (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -whizz // (c) 1989 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +whizz // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) avengers // 2/1987 (c) 1987 (US) avengers2 // 2/1987 (c) 1987 (US) buraiken // 2/1987 (c) 1987 (Japan) @@ -6636,6 +6638,7 @@ overdriva // GX789 (c) 1990 overdrivb // GX789 (c) 1990 gradius3 // GX945 (c) 1989 (World) gradius3j // GX945 (c) 1989 (Japan) +gradius3js // GX945 (c) 1989 (Japan, split) gradius3a // GX945 (c) 1989 (Asia) // Konami 68020 games diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c index 4cc70d9ecdf..9868e367ba2 100644 --- a/src/mame/drivers/gradius3.c +++ b/src/mame/drivers/gradius3.c @@ -16,6 +16,10 @@ 2009-03: Added dsw locations and verified factory setting based on Guru's notes + 2015-05: + gradius3js set added, same as normal gradius3j set in content but with + some ROMs split and populated differently. + ***************************************************************************/ #include "emu.h" @@ -407,6 +411,53 @@ ROM_START( gradius3j ) ROM_LOAD( "945_l11b.c20", 0x60000, 0x20000, CRC(89ea3baf) SHA1(8edcbaa7969185cfac48c02559826d1b8b081f3f) ) ROM_END +ROM_START( gradius3js ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "945_s13.f15", 0x00000, 0x20000, CRC(70c240a2) SHA1(82dc391572e1f61b0182cb031654d71adcdd5f6e) ) + ROM_LOAD16_BYTE( "945_s12.e15", 0x00001, 0x20000, CRC(bbc300d4) SHA1(e1ca98bc591575285d7bd2d4fefdf35fed10dcb6) ) + + ROM_REGION( 0x100000, "sub", 0 ) + ROM_LOAD16_BYTE( "945_m09.r17", 0x000000, 0x20000, CRC(b4a6df25) SHA1(85533cf140d28f6f81c0b49b8061bda0924a613a) ) + ROM_LOAD16_BYTE( "945_m08.n17", 0x000001, 0x20000, CRC(74e981d2) SHA1(e7b47a2da01ff73293d2100c48fdf00b33125af5) ) + ROM_LOAD16_BYTE( "945_l06b.r11", 0x040000, 0x20000, CRC(83772304) SHA1(a90c75a3de670b6ec5e0fc201876d463b4a76766) ) + ROM_LOAD16_BYTE( "945_l06a.n11", 0x040001, 0x20000, CRC(e1fd75b6) SHA1(6160d80a2f1bf550e85d6253cf521a96f5a644cc) ) + ROM_LOAD16_BYTE( "945_l07c.r15", 0x080000, 0x20000, CRC(c1e399b6) SHA1(e95bd478dd3beea0175bf9ee4cededb111c4ace1) ) + ROM_LOAD16_BYTE( "945_l07a.n15", 0x080001, 0x20000, CRC(96222d04) SHA1(b55700f683a556b0e73dbac9c7b4ce485420d21c) ) + ROM_LOAD16_BYTE( "945_l07d.r13", 0x0c0000, 0x20000, CRC(4c16d4bd) SHA1(01dcf169b78a1e495214b10181401d1920b0c924) ) + ROM_LOAD16_BYTE( "945_l07b.n13", 0x0c0001, 0x20000, CRC(5e209d01) SHA1(0efa1bbfdc7e2ba1e0bb96245e2bfe961258b446) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "945_m05.d9", 0x00000, 0x10000, CRC(c8c45365) SHA1(b9a7b736b52bca42c7b8c8ed64c8df73e0116158) ) + + ROM_REGION( 0x200000, "k051960", 0 ) /* graphics (addressable by the main CPU) */ + ROM_LOAD32_BYTE( "945_A02A.K2", 0x000000, 0x20000, CRC(fbb81511) SHA1(e7988d52e323e46117f5080c469daf9b119f28a0) ) + ROM_LOAD32_BYTE( "945_A02C.M2", 0x000001, 0x20000, CRC(031b55e8) SHA1(64ed8dee60bf012df7c1ed496af1c75263c052a6) ) + ROM_LOAD32_BYTE( "945_A01A.E2", 0x000002, 0x20000, CRC(bace5abb) SHA1(b32df63294c0730f463335b1b760494389c60062) ) + ROM_LOAD32_BYTE( "945_A01C.H2", 0x000003, 0x20000, CRC(d91b29a6) SHA1(0c3027a08996f4c2b86dd88695241b21c8dffd64) ) + ROM_LOAD32_BYTE( "945_A02B.K4", 0x080000, 0x20000, CRC(c0fed4ab) SHA1(f01975b13759cae7c8dfd24f9b3f4ac960d32957) ) + ROM_LOAD32_BYTE( "945_A02D.M4", 0x080001, 0x20000, CRC(d462817c) SHA1(00137e38454e7c3548a1a9553c5ee644916b3959) ) + ROM_LOAD32_BYTE( "945_A01B.E4", 0x080002, 0x20000, CRC(b426090e) SHA1(06a671a648e3255146fe0c325d5451d4f75f08aa) ) + ROM_LOAD32_BYTE( "945_A01D.H4", 0x080003, 0x20000, CRC(3990c09a) SHA1(1f6a089c1d03fb95d4d96fecc0379bde26ee2b9d) ) + + ROM_LOAD32_BYTE( "945_l04a.k6", 0x100000, 0x20000, CRC(884e21ee) SHA1(ce86dd3a06775e5b1aa09db010dcb674e67828e7) ) + ROM_LOAD32_BYTE( "945_l04c.m6", 0x100001, 0x20000, CRC(45bcd921) SHA1(e51a8a71362a6fb55124aa1dce74519c0a3c6e3f) ) + ROM_LOAD32_BYTE( "945_l03a.e6", 0x100002, 0x20000, CRC(a67ef087) SHA1(fd63474f3bbde5dfc53ed4c1db25d6411a8b54d2) ) + ROM_LOAD32_BYTE( "945_l03c.h6", 0x100003, 0x20000, CRC(a56be17a) SHA1(1d387736144c30fcb5de54235331ab1ff70c356e) ) + ROM_LOAD32_BYTE( "945_l04b.k8", 0x180000, 0x20000, CRC(843bc67d) SHA1(cdf8421083f24ab27867ed5d08d8949da192b2b9) ) + ROM_LOAD32_BYTE( "945_l04d.m8", 0x180001, 0x20000, CRC(0a98d08e) SHA1(1e0ca51a2d45c01fa3f11950ddd387f41ddae691) ) + ROM_LOAD32_BYTE( "945_l03b.e8", 0x180002, 0x20000, CRC(933e68b9) SHA1(f3a39446ca77d17fdbd938bd5f718ae9d5570879) ) + ROM_LOAD32_BYTE( "945_l03d.h8", 0x180003, 0x20000, CRC(f375e87b) SHA1(6427b966795c907c8e516244872fe52217da62c4) ) + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "945l14.j28", 0x0000, 0x0100, CRC(c778c189) SHA1(847eaf379ba075c25911c6f83dd63ff390534f60) ) /* priority encoder (not used) */ + + ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 samples */ + ROM_LOAD( "945_A10A.C14", 0x00000, 0x20000, CRC(ec717414) SHA1(8c63d5fe01d0833529fca91bc80cdbd8a04174c0) ) + ROM_LOAD( "945_A10B.C16", 0x20000, 0x20000, CRC(709e30e4) SHA1(27fcea720cd2498f1870c9290d30dcb3dd81d5e5) ) + ROM_LOAD( "945_l11a.c18", 0x40000, 0x20000, CRC(6043f4eb) SHA1(1c2e9ace1cfdde504b7b6158e3c3f54dc5ae33d4) ) + ROM_LOAD( "945_l11b.c20", 0x60000, 0x20000, CRC(89ea3baf) SHA1(8edcbaa7969185cfac48c02559826d1b8b081f3f) ) +ROM_END + ROM_START( gradius3a ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "945_13.f15", 0x00000, 0x20000, CRC(9974fe6b) SHA1(c18ad8d7c93bf58d886715d8e210177cf49f220b) ) @@ -450,4 +501,5 @@ ROM_END GAME( 1989, gradius3, 0, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (World, program code R)", GAME_SUPPORTS_SAVE ) GAME( 1989, gradius3j, gradius3, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (Japan, program code S)", GAME_SUPPORTS_SAVE ) +GAME( 1989, gradius3js, gradius3, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (Japan, program code S, split)", GAME_SUPPORTS_SAVE ) GAME( 1989, gradius3a, gradius3, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (Asia)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c index f2693e8f6ea..1c2be5ea2a2 100644 --- a/src/mame/drivers/madmotor.c +++ b/src/mame/drivers/madmotor.c @@ -291,45 +291,46 @@ MACHINE_CONFIG_END /******************************************************************************/ +/* ROM names all corrected as per exact checksum matching PCB - system11 */ ROM_START( madmotor ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD16_BYTE( "02", 0x00000, 0x20000, CRC(50b554e0) SHA1(e33d0ab5464ab5ff394dd630536ac83baf0aa2c9) ) - ROM_LOAD16_BYTE( "00", 0x00001, 0x20000, CRC(2d6a1b3f) SHA1(fa7058bf907becac56ed9938c5643aaefdf7a2c0) ) - ROM_LOAD16_BYTE( "03", 0x40000, 0x20000, CRC(442a0a52) SHA1(86bb5470d5653d125481250f778c632371dddad8) ) - ROM_LOAD16_BYTE( "01", 0x40001, 0x20000, CRC(e246876e) SHA1(648dca8bab001cfb42618081bbc1efa14118743e) ) + ROM_LOAD16_BYTE( "02-2.B4", 0x00000, 0x20000, CRC(50b554e0) SHA1(e33d0ab5464ab5ff394dd630536ac83baf0aa2c9) ) + ROM_LOAD16_BYTE( "00-2.B1", 0x00001, 0x20000, CRC(2d6a1b3f) SHA1(fa7058bf907becac56ed9938c5643aaefdf7a2c0) ) + ROM_LOAD16_BYTE( "03-2.B6", 0x40000, 0x20000, CRC(442a0a52) SHA1(86bb5470d5653d125481250f778c632371dddad8) ) + ROM_LOAD16_BYTE( "01-2.B3", 0x40001, 0x20000, CRC(e246876e) SHA1(648dca8bab001cfb42618081bbc1efa14118743e) ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */ - ROM_LOAD( "14", 0x00000, 0x10000, CRC(1c28a7e5) SHA1(ed30d0a5a8a079677bd34b6d98ab1b15b934b30f) ) + ROM_LOAD( "14.L7", 0x00000, 0x10000, CRC(1c28a7e5) SHA1(ed30d0a5a8a079677bd34b6d98ab1b15b934b30f) ) ROM_REGION( 0x020000, "gfx1", 0 ) - ROM_LOAD( "04", 0x000000, 0x10000, CRC(833ca3ab) SHA1(7a3e7ebecc1596d2e487595369ad9ba54ced5bfb) ) /* chars */ - ROM_LOAD( "05", 0x010000, 0x10000, CRC(a691fbfe) SHA1(c726a4c15d599feb6883d9b643453e7028fa16d6) ) + ROM_LOAD( "04.A9", 0x000000, 0x10000, CRC(833ca3ab) SHA1(7a3e7ebecc1596d2e487595369ad9ba54ced5bfb) ) /* chars */ + ROM_LOAD( "05.A11", 0x010000, 0x10000, CRC(a691fbfe) SHA1(c726a4c15d599feb6883d9b643453e7028fa16d6) ) ROM_REGION( 0x040000, "gfx2", 0 ) - ROM_LOAD( "10", 0x000000, 0x20000, CRC(9dbf482b) SHA1(086e9170d577e502604c180f174fbce53a1e20e5) ) /* tiles */ - ROM_LOAD( "11", 0x020000, 0x20000, CRC(593c48a9) SHA1(1158888f6b836253b8ae9db9b8e352f289b2e815) ) + ROM_LOAD( "10.A19", 0x000000, 0x20000, CRC(9dbf482b) SHA1(086e9170d577e502604c180f174fbce53a1e20e5) ) /* tiles */ + ROM_LOAD( "11.A21", 0x020000, 0x20000, CRC(593c48a9) SHA1(1158888f6b836253b8ae9db9b8e352f289b2e815) ) ROM_REGION( 0x080000, "gfx3", 0 ) - ROM_LOAD( "06", 0x000000, 0x20000, CRC(448850e5) SHA1(6a44a42738cf6a55b4bec807e0a3939a42b36793) ) /* tiles */ - ROM_LOAD( "07", 0x020000, 0x20000, CRC(ede4d141) SHA1(7b847372bac043aa397aa5c274f90b9193de9176) ) - ROM_LOAD( "08", 0x040000, 0x20000, CRC(c380e5e5) SHA1(ec87a94e7948b84c96b1577f5a8caebc56e38a94) ) - ROM_LOAD( "09", 0x060000, 0x20000, CRC(1ee3326a) SHA1(bd03e5c4a2e7689260e6cc67288e71ef13f05a4b) ) + ROM_LOAD( "06.A13", 0x000000, 0x20000, CRC(448850e5) SHA1(6a44a42738cf6a55b4bec807e0a3939a42b36793) ) /* tiles */ + ROM_LOAD( "07.A14", 0x020000, 0x20000, CRC(ede4d141) SHA1(7b847372bac043aa397aa5c274f90b9193de9176) ) + ROM_LOAD( "08.A16", 0x040000, 0x20000, CRC(c380e5e5) SHA1(ec87a94e7948b84c96b1577f5a8caebc56e38a94) ) + ROM_LOAD( "09.A18", 0x060000, 0x20000, CRC(1ee3326a) SHA1(bd03e5c4a2e7689260e6cc67288e71ef13f05a4b) ) ROM_REGION( 0x100000, "gfx4", 0 ) - ROM_LOAD( "15", 0x000000, 0x20000, CRC(90ae9f74) SHA1(806f96fd08fca1beeeaefe3c0fac1991410aa9c4) ) /* sprites */ - ROM_LOAD( "16", 0x020000, 0x20000, CRC(e96ac815) SHA1(a2b22a29ad0a4f144bb09299c454dc7a842a5318) ) - ROM_LOAD( "17", 0x040000, 0x20000, CRC(abad9a1b) SHA1(3cec6b4ef925205efe4a8fb28e08eb58e3ba4019) ) - ROM_LOAD( "18", 0x060000, 0x20000, CRC(96d8d64b) SHA1(54ce87fe2b14b574176d2a1d2b86057b9cd10883) ) - ROM_LOAD( "19", 0x080000, 0x20000, CRC(cbd8c9b8) SHA1(5e86c0298b3eea06920121eecb70e5bee705addf) ) - ROM_LOAD( "20", 0x0a0000, 0x20000, CRC(47f706a8) SHA1(bd4fe499710f8905eb4b8d1ca990f2908feb95e1) ) - ROM_LOAD( "21", 0x0c0000, 0x20000, CRC(9c72d364) SHA1(9290e463273fa1f921279f1bab808d91d3aa9648) ) - ROM_LOAD( "22", 0x0e0000, 0x20000, CRC(1e78aa60) SHA1(f5f58ee6f5efe56e72623e57ce27884551e09bd9) ) + ROM_LOAD( "15.H11", 0x000000, 0x20000, CRC(90ae9f74) SHA1(806f96fd08fca1beeeaefe3c0fac1991410aa9c4) ) /* sprites */ + ROM_LOAD( "16.H13", 0x020000, 0x20000, CRC(e96ac815) SHA1(a2b22a29ad0a4f144bb09299c454dc7a842a5318) ) + ROM_LOAD( "17.H14", 0x040000, 0x20000, CRC(abad9a1b) SHA1(3cec6b4ef925205efe4a8fb28e08eb58e3ba4019) ) + ROM_LOAD( "18.H16", 0x060000, 0x20000, CRC(96d8d64b) SHA1(54ce87fe2b14b574176d2a1d2b86057b9cd10883) ) + ROM_LOAD( "19.J13", 0x080000, 0x20000, CRC(cbd8c9b8) SHA1(5e86c0298b3eea06920121eecb70e5bee705addf) ) + ROM_LOAD( "20.J14", 0x0a0000, 0x20000, CRC(47f706a8) SHA1(bd4fe499710f8905eb4b8d1ca990f2908feb95e1) ) + ROM_LOAD( "21.J16", 0x0c0000, 0x20000, CRC(9c72d364) SHA1(9290e463273fa1f921279f1bab808d91d3aa9648) ) + ROM_LOAD( "22.J18", 0x0e0000, 0x20000, CRC(1e78aa60) SHA1(f5f58ee6f5efe56e72623e57ce27884551e09bd9) ) ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */ - ROM_LOAD( "12", 0x00000, 0x20000, CRC(c202d200) SHA1(8470654923a0e8780dad678f5745f8e3e3be08b2) ) + ROM_LOAD( "12.H1", 0x00000, 0x20000, CRC(c202d200) SHA1(8470654923a0e8780dad678f5745f8e3e3be08b2) ) ROM_REGION( 0x40000, "oki2", 0 ) /* ADPCM samples */ - ROM_LOAD( "13", 0x00000, 0x20000, CRC(cc4d65e9) SHA1(b9bcaa52c570f94d2f2e5dd84c94773cc4115442) ) + ROM_LOAD( "13.H3", 0x00000, 0x20000, CRC(cc4d65e9) SHA1(b9bcaa52c570f94d2f2e5dd84c94773cc4115442) ) ROM_END /******************************************************************************/ diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c index 515c80e284c..45c01dedf12 100644 --- a/src/mame/drivers/sidearms.c +++ b/src/mame/drivers/sidearms.c @@ -10,6 +10,13 @@ Change Log: +MAY-2015 System11 + +- added turtshipko and turtshipkn. +- amended comments for T-5 instances, A14 is tied high on the PCBs hence the need to load the higher half of the ROM only +- order of age is guessed - turtshipko has grey bullets and is the only revision to have these, probably fixed based on feedback before it was licensed to Sharp Image and Pacific Games - differences between US/JP/Korea versions previously in MAME are minimal. +- turtshipkn I assume is newer, the level order has changed and the disclaimer is in pure Korean however the orange bullets are retained. Given the 88/9 release date from the startup screen it would seem unlikely that this came out first, then got grey bullets and back to orange in time for it to still be a 1988 game in other countries. + JUL-2003 AAT - cleaned video and corrected screen flipping @@ -906,7 +913,7 @@ ROM_START( turtship ) ROM_REGION( 0x04000, "gfx1", 0 ) ROM_LOAD( "t-5.8k", 0x00000, 0x04000, CRC(35c3dbc5) SHA1(6700c72e5e0f7bd1429d342cb5d3daccd6b1b70f) ) /* characters */ - ROM_CONTINUE( 0x00000, 0x04000 ) /* is the first half used? */ + ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */ ROM_REGION( 0x80000, "gfx2", 0 ) ROM_LOAD( "t-8.1d", 0x00000, 0x10000, CRC(30a857f0) SHA1(a2d261e8104d0459067bdbdd71662fe8d6917da1) ) /* tiles */ @@ -939,7 +946,8 @@ ROM_START( turtshipj ) ROM_REGION( 0x04000, "gfx1", 0 ) ROM_LOAD( "t-5.8k", 0x00000, 0x04000, CRC(35c3dbc5) SHA1(6700c72e5e0f7bd1429d342cb5d3daccd6b1b70f) ) /* characters */ - ROM_CONTINUE( 0x00000, 0x04000 ) /* is the first half used? */ + ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */ + ROM_REGION( 0x80000, "gfx2", 0 ) ROM_LOAD( "t-8.1d", 0x00000, 0x10000, CRC(30a857f0) SHA1(a2d261e8104d0459067bdbdd71662fe8d6917da1) ) /* tiles */ @@ -970,7 +978,7 @@ ROM_START( turtshipk ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "t-4.8a", 0x00000, 0x08000, CRC(1cbe48e8) SHA1(6ac5981d36a44595bb8dc847c54c7be7b374f82c) ) - ROM_REGION( 0x04000, "gfx1", 0 ) + ROM_REGION( 0x04000, "gfx1", 0 ) /* Really a 27128? */ ROM_LOAD( "turtship.005", 0x00000, 0x04000, CRC(651fef75) SHA1(9c821a2ee30c222987f0d4192133776490d6a4e0) ) /* characters */ ROM_REGION( 0x80000, "gfx2", 0 ) @@ -993,6 +1001,73 @@ ROM_START( turtshipk ) ROM_LOAD( "turtship.016", 0x00000, 0x08000, CRC(affd51dd) SHA1(3338aa1fdd6b9926acc215f7f3656d70803f1832) ) ROM_END +ROM_START( turtshipko ) + ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + banked ROMs images */ + ROM_LOAD( "T-3.G5", 0x00000, 0x08000, CRC(cd789535) SHA1(3c4f94c751645b61066177fbf3157924ad177c32) ) + ROM_LOAD( "T-2.G3", 0x08000, 0x08000, CRC(253678c0) SHA1(1470fd936003462d480c759658628ea085d4bd71) ) + ROM_LOAD( "T-1.E3", 0x10000, 0x08000, CRC(d6fdc376) SHA1(3f4e1fde8b83e3762f9499dfe291309efe940093) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "T-4.A8", 0x00000, 0x08000, CRC(1cbe48e8) SHA1(6ac5981d36a44595bb8dc847c54c7be7b374f82c) ) + + ROM_REGION( 0x04000, "gfx1", 0 ) + ROM_LOAD( "T-5.K8", 0x00000, 0x04000, CRC(35c3dbc5) SHA1(6700c72e5e0f7bd1429d342cb5d3daccd6b1b70f) ) /* characters */ + ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */ + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD( "T-8.D1", 0x00000, 0x10000, CRC(2f0b2336) SHA1(a869e0a50aab7d29afbca46fa04bd470488a8eeb) ) /* tiles */ + ROM_LOAD( "T-10.C3", 0x10000, 0x10000, CRC(6a0072f4) SHA1(d74b53ed90a4d01020a179f263a39b7547b8f82e) ) + ROM_RELOAD( 0x30000, 0x10000) + ROM_LOAD( "T-11.D3", 0x20000, 0x10000, CRC(53da6cb1) SHA1(52720746298adb01828f959f81b385d268c94343) ) + ROM_LOAD( "T-6.A1", 0x40000, 0x10000, CRC(a7cce654) SHA1(f6c99622dcacc1d76021ca29b0bbceefbb75c499) ) + ROM_LOAD( "T-7.C1", 0x50000, 0x10000, CRC(90dd8415) SHA1(8e9d43ff9164fb287ab82df7da8890976b9d21c7) ) + ROM_RELOAD( 0x70000, 0x10000) + ROM_LOAD( "T-9.A3", 0x60000, 0x10000, CRC(44762916) SHA1(3427066fc02d1b9b71a59ac41d3332d5cd8d1423) ) + + ROM_REGION( 0x40000, "gfx3", 0 ) + ROM_LOAD( "T-13.I1", 0x00000, 0x10000, CRC(1cc87f50) SHA1(d7d8a4376b556675dafa0a407bb34b6017f17e7d) ) /* sprites */ + ROM_LOAD( "T-15.I3", 0x10000, 0x10000, CRC(775ee5d9) SHA1(e39eb558cc2d5cdf4c87b96f85af72e5600b995e) ) + ROM_LOAD( "T-12.G1", 0x20000, 0x10000, CRC(57783312) SHA1(57942e8c3b7be63ea62bae3c104cb2842eb6b755) ) + ROM_LOAD( "T-14.G3", 0x30000, 0x10000, CRC(a30e3346) SHA1(150a837fb5d4705df9e8e9a94f78cff0e1c57d64) ) + + ROM_REGION( 0x08000, "gfx4", 0 ) /* background tilemaps */ + ROM_LOAD( "T-16.F9", 0x00000, 0x08000, CRC(9b377277) SHA1(4858560e35144727aea958023f3df785baa994a8) ) +ROM_END + +ROM_START( turtshipkn ) + ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + banked ROMs images */ + ROM_LOAD( "T-3.G5", 0x00000, 0x08000, CRC(529b091c) SHA1(9a3a885dbf1f9d3c3c326418efdcb4f6f96eb4ae) ) + ROM_LOAD( "T-2.G3", 0x08000, 0x08000, CRC(d2f30195) SHA1(d64f088ed776658563943e8cde086842d0d899f8) ) + ROM_LOAD( "T-1.E3", 0x10000, 0x08000, CRC(2d02da90) SHA1(5cf059e04e145861f9877cefa2c7168e6ded19ac) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "T-4.A8", 0x00000, 0x08000, CRC(1cbe48e8) SHA1(6ac5981d36a44595bb8dc847c54c7be7b374f82c) ) + + ROM_REGION( 0x04000, "gfx1", 0 ) + ROM_LOAD( "T-5.K8", 0x00000, 0x04000, CRC(5c2ee02d) SHA1(c8d3dbdaab943c1639795915cf275951501a2a77) ) /* characters */ + ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */ + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD( "T-8.D1", 0x00000, 0x10000, CRC(2f0b2336) SHA1(a869e0a50aab7d29afbca46fa04bd470488a8eeb) ) /* tiles */ + ROM_LOAD( "T-10.C3", 0x10000, 0x10000, CRC(6a0072f4) SHA1(d74b53ed90a4d01020a179f263a39b7547b8f82e) ) + ROM_RELOAD( 0x30000, 0x10000) + ROM_LOAD( "T-11.D3", 0x20000, 0x10000, CRC(53da6cb1) SHA1(52720746298adb01828f959f81b385d268c94343) ) + ROM_LOAD( "T-6.A1", 0x40000, 0x10000, CRC(a7cce654) SHA1(f6c99622dcacc1d76021ca29b0bbceefbb75c499) ) + ROM_LOAD( "T-7.C1", 0x50000, 0x10000, CRC(90dd8415) SHA1(8e9d43ff9164fb287ab82df7da8890976b9d21c7) ) + ROM_RELOAD( 0x70000, 0x10000) + ROM_LOAD( "T-9.A3", 0x60000, 0x10000, CRC(44762916) SHA1(3427066fc02d1b9b71a59ac41d3332d5cd8d1423) ) + + ROM_REGION( 0x40000, "gfx3", 0 ) + ROM_LOAD( "T-13.I1", 0x00000, 0x10000, CRC(1cc87f50) SHA1(d7d8a4376b556675dafa0a407bb34b6017f17e7d) ) /* sprites */ + ROM_LOAD( "T-15.I3", 0x10000, 0x10000, CRC(3bf91fb8) SHA1(1c8368dc8d52c3c48a85391f00c91a80fa5d781d) ) + ROM_LOAD( "T-12.G1", 0x20000, 0x10000, CRC(57783312) SHA1(57942e8c3b7be63ea62bae3c104cb2842eb6b755) ) + ROM_LOAD( "T-14.G3", 0x30000, 0x10000, CRC(ee162dc0) SHA1(127b3cb3ddd47aa8ee70cad2d54b1306ad8f10e8) ) + + ROM_REGION( 0x08000, "gfx4", 0 ) /* background tilemaps */ + ROM_LOAD( "T-16.F9", 0x00000, 0x08000, CRC(9b377277) SHA1(4858560e35144727aea958023f3df785baa994a8) ) +ROM_END + + ROM_START( dyger ) ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + banked ROMs images */ ROM_LOAD( "d-3.5g", 0x00000, 0x08000, CRC(bae9882e) SHA1(88194e58673ebd0841e9e07482842f6dbb823afc) ) @@ -1153,6 +1228,8 @@ GAME( 1986, sidearmsj, sidearms, sidearms, sidearms, sidearms_state, sidearms, GAME( 1988, turtship, 0, turtship, turtship, sidearms_state, turtship, ROT0, "Philko (Sharp Image license)", "Turtle Ship (North America)", GAME_SUPPORTS_SAVE ) GAME( 1988, turtshipj,turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko (Pacific Games license)", "Turtle Ship (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1988, turtshipk,turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko", "Turtle Ship (Korea)", GAME_SUPPORTS_SAVE ) +GAME( 1988, turtshipko,turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko", "Turtle Ship (Korea, older)", GAME_SUPPORTS_SAVE ) +GAME( 1988, turtshipkn, turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko", "Turtle Ship (Korea, 88/9)", GAME_SUPPORTS_SAVE ) GAME( 1989, dyger, 0, turtship, dyger, sidearms_state, dyger, ROT270, "Philko", "Dyger (Korea set 1)", GAME_SUPPORTS_SAVE ) GAME( 1989, dygera, dyger, turtship, dyger, sidearms_state, dyger, ROT270, "Philko", "Dyger (Korea set 2)", GAME_SUPPORTS_SAVE ) From 46c7eabbaf98b98fd1f06eb2f56ffc14ae389f5a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 30 May 2015 13:36:37 +1000 Subject: [PATCH 017/284] PMF extension doesn't work on OSX (nw) --- src/emu/netlist/nl_config.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index 5235907a0ac..c6b5373fb26 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -28,18 +28,16 @@ */ #ifndef USE_PMFDELEGATES -#if defined(__clang__) || (defined(__GNUC__) && defined(__i386__)) +#if defined(__clang__) || defined(__APPLE__) || (defined(__GNUC__) && defined(__i386__)) #define USE_PMFDELEGATES (0) #define NO_USE_PMFCONVERSION (1) +#elif defined(__GNUC__) + #define USE_PMFDELEGATES (0) + #define NO_USE_PMFCONVERSION (0) + #pragma GCC diagnostic ignored "-Wpmf-conversions" #else - #if defined(__GNUC__) - #define USE_PMFDELEGATES (1) - #define NO_USE_PMFCONVERSION (0) - #pragma GCC diagnostic ignored "-Wpmf-conversions" - #else - #define USE_PMFDELEGATES (0) - #define NO_USE_PMFCONVERSION (1) - #endif + #define USE_PMFDELEGATES (0) + #define NO_USE_PMFCONVERSION (1) #endif #endif From 87bbbfffc3ce0588a63db2d6647e829299b52ead Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 30 May 2015 07:51:29 +0200 Subject: [PATCH 018/284] Got answer from Steve Ellenoff (nw) --- src/emu/cpu/arm7/arm7.c | 14 +------------- src/emu/cpu/arm7/arm7.h | 14 +------------- src/emu/cpu/arm7/arm7core.h | 14 +------------- src/emu/cpu/arm7/arm7core.inc | 14 +------------- src/emu/cpu/arm7/arm7dasm.c | 14 +------------- src/emu/cpu/arm7/arm7drc.inc | 14 +------------- src/emu/cpu/arm7/arm7help.h | 2 +- src/emu/cpu/arm7/arm7ops.c | 2 +- src/emu/cpu/arm7/arm7tdrc.inc | 2 +- src/emu/cpu/arm7/arm7thmb.c | 2 +- src/emu/cpu/mcs51/mcs51.c | 14 +------------- src/emu/cpu/mcs51/mcs51.h | 14 +------------- src/emu/cpu/mcs51/mcs51dasm.c | 14 +------------- src/mame/drivers/ertictac.c | 2 +- src/mame/drivers/gladiatr.c | 2 +- src/mame/drivers/gsword.c | 2 +- src/mame/drivers/portrait.c | 2 +- src/mame/drivers/tagteam.c | 2 +- src/mame/includes/gladiatr.h | 2 +- src/mame/includes/gsword.h | 2 +- src/mame/includes/portrait.h | 2 +- src/mame/includes/tagteam.h | 2 +- src/mame/video/gladiatr.c | 2 +- src/mame/video/gsword.c | 2 +- src/mame/video/portrait.c | 2 +- src/mame/video/tagteam.c | 2 +- 26 files changed, 26 insertions(+), 134 deletions(-) diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c index b030275602b..65125f265f6 100644 --- a/src/emu/cpu/arm7/arm7.c +++ b/src/emu/cpu/arm7/arm7.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /***************************************************************************** * @@ -8,18 +8,6 @@ * Copyright Steve Ellenoff, all rights reserved. * Thumb, DSP, and MMU support and many bugfixes by R. Belmont and Ryan Holtz. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) diff --git a/src/emu/cpu/arm7/arm7.h b/src/emu/cpu/arm7/arm7.h index cb444cf69e4..9b98151494f 100644 --- a/src/emu/cpu/arm7/arm7.h +++ b/src/emu/cpu/arm7/arm7.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /***************************************************************************** * @@ -7,18 +7,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) diff --git a/src/emu/cpu/arm7/arm7core.h b/src/emu/cpu/arm7/arm7core.h index ba75a0ddf01..0883bae8291 100644 --- a/src/emu/cpu/arm7/arm7core.h +++ b/src/emu/cpu/arm7/arm7core.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /***************************************************************************** * @@ -7,18 +7,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) diff --git a/src/emu/cpu/arm7/arm7core.inc b/src/emu/cpu/arm7/arm7core.inc index 51abd756b1f..736d42b0262 100644 --- a/src/emu/cpu/arm7/arm7core.inc +++ b/src/emu/cpu/arm7/arm7core.inc @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /***************************************************************************** * @@ -7,18 +7,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) diff --git a/src/emu/cpu/arm7/arm7dasm.c b/src/emu/cpu/arm7/arm7dasm.c index 50bcae74a1e..b749d3624a2 100644 --- a/src/emu/cpu/arm7/arm7dasm.c +++ b/src/emu/cpu/arm7/arm7dasm.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /***************************************************************************** * @@ -7,18 +7,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) diff --git a/src/emu/cpu/arm7/arm7drc.inc b/src/emu/cpu/arm7/arm7drc.inc index 61b004c457e..fc97e35da1f 100644 --- a/src/emu/cpu/arm7/arm7drc.inc +++ b/src/emu/cpu/arm7/arm7drc.inc @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /***************************************************************************** * @@ -9,18 +9,6 @@ * Thumb, DSP, and MMU support and many bugfixes by R. Belmont and Ryan Holtz. * Dyanmic Recompiler (DRC) / Just In Time Compiler (JIT) by Ryan Holtz. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999' * #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76) diff --git a/src/emu/cpu/arm7/arm7help.h b/src/emu/cpu/arm7/arm7help.h index 307da0e44ef..5625318b942 100644 --- a/src/emu/cpu/arm7/arm7help.h +++ b/src/emu/cpu/arm7/arm7help.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz /* ARM7 core helper Macros / Functions */ diff --git a/src/emu/cpu/arm7/arm7ops.c b/src/emu/cpu/arm7/arm7ops.c index 151299e1e98..9b96ca9054c 100644 --- a/src/emu/cpu/arm7/arm7ops.c +++ b/src/emu/cpu/arm7/arm7ops.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz #include "emu.h" #include "arm7.h" diff --git a/src/emu/cpu/arm7/arm7tdrc.inc b/src/emu/cpu/arm7/arm7tdrc.inc index e9847a97642..ee0573a32e7 100644 --- a/src/emu/cpu/arm7/arm7tdrc.inc +++ b/src/emu/cpu/arm7/arm7tdrc.inc @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz #include "emu.h" #include "arm7core.h" diff --git a/src/emu/cpu/arm7/arm7thmb.c b/src/emu/cpu/arm7/arm7thmb.c index 5e67464d284..3dfd46094aa 100644 --- a/src/emu/cpu/arm7/arm7thmb.c +++ b/src/emu/cpu/arm7/arm7thmb.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,R. Belmont,Ryan Holtz #include "emu.h" #include "arm7.h" diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c index 94811d9851e..d3c73ecf0c6 100644 --- a/src/emu/cpu/mcs51/mcs51.c +++ b/src/emu/cpu/mcs51/mcs51.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Manuel Abadia, Couriersud /***************************************************************************** * @@ -13,18 +13,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Intel(tm) MC51 Microcontroller Family Users Manual' and * #2) 8051 simulator by Travis Marlatte diff --git a/src/emu/cpu/mcs51/mcs51.h b/src/emu/cpu/mcs51/mcs51.h index e90b7d421c9..89caacafa49 100644 --- a/src/emu/cpu/mcs51/mcs51.h +++ b/src/emu/cpu/mcs51/mcs51.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Manuel Abadia, Couriersud /***************************************************************************** * @@ -13,18 +13,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Intel(tm) MC51 Microcontroller Family Users Manual' and * #2) 8051 simulator by Travis Marlatte diff --git a/src/emu/cpu/mcs51/mcs51dasm.c b/src/emu/cpu/mcs51/mcs51dasm.c index 62187d4a692..0d16048855f 100644 --- a/src/emu/cpu/mcs51/mcs51dasm.c +++ b/src/emu/cpu/mcs51/mcs51dasm.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff /***************************************************************************** * @@ -13,18 +13,6 @@ * * Copyright Steve Ellenoff, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * sellenoff@hotmail.com - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * This work is based on: * #1) 'Intel(tm) MC51 Microcontroller Family Users Manual' and * #2) 8051 simulator by Travis Marlatte diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c index e34d84d6a7c..dc3d05d682c 100644 --- a/src/mame/drivers/ertictac.c +++ b/src/mame/drivers/ertictac.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Angelo Salese, R. Belmont, Tomasz Slanina, Steve Ellenoff, Nicola Salmoria /******************************************************************************************* diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c index 875818142ee..482c56808c7 100644 --- a/src/mame/drivers/gladiatr.c +++ b/src/mame/drivers/gladiatr.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Victor Trucco,Steve Ellenoff,Phil Stroffolino,Tatsuyuki Satoh,Tomasz Slanina,Nicola Salmoria /*************************************************************************** diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c index 52f91c44223..50ae7998a2c 100644 --- a/src/mame/drivers/gsword.c +++ b/src/mame/drivers/gsword.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,Jarek Parchanski /* Great Swordsman (Taito) 1984 diff --git a/src/mame/drivers/portrait.c b/src/mame/drivers/portrait.c index 7134d0f8942..c55df3885fc 100644 --- a/src/mame/drivers/portrait.c +++ b/src/mame/drivers/portrait.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Pierpaolo Prazzoli /************************************************************************** Portraits diff --git a/src/mame/drivers/tagteam.c b/src/mame/drivers/tagteam.c index 4a92373602c..e0abaacd8af 100644 --- a/src/mame/drivers/tagteam.c +++ b/src/mame/drivers/tagteam.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Brad Oliver /*************************************************************************** diff --git a/src/mame/includes/gladiatr.h b/src/mame/includes/gladiatr.h index 93beba148e4..06813718742 100644 --- a/src/mame/includes/gladiatr.h +++ b/src/mame/includes/gladiatr.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Victor Trucco,Steve Ellenoff,Phil Stroffolino,Tatsuyuki Satoh,Tomasz Slanina,Nicola Salmoria #include "sound/msm5205.h" diff --git a/src/mame/includes/gsword.h b/src/mame/includes/gsword.h index 30bc33d2108..513569d5fdc 100644 --- a/src/mame/includes/gsword.h +++ b/src/mame/includes/gsword.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,Jarek Parchanski #include "sound/ay8910.h" #include "sound/msm5205.h" diff --git a/src/mame/includes/portrait.h b/src/mame/includes/portrait.h index 0948166636a..edf4c2a37ce 100644 --- a/src/mame/includes/portrait.h +++ b/src/mame/includes/portrait.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Pierpaolo Prazzoli #include "sound/tms5220.h" diff --git a/src/mame/includes/tagteam.h b/src/mame/includes/tagteam.h index aebbdc78331..aa588c11567 100644 --- a/src/mame/includes/tagteam.h +++ b/src/mame/includes/tagteam.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Brad Oliver class tagteam_state : public driver_device { diff --git a/src/mame/video/gladiatr.c b/src/mame/video/gladiatr.c index d94bd4e7dd3..31a115c792a 100644 --- a/src/mame/video/gladiatr.c +++ b/src/mame/video/gladiatr.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Victor Trucco,Steve Ellenoff,Phil Stroffolino,Tatsuyuki Satoh,Tomasz Slanina,Nicola Salmoria /*************************************************************************** diff --git a/src/mame/video/gsword.c b/src/mame/video/gsword.c index 95e78a571de..2b3e4de0a50 100644 --- a/src/mame/video/gsword.c +++ b/src/mame/video/gsword.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff,Jarek Parchanski /*************************************************************************** Great Swordsman diff --git a/src/mame/video/portrait.c b/src/mame/video/portrait.c index f9ba1b75d1b..e3dc2b46796 100644 --- a/src/mame/video/portrait.c +++ b/src/mame/video/portrait.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Pierpaolo Prazzoli /*************************************************************************** diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c index 923abc5856f..6a6f7358d9a 100644 --- a/src/mame/video/tagteam.c +++ b/src/mame/video/tagteam.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Steve Ellenoff, Brad Oliver /*************************************************************************** From 66e394a50f057709e7e4f9932d863eea188c9826 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 30 May 2015 07:54:01 +0200 Subject: [PATCH 019/284] removed some non-commercial use texts no use since it's BSD3 now (nw) --- src/emu/cpu/cp1610/cp1610.c | 10 ---------- src/emu/cpu/cp1610/cp1610.h | 10 ---------- src/emu/cpu/lr35902/lr35902d.c | 14 -------------- src/emu/cpu/sc61860/sc61860.c | 12 ------------ src/emu/cpu/sc61860/sc61860.h | 12 ------------ src/emu/cpu/sc61860/scdasm.c | 12 ------------ src/emu/cpu/sc61860/scops.inc | 12 ------------ src/emu/cpu/scudsp/scudsp.c | 11 ----------- src/mess/video/pc1403.c | 12 ------------ 9 files changed, 105 deletions(-) diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c index 1dc911adf5e..1279a2cdd91 100644 --- a/src/emu/cpu/cp1610/cp1610.c +++ b/src/emu/cpu/cp1610/cp1610.c @@ -7,16 +7,6 @@ * * Copyright Frank Palazzolo, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * palazzol@comcast.net - * - This entire notice must remain in the source code. - * * This work is based on Juergen Buchmueller's F8 emulation, * and the 'General Instruments CP1610' data sheets. * Special thanks to Joe Zbiciak for his GPL'd CP1610 emulator diff --git a/src/emu/cpu/cp1610/cp1610.h b/src/emu/cpu/cp1610/cp1610.h index 1b2e8657892..670fb0deac8 100644 --- a/src/emu/cpu/cp1610/cp1610.h +++ b/src/emu/cpu/cp1610/cp1610.h @@ -7,16 +7,6 @@ * * Copyright Frank Palazzolo, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * palazzol@comcast.net - * - This entire notice must remain in the source code. - * *****************************************************************************/ #pragma once diff --git a/src/emu/cpu/lr35902/lr35902d.c b/src/emu/cpu/lr35902/lr35902d.c index 64af29a544c..cf6d61bd7d6 100644 --- a/src/emu/cpu/lr35902/lr35902d.c +++ b/src/emu/cpu/lr35902/lr35902d.c @@ -5,20 +5,6 @@ * lr35902d.c * Portable Sharp LR35902 disassembler * - * Copyright The MESS Team. - * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * pullmoll@t-online.de - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * *****************************************************************************/ #include "emu.h" diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c index d0006cb4f23..a36c02a658a 100644 --- a/src/emu/cpu/sc61860/sc61860.c +++ b/src/emu/cpu/sc61860/sc61860.c @@ -8,18 +8,6 @@ * * Copyright Peter Trauner, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * peter.trauner@jk.uni-linz.ac.at - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * History of changes: * 29.7.2001 Several changes listed below taken by Mario Konegger * (konegger@itp.tu-graz.ac.at) diff --git a/src/emu/cpu/sc61860/sc61860.h b/src/emu/cpu/sc61860/sc61860.h index 51791715fcd..e34197f83f9 100644 --- a/src/emu/cpu/sc61860/sc61860.h +++ b/src/emu/cpu/sc61860/sc61860.h @@ -8,18 +8,6 @@ * * Copyright Peter Trauner, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * peter.trauner@jk.uni-linz.ac.at - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * *****************************************************************************/ #pragma once diff --git a/src/emu/cpu/sc61860/scdasm.c b/src/emu/cpu/sc61860/scdasm.c index 8d7cc3ad43e..047ba7fae30 100644 --- a/src/emu/cpu/sc61860/scdasm.c +++ b/src/emu/cpu/sc61860/scdasm.c @@ -8,18 +8,6 @@ * * Copyright Peter Trauner, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * peter.trauner@jk.uni-linz.ac.at - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * *****************************************************************************/ #include "emu.h" diff --git a/src/emu/cpu/sc61860/scops.inc b/src/emu/cpu/sc61860/scops.inc index a432d5a4c5f..bde6edd53e1 100644 --- a/src/emu/cpu/sc61860/scops.inc +++ b/src/emu/cpu/sc61860/scops.inc @@ -8,18 +8,6 @@ * * Copyright Peter Trauner, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * peter.trauner@jk.uni-linz.ac.at - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * History of changes: * 21.07.2001 Several changes listed below were made by Mario Konegger * (konegger@itp.tu-graz.ac.at) diff --git a/src/emu/cpu/scudsp/scudsp.c b/src/emu/cpu/scudsp/scudsp.c index 887c94cec1b..14d1565caa2 100644 --- a/src/emu/cpu/scudsp/scudsp.c +++ b/src/emu/cpu/scudsp/scudsp.c @@ -7,17 +7,6 @@ * * copyright Angelo Salese & Mariusz Wojcieszek, all rights reserved * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * lordkale@libero.it or - * - This entire notice must remain in the source code. - * - * * Changelog: * 131010: Angelo Salese * - Converted to CPU structure diff --git a/src/mess/video/pc1403.c b/src/mess/video/pc1403.c index ebb3f0b68f3..0eb722c0319 100644 --- a/src/mess/video/pc1403.c +++ b/src/mess/video/pc1403.c @@ -8,18 +8,6 @@ * * Copyright (c) 2001 Peter Trauner, all rights reserved. * - * - This source code is released as freeware for non-commercial purposes. - * - You are free to use and redistribute this code in modified or - * unmodified form, provided you list me in the credits. - * - If you modify this source code, you must add a notice to each modified - * source file that it has been changed. If you're a nice person, you - * will clearly mark each change too. :) - * - If you wish to use this for commercial purposes, please contact me at - * peter.trauner@jk.uni-linz.ac.at - * - The author of this copywritten work reserves the right to change the - * terms of its usage and license at any time, including retroactively - * - This entire notice must remain in the source code. - * * History of changes: * 21.07.2001 Several changes listed below were made by Mario Konegger * (konegger@itp.tu-graz.ac.at) From 359be6fcf06f80fb1196f30a7f072c9c9ded1cfb Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 30 May 2015 10:33:37 +0200 Subject: [PATCH 020/284] fix windows build (nw) --- scripts/toolchain.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index d86c3d53f8f..91d1f29884e 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -199,8 +199,7 @@ function toolchain(_buildDir, _subDir) end premake.gcc.cc = "$(MINGW64)/bin/x86_64-w64-mingw32-gcc" premake.gcc.cxx = "$(MINGW64)/bin/x86_64-w64-mingw32-g++" --- premake.gcc.ar = "$(MINGW64)/bin/ar" - premake.gcc.ar = "$(MINGW64)/bin/gcc-ar" + premake.gcc.ar = "$(MINGW64)/bin/ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-mingw64-gcc") end From bafa89c8a8e50de936d8045291f996967362c944 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Sat, 30 May 2015 05:03:29 -0400 Subject: [PATCH 021/284] Fix the damage (nw) --- src/emu/sound/fmopl.c | 14 +++++++------- src/emu/sound/ym2413.c | 14 +++++++------- src/emu/sound/ymf262.c | 14 +++++++------- src/mess/drivers/atarist.c | 2 +- src/mess/drivers/nascom1.c | 18 ++++++++---------- src/mess/includes/atarist.h | 5 ++--- 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/emu/sound/fmopl.c b/src/emu/sound/fmopl.c index a681de4744c..4932cde31fa 100644 --- a/src/emu/sound/fmopl.c +++ b/src/emu/sound/fmopl.c @@ -344,7 +344,7 @@ static const int slot_array[32]= /* table is 3dB/octave , DV converts this into 6dB/octave */ /* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */ #define DV (0.1875/2.0) -static const double ksl_tab[8*16]= +static const UINT32 ksl_tab[8*16]= { /* OCT 0 */ 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, @@ -511,10 +511,10 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), /* multiple table */ #define ML 2 -static const double mul_tab[16]= { +static const UINT8 mul_tab[16]= { /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ - 0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML, - 8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML + ML/2, 1*ML, 2*ML, 3*ML, 4*ML, 5*ML, 6*ML, 7*ML, + 8*ML, 9*ML,10*ML,10*ML,12*ML,12*ML,15*ML,15*ML }; #undef ML @@ -1299,7 +1299,7 @@ static void OPL_initalize(FM_OPL *OPL) logerror("FMOPL.C: ksl_tab[oct=%2i] =",i); for (j=0; j<16; j++) { - logerror("%08x ", (UINT32) ksl_tab[i*16+j] ); + logerror("%08x ", ksl_tab[i*16+j] ); } logerror("\n"); } @@ -1388,7 +1388,7 @@ INLINE void set_mul(FM_OPL *OPL,int slot,int v) OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; - SLOT->mul = (UINT8)mul_tab[v&0x0f]; + SLOT->mul = mul_tab[v&0x0f]; SLOT->KSR = (v&0x10) ? 0 : 2; SLOT->eg_type = (v&0x20); SLOT->vib = (v&0x40); @@ -1674,7 +1674,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v) CH->block_fnum = block_fnum; - CH->ksl_base = (UINT32) ksl_tab[block_fnum>>6]; + CH->ksl_base = ksl_tab[block_fnum>>6]; CH->fc = OPL->fn_tab[block_fnum&0x03ff] >> (7-block); /* BLK 2,1,0 bits -> bits 3,2,1 of kcode */ diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c index 94d039bae9d..631560912b0 100644 --- a/src/emu/sound/ym2413.c +++ b/src/emu/sound/ym2413.c @@ -280,7 +280,7 @@ struct YM2413 /* table is 3dB/octave, DV converts this into 6dB/octave */ /* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */ #define DV (0.1875/1.0) -static const double ksl_tab[8*16]= +static const UINT32 ksl_tab[8*16]= { /* OCT 0 */ 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, @@ -447,10 +447,10 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), /* multiple table */ #define ML 2 -static const double mul_tab[16]= { +static const UINT8 mul_tab[16]= { /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ - 0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML, - 8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML + ML/2, 1*ML, 2*ML, 3*ML, 4*ML, 5*ML, 6*ML, 7*ML, + 8*ML, 9*ML,10*ML,10*ML,12*ML,12*ML,15*ML,15*ML }; #undef ML @@ -1367,7 +1367,7 @@ static void OPLL_initalize(YM2413 *chip, device_t *device) logerror("ym2413.c: ksl_tab[oct=%2i] =",i); for (j=0; j<16; j++) { - logerror("%08x ", (UINT32)ksl_tab[i*16+j] ); + logerror("%08x ", ksl_tab[i*16+j] ); } logerror("\n"); } @@ -1470,7 +1470,7 @@ INLINE void set_mul(YM2413 *chip,int slot,int v) OPLL_CH *CH = &chip->P_CH[slot/2]; OPLL_SLOT *SLOT = &CH->SLOT[slot&1]; - SLOT->mul = (UINT8)mul_tab[v&0x0f]; + SLOT->mul = mul_tab[v&0x0f]; SLOT->KSR = (v&0x10) ? 0 : 2; SLOT->eg_type = (v&0x20); SLOT->vib = (v&0x40); @@ -1839,7 +1839,7 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v) /* BLK 2,1,0 bits -> bits 3,2,1 of kcode, FNUM MSB -> kcode LSB */ CH->kcode = (block_fnum&0x0f00)>>8; - CH->ksl_base = (UINT32) ksl_tab[block_fnum>>5]; + CH->ksl_base = ksl_tab[block_fnum>>5]; block_fnum = block_fnum * 2; block = (block_fnum&0x1c00) >> 10; diff --git a/src/emu/sound/ymf262.c b/src/emu/sound/ymf262.c index 0f04a97eee1..0982ae266e8 100644 --- a/src/emu/sound/ymf262.c +++ b/src/emu/sound/ymf262.c @@ -297,7 +297,7 @@ static const int slot_array[32]= /* table is 3dB/octave , DV converts this into 6dB/octave */ /* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */ #define DV (0.1875/2.0) -static const double ksl_tab[8*16]= +static const UINT32 ksl_tab[8*16]= { /* OCT 0 */ 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV, @@ -464,10 +464,10 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), /* multiple table */ #define ML 2 -static const double mul_tab[16]= { +static const UINT8 mul_tab[16]= { /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ - 0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML, - 8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML + ML/2, 1*ML, 2*ML, 3*ML, 4*ML, 5*ML, 6*ML, 7*ML, + 8*ML, 9*ML,10*ML,10*ML,12*ML,12*ML,15*ML,15*ML }; #undef ML @@ -1345,7 +1345,7 @@ static void OPL3_initalize(OPL3 *chip) logerror("YMF262.C: ksl_tab[oct=%2i] =",i); for (j=0; j<16; j++) { - logerror("%08x ", (UINT32) ksl_tab[i*16+j] ); + logerror("%08x ", ksl_tab[i*16+j] ); } logerror("\n"); } @@ -1438,7 +1438,7 @@ INLINE void set_mul(OPL3 *chip,int slot,int v) OPL3_CH *CH = &chip->P_CH[slot/2]; OPL3_SLOT *SLOT = &CH->SLOT[slot&1]; - SLOT->mul = (UINT8)mul_tab[v&0x0f]; + SLOT->mul = mul_tab[v&0x0f]; SLOT->KSR = (v&0x10) ? 0 : 2; SLOT->eg_type = (v&0x20); SLOT->vib = (v&0x40); @@ -1959,7 +1959,7 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) CH->block_fnum = block_fnum; - CH->ksl_base = (UINT32) ksl_tab[block_fnum>>6]; + CH->ksl_base = ksl_tab[block_fnum>>6]; CH->fc = chip->fn_tab[block_fnum&0x03ff] >> (7-block); /* BLK 2,1,0 bits -> bits 3,2,1 of kcode */ diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c index 024d82626ab..46ad6a90e95 100644 --- a/src/mess/drivers/atarist.c +++ b/src/mess/drivers/atarist.c @@ -1625,7 +1625,7 @@ static INPUT_PORTS_START( ste ) PORT_CONFNAME( 0x01, 0x00, "Input Port 0 Device") PORT_CONFSETTING( 0x00, "Mouse" ) PORT_CONFSETTING( 0x01, DEF_STR( Joystick ) ) - PORT_CONFNAME( 0x80, 0x80, "Monitor") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, st_state, write_monochrome) + PORT_CONFNAME( 0x80, 0x80, "Monitor") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, ste_state, write_monochrome) PORT_CONFSETTING( 0x00, "Monochrome (Atari SM124)" ) PORT_CONFSETTING( 0x80, "Color (Atari SC1435)" ) diff --git a/src/mess/drivers/nascom1.c b/src/mess/drivers/nascom1.c index ac1bde10eb7..948919fdab6 100644 --- a/src/mess/drivers/nascom1.c +++ b/src/mess/drivers/nascom1.c @@ -72,8 +72,7 @@ public: DECLARE_READ8_MEMBER(nascom1_port_01_r); DECLARE_WRITE8_MEMBER(nascom1_port_01_w); DECLARE_READ8_MEMBER(nascom1_port_02_r); - // FIXME - /*virtual*/ DECLARE_DRIVER_INIT(nascom); + DECLARE_DRIVER_INIT(nascom); void screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect, int char_height); DECLARE_READ8_MEMBER(nascom1_hd6402_si); DECLARE_WRITE8_MEMBER(nascom1_hd6402_so); @@ -113,9 +112,8 @@ public: DECLARE_WRITE_LINE_MEMBER(ram_disable_w); DECLARE_WRITE_LINE_MEMBER(ram_disable_cpm_w); - // FIXME - /*virtual*/ DECLARE_DRIVER_INIT(nascom); - /*virtual*/ DECLARE_DRIVER_INIT(nascomc); + DECLARE_DRIVER_INIT(nascom2); + DECLARE_DRIVER_INIT(nascom2c); UINT32 screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); int load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id); @@ -352,9 +350,9 @@ void nascom2_state::machine_reset() m_maincpu->set_state_int(Z80_PC, m_lsw1->read() << 12); } -DRIVER_INIT_MEMBER( nascom2_state, nascom ) +DRIVER_INIT_MEMBER( nascom2_state, nascom2 ) { - nascom_state::init_nascom(); + DRIVER_INIT_CALL(nascom); // setup nasbus m_nasbus->set_program_space(&m_maincpu->space(AS_PROGRAM)); @@ -372,7 +370,7 @@ WRITE_LINE_MEMBER( nascom2_state::ram_disable_w ) } } -DRIVER_INIT_MEMBER( nascom2_state, nascomc ) +DRIVER_INIT_MEMBER( nascom2_state, nascom2c ) { // install memory m_maincpu->space(AS_PROGRAM).install_ram(0x0000, 0x0000 + m_ram->size() - 1, m_ram->pointer()); @@ -774,5 +772,5 @@ ROM_END // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ COMP( 1977, nascom1, 0, 0, nascom1, nascom1, nascom_state, nascom, "Nascom Microcomputers", "Nascom 1", GAME_NO_SOUND_HW ) -COMP( 1979, nascom2, 0, 0, nascom2, nascom2, nascom2_state, nascom, "Nascom Microcomputers", "Nascom 2", GAME_NO_SOUND_HW ) -COMP( 1980, nascom2c, nascom2, 0, nascom2c, nascom2c, nascom2_state, nascomc, "Nascom Microcomputers", "Nascom 2 (CP/M)", GAME_NO_SOUND_HW ) +COMP( 1979, nascom2, 0, 0, nascom2, nascom2, nascom2_state, nascom2, "Nascom Microcomputers", "Nascom 2", GAME_NO_SOUND_HW ) +COMP( 1980, nascom2c, nascom2, 0, nascom2c, nascom2c, nascom2_state, nascom2c, "Nascom Microcomputers", "Nascom 2 (CP/M)", GAME_NO_SOUND_HW ) diff --git a/src/mess/includes/atarist.h b/src/mess/includes/atarist.h index d9b3d8be175..2e153b4a59a 100644 --- a/src/mess/includes/atarist.h +++ b/src/mess/includes/atarist.h @@ -332,8 +332,7 @@ public: int m_monochrome; required_device m_palette; - // make GCC 5.1 happy.. FIXME - /*virtual*/ DECLARE_WRITE_LINE_MEMBER( write_monochrome ); + DECLARE_WRITE_LINE_MEMBER( write_monochrome ); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); @@ -395,7 +394,7 @@ public: DECLARE_WRITE16_MEMBER( microwire_mask_w ); DECLARE_READ8_MEMBER( mfp_gpio_r ); - virtual DECLARE_WRITE_LINE_MEMBER( write_monochrome ); + DECLARE_WRITE_LINE_MEMBER( write_monochrome ); void dmasound_set_state(int level); void dmasound_tick(); From 51709eef04f9f0c6d621447c568e170927fa9472 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sat, 30 May 2015 11:09:26 +0200 Subject: [PATCH 022/284] wd_fdc: clear head load after 3 disk revolutions, fixes z80netf format command --- src/emu/machine/wd_fdc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index 38b3d2f313b..6263cd95026 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -1232,6 +1232,10 @@ void wd_fdc_t::spinup() void wd_fdc_t::ready_callback(floppy_image_device *floppy, int state) { + // why is this even possible? + if (!floppy) + return; + live_sync(); if(!ready_hooked) return; @@ -1260,13 +1264,24 @@ void wd_fdc_t::index_callback(floppy_image_device *floppy, int state) switch(sub_state) { case IDLE: - if(motor_control) { + if(motor_control || head_control) { motor_timeout ++; - if(motor_timeout >= 5) { + if(motor_control && motor_timeout >= 5) { status &= ~S_MON; if(floppy) floppy->mon_w(1); } + + if (head_control && motor_timeout >= 3) + { + hld = false; + + // signal drive to unload head + if (!hld_cb.isnull()) + hld_cb(hld); + + status &= ~S_HLD; // todo: should get this value from the drive + } } break; From 0afa6824566f59fc4d534060b8e81315cab840bf Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sat, 30 May 2015 15:07:48 +0200 Subject: [PATCH 023/284] dgnalpha: updated to use the new wd fdc --- scripts/src/lib.lua | 2 + src/lib/formats/vdk_dsk.c | 158 +++++++++++++++++++++++++++++++++++ src/lib/formats/vdk_dsk.h | 39 +++++++++ src/mess/drivers/dragon.c | 34 +++++--- src/mess/includes/dgnalpha.h | 17 +++- src/mess/machine/dgnalpha.c | 39 ++++----- 6 files changed, 255 insertions(+), 34 deletions(-) create mode 100644 src/lib/formats/vdk_dsk.c create mode 100644 src/lib/formats/vdk_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 166ab4beddb..f7e2a2cba0a 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -373,6 +373,8 @@ project "formats" MAME_DIR .. "src/lib/formats/uef_cas.h", MAME_DIR .. "src/lib/formats/upd765_dsk.c", MAME_DIR .. "src/lib/formats/upd765_dsk.h", + MAME_DIR .. "src/lib/formats/vdk_dsk.c", + MAME_DIR .. "src/lib/formats/vdk_dsk.h", MAME_DIR .. "src/lib/formats/victor9k_dsk.c", MAME_DIR .. "src/lib/formats/victor9k_dsk.h", MAME_DIR .. "src/lib/formats/vg5k_cas.c", diff --git a/src/lib/formats/vdk_dsk.c b/src/lib/formats/vdk_dsk.c new file mode 100644 index 00000000000..325adab4d67 --- /dev/null +++ b/src/lib/formats/vdk_dsk.c @@ -0,0 +1,158 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + VDK + + Disk image format + + Used by Paul Burgin's PC-Dragon emulator + +***************************************************************************/ + +#include "emu.h" +#include "vdk_dsk.h" + +vdk_format::vdk_format() : wd177x_format(NULL) +{ + m_format.form_factor = floppy_image::FF_525; + m_format.encoding = floppy_image::MFM; + m_format.cell_size = 2000; + m_format.sector_count = 18; +// m_format.track_count = 40/80 +// m_format.head_count = 1/2 + m_format.sector_base_size = 256; + m_format.sector_base_id = 1; + m_format.gap_1 = 32; + m_format.gap_2 = 24; + m_format.gap_3 = 22; +} + +const char *vdk_format::name() const +{ + return "vdk"; +} + +const char *vdk_format::description() const +{ + return "VDK disk image"; +} + +const char *vdk_format::extensions() const +{ + return "vdk"; +} + +int vdk_format::identify(io_generic *io, UINT32 form_factor) +{ + UINT8 id[2]; + io_generic_read(io, id, 0, 2); + + if (id[0] == 'd' && id[1] == 'k') + return 50; + else + return 0; +} + +bool vdk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +{ + UINT8 header[0x100]; + io_generic_read(io, header, 0, 100); + int header_size = header[3] * 0x100 + header[2]; + + m_format.track_count = header[8]; + m_format.head_count = header[9]; + + switch (m_format.head_count) + { + case 1: m_format.variant = floppy_image::SSDD; break; + case 2: m_format.variant = floppy_image::DSDD; break; + default: return false; + } + + floppy_image_format_t::desc_e *desc; + int current_size; + int end_gap_index; + + desc = get_desc_mfm(m_format, current_size, end_gap_index); + + int total_size = 200000000 / m_format.cell_size; + int remaining_size = total_size - current_size; + if (remaining_size < 0) + throw emu_fatalerror("vdk_format: Incorrect track layout, max_size=%d, current_size=%d", total_size, current_size); + + // fixup the end gap + desc[end_gap_index].p2 = remaining_size / 16; + desc[end_gap_index + 1].p2 = remaining_size & 15; + desc[end_gap_index + 1].p1 >>= 16 - (remaining_size & 15); + + int track_size = compute_track_size(m_format); + + UINT8 sectdata[40*512]; + desc_s sectors[40]; + build_sector_description(m_format, sectdata, sectors); + + for(int track=0; track < m_format.track_count; track++) + for(int head=0; head < m_format.head_count; head++) { + io_generic_read(io, sectdata, header_size + get_image_offset(m_format, head, track), track_size); + generate_track(desc, track, head, sectors, m_format.sector_count, total_size, image); + } + + image->set_variant(m_format.variant); + + return true; +} + +bool vdk_format::save(io_generic *io, floppy_image *image) +{ + int tracks, heads; + image->get_actual_geometry(tracks, heads); + + m_format.track_count = tracks; + m_format.head_count = heads; + + switch (m_format.head_count) + { + case 1: m_format.variant = floppy_image::SSDD; break; + case 2: m_format.variant = floppy_image::DSDD; break; + default: return false; + } + + // write header + UINT8 header[12]; + + header[0] = 'd'; + header[1] = 'k'; + header[2] = sizeof(header) % 0x100; + header[3] = sizeof(header) / 0x100; + header[4] = 0x10; + header[5] = 0x10; + header[6] = 'M'; + header[7] = 0x01; + header[8] = tracks; + header[9] = heads; + header[10] = 0; + header[11] = 0; + + io_generic_write(io, header, 0, sizeof(header)); + + // write disk data + int track_size = compute_track_size(m_format); + + UINT8 sectdata[40*512]; + desc_s sectors[40]; + build_sector_description(m_format, sectdata, sectors); + + for (int track = 0; track < m_format.track_count; track++) + { + for (int head = 0; head < m_format.head_count; head++) + { + extract_sectors(image, m_format, sectors, track, head); + io_generic_write(io, sectdata, sizeof(header) + get_image_offset(m_format, head, track), track_size); + } + } + + return true; +} + +const floppy_format_type FLOPPY_VDK_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/vdk_dsk.h b/src/lib/formats/vdk_dsk.h new file mode 100644 index 00000000000..be05865ce2a --- /dev/null +++ b/src/lib/formats/vdk_dsk.h @@ -0,0 +1,39 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + VDK + + Disk image format + + Used by Paul Burgin's PC-Dragon emulator + +***************************************************************************/ + +#pragma once + +#ifndef __VDK_DSK_H__ +#define __VDK_DSK_H__ + +#include "wd177x_dsk.h" + +class vdk_format : public wd177x_format +{ +public: + vdk_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + + virtual int identify(io_generic *io, UINT32 form_factor); + virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); + virtual bool save(io_generic *io, floppy_image *image); + +private: + format m_format; +}; + +extern const floppy_format_type FLOPPY_VDK_FORMAT; + +#endif // __VDK_DSK_H__ diff --git a/src/mess/drivers/dragon.c b/src/mess/drivers/dragon.c index 3a95025fd49..2b22531f63c 100644 --- a/src/mess/drivers/dragon.c +++ b/src/mess/drivers/dragon.c @@ -18,7 +18,8 @@ #include "bus/coco/coco_pak.h" #include "bus/coco/coco_fdc.h" #include "bus/coco/coco_multi.h" -#include "formats/coco_dsk.h" +#include "formats/vdk_dsk.h" +#include "formats/dmk_dsk.h" #include "imagedev/flopdrv.h" @@ -125,12 +126,19 @@ static SLOT_INTERFACE_START(dragon_cart) SLOT_INTERFACE("pak", COCO_PAK) SLOT_INTERFACE_END -static const floppy_interface coco_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(coco), - NULL -}; +FLOPPY_FORMATS_MEMBER( dragon_alpha_state::dragon_formats ) + FLOPPY_VDK_FORMAT, + FLOPPY_DMK_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( dragon_floppies ) + SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) + SLOT_INTERFACE("sd", FLOPPY_525_SD) + SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD) + SLOT_INTERFACE("dd", FLOPPY_525_DD) + SLOT_INTERFACE("ssqd", FLOPPY_525_SSQD) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END static MACHINE_CONFIG_START( dragon_base, dragon_state ) // basic machine hardware @@ -237,12 +245,14 @@ static MACHINE_CONFIG_DERIVED_CLASS( dgnalpha, dragon_base, dragon_alpha_state ) MCFG_MOS6551_XTAL(XTAL_1_8432MHz) // floppy - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface) + MCFG_WD2797x_ADD(WD2797_TAG, XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_drq_w)) - MCFG_DEVICE_ADD(WD2797_TAG, WD2797, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_drq_w)) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", dragon_floppies, "qd", dragon_alpha_state::dragon_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", dragon_floppies, "qd", dragon_alpha_state::dragon_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":2", dragon_floppies, "qd", dragon_alpha_state::dragon_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":3", dragon_floppies, "qd", dragon_alpha_state::dragon_formats) // sound hardware MCFG_SOUND_ADD(AY8912_TAG, AY8912, 1000000) diff --git a/src/mess/includes/dgnalpha.h b/src/mess/includes/dgnalpha.h index 50ed8a19885..402de4f846f 100644 --- a/src/mess/includes/dgnalpha.h +++ b/src/mess/includes/dgnalpha.h @@ -16,7 +16,7 @@ #include "includes/dragon.h" #include "sound/ay8910.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" @@ -42,13 +42,24 @@ public: : dragon64_state(mconfig, type, tag), m_pia_2(*this, PIA2_TAG), m_ay8912(*this, AY8912_TAG), - m_fdc(*this, WD2797_TAG) + m_fdc(*this, WD2797_TAG), + m_floppy0(*this, WD2797_TAG ":0"), + m_floppy1(*this, WD2797_TAG ":1"), + m_floppy2(*this, WD2797_TAG ":2"), + m_floppy3(*this, WD2797_TAG ":3") { } + DECLARE_FLOPPY_FORMATS(dragon_formats); + required_device m_pia_2; required_device m_ay8912; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; + /* pia2 */ DECLARE_WRITE8_MEMBER( pia2_pa_w ); diff --git a/src/mess/machine/dgnalpha.c b/src/mess/machine/dgnalpha.c index 4fe71930528..a146e1e3aae 100644 --- a/src/mess/machine/dgnalpha.c +++ b/src/mess/machine/dgnalpha.c @@ -161,6 +161,7 @@ READ8_MEMBER( dragon_alpha_state::ff20_read ) result = m_fdc->status_r(space, 0); break; } + return result; } @@ -196,10 +197,7 @@ WRITE8_MEMBER( dragon_alpha_state::ff20_write ) m_fdc->track_w(space, 0, data); break; case 15: - m_fdc->command_w(space, 0, data); - - /* disk head is encoded in the command byte */ - m_fdc->set_side((data & 0x02) ? 1 : 0); + m_fdc->cmd_w(space, 0, data); break; } } @@ -316,21 +314,24 @@ WRITE8_MEMBER( dragon_alpha_state::psg_porta_write ) /* Bits 0..3 are the drive select lines for the internal floppy interface */ /* Bit 4 is the motor on, in the real hardware these are inverted on their way to the drive */ /* Bits 5,6,7 are connected to /DDEN, ENP and 5/8 on the WD2797 */ - switch (data & 0xF) - { - case(0x01) : - m_fdc->set_drive(0); - break; - case(0x02) : - m_fdc->set_drive(1); - break; - case(0x04) : - m_fdc->set_drive(2); - break; - case(0x08) : - m_fdc->set_drive(3); - break; - } + + floppy_image_device *floppy = NULL; + + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); + if (BIT(data, 2)) floppy = m_floppy2->get_device(); + if (BIT(data, 3)) floppy = m_floppy3->get_device(); + + m_fdc->set_floppy(floppy); + + // todo: turning the motor on with bit 4 isn't giving the drive enough + // time to spin up, how does it work in hardware? + if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(0); + if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(0); + if (m_floppy2->get_device()) m_floppy2->get_device()->mon_w(0); + if (m_floppy3->get_device()) m_floppy3->get_device()->mon_w(0); + + m_fdc->dden_w(BIT(data, 5)); } /*************************************************************************** From 99855c456f44b989ec12b48da108ef03c217dd09 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Sat, 30 May 2015 18:16:17 +0300 Subject: [PATCH 024/284] wd_fdc: fixes to get BetaDisk work without patches --- src/emu/machine/wd_fdc.c | 5 ++++- src/mess/drivers/scorpion.c | 2 -- src/mess/machine/beta.c | 7 +------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index 6263cd95026..4e922aab398 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -747,6 +747,7 @@ void wd_fdc_t::write_track_continue() if (TRACE_STATE) logerror("%s: DATA_LOAD_WAIT_DONE\n", tag()); if(drq) { status |= S_LOST; + drop_drq(); command_end(); return; } @@ -904,11 +905,13 @@ void wd_fdc_t::interrupt_start() if(!(command & 0x0f)) { intrq_cond = 0; + } else if ((command & 0x0f) > 8) { // assume I_IMM is set only if condition equal to 8 but not more than, Spectrum's BetaDisk require this + intrq_cond = 0; } else { intrq_cond = (intrq_cond & I_IMM) | (command & 0x0f); } - if(intrq_cond & I_IMM) { + if(command & I_IMM) { intrq = true; if(!intrq_cb.isnull()) intrq_cb(intrq); diff --git a/src/mess/drivers/scorpion.c b/src/mess/drivers/scorpion.c index 80385da7774..de840193ade 100644 --- a/src/mess/drivers/scorpion.c +++ b/src/mess/drivers/scorpion.c @@ -322,8 +322,6 @@ ROM_START(scorpio) ROMX_LOAD("scorp2.rom", 0x018000, 0x4000, CRC(fd0d3ce1) SHA1(07783ee295274d8ff15d935bfd787c8ac1d54900), ROM_BIOS(7)) ROMX_LOAD("scorp3.rom", 0x01c000, 0x4000, CRC(1fe1d003) SHA1(33703e97cc93b7edfcc0334b64233cf81b7930db), ROM_BIOS(7)) - ROM_FILL( 0x1fe47, 1, 0x3e) // patch TR-DOS bug - ROM_REGION(0x01000, "keyboard", 0) ROM_LOAD( "scrpkey.rom", 0x0000, 0x1000, CRC(e938a510) SHA1(2753993c97ff0fc6cff26ed792929abc1288dc6f)) diff --git a/src/mess/machine/beta.c b/src/mess/machine/beta.c index ff7187ba3e3..32d4ba445ea 100644 --- a/src/mess/machine/beta.c +++ b/src/mess/machine/beta.c @@ -11,7 +11,7 @@ *********************************************************************/ /* BUGS: -- due to original firmware bug random commands can be sent to FDC instead of SEEK, current WD FDC emulation cant handle this correctly, use patch fix for now +- due to original firmware bug random commands can be sent to FDC instead of SEEK */ #include "emu.h" @@ -268,11 +268,6 @@ ROM_START( beta_disk ) //Default for now ROM_LOAD( "trd503.rom", 0x00000, 0x4000, CRC(10751aba) SHA1(21695e3f2a8f796386ce66eea8a246b0ac44810c)) - - // TR-DOS rom have a bug - semi-random commands sent to FDC instead of SEEK command sometimes - // however it works OK on real hardware but does not using our WD FDC emulation, both legacy and modern - // this patch fixes original bug - ROM_FILL( 0x3e47, 1, 0x3e) ROM_END From 50bd352f0b077340535e867e5e338c272f9466d9 Mon Sep 17 00:00:00 2001 From: system11b Date: Sat, 30 May 2015 21:30:57 +0100 Subject: [PATCH 025/284] Added 1998 copyright Fantasia 2 version, single ROM difference taken from board with 961210 model number same as the others. --- src/mame/arcade.lst | 1 + src/mame/drivers/expro02.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 69d5bb2111d..c46f8f1468e 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -9368,6 +9368,7 @@ missmw96 // (c) 1996 Comad smissw // fantsia2 // (c) 1997 Comad fantsia2a // (c) 1997 Comad +fantsia2n // (c) 1998 Comad wownfant // (c) 2002 Comad pgalvip // (c) 1996 ACE International (Afega stickers on ROMs) pgalvipa // diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c index cd4c5e9b617..0fb97421ae6 100644 --- a/src/mame/drivers/expro02.c +++ b/src/mame/drivers/expro02.c @@ -15,6 +15,7 @@ Miss World '96 1996 Comad Ms/Mr World '96 1996 Comad Fantasia II 1997 Comad + Fantasia II 1998 Comad The following seem similar but could have other changes @@ -1619,6 +1620,31 @@ ROM_START( fantsia2a ) ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) ROM_END +/* sole change seems to be copyright date, PCB has chip references instead of grid references. Not correcting all labels in other sets in case these are legitimate labels */ +ROM_START( fantsia2n ) + ROM_REGION( 0x500000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "prog2.g17", 0x000000, 0x80000, CRC(57c59972) SHA1(4b1da928b537cf340a67026d07bc3dfc078b0d0f) ) + ROM_LOAD16_BYTE( "prog1.f17", 0x000001, 0x80000, CRC(bf2d9a26) SHA1(92f0c1bd32f1e5e0ede3ba847242a212dfae4986) ) + ROM_LOAD16_BYTE( "scr2.g16", 0x100000, 0x80000, CRC(887b1bc5) SHA1(b6fcdc8a56ea25758f363224d256e9b6c8e30244) ) + ROM_LOAD16_BYTE( "scr1.f16", 0x100001, 0x80000, CRC(cbba3182) SHA1(a484819940fa1ef18ce679465c31075798748bac) ) + ROM_LOAD16_BYTE( "scr4.g15", 0x200000, 0x80000, CRC(ce97e411) SHA1(be0ed41362db03f384229c708f2ba4146e5cb501) ) + ROM_LOAD16_BYTE( "scr3.f15", 0x200001, 0x80000, CRC(480cc2e8) SHA1(38fe57ba1e34537f8be65fcc023ccd43369a5d94) ) + ROM_LOAD16_BYTE( "scr6.g14", 0x300000, 0x80000, CRC(b29d49de) SHA1(854b76755acf58fb8a4648a0ce72ea6bdf26c555) ) + ROM_LOAD16_BYTE( "scr5.f14", 0x300001, 0x80000, CRC(d5f88b83) SHA1(518a1f6732149f2851bbedca61f7313c39beb91b) ) + ROM_LOAD16_BYTE( "scr8.g20", 0x400000, 0x80000, CRC(694ae2b3) SHA1(82b7a565290fce07c8393af4718fd1e6136928e9) ) + ROM_LOAD16_BYTE( "scr7.f20", 0x400001, 0x80000, CRC(6068712c) SHA1(80a136d76dca566772e34d832ac11b8c7d6ce9ab) ) + + ROM_REGION( 0x100000, "gfx1", 0 ) /* sprites */ + ROM_LOAD( "23_OBJ1.U5", 0x00000, 0x80000, CRC(b45c9234) SHA1(b5eeec91b9c6952b338130458405997e1a51bf2f) ) + ROM_LOAD( "obj2.2i", 0x80000, 0x80000, CRC(ea6e3861) SHA1(463b40f5441231a0451571a0b8afe1ed0fd4b164) ) + + ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ + ROM_LOAD( "music2.1b", 0x00000, 0x80000, CRC(23cc4f9c) SHA1(06b5342c25de966ce590917c571e5b19af1fef7d) ) + ROM_RELOAD( 0x40000, 0x80000 ) + ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) +ROM_END + ROM_START( wownfant) ROM_REGION( 0x500000, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "ep-4001 42750001 u81.bin", 0x000000, 0x80000, CRC(9942d200) SHA1(d2f69c0949881ef4aef202b564eac069c030a497) ) @@ -1831,6 +1857,7 @@ GAME( 1996, smissw, 0, smissw, missw96, driver_device, 0, ROT0, "C GAME( 1997, fantsia2, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Explicit)", GAME_NO_COCKTAIL ) GAME( 1997, fantsia2a,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Less Explicit)", GAME_NO_COCKTAIL ) +GAME( 1998, fantsia2n,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (1998)", GAME_NO_COCKTAIL ) GAME( 2002, wownfant, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "WOW New Fantasia", GAME_NO_COCKTAIL ) From 1e170b1336c6e21b953fbdb81ddc8614541b680b Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 30 May 2015 22:51:54 +0200 Subject: [PATCH 026/284] added branch/call/return opcodes --- src/emu/cpu/melps4/m58846.c | 2 +- src/emu/cpu/melps4/melps4.c | 32 +++++++++++++++-- src/emu/cpu/melps4/melps4.h | 16 ++++++--- src/emu/cpu/melps4/melps4op.inc | 64 +++++++++++++++++++++++++++------ 4 files changed, 96 insertions(+), 18 deletions(-) diff --git a/src/emu/cpu/melps4/m58846.c b/src/emu/cpu/melps4/m58846.c index e4842d28a6a..bcc50e06ca3 100644 --- a/src/emu/cpu/melps4/m58846.c +++ b/src/emu/cpu/melps4/m58846.c @@ -52,7 +52,7 @@ void m58846_device::device_start() melps4_cpu_device::device_start(); // set fixed state - m_bm_page = 2; + m_sm_page = 2; m_int_page = 1; } diff --git a/src/emu/cpu/melps4/melps4.c b/src/emu/cpu/melps4/melps4.c index b9172f7745d..342147892b3 100644 --- a/src/emu/cpu/melps4/melps4.c +++ b/src/emu/cpu/melps4/melps4.c @@ -44,9 +44,10 @@ void melps4_cpu_device::state_string_export(const device_state_entry &entry, std { // obviously not from a single flags register, letters are made up case STATE_GENFLAGS: - strprintf(str, "%c%c%c%c", + strprintf(str, "%c%c%c%c%c", m_intp ? 'P':'p', m_inte ? 'I':'i', + m_sm ? 'S':'s', m_cps ? 'D':'d', m_cy ? 'C':'c' ); @@ -83,10 +84,14 @@ void melps4_cpu_device::device_start() m_prev_op = 0; m_bitmask = 0; + m_sm = m_sms = false; + m_ba_flag = false; + m_sp_param = 0; m_cps = 0; m_skip = false; m_inte = 0; m_intp = 1; + m_prohibit_irq = false; m_a = 0; m_b = 0; @@ -110,10 +115,15 @@ void melps4_cpu_device::device_start() save_item(NAME(m_prev_op)); save_item(NAME(m_bitmask)); + save_item(NAME(m_sm)); + save_item(NAME(m_sms)); + save_item(NAME(m_ba_flag)); + save_item(NAME(m_sp_param)); save_item(NAME(m_cps)); save_item(NAME(m_skip)); save_item(NAME(m_inte)); save_item(NAME(m_intp)); + save_item(NAME(m_prohibit_irq)); save_item(NAME(m_a)); save_item(NAME(m_b)); @@ -131,7 +141,7 @@ void melps4_cpu_device::device_start() // register state for debugger state_add(STATE_GENPC, "curpc", m_pc).formatstr("%04X").noshow(); - state_add(STATE_GENFLAGS, "GENFLAGS", m_cy).formatstr("%4s").noshow(); + state_add(STATE_GENFLAGS, "GENFLAGS", m_cy).formatstr("%5s").noshow(); state_add(MELPS4_PC, "PC", m_pc).formatstr("%04X"); state_add(MELPS4_A, "A", m_a).formatstr("%2d"); // show in decimal @@ -158,6 +168,11 @@ void melps4_cpu_device::device_start() void melps4_cpu_device::device_reset() { + m_sm = m_sms = false; + m_ba_flag = false; + m_prohibit_irq = false; + + m_skip = false; m_op = m_prev_op = 0; m_pc = m_prev_pc = 0; m_inte = 0; @@ -192,6 +207,10 @@ void melps4_cpu_device::execute_run() // remember previous state m_prev_op = m_op; m_prev_pc = m_pc; + + // irq is not accepted during skip or LXY, LA, EI, DI, RT/RTS/RTI or any branch + //.. + m_prohibit_irq = false; // fetch next opcode debugger_instruction_hook(this, m_pc); @@ -201,6 +220,13 @@ void melps4_cpu_device::execute_run() m_pc = (m_pc & ~0x7f) | ((m_pc + 1) & 0x7f); // stays in the same page // handle opcode if it's not skipped - execute_one(); + if (m_skip) + { + // if it's a long jump, skip next one as well + if (m_op != m_ba_op && (m_op & ~0xf) != m_sp_mask) + m_skip = false; + } + else + execute_one(); } } diff --git a/src/emu/cpu/melps4/melps4.h b/src/emu/cpu/melps4/melps4.h index d8b9380f7d7..ba6c18f4695 100644 --- a/src/emu/cpu/melps4/melps4.h +++ b/src/emu/cpu/melps4/melps4.h @@ -52,9 +52,11 @@ public: , m_prgwidth(prgwidth) , m_datawidth(datawidth) , m_stack_levels(3) - , m_bm_page(14) + , m_sm_page(14) , m_int_page(12) , m_xami_mask(0xf) + , m_sp_mask(0x7<<4) + , m_ba_op(0x01) { } protected: @@ -86,29 +88,35 @@ protected: int m_icount; - // fixed settings or mask options + // fixed settings or mask options that differ between MCU type int m_prgwidth; // number of bits and bitmask for ROM/RAM size int m_datawidth; // " int m_prgmask; // " int m_datamask; // " UINT8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 - UINT8 m_bm_page; // short BM default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 + UINT8 m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 UINT8 m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47 UINT8 m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others) + UINT16 m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47 + UINT16 m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47 // internal state, misc regs UINT16 m_pc; // program counter (11 or 10-bit) UINT16 m_prev_pc; - UINT16 m_stack[12]; // callstack + UINT16 m_stack[12]; // callstack (SK0-SKx, same size as PC) UINT16 m_op; UINT16 m_prev_op; UINT8 m_bitmask; // opcode bit argument + bool m_sm, m_sms; // subroutine mode flag + stack + bool m_ba_flag; // temp flag indicates BA opcode was executed + UINT8 m_sp_param; // temp register holding SP opcode parameter UINT8 m_cps; // DP,CY or DP',CY' selected bool m_skip; // skip next opcode UINT8 m_inte; // interrupt enable flag UINT8 m_intp; // external interrupt polarity ('40 to '44) + bool m_prohibit_irq; // interrupt is prohibited during certain opcodes // work registers (unless specified, each is 4-bit) UINT8 m_a; // accumulator diff --git a/src/emu/cpu/melps4/melps4op.inc b/src/emu/cpu/melps4/melps4op.inc index 296a5b1a39a..5d2f6d38a94 100644 --- a/src/emu/cpu/melps4/melps4op.inc +++ b/src/emu/cpu/melps4/melps4op.inc @@ -19,10 +19,16 @@ inline void melps4_cpu_device::ram_w(UINT8 data) void melps4_cpu_device::pop_pc() { + m_pc = m_stack[0]; + for (int i = 0; i < m_stack_levels-1; i++) + m_stack[i] = m_stack[i+1]; } void melps4_cpu_device::push_pc() { + for (int i = m_stack_levels-1; i >= 1; i--) + m_stack[i] = m_stack[i-1]; + m_stack[0] = m_pc; } @@ -82,6 +88,7 @@ void melps4_cpu_device::op_tax() void melps4_cpu_device::op_lxy() { // LXY x,y: load immediate into X,Y, skip any next LXY + m_prohibit_irq = true; if ((m_op & ~0x3f) != (m_prev_op & ~0x3f)) { m_x = m_op >> 4 & 3; @@ -181,6 +188,7 @@ void melps4_cpu_device::op_xami() void melps4_cpu_device::op_la() { // LA n: load immediate into A, skip any next LA + m_prohibit_irq = true; if ((m_op & ~0xf) != (m_prev_op & ~0xf)) m_a = m_op & 0xf; } @@ -437,26 +445,57 @@ void melps4_cpu_device::op_snz2() void melps4_cpu_device::op_ba() { - // BA: x - op_illegal(); + // BA: indicate next branch is indirect + m_prohibit_irq = true; + m_ba_flag = true; } void melps4_cpu_device::op_sp() { - // SP: set page - op_illegal(); + // SP: set page for next branch + // note: mnemonic is guessed, manual names it BL or BML + m_prohibit_irq = true; + m_sp_param = m_op & 0xf; } void melps4_cpu_device::op_b() { - // B xy: branch in current page - op_illegal(); + // B xy: branch + m_prohibit_irq = true; + + // determine new page: + // - short call: subroutine page + // - short jump: current page, or sub. page + 1 when in sub. mode + // - long jump/call(B/BM preceded by SP): temp SP register + UINT8 page = m_pc >> 7; + if ((m_prev_op & ~0xf) == m_sp_mask) + { + m_sm = false; + page = m_sp_param; + } + else if (m_sm) + page = m_sm_page | (m_op >> 7 & 1); + + m_pc = page << 7 | (m_op & 0x7f); + + // if BA opcode was executed, set PC low 4 bits to A + if (m_ba_flag) + { + m_ba_flag = false; + m_pc = (m_pc & ~0xf) | m_a; + } } void melps4_cpu_device::op_bm() { - // BM xy call subroutine on page 14 - op_illegal(); + // BM xy call subroutine + // don't push stack on short calls when in subroutine mode + if (!m_sm || (m_prev_op & ~0xf) == m_sp_mask) + push_pc(); + + // set subroutine mode - it is reset after long jump/call or return + m_sm = true; + op_b(); } @@ -465,7 +504,9 @@ void melps4_cpu_device::op_bm() void melps4_cpu_device::op_rt() { // RT: return from subroutine - op_illegal(); + m_prohibit_irq = true; + m_sm = false; + pop_pc(); } void melps4_cpu_device::op_rts() @@ -478,7 +519,8 @@ void melps4_cpu_device::op_rts() void melps4_cpu_device::op_rti() { // RTI: return from interrupt routine - op_illegal(); + op_rt(); + m_sm = m_sms; } @@ -587,12 +629,14 @@ void melps4_cpu_device::op_ei() { // EI: enable interrupt flag m_inte = 1; + m_prohibit_irq = true; } void melps4_cpu_device::op_di() { // DI: disable interrupt flag m_inte = 0; + m_prohibit_irq = true; } void melps4_cpu_device::op_inth() From 2f13be3ec52d8b540be83ce8ffd25867175d4c5a Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 29 May 2015 23:50:44 +0200 Subject: [PATCH 027/284] Fix OpenMP by using spinlocks in push_to_queue. However no observable performance improvement. Without OpenMP, locks will not be compiled. Removed a couple of inlines and added consts were appropriate. (nw) --- src/emu/netlist/nl_base.h | 156 +++++++------- src/emu/netlist/nl_lists.h | 52 +++-- src/emu/netlist/plib/pconfig.h | 1 + src/emu/netlist/plib/plists.h | 84 ++++---- src/emu/netlist/plib/pparser.h | 4 +- src/emu/netlist/plib/pstring.c | 16 +- src/emu/netlist/plib/pstring.h | 58 +++--- src/emu/netlist/tools/nl_convert.h | 320 +++++++++++++++-------------- 8 files changed, 360 insertions(+), 331 deletions(-) diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index b5d547d2fdd..042843b4dc5 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -266,7 +266,7 @@ public: nl_fatalerror(const char *format, va_list ap); virtual ~nl_fatalerror() throw() {} - /* inline */ const pstring &text() { return m_text; } + const pstring &text() { return m_text; } private: pstring m_text; }; @@ -328,7 +328,7 @@ public: netlist_logic_family_t() : m_logic_family(NULL) {} - ATTR_HOT /* inline */ const netlist_logic_family_desc_t *logic_family() const { return m_logic_family; } + ATTR_HOT const netlist_logic_family_desc_t *logic_family() const { return m_logic_family; } ATTR_COLD void set_logic_family(const netlist_logic_family_desc_t *fam) { m_logic_family = fam; } private: @@ -395,16 +395,16 @@ public: PSTATE_INTERFACE_DECL() - ATTR_HOT /* inline */ type_t type() const { return m_objtype; } - ATTR_HOT /* inline */ family_t family() const { return m_family; } + ATTR_HOT type_t type() const { return m_objtype; } + ATTR_HOT family_t family() const { return m_family; } - ATTR_HOT /* inline */ bool isType(const type_t atype) const { return (m_objtype == atype); } - ATTR_HOT /* inline */ bool isFamily(const family_t afamily) const { return (m_family == afamily); } + ATTR_HOT bool isType(const type_t atype) const { return (m_objtype == atype); } + ATTR_HOT bool isFamily(const family_t afamily) const { return (m_family == afamily); } - ATTR_HOT /* inline */ netlist_base_t & netlist() { return *m_netlist; } - ATTR_HOT /* inline */ const netlist_base_t & netlist() const { return *m_netlist; } + ATTR_HOT netlist_base_t & netlist() { return *m_netlist; } + ATTR_HOT const netlist_base_t & netlist() const { return *m_netlist; } - ATTR_COLD void /* inline */ do_reset() + ATTR_COLD void do_reset() { reset(); } @@ -434,7 +434,7 @@ public: ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname); - ATTR_HOT /* inline */ netlist_core_device_t &netdev() const { return *m_netdev; } + ATTR_HOT netlist_core_device_t &netdev() const { return *m_netdev; } private: netlist_core_device_t * m_netdev; }; @@ -467,21 +467,21 @@ public: //ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname); ATTR_COLD void set_net(netlist_net_t &anet); - ATTR_COLD /* inline */ void clear_net() { m_net = NULL; } - ATTR_HOT /* inline */ bool has_net() const { return (m_net != NULL); } + ATTR_COLD void clear_net() { m_net = NULL; } + ATTR_HOT bool has_net() const { return (m_net != NULL); } - ATTR_HOT /* inline */ const netlist_net_t & net() const { return *m_net;} - ATTR_HOT /* inline */ netlist_net_t & net() { return *m_net;} + ATTR_HOT const netlist_net_t & net() const { return *m_net;} + ATTR_HOT netlist_net_t & net() { return *m_net;} - ATTR_HOT /* inline */ bool is_state(const state_e astate) const { return (m_state == astate); } - ATTR_HOT /* inline */ state_e state() const { return m_state; } - ATTR_HOT /* inline */ void set_state(const state_e astate) + ATTR_HOT bool is_state(const state_e astate) const { return (m_state == astate); } + ATTR_HOT state_e state() const { return m_state; } + ATTR_HOT void set_state(const state_e astate) { nl_assert(astate != STATE_NONEX); m_state = astate; } - /* inline only intended to be called from nl_base.c */ + ATTR_HOT inline void update_dev(const UINT32 mask); protected: @@ -512,21 +512,21 @@ public: nl_double *m_go1; // conductance for Voltage from other term nl_double *m_gt1; // conductance for total conductance - ATTR_HOT /* inline */ void set(const nl_double G) + ATTR_HOT void set(const nl_double G) { set_ptr(m_Idr1, 0); set_ptr(m_go1, G); set_ptr(m_gt1, G); } - ATTR_HOT /* inline */ void set(const nl_double GO, const nl_double GT) + ATTR_HOT void set(const nl_double GO, const nl_double GT) { set_ptr(m_Idr1, 0); set_ptr(m_go1, GO); set_ptr(m_gt1, GT); } - ATTR_HOT /* inline */ void set(const nl_double GO, const nl_double GT, const nl_double I) + ATTR_HOT void set(const nl_double GO, const nl_double GT, const nl_double I) { set_ptr(m_Idr1, I); set_ptr(m_go1, GO); @@ -543,7 +543,7 @@ protected: /* ATTR_COLD */ virtual void reset(); private: - ATTR_HOT /* inline */ void set_ptr(nl_double *ptr, const nl_double val) + ATTR_HOT void set_ptr(nl_double *ptr, const nl_double val) { if (ptr != NULL && *ptr != val) { @@ -606,13 +606,13 @@ public: set_state(STATE_INP_ACTIVE); } - ATTR_HOT /* inline */ netlist_sig_t Q() const; - ATTR_HOT /* inline */ netlist_sig_t last_Q() const; + ATTR_HOT netlist_sig_t Q() const; + ATTR_HOT netlist_sig_t last_Q() const; - ATTR_HOT /* inline */ void inactivate(); - ATTR_HOT /* inline */ void activate(); - ATTR_HOT /* inline */ void activate_hl(); - ATTR_HOT /* inline */ void activate_lh(); + ATTR_HOT void inactivate(); + ATTR_HOT void activate(); + ATTR_HOT void activate_hl(); + ATTR_HOT void activate_lh(); protected: /* ATTR_COLD */ virtual void reset() @@ -636,7 +636,7 @@ public: set_state(STATE_INP_ACTIVE); } - ATTR_HOT /* inline */ nl_double Q_Analog() const; + ATTR_HOT nl_double Q_Analog() const; protected: /* ATTR_COLD */ virtual void reset() @@ -666,25 +666,25 @@ public: ATTR_COLD void merge_net(netlist_net_t *othernet); ATTR_COLD void register_railterminal(netlist_core_terminal_t &mr); - ATTR_HOT /* inline */ netlist_logic_net_t & as_logic(); - ATTR_HOT /* inline */ const netlist_logic_net_t & as_logic() const; + ATTR_HOT netlist_logic_net_t & as_logic(); + ATTR_HOT const netlist_logic_net_t & as_logic() const; - ATTR_HOT /* inline */ netlist_analog_net_t & as_analog(); - ATTR_HOT /* inline */ const netlist_analog_net_t & as_analog() const; + ATTR_HOT netlist_analog_net_t & as_analog(); + ATTR_HOT const netlist_analog_net_t & as_analog() const; ATTR_HOT void update_devs(); - ATTR_HOT /* inline */ const netlist_time &time() const { return m_time; } - ATTR_HOT /* inline */ void set_time(const netlist_time &ntime) { m_time = ntime; } + ATTR_HOT const netlist_time &time() const { return m_time; } + ATTR_HOT void set_time(const netlist_time &ntime) { m_time = ntime; } - ATTR_HOT /* inline */ bool isRailNet() const { return !(m_railterminal == NULL); } - ATTR_HOT /* inline */ netlist_core_terminal_t & railterminal() const { return *m_railterminal; } + ATTR_HOT bool isRailNet() const { return !(m_railterminal == NULL); } + ATTR_HOT netlist_core_terminal_t & railterminal() const { return *m_railterminal; } - ATTR_HOT /* inline */ void push_to_queue(const netlist_time &delay); - ATTR_HOT /* inline */ void reschedule_in_queue(const netlist_time &delay); - ATTR_HOT bool /* inline */ is_queued() const { return m_in_queue == 1; } + ATTR_HOT void push_to_queue(const netlist_time &delay); + ATTR_HOT void reschedule_in_queue(const netlist_time &delay); + ATTR_HOT bool is_queued() const { return m_in_queue == 1; } - ATTR_HOT /* inline */ int num_cons() const { return m_core_terms.size(); } + ATTR_HOT int num_cons() const { return m_core_terms.size(); } ATTR_HOT void inc_active(netlist_core_terminal_t &term); ATTR_HOT void dec_active(netlist_core_terminal_t &term); @@ -695,7 +695,7 @@ public: plist_t m_core_terms; // save post-start m_list ... - ATTR_HOT /* inline */ void set_Q_time(const netlist_sig_t &newQ, const netlist_time &at) + ATTR_HOT void set_Q_time(const netlist_sig_t &newQ, const netlist_time &at) { if (newQ != m_new_Q) { @@ -740,17 +740,17 @@ public: ATTR_COLD netlist_logic_net_t(); /* ATTR_COLD */ virtual ~netlist_logic_net_t() { }; - ATTR_HOT /* inline */ netlist_sig_t Q() const + ATTR_HOT netlist_sig_t Q() const { return m_cur_Q; } - ATTR_HOT /* inline */ netlist_sig_t new_Q() const + ATTR_HOT netlist_sig_t new_Q() const { return m_new_Q; } - ATTR_HOT /* inline */ void set_Q(const netlist_sig_t &newQ, const netlist_time &delay) + ATTR_HOT void set_Q(const netlist_sig_t &newQ, const netlist_time &delay) { if (newQ != m_new_Q) { @@ -759,7 +759,7 @@ public: } } - ATTR_HOT /* inline */ void toggle_new_Q() + ATTR_HOT void toggle_new_Q() { m_new_Q ^= 1; } @@ -773,7 +773,7 @@ public: /* internal state support * FIXME: get rid of this and implement export/import in MAME */ - ATTR_COLD /* inline */ netlist_sig_t &Q_state_ptr() + ATTR_COLD netlist_sig_t &Q_state_ptr() { return m_cur_Q; } @@ -800,17 +800,17 @@ public: ATTR_COLD netlist_analog_net_t(); /* ATTR_COLD */ virtual ~netlist_analog_net_t() { }; - ATTR_HOT /* inline */ nl_double Q_Analog() const + ATTR_HOT nl_double Q_Analog() const { return m_cur_Analog; } - ATTR_COLD /* inline */ nl_double &Q_Analog_state_ptr() + ATTR_COLD nl_double &Q_Analog_state_ptr() { return m_cur_Analog; } - ATTR_HOT /* inline */ netlist_matrix_solver_t *solver() { return m_solver; } + ATTR_HOT netlist_matrix_solver_t *solver() { return m_solver; } ATTR_COLD bool already_processed(list_t *groups, int cur_group); ATTR_COLD void process_net(list_t *groups, int &cur_group); @@ -850,7 +850,7 @@ public: ATTR_COLD void initial(const netlist_sig_t val); - ATTR_HOT /* inline */ void set_Q(const netlist_sig_t newQ, const netlist_time &delay) + ATTR_HOT void set_Q(const netlist_sig_t newQ, const netlist_time &delay) { net().as_logic().set_Q(newQ, delay); } @@ -874,7 +874,7 @@ public: ATTR_COLD void initial(const nl_double val); - ATTR_HOT /* inline */ void set_Q(const nl_double newQ); + ATTR_HOT void set_Q(const nl_double newQ); netlist_analog_net_t *m_proxied_net; // only for proxy nets in analog input logic @@ -901,7 +901,7 @@ public: ATTR_COLD netlist_param_t(const param_type_t atype); - ATTR_HOT /* inline */ param_type_t param_type() const { return m_param_type; } + ATTR_HOT param_type_t param_type() const { return m_param_type; } protected: @@ -917,9 +917,9 @@ class netlist_param_double_t : public netlist_param_t public: ATTR_COLD netlist_param_double_t(); - ATTR_HOT /* inline */ void setTo(const nl_double param); - ATTR_COLD /* inline */ void initial(const nl_double val) { m_param = val; } - ATTR_HOT /* inline */ nl_double Value() const { return m_param; } + ATTR_HOT void setTo(const nl_double param); + ATTR_COLD void initial(const nl_double val) { m_param = val; } + ATTR_HOT nl_double Value() const { return m_param; } protected: /* ATTR_COLD */ virtual void save_register() @@ -938,10 +938,10 @@ class netlist_param_int_t : public netlist_param_t public: ATTR_COLD netlist_param_int_t(); - ATTR_HOT /* inline */ void setTo(const int param); - ATTR_COLD /* inline */ void initial(const int val) { m_param = val; } + ATTR_HOT void setTo(const int param); + ATTR_COLD void initial(const int val) { m_param = val; } - ATTR_HOT /* inline */ int Value() const { return m_param; } + ATTR_HOT int Value() const { return m_param; } protected: /* ATTR_COLD */ virtual void save_register() @@ -967,10 +967,10 @@ class netlist_param_str_t : public netlist_param_t public: ATTR_COLD netlist_param_str_t(); - ATTR_HOT /* inline */ void setTo(const pstring ¶m); - ATTR_COLD /* inline */ void initial(const pstring &val) { m_param = val; } + ATTR_HOT void setTo(const pstring ¶m); + ATTR_COLD void initial(const pstring &val) { m_param = val; } - ATTR_HOT /* inline */ const pstring &Value() const { return m_param; } + ATTR_HOT const pstring &Value() const { return m_param; } private: pstring m_param; @@ -982,9 +982,9 @@ class netlist_param_model_t : public netlist_param_t public: ATTR_COLD netlist_param_model_t(); - ATTR_COLD /* inline */ void initial(const pstring &val) { m_param = val; } + ATTR_COLD void initial(const pstring &val) { m_param = val; } - ATTR_HOT /* inline */ const pstring &Value() const { return m_param; } + ATTR_HOT const pstring &Value() const { return m_param; } /* these should be cached! */ ATTR_COLD nl_double model_value(const pstring &entity, const nl_double defval = 0.0) const; @@ -1012,7 +1012,7 @@ public: /* ATTR_COLD */ virtual void init(netlist_base_t &anetlist, const pstring &name); ATTR_HOT virtual void update_param() {} - ATTR_HOT /* inline */ void update_dev() + ATTR_HOT void update_dev() { begin_timing(stat_total_time); inc_stat(stat_update_count); @@ -1032,22 +1032,22 @@ public: ATTR_HOT netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp); - ATTR_HOT /* inline */ netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const + ATTR_HOT netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const { nl_assert(inp.state() != netlist_logic_t::STATE_INP_PASSIVE); return inp.Q(); } - ATTR_HOT /* inline */ void OUTLOGIC(netlist_logic_output_t &out, const netlist_sig_t val, const netlist_time &delay) + ATTR_HOT void OUTLOGIC(netlist_logic_output_t &out, const netlist_sig_t val, const netlist_time &delay) { out.set_Q(val, delay); } - ATTR_HOT /* inline */ nl_double INPANALOG(const netlist_analog_input_t &inp) const { return inp.Q_Analog(); } + ATTR_HOT nl_double INPANALOG(const netlist_analog_input_t &inp) const { return inp.Q_Analog(); } - ATTR_HOT /* inline */ nl_double TERMANALOG(const netlist_terminal_t &term) const { return term.net().as_analog().Q_Analog(); } + ATTR_HOT nl_double TERMANALOG(const netlist_terminal_t &term) const { return term.net().as_analog().Q_Analog(); } - ATTR_HOT /* inline */ void OUTANALOG(netlist_analog_output_t &out, const nl_double val) + ATTR_HOT void OUTANALOG(netlist_analog_output_t &out, const nl_double val) { out.set_Q(val); } @@ -1166,20 +1166,20 @@ public: ATTR_COLD void start(); ATTR_COLD void stop(); - ATTR_HOT /* inline */ const netlist_queue_t &queue() const { return m_queue; } - ATTR_HOT /* inline */ netlist_queue_t &queue() { return m_queue; } - ATTR_HOT /* inline */ const netlist_time &time() const { return m_time; } - ATTR_HOT /* inline */ NETLIB_NAME(solver) *solver() const { return m_solver; } - ATTR_HOT /* inline */ NETLIB_NAME(gnd) *gnd() const { return m_gnd; } + ATTR_HOT const netlist_queue_t &queue() const { return m_queue; } + ATTR_HOT netlist_queue_t &queue() { return m_queue; } + ATTR_HOT const netlist_time &time() const { return m_time; } + ATTR_HOT NETLIB_NAME(solver) *solver() const { return m_solver; } + ATTR_HOT NETLIB_NAME(gnd) *gnd() const { return m_gnd; } ATTR_HOT nl_double gmin() const; ATTR_HOT void push_to_queue(netlist_net_t &out, const netlist_time &attime); ATTR_HOT void remove_from_queue(netlist_net_t &out); ATTR_HOT void process_queue(const netlist_time &delta); - ATTR_HOT /* inline */ void abort_current_queue_slice() { m_stop = netlist_time::zero; } + ATTR_HOT void abort_current_queue_slice() { m_stop = netlist_time::zero; } - ATTR_HOT /* inline */ const bool &use_deactivate() const { return m_use_deactivate; } + ATTR_HOT const bool &use_deactivate() const { return m_use_deactivate; } ATTR_COLD void rebuild_lists(); /* must be called after post_load ! */ @@ -1282,7 +1282,7 @@ private: }; // ----------------------------------------------------------------------------- -// /* inline */ implementations +// inline implementations // ----------------------------------------------------------------------------- PSTATE_INTERFACE(netlist_object_t, m_netlist, name()) diff --git a/src/emu/netlist/nl_lists.h b/src/emu/netlist/nl_lists.h index 1a047c3b5aa..f7408177103 100644 --- a/src/emu/netlist/nl_lists.h +++ b/src/emu/netlist/nl_lists.h @@ -12,7 +12,6 @@ #include "nl_config.h" - // ---------------------------------------------------------------------------------------- // timed queue // ---------------------------------------------------------------------------------------- @@ -26,13 +25,13 @@ public: class entry_t { public: - ATTR_HOT /* inline */ entry_t() + ATTR_HOT entry_t() : m_exec_time(), m_object() {} - ATTR_HOT /* inline */ entry_t(const _Time &atime, const _Element &elem) : m_exec_time(atime), m_object(elem) {} - ATTR_HOT /* inline */ const _Time &exec_time() const { return m_exec_time; } - ATTR_HOT /* inline */ const _Element &object() const { return m_object; } + ATTR_HOT entry_t(const _Time &atime, const _Element &elem) : m_exec_time(atime), m_object(elem) {} + ATTR_HOT const _Time &exec_time() const { return m_exec_time; } + ATTR_HOT const _Element &object() const { return m_object; } - ATTR_HOT /* inline */ entry_t &operator=(const entry_t &right) { + ATTR_HOT entry_t &operator=(const entry_t &right) { m_exec_time = right.m_exec_time; m_object = right.m_object; return *this; @@ -45,15 +44,22 @@ public: netlist_timed_queue() { +#if HAS_OPENMP && USE_OPENMP + m_lock = 0; +#endif clear(); } - ATTR_HOT /* inline */ int capacity() const { return _Size; } - ATTR_HOT /* inline */ bool is_empty() const { return (m_end == &m_list[1]); } - ATTR_HOT /* inline */ bool is_not_empty() const { return (m_end > &m_list[1]); } + ATTR_HOT int capacity() const { return _Size; } + ATTR_HOT bool is_empty() const { return (m_end == &m_list[1]); } + ATTR_HOT bool is_not_empty() const { return (m_end > &m_list[1]); } ATTR_HOT void push(const entry_t &e) { +#if HAS_OPENMP && USE_OPENMP + /* Lock */ + while (atomic_exchange32(&m_lock, 1)) { } +#endif const _Time t = e.exec_time(); entry_t * i = m_end++; while (t > (i - 1)->exec_time()) @@ -64,21 +70,28 @@ public: } *i = e; inc_stat(m_prof_call); +#if HAS_OPENMP && USE_OPENMP + m_lock = 0; +#endif //nl_assert(m_end - m_list < _Size); } - ATTR_HOT /* inline */ const entry_t *pop() + ATTR_HOT const entry_t *pop() { return --m_end; } - ATTR_HOT /* inline */ const entry_t *peek() const + ATTR_HOT const entry_t *peek() const { return (m_end-1); } - ATTR_HOT /* inline */ void remove(const _Element &elem) + ATTR_HOT void remove(const _Element &elem) { + /* Lock */ +#if HAS_OPENMP && USE_OPENMP + while (atomic_exchange32(&m_lock, 1)) { } +#endif entry_t * i = m_end - 1; while (i > &m_list[0]) { @@ -90,10 +103,16 @@ public: *i = *(i+1); i++; } +#if HAS_OPENMP && USE_OPENMP + m_lock = 0; +#endif return; } i--; } +#if HAS_OPENMP && USE_OPENMP + m_lock = 0; +#endif } ATTR_COLD void clear() @@ -109,9 +128,9 @@ public: // save state support & mame disasm - ATTR_COLD /* inline */ const entry_t *listptr() const { return &m_list[0]; } - ATTR_HOT /* inline */ int count() const { return m_end - m_list; } - ATTR_HOT /* inline */ const entry_t & operator[](const int & index) const { return m_list[index]; } + ATTR_COLD const entry_t *listptr() const { return &m_list[0]; } + ATTR_HOT int count() const { return m_end - m_list; } + ATTR_HOT const entry_t & operator[](const int & index) const { return m_list[index]; } #if (NL_KEEP_STATISTICS) // profiling @@ -121,6 +140,9 @@ public: private: +#if HAS_OPENMP && USE_OPENMP + volatile INT32 m_lock; +#endif entry_t * m_end; entry_t m_list[_Size]; diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h index 6c00cdd3411..fbbb0d0a4c9 100644 --- a/src/emu/netlist/plib/pconfig.h +++ b/src/emu/netlist/plib/pconfig.h @@ -23,6 +23,7 @@ #if !(PSTANDALONE) #include "osdcore.h" +#include "eminline.h" #undef ATTR_COLD #define ATTR_COLD diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h index 032f123aab1..4f41c88ba3f 100644 --- a/src/emu/netlist/plib/plists.h +++ b/src/emu/netlist/plib/plists.h @@ -58,12 +58,12 @@ public: * array works around this. */ - ATTR_HOT /* inline */ _ListClass *data() { return m_list; } + ATTR_HOT _ListClass *data() { return m_list; } - ATTR_HOT /* inline */ _ListClass& operator[](std::size_t index) { return m_list[index]; } - ATTR_HOT /* inline */ const _ListClass& operator[](std::size_t index) const { return m_list[index]; } + ATTR_HOT _ListClass& operator[](std::size_t index) { return m_list[index]; } + ATTR_HOT const _ListClass& operator[](std::size_t index) const { return m_list[index]; } - ATTR_HOT /* inline */ std::size_t size() const { return m_capacity; } + ATTR_HOT std::size_t size() const { return m_capacity; } protected: ATTR_COLD void set_capacity(const std::size_t new_capacity) @@ -96,7 +96,7 @@ public: plist_t() : std::vector<_ListClass>() {} plist_t(const int numElements) : std::vector<_ListClass>(numElements) {} - /* inline */ void add(const _ListClass &elem) { this->push_back(elem); } + void add(const _ListClass &elem) { this->push_back(elem); } void clear_and_free() { for (_ListClass *i = this->data(); i < this->data() + this->size(); i++) @@ -105,7 +105,7 @@ public: } this->clear(); } - /* inline */ bool contains(const _ListClass &elem) const + bool contains(const _ListClass &elem) const { for (const _ListClass *i = this->data(); i < this->data() + this->size(); i++) { @@ -115,7 +115,7 @@ public: return false; } - /* inline */ void remove(const _ListClass &elem) + void remove(const _ListClass &elem) { for (int i = 0; i < this->size(); i++) { @@ -126,12 +126,12 @@ public: } } } - /* inline */ void remove_at(const int pos) + void remove_at(const int pos) { this->erase(this->begin() + pos); } - /* inline */ int indexof(const _ListClass &elem) const + int indexof(const _ListClass &elem) const { for (int i = 0; i < this->size(); i++) { @@ -141,7 +141,7 @@ public: return -1; } - ATTR_HOT /* inline */ void swap(const int pos1, const int pos2) + ATTR_HOT void swap(const int pos1, const int pos2) { //nl_assert((pos1>=0) && (pos1=0) && (pos2= m_capacity){ std::size_t new_size = m_capacity * 2; @@ -217,7 +217,7 @@ public: m_list[m_count++] = elem; } - ATTR_HOT /* inline */ void remove(const _ListClass &elem) + ATTR_HOT void remove(const _ListClass &elem) { for (std::size_t i = 0; i < m_count; i++) { @@ -234,7 +234,7 @@ public: } } - ATTR_HOT /* inline */ void remove_at(const std::size_t pos) + ATTR_HOT void remove_at(const std::size_t pos) { //nl_assert((pos>=0) && (pos=0) && (pos1=0) && (pos2 static const pstring get_name(const T *elem) { return elem->name(); } - template static const pstring get_name(T *elem) { return elem->name(); } - template static const pstring get_name(const T &elem) { return elem.name(); } + template static const pstring &get_name(const T *elem) { return elem->name(); } + template static const pstring &get_name(T *elem) { return elem->name(); } + template static const pstring &get_name(const T &elem) { return elem.name(); } }; @@ -403,27 +403,27 @@ public: { } - ATTR_HOT /* inline */ void push(const _StackClass &elem) + ATTR_HOT void push(const _StackClass &elem) { m_list.add(elem); } - ATTR_HOT /* inline */ _StackClass peek() const + ATTR_HOT _StackClass peek() const { return m_list[m_list.size() - 1]; } - ATTR_HOT /* inline */ _StackClass pop() + ATTR_HOT _StackClass pop() { _StackClass ret = peek(); m_list.remove_at(m_list.size() - 1); return ret; } - ATTR_HOT /* inline */ int count() const { return m_list.size(); } - ATTR_HOT /* inline */ bool empty() const { return (m_list.size() == 0); } - ATTR_HOT /* inline */ void reset() { m_list.reset(); } - ATTR_HOT /* inline */ int capacity() const { return m_list.capacity(); } + ATTR_HOT int count() const { return m_list.size(); } + ATTR_HOT bool empty() const { return (m_list.size() == 0); } + ATTR_HOT void reset() { m_list.reset(); } + ATTR_HOT int capacity() const { return m_list.capacity(); } private: plist_t<_StackClass> m_list; @@ -448,7 +448,7 @@ public: plinkedlist_t() : m_head(NULL) {} - ATTR_HOT /* inline */ void insert(const _ListClass &before, _ListClass &elem) + ATTR_HOT void insert(const _ListClass &before, _ListClass &elem) { if (m_head == &before) { @@ -473,13 +473,13 @@ public: } } - ATTR_HOT /* inline */ void insert(_ListClass &elem) + ATTR_HOT void insert(_ListClass &elem) { elem.m_next = m_head; m_head = &elem; } - ATTR_HOT /* inline */ void add(_ListClass &elem) + ATTR_HOT void add(_ListClass &elem) { _ListClass **p = &m_head; while (*p != NULL) @@ -490,7 +490,7 @@ public: elem.m_next = NULL; } - ATTR_HOT /* inline */ void remove(const _ListClass &elem) + ATTR_HOT void remove(const _ListClass &elem) { _ListClass **p = &m_head; while (*p != &elem) @@ -502,11 +502,11 @@ public: } - ATTR_HOT static /* inline */ _ListClass *next(const _ListClass &elem) { return elem.m_next; } - ATTR_HOT static /* inline */ _ListClass *next(const _ListClass *elem) { return elem->m_next; } - ATTR_HOT /* inline */ _ListClass *first() const { return m_head; } - ATTR_HOT /* inline */ void clear() { m_head = NULL; } - ATTR_HOT /* inline */ bool is_empty() const { return (m_head == NULL); } + ATTR_HOT static _ListClass *next(const _ListClass &elem) { return elem.m_next; } + ATTR_HOT static _ListClass *next(const _ListClass *elem) { return elem->m_next; } + ATTR_HOT _ListClass *first() const { return m_head; } + ATTR_HOT void clear() { m_head = NULL; } + ATTR_HOT bool is_empty() const { return (m_head == NULL); } private: _ListClass *m_head; diff --git a/src/emu/netlist/plib/pparser.h b/src/emu/netlist/plib/pparser.h index 4a3305094aa..4dbaac67324 100644 --- a/src/emu/netlist/plib/pparser.h +++ b/src/emu/netlist/plib/pparser.h @@ -51,13 +51,13 @@ public: m_id = token_id_t(-1); m_token =""; } - token_t(token_type type, const pstring str) + token_t(token_type type, const pstring &str) { m_type = type; m_id = token_id_t(-1); m_token = str; } - token_t(const token_id_t id, const pstring str) + token_t(const token_id_t id, const pstring &str) { m_type = TOKEN; m_id = id; diff --git a/src/emu/netlist/plib/pstring.c b/src/emu/netlist/plib/pstring.c index ec930808e7b..37af773b254 100644 --- a/src/emu/netlist/plib/pstring.c +++ b/src/emu/netlist/plib/pstring.c @@ -73,7 +73,7 @@ void pstring::pcopy(const char *from, int size) m_ptr = n; } -pstring pstring::substr(unsigned int start, int count) const +const pstring pstring::substr(unsigned int start, int count) const { pstring ret; unsigned alen = len(); @@ -85,7 +85,7 @@ pstring pstring::substr(unsigned int start, int count) const return ret; } -pstring pstring::ucase() const +const pstring pstring::ucase() const { pstring ret = *this; ret.pcopy(cstr(), len()); @@ -94,7 +94,7 @@ pstring pstring::ucase() const return ret; } -int pstring::find_first_not_of(const pstring no) const +int pstring::find_first_not_of(const pstring &no) const { for (int i=0; i < len(); i++) { @@ -108,7 +108,7 @@ int pstring::find_first_not_of(const pstring no) const return -1; } -int pstring::find_last_not_of(const pstring no) const +int pstring::find_last_not_of(const pstring &no) const { for (int i=len() - 1; i >= 0; i--) { @@ -144,7 +144,7 @@ pstring pstring::replace(const pstring &search, const pstring &replace) const } return ret; } -pstring pstring::ltrim(const pstring ws) const +const pstring pstring::ltrim(const pstring &ws) const { int f = find_first_not_of(ws); if (f>=0) @@ -153,7 +153,7 @@ pstring pstring::ltrim(const pstring ws) const return ""; } -pstring pstring::rtrim(const pstring ws) const +const pstring pstring::rtrim(const pstring &ws) const { int f = find_last_not_of(ws); if (f>=0) @@ -218,7 +218,7 @@ long pstring::as_long(bool *error) const return ret; } -pstring pstring::vprintf(va_list args) const +const pstring pstring::vprintf(va_list args) const { // sprintf into the temporary buffer char tempbuf[4096]; @@ -259,7 +259,7 @@ void pstring::resetmem() // pstring ... // ---------------------------------------------------------------------------------------- -pstring pstring::sprintf(const char *format, ...) +const pstring pstring::sprintf(const char *format, ...) { va_list ap; va_start(ap, format); diff --git a/src/emu/netlist/plib/pstring.h b/src/emu/netlist/plib/pstring.h index 7cfb936472c..e3054263ed7 100644 --- a/src/emu/netlist/plib/pstring.h +++ b/src/emu/netlist/plib/pstring.h @@ -36,7 +36,7 @@ public: // C string conversion operators and helpers operator const char *() const { return m_ptr->str(); } - inline const char *cstr() const { return m_ptr->str(); } + const char *cstr() const { return m_ptr->str(); } // concatenation operators pstring& operator+=(const char c) { char buf[2] = { c, 0 }; pcat(buf); return *this; } @@ -61,13 +61,13 @@ public: bool operator>=(const char *string) const { return (pcmp(string) >= 0); } bool operator>=(const pstring &string) const { return (pcmp(string.cstr()) >= 0); } - inline int len() const { return m_ptr->len(); } + int len() const { return m_ptr->len(); } - inline bool equals(const pstring &string) const { return (pcmp(string.cstr(), m_ptr->str()) == 0); } - inline bool iequals(const pstring &string) const { return (pcmpi(string.cstr(), m_ptr->str()) == 0); } + bool equals(const pstring &string) const { return (pcmp(string.cstr(), m_ptr->str()) == 0); } + bool iequals(const pstring &string) const { return (pcmpi(string.cstr(), m_ptr->str()) == 0); } - inline int cmp(const pstring &string) const { return pcmp(string.cstr()); } - inline int cmpi(const pstring &string) const { return pcmpi(cstr(), string.cstr()); } + int cmp(const pstring &string) const { return pcmp(string.cstr()); } + int cmpi(const pstring &string) const { return pcmpi(cstr(), string.cstr()); } int find(const char *search, int start = 0) const; @@ -75,28 +75,28 @@ public: // various - inline bool startsWith(const pstring &arg) const { return (pcmp(cstr(), arg.cstr(), arg.len()) == 0); } + bool startsWith(const pstring &arg) const { return (pcmp(cstr(), arg.cstr(), arg.len()) == 0); } bool startsWith(const char *arg) const; pstring replace(const pstring &search, const pstring &replace) const; // these return nstring ... - inline pstring cat(const pstring &s) const { return *this + s; } - inline pstring cat(const char *s) const { return *this + s; } + const pstring cat(const pstring &s) const { return *this + s; } + const pstring cat(const char *s) const { return *this + s; } - pstring substr(unsigned int start, int count = -1) const ; + const pstring substr(unsigned int start, int count = -1) const ; - inline pstring left(unsigned int count) const { return substr(0, count); } - inline pstring right(unsigned int count) const { return substr(len() - count, count); } + const pstring left(unsigned int count) const { return substr(0, count); } + const pstring right(unsigned int count) const { return substr(len() - count, count); } - int find_first_not_of(const pstring no) const; - int find_last_not_of(const pstring no) const; + int find_first_not_of(const pstring &no) const; + int find_last_not_of(const pstring &no) const; - pstring ltrim(const pstring ws = " \t\n\r") const; - pstring rtrim(const pstring ws = " \t\n\r") const; - inline pstring trim(const pstring ws = " \t\n\r") const { return this->ltrim(ws).rtrim(ws); } + const pstring ltrim(const pstring &ws = " \t\n\r") const; + const pstring rtrim(const pstring &ws = " \t\n\r") const; + const pstring trim(const pstring &ws = " \t\n\r") const { return this->ltrim(ws).rtrim(ws); } - pstring rpad(const pstring ws, const int cnt) const + const pstring rpad(const pstring &ws, const int cnt) const { // FIXME: slow! pstring ret = *this; @@ -105,7 +105,7 @@ public: return ret.substr(0, cnt); } - pstring ucase() const; + const pstring ucase() const; // conversions @@ -115,10 +115,10 @@ public: // printf using string as format ... - pstring vprintf(va_list args) const; + const pstring vprintf(va_list args) const; // static - static pstring sprintf(const char *format, ...) ATTR_PRINTF(1,2); + static const pstring sprintf(const char *format, ...) ATTR_PRINTF(1,2); static void resetmem(); protected: @@ -147,13 +147,13 @@ protected: str_t *m_ptr; private: - inline void init() + void init() { m_ptr = &m_zero; m_ptr->m_ref_count++; } - inline int pcmp(const char *right) const + int pcmp(const char *right) const { return pcmp(m_ptr->str(), right); } @@ -166,7 +166,7 @@ private: void pcopy(const char *from); - inline void pcopy(const pstring &from) + void pcopy(const pstring &from) { sfree(m_ptr); m_ptr = from.m_ptr; @@ -212,7 +212,7 @@ public: // C string conversion operators and helpers operator const char *() const { return m_ptr; } - inline const char *cstr() const { return m_ptr; } + const char *cstr() const { return m_ptr; } operator pstring() const { return pstring(m_ptr); } @@ -220,10 +220,10 @@ public: pstringbuffer& operator+=(const char c) { char buf[2] = { c, 0 }; pcat(buf); return *this; } pstringbuffer& operator+=(const pstring &string) { pcat(string.cstr()); return *this; } - inline std::size_t len() const { return m_len; } + std::size_t len() const { return m_len; } - inline void cat(const pstring &s) { pcat(s); } - inline void cat(const char *s) { pcat(s); } + void cat(const pstring &s) { pcat(s); } + void cat(const char *s) { pcat(s); } pstring substr(unsigned int start, int count = -1) { @@ -232,7 +232,7 @@ public: private: - inline void init() + void init() { m_ptr = NULL; m_size = 0; diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index e4726b33314..9ecbb186f1f 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -26,15 +26,149 @@ public: nl_convert_base_t() {}; virtual ~nl_convert_base_t() { - nets.clear_and_free(); + m_nets.clear_and_free(); devs.clear_and_free(); - pins.clear_and_free(); + m_pins.clear_and_free(); } const pstringbuffer &result() { return m_buf; } virtual void convert(const pstring &contents) = 0; protected: + + void out(const char *format, ...) ATTR_PRINTF(2,3) + { + va_list ap; + va_start(ap, format); + m_buf += pstring(format).vprintf(ap); + va_end(ap); + } + + void add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias) + { + m_pins.add(palloc(sp_pin_alias_t, devname + "." + name, devname + "." + alias), false); + } + + void add_ext_alias(const pstring &alias) + { + m_ext_alias.add(alias); + } + + void add_device(const pstring &atype, const pstring &aname, const pstring &amodel) + { + devs.add(palloc(sp_dev_t, atype, aname, amodel), false); + } + void add_device(const pstring &atype, const pstring &aname, double aval) + { + devs.add(palloc(sp_dev_t, atype, aname, aval), false); + } + void add_device(const pstring &atype, const pstring &aname) + { + devs.add(palloc(sp_dev_t, atype, aname), false); + } + + void add_term(pstring netname, pstring termname) + { + sp_net_t * net = m_nets.find_by_name(netname); + if (net == NULL) + { + net = palloc(sp_net_t, netname); + m_nets.add(net, false); + } + + /* if there is a pin alias, translate ... */ + sp_pin_alias_t *alias = m_pins.find_by_name(termname); + + if (alias != NULL) + net->terminals().add(alias->alias()); + else + net->terminals().add(termname); + } + + void dump_nl() + { + for (int i=0; iterminals()[0].cstr()); + // if the aliased net only has this one terminal connected ==> don't dump + if (net->terminals().size() == 1) + net->set_no_export(); + } + for (int i=0; ihas_value()) + out("%s(%s, %s)\n", devs[i]->type().cstr(), + devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); + else if (devs[i]->has_model()) + out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), + devs[i]->name().cstr(), devs[i]->model().cstr()); + else + out("%s(%s)\n", devs[i]->type().cstr(), + devs[i]->name().cstr()); + } + // print nets + for (int i=0; iis_no_export()) + { + //printf("Net %s\n", net->name().cstr()); + out("NET_C(%s", net->terminals()[0].cstr() ); + for (int j=1; jterminals().size(); j++) + { + out(", %s", net->terminals()[j].cstr() ); + } + out(")\n"); + } + } + devs.clear_and_free(); + m_nets.clear_and_free(); + m_pins.clear_and_free(); + m_ext_alias.clear(); + } + + const pstring get_nl_val(const double val) + { + { + int i = 0; + while (m_sp_units[i].sp_unit != "-" ) + { + if (m_sp_units[i].mult <= nl_math::abs(val)) + break; + i++; + } + return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); + } + } + double get_sp_unit(const pstring &unit) + { + int i = 0; + while (m_sp_units[i].sp_unit != "-") + { + if (m_sp_units[i].sp_unit == unit) + return m_sp_units[i].mult; + i++; + } + fprintf(stderr, "Unit %s unknown\n", unit.cstr()); + return 0.0; + } + + double get_sp_val(const pstring &sin) + { + int p = sin.len() - 1; + while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) + p--; + pstring val = sin.substr(0,p + 1); + pstring unit = sin.substr(p + 1); + + double ret = get_sp_unit(unit) * val.as_double(); + //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret); + return ret; + } + +private: struct sp_net_t { public: @@ -102,124 +236,18 @@ protected: pstring m_alias; }; - void add_term(pstring netname, pstring termname) - { - sp_net_t * net = nets.find_by_name(netname); - if (net == NULL) - { - net = palloc(sp_net_t, netname); - nets.add(net, false); - } - /* if there is a pin alias, translate ... */ - sp_pin_alias_t *alias = pins.find_by_name(termname); - if (alias != NULL) - net->terminals().add(alias->alias()); - else - net->terminals().add(termname); - } - - const pstring get_nl_val(const double val) - { - { - int i = 0; - while (m_sp_units[i].sp_unit != "-" ) - { - if (m_sp_units[i].mult <= nl_math::abs(val)) - break; - i++; - } - return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); - } - } - double get_sp_unit(const pstring &unit) - { - int i = 0; - while (m_sp_units[i].sp_unit != "-") - { - if (m_sp_units[i].sp_unit == unit) - return m_sp_units[i].mult; - i++; - } - fprintf(stderr, "Unit %s unknown\n", unit.cstr()); - return 0.0; - } - - double get_sp_val(const pstring &sin) - { - int p = sin.len() - 1; - while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) - p--; - pstring val = sin.substr(0,p + 1); - pstring unit = sin.substr(p + 1); - - double ret = get_sp_unit(unit) * val.as_double(); - //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret); - return ret; - } - - void dump_nl() - { - for (int i=0; iterminals()[0].cstr()); - // if the aliased net only has this one terminal connected ==> don't dump - if (net->terminals().size() == 1) - net->set_no_export(); - } - for (int i=0; ihas_value()) - out("%s(%s, %s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); - else if (devs[i]->has_model()) - out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), devs[i]->model().cstr()); - else - out("%s(%s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr()); - } - // print nets - for (int i=0; iis_no_export()) - { - //printf("Net %s\n", net->name().cstr()); - out("NET_C(%s", net->terminals()[0].cstr() ); - for (int j=1; jterminals().size(); j++) - { - out(", %s", net->terminals()[j].cstr() ); - } - out(")\n"); - } - } - devs.clear_and_free(); - nets.clear_and_free(); - pins.clear_and_free(); - alias.clear(); - } - - void out(const char *format, ...) ATTR_PRINTF(2,3) - { - va_list ap; - va_start(ap, format); - m_buf += pstring(format).vprintf(ap); - va_end(ap); - } - - pnamedlist_t nets; - pnamedlist_t devs; - pnamedlist_t pins; - plist_t alias; private: pstringbuffer m_buf; + pnamedlist_t devs; + pnamedlist_t m_nets; + plist_t m_ext_alias; + pnamedlist_t m_pins; + static sp_unit m_sp_units[]; }; @@ -261,8 +289,7 @@ public: // FIXME: Parameter out("NETLIST_START(dummy)\n"); - nets.add(palloc(sp_net_t, "0"), false); - nets[0]->terminals().add("GND"); + add_term("0", "GND"); pstring line = ""; @@ -305,7 +332,7 @@ protected: { out("NETLIST_START(%s)\n", tt[1].cstr()); for (int i=2; i 5) - devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false); + add_device("QBJT", tt[0], tt[5]); else - devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false); + add_device("QBJT", tt[0], tt[4]); add_term(tt[1], tt[0] + ".C"); add_term(tt[2], tt[0] + ".B"); add_term(tt[3], tt[0] + ".E"); @@ -334,13 +361,13 @@ protected: break; case 'R': val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "RES", tt[0], val), false); + add_device("RES", tt[0], val); add_term(tt[1], tt[0] + ".1"); add_term(tt[2], tt[0] + ".2"); break; case 'C': val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "CAP", tt[0], val), false); + add_device("CAP", tt[0], val); add_term(tt[1], tt[0] + ".1"); add_term(tt[2], tt[0] + ".2"); break; @@ -349,7 +376,7 @@ protected: if (tt[2].equals("0")) { val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false); + add_device("ANALOG_INPUT", tt[0], val); add_term(tt[1], tt[0] + ".Q"); //add_term(tt[2], tt[0] + ".2"); } @@ -358,7 +385,7 @@ protected: break; case 'D': // FIXME: Rewrite resistor value - devs.add(palloc(sp_dev_t, "DIODE", tt[0], tt[3]), false); + add_device("DIODE", tt[0], tt[3]); add_term(tt[1], tt[0] + ".A"); add_term(tt[2], tt[0] + ".K"); break; @@ -371,7 +398,7 @@ protected: pstring xname = tt[0].replace(".", "_"); pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; - devs.add(palloc(sp_dev_t, tname, xname), false); + add_device(tname, xname); for (int i=1; i < tt.size() - 1; i++) { pstring term = pstring::sprintf("%s.%d", xname.cstr(), i); @@ -449,10 +476,8 @@ public: tok.reset(contents.cstr()); out("NETLIST_START(dummy)\n"); - nets.add(palloc(sp_net_t, "GND"), false); - nets[0]->terminals().add("GND"); - nets.add(palloc(sp_net_t, "VCC"), false); - nets[1]->terminals().add("VCC"); + add_term("GND", "GND"); + add_term("VCC", "VCC"); eagle_tokenizer::token_t token = tok.get_token(); while (true) { @@ -489,60 +514,41 @@ public: { case 'Q': { - devs.add(palloc(sp_dev_t, "QBJT", name, sval), false); -#if 0 - if ((!cerr || tt[4].startsWith("N")) && tt.size() > 5) - devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false); - else - devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false); -#endif + add_device("QBJT", name, sval); } break; case 'R': { double val = get_sp_val(sval); - devs.add(palloc(sp_dev_t, "RES", name, val), false); + add_device("RES", name, val); } break; case 'C': { double val = get_sp_val(sval); - devs.add(palloc(sp_dev_t, "CAP", name, val), false); + add_device("CAP", name, val); } break; case 'P': if (sval.ucase() == "HIGH") - devs.add(palloc(sp_dev_t, "TTL_INPUT", name, 1), false); + add_device("TTL_INPUT", name, 1); else if (sval.ucase() == "LOW") - devs.add(palloc(sp_dev_t, "TTL_INPUT", name, 0), false); + add_device("TTL_INPUT", name, 0); else - devs.add(palloc(sp_dev_t, "ANALOG_INPUT", name, sval.as_double()), false); - pins.add(palloc(sp_pin_alias_t, name + ".1", name + ".Q"), false); - -#if 0 - // just simple Voltage sources .... - if (tt[2].equals("0")) - { - val = get_sp_val(tt[3]); - devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false); - add_term(tt[1], tt[0] + ".Q"); - //add_term(tt[2], tt[0] + ".2"); - } - else - fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); -#endif + add_device("ANALOG_INPUT", name, sval.as_double()); + add_pin_alias(name, "1", "Q"); break; case 'D': /* Pin 1 = Anode, Pin 2 = Cathode */ - devs.add(palloc(sp_dev_t, "DIODE", name, sval), false); - pins.add(palloc(sp_pin_alias_t, name + ".1", name + ".A"), false); - pins.add(palloc(sp_pin_alias_t, name + ".2", name + ".K"), false); + add_device("DIODE", name, sval); + add_pin_alias(name, "1", "A"); + add_pin_alias(name, "2", "K"); break; case 'U': case 'X': { pstring tname = "TTL_" + sval + "_DIP"; - devs.add(palloc(sp_dev_t, tname, name), false); + add_device(tname, name); break; } default: From 3a455f75a53597594dcddb87b65346aada870527 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 31 May 2015 00:25:13 +0200 Subject: [PATCH 028/284] Netlist now uses the same approach as delegate.h to derive member function pointers. If the platform doesn't support this approach, virtual function calls will be used. In addition, this commit contains modifications for standalone compile. (nw) --- src/emu/machine/netlist.c | 2 +- src/emu/netlist/analog/nld_ms_direct.h | 8 +- src/emu/netlist/analog/nld_ms_direct1.h | 2 +- src/emu/netlist/analog/nld_ms_direct2.h | 2 +- src/emu/netlist/analog/nld_ms_sor.h | 2 +- src/emu/netlist/analog/nld_ms_sor_mat.h | 4 +- src/emu/netlist/analog/nld_solver.c | 14 +-- src/emu/netlist/analog/nld_solver.h | 2 +- src/emu/netlist/analog/nld_twoterm.c | 2 + src/emu/netlist/devices/nld_system.h | 18 ++-- src/emu/netlist/nl_base.c | 21 +++-- src/emu/netlist/nl_base.h | 26 ++---- src/emu/netlist/nl_config.h | 62 +++++++++---- src/emu/netlist/nl_setup.c | 14 +-- src/emu/netlist/nl_setup.h | 8 +- src/emu/netlist/nl_time.h | 48 +++++----- src/emu/netlist/nl_util.h | 1 + src/emu/netlist/plib/palloc.h | 14 ++- src/emu/netlist/plib/pconfig.h | 116 +++++++++++++++++++++--- src/emu/netlist/plib/pparser.c | 1 + src/emu/netlist/plib/pstate.h | 1 + src/emu/netlist/plib/pstring.c | 2 +- src/emu/netlist/plib/pstring.h | 2 + src/emu/netlist/tools/nl_convert.h | 3 +- src/tools/nltool.c | 17 +++- 25 files changed, 266 insertions(+), 126 deletions(-) diff --git a/src/emu/machine/netlist.c b/src/emu/machine/netlist.c index 125f34c9f33..794eaa28454 100644 --- a/src/emu/machine/netlist.c +++ b/src/emu/machine/netlist.c @@ -294,7 +294,7 @@ void netlist_mame_device_t::device_start() //printf("clock is %d\n", clock()); m_netlist = global_alloc_clear(netlist_mame_t(*this)); - m_setup = global_alloc_clear(netlist_setup_t(*m_netlist)); + m_setup = global_alloc_clear(netlist_setup_t(m_netlist)); netlist().init_object(*m_netlist, "netlist"); m_setup->init(); diff --git a/src/emu/netlist/analog/nld_ms_direct.h b/src/emu/netlist/analog/nld_ms_direct.h index b5021e1c9f6..92d6d7b5fe4 100644 --- a/src/emu/netlist/analog/nld_ms_direct.h +++ b/src/emu/netlist/analog/nld_ms_direct.h @@ -15,8 +15,8 @@ class netlist_matrix_solver_direct_t: public netlist_matrix_solver_t { public: - netlist_matrix_solver_direct_t(const netlist_solver_parameters_t ¶ms, const int size); - netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t ¶ms, const int size); + netlist_matrix_solver_direct_t(const netlist_solver_parameters_t *params, const int size); + netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t *params, const int size); virtual ~netlist_matrix_solver_direct_t(); @@ -417,7 +417,7 @@ ATTR_HOT inline int netlist_matrix_solver_direct_t::vsolve_non_ } template -netlist_matrix_solver_direct_t::netlist_matrix_solver_direct_t(const netlist_solver_parameters_t ¶ms, const int size) +netlist_matrix_solver_direct_t::netlist_matrix_solver_direct_t(const netlist_solver_parameters_t *params, const int size) : netlist_matrix_solver_t(GAUSSIAN_ELIMINATION, params) , m_dim(size) , m_lp_fact(0) @@ -434,7 +434,7 @@ netlist_matrix_solver_direct_t::netlist_matrix_solver_direct_t( } template -netlist_matrix_solver_direct_t::netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t ¶ms, const int size) +netlist_matrix_solver_direct_t::netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t *params, const int size) : netlist_matrix_solver_t(type, params) , m_dim(size) , m_lp_fact(0) diff --git a/src/emu/netlist/analog/nld_ms_direct1.h b/src/emu/netlist/analog/nld_ms_direct1.h index 6b901417a0a..991da037591 100644 --- a/src/emu/netlist/analog/nld_ms_direct1.h +++ b/src/emu/netlist/analog/nld_ms_direct1.h @@ -15,7 +15,7 @@ class netlist_matrix_solver_direct1_t: public netlist_matrix_solver_direct_t<1,1 { public: - netlist_matrix_solver_direct1_t(const netlist_solver_parameters_t ¶ms) + netlist_matrix_solver_direct1_t(const netlist_solver_parameters_t *params) : netlist_matrix_solver_direct_t<1, 1>(params, 1) {} ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson); diff --git a/src/emu/netlist/analog/nld_ms_direct2.h b/src/emu/netlist/analog/nld_ms_direct2.h index 2aa8d749aaa..69df8085c57 100644 --- a/src/emu/netlist/analog/nld_ms_direct2.h +++ b/src/emu/netlist/analog/nld_ms_direct2.h @@ -17,7 +17,7 @@ class netlist_matrix_solver_direct2_t: public netlist_matrix_solver_direct_t<2,2 { public: - netlist_matrix_solver_direct2_t(const netlist_solver_parameters_t ¶ms) + netlist_matrix_solver_direct2_t(const netlist_solver_parameters_t *params) : netlist_matrix_solver_direct_t<2, 2>(params, 2) {} ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson); diff --git a/src/emu/netlist/analog/nld_ms_sor.h b/src/emu/netlist/analog/nld_ms_sor.h index 25799dbb1e6..810e88799ac 100644 --- a/src/emu/netlist/analog/nld_ms_sor.h +++ b/src/emu/netlist/analog/nld_ms_sor.h @@ -20,7 +20,7 @@ class netlist_matrix_solver_SOR_t: public netlist_matrix_solver_direct_t(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size) , m_lp_fact(0) , m_gs_fail(0) diff --git a/src/emu/netlist/analog/nld_ms_sor_mat.h b/src/emu/netlist/analog/nld_ms_sor_mat.h index 9c5a29382f1..adc65170a87 100644 --- a/src/emu/netlist/analog/nld_ms_sor_mat.h +++ b/src/emu/netlist/analog/nld_ms_sor_mat.h @@ -20,9 +20,9 @@ class netlist_matrix_solver_SOR_mat_t: public netlist_matrix_solver_direct_t(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size) - , m_omega(params.m_sor) + , m_omega(params->m_sor) , m_lp_fact(0) , m_gs_fail(0) , m_gs_total(0) diff --git a/src/emu/netlist/analog/nld_solver.c b/src/emu/netlist/analog/nld_solver.c index 4f4ea19c79c..41a13792490 100644 --- a/src/emu/netlist/analog/nld_solver.c +++ b/src/emu/netlist/analog/nld_solver.c @@ -64,11 +64,11 @@ ATTR_COLD void terms_t::set_pointers() // netlist_matrix_solver // ---------------------------------------------------------------------------------------- -ATTR_COLD netlist_matrix_solver_t::netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms) +ATTR_COLD netlist_matrix_solver_t::netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t *params) : m_stat_calculations(0), m_stat_newton_raphson(0), m_stat_vsolver_calls(0), - m_params(params), + m_params(*params), m_cur_ts(0), m_type(type) { @@ -399,9 +399,9 @@ template netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int gs_threshold, const bool use_specific) { if (use_specific && m_N == 1) - return palloc(netlist_matrix_solver_direct1_t, m_params); + return palloc(netlist_matrix_solver_direct1_t, &m_params); else if (use_specific && m_N == 2) - return palloc(netlist_matrix_solver_direct2_t, m_params); + return palloc(netlist_matrix_solver_direct2_t, &m_params); else { if (size >= gs_threshold) @@ -409,18 +409,18 @@ netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int if (USE_MATRIX_GS) { typedef netlist_matrix_solver_SOR_mat_t solver_mat; - return palloc(solver_mat, m_params, size); + return palloc(solver_mat, &m_params, size); } else { typedef netlist_matrix_solver_SOR_t solver_GS; - return palloc(solver_GS, m_params, size); + return palloc(solver_GS, &m_params, size); } } else { typedef netlist_matrix_solver_direct_t solver_D; - return palloc(solver_D, m_params, size); + return palloc(solver_D, &m_params, size); } } } diff --git a/src/emu/netlist/analog/nld_solver.h b/src/emu/netlist/analog/nld_solver.h index 7ab2f4a7733..23c050c11a4 100644 --- a/src/emu/netlist/analog/nld_solver.h +++ b/src/emu/netlist/analog/nld_solver.h @@ -99,7 +99,7 @@ public: GAUSS_SEIDEL }; - ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms); + ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t *params); /* ATTR_COLD */ virtual ~netlist_matrix_solver_t(); /* ATTR_COLD */ virtual void vsetup(netlist_analog_net_t::list_t &nets) = 0; diff --git a/src/emu/netlist/analog/nld_twoterm.c b/src/emu/netlist/analog/nld_twoterm.c index 02ec7fa9c29..5c43a500d88 100644 --- a/src/emu/netlist/analog/nld_twoterm.c +++ b/src/emu/netlist/analog/nld_twoterm.c @@ -5,6 +5,8 @@ * */ +#include + #include "nld_twoterm.h" #include "nld_solver.h" diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h index f764f0027e6..cefd11c5549 100644 --- a/src/emu/netlist/devices/nld_system.h +++ b/src/emu/netlist/devices/nld_system.h @@ -261,12 +261,12 @@ private: class nld_base_proxy : public netlist_device_t { public: - ATTR_COLD nld_base_proxy(netlist_logic_t &inout_proxied, netlist_core_terminal_t &proxy_inout) + ATTR_COLD nld_base_proxy(netlist_logic_t *inout_proxied, netlist_core_terminal_t *proxy_inout) : netlist_device_t() { - m_logic_family = inout_proxied.logic_family(); - m_term_proxied = &inout_proxied; - m_proxy_term = &proxy_inout; + m_logic_family = inout_proxied->logic_family(); + m_term_proxied = inout_proxied; + m_proxy_term = proxy_inout; } /* ATTR_COLD */ virtual ~nld_base_proxy() {} @@ -294,8 +294,8 @@ private: class nld_a_to_d_proxy : public nld_base_proxy { public: - ATTR_COLD nld_a_to_d_proxy(netlist_logic_input_t &in_proxied) - : nld_base_proxy(in_proxied, m_I) + ATTR_COLD nld_a_to_d_proxy(netlist_logic_input_t *in_proxied) + : nld_base_proxy(in_proxied, &m_I) { } @@ -336,7 +336,7 @@ private: class nld_base_d_to_a_proxy : public nld_base_proxy { public: - ATTR_COLD nld_base_d_to_a_proxy(netlist_logic_output_t &out_proxied, netlist_core_terminal_t &proxy_out) + ATTR_COLD nld_base_d_to_a_proxy(netlist_logic_output_t *out_proxied, netlist_core_terminal_t *proxy_out) : nld_base_proxy(out_proxied, proxy_out) { } @@ -359,8 +359,8 @@ private: class nld_d_to_a_proxy : public nld_base_d_to_a_proxy { public: - ATTR_COLD nld_d_to_a_proxy(netlist_logic_output_t &out_proxied) - : nld_base_d_to_a_proxy(out_proxied, m_RV.m_P) + ATTR_COLD nld_d_to_a_proxy(netlist_logic_output_t *out_proxied) + : nld_base_d_to_a_proxy(out_proxied, &m_RV.m_P) , m_RV(TWOTERM) , m_last_state(-1) , m_is_timestep(false) diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index b07e462f4f4..e3f2361d337 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -6,6 +6,7 @@ */ #include +#include #include "plib/palloc.h" @@ -51,7 +52,7 @@ public: m_R_low = 1.0; m_R_high = 130.0; } - virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t &proxied) const + virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t *proxied) const { return palloc(nld_d_to_a_proxy , proxied); } @@ -71,7 +72,7 @@ public: m_R_low = 1.0; m_R_high = 130.0; } - virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t &proxied) const + virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t *proxied) const { return palloc(nld_d_to_a_proxy , proxied); } @@ -419,15 +420,15 @@ ATTR_COLD void netlist_core_device_t::init(netlist_base_t &anetlist, const pstri set_logic_family(this->default_logic_family()); init_object(anetlist, name); -#if USE_PMFDELEGATES +#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update; -#if NO_USE_PMFCONVERSION static_update = pFunc; -#else +#elif (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) + void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update; static_update = reinterpret_cast((this->*pFunc)); +#elif (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL) + static_update = pmfp::get_mfp(&netlist_core_device_t::update, this); #endif -#endif - } ATTR_COLD netlist_core_device_t::~netlist_core_device_t() @@ -665,7 +666,7 @@ ATTR_COLD void netlist_net_t::save_register() netlist_object_t::save_register(); } -ATTR_HOT inline void netlist_core_terminal_t::update_dev(const UINT32 mask) +ATTR_HOT /* inline */ void netlist_core_terminal_t::update_dev(const UINT32 mask) { inc_stat(netdev().stat_call_count); if ((state() & mask) != 0) @@ -674,7 +675,7 @@ ATTR_HOT inline void netlist_core_terminal_t::update_dev(const UINT32 mask) } } -ATTR_HOT inline void netlist_net_t::update_devs() +ATTR_HOT /* inline */ void netlist_net_t::update_devs() { //assert(m_num_cons != 0); nl_assert(this->isRailNet()); @@ -1056,7 +1057,7 @@ ATTR_COLD nl_double netlist_param_model_t::model_value(const pstring &entity, co // mainclock // ---------------------------------------------------------------------------------------- -ATTR_HOT inline void NETLIB_NAME(mainclock)::mc_update(netlist_logic_net_t &net) +ATTR_HOT /* inline */ void NETLIB_NAME(mainclock)::mc_update(netlist_logic_net_t &net) { net.toggle_new_Q(); net.update_devs(); diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index 042843b4dc5..fe70e4677ac 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -170,13 +170,11 @@ class netlist_core_device_t; -#if USE_PMFDELEGATES -#if NO_USE_PMFCONVERSION +#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) typedef void (netlist_core_device_t::*net_update_delegate)(); -#else +#elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) typedef void (*net_update_delegate)(netlist_core_device_t *); #endif -#endif //============================================================ // MACROS / netlist devices @@ -312,7 +310,7 @@ class netlist_logic_family_desc_t { public: virtual ~netlist_logic_family_desc_t() {} - virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t &proxied) const = 0; + virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t *proxied) const = 0; nl_double m_low_thresh_V; nl_double m_high_thresh_V; @@ -482,7 +480,7 @@ public: } - ATTR_HOT inline void update_dev(const UINT32 mask); + ATTR_HOT /* inline */ void update_dev(const UINT32 mask); protected: /* ATTR_COLD */ virtual void save_register() @@ -1016,12 +1014,11 @@ public: { begin_timing(stat_total_time); inc_stat(stat_update_count); -#if USE_PMFDELEGATES -#if NO_USE_PMFCONVERSION + +#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) (this->*static_update)(); -#else +#elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) static_update(this); -#endif #else update(); #endif @@ -1059,8 +1056,6 @@ public: ATTR_HOT virtual void step_time(ATTR_UNUSED const nl_double st) { } ATTR_HOT virtual void update_terminals() { } - - #if (NL_KEEP_STATISTICS) /* stats */ osd_ticks_t stat_total_time; @@ -1068,10 +1063,6 @@ public: INT32 stat_call_count; #endif -#if USE_PMFDELEGATES - net_update_delegate static_update; -#endif - protected: ATTR_HOT virtual void update() { } @@ -1083,6 +1074,9 @@ protected: } private: +#if (NL_PMF_TYPE > NL_PMF_TYPE_VIRTUAL) + net_update_delegate static_update; +#endif }; diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index c6b5373fb26..b3f0e219d4e 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -15,30 +15,55 @@ //============================================================ /* - * The next options needs -Wno-pmf-conversions to compile and gcc - * There is quite some significant speed-up of up to 20% involved. - * NO_USE_PMFCONVERSION is for illustrative purposes only. Using PMFs - * has some overhead in comparison to calling a virtual function. + * The following options determine how object::update is called. + * NL_PMF_TYPE_VIRTUAL + * Use stock virtual call * - * To get a performance increase we need the GCC extension. + * NL_PMF_TYPE_GNUC_PMF + * Use standard pointer to member function syntax * - * Todo: This doesn't work with current (4.8+) mingw 32bit builds. - * Therefore disabled for now for i386 builds. + * NL_PMF_TYPE_GNUC_PMF_CONV + * Use gnu extension and convert the pmf to a function pointer. + * This is not standard compliant and needs + * -Wno-pmf-conversions to compile. * + * NL_PMF_TYPE_INTERNAL + * Use the same approach as MAME for deriving the function pointer. + * This is compiler-dependant as well + * + * Benchmarks for ./nltool -c run -f src/mame/drivers/nl_pong.c -t 10 -n pong_fast + * + * NL_PMF_TYPE_INTERNAL: 215% + * NL_PMF_TYPE_GNUC_PMF: 163% + * NL_PMF_TYPE_GNUC_PMF_CONV: 215% + * NL_PMF_TYPE_VIRTUAL: 213% + * + * The whole exercise was done to avoid virtual calls. In prior versions of + * netlist, the INTERNAL and GNUC_PMF_CONV approach provided significant improvement. + * Since than, ATTR_COLD was removed from functions declared as virtual. + * This may explain that the recent benchmarks show no difference at all. + * + * Disappointing is the GNUC_PMF performance. */ -#ifndef USE_PMFDELEGATES -#if defined(__clang__) || defined(__APPLE__) || (defined(__GNUC__) && defined(__i386__)) - #define USE_PMFDELEGATES (0) - #define NO_USE_PMFCONVERSION (1) -#elif defined(__GNUC__) - #define USE_PMFDELEGATES (0) - #define NO_USE_PMFCONVERSION (0) - #pragma GCC diagnostic ignored "-Wpmf-conversions" -#else - #define USE_PMFDELEGATES (0) - #define NO_USE_PMFCONVERSION (1) +// This will be autodetected +// #define NL_PMF_TYPE 3 + +#define NL_PMF_TYPE_VIRTUAL 0 +#define NL_PMF_TYPE_GNUC_PMF 1 +#define NL_PMF_TYPE_GNUC_PMF_CONV 2 +#define NL_PMF_TYPE_INTERNAL 3 + +#ifndef NL_PMF_TYPE + #if PHAS_PMF_INTERNAL + #define NL_PMF_TYPE NL_PMF_TYPE_INTERNAL + #else + #define NL_PMF_TYPE NL_PMF_TYPE_VIRTUAL + #endif #endif + +#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) +#pragma GCC diagnostic ignored "-Wpmf-conversions" #endif /* @@ -69,7 +94,6 @@ #define NETLIST_GMIN_DEFAULT (1e-9) - //#define nl_double float //#define NL_FCONST(x) (x ## f) diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 5799a8dddcd..04145bc5ead 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -34,11 +34,11 @@ NETLIST_END() // netlist_setup_t // ---------------------------------------------------------------------------------------- -netlist_setup_t::netlist_setup_t(netlist_base_t &netlist) +netlist_setup_t::netlist_setup_t(netlist_base_t *netlist) : m_netlist(netlist) , m_proxy_cnt(0) { - netlist.set_setup(this); + netlist->set_setup(this); m_factory = palloc(netlist_factory_list_t); } @@ -394,7 +394,7 @@ nld_base_proxy *netlist_setup_t::get_d_a_proxy(netlist_core_terminal_t &out) if (proxy == NULL) { // create a new one ... - nld_base_d_to_a_proxy *new_proxy = out_cast.logic_family()->create_d_a_proxy(out_cast); + nld_base_d_to_a_proxy *new_proxy = out_cast.logic_family()->create_d_a_proxy(&out_cast); pstring x = pstring::sprintf("proxy_da_%s_%d", out.name().cstr(), m_proxy_cnt); m_proxy_cnt++; @@ -425,7 +425,7 @@ void netlist_setup_t::connect_input_output(netlist_core_terminal_t &in, netlist_ if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC)) { netlist_logic_input_t &incast = dynamic_cast(in); - nld_a_to_d_proxy *proxy = palloc(nld_a_to_d_proxy, incast); + nld_a_to_d_proxy *proxy = palloc(nld_a_to_d_proxy, &incast); incast.set_proxy(proxy); pstring x = pstring::sprintf("proxy_ad_%s_%d", in.name().cstr(), m_proxy_cnt); m_proxy_cnt++; @@ -464,7 +464,7 @@ void netlist_setup_t::connect_terminal_input(netlist_terminal_t &term, netlist_c { netlist_logic_input_t &incast = dynamic_cast(inp); NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n")); - nld_a_to_d_proxy *proxy = palloc(nld_a_to_d_proxy, incast); + nld_a_to_d_proxy *proxy = palloc(nld_a_to_d_proxy, &incast); incast.set_proxy(proxy); pstring x = pstring::sprintf("proxy_ad_%s_%d", inp.name().cstr(), m_proxy_cnt); m_proxy_cnt++; @@ -745,13 +745,13 @@ void netlist_setup_t::resolve_inputs() netlist().log("initialize solver ...\n"); - if (m_netlist.solver() == NULL) + if (netlist().solver() == NULL) { if (has_twoterms) netlist().error("No solver found for this net although analog elements are present\n"); } else - m_netlist.solver()->post_start(); + netlist().solver()->post_start(); } diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index df9cebac2ce..f1f117e8fc6 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -107,13 +107,13 @@ public: typedef pnamedlist_t tagmap_terminal_t; typedef plist_t tagmap_link_t; - netlist_setup_t(netlist_base_t &netlist); + netlist_setup_t(netlist_base_t *netlist); ~netlist_setup_t(); void init(); - netlist_base_t &netlist() { return m_netlist; } - const netlist_base_t &netlist() const { return m_netlist; } + netlist_base_t &netlist() { return *m_netlist; } + const netlist_base_t &netlist() const { return *m_netlist; } pstring build_fqn(const pstring &obj_name) const; @@ -159,7 +159,7 @@ protected: private: - netlist_base_t &m_netlist; + netlist_base_t *m_netlist; tagmap_nstring_t m_alias; tagmap_param_t m_params; diff --git a/src/emu/netlist/nl_time.h b/src/emu/netlist/nl_time.h index 365fd271c19..a6ca27191e2 100644 --- a/src/emu/netlist/nl_time.h +++ b/src/emu/netlist/nl_time.h @@ -31,44 +31,44 @@ public: static const INTERNALTYPE RESOLUTION = NETLIST_INTERNAL_RES; - ATTR_HOT inline netlist_time() : m_time(0) {} + ATTR_HOT /* inline */ netlist_time() : m_time(0) {} - ATTR_HOT friend inline const netlist_time operator-(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline const netlist_time operator+(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline const netlist_time operator*(const netlist_time &left, const UINT32 factor); - ATTR_HOT friend inline UINT32 operator/(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline bool operator>(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline bool operator<(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline bool operator>=(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline bool operator<=(const netlist_time &left, const netlist_time &right); - ATTR_HOT friend inline bool operator!=(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ const netlist_time operator-(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ const netlist_time operator+(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ const netlist_time operator*(const netlist_time &left, const UINT32 factor); + ATTR_HOT friend /* inline */ UINT32 operator/(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ bool operator>(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ bool operator<(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ bool operator>=(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ bool operator<=(const netlist_time &left, const netlist_time &right); + ATTR_HOT friend /* inline */ bool operator!=(const netlist_time &left, const netlist_time &right); - ATTR_HOT inline const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; } - ATTR_HOT inline const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; } + ATTR_HOT /* inline */ const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; } + ATTR_HOT /* inline */ const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; } // issues with ISO C++ standard - //ATTR_HOT inline operator double() const { return as_double(); } + //ATTR_HOT /* inline */ operator double() const { return as_double(); } - ATTR_HOT inline const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; } + ATTR_HOT /* inline */ const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; } - ATTR_HOT inline INTERNALTYPE as_raw() const { return m_time; } - ATTR_HOT inline double as_double() const { return (double) m_time / (double) RESOLUTION; } + ATTR_HOT /* inline */ INTERNALTYPE as_raw() const { return m_time; } + ATTR_HOT /* inline */ double as_double() const { return (double) m_time / (double) RESOLUTION; } // for save states .... - ATTR_HOT inline INTERNALTYPE *get_internaltype_ptr() { return &m_time; } + ATTR_HOT /* inline */ INTERNALTYPE *get_internaltype_ptr() { return &m_time; } - ATTR_HOT static inline const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); } - ATTR_HOT static inline const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); } - ATTR_HOT static inline const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); } - ATTR_HOT static inline const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); } - ATTR_HOT static inline const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); } - ATTR_HOT static inline const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); } + ATTR_HOT static /* inline */ const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); } + ATTR_HOT static /* inline */ const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); } + ATTR_HOT static /* inline */ const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); } + ATTR_HOT static /* inline */ const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); } + ATTR_HOT static /* inline */ const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); } + ATTR_HOT static /* inline */ const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); } static const netlist_time zero; protected: - ATTR_HOT inline netlist_time(const INTERNALTYPE val) : m_time(val) {} + ATTR_HOT /* inline */ netlist_time(const INTERNALTYPE val) : m_time(val) {} private: INTERNALTYPE m_time; diff --git a/src/emu/netlist/nl_util.h b/src/emu/netlist/nl_util.h index 09a06ce976a..020f8622208 100644 --- a/src/emu/netlist/nl_util.h +++ b/src/emu/netlist/nl_util.h @@ -10,6 +10,7 @@ #include #include +#include #include "plib/pstring.h" #include "plib/plists.h" diff --git a/src/emu/netlist/plib/palloc.h b/src/emu/netlist/plib/palloc.h index e78bbc6e3ab..c5d060196f1 100644 --- a/src/emu/netlist/plib/palloc.h +++ b/src/emu/netlist/plib/palloc.h @@ -40,28 +40,28 @@ inline T *palloc_t() } template -inline T *palloc_t(P1 &p1) +inline T *palloc_t(P1 p1) { void *p = palloc_raw(sizeof(T)); return new (p) T(p1); } template -inline T *palloc_t(P1 &p1, P2 &p2) +inline T *palloc_t(P1 p1, P2 p2) { void *p = palloc_raw(sizeof(T)); return new (p) T(p1, p2); } template -inline T *palloc_t(P1 &p1, P2 &p2, P3 &p3) +inline T *palloc_t(P1 p1, P2 p2, P3 p3) { void *p = palloc_raw(sizeof(T)); return new (p) T(p1, p2, p3); } template -inline T *palloc_t(P1 &p1, P2 &p2, P3 &p3, P4 &p4, P5 &p5, P6 &p6, P7 &p7) +inline T *palloc_t(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) { void *p = palloc_raw(sizeof(T)); return new (p) T(p1, p2, p3, p4, p5, p6, p7); @@ -87,9 +87,13 @@ inline void pfree_array_t(T *p) delete[] p; } +#if 1 #define palloc(T, ...) palloc_t(__VA_ARGS__) #define pfree(_ptr) pfree_t(_ptr) - +#else +#define palloc(T, ...) new T(__VA_ARGS__) +#define pfree(_ptr) delete(_ptr) +#endif #define palloc_array(T, N) palloc_array_t(N) #define pfree_array(_ptr) pfree_array_t(_ptr) diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h index fbbb0d0a4c9..5598906d730 100644 --- a/src/emu/netlist/plib/pconfig.h +++ b/src/emu/netlist/plib/pconfig.h @@ -12,24 +12,56 @@ #define PSTANDALONE (0) #endif -//============================================================ -// Compiling standalone -//============================================================ - -// Compiling without mame ? - -#include -#include - #if !(PSTANDALONE) #include "osdcore.h" #include "eminline.h" -#undef ATTR_COLD -#define ATTR_COLD +#ifndef assert +#define assert(x) do {} while (0) +#endif + +#include "delegate.h" #else #include +#include +#endif + +//============================================================ +// Compiling standalone +//============================================================ + +#if !(PSTANDALONE) + +#undef ATTR_COLD +#define ATTR_COLD + +/* use MAME */ +#if (USE_DELEGATE_TYPE == DELEGATE_TYPE_INTERNAL) +#define PHAS_PMF_INTERNAL 1 +#else +#define PHAS_PMF_INTERNAL 0 +#endif + +#else + +/* determine PMF approach */ + +#if defined(__GNUC__) + /* does not work in versions over 4.7.x of 32bit MINGW */ + #if defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) + #define PHAS_PMF_INTERNAL 0 + #elif defined(EMSCRIPTEN) + #define PHAS_PMF_INTERNAL 0 + #elif defined(__arm__) || defined(__ARMEL__) + #define PHAS_PMF_INTERNAL 0 + #else + #define PHAS_PMF_INTERNAL 1 + #endif +#else +#define USE_DELEGATE_TYPE PHAS_PMF_INTERNAL 0 +#endif + /* not supported in GCC prior to 4.4.x */ /* ATTR_HOT and ATTR_COLD cause performance degration in 5.1 */ @@ -97,4 +129,66 @@ typedef int64_t INT64; #endif +/* + * The following class was derived from the MAME delegate.h code. + * It derives a pointer to a member function. + */ + +#if (PHAS_PMF_INTERNAL) +class pmfp +{ +public: + // construct from any member function pointer + class generic_class; + typedef void (*generic_function)(); + + #if (PSTANDALONE) + typedef std::size_t FPTR; + #endif + + template + pmfp(_MemberFunctionType mfp) + : m_function(0), m_this_delta(0) + { + *reinterpret_cast<_MemberFunctionType *>(this) = mfp; + } + + // binding helper + template + _FunctionType update_after_bind(_ObjectType *object) + { + return reinterpret_cast<_FunctionType>( + convert_to_generic(reinterpret_cast(object))); + } + template + static _FunctionType get_mfp(_MemberFunctionType mfp, _ObjectType *object) + { + pmfp mfpo(mfp); + return mfpo.update_after_bind<_FunctionType>(object); + } + +private: + // extract the generic function and adjust the object pointer + generic_function convert_to_generic(generic_class * object) const + { + // apply the "this" delta to the object first + generic_class * o_p_delta = reinterpret_cast(reinterpret_cast(object) + m_this_delta); + + // if the low bit of the vtable index is clear, then it is just a raw function pointer + if (!(m_function & 1)) + return reinterpret_cast(m_function); + + // otherwise, it is the byte index into the vtable where the actual function lives + UINT8 *vtable_base = *reinterpret_cast(o_p_delta); + return *reinterpret_cast(vtable_base + m_function - 1); + } + + // actual state + FPTR m_function; // first item can be one of two things: + // if even, it's a pointer to the function + // if odd, it's the byte offset into the vtable + int m_this_delta; // delta to apply to the 'this' pointer +}; +#endif + #endif /* PCONFIG_H_ */ diff --git a/src/emu/netlist/plib/pparser.c b/src/emu/netlist/plib/pparser.c index 95b9260c7cd..6022eef1426 100644 --- a/src/emu/netlist/plib/pparser.c +++ b/src/emu/netlist/plib/pparser.c @@ -6,6 +6,7 @@ */ #include +#include #include "pparser.h" diff --git a/src/emu/netlist/plib/pstate.h b/src/emu/netlist/plib/pstate.h index 73b83e65a00..27e0ea08ebb 100644 --- a/src/emu/netlist/plib/pstate.h +++ b/src/emu/netlist/plib/pstate.h @@ -71,6 +71,7 @@ NETLIST_SAVE_TYPE(INT32, DT_INT); NETLIST_SAVE_TYPE(UINT16, DT_INT16); NETLIST_SAVE_TYPE(INT16, DT_INT16); //NETLIST_SAVE_TYPE(netlist_time::INTERNALTYPE, DT_INT64); +//NETLIST_SAVE_TYPE(std::size_t, DT_INT64); class pstate_manager_t; diff --git a/src/emu/netlist/plib/pstring.c b/src/emu/netlist/plib/pstring.c index 37af773b254..e5f73ffa17b 100644 --- a/src/emu/netlist/plib/pstring.c +++ b/src/emu/netlist/plib/pstring.c @@ -5,12 +5,12 @@ * */ -#include #include #include //FIXME:: pstring should be locale free #include #include +#include #include "pstring.h" #include "palloc.h" diff --git a/src/emu/netlist/plib/pstring.h b/src/emu/netlist/plib/pstring.h index e3054263ed7..44a990c34a3 100644 --- a/src/emu/netlist/plib/pstring.h +++ b/src/emu/netlist/plib/pstring.h @@ -7,6 +7,8 @@ #ifndef _PSTRING_H_ #define _PSTRING_H_ +#include + #include "pconfig.h" // ---------------------------------------------------------------------------------------- diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index 9ecbb186f1f..db5fcbf4f68 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -11,6 +11,7 @@ #define NL_CONVERT_H_ #include +#include #include "plib/pstring.h" #include "plib/plists.h" @@ -462,7 +463,7 @@ public: void verror(pstring msg, int line_num, pstring line) { - m_convert.out("abc"); + m_convert.out("%s (line %d): %s\n", msg.cstr(), line_num, line.cstr()); } diff --git a/src/tools/nltool.c b/src/tools/nltool.c index cd0cc5e62ad..f2cc7e0734c 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -183,7 +183,7 @@ public: void init() { - m_setup = palloc(netlist_setup_t, *this); + m_setup = palloc(netlist_setup_t, this); this->init_object(*this, "netlist"); m_setup->init(); } @@ -349,16 +349,29 @@ static void listdevices() main - primary entry point -------------------------------------------------*/ +#if (!PSTANDALONE) #include "corealloc.h" +#endif + +static const char *pmf_verbose[] = +{ + "NL_PMF_TYPE_VIRTUAL", + "NL_PMF_TYPE_GNUC_PMF", + "NL_PMF_TYPE_GNUC_PMF_CONV", + "NL_PMF_TYPE_INTERNAL" +}; int main(int argc, char *argv[]) { +#if (!PSTANDALONE) track_memory(true); { +#endif tool_options_t opts; int ret; fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n"); + fprintf(stderr, "Update dispatching using method %s\n", pmf_verbose[NL_PMF_TYPE]); if ((ret = opts.parse(argc, argv)) != argc) { fprintf(stderr, "Error parsing %s\n", argv[ret]); @@ -396,7 +409,9 @@ int main(int argc, char *argv[]) usage(opts); return 1; } +#if (!PSTANDALONE) } dump_unfreed_mem(); +#endif return 0; } From 6e4bbb1224de508ea2a7429b78e29bb9390890b0 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 31 May 2015 01:35:14 +0200 Subject: [PATCH 029/284] Fixed clang compile. (nw) --- src/emu/netlist/devices/nld_system.h | 82 ++++++++++++++-------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h index cefd11c5549..84d1f30694d 100644 --- a/src/emu/netlist/devices/nld_system.h +++ b/src/emu/netlist/devices/nld_system.h @@ -133,23 +133,23 @@ NETLIB_DEVICE_WITH_PARAMS(analog_input, class NETLIB_NAME(gnd) : public netlist_device_t { public: - ATTR_COLD NETLIB_NAME(gnd)() + NETLIB_NAME(gnd)() : netlist_device_t(GND) { } - /* ATTR_COLD */ virtual ~NETLIB_NAME(gnd)() {} + virtual ~NETLIB_NAME(gnd)() {} protected: - ATTR_COLD void start() + void start() { register_output("Q", m_Q); } - ATTR_COLD void reset() + void reset() { } - ATTR_HOT void update() + void update() { OUTANALOG(m_Q, 0.0); } @@ -166,23 +166,23 @@ private: class NETLIB_NAME(dummy_input) : public netlist_device_t { public: - ATTR_COLD NETLIB_NAME(dummy_input)() + NETLIB_NAME(dummy_input)() : netlist_device_t(DUMMY) { } - /* ATTR_COLD */ virtual ~NETLIB_NAME(dummy_input)() {} + virtual ~NETLIB_NAME(dummy_input)() {} protected: - ATTR_COLD void start() + void start() { register_input("I", m_I); } - ATTR_COLD void reset() + void reset() { } - ATTR_HOT void update() + void update() { } @@ -198,24 +198,24 @@ private: class NETLIB_NAME(frontier) : public netlist_device_t { public: - ATTR_COLD NETLIB_NAME(frontier)() + NETLIB_NAME(frontier)() : netlist_device_t(DUMMY) { } - /* ATTR_COLD */ virtual ~NETLIB_NAME(frontier)() {} + virtual ~NETLIB_NAME(frontier)() {} protected: - ATTR_COLD void start() + void start() { register_input("I", m_I); register_output("Q", m_Q); } - ATTR_COLD void reset() + void reset() { } - ATTR_HOT void update() + void update() { OUTANALOG(m_Q, INPANALOG(m_I)); } @@ -233,10 +233,10 @@ private: class NETLIB_NAME(res_sw) : public netlist_device_t { public: - ATTR_COLD NETLIB_NAME(res_sw)() + NETLIB_NAME(res_sw)() : netlist_device_t() { } - /* ATTR_COLD */ virtual ~NETLIB_NAME(res_sw)() {} + virtual ~NETLIB_NAME(res_sw)() {} netlist_param_double_t m_RON; netlist_param_double_t m_ROFF; @@ -245,8 +245,8 @@ public: protected: - ATTR_COLD void start(); - ATTR_COLD void reset(); + void start(); + void reset(); ATTR_HOT void update(); ATTR_HOT void update_param(); @@ -261,7 +261,7 @@ private: class nld_base_proxy : public netlist_device_t { public: - ATTR_COLD nld_base_proxy(netlist_logic_t *inout_proxied, netlist_core_terminal_t *proxy_inout) + nld_base_proxy(netlist_logic_t *inout_proxied, netlist_core_terminal_t *proxy_inout) : netlist_device_t() { m_logic_family = inout_proxied->logic_family(); @@ -269,14 +269,14 @@ public: m_proxy_term = proxy_inout; } - /* ATTR_COLD */ virtual ~nld_base_proxy() {} + virtual ~nld_base_proxy() {} - ATTR_COLD netlist_logic_t &term_proxied() const { return *m_term_proxied; } - ATTR_COLD netlist_core_terminal_t &proxy_term() const { return *m_proxy_term; } + netlist_logic_t &term_proxied() const { return *m_term_proxied; } + netlist_core_terminal_t &proxy_term() const { return *m_proxy_term; } protected: - /* ATTR_COLD */ virtual const netlist_logic_family_desc_t &logic_family() const + virtual const netlist_logic_family_desc_t &logic_family() const { return *m_logic_family; } @@ -294,24 +294,24 @@ private: class nld_a_to_d_proxy : public nld_base_proxy { public: - ATTR_COLD nld_a_to_d_proxy(netlist_logic_input_t *in_proxied) + nld_a_to_d_proxy(netlist_logic_input_t *in_proxied) : nld_base_proxy(in_proxied, &m_I) { } - /* ATTR_COLD */ virtual ~nld_a_to_d_proxy() {} + virtual ~nld_a_to_d_proxy() {} netlist_analog_input_t m_I; netlist_logic_output_t m_Q; protected: - ATTR_COLD void start() + void start() { register_input("I", m_I); register_output("Q", m_Q); } - ATTR_COLD void reset() + void reset() { } @@ -336,17 +336,17 @@ private: class nld_base_d_to_a_proxy : public nld_base_proxy { public: - ATTR_COLD nld_base_d_to_a_proxy(netlist_logic_output_t *out_proxied, netlist_core_terminal_t *proxy_out) - : nld_base_proxy(out_proxied, proxy_out) + virtual ~nld_base_d_to_a_proxy() {} + + virtual netlist_logic_input_t &in() { return m_I; } + +protected: + nld_base_d_to_a_proxy(netlist_logic_output_t *out_proxied, netlist_core_terminal_t &proxy_out) + : nld_base_proxy(out_proxied, &proxy_out) { } - /* ATTR_COLD */ virtual ~nld_base_d_to_a_proxy() {} - - /* ATTR_COLD */ virtual netlist_logic_input_t &in() { return m_I; } - -protected: - /* ATTR_COLD */ virtual void start() + virtual void start() { register_input("I", m_I); } @@ -359,20 +359,20 @@ private: class nld_d_to_a_proxy : public nld_base_d_to_a_proxy { public: - ATTR_COLD nld_d_to_a_proxy(netlist_logic_output_t *out_proxied) - : nld_base_d_to_a_proxy(out_proxied, &m_RV.m_P) + nld_d_to_a_proxy(netlist_logic_output_t *out_proxied) + : nld_base_d_to_a_proxy(out_proxied, m_RV.m_P) , m_RV(TWOTERM) , m_last_state(-1) , m_is_timestep(false) { } - /* ATTR_COLD */ virtual ~nld_d_to_a_proxy() {} + virtual ~nld_d_to_a_proxy() {} protected: - /* ATTR_COLD */ virtual void start(); + virtual void start(); - /* ATTR_COLD */ virtual void reset(); + virtual void reset(); ATTR_HOT void update(); From 3a1d3b2b22ca0ef92cde27ddb24826e2d11ee6a7 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sat, 30 May 2015 17:04:22 -0700 Subject: [PATCH 030/284] idehd.c: increase IDE fill-time to avoid missed interrupts [Peter Ferrie] --- src/emu/machine/idehd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/machine/idehd.c b/src/emu/machine/idehd.c index ffb9a026ea8..2cd59aa0892 100644 --- a/src/emu/machine/idehd.c +++ b/src/emu/machine/idehd.c @@ -394,7 +394,7 @@ void ata_mass_storage_device::fill_buffer() { set_dasp(ASSERT_LINE); - start_busy(TIME_BETWEEN_SECTORS, PARAM_COMMAND); + start_busy(TIME_PER_SECTOR, PARAM_COMMAND); } break; } From 810f82fee23c843b081b8efeaad2d594adf01aba Mon Sep 17 00:00:00 2001 From: balr0g Date: Sat, 30 May 2015 21:06:18 -0400 Subject: [PATCH 031/284] Corrections (nw) --- src/mess/machine/cx4data.inc | 2 +- src/mess/machine/cx4fn.inc | 2 +- src/mess/machine/cx4oam.inc | 2 +- src/mess/machine/cx4ops.inc | 2 +- src/mess/machine/snescx4.c | 2 +- src/mess/machine/snescx4.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mess/machine/cx4data.inc b/src/mess/machine/cx4data.inc index b3184a452fb..b7d1610a304 100644 --- a/src/mess/machine/cx4data.inc +++ b/src/mess/machine/cx4data.inc @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:byuu +// copyright-holders:byuu, Nach /*************************************************************************** cx4data.c diff --git a/src/mess/machine/cx4fn.inc b/src/mess/machine/cx4fn.inc index 811a9794e62..2b5a302a227 100644 --- a/src/mess/machine/cx4fn.inc +++ b/src/mess/machine/cx4fn.inc @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:byuu +// copyright-holders:byuu, Nach /*************************************************************************** cx4fn.c diff --git a/src/mess/machine/cx4oam.inc b/src/mess/machine/cx4oam.inc index bcb7d29e922..abf74defea2 100644 --- a/src/mess/machine/cx4oam.inc +++ b/src/mess/machine/cx4oam.inc @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:byuu +// copyright-holders:byuu, Nach /*************************************************************************** cx4oam.c diff --git a/src/mess/machine/cx4ops.inc b/src/mess/machine/cx4ops.inc index 9147bb43869..02b97bc944d 100644 --- a/src/mess/machine/cx4ops.inc +++ b/src/mess/machine/cx4ops.inc @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:byuu +// copyright-holders:byuu, Nach /*************************************************************************** cx4ops.c diff --git a/src/mess/machine/snescx4.c b/src/mess/machine/snescx4.c index 26271e9a751..a4a200452a2 100644 --- a/src/mess/machine/snescx4.c +++ b/src/mess/machine/snescx4.c @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:Fabio Priuli, byuu +// copyright-holders:Fabio Priuli, byuu, Nach /*************************************************************************** snescx4.c diff --git a/src/mess/machine/snescx4.h b/src/mess/machine/snescx4.h index 3a553bfe745..1adca638a39 100644 --- a/src/mess/machine/snescx4.h +++ b/src/mess/machine/snescx4.h @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:Fabio Priuli, byuu +// copyright-holders:Fabio Priuli, byuu, Nach /*************************************************************************** snescx4.h From 16ed4aae36d7380529ec2de37e02c310a2d68175 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 31 May 2015 14:11:06 +1000 Subject: [PATCH 032/284] camplynx: added a popmessage to tell user how to load the tape. --- src/lib/formats/camplynx_cas.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/formats/camplynx_cas.c b/src/lib/formats/camplynx_cas.c index 8c467314e5a..4f53dbdd867 100644 --- a/src/lib/formats/camplynx_cas.c +++ b/src/lib/formats/camplynx_cas.c @@ -23,7 +23,7 @@ Each byte is 8 bits (MSB first) with no start or stop bits. ********************************************************************/ -#include +#include "emu.h" // for popmessage and #include "camplynx_cas.h" @@ -84,13 +84,13 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) UINT32 byte_count = 0; UINT32 i; - /* header zeroes */ for (i=0; i<555; i++) sample_count += camplynx_output_byte(buffer, sample_count, 0); if (bytes[0] == 0x22) { + std::string pgmname = " LOAD \""; byte_count++; sample_count += camplynx_output_byte(buffer, sample_count, 0xA5); sample_count += camplynx_output_byte(buffer, sample_count, 0x22); @@ -99,14 +99,25 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) for (i=1; bytes[i]!=0x22; i++) { if (i < camplynx_image_size) + { sample_count += camplynx_output_byte(buffer, sample_count, bytes[i]); + pgmname.append(1, bytes[i]); + } else return sample_count; byte_count++; } + pgmname.append(1, 0x22); sample_count += camplynx_output_byte(buffer, sample_count, bytes[byte_count++]); // should be 0x22 + // if a machine-language program, say to use MLOAD + if (bytes[byte_count] == 0x4D) + pgmname[0] = 0x4D; + + // Tell user how to load the tape + popmessage("%s",pgmname.c_str()); + /* data zeroes */ for (i=0; i<555; i++) sample_count += camplynx_output_byte(buffer, sample_count, 0); From 81ee2e603e3e61f8a8a01ad4ad4f835e7de7820f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 27 May 2015 16:40:27 +0200 Subject: [PATCH 033/284] Removed -Wno-unused-variable for mingw/gcc (nw) --- scripts/genie.lua | 1 - scripts/src/3rdparty.lua | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 356d4d8d3dc..7b88a7d3ade 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -873,7 +873,6 @@ end if (version >= 40800) then -- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds) buildoptions { - "-Wno-unused-variable", "-Wno-array-bounds" } end diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index bba91c7835e..d7cebd5bc6d 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -621,6 +621,7 @@ project "portaudio" "-Wno-missing-braces", "-Wno-unused-but-set-variable", "-Wno-maybe-uninitialized", + "-Wno-unused-variable", "-Wno-unused-value", "-Wno-unused-function", "-Wno-unknown-pragmas", From b1c1b6979a91596acb396716e52dabbc9bb49bac Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 06:52:52 +0200 Subject: [PATCH 034/284] removed dumper (nw) --- src/mame/drivers/fortecar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c index 0cbae10e087..e38884f1204 100644 --- a/src/mame/drivers/fortecar.c +++ b/src/mame/drivers/fortecar.c @@ -1,5 +1,5 @@ // license:??? -// copyright-holders:Angelo Salese, Roberto Fresca, Rob Ragon +// copyright-holders:Angelo Salese, Roberto Fresca /************************************************************************************************* Forte Card From c1624e7512ec3519d080469b6b8cadb636f437b5 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 07:06:00 +0200 Subject: [PATCH 035/284] fixed license, there was driver beta so wrong owners assigned (nw) --- src/mess/machine/beta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/machine/beta.c b/src/mess/machine/beta.c index 32d4ba445ea..e671e67c89a 100644 --- a/src/mess/machine/beta.c +++ b/src/mess/machine/beta.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Curt Coder, MetalliC +// copyright-holders:Miodrag Milanovic, MetalliC /********************************************************************* beta.h From 493527173f62cc145fac006a789fb737d5f6bb50 Mon Sep 17 00:00:00 2001 From: RobertoFresca Date: Sun, 31 May 2015 02:22:47 -0300 Subject: [PATCH 036/284] Typo found... --- src/emu/sound/okim9810.c | 2 +- src/emu/sound/okim9810.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c index 311138e8df7..54e53fe55d0 100644 --- a/src/emu/sound/okim9810.c +++ b/src/emu/sound/okim9810.c @@ -4,7 +4,7 @@ okim9810.h - OKI MSM9810 ADCPM(2) sound chip. + OKI MSM9810 ADPCM(2) sound chip. ***************************************************************************/ diff --git a/src/emu/sound/okim9810.h b/src/emu/sound/okim9810.h index 665c9a9fdee..6d3595c59b2 100644 --- a/src/emu/sound/okim9810.h +++ b/src/emu/sound/okim9810.h @@ -4,7 +4,7 @@ okim9810.h - OKI MSM9810 ADCPM(2) sound chip. + OKI MSM9810 ADPCM(2) sound chip. Notes: The master clock frequency for this chip can range from 3.5MHz to 4.5Mhz. From b339e78fbef0b9de3521886517bcc608f9d83509 Mon Sep 17 00:00:00 2001 From: RobertoFresca Date: Sun, 31 May 2015 02:36:32 -0300 Subject: [PATCH 037/284] Fix some spacing... --- src/mame/drivers/fortecar.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c index e38884f1204..1f0dbe28626 100644 --- a/src/mame/drivers/fortecar.c +++ b/src/mame/drivers/fortecar.c @@ -486,7 +486,7 @@ WRITE8_MEMBER(fortecar_state::ayporta_w) */ int i; - for(i=0;i<8;i++) + for(i = 0; i < 8; i++) output_set_lamp_value(i, (data >> i) & 1); } @@ -596,22 +596,22 @@ INPUT_PORTS_END static const gfx_layout tiles8x8_layout_3bpp = { - 8,8, + 8, 8, RGN_FRAC(1,3), 3, { RGN_FRAC(2,3)+4, RGN_FRAC(1,3)+4, RGN_FRAC(0,3)+4 }, - { 8,9,10,11,0, 1, 2, 3 }, + { 8, 9, 10, 11, 0, 1, 2, 3 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, 16*8 }; static const gfx_layout tiles8x8_layout_6bpp = { - 8,8, + 8, 8, RGN_FRAC(1,3), 6, { RGN_FRAC(2,3)+0, RGN_FRAC(1,3)+0, RGN_FRAC(0,3)+0, RGN_FRAC(2,3)+4, RGN_FRAC(1,3)+4, RGN_FRAC(0,3)+4 }, - { 8,9,10,11,0, 1, 2, 3 }, + { 8, 9, 10, 11, 0, 1, 2, 3 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, 16*8 }; @@ -629,7 +629,7 @@ void fortecar_state::machine_reset() int i; /* apparently there's a random fill in there (checked thru trojan TODO: extract proper algorythm) */ - for(i=0;i Date: Sun, 31 May 2015 08:06:24 +0200 Subject: [PATCH 038/284] fix compile on latest clang (nw) --- src/lib/formats/camplynx_cas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/formats/camplynx_cas.c b/src/lib/formats/camplynx_cas.c index 4f53dbdd867..02133da4da4 100644 --- a/src/lib/formats/camplynx_cas.c +++ b/src/lib/formats/camplynx_cas.c @@ -101,19 +101,19 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) if (i < camplynx_image_size) { sample_count += camplynx_output_byte(buffer, sample_count, bytes[i]); - pgmname.append(1, bytes[i]); + pgmname.append(1, (char)bytes[i]); } else return sample_count; byte_count++; } - pgmname.append(1, 0x22); + pgmname.append(1, (char)0x22); sample_count += camplynx_output_byte(buffer, sample_count, bytes[byte_count++]); // should be 0x22 // if a machine-language program, say to use MLOAD if (bytes[byte_count] == 0x4D) - pgmname[0] = 0x4D; + pgmname[0] = (char)0x4D; // Tell user how to load the tape popmessage("%s",pgmname.c_str()); From 02751b71e6c901ad662cb835741a7a3fc541ddee Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 08:53:12 +0200 Subject: [PATCH 039/284] Fix for osx 10.6.x build (nw) --- scripts/src/3rdparty.lua | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index d7cebd5bc6d..ad9e4320173 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -554,6 +554,7 @@ project "bgfx" configuration { "gmake" } buildoptions { "-Wno-uninitialized", + "-Wno-unused-function", } configuration { } @@ -619,24 +620,30 @@ project "portaudio" "-Wno-bad-function-cast", "-Wno-undef", "-Wno-missing-braces", - "-Wno-unused-but-set-variable", - "-Wno-maybe-uninitialized", "-Wno-unused-variable", "-Wno-unused-value", "-Wno-unused-function", "-Wno-unknown-pragmas", - "-Wno-sometimes-uninitialized", } - local version = str_to_version(_OPTIONS["gcc_version"]) - if (_OPTIONS["gcc"]~=nil) and string.find(_OPTIONS["gcc"], "clang") then - buildoptions_c { - "-Wno-unknown-warning-option", - "-Wno-absolute-value", - "-Wno-unused-variable", - } + local version = str_to_version(_OPTIONS["gcc_version"]) + if (_OPTIONS["gcc"]~=nil) then + if string.find(_OPTIONS["gcc"], "clang") then + buildoptions_c { + "-Wno-unknown-warning-option", + "-Wno-absolute-value", + "-Wno-unused-variable", + } + else + if (version >= 40400) then + buildoptions_c { + "-Wno-unused-but-set-variable", + "-Wno-maybe-uninitialized", + "-Wno-sometimes-uninitialized", + } + end + end end - configuration { "vs*" } buildoptions { "/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer From 0c45c0f1f69dabaa9ada746ecd3b55815c46b5d8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 08:59:21 +0200 Subject: [PATCH 040/284] fix for clang (nw) --- scripts/src/3rdparty.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index ad9e4320173..5a205995b36 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -633,6 +633,9 @@ project "portaudio" "-Wno-unknown-warning-option", "-Wno-absolute-value", "-Wno-unused-variable", + "-Wno-unused-but-set-variable", + "-Wno-maybe-uninitialized", + "-Wno-sometimes-uninitialized", } else if (version >= 40400) then From 2f7882fbff8a0fa3877fdfe9217d2ec57d875b1f Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 10:40:18 +0200 Subject: [PATCH 041/284] x1/x1twin: updated to use the new wd fdc. bonus: formatting disks now works in hubasic. --- scripts/src/lib.lua | 2 ++ src/lib/formats/x1_dsk.c | 41 ++++++++++++++++++++++++ src/lib/formats/x1_dsk.h | 33 ++++++++++++++++++++ src/mess/drivers/x1.c | 65 ++++++++++++++++++++++----------------- src/mess/drivers/x1twin.c | 34 ++++++++------------ src/mess/includes/x1.h | 14 +++++++-- 6 files changed, 137 insertions(+), 52 deletions(-) create mode 100644 src/lib/formats/x1_dsk.c create mode 100644 src/lib/formats/x1_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index f7e2a2cba0a..6eca056a87f 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -391,6 +391,8 @@ project "formats" MAME_DIR .. "src/lib/formats/wd177x_dsk.h", MAME_DIR .. "src/lib/formats/x07_cas.c", MAME_DIR .. "src/lib/formats/x07_cas.h", + MAME_DIR .. "src/lib/formats/x1_dsk.c", + MAME_DIR .. "src/lib/formats/x1_dsk.h", MAME_DIR .. "src/lib/formats/x1_tap.c", MAME_DIR .. "src/lib/formats/x1_tap.h", MAME_DIR .. "src/lib/formats/xdf_dsk.c", diff --git a/src/lib/formats/x1_dsk.c b/src/lib/formats/x1_dsk.c new file mode 100644 index 00000000000..b6a5d1890da --- /dev/null +++ b/src/lib/formats/x1_dsk.c @@ -0,0 +1,41 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Sharp X1 + + Disk image format + +***************************************************************************/ + +#include "x1_dsk.h" + +x1_format::x1_format() : wd177x_format(formats) +{ +} + +const char *x1_format::name() const +{ + return "x1"; +} + +const char *x1_format::description() const +{ + return "Sharp X1 disk image"; +} + +const char *x1_format::extensions() const +{ + return "2d"; +} + +const x1_format::format x1_format::formats[] = +{ + { + floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, + 2000, 16, 40, 2, 256, {}, 1, {}, 32, 22, 54 + }, + {} +}; + +const floppy_format_type FLOPPY_X1_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/x1_dsk.h b/src/lib/formats/x1_dsk.h new file mode 100644 index 00000000000..0774c6bf27e --- /dev/null +++ b/src/lib/formats/x1_dsk.h @@ -0,0 +1,33 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Sharp X1 + + Disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __X1_DSK_H__ +#define __X1_DSK_H__ + +#include "wd177x_dsk.h" + +class x1_format : public wd177x_format +{ +public: + x1_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_X1_FORMAT; + +#endif // __X1_DSK_H__ diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c index 577e8780f2d..8ed1dc743cd 100644 --- a/src/mess/drivers/x1.c +++ b/src/mess/drivers/x1.c @@ -206,6 +206,7 @@ ************************************************************************************************/ #include "includes/x1.h" +#include "formats/x1_dsk.h" #define MAIN_CLOCK XTAL_16MHz #define VDP_CLOCK XTAL_42_9545MHz @@ -1021,10 +1022,12 @@ READ8_MEMBER( x1_state::x1_fdc_r ) WRITE8_MEMBER( x1_state::x1_fdc_w ) { + floppy_image_device *floppy = NULL; + switch(offset+0xff8) { case 0x0ff8: - m_fdc->command_w(space, offset,data); + m_fdc->cmd_w(space, offset,data); break; case 0x0ff9: m_fdc->track_w(space, offset,data); @@ -1035,12 +1038,25 @@ WRITE8_MEMBER( x1_state::x1_fdc_w ) case 0x0ffb: m_fdc->data_w(space, offset,data); break; + case 0x0ffc: - m_fdc->set_drive(data & 3); - floppy_get_device(machine(), data & 3)->floppy_mon_w(!BIT(data, 7)); - floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(data & 0x80,0); - m_fdc->set_side(BIT(data, 4)); + switch (data & 0x03) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + case 2: floppy = m_floppy2->get_device(); break; + case 3: floppy = m_floppy3->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + if (floppy) + { + floppy->ss_w(BIT(data, 4)); + floppy->mon_w(!BIT(data, 7)); + } break; + case 0x0ffd: case 0x0ffe: case 0x0fff: @@ -2414,21 +2430,13 @@ PALETTE_INIT_MEMBER(x1_state,x1) palette.set_pen_color(i,rgb_t(0x00,0x00,0x00)); } -static LEGACY_FLOPPY_OPTIONS_START( x1 ) - LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([40]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END +FLOPPY_FORMATS_MEMBER( x1_state::floppy_formats ) + FLOPPY_X1_FORMAT +FLOPPY_FORMATS_END -static const floppy_interface x1_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSDD_40, - LEGACY_FLOPPY_OPTIONS_NAME(x1), - "floppy_5_25" -}; +static SLOT_INTERFACE_START( x1_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END static MACHINE_CONFIG_START( x1, x1_state ) /* basic machine hardware */ @@ -2475,8 +2483,14 @@ static MACHINE_CONFIG_START( x1, x1_state ) MCFG_VIDEO_START_OVERRIDE(x1_state,x1) - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_MB8877x_ADD("fdc", MAIN_CLOCK / 16) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", x1_floppies, "dd", x1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", x1_floppies, "dd", x1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", x1_floppies, "dd", x1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", x1_floppies, "dd", x1_state::floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop") MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "x1_cart") MCFG_GENERIC_EXTENSIONS("bin,rom") @@ -2502,9 +2516,6 @@ static MACHINE_CONFIG_START( x1, x1_state ) MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass") - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface) - MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop") - MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1_state, x1_keyboard_callback, attotime::from_hz(250)) MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1_state, x1_cmt_wind_timer, attotime::from_hz(16)) MACHINE_CONFIG_END @@ -2527,10 +2538,8 @@ static MACHINE_CONFIG_DERIVED( x1turbo, x1 ) MCFG_Z80DMA_IN_IORQ_CB(READ8(x1_state, io_read_byte)) MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(x1_state, io_write_byte)) - MCFG_DEVICE_REMOVE("fdc") - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(x1_state,fdc_drq_w)) + MCFG_DEVICE_MODIFY("fdc") + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(x1_state, fdc_drq_w)) MCFG_YM2151_ADD("ym", MAIN_CLOCK/8) //option board MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c index a0bfb2ad5b4..b89f5e757a4 100644 --- a/src/mess/drivers/x1twin.c +++ b/src/mess/drivers/x1twin.c @@ -15,6 +15,7 @@ ************************************************************************************************/ #include "includes/x1.h" +#include "formats/x1_dsk.h" #include "includes/pce.h" //#include "cpu/h6280/h6280.h" @@ -394,23 +395,9 @@ static const z80_daisy_config x1_daisy[] = { NULL } }; -static LEGACY_FLOPPY_OPTIONS_START( x1 ) - LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([40]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -static const floppy_interface x1_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSDD_40, - LEGACY_FLOPPY_OPTIONS_NAME(x1), - "floppy_5_25" -}; - - +static SLOT_INTERFACE_START( x1_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END static MACHINE_CONFIG_START( x1twin, x1twin_state ) /* basic machine hardware */ @@ -471,8 +458,14 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state ) MCFG_VIDEO_START_OVERRIDE(x1twin_state,x1) - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_MB8877x_ADD("fdc", MAIN_CLOCK / 16) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", x1_floppies, "dd", x1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", x1_floppies, "dd", x1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", x1_floppies, "dd", x1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", x1_floppies, "dd", x1_state::floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop") MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "x1_cart") MCFG_GENERIC_EXTENSIONS("bin,rom") @@ -503,9 +496,6 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state ) MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass") - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface) - MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop") - #if 0 MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6) MCFG_C6280_CPU("pce_cpu") diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h index ba48f6ff043..ec286064412 100644 --- a/src/mess/includes/x1.h +++ b/src/mess/includes/x1.h @@ -15,7 +15,7 @@ #include "machine/z80ctc.h" #include "machine/z80dart.h" #include "machine/i8255.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/z80dma.h" #include "video/mc6845.h" #include "sound/2151intf.h" @@ -81,6 +81,10 @@ public: m_cassette(*this, "cassette"), m_cart(*this, "cartslot"), m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), + m_floppy2(*this, "fdc:2"), + m_floppy3(*this, "fdc:3"), m_crtc(*this, "crtc"), m_ctc(*this, "ctc"), m_gfxdecode(*this, "gfxdecode"), @@ -88,10 +92,16 @@ public: m_dma(*this, "dma") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; required_device m_cassette; required_device m_cart; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; required_device m_crtc; required_device m_ctc; From 6bd3dff96fea28af22a5ff1ff788a577bdc68924 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 10:58:03 +0200 Subject: [PATCH 042/284] removed duplicated compile option (nw) --- scripts/src/3rdparty.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 5a205995b36..dd53fa8105e 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -632,7 +632,6 @@ project "portaudio" buildoptions_c { "-Wno-unknown-warning-option", "-Wno-absolute-value", - "-Wno-unused-variable", "-Wno-unused-but-set-variable", "-Wno-maybe-uninitialized", "-Wno-sometimes-uninitialized", From ff076425e79dafcaaea144b38c8ee6e161777fea Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 31 May 2015 19:09:51 +1000 Subject: [PATCH 043/284] ui: Fix corruption when a game status and a pop message appear at the same time. --- src/emu/ui/ui.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c index b9b9da66643..91f3f4825b1 100644 --- a/src/emu/ui/ui.c +++ b/src/emu/ui/ui.c @@ -92,6 +92,7 @@ static const input_item_id non_char_keys[] = // messagebox buffer static std::string messagebox_text; +static std::string messagebox_poptext; static rgb_t messagebox_backcolor; // slider info @@ -441,7 +442,7 @@ void ui_manager::update_and_render(render_container *container) // display any popup messages if (osd_ticks() < m_popup_text_end) - draw_text_box(container, messagebox_text.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor); + draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor); else m_popup_text_end = 0; @@ -868,7 +869,7 @@ void CLIB_DECL ui_manager::popup_time(int seconds, const char *text, ...) // extract the text va_start(arg,text); - strvprintf(messagebox_text, text, arg); + strvprintf(messagebox_poptext, text, arg); messagebox_backcolor = UI_BACKGROUND_COLOR; va_end(arg); From cf876483c05d386a3c5b4e8dd04cb8ad9407c86d Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 11:29:23 +0200 Subject: [PATCH 044/284] dgn_beta: updated to use the new wd fdc. can't test the system since it appears to be completely non-working. --- src/mess/drivers/dgn_beta.c | 30 ++++++++------ src/mess/includes/dgn_beta.h | 20 +++++---- src/mess/machine/dgn_beta.c | 80 +++++++++--------------------------- 3 files changed, 50 insertions(+), 80 deletions(-) diff --git a/src/mess/drivers/dgn_beta.c b/src/mess/drivers/dgn_beta.c index f71d0c98ae9..31135e6632b 100644 --- a/src/mess/drivers/dgn_beta.c +++ b/src/mess/drivers/dgn_beta.c @@ -45,7 +45,8 @@ documentation still exists. #include "machine/6821pia.h" #include "includes/dgn_beta.h" #include "machine/mos6551.h" -#include "formats/coco_dsk.h" +#include "formats/vdk_dsk.h" +#include "formats/dmk_dsk.h" #include "imagedev/flopdrv.h" #include "machine/ram.h" #include "video/mc6845.h" @@ -288,13 +289,6 @@ PALETTE_INIT_MEMBER(dgn_beta_state, dgn) } } -static const floppy_interface dgnbeta_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(coco), - NULL -}; - /* F4 Character Displayer */ static const gfx_layout dgnbeta_charlayout = { @@ -313,6 +307,14 @@ static GFXDECODE_START( dgnbeta ) GFXDECODE_ENTRY( "gfx1", 0x0000, dgnbeta_charlayout, 0, 8 ) GFXDECODE_END +FLOPPY_FORMATS_MEMBER( dgn_beta_state::floppy_formats ) + FLOPPY_VDK_FORMAT, + FLOPPY_DMK_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( dgn_beta_floppies ) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state ) /* basic machine hardware */ @@ -366,12 +368,14 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state ) MCFG_PIA_IRQA_HANDLER(WRITELINE(dgn_beta_state,d_pia2_irq_a)) MCFG_PIA_IRQB_HANDLER(WRITELINE(dgn_beta_state,d_pia2_irq_b)) - MCFG_DEVICE_ADD(FDC_TAG, WD2797, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(dgn_beta_state,dgnbeta_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(dgn_beta_state,dgnbeta_fdc_drq_w)) + MCFG_WD2797x_ADD(FDC_TAG, XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(dgn_beta_state, dgnbeta_fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(dgn_beta_state, dgnbeta_fdc_drq_w)) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(dgnbeta_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":2", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":3", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats) MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_12_288MHz / 16) //XTAL is guessed MCFG_MC6845_SHOW_BORDER_AREA(false) diff --git a/src/mess/includes/dgn_beta.h b/src/mess/includes/dgn_beta.h index e19ca60d71b..3869f71fffc 100644 --- a/src/mess/includes/dgn_beta.h +++ b/src/mess/includes/dgn_beta.h @@ -10,7 +10,7 @@ #define DGN_BETA_H_ #include "video/mc6845.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/6821pia.h" #include "machine/ram.h" @@ -58,12 +58,6 @@ #define KOutDat KInClk /* Also used for data into output shifter */ #define KInDat 0x20 /* Keyboard data in from keyboard (serial stream) */ -/***** WD2797 pins *****/ - -#define DSMask 0x03 /* PA0 & PA1 are binary encoded drive */ -#define ENPCtrl 0x20 /* PA5 on PIA */ -#define DDenCtrl 0x40 /* PA6 on PIA */ - /***** Video Modes *****/ enum BETA_VID_MODES @@ -93,8 +87,15 @@ public: m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_ram(*this, RAM_TAG), + m_fdc(*this, FDC_TAG), + m_floppy0(*this, FDC_TAG ":0"), + m_floppy1(*this, FDC_TAG ":1"), + m_floppy2(*this, FDC_TAG ":2"), + m_floppy3(*this, FDC_TAG ":3"), m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_mc6845; required_shared_ptr m_videoram; @@ -214,6 +215,11 @@ public: void dgn_beta_frame_interrupt (int data); void dgn_beta_line_interrupt (int data); required_device m_ram; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; required_device m_palette; }; diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c index 46f027974fa..57de97d32f5 100644 --- a/src/mess/machine/dgn_beta.c +++ b/src/mess/machine/dgn_beta.c @@ -64,7 +64,6 @@ #include "machine/6821pia.h" #include "includes/dgn_beta.h" #include "machine/mos6551.h" -#include "machine/wd17xx.h" #include "imagedev/flopdrv.h" #include "debug/debugcpu.h" @@ -567,7 +566,6 @@ READ8_MEMBER(dgn_beta_state::d_pia1_pa_r) WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w) { int HALT_DMA; - wd2797_device *fdc = machine().device(FDC_TAG); /* Only play with halt line if halt bit changed since last write */ if((data & 0x80) != m_d_pia1_pa_last) @@ -589,10 +587,20 @@ WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w) } /* Drive selects are binary encoded on PA0 & PA1 */ - fdc->set_drive(~data & DSMask); + floppy_image_device *floppy = NULL; - /* Set density of WD2797 */ - fdc->dden_w(BIT(data, 6)); + switch (~data & 0x03) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + case 2: floppy = m_floppy2->get_device(); break; + case 3: floppy = m_floppy3->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + // not connected: bit 5 = ENP + m_fdc->dden_w(BIT(data, 6)); LOG_DISK(("Set density %s\n", BIT(data, 6) ? "low" : "high")); } @@ -787,7 +795,7 @@ void dgn_beta_state::cpu1_recalc_firq(int state) /********************************************************************************************/ /* The INTRQ line goes through pia2 ca1, in exactly the same way as DRQ from DragonDos does */ -WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_intrq_w) +WRITE_LINE_MEMBER( dgn_beta_state::dgnbeta_fdc_intrq_w ) { device_t *device = machine().device(PIA_2_TAG); LOG_DISK(("dgnbeta_fdc_intrq_w(%d)\n", state)); @@ -796,64 +804,21 @@ WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_intrq_w) } /* DRQ is routed through various logic to the FIRQ inturrupt line on *BOTH* CPUs */ -WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_drq_w) +WRITE_LINE_MEMBER( dgn_beta_state::dgnbeta_fdc_drq_w ) { LOG_DISK(("dgnbeta_fdc_drq_w(%d)\n", state)); cpu1_recalc_firq(state); } -READ8_MEMBER(dgn_beta_state::dgnbeta_wd2797_r) +READ8_MEMBER( dgn_beta_state::dgnbeta_wd2797_r ) { - int result = 0; - wd2797_device *fdc = machine().device(FDC_TAG); - - switch(offset & 0x03) - { - case 0: - result = fdc->status_r(space, 0); - LOG_DISK(("Disk status=%2.2X\n",result)); - break; - case 1: - result = fdc->track_r(space, 0); - break; - case 2: - result = fdc->sector_r(space, 0); - break; - case 3: - result = fdc->data_r(space, 0); - break; - default: - break; - } - - return result; + return m_fdc->read(space, offset & 0x03); } -WRITE8_MEMBER(dgn_beta_state::dgnbeta_wd2797_w) +WRITE8_MEMBER( dgn_beta_state::dgnbeta_wd2797_w ) { - wd2797_device *fdc = machine().device(FDC_TAG); - - m_wd2797_written=1; - - switch(offset & 0x3) - { - case 0: - /* disk head is encoded in the command byte */ - /* But only for Type 3/4 commands */ - if(data & 0x80) - fdc->set_side((data & 0x02) ? 1 : 0); - fdc->command_w(space, 0, data); - break; - case 1: - fdc->track_w(space, 0, data); - break; - case 2: - fdc->sector_w(space, 0, data); - break; - case 3: - fdc->data_w(space, 0, data); - break; - }; + m_wd2797_written = 1; + m_fdc->write(space, offset & 0x03, data); } /* Scan physical keyboard into Keyboard array */ @@ -924,7 +889,6 @@ void dgn_beta_state::dgn_beta_line_interrupt (int data) /********************************* Machine/Driver Initialization ****************************************/ void dgn_beta_state::machine_reset() { - wd2797_device *fdc = machine().device(FDC_TAG); pia6821_device *pia_0 = machine().device( PIA_0_TAG ); pia6821_device *pia_1 = machine().device( PIA_1_TAG ); pia6821_device *pia_2 = machine().device( PIA_2_TAG ); @@ -963,12 +927,8 @@ void dgn_beta_state::machine_reset() m_DMA_NMI_LAST = 0x80; /* start with DMA NMI inactive, as pulled up */ // DMA_NMI = CLEAR_LINE; /* start with DMA NMI inactive */ - fdc->dden_w(CLEAR_LINE); - fdc->set_drive(0); - m_videoram.set_target(m_ram->pointer(),m_videoram.bytes()); /* Point video ram at the start of physical ram */ - fdc->reset(); m_wd2797_written=0; m_maincpu->reset(); From 3a896dae5ea0af14fe27f137d3302b730eafa4cf Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 11:37:49 +0200 Subject: [PATCH 045/284] excali64: remove support for the old wd fdc since the new one works fine. --- src/mess/drivers/excali64.c | 69 ++----------------------------------- 1 file changed, 2 insertions(+), 67 deletions(-) diff --git a/src/mess/drivers/excali64.c b/src/mess/drivers/excali64.c index e34b55b01c5..ef7770a648d 100644 --- a/src/mess/drivers/excali64.c +++ b/src/mess/drivers/excali64.c @@ -28,8 +28,6 @@ ToDo: ****************************************************************************/ -#define NEWFDC 1 - #include "emu.h" #include "cpu/z80/z80.h" @@ -46,14 +44,8 @@ ToDo: #include "machine/z80dma.h" #include "machine/rescap.h" #include "machine/74123.h" -#if NEWFDC #include "machine/wd_fdc.h" #include "formats/excali64_dsk.h" -#else -#include "machine/wd17xx.h" -#include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" -#endif class excali64_state : public driver_device { @@ -69,10 +61,8 @@ public: , m_u12(*this, "u12") , m_centronics(*this, "centronics") , m_fdc(*this, "fdc") -#if NEWFDC , m_floppy0(*this, "fdc:0") , m_floppy1(*this, "fdc:1") -#endif { } DECLARE_PALETTE_INIT(excali64); @@ -85,9 +75,7 @@ public: DECLARE_WRITE8_MEMBER(porte4_w); DECLARE_READ8_MEMBER(porte8_r); DECLARE_WRITE8_MEMBER(portec_w); -#if NEWFDC DECLARE_FLOPPY_FORMATS(floppy_formats); -#endif DECLARE_WRITE_LINE_MEMBER(cent_busy_w); DECLARE_WRITE_LINE_MEMBER(busreq_w); DECLARE_READ8_MEMBER(memory_read_byte); @@ -118,13 +106,9 @@ private: required_device m_dma; required_device m_u12; required_device m_centronics; -#if NEWFDC required_device m_fdc; required_device m_floppy0; required_device m_floppy1; -#else - required_device m_fdc; -#endif }; static ADDRESS_MAP_START(excali64_mem, AS_PROGRAM, 8, excali64_state) @@ -150,11 +134,7 @@ static ADDRESS_MAP_START(excali64_io, AS_IO, 8, excali64_state) AM_RANGE(0xe4, 0xe7) AM_WRITE(porte4_w) AM_RANGE(0xe8, 0xeb) AM_READ(porte8_r) AM_RANGE(0xec, 0xef) AM_WRITE(portec_w) -#if NEWFDC AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_t, read, write) -#else - AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_device, read, write) -#endif ADDRESS_MAP_END @@ -245,7 +225,6 @@ WRITE_LINE_MEMBER( excali64_state::cent_busy_w ) m_centronics_busy = state; } -#if NEWFDC FLOPPY_FORMATS_MEMBER( excali64_state::floppy_formats ) FLOPPY_EXCALI64_FORMAT FLOPPY_FORMATS_END @@ -254,37 +233,13 @@ static SLOT_INTERFACE_START( excali64_floppies ) SLOT_INTERFACE( "drive0", FLOPPY_525_QD ) SLOT_INTERFACE( "drive1", FLOPPY_525_QD ) SLOT_INTERFACE_END -#else -static LEGACY_FLOPPY_OPTIONS_START(excali64) - LEGACY_FLOPPY_OPTION(excali64_ds, "raw", "Excalibur 64 DS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([5]) - SECTOR_LENGTH([1024]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -static const floppy_interface excali64_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSDD, - LEGACY_FLOPPY_OPTIONS_NAME(excali64), - NULL -}; -#endif // pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off. WRITE8_MEMBER( excali64_state::motor_w ) { m_motor = BIT(data, 0); -#if NEWFDC m_floppy1->get_device()->mon_w(!m_motor); m_floppy0->get_device()->mon_w(!m_motor); -#else - legacy_floppy_image_device *flop = subdevice(FLOPPY_0); - flop->floppy_mon_w(!m_motor); // motor on - flop = subdevice(FLOPPY_1); - flop->floppy_mon_w(!m_motor); // motor on -#endif } READ8_MEMBER( excali64_state::porte8_r ) @@ -294,7 +249,6 @@ READ8_MEMBER( excali64_state::porte8_r ) WRITE8_MEMBER( excali64_state::porte4_w ) { -#if NEWFDC floppy_image_device *floppy = NULL; if (BIT(data, 0)) floppy = m_floppy0->get_device(); @@ -306,16 +260,6 @@ WRITE8_MEMBER( excali64_state::porte4_w ) if (floppy) floppy->ss_w(BIT(data, 4)); -#else - if BIT(data, 0) - m_fdc->set_drive(0); - - if BIT(data, 1) - m_fdc->set_drive(1); - - m_fdc->set_side(BIT(data, 4)); -#endif - m_u12->b_w(space,offset, BIT(data, 5)); // motor pulse } @@ -326,11 +270,7 @@ d2 = density select (0 = double) */ WRITE8_MEMBER( excali64_state::portec_w ) { -#if NEWFDC m_fdc->dden_w(BIT(data, 2)); -#else - m_fdc->dden_w(!BIT(data, 2)); -#endif } WRITE_LINE_MEMBER( excali64_state::busreq_w ) @@ -651,17 +591,12 @@ static MACHINE_CONFIG_START( excali64, excali64_state ) /* Devices */ MCFG_CASSETTE_ADD( "cassette" ) -#if NEWFDC + MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16) MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "drive0", excali64_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "drive1", excali64_state::floppy_formats) -#else - MCFG_DEVICE_ADD("fdc", WD2793, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(excali64_floppy_interface) -#endif + MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4) MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w)) MCFG_Z80DMA_IN_MREQ_CB(READ8(excali64_state, memory_read_byte)) From 2923224b5145191960a03674e297e11342b765c5 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 11:50:06 +0200 Subject: [PATCH 046/284] remove text (nw) --- makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/makefile b/makefile index ba0279ef2f1..21c518506bd 100644 --- a/makefile +++ b/makefile @@ -4,9 +4,6 @@ # # Core makefile for building MAME and derivatives # -# Copyright (c) Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. -# ########################################################################### From f23ff0f6f05eb62bb34ab00f9dce1a697a38a877 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 31 May 2015 12:37:01 +0200 Subject: [PATCH 047/284] fix compile on GCC 4.4 on old Ubuntu (nw) --- 3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c | 6 +++--- scripts/src/3rdparty.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c b/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c index d73f5262420..628a03e7b0f 100644 --- a/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c +++ b/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c @@ -3697,7 +3697,7 @@ static PaError PaAlsaStream_GetAvailableFrames( PaAlsaStream *self, int queryCap *available, int *xrunOccurred ) { PaError result = paNoError; - unsigned long captureFrames, playbackFrames; + unsigned long captureFrames = 0, playbackFrames = 0; *xrunOccurred = 0; assert( queryCapture || queryPlayback ); @@ -4579,7 +4579,7 @@ error: PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card ) { - PaAlsaStream *stream; + PaAlsaStream *stream = NULL; PaError result = paNoError; snd_pcm_info_t* pcmInfo; @@ -4598,7 +4598,7 @@ error: PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card ) { - PaAlsaStream *stream; + PaAlsaStream *stream = NULL; PaError result = paNoError; snd_pcm_info_t* pcmInfo; diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index dd53fa8105e..34c9a14599c 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -637,7 +637,7 @@ project "portaudio" "-Wno-sometimes-uninitialized", } else - if (version >= 40400) then + if (version >= 40600) then buildoptions_c { "-Wno-unused-but-set-variable", "-Wno-maybe-uninitialized", From 3a9d6f4b4be4bed19720eea2cffab021139bd241 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 13:08:37 +0200 Subject: [PATCH 048/284] mbc200: updated to use the new wd fdc and make it boot. --- src/mess/drivers/mbc200.c | 77 ++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 42 deletions(-) diff --git a/src/mess/drivers/mbc200.c b/src/mess/drivers/mbc200.c index fc15fd4c9ca..6a7f02e4bb2 100644 --- a/src/mess/drivers/mbc200.c +++ b/src/mess/drivers/mbc200.c @@ -41,8 +41,7 @@ #include "machine/i8255.h" #include "machine/i8251.h" #include "video/mc6845.h" -//#include "machine/wd_fdc.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" class mbc200_state : public driver_device @@ -56,14 +55,13 @@ public: , m_vram(*this, "vram") , m_maincpu(*this, "maincpu") , m_fdc(*this, "fdc") - //, m_floppy0(*this, "fdc:0") - //, m_floppy1(*this, "fdc:1") - , m_floppy0(*this, FLOPPY_0) - , m_floppy1(*this, FLOPPY_1) + , m_floppy0(*this, "fdc:0") + , m_floppy1(*this, "fdc:1") { } DECLARE_READ8_MEMBER(p2_porta_r); DECLARE_WRITE8_MEMBER(pm_porta_w); + DECLARE_WRITE8_MEMBER(pm_portb_w); MC6845_UPDATE_ROW(update_row); required_device m_palette; @@ -75,12 +73,9 @@ private: required_device m_ppi_m; required_shared_ptr m_vram; required_device m_maincpu; - //required_device m_fdc; - //required_device m_floppy0; - //required_device m_floppy1; - required_device m_fdc; - required_device m_floppy0; - required_device m_floppy1; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; }; @@ -97,13 +92,32 @@ WRITE8_MEMBER( mbc200_state::pm_porta_w ) m_comm_latch = data; // to slave CPU } +WRITE8_MEMBER( mbc200_state::pm_portb_w ) +{ + floppy_image_device *floppy = NULL; + + // to be verified + switch (data & 0x01) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + if (floppy) + { + floppy->mon_w(0); + floppy->ss_w(BIT(data, 7)); + } +} + static ADDRESS_MAP_START( mbc200_io , AS_IO, 8, mbc200_state) ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0xe0, 0xe0) AM_DEVREADWRITE("i8251_1", i8251_device, data_r, data_w) AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE("i8251_1", i8251_device, status_r, control_w) - //AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_t, read, write) - AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_device, read, write) + AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_t, read, write) AM_RANGE(0xe8, 0xeb) AM_DEVREADWRITE("ppi_m", i8255_device, read, write) AM_RANGE(0xec, 0xec) AM_DEVREADWRITE("i8251_2", i8251_device, data_r, data_w) AM_RANGE(0xed, 0xed) AM_DEVREADWRITE("i8251_2", i8251_device, status_r, control_w) @@ -142,18 +156,6 @@ INPUT_PORTS_END void mbc200_state::machine_start() { -// floppy_image_device *floppy = NULL; -// floppy = m_floppy0->get_device(); -// floppy1 not supported currently -// m_fdc->set_floppy(floppy); - -// if (floppy) -// floppy->mon_w(0); - - m_floppy0->floppy_mon_w(0); - m_floppy1->floppy_mon_w(0); - m_floppy0->floppy_drive_set_ready_state(1, 1); - m_floppy1->floppy_drive_set_ready_state(1, 1); } void mbc200_state::machine_reset() @@ -163,16 +165,9 @@ void mbc200_state::machine_reset() memcpy(main, roms, 0x1000); } -static const floppy_interface mbc200_floppy_interface = -{ - FLOPPY_STANDARD_5_25_SSDD_40, - LEGACY_FLOPPY_OPTIONS_NAME(default), - "floppy_5_25" -}; - -//static SLOT_INTERFACE_START( mbc200_floppies ) -// SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD ) -//SLOT_INTERFACE_END +static SLOT_INTERFACE_START( mbc200_floppies ) + SLOT_INTERFACE("qd", FLOPPY_525_QD ) +SLOT_INTERFACE_END MC6845_UPDATE_ROW( mbc200_state::update_row ) { @@ -244,16 +239,14 @@ static MACHINE_CONFIG_START( mbc200, mbc200_state ) MCFG_DEVICE_ADD("ppi_m", I8255, 0) MCFG_I8255_OUT_PORTA_CB(WRITE8(mbc200_state, pm_porta_w)) + MCFG_I8255_OUT_PORTB_CB(WRITE8(mbc200_state, pm_portb_w)) MCFG_DEVICE_ADD("i8251_1", I8251, 0) // INS8251N MCFG_DEVICE_ADD("i8251_2", I8251, 0) // INS8251A - //MCFG_MB8876x_ADD("fdc", 1000000) // guess - //MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbc200_floppies, "525dd", floppy_image_device::default_floppy_formats) - //MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbc200_floppies, "525dd", floppy_image_device::default_floppy_formats) - MCFG_DEVICE_ADD("fdc", MB8876, 0) // MB8876A - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mbc200_floppy_interface) + MCFG_MB8876x_ADD("fdc", XTAL_8MHz / 8) // guess + MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbc200_floppies, "qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbc200_floppies, "qd", floppy_image_device::default_floppy_formats) /* software lists */ MCFG_SOFTWARE_LIST_ADD("flop_list", "mbc200") From 511762fa2d25965d05fc277efd29fb4a50d95420 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sun, 31 May 2015 13:20:42 +0200 Subject: [PATCH 049/284] Allow compiling with shared libraries [O. Galibert] Put SHLIB=1 in the main makefile, or on the command line. The idea is to get a *way* faster link with symbols. It works at least on linux, with one annoying caveat: you have to be in the build/projects/sdl/mame/gmake-linux directory to start mame afterwards. We're going to move some things around to be able to use LD_LIBRARY_PATH or have it start as-is from the root. --- makefile | 4 +++ scripts/genie.lua | 21 ++++++++++++++ scripts/src/emu.lua | 9 +++--- scripts/src/lib.lua | 6 ++-- scripts/src/osd/osdmini.lua | 4 +-- scripts/src/osd/sdl.lua | 6 ++-- scripts/src/osd/windows.lua | 4 +-- scripts/target/ldplayer/ldplayer.lua | 2 +- scripts/target/mame/arcade.lua | 2 +- scripts/target/mame/dummy.lua | 2 +- scripts/target/mame/mess.lua | 2 +- scripts/target/mame/tiny.lua | 2 +- src/emu/cpu/m6809/hd6309.c | 26 ++++++++--------- src/emu/cpu/m6809/konami.c | 20 ++++++------- src/emu/cpu/m6809/m6809.c | 6 ++-- src/emu/cpu/m6809/m6809.h | 38 ++++++++++++------------- src/emu/cpu/mcs96/i8xc196.c | 4 +++ src/emu/cpu/mcs96/i8xc196.h | 1 - src/emu/cpu/pic16c62x/pic16c62x.c | 9 ++++++ src/emu/machine/68561mpcc.c | 6 ---- src/emu/video/mc6847.c | 16 +++++------ src/mess/video/gime.c | 42 ++++++++++++++-------------- 22 files changed, 134 insertions(+), 98 deletions(-) diff --git a/makefile b/makefile index 21c518506bd..e9b302c711a 100644 --- a/makefile +++ b/makefile @@ -393,6 +393,10 @@ ifdef OPTIMIZE PARAMS += --OPTIMIZE=$(OPTIMIZE) endif +ifdef SHLIB +PARAMS += --SHLIB=$(SHLIB) +endif + ifdef ARCHOPTS PARAMS += --ARCHOPTS='$(ARCHOPTS)' endif diff --git a/scripts/genie.lua b/scripts/genie.lua index 7b88a7d3ade..b4915406b25 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -311,6 +311,21 @@ newoption { } +newoption { + trigger = "SHLIB", + description = "Generate shared libs.", + allowed = { + { "0", "Static libs" }, + { "1", "Shared libs" }, + } +} + +if _OPTIONS["SHLIB"]=="1" then + LIBTYPE = "SharedLib" +else + LIBTYPE = "StaticLib" +end + PYTHON = "python" if _OPTIONS["PYTHON_EXECUTABLE"]~=nil then @@ -743,6 +758,12 @@ if _OPTIONS["OPTIMIZE"] then end end +if _OPTIONS["SHLIB"] then + buildoptions { + "-fPIC" + } +end + if _OPTIONS["SSE2"]=="1" then buildoptions { "-msse2", diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index 3b020839b14..2eb279377b5 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -2,8 +2,9 @@ -- copyright-holders:MAMEdev Team project ("emu") +targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf") -kind "StaticLib" +kind (LIBTYPE) options { "ForceCPP", } @@ -358,7 +359,7 @@ function emuProject(_target, _subtarget) project ("optional") uuid (os.uuid("optional-" .. _target .."_" .. _subtarget)) - kind "StaticLib" + kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) options { "ForceCPP", @@ -397,7 +398,7 @@ function emuProject(_target, _subtarget) project ("bus") uuid ("5d782c89-cf7e-4cfe-8f9f-0d4bfc16c91d") - kind "StaticLib" + kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) options { "ForceCPP", @@ -428,7 +429,7 @@ function emuProject(_target, _subtarget) project ("dasm") uuid ("f2d28b0a-6da5-4f78-b629-d834aa00429d") - kind "StaticLib" + kind (LIBTYPE) targetsubdir(_target .."_" .. _subtarget) options { "ForceCPP", diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 6eca056a87f..e24ff00f438 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -2,8 +2,9 @@ -- copyright-holders:MAMEdev Team project "utils" + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid "22489ad0-4cb2-4d91-ad81-24b0d80ca30a" - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", @@ -94,8 +95,9 @@ project "utils" project "formats" + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid "f69636b1-fcce-45ce-b09a-113e371a2d7a" - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/src/osd/osdmini.lua b/scripts/src/osd/osdmini.lua index a1b19f9cb2a..b4afaaa6532 100644 --- a/scripts/src/osd/osdmini.lua +++ b/scripts/src/osd/osdmini.lua @@ -7,7 +7,7 @@ end project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) removeflags { "SingleOutputDir", @@ -54,7 +54,7 @@ project ("osd_" .. _OPTIONS["osd"]) project ("ocore_" .. _OPTIONS["osd"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 2c8e2ed51c5..0fc7d57d3b9 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -293,8 +293,9 @@ end project ("osd_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .._OPTIONS["subtarget"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) dofile("sdl_cfg.lua") osdmodulesbuild() @@ -361,8 +362,9 @@ project ("osd_" .. _OPTIONS["osd"]) project ("ocore_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index 33176ff43fc..e9965017933 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -90,7 +90,7 @@ end project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) dofile("windows_cfg.lua") osdmodulesbuild() @@ -153,7 +153,7 @@ project ("osd_" .. _OPTIONS["osd"]) project ("ocore_" .. _OPTIONS["osd"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) - kind "StaticLib" + kind (LIBTYPE) options { "ForceCPP", diff --git a/scripts/target/ldplayer/ldplayer.lua b/scripts/target/ldplayer/ldplayer.lua index 3660b87cba9..f12fad0c7db 100644 --- a/scripts/target/ldplayer/ldplayer.lua +++ b/scripts/target/ldplayer/ldplayer.lua @@ -54,7 +54,7 @@ BUSES["MIDI"] = true function createProjects_ldplayer_ldplayer(_target, _subtarget) project ("drvldplayer") targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drvldplayer")) options { diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index eff03dac309..8d0346f3942 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -760,7 +760,7 @@ end function createMAMEProjects(_target, _subtarget, _name) project (_name) targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) options { diff --git a/scripts/target/mame/dummy.lua b/scripts/target/mame/dummy.lua index bd207bf41c8..145862828d5 100644 --- a/scripts/target/mame/dummy.lua +++ b/scripts/target/mame/dummy.lua @@ -15,7 +15,7 @@ dofile("mess.lua") function createProjects_mame_dummy(_target, _subtarget) project ("mame_dummy") targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-mame_dummy")) options { diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 84bed8d6c66..8db1d42aa81 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -859,7 +859,7 @@ end function createMESSProjects(_target, _subtarget, _name) project (_name) targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name)) options { diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua index 350dfd5847c..9dc18d31d9a 100644 --- a/scripts/target/mame/tiny.lua +++ b/scripts/target/mame/tiny.lua @@ -78,7 +78,7 @@ BUSES["CENTRONICS"] = true function createProjects_mame_tiny(_target, _subtarget) project ("mame_tiny") targetsubdir(_target .."_" .. _subtarget) - kind "StaticLib" + kind (LIBTYPE) uuid (os.uuid("drv-mame-tiny")) options { diff --git a/src/emu/cpu/m6809/hd6309.c b/src/emu/cpu/m6809/hd6309.c index 027c9b7511b..5b270d26c90 100644 --- a/src/emu/cpu/m6809/hd6309.c +++ b/src/emu/cpu/m6809/hd6309.c @@ -313,7 +313,7 @@ offs_t hd6309_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o // read_operand //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand() +inline UINT8 hd6309_device::read_operand() { switch(m_addressing_mode) { @@ -332,7 +332,7 @@ ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand() // read_operand //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand(int ordinal) +inline UINT8 hd6309_device::read_operand(int ordinal) { switch(m_addressing_mode) { @@ -356,7 +356,7 @@ ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand(int ordinal) // write_operand //------------------------------------------------- -ATTR_FORCE_INLINE void hd6309_device::write_operand(UINT8 data) +inline void hd6309_device::write_operand(UINT8 data) { switch(m_addressing_mode) { @@ -375,7 +375,7 @@ ATTR_FORCE_INLINE void hd6309_device::write_operand(UINT8 data) // write_operand //------------------------------------------------- -ATTR_FORCE_INLINE void hd6309_device::write_operand(int ordinal, UINT8 data) +inline void hd6309_device::write_operand(int ordinal, UINT8 data) { switch(m_addressing_mode) { @@ -398,7 +398,7 @@ ATTR_FORCE_INLINE void hd6309_device::write_operand(int ordinal, UINT8 data) // bittest_register //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 &hd6309_device::bittest_register() +inline UINT8 &hd6309_device::bittest_register() { switch(m_temp_im & 0xC0) { @@ -414,7 +414,7 @@ ATTR_FORCE_INLINE UINT8 &hd6309_device::bittest_register() // bittest_source //------------------------------------------------- -ATTR_FORCE_INLINE bool hd6309_device::bittest_source() +inline bool hd6309_device::bittest_source() { return (m_temp.b.l & (1 << ((m_temp_im >> 3) & 0x07))) ? true : false; } @@ -424,7 +424,7 @@ ATTR_FORCE_INLINE bool hd6309_device::bittest_source() // bittest_dest //------------------------------------------------- -ATTR_FORCE_INLINE bool hd6309_device::bittest_dest() +inline bool hd6309_device::bittest_dest() { return (bittest_register() & (1 << ((m_temp_im >> 0) & 0x07))) ? true : false; } @@ -434,7 +434,7 @@ ATTR_FORCE_INLINE bool hd6309_device::bittest_dest() // bittest_set //------------------------------------------------- -ATTR_FORCE_INLINE void hd6309_device::bittest_set(bool result) +inline void hd6309_device::bittest_set(bool result) { if (result) bittest_register() |= (1 << ((m_temp_im >> 0) & 0x07)); @@ -448,7 +448,7 @@ ATTR_FORCE_INLINE void hd6309_device::bittest_set(bool result) // read_exgtfr_register //------------------------------------------------- -ATTR_FORCE_INLINE m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UINT8 reg) +inline m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UINT8 reg) { UINT16 value = 0; @@ -486,7 +486,7 @@ ATTR_FORCE_INLINE m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_ // write_exgtfr_register //------------------------------------------------- -ATTR_FORCE_INLINE void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) +inline void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) { switch(reg & 0x0F) { @@ -517,7 +517,7 @@ ATTR_FORCE_INLINE void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_bas // tfr_read //------------------------------------------------- -ATTR_FORCE_INLINE bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data) +inline bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data) { PAIR16 *reg; @@ -550,7 +550,7 @@ ATTR_FORCE_INLINE bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &d // tfr_write //------------------------------------------------- -ATTR_FORCE_INLINE bool hd6309_device::tfr_write(UINT8 opcode, UINT8 arg, UINT8 data) +inline bool hd6309_device::tfr_write(UINT8 opcode, UINT8 arg, UINT8 data) { PAIR16 *reg; @@ -789,7 +789,7 @@ bool hd6309_device::divd() // execute_one - try to execute a single instruction //------------------------------------------------- -ATTR_FORCE_INLINE void hd6309_device::execute_one() +inline void hd6309_device::execute_one() { switch(pop_state()) { diff --git a/src/emu/cpu/m6809/konami.c b/src/emu/cpu/m6809/konami.c index d86f44651d2..8dc2bf3ab78 100644 --- a/src/emu/cpu/m6809/konami.c +++ b/src/emu/cpu/m6809/konami.c @@ -120,7 +120,7 @@ offs_t konami_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT // read_operand //------------------------------------------------- -inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand() +inline UINT8 konami_cpu_device::read_operand() { return super::read_operand(); } @@ -130,7 +130,7 @@ inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand() // read_operand //------------------------------------------------- -inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand(int ordinal) +inline UINT8 konami_cpu_device::read_operand(int ordinal) { switch(m_addressing_mode) { @@ -146,7 +146,7 @@ inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand(int ordinal) // write_operand //------------------------------------------------- -ATTR_FORCE_INLINE void konami_cpu_device::write_operand(UINT8 data) +inline void konami_cpu_device::write_operand(UINT8 data) { super::write_operand(data); } @@ -157,7 +157,7 @@ ATTR_FORCE_INLINE void konami_cpu_device::write_operand(UINT8 data) // write_operand //------------------------------------------------- -ATTR_FORCE_INLINE void konami_cpu_device::write_operand(int ordinal, UINT8 data) +inline void konami_cpu_device::write_operand(int ordinal, UINT8 data) { switch(m_addressing_mode) { @@ -173,7 +173,7 @@ ATTR_FORCE_INLINE void konami_cpu_device::write_operand(int ordinal, UINT8 data) // ireg //------------------------------------------------- -ATTR_FORCE_INLINE UINT16 &konami_cpu_device::ireg() +inline UINT16 &konami_cpu_device::ireg() { switch(m_opcode & 0x70) { @@ -194,7 +194,7 @@ ATTR_FORCE_INLINE UINT16 &konami_cpu_device::ireg() // read_exgtfr_register //------------------------------------------------- -ATTR_FORCE_INLINE m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_register(UINT8 reg) +inline m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_register(UINT8 reg) { exgtfr_register result; result.word_value = 0x00FF; @@ -217,7 +217,7 @@ ATTR_FORCE_INLINE m6809_base_device::exgtfr_register konami_cpu_device::read_exg // write_exgtfr_register //------------------------------------------------- -ATTR_FORCE_INLINE void konami_cpu_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) +inline void konami_cpu_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) { switch(reg & 0x07) { @@ -287,7 +287,7 @@ template T konami_cpu_device::safe_shift_left(T value, UINT32 shift) // lmul //------------------------------------------------- -ATTR_FORCE_INLINE void konami_cpu_device::lmul() +inline void konami_cpu_device::lmul() { PAIR result; @@ -313,7 +313,7 @@ ATTR_FORCE_INLINE void konami_cpu_device::lmul() // divx //------------------------------------------------- -ATTR_FORCE_INLINE void konami_cpu_device::divx() +inline void konami_cpu_device::divx() { UINT16 result; UINT8 remainder; @@ -357,7 +357,7 @@ void konami_cpu_device::set_lines(UINT8 data) // execute_one - try to execute a single instruction //------------------------------------------------- -ATTR_FORCE_INLINE void konami_cpu_device::execute_one() +inline void konami_cpu_device::execute_one() { switch(pop_state()) { diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c index 3b7fc33d94f..1b7b0e1e777 100644 --- a/src/emu/cpu/m6809/m6809.c +++ b/src/emu/cpu/m6809/m6809.c @@ -456,7 +456,7 @@ const char *m6809_base_device::inputnum_string(int inputnum) // read_exgtfr_register //------------------------------------------------- -ATTR_FORCE_INLINE m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(UINT8 reg) +m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(UINT8 reg) { exgtfr_register result; result.byte_value = 0xFF; @@ -483,7 +483,7 @@ ATTR_FORCE_INLINE m6809_base_device::exgtfr_register m6809_base_device::read_exg // write_exgtfr_register //------------------------------------------------- -ATTR_FORCE_INLINE void m6809_base_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) +void m6809_base_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) { switch(reg & 0x0F) { @@ -516,7 +516,7 @@ void m6809_base_device::log_illegal() // execute_one - try to execute a single instruction //------------------------------------------------- -ATTR_FORCE_INLINE void m6809_base_device::execute_one() +void m6809_base_device::execute_one() { switch(pop_state()) { diff --git a/src/emu/cpu/m6809/m6809.h b/src/emu/cpu/m6809/m6809.h index eb0633af44c..7b14a6882e5 100644 --- a/src/emu/cpu/m6809/m6809.h +++ b/src/emu/cpu/m6809/m6809.h @@ -147,27 +147,27 @@ protected: devcb_write_line m_lic_func; // LIC pin on the 6809E // eat cycles - ATTR_FORCE_INLINE void eat(int cycles) { m_icount -= cycles; } + inline void eat(int cycles) { m_icount -= cycles; } void eat_remaining(); // read a byte from given memory location - ATTR_FORCE_INLINE UINT8 read_memory(UINT16 address) { eat(1); return m_addrspace[AS_PROGRAM]->read_byte(address); } + inline UINT8 read_memory(UINT16 address) { eat(1); return m_addrspace[AS_PROGRAM]->read_byte(address); } // write a byte to given memory location - ATTR_FORCE_INLINE void write_memory(UINT16 address, UINT8 data) { eat(1); m_addrspace[AS_PROGRAM]->write_byte(address, data); } + inline void write_memory(UINT16 address, UINT8 data) { eat(1); m_addrspace[AS_PROGRAM]->write_byte(address, data); } // read_opcode() is like read_memory() except it is used for reading opcodes. In the case of a system // with memory mapped I/O, this function can be used to greatly speed up emulation. - ATTR_FORCE_INLINE UINT8 read_opcode(UINT16 address) { eat(1); return m_direct->read_decrypted_byte(address); } + inline UINT8 read_opcode(UINT16 address) { eat(1); return m_direct->read_decrypted_byte(address); } // read_opcode_arg() is identical to read_opcode() except it is used for reading opcode arguments. This // difference can be used to support systems that use different encoding mechanisms for opcodes // and opcode arguments. - ATTR_FORCE_INLINE UINT8 read_opcode_arg(UINT16 address) { eat(1); return m_direct->read_raw_byte(address); } + inline UINT8 read_opcode_arg(UINT16 address) { eat(1); return m_direct->read_raw_byte(address); } // read_opcode() and bump the program counter - ATTR_FORCE_INLINE UINT8 read_opcode() { return read_opcode(m_pc.w++); } - ATTR_FORCE_INLINE UINT8 read_opcode_arg() { return read_opcode_arg(m_pc.w++); } + inline UINT8 read_opcode() { return read_opcode(m_pc.w++); } + inline UINT8 read_opcode_arg() { return read_opcode_arg(m_pc.w++); } // state stack - implemented as a UINT32 void push_state(UINT8 state) { m_state = (m_state << 8) | state; } @@ -219,15 +219,15 @@ protected: template T set_flags(UINT8 mask, T r); // branch conditions - ATTR_FORCE_INLINE bool cond_hi() { return !(m_cc & CC_ZC); } // BHI/BLS - ATTR_FORCE_INLINE bool cond_cc() { return !(m_cc & CC_C); } // BCC/BCS - ATTR_FORCE_INLINE bool cond_ne() { return !(m_cc & CC_Z); } // BNE/BEQ - ATTR_FORCE_INLINE bool cond_vc() { return !(m_cc & CC_V); } // BVC/BVS - ATTR_FORCE_INLINE bool cond_pl() { return !(m_cc & CC_N); } // BPL/BMI - ATTR_FORCE_INLINE bool cond_ge() { return (m_cc & CC_N ? true : false) == (m_cc & CC_V ? true : false); } // BGE/BLT - ATTR_FORCE_INLINE bool cond_gt() { return cond_ge() && !(m_cc & CC_Z); } // BGT/BLE - ATTR_FORCE_INLINE void set_cond(bool cond) { m_cond = cond; } - ATTR_FORCE_INLINE bool branch_taken() { return m_cond; } + inline bool cond_hi() { return !(m_cc & CC_ZC); } // BHI/BLS + inline bool cond_cc() { return !(m_cc & CC_C); } // BCC/BCS + inline bool cond_ne() { return !(m_cc & CC_Z); } // BNE/BEQ + inline bool cond_vc() { return !(m_cc & CC_V); } // BVC/BVS + inline bool cond_pl() { return !(m_cc & CC_N); } // BPL/BMI + inline bool cond_ge() { return (m_cc & CC_N ? true : false) == (m_cc & CC_V ? true : false); } // BGE/BLT + inline bool cond_gt() { return cond_ge() && !(m_cc & CC_Z); } // BGT/BLE + inline void set_cond(bool cond) { m_cond = cond; } + inline bool branch_taken() { return m_cond; } // interrupt registers bool firq_saves_entire_state() { return false; } @@ -235,8 +235,8 @@ protected: UINT16 entire_state_registers() { return 0xFF; } // miscellaneous - exgtfr_register read_exgtfr_register(UINT8 reg); - void write_exgtfr_register(UINT8 reg, exgtfr_register value); + inline exgtfr_register read_exgtfr_register(UINT8 reg); + inline void write_exgtfr_register(UINT8 reg, exgtfr_register value); bool is_register_addressing_mode(); bool is_ea_addressing_mode() { return m_addressing_mode == ADDRESSING_MODE_EA; } UINT16 get_pending_interrupt(); @@ -255,7 +255,7 @@ private: int m_clock_divider; // functions - void execute_one(); + inline void execute_one(); const char *inputnum_string(int inputnum); }; diff --git a/src/emu/cpu/mcs96/i8xc196.c b/src/emu/cpu/mcs96/i8xc196.c index 8e80da19cdb..19553280de2 100644 --- a/src/emu/cpu/mcs96/i8xc196.c +++ b/src/emu/cpu/mcs96/i8xc196.c @@ -69,4 +69,8 @@ UINT16 i8xc196_device::io_r16(UINT8 adr) return data; } +void i8xc196_device::do_exec_partial() +{ +} + #include "cpu/mcs96/i8xc196.inc" diff --git a/src/emu/cpu/mcs96/i8xc196.h b/src/emu/cpu/mcs96/i8xc196.h index cb41e693fe8..299f6c9128d 100644 --- a/src/emu/cpu/mcs96/i8xc196.h +++ b/src/emu/cpu/mcs96/i8xc196.h @@ -23,7 +23,6 @@ public: virtual void do_exec_full(); virtual void do_exec_partial(); - virtual void next(int cycles); virtual void io_w8(UINT8 adr, UINT8 data); virtual void io_w16(UINT8 adr, UINT16 data); virtual UINT8 io_r8(UINT8 adr); diff --git a/src/emu/cpu/pic16c62x/pic16c62x.c b/src/emu/cpu/pic16c62x/pic16c62x.c index 42e92b0addf..1d2dae52b95 100644 --- a/src/emu/cpu/pic16c62x/pic16c62x.c +++ b/src/emu/cpu/pic16c62x/pic16c62x.c @@ -57,6 +57,15 @@ #include "pic16c62x.h" +const device_type PIC16C620 = &device_creator; +const device_type PIC16C620A = &device_creator; +const device_type PIC16C621 = &device_creator; +const device_type PIC16C621A = &device_creator; +const device_type PIC16C622 = &device_creator; +const device_type PIC16C622A = &device_creator; + + + /**************************************************************************** * Internal Memory Map ****************************************************************************/ diff --git a/src/emu/machine/68561mpcc.c b/src/emu/machine/68561mpcc.c index c894f4c96ba..1b8a8895fed 100644 --- a/src/emu/machine/68561mpcc.c +++ b/src/emu/machine/68561mpcc.c @@ -23,8 +23,6 @@ const device_type MPCC68561 = &device_creator; #define LOG_MPCC (1) -#if 0 // future - /*************************************************************************** IMPLEMENTATION ***************************************************************************/ @@ -481,7 +479,3 @@ WRITE8_MEMBER( mpcc68561_t::reg_w ) break; } } - -#else - -#endif diff --git a/src/emu/video/mc6847.c b/src/emu/video/mc6847.c index 44ae168b028..76c0dcb4c92 100644 --- a/src/emu/video/mc6847.c +++ b/src/emu/video/mc6847.c @@ -150,7 +150,7 @@ mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device // to the clock //------------------------------------------------- -ATTR_FORCE_INLINE emu_timer *mc6847_friend_device::setup_timer(device_timer_id id, double offset, double period) +inline emu_timer *mc6847_friend_device::setup_timer(device_timer_id id, double offset, double period) { emu_timer *timer = timer_alloc(id); timer->adjust( @@ -228,7 +228,7 @@ void mc6847_friend_device::device_post_load(void) // update_field_sync_timer //------------------------------------------------- -ATTR_FORCE_INLINE void mc6847_friend_device::update_field_sync_timer(void) +void mc6847_friend_device::update_field_sync_timer(void) { // are we expecting field sync? bool expected_field_sync = (m_physical_scanline < m_field_sync_falling_edge_scanline) @@ -268,7 +268,7 @@ void mc6847_friend_device::device_timer(emu_timer &timer, device_timer_id id, in // new_frame //------------------------------------------------- -ATTR_FORCE_INLINE void mc6847_friend_device::new_frame(void) +inline void mc6847_friend_device::new_frame(void) { m_physical_scanline = 0; m_logical_scanline = 0; @@ -304,7 +304,7 @@ const char *mc6847_friend_device::scanline_zone_string(scanline_zone zone) // change_horizontal_sync //------------------------------------------------- -ATTR_FORCE_INLINE void mc6847_friend_device::change_horizontal_sync(bool line) +inline void mc6847_friend_device::change_horizontal_sync(bool line) { g_profiler.start(PROFILER_USER1); @@ -372,7 +372,7 @@ ATTR_FORCE_INLINE void mc6847_friend_device::change_horizontal_sync(bool line) // change_field_sync //------------------------------------------------- -ATTR_FORCE_INLINE void mc6847_friend_device::change_field_sync(bool line) +inline void mc6847_friend_device::change_field_sync(bool line) { /* output field sync */ if (line != m_field_sync) @@ -397,7 +397,7 @@ ATTR_FORCE_INLINE void mc6847_friend_device::change_field_sync(bool line) // next_scanline //------------------------------------------------- -ATTR_FORCE_INLINE void mc6847_friend_device::next_scanline(void) +inline void mc6847_friend_device::next_scanline(void) { /* advance to next scanline */ m_physical_scanline++; @@ -678,7 +678,7 @@ void mc6847_base_device::record_scanline_res(int scanline, INT32 start_pos, INT3 // record_body_scanline //------------------------------------------------- -ATTR_FORCE_INLINE void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_pos, INT32 end_pos) +inline void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_pos, INT32 end_pos) { // sanity checks assert(scanline < 192); @@ -780,7 +780,7 @@ void mc6847_base_device::field_sync_changed(bool line) // border_value //------------------------------------------------- -ATTR_FORCE_INLINE mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1) +inline mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1) { pixel_t result; switch(mc6847_friend_device::border_value(mode, is_mc6847t1)) diff --git a/src/mess/video/gime.c b/src/mess/video/gime.c index 93e06b149eb..83b78e92b25 100644 --- a/src/mess/video/gime.c +++ b/src/mess/video/gime.c @@ -201,7 +201,7 @@ void gime_base_device::device_start(void) // get_composite_color //------------------------------------------------- -ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_composite_color(int color) +inline gime_base_device::pixel_t gime_base_device::get_composite_color(int color) { /* CMP colors * @@ -313,7 +313,7 @@ ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_composite_colo // get_rgb_color //------------------------------------------------- -ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_rgb_color(int color) +inline gime_base_device::pixel_t gime_base_device::get_rgb_color(int color) { return (((color >> 4) & 2) | ((color >> 2) & 1)) * 0x550000 | (((color >> 3) & 2) | ((color >> 1) & 1)) * 0x005500 @@ -543,7 +543,7 @@ void gime_base_device::reset_timer(void) // update_memory //------------------------------------------------- -ATTR_FORCE_INLINE void gime_base_device::update_memory(void) +inline void gime_base_device::update_memory(void) { for (int bank = 0; bank <= 8; bank++) { @@ -701,7 +701,7 @@ UINT8 gime_base_device::read(offs_t offset) // read_gime_register //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 gime_base_device::read_gime_register(offs_t offset) +inline UINT8 gime_base_device::read_gime_register(offs_t offset) { offset &= 0x0F; @@ -746,7 +746,7 @@ ATTR_FORCE_INLINE UINT8 gime_base_device::read_gime_register(offs_t offset) // read_mmu_register //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 gime_base_device::read_mmu_register(offs_t offset) +inline UINT8 gime_base_device::read_mmu_register(offs_t offset) { return (m_mmu[offset & 0x0F] & 0x3F) | (read_floating_bus() & 0xC0); } @@ -757,7 +757,7 @@ ATTR_FORCE_INLINE UINT8 gime_base_device::read_mmu_register(offs_t offset) // read_palette_register //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 gime_base_device::read_palette_register(offs_t offset) +inline UINT8 gime_base_device::read_palette_register(offs_t offset) { // Bits 7/6 are floating, and behave oddly. On a real CoCo 3 // @@ -775,7 +775,7 @@ ATTR_FORCE_INLINE UINT8 gime_base_device::read_palette_register(offs_t offset) // read_floating_bus //------------------------------------------------- -ATTR_FORCE_INLINE UINT8 gime_base_device::read_floating_bus(void) +inline UINT8 gime_base_device::read_floating_bus(void) { return m_read_floating_bus(0); } @@ -815,7 +815,7 @@ void gime_base_device::write(offs_t offset, UINT8 data) // write_gime_register //------------------------------------------------- -ATTR_FORCE_INLINE void gime_base_device::write_gime_register(offs_t offset, UINT8 data) +inline void gime_base_device::write_gime_register(offs_t offset, UINT8 data) { // this is needed for writes to FF95 bool timer_was_off = (m_gime_registers[0x04] == 0x00) && (m_gime_registers[0x05] == 0x00); @@ -1018,7 +1018,7 @@ ATTR_FORCE_INLINE void gime_base_device::write_gime_register(offs_t offset, UINT // write_mmu_register //------------------------------------------------- -ATTR_FORCE_INLINE void gime_base_device::write_mmu_register(offs_t offset, UINT8 data) +inline void gime_base_device::write_mmu_register(offs_t offset, UINT8 data) { offset &= 0x0F; @@ -1038,7 +1038,7 @@ ATTR_FORCE_INLINE void gime_base_device::write_mmu_register(offs_t offset, UINT8 // write_palette_register //------------------------------------------------- -ATTR_FORCE_INLINE void gime_base_device::write_palette_register(offs_t offset, UINT8 data) +inline void gime_base_device::write_palette_register(offs_t offset, UINT8 data) { offset &= 0x0F; @@ -1071,7 +1071,7 @@ ATTR_FORCE_INLINE void gime_base_device::write_palette_register(offs_t offset, U // write_sam_register //------------------------------------------------- -ATTR_FORCE_INLINE void gime_base_device::write_sam_register(offs_t offset) +inline void gime_base_device::write_sam_register(offs_t offset) { /* change the SAM state */ UINT16 xorval = alter_sam_state(offset); @@ -1145,7 +1145,7 @@ void gime_base_device::recalculate_firq(void) // John Kowalski confirms this behavior //------------------------------------------------- -ATTR_FORCE_INLINE offs_t gime_base_device::get_video_base(void) +inline offs_t gime_base_device::get_video_base(void) { offs_t result; UINT8 ff9d_mask, ff9e_mask; @@ -1282,7 +1282,7 @@ void gime_base_device::record_border_scanline(UINT16 physical_scanline) // get_lines_per_row //------------------------------------------------- -ATTR_FORCE_INLINE UINT16 gime_base_device::get_lines_per_row(void) +inline UINT16 gime_base_device::get_lines_per_row(void) { UINT16 lines_per_row; if (m_legacy_video) @@ -1361,7 +1361,7 @@ ATTR_FORCE_INLINE UINT16 gime_base_device::get_lines_per_row(void) //------------------------------------------------- template -ATTR_FORCE_INLINE UINT32 gime_base_device::record_scanline_res(int scanline) +inline UINT32 gime_base_device::record_scanline_res(int scanline) { int column; UINT32 base_offset = m_legacy_video ? 0 : (m_gime_registers[0x0F] & 0x7F) * 2; @@ -1639,7 +1639,7 @@ UINT32 gime_base_device::emit_dummy_samples(const scanline_record *scanline, int // emit_mc6847_samples //------------------------------------------------- -ATTR_FORCE_INLINE UINT32 gime_base_device::emit_mc6847_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette) +inline UINT32 gime_base_device::emit_mc6847_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette) { return super::emit_mc6847_samples<2>( scanline->m_mode[sample_start], @@ -1659,7 +1659,7 @@ ATTR_FORCE_INLINE UINT32 gime_base_device::emit_mc6847_samples(const scanline_re //------------------------------------------------- template -ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_graphics_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette) +inline UINT32 gime_base_device::emit_gime_graphics_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette) { const UINT8 *data = &scanline->m_data[sample_start]; mc6847_friend_device::emit_graphics(data, sample_count, pixels, 0, palette); @@ -1673,7 +1673,7 @@ ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_graphics_samples(const scan //------------------------------------------------- template -ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_text_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette) +inline UINT32 gime_base_device::emit_gime_text_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette) { UINT8 attribute = scanline->m_mode[sample_start]; const UINT8 *data = &scanline->m_data[sample_start]; @@ -1733,7 +1733,7 @@ ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_text_samples(const scanline //------------------------------------------------- template -ATTR_FORCE_INLINE void gime_base_device::render_scanline(const scanline_record *scanline, pixel_t *pixels, int min_x, int max_x, palette_resolver *resolver) +inline void gime_base_device::render_scanline(const scanline_record *scanline, pixel_t *pixels, int min_x, int max_x, palette_resolver *resolver) { int left_border, right_border; int x, x2, pixel_position; @@ -1934,7 +1934,7 @@ bool gime_base_device::update_rgb(bitmap_rgb32 &bitmap, const rectangle &cliprec // palette_resolver::palette_resolver //------------------------------------------------- -ATTR_FORCE_INLINE gime_base_device::palette_resolver::palette_resolver(gime_base_device *gime, const pixel_t *palette) +inline gime_base_device::palette_resolver::palette_resolver(gime_base_device *gime, const pixel_t *palette) { m_gime = gime; m_palette = palette; @@ -1948,7 +1948,7 @@ ATTR_FORCE_INLINE gime_base_device::palette_resolver::palette_resolver(gime_base // palette_resolver::get_palette //------------------------------------------------- -ATTR_FORCE_INLINE const gime_base_device::pixel_t *gime_base_device::palette_resolver::get_palette(UINT16 palette_rotation) +inline const gime_base_device::pixel_t *gime_base_device::palette_resolver::get_palette(UINT16 palette_rotation) { if (UNEXPECTED(m_current_resolved_palette != palette_rotation)) { @@ -1965,7 +1965,7 @@ ATTR_FORCE_INLINE const gime_base_device::pixel_t *gime_base_device::palette_res // palette_resolver::lookup //------------------------------------------------- -ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::palette_resolver::lookup(UINT8 color) +inline gime_base_device::pixel_t gime_base_device::palette_resolver::lookup(UINT8 color) { assert(color <= 63); return m_palette[color]; From ad0d9f93419180c6ad9d3d93bb40f21599658f9b Mon Sep 17 00:00:00 2001 From: arbee Date: Sun, 31 May 2015 08:48:53 -0400 Subject: [PATCH 050/284] mac: fix crashiness in NuBus "image" card host access [R. Belmont] --- src/emu/bus/nubus/nubus_image.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/emu/bus/nubus/nubus_image.c b/src/emu/bus/nubus/nubus_image.c index 4a49cdac04c..8178b6ec870 100644 --- a/src/emu/bus/nubus/nubus_image.c +++ b/src/emu/bus/nubus/nubus_image.c @@ -215,6 +215,8 @@ void nubus_image_device::device_start() filectx.curdir[0] = '.'; filectx.curdir[1] = '\0'; + filectx.dirp = NULL; + filectx.fd = NULL; } //------------------------------------------------- From a3806ce7a117445e9018bfc0b9444bab56a11788 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 31 May 2015 18:00:42 +0200 Subject: [PATCH 051/284] delegate.h now supports mingw 32 bit builds with INTERNAL configuration. Member functions are called in this case using __thiscall ABI. [Couriersud] --- src/emu/devdelegate.h | 4 +++ src/emu/schedule.h | 2 ++ src/lib/util/delegate.h | 76 ++++++++++++++++++++++++++++++++--------- 3 files changed, 66 insertions(+), 16 deletions(-) diff --git a/src/emu/devdelegate.h b/src/emu/devdelegate.h index 2ce6cc9a0fa..ba1b82ab8ee 100644 --- a/src/emu/devdelegate.h +++ b/src/emu/devdelegate.h @@ -54,17 +54,21 @@ public: device_delegate(const basetype &src) : basetype(src), device_delegate_helper(src.m_device_name) { } device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), device_delegate_helper(src.m_device_name) { } template device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object), device_delegate_helper(safe_tag(dynamic_cast(object))) { } +#ifdef USE_STATIC_DELEGATE template device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object), device_delegate_helper(safe_tag(dynamic_cast(object))) { } template device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object), device_delegate_helper(safe_tag(dynamic_cast(object))) { } +#endif device_delegate &operator=(const thistype &src) { *static_cast(this) = src; m_device_name = src.m_device_name; return *this; } // provide additional constructors that take a device name string template device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { } template device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { } +#ifdef USE_STATIC_DELEGATE template device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { } template device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { } device_delegate(typename basetype::template traits::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), device_delegate_helper(NULL) { } device_delegate(typename basetype::template traits::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), device_delegate_helper(NULL) { } +#endif // and constructors that provide a search root device_delegate(const thistype &src, device_t &search_root) : basetype(src), device_delegate_helper(src.m_device_name) { bind_relative_to(search_root); } diff --git a/src/emu/schedule.h b/src/emu/schedule.h index 36ae83d2929..a2d8660ef4f 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -144,10 +144,12 @@ public: void synchronize(timer_expired_delegate callback = timer_expired_delegate(), int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, param, ptr); } // timers with old-skool callbacks +#ifdef USE_STATIC_DELEGATE emu_timer *timer_alloc(timer_expired_func callback, const char *name, void *ptr = NULL) { return timer_alloc(timer_expired_delegate(callback, name, &machine()), ptr); } void timer_set(const attotime &duration, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_set(duration, timer_expired_delegate(callback, name, &machine()), param, ptr); } void timer_pulse(const attotime &period, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_pulse(period, timer_expired_delegate(callback, name, &machine()), param, ptr); } void synchronize(timer_expired_func callback, const char *name = NULL, int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, name, param, ptr); } +#endif // timers, specified by device/id; generally devices should use the device_t methods instead emu_timer *timer_alloc(device_t &device, device_timer_id id = 0, void *ptr = NULL); diff --git a/src/lib/util/delegate.h b/src/lib/util/delegate.h index 363163e2ccf..3b02f91b976 100644 --- a/src/lib/util/delegate.h +++ b/src/lib/util/delegate.h @@ -95,20 +95,29 @@ #if defined(__GNUC__) /* does not work in versions over 4.7.x of 32bit MINGW */ #if defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) - #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE + //#define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE + #define USE_DELEGATE_TYPE DELEGATE_TYPE_INTERNAL + #define MEMBER_ABI __thiscall + #define HAS_DIFFERENT_ABI 1 #elif defined(EMSCRIPTEN) #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE #elif defined(__arm__) || defined(__ARMEL__) #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE #else #define USE_DELEGATE_TYPE DELEGATE_TYPE_INTERNAL + #define MEMBER_ABI + #define HAS_DIFFERENT_ABI 0 #endif #else #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE #endif +#define USE_STATIC_DELEGATE 1 - +#if (USE_DELEGATE_TYPE == DELEGATE_TYPE_COMPATIBLE) + #define MEMBER_ABI + #define HAS_DIFFERENT_ABI 0 +#endif //************************************************************************** // HELPER CLASSES //************************************************************************** @@ -554,7 +563,7 @@ public: typedef typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type, _P5Type, _P6Type, _P7Type, _P8Type, _P9Type, _P10Type, _P11Type, _P12Type>::static_ref_func_type static_ref_func_type; }; typedef typename traits::static_func_type generic_static_func; - + typedef MEMBER_ABI generic_static_func generic_member_func; // generic constructor delegate_base() : m_function(NULL), @@ -646,20 +655,29 @@ public: return (m_raw_function == rhs.m_raw_function && object() == rhs.object() && m_raw_mfp == rhs.m_raw_mfp); } +#define DELEGATE_CALL(x) \ + if (is_mfp() && (HAS_DIFFERENT_ABI)) \ + return (*reinterpret_cast(m_function)) x; \ + else \ + return (*m_function) x; \ + + //return MEMBER_ABI (*reinpertret_cast(m_function)) x; + // call the function - _ReturnType operator()() const { return (*m_function)(m_object); } - _ReturnType operator()(_P1Type p1) const { return (*m_function)(m_object, p1); } - _ReturnType operator()(_P1Type p1, _P2Type p2) const { return (*m_function)(m_object, p1, p2); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5) const { return (*m_function)(m_object, p1, p2, p3, p4, p5); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); } - _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11, _P12Type p12) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); } + _ReturnType operator()() const { DELEGATE_CALL((m_object)); } + //_ReturnType operator()() const { return (*m_function)(m_object); } + _ReturnType operator()(_P1Type p1) const { DELEGATE_CALL((m_object, p1)); } + _ReturnType operator()(_P1Type p1, _P2Type p2) const { DELEGATE_CALL((m_object, p1, p2)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { DELEGATE_CALL((m_object, p1, p2, p3)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { DELEGATE_CALL((m_object, p1, p2, p3, p4)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)); } + _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11, _P12Type p12) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)); } // getters bool has_object() const { return (object() != NULL); } @@ -732,8 +750,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -749,8 +769,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -766,8 +788,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -783,8 +807,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -800,8 +826,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -817,8 +845,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -834,8 +864,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -851,8 +883,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -868,8 +902,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -885,8 +921,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -902,8 +940,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -919,8 +959,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; @@ -936,8 +978,10 @@ public: delegate(const basetype &src) : basetype(src) { } delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { } template delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#ifdef USE_STATIC_DELEGATE template delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } template delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { } +#endif delegate &operator=(const basetype &src) { *static_cast(this) = src; return *this; } }; From b7a823de3f76de9a67835a75cde2ee8f604a01ba Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 31 May 2015 18:01:46 +0200 Subject: [PATCH 052/284] Code maintenance. Remove commented out directives. (nw) --- src/emu/netlist/analog/nld_bjt.h | 12 ++--- src/emu/netlist/analog/nld_fourterm.h | 18 +++---- src/emu/netlist/analog/nld_ms_direct.h | 6 +-- src/emu/netlist/analog/nld_ms_jakobi.h | 2 +- src/emu/netlist/analog/nld_ms_sor.h | 2 +- src/emu/netlist/analog/nld_ms_sor_mat.h | 2 +- src/emu/netlist/analog/nld_solver.h | 14 ++--- src/emu/netlist/analog/nld_twoterm.h | 18 +++---- src/emu/netlist/devices/nld_signal.h | 6 +-- src/emu/netlist/devices/nld_system.c | 4 +- src/emu/netlist/devices/nld_truthtable.c | 4 +- src/emu/netlist/devices/nld_truthtable.h | 16 +++--- src/emu/netlist/nl_base.h | 66 ++++++++++++------------ src/emu/netlist/nl_config.h | 2 +- src/emu/netlist/nl_factory.h | 4 +- src/emu/netlist/plib/pconfig.h | 2 +- 16 files changed, 89 insertions(+), 89 deletions(-) diff --git a/src/emu/netlist/analog/nld_bjt.h b/src/emu/netlist/analog/nld_bjt.h index eca05c423c7..69a56ea16ad 100644 --- a/src/emu/netlist/analog/nld_bjt.h +++ b/src/emu/netlist/analog/nld_bjt.h @@ -46,8 +46,8 @@ public: inline bool is_qtype(q_type atype) const { return m_qtype == atype; } inline void set_qtype(q_type atype) { m_qtype = atype; } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); + virtual void start(); + virtual void reset(); ATTR_HOT void update(); netlist_param_model_t m_model; @@ -110,9 +110,9 @@ public: protected: - /* ATTR_COLD */ virtual void start(); + virtual void start(); ATTR_HOT virtual void update_param(); - /* ATTR_COLD */ virtual void reset(); + virtual void reset(); NETLIB_UPDATE_TERMINALSI(); nl_double m_gB; // base conductance / switch on @@ -142,8 +142,8 @@ public: protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); + virtual void start(); + virtual void reset(); ATTR_HOT void update_param(); ATTR_HOT void virtual update(); NETLIB_UPDATE_TERMINALSI(); diff --git a/src/emu/netlist/analog/nld_fourterm.h b/src/emu/netlist/analog/nld_fourterm.h index 13584babef5..e14a69a9944 100644 --- a/src/emu/netlist/analog/nld_fourterm.h +++ b/src/emu/netlist/analog/nld_fourterm.h @@ -56,9 +56,9 @@ public: : netlist_device_t(afamily), m_gfac(1.0) { } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); - /* ATTR_COLD */ virtual void update_param(); + virtual void start(); + virtual void reset(); + virtual void update_param(); ATTR_HOT void update(); ATTR_COLD void start_internal(const nl_double def_RI); @@ -112,9 +112,9 @@ public: //: netlist_device_t(afamily), m_gfac(1.0) { } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); - /* ATTR_COLD */ virtual void update_param(); + virtual void start(); + virtual void reset(); + virtual void update_param(); ATTR_HOT void update(); nl_double m_gfac; @@ -156,9 +156,9 @@ public: : NETLIB_NAME(VCCS)(VCVS) { } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); - /* ATTR_COLD */ virtual void update_param(); + virtual void start(); + virtual void reset(); + virtual void update_param(); //ATTR_HOT void update(); netlist_terminal_t m_OP2; diff --git a/src/emu/netlist/analog/nld_ms_direct.h b/src/emu/netlist/analog/nld_ms_direct.h index 92d6d7b5fe4..b757f82c8b3 100644 --- a/src/emu/netlist/analog/nld_ms_direct.h +++ b/src/emu/netlist/analog/nld_ms_direct.h @@ -20,15 +20,15 @@ public: virtual ~netlist_matrix_solver_direct_t(); - /* ATTR_COLD */ virtual void vsetup(netlist_analog_net_t::list_t &nets); - /* ATTR_COLD */ virtual void reset() { netlist_matrix_solver_t::reset(); } + virtual void vsetup(netlist_analog_net_t::list_t &nets); + virtual void reset() { netlist_matrix_solver_t::reset(); } ATTR_HOT inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson); protected: - /* ATTR_COLD */ virtual void add_term(int net_idx, netlist_terminal_t *term); + virtual void add_term(int net_idx, netlist_terminal_t *term); ATTR_HOT virtual nl_double vsolve(); diff --git a/src/emu/netlist/analog/nld_ms_jakobi.h b/src/emu/netlist/analog/nld_ms_jakobi.h index 9376e54c9ef..04da90a6176 100644 --- a/src/emu/netlist/analog/nld_ms_jakobi.h +++ b/src/emu/netlist/analog/nld_ms_jakobi.h @@ -31,7 +31,7 @@ public: virtual ~netlist_matrix_solver_SOR_t() {} - /* ATTR_COLD */ virtual void log_stats(); + virtual void log_stats(); ATTR_HOT inline int vsolve_non_dynamic(); protected: diff --git a/src/emu/netlist/analog/nld_ms_sor.h b/src/emu/netlist/analog/nld_ms_sor.h index 810e88799ac..93d645b3633 100644 --- a/src/emu/netlist/analog/nld_ms_sor.h +++ b/src/emu/netlist/analog/nld_ms_sor.h @@ -30,7 +30,7 @@ public: virtual ~netlist_matrix_solver_SOR_t() {} - /* ATTR_COLD */ virtual void log_stats(); + virtual void log_stats(); ATTR_HOT virtual int vsolve_non_dynamic(const bool newton_raphson); protected: diff --git a/src/emu/netlist/analog/nld_ms_sor_mat.h b/src/emu/netlist/analog/nld_ms_sor_mat.h index adc65170a87..fd7d76a0157 100644 --- a/src/emu/netlist/analog/nld_ms_sor_mat.h +++ b/src/emu/netlist/analog/nld_ms_sor_mat.h @@ -36,7 +36,7 @@ public: virtual ~netlist_matrix_solver_SOR_mat_t() {} - /* ATTR_COLD */ virtual void log_stats(); + virtual void log_stats(); ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson); protected: diff --git a/src/emu/netlist/analog/nld_solver.h b/src/emu/netlist/analog/nld_solver.h index 23c050c11a4..0ddd3fd2a0f 100644 --- a/src/emu/netlist/analog/nld_solver.h +++ b/src/emu/netlist/analog/nld_solver.h @@ -100,9 +100,9 @@ public: }; ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t *params); - /* ATTR_COLD */ virtual ~netlist_matrix_solver_t(); + virtual ~netlist_matrix_solver_t(); - /* ATTR_COLD */ virtual void vsetup(netlist_analog_net_t::list_t &nets) = 0; + virtual void vsetup(netlist_analog_net_t::list_t &nets) = 0; template void solve_base(C *p); @@ -120,11 +120,11 @@ public: /* netdevice functions */ ATTR_HOT virtual void update(); - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); + virtual void start(); + virtual void reset(); ATTR_COLD int get_net_idx(netlist_net_t *net); - /* ATTR_COLD */ virtual void log_stats() {}; + virtual void log_stats() {}; inline eSolverType type() const { return m_type; } @@ -136,7 +136,7 @@ protected: // should return next time step ATTR_HOT virtual nl_double vsolve() = 0; - /* ATTR_COLD */ virtual void add_term(int net_idx, netlist_terminal_t *term) = 0; + virtual void add_term(int net_idx, netlist_terminal_t *term) = 0; plist_t m_nets; plist_t m_inps; @@ -173,7 +173,7 @@ public: NETLIB_NAME(solver)() : netlist_device_t() { } - /* ATTR_COLD */ virtual ~NETLIB_NAME(solver)(); + virtual ~NETLIB_NAME(solver)(); ATTR_COLD void post_start(); ATTR_COLD void stop(); diff --git a/src/emu/netlist/analog/nld_twoterm.h b/src/emu/netlist/analog/nld_twoterm.h index fed3b148db5..43b0f61a8f8 100644 --- a/src/emu/netlist/analog/nld_twoterm.h +++ b/src/emu/netlist/analog/nld_twoterm.h @@ -122,8 +122,8 @@ public: } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); + virtual void start(); + virtual void reset(); ATTR_HOT void update(); private: @@ -144,8 +144,8 @@ public: } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); + virtual void start(); + virtual void reset(); ATTR_HOT void update(); }; @@ -193,9 +193,9 @@ public: } protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void reset(); - /* ATTR_COLD */ virtual void update_param(); + virtual void start(); + virtual void reset(); + virtual void update_param(); ATTR_HOT void update(); netlist_param_double_t m_C; @@ -282,8 +282,8 @@ public: NETLIB_UPDATE_TERMINALSI(); protected: - /* ATTR_COLD */ virtual void start(); - /* ATTR_COLD */ virtual void update_param(); + virtual void start(); + virtual void update_param(); ATTR_HOT void update(); netlist_param_model_t m_model; diff --git a/src/emu/netlist/devices/nld_signal.h b/src/emu/netlist/devices/nld_signal.h index 3f4bb331741..f6ac5fd0924 100644 --- a/src/emu/netlist/devices/nld_signal.h +++ b/src/emu/netlist/devices/nld_signal.h @@ -18,7 +18,7 @@ class NETLIB_NAME(_name) : public net_signal_t<_num_input, _check, _invert> \ { \ public: \ - ATTR_COLD NETLIB_NAME(_name) () \ + NETLIB_NAME(_name) () \ : net_signal_t<_num_input, _check, _invert>() { } \ } @@ -35,7 +35,7 @@ public: { } - ATTR_COLD void start() + void start() { const char *sIN[8] = { "A", "B", "C", "D", "E", "F", "G", "H" }; @@ -47,7 +47,7 @@ public: save(NLNAME(m_active)); } - ATTR_COLD void reset() + void reset() { m_Q[0].initial(0); m_active = 1; diff --git a/src/emu/netlist/devices/nld_system.c b/src/emu/netlist/devices/nld_system.c index b7a5cf6c71e..d32b169151d 100644 --- a/src/emu/netlist/devices/nld_system.c +++ b/src/emu/netlist/devices/nld_system.c @@ -177,7 +177,7 @@ NETLIB_UPDATE_PARAM(analog_input) // nld_d_to_a_proxy // ---------------------------------------------------------------------------------------- -ATTR_COLD void nld_d_to_a_proxy::start() +void nld_d_to_a_proxy::start() { nld_base_d_to_a_proxy::start(); @@ -192,7 +192,7 @@ ATTR_COLD void nld_d_to_a_proxy::start() m_Q.initial(0.0); } -ATTR_COLD void nld_d_to_a_proxy::reset() +void nld_d_to_a_proxy::reset() { m_RV.do_reset(); m_is_timestep = m_RV.m_P.net().as_analog().solver()->is_timestep(); diff --git a/src/emu/netlist/devices/nld_truthtable.c b/src/emu/netlist/devices/nld_truthtable.c index 03acc31d4f4..24c3e88285e 100644 --- a/src/emu/netlist/devices/nld_truthtable.c +++ b/src/emu/netlist/devices/nld_truthtable.c @@ -97,7 +97,7 @@ UINT32 truthtable_desc_t::get_ignored_extended(UINT32 i) // desc // ---------------------------------------------------------------------------------------- -ATTR_COLD void truthtable_desc_t::help(unsigned cur, pstring_list_t list, +void truthtable_desc_t::help(unsigned cur, pstring_list_t list, UINT64 state,UINT16 val, UINT8 *timing_index) { pstring elem = list[cur].trim(); @@ -142,7 +142,7 @@ ATTR_COLD void truthtable_desc_t::help(unsigned cur, pstring_list_t list, } } -ATTR_COLD void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32 disabled_ignore) +void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32 disabled_ignore) { unsigned line = 0; diff --git a/src/emu/netlist/devices/nld_truthtable.h b/src/emu/netlist/devices/nld_truthtable.h index 3f447d28f2e..dbeeb5ab57e 100644 --- a/src/emu/netlist/devices/nld_truthtable.h +++ b/src/emu/netlist/devices/nld_truthtable.h @@ -45,10 +45,10 @@ struct truthtable_desc_t { } - ATTR_COLD void setup(const pstring_list_t &desc, UINT32 disabled_ignore); + void setup(const pstring_list_t &desc, UINT32 disabled_ignore); private: - ATTR_COLD void help(unsigned cur, pstring_list_t list, + void help(unsigned cur, pstring_list_t list, UINT64 state,UINT16 val, UINT8 *timing_index); static unsigned count_bits(UINT32 v); static UINT32 set_bits(UINT32 v, UINT32 b); @@ -106,7 +106,7 @@ public: m_desc = desc; } - /* ATTR_COLD */ virtual void start() + virtual void start() { pstring header = m_desc[0]; @@ -164,7 +164,7 @@ public: } - ATTR_COLD void reset() + void reset() { m_active = 0; for (unsigned i=0; i - ATTR_HOT inline void process() + inline void process() { netlist_time mt = netlist_time::zero; @@ -262,7 +262,7 @@ class netlist_base_factory_truthtable_t : public netlist_base_factory_t { NETLIST_PREVENT_COPYING(netlist_base_factory_truthtable_t) public: - ATTR_COLD netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname, + netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname, const pstring &def_param) : netlist_base_factory_t(name, classname, def_param) {} @@ -275,11 +275,11 @@ class netlist_factory_truthtable_t : public netlist_base_factory_truthtable_t { NETLIST_PREVENT_COPYING(netlist_factory_truthtable_t) public: - ATTR_COLD netlist_factory_truthtable_t(const pstring &name, const pstring &classname, + netlist_factory_truthtable_t(const pstring &name, const pstring &classname, const pstring &def_param) : netlist_base_factory_truthtable_t(name, classname, def_param) { } - ATTR_COLD netlist_device_t *Create() + netlist_device_t *Create() { typedef nld_truthtable_t tt_type; netlist_device_t *r = palloc(tt_type, &m_ttbl, m_desc); diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index fe70e4677ac..7e9ed94d499 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -173,7 +173,7 @@ class netlist_core_device_t; #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) typedef void (netlist_core_device_t::*net_update_delegate)(); #elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) -typedef void (*net_update_delegate)(netlist_core_device_t *); +typedef /*__thiscall */ void (*net_update_delegate)(netlist_core_device_t *); #endif //============================================================ @@ -248,7 +248,7 @@ typedef void (*net_update_delegate)(netlist_core_device_t *); , _priv) #define NETLIB_LOGIC_FAMILY(_fam) \ -/* ATTR_COLD */ virtual const netlist_logic_family_desc_t *default_logic_family() \ +virtual const netlist_logic_family_desc_t *default_logic_family() \ { \ return &netlist_family_ ## _fam; \ } @@ -409,9 +409,9 @@ public: protected: - /* ATTR_COLD */ virtual void reset() = 0; + virtual void reset() = 0; // must call parent save_register ! - /* ATTR_COLD */ virtual void save_register() { }; + virtual void save_register() { }; private: pstring m_name; @@ -483,7 +483,7 @@ public: ATTR_HOT /* inline */ void update_dev(const UINT32 mask); protected: - /* ATTR_COLD */ virtual void save_register() + virtual void save_register() { save(NLNAME(m_state)); netlist_owned_object_t::save_register(); @@ -537,9 +537,9 @@ public: netlist_terminal_t *m_otherterm; protected: - /* ATTR_COLD */ virtual void save_register(); + virtual void save_register(); - /* ATTR_COLD */ virtual void reset(); + virtual void reset(); private: ATTR_HOT void set_ptr(nl_double *ptr, const nl_double val) { @@ -613,7 +613,7 @@ public: ATTR_HOT void activate_lh(); protected: - /* ATTR_COLD */ virtual void reset() + virtual void reset() { //netlist_core_terminal_t::reset(); set_state(STATE_INP_ACTIVE); @@ -637,7 +637,7 @@ public: ATTR_HOT nl_double Q_Analog() const; protected: - /* ATTR_COLD */ virtual void reset() + virtual void reset() { //netlist_core_terminal_t::reset(); set_state(STATE_INP_ACTIVE); @@ -656,7 +656,7 @@ public: typedef plist_t list_t; ATTR_COLD netlist_net_t(const family_t afamily); - /* ATTR_COLD */ virtual ~netlist_net_t(); + virtual ~netlist_net_t(); ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname); @@ -705,8 +705,8 @@ public: protected: //FIXME: needed by current solver code - /* ATTR_COLD */ virtual void save_register(); - /* ATTR_COLD */ virtual void reset(); + virtual void save_register(); + virtual void reset(); netlist_sig_t m_new_Q; netlist_sig_t m_cur_Q; @@ -736,7 +736,7 @@ public: typedef plist_t list_t; ATTR_COLD netlist_logic_net_t(); - /* ATTR_COLD */ virtual ~netlist_logic_net_t() { }; + virtual ~netlist_logic_net_t() { }; ATTR_HOT netlist_sig_t Q() const { @@ -778,8 +778,8 @@ public: protected: //FIXME: needed by current solver code - /* ATTR_COLD */ virtual void save_register(); - /* ATTR_COLD */ virtual void reset(); + virtual void save_register(); + virtual void reset(); private: @@ -796,7 +796,7 @@ public: typedef plist_t list_t; ATTR_COLD netlist_analog_net_t(); - /* ATTR_COLD */ virtual ~netlist_analog_net_t() { }; + virtual ~netlist_analog_net_t() { }; ATTR_HOT nl_double Q_Analog() const { @@ -815,8 +815,8 @@ public: protected: - /* ATTR_COLD */ virtual void save_register(); - /* ATTR_COLD */ virtual void reset(); + virtual void save_register(); + virtual void reset(); private: @@ -841,7 +841,7 @@ public: ATTR_COLD netlist_logic_output_t(); ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname); - /* ATTR_COLD */ virtual void reset() + virtual void reset() { set_state(STATE_OUT); } @@ -865,7 +865,7 @@ public: ATTR_COLD netlist_analog_output_t(); ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname); - /* ATTR_COLD */ virtual void reset() + virtual void reset() { set_state(STATE_OUT); } @@ -903,7 +903,7 @@ public: protected: - /* ATTR_COLD */ virtual void reset() { } + virtual void reset() { } private: const param_type_t m_param_type; @@ -920,7 +920,7 @@ public: ATTR_HOT nl_double Value() const { return m_param; } protected: - /* ATTR_COLD */ virtual void save_register() + virtual void save_register() { save(NLNAME(m_param)); netlist_param_t::save_register(); @@ -942,7 +942,7 @@ public: ATTR_HOT int Value() const { return m_param; } protected: - /* ATTR_COLD */ virtual void save_register() + virtual void save_register() { save(NLNAME(m_param)); netlist_param_t::save_register(); @@ -1005,9 +1005,9 @@ public: ATTR_COLD netlist_core_device_t(const family_t afamily); - /* ATTR_COLD */ virtual ~netlist_core_device_t(); + virtual ~netlist_core_device_t(); - /* ATTR_COLD */ virtual void init(netlist_base_t &anetlist, const pstring &name); + virtual void init(netlist_base_t &anetlist, const pstring &name); ATTR_HOT virtual void update_param() {} ATTR_HOT void update_dev() @@ -1066,9 +1066,9 @@ public: protected: ATTR_HOT virtual void update() { } - /* ATTR_COLD */ virtual void start() { } - /* ATTR_COLD */ virtual void stop() { } \ - /* ATTR_COLD */ virtual const netlist_logic_family_desc_t *default_logic_family() + virtual void start() { } + virtual void stop() { } \ + virtual const netlist_logic_family_desc_t *default_logic_family() { return &netlist_family_TTL; } @@ -1088,9 +1088,9 @@ public: ATTR_COLD netlist_device_t(); ATTR_COLD netlist_device_t(const family_t afamily); - /* ATTR_COLD */ virtual ~netlist_device_t(); + virtual ~netlist_device_t(); - /* ATTR_COLD */ virtual void init(netlist_base_t &anetlist, const pstring &name); + virtual void init(netlist_base_t &anetlist, const pstring &name); ATTR_COLD netlist_setup_t &setup(); @@ -1245,12 +1245,12 @@ protected: }; // any derived netlist must override this ... - /* ATTR_COLD */ virtual void verror(const loglevel_e level, + virtual void verror(const loglevel_e level, const char *format, va_list ap) const = 0; /* from netlist_object */ - /* ATTR_COLD */ virtual void reset(); - /* ATTR_COLD */ virtual void save_register(); + virtual void reset(); + virtual void save_register(); #if (NL_KEEP_STATISTICS) // performance diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index b3f0e219d4e..30ba2fae678 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -47,7 +47,7 @@ */ // This will be autodetected -// #define NL_PMF_TYPE 3 +#define NL_PMF_TYPE 3 #define NL_PMF_TYPE_VIRTUAL 0 #define NL_PMF_TYPE_GNUC_PMF 1 diff --git a/src/emu/netlist/nl_factory.h b/src/emu/netlist/nl_factory.h index ff4c56ceff1..c0379caced4 100644 --- a/src/emu/netlist/nl_factory.h +++ b/src/emu/netlist/nl_factory.h @@ -27,9 +27,9 @@ public: : m_name(name), m_classname(classname), m_def_param(def_param) {} - /* ATTR_COLD */ virtual ~netlist_base_factory_t() {} + virtual ~netlist_base_factory_t() {} - /* ATTR_COLD */ virtual netlist_device_t *Create() = 0; + virtual netlist_device_t *Create() = 0; ATTR_COLD const pstring &name() const { return m_name; } ATTR_COLD const pstring &classname() const { return m_classname; } diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h index 5598906d730..9e25751ec72 100644 --- a/src/emu/netlist/plib/pconfig.h +++ b/src/emu/netlist/plib/pconfig.h @@ -134,7 +134,7 @@ typedef int64_t INT64; * It derives a pointer to a member function. */ -#if (PHAS_PMF_INTERNAL) +#if 1 || (PHAS_PMF_INTERNAL) class pmfp { public: From 75b15886e3d8ea223dd3674f0b5020231923a651 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 18:10:58 +0200 Subject: [PATCH 053/284] pk8020: updated to use the new wd fdc. fixes regression booting cp/m. --- scripts/src/lib.lua | 2 ++ src/lib/formats/pk8020_dsk.c | 44 +++++++++++++++++++++++++++ src/lib/formats/pk8020_dsk.h | 33 ++++++++++++++++++++ src/mess/drivers/pk8020.c | 40 +++++++++++------------- src/mess/includes/pk8020.h | 14 +++++++-- src/mess/machine/pk8020.c | 59 +++++++++++++++--------------------- 6 files changed, 133 insertions(+), 59 deletions(-) create mode 100644 src/lib/formats/pk8020_dsk.c create mode 100644 src/lib/formats/pk8020_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index e24ff00f438..788aaf18e9d 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -313,6 +313,8 @@ project "formats" MAME_DIR .. "src/lib/formats/pc98fdi_dsk.h", MAME_DIR .. "src/lib/formats/phc25_cas.c", MAME_DIR .. "src/lib/formats/phc25_cas.h", + MAME_DIR .. "src/lib/formats/pk8020_dsk.c", + MAME_DIR .. "src/lib/formats/pk8020_dsk.h", MAME_DIR .. "src/lib/formats/pmd_cas.c", MAME_DIR .. "src/lib/formats/pmd_cas.h", MAME_DIR .. "src/lib/formats/primoptp.c", diff --git a/src/lib/formats/pk8020_dsk.c b/src/lib/formats/pk8020_dsk.c new file mode 100644 index 00000000000..e21fdbdb98e --- /dev/null +++ b/src/lib/formats/pk8020_dsk.c @@ -0,0 +1,44 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + PK-8020 + + Disk image format + + TODO: + - Verify gap sizes + +***************************************************************************/ + +#include "pk8020_dsk.h" + +pk8020_format::pk8020_format() : wd177x_format(formats) +{ +} + +const char *pk8020_format::name() const +{ + return "pk8020"; +} + +const char *pk8020_format::description() const +{ + return "PK-8020 disk image"; +} + +const char *pk8020_format::extensions() const +{ + return "kdi"; +} + +const pk8020_format::format pk8020_format::formats[] = +{ + { + floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM, + 2000, 5, 80, 2, 1024, {}, 1, {}, 60, 22, 24 + }, + {} +}; + +const floppy_format_type FLOPPY_PK8020_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/pk8020_dsk.h b/src/lib/formats/pk8020_dsk.h new file mode 100644 index 00000000000..1700530c781 --- /dev/null +++ b/src/lib/formats/pk8020_dsk.h @@ -0,0 +1,33 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + PK-8020 + + Disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __PK8020_DSK_H__ +#define __PK8020_DSK_H__ + +#include "wd177x_dsk.h" + +class pk8020_format : public wd177x_format +{ +public: + pk8020_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_PK8020_FORMAT; + +#endif // __PK8020_DSK_H__ diff --git a/src/mess/drivers/pk8020.c b/src/mess/drivers/pk8020.c index e238baf7b3c..49d8faec173 100644 --- a/src/mess/drivers/pk8020.c +++ b/src/mess/drivers/pk8020.c @@ -14,7 +14,7 @@ #include "cpu/i8085/i8085.h" #include "machine/i8255.h" #include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" +#include "formats/pk8020_dsk.h" #include "includes/pk8020.h" #include "machine/ram.h" @@ -141,21 +141,6 @@ static INPUT_PORTS_START( pk8020 ) PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED) INPUT_PORTS_END -static LEGACY_FLOPPY_OPTIONS_START(pk8020) - LEGACY_FLOPPY_OPTION(pk8020, "kdi", "PK8020 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([5]) - SECTOR_LENGTH([1024]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -static const floppy_interface pk8020_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(pk8020), - "floppy_5_25" -}; /* F4 Character Displayer */ static const gfx_layout pk8020_charlayout = @@ -176,6 +161,15 @@ static GFXDECODE_START( pk8020 ) GFXDECODE_END +FLOPPY_FORMATS_MEMBER( pk8020_state::floppy_formats ) + FLOPPY_PK8020_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( pk8020_floppies ) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END + + /* Machine driver */ static MACHINE_CONFIG_START( pk8020, pk8020_state ) /* basic machine hardware */ @@ -221,9 +215,14 @@ static MACHINE_CONFIG_START( pk8020, pk8020_state ) MCFG_DEVICE_ADD("rs232", I8251, 0) MCFG_DEVICE_ADD("lan", I8251, 0) - MCFG_DEVICE_ADD("wd1793", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_DDEN_CALLBACK(VCC) + MCFG_FD1793x_ADD("wd1793", XTAL_20MHz / 20) + + MCFG_FLOPPY_DRIVE_ADD("wd1793:0", pk8020_floppies, "qd", pk8020_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd1793:1", pk8020_floppies, "qd", pk8020_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd1793:2", pk8020_floppies, "qd", pk8020_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd1793:3", pk8020_floppies, "qd", pk8020_state::floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("flop_list", "korvet_flop") /* audio hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -235,9 +234,6 @@ static MACHINE_CONFIG_START( pk8020, pk8020_state ) MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(pk8020_floppy_interface) - MCFG_SOFTWARE_LIST_ADD("flop_list","korvet_flop") - /* internal ram */ MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("258K") //64 + 4*48 + 2 diff --git a/src/mess/includes/pk8020.h b/src/mess/includes/pk8020.h index 63994d4a536..e73fa870187 100644 --- a/src/mess/includes/pk8020.h +++ b/src/mess/includes/pk8020.h @@ -13,7 +13,7 @@ #include "machine/pit8253.h" #include "machine/pic8259.h" #include "machine/i8251.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "imagedev/cassette.h" #include "sound/speaker.h" #include "sound/wave.h" @@ -33,6 +33,10 @@ public: m_lan(*this, "lan"), m_ram(*this, RAM_TAG), m_wd1793(*this, "wd1793"), + m_floppy0(*this, "wd1793:0"), + m_floppy1(*this, "wd1793:1"), + m_floppy2(*this, "wd1793:2"), + m_floppy3(*this, "wd1793:3"), m_pit8253(*this, "pit8253"), m_pic8259(*this, "pic8259"), m_speaker(*this, "speaker"), @@ -40,6 +44,8 @@ public: m_region_gfx1(*this, "gfx1"), m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + UINT8 m_color; UINT8 m_video_page; UINT8 m_wide; @@ -84,7 +90,11 @@ protected: required_device m_rs232; required_device m_lan; required_device m_ram; - required_device m_wd1793; + required_device m_wd1793; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; required_device m_pit8253; required_device m_pic8259; required_device m_speaker; diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c index 21816e14f7f..d20ab196748 100644 --- a/src/mess/machine/pk8020.c +++ b/src/mess/machine/pk8020.c @@ -157,13 +157,7 @@ READ8_MEMBER(pk8020_state::devices_r) case 1 : return m_rs232->status_r(space,0); } break; - case 0x18: switch(offset & 3) { - case 0 : return m_wd1793->status_r(space, 0); - case 1 : return m_wd1793->track_r(space, 0); - case 2 : return m_wd1793->sector_r(space, 0); - case 3 : return m_wd1793->data_r(space, 0); - } - break; + case 0x18: return m_wd1793->read(space, offset & 0x03); case 0x20: switch(offset & 1) { case 0 : return m_lan->data_r(space,0); case 1 : return m_lan->status_r(space,0); @@ -187,13 +181,9 @@ WRITE8_MEMBER(pk8020_state::devices_w) case 1 : m_rs232->control_w(space,0,data); break; } break; - case 0x18: switch(offset & 3) { - case 0 : m_wd1793->command_w(space, 0,data);break; - case 1 : m_wd1793->track_w(space, 0,data);break; - case 2 : m_wd1793->sector_w(space, 0,data);break; - case 3 : m_wd1793->data_w(space, 0,data);break; - } - break; + case 0x18: + m_wd1793->write(space, offset & 0x03, data); + break; case 0x20: switch(offset & 1) { case 0 : m_lan->data_w(space,0,data); break; case 1 : m_lan->control_w(space,0,data); break; @@ -841,29 +831,28 @@ WRITE8_MEMBER(pk8020_state::pk8020_portc_w) WRITE8_MEMBER(pk8020_state::pk8020_portb_w) { + floppy_image_device *floppy = NULL; + // Turn all motors off - floppy_get_device(machine(), 0)->floppy_mon_w(1); - floppy_get_device(machine(), 1)->floppy_mon_w(1); - floppy_get_device(machine(), 2)->floppy_mon_w(1); - floppy_get_device(machine(), 3)->floppy_mon_w(1); - m_wd1793->set_side(BIT(data,4)); - if (BIT(data,0)) { - m_wd1793->set_drive(0); - floppy_get_device(machine(), 0)->floppy_mon_w(0); - floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(1, 1); - } else if (BIT(data,1)) { - m_wd1793->set_drive(1); - floppy_get_device(machine(), 1)->floppy_mon_w(0); - floppy_get_device(machine(), 1)->floppy_drive_set_ready_state(1, 1); - } else if (BIT(data,2)) { - m_wd1793->set_drive(2); - floppy_get_device(machine(), 2)->floppy_mon_w(0); - floppy_get_device(machine(), 2)->floppy_drive_set_ready_state(1, 1); - } else if (BIT(data,3)) { - m_wd1793->set_drive(3); - floppy_get_device(machine(), 3)->floppy_mon_w(0); - floppy_get_device(machine(), 3)->floppy_drive_set_ready_state(1, 1); + if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(1); + if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(1); + if (m_floppy2->get_device()) m_floppy2->get_device()->mon_w(1); + if (m_floppy3->get_device()) m_floppy3->get_device()->mon_w(1); + + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); + if (BIT(data, 2)) floppy = m_floppy2->get_device(); + if (BIT(data, 3)) floppy = m_floppy3->get_device(); + + m_wd1793->set_floppy(floppy); + + if (floppy) + { + floppy->mon_w(0); + floppy->ss_w(BIT(data, 4)); } + + // todo: at least bit 5 and bit 7 is connected to something too... } READ8_MEMBER(pk8020_state::pk8020_portc_r) From b2d2d4de2d19f7d8486bc2e1af0ac61b86d9faf9 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 18:28:09 +0200 Subject: [PATCH 054/284] remove it here too (nw) --- src/mess/machine/pk8020.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c index d20ab196748..e065aac7fd7 100644 --- a/src/mess/machine/pk8020.c +++ b/src/mess/machine/pk8020.c @@ -13,7 +13,6 @@ #include "emu.h" #include "includes/pk8020.h" #include "cpu/i8085/i8085.h" -#include "machine/wd17xx.h" #include "imagedev/flopdrv.h" From 8c828a727f363e334215600af3654b2bcf88a71a Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 31 May 2015 19:44:05 +0200 Subject: [PATCH 055/284] added i/o ports+opcodes --- src/emu/cpu/melps4/m58846.c | 6 +- src/emu/cpu/melps4/melps4.c | 105 +++++++++++++++++++++++++++++ src/emu/cpu/melps4/melps4.h | 115 ++++++++++++++++++++++++++++++-- src/emu/cpu/melps4/melps4op.inc | 36 +++++----- 4 files changed, 234 insertions(+), 28 deletions(-) diff --git a/src/emu/cpu/melps4/m58846.c b/src/emu/cpu/melps4/m58846.c index bcc50e06ca3..fb5760cabaa 100644 --- a/src/emu/cpu/melps4/m58846.c +++ b/src/emu/cpu/melps4/m58846.c @@ -30,7 +30,7 @@ ADDRESS_MAP_END // device definitions m58846_device::m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : melps4_cpu_device(mconfig, M58846, "M58846", tag, owner, clock, 11, ADDRESS_MAP_NAME(program_2kx9), 7, ADDRESS_MAP_NAME(data_128x4), "m58846", __FILE__) + : melps4_cpu_device(mconfig, M58846, "M58846", tag, owner, clock, 11, ADDRESS_MAP_NAME(program_2kx9), 7, ADDRESS_MAP_NAME(data_128x4), 12 /* number of D pins */, 2 /* subroutine page */, 1 /* interrupt page */, "m58846", __FILE__) { } @@ -50,10 +50,6 @@ offs_t m58846_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o void m58846_device::device_start() { melps4_cpu_device::device_start(); - - // set fixed state - m_sm_page = 2; - m_int_page = 1; } diff --git a/src/emu/cpu/melps4/melps4.c b/src/emu/cpu/melps4/melps4.c index 342147892b3..4e9305b2cc5 100644 --- a/src/emu/cpu/melps4/melps4.c +++ b/src/emu/cpu/melps4/melps4.c @@ -75,6 +75,21 @@ void melps4_cpu_device::device_start() m_data = &space(AS_DATA); m_prgmask = (1 << m_prgwidth) - 1; m_datamask = (1 << m_datawidth) - 1; + m_d_mask = (1 << m_d_pins) - 1; + + // resolve callbacks + m_read_k.resolve_safe(0); + m_read_d.resolve_safe(0); + m_read_s.resolve_safe(0); + m_read_f.resolve_safe(0); + m_read_t.resolve_safe(0); + + m_write_d.resolve_safe(); + m_write_s.resolve_safe(); + m_write_f.resolve_safe(); + m_write_g.resolve_safe(); + m_write_u.resolve_safe(); + m_write_t.resolve_safe(); // zerofill m_pc = 0; @@ -83,6 +98,10 @@ void melps4_cpu_device::device_start() m_op = 0; m_prev_op = 0; m_bitmask = 0; + + m_port_d = 0; + m_port_s = 0; + m_port_f = 0; m_sm = m_sms = false; m_ba_flag = false; @@ -115,6 +134,10 @@ void melps4_cpu_device::device_start() save_item(NAME(m_prev_op)); save_item(NAME(m_bitmask)); + save_item(NAME(m_port_d)); + save_item(NAME(m_port_s)); + save_item(NAME(m_port_f)); + save_item(NAME(m_sm)); save_item(NAME(m_sms)); save_item(NAME(m_ba_flag)); @@ -181,6 +204,88 @@ void melps4_cpu_device::device_reset() m_v = 0; m_w = 0; + + // clear ports + write_d_pin(MELPS4_PORTD_CLR, 0); + write_gen_port(MELPS4_PORTS, 0); + write_gen_port(MELPS4_PORTF, 0); + write_gen_port(MELPS4_PORTG, 0); + write_gen_port(MELPS4_PORTU, 0); + m_write_t(0); +} + + + +//------------------------------------------------- +// i/o handling +//------------------------------------------------- + +UINT8 melps4_cpu_device::read_gen_port(int port) +{ + // input generic port + switch (port) + { + case MELPS4_PORTS: + return m_port_s | m_read_s(port, 0xff); + case MELPS4_PORTF: + return m_port_f | (m_read_f(port, 0xff) & 0xf); + + default: + break; + } + + return 0; +} + +void melps4_cpu_device::write_gen_port(int port, UINT8 data) +{ + // output generic port + switch (port) + { + case MELPS4_PORTS: + m_port_s = data; + m_write_s(port, data, 0xff); + break; + case MELPS4_PORTF: + m_port_f = data & 0xf; + m_write_f(port, data & 0xf, 0xff); + break; + case MELPS4_PORTG: + m_write_g(port, data & 0xf, 0xff); + break; + case MELPS4_PORTU: + m_write_u(port, data & 1, 0xff); + break; + + default: + break; + } +} + +int melps4_cpu_device::read_d_pin(int bit) +{ + // read port D, return state of selected pin + bit &= 0xf; + UINT16 d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask; + return d >> bit & 1; +} + +void melps4_cpu_device::write_d_pin(int bit, int state) +{ + // clear all port D pins + if (bit == MELPS4_PORTD_CLR) + { + m_port_d = 0; + m_write_d(bit, 0, 0xffff); + } + + // set/reset one port D pin + else + { + bit &= 0xf; + m_port_d = ((m_port_d & (~(1 << bit))) | (state << bit)) & m_d_mask; + m_write_d(bit, m_port_d, 0xffff); + } } diff --git a/src/emu/cpu/melps4/melps4.h b/src/emu/cpu/melps4/melps4.h index ba6c18f4695..6fcc27c4364 100644 --- a/src/emu/cpu/melps4/melps4.h +++ b/src/emu/cpu/melps4/melps4.h @@ -12,6 +12,58 @@ #include "emu.h" +// I/O ports setup + +// K input or A/D input port, up to 16 pins +#define MCFG_MELPS4_READ_K_CB(_devcb) \ + melps4_cpu_device::set_read_k_callback(*device, DEVCB_##_devcb); + +// D discrete I/O port, up to 16 pins - offset 0-15 for bit, 16 for all pins clear +#define MCFG_MELPS4_READ_D_CB(_devcb) \ + melps4_cpu_device::set_read_d_callback(*device, DEVCB_##_devcb); +#define MCFG_MELPS4_WRITE_D_CB(_devcb) \ + melps4_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb); + +// 8-bit S generic I/O port +#define MCFG_MELPS4_READ_S_CB(_devcb) \ + melps4_cpu_device::set_read_s_callback(*device, DEVCB_##_devcb); +#define MCFG_MELPS4_WRITE_S_CB(_devcb) \ + melps4_cpu_device::set_write_s_callback(*device, DEVCB_##_devcb); + +// 4-bit F generic I/O port +#define MCFG_MELPS4_READ_F_CB(_devcb) \ + melps4_cpu_device::set_read_f_callback(*device, DEVCB_##_devcb); +#define MCFG_MELPS4_WRITE_F_CB(_devcb) \ + melps4_cpu_device::set_write_f_callback(*device, DEVCB_##_devcb); + +// 4-bit G generic output port +#define MCFG_MELPS4_WRITE_G_CB(_devcb) \ + melps4_cpu_device::set_write_g_callback(*device, DEVCB_##_devcb); + +// 1-bit U generic output port +#define MCFG_MELPS4_WRITE_U_CB(_devcb) \ + melps4_cpu_device::set_write_u_callback(*device, DEVCB_##_devcb); + +// T timer I/O pin +#define MCFG_MELPS4_READ_T_CB(_devcb) \ + melps4_cpu_device::set_read_t_callback(*device, DEVCB_##_devcb); +#define MCFG_MELPS4_WRITE_T_CB(_devcb) \ + melps4_cpu_device::set_write_t_callback(*device, DEVCB_##_devcb); + + +#define MELPS4_PORTD_CLR 16 + +// only generic ports here (S is 8-bit) +enum +{ + MELPS4_PORTS = 0, + MELPS4_PORTF = 2, + MELPS4_PORTG, + MELPS4_PORTU +}; + + + // pinout reference /* @@ -45,20 +97,46 @@ class melps4_cpu_device : public cpu_device { public: // construction/destruction - melps4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + melps4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, UINT8 sm_page, UINT8 int_page, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program) , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) , m_prgwidth(prgwidth) , m_datawidth(datawidth) - , m_stack_levels(3) - , m_sm_page(14) - , m_int_page(12) + , m_d_pins(d_pins) + , m_sm_page(sm_page) + , m_int_page(int_page) , m_xami_mask(0xf) , m_sp_mask(0x7<<4) , m_ba_op(0x01) + , m_stack_levels(3) + , m_read_k(*this) + , m_read_d(*this) + , m_read_s(*this) + , m_read_f(*this) + , m_read_t(*this) + , m_write_d(*this) + , m_write_s(*this) + , m_write_f(*this) + , m_write_g(*this) + , m_write_u(*this) + , m_write_t(*this) { } + // static configuration helpers + template static devcb_base &set_read_k_callback(device_t &device, _Object object) { return downcast(device).m_read_k.set_callback(object); } + template static devcb_base &set_read_d_callback(device_t &device, _Object object) { return downcast(device).m_read_d.set_callback(object); } + template static devcb_base &set_read_s_callback(device_t &device, _Object object) { return downcast(device).m_read_s.set_callback(object); } + template static devcb_base &set_read_f_callback(device_t &device, _Object object) { return downcast(device).m_read_f.set_callback(object); } + template static devcb_base &set_read_t_callback(device_t &device, _Object object) { return downcast(device).m_read_t.set_callback(object); } + + template static devcb_base &set_write_d_callback(device_t &device, _Object object) { return downcast(device).m_write_d.set_callback(object); } + template static devcb_base &set_write_s_callback(device_t &device, _Object object) { return downcast(device).m_write_s.set_callback(object); } + template static devcb_base &set_write_f_callback(device_t &device, _Object object) { return downcast(device).m_write_f.set_callback(object); } + template static devcb_base &set_write_g_callback(device_t &device, _Object object) { return downcast(device).m_write_g.set_callback(object); } + template static devcb_base &set_write_u_callback(device_t &device, _Object object) { return downcast(device).m_write_u.set_callback(object); } + template static devcb_base &set_write_t_callback(device_t &device, _Object object) { return downcast(device).m_write_t.set_callback(object); } + protected: // device-level overrides virtual void device_start(); @@ -89,17 +167,19 @@ protected: int m_icount; // fixed settings or mask options that differ between MCU type - int m_prgwidth; // number of bits and bitmask for ROM/RAM size + int m_prgwidth; // number of bits and bitmask for ROM/RAM size: see melps4.c for info int m_datawidth; // " int m_prgmask; // " int m_datamask; // " + int m_d_pins; // number of D port pins and bitmask: 11 on '40,'41,'42,'44, 8 on '43, 12 on '45,'46, 16 on '47 + int m_d_mask; // " - UINT8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 UINT8 m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 UINT8 m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47 UINT8 m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others) UINT16 m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47 UINT16 m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47 + UINT8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 // internal state, misc regs UINT16 m_pc; // program counter (11 or 10-bit) @@ -108,6 +188,10 @@ protected: UINT16 m_op; UINT16 m_prev_op; UINT8 m_bitmask; // opcode bit argument + + UINT16 m_port_d; // last written port data + UINT8 m_port_s; // " + UINT8 m_port_f; // " bool m_sm, m_sms; // subroutine mode flag + stack bool m_ba_flag; // temp flag indicates BA opcode was executed @@ -133,6 +217,25 @@ protected: UINT8 m_v; // timer control V UINT8 m_w; // timer control W + // i/o handlers + devcb_read16 m_read_k; + devcb_read16 m_read_d; + devcb_read8 m_read_s; + devcb_read8 m_read_f; + devcb_read_line m_read_t; + + devcb_write16 m_write_d; + devcb_write8 m_write_s; + devcb_write8 m_write_f; + devcb_write8 m_write_g; + devcb_write8 m_write_u; + devcb_write_line m_write_t; + + UINT8 read_gen_port(int port); + void write_gen_port(int port, UINT8 data); + int read_d_pin(int bit); + void write_d_pin(int bit, int state); + // misc internal helpers UINT8 ram_r(); void ram_w(UINT8 data); diff --git a/src/emu/cpu/melps4/melps4op.inc b/src/emu/cpu/melps4/melps4op.inc index 5d2f6d38a94..46780efb616 100644 --- a/src/emu/cpu/melps4/melps4op.inc +++ b/src/emu/cpu/melps4/melps4op.inc @@ -529,43 +529,44 @@ void melps4_cpu_device::op_rti() void melps4_cpu_device::op_cld() { // CLD: clear port D - op_illegal(); + write_d_pin(MELPS4_PORTD_CLR, 0); } void melps4_cpu_device::op_cls() { // CLS: clear port S - op_illegal(); + write_gen_port(MELPS4_PORTS, 0); } void melps4_cpu_device::op_clds() { // CLDS: CLD, CLS - op_illegal(); + op_cld(); + op_cls(); } void melps4_cpu_device::op_sd() { // SD: set port D bit designated by Y - op_illegal(); + write_d_pin(m_y, 1); } void melps4_cpu_device::op_rd() { // RD: reset port D bit designated by Y - op_illegal(); + write_d_pin(m_y, 0); } void melps4_cpu_device::op_szd() { // SZD: skip next if port D bit designated by Y is 0 - op_illegal(); + m_skip = !read_d_pin(m_y); } void melps4_cpu_device::op_osab() { // OSAB: output A and B to port S - op_illegal(); + write_gen_port(MELPS4_PORTS, m_b << 4 | m_a); } void melps4_cpu_device::op_ospa() @@ -577,49 +578,50 @@ void melps4_cpu_device::op_ospa() void melps4_cpu_device::op_ose() { // OSE: output E to port S - op_illegal(); + write_gen_port(MELPS4_PORTS, m_e); } void melps4_cpu_device::op_ias() { // IAS i: transfer port S(hi/lo) to A - op_illegal(); + int shift = (m_op & 1) ? 0 : 4; + m_a = read_gen_port(MELPS4_PORTS) >> shift & 0xf; } void melps4_cpu_device::op_ofa() { // OFA: output A to port F - op_illegal(); + write_gen_port(MELPS4_PORTF, m_a); } void melps4_cpu_device::op_iaf() { // IAF: input port F to A - op_illegal(); + m_a = read_gen_port(MELPS4_PORTF); } void melps4_cpu_device::op_oga() { // OGA: output A to port G - op_illegal(); + write_gen_port(MELPS4_PORTG, m_a); } void melps4_cpu_device::op_iak() { // IAK: input port K to A - op_illegal(); + m_a = m_read_k(0, 0xffff) & 0xf; } void melps4_cpu_device::op_szk() { // SZK j: skip next if port K bit is reset - op_illegal(); + m_skip = !(m_read_k(0, 0xffff) & m_bitmask); } void melps4_cpu_device::op_su() { // SU/RU: set/reset port U - op_illegal(); + write_gen_port(MELPS4_PORTU, m_op & 1); } @@ -628,15 +630,15 @@ void melps4_cpu_device::op_su() void melps4_cpu_device::op_ei() { // EI: enable interrupt flag - m_inte = 1; m_prohibit_irq = true; + m_inte = 1; } void melps4_cpu_device::op_di() { // DI: disable interrupt flag - m_inte = 0; m_prohibit_irq = true; + m_inte = 0; } void melps4_cpu_device::op_inth() From 9ad081a91682af32b91e6a38f7c9005e2bb0a683 Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 31 May 2015 13:20:51 -0500 Subject: [PATCH 056/284] New G-Loc clone New Clone Added ----------------------------------- G-LOC Air Battle (World) [Arzeno Fabrice, The Dumping Union] --- src/mame/arcade.lst | 3 +- src/mame/drivers/segaybd.c | 215 +++++++++++++++++++++++++------------ 2 files changed, 149 insertions(+), 69 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 81877301216..cce4c398951 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -4794,7 +4794,8 @@ pdrift // 1988.?? Power Drift (World) pdrifta // 1988.?? Power Drift (World) pdrifte // 1988.?? Power Drift (World) pdriftl -gloc // 1990.04 G-LOC Air Battle (US) +gloc // 1990.?? G-LOC Air Battle (World) +glocu // 1990.04 G-LOC Air Battle (US) // 1990.05 G-LOC Air Battle (Japan) glocr360 // 1990.?? G-LOC (R360, World?) strkfgtr // 1991.06 Strike Fighter (World) diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index e406b0a10ba..ca53982e276 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -1431,7 +1431,7 @@ MACHINE_CONFIG_END //************************************************************************************************************************* //************************************************************************************************************************* // Galaxy Force, Sega Y-board -// Sega Game ID: 831-6614 (two PCB board stack +// Sega Game ID: 831-6614 (two PCB board stack) // // NOTE: An original PCB is very hard to locate intact. Most of these boards were upgraded to Galaxy Force 2 through a // chip swap upgrade. @@ -1441,7 +1441,7 @@ MACHINE_CONFIG_END //************************************************************************************************************************* //************************************************************************************************************************* //************************************************************************************************************************* -// Galaxy Force 2, Sega Y-board +// Galaxy Force 2 (World), Sega Y-board // CPU: 68000 (317-????) // ROM_START( gforce2 ) @@ -1519,7 +1519,7 @@ ROM_START( gforce2 ) ROM_END //************************************************************************************************************************* -// Galaxy Force 2, Sega Y-board +// Galaxy Force 2 (Japan, Rev A), Sega Y-board // CPU: 68000 (317-????) // ROM_START( gforce2ja ) @@ -1594,7 +1594,7 @@ ROM_START( gforce2ja ) ROM_END //************************************************************************************************************************* -// Galaxy Force 2, Sega Y-board +// Galaxy Force 2 (Japan), Sega Y-board // CPU: 68000 (317-????) // ROM_START( gforce2j ) @@ -1672,12 +1672,88 @@ ROM_END //************************************************************************************************************************* //************************************************************************************************************************* //************************************************************************************************************************* -// G-Loc, Sega Y-board +// G-Loc (World), Sega Y-board +// CPU: 68000 (317-????) +// CPU BD 837-7403 +// VIDEO BD 837-7301-02 +// GAME BD 834-7300-07 G-LOC +// +ROM_START( gloc ) + ROM_REGION( 0x080000, "maincpu", 0 ) // M + ROM_LOAD16_BYTE( "epr-13172.25", 0x000000, 0x20000, CRC(75e7174c) SHA1(ef052a6973cf49267463a0c14e8c392a083c62fb) ) + ROM_LOAD16_BYTE( "epr-13171.24", 0x000001, 0x20000, CRC(90733468) SHA1(1c540c447321e323473462e8c26c59163e0e3b6d) ) + ROM_LOAD16_BYTE( "epr-13028.27", 0x040000, 0x20000, CRC(b6aa2edf) SHA1(07259fc48cd0f63fbd0a8dadf2294575cd790c85) ) + ROM_LOAD16_BYTE( "epr-13027.26", 0x040001, 0x20000, CRC(6463c87a) SHA1(882d980a1568ca777364822295e173224509f842) ) + + ROM_REGION( 0x040000, "subx", 0 ) // X + ROM_LOAD16_BYTE( "epr-13032.81", 0x000000, 0x20000, CRC(7da09c4e) SHA1(09ec269c07f07549aa9851585eac0a5195e25bf9) ) + ROM_LOAD16_BYTE( "epr-13031.80", 0x000001, 0x20000, CRC(f3c7e3f4) SHA1(927c0cf05e7a72d79fdf19bbe7b18bf167feccd6) ) + + ROM_REGION( 0x040000, "suby", 0 ) // Y + ROM_LOAD16_BYTE( "epr-13030.54", 0x000000, 0x20000, CRC(81abcabf) SHA1(cb4e817d66a7f384aa9757758c51cd1bf7347dd0) ) + ROM_LOAD16_BYTE( "epr-13029.53", 0x000001, 0x20000, CRC(f3638efb) SHA1(f82a46fc8616cbe0235746161c587e54adecfe50) ) + + ROM_REGION16_BE( 0x200000, "bsprites", 0) + ROM_LOAD16_BYTE( "epr-13039.16", 0x000000, 0x80000, CRC(d7e1266d) SHA1(b0fc4cc60a7e876ae2af343bba6da3fb926ea9c5) ) + ROM_LOAD16_BYTE( "epr-13037.14", 0x000001, 0x80000, CRC(b801a250) SHA1(7d1f6a1f2022a4f302f22d11fa79057cf8134ad2) ) + ROM_LOAD16_BYTE( "epr-13040.17", 0x100000, 0x80000, CRC(4aeb3a85) SHA1(5521fd2d3956839bdbe7b70a9e60cd9fb72a42f1) ) + ROM_LOAD16_BYTE( "epr-13038.15", 0x100001, 0x80000, CRC(0b2edb6d) SHA1(04944d6e6f020cd6d33641110847706516630227) ) + + ROM_REGION64_BE( 0x1000000, "ysprites", 0 ) + ROMX_LOAD( "epr-13048.67", 0x000000, 0x80000, CRC(fe1eb0dd) SHA1(5e292fc0b83505eb289e026d4be24c9038ef1418), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13056.75", 0x000001, 0x80000, CRC(5904f8e6) SHA1(fbb01dadc796624c360d44b7631e3f1f285abf2e), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13044.63", 0x000002, 0x80000, CRC(4d931f89) SHA1(ff603f4347e4728a2849d9f480893ad0af7abc5c), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13052.71", 0x000003, 0x80000, CRC(0291f040) SHA1(610dee2a31445f4a054111b7005278560a9c0702), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13064.86", 0x000004, 0x80000, CRC(5f8e651b) SHA1(f1a957e68dea40c23f6a5a208358ec6d6515fe60), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13072.114", 0x000005, 0x80000, CRC(6b85641a) SHA1(143a4684d5f303cd30880a2d5728dccbdd168da4), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13060.82", 0x000006, 0x80000, CRC(ee16ad97) SHA1(6af38cfaf694f686f8e4223fb0b13cd350a8b9e5), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13068.110", 0x000007, 0x80000, CRC(64d52bbb) SHA1(b6eab546edb2443e5da6c94ec811ec5084212e60), ROM_SKIP(7) ) + + ROMX_LOAD( "epr-13047.66", 0x400000, 0x80000, CRC(53340832) SHA1(8ece8a71ea8ed80458121622307a137fb13931f6), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13055.74", 0x400001, 0x80000, CRC(39b6b665) SHA1(d915db1d9bfe0c6ad3f7b447ce0cfdb42ec66ffe), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13043.62", 0x400002, 0x80000, CRC(208f16fd) SHA1(ce96708ea9886af4aba8730cbb98c0ca72b96f57), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13051.70", 0x400003, 0x80000, CRC(ad62cbd4) SHA1(09c008ce5cb97575a4312d2f22566bda72ecc4e2), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13063.85", 0x400004, 0x80000, CRC(c580bf6d) SHA1(cb72970377ad2acce499059aa8155711b8da8a11), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13071.113", 0x400005, 0x80000, CRC(df99ef99) SHA1(12648844c6e78dbd573b7bf0c981edb4d3012b58), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13059.81", 0x400006, 0x80000, CRC(4c982558) SHA1(e04902af2740ca098cd6bbf1f57cb25562754a76), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13067.109", 0x400007, 0x80000, CRC(f97f6119) SHA1(6f91fc28a1260ca4f1c695863717b27d1e45dc32), ROM_SKIP(7) ) + + ROMX_LOAD( "epr-13046.65", 0x800000, 0x80000, CRC(c75a86e9) SHA1(8a180e1e2dd06eb81e2aa4ef73b83879cf6afc1b), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13054.73", 0x800001, 0x80000, CRC(2934549a) SHA1(058b2966141d0db6bb8557d65c77b3458aca9358), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13042.61", 0x800002, 0x80000, CRC(53ed97af) SHA1(22dffa434eb98e5bca1e429b69553a3540dc54a7), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13050.69", 0x800003, 0x80000, CRC(04429068) SHA1(d7d8738809fd959ed428796b2bd1b589b74522c6), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13062.84", 0x800004, 0x80000, CRC(4fdb4ee3) SHA1(d76065b9abe5c3cf692567d3a8746a231748340d), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13070.112", 0x800005, 0x80000, CRC(52ea130e) SHA1(860cb3a1701066e595518c49b696b7b7a3994ada), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13058.80", 0x800006, 0x80000, CRC(19ff1626) SHA1(029e231c3322467b5e2e52eea11df4f645460468), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13066.108", 0x800007, 0x80000, CRC(bc70a250) SHA1(25189854cc01855b6e3589b85490f30dda029f86), ROM_SKIP(7) ) + + ROMX_LOAD( "epr-13045.64", 0xc00000, 0x80000, CRC(54d5bc6d) SHA1(18a301c9e6c4a352f300a438d85c6e6952bf0738), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13053.72", 0xc00001, 0x80000, CRC(9502af13) SHA1(1a8c0fcd10f4c86af69c0107f486ca2eb8863f93), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13041.60", 0xc00002, 0x80000, CRC(d0a7402c) SHA1(8932503c570ec49fdb4706f4015608bd060bafa0), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13049.68", 0xc00003, 0x80000, CRC(5b9c0b6c) SHA1(17f2460b7dc0bd34dca3f90f2b553df4a7149147), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13061.83", 0xc00004, 0x80000, CRC(7b95ec3b) SHA1(284aba4effd9d376a7a8f510a6f675fcb3393d09), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13069.111", 0xc00005, 0x80000, CRC(e1f538f0) SHA1(55dc85faed1d5a7f2d586bac7e524c3fef3c53b4), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13057.79", 0xc00006, 0x80000, CRC(73baefee) SHA1(6e86edc8229dd6112034a7df79f7341a4120dc6b), ROM_SKIP(7) ) + ROMX_LOAD( "epr-13065.107", 0xc00007, 0x80000, CRC(8937a655) SHA1(d38726a8a6fe68a002ac8d17f70ab83c2f814aa2), ROM_SKIP(7) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) // Z80 sound CPU + ROM_LOAD( "epr-13033.102", 0x000000, 0x10000, CRC(6df5e827) SHA1(ec260886a27ba00690490500fcf4ebf07fb35205) ) + + ROM_REGION( 0x200000, "pcm", ROMREGION_ERASEFF ) // SegaPCM samples + ROM_LOAD( "epr-13036.107", 0x000000, 0x80000, CRC(7890c26c) SHA1(97e0678bb571de5cf732804f8909e5cbd24980f1) ) + ROM_LOAD( "epr-13035.106", 0x080000, 0x80000, CRC(009fa13e) SHA1(c7b224b471696b12332fc7c403c127b19c297df7) ) + ROM_LOAD( "epr-13034.105", 0x100000, 0x80000, CRC(cd22d95d) SHA1(857aa320df0b3fb44fc8a5526ba5ee82cc74fe63) ) +ROM_END + +//************************************************************************************************************************* +// G-Loc (US), Sega Y-board // CPU: 68000 (317-????) // VIDEO BD 837-7301-01 // GAME BD 834-7300-04 G-LOC // -ROM_START( gloc ) +// No "For use in..." region notice, but displays the FBI "Winners Don't Use Drugs" splash screen during attract sequence +// +ROM_START( glocu ) ROM_REGION( 0x080000, "maincpu", 0 ) // M ROM_LOAD16_BYTE( "epr-13170.25", 0x000000, 0x20000, CRC(45189229) SHA1(01d18f6e4887633475baf610f455fad4ed7981e4) ) ROM_LOAD16_BYTE( "epr-13169.24", 0x000001, 0x20000, CRC(1b47cd6e) SHA1(694f489766f25e4c1f1fef6db79de347688ad80a) ) @@ -1749,7 +1825,7 @@ ROM_END ROM_START( glocr360 ) ROM_REGION( 0x080000, "maincpu", 0 ) // M ROM_LOAD16_BYTE( "epr-13623.25", 0x000000, 0x20000, CRC(58ad10e7) SHA1(3760ede1d1c089f6c8b2ec88b2f25bce67add467) ) - ROM_LOAD16_BYTE( "epr-13622.24", 0x000001, 0x20000, CRC(c4e68dbf) SHA1(f85e6fdf159e19342e5a9278f004e95752af7d55) ) + ROM_LOAD16_BYTE( "epr-13622.24", 0x000001, 0x20000, CRC(c4e68dbf) SHA1(f85e6fdf159e19342e5a9278f004e95752af7d55) ) ROM_LOAD16_BYTE( "epr-13323a.27", 0x040000, 0x20000, CRC(02e24a33) SHA1(4955b13e5e90945dfb9066597b16df63c2a09552) ) ROM_LOAD16_BYTE( "epr-13322a.26", 0x040001, 0x20000, CRC(94f67740) SHA1(3d1be8dc9c370cd024fae19bb0b2663995d13d0e) ) @@ -1817,7 +1893,7 @@ ROM_END //************************************************************************************************************************* //************************************************************************************************************************* //************************************************************************************************************************* -// Power Drift, Sega Y-board +// Power Drift (World, Rev A), Sega Y-board // CPU: 68000 (317-????) // CPU BD POWER DRIFT 837-6695-08 (or 837-6695-09) // VIDEO BD POWER DRIFT 837-6696-01 (or 837-6696-02) @@ -1903,6 +1979,7 @@ ROM_START( pdrift ) ROM_END //************************************************************************************************************************* +// Power Drift (World) // ROM_START( pdrifta ) ROM_REGION( 0x080000, "maincpu", 0 ) // M @@ -1985,6 +2062,7 @@ ROM_START( pdrifta ) ROM_END //************************************************************************************************************************* +// Power Drift (World) // Earlier set based on eprom numbers & Sega Eprom/Mask Rom Locations sheet 421-7708 // ROM_START( pdrifte ) @@ -2068,7 +2146,7 @@ ROM_START( pdrifte ) ROM_END //************************************************************************************************************************* -// Power Drift, Sega Y-board +// Power Drift (Japan), Sega Y-board // CPU: 68000 (317-????) // CPU BD POWER DRIFT 837-6695-08 (or 837-6695-09) // VIDEO BD POWER DRIFT 837-6696-01 (or 837-6696-02) @@ -2154,88 +2232,88 @@ ROM_START( pdriftj ) ROM_END //************************************************************************************************************************* -// Power Drift, Sega Y-board Link version +// Power Drift (Japan), Sega Y-board Link version // Sega Game ID: 833-6697 // // This was just 6 loose program roms + 4 sprite roms + the link PCBs, other roms could be incorrect // ROM_START(pdriftl) ROM_REGION(0x080000, "maincpu", 0) // M - ROM_LOAD16_BYTE("epr-12107a.25", 0x000000, 0x20000, CRC(0acaed3c) SHA1(0a3d86346b7a75a53b07311c095a879a22048590)) - ROM_LOAD16_BYTE("epr-12106a.24", 0x000001, 0x20000, CRC(d222f7a6) SHA1(ce73b9a155c0ebd4b1c0c71c80fd3dce6043dcf6)) + ROM_LOAD16_BYTE("epr-12107a.25", 0x000000, 0x20000, CRC(0acaed3c) SHA1(0a3d86346b7a75a53b07311c095a879a22048590) ) + ROM_LOAD16_BYTE("epr-12106a.24", 0x000001, 0x20000, CRC(d222f7a6) SHA1(ce73b9a155c0ebd4b1c0c71c80fd3dce6043dcf6) ) // 26+27 not tested, probably not used ROM_REGION(0x040000, "subx", 0) // X - ROM_LOAD16_BYTE("epr-12111.81", 0x000000, 0x20000, CRC(41b0622c) SHA1(9751c88f4c0df2e0852cee071683c8e6156da8cb)) - ROM_LOAD16_BYTE("epr-12110.80", 0x000001, 0x20000, CRC(26db4865) SHA1(963c10156cddf44abc86dbe66349bc83656eda15)) + ROM_LOAD16_BYTE("epr-12111.81", 0x000000, 0x20000, CRC(41b0622c) SHA1(9751c88f4c0df2e0852cee071683c8e6156da8cb) ) + ROM_LOAD16_BYTE("epr-12110.80", 0x000001, 0x20000, CRC(26db4865) SHA1(963c10156cddf44abc86dbe66349bc83656eda15) ) ROM_REGION(0x040000, "suby", 0) // Y - ROM_LOAD16_BYTE("epr-12109.54", 0x000000, 0x20000, CRC(256350b8) SHA1(72b05d3583d63766690fed4827ec586e832168d1)) - ROM_LOAD16_BYTE("epr-12108.53", 0x000001, 0x20000, CRC(a3a56771) SHA1(f41d466f31a1b833d21a7011314c48d5056409eb)) + ROM_LOAD16_BYTE("epr-12109.54", 0x000000, 0x20000, CRC(256350b8) SHA1(72b05d3583d63766690fed4827ec586e832168d1) ) + ROM_LOAD16_BYTE("epr-12108.53", 0x000001, 0x20000, CRC(a3a56771) SHA1(f41d466f31a1b833d21a7011314c48d5056409eb) ) ROM_REGION16_BE(0x080000, "bsprites", 0) - ROM_LOAD16_BYTE("epr-12114.16", 0x000000, 0x20000, CRC(8b07e8eb) SHA1(22a4aff968d6de52372b7b2b5322d353f7b835ef)) - ROM_LOAD16_BYTE("epr-12115.14", 0x000001, 0x20000, CRC(045b2912) SHA1(697c8eff69bf1a23745d24171f0b50635cf8513e)) - ROM_LOAD16_BYTE("epr-12112.17", 0x040000, 0x20000, CRC(5dd13e81) SHA1(74ced668a36480a2ce9e3667e4915bfee2391534)) - ROM_LOAD16_BYTE("epr-12113.15", 0x040001, 0x20000, CRC(69b8bd5a) SHA1(e312b60fff672363326b6169be7aff6b943d27c9)) + ROM_LOAD16_BYTE("epr-12114.16", 0x000000, 0x20000, CRC(8b07e8eb) SHA1(22a4aff968d6de52372b7b2b5322d353f7b835ef) ) + ROM_LOAD16_BYTE("epr-12115.14", 0x000001, 0x20000, CRC(045b2912) SHA1(697c8eff69bf1a23745d24171f0b50635cf8513e) ) + ROM_LOAD16_BYTE("epr-12112.17", 0x040000, 0x20000, CRC(5dd13e81) SHA1(74ced668a36480a2ce9e3667e4915bfee2391534) ) + ROM_LOAD16_BYTE("epr-12113.15", 0x040001, 0x20000, CRC(69b8bd5a) SHA1(e312b60fff672363326b6169be7aff6b943d27c9) ) ROM_REGION64_BE(0x400000, "ysprites", 0) - ROMX_LOAD("epr-11757.67", 0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7)) - ROMX_LOAD("epr-11758.75", 0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7)) - ROMX_LOAD("epr-11773.63", 0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7)) - ROMX_LOAD("epr-11774.71", 0x000003, 0x20000, CRC(2ca0c170) SHA1(7de74c045bf084659ba70da9458d720125ff25ae), ROM_SKIP(7)) - ROMX_LOAD("epr-11759.86", 0x000004, 0x20000, CRC(ac8111f6) SHA1(6412716dc97ae697b438d9c9cd554d1087416bc2), ROM_SKIP(7)) - ROMX_LOAD("epr-11760.114", 0x000005, 0x20000, CRC(91282af9) SHA1(fddee7982949b7da724c7830e7bd139aeb84672d), ROM_SKIP(7)) - ROMX_LOAD("epr-11775.82", 0x000006, 0x20000, CRC(48225793) SHA1(ee003c2ea24c14e0968da94bac139735660932fe), ROM_SKIP(7)) - ROMX_LOAD("epr-11776.110", 0x000007, 0x20000, CRC(78c46198) SHA1(d299e631843da47cb7a46103d52a3dabfab71746), ROM_SKIP(7)) + ROMX_LOAD("epr-11757.67", 0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) ) + ROMX_LOAD("epr-11758.75", 0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) ) + ROMX_LOAD("epr-11773.63", 0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7) ) + ROMX_LOAD("epr-11774.71", 0x000003, 0x20000, CRC(2ca0c170) SHA1(7de74c045bf084659ba70da9458d720125ff25ae), ROM_SKIP(7) ) + ROMX_LOAD("epr-11759.86", 0x000004, 0x20000, CRC(ac8111f6) SHA1(6412716dc97ae697b438d9c9cd554d1087416bc2), ROM_SKIP(7) ) + ROMX_LOAD("epr-11760.114", 0x000005, 0x20000, CRC(91282af9) SHA1(fddee7982949b7da724c7830e7bd139aeb84672d), ROM_SKIP(7) ) + ROMX_LOAD("epr-11775.82", 0x000006, 0x20000, CRC(48225793) SHA1(ee003c2ea24c14e0968da94bac139735660932fe), ROM_SKIP(7) ) + ROMX_LOAD("epr-11776.110", 0x000007, 0x20000, CRC(78c46198) SHA1(d299e631843da47cb7a46103d52a3dabfab71746), ROM_SKIP(7) ) - ROMX_LOAD("epr-11761.66", 0x100000, 0x20000, CRC(baa5d065) SHA1(56dc71814e3f0f327781b0c1587038351c60f7b7), ROM_SKIP(7)) - ROMX_LOAD("epr-11762.74", 0x100001, 0x20000, CRC(1d1af7a5) SHA1(86c02565b5aca201588c98678fb0c54faa8d4d6b), ROM_SKIP(7)) - ROMX_LOAD("epr-11777.62", 0x100002, 0x20000, CRC(9662dd32) SHA1(454ec914b6c936f692bf90d2232c8169acec470a), ROM_SKIP(7)) - ROMX_LOAD("epr-11778.70", 0x100003, 0x20000, CRC(2dfb7494) SHA1(4b9f1609e425c5e634e95dbc2d0ca820dd9212bc), ROM_SKIP(7)) - ROMX_LOAD("epr-11763.85", 0x100004, 0x20000, CRC(1ee23407) SHA1(776c868e0e4e601fd6d0a83561b064b4be0560e2), ROM_SKIP(7)) - ROMX_LOAD("epr-11764.113", 0x100005, 0x20000, CRC(e859305e) SHA1(aafcc3209a4fb6e0e8169ae6cce386b370b824f7), ROM_SKIP(7)) - ROMX_LOAD("epr-11779.81", 0x100006, 0x20000, CRC(a49cd793) SHA1(efe77949be39a2ff88b50bfb2b4664b9267d9a09), ROM_SKIP(7)) - ROMX_LOAD("epr-11780.109", 0x100007, 0x20000, CRC(d514ed81) SHA1(fbac3ad085363972a79e77aebb7fdae2200e7cda), ROM_SKIP(7)) + ROMX_LOAD("epr-11761.66", 0x100000, 0x20000, CRC(baa5d065) SHA1(56dc71814e3f0f327781b0c1587038351c60f7b7), ROM_SKIP(7) ) + ROMX_LOAD("epr-11762.74", 0x100001, 0x20000, CRC(1d1af7a5) SHA1(86c02565b5aca201588c98678fb0c54faa8d4d6b), ROM_SKIP(7) ) + ROMX_LOAD("epr-11777.62", 0x100002, 0x20000, CRC(9662dd32) SHA1(454ec914b6c936f692bf90d2232c8169acec470a), ROM_SKIP(7) ) + ROMX_LOAD("epr-11778.70", 0x100003, 0x20000, CRC(2dfb7494) SHA1(4b9f1609e425c5e634e95dbc2d0ca820dd9212bc), ROM_SKIP(7) ) + ROMX_LOAD("epr-11763.85", 0x100004, 0x20000, CRC(1ee23407) SHA1(776c868e0e4e601fd6d0a83561b064b4be0560e2), ROM_SKIP(7) ) + ROMX_LOAD("epr-11764.113", 0x100005, 0x20000, CRC(e859305e) SHA1(aafcc3209a4fb6e0e8169ae6cce386b370b824f7), ROM_SKIP(7) ) + ROMX_LOAD("epr-11779.81", 0x100006, 0x20000, CRC(a49cd793) SHA1(efe77949be39a2ff88b50bfb2b4664b9267d9a09), ROM_SKIP(7) ) + ROMX_LOAD("epr-11780.109", 0x100007, 0x20000, CRC(d514ed81) SHA1(fbac3ad085363972a79e77aebb7fdae2200e7cda), ROM_SKIP(7) ) - ROMX_LOAD("epr-11765.65", 0x200000, 0x20000, CRC(649e2dff) SHA1(a6c61b71d08b31a0ca175ab0404e2eaf1d09ccc2), ROM_SKIP(7)) - ROMX_LOAD("epr-11766.73", 0x200001, 0x20000, CRC(d92fb7fc) SHA1(2f5c2d88ae0766351b9efe8ffcbebc88fc3a6c59), ROM_SKIP(7)) - ROMX_LOAD("epr-11781.61", 0x200002, 0x20000, CRC(9692d4cd) SHA1(967351ba2c781ca865e3c1ee9eeef1aad2247c27), ROM_SKIP(7)) - ROMX_LOAD("epr-11782.69", 0x200003, 0x20000, CRC(c913bb43) SHA1(9bc15a3180cf4c3134bb55e99e6092f0faf95c56), ROM_SKIP(7)) - ROMX_LOAD("epr-11767.84", 0x200004, 0x20000, CRC(1f8ad054) SHA1(289f5795116ee29540f28e35c3b4f72adeca7891), ROM_SKIP(7)) - ROMX_LOAD("epr-11768.112", 0x200005, 0x20000, CRC(db2c4053) SHA1(a5b6daa6deb7afb0019e289acb81c82d507ec93a), ROM_SKIP(7)) - ROMX_LOAD("epr-11783.80", 0x200006, 0x20000, CRC(6d189007) SHA1(dd871ea3166fdcb59d49707d35dde8b6c7fdc76b), ROM_SKIP(7)) - ROMX_LOAD("epr-11784.108", 0x200007, 0x20000, CRC(57f5fd64) SHA1(6aff54d3f3f76ce0f1a93485d1a35a3987d456d9), ROM_SKIP(7)) + ROMX_LOAD("epr-11765.65", 0x200000, 0x20000, CRC(649e2dff) SHA1(a6c61b71d08b31a0ca175ab0404e2eaf1d09ccc2), ROM_SKIP(7) ) + ROMX_LOAD("epr-11766.73", 0x200001, 0x20000, CRC(d92fb7fc) SHA1(2f5c2d88ae0766351b9efe8ffcbebc88fc3a6c59), ROM_SKIP(7) ) + ROMX_LOAD("epr-11781.61", 0x200002, 0x20000, CRC(9692d4cd) SHA1(967351ba2c781ca865e3c1ee9eeef1aad2247c27), ROM_SKIP(7) ) + ROMX_LOAD("epr-11782.69", 0x200003, 0x20000, CRC(c913bb43) SHA1(9bc15a3180cf4c3134bb55e99e6092f0faf95c56), ROM_SKIP(7) ) + ROMX_LOAD("epr-11767.84", 0x200004, 0x20000, CRC(1f8ad054) SHA1(289f5795116ee29540f28e35c3b4f72adeca7891), ROM_SKIP(7) ) + ROMX_LOAD("epr-11768.112", 0x200005, 0x20000, CRC(db2c4053) SHA1(a5b6daa6deb7afb0019e289acb81c82d507ec93a), ROM_SKIP(7) ) + ROMX_LOAD("epr-11783.80", 0x200006, 0x20000, CRC(6d189007) SHA1(dd871ea3166fdcb59d49707d35dde8b6c7fdc76b), ROM_SKIP(7) ) + ROMX_LOAD("epr-11784.108", 0x200007, 0x20000, CRC(57f5fd64) SHA1(6aff54d3f3f76ce0f1a93485d1a35a3987d456d9), ROM_SKIP(7) ) - ROMX_LOAD("epr-11769.64", 0x300000, 0x20000, CRC(28f0ab51) SHA1(d7cb7b83e5d85eb59d34cfd5c0d8e6c7ff81e24c), ROM_SKIP(7)) - ROMX_LOAD("epr-11770.72", 0x300001, 0x20000, CRC(d7557ea9) SHA1(62430505d399ee2cc0f94e03144860056345573c), ROM_SKIP(7)) - ROMX_LOAD("epr-11785.60", 0x300002, 0x20000, CRC(e6ef32c4) SHA1(869ba3816f5e3125f613f3b284fec74cd19db79e), ROM_SKIP(7)) - ROMX_LOAD("epr-11786.68", 0x300003, 0x20000, CRC(2066b49d) SHA1(905ce70c921043d07591422a87fedd6e897ff38e), ROM_SKIP(7)) - ROMX_LOAD("epr-11771.83", 0x300004, 0x20000, CRC(67635618) SHA1(f690ace026130ecb95532c92f2ad3741d0d167c1), ROM_SKIP(7)) - ROMX_LOAD("epr-11772.111", 0x300005, 0x20000, CRC(0f798d3a) SHA1(71565ce28b93ae50d64af8c965fba6408a07f031), ROM_SKIP(7)) - ROMX_LOAD("epr-11787.79", 0x300006, 0x20000, CRC(e631dc12) SHA1(3fd6db2eb297890b35dec566b6a90fc2d96bd085), ROM_SKIP(7)) - ROMX_LOAD("epr-11788.107", 0x300007, 0x20000, CRC(8464c66e) SHA1(af93cbcc50acbd929d0298fb9a75da0369e13ff7), ROM_SKIP(7)) + ROMX_LOAD("epr-11769.64", 0x300000, 0x20000, CRC(28f0ab51) SHA1(d7cb7b83e5d85eb59d34cfd5c0d8e6c7ff81e24c), ROM_SKIP(7) ) + ROMX_LOAD("epr-11770.72", 0x300001, 0x20000, CRC(d7557ea9) SHA1(62430505d399ee2cc0f94e03144860056345573c), ROM_SKIP(7) ) + ROMX_LOAD("epr-11785.60", 0x300002, 0x20000, CRC(e6ef32c4) SHA1(869ba3816f5e3125f613f3b284fec74cd19db79e), ROM_SKIP(7) ) + ROMX_LOAD("epr-11786.68", 0x300003, 0x20000, CRC(2066b49d) SHA1(905ce70c921043d07591422a87fedd6e897ff38e), ROM_SKIP(7) ) + ROMX_LOAD("epr-11771.83", 0x300004, 0x20000, CRC(67635618) SHA1(f690ace026130ecb95532c92f2ad3741d0d167c1), ROM_SKIP(7) ) + ROMX_LOAD("epr-11772.111", 0x300005, 0x20000, CRC(0f798d3a) SHA1(71565ce28b93ae50d64af8c965fba6408a07f031), ROM_SKIP(7) ) + ROMX_LOAD("epr-11787.79", 0x300006, 0x20000, CRC(e631dc12) SHA1(3fd6db2eb297890b35dec566b6a90fc2d96bd085), ROM_SKIP(7) ) + ROMX_LOAD("epr-11788.107", 0x300007, 0x20000, CRC(8464c66e) SHA1(af93cbcc50acbd929d0298fb9a75da0369e13ff7), ROM_SKIP(7) ) ROM_REGION(0x10000, "soundcpu", 0) // Z80 sound CPU - ROM_LOAD("epr-11899.102", 0x000000, 0x10000, CRC(ed9fa889) SHA1(25d1a069254b34c31d8ee82d301ada895e8dc391)) + ROM_LOAD("epr-11899.102", 0x000000, 0x10000, CRC(ed9fa889) SHA1(25d1a069254b34c31d8ee82d301ada895e8dc391) ) ROM_REGION(0x200000, "pcm", ROMREGION_ERASEFF) // SegaPCM samples - ROM_LOAD("mpr-11754.107", 0x000000, 0x80000, CRC(ebeb8484) SHA1(269f33cb1a9be126bada858e25291385d48686a2)) - ROM_LOAD("epr-11756.105", 0x080000, 0x20000, CRC(12e43f8a) SHA1(0f9a11ba6b7c1a352daa1146a01ce147945e91e4)) + ROM_LOAD("mpr-11754.107", 0x000000, 0x80000, CRC(ebeb8484) SHA1(269f33cb1a9be126bada858e25291385d48686a2) ) + ROM_LOAD("epr-11756.105", 0x080000, 0x20000, CRC(12e43f8a) SHA1(0f9a11ba6b7c1a352daa1146a01ce147945e91e4) ) ROM_RELOAD( 0x0a0000, 0x20000) ROM_RELOAD( 0x0c0000, 0x20000) ROM_RELOAD( 0x0e0000, 0x20000) - ROM_LOAD("epr-11755.106", 0x100000, 0x20000, CRC(c2db1244) SHA1(c98fe17c9f04a639a862cc2a86fab17d1f5d025c)) + ROM_LOAD("epr-11755.106", 0x100000, 0x20000, CRC(c2db1244) SHA1(c98fe17c9f04a639a862cc2a86fab17d1f5d025c) ) ROM_RELOAD( 0x120000, 0x20000) ROM_RELOAD( 0x140000, 0x20000) ROM_RELOAD( 0x160000, 0x20000) ROM_REGION(0x100000, "user1", 0) // These are mpr-11754.107 split into 4 roms. They would be located on a Sega 839-0221 daughter card. - ROM_LOAD("epr-11895.ic1", 0x000000, 0x20000, CRC(ee99a6fd) SHA1(4444826e751d9186e6d46b081e47cd99ee3cf853)) - ROM_LOAD("epr-11896.ic2", 0x000000, 0x20000, CRC(4bebc015) SHA1(307022ea1c1ee87c9ef3782526888c48c3c69fd2)) - ROM_LOAD("epr-11897.ic3", 0x000000, 0x20000, CRC(4463cb95) SHA1(e86fd4611cf83fe72d59950a60fc8c3a7381a1c7)) - ROM_LOAD("epr-11898.ic4", 0x000000, 0x20000, CRC(5d19d767) SHA1(d335cd3ef57c75e388df04b04fc3e2881a3902cf)) + ROM_LOAD("epr-11895.ic1", 0x000000, 0x20000, CRC(ee99a6fd) SHA1(4444826e751d9186e6d46b081e47cd99ee3cf853) ) + ROM_LOAD("epr-11896.ic2", 0x000000, 0x20000, CRC(4bebc015) SHA1(307022ea1c1ee87c9ef3782526888c48c3c69fd2) ) + ROM_LOAD("epr-11897.ic3", 0x000000, 0x20000, CRC(4463cb95) SHA1(e86fd4611cf83fe72d59950a60fc8c3a7381a1c7) ) + ROM_LOAD("epr-11898.ic4", 0x000000, 0x20000, CRC(5d19d767) SHA1(d335cd3ef57c75e388df04b04fc3e2881a3902cf) ) ROM_REGION(0x10000, "linkcpu", 0) // Z80 link board CPU ROM_LOAD("epr-12028", 0x000000, 0x08000, CRC(bb682a92) SHA1(0445bdbca0db9edecd826da37cd2d3afc57c5cf6) ) @@ -2245,7 +2323,7 @@ ROM_END //************************************************************************************************************************* //************************************************************************************************************************* //************************************************************************************************************************* -// Rail Chase World, Sega Y-board +// Rail Chase (World), Sega Y-board // CPU: 68000 (317-????) // CPU BD 837-8073-05 // VIDEO BD 837-8074-01 @@ -2263,8 +2341,8 @@ ROM_START( rchase ) ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) ) ROM_REGION( 0x040000, "suby", 0 ) // Y - ROM_LOAD16_BYTE( "epr-14092.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) - ROM_LOAD16_BYTE( "epr-14091.53", 0x000001, 0x20000, CRC(72a56f71) SHA1(d45d3072ea92b5dde5c70138e56e7f0ca248880e) ) + ROM_LOAD16_BYTE( "epr-14092.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // same as epr-13990.54 belown + ROM_LOAD16_BYTE( "epr-14091.53", 0x000001, 0x20000, CRC(72a56f71) SHA1(d45d3072ea92b5dde5c70138e56e7f0ca248880e) ) // 1 byte difference between regions ROM_REGION16_BE( 0x080000, "bsprites", 0 ) ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) ) @@ -2308,7 +2386,7 @@ ROM_START( rchase ) ROM_END //************************************************************************************************************************* -// Rail Chase Japan, Sega Y-board +// Rail Chase (Japan), Sega Y-board // CPU: 68000 (317-????) // ROM_START( rchasej ) @@ -2323,8 +2401,8 @@ ROM_START( rchasej ) ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) ) ROM_REGION( 0x040000, "suby", 0 ) // Y - ROM_LOAD16_BYTE( "epr-13990.54.verify", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // Need to verify EPR #, same as epr-14092.54 above - ROM_LOAD16_BYTE( "epr-13989.53.verify", 0x000001, 0x20000, CRC(8f4f824e) SHA1(d470f23ce2dca4e75b7b714175d47338c41bb721) ) // Need to verify EPR # + ROM_LOAD16_BYTE( "epr-13990.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) + ROM_LOAD16_BYTE( "epr-13989.53", 0x000001, 0x20000, CRC(8f4f824e) SHA1(d470f23ce2dca4e75b7b714175d47338c41bb721) ) ROM_REGION16_BE( 0x080000, "bsprites", 0 ) ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) ) @@ -2590,10 +2668,11 @@ DRIVER_INIT_MEMBER(segaybd_state,rchase) // YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS, LAYOUT GAME( 1988, gforce2, 0, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2", GAME_SUPPORTS_SAVE ) -GAME( 1988, gforce2j, gforce2, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Japan)", GAME_SUPPORTS_SAVE ) GAME( 1988, gforce2ja, gforce2, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Japan, Rev A)", GAME_SUPPORTS_SAVE ) +GAME( 1988, gforce2j, gforce2, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1990, gloc, 0, yboard, gloc, segaybd_state, gloc, ROT0, "Sega", "G-LOC Air Battle (US)", GAME_SUPPORTS_SAVE ) +GAME( 1990, gloc, 0, yboard, gloc, segaybd_state, gloc, ROT0, "Sega", "G-LOC Air Battle (World)", GAME_SUPPORTS_SAVE ) +GAME( 1990, glocu, gloc, yboard, gloc, segaybd_state, gloc, ROT0, "Sega", "G-LOC Air Battle (US)", GAME_SUPPORTS_SAVE ) GAME( 1990, glocr360, gloc, yboard, glocr360, segaybd_state, r360, ROT0, "Sega", "G-LOC R360", GAME_SUPPORTS_SAVE ) GAMEL(1988, pdrift, 0, yboard, pdrift, segaybd_state, pdrift, ROT0, "Sega", "Power Drift (World, Rev A)", GAME_SUPPORTS_SAVE, layout_pdrift ) From 22ee342634bd70a3203b38cd9c21bca3e33ad688 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 21:27:23 +0200 Subject: [PATCH 057/284] flopimg: save all possible data sectors in fm mode --- src/lib/formats/flopimg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c index 510f7d8c2d4..116edca5b1f 100644 --- a/src/lib/formats/flopimg.c +++ b/src/lib/formats/flopimg.c @@ -2563,8 +2563,9 @@ void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const UINT8 *bi if(idblk_count < 100) idblk[idblk_count++] = i+1; } - // fb - if(shift_reg == 0xf56f) { // data mark + // f8, f9, fa, fb + if(shift_reg == 0xf56a || shift_reg == 0xf56b || + shift_reg == 0xf56e || shift_reg == 0xf56f) { // data mark if(dblk_count < 100) dblk[dblk_count++] = i+1; } From d68270a1571ef9a7eb18b14f6329bcb11e531e44 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 21:38:50 +0200 Subject: [PATCH 058/284] wd177x_dsk: add support to mark tracks as deleted data --- src/lib/formats/wd177x_dsk.c | 18 ++++++++++++++++++ src/lib/formats/wd177x_dsk.h | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/src/lib/formats/wd177x_dsk.c b/src/lib/formats/wd177x_dsk.c index da0ab9e7130..839b03b0dce 100644 --- a/src/lib/formats/wd177x_dsk.c +++ b/src/lib/formats/wd177x_dsk.c @@ -204,6 +204,12 @@ bool wd177x_format::load(io_generic *io, UINT32 form_factor, floppy_image *image for(int track=0; track < f.track_count; track++) for(int head=0; head < f.head_count; head++) { + + if (f.encoding == floppy_image::FM) + desc[14].p1 = get_track_dam_fm(f, head, track); + else + desc[16].p1 = get_track_dam_mfm(f, head, track); + io_generic_read(io, sectdata, get_image_offset(f, head, track), track_size); generate_track(desc, track, head, sectors, f.sector_count, total_size, image); } @@ -345,6 +351,18 @@ int wd177x_format::get_image_offset(const format &f, int head, int track) return (track * f.head_count + head) * compute_track_size(f); } +int wd177x_format::get_track_dam_fm(const format &f, int head, int track) +{ + // everything marked as data by default + return FM_DAM; +} + +int wd177x_format::get_track_dam_mfm(const format &f, int head, int track) +{ + // everything marked as data by default + return MFM_DAM; +} + void wd177x_format::check_compatibility(floppy_image *image, std::vector &candidates) { UINT8 bitstream[500000/8]; diff --git a/src/lib/formats/wd177x_dsk.h b/src/lib/formats/wd177x_dsk.h index 64846e95dcf..a932beb1ced 100644 --- a/src/lib/formats/wd177x_dsk.h +++ b/src/lib/formats/wd177x_dsk.h @@ -43,11 +43,16 @@ public: virtual bool supports_save() const; protected: + enum { FM_DAM = 0xf56f, FM_DDAM = 0xf56a, MFM_DAM = 0xfb, MFM_DDAM = 0xf8 }; + const format *formats; + virtual floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index); virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index); virtual int find_size(io_generic *io, UINT32 form_factor); virtual int get_image_offset(const format &f, int head, int track); + virtual int get_track_dam_fm(const format &f, int head, int track); + virtual int get_track_dam_mfm(const format &f, int head, int track); int compute_track_size(const format &f) const; void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const; From bf4f1beaa2cd03b4362e52599ddcf4c4a9c32f13 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 31 May 2015 21:40:16 +0200 Subject: [PATCH 059/284] cgenie: fix plain sector disk images --- src/emu/bus/cgenie/expansion/floppy.c | 2 -- src/lib/formats/cgenie_dsk.c | 10 ++++++++++ src/lib/formats/cgenie_dsk.h | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/emu/bus/cgenie/expansion/floppy.c b/src/emu/bus/cgenie/expansion/floppy.c index 7f7475a2211..3221067b874 100644 --- a/src/emu/bus/cgenie/expansion/floppy.c +++ b/src/emu/bus/cgenie/expansion/floppy.c @@ -5,8 +5,6 @@ EACA Colour Genie Floppy Disc Controller TODO: - - Plain sector files are not working (some sectors are marked DDM), - maybe support the .cgd format? - What's the exact FD1793 model? - How does it turn off the motor? - What's the source of the timer and the exact timings? diff --git a/src/lib/formats/cgenie_dsk.c b/src/lib/formats/cgenie_dsk.c index 895651acbe2..827830682ec 100644 --- a/src/lib/formats/cgenie_dsk.c +++ b/src/lib/formats/cgenie_dsk.c @@ -29,6 +29,16 @@ const char *cgenie_format::extensions() const return "dsk"; } +int cgenie_format::get_track_dam_fm(const format &f, int head, int track) +{ + return (track == f.track_count/2) ? FM_DDAM : FM_DAM; +} + +int cgenie_format::get_track_dam_mfm(const format &f, int head, int track) +{ + return (track == f.track_count/2) ? MFM_DDAM : MFM_DAM; +} + const cgenie_format::format cgenie_format::formats[] = { { // 102k 5 1/4 inch single density single sided (Type A) diff --git a/src/lib/formats/cgenie_dsk.h b/src/lib/formats/cgenie_dsk.h index 2c88860b9cc..1eda22404c5 100644 --- a/src/lib/formats/cgenie_dsk.h +++ b/src/lib/formats/cgenie_dsk.h @@ -24,6 +24,10 @@ public: virtual const char *description() const; virtual const char *extensions() const; +protected: + virtual int get_track_dam_fm(const format &f, int head, int track); + virtual int get_track_dam_mfm(const format &f, int head, int track); + private: static const format formats[]; }; From 14a019da2027e07be1fd06555bb6fbe11eabf3c7 Mon Sep 17 00:00:00 2001 From: arbee Date: Sun, 31 May 2015 15:55:57 -0400 Subject: [PATCH 060/284] mac: Image card now accepts paths starting with '$' for your $HOME needs. Also fixed a crash if the path is invalid. [R. Belmont] --- src/emu/bus/nubus/nubus_image.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/emu/bus/nubus/nubus_image.c b/src/emu/bus/nubus/nubus_image.c index 8178b6ec870..d002a3badca 100644 --- a/src/emu/bus/nubus/nubus_image.c +++ b/src/emu/bus/nubus/nubus_image.c @@ -282,7 +282,7 @@ WRITE32_MEMBER( nubus_image_device::file_cmd_w ) strcpy((char*)filectx.filename, (char*)filectx.curdir); break; case kFileCmdSetDir: - if(filectx.filename[0] == '/') { + if ((filectx.filename[0] == '/') || (filectx.filename[0] == '$')) { strcpy((char*)filectx.curdir, (char*)filectx.filename); } else { strcat((char*)filectx.curdir, "/"); @@ -293,10 +293,15 @@ WRITE32_MEMBER( nubus_image_device::file_cmd_w ) if(filectx.dirp) osd_closedir(filectx.dirp); filectx.dirp = osd_opendir((const char *)filectx.curdir); case kFileCmdGetNextListing: - dp = osd_readdir(filectx.dirp); - if(dp) { - strncpy((char*)filectx.filename, dp->name, sizeof(filectx.filename)); - } else { + if (filectx.dirp) { + dp = osd_readdir(filectx.dirp); + if(dp) { + strncpy((char*)filectx.filename, dp->name, sizeof(filectx.filename)); + } else { + memset(filectx.filename, 0, sizeof(filectx.filename)); + } + } + else { memset(filectx.filename, 0, sizeof(filectx.filename)); } break; From 9f74d5fd7b4fc584961a7d816b0db2e233fa085a Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Sun, 31 May 2015 23:03:24 +0300 Subject: [PATCH 061/284] wd_fdc: separate soviet FD179x clone --- src/emu/machine/wd_fdc.c | 54 ++++++++++++++++++++++++++++++++++++---- src/emu/machine/wd_fdc.h | 10 ++++++++ src/mess/machine/beta.c | 2 +- src/mess/machine/beta.h | 2 +- 4 files changed, 61 insertions(+), 7 deletions(-) diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index 4e922aab398..82dd3d0d0dc 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -9,6 +9,7 @@ const device_type FD1781x = &device_creator; const device_type FD1791x = &device_creator; const device_type FD1792x = &device_creator; const device_type FD1793x = &device_creator; +const device_type KR1818VG93x = &device_creator; const device_type FD1794x = &device_creator; const device_type FD1795x = &device_creator; const device_type FD1797x = &device_creator; @@ -903,12 +904,17 @@ void wd_fdc_t::interrupt_start() status_type_1 = true; } - if(!(command & 0x0f)) { - intrq_cond = 0; - } else if ((command & 0x0f) > 8) { // assume I_IMM is set only if condition equal to 8 but not more than, Spectrum's BetaDisk require this - intrq_cond = 0; + int intcond = command & 0x0f; + if (!nonsticky_immint) { + if(intcond == 0) + intrq_cond = 0; + else + intrq_cond = (intrq_cond & I_IMM) | intcond; } else { - intrq_cond = (intrq_cond & I_IMM) | (command & 0x0f); + if (intcond < 8) + intrq_cond = intcond; + else + intrq_cond = 0; } if(command & I_IMM) { @@ -2394,6 +2400,7 @@ fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int fd1771_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2418,6 +2425,7 @@ fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int fd1781_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2444,6 +2452,7 @@ fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1792x, "FD1792", tag, owner, clock, "fd1792", __FILE__) @@ -2459,6 +2468,7 @@ fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793x, "FD1793", tag, owner, clock, "fd1793", __FILE__) @@ -2474,6 +2484,23 @@ fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; +} + +kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793x, "FD1793", tag, owner, clock, "fd1793", __FILE__) +{ + step_times = fd179x_step_times; + delay_register_commit = 4; + delay_command_commit = 12; + disable_mfm = false; + has_enmf = false; + inverted_bus = false; + side_control = false; + side_compare = true; + head_control = true; + motor_control = false; + ready_hooked = true; + nonsticky_immint = true; } fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1794x, "FD1794", tag, owner, clock, "fd1794", __FILE__) @@ -2489,6 +2516,7 @@ fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1795x, "FD1795", tag, owner, clock, "fd1795", __FILE__) @@ -2504,6 +2532,7 @@ fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int fd1795_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2527,6 +2556,7 @@ fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int fd1797_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2550,6 +2580,7 @@ mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8876x, "MB8876", tag, owner, clock, "mb8876", __FILE__) @@ -2565,6 +2596,7 @@ mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8877x, "MB8877", tag, owner, clock, "mb8877", __FILE__) @@ -2580,6 +2612,7 @@ mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1761x, "FD1761", tag, owner, clock, "fd1761", __FILE__) @@ -2595,6 +2628,7 @@ fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1763x, "FD1763", tag, owner, clock, "fd1763", __FILE__) @@ -2610,6 +2644,7 @@ fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1765x, "FD1765", tag, owner, clock, "fd1765", __FILE__) @@ -2625,6 +2660,7 @@ fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int fd1765_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2648,6 +2684,7 @@ fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int fd1767_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2671,6 +2708,7 @@ wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2793x, "WD2793", tag, owner, clock, "wd2793", __FILE__) @@ -2686,6 +2724,7 @@ wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2795x, "WD2795", tag, owner, clock, "wd2795", __FILE__) @@ -2701,6 +2740,7 @@ wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int wd2795_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2724,6 +2764,7 @@ wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *own head_control = true; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } int wd2797_t::calc_sector_size(UINT8 size, UINT8 command) const @@ -2747,6 +2788,7 @@ wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *own head_control = false; motor_control = true; ready_hooked = false; + nonsticky_immint = false; } wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1772x, "WD1772", tag, owner, clock, "wd1772", __FILE__) @@ -2764,6 +2806,7 @@ wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *own head_control = false; motor_control = true; ready_hooked = false; + nonsticky_immint = false; } int wd1772_t::settle_time() const @@ -2784,4 +2827,5 @@ wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *own head_control = false; motor_control = false; ready_hooked = true; + nonsticky_immint = false; } diff --git a/src/emu/machine/wd_fdc.h b/src/emu/machine/wd_fdc.h index 3f2d6c64b5b..8077ec2ec21 100644 --- a/src/emu/machine/wd_fdc.h +++ b/src/emu/machine/wd_fdc.h @@ -59,6 +59,9 @@ #define MCFG_FD1793x_ADD(_tag, _clock) \ MCFG_DEVICE_ADD(_tag, FD1793x, _clock) +#define MCFG_KR1818VG93x_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, KR1818VG93x, _clock) + #define MCFG_FD1794x_ADD(_tag, _clock) \ MCFG_DEVICE_ADD(_tag, FD1794x, _clock) @@ -188,6 +191,7 @@ protected: bool head_control; bool motor_control; bool ready_hooked; + bool nonsticky_immint; int clock_ratio; const int *step_times; int delay_register_commit; @@ -532,6 +536,11 @@ public: fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; +class kr1818vg93_t : public wd_fdc_analog_t { +public: + kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + class fd1794_t : public wd_fdc_analog_t { public: fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -647,6 +656,7 @@ extern const device_type FD1781x; extern const device_type FD1791x; extern const device_type FD1792x; extern const device_type FD1793x; +extern const device_type KR1818VG93x; extern const device_type FD1795x; extern const device_type FD1797x; diff --git a/src/mess/machine/beta.c b/src/mess/machine/beta.c index e671e67c89a..6774281e26a 100644 --- a/src/mess/machine/beta.c +++ b/src/mess/machine/beta.c @@ -182,7 +182,7 @@ static SLOT_INTERFACE_START( beta_disk_floppies ) SLOT_INTERFACE_END static MACHINE_CONFIG_FRAGMENT( beta_disk ) - MCFG_WD2793x_ADD("wd179x", XTAL_8MHz / 8) // KR1818VG93 clone of WD1793 + MCFG_KR1818VG93x_ADD("wd179x", XTAL_8MHz / 8) MCFG_FLOPPY_DRIVE_ADD("wd179x:0", beta_disk_floppies, "drive0", beta_disk_device::floppy_formats) MCFG_FLOPPY_DRIVE_ADD("wd179x:1", beta_disk_floppies, "drive1", beta_disk_device::floppy_formats) MCFG_FLOPPY_DRIVE_ADD("wd179x:2", beta_disk_floppies, "drive2", beta_disk_device::floppy_formats) diff --git a/src/mess/machine/beta.h b/src/mess/machine/beta.h index c082819149e..4afe62c771c 100644 --- a/src/mess/machine/beta.h +++ b/src/mess/machine/beta.h @@ -50,7 +50,7 @@ protected: virtual machine_config_constructor device_mconfig_additions() const; private: - required_device m_wd179x; + required_device m_wd179x; required_device m_floppy0; required_device m_floppy1; required_device m_floppy2; From c4c906f5091d4932a72ffb628961ff41d1118527 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sun, 31 May 2015 22:21:14 +0200 Subject: [PATCH 062/284] M1COMM - initial commit --- scripts/target/mame/arcade.lua | 1 + src/mame/drivers/model1.c | 15 ++ src/mame/includes/model1.h | 3 + src/mame/machine/m1comm.c | 290 +++++++++++++++++++++++++++++++++ src/mame/machine/m1comm.h | 80 +++++++++ 5 files changed, 389 insertions(+) create mode 100644 src/mame/machine/m1comm.c create mode 100644 src/mame/machine/m1comm.h diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index eff03dac309..c34ef9eb959 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -2421,6 +2421,7 @@ files { MAME_DIR .. "src/mame/drivers/model1.c", MAME_DIR .. "src/mame/machine/model1.c", MAME_DIR .. "src/mame/video/model1.c", + MAME_DIR .. "src/mame/machine/m1comm.c", MAME_DIR .. "src/mame/audio/dsbz80.c", MAME_DIR .. "src/mame/drivers/model2.c", MAME_DIR .. "src/mame/video/model2.c", diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c index 7cf50339ff2..933abf5e37e 100644 --- a/src/mame/drivers/model1.c +++ b/src/mame/drivers/model1.c @@ -742,6 +742,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(model1_state::model1_interrupt) irq_raise(m_sound_irq); m_m1audio->check_fifo_irq(); + + if (m_m1comm != NULL) + m_m1comm->check_vint_irq(); } } @@ -902,6 +905,10 @@ static ADDRESS_MAP_START( model1_mem, AS_PROGRAM, 16, model1_state ) AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(p_w) AM_SHARE("palette") AM_RANGE(0x910000, 0x91bfff) AM_RAM AM_SHARE("color_xlat") + AM_RANGE(0xb00000, 0xb00fff) AM_DEVREADWRITE8("m1comm", m1comm_device, share_r, share_w, 0xffff) + AM_RANGE(0xb01000, 0xb01001) AM_DEVREADWRITE8("m1comm", m1comm_device, cn_r, cn_w, 0x00ff) + AM_RANGE(0xb01002, 0xb01003) AM_DEVREADWRITE8("m1comm", m1comm_device, fg_r, fg_w, 0x00ff) + AM_RANGE(0xc00000, 0xc0003f) AM_READWRITE(io_r, io_w) AM_RANGE(0xc00040, 0xc00043) AM_READWRITE(network_ctl_r, network_ctl_w) @@ -950,6 +957,10 @@ static ADDRESS_MAP_START( model1_vr_mem, AS_PROGRAM, 16, model1_state ) AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(p_w) AM_SHARE("palette") AM_RANGE(0x910000, 0x91bfff) AM_RAM AM_SHARE("color_xlat") + AM_RANGE(0xb00000, 0xb00fff) AM_DEVREADWRITE8("m1comm", m1comm_device, share_r, share_w, 0xffff) + AM_RANGE(0xb01000, 0xb01001) AM_DEVREADWRITE8("m1comm", m1comm_device, cn_r, cn_w, 0x00ff) + AM_RANGE(0xb01002, 0xb01003) AM_DEVREADWRITE8("m1comm", m1comm_device, fg_r, fg_w, 0x00ff) + AM_RANGE(0xc00000, 0xc0003f) AM_READWRITE(io_r, io_w) AM_RANGE(0xc00040, 0xc00043) AM_READWRITE(network_ctl_r, network_ctl_w) @@ -1541,6 +1552,8 @@ static MACHINE_CONFIG_START( model1, model1_state ) MCFG_VIDEO_START_OVERRIDE(model1_state,model1) MCFG_SEGAM1AUDIO_ADD("m1audio") + + MCFG_M1COMM_ADD("m1comm") MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED(swa, model1) @@ -1586,6 +1599,8 @@ static MACHINE_CONFIG_START( model1_vr, model1_state ) MCFG_VIDEO_START_OVERRIDE(model1_state,model1) MCFG_SEGAM1AUDIO_ADD("m1audio") + + MCFG_M1COMM_ADD("m1comm") MACHINE_CONFIG_END GAME( 1993, vf, 0, model1, vf, driver_device, 0, ROT0, "Sega", "Virtua Fighter", GAME_IMPERFECT_GRAPHICS ) diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h index 86bb9679847..dce16b83fe1 100644 --- a/src/mame/includes/model1.h +++ b/src/mame/includes/model1.h @@ -2,6 +2,7 @@ // copyright-holders:Olivier Galibert #include "audio/dsbz80.h" #include "audio/segam1audio.h" +#include "machine/m1comm.h" #include "cpu/v60/v60.h" #define DECLARE_TGP_FUNCTION(name) void name() @@ -16,6 +17,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_m1audio(*this, "m1audio"), + m_m1comm(*this, "m1comm"), m_dsbz80(*this, DSBZ80_TAG), m_tgp(*this, "tgp"), m_screen(*this, "screen"), @@ -29,6 +31,7 @@ public: required_device m_maincpu; // V60 required_device m_m1audio; // Model 1 standard sound board + optional_device m_m1comm; // Model 1 communication board optional_device m_dsbz80; // Digital Sound Board optional_device m_tgp; required_device m_screen; diff --git a/src/mame/machine/m1comm.c b/src/mame/machine/m1comm.c new file mode 100644 index 00000000000..7e734846b95 --- /dev/null +++ b/src/mame/machine/m1comm.c @@ -0,0 +1,290 @@ +// license:BSD-3-Clause +// copyright-holders:Ariane Fugmann + +/* +Comm PCB +-------- + +MODEL-1 COMMUNICATION BD 837-8842 171-6293B (C) SEGA 1992 +|--------------------------------------------------------------------------------| +| | +| MB89237A MB89374 | +| JP4 LED1 | +| 15112.17 Z80 | +| JP2 JP3 75179 | +| MB8464 315-5624 JP6 | +| 315-5547 | +| 315-5611 SW1 PC910 CN4| +| | +| PC910 CN5| +| MB8421 MB8431 JP7 | +| JP5 | +| JP8 CN7| +| CN1 CN2 | +| |---------------------------------| |---------------------------------| CN6| +| |---------------------------------| |---------------------------------| | +|--------------------------------------------------------------------------------| +Notes: + 15112.17 - AMD AM27C100 128k x8 EPROM (DIP32, labelled 'EPR-15112') + Z80 - Zilog Z0840004PSC Z80 CPU, running at 4.000MHz (DIP40) + MB8464 - Fujitsu MB8464 8k x8 SRAM (DIP28) + MB8421 - Fujitsu MB8421-12LP 2k x8 SRAM (SDIP52) + MB8431 - Fujitsu MB8431-90LP 2k x8 SRAM (SDIP52) + MB89237A - Fujitsu MB89237A DMA-Controller (DIP20) [most likely i8237A clone] + MB89374 - Fujitsu MB89374 Data Link Controller (SDIP42) + 75179 - Texas Instruments SN75179 Differential Driver and Receiver Pair (DIP8) + 315-5547 - AMI 18CV8PC-25 PAL (DIP20) + 315-5624 - MMI PAL16L8BCN PAL (DIP20) + 315-5611 - Lattice GAL16V8A PAL (DIP20) + PC910 - Sharp PC910 opto-isolator (x2, DIP8) + SW1 - Push Button Switch (enables board) + CN1, CN2 - Connectors to join Comm board to Video board + CN4 - 8 pin connector (DIFFERENTIAL port) + CN5 - 6 pin connector (SERIAL port) + CN6, CN7 - TOSLINK-Connectors for network optical cable link + JP2 - Jumper, set to 2-3 (connected to EPROM A15) + JP3 - Jumper, set to 1-2 (connected to EPROM A16) + JP4 - Jumper, set to 1-2 + JP5 - Jumper, shorted (enables TOSLINK RX channel) + JP6 - Jumper, not shorted (enables DIFFERERENTIAL RX channel) + JP7 - Jumper, not shorted (enables SERIAL RX channel) + JP8 - Jumper, set to 1-2 (selects CLOCK SOURCE) +*/ + +#include "machine/m1comm.h" + +#define Z80_TAG "m1commcpu" + +#define __M1COMM_VERBOSE__ + +/************************************* + * M1COMM Memory Map + *************************************/ +static ADDRESS_MAP_START( m1comm_mem, AS_PROGRAM, 8, m1comm_device ) + AM_RANGE(0x0000, 0x7fff) AM_ROM + AM_RANGE(0x8000, 0x9fff) AM_RAM + AM_RANGE(0xC000, 0xffff) AM_READWRITE(share_r, share_w) +ADDRESS_MAP_END + +/************************************* + * M1COMM I/O Map + *************************************/ +static ADDRESS_MAP_START( m1comm_io, AS_IO, 8, m1comm_device ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x00, 0x1F) AM_READWRITE(dlc_reg_r, dlc_reg_w) + AM_RANGE(0x20, 0x2F) AM_READWRITE(dma_reg_r, dma_reg_w) + AM_RANGE(0x40, 0x40) AM_READWRITE(syn_r, syn_w) + AM_RANGE(0x60, 0x60) AM_READWRITE(zfg_r, zfg_w) + AM_RANGE(0xFFFF, 0xFFFF) AM_RAM +ADDRESS_MAP_END + +MACHINE_CONFIG_FRAGMENT( m1comm ) + MCFG_CPU_ADD(Z80_TAG, Z80, 4000000) /* 32 MHz / 8 */ + MCFG_CPU_PROGRAM_MAP(m1comm_mem) + MCFG_CPU_IO_MAP(m1comm_io) +MACHINE_CONFIG_END + +ROM_START( m1comm ) + ROM_REGION( 0x20000, Z80_TAG, ROMREGION_ERASEFF ) + ROM_LOAD( "epr-15112.17", 0x0000, 0x20000, CRC(4950E771) ) +ROM_END + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +const device_type M1COMM = &device_creator; + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor m1comm_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( m1comm ); +} + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const rom_entry *m1comm_device::device_rom_region() const +{ + return ROM_NAME( m1comm ); +} + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// m1comm_device - constructor +//------------------------------------------------- + +m1comm_device::m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, M1COMM, "MODEL-1 COMMUNICATION BD", tag, owner, clock, "m1comm", __FILE__), + m_commcpu(*this, Z80_TAG) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void m1comm_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void m1comm_device::device_reset() +{ + m_syn = 0; + m_zfg = 0; + m_cn = 0; + m_fg = 0; + + m_commcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); +} + +READ8_MEMBER(m1comm_device::dlc_reg_r) +{ + // dirty hack to keep Z80 in RESET state + if (!m_cn) + { + device_reset(); + return 0xFF; + } + // dirty hack to keep Z80 in RESET state + + UINT8 result = m_dlc_reg[offset]; +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-dlc_reg_r: read register %02x for value %02x\n", offset, result); +#endif + return result; +} + +WRITE8_MEMBER(m1comm_device::dlc_reg_w) +{ + m_dlc_reg[offset] = data; +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-dlc_reg_w: write register %02x for value %02x\n", offset, data); +#endif +} + +READ8_MEMBER(m1comm_device::dma_reg_r) +{ + UINT8 result = m_dma_reg[offset]; +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-dma_reg_r: read register %02x for value %02x\n", offset, result); +#endif + return result; +} + +WRITE8_MEMBER(m1comm_device::dma_reg_w) +{ +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-dma_reg_w: %02x %02x\n", offset, data); +#endif + m_dma_reg[offset] = data; +} + +READ8_MEMBER(m1comm_device::syn_r) +{ + UINT8 result = m_syn | 0xFC; +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-syn_r: read register %02x for value %02x\n", offset, result); +#endif + return result; +} + +WRITE8_MEMBER(m1comm_device::syn_w) +{ + m_syn = data & 0x03; + +#ifdef __M1COMM_VERBOSE__ + switch (data & 0x02) + { + case 0x00: + printf("m1comm-syn_w: VINT disabled\n"); + break; + + case 0x02: + printf("m1comm-syn_w: VINT enabled\n"); + break; + + default: + printf("m1comm-syn_w: %02x\n", data); + break; + } +#endif +} + +READ8_MEMBER(m1comm_device::zfg_r) +{ + UINT8 result = m_zfg | 0xFE; +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-zfg_r: read register %02x for value %02x\n", offset, result); +#endif + return result; +} + +WRITE8_MEMBER(m1comm_device::zfg_w) +{ +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-zfg_w: %02x\n", data); +#endif + m_zfg = data & 0x01; +} + +READ8_MEMBER(m1comm_device::share_r) +{ + return m_shared[offset]; +} + +WRITE8_MEMBER(m1comm_device::share_w) +{ + m_shared[offset] = data; +} + +READ8_MEMBER(m1comm_device::cn_r) +{ + return m_cn | 0xFE; +} + +WRITE8_MEMBER(m1comm_device::cn_w) +{ + m_cn = data & 0x01; + + if (!m_cn) + device_reset(); + else + m_commcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); +} + +READ8_MEMBER(m1comm_device::fg_r) +{ + return m_fg | (~m_zfg << 7) | 0x7E; +} + +WRITE8_MEMBER(m1comm_device::fg_w) +{ + if (!m_cn) + return; + + m_fg = data & 0x01; +} + +void m1comm_device::check_vint_irq() +{ + if (m_syn & 0x02) + { + m_commcpu->set_input_line_and_vector(0, HOLD_LINE, 0xEF); +#ifdef __M1COMM_VERBOSE__ + printf("m1comm-INT5\n"); +#endif + } +} \ No newline at end of file diff --git a/src/mame/machine/m1comm.h b/src/mame/machine/m1comm.h new file mode 100644 index 00000000000..90f2737f048 --- /dev/null +++ b/src/mame/machine/m1comm.h @@ -0,0 +1,80 @@ +// license:BSD-3-Clause +// copyright-holders:Ariane Fugmann +#pragma once + +#ifndef __M1COMM_H__ +#define __M1COMM_H__ + +#include "emu.h" +#include "cpu/z80/z80.h" + +#define MCFG_M1COMM_ADD(_tag ) \ + MCFG_DEVICE_ADD(_tag, M1COMM, 0) + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class m1comm_device : public device_t +{ +public: + // construction/destruction + m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + + required_device m_commcpu; + + // internal API - stuff that happens on the comm board + // MB89374 registers + DECLARE_READ8_MEMBER(dlc_reg_r); + DECLARE_WRITE8_MEMBER(dlc_reg_w); + // MB89237A registers + DECLARE_READ8_MEMBER(dma_reg_r); + DECLARE_WRITE8_MEMBER(dma_reg_w); + // single bit registers (74LS74) + DECLARE_READ8_MEMBER(syn_r); + DECLARE_WRITE8_MEMBER(syn_w); + DECLARE_READ8_MEMBER(zfg_r); + DECLARE_WRITE8_MEMBER(zfg_w); + // shared memory 4k + DECLARE_READ8_MEMBER(share_r); + DECLARE_WRITE8_MEMBER(share_w); + + // public API - stuff that gets called from the model1 + // shared memory 4k + // reads/writes at I/O 0xB00xxx + // - share_r + // - share_w + // single bit registers (74LS74) + // reads/writes at I/O 0xB01000 + DECLARE_READ8_MEMBER(cn_r); + DECLARE_WRITE8_MEMBER(cn_w); + // reads/writes at I/O 0xB01002 + DECLARE_READ8_MEMBER(fg_r); + DECLARE_WRITE8_MEMBER(fg_w); + + // IRQ logic - 5 = VINT, 7 = DLC + void check_vint_irq(); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + virtual const rom_entry *device_rom_region() const; + +private: + UINT8 m_shared[0x1000]; // 2x 2k = 4k; model1 accesses this with 16bit data and 11bit address (A0 to A10) + UINT8 m_dlc_reg[0x20]; // MB89374 registers + UINT8 m_dma_reg[0x20]; // MB89237A registers + UINT8 m_syn; // bit0 is stored; purpose unknown, bit1 is used to enable/disable VINT/IRQ5 + UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored + UINT8 m_cn; // bit0 is used to enable/disable the comm board + UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 +}; + +// device type definition +extern const device_type M1COMM; + +#endif /* __M1COMM_H__ */ From 70b15d1ce6b0035b651e4d3da8d0fb7ff401d41b Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Mon, 1 Jun 2015 00:02:48 +0300 Subject: [PATCH 063/284] fix c/p (nw) --- src/emu/machine/wd_fdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c index 82dd3d0d0dc..9052c033bef 100644 --- a/src/emu/machine/wd_fdc.c +++ b/src/emu/machine/wd_fdc.c @@ -2487,7 +2487,7 @@ fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793x, "FD1793", tag, owner, clock, "fd1793", __FILE__) +kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, KR1818VG93x, "KR1818VG93", tag, owner, clock, "kr1818vg93", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; From 8c109dc6b12f5238c030e6ddca2058367da33ff3 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Sun, 31 May 2015 22:46:20 +0100 Subject: [PATCH 064/284] new clones Mr. Kicker (F-E1-16-010 PCB) [system11] (I'll work out the speedup in a bit) --- src/mame/arcade.lst | 1 + src/mame/drivers/vamphalf.c | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index cce4c398951..5d9bfd3bda2 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -10909,6 +10909,7 @@ mosaicf2 // (c) 1999 F2 System royalpk2 // finalgdr // (c) 2001 Semicom mrkicker // (c) 2001 Semicom +mrkickera // (c) 2001 Semicom wivernwg // (c) 2001 Semicom wyvernwg // (c) 2001 Semicom / Game Vision wyvernwga // (c) 2001 Semicom / Game Vision diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c index 7d601fefa28..161b7bd5d02 100644 --- a/src/mame/drivers/vamphalf.c +++ b/src/mame/drivers/vamphalf.c @@ -162,6 +162,7 @@ public: DECLARE_WRITE32_MEMBER(finalgdr_oki_bank_w); DECLARE_WRITE32_MEMBER(aoh_oki_bank_w); DECLARE_WRITE16_MEMBER(boonggab_oki_bank_w); + DECLARE_WRITE16_MEMBER(mrkickera_oki_bank_w); DECLARE_WRITE32_MEMBER(wyvernwg_snd_w); DECLARE_WRITE16_MEMBER(misncrft_snd_w); DECLARE_READ8_MEMBER(qs1000_p1_r); @@ -187,6 +188,7 @@ public: DECLARE_DRIVER_INIT(boonggab); DECLARE_DRIVER_INIT(wyvernwg); DECLARE_DRIVER_INIT(yorijori); + DECLARE_DRIVER_INIT(mrkickera); UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -339,6 +341,12 @@ WRITE16_MEMBER(vamphalf_state::boonggab_oki_bank_w) m_oki->set_bank_base(0x40000 * (data & 0x7)); } + +WRITE16_MEMBER(vamphalf_state::mrkickera_oki_bank_w) +{ + m_oki->set_bank_base(0x40000 * (data & 0x3)); +} + WRITE16_MEMBER(vamphalf_state::boonggab_prize_w) { if(offset) @@ -450,6 +458,7 @@ static ADDRESS_MAP_START( misncrft_io, AS_IO, 16, vamphalf_state ) ADDRESS_MAP_END static ADDRESS_MAP_START( coolmini_io, AS_IO, 16, vamphalf_state ) +// AM_RANGE(0x002, 0x003) AM_WRITE(mrkickera_oki_bank_w) // not coolmini?, installed on init AM_RANGE(0x200, 0x203) AM_WRITE(flipscreen_w) AM_RANGE(0x300, 0x303) AM_READ_PORT("SYSTEM") AM_RANGE(0x304, 0x307) AM_READ_PORT("P1_P2") @@ -513,6 +522,8 @@ static ADDRESS_MAP_START( mrkicker_io, AS_IO, 32, vamphalf_state ) AM_RANGE(0x7c00, 0x7c03) AM_READ_PORT("SYSTEM") ADDRESS_MAP_END + + static ADDRESS_MAP_START( jmpbreak_io, AS_IO, 16, vamphalf_state ) AM_RANGE(0x0c0, 0x0c3) AM_NOP // ? AM_RANGE(0x100, 0x103) AM_WRITENOP // ? @@ -1106,6 +1117,8 @@ static MACHINE_CONFIG_DERIVED( mrkicker, common ) MCFG_FRAGMENT_ADD(sound_ym_oki) MACHINE_CONFIG_END + + static MACHINE_CONFIG_START( aoh, vamphalf_state ) MCFG_CPU_ADD("maincpu", E132XN, XTAL_20MHz*4) /* 4x internal multiplier */ MCFG_CPU_PROGRAM_MAP(aoh_map) @@ -2237,6 +2250,36 @@ ROM_START( mrkicker ) ROM_LOAD( "eeprom-mrkicker.bin", 0x0000, 0x0080, CRC(87afb8f7) SHA1(444203b793c1d7929fc5916f18b510198719cd38) ) ROM_END +ROM_START( mrkickera ) + ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */ + /* rom0 empty */ + ROM_LOAD( "3.rom2", 0x080000, 0x080000, CRC(3f7fa08b) SHA1(dbffd44d8387e6ed1a4b5ec85ccf64d69a108d88) ) + + ROM_REGION( 0x800000, "gfx1", 0 ) /* gfx data */ + ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(c677aac3) SHA1(356073a29260e8e6c29dd12b2113b30140c6108c) ) + ROM_LOAD32_WORD( "romh00", 0x000002, 0x200000, CRC(b6337d4a) SHA1(2f46e2933af7fd0f71083900d5e6e4f602ab4c66) ) + /* roml01 empty */ + /* romh01 empty */ + + ROM_REGION( 0x080000, "user2", 0 ) /* Oki Samples */ + ROM_LOAD( "at27c040.u7", 0x000000, 0x080000, CRC(e8141fcd) SHA1(256fd1987030e0a1df0a66a228c1fea996cda686) ) /* Mask ROM */ + + /* $00000-$20000 stays the same in all sound banks, */ + /* the second half of the bank is what gets switched */ + ROM_REGION( 0x100000, "oki", 0 ) /* Samples */ + ROM_COPY( "user2", 0x000000, 0x000000, 0x020000) + ROM_COPY( "user2", 0x000000, 0x020000, 0x020000) + ROM_COPY( "user2", 0x000000, 0x040000, 0x020000) + ROM_COPY( "user2", 0x020000, 0x060000, 0x020000) + ROM_COPY( "user2", 0x000000, 0x080000, 0x020000) + ROM_COPY( "user2", 0x040000, 0x0a0000, 0x020000) + ROM_COPY( "user2", 0x000000, 0x0c0000, 0x020000) + ROM_COPY( "user2", 0x060000, 0x0e0000, 0x020000) + + ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* Default EEPROM (it doesn't boot without and the game code crashes) */ + ROM_LOAD( "eeprom-mrkicker.bin", 0x0000, 0x0080, CRC(87afb8f7) SHA1(444203b793c1d7929fc5916f18b510198719cd38) ) +ROM_END + /* Age Of Heroes - Silkroad 2 Unico, 2001 @@ -2704,6 +2747,15 @@ DRIVER_INIT_MEMBER(vamphalf_state,coolmini) m_flip_bit = 1; } +DRIVER_INIT_MEMBER(vamphalf_state,mrkickera) +{ +// m_maincpu->space(AS_PROGRAM).install_read_handler(0x000d2e80, 0x000d2e83, read16_delegate(FUNC(vamphalf_state::mrkickera_speedup_r), this)); + m_maincpu->space(AS_IO).install_write_handler(0x002, 0x003, write16_delegate(FUNC(vamphalf_state::mrkickera_oki_bank_w), this)); + + m_palshift = 0; + m_flip_bit = 1; +} + DRIVER_INIT_MEMBER(vamphalf_state,suplup) { m_maincpu->space(AS_PROGRAM).install_read_handler(0x0011605c, 0x0011605f, read16_delegate(FUNC(vamphalf_state::suplup_speedup_r), this)); @@ -2895,6 +2947,7 @@ GAME( 2000, mrdig, 0, mrdig, common, vamphalf_state, mrdig, R GAME( 2001, dtfamily, 0, coolmini, common, vamphalf_state, dtfamily, ROT0, "SemiCom", "Diet Family", GAME_SUPPORTS_SAVE ) GAME( 2001, finalgdr, 0, finalgdr, finalgdr, vamphalf_state, finalgdr, ROT0, "SemiCom", "Final Godori (Korea, version 2.20.5915)", GAME_SUPPORTS_SAVE ) GAME( 2001, mrkicker, 0, mrkicker, finalgdr, vamphalf_state, mrkicker, ROT0, "SemiCom", "Mr. Kicker", GAME_SUPPORTS_SAVE ) +GAME( 2001, mrkickera, mrkicker, coolmini, common, vamphalf_state, mrkickera,ROT0, "SemiCom", "Mr. Kicker (F-E1-16-010 PCB)", GAME_SUPPORTS_SAVE ) GAME( 2001, toyland, 0, coolmini, common, vamphalf_state, toyland, ROT0, "SemiCom", "Toy Land Adventure", GAME_SUPPORTS_SAVE ) GAME( 2001, wivernwg, 0, wyvernwg, common, vamphalf_state, wyvernwg, ROT270, "SemiCom", "Wivern Wings", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 2001, wyvernwg, wivernwg, wyvernwg, common, vamphalf_state, wyvernwg, ROT270, "SemiCom (Game Vision license)", "Wyvern Wings (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) From 7500669a194853266769f1cad42f7c9acf257e60 Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 1 Jun 2015 00:29:10 +0200 Subject: [PATCH 065/284] Fix save states in netlist. (nw) --- src/emu/netlist/nl_lists.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emu/netlist/nl_lists.h b/src/emu/netlist/nl_lists.h index f7408177103..94726cad80f 100644 --- a/src/emu/netlist/nl_lists.h +++ b/src/emu/netlist/nl_lists.h @@ -128,9 +128,9 @@ public: // save state support & mame disasm - ATTR_COLD const entry_t *listptr() const { return &m_list[0]; } - ATTR_HOT int count() const { return m_end - m_list; } - ATTR_HOT const entry_t & operator[](const int & index) const { return m_list[index]; } + ATTR_COLD const entry_t *listptr() const { return &m_list[1]; } + ATTR_HOT int count() const { return m_end - &m_list[1]; } + ATTR_HOT const entry_t & operator[](const int & index) const { return m_list[1+index]; } #if (NL_KEEP_STATISTICS) // profiling From 872ca80ac52c1bcc47cf5b0b087ccdc891496851 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 31 May 2015 23:34:31 +0200 Subject: [PATCH 066/284] Converted netlist into a library. Moved most code from nl_convert.h to nl_convert.c. Targets using netlist must now specify this explicitly with MACHINES["NETLIST"] = true Added subtarget "nl" which only contains games with netlist elements. (nw) --- scripts/src/emu.lua | 5 +- scripts/src/machine.lua | 11 + scripts/src/main.lua | 1 + scripts/src/netlist.lua | 271 ++++++++++--------- scripts/src/tools.lua | 3 +- scripts/target/mame/arcade.lua | 1 + scripts/target/mame/mess.lua | 1 + scripts/target/mame/nl.lua | 121 +++++++++ src/emu/netlist/analog/nld_bjt.c | 9 + src/emu/netlist/analog/nld_bjt.h | 9 +- src/emu/netlist/nl_base.h | 2 +- src/emu/netlist/plib/pconfig.h | 8 +- src/emu/netlist/tools/nl_convert.c | 413 +++++++++++++++++++++++++++++ src/emu/netlist/tools/nl_convert.h | 393 ++------------------------- src/mame/nl.lst | 32 +++ 15 files changed, 767 insertions(+), 513 deletions(-) create mode 100644 scripts/target/mame/nl.lua create mode 100644 src/emu/netlist/tools/nl_convert.c create mode 100644 src/mame/nl.lst diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index 2eb279377b5..f81ca07af5c 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -266,8 +266,6 @@ files { MAME_DIR .. "src/emu/machine/laserdsc.h", MAME_DIR .. "src/emu/machine/latch.c", MAME_DIR .. "src/emu/machine/latch.h", - MAME_DIR .. "src/emu/machine/netlist.c", - MAME_DIR .. "src/emu/machine/netlist.h", MAME_DIR .. "src/emu/machine/nvram.c", MAME_DIR .. "src/emu/machine/nvram.h", MAME_DIR .. "src/emu/machine/ram.c", @@ -389,12 +387,13 @@ function emuProject(_target, _subtarget) dofile(path.join("src", "sound.lua")) - dofile(path.join("src", "netlist.lua")) dofile(path.join("src", "video.lua")) dofile(path.join("src", "machine.lua")) + -- netlist now defines a project + dofile(path.join("src", "netlist.lua")) project ("bus") uuid ("5d782c89-cf7e-4cfe-8f9f-0d4bfc16c91d") diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 528cebbd3d2..67d18e7a44e 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -2662,3 +2662,14 @@ if (MACHINES["PCI9050"]~=null) then } end +--------------------------------------------------- +-- +--@src/emu/machine/netlist.h,MACHINES += NETLIST +--------------------------------------------------- + +if (MACHINES["NETLIST"]~=null) then + files { + MAME_DIR .. "src/emu/machine/netlist.c", + MAME_DIR .. "src/emu/machine/netlist.h", + } +end diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 9559eb1f594..809a18be70a 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -87,6 +87,7 @@ function mainProject(_target, _subtarget) links { "osd_" .. _OPTIONS["osd"], "bus", + "netlist", "optional", "emu", "dasm", diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua index 9d61b0d4892..b0e3f0cab0b 100644 --- a/scripts/src/netlist.lua +++ b/scripts/src/netlist.lua @@ -1,127 +1,152 @@ -- license:BSD-3-Clause -- copyright-holders:MAMEdev Team -files { - MAME_DIR .. "src/emu/netlist/nl_config.h", - MAME_DIR .. "src/emu/netlist/nl_dice_compat.h", - MAME_DIR .. "src/emu/netlist/nl_lists.h", - MAME_DIR .. "src/emu/netlist/nl_time.h", - MAME_DIR .. "src/emu/netlist/nl_util.h", - MAME_DIR .. "src/emu/netlist/nl_base.c", - MAME_DIR .. "src/emu/netlist/nl_base.h", - MAME_DIR .. "src/emu/netlist/nl_parser.c", - MAME_DIR .. "src/emu/netlist/nl_parser.h", - MAME_DIR .. "src/emu/netlist/nl_setup.c", - MAME_DIR .. "src/emu/netlist/nl_setup.h", - MAME_DIR .. "src/emu/netlist/nl_factory.c", - MAME_DIR .. "src/emu/netlist/nl_factory.h", - MAME_DIR .. "src/emu/netlist/plib/pconfig.h", - MAME_DIR .. "src/emu/netlist/plib/palloc.c", - MAME_DIR .. "src/emu/netlist/plib/palloc.h", - MAME_DIR .. "src/emu/netlist/plib/plists.h", - MAME_DIR .. "src/emu/netlist/plib/poptions.h", - MAME_DIR .. "src/emu/netlist/plib/pparser.c", - MAME_DIR .. "src/emu/netlist/plib/pparser.h", - MAME_DIR .. "src/emu/netlist/plib/pstate.c", - MAME_DIR .. "src/emu/netlist/plib/pstate.h", - MAME_DIR .. "src/emu/netlist/plib/pstring.c", - MAME_DIR .. "src/emu/netlist/plib/pstring.h", - MAME_DIR .. "src/emu/netlist/analog/nld_bjt.c", - MAME_DIR .. "src/emu/netlist/analog/nld_bjt.h", - MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.c", - MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.h", - MAME_DIR .. "src/emu/netlist/analog/nld_solver.c", - MAME_DIR .. "src/emu/netlist/analog/nld_solver.h", - MAME_DIR .. "src/emu/netlist/analog/nld_switches.c", - MAME_DIR .. "src/emu/netlist/analog/nld_switches.h", - MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.c", - MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.h", - MAME_DIR .. "src/emu/netlist/analog/nld_opamps.c", - MAME_DIR .. "src/emu/netlist/analog/nld_opamps.h", - MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct.h", - MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct1.h", - MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct2.h", - MAME_DIR .. "src/emu/netlist/analog/nld_ms_gauss_seidel.h", - MAME_DIR .. "src/emu/netlist/devices/nld_4020.c", - MAME_DIR .. "src/emu/netlist/devices/nld_4020.h", - MAME_DIR .. "src/emu/netlist/devices/nld_4066.c", - MAME_DIR .. "src/emu/netlist/devices/nld_4066.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7400.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7400.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7402.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7402.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7404.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7404.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7408.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7408.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7410.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7410.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7411.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7411.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7420.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7420.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7425.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7425.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7427.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7427.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7430.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7430.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7432.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7432.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7437.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7437.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7448.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7448.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7450.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7450.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7474.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7474.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7483.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7483.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7486.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7486.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7490.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7490.h", - MAME_DIR .. "src/emu/netlist/devices/nld_7493.c", - MAME_DIR .. "src/emu/netlist/devices/nld_7493.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74107.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74107.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74123.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74123.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74153.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74153.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74175.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74175.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74192.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74192.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74193.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74193.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74279.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74279.h", - MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.c", - MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.h", - MAME_DIR .. "src/emu/netlist/devices/nld_82S16.c", - MAME_DIR .. "src/emu/netlist/devices/nld_82S16.h", - MAME_DIR .. "src/emu/netlist/devices/nld_9310.c", - MAME_DIR .. "src/emu/netlist/devices/nld_9310.h", - MAME_DIR .. "src/emu/netlist/devices/nld_9312.c", - MAME_DIR .. "src/emu/netlist/devices/nld_9312.h", - MAME_DIR .. "src/emu/netlist/devices/nld_9316.c", - MAME_DIR .. "src/emu/netlist/devices/nld_9316.h", - MAME_DIR .. "src/emu/netlist/devices/nld_ne555.c", - MAME_DIR .. "src/emu/netlist/devices/nld_ne555.h", - MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.c", - MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.h", - MAME_DIR .. "src/emu/netlist/devices/nld_legacy.c", - MAME_DIR .. "src/emu/netlist/devices/nld_legacy.h", - MAME_DIR .. "src/emu/netlist/devices/net_lib.c", - MAME_DIR .. "src/emu/netlist/devices/net_lib.h", - MAME_DIR .. "src/emu/netlist/devices/nld_log.c", - MAME_DIR .. "src/emu/netlist/devices/nld_log.h", - MAME_DIR .. "src/emu/netlist/devices/nld_system.c", - MAME_DIR .. "src/emu/netlist/devices/nld_system.h", - MAME_DIR .. "src/emu/netlist/devices/nld_cmos.h", - MAME_DIR .. "src/emu/netlist/devices/nld_signal.h", - MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.c", - MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.h", +project "netlist" + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) + uuid "665ef8ac-2a4c-4c3e-a05f-fd1e5db11de9" + kind (LIBTYPE) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/emu/netlist", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib/util", + } + -- if _OPTIONS["with-bundled-expat"] then + -- includedirs { + -- MAME_DIR .. "3rdparty/expat/lib", + -- } + --end + + + files { + MAME_DIR .. "src/emu/netlist/nl_config.h", + MAME_DIR .. "src/emu/netlist/nl_dice_compat.h", + MAME_DIR .. "src/emu/netlist/nl_lists.h", + MAME_DIR .. "src/emu/netlist/nl_time.h", + MAME_DIR .. "src/emu/netlist/nl_util.h", + MAME_DIR .. "src/emu/netlist/nl_base.c", + MAME_DIR .. "src/emu/netlist/nl_base.h", + MAME_DIR .. "src/emu/netlist/nl_parser.c", + MAME_DIR .. "src/emu/netlist/nl_parser.h", + MAME_DIR .. "src/emu/netlist/nl_setup.c", + MAME_DIR .. "src/emu/netlist/nl_setup.h", + MAME_DIR .. "src/emu/netlist/nl_factory.c", + MAME_DIR .. "src/emu/netlist/nl_factory.h", + MAME_DIR .. "src/emu/netlist/plib/pconfig.h", + MAME_DIR .. "src/emu/netlist/plib/palloc.c", + MAME_DIR .. "src/emu/netlist/plib/palloc.h", + MAME_DIR .. "src/emu/netlist/plib/plists.h", + MAME_DIR .. "src/emu/netlist/plib/poptions.h", + MAME_DIR .. "src/emu/netlist/plib/pparser.c", + MAME_DIR .. "src/emu/netlist/plib/pparser.h", + MAME_DIR .. "src/emu/netlist/plib/pstate.c", + MAME_DIR .. "src/emu/netlist/plib/pstate.h", + MAME_DIR .. "src/emu/netlist/plib/pstring.c", + MAME_DIR .. "src/emu/netlist/plib/pstring.h", + MAME_DIR .. "src/emu/netlist/plib/pstring.c", + MAME_DIR .. "src/emu/netlist/plib/pstring.h", + MAME_DIR .. "src/emu/netlist/tools/nl_convert.c", + MAME_DIR .. "src/emu/netlist/tools/nl_convert.h", + MAME_DIR .. "src/emu/netlist/analog/nld_bjt.c", + MAME_DIR .. "src/emu/netlist/analog/nld_bjt.h", + MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.c", + MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.h", + MAME_DIR .. "src/emu/netlist/analog/nld_solver.c", + MAME_DIR .. "src/emu/netlist/analog/nld_solver.h", + MAME_DIR .. "src/emu/netlist/analog/nld_switches.c", + MAME_DIR .. "src/emu/netlist/analog/nld_switches.h", + MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.c", + MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.h", + MAME_DIR .. "src/emu/netlist/analog/nld_opamps.c", + MAME_DIR .. "src/emu/netlist/analog/nld_opamps.h", + MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct.h", + MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct1.h", + MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct2.h", + MAME_DIR .. "src/emu/netlist/analog/nld_ms_gauss_seidel.h", + MAME_DIR .. "src/emu/netlist/devices/nld_4020.c", + MAME_DIR .. "src/emu/netlist/devices/nld_4020.h", + MAME_DIR .. "src/emu/netlist/devices/nld_4066.c", + MAME_DIR .. "src/emu/netlist/devices/nld_4066.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7400.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7400.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7402.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7402.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7404.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7404.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7408.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7408.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7410.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7410.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7411.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7411.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7420.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7420.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7425.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7425.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7427.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7427.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7430.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7430.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7432.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7432.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7437.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7437.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7448.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7448.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7450.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7450.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7474.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7474.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7483.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7483.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7486.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7486.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7490.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7490.h", + MAME_DIR .. "src/emu/netlist/devices/nld_7493.c", + MAME_DIR .. "src/emu/netlist/devices/nld_7493.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74107.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74107.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74123.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74123.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74153.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74153.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74175.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74175.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74192.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74192.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74193.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74193.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74279.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74279.h", + MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.c", + MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.h", + MAME_DIR .. "src/emu/netlist/devices/nld_82S16.c", + MAME_DIR .. "src/emu/netlist/devices/nld_82S16.h", + MAME_DIR .. "src/emu/netlist/devices/nld_9310.c", + MAME_DIR .. "src/emu/netlist/devices/nld_9310.h", + MAME_DIR .. "src/emu/netlist/devices/nld_9312.c", + MAME_DIR .. "src/emu/netlist/devices/nld_9312.h", + MAME_DIR .. "src/emu/netlist/devices/nld_9316.c", + MAME_DIR .. "src/emu/netlist/devices/nld_9316.h", + MAME_DIR .. "src/emu/netlist/devices/nld_ne555.c", + MAME_DIR .. "src/emu/netlist/devices/nld_ne555.h", + MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.c", + MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.h", + MAME_DIR .. "src/emu/netlist/devices/nld_legacy.c", + MAME_DIR .. "src/emu/netlist/devices/nld_legacy.h", + MAME_DIR .. "src/emu/netlist/devices/net_lib.c", + MAME_DIR .. "src/emu/netlist/devices/net_lib.h", + MAME_DIR .. "src/emu/netlist/devices/nld_log.c", + MAME_DIR .. "src/emu/netlist/devices/nld_log.h", + MAME_DIR .. "src/emu/netlist/devices/nld_system.c", + MAME_DIR .. "src/emu/netlist/devices/nld_system.h", + MAME_DIR .. "src/emu/netlist/devices/nld_cmos.h", + MAME_DIR .. "src/emu/netlist/devices/nld_signal.h", + MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.c", + MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.h", } diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index 936afb54346..b7a88f038f7 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -443,6 +443,7 @@ links { "flac", "7z", "ocore_" .. _OPTIONS["osd"], + "netlist", } includedirs { @@ -455,8 +456,6 @@ files { MAME_DIR .. "src/tools/nltool.c", } -dofile("netlist.lua") - -------------------------------------------------- -- castool -------------------------------------------------- diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 8d0346f3942..aababae90f6 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -470,6 +470,7 @@ MACHINES["MSM6242"] = true --MACHINES["NCR5380N"] = true --MACHINES["NCR5390"] = true MACHINES["NCR539x"] = true +MACHINES["NETLIST"] = true --MACHINES["NCR53C7XX"] = true MACHINES["NMC9306"] = true --MACHINES["NSC810"] = true diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 8db1d42aa81..86ba1bce400 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -471,6 +471,7 @@ MACHINES["NCR5380N"] = true MACHINES["NCR5390"] = true MACHINES["NCR539x"] = true MACHINES["NCR53C7XX"] = true +MACHINES["NETLIST"] = true MACHINES["NMC9306"] = true MACHINES["NSC810"] = true MACHINES["NSCSI"] = true diff --git a/scripts/target/mame/nl.lua b/scripts/target/mame/nl.lua new file mode 100644 index 00000000000..86aebc37245 --- /dev/null +++ b/scripts/target/mame/nl.lua @@ -0,0 +1,121 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- nl.lua +-- +-- Compiles all drivers using netlist code +-- Use make SUBTARGET=nl to build +-- +--------------------------------------------------------------------------- + + +-------------------------------------------------- +-- Specify all the CPU cores necessary for the +-- drivers referenced in nl.lst. +-------------------------------------------------- + +CPUS["Z80"] = true +--CPUS["M6502"] = true +--CPUS["MCS48"] = true +--CPUS["MCS51"] = true +--CPUS["M6800"] = true +--CPUS["M6809"] = true +--CPUS["M680X0"] = true +--CPUS["TMS9900"] = true +--CPUS["COP400"] = true + +-------------------------------------------------- +-- Specify all the sound cores necessary for the +-- drivers referenced in nl.lst. +-------------------------------------------------- + +--SOUNDS["SAMPLES"] = true +SOUNDS["DAC"] = true +--SOUNDS["DISCRETE"] = true +SOUNDS["AY8910"] = true +--SOUNDS["YM2151"] = true +--SOUNDS["ASTROCADE"] = true +--SOUNDS["TMS5220"] = true +--SOUNDS["OKIM6295"] = true +--SOUNDS["HC55516"] = true +--SOUNDS["YM3812"] = true +--SOUNDS["CEM3394"] = true +--SOUNDS["VOTRAX"] = true + +-------------------------------------------------- +-- specify available video cores +-------------------------------------------------- + +VIDEOS["FIXFREQ"] = true + +-------------------------------------------------- +-- specify available machine cores +-------------------------------------------------- + +MACHINES["NETLIST"] = true +--MACHINES["6821PIA"] = true +--MACHINES["TTL74148"] = true +--MACHINES["TTL74153"] = true +--MACHINES["TTL7474"] = true +--MACHINES["RIOT6532"] = true +--MACHINES["PIT8253"] = true +--MACHINES["Z80CTC"] = true +--MACHINES["68681"] = true +--MACHINES["BANKDEV"] = true + + +-------------------------------------------------- +-- specify available bus cores +-------------------------------------------------- + +-- not needed by nl.lua but build system wants at least one bus +BUSES["CENTRONICS"] = true + +-------------------------------------------------- +-- This is the list of files that are necessary +-- for building all of the drivers referenced +-- in tiny.lst +-------------------------------------------------- + +function createProjects_mame_nl(_target, _subtarget) + project ("mame_netlist") + targetsubdir(_target .."_" .. _subtarget) + kind (LIBTYPE) + uuid (os.uuid("drv-mame-nl")) + + options { + "ForceCPP", + } + + includedirs { + MAME_DIR .. "src/osd", + MAME_DIR .. "src/emu", + MAME_DIR .. "src/mame", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/zlib", + GEN_DIR .. "mame/layout", + } + + files{ + MAME_DIR .. "src/mame/drivers/pong.c", + MAME_DIR .. "src/mame/drivers/nl_pong.c", + MAME_DIR .. "src/mame/drivers/nl_pongd.c", + MAME_DIR .. "src/mame/drivers/nl_breakout.c", + + MAME_DIR .. "src/mame/drivers/1942.c", + MAME_DIR .. "src/mame/video/1942.c", + MAME_DIR .. "src/mame/drivers/popeye.c", + MAME_DIR .. "src/mame/video/popeye.c", + + } +end + +function linkProjects_mame_nl(_target, _subtarget) + links { + "mame_netlist", + } +end diff --git a/src/emu/netlist/analog/nld_bjt.c b/src/emu/netlist/analog/nld_bjt.c index fe9644ef052..04de16923e2 100644 --- a/src/emu/netlist/analog/nld_bjt.c +++ b/src/emu/netlist/analog/nld_bjt.c @@ -42,6 +42,15 @@ private: // nld_Q // ---------------------------------------------------------------------------------------- +NETLIB_NAME(Q)::NETLIB_NAME(Q)(const family_t afamily) +: netlist_device_t(afamily) +, m_qtype(BJT_NPN) { } + +NETLIB_NAME(Q)::~NETLIB_NAME(Q)() +{ +} + + NETLIB_START(Q) { register_param("model", m_model, ""); diff --git a/src/emu/netlist/analog/nld_bjt.h b/src/emu/netlist/analog/nld_bjt.h index 69a56ea16ad..b9bace5c032 100644 --- a/src/emu/netlist/analog/nld_bjt.h +++ b/src/emu/netlist/analog/nld_bjt.h @@ -38,9 +38,8 @@ public: BJT_PNP }; - ATTR_COLD NETLIB_NAME(Q)(const family_t afamily) - : netlist_device_t(afamily) - , m_qtype(BJT_NPN) { } + NETLIB_NAME(Q)(const family_t afamily); + virtual ~NETLIB_NAME(Q)(); inline q_type qtype() const { return m_qtype; } inline bool is_qtype(q_type atype) const { return m_qtype == atype; } @@ -59,9 +58,11 @@ class NETLIB_NAME(QBJT) : public NETLIB_NAME(Q) { public: - ATTR_COLD NETLIB_NAME(QBJT)(const family_t afamily) + NETLIB_NAME(QBJT)(const family_t afamily) : NETLIB_NAME(Q)(afamily) { } + virtual ~NETLIB_NAME(QBJT)() { } + protected: private: diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index 7e9ed94d499..07a99c8f0b1 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -173,7 +173,7 @@ class netlist_core_device_t; #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) typedef void (netlist_core_device_t::*net_update_delegate)(); #elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) -typedef /*__thiscall */ void (*net_update_delegate)(netlist_core_device_t *); +typedef MEMBER_ABI void (*net_update_delegate)(netlist_core_device_t *); #endif //============================================================ diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h index 9e25751ec72..cfb4fe8fb60 100644 --- a/src/emu/netlist/plib/pconfig.h +++ b/src/emu/netlist/plib/pconfig.h @@ -50,7 +50,8 @@ #if defined(__GNUC__) /* does not work in versions over 4.7.x of 32bit MINGW */ #if defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) - #define PHAS_PMF_INTERNAL 0 + #define PHAS_PMF_INTERNAL 1 + #define MEMBER_ABI __thiscall #elif defined(EMSCRIPTEN) #define PHAS_PMF_INTERNAL 0 #elif defined(__arm__) || defined(__ARMEL__) @@ -62,6 +63,9 @@ #define USE_DELEGATE_TYPE PHAS_PMF_INTERNAL 0 #endif +#ifndef MEMBER_ABI + #define MEMBER_ABI +#endif /* not supported in GCC prior to 4.4.x */ /* ATTR_HOT and ATTR_COLD cause performance degration in 5.1 */ @@ -134,7 +138,7 @@ typedef int64_t INT64; * It derives a pointer to a member function. */ -#if 1 || (PHAS_PMF_INTERNAL) +#if (PHAS_PMF_INTERNAL) class pmfp { public: diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c new file mode 100644 index 00000000000..10c3180ab67 --- /dev/null +++ b/src/emu/netlist/tools/nl_convert.c @@ -0,0 +1,413 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * nl_convert.c + * + */ + +#include "nl_convert.h" + +#if 0 +#include +#include + +#include "plib/pstring.h" +#include "plib/plists.h" +#endif + +/*------------------------------------------------- + convert - convert a spice netlist +-------------------------------------------------*/ + + +void nl_convert_base_t::out(const char *format, ...) +{ + va_list ap; + va_start(ap, format); + m_buf += pstring(format).vprintf(ap); + va_end(ap); +} + +void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias) +{ + m_pins.add(palloc(sp_pin_alias_t, devname + "." + name, devname + "." + alias), false); +} + +void nl_convert_base_t::add_ext_alias(const pstring &alias) +{ + m_ext_alias.add(alias); +} + +void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, const pstring &amodel) +{ + devs.add(palloc(sp_dev_t, atype, aname, amodel), false); +} +void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, double aval) +{ + devs.add(palloc(sp_dev_t, atype, aname, aval), false); +} +void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname) +{ + devs.add(palloc(sp_dev_t, atype, aname), false); +} + +void nl_convert_base_t::add_term(pstring netname, pstring termname) +{ + sp_net_t * net = m_nets.find_by_name(netname); + if (net == NULL) + { + net = palloc(sp_net_t, netname); + m_nets.add(net, false); + } + + /* if there is a pin alias, translate ... */ + sp_pin_alias_t *alias = m_pins.find_by_name(termname); + + if (alias != NULL) + net->terminals().add(alias->alias()); + else + net->terminals().add(termname); +} + +void nl_convert_base_t::dump_nl() +{ + for (int i=0; iterminals()[0].cstr()); + // if the aliased net only has this one terminal connected ==> don't dump + if (net->terminals().size() == 1) + net->set_no_export(); + } + for (int i=0; ihas_value()) + out("%s(%s, %s)\n", devs[i]->type().cstr(), + devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); + else if (devs[i]->has_model()) + out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), + devs[i]->name().cstr(), devs[i]->model().cstr()); + else + out("%s(%s)\n", devs[i]->type().cstr(), + devs[i]->name().cstr()); + } + // print nets + for (int i=0; iis_no_export()) + { + //printf("Net %s\n", net->name().cstr()); + out("NET_C(%s", net->terminals()[0].cstr() ); + for (int j=1; jterminals().size(); j++) + { + out(", %s", net->terminals()[j].cstr() ); + } + out(")\n"); + } + } + devs.clear_and_free(); + m_nets.clear_and_free(); + m_pins.clear_and_free(); + m_ext_alias.clear(); +} + +const pstring nl_convert_base_t::get_nl_val(const double val) +{ + { + int i = 0; + while (m_sp_units[i].sp_unit != "-" ) + { + if (m_sp_units[i].mult <= nl_math::abs(val)) + break; + i++; + } + return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); + } +} +double nl_convert_base_t::get_sp_unit(const pstring &unit) +{ + int i = 0; + while (m_sp_units[i].sp_unit != "-") + { + if (m_sp_units[i].sp_unit == unit) + return m_sp_units[i].mult; + i++; + } + fprintf(stderr, "Unit %s unknown\n", unit.cstr()); + return 0.0; +} + +double nl_convert_base_t::get_sp_val(const pstring &sin) +{ + int p = sin.len() - 1; + while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) + p--; + pstring val = sin.substr(0,p + 1); + pstring unit = sin.substr(p + 1); + + double ret = get_sp_unit(unit) * val.as_double(); + //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret); + return ret; +} + +nl_convert_base_t::sp_unit nl_convert_base_t::m_sp_units[] = { + {"T", "", 1.0e12 }, + {"G", "", 1.0e9 }, + {"MEG", "RES_M(%g)", 1.0e6 }, + {"k", "RES_K(%g)", 1.0e3 }, /* eagle */ + {"K", "RES_K(%g)", 1.0e3 }, + {"", "%g", 1.0e0 }, + {"M", "CAP_M(%g)", 1.0e-3 }, + {"u", "CAP_U(%g)", 1.0e-6 }, /* eagle */ + {"U", "CAP_U(%g)", 1.0e-6 }, + {"µ", "CAP_U(%g)", 1.0e-6 }, + {"N", "CAP_N(%g)", 1.0e-9 }, + {"P", "CAP_P(%g)", 1.0e-12}, + {"F", "%ge-15", 1.0e-15}, + + {"MIL", "%e", 25.4e-6}, + + {"-", "%g", 1.0 } +}; + + +void nl_convert_spice_t::convert(const pstring &contents) +{ + pstring_list_t spnl(contents, "\n"); + + // Add gnd net + + // FIXME: Parameter + out("NETLIST_START(dummy)\n"); + add_term("0", "GND"); + + pstring line = ""; + + for (std::size_t i=0; i < spnl.size(); i++) + { + // Basic preprocessing + pstring inl = spnl[i].trim().ucase(); + if (inl.startsWith("+")) + line = line + inl.substr(1); + else + { + process_line(line); + line = inl; + } + } + process_line(line); + dump_nl(); + // FIXME: Parameter + out("NETLIST_END()\n"); +} + +void nl_convert_spice_t::process_line(const pstring &line) +{ + if (line != "") + { + pstring_list_t tt(line, " ", true); + double val = 0.0; + switch (tt[0].cstr()[0]) + { + case ';': + out("// %s\n", line.substr(1).cstr()); + break; + case '*': + out("// %s\n", line.substr(1).cstr()); + break; + case '.': + if (tt[0].equals(".SUBCKT")) + { + out("NETLIST_START(%s)\n", tt[1].cstr()); + for (int i=2; i 5) + add_device("QBJT", tt[0], tt[5]); + else + add_device("QBJT", tt[0], tt[4]); + add_term(tt[1], tt[0] + ".C"); + add_term(tt[2], tt[0] + ".B"); + add_term(tt[3], tt[0] + ".E"); + } + break; + case 'R': + val = get_sp_val(tt[3]); + add_device("RES", tt[0], val); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + break; + case 'C': + val = get_sp_val(tt[3]); + add_device("CAP", tt[0], val); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + break; + case 'V': + // just simple Voltage sources .... + if (tt[2].equals("0")) + { + val = get_sp_val(tt[3]); + add_device("ANALOG_INPUT", tt[0], val); + add_term(tt[1], tt[0] + ".Q"); + //add_term(tt[2], tt[0] + ".2"); + } + else + fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); + break; + case 'D': + // FIXME: Rewrite resistor value + add_device("DIODE", tt[0], tt[3]); + add_term(tt[1], tt[0] + ".A"); + add_term(tt[2], tt[0] + ".K"); + break; + case 'U': + case 'X': + { + // FIXME: specific code for KICAD exports + // last element is component type + // FIXME: Parameter + + pstring xname = tt[0].replace(".", "_"); + pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; + add_device(tname, xname); + for (int i=1; i < tt.size() - 1; i++) + { + pstring term = pstring::sprintf("%s.%d", xname.cstr(), i); + add_term(tt[i], term); + } + break; + } + default: + out("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr()); + } + } +} + + +void nl_convert_eagle_t::convert(const pstring &contents) +{ + eagle_tokenizer tok(*this); + tok.reset(contents.cstr()); + + out("NETLIST_START(dummy)\n"); + add_term("GND", "GND"); + add_term("VCC", "VCC"); + eagle_tokenizer::token_t token = tok.get_token(); + while (true) + { + if (token.is_type(eagle_tokenizer::ENDOFFILE)) + { + dump_nl(); + // FIXME: Parameter + out("NETLIST_END()\n"); + return; + } + else if (token.is(tok.m_tok_SEMICOLON)) + { + /* ignore empty statements */ + token = tok.get_token(); + } + else if (token.is(tok.m_tok_ADD)) + { + pstring name = tok.get_string(); + /* skip to semicolon */ + do + { + token = tok.get_token(); + } while (!token.is(tok.m_tok_SEMICOLON)); + token = tok.get_token(); + pstring sval = ""; + if (token.is(tok.m_tok_VALUE)) + { + pstring vname = tok.get_string(); + sval = tok.get_string(); + tok.require_token(tok.m_tok_SEMICOLON); + token = tok.get_token(); + } + switch (name.cstr()[0]) + { + case 'Q': + { + add_device("QBJT", name, sval); + } + break; + case 'R': + { + double val = get_sp_val(sval); + add_device("RES", name, val); + } + break; + case 'C': + { + double val = get_sp_val(sval); + add_device("CAP", name, val); + } + break; + case 'P': + if (sval.ucase() == "HIGH") + add_device("TTL_INPUT", name, 1); + else if (sval.ucase() == "LOW") + add_device("TTL_INPUT", name, 0); + else + add_device("ANALOG_INPUT", name, sval.as_double()); + add_pin_alias(name, "1", "Q"); + break; + case 'D': + /* Pin 1 = Anode, Pin 2 = Cathode */ + add_device("DIODE", name, sval); + add_pin_alias(name, "1", "A"); + add_pin_alias(name, "2", "K"); + break; + case 'U': + case 'X': + { + pstring tname = "TTL_" + sval + "_DIP"; + add_device(tname, name); + break; + } + default: + tok.error("// IGNORED %s\n", name.cstr()); + } + + } + else if (token.is(tok.m_tok_SIGNAL)) + { + pstring netname = tok.get_string(); + token = tok.get_token(); + while (!token.is(tok.m_tok_SEMICOLON)) + { + /* fixme: should check for string */ + pstring devname = token.str(); + pstring pin = tok.get_string(); + add_term(netname, devname + "." + pin); + token = tok.get_token(); } + } + else + { + out("Unexpected %s\n", token.str().cstr()); + return; + } + } + +} + + diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index db5fcbf4f68..1e37d61e487 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -15,6 +15,7 @@ #include "plib/pstring.h" #include "plib/plists.h" +#include "plib/pparser.h" /*------------------------------------------------- convert - convert a spice netlist @@ -37,137 +38,23 @@ public: protected: - void out(const char *format, ...) ATTR_PRINTF(2,3) - { - va_list ap; - va_start(ap, format); - m_buf += pstring(format).vprintf(ap); - va_end(ap); - } + void out(const char *format, ...) ATTR_PRINTF(2,3); + void add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias); - void add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias) - { - m_pins.add(palloc(sp_pin_alias_t, devname + "." + name, devname + "." + alias), false); - } + void add_ext_alias(const pstring &alias); - void add_ext_alias(const pstring &alias) - { - m_ext_alias.add(alias); - } + void add_device(const pstring &atype, const pstring &aname, const pstring &amodel); + void add_device(const pstring &atype, const pstring &aname, double aval); + void add_device(const pstring &atype, const pstring &aname); - void add_device(const pstring &atype, const pstring &aname, const pstring &amodel) - { - devs.add(palloc(sp_dev_t, atype, aname, amodel), false); - } - void add_device(const pstring &atype, const pstring &aname, double aval) - { - devs.add(palloc(sp_dev_t, atype, aname, aval), false); - } - void add_device(const pstring &atype, const pstring &aname) - { - devs.add(palloc(sp_dev_t, atype, aname), false); - } + void add_term(pstring netname, pstring termname); - void add_term(pstring netname, pstring termname) - { - sp_net_t * net = m_nets.find_by_name(netname); - if (net == NULL) - { - net = palloc(sp_net_t, netname); - m_nets.add(net, false); - } + void dump_nl(); - /* if there is a pin alias, translate ... */ - sp_pin_alias_t *alias = m_pins.find_by_name(termname); + const pstring get_nl_val(const double val); + double get_sp_unit(const pstring &unit); - if (alias != NULL) - net->terminals().add(alias->alias()); - else - net->terminals().add(termname); - } - - void dump_nl() - { - for (int i=0; iterminals()[0].cstr()); - // if the aliased net only has this one terminal connected ==> don't dump - if (net->terminals().size() == 1) - net->set_no_export(); - } - for (int i=0; ihas_value()) - out("%s(%s, %s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); - else if (devs[i]->has_model()) - out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), devs[i]->model().cstr()); - else - out("%s(%s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr()); - } - // print nets - for (int i=0; iis_no_export()) - { - //printf("Net %s\n", net->name().cstr()); - out("NET_C(%s", net->terminals()[0].cstr() ); - for (int j=1; jterminals().size(); j++) - { - out(", %s", net->terminals()[j].cstr() ); - } - out(")\n"); - } - } - devs.clear_and_free(); - m_nets.clear_and_free(); - m_pins.clear_and_free(); - m_ext_alias.clear(); - } - - const pstring get_nl_val(const double val) - { - { - int i = 0; - while (m_sp_units[i].sp_unit != "-" ) - { - if (m_sp_units[i].mult <= nl_math::abs(val)) - break; - i++; - } - return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); - } - } - double get_sp_unit(const pstring &unit) - { - int i = 0; - while (m_sp_units[i].sp_unit != "-") - { - if (m_sp_units[i].sp_unit == unit) - return m_sp_units[i].mult; - i++; - } - fprintf(stderr, "Unit %s unknown\n", unit.cstr()); - return 0.0; - } - - double get_sp_val(const pstring &sin) - { - int p = sin.len() - 1; - while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) - p--; - pstring val = sin.substr(0,p + 1); - pstring unit = sin.substr(p + 1); - - double ret = get_sp_unit(unit) * val.as_double(); - //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret); - return ret; - } + double get_sp_val(const pstring &sin); private: struct sp_net_t @@ -253,26 +140,6 @@ private: }; -nl_convert_base_t::sp_unit nl_convert_base_t::m_sp_units[] = { - {"T", "", 1.0e12 }, - {"G", "", 1.0e9 }, - {"MEG", "RES_M(%g)", 1.0e6 }, - {"k", "RES_K(%g)", 1.0e3 }, /* eagle */ - {"K", "RES_K(%g)", 1.0e3 }, - {"", "%g", 1.0e0 }, - {"M", "CAP_M(%g)", 1.0e-3 }, - {"u", "CAP_U(%g)", 1.0e-6 }, /* eagle */ - {"U", "CAP_U(%g)", 1.0e-6 }, - {"µ", "CAP_U(%g)", 1.0e-6 }, - {"N", "CAP_N(%g)", 1.0e-9 }, - {"P", "CAP_P(%g)", 1.0e-12}, - {"F", "%ge-15", 1.0e-15}, - - {"MIL", "%e", 25.4e-6}, - - {"-", "%g", 1.0 } -}; - class nl_convert_spice_t : public nl_convert_base_t { public: @@ -282,136 +149,11 @@ public: { } - void convert(const pstring &contents) - { - pstring_list_t spnl(contents, "\n"); - - // Add gnd net - - // FIXME: Parameter - out("NETLIST_START(dummy)\n"); - add_term("0", "GND"); - - pstring line = ""; - - for (std::size_t i=0; i < spnl.size(); i++) - { - // Basic preprocessing - pstring inl = spnl[i].trim().ucase(); - if (inl.startsWith("+")) - line = line + inl.substr(1); - else - { - process_line(line); - line = inl; - } - } - process_line(line); - dump_nl(); - // FIXME: Parameter - out("NETLIST_END()\n"); - } + void convert(const pstring &contents); protected: - void process_line(const pstring &line) - { - if (line != "") - { - pstring_list_t tt(line, " ", true); - double val = 0.0; - switch (tt[0].cstr()[0]) - { - case ';': - out("// %s\n", line.substr(1).cstr()); - break; - case '*': - out("// %s\n", line.substr(1).cstr()); - break; - case '.': - if (tt[0].equals(".SUBCKT")) - { - out("NETLIST_START(%s)\n", tt[1].cstr()); - for (int i=2; i 5) - add_device("QBJT", tt[0], tt[5]); - else - add_device("QBJT", tt[0], tt[4]); - add_term(tt[1], tt[0] + ".C"); - add_term(tt[2], tt[0] + ".B"); - add_term(tt[3], tt[0] + ".E"); - } - break; - case 'R': - val = get_sp_val(tt[3]); - add_device("RES", tt[0], val); - add_term(tt[1], tt[0] + ".1"); - add_term(tt[2], tt[0] + ".2"); - break; - case 'C': - val = get_sp_val(tt[3]); - add_device("CAP", tt[0], val); - add_term(tt[1], tt[0] + ".1"); - add_term(tt[2], tt[0] + ".2"); - break; - case 'V': - // just simple Voltage sources .... - if (tt[2].equals("0")) - { - val = get_sp_val(tt[3]); - add_device("ANALOG_INPUT", tt[0], val); - add_term(tt[1], tt[0] + ".Q"); - //add_term(tt[2], tt[0] + ".2"); - } - else - fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); - break; - case 'D': - // FIXME: Rewrite resistor value - add_device("DIODE", tt[0], tt[3]); - add_term(tt[1], tt[0] + ".A"); - add_term(tt[2], tt[0] + ".K"); - break; - case 'U': - case 'X': - { - // FIXME: specific code for KICAD exports - // last element is component type - // FIXME: Parameter - - pstring xname = tt[0].replace(".", "_"); - pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; - add_device(tname, xname); - for (int i=1; i < tt.size() - 1; i++) - { - pstring term = pstring::sprintf("%s.%d", xname.cstr(), i); - add_term(tt[i], term); - } - break; - } - default: - out("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr()); - } - } - } + void process_line(const pstring &line); private: @@ -471,112 +213,7 @@ public: nl_convert_eagle_t &m_convert; }; - void convert(const pstring &contents) - { - eagle_tokenizer tok(*this); - tok.reset(contents.cstr()); - - out("NETLIST_START(dummy)\n"); - add_term("GND", "GND"); - add_term("VCC", "VCC"); - eagle_tokenizer::token_t token = tok.get_token(); - while (true) - { - if (token.is_type(eagle_tokenizer::ENDOFFILE)) - { - dump_nl(); - // FIXME: Parameter - out("NETLIST_END()\n"); - return; - } - else if (token.is(tok.m_tok_SEMICOLON)) - { - /* ignore empty statements */ - token = tok.get_token(); - } - else if (token.is(tok.m_tok_ADD)) - { - pstring name = tok.get_string(); - /* skip to semicolon */ - do - { - token = tok.get_token(); - } while (!token.is(tok.m_tok_SEMICOLON)); - token = tok.get_token(); - pstring sval = ""; - if (token.is(tok.m_tok_VALUE)) - { - pstring vname = tok.get_string(); - sval = tok.get_string(); - tok.require_token(tok.m_tok_SEMICOLON); - token = tok.get_token(); - } - switch (name.cstr()[0]) - { - case 'Q': - { - add_device("QBJT", name, sval); - } - break; - case 'R': - { - double val = get_sp_val(sval); - add_device("RES", name, val); - } - break; - case 'C': - { - double val = get_sp_val(sval); - add_device("CAP", name, val); - } - break; - case 'P': - if (sval.ucase() == "HIGH") - add_device("TTL_INPUT", name, 1); - else if (sval.ucase() == "LOW") - add_device("TTL_INPUT", name, 0); - else - add_device("ANALOG_INPUT", name, sval.as_double()); - add_pin_alias(name, "1", "Q"); - break; - case 'D': - /* Pin 1 = Anode, Pin 2 = Cathode */ - add_device("DIODE", name, sval); - add_pin_alias(name, "1", "A"); - add_pin_alias(name, "2", "K"); - break; - case 'U': - case 'X': - { - pstring tname = "TTL_" + sval + "_DIP"; - add_device(tname, name); - break; - } - default: - tok.error("// IGNORED %s\n", name.cstr()); - } - - } - else if (token.is(tok.m_tok_SIGNAL)) - { - pstring netname = tok.get_string(); - token = tok.get_token(); - while (!token.is(tok.m_tok_SEMICOLON)) - { - /* fixme: should check for string */ - pstring devname = token.str(); - pstring pin = tok.get_string(); - add_term(netname, devname + "." + pin); - token = tok.get_token(); } - } - else - { - out("Unexpected %s\n", token.str().cstr()); - return; - } - } - - } + void convert(const pstring &contents); protected: diff --git a/src/mame/nl.lst b/src/mame/nl.lst new file mode 100644 index 00000000000..904db249b13 --- /dev/null +++ b/src/mame/nl.lst @@ -0,0 +1,32 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles +/****************************************************************************** + + nl.lst + + List of all drivers using netlist code. This file is parsed by then + genie build system. + +******************************************************************************/ + +1942 // 12/1984 (c) 1984 +1942a // 12/1984 (c) 1984 +1942abl // bootleg +1942b // 12/1984 (c) 1984 +1942w // 12/1984 (c) 1984 + Williams Electronics license (c) 1985 +1942p // prototype +1942h // hack (Two Bit Score?) +popeye // (c) 1982 +popeyeu // (c) 1982 +popeyef // (c) 1982 +popeyebl // bootleg + +// mario + + +// Atari 100% TTL +pong // (c) 1972 Atari +pongd // (c) 1975 Atari +pongf // (c) 1972 Atari +breakout // (c) 1976 Atari + From b95d7f3491e3ae6c7130893119c319ae6d4e2f88 Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 31 May 2015 20:10:47 -0500 Subject: [PATCH 067/284] segaybd.c - Spelling - NW --- src/mame/drivers/segaybd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index ca53982e276..d9dae371630 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -2341,7 +2341,7 @@ ROM_START( rchase ) ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) ) ROM_REGION( 0x040000, "suby", 0 ) // Y - ROM_LOAD16_BYTE( "epr-14092.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // same as epr-13990.54 belown + ROM_LOAD16_BYTE( "epr-14092.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // same as epr-13990.54 below ROM_LOAD16_BYTE( "epr-14091.53", 0x000001, 0x20000, CRC(72a56f71) SHA1(d45d3072ea92b5dde5c70138e56e7f0ca248880e) ) // 1 byte difference between regions ROM_REGION16_BE( 0x080000, "bsprites", 0 ) From 4d81025ab6647d439d55903c97b7b5a18ac7d979 Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 31 May 2015 21:02:18 -0500 Subject: [PATCH 068/284] snowbros.c: Have CPU speeds be based off of actual OSC clocks. - NW Use OSC as listed in the driver and use reasonable clock and divider where clocks are unknown. Cross reference with PCB pics for example on Ball Boys MC68000P10 isn't really clocked at 16MHz, it's either 12MHz or 8MHz (16MHz/2) and note in driver. IE: 16MHz/4 vs 12MHz/3 for 4MHz and 16MHz/16 vs 12MHz/12 for 1MHz OKI clock. --- src/mame/drivers/snowbros.c | 72 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c index dee53e1e965..9b8a0f722b4 100644 --- a/src/mame/drivers/snowbros.c +++ b/src/mame/drivers/snowbros.c @@ -1654,11 +1654,11 @@ MACHINE_RESET_MEMBER(snowbros_state,finalttr) static MACHINE_CONFIG_START( snowbros, snowbros_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 Mhz - confirmed */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* 8 Mhz - confirmed */ MCFG_CPU_PROGRAM_MAP(snowbros_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1) - MCFG_CPU_ADD("soundcpu", Z80, 6000000) /* 6 MHz - confirmed */ + MCFG_CPU_ADD("soundcpu", Z80, XTAL_12MHz/2) /* 6 MHz - confirmed */ MCFG_CPU_PROGRAM_MAP(sound_map) MCFG_CPU_IO_MAP(sound_io_map) @@ -1683,7 +1683,7 @@ static MACHINE_CONFIG_START( snowbros, snowbros_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("ymsnd", YM3812, 3000000) + MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3 MHz - confirmed */ MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -1731,12 +1731,11 @@ static MACHINE_CONFIG_DERIVED( semicom, snowbros ) MACHINE_CONFIG_END - static MACHINE_CONFIG_DERIVED( semicom_mcu, semicom ) /* basic machine hardware */ - MCFG_CPU_ADD("protection", I8052, 16000000) // AT89C52 + MCFG_CPU_ADD("protection", I8052, XTAL_16MHz) // AT89C52 MCFG_CPU_PROGRAM_MAP(protection_map) MCFG_CPU_IO_MAP(protection_iomap) MACHINE_CONFIG_END @@ -1746,34 +1745,15 @@ static MACHINE_CONFIG_DERIVED( semiprot, semicom ) MCFG_MACHINE_RESET_OVERRIDE (snowbros_state, semiprot ) MACHINE_CONFIG_END -/* - -Honey Doll - Barko Corp 1995 - -Rom Board include a Cypress cy7C382-0JC chip - -Main Board : - -CPU : 1 X MC68000P12 - 1 X Z80B - -1 X Oki M6295 -2 X Cypress CY7C384A-XJC - -2 x quartz - 12Mhz and 16Mhz - - -See included pics -*/ static MACHINE_CONFIG_START( honeydol, snowbros_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 16000000) + MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like SemiCom or 8MHz (16MHz/2) like snowbros??? */ MCFG_CPU_PROGRAM_MAP(honeydol_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1) - MCFG_CPU_ADD("soundcpu", Z80, 4000000) + MCFG_CPU_ADD("soundcpu", Z80, XTAL_16MHz/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */ MCFG_CPU_PROGRAM_MAP(honeydol_sound_map) MCFG_CPU_IO_MAP(honeydol_sound_io_map) @@ -1795,23 +1775,23 @@ static MACHINE_CONFIG_START( honeydol, snowbros_state ) /* sound hardware */ - MCFG_SOUND_ADD("ymsnd", YM3812, 3000000) + MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3Mhz */ MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_OKIM6295_ADD("oki", 999900, OKIM6295_PIN7_HIGH) /* freq? */ + MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) /* freq? */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END static MACHINE_CONFIG_START( twinadv, snowbros_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 16000000) // or 12 + MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like SemiCom or 8MHz (16MHz/2) like snowbros??? */ MCFG_CPU_PROGRAM_MAP(twinadv_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1) - MCFG_CPU_ADD("soundcpu", Z80, 4000000) + MCFG_CPU_ADD("soundcpu", Z80, XTAL_16MHz/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */ MCFG_CPU_PROGRAM_MAP(sound_map) MCFG_CPU_IO_MAP(twinadv_sound_io_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", snowbros_state, irq0_line_hold) @@ -1833,7 +1813,7 @@ static MACHINE_CONFIG_START( twinadv, snowbros_state ) MCFG_SPEAKER_STANDARD_MONO("mono") /* sound hardware */ - MCFG_OKIM6295_ADD("oki", 12000000/12, OKIM6295_PIN7_HIGH) /* freq? */ + MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) /* freq? */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -1859,15 +1839,15 @@ Intel P8752 (mcu) static MACHINE_CONFIG_DERIVED( finalttr, semicom ) MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_CLOCK(12000000) + MCFG_CPU_CLOCK(XTAL_12MHz) MCFG_CPU_PROGRAM_MAP(finalttr_map) MCFG_CPU_MODIFY("soundcpu") - MCFG_CPU_CLOCK(3578545) + MCFG_CPU_CLOCK(XTAL_3_579545MHz) MCFG_MACHINE_RESET_OVERRIDE (snowbros_state, finalttr ) - MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000) + MCFG_SOUND_REPLACE("ymsnd", YM2151, XTAL_3_579545MHz) /* possible but less likely 4MHz (12MHz/3) */ MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0)) MCFG_SOUND_ROUTE(0, "mono", 0.08) MCFG_SOUND_ROUTE(1, "mono", 0.08) @@ -1883,10 +1863,10 @@ static MACHINE_CONFIG_DERIVED( _4in1, semicom ) MCFG_GFXDECODE_MODIFY("gfxdecode", snowbros) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( snowbro3, snowbros_state ) +static MACHINE_CONFIG_START( snowbro3, snowbros_state ) /* PCB has 16MHz & 12MHz OSCs */ /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16mhz or 12mhz ? */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* MC68000P10 CPU @ 12mhz or 8MHz (16MHz/2) ? */ MCFG_CPU_PROGRAM_MAP(snowbros3_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros3_irq, "screen", 0, 1) @@ -1906,7 +1886,7 @@ static MACHINE_CONFIG_START( snowbro3, snowbros_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_OKIM6295_ADD("oki", 999900, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified + MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -2064,6 +2044,24 @@ ROM_END /* Barko */ +/* + +Honey Doll - Barko Corp 1995 + +Rom Board include a Cypress cy7C382-0JC chip + +Main Board : + +CPU : 1 X MC68000P12 + 1 X Z80B + +1 X Oki M6295 +2 X Cypress CY7C384A-XJC + +2 x quartz - 12Mhz and 16Mhz + +*/ + ROM_START( honeydol ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "d-16.uh12", 0x00001, 0x20000, CRC(cee1a2e3) SHA1(6d1ff5358ec704616b724eea2ab9b60b84709eb1) ) From 9d45354044b3de57152d4c9833be0e1841dc3478 Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 31 May 2015 21:14:52 -0500 Subject: [PATCH 069/284] snowbros.c: Better documentation for Honey Dolls - NW --- src/mame/drivers/snowbros.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c index 9b8a0f722b4..c6ac04078b7 100644 --- a/src/mame/drivers/snowbros.c +++ b/src/mame/drivers/snowbros.c @@ -1749,7 +1749,7 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_START( honeydol, snowbros_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like SemiCom or 8MHz (16MHz/2) like snowbros??? */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* MC68000P12 @ 12MHz */ MCFG_CPU_PROGRAM_MAP(honeydol_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1) @@ -1787,7 +1787,7 @@ MACHINE_CONFIG_END static MACHINE_CONFIG_START( twinadv, snowbros_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like SemiCom or 8MHz (16MHz/2) like snowbros??? */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like Honey Dolls ? */ MCFG_CPU_PROGRAM_MAP(twinadv_map) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1) From d6d92c2a5f8fa2f8f3880b449aa02c1cc291e328 Mon Sep 17 00:00:00 2001 From: balr0g Date: Sun, 31 May 2015 22:52:29 -0400 Subject: [PATCH 070/284] Fix Game Blaster emulation, now working [balrog] --- src/emu/bus/isa/gblaster.c | 33 ++++++++++++++++++++++++++++----- src/emu/bus/isa/gblaster.h | 3 +++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/emu/bus/isa/gblaster.c b/src/emu/bus/isa/gblaster.c index 7cfe3a9b42b..9966f2353dd 100644 --- a/src/emu/bus/isa/gblaster.c +++ b/src/emu/bus/isa/gblaster.c @@ -35,8 +35,8 @@ WRITE8_MEMBER( isa8_gblaster_device::saa1099_1_16_w ) { switch(offset) { - case 0 : m_saa1099_1->control_w( space, offset, data ); break; - case 1 : m_saa1099_1->data_w( space, offset, data ); break; + case 0 : m_saa1099_1->data_w( space, offset, data ); break; + case 1 : m_saa1099_1->control_w( space, offset, data ); break; } } @@ -44,8 +44,29 @@ WRITE8_MEMBER( isa8_gblaster_device::saa1099_2_16_w ) { switch(offset) { - case 0 : m_saa1099_2->control_w( space, offset, data ); break; - case 1 : m_saa1099_2->data_w( space, offset, data ); break; + case 0 : m_saa1099_2->data_w( space, offset, data ); break; + case 1 : m_saa1099_2->control_w( space, offset, data ); break; + } +} + +READ8_MEMBER( isa8_gblaster_device::detect_r ) +{ + switch(offset) + { + case 0: + case 1: return 0x7f; break; // this register reportedly returns 0x3f on a Tandy 1000 TL, and 0x7f on a generic 486 PC. + case 6: + case 7: return detect_reg; break; + default: return 0xff; + } +} + +WRITE8_MEMBER( isa8_gblaster_device::detect_w ) +{ + switch(offset) + { + case 2: + case 3: detect_reg = (data & 0xff); break; } } @@ -77,7 +98,8 @@ isa8_gblaster_device::isa8_gblaster_device(const machine_config &mconfig, const device_t(mconfig, ISA8_GAME_BLASTER, "Game Blaster Sound Card", tag, owner, clock, "isa_gblaster", __FILE__), device_isa8_card_interface(mconfig, *this), m_saa1099_1(*this, "saa1099.1"), - m_saa1099_2(*this, "saa1099.2") + m_saa1099_2(*this, "saa1099.2"), + detect_reg(0xFF) { } @@ -90,6 +112,7 @@ void isa8_gblaster_device::device_start() set_isa_device(); m_isa->install_device(0x0220, 0x0221, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_1_16_w), this ) ); m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_2_16_w), this ) ); + m_isa->install_device(0x0224, 0x022F, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::detect_r), this ), write8_delegate( FUNC(isa8_gblaster_device::detect_w), this ) ); } //------------------------------------------------- diff --git a/src/emu/bus/isa/gblaster.h b/src/emu/bus/isa/gblaster.h index 2388f5bbd36..b2625e98975 100644 --- a/src/emu/bus/isa/gblaster.h +++ b/src/emu/bus/isa/gblaster.h @@ -29,6 +29,8 @@ public: DECLARE_READ8_MEMBER(saa1099_16_r); DECLARE_WRITE8_MEMBER(saa1099_1_16_w); DECLARE_WRITE8_MEMBER(saa1099_2_16_w); + DECLARE_READ8_MEMBER(detect_r); + DECLARE_WRITE8_MEMBER(detect_w); protected: // device-level overrides virtual void device_start(); @@ -37,6 +39,7 @@ private: // internal state required_device m_saa1099_1; required_device m_saa1099_2; + UINT8 detect_reg; }; From 5b609df8b11794450b6e9015407692fb7829f058 Mon Sep 17 00:00:00 2001 From: balr0g Date: Mon, 1 Jun 2015 00:03:23 -0400 Subject: [PATCH 071/284] Fix game blaster compatibility in sb1.0 [balrog] --- src/emu/bus/isa/sblaster.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/emu/bus/isa/sblaster.c b/src/emu/bus/isa/sblaster.c index b37067a2923..d04d5bf8bc1 100644 --- a/src/emu/bus/isa/sblaster.c +++ b/src/emu/bus/isa/sblaster.c @@ -29,6 +29,7 @@ pro audio spectrum 16: 1 OPL3 2 x saa1099 chips + inherited from game blaster also on sound blaster 1.0 option on sound blaster 1.5 @@ -150,8 +151,8 @@ WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_1_16_w ) { switch(offset) { - case 0 : m_saa1099_1->control_w( space, offset, data ); break; - case 1 : m_saa1099_1->data_w( space, offset, data ); break; + case 0 : m_saa1099_1->data_w( space, offset, data ); break; + case 1 : m_saa1099_1->control_w( space, offset, data ); break; } } @@ -159,8 +160,8 @@ WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_2_16_w ) { switch(offset) { - case 0 : m_saa1099_2->control_w( space, offset, data ); break; - case 1 : m_saa1099_2->data_w( space, offset, data ); break; + case 0 : m_saa1099_2->data_w( space, offset, data ); break; + case 1 : m_saa1099_2->control_w( space, offset, data ); break; } } From dbed74ef60b682e23d7720bfcb89adbb062f9671 Mon Sep 17 00:00:00 2001 From: RobertoFresca Date: Mon, 1 Jun 2015 02:40:54 -0300 Subject: [PATCH 072/284] some alignment, spacing, info, notes... (nw) --- src/mame/drivers/jankenmn.c | 92 +++++++++++++++++++++++++++++-------- 1 file changed, 72 insertions(+), 20 deletions(-) diff --git a/src/mame/drivers/jankenmn.c b/src/mame/drivers/jankenmn.c index 8654b400c6c..2f70aaaac9b 100644 --- a/src/mame/drivers/jankenmn.c +++ b/src/mame/drivers/jankenmn.c @@ -36,6 +36,16 @@ * Janken Man Lucky!, (c) 199?, Sunwise. +**************************************************************************** + + General Notes... + + For better experience, use the hi-res external artwork I made. + + Preview: http://www.robertofresca.com/imagenes/jankenmn_full.png + Artwork: http://mrdo.mameworld.info/artwork/jankenmn.zip + (mirror) http://www.progettoemma.net/mw/jankenmn.zip + **************************************************************************** Hardware Notes... @@ -108,27 +118,27 @@ lamps: - 0 = Multiplier 1 "attarii" (pays x1) - 1 = Multiplier 2 "ooatari" (pays x2) + 00 = Multiplier 1 "attarii" (pays x1) + 01 = Multiplier 2 "ooatari" (pays x2) - 2 = Rock button LED - 3 = Scissors button LED - 4 = Paper button LED + 02 = Rock button LED + 03 = Scissors button LED + 04 = Paper button LED - 5 = Lose - 6 = Draw - 7 = Win + 05 = Lose + 06 = Draw + 07 = Win - 8 = Base Hand - 9 = Paper components - 10 = Paper/Scissors components + 08 = Base Hand + 09 = Paper components + 10 = Paper/Scissors common components 11 = Rock components 12 = Scissors components - 13 = Rock/Scissors components + 13 = Rock/Scissors common components 14 = Payout error LED - Not implemented in internal .lay: + Not implemented in the internal layout/artwork: 15 = Rotating blue lamp @@ -169,7 +179,7 @@ public: *********************************************/ static const UINT8 led_map[16] = // 7748 IC? - { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; + { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0x00 }; WRITE8_MEMBER(jankenmn_state::lamps1_w) { @@ -182,7 +192,7 @@ WRITE8_MEMBER(jankenmn_state::lamps1_w) output_set_lamp_value(13, (data & 3) != 0); // d4-d7: led7seg (remaining credits) right digit - output_set_digit_value(1, led_map[data >> 4 & 0xf]); + output_set_digit_value(1, led_map[data >> 4 & 0x0f]); // d3: ? (only set if game is over) } @@ -222,6 +232,8 @@ WRITE8_MEMBER(jankenmn_state::lamps3_w) coin_lockout_global_w(machine(), ~data & 0x20); // d0, d6, d7: N/C? + if (data & 0x04) + logerror("payout: %02X\n", (data & 0x04)); } CUSTOM_INPUT_MEMBER(jankenmn_state::hopper_status_r) @@ -249,6 +261,46 @@ static ADDRESS_MAP_START( jankenmn_port_map, AS_IO, 8, jankenmn_state ) AM_RANGE(0x30, 0x30) AM_WRITENOP // ??? ADDRESS_MAP_END +/* + Writes to port 30h.... + + They are coming from different code chunks, but seems that at least + they have different functions. Writes from 00B6h are unknown, whilst + others coming from 00D6h are counters. Sometimes whilst one increase, + the other one decrease. Writes coming from 0103h seems to clear (00) + or just end whatever the command sent. + + Other behaviours could point to be different counters. + + Also when you win, and the multipliers start to run, a lot of data + is written to the port. Maybe is a leftover, or just a connector to + hook the multiplier's 'roulette style' matrix lamps for other Janken + Man games... + + ':maincpu' (00B6): unmapped io memory write to 0030 = 01 & FF + ':maincpu' (00D6): unmapped io memory write to 0030 = 2F & FF + ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF + + ':maincpu' (00B6): unmapped io memory write to 0030 = F4 & FF + ':maincpu' (00D6): unmapped io memory write to 0030 = 30 & FF + ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF + + ':maincpu' (00B6): unmapped io memory write to 0030 = E7 & FF + ':maincpu' (00D6): unmapped io memory write to 0030 = 31 & FF + ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF + + ':maincpu' (00B6): unmapped io memory write to 0030 = DA & FF + ':maincpu' (00D6): unmapped io memory write to 0030 = 32 & FF + ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF + + ':maincpu' (00B6): unmapped io memory write to 0030 = CD & FF + ':maincpu' (00D6): unmapped io memory write to 0030 = 33 & FF + ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF + + + Need more analysis... + +*/ /********************************************* * Input Ports Definitions * @@ -256,9 +308,9 @@ ADDRESS_MAP_END static INPUT_PORTS_START( jankenmn ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Guu (Rock)") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Choki (Scissors)") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Paa (Paper)") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Guu (Rock)") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("Choki (Scissors)") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Paa (Paper)") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // 100 yen coin PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state, hopper_status_r, NULL) @@ -362,5 +414,5 @@ ROM_END * Game Drivers * *********************************************/ -/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS... LAYOUT */ -GAMEL( 1991, jankenmn, 0, jankenmn, jankenmn, driver_device, 0, ROT0, "Sunwise", "Janken Man Kattara Ageru", GAME_SUPPORTS_SAVE, layout_jankenmn ) +/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS... LAYOUT */ +GAMEL( 1991, jankenmn, 0, jankenmn, jankenmn, driver_device, 0, ROT0, "Sunwise", "Janken Man Kattara Ageru", GAME_SUPPORTS_SAVE, layout_jankenmn ) From 0573fd994dc39a6e37bede3b6121a0c5e0f369e4 Mon Sep 17 00:00:00 2001 From: RobertoFresca Date: Mon, 1 Jun 2015 02:48:52 -0300 Subject: [PATCH 073/284] Chsuper.c driver. Added notes about the sound writes. --- src/mame/drivers/chsuper.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/mame/drivers/chsuper.c b/src/mame/drivers/chsuper.c index e31ca733741..78fdc8f0238 100644 --- a/src/mame/drivers/chsuper.c +++ b/src/mame/drivers/chsuper.c @@ -212,6 +212,39 @@ static ADDRESS_MAP_START( chsuper_portmap, AS_IO, 8, chsuper_state ) AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE("dac", dac_device, write_unsigned8) // unk writes ADDRESS_MAP_END +/* About Sound... + + Samples are PCM unsigned 8-bit, mono. + These are embedded into the program ROM, starting + at the 0x10000 offset. + + The audio system is currently unknown, but the sound writes + are the following... + + For any sample triggered: + + FF39h --> 0x02 + FF30h --> 0x30 + + then the following 5 writes (per sample number)... + + SND# (hex): 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 + Writes... + FF2Ah: 0x00 0xEA 0x01 0x76 0x00 0xF9 0x01 0x0F 0x00 0x84 0x01 0x01 0x00 0x01 0x01 0x01 0x00 0x01 0x01 0x8C 0x00 + FF29h: 0xFF 0xF6 0x04 0x05 0xFF 0x05 0x04 0x75 0xFF 0xF8 0x04 0x00 0xFF 0x00 0x04 0x21 0xFF 0x21 0x04 0x0D 0xFF + FF28h: 0xFF 0x0F 0xF8 0x69 0xFF 0x75 0x83 0x05 0xFF 0x0D 0x90 0xF8 0xFF 0x00 0x20 0x00 0xFF 0x00 0x00 0x9C 0xFF + FF2Fh: 0xF7 0x0F 0xFF 0xFF 0x06 0x00 0xFF 0xFF 0xF9 0x0D 0xFD 0xFF 0x01 0x04 0x1C 0xFF 0x22 0xE3 0xFF 0xFF 0xBB + FF2Eh: 0xF0 0x17 0xFF 0xFF 0x8A 0xF2 0xFF 0xFF 0xF2 0x7D 0x98 0xFF 0xFF 0x20 0xE0 0xFF 0xFF 0x00 0xFF 0xFF 0x1F + + then ending with... + + FF2Ch --> 0x00 + FF2Bh --> 0xF8 + FF30h --> 0x90 + FF39h --> 0x00 + +*/ + static INPUT_PORTS_START( chsuper ) PORT_START("IN0") From 508cceb599402b3ca487c12bd93b5c19e8ae8831 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Mon, 1 Jun 2015 19:10:04 +1200 Subject: [PATCH 074/284] clgd542x: fixed display of 16-bit video modes, added support for some acceleration features in 16-bit video modes. --- src/emu/video/clgd542x.c | 133 +++++++++++++++++++++++++++++++++------ src/emu/video/clgd542x.h | 2 + 2 files changed, 115 insertions(+), 20 deletions(-) diff --git a/src/emu/video/clgd542x.c b/src/emu/video/clgd542x.c index 84a7c0b33cf..aee97491ef1 100644 --- a/src/emu/video/clgd542x.c +++ b/src/emu/video/clgd542x.c @@ -233,13 +233,12 @@ void cirrus_gd5428_device::cirrus_define_video_mode() if (!gc_locked && (vga.sequencer.data[0x07] & 0x01)) { - switch(vga.sequencer.data[0x07] & 0x0E) + switch(vga.sequencer.data[0x07] & 0x06) // bit 3 is reserved on GD542x { case 0x00: svga.rgb8_en = 1; break; - case 0x02: svga.rgb16_en = 1; divisor = 2; break; //double VCLK - case 0x04: svga.rgb24_en = 1; divisor = 3; break; - case 0x06: svga.rgb16_en = 1; break; - case 0x08: svga.rgb32_en = 1; break; + case 0x02: svga.rgb16_en = 1; clock /= 2; break; // Clock / 2 for 16-bit data + case 0x04: svga.rgb24_en = 1; clock /= 3; break; // Clock / 3 for 24-bit data + case 0x06: svga.rgb16_en = 1; divisor = 2; break; // Clock rate for 16-bit data } } recompute_params_clock(divisor, (int)clock); @@ -251,6 +250,12 @@ UINT16 cirrus_gd5428_device::offset() if (svga.rgb8_en == 1) // guess off <<= 2; + if (svga.rgb16_en == 1) + off <<= 2; + if (svga.rgb24_en == 1) + off <<= 2; + if (svga.rgb32_en == 1) + off <<= 2; // popmessage("Offset: %04x %s %s ** -- actual: %04x",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",off); return off; } @@ -276,22 +281,43 @@ void cirrus_gd5428_device::start_bitblt() { if(m_blt_mode & 0x80) // colour expand { - UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs + if(m_blt_mode & 0x10) // 16-bit colour expansion / transparency width + { + // use GR0/1/10/11 background/foreground regs + UINT16 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset); - copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); - if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits) - m_blt_source_current++; + if(m_blt_dest_current & 1) + copy_pixel(pixel >> 8, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); + else + copy_pixel(pixel & 0xff, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); + if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits) + m_blt_source_current++; + } + else + { + UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs + + copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); + if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits) + m_blt_source_current++; + } } else { copy_pixel(vga.memory[m_blt_source_current % vga.svga_intf.vram_size], vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); m_blt_source_current++; } + m_blt_dest_current++; if(m_blt_mode & 0x40 && (x % 8) == 7) // 8x8 pattern - reset pattern source location { if(m_blt_mode & 0x80) // colour expand m_blt_source_current = m_blt_source + (1*(y % 8)); // patterns are linear data + else if(svga.rgb15_en || svga.rgb16_en) + { + if(m_blt_mode & 0x40 && (x % 16) == 15) + m_blt_source_current = m_blt_source + (16*(y % 8)); + } else m_blt_source_current = m_blt_source + (8*(y % 8)); } @@ -300,6 +326,11 @@ void cirrus_gd5428_device::start_bitblt() { if(m_blt_mode & 0x80) // colour expand m_blt_source_current = m_blt_source + (1*(y % 8)); // patterns are linear data + else if(svga.rgb15_en || svga.rgb16_en) + { + if(m_blt_mode & 0x40 && (x % 16) == 15) + m_blt_source_current = m_blt_source + (16*(y % 8)); + } else m_blt_source_current = m_blt_source + (8*(y % 8)); } @@ -326,11 +357,26 @@ void cirrus_gd5428_device::start_reverse_bitblt() { if(m_blt_mode & 0x80) // colour expand { + if(m_blt_mode & 0x10) // 16-bit colour expansion / transparency width + { + // use GR0/1/10/11 background/foreground regs + UINT16 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset); + + if(m_blt_dest_current & 1) + copy_pixel(pixel >> 8, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); + else + copy_pixel(pixel & 0xff, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); + if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits) + m_blt_source_current--; + } + else + { UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't decrement if a pattern (it's only 8 bits) m_blt_source_current--; + } } else { @@ -342,6 +388,11 @@ void cirrus_gd5428_device::start_reverse_bitblt() { if(m_blt_mode & 0x80) // colour expand m_blt_source_current = m_blt_source - (1*(y % 8)); // patterns are linear data + else if(svga.rgb15_en || svga.rgb16_en) + { + if(m_blt_mode & 0x40 && (x % 16) == 15) + m_blt_source_current = m_blt_source - (16*(y % 8)); + } else m_blt_source_current = m_blt_source - (8*(y % 8)); } @@ -350,6 +401,11 @@ void cirrus_gd5428_device::start_reverse_bitblt() { if(m_blt_mode & 0x80) // colour expand m_blt_source_current = m_blt_source - (1*(y % 8)); // patterns are linear data + else if(svga.rgb15_en || svga.rgb16_en) + { + if(m_blt_mode & 0x40 && (x % 16) == 15) + m_blt_source_current = m_blt_source - (16*(y % 8)); + } else m_blt_source_current = m_blt_source - (8*(y % 8)); } @@ -407,7 +463,11 @@ void cirrus_gd5428_device::blit_byte() for(x=0;x<8;x++) { - pixel = ((m_blt_system_buffer & (0x00000001 << (7-x))) >> (7-x)) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs + // use GR0/1/10/11 background/foreground regs + if(m_blt_dest_current & 1) + pixel = ((m_blt_system_buffer & (0x00000001 << (7-x))) >> (7-x)) ? m_gr11 : m_gr10; + else + pixel = ((m_blt_system_buffer & (0x00000001 << (7-x))) >> (7-x)) ? vga.gc.enable_set_reset : vga.gc.set_reset; if(m_blt_pixel_count <= m_blt_width - 1) copy_pixel(pixel,vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); m_blt_dest_current++; @@ -656,9 +716,11 @@ UINT8 cirrus_gd5428_device::cirrus_gc_reg_read(UINT8 index) break; case 0x0e: // Miscellaneous Control break; - case 0x10: // Foreground Colour Byte 1 + case 0x10: // Background Colour Byte 1 + res = m_gr10; break; - case 0x11: // Background Colour Byte 1 + case 0x11: // Foreground Colour Byte 1 + res = m_gr11; break; case 0x20: // BLT Width 0 res = m_blt_width & 0x00ff; @@ -778,9 +840,11 @@ void cirrus_gd5428_device::cirrus_gc_reg_write(UINT8 index, UINT8 data) break; case 0x0e: // Miscellaneous Control break; - case 0x10: // Foreground Colour Byte 1 + case 0x10: // Background Colour Byte 1 + m_gr10 = data; break; - case 0x11: // Background Colour Byte 1 + case 0x11: // Foreground Colour Byte 1 + m_gr11 = data; break; case 0x20: // BLT Width 0 m_blt_width = (m_blt_width & 0xff00) | data; @@ -1328,14 +1392,27 @@ WRITE8_MEMBER(cirrus_gd5428_device::mem_w) else offset &= 0xffff; + // GR0 (and GR10 in 15/16bpp modes) = background colour in write mode 5 + // GR1 (and GR11 in 15/16bpp modes) = foreground colour in write modes 4 or 5 if(vga.gc.write_mode == 4) { int i; for(i=0;i<8;i++) { - if(data & (0x01 << (7-i))) - vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; // GR1 (and GR11 in 16bpp modes) = foreground colour in write modes 4 or 5 + if(svga.rgb8_en) + { + if(data & (0x01 << (7-i))) + vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; + } + else if(svga.rgb15_en || svga.rgb16_en) + { + if(data & (0x01 << (7-i))) + { + vga.memory[((addr+offset)*16+(i*2)) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; + vga.memory[((addr+offset)*16+(i*2)+1) % vga.svga_intf.vram_size] = m_gr11; + } + } } return; } @@ -1346,10 +1423,26 @@ WRITE8_MEMBER(cirrus_gd5428_device::mem_w) for(i=0;i<8;i++) { - if(data & (0x01 << (7-i))) - vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; // GR1 (and GR11 in 16bpp modes) = foreground colour in write modes 4 or 5 - else - vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.set_reset; // GR0 (and GR10 in 16bpp modes) = background colour in write mode 5 + if(svga.rgb8_en) + { + if(data & (0x01 << (7-i))) + vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; + else + vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.set_reset; + } + else if(svga.rgb15_en || svga.rgb16_en) + { + if(data & (0x01 << (7-i))) + { + vga.memory[((addr+offset)*16+(i*2)) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; + vga.memory[((addr+offset)*16+(i*2)+1) % vga.svga_intf.vram_size] = m_gr11; + } + else + { + vga.memory[((addr+offset)*16+(i*2)) % vga.svga_intf.vram_size] = vga.gc.set_reset; + vga.memory[((addr+offset)*16+(i*2)+1) % vga.svga_intf.vram_size] = m_gr10; + } + } } return; } diff --git a/src/emu/video/clgd542x.h b/src/emu/video/clgd542x.h index 31e1876ef9e..20300d160fd 100644 --- a/src/emu/video/clgd542x.h +++ b/src/emu/video/clgd542x.h @@ -41,6 +41,8 @@ protected: UINT8 gc_bank_1; bool gc_locked; UINT8 m_lock_reg; + UINT8 m_gr10; // high byte of background colour (in 15/16bpp) + UINT8 m_gr11; // high byte of foreground colour (in 15/16bpp) UINT8 m_cr19; UINT8 m_cr1a; From 476d027582fd1fe1ce535e662161bed8f207ec65 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 10:14:02 +0200 Subject: [PATCH 075/284] mz2000: updated to use new wd fdc. fix softlist to use the correct interface. change x1_dsk to 2d_dsk and use it for the mz2000 as well. --- hash/mz2000_flop.xml | 30 ++++---- scripts/src/lib.lua | 4 +- src/lib/formats/2d_dsk.c | 41 ++++++++++ src/lib/formats/{x1_dsk.h => 2d_dsk.h} | 14 ++-- src/lib/formats/x1_dsk.c | 41 ---------- src/mess/drivers/mz2000.c | 100 ++++++++++++++----------- src/mess/drivers/x1.c | 4 +- src/mess/drivers/x1twin.c | 1 - 8 files changed, 125 insertions(+), 110 deletions(-) create mode 100644 src/lib/formats/2d_dsk.c rename src/lib/formats/{x1_dsk.h => 2d_dsk.h} (70%) delete mode 100644 src/lib/formats/x1_dsk.c diff --git a/hash/mz2000_flop.xml b/hash/mz2000_flop.xml index 694cd60c0dd..9740d9cc175 100644 --- a/hash/mz2000_flop.xml +++ b/hash/mz2000_flop.xml @@ -18,14 +18,14 @@ 2002 Toshio Fukui - + - + @@ -48,14 +48,14 @@ 2011? Toshio Fukui - + - + @@ -67,7 +67,7 @@ TF-DOS Ver2.1C (TF) 200? Toshio Fukui - + @@ -79,14 +79,14 @@ TF-DOS Ver2.1 (TF) 200? Toshio Fukui - + - + @@ -97,13 +97,13 @@ TF-DOS Ver2.0B (TS) 200? Toshio Fukui - + - + @@ -114,7 +114,7 @@ Graphic Editor III "Art Magic" 200? Toshio Fukui - + @@ -125,7 +125,7 @@ Brave 200? Toshio Fukui - + @@ -136,7 +136,7 @@ Lilas 200? Toshio Fukui - + @@ -147,7 +147,7 @@ TF-DOS Programs 1 200? Toshio Fukui - + @@ -158,7 +158,7 @@ TF-DOS Programs 2 200? Toshio Fukui - + @@ -170,7 +170,7 @@ Sharp BASIC Programs 1 200? <unknown> - + diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 788aaf18e9d..dcf4c44268e 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -114,6 +114,8 @@ project "formats" } files { + MAME_DIR .. "src/lib/formats/2d_dsk.c", + MAME_DIR .. "src/lib/formats/2d_dsk.h", MAME_DIR .. "src/lib/formats/cassimg.c", MAME_DIR .. "src/lib/formats/cassimg.h", MAME_DIR .. "src/lib/formats/flopimg.c", @@ -395,8 +397,6 @@ project "formats" MAME_DIR .. "src/lib/formats/wd177x_dsk.h", MAME_DIR .. "src/lib/formats/x07_cas.c", MAME_DIR .. "src/lib/formats/x07_cas.h", - MAME_DIR .. "src/lib/formats/x1_dsk.c", - MAME_DIR .. "src/lib/formats/x1_dsk.h", MAME_DIR .. "src/lib/formats/x1_tap.c", MAME_DIR .. "src/lib/formats/x1_tap.h", MAME_DIR .. "src/lib/formats/xdf_dsk.c", diff --git a/src/lib/formats/2d_dsk.c b/src/lib/formats/2d_dsk.c new file mode 100644 index 00000000000..7f304b4eaa0 --- /dev/null +++ b/src/lib/formats/2d_dsk.c @@ -0,0 +1,41 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + 2D + + Disk image format used by early Sharp computers + +***************************************************************************/ + +#include "2d_dsk.h" + +_2d_format::_2d_format() : wd177x_format(formats) +{ +} + +const char *_2d_format::name() const +{ + return "2d"; +} + +const char *_2d_format::description() const +{ + return "2D disk image"; +} + +const char *_2d_format::extensions() const +{ + return "2d"; +} + +const _2d_format::format _2d_format::formats[] = +{ + { + floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, + 2000, 16, 40, 2, 256, {}, 1, {}, 32, 22, 54 + }, + {} +}; + +const floppy_format_type FLOPPY_2D_FORMAT = &floppy_image_format_creator<_2d_format>; diff --git a/src/lib/formats/x1_dsk.h b/src/lib/formats/2d_dsk.h similarity index 70% rename from src/lib/formats/x1_dsk.h rename to src/lib/formats/2d_dsk.h index 0774c6bf27e..ab70b95f21a 100644 --- a/src/lib/formats/x1_dsk.h +++ b/src/lib/formats/2d_dsk.h @@ -2,7 +2,7 @@ // copyright-holders:Dirk Best /*************************************************************************** - Sharp X1 + Sharp 2D Disk image format @@ -10,15 +10,15 @@ #pragma once -#ifndef __X1_DSK_H__ -#define __X1_DSK_H__ +#ifndef __2D_DSK_H__ +#define __2D_DSK_H__ #include "wd177x_dsk.h" -class x1_format : public wd177x_format +class _2d_format : public wd177x_format { public: - x1_format(); + _2d_format(); virtual const char *name() const; virtual const char *description() const; @@ -28,6 +28,6 @@ private: static const format formats[]; }; -extern const floppy_format_type FLOPPY_X1_FORMAT; +extern const floppy_format_type FLOPPY_2D_FORMAT; -#endif // __X1_DSK_H__ +#endif // __2D_DSK_H__ diff --git a/src/lib/formats/x1_dsk.c b/src/lib/formats/x1_dsk.c deleted file mode 100644 index b6a5d1890da..00000000000 --- a/src/lib/formats/x1_dsk.c +++ /dev/null @@ -1,41 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Dirk Best -/*************************************************************************** - - Sharp X1 - - Disk image format - -***************************************************************************/ - -#include "x1_dsk.h" - -x1_format::x1_format() : wd177x_format(formats) -{ -} - -const char *x1_format::name() const -{ - return "x1"; -} - -const char *x1_format::description() const -{ - return "Sharp X1 disk image"; -} - -const char *x1_format::extensions() const -{ - return "2d"; -} - -const x1_format::format x1_format::formats[] = -{ - { - floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, - 2000, 16, 40, 2, 256, {}, 1, {}, 32, 22, 54 - }, - {} -}; - -const floppy_format_type FLOPPY_X1_FORMAT = &floppy_image_format_creator; diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c index 63c04d3b04b..7f86fd940a0 100644 --- a/src/mess/drivers/mz2000.c +++ b/src/mess/drivers/mz2000.c @@ -21,15 +21,14 @@ #include "cpu/z80/z80.h" #include "machine/z80pio.h" #include "machine/i8255.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/pit8253.h" #include "sound/beep.h" #include "sound/wave.h" #include "machine/rp5c15.h" - #include "imagedev/cassette.h" #include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" +#include "formats/2d_dsk.h" #include "formats/mz_cas.h" #define MASTER_CLOCK XTAL_17_73447MHz/5 /* TODO: was 4 MHz, but otherwise cassette won't work due of a bug with MZF support ... */ @@ -41,8 +40,13 @@ public: mz2000_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_cass(*this, "cassette"), + m_floppy(NULL), m_maincpu(*this, "maincpu"), m_mb8877a(*this, "mb8877a"), + m_floppy0(*this, "mb8877a:0"), + m_floppy1(*this, "mb8877a:1"), + m_floppy2(*this, "mb8877a:2"), + m_floppy3(*this, "mb8877a:3"), m_pit8253(*this, "pit"), m_beeper(*this, "beeper"), m_region_tvram(*this, "tvram"), @@ -68,8 +72,12 @@ public: m_io_config(*this, "CONFIG"), m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_cass; + floppy_image_device *m_floppy; + UINT8 m_ipl_enable; UINT8 m_tvram_enable; UINT8 m_gvram_enable; @@ -98,15 +106,16 @@ public: DECLARE_READ8_MEMBER(mz2000_mem_r); DECLARE_WRITE8_MEMBER(mz2000_mem_w); DECLARE_WRITE8_MEMBER(mz2000_gvram_bank_w); - DECLARE_WRITE8_MEMBER(mz2000_fdc_w); + DECLARE_WRITE8_MEMBER(floppy_select_w); + DECLARE_WRITE8_MEMBER(floppy_side_w); DECLARE_WRITE8_MEMBER(timer_w); DECLARE_WRITE8_MEMBER(mz2000_tvram_attr_w); DECLARE_WRITE8_MEMBER(mz2000_gvram_mask_w); virtual void machine_reset(); virtual void video_start(); UINT32 screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_READ8_MEMBER(mz2000_wd17xx_r); - DECLARE_WRITE8_MEMBER(mz2000_wd17xx_w); + DECLARE_READ8_MEMBER(fdc_r); + DECLARE_WRITE8_MEMBER(fdc_w); DECLARE_READ8_MEMBER(mz2000_porta_r); DECLARE_READ8_MEMBER(mz2000_portb_r); DECLARE_READ8_MEMBER(mz2000_portc_r); @@ -119,7 +128,11 @@ public: protected: required_device m_maincpu; - required_device m_mb8877a; + required_device m_mb8877a; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; required_device m_pit8253; required_device m_beeper; required_memory_region m_region_tvram; @@ -339,7 +352,7 @@ WRITE8_MEMBER(mz2000_state::mz2000_gvram_bank_w) m_gvram_bank = data & 3; } -READ8_MEMBER(mz2000_state::mz2000_wd17xx_r) +READ8_MEMBER(mz2000_state::fdc_r) { if(m_has_fdc) return m_mb8877a->read(space, offset) ^ 0xff; @@ -347,25 +360,34 @@ READ8_MEMBER(mz2000_state::mz2000_wd17xx_r) return 0xff; } -WRITE8_MEMBER(mz2000_state::mz2000_wd17xx_w) +WRITE8_MEMBER(mz2000_state::fdc_w) { if(m_has_fdc) m_mb8877a->write(space, offset, data ^ 0xff); } -WRITE8_MEMBER(mz2000_state::mz2000_fdc_w) +WRITE8_MEMBER(mz2000_state::floppy_select_w) { - switch(offset+0xdc) + switch (data & 0x03) { - case 0xdc: - m_mb8877a->set_drive(data & 3); - floppy_get_device(machine(), data & 3)->floppy_mon_w((data & 0x80) ? CLEAR_LINE : ASSERT_LINE); - floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(1,0); - break; - case 0xdd: - m_mb8877a->set_side((data & 1)); - break; + case 0: m_floppy = m_floppy0->get_device(); break; + case 1: m_floppy = m_floppy1->get_device(); break; + case 2: m_floppy = m_floppy2->get_device(); break; + case 3: m_floppy = m_floppy3->get_device(); break; } + + m_mb8877a->set_floppy(m_floppy); + + // todo: bit 2 is connected to something too... + + if (m_floppy) + m_floppy->mon_w(!BIT(data, 7)); +} + +WRITE8_MEMBER(mz2000_state::floppy_side_w) +{ + if (m_floppy) + m_floppy->ss_w(BIT(data, 0)); } WRITE8_MEMBER(mz2000_state::timer_w) @@ -396,8 +418,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(mz2000_io, AS_IO, 8, mz2000_state ) ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0xd8, 0xdb) AM_READWRITE(mz2000_wd17xx_r, mz2000_wd17xx_w) - AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2000_fdc_w) + AM_RANGE(0xd8, 0xdb) AM_READWRITE(fdc_r, fdc_w) + AM_RANGE(0xdc, 0xdc) AM_WRITE(floppy_select_w) + AM_RANGE(0xdd, 0xdd) AM_WRITE(floppy_side_w) AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write) AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("pit", pit8253_device, read, write) AM_RANGE(0xe8, 0xeb) AM_DEVREADWRITE("z80pio_1", z80pio_device, read_alt, write_alt) @@ -775,23 +798,15 @@ READ8_MEMBER(mz2000_state::mz2000_pio1_porta_r) return m_porta_latch; } -#if 0 -static LEGACY_FLOPPY_OPTIONS_START( mz2000 ) - LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -#endif -static const floppy_interface mz2000_floppy_interface = -{ - FLOPPY_STANDARD_3_5_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(default), - NULL -}; +FLOPPY_FORMATS_MEMBER( mz2000_state::floppy_formats ) + FLOPPY_2D_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( mz2000_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( mz2000, mz2000_state ) /* basic machine hardware */ @@ -818,12 +833,14 @@ static MACHINE_CONFIG_START( mz2000, mz2000_state ) MCFG_PIT8253_CLK1(31250) /* needed by "Art Magic" to boot */ MCFG_PIT8253_CLK2(31250) - MCFG_DEVICE_ADD("mb8877a", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_MB8877x_ADD("mb8877a", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mz2000_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:0", mz2000_floppies, "dd", mz2000_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:1", mz2000_floppies, "dd", mz2000_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:2", mz2000_floppies, "dd", mz2000_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:3", mz2000_floppies, "dd", mz2000_state::floppy_formats) - MCFG_SOFTWARE_LIST_ADD("flop_list","mz2000_flop") + MCFG_SOFTWARE_LIST_ADD("flop_list", "mz2000_flop") MCFG_CASSETTE_ADD( "cassette" ) MCFG_CASSETTE_FORMATS(mz700_cassette_formats) @@ -844,7 +861,6 @@ static MACHINE_CONFIG_START( mz2000, mz2000_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", mz2000) MCFG_PALETTE_ADD("palette", 8) - MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c index 8ed1dc743cd..753783ff436 100644 --- a/src/mess/drivers/x1.c +++ b/src/mess/drivers/x1.c @@ -206,7 +206,7 @@ ************************************************************************************************/ #include "includes/x1.h" -#include "formats/x1_dsk.h" +#include "formats/2d_dsk.h" #define MAIN_CLOCK XTAL_16MHz #define VDP_CLOCK XTAL_42_9545MHz @@ -2431,7 +2431,7 @@ PALETTE_INIT_MEMBER(x1_state,x1) } FLOPPY_FORMATS_MEMBER( x1_state::floppy_formats ) - FLOPPY_X1_FORMAT + FLOPPY_2D_FORMAT FLOPPY_FORMATS_END static SLOT_INTERFACE_START( x1_floppies ) diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c index b89f5e757a4..c6a14a5ac36 100644 --- a/src/mess/drivers/x1twin.c +++ b/src/mess/drivers/x1twin.c @@ -15,7 +15,6 @@ ************************************************************************************************/ #include "includes/x1.h" -#include "formats/x1_dsk.h" #include "includes/pce.h" //#include "cpu/h6280/h6280.h" From 5a9f173f08ecbc6e523b6f3b3e893034258f893d Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 12:26:43 +0200 Subject: [PATCH 076/284] mz2500: updated to use the new wd fdc. note that some d88 format disks don't load anymore since the new code verifies the track size, might be bad dumps or protected disks. --- src/mess/drivers/mz2500.c | 101 +++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c index d0f7c46a286..5f94242d745 100644 --- a/src/mess/drivers/mz2500.c +++ b/src/mess/drivers/mz2500.c @@ -49,7 +49,7 @@ #include "machine/z80pio.h" #include "machine/z80dart.h" #include "machine/i8255.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/pit8253.h" #include "sound/2203intf.h" #include "sound/beep.h" @@ -57,7 +57,6 @@ //#include "imagedev/cassette.h" #include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" #define RP5C15_TAG "rp5c15" @@ -71,6 +70,12 @@ public: m_pit(*this, "pit"), m_beeper(*this, "beeper"), m_gfxdecode(*this, "gfxdecode"), + m_fdc(*this, "mb8877a"), + m_floppy0(*this, "mb8877a:0"), + m_floppy1(*this, "mb8877a:1"), + m_floppy2(*this, "mb8877a:2"), + m_floppy3(*this, "mb8877a:3"), + m_floppy(NULL), m_palette(*this, "palette") { } @@ -79,6 +84,13 @@ public: required_device m_pit; required_device m_beeper; required_device m_gfxdecode; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; + + floppy_image_device *m_floppy = NULL; UINT8 *m_main_ram; UINT8 *m_ipl_rom; @@ -161,7 +173,6 @@ public: DECLARE_WRITE8_MEMBER(mz2500_tv_crtc_w); DECLARE_WRITE8_MEMBER(mz2500_irq_sel_w); DECLARE_WRITE8_MEMBER(mz2500_irq_data_w); - DECLARE_WRITE8_MEMBER(mz2500_fdc_w); DECLARE_READ8_MEMBER(mz2500_rom_r); DECLARE_WRITE8_MEMBER(mz2500_rom_w); DECLARE_WRITE8_MEMBER(palette4096_io_w); @@ -190,8 +201,12 @@ public: DECLARE_PALETTE_INIT(mz2500); UINT32 screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mz2500_vbl); - DECLARE_READ8_MEMBER(mz2500_wd17xx_r); - DECLARE_WRITE8_MEMBER(mz2500_wd17xx_w); + + DECLARE_READ8_MEMBER(fdc_r); + DECLARE_WRITE8_MEMBER(fdc_w); + DECLARE_WRITE8_MEMBER(floppy_select_w); + DECLARE_WRITE8_MEMBER(floppy_side_w); + DECLARE_READ8_MEMBER(mz2500_porta_r); DECLARE_READ8_MEMBER(mz2500_portb_r); DECLARE_READ8_MEMBER(mz2500_portc_r); @@ -1182,41 +1197,28 @@ WRITE8_MEMBER(mz2500_state::mz2500_irq_data_w) // popmessage("%02x %02x %02x %02x",m_irq_vector[0],m_irq_vector[1],m_irq_vector[2],m_irq_vector[3]); } -WRITE8_MEMBER(mz2500_state::mz2500_fdc_w) +WRITE8_MEMBER(mz2500_state::floppy_select_w) { - mb8877_device *fdc = machine().device("mb8877a"); - UINT8 drivenum; - switch(offset+0xdc) + switch ((data & 0x03) ^ m_fdc_reverse) { - case 0xdc: - drivenum = (data & 3) ^ m_fdc_reverse; - fdc->set_drive(drivenum); - floppy_get_device(machine(), drivenum)->floppy_mon_w((data & 0x80) ? CLEAR_LINE : ASSERT_LINE); - floppy_get_device(machine(), drivenum)->floppy_drive_set_ready_state(1,0); - break; - case 0xdd: - fdc->set_side((data & 1)); - break; + case 0: m_floppy = m_floppy0->get_device(); break; + case 1: m_floppy = m_floppy1->get_device(); break; + case 2: m_floppy = m_floppy2->get_device(); break; + case 3: m_floppy = m_floppy3->get_device(); break; } + + m_fdc->set_floppy(m_floppy); + + if (m_floppy) + m_floppy->mon_w(!BIT(data, 7)); } -#if 0 -static LEGACY_FLOPPY_OPTIONS_START( mz2500 ) - LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -#endif - -static const floppy_interface mz2500_floppy_interface = +WRITE8_MEMBER(mz2500_state::floppy_side_w) { - FLOPPY_STANDARD_3_5_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(default), - "floppy_3_5" -}; + if (m_floppy) + m_floppy->ss_w(BIT(data, 0)); +} + static ADDRESS_MAP_START(mz2500_map, AS_PROGRAM, 8, mz2500_state ) AM_RANGE(0x0000, 0x1fff) AM_READWRITE(bank0_r,bank0_w) @@ -1267,16 +1269,14 @@ WRITE8_MEMBER(mz2500_state::palette4096_io_w) m_palette->set_pen_color(pal_entry+0x10, pal4bit(m_pal[pal_entry].r), pal4bit(m_pal[pal_entry].g), pal4bit(m_pal[pal_entry].b)); } -READ8_MEMBER(mz2500_state::mz2500_wd17xx_r) +READ8_MEMBER(mz2500_state::fdc_r) { - mb8877_device *fdc = machine().device("mb8877a"); - return fdc->read(space, offset) ^ 0xff; + return m_fdc->read(space, offset) ^ 0xff; } -WRITE8_MEMBER(mz2500_state::mz2500_wd17xx_w) +WRITE8_MEMBER(mz2500_state::fdc_w) { - mb8877_device *fdc = machine().device("mb8877a"); - fdc->write(space, offset, data ^ 0xff); + m_fdc->write(space, offset, data ^ 0xff); } READ8_MEMBER(mz2500_state::mz2500_bplane_latch_r) @@ -1532,8 +1532,9 @@ static ADDRESS_MAP_START(mz2500_io, AS_IO, 8, mz2500_state ) AM_RANGE(0xcc, 0xcc) AM_READWRITE(rp5c15_8_r, rp5c15_8_w) AM_RANGE(0xce, 0xce) AM_WRITE(mz2500_dictionary_bank_w) AM_RANGE(0xcf, 0xcf) AM_WRITE(mz2500_kanji_bank_w) - AM_RANGE(0xd8, 0xdb) AM_READWRITE(mz2500_wd17xx_r, mz2500_wd17xx_w) - AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2500_fdc_w) + AM_RANGE(0xd8, 0xdb) AM_READWRITE(fdc_r, fdc_w) + AM_RANGE(0xdc, 0xdc) AM_WRITE(floppy_select_w) + AM_RANGE(0xdd, 0xdd) AM_WRITE(floppy_side_w) AM_RANGE(0xde, 0xde) AM_WRITENOP AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write) AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("pit", pit8253_device, read, write) @@ -2067,6 +2068,12 @@ WRITE_LINE_MEMBER(mz2500_state::mz2500_rtc_alarm_irq) // m_maincpu->set_input_line_and_vector(0, HOLD_LINE,drvm_irq_vector[3]); } + +static SLOT_INTERFACE_START( mz2500_floppies ) + SLOT_INTERFACE("dd", FLOPPY_35_DD) +SLOT_INTERFACE_END + + static MACHINE_CONFIG_START( mz2500, mz2500_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z80, 6000000) @@ -2101,12 +2108,14 @@ static MACHINE_CONFIG_START( mz2500, mz2500_state ) MCFG_PIT8253_CLK2(16) //CH2, used by Super MZ demo / The Black Onyx and a few others (TODO: timing of this) MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pit", pit8253_device, write_clk1)) - MCFG_DEVICE_ADD("mb8877a", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_MB8877x_ADD("mb8877a", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mz2500_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:0", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:1", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:2", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("mb8877a:3", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats) - MCFG_SOFTWARE_LIST_ADD("flop_list","mz2500") + MCFG_SOFTWARE_LIST_ADD("flop_list", "mz2500") /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) From 9a4e011f0cec672f3d7aa048e990bd5e520ebeff Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 13:54:17 +0200 Subject: [PATCH 077/284] small fix (nw) --- src/mess/drivers/mz2500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c index 5f94242d745..a7112dc8c78 100644 --- a/src/mess/drivers/mz2500.c +++ b/src/mess/drivers/mz2500.c @@ -90,7 +90,7 @@ public: required_device m_floppy2; required_device m_floppy3; - floppy_image_device *m_floppy = NULL; + floppy_image_device *m_floppy; UINT8 *m_main_ram; UINT8 *m_ipl_rom; From 64a891642013e423f24649e0582b6367c1ba7b21 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 14:24:43 +0200 Subject: [PATCH 078/284] smc777: updated to use the new wd fdc. fixed drive type & softlist. --- hash/smc777.xml | 32 ++++---- src/mess/drivers/smc777.c | 160 ++++++++++++++++---------------------- 2 files changed, 82 insertions(+), 110 deletions(-) diff --git a/hash/smc777.xml b/hash/smc777.xml index 03ec6029521..6a689237353 100644 --- a/hash/smc777.xml +++ b/hash/smc777.xml @@ -140,7 +140,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? Sony Corp. - + @@ -153,7 +153,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -166,7 +166,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -178,7 +178,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -190,7 +190,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -202,7 +202,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? Sony - + @@ -215,7 +215,7 @@ Known to be dumped, but no longer available: (If you do have any of these please Sony - + @@ -228,7 +228,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -243,7 +243,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 1987 Y. Sato - + @@ -256,7 +256,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 1987 M & M / Alines Soft - + @@ -270,7 +270,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 1987 M & M - + @@ -282,7 +282,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 1987 Kawaguchiya - + @@ -295,7 +295,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -308,7 +308,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -322,7 +322,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + @@ -334,7 +334,7 @@ Known to be dumped, but no longer available: (If you do have any of these please 198? <unknown> - + diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c index 05089f3b07d..3408d590cc5 100644 --- a/src/mess/drivers/smc777.c +++ b/src/mess/drivers/smc777.c @@ -24,11 +24,11 @@ #include "sound/sn76496.h" #include "sound/beep.h" #include "video/mc6845.h" - -#include "machine/wd17xx.h" -#include "formats/basicdsk.h" +#include "machine/wd_fdc.h" #include "imagedev/flopdrv.h" +#define MASTER_CLOCK XTAL_4_028MHz + #define mc6845_h_char_total (m_crtc_vreg[0]+1) #define mc6845_h_display (m_crtc_vreg[1]) #define mc6845_h_sync_pos (m_crtc_vreg[2]) @@ -54,15 +54,19 @@ public: m_maincpu(*this, "maincpu"), m_crtc(*this, "crtc"), m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), m_sn(*this, "sn1"), m_beeper(*this, "beeper"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette") { } required_device m_maincpu; required_device m_crtc; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; optional_device m_sn; required_device m_beeper; @@ -99,8 +103,6 @@ public: DECLARE_WRITE8_MEMBER(smc777_pcg_w); DECLARE_READ8_MEMBER(smc777_fbuf_r); DECLARE_WRITE8_MEMBER(smc777_fbuf_w); - DECLARE_READ8_MEMBER(smc777_fdc1_r); - DECLARE_WRITE8_MEMBER(smc777_fdc1_w); DECLARE_READ8_MEMBER(key_r); DECLARE_WRITE8_MEMBER(key_w); DECLARE_WRITE8_MEMBER(border_col_w); @@ -124,9 +126,14 @@ public: UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(smc777_vblank_irq); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); - DECLARE_WRITE_LINE_MEMBER(smc777_fdc_intrq_w); - DECLARE_WRITE_LINE_MEMBER(smc777_fdc_drq_w); - void check_floppy_inserted(); + + DECLARE_READ8_MEMBER(fdc_r); + DECLARE_WRITE8_MEMBER(fdc_w); + DECLARE_READ8_MEMBER(fdc_request_r); + DECLARE_WRITE8_MEMBER(floppy_select_w); + DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w); + DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); + required_device m_gfxdecode; required_device m_palette; }; @@ -379,79 +386,53 @@ WRITE8_MEMBER(smc777_state::smc777_fbuf_w) m_gvram[vram_index] = data; } - -void smc777_state::check_floppy_inserted() +READ8_MEMBER( smc777_state::fdc_r ) { - int f_num; - floppy_image_legacy *floppy; - - /* check if a floppy is there, automatically disconnect the ready line if so (HW doesn't control the ready line) */ - /* FIXME: floppy drive 1 doesn't work? */ - for(f_num=0;f_num<2;f_num++) - { - floppy = floppy_get_device(machine(), f_num)->flopimg_get_image(); - floppy_get_device(machine(), f_num)->floppy_mon_w((floppy != NULL) ? 0 : 1); - floppy_get_device(machine(), f_num)->floppy_drive_set_ready_state((floppy != NULL) ? 1 : 0,0); - } + return m_fdc->read(space, offset) ^ 0xff; } -READ8_MEMBER(smc777_state::smc777_fdc1_r) +WRITE8_MEMBER( smc777_state::fdc_w ) { - check_floppy_inserted(); - - switch(offset) - { - case 0x00: - return m_fdc->status_r(space, offset) ^ 0xff; - case 0x01: - return m_fdc->track_r(space, offset) ^ 0xff; - case 0x02: - return m_fdc->sector_r(space, offset) ^ 0xff; - case 0x03: - return m_fdc->data_r(space, offset) ^ 0xff; - case 0x04: //irq / drq status - //popmessage("%02x %02x\n",m_fdc_irq_flag,m_fdc_drq_flag); - - return (m_fdc_irq_flag ? 0x80 : 0x00) | (m_fdc_drq_flag ? 0x00 : 0x40); - } - - return 0x00; + m_fdc->write(space, offset, data ^ 0xff); } -WRITE8_MEMBER(smc777_state::smc777_fdc1_w) +READ8_MEMBER( smc777_state::fdc_request_r ) { - check_floppy_inserted(); + UINT8 data = 0; - switch(offset) - { - case 0x00: - m_fdc->command_w(space, offset,data ^ 0xff); - break; - case 0x01: - m_fdc->track_w(space, offset,data ^ 0xff); - break; - case 0x02: - m_fdc->sector_w(space, offset,data ^ 0xff); - break; - case 0x03: - m_fdc->data_w(space, offset,data ^ 0xff); - break; - case 0x04: - // ---- xxxx select floppy drive (yes, 15 of them, A to P) - m_fdc->set_drive(data & 0x01); - // m_fdc->set_side((data & 0x10)>>4); - if(data & 0xf0) - printf("floppy access %02x\n",data); - break; - } + data |= !m_fdc_drq_flag << 6; + data |= m_fdc_irq_flag << 7; + + return data; } -WRITE_LINE_MEMBER(smc777_state::smc777_fdc_intrq_w) +WRITE8_MEMBER( smc777_state::floppy_select_w ) +{ + floppy_image_device *floppy = NULL; + + // ---- xxxx select floppy drive (yes, 15 of them, A to P) + switch (data & 0x01) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + // no idea where the motor on signal is + if (floppy) + floppy->mon_w(0); + + if(data & 0xf0) + printf("floppy access %02x\n", data); +} + +WRITE_LINE_MEMBER( smc777_state::fdc_intrq_w ) { m_fdc_irq_flag = state; } -WRITE_LINE_MEMBER(smc777_state::smc777_fdc_drq_w) +WRITE_LINE_MEMBER( smc777_state::fdc_drq_w ) { m_fdc_drq_flag = state; } @@ -652,7 +633,8 @@ READ8_MEMBER(smc777_state::smc777_io_r) else if(low_offs == 0x26) { logerror("RS-232c RX %04x\n",space.device().safe_pc()); return 0xff; } else if(low_offs >= 0x28 && low_offs <= 0x2c) { logerror("FDC 2 read %02x\n",low_offs & 7); return 0xff; } else if(low_offs >= 0x2d && low_offs <= 0x2f) { logerror("RS-232c no. 2 read %02x\n",low_offs & 3); return 0xff; } - else if(low_offs >= 0x30 && low_offs <= 0x34) { return smc777_fdc1_r(space,low_offs & 7); } + else if(low_offs >= 0x30 && low_offs <= 0x33) { return fdc_r(space, low_offs & 3); } + else if(low_offs >= 0x34 && low_offs <= 0x34) { return fdc_request_r(space, 0); } else if(low_offs >= 0x35 && low_offs <= 0x37) { logerror("RS-232c no. 3 read %02x\n",low_offs & 3); return 0xff; } else if(low_offs >= 0x38 && low_offs <= 0x3b) { logerror("Cache disk unit read %02x\n",low_offs & 7); return 0xff; } else if(low_offs >= 0x3c && low_offs <= 0x3d) { logerror("RGB superimposer read %02x\n",low_offs & 1); return 0xff; } @@ -693,7 +675,8 @@ WRITE8_MEMBER(smc777_state::smc777_io_w) else if(low_offs == 0x26) { logerror("RS-232c TX %02x\n",data); } else if(low_offs >= 0x28 && low_offs <= 0x2c) { logerror("FDC 2 write %02x %02x\n",low_offs & 7,data); } else if(low_offs >= 0x2d && low_offs <= 0x2f) { logerror("RS-232c no. 2 write %02x %02x\n",low_offs & 3,data); } - else if(low_offs >= 0x30 && low_offs <= 0x34) { smc777_fdc1_w(space,low_offs & 7,data); } + else if(low_offs >= 0x30 && low_offs <= 0x33) { fdc_w(space, low_offs & 3, data); } + else if(low_offs >= 0x34 && low_offs <= 0x34) { floppy_select_w(space, 0, data); } else if(low_offs >= 0x35 && low_offs <= 0x37) { logerror("RS-232c no. 3 write %02x %02x\n",low_offs & 3,data); } else if(low_offs >= 0x38 && low_offs <= 0x3b) { logerror("Cache disk unit write %02x %02x\n",low_offs & 7,data); } else if(low_offs >= 0x3c && low_offs <= 0x3d) { logerror("RGB superimposer write %02x %02x\n",low_offs & 1,data); } @@ -1021,21 +1004,6 @@ PALETTE_INIT_MEMBER(smc777_state, smc777) } } -static LEGACY_FLOPPY_OPTIONS_START( smc777 ) - LEGACY_FLOPPY_OPTION( img, "img", "SMC70 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([70]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -static const floppy_interface smc777_floppy_interface = -{ - FLOPPY_STANDARD_5_25_SSDD, - LEGACY_FLOPPY_OPTIONS_NAME(smc777), - "floppy_5_25" -}; INTERRUPT_GEN_MEMBER(smc777_state::smc777_vblank_irq) { @@ -1044,7 +1012,10 @@ INTERRUPT_GEN_MEMBER(smc777_state::smc777_vblank_irq) } -#define MASTER_CLOCK XTAL_4_028MHz +static SLOT_INTERFACE_START( smc777_floppies ) + SLOT_INTERFACE("ssdd", FLOPPY_35_SSDD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( smc777, smc777_state ) /* basic machine hardware */ @@ -1071,15 +1042,16 @@ static MACHINE_CONFIG_START( smc777, smc777_state ) MCFG_MC6845_SHOW_BORDER_AREA(true) MCFG_MC6845_CHAR_WIDTH(8) - /* devices */ - MCFG_DEVICE_ADD("fdc", MB8876, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(smc777_state, smc777_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(smc777_state, smc777_fdc_drq_w)) + // floppy controller + MCFG_MB8876x_ADD("fdc", XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(smc777_state, fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(smc777_state, fdc_drq_w)) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(smc777_floppy_interface) + // does it really support 16 of them? + MCFG_FLOPPY_DRIVE_ADD("fdc:0", smc777_floppies, "ssdd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", smc777_floppies, "ssdd", floppy_image_device::default_floppy_formats) - MCFG_SOFTWARE_LIST_ADD("flop_list","smc777") + MCFG_SOFTWARE_LIST_ADD("flop_list", "smc777") /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") From 3e82eead53284ecb225ebb409343643cda1dcd47 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 16:39:11 +0200 Subject: [PATCH 079/284] mbc55x: updated to use the new wd fdc --- src/mess/drivers/mbc55x.c | 34 ++++++++++++++++++++++------------ src/mess/includes/mbc55x.h | 14 ++++++++++++-- src/mess/machine/mbc55x.c | 21 +++++++++++++++++++-- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/src/mess/drivers/mbc55x.c b/src/mess/drivers/mbc55x.c index 7c3017d0544..2ff26f364f6 100644 --- a/src/mess/drivers/mbc55x.c +++ b/src/mess/drivers/mbc55x.c @@ -32,12 +32,6 @@ const unsigned char mbc55x_palette[SCREEN_NO_COLOURS][3] = { 0x80,0x80,0x80 }, /* light grey */ }; -static const floppy_interface mbc55x_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSSD_35, - LEGACY_FLOPPY_OPTIONS_NAME(pc), - "floppy_5_25" -}; static ADDRESS_MAP_START(mbc55x_mem, AS_PROGRAM, 8, mbc55x_state) AM_RANGE( 0x00000, 0x0FFFF ) AM_RAMBANK(RAM_BANK00_TAG) @@ -224,6 +218,23 @@ PALETTE_INIT_MEMBER(mbc55x_state, mbc55x) } +FLOPPY_FORMATS_MEMBER( mbc55x_state::floppy_formats ) + FLOPPY_PC_FORMAT +FLOPPY_FORMATS_END + + +// MBC-550 : 1 x 5.25" disk-drive (160 KB) +// MBC-555 : 2 x 5.25" disk-drive (160 KB) +// MBC-555-2 : 2 x 5.25" disk-drive (360 KB) +// MBC-555-3 : 2 x 5.25" disk-drive (720 KB) + +static SLOT_INTERFACE_START( mbc55x_floppies ) + SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD) + SLOT_INTERFACE("dd", FLOPPY_525_DD) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END + + static MACHINE_CONFIG_START( mbc55x, mbc55x_state ) /* basic machine hardware */ MCFG_CPU_ADD(MAINCPU_TAG, I8088, 3600000) @@ -281,13 +292,12 @@ static MACHINE_CONFIG_START( mbc55x, mbc55x_state ) MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(mbc55x_state, vid_vsync_changed)) /* Backing storage */ - MCFG_DEVICE_ADD(FDC_TAG, FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(mbc55x_state, mbc55x_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(mbc55x_state, mbc55x_fdc_drq_w)) - MCFG_WD17XX_DDEN_CALLBACK(GND) + MCFG_FD1793x_ADD(FDC_TAG, XTAL_1MHz) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mbc55x_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", mbc55x_floppies, "qd", mbc55x_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", mbc55x_floppies, "qd", mbc55x_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":2", mbc55x_floppies, "", mbc55x_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":3", mbc55x_floppies, "", mbc55x_state::floppy_formats) /* Software list */ MCFG_SOFTWARE_LIST_ADD("disk_list","mbc55x") diff --git a/src/mess/includes/mbc55x.h b/src/mess/includes/mbc55x.h index fc308aeaf3e..dd47893cbc6 100644 --- a/src/mess/includes/mbc55x.h +++ b/src/mess/includes/mbc55x.h @@ -15,7 +15,7 @@ #include "machine/i8255.h" #include "machine/pit8253.h" #include "machine/pic8259.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/i8251.h" #include "sound/speaker.h" #include "video/mc6845.h" @@ -98,19 +98,29 @@ public: m_ppi(*this, PPI8255_TAG), m_pic(*this, PIC8259_TAG), m_fdc(*this, FDC_TAG), + m_floppy0(*this, FDC_TAG ":0"), + m_floppy1(*this, FDC_TAG ":1"), + m_floppy2(*this, FDC_TAG ":2"), + m_floppy3(*this, FDC_TAG ":3"), m_speaker(*this, "speaker"), m_ram(*this, RAM_TAG), m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; required_device m_crtc; required_device m_kb_uart; required_device m_pit; required_device m_ppi; required_device m_pic; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; required_device m_speaker; required_device m_ram; required_device m_palette; diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c index f2e341d5f9c..67027abacee 100644 --- a/src/mess/machine/mbc55x.c +++ b/src/mess/machine/mbc55x.c @@ -72,8 +72,25 @@ WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portb_w ) WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portc_w ) { - m_fdc->set_drive((data & 0x03)); - m_fdc->set_side(BIT(data, 2)); + floppy_image_device *floppy = NULL; + + switch (data & 0x03) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + case 2: floppy = m_floppy2->get_device(); break; + case 3: floppy = m_floppy3->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + if (floppy) + { + floppy->mon_w(0); + floppy->ss_w(BIT(data, 2)); + } + + printf("port c %02x\n", data); } /* Serial port USART, unimplemented as yet */ From b18021648e0f5b49df89405d728e5e4107cba171 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 16:44:06 +0200 Subject: [PATCH 080/284] cleanup (nw) --- src/mess/includes/mbc55x.h | 3 +-- src/mess/machine/mbc55x.c | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/mess/includes/mbc55x.h b/src/mess/includes/mbc55x.h index dd47893cbc6..d0578708939 100644 --- a/src/mess/includes/mbc55x.h +++ b/src/mess/includes/mbc55x.h @@ -149,8 +149,7 @@ public: DECLARE_WRITE_LINE_MEMBER(vid_hsync_changed); DECLARE_WRITE_LINE_MEMBER(vid_vsync_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_t2); - DECLARE_WRITE_LINE_MEMBER(mbc55x_fdc_intrq_w); - DECLARE_WRITE_LINE_MEMBER(mbc55x_fdc_drq_w); + UINT32 m_debug_machine; UINT32 m_debug_video; UINT8 m_video_mem[VIDEO_MEM_SIZE]; diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c index 67027abacee..abfff2ca144 100644 --- a/src/mess/machine/mbc55x.c +++ b/src/mess/machine/mbc55x.c @@ -89,8 +89,6 @@ WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portc_w ) floppy->mon_w(0); floppy->ss_w(BIT(data, 2)); } - - printf("port c %02x\n", data); } /* Serial port USART, unimplemented as yet */ @@ -156,13 +154,6 @@ WRITE8_MEMBER(mbc55x_state::mbc55x_disk_w) m_fdc->write(space, offset>>1, data); } -WRITE_LINE_MEMBER( mbc55x_state::mbc55x_fdc_intrq_w ) -{ -} - -WRITE_LINE_MEMBER( mbc55x_state::mbc55x_fdc_drq_w ) -{ -} /* Keyboard emulation From 0b593e25ea66f7487646043e90a9ecba57cb2839 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 17:24:56 +0200 Subject: [PATCH 081/284] z100: updated to use the new wd fdc. changes can't be verified since the system is non-working. --- src/mess/drivers/z100.c | 96 +++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 56 deletions(-) diff --git a/src/mess/drivers/z100.c b/src/mess/drivers/z100.c index f4ba50f7cac..56b1ebb5b99 100644 --- a/src/mess/drivers/z100.c +++ b/src/mess/drivers/z100.c @@ -148,10 +148,8 @@ ZDIPSW EQU 0FFH ; Configuration dip switches #include "video/mc6845.h" #include "machine/pic8259.h" #include "machine/6821pia.h" -#include "machine/wd17xx.h" - +#include "machine/wd_fdc.h" #include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" class z100_state : public driver_device { @@ -164,8 +162,13 @@ public: m_picm(*this, "pic8259_master"), m_pics(*this, "pic8259_slave"), m_fdc(*this, "z207_fdc"), + m_floppy0(*this, "z207_fdc:0"), + m_floppy1(*this, "z207_fdc:1"), + m_floppy2(*this, "z207_fdc:2"), + m_floppy3(*this, "z207_fdc:3"), m_crtc(*this, "crtc"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_floppy(NULL) { } required_device m_maincpu; @@ -173,7 +176,11 @@ public: required_device m_pia1; required_device m_picm; required_device m_pics; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; required_device m_crtc; required_device m_palette; @@ -184,8 +191,8 @@ public: DECLARE_WRITE8_MEMBER(keyb_command_w); DECLARE_WRITE8_MEMBER(z100_6845_address_w); DECLARE_WRITE8_MEMBER(z100_6845_data_w); - DECLARE_READ8_MEMBER(z207_fdc_r); - DECLARE_WRITE8_MEMBER(z207_fdc_w); + DECLARE_WRITE8_MEMBER(floppy_select_w); + DECLARE_WRITE8_MEMBER(floppy_motor_w); DECLARE_READ8_MEMBER(get_slave_ack); DECLARE_WRITE8_MEMBER(video_pia_A_w); DECLARE_WRITE8_MEMBER(video_pia_B_w); @@ -200,7 +207,8 @@ public: UINT8 m_clr_val; UINT8 m_crtc_vreg[0x100],m_crtc_index; UINT16 m_start_addr; - UINT8 m_z207_cur_drive; + + floppy_image_device *m_floppy; mc6845_device *m_mc6845; DECLARE_DRIVER_INIT(z100); @@ -350,41 +358,25 @@ WRITE8_MEMBER( z100_state::z100_6845_data_w ) m_crtc->register_w(space, offset, data); } -READ8_MEMBER( z100_state::z207_fdc_r ) +// todo: side select? + +WRITE8_MEMBER( z100_state::floppy_select_w ) { - UINT8 res; - - res = 0; - - switch(offset) + switch (data & 0x03) { - case 0: res = m_fdc->status_r(space, offset); break; - case 1: res = m_fdc->track_r(space, offset); break; - case 2: res = m_fdc->sector_r(space, offset); break; - case 3: res = m_fdc->data_r(space, offset); break; + case 0: m_floppy = m_floppy0->get_device(); break; + case 1: m_floppy = m_floppy1->get_device(); break; + case 2: m_floppy = m_floppy2->get_device(); break; + case 3: m_floppy = m_floppy3->get_device(); break; } - return res; + m_fdc->set_floppy(m_floppy); } -WRITE8_MEMBER( z100_state::z207_fdc_w ) +WRITE8_MEMBER( z100_state::floppy_motor_w ) { - switch(offset) - { - case 0: m_fdc->command_w(space, offset,data); break; - case 1: m_fdc->track_w(space, offset,data); break; - case 2: m_fdc->sector_w(space, offset,data); break; - case 3: m_fdc->data_w(space, offset,data); break; - case 4: // disk control - m_fdc->set_drive(data & 3); - m_z207_cur_drive = data & 3; - break; - case 5: // aux control - floppy_get_device(machine(), m_z207_cur_drive)->floppy_mon_w(!BIT(data, 1)); - floppy_get_device(machine(), m_z207_cur_drive)->floppy_drive_set_ready_state(data & 2,0); - break; - - } + if (m_floppy) + m_floppy->mon_w(!BIT(data, 1)); } static ADDRESS_MAP_START(z100_io, AS_IO, 8, z100_state) @@ -399,7 +391,9 @@ static ADDRESS_MAP_START(z100_io, AS_IO, 8, z100_state) // AM_RANGE (0xa4, 0xa7) gateway (reserved) // AM_RANGE (0xac, 0xad) Z-217 secondary disk controller (winchester) // AM_RANGE (0xae, 0xaf) Z-217 primary disk controller (winchester) - AM_RANGE (0xb0, 0xb7) AM_READWRITE(z207_fdc_r,z207_fdc_w) // primary (wd1797) + AM_RANGE (0xb0, 0xb3) AM_DEVREADWRITE("z207_fdc", fd1797_t, read, write) + AM_RANGE (0xb4, 0xb4) AM_WRITE(floppy_select_w) + AM_RANGE (0xb5, 0xb5) AM_WRITE(floppy_motor_w) // z-207 secondary disk controller (wd1797) // AM_RANGE (0xcd, 0xce) ET-100 CRT Controller // AM_RANGE (0xd4, 0xd7) ET-100 Trainer Parallel I/O @@ -644,22 +638,6 @@ WRITE_LINE_MEMBER( z100_state::video_pia_CB2_w ) m_clr_val = (state & 1) ? 0x00 : 0xff; } -static LEGACY_FLOPPY_OPTIONS_START( z100 ) - LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([40]) - SECTORS([16]) - SECTOR_LENGTH([256]) //up to 1024 - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -static const floppy_interface z100_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSDD_40, - LEGACY_FLOPPY_OPTIONS_NAME(z100), - "floppy_5_25" -}; - void z100_state::machine_start() { m_mc6845 = machine().device("crtc"); @@ -681,6 +659,10 @@ void z100_state::machine_reset() } } +static SLOT_INTERFACE_START( z100_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( z100, z100_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",I8088, XTAL_14_31818MHz/3) @@ -715,10 +697,12 @@ static MACHINE_CONFIG_START( z100, z100_state ) MCFG_DEVICE_ADD("pia1", PIA6821, 0) - MCFG_DEVICE_ADD("z207_fdc", FD1797, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS + MCFG_FD1797x_ADD("z207_fdc", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(z100_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("z207_fdc:0", z100_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("z207_fdc:1", z100_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("z207_fdc:2", z100_floppies, "", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("z207_fdc:3", z100_floppies, "", floppy_image_device::default_floppy_formats) MACHINE_CONFIG_END /* ROM definition */ From 875a901dc228b7568763d9e079c12eeb344ea4ab Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 18:08:37 +0200 Subject: [PATCH 082/284] bml3mp1802: updated to use the new wd fdc. changes are untested, system is not working. --- src/emu/bus/bml3/bml3mp1802.c | 69 +++++++++++++++++------------------ src/emu/bus/bml3/bml3mp1802.h | 12 ++++-- 2 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/emu/bus/bml3/bml3mp1802.c b/src/emu/bus/bml3/bml3mp1802.c index af061edbab9..860d827caa3 100644 --- a/src/emu/bus/bml3/bml3mp1802.c +++ b/src/emu/bus/bml3/bml3mp1802.c @@ -23,12 +23,9 @@ const device_type BML3BUS_MP1802 = &device_creator; -static const floppy_interface bml3_mp1802_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSDD, - LEGACY_FLOPPY_OPTIONS_NAME(default), - NULL -}; +static SLOT_INTERFACE_START( mp1802_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END WRITE_LINE_MEMBER( bml3bus_mp1802_device::bml3_wd17xx_intrq_w ) { @@ -46,11 +43,13 @@ ROM_START( mp1802 ) ROM_END MACHINE_CONFIG_FRAGMENT( mp1802 ) - MCFG_DEVICE_ADD("wd17xx", MB8866, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w)) + MCFG_MB8866x_ADD("fdc", XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w)) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_mp1802_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", mp1802_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", mp1802_floppies, "dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", mp1802_floppies, "", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", mp1802_floppies, "", floppy_image_device::default_floppy_formats) MACHINE_CONFIG_END /*************************************************************************** @@ -78,34 +77,28 @@ const rom_entry *bml3bus_mp1802_device::device_rom_region() const READ8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_r) { - return m_wd17xx->drq_r() ? 0x00 : 0x80; + return m_fdc->drq_r() ? 0x00 : 0x80; } WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w) { - int drive = data & 0x03; - int side = BIT(data, 4); - int motor = BIT(data, 3); - const char *floppy_name = NULL; - switch (drive) { - case 0: - floppy_name = FLOPPY_0; - break; - case 1: - floppy_name = FLOPPY_1; - break; - case 2: - floppy_name = FLOPPY_2; - break; - case 3: - floppy_name = FLOPPY_3; - break; + floppy_image_device *floppy = NULL; + + switch (data & 0x03) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + case 2: floppy = m_floppy2->get_device(); break; + case 3: floppy = m_floppy3->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + if (floppy) + { + floppy->mon_w(!BIT(data, 3)); + floppy->ss_w(BIT(data, 4)); } - legacy_floppy_image_device *floppy = subdevice(floppy_name); - m_wd17xx->set_drive(drive); - floppy->floppy_mon_w(!motor); - floppy->floppy_drive_set_ready_state(ASSERT_LINE, 0); - m_wd17xx->set_side(side); } @@ -116,7 +109,11 @@ WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w) bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, BML3BUS_MP1802, "Hitachi MP-1802 Floppy Controller Card", tag, owner, clock, "bml3mp1802", __FILE__), device_bml3bus_card_interface(mconfig, *this), - m_wd17xx(*this, "wd17xx") + m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), + m_floppy2(*this, "fdc:2"), + m_floppy3(*this, "fdc:3") { } @@ -134,8 +131,8 @@ void bml3bus_mp1802_device::device_start() // install into memory address_space &space_prg = machine().firstcpu->space(AS_PROGRAM); - space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_device::read),(mb8866_device*)m_wd17xx), write8_delegate(FUNC(mb8866_device::write),(mb8866_device*)m_wd17xx)); - space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this) ); + space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_t::read),(mb8866_t*)m_fdc), write8_delegate(FUNC(mb8866_t::write),(mb8866_t*)m_fdc)); + space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this)); // overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work... UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base(); memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800); diff --git a/src/emu/bus/bml3/bml3mp1802.h b/src/emu/bus/bml3/bml3mp1802.h index 6569171a199..0c4088c0d4f 100644 --- a/src/emu/bus/bml3/bml3mp1802.h +++ b/src/emu/bus/bml3/bml3mp1802.h @@ -15,7 +15,8 @@ #include "emu.h" #include "bml3bus.h" #include "imagedev/flopdrv.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" + //************************************************************************** // TYPE DEFINITIONS @@ -36,13 +37,18 @@ public: DECLARE_READ8_MEMBER(bml3_mp1802_r); DECLARE_WRITE8_MEMBER(bml3_mp1802_w); DECLARE_WRITE_LINE_MEMBER(bml3_wd17xx_intrq_w); + protected: virtual void device_start(); virtual void device_reset(); - required_device m_wd17xx; - private: + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; + UINT8 *m_rom; }; From e35d859f8b2d9b781e3cd7af659f114de3c8d050 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 1 Jun 2015 20:32:45 +0200 Subject: [PATCH 083/284] fm7: updated to use the new wd fdc --- src/mess/drivers/fm7.c | 109 +++++++++++++++++++++------------------- src/mess/includes/fm7.h | 11 +++- 2 files changed, 67 insertions(+), 53 deletions(-) diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c index 2f088103da9..f37afdb25e1 100644 --- a/src/mess/drivers/fm7.c +++ b/src/mess/drivers/fm7.c @@ -469,7 +469,7 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w) switch(offset) { case 0: - m_fdc->command_w(space, offset,data); + m_fdc->cmd_w(space, offset,data); break; case 1: m_fdc->track_w(space, offset,data); @@ -482,7 +482,8 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w) break; case 4: m_fdc_side = data & 0x01; - m_fdc->set_side(data & 0x01); + if (m_floppy) + m_floppy->ss_w(data & 0x01); logerror("FDC: wrote %02x to 0x%04x (side)\n",data,offset+0xfd18); break; case 5: @@ -493,9 +494,17 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w) } else { - m_fdc->set_drive(data & 0x03); - floppy_get_device(machine(), data & 0x03)->floppy_mon_w(!BIT(data, 7)); - floppy_get_device(machine(), data & 0x03)->floppy_drive_set_ready_state(data & 0x80,0); + switch (data & 0x01) + { + case 0: m_floppy = m_floppy0->get_device(); break; + case 1: m_floppy = m_floppy1->get_device(); break; + } + + m_fdc->set_floppy(m_floppy); + + if (m_floppy) + m_floppy->mon_w(!BIT(data, 7)); + logerror("FDC: wrote %02x to 0x%04x (drive)\n",data,offset+0xfd18); } break; @@ -2031,12 +2040,11 @@ void fm7_state::machine_reset() memset(m_video_ram, 0, sizeof(UINT8) * 0x18000); } -static const floppy_interface fm7_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(default), - "floppy_5_25" -}; + +static SLOT_INTERFACE_START( fm7_floppies ) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END + #define MCFG_ADDRESS_BANK(tag) \ MCFG_DEVICE_ADD(tag, ADDRESS_MAP_BANK, 0) \ @@ -2085,10 +2093,16 @@ static MACHINE_CONFIG_START( fm7, fm7_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("fm7_cass") - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + MCFG_SOFTWARE_LIST_ADD("cass_list","fm7_cass") + + MCFG_MB8877x_ADD("fdc", XTAL_8MHz / 8) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("flop_list","fm7_disk") MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_SLOT_OPTION_ADD( "dsjoy", DEMPA_SHINBUNSHA_JOYSTICK ) @@ -2098,11 +2112,6 @@ static MACHINE_CONFIG_START( fm7, fm7_state ) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface) - - MCFG_SOFTWARE_LIST_ADD("cass_list","fm7_cass") - MCFG_SOFTWARE_LIST_ADD("flop_list","fm7_disk") MACHINE_CONFIG_END static MACHINE_CONFIG_START( fm8, fm7_state ) @@ -2142,10 +2151,12 @@ static MACHINE_CONFIG_START( fm8, fm7_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("fm7_cass") - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + MCFG_MB8877x_ADD("fdc", XTAL_8MHz / 8) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) @@ -2154,9 +2165,6 @@ static MACHINE_CONFIG_START( fm8, fm7_state ) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface) - MACHINE_CONFIG_END static MACHINE_CONFIG_START( fm77av, fm7_state ) @@ -2218,10 +2226,17 @@ static MACHINE_CONFIG_START( fm77av, fm7_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("fm7_cass") - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("cass_list", "fm7_cass") + + MCFG_MB8877x_ADD("fdc", XTAL_8MHz / 8) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("av_flop_list", "fm77av") + MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("flop_list", "fm7_disk") MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) @@ -2230,12 +2245,6 @@ static MACHINE_CONFIG_START( fm77av, fm7_state ) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface) - - MCFG_SOFTWARE_LIST_ADD("av_flop_list","fm77av") - MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("cass_list","fm7_cass") - MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("flop_list","fm7_disk") MACHINE_CONFIG_END static MACHINE_CONFIG_START( fm11, fm7_state ) @@ -2296,10 +2305,12 @@ static MACHINE_CONFIG_START( fm11, fm7_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("fm7_cass") - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + MCFG_MB8877x_ADD("fdc", XTAL_8MHz / 8) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) @@ -2308,9 +2319,6 @@ static MACHINE_CONFIG_START( fm11, fm7_state ) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface) - MACHINE_CONFIG_END static MACHINE_CONFIG_START( fm16beta, fm7_state ) @@ -2350,10 +2358,12 @@ static MACHINE_CONFIG_START( fm16beta, fm7_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) MCFG_CASSETTE_INTERFACE("fm7_cass") - MCFG_DEVICE_ADD("fdc", MB8877, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + MCFG_MB8877x_ADD("fdc", XTAL_8MHz / 8) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats) MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) @@ -2362,9 +2372,6 @@ static MACHINE_CONFIG_START( fm16beta, fm7_state ) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") - - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface) - MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/includes/fm7.h b/src/mess/includes/fm7.h index 9e789c5fff8..35dd9efb290 100644 --- a/src/mess/includes/fm7.h +++ b/src/mess/includes/fm7.h @@ -5,7 +5,7 @@ #include "imagedev/cassette.h" #include "sound/beep.h" #include "sound/2203intf.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/bankdev.h" /* @@ -136,6 +136,9 @@ public: m_centronics(*this, "centronics"), m_cent_data_out(*this, "cent_data_out"), m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), + m_floppy(NULL), m_kanji(*this, "kanji1"), m_key1(*this, "key1"), m_key2(*this, "key2"), @@ -319,7 +322,11 @@ public: optional_device m_psg; required_device m_centronics; required_device m_cent_data_out; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + + floppy_image_device *m_floppy = NULL; void fm7_alu_mask_write(UINT32 offset, int bank, UINT8 dat); void fm7_alu_function_compare(UINT32 offset); From 46bf05c2fd15d347f0e6218e2f1e2917a1642ff1 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 1 Jun 2015 21:34:50 +0200 Subject: [PATCH 084/284] namcos86.c: preparation for save state support, switched to configured banking. Not enabled because roishtar's mcu fails spectacularly on reload (nw) --- src/emu/sound/n63701x.c | 10 ++++ src/mame/drivers/namcos86.c | 60 +++++++++++------------ src/mame/includes/namcos86.h | 58 +++++++++++----------- src/mame/video/namcos86.c | 93 ++++++++++++++---------------------- 4 files changed, 106 insertions(+), 115 deletions(-) diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c index e76db1e1fc4..db90445f0cf 100644 --- a/src/emu/sound/n63701x.c +++ b/src/emu/sound/n63701x.c @@ -47,6 +47,16 @@ namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const ch void namco_63701x_device::device_start() { m_stream = stream_alloc(0, 2, clock()/1000); + + for (int i = 0; i < 2; i++) + { + save_item(NAME(m_voices[i].select), i); + save_item(NAME(m_voices[i].playing), i); + save_item(NAME(m_voices[i].base_addr), i); + save_item(NAME(m_voices[i].position), i); + save_item(NAME(m_voices[i].volume), i); + save_item(NAME(m_voices[i].silence_counter), i); + } } diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c index 7c3c2cce60c..7449c64837c 100644 --- a/src/mame/drivers/namcos86.c +++ b/src/mame/drivers/namcos86.c @@ -183,13 +183,11 @@ TODO: WRITE8_MEMBER(namcos86_state::bankswitch1_w) { - UINT8 *base = memregion("cpu1")->base() + 0x10000; - /* if the ROM expansion module is available, don't do anything. This avoids conflict */ /* with bankswitch1_ext_w() in wndrmomo */ if (memregion("user1")->base()) return; - membank("bank1")->set_base(base + ((data & 0x03) * 0x2000)); + membank("bank1")->set_entry(data & 0x03); } WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w) @@ -198,14 +196,12 @@ WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w) if (base == 0) return; - membank("bank1")->set_base(base + ((data & 0x1f) * 0x2000)); + membank("bank1")->set_entry(data & 0x1f); } WRITE8_MEMBER(namcos86_state::bankswitch2_w) { - UINT8 *base = memregion("cpu2")->base() + 0x10000; - - membank("bank2")->set_base(base + ((data & 0x03) * 0x2000)); + membank("bank2")->set_entry(data & 0x03); } /* Stubs to pass the correct Dip Switch setup to the MCU */ @@ -222,7 +218,6 @@ READ8_MEMBER(namcos86_state::dsw0_r) rlo |= ( ioport("DSWB")->read() & 0x04 ) >> 1; rlo |= ( ioport("DSWB")->read() & 0x10 ) >> 2; rlo |= ( ioport("DSWB")->read() & 0x40 ) >> 3; - return rhi | rlo; } @@ -276,14 +271,14 @@ WRITE8_MEMBER(namcos86_state::watchdog2_w) } -WRITE8_MEMBER(namcos86_state::namcos86_coin_w) +WRITE8_MEMBER(namcos86_state::coin_w) { coin_lockout_global_w(machine(), data & 1); coin_counter_w(machine(), 0,~data & 2); coin_counter_w(machine(), 1,~data & 4); } -WRITE8_MEMBER(namcos86_state::namcos86_led_w) +WRITE8_MEMBER(namcos86_state::led_w) { set_led_status(machine(), 0,data & 0x08); set_led_status(machine(), 1,data & 0x10); @@ -320,23 +315,26 @@ WRITE8_MEMBER(namcos86_state::cus115_w) } } - -void namcos86_state::machine_reset() +void namcos86_state::machine_start() { - UINT8 *base = memregion("cpu1")->base() + 0x10000; + if (!memregion("user1")->base()) + membank("bank1")->configure_entries(0, 4, memregion("cpu1")->base() + 0x10000, 0x2000); + else + membank("bank1")->configure_entries(0, 32, memregion("user1")->base(), 0x2000); - membank("bank1")->set_base(base); + membank("bank2")->configure_entries(0, 4, memregion("cpu2")->base() + 0x10000, 0x2000); + + save_item(NAME(m_wdog)); } - static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, namcos86_state ) - AM_RANGE(0x0000, 0x1fff) AM_READWRITE(rthunder_videoram1_r,rthunder_videoram1_w) AM_SHARE("videoram1") - AM_RANGE(0x2000, 0x3fff) AM_READWRITE(rthunder_videoram2_r,rthunder_videoram2_w) AM_SHARE("videoram2") + AM_RANGE(0x0000, 0x1fff) AM_RAM AM_WRITE(videoram1_w) AM_SHARE("videoram1") + AM_RANGE(0x2000, 0x3fff) AM_RAM AM_WRITE(videoram2_w) AM_SHARE("videoram2") AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ - AM_RANGE(0x4000, 0x5fff) AM_READWRITE(rthunder_spriteram_r,rthunder_spriteram_w) + AM_RANGE(0x4000, 0x5fff) AM_RAM AM_WRITE(spriteram_w) AM_SHARE("spriteram") AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1") AM_RANGE(0x8000, 0xffff) AM_ROM @@ -346,25 +344,25 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, namcos86_state ) AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog1_w) AM_RANGE(0x8400, 0x8400) AM_WRITE(int_ack1_w) /* IRQ acknowledge */ - AM_RANGE(0x8800, 0x8fff) AM_WRITE(rthunder_tilebank_select_w) + AM_RANGE(0x8800, 0x8fff) AM_WRITE(tilebank_select_w) - AM_RANGE(0x9000, 0x9002) AM_WRITE(rthunder_scroll0_w) /* scroll + priority */ + AM_RANGE(0x9000, 0x9002) AM_WRITE(scroll0_w) /* scroll + priority */ AM_RANGE(0x9003, 0x9003) AM_WRITE(bankswitch1_w) - AM_RANGE(0x9004, 0x9006) AM_WRITE(rthunder_scroll1_w) /* scroll + priority */ + AM_RANGE(0x9004, 0x9006) AM_WRITE(scroll1_w) /* scroll + priority */ - AM_RANGE(0x9400, 0x9402) AM_WRITE(rthunder_scroll2_w) /* scroll + priority */ + AM_RANGE(0x9400, 0x9402) AM_WRITE(scroll2_w) /* scroll + priority */ // { 0x9403, 0x9403 } sub CPU rom bank select would be here - AM_RANGE(0x9404, 0x9406) AM_WRITE(rthunder_scroll3_w) /* scroll + priority */ + AM_RANGE(0x9404, 0x9406) AM_WRITE(scroll3_w) /* scroll + priority */ - AM_RANGE(0xa000, 0xa000) AM_WRITE(rthunder_backcolor_w) + AM_RANGE(0xa000, 0xa000) AM_WRITE(backcolor_w) ADDRESS_MAP_END #define CPU2_MEMORY(NAME,ADDR_SPRITE,ADDR_VIDEO1,ADDR_VIDEO2,ADDR_ROM,ADDR_BANK,ADDR_WDOG,ADDR_INT) \ static ADDRESS_MAP_START( NAME##_cpu2_map, AS_PROGRAM, 8, namcos86_state ) \ - AM_RANGE(ADDR_SPRITE+0x0000, ADDR_SPRITE+0x1fff) AM_READWRITE(rthunder_spriteram_r,rthunder_spriteram_w) AM_SHARE("spriteram") \ - AM_RANGE(ADDR_VIDEO1+0x0000, ADDR_VIDEO1+0x1fff) AM_READWRITE(rthunder_videoram1_r,rthunder_videoram1_w) \ - AM_RANGE(ADDR_VIDEO2+0x0000, ADDR_VIDEO2+0x1fff) AM_READWRITE(rthunder_videoram2_r,rthunder_videoram2_w) \ + AM_RANGE(ADDR_SPRITE+0x0000, ADDR_SPRITE+0x1fff) AM_RAM AM_WRITE(spriteram_w) AM_SHARE("spriteram") \ + AM_RANGE(ADDR_VIDEO1+0x0000, ADDR_VIDEO1+0x1fff) AM_RAM AM_WRITE(videoram1_w) AM_SHARE("videoram1") \ + AM_RANGE(ADDR_VIDEO2+0x0000, ADDR_VIDEO2+0x1fff) AM_RAM AM_WRITE(videoram2_w) AM_SHARE("videoram2") \ AM_RANGE(ADDR_ROM+0x0000, ADDR_ROM+0x1fff) AM_ROMBANK("bank2") \ AM_RANGE(0x8000, 0xffff) AM_ROM \ /* { ADDR_BANK+0x00, ADDR_BANK+0x02 } layer 2 scroll registers would be here */ \ @@ -422,8 +420,8 @@ READ8_MEMBER(namcos86_state::readFF) static ADDRESS_MAP_START( mcu_port_map, AS_IO, 8, namcos86_state ) AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ_PORT("IN2") AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READ(readFF) /* leds won't work otherwise */ - AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(namcos86_coin_w) - AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(namcos86_led_w) + AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(coin_w) + AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(led_w) ADDRESS_MAP_END @@ -1001,8 +999,8 @@ static MACHINE_CONFIG_START( hopmappy, namcos86_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(XTAL_49_152MHz/8, 384, 3+8*8, 3+44*8, 264, 2*8, 30*8) - MCFG_SCREEN_UPDATE_DRIVER(namcos86_state, screen_update_namcos86) - MCFG_SCREEN_VBLANK_DRIVER(namcos86_state, screen_eof_namcos86) + MCFG_SCREEN_UPDATE_DRIVER(namcos86_state, screen_update) + MCFG_SCREEN_VBLANK_DRIVER(namcos86_state, screen_eof) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", namcos86) diff --git a/src/mame/includes/namcos86.h b/src/mame/includes/namcos86.h index eb114022533..683e746d1b5 100644 --- a/src/mame/includes/namcos86.h +++ b/src/mame/includes/namcos86.h @@ -7,25 +7,26 @@ class namcos86_state : public driver_device public: namcos86_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_rthunder_videoram1(*this, "videoram1"), - m_rthunder_videoram2(*this, "videoram2"), - m_rthunder_spriteram(*this, "spriteram"), m_cpu1(*this, "cpu1"), m_cpu2(*this, "cpu2"), m_cus30(*this, "namco"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_rthunder_videoram1(*this, "videoram1"), + m_rthunder_videoram2(*this, "videoram2"), + m_rthunder_spriteram(*this, "spriteram") { } - UINT8 *m_spriteram; - int m_wdog; - required_shared_ptr m_rthunder_videoram1; - required_shared_ptr m_rthunder_videoram2; - required_shared_ptr m_rthunder_spriteram; required_device m_cpu1; required_device m_cpu2; required_device m_cus30; required_device m_gfxdecode; required_device m_palette; + required_shared_ptr m_rthunder_videoram1; + required_shared_ptr m_rthunder_videoram2; + required_shared_ptr m_rthunder_spriteram; + + UINT8 *m_spriteram; + int m_wdog; int m_tilebank; int m_xscroll[4]; int m_yscroll[4]; @@ -33,6 +34,7 @@ public: int m_backcolor; const UINT8 *m_tile_address_prom; int m_copy_sprites; + DECLARE_WRITE8_MEMBER(bankswitch1_w); DECLARE_WRITE8_MEMBER(bankswitch1_ext_w); DECLARE_WRITE8_MEMBER(bankswitch2_w); @@ -42,32 +44,34 @@ public: DECLARE_WRITE8_MEMBER(int_ack2_w); DECLARE_WRITE8_MEMBER(watchdog1_w); DECLARE_WRITE8_MEMBER(watchdog2_w); - DECLARE_WRITE8_MEMBER(namcos86_coin_w); - DECLARE_WRITE8_MEMBER(namcos86_led_w); + DECLARE_WRITE8_MEMBER(coin_w); + DECLARE_WRITE8_MEMBER(led_w); DECLARE_WRITE8_MEMBER(cus115_w); DECLARE_READ8_MEMBER(readFF); - DECLARE_READ8_MEMBER(rthunder_videoram1_r); - DECLARE_WRITE8_MEMBER(rthunder_videoram1_w); - DECLARE_READ8_MEMBER(rthunder_videoram2_r); - DECLARE_WRITE8_MEMBER(rthunder_videoram2_w); - DECLARE_WRITE8_MEMBER(rthunder_tilebank_select_w); - DECLARE_WRITE8_MEMBER(rthunder_scroll0_w); - DECLARE_WRITE8_MEMBER(rthunder_scroll1_w); - DECLARE_WRITE8_MEMBER(rthunder_scroll2_w); - DECLARE_WRITE8_MEMBER(rthunder_scroll3_w); - DECLARE_WRITE8_MEMBER(rthunder_backcolor_w); - DECLARE_READ8_MEMBER(rthunder_spriteram_r); - DECLARE_WRITE8_MEMBER(rthunder_spriteram_w); - DECLARE_DRIVER_INIT(namco86); + DECLARE_WRITE8_MEMBER(videoram1_w); + DECLARE_WRITE8_MEMBER(videoram2_w); + DECLARE_WRITE8_MEMBER(tilebank_select_w); + DECLARE_WRITE8_MEMBER(scroll0_w); + DECLARE_WRITE8_MEMBER(scroll1_w); + DECLARE_WRITE8_MEMBER(scroll2_w); + DECLARE_WRITE8_MEMBER(scroll3_w); + DECLARE_WRITE8_MEMBER(backcolor_w); + DECLARE_WRITE8_MEMBER(spriteram_w); + TILE_GET_INFO_MEMBER(get_tile_info0); TILE_GET_INFO_MEMBER(get_tile_info1); TILE_GET_INFO_MEMBER(get_tile_info2); TILE_GET_INFO_MEMBER(get_tile_info3); - virtual void machine_reset(); + + DECLARE_DRIVER_INIT(namco86); + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(namcos86); - UINT32 screen_update_namcos86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_eof_namcos86(screen_device &screen, bool state); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_eof(screen_device &screen, bool state); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void scroll_w(address_space &space, int offset, int data, int layer); private: inline void get_tile_info(tile_data &tileinfo,int tile_index,int layer,UINT8 *vram); diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c index 0f59c3245c9..0b2e31e3b9f 100644 --- a/src/mame/video/namcos86.c +++ b/src/mame/video/namcos86.c @@ -148,6 +148,12 @@ void namcos86_state::video_start() } m_spriteram = m_rthunder_spriteram + 0x1800; + + save_item(NAME(m_tilebank)); + save_item(NAME(m_xscroll)); + save_item(NAME(m_yscroll)); + save_item(NAME(m_backcolor)); + save_item(NAME(m_copy_sprites)); } @@ -158,29 +164,19 @@ void namcos86_state::video_start() ***************************************************************************/ -READ8_MEMBER(namcos86_state::rthunder_videoram1_r) -{ - return m_rthunder_videoram1[offset]; -} - -WRITE8_MEMBER(namcos86_state::rthunder_videoram1_w) +WRITE8_MEMBER(namcos86_state::videoram1_w) { m_rthunder_videoram1[offset] = data; m_bg_tilemap[offset/0x1000]->mark_tile_dirty((offset & 0xfff)/2); } -READ8_MEMBER(namcos86_state::rthunder_videoram2_r) -{ - return m_rthunder_videoram2[offset]; -} - -WRITE8_MEMBER(namcos86_state::rthunder_videoram2_w) +WRITE8_MEMBER(namcos86_state::videoram2_w) { m_rthunder_videoram2[offset] = data; m_bg_tilemap[2+offset/0x1000]->mark_tile_dirty((offset & 0xfff)/2); } -WRITE8_MEMBER(namcos86_state::rthunder_tilebank_select_w) +WRITE8_MEMBER(namcos86_state::tilebank_select_w) { int bit = BIT(offset,10); if (m_tilebank != bit) @@ -191,53 +187,46 @@ WRITE8_MEMBER(namcos86_state::rthunder_tilebank_select_w) } } -static void scroll_w(address_space &space, int offset, int data, int layer) +void namcos86_state::scroll_w(address_space &space, int offset, int data, int layer) { - namcos86_state *state = space.machine().driver_data(); switch (offset) { case 0: - state->m_xscroll[layer] = (state->m_xscroll[layer]&0xff)|(data<<8); + m_xscroll[layer] = (m_xscroll[layer]&0xff)|(data<<8); break; case 1: - state->m_xscroll[layer] = (state->m_xscroll[layer]&0xff00)|data; + m_xscroll[layer] = (m_xscroll[layer]&0xff00)|data; break; case 2: - state->m_yscroll[layer] = data; + m_yscroll[layer] = data; break; } } -WRITE8_MEMBER(namcos86_state::rthunder_scroll0_w) +WRITE8_MEMBER(namcos86_state::scroll0_w) { scroll_w(space,offset,data,0); } -WRITE8_MEMBER(namcos86_state::rthunder_scroll1_w) +WRITE8_MEMBER(namcos86_state::scroll1_w) { scroll_w(space,offset,data,1); } -WRITE8_MEMBER(namcos86_state::rthunder_scroll2_w) +WRITE8_MEMBER(namcos86_state::scroll2_w) { scroll_w(space,offset,data,2); } -WRITE8_MEMBER(namcos86_state::rthunder_scroll3_w) +WRITE8_MEMBER(namcos86_state::scroll3_w) { scroll_w(space,offset,data,3); } -WRITE8_MEMBER(namcos86_state::rthunder_backcolor_w) +WRITE8_MEMBER(namcos86_state::backcolor_w) { m_backcolor = data; } - -READ8_MEMBER(namcos86_state::rthunder_spriteram_r) -{ - return m_rthunder_spriteram[offset]; -} - -WRITE8_MEMBER(namcos86_state::rthunder_spriteram_w) +WRITE8_MEMBER(namcos86_state::spriteram_w) { m_rthunder_spriteram[offset] = data; @@ -273,17 +262,16 @@ sprite format: 15 xxxxxxxx Y position */ -static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void namcos86_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - namcos86_state *state = screen.machine().driver_data(); - const UINT8 *source = &state->m_spriteram[0x0800-0x20]; /* the last is NOT a sprite */ - const UINT8 *finish = &state->m_spriteram[0]; - gfx_element *gfx = state->m_gfxdecode->gfx(2); + const UINT8 *source = &m_spriteram[0x0800-0x20]; /* the last is NOT a sprite */ + const UINT8 *finish = &m_spriteram[0]; + gfx_element *gfx = m_gfxdecode->gfx(2); - int sprite_xoffs = state->m_spriteram[0x07f5] + ((state->m_spriteram[0x07f4] & 1) << 8); - int sprite_yoffs = state->m_spriteram[0x07f7]; + int sprite_xoffs = m_spriteram[0x07f5] + ((m_spriteram[0x07f4] & 1) << 8); + int sprite_yoffs = m_spriteram[0x07f7]; - int bank_sprites = state->m_gfxdecode->gfx(2)->elements() / 8; + int bank_sprites = m_gfxdecode->gfx(2)->elements() / 8; while (source >= finish) { @@ -311,7 +299,7 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect sx += sprite_xoffs; sy -= sprite_yoffs; - if (state->flip_screen()) + if (flip_screen()) { sx = -sx - sizex; sy = -sy - sizey; @@ -337,10 +325,8 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect void namcos86_state::set_scroll(int layer) { - int scrollx,scrolly; - - scrollx = m_xscroll[layer]; - scrolly = m_yscroll[layer]; + int scrollx = m_xscroll[layer]; + int scrolly = m_yscroll[layer]; if (flip_screen()) { scrollx = -scrollx; @@ -351,10 +337,8 @@ void namcos86_state::set_scroll(int layer) } -UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 namcos86_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int layer; - /* flip screen is embedded in the sprite control registers */ flip_screen_set(m_spriteram[0x07f6] & 1); set_scroll(0); @@ -366,11 +350,9 @@ UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind1 bitmap.fill(m_gfxdecode->gfx(0)->colorbase() + 8*m_backcolor+7, cliprect); - for (layer = 0;layer < 8;layer++) + for (int layer = 0;layer < 8;layer++) { - int i; - - for (i = 3;i >= 0;i--) + for (int i = 3;i >= 0;i--) { if (((m_xscroll[i] & 0x0e00) >> 9) == layer) m_bg_tilemap[i]->draw(screen, bitmap, cliprect, 0,layer,0); @@ -382,20 +364,17 @@ UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind1 } -void namcos86_state::screen_eof_namcos86(screen_device &screen, bool state) +void namcos86_state::screen_eof(screen_device &screen, bool state) { // rising edge if (state) { if (m_copy_sprites) { - UINT8 *spriteram = m_spriteram; - int i,j; - - for (i = 0;i < 0x800;i += 16) + for (int i = 0;i < 0x800;i += 16) { - for (j = 10;j < 16;j++) - spriteram[i+j] = spriteram[i+j - 6]; + for (int j = 10;j < 16;j++) + m_spriteram[i+j] = m_spriteram[i+j - 6]; } m_copy_sprites = 0; From 7c45fecc12c69cd01cc99c8ba03fe8441679a0f6 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 1 Jun 2015 22:50:36 +0200 Subject: [PATCH 085/284] added cfrogger i/o handlers --- src/emu/cpu/melps4/m58846.c | 1 + src/emu/cpu/melps4/melps4.c | 7 +-- src/emu/cpu/melps4/melps4.h | 11 ++--- src/emu/cpu/melps4/melps4op.inc | 10 ++--- src/mess/drivers/hh_melps4.c | 76 ++++++++++++++++++++++++++++++++- 5 files changed, 88 insertions(+), 17 deletions(-) diff --git a/src/emu/cpu/melps4/m58846.c b/src/emu/cpu/melps4/m58846.c index fb5760cabaa..ac14baf797d 100644 --- a/src/emu/cpu/melps4/m58846.c +++ b/src/emu/cpu/melps4/m58846.c @@ -111,6 +111,7 @@ void m58846_device::execute_one() case 0x0b: op_ose(); break; case 0x0c: op_tya(); break; case 0x0f: op_cma(); break; + // 0x18 RAR undocumented? case 0x10: op_cls(); break; case 0x11: op_clds(); break; diff --git a/src/emu/cpu/melps4/melps4.c b/src/emu/cpu/melps4/melps4.c index 4e9305b2cc5..5fdd2b1cab6 100644 --- a/src/emu/cpu/melps4/melps4.c +++ b/src/emu/cpu/melps4/melps4.c @@ -23,11 +23,13 @@ *M58496: 72-pin QFP CMOS, 2Kx10 ROM, 128x4 internal + 256x4 external RAM, 1 timer, low-power *M58497: almost same as M58496 - MELPS 760 subfamily has more differences, document them when needed. + MELPS 760 family has more differences, document them when needed. + MELPS 720 family as well References: - - 1982 Mitsubishi LSI Data Book + - 1980 and 1982 Mitsubishi LSI Data Books + - M34550Mx-XXXFP datasheet (this one is MELPS 720 family) */ @@ -82,7 +84,6 @@ void melps4_cpu_device::device_start() m_read_d.resolve_safe(0); m_read_s.resolve_safe(0); m_read_f.resolve_safe(0); - m_read_t.resolve_safe(0); m_write_d.resolve_safe(); m_write_s.resolve_safe(); diff --git a/src/emu/cpu/melps4/melps4.h b/src/emu/cpu/melps4/melps4.h index 6fcc27c4364..023b0b9ba02 100644 --- a/src/emu/cpu/melps4/melps4.h +++ b/src/emu/cpu/melps4/melps4.h @@ -44,20 +44,18 @@ #define MCFG_MELPS4_WRITE_U_CB(_devcb) \ melps4_cpu_device::set_write_u_callback(*device, DEVCB_##_devcb); -// T timer I/O pin -#define MCFG_MELPS4_READ_T_CB(_devcb) \ - melps4_cpu_device::set_read_t_callback(*device, DEVCB_##_devcb); +// T timer I/O pin (use execute_set_input for reads) #define MCFG_MELPS4_WRITE_T_CB(_devcb) \ melps4_cpu_device::set_write_t_callback(*device, DEVCB_##_devcb); #define MELPS4_PORTD_CLR 16 -// only generic ports here (S is 8-bit) +// only generic ports here enum { MELPS4_PORTS = 0, - MELPS4_PORTF = 2, + MELPS4_PORTF, MELPS4_PORTG, MELPS4_PORTU }; @@ -114,7 +112,6 @@ public: , m_read_d(*this) , m_read_s(*this) , m_read_f(*this) - , m_read_t(*this) , m_write_d(*this) , m_write_s(*this) , m_write_f(*this) @@ -128,7 +125,6 @@ public: template static devcb_base &set_read_d_callback(device_t &device, _Object object) { return downcast(device).m_read_d.set_callback(object); } template static devcb_base &set_read_s_callback(device_t &device, _Object object) { return downcast(device).m_read_s.set_callback(object); } template static devcb_base &set_read_f_callback(device_t &device, _Object object) { return downcast(device).m_read_f.set_callback(object); } - template static devcb_base &set_read_t_callback(device_t &device, _Object object) { return downcast(device).m_read_t.set_callback(object); } template static devcb_base &set_write_d_callback(device_t &device, _Object object) { return downcast(device).m_write_d.set_callback(object); } template static devcb_base &set_write_s_callback(device_t &device, _Object object) { return downcast(device).m_write_s.set_callback(object); } @@ -222,7 +218,6 @@ protected: devcb_read16 m_read_d; devcb_read8 m_read_s; devcb_read8 m_read_f; - devcb_read_line m_read_t; devcb_write16 m_write_d; devcb_write8 m_write_s; diff --git a/src/emu/cpu/melps4/melps4op.inc b/src/emu/cpu/melps4/melps4op.inc index 46780efb616..476de900e93 100644 --- a/src/emu/cpu/melps4/melps4op.inc +++ b/src/emu/cpu/melps4/melps4op.inc @@ -419,13 +419,13 @@ void melps4_cpu_device::op_tab2() void melps4_cpu_device::op_tva() { // TVA: transfer A to timer control V - op_illegal(); + m_v = m_a; } void melps4_cpu_device::op_twa() { // TWA: transfer A to timer control W - op_illegal(); + m_w = m_a; } void melps4_cpu_device::op_snz1() @@ -547,19 +547,19 @@ void melps4_cpu_device::op_clds() void melps4_cpu_device::op_sd() { - // SD: set port D bit designated by Y + // SD: set port D pin designated by Y write_d_pin(m_y, 1); } void melps4_cpu_device::op_rd() { - // RD: reset port D bit designated by Y + // RD: reset port D pin designated by Y write_d_pin(m_y, 0); } void melps4_cpu_device::op_szd() { - // SZD: skip next if port D bit designated by Y is 0 + // SZD: skip next if port D pin designated by Y is 0 m_skip = !read_d_pin(m_y); } diff --git a/src/mess/drivers/hh_melps4.c b/src/mess/drivers/hh_melps4.c index 737f937b4f8..1aaec668170 100644 --- a/src/mess/drivers/hh_melps4.c +++ b/src/mess/drivers/hh_melps4.c @@ -29,7 +29,7 @@ public: // devices required_device m_maincpu; - optional_ioport_array<2> m_inp_matrix; // max 2 + optional_ioport_array<4> m_inp_matrix; // max 4 optional_device m_speaker; // misc common @@ -226,20 +226,94 @@ public: : hh_melps4_state(mconfig, type, tag) { } + void prepare_display(); + DECLARE_WRITE8_MEMBER(plate_w); + DECLARE_WRITE16_MEMBER(grid_w); + DECLARE_WRITE_LINE_MEMBER(speaker_w); + DECLARE_READ8_MEMBER(input_r); + + DECLARE_INPUT_CHANGED_MEMBER(reset_button); }; // handlers +void cfrogger_state::prepare_display() +{ + UINT16 grid = BITSWAP16(m_grid,15,14,13,12,0,1,2,3,4,5,6,7,8,9,10,11); + UINT16 plate = BITSWAP16(m_plate,12,4,13,5,14,6,15,7,3,11,2,10,1,9,0,8); + display_matrix(16, 12, plate, grid); +} + +WRITE8_MEMBER(cfrogger_state::plate_w) +{ + // Sx,Fx,Gx: vfd matrix plate + int mask = (offset == MELPS4_PORTS) ? 0xff : 0xf; // port S is 8-bit + int shift = (offset == MELPS4_PORTS) ? 0 : (offset + 1) * 4; + m_plate = (m_plate & ~(mask << shift)) | (data << shift); + prepare_display(); + + // F0,F1: input mux + m_inp_mux = m_plate >> 8 & 3; +} + +WRITE16_MEMBER(cfrogger_state::grid_w) +{ + // D0-D11: vfd matrix grid + m_grid = data; + prepare_display(); +} + +WRITE_LINE_MEMBER(cfrogger_state::speaker_w) +{ + // T: speaker out + m_speaker->level_w(state); +} + +READ8_MEMBER(cfrogger_state::input_r) +{ + // K0,K1: multiplexed inputs + // K2: N/C + // K3: fixed input + return (m_inp_matrix[2]->read() & 8) | (read_inputs(2) & 3); +} + // config static INPUT_PORTS_START( cfrogger ) + PORT_START("IN.0") // F0 port K + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + + PORT_START("IN.1") // F1 port K + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + + PORT_START("IN.2") // K3 + PORT_CONFNAME( 0x08, 0x00, "Skill Level" ) + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x08, "2" ) + + PORT_START("IN.3") // fake + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_MEMBER(DEVICE_SELF, cfrogger_state, reset_button, NULL) INPUT_PORTS_END +INPUT_CHANGED_MEMBER(cfrogger_state::reset_button) +{ + // reset button is directly tied to MCU reset pin + m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); +} + + static MACHINE_CONFIG_START( cfrogger, cfrogger_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M58846, XTAL_600kHz) + MCFG_MELPS4_WRITE_S_CB(WRITE8(cfrogger_state, plate_w)) + MCFG_MELPS4_WRITE_F_CB(WRITE8(cfrogger_state, plate_w)) + MCFG_MELPS4_WRITE_G_CB(WRITE8(cfrogger_state, plate_w)) + MCFG_MELPS4_WRITE_D_CB(WRITE16(cfrogger_state, grid_w)) + MCFG_MELPS4_WRITE_T_CB(WRITELINE(cfrogger_state, speaker_w)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_melps4_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_melps4_test) From 00026ec09529348868b1c7501515becb09161e93 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jun 2015 00:05:38 +0200 Subject: [PATCH 086/284] small correction --- scripts/target/mame/nl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/target/mame/nl.lua b/scripts/target/mame/nl.lua index 86aebc37245..2ed0cae3e19 100644 --- a/scripts/target/mame/nl.lua +++ b/scripts/target/mame/nl.lua @@ -76,7 +76,7 @@ BUSES["CENTRONICS"] = true -------------------------------------------------- -- This is the list of files that are necessary -- for building all of the drivers referenced --- in tiny.lst +-- in nl.lst -------------------------------------------------- function createProjects_mame_nl(_target, _subtarget) From 3ae2668e4f852cda6a97e1be39202747294324da Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 2 Jun 2015 10:58:14 +0200 Subject: [PATCH 087/284] swtpc09: updated to use the new wd fdc. flex_dsk.c currently doesn't support the uniflex format and the flex disks i found don't seem to work on this driver, but they at least load a sector from disk and try to execute it. this driver really needs to use slot devices for each of its controller cards. --- src/mess/drivers/swtpc09.c | 100 +++++++---------------- src/mess/includes/swtpc09.h | 15 +++- src/mess/machine/swtpc09.c | 157 +++++++++--------------------------- 3 files changed, 82 insertions(+), 190 deletions(-) diff --git a/src/mess/drivers/swtpc09.c b/src/mess/drivers/swtpc09.c index c5f0c9868aa..df533c1f3f4 100644 --- a/src/mess/drivers/swtpc09.c +++ b/src/mess/drivers/swtpc09.c @@ -25,7 +25,7 @@ #include "emu.h" #include "includes/swtpc09.h" - +#include "formats/flex_dsk.h" /************************************************************************** @@ -70,64 +70,20 @@ ADDRESS_MAP_END static INPUT_PORTS_START( swtpc09 ) INPUT_PORTS_END -static LEGACY_FLOPPY_OPTIONS_START(swtpc09) - LEGACY_FLOPPY_OPTION(dsdd40, "dsk", "flex 40 trks ds dd 5.25", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([36]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(ssdd40, "dsk", "flex 40 trks ss dd 5.25 ", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([25]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(sssd40, "dsk", "flex 40 trks ss sd 5.25", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([10]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(sssd35, "dsk", "flex 35 trks ss sd 5.25", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([35]) - SECTORS([10]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(flex144M, "dsk", "flex 1.44mb disk from swtpc emu", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([80]) - SECTORS([72]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(flexdssd8inch, "dsk", "Flex 8 inch ds sd floppy image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([30]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(uniflexdssd8inch, "dsk", "UNIFlex 8 inch ds sd floppy image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([16]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(uniflexdsdd8inch, "dsk", "UNIFlex 8 inch ds dd floppy image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([32]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END +FLOPPY_FORMATS_MEMBER( swtpc09_state::floppy_formats ) + FLOPPY_FLEX_FORMAT +FLOPPY_FORMATS_END - -static const floppy_interface swtpc09_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(swtpc09), - NULL -}; +// todo: implement floppy controller cards as slot devices and do this properly +static SLOT_INTERFACE_START( swtpc09_floppies ) + SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) // flex 40 trks ss sd 5.25 + SLOT_INTERFACE("sssd35", FLOPPY_525_SSSD_35T) // flex 35 trks ss sd 5.25 + SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD) // flex 40 trks ss dd 5.25 + SLOT_INTERFACE("dd", FLOPPY_525_DD) // flex 40 trks ds dd 5.25 + SLOT_INTERFACE("8dssd", FLOPPY_8_DSSD) // UNIFlex 8 inch ds sd + SLOT_INTERFACE("8dsdd", FLOPPY_8_DSDD) // UNIFlex 8 inch ds dd + SLOT_INTERFACE("35hd", FLOPPY_35_HD) // flex 1.44mb disk from swtpc emu (emulator only?) +SLOT_INTERFACE_END WRITE_LINE_MEMBER(swtpc09_state::write_acia_clock) { @@ -171,12 +127,14 @@ static MACHINE_CONFIG_START( swtpc09, swtpc09_state ) MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock)) - MCFG_DEVICE_ADD("fdc", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_drq_w)) + MCFG_FD1793x_ADD("fdc", XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_drq_w)) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) MACHINE_CONFIG_END /* MPU09, MPID, MPS2 DC4 PIAIDE*/ @@ -210,10 +168,12 @@ static MACHINE_CONFIG_START( swtpc09i, swtpc09_state ) MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock)) - MCFG_DEVICE_ADD("fdc", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_FD1793x_ADD("fdc", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) MCFG_DEVICE_ADD("piaide", PIA6821, 0) @@ -258,10 +218,12 @@ static MACHINE_CONFIG_START( swtpc09d3, swtpc09_state ) MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock)) - MCFG_DEVICE_ADD("fdc", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_FD1793x_ADD("fdc", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", swtpc09_floppies, "dd", swtpc09_state::floppy_formats) MCFG_DEVICE_ADD("via", VIA6522, XTAL_4MHz / 4) MCFG_VIA6522_READPA_HANDLER(READ8(swtpc09_state, dmf3_via_read_porta)) diff --git a/src/mess/includes/swtpc09.h b/src/mess/includes/swtpc09.h index f1c8a0895d4..de0b27288a5 100644 --- a/src/mess/includes/swtpc09.h +++ b/src/mess/includes/swtpc09.h @@ -12,10 +12,9 @@ #include "emu.h" #include "cpu/m6809/m6809.h" #include "video/generic.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "formats/basicdsk.h" #include "imagedev/flopdrv.h" -#include "machine/wd17xx.h" #include "machine/6840ptm.h" #include "machine/6821pia.h" #include "machine/6850acia.h" @@ -38,17 +37,27 @@ public: m_ptm(*this, "ptm"), m_acia(*this, "acia"), m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), + m_floppy2(*this, "fdc:2"), + m_floppy3(*this, "fdc:3"), m_via(*this, "via"), m_piaide(*this, "piaide"), m_harddisk(*this, "harddisk"), m_ide(*this, "ide") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; required_device m_pia; required_device m_ptm; required_device m_acia; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_floppy2; + required_device m_floppy3; optional_device m_via; optional_device m_piaide; optional_device m_harddisk; diff --git a/src/mess/machine/swtpc09.c b/src/mess/machine/swtpc09.c index 719eb29ce0c..29bae501462 100644 --- a/src/mess/machine/swtpc09.c +++ b/src/mess/machine/swtpc09.c @@ -126,52 +126,22 @@ WRITE8_MEMBER ( swtpc09_state::dmf2_control_reg_w ) { LOG(("swtpc09_dmf2_control_reg_w $%02X\n", data)); - switch (data & 0x0F) + floppy_image_device *floppy = NULL; + + if (!BIT(data, 0)) floppy = m_floppy0->get_device(); + if (!BIT(data, 1)) floppy = m_floppy1->get_device(); + if (!BIT(data, 2)) floppy = m_floppy2->get_device(); + if (!BIT(data, 3)) floppy = m_floppy3->get_device(); + + m_fdc->set_floppy(floppy); + + if (floppy) { - case 0x0e: - m_fdc->set_drive(0); - // need to set drive ready as sw checks before doing anything - machine().device("floppy0")->floppy_drive_set_ready_state(1,0); - break; - case 0x0d: - m_fdc->set_drive(1); - machine().device("floppy1")->floppy_drive_set_ready_state(1,0); - break; - - case 0x0b: - m_fdc->set_drive(2); - machine().device("floppy2")->floppy_drive_set_ready_state(1,0); - break; - - case 0x07: - m_fdc->set_drive(3); - machine().device("floppy3")->floppy_drive_set_ready_state(1,0); - break; - - default: - break; - } - - // ignore side select in emulation due to sector numbering - ////side select - //if (!(data & 0x10)) { - // wd17xx_set_side(fdc, 1); - //} - //if (data & 0x10) { - // wd17xx_set_side(fdc, 0); - //} - - - /* bit 5 dden select */ - - if (!(data & 0x20)) { - m_fdc->dden_w(0); - LOG(("Density single\n")); - } - if (data & 0x20) { - m_fdc->dden_w(1); - LOG(("Density double\n")); + floppy->mon_w(0); + floppy->ss_w(!BIT(data, 4)); } + + m_fdc->dden_w(!BIT(data, 5)); } /* FDC controller dma transfer */ @@ -384,52 +354,22 @@ WRITE8_MEMBER ( swtpc09_state::dmf3_control_reg_w ) { LOG(("swtpc09_dmf3_control_reg_w $%02X\n", data)); - switch (data & 0x0F) + floppy_image_device *floppy = NULL; + + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); + if (BIT(data, 2)) floppy = m_floppy2->get_device(); + if (BIT(data, 3)) floppy = m_floppy3->get_device(); + + m_fdc->set_floppy(floppy); + + if (floppy) { - case 0x01: - m_fdc->set_drive(0); - // need to set drive ready as sw checks before doing anything - machine().device("floppy0")->floppy_drive_set_ready_state(1,0); - break; - case 0x02: - m_fdc->set_drive(1); - machine().device("floppy1")->floppy_drive_set_ready_state(1,0); - break; - - case 0x04: - m_fdc->set_drive(2); - machine().device("floppy2")->floppy_drive_set_ready_state(1,0); - break; - - case 0x08: - m_fdc->set_drive(3); - machine().device("floppy3")->floppy_drive_set_ready_state(1,0); - break; - - default: - break; - } - - // ignore side select in emulation due to sector numbering - ////side select - //if (!(data & 0x10)) { - // wd17xx_set_side(fdc, 1); - //} - //if (data & 0x10) { - // wd17xx_set_side(fdc, 0); - //} - - - /* bit 5 dden select */ - - if (data & 0x20) { - m_fdc->dden_w(0); - LOG(("Density single\n")); - } - if (!(data & 0x20)) { - m_fdc->dden_w(1); - LOG(("Density double\n")); + floppy->mon_w(0); + floppy->ss_w(BIT(data, 4)); } + + m_fdc->dden_w(BIT(data, 5)); } // DC4 drive select @@ -438,33 +378,14 @@ WRITE8_MEMBER ( swtpc09_state::dc4_control_reg_w ) { LOG(("swtpc09_dc4_control_reg_w $%02X\n", data)); - switch (data & 0x03) - { - case 0x00: - m_fdc->set_drive(0); - // need to set drive ready as sw checks before doing anything - machine().device("floppy0")->floppy_drive_set_ready_state(1,0); - break; - case 0x01: - m_fdc->set_drive(1); - machine().device("floppy1")->floppy_drive_set_ready_state(1,0); - break; + floppy_image_device *floppy = NULL; - case 0x02: - m_fdc->set_drive(2); - machine().device("floppy2")->floppy_drive_set_ready_state(1,0); - break; + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); + if (BIT(data, 2)) floppy = m_floppy2->get_device(); + if (BIT(data, 3)) floppy = m_floppy3->get_device(); - case 0x03: - m_fdc->set_drive(3); - machine().device("floppy3")->floppy_drive_set_ready_state(1,0); - break; - - default: - break; - } - - // ignore side select in emulation due to sector numbering + m_fdc->set_floppy(floppy); } @@ -537,7 +458,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w) address_space &mem = m_maincpu->space(AS_PROGRAM); - fd1793_device *fdc = machine().device("fdc"); + fd1793_t *fdc = machine().device("fdc"); pia6821_device *pia = machine().device("pia"); ptm6840_device *ptm = machine().device("ptm"); acia6850_device *acia = machine().device("acia"); @@ -574,7 +495,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w) mem.install_readwrite_handler(logical_address+0x004, logical_address+0x004, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w),acia)); mem.install_readwrite_handler(logical_address+0x005, logical_address+0x005, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w),acia)); mem.install_write_handler(logical_address+0x014, logical_address+0x014, write8_delegate(FUNC(swtpc09_state::dc4_control_reg_w),this)); - mem.install_readwrite_handler(logical_address+0x018, logical_address+0x01b, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc)); + mem.install_readwrite_handler(logical_address+0x018, logical_address+0x01b, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc)); //mem.nop_readwrite(logical_address+0x01c, logical_address+0x05f); mem.install_readwrite_handler(logical_address+0x060, logical_address+0x06f, read8_delegate(FUNC(pia6821_device::read), piaide), write8_delegate(FUNC(pia6821_device::write), piaide)); //mem.nop_readwrite(logical_address+0x070, logical_address+0x07f); @@ -598,7 +519,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w) if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2) // if DMF2 conroller this is the map { mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this)); - mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc)); + mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc)); mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this)); mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this)); //mem.nop_readwrite(logical_address+0x042, logical_address+0x7ff); @@ -608,7 +529,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w) else if (m_system_type == FLEX_DC4_PIAIDE) // 2k ram for piaide on s09 board { //mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this)); - //mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc)); + //mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc)); //mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this)); //mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this)); mem.install_ram(logical_address+0x000, logical_address+0x7ff, &RAM[0xf000]); @@ -618,7 +539,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w) else // assume DMF3 controller { mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this)); - mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc)); + mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc)); mem.install_readwrite_handler(logical_address+0x024, logical_address+0x024, read8_delegate(FUNC(swtpc09_state::dmf3_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_control_reg_w),this)); mem.install_readwrite_handler(logical_address+0x025, logical_address+0x025, read8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_w),this)); //mem.nop_readwrite(logical_address+0x030, logical_address+0x03f); From 99b58a5c0c010ebac2c7430bdd24699244c769b9 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 11:27:11 +0200 Subject: [PATCH 088/284] gameboy.c: improved accuracy of the emulation for MBC2 games [Tauwasser] out of whatsnew: also improved the name of some flags, clarifying their meaning. --- src/emu/bus/gameboy/mbc.c | 33 +++++++++++++++------------------ src/emu/bus/gameboy/mbc.h | 4 ++-- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/emu/bus/gameboy/mbc.c b/src/emu/bus/gameboy/mbc.c index b6f31714a3a..4c0a81459b6 100644 --- a/src/emu/bus/gameboy/mbc.c +++ b/src/emu/bus/gameboy/mbc.c @@ -368,8 +368,7 @@ WRITE8_MEMBER(gb_rom_mbc1_device::write_bank) m_ram_bank = data & 0x3; break; case 0x6000: // MBC1 Mode Register - default: - m_mode = (data & 0x1) ? MODE_4M_256k : MODE_16M_8k; + m_mode = (data & 0x1) ? MODE_4M_256k : MODE_16M_64k; break; } } @@ -399,31 +398,29 @@ WRITE8_MEMBER(gb_rom_mbc1_device::write_ram) READ8_MEMBER(gb_rom_mbc2_device::read_rom) { - if (offset < 0x4000) - return m_rom[rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)]; - else + if (offset & 0x4000) /* RB1 */ return m_rom[rom_bank_map[m_latch_bank2] * 0x4000 + (offset & 0x3fff)]; + else /* RB0 */ + return m_rom[rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)]; } WRITE8_MEMBER(gb_rom_mbc2_device::write_bank) { - if (offset < 0x2000) - m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0; - else if (offset < 0x4000) - { - // 4bits only - data &= 0x0f; - // bank = 0 => bank = 1 - if (data == 0) - data = 1; + // the mapper only has data lines D3..D0 + data &= 0x0f; - // The least significant bit of the upper address byte must be 1 - if (offset & 0x0100) - m_latch_bank2 = (m_latch_bank2 & 0x100) | data; + // the mapper only uses inputs A15..A14, A8 for register accesses + switch (offset & 0xc100) + { + case 0x0000: // RAM Enable Register + m_ram_enable = (data == 0x0a) ? 1 : 0; + break; + case 0x0100: // ROM Bank Register + m_latch_bank2 = (data == 0x00) ? 0x01 : data; + break; } } -// 1 bank only?? READ8_MEMBER(gb_rom_mbc2_device::read_ram) { if (!m_ram.empty() && m_ram_enable) diff --git a/src/emu/bus/gameboy/mbc.h b/src/emu/bus/gameboy/mbc.h index f1596cbd0a6..199501f5261 100644 --- a/src/emu/bus/gameboy/mbc.h +++ b/src/emu/bus/gameboy/mbc.h @@ -37,7 +37,7 @@ class gb_rom_mbc1_device : public gb_rom_mbc_device public: enum { - MODE_16M_8k = 0, /// 16Mbit ROM, 8kBit RAM + MODE_16M_64k = 0, /// 16Mbit ROM, 64kBit RAM MODE_4M_256k = 1, /// 4Mbit ROM, 256kBit RAM }; @@ -47,7 +47,7 @@ public: // device-level overrides virtual void device_start() { shared_start(); save_item(NAME(m_mode)); }; - virtual void device_reset() { shared_reset(); m_mode = MODE_16M_8k; }; + virtual void device_reset() { shared_reset(); m_mode = MODE_16M_64k; }; virtual void set_additional_wirings(UINT8 mask, int shift) { m_mask = mask; m_shift = shift; } // these get set at cart loading virtual DECLARE_READ8_MEMBER(read_rom); From 4138b3c87195519669711937390d5cc3534ee70f Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 11:29:19 +0200 Subject: [PATCH 089/284] nes.c: fixed the flip disk input not being recognized in the fds driver. nw. --- src/mess/drivers/nes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c index 44a4db083d8..50e99f6dd4c 100644 --- a/src/mess/drivers/nes.c +++ b/src/mess/drivers/nes.c @@ -215,6 +215,7 @@ void nes_state::setup_disk(nes_disksys_device *slot) MACHINE_START_MEMBER( nes_state, fds ) { m_ciram = auto_alloc_array(machine(), UINT8, 0x800); + m_io_disksel = ioport("FLIPDISK"); setup_disk(m_disk); // register saves From 85535e83fe6c3f6be765cd3a6e7418807dafba50 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 11:32:11 +0200 Subject: [PATCH 090/284] ui: when accessing the internal File Manager for a system with available softlists, let the softlist item be highlighted by default to make navigation faster [Fabio Priuli] --- src/emu/ui/filesel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emu/ui/filesel.c b/src/emu/ui/filesel.c index 294e58c76fb..141d2f9e7b9 100644 --- a/src/emu/ui/filesel.c +++ b/src/emu/ui/filesel.c @@ -566,7 +566,8 @@ void ui_menu_file_selector::populate() if (m_has_softlist) { // add the "[software list]" entry - append_entry(SELECTOR_ENTRY_TYPE_SOFTWARE_LIST, NULL, NULL); + entry = append_entry(SELECTOR_ENTRY_TYPE_SOFTWARE_LIST, NULL, NULL); + selected_entry = entry; } // add the drives From c78e60ed468ada685498961cafc774f3965222aa Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 11:41:14 +0200 Subject: [PATCH 091/284] cheat: improved cheat support for games in softlist. XML cheats for home systems should now be stored in a subfolder (or a compressed archive), named after the software list, inside the cheatpath. this allows for loading cheats for consoles / home computers without interfering with arcade cheats when games have identical shortnames. For instance, loading Galaga in NES allows now to use its specific cheats even if a galaga.xml is available in the arcade cheat.7z (previously you'd get an error due to the arcade cheat referring to a cpu not present in the NES). [Pugsy, Fabio Priuli] --- src/emu/cheat.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/emu/cheat.c b/src/emu/cheat.c index fc19df4e83c..c5cce57604b 100644 --- a/src/emu/cheat.c +++ b/src/emu/cheat.c @@ -1134,25 +1134,30 @@ void cheat_manager::reload() m_lastline = 0; m_disabled = false; - // load the cheat file, MESS will load a crc32.xml ( eg. 01234567.xml ) - // and MAME will load gamename.xml + // load the cheat file, if it's a system that has a software list then try softlist_name/shortname.xml first, + // if it fails to load then try to load via crc32 - basename/crc32.xml ( eg. 01234567.xml ) image_interface_iterator iter(machine().root_device()); for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) if (image->exists()) { - // if we are loading through software lists, try to load shortname.xml + // if we are loading through a software list, try to load softlist_name/shortname.xml + // this allows the coexistence of arcade cheats with cheats for home conversions which + // have the same shortname if (image->software_entry() != NULL) { - load_cheats(image->basename()); + std::string filename; + strprintf(filename, "%s%s%s", image->software_list_name(), PATH_SEPARATOR, image->basename()); + load_cheats(filename.c_str()); break; } + // else we are loading outside the software list, try to load machine_basename/crc32.xml else { UINT32 crc = image->crc(); if (crc != 0) { std::string filename; - strprintf(filename,"%08X", crc); + strprintf(filename, "%s%s%08X", machine().basename(), PATH_SEPARATOR, crc); load_cheats(filename.c_str()); break; } From 8b1c12653862e48802afb1873573caa285a5b4b9 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 11:59:06 +0200 Subject: [PATCH 092/284] n64.xml: fixed some parent/clone relation. [Andrea Petrucci] --- hash/n64.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hash/n64.xml b/hash/n64.xml index 2b591f8e46a..3f7ae425852 100644 --- a/hash/n64.xml +++ b/hash/n64.xml @@ -6480,7 +6480,7 @@ patched out (+ a fix for internal checksum) - + Mia Hamm Soccer 64 (USA) 2000 South Peak @@ -9969,7 +9969,7 @@ patched out (+ a fix for internal checksum) - + Taz Express (USA, Prototype) 2000? Infogrames @@ -9991,7 +9991,7 @@ patched out (+ a fix for internal checksum) - + Tetris 64 (Jpn) 1998 Seta Corporation From bc445d85bf9052922587977ae3c169a5a0239201 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 12:03:22 +0200 Subject: [PATCH 093/284] audit.c: worked around a crash occurring when trying to mount a CHD from the internal UI. nw. I'll keep searching for a better fix, of course, but the current behavior was really annoying (for instance it was impossible to change disk after emulation had started, when loading from softlist) --- src/emu/audit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/emu/audit.c b/src/emu/audit.c index b8ab208d6a0..a6e9910680d 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -462,10 +462,16 @@ audit_record *media_auditor::audit_one_disk(const rom_entry *rom, const char *lo { // allocate and append a new record audit_record &record = m_record_list.append(*global_alloc(audit_record(*rom, audit_record::MEDIA_DISK))); + chd_error err; // open the disk chd_file source; - chd_error err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag)); + if (&m_enumerator.driver() != NULL) + err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag)); + else + // FIXME: this shouldn't be needed, but when trying to load a CDROM from the internal UI for some reason + // the enumerator is created with NULL driver() and we have to catch it by passing through the current options + err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(m_enumerator.find(m_enumerator.options().system_name())), rom, source, locationtag)); // if we succeeded, get the hashes if (err == CHDERR_NONE) From 67f292241dd7e7ac64b19196aa9d2f6ed3aa667d Mon Sep 17 00:00:00 2001 From: yz70s Date: Tue, 2 Jun 2015 12:51:04 +0200 Subject: [PATCH 094/284] chihiro.c: lets' start playing with usb. Also added two new chihiro debug commands dump_timer and dump_dpc to show the contents of the _KTIMER and _KDPC kernel structures. (nw) Usb is disabled by default (to allow loading the game), uncomment the USB_ENABLED define to enable it. --- src/mame/drivers/chihiro.c | 364 ++++++++++++++++++++++++++++++++++++- 1 file changed, 354 insertions(+), 10 deletions(-) diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c index 1fe778e3726..e54154eaee1 100644 --- a/src/mame/drivers/chihiro.c +++ b/src/mame/drivers/chihiro.c @@ -376,6 +376,7 @@ Thanks to Alex, Mr Mudkips, and Philip Burke for this info. #define LOG_PCI //#define LOG_OHCI //#define LOG_BASEBOARD +//#define USB_ENABLED class chihiro_state : public driver_device { @@ -410,6 +411,10 @@ public: int smbus_pic16lc(int command, int rw, int data); int smbus_cx25871(int command, int rw, int data); int smbus_eeprom(int command, int rw, int data); + void usb_ohci_interrupts(); + void usb_ohci_read_endpoint_descriptor(UINT32 address); + void usb_ohci_read_transfer_descriptor(UINT32 address); + void usb_ohci_read_isochronous_transfer_descriptor(UINT32 address); void baseboard_ide_event(int type, UINT8 *read, UINT8 *write); UINT8 *baseboard_ide_dimmboard(UINT32 lba); void dword_write_le(UINT8 *addr, UINT32 d); @@ -426,6 +431,7 @@ public: DECLARE_WRITE_LINE_MEMBER(chihiro_pit8254_out2_changed); IRQ_CALLBACK_MEMBER(irq_callback); TIMER_CALLBACK_MEMBER(audio_apu_timer); + TIMER_CALLBACK_MEMBER(usb_ohci_timer); struct chihiro_devices { pic8259_device *pic8259_1; @@ -468,6 +474,49 @@ public: UINT32 mixer_regs[0x80 / 4]; UINT32 controller_regs[0x38 / 4]; } ac97st; + struct ohci_state { + UINT32 hc_regs[255]; + int ports[4 + 1]; + emu_timer *timer; + int state; + UINT32 framenumber; + address_space *space; + struct { + int mps; // MaximumPacketSize + int f; // Format + int k; // sKip + int s; // Speed + int d; // Direction + int en; // EndpointNumber + int fa; // FunctionAddress + UINT32 tailp; // TDQueueTailPointer + UINT32 headp; // TDQueueHeadPointer + UINT32 nexted; // NextED + int c; // toggleCarry + int h; // Halted + } endpoint_descriptor; + struct { + int cc; // ConditionCode + int ec; // ErrorCount + int t; // DataToggle + int di; // DelayInterrupt + int dp; // Direction/PID + int r; // bufferRounding + UINT32 cbp; // CurrentBufferPointer + UINT32 nexttd; // NextTD + UINT32 be; // BufferEnd + } transfer_descriptor; + struct { + int cc; // ConditionCode + int fc; // FrameCount + int di; // DelayInterrupt + int sf; // StartingFrame + UINT32 bp0; // BufferPage0 + UINT32 nexttd; // NextTD + UINT32 be; // BufferEnd + UINT32 offset[8]; // Offset/PacketStatusWord + } isochronous_transfer_descriptor; + } ohcist; UINT8 pic16lc_buffer[0xff]; nv2a_renderer *nvidia_nv2a; bool debug_irq_active; @@ -477,6 +526,50 @@ public: int usbhack_index; int usbhack_counter; required_device m_maincpu; + + enum OHCIRegisters { + HcRevision=0, + HcControl, + HcCommandStatus, + HcInterruptStatus, + HcInterruptEnable, + HcInterruptDisable, + HcHCCA, + HcPeriodCurrentED, + HcControlHeadED, + HcControlCurrentED, + HcBulkHeadED, + HcBulkCurrentED, + HcDoneHead, + HcFmInterval, + HcFmRemaining, + HcFmNumber, + HcPeriodicStart, + HcLSThreshold, + HcRhDescriptorA, + HcRhDescriptorB, + HcRhStatus, + HcRhPortStatus0 + }; + + enum OHCIHostControllerFunctionalState { + UsbReset=0, + UsbResume, + UsbOperational, + UsbSuspend + }; + + enum OHCIInterrupt { + SchedulingOverrun=1, + WritebackDoneHead=2, + StartofFrame=4, + ResumeDetected=8, + UnrecoverableError=16, + FrameNumberOverflow=32, + RootHubStatusChange=64, + OwnershipChange=0x40000000, + MasterInterruptEnable=0x80000000 + }; }; /* jamtable instructions for Chihiro (different from console) @@ -721,6 +814,62 @@ static void dump_list_command(running_machine &machine, int ref, int params, con } } +static void dump_dpc_command(running_machine &machine, int ref, int params, const char **param) +{ + chihiro_state *state = machine.driver_data(); + address_space &space = state->m_maincpu->space(); + UINT64 addr; + offs_t address; + + if (params < 1) + return; + if (!debug_command_parameter_number(machine, param[0], &addr)) + return; + address = (offs_t)addr; + if (!debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address)) + { + debug_console_printf(machine, "Address is unmapped.\n"); + return; + } + debug_console_printf(machine, "Type %d word\n", space.read_word_unaligned(address)); + debug_console_printf(machine, "Inserted %d byte\n", space.read_byte(address + 2)); + debug_console_printf(machine, "Padding %d byte\n", space.read_byte(address + 3)); + debug_console_printf(machine, "DpcListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 4), space.read_dword_unaligned(address + 8)); + debug_console_printf(machine, "DeferredRoutine %08X dword\n", space.read_dword_unaligned(address + 12)); + debug_console_printf(machine, "DeferredContext %08X dword\n", space.read_dword_unaligned(address + 16)); + debug_console_printf(machine, "SystemArgument1 %08X dword\n", space.read_dword_unaligned(address + 20)); + debug_console_printf(machine, "SystemArgument2 %08X dword\n", space.read_dword_unaligned(address + 24)); +} + +static void dump_timer_command(running_machine &machine, int ref, int params, const char **param) +{ + chihiro_state *state = machine.driver_data(); + address_space &space = state->m_maincpu->space(); + UINT64 addr; + offs_t address; + + if (params < 1) + return; + if (!debug_command_parameter_number(machine, param[0], &addr)) + return; + address = (offs_t)addr; + if (!debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address)) + { + debug_console_printf(machine, "Address is unmapped.\n"); + return; + } + debug_console_printf(machine, "Header.Type %d byte\n", space.read_byte(address)); + debug_console_printf(machine, "Header.Absolute %d byte\n", space.read_byte(address + 1)); + debug_console_printf(machine, "Header.Size %d byte\n", space.read_byte(address + 2)); + debug_console_printf(machine, "Header.Inserted %d byte\n", space.read_byte(address + 3)); + debug_console_printf(machine, "Header.SignalState %08X dword\n", space.read_dword_unaligned(address + 4)); + debug_console_printf(machine, "Header.WaitListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 8), space.read_dword_unaligned(address + 12)); + debug_console_printf(machine, "DueTime %I64d qword\n", (INT64)space.read_qword_unaligned(address + 16)); + debug_console_printf(machine, "TimerListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 24), space.read_dword_unaligned(address + 28)); + debug_console_printf(machine, "Dpc %08X dword\n", space.read_dword_unaligned(address + 32)); + debug_console_printf(machine, "Period %d dword\n", space.read_dword_unaligned(address + 36)); +} + static void curthread_command(running_machine &machine, int ref, int params, const char **param) { chihiro_state *state = machine.driver_data(); @@ -878,6 +1027,8 @@ static void help_command(running_machine &machine, int ref, int params, const ch debug_console_printf(machine, " chihiro dump_string,
-- Dump _STRING object at
\n"); debug_console_printf(machine, " chihiro dump_process,
-- Dump _PROCESS object at
\n"); debug_console_printf(machine, " chihiro dump_list,
[,] -- Dump _LIST_ENTRY chain starting at
\n"); + debug_console_printf(machine, " chihiro dump_dpc,
-- Dump _KDPC object at
\n"); + debug_console_printf(machine, " chihiro dump_timer,
-- Dump _KTIMER object at
\n"); debug_console_printf(machine, " chihiro curthread -- Print information about current thread\n"); debug_console_printf(machine, " chihiro irq, -- Generate interrupt with irq number 0-15\n"); debug_console_printf(machine, " chihiro nv2a_combiners -- Toggle use of register combiners\n"); @@ -900,6 +1051,10 @@ static void chihiro_debug_commands(running_machine &machine, int ref, int params dump_process_command(machine, ref, params - 1, param + 1); else if (strcmp("dump_list", param[0]) == 0) dump_list_command(machine, ref, params - 1, param + 1); + else if (strcmp("dump_dpc", param[0]) == 0) + dump_dpc_command(machine, ref, params - 1, param + 1); + else if (strcmp("dump_timer", param[0]) == 0) + dump_timer_command(machine, ref, params - 1, param + 1); else if (strcmp("curthread", param[0]) == 0) curthread_command(machine, ref, params - 1, param + 1); else if (strcmp("irq", param[0]) == 0) @@ -1022,7 +1177,7 @@ static void geforce_pci_w(device_t *busdevice, device_t *device, int function, i } /* - * ohci usb controller placeholder + * ohci usb controller (placeholder for now) */ #ifdef LOG_OHCI @@ -1063,9 +1218,20 @@ static const struct { READ32_MEMBER(chihiro_state::usbctrl_r) { - int a, p; + UINT32 ret; +#ifdef LOG_OHCI + if (offset >= 0x54 / 4) + logerror("usb controller 0 register HcRhPortStatus[%d] read\n", (offset - 0x54 / 4) + 1); + else + logerror("usb controller 0 register %s read\n", usbregnames[offset]); +#endif + ret=ohcist.hc_regs[offset]; if (offset == 0) { /* hacks needed until usb (and jvs) is implemented */ +#ifdef USB_ENABLED +#else + int p; + if (usbhack_counter == 0) p = 0; else if (usbhack_counter == 1) // after game loaded @@ -1073,31 +1239,198 @@ READ32_MEMBER(chihiro_state::usbctrl_r) else p = -1; if (p >= 0) { - for (a = 0; a < 16; a++) { + for (int a = 0; a < 16; a++) { if (hacks[p].modify[a].address == 0) break; m_maincpu->space(0).write_byte(hacks[p].modify[a].address, hacks[p].modify[a].write_byte); } } usbhack_counter++; - } -#ifdef LOG_OHCI - if (offset >= 0x54 / 4) - logerror("usb controller 0 register HcRhPortStatus[%d] read\n", (offset - 0x54 / 4) + 1); - else - logerror("usb controller 0 register %s read\n", usbregnames[offset]); #endif - return 0; + } + return ret; } WRITE32_MEMBER(chihiro_state::usbctrl_w) { +#ifdef USB_ENABLED + UINT32 old = ohcist.hc_regs[offset]; +#endif + #ifdef LOG_OHCI if (offset >= 0x54 / 4) logerror("usb controller 0 register HcRhPortStatus[%d] write %08X\n", (offset - 0x54 / 4) + 1, data); else logerror("usb controller 0 register %s write %08X\n", usbregnames[offset], data); #endif +#ifdef USB_ENABLED + if (offset == HcRhStatus) { + if (data & 0x80000000) + ohcist.hc_regs[HcRhStatus] &= ~0x8000; + if (data & 0x00020000) + ohcist.hc_regs[HcRhStatus] &= ~0x0002; + if (data & 0x00010000) + ohcist.hc_regs[HcRhStatus] &= ~0x0001; + return; + } + if (offset == HcControl) { + int hcfs; + + hcfs = (data >> 6) & 3; + if (hcfs == UsbOperational) { + ohcist.timer->enable(); + ohcist.timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); + } + else + ohcist.timer->enable(false); + ohcist.state = hcfs; + } + if (offset == HcCommandStatus) { + if (data & 1) + ohcist.hc_regs[HcControl] |= 3 << 6; + } + if (offset == HcInterruptStatus) { + ohcist.hc_regs[HcInterruptStatus] &= ~data; + usb_ohci_interrupts(); + return; + } + if (offset == HcInterruptEnable) { + ohcist.hc_regs[HcInterruptEnable] |= data; + usb_ohci_interrupts(); + return; + } + if (offset == HcInterruptDisable) { + ohcist.hc_regs[HcInterruptEnable] &= ~data; + usb_ohci_interrupts(); + return; + } + if (offset >= HcRhPortStatus0) { + int port = offset - HcRhPortStatus0 + 1; // port 0 not used + // bit 0 ClearPortEnable: 1 clears PortEnableStatus + // bit 1 SetPortEnable: 1 sets PortEnableStatus + // bit 2 SetPortSuspend: 1 sets PortSuspendStatus + // bit 3 ClearSuspendStatus: 1 clears PortSuspendStatus + // bit 4 SetPortReset: 1 sets PortResetStatus + if (data & 0x10) { + ohcist.hc_regs[offset] |= 0x10; + // after 10ms set PortResetStatusChange and clear PortResetStatus and set PortEnableStatus + ohcist.ports[port] = 10; + } + // bit 8 SetPortPower: 1 sets PortPowerStatus + // bit 9 ClearPortPower: 1 clears PortPowerStatus + // bit 16 1 clears ConnectStatusChange + // bit 17 1 clears PortEnableStatusChange + // bit 18 1 clears PortSuspendStatusChange + // bit 19 1 clears PortOverCurrentIndicatorChange + // bit 20 1 clears PortResetStatusChange + if (ohcist.hc_regs[offset] != old) + ohcist.hc_regs[HcInterruptStatus] |= RootHubStatusChange; + usb_ohci_interrupts(); + return; + } +#endif + ohcist.hc_regs[offset] = data; +} + +TIMER_CALLBACK_MEMBER(chihiro_state::usb_ohci_timer) +{ + UINT32 hcca; + int changed = 0; + + if (ohcist.state == UsbOperational) { + ohcist.framenumber=(ohcist.framenumber+1) & 0xffff; + hcca = ohcist.hc_regs[HcHCCA]; + ohcist.space->write_dword(hcca + 0x80, ohcist.framenumber); + ohcist.hc_regs[HcFmNumber] = ohcist.framenumber; + } + for (int p = 1; p <= 4; p++) { + if (ohcist.ports[p] > 0) { + ohcist.ports[p]--; + if (ohcist.ports[p] == 0) { + ohcist.hc_regs[HcRhPortStatus0 + p - 1] = (ohcist.hc_regs[HcRhPortStatus0 + p - 1] & ~(1 << 4)) | (1 << 20) | (1 << 1); + changed = 1; + } + } + } + if (ohcist.state == UsbOperational) { + if (ohcist.framenumber == 0) + ohcist.hc_regs[HcInterruptStatus] |= FrameNumberOverflow; + ohcist.hc_regs[HcInterruptStatus] |= StartofFrame; + } + if (changed != 0) { + ohcist.hc_regs[HcInterruptStatus] |= RootHubStatusChange; + } + usb_ohci_interrupts(); +} + +void chihiro_state::usb_ohci_interrupts() +{ + if (((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != 0) && ((ohcist.hc_regs[HcInterruptEnable] & MasterInterruptEnable) != 0)) + chihiro_devs.pic8259_1->ir1_w(1); + else + chihiro_devs.pic8259_1->ir1_w(0); +} + +void chihiro_state::usb_ohci_read_endpoint_descriptor(UINT32 address) +{ + UINT32 w; + + w = ohcist.space->read_dword(address); + ohcist.endpoint_descriptor.fa = w & 0x7f; + ohcist.endpoint_descriptor.en = (w >> 7) & 15; + ohcist.endpoint_descriptor.d = (w >> 11) & 3; + ohcist.endpoint_descriptor.s = (w >> 13) & 1; + ohcist.endpoint_descriptor.k = (w >> 14) & 1; + ohcist.endpoint_descriptor.f = (w >> 15) & 1; + ohcist.endpoint_descriptor.mps = (w >> 16) & 0x7ff; + ohcist.endpoint_descriptor.tailp = ohcist.space->read_dword(address + 4); + w = ohcist.space->read_dword(address + 8); + ohcist.endpoint_descriptor.headp = w & 0xfffffffc; + ohcist.endpoint_descriptor.h = w & 1; + ohcist.endpoint_descriptor.c = (w >> 1) & 1; + ohcist.endpoint_descriptor.nexted = ohcist.space->read_dword(address + 12); +} + +void chihiro_state::usb_ohci_read_transfer_descriptor(UINT32 address) +{ + UINT32 w; + + w = ohcist.space->read_dword(address); + ohcist.transfer_descriptor.cc = (w >> 28) & 15; + ohcist.transfer_descriptor.ec= (w >> 16) & 3; + ohcist.transfer_descriptor.t= (w >> 24) & 3; + ohcist.transfer_descriptor.di= (w >> 21) & 7; + ohcist.transfer_descriptor.dp= (w >> 19) & 3; + ohcist.transfer_descriptor.r = (w >> 18) & 1; + ohcist.transfer_descriptor.cbp = ohcist.space->read_dword(address + 4); + ohcist.transfer_descriptor.nexttd = ohcist.space->read_dword(address + 8); + ohcist.transfer_descriptor.be = ohcist.space->read_dword(address + 12); +} + +void chihiro_state::usb_ohci_read_isochronous_transfer_descriptor(UINT32 address) +{ + UINT32 w; + + w = ohcist.space->read_dword(address); + ohcist.isochronous_transfer_descriptor.cc = (w >> 28) & 15; + ohcist.isochronous_transfer_descriptor.fc = (w >> 24) & 7; + ohcist.isochronous_transfer_descriptor.di = (w >> 21) & 7; + ohcist.isochronous_transfer_descriptor.sf = w & 0xffff; + ohcist.isochronous_transfer_descriptor.bp0 = ohcist.space->read_dword(address + 4) & 0xfffff000; + ohcist.isochronous_transfer_descriptor.nexttd = ohcist.space->read_dword(address + 8); + ohcist.isochronous_transfer_descriptor.be = ohcist.space->read_dword(address + 12); + w = ohcist.space->read_dword(address + 16); + ohcist.isochronous_transfer_descriptor.offset[0] = w & 0xffff; + ohcist.isochronous_transfer_descriptor.offset[1] = (w >> 16) & 0xffff; + w = ohcist.space->read_dword(address + 20); + ohcist.isochronous_transfer_descriptor.offset[2] = w & 0xffff; + ohcist.isochronous_transfer_descriptor.offset[3] = (w >> 16) & 0xffff; + w = ohcist.space->read_dword(address + 24); + ohcist.isochronous_transfer_descriptor.offset[4] = w & 0xffff; + ohcist.isochronous_transfer_descriptor.offset[5] = (w >> 16) & 0xffff; + w = ohcist.space->read_dword(address + 28); + ohcist.isochronous_transfer_descriptor.offset[6] = w & 0xffff; + ohcist.isochronous_transfer_descriptor.offset[7] = (w >> 16) & 0xffff; } /* @@ -1792,6 +2125,17 @@ void chihiro_state::machine_start() apust.timer->enable(false); if (machine().debug_flags & DEBUG_FLAG_ENABLED) debug_console_register_command(machine(), "chihiro", CMDFLAG_NONE, 0, 1, 4, chihiro_debug_commands); + memset(&ohcist, 0, sizeof(ohcist)); +#ifdef USB_ENABLED + ohcist.hc_regs[HcRevision] = 0x10; + ohcist.hc_regs[HcFmInterval] = 0x2edf; + ohcist.hc_regs[HcLSThreshold] = 0x628; + ohcist.hc_regs[HcRhDescriptorA] = 4; + ohcist.hc_regs[HcRhPortStatus0] = 1; // test connect + ohcist.space = &m_maincpu->space(); + ohcist.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(chihiro_state::usb_ohci_timer), this), (void *)"USB OHCI Timer"); + ohcist.timer->enable(false); +#endif usbhack_index = -1; for (int a = 1; a < 2; a++) if (strcmp(machine().basename(), hacks[a].game_name) == 0) { From ada45f655ed1a726ca0c1f723a997112162f8d02 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 2 Jun 2015 13:36:22 +0200 Subject: [PATCH 095/284] hec2mdhrx: updated to use the new wd fdc. --- scripts/src/lib.lua | 2 + src/lib/formats/hect_dsk.c | 32 ------------ src/lib/formats/hector_minidisc.c | 41 ++++++++++++++++ src/lib/formats/hector_minidisc.h | 33 +++++++++++++ src/mess/drivers/hec2hrp.c | 24 ++++----- src/mess/includes/hec2hrp.h | 20 +++++--- src/mess/machine/hec2hrp.c | 82 +++++-------------------------- 7 files changed, 113 insertions(+), 121 deletions(-) create mode 100644 src/lib/formats/hector_minidisc.c create mode 100644 src/lib/formats/hector_minidisc.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index dcf4c44268e..611ed2ae9d9 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -257,6 +257,8 @@ project "formats" MAME_DIR .. "src/lib/formats/hect_dsk.h", MAME_DIR .. "src/lib/formats/hect_tap.c", MAME_DIR .. "src/lib/formats/hect_tap.h", + MAME_DIR .. "src/lib/formats/hector_minidisc.c", + MAME_DIR .. "src/lib/formats/hector_minidisc.h", MAME_DIR .. "src/lib/formats/iq151_dsk.c", MAME_DIR .. "src/lib/formats/iq151_dsk.h", MAME_DIR .. "src/lib/formats/imd_dsk.c", diff --git a/src/lib/formats/hect_dsk.c b/src/lib/formats/hect_dsk.c index 4e8794131f8..8dfe445e6e4 100644 --- a/src/lib/formats/hect_dsk.c +++ b/src/lib/formats/hect_dsk.c @@ -93,38 +93,6 @@ static FLOPPY_CONSTRUCT(hector_disc2_dsk800_construct) return basicdsk_construct(floppy, &geometry); } -/* For the 720Ko disk 3 1/2 inch disk for the mini disc unit !!: - 512 bytes per sectors, - 9 sector per track, - From sector =1 to sector 9, - 80 tracks, - 2 Head - This format can be extract from a real disc with anadisk (*.IMG format rename in *.HE7). -*/ - -static FLOPPY_IDENTIFY(hector_minidisc_dsk_identify) -{ - *vote = (floppy_image_size(floppy) == (2*70*9*512)) ? 100 : 0; - return FLOPPY_ERROR_SUCCESS; -} - -static FLOPPY_CONSTRUCT(hector_minidisc_dsk_construct) -{ - struct basicdsk_geometry geometry; - memset(&geometry, 0, sizeof(geometry)); // 635904 octets - geometry.heads = 2;//2 - geometry.first_sector_id = 1; - geometry.sector_length = 512; - geometry.tracks = 70;//69 - geometry.sectors = 9; - return basicdsk_construct(floppy, &geometry); -} - -/* Specific for the mini disc unit */ -LEGACY_FLOPPY_OPTIONS_START( hector_minidisc ) - LEGACY_FLOPPY_OPTION( hector_dsk, "HMD", "hector mini disc floppy disk image 360Ko", hector_minidisc_dsk_identify, hector_minidisc_dsk_construct, NULL, NULL) -LEGACY_FLOPPY_OPTIONS_END - LEGACY_FLOPPY_OPTIONS_START( hector_disc2 ) LEGACY_FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, NULL, NULL) LEGACY_FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, NULL, NULL) diff --git a/src/lib/formats/hector_minidisc.c b/src/lib/formats/hector_minidisc.c new file mode 100644 index 00000000000..fe4a7ee44b1 --- /dev/null +++ b/src/lib/formats/hector_minidisc.c @@ -0,0 +1,41 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Hector Minidisc + + Disk image format + +***************************************************************************/ + +#include "hector_minidisc.h" + +hmd_format::hmd_format() : upd765_format(formats) +{ +} + +const char *hmd_format::name() const +{ + return "hector_minidisc"; +} + +const char *hmd_format::description() const +{ + return "Hector Minidisc disk image"; +} + +const char *hmd_format::extensions() const +{ + return "hmd"; +} + +const hmd_format::format hmd_format::formats[] = +{ + { + floppy_image::FF_35, floppy_image::DSDD, floppy_image::MFM, + 2000, 9, 70, 2, 512, {}, 1, {}, 80, 50, 22, 54 + }, + {} +}; + +const floppy_format_type FLOPPY_HMD_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/hector_minidisc.h b/src/lib/formats/hector_minidisc.h new file mode 100644 index 00000000000..d850573f2b6 --- /dev/null +++ b/src/lib/formats/hector_minidisc.h @@ -0,0 +1,33 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Hector Minidisc + + Disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __HMD_DSK_H__ +#define __HMD_DSK_H__ + +#include "upd765_dsk.h" + +class hmd_format : public upd765_format +{ +public: + hmd_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_HMD_FORMAT; + +#endif // __HMD_DSK_H__ diff --git a/src/mess/drivers/hec2hrp.c b/src/mess/drivers/hec2hrp.c index 0dc0547ad13..e1381d33a63 100644 --- a/src/mess/drivers/hec2hrp.c +++ b/src/mess/drivers/hec2hrp.c @@ -81,6 +81,7 @@ #include "machine/upd765.h" /* for floppy disc controller */ #include "cpu/z80/z80.h" #include "formats/hect_dsk.h" +#include "formats/hector_minidisc.h" #include "includes/hec2hrp.h" /*****************************************************************************/ @@ -176,7 +177,8 @@ static ADDRESS_MAP_START( hec2mdhrx_io , AS_IO, 8, hec2hrp_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) // Minidisc commands and changing the rom page !*/ - AM_RANGE(0x000,0x0EF) AM_READWRITE(hector_179x_register_r,hector_179x_register_w)/* 179x registers*/ + AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("wd179x", fd1793_t, read, write) + AM_RANGE(0x08, 0x08) AM_WRITE(minidisc_control_w) AM_RANGE(0x0f0,0x0ff) AM_READWRITE(hector_io_8255_r, hector_io_8255_w ) ADDRESS_MAP_END @@ -356,7 +358,6 @@ MACHINE_START_MEMBER(hec2hrp_state,hec2mdhrx) m_hector_videoram.set_target(m_hector_videoram_hrx,m_hector_videoram.bytes()); hector_init(); - hector_minidisc_init(); } MACHINE_RESET_MEMBER(hec2hrp_state,hec2hrx) { @@ -385,12 +386,14 @@ MACHINE_RESET_MEMBER(hec2hrp_state,hec2mdhrx) /********* mini disque interface ***************************/ /***********************************************************/ -const floppy_interface minidisc_floppy_interface = -{ - FLOPPY_STANDARD_3_5_DSDD, - LEGACY_FLOPPY_OPTIONS_NAME(hector_minidisc), - NULL -}; +FLOPPY_FORMATS_MEMBER( hec2hrp_state::minidisc_formats ) + FLOPPY_HMD_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( minidisc_floppies ) + SLOT_INTERFACE("dd", FLOPPY_35_DD) +SLOT_INTERFACE_END + /******************************************************************************/ static MACHINE_CONFIG_START( hec2hr, hec2hrp_state ) @@ -567,10 +570,9 @@ static MACHINE_CONFIG_START( hec2mdhrx, hec2hrp_state ) MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2mdhrx) /* Mini Disc */ - MCFG_DEVICE_ADD("wd179x", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE1_TAGS + MCFG_FD1793x_ADD("wd179x", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, minidisc_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("wd179x:0", minidisc_floppies, "dd", hec2hrp_state::minidisc_formats) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) diff --git a/src/mess/includes/hec2hrp.h b/src/mess/includes/hec2hrp.h index 36b3d93530e..c30b7bfccd3 100644 --- a/src/mess/includes/hec2hrp.h +++ b/src/mess/includes/hec2hrp.h @@ -40,7 +40,7 @@ */ #include "machine/upd765.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "imagedev/flopdrv.h" #include "imagedev/cassette.h" #include "sound/sn76477.h" /* for sn sound*/ @@ -83,7 +83,12 @@ public: m_palette(*this, "palette"), m_videoram(*this,"videoram"), m_hector_videoram(*this,"hector_videoram") , - m_keyboard(*this, "KEY") { } + m_keyboard(*this, "KEY"), + m_minidisc_fdc(*this, "wd179x"), + m_floppy0(*this, "wd179x:0") + {} + + DECLARE_FLOPPY_FORMATS(minidisc_formats); required_device m_maincpu; optional_device m_disc2cpu; @@ -94,6 +99,9 @@ public: optional_shared_ptr m_hector_videoram; required_ioport_array<9> m_keyboard; + optional_device m_minidisc_fdc; + optional_device m_floppy0; + UINT8 m_hector_flag_hr; UINT8 m_hector_flag_80c; UINT8 m_hector_color[4]; @@ -131,8 +139,9 @@ public: int m_hector_flag_result; int m_print; UINT8 m_hector_videoram_hrx[0x04000]; - DECLARE_READ8_MEMBER(hector_179x_register_r); - DECLARE_WRITE8_MEMBER(hector_179x_register_w); + + DECLARE_WRITE8_MEMBER(minidisc_control_w); + DECLARE_WRITE8_MEMBER(hector_switch_bank_w); DECLARE_WRITE8_MEMBER(hector_keyboard_w); DECLARE_READ8_MEMBER(hector_keyboard_r); @@ -162,7 +171,6 @@ public: int isHectorWithMiniDisc(); int isHectorHR(); int isHectoreXtend(); - void hector_minidisc_init(); void Mise_A_Jour_Etat(int Adresse, int Value ); void Init_Value_SN76477_Hector(); void Update_Sound(address_space &space, UINT8 data); @@ -188,6 +196,4 @@ public: void hector_disc2_reset(); }; -extern const floppy_interface minidisc_floppy_interface; - MACHINE_CONFIG_EXTERN( hector_audio ); diff --git a/src/mess/machine/hec2hrp.c b/src/mess/machine/hec2hrp.c index a6ebb75c64c..55db5bdfe5f 100644 --- a/src/mess/machine/hec2hrp.c +++ b/src/mess/machine/hec2hrp.c @@ -102,85 +102,25 @@ TIMER_CALLBACK_MEMBER(hec2hrp_state::Callback_CK) m_CK_signal++; } -void hec2hrp_state::hector_minidisc_init() +WRITE8_MEMBER( hec2hrp_state::minidisc_control_w ) { - fd1793_device *fdc = machine().device("wd179x"); - //set density - fdc->dden_w(1);// density select => always 1 (0 ?a plante !) + floppy_image_device *floppy = NULL; - /* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */ - floppy_get_device(machine(), 0)->floppy_mon_w( 0); // Moteur floppy A: - //floppy_get_device(machine(), 1)->floppy_mon_w(BIT(data, 7)); // Moteur floppy B:, not implanted on the real machine + if (BIT(data, 6)) floppy = m_floppy0->get_device(); + // bit 7 = drive 2? - //Set the drive ready ! - floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0);// Disc 0 ready ! + m_minidisc_fdc->set_floppy(floppy); -} - -READ8_MEMBER(hec2hrp_state::hector_179x_register_r) -{ -int data=0; -fd1793_device *fdc = machine().device("wd179x"); - - switch (offset & 0x0ff) + if (floppy) { - /* minidisc floppy disc interface */ - case 0x04: - data = fdc->status_r(space, 0); - break; - case 0x05: - data = fdc->track_r(space, 0); - break; - case 0x06: - data = fdc->sector_r(space, 0); - break; - case 0x07: - data = fdc->data_r(space, 0); - break; - default: - break; + // don't know where the motor on signal is + floppy->mon_w(0); + floppy->ss_w(BIT(data, 4)); } - return data; + membank("bank2")->set_entry(BIT(data, 5) ? HECTOR_BANK_BASE : HECTOR_BANK_DISC); } -WRITE8_MEMBER(hec2hrp_state::hector_179x_register_w) -{ -fd1793_device *fdc = machine().device("wd179x"); -switch (offset) - { - /* minidisc floppy disc interface */ - case 0x04: - fdc->command_w(space, 0, data); - break; - case 0x05: - fdc->track_w(space, 0, data); - break; - case 0x06: - fdc->sector_w(space, 0, data); - break; - case 0x07: - /*write into command register*/ - fdc->data_w(space, 0, data); - break; - case 0x08: - /*General purpose port (0x08) for the minidisk I/O */ - { - // Rom page bank switching - membank("bank2")->set_entry(BIT(data, 5) ? HECTOR_BANK_BASE : HECTOR_BANK_DISC ); - // Set drive number - if (BIT(data, 6)) fdc->set_drive(0); // Set the correct drive number 0 - //if (BIT(data, 7)) fdc->set_drive(1);// Set the correct drive number 1,never here - - // Set side - fdc->set_side(BIT(data, 4) ? 1 : 0);// side select - } - break; - - default: - break; - } -} WRITE8_MEMBER(hec2hrp_state::hector_switch_bank_w) { if (offset==0x00) { /* 0x800 et 0x000=> video page, HR*/ @@ -255,7 +195,7 @@ READ8_MEMBER(hec2hrp_state::hector_keyboard_r) /* floppy md master reset */ if (isHectorWithMiniDisc()) - machine().device("wd179x")->mr_w(1); + m_minidisc_fdc->reset(); } else /* aviable for BR machines */ From cdabf91b19934fcb26c1a666ad6b1e3b02c828a4 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 15:06:46 +0200 Subject: [PATCH 096/284] added some further sanity check. nw. --- src/emu/bus/a7800/a78_slot.c | 2 +- src/emu/bus/gameboy/gb_slot.c | 2 +- src/emu/bus/megadrive/md_slot.c | 2 +- src/emu/bus/sega8/sega8_slot.c | 2 +- src/emu/bus/vboy/slot.c | 2 +- src/emu/bus/wswan/slot.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c index e7f6da4f6cb..6332492a6c2 100644 --- a/src/emu/bus/a7800/a78_slot.c +++ b/src/emu/bus/a7800/a78_slot.c @@ -488,7 +488,7 @@ void a78_partialhash(hash_collection &dest, const unsigned char *data, void a78_cart_slot_device::call_unload() { - if (m_cart && m_cart->get_nvram_size()) + if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size()) battery_save(m_cart->get_nvram_base(), 0x800); } diff --git a/src/emu/bus/gameboy/gb_slot.c b/src/emu/bus/gameboy/gb_slot.c index 60c98447591..922dc91cce2 100644 --- a/src/emu/bus/gameboy/gb_slot.c +++ b/src/emu/bus/gameboy/gb_slot.c @@ -438,7 +438,7 @@ bool megaduck_cart_slot_device::call_load() void base_gb_cart_slot_device::call_unload() { - if (m_cart && m_cart->get_ram_size() && m_cart->get_has_battery()) + if (m_cart && m_cart->get_ram_base() && m_cart->get_ram_size() && m_cart->get_has_battery()) battery_save(m_cart->get_ram_base(), m_cart->get_ram_size()); } diff --git a/src/emu/bus/megadrive/md_slot.c b/src/emu/bus/megadrive/md_slot.c index b53419b5528..af40c089d5a 100644 --- a/src/emu/bus/megadrive/md_slot.c +++ b/src/emu/bus/megadrive/md_slot.c @@ -552,7 +552,7 @@ int base_md_cart_slot_device::load_nonlist() void base_md_cart_slot_device::call_unload() { - if (m_cart && m_cart->get_nvram_size()) + if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size()) battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size()); } diff --git a/src/emu/bus/sega8/sega8_slot.c b/src/emu/bus/sega8/sega8_slot.c index 0aa73d2c6c2..92c80af2c61 100644 --- a/src/emu/bus/sega8/sega8_slot.c +++ b/src/emu/bus/sega8/sega8_slot.c @@ -410,7 +410,7 @@ bool sega8_cart_slot_device::call_load() void sega8_cart_slot_device::call_unload() { - if (m_cart && m_cart->get_ram_size() && m_cart->get_has_battery()) + if (m_cart && m_cart->get_ram_base() && m_cart->get_ram_size() && m_cart->get_has_battery()) battery_save(m_cart->get_ram_base(), m_cart->get_ram_size()); } diff --git a/src/emu/bus/vboy/slot.c b/src/emu/bus/vboy/slot.c index 0cbbb618419..da00aeaca04 100644 --- a/src/emu/bus/vboy/slot.c +++ b/src/emu/bus/vboy/slot.c @@ -213,7 +213,7 @@ bool vboy_cart_slot_device::call_load() void vboy_cart_slot_device::call_unload() { - if (m_cart && m_cart->get_eeprom_size()) + if (m_cart && m_cart->get_eeprom_base() && m_cart->get_eeprom_size()) battery_save(m_cart->get_eeprom_base(), m_cart->get_eeprom_size() * 4); } diff --git a/src/emu/bus/wswan/slot.c b/src/emu/bus/wswan/slot.c index 6e22ab1b40b..8da5f6e694d 100644 --- a/src/emu/bus/wswan/slot.c +++ b/src/emu/bus/wswan/slot.c @@ -232,7 +232,7 @@ bool ws_cart_slot_device::call_load() void ws_cart_slot_device::call_unload() { - if (m_cart && m_cart->get_nvram_size()) + if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size()) battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size()); } From 358e90476a1de1085526fb9914d44da47de51ff2 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Tue, 2 Jun 2015 15:08:57 +0200 Subject: [PATCH 097/284] not sure about other compilers, but old Apple GCC is very unhappy with this (and m_floppy is also initialized to NULL a few lines above, making this line not necessary from what I can tell). nw. --- src/mess/includes/fm7.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/includes/fm7.h b/src/mess/includes/fm7.h index 35dd9efb290..6c24829cba5 100644 --- a/src/mess/includes/fm7.h +++ b/src/mess/includes/fm7.h @@ -326,7 +326,7 @@ public: required_device m_floppy0; required_device m_floppy1; - floppy_image_device *m_floppy = NULL; + floppy_image_device *m_floppy; void fm7_alu_mask_write(UINT32 offset, int bank, UINT8 dat); void fm7_alu_function_compare(UINT32 offset); From 04e8ae89d2d11660386fdb4d6c0cfc6de3373473 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 2 Jun 2015 16:11:04 +0200 Subject: [PATCH 098/284] Put some licenses since authors all replied (nw) --- src/mess/drivers/mtx.c | 2 +- src/mess/drivers/sms.c | 2 +- src/mess/drivers/z80ne.c | 2 +- src/mess/includes/mtx.h | 2 +- src/mess/includes/sms.h | 2 +- src/mess/includes/z80ne.h | 2 +- src/mess/machine/mtx.c | 2 +- src/mess/machine/sms.c | 2 +- src/mess/machine/z80ne.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mess/drivers/mtx.c b/src/mess/drivers/mtx.c index df1a4ee859f..f6839299480 100644 --- a/src/mess/drivers/mtx.c +++ b/src/mess/drivers/mtx.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Lee Ward, Dirk Best, Curt Coder /************************************************************************* diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c index 1a4d225a94a..bd7c6f37c8d 100644 --- a/src/mess/drivers/sms.c +++ b/src/mess/drivers/sms.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Wilbert Pol, Charles MacDonald,Mathis Rosenhauer,Brad Oliver,Michael Luong,Fabio Priuli,Enik Land /****************************************************************************** Contributors: diff --git a/src/mess/drivers/z80ne.c b/src/mess/drivers/z80ne.c index c7e52a248f3..f8e80e537a7 100644 --- a/src/mess/drivers/z80ne.c +++ b/src/mess/drivers/z80ne.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Roberto Lavarone /****************************************************************************** Nuova Elettronica Z80NE system driver diff --git a/src/mess/includes/mtx.h b/src/mess/includes/mtx.h index 9e852ed6e2d..5558e1fcd15 100644 --- a/src/mess/includes/mtx.h +++ b/src/mess/includes/mtx.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Lee Ward, Dirk Best, Curt Coder /************************************************************************* diff --git a/src/mess/includes/sms.h b/src/mess/includes/sms.h index 556b663d41a..4f2efcdbbd3 100644 --- a/src/mess/includes/sms.h +++ b/src/mess/includes/sms.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Wilbert Pol, Charles MacDonald,Mathis Rosenhauer,Brad Oliver,Michael Luong,Fabio Priuli,Enik Land /***************************************************************************** * diff --git a/src/mess/includes/z80ne.h b/src/mess/includes/z80ne.h index 6ba7c12831e..b7dbfc9f8c5 100644 --- a/src/mess/includes/z80ne.h +++ b/src/mess/includes/z80ne.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Roberto Lavarone /***************************************************************************** * diff --git a/src/mess/machine/mtx.c b/src/mess/machine/mtx.c index 46f3ec32e3f..0594ec6c086 100644 --- a/src/mess/machine/mtx.c +++ b/src/mess/machine/mtx.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Lee Ward, Dirk Best, Curt Coder /************************************************************************* diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c index 5c4d15f2155..89e478c9ba2 100644 --- a/src/mess/machine/sms.c +++ b/src/mess/machine/sms.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Wilbert Pol, Charles MacDonald,Mathis Rosenhauer,Brad Oliver,Michael Luong,Fabio Priuli,Enik Land #include "emu.h" #include "crsshair.h" diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c index 4245165c902..3e5bce4522e 100644 --- a/src/mess/machine/z80ne.c +++ b/src/mess/machine/z80ne.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Roberto Lavarone /*********************************************************************** From 3aeb79cbc0b8a92b304a5bcb368c186b7958ff71 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 2 Jun 2015 16:21:11 +0200 Subject: [PATCH 099/284] resolved some more (nw) --- src/emu/sound/pokey.c | 2 +- src/emu/sound/pokey.h | 2 +- src/mame/drivers/bublbobl.c | 2 +- src/mame/drivers/cheekyms.c | 2 +- src/mame/drivers/dmndrby.c | 2 +- src/mame/drivers/firefox.c | 4 ++-- src/mame/drivers/gameplan.c | 2 +- src/mame/drivers/naughtyb.c | 2 +- src/mame/drivers/pse.c | 2 +- src/mame/includes/bublbobl.h | 2 +- src/mame/includes/cheekyms.h | 2 +- src/mame/includes/gameplan.h | 2 +- src/mame/includes/naughtyb.h | 2 +- src/mame/machine/bublbobl.c | 2 +- src/mame/machine/mathbox.c | 2 +- src/mame/machine/mathbox.h | 2 +- src/mame/video/avgdvg.c | 2 +- src/mame/video/avgdvg.h | 2 +- src/mame/video/bublbobl.c | 2 +- src/mame/video/cheekyms.c | 2 +- src/mame/video/gameplan.c | 2 +- src/mame/video/naughtyb.c | 2 +- src/mess/drivers/bbc.c | 2 +- src/mess/includes/bbc.h | 2 +- src/mess/machine/bbc.c | 2 +- src/mess/video/bbc.c | 2 +- 26 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index e27870108b5..33aec56ae80 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brad Oliver, Eric Smith, Juergen Buchmueller /***************************************************************************** * diff --git a/src/emu/sound/pokey.h b/src/emu/sound/pokey.h index c2cf13ba477..96c9f672246 100644 --- a/src/emu/sound/pokey.h +++ b/src/emu/sound/pokey.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brad Oliver, Eric Smith, Juergen Buchmueller /***************************************************************************** * diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index 1683613309b..065ca46b23f 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore, Nicola Salmoria /*************************************************************************** diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c index a0aadecb296..6b155075488 100644 --- a/src/mame/drivers/cheekyms.c +++ b/src/mame/drivers/cheekyms.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Lee Taylor, Chris Moore /************************************************************************* Universal Cheeky Mouse Driver diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c index 3094ff3450e..988e014330b 100644 --- a/src/mame/drivers/dmndrby.c +++ b/src/mame/drivers/dmndrby.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Angelo Salese, David Haywood, Mike Green /******************************************************************************************* diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c index 236a761b9f6..7d18687fed4 100644 --- a/src/mame/drivers/firefox.c +++ b/src/mame/drivers/firefox.c @@ -1,5 +1,5 @@ -// license:??? -// copyright-holders:smf, Aaron Giles, Chris Hardy, Scott Waye +// license:BSD-3-Clause +// copyright-holders:smf, Aaron Giles, Chris Hardy /*************************************************************************** Atari Fire Fox hardware diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c index a8bc03e56ce..90161a9f3d3 100644 --- a/src/mame/drivers/gameplan.c +++ b/src/mame/drivers/gameplan.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore /*************************************************************************** diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c index bcc89e59a34..d1f409d131f 100644 --- a/src/mame/drivers/naughtyb.c +++ b/src/mame/drivers/naughtyb.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brad Oliver,Sal and John Bugliarisi,Paul Priest /*************************************************************************** diff --git a/src/mame/drivers/pse.c b/src/mame/drivers/pse.c index 40fa2859b3c..d24aca5a0d0 100644 --- a/src/mame/drivers/pse.c +++ b/src/mame/drivers/pse.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Fabio Priuli,Dave Widel, gregf /*************************************************************************** diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h index aff69a0391d..61a18a94ca8 100644 --- a/src/mame/includes/bublbobl.h +++ b/src/mame/includes/bublbobl.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore, Nicola Salmoria class bublbobl_state : public driver_device diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h index d40d9e4dc77..4e6ce443d99 100644 --- a/src/mame/includes/cheekyms.h +++ b/src/mame/includes/cheekyms.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Lee Taylor, Chris Moore /************************************************************************* diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h index 21e29d9b7d8..700a2e1e4ea 100644 --- a/src/mame/includes/gameplan.h +++ b/src/mame/includes/gameplan.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore /*************************************************************************** diff --git a/src/mame/includes/naughtyb.h b/src/mame/includes/naughtyb.h index 42aa42b5f1c..33ee7367396 100644 --- a/src/mame/includes/naughtyb.h +++ b/src/mame/includes/naughtyb.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brad Oliver,Sal and John Bugliarisi,Paul Priest #include "audio/pleiads.h" diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index 5fb2ad4e140..84a3a6c125b 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore, Nicola Salmoria /*************************************************************************** diff --git a/src/mame/machine/mathbox.c b/src/mame/machine/mathbox.c index 5a7ae2f2b17..7b014ed1158 100644 --- a/src/mame/machine/mathbox.c +++ b/src/mame/machine/mathbox.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Eric Smith /* * mathbox.c: math box simulation (Battlezone/Red Baron/Tempest) diff --git a/src/mame/machine/mathbox.h b/src/mame/machine/mathbox.h index 5ff280477b2..bbc35505b8d 100644 --- a/src/mame/machine/mathbox.h +++ b/src/mame/machine/mathbox.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Eric Smith /* * mathbox.h: math box simulation (Battlezone/Red Baron/Tempest) diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c index 66ef84ca034..1b5d6b3b37b 100644 --- a/src/mame/video/avgdvg.c +++ b/src/mame/video/avgdvg.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Eric Smith, Brad Oliver, Bernd Wiebelt, Aaron Giles, Andrew Caldwell /************************************************************************* diff --git a/src/mame/video/avgdvg.h b/src/mame/video/avgdvg.h index 2a455974dc0..79f923e7f46 100644 --- a/src/mame/video/avgdvg.h +++ b/src/mame/video/avgdvg.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Eric Smith, Brad Oliver, Bernd Wiebelt, Aaron Giles, Andrew Caldwell #ifndef __AVGDVG__ #define __AVGDVG__ diff --git a/src/mame/video/bublbobl.c b/src/mame/video/bublbobl.c index 9ec2ca6bb37..5efdd4db370 100644 --- a/src/mame/video/bublbobl.c +++ b/src/mame/video/bublbobl.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore, Nicola Salmoria /*************************************************************************** diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c index ec317af70ec..99a98580f82 100644 --- a/src/mame/video/cheekyms.c +++ b/src/mame/video/cheekyms.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Lee Taylor, Chris Moore /************************************************************************* Universal Cheeky Mouse Driver diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c index 9d51a2b59ef..e20324372e0 100644 --- a/src/mame/video/gameplan.c +++ b/src/mame/video/gameplan.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Chris Moore /*************************************************************************** diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c index 7a9da39b827..fea1e0227d8 100644 --- a/src/mame/video/naughtyb.c +++ b/src/mame/video/naughtyb.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brad Oliver,Sal and John Bugliarisi,Paul Priest /*************************************************************************** diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c index 5a4df8785ac..de7f17dee44 100644 --- a/src/mess/drivers/bbc.c +++ b/src/mess/drivers/bbc.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Gordon Jefferyes, Nigel Barnes /****************************************************************************** BBC Model A,B diff --git a/src/mess/includes/bbc.h b/src/mess/includes/bbc.h index 499283e8ec3..11bd1c13eb1 100644 --- a/src/mess/includes/bbc.h +++ b/src/mess/includes/bbc.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Gordon Jefferyes, Nigel Barnes /***************************************************************************** * diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index 1fc4d5c22da..d0a5572540e 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Gordon Jefferyes, Nigel Barnes /****************************************************************************** BBC Model B diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c index 06400a45ed8..8297f4cacaf 100644 --- a/src/mess/video/bbc.c +++ b/src/mess/video/bbc.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Gordon Jefferyes, Nigel Barnes /****************************************************************************** BBC Model B From 0f170cfe31172324686886b8c1aedc01822681bc Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 2 Jun 2015 16:23:13 +0200 Subject: [PATCH 100/284] rm380z: updated to use the new wd fdc --- src/mess/drivers/rm380z.c | 20 +++++++------------ src/mess/includes/rm380z.h | 10 +++++++--- src/mess/machine/rm380z.c | 39 ++++++++------------------------------ 3 files changed, 22 insertions(+), 47 deletions(-) diff --git a/src/mess/drivers/rm380z.c b/src/mess/drivers/rm380z.c index 2765039f172..e14d6586a59 100644 --- a/src/mess/drivers/rm380z.c +++ b/src/mess/drivers/rm380z.c @@ -103,10 +103,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( rm380z_io , AS_IO, 8, rm380z_state) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0xbf) AM_READWRITE(rm380z_portlow_r, rm380z_portlow_w) - AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("wd1771", fd1771_device, status_r, command_w) - AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("wd1771", fd1771_device, track_r, track_w) - AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE("wd1771", fd1771_device, sector_r, sector_w) - AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_device, data_r, data_w) + AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_t, read, write) AM_RANGE(0xc4, 0xc4) AM_WRITE(disk_0_control) AM_RANGE(0xc5, 0xff) AM_READWRITE(rm380z_porthi_r, rm380z_porthi_w) ADDRESS_MAP_END @@ -120,12 +117,9 @@ INPUT_PORTS_END // // -static const floppy_interface rm380z_floppy_interface = -{ - FLOPPY_STANDARD_5_25_SSSD, - LEGACY_FLOPPY_OPTIONS_NAME(default), - NULL -}; +static SLOT_INTERFACE_START( rm380z_floppies ) + SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) +SLOT_INTERFACE_END UINT32 rm380z_state::screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { @@ -157,10 +151,10 @@ static MACHINE_CONFIG_START( rm380z, rm380z_state ) MCFG_RAM_DEFAULT_SIZE("56K") /* floppy disk */ - MCFG_DEVICE_ADD("wd1771", FD1771, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS + MCFG_FD1771x_ADD("wd1771", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(rm380z_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("wd1771:0", rm380z_floppies, "sssd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd1771:1", rm380z_floppies, "sssd", floppy_image_device::default_floppy_formats) /* keyboard */ MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) diff --git a/src/mess/includes/rm380z.h b/src/mess/includes/rm380z.h index 394446daeca..b3b47a23bfd 100644 --- a/src/mess/includes/rm380z.h +++ b/src/mess/includes/rm380z.h @@ -14,7 +14,7 @@ Research Machines RM 380Z #include "cpu/z80/z80.h" #include "machine/ram.h" #include "imagedev/flopdrv.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/keyboard.h" // @@ -89,13 +89,17 @@ public: required_device m_maincpu; required_device m_messram; - optional_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; rm380z_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, RM380Z_MAINCPU_TAG), m_messram(*this, RAM_TAG), - m_fdc(*this, "wd1771") + m_fdc(*this, "wd1771"), + m_floppy0(*this, "wd1771:0"), + m_floppy1(*this, "wd1771:1") { } diff --git a/src/mess/machine/rm380z.c b/src/mess/machine/rm380z.c index 4fb941b82b9..082dbf6ff75 100644 --- a/src/mess/machine/rm380z.c +++ b/src/mess/machine/rm380z.c @@ -210,41 +210,18 @@ WRITE8_MEMBER( rm380z_state::keyboard_put ) WRITE8_MEMBER( rm380z_state::disk_0_control ) { - fd1771_device *fdc = machine().device("wd1771"); + floppy_image_device *floppy = NULL; - //printf("disk drive port0 write [%x]\n",data); + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); - // drive port0 - if (data&0x01) - { - // drive select bit 0 - fdc->set_drive(0); - } + m_fdc->set_floppy(floppy); - if (data&0x02) - { - // drive select bit 1 - fdc->set_drive(1); - } - - if (data&0x08) - { - // motor on - } - - // "MSEL (dir/side select bit)" - if (data&0x20) - { - fdc->set_side(1); - } - else - { - fdc->set_side(0); - } - - // set drive en- (?) - if (data&0x40) + if (floppy) { + // don't know how motor on is connected + floppy->mon_w(0); + floppy->ss_w(BIT(data, 5)); } } From 3e7cb131480611d10e36725b87c5bbcb1b82fd5f Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jun 2015 16:29:23 +0200 Subject: [PATCH 101/284] made branch condition and add/sub carry param optional --- src/emu/cpu/mn10200/mn10200.c | 61 ++++++++++++++++++----------------- src/emu/cpu/mn10200/mn10200.h | 8 ++--- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c index e05c032c91c..4a784b78844 100644 --- a/src/emu/cpu/mn10200/mn10200.c +++ b/src/emu/cpu/mn10200/mn10200.c @@ -479,9 +479,9 @@ void mn10200_device::do_jsr(UINT32 to, UINT32 ret) change_pc(to); } -void mn10200_device::do_branch(bool state) +void mn10200_device::do_branch(int condition) { - if (state) + if (condition) { m_cycles -= 1; change_pc(m_pc + (INT8)read_arg8(m_pc)); @@ -494,6 +494,7 @@ void mn10200_device::execute_run() { while (m_cycles > 0) { + // internal peripheral, external pin, or prev instruction may have changed irq state while (m_possible_irq) { @@ -579,13 +580,13 @@ void mn10200_device::execute_run() // add dn, dm case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: - m_d[op&3] = do_add(m_d[op&3], m_d[op>>2&3], 0); + m_d[op&3] = do_add(m_d[op&3], m_d[op>>2&3]); break; // sub dn, dm case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - m_d[op&3] = do_sub(m_d[op&3], m_d[op>>2&3], 0); + m_d[op&3] = do_sub(m_d[op&3], m_d[op>>2&3]); break; // extx dn @@ -634,19 +635,19 @@ void mn10200_device::execute_run() // add imm8, an case 0xd0: case 0xd1: case 0xd2: case 0xd3: - m_a[op&3] = do_add(m_a[op&3], (INT8)read_arg8(m_pc), 0); + m_a[op&3] = do_add(m_a[op&3], (INT8)read_arg8(m_pc)); m_pc += 1; break; // add imm8, dn case 0xd4: case 0xd5: case 0xd6: case 0xd7: - m_d[op&3] = do_add(m_d[op&3], (INT8)read_arg8(m_pc), 0); + m_d[op&3] = do_add(m_d[op&3], (INT8)read_arg8(m_pc)); m_pc += 1; break; // cmp imm8, dn case 0xd8: case 0xd9: case 0xda: case 0xdb: - do_sub(m_d[op&3], (INT8)read_arg8(m_pc), 0); + do_sub(m_d[op&3], (INT8)read_arg8(m_pc)); m_pc += 1; break; @@ -718,7 +719,7 @@ void mn10200_device::execute_run() // bra label8 case 0xea: - do_branch(true); + do_branch(); m_pc += 1; break; @@ -733,7 +734,7 @@ void mn10200_device::execute_run() // cmp imm16, an case 0xec: case 0xed: case 0xee: case 0xef: - do_sub(m_a[op&3], read_arg16(m_pc), 0); + do_sub(m_a[op&3], read_arg16(m_pc)); m_pc += 2; break; @@ -904,17 +905,17 @@ void mn10200_device::execute_run() { // add dm, an case 0x00: - m_a[op&3] = do_add(m_a[op&3], m_d[op>>2&3], 0); + m_a[op&3] = do_add(m_a[op&3], m_d[op>>2&3]); break; // sub dm, an case 0x10: - m_a[op&3] = do_sub(m_a[op&3], m_d[op>>2&3], 0); + m_a[op&3] = do_sub(m_a[op&3], m_d[op>>2&3]); break; // cmp dm, an case 0x20: - do_sub(m_a[op&3], m_d[op>>2&3], 0); + do_sub(m_a[op&3], m_d[op>>2&3]); break; // mov dm, an @@ -924,17 +925,17 @@ void mn10200_device::execute_run() // add an, am case 0x40: - m_a[op&3] = do_add(m_a[op&3], m_a[op>>2&3], 0); + m_a[op&3] = do_add(m_a[op&3], m_a[op>>2&3]); break; // sub an, am case 0x50: - m_a[op&3] = do_sub(m_a[op&3], m_a[op>>2&3], 0); + m_a[op&3] = do_sub(m_a[op&3], m_a[op>>2&3]); break; // cmp an, am case 0x60: - do_sub(m_a[op&3], m_a[op>>2&3], 0); + do_sub(m_a[op&3], m_a[op>>2&3]); break; // mov an, am @@ -962,17 +963,17 @@ void mn10200_device::execute_run() // add an, dm case 0xc0: - m_d[op&3] = do_add(m_d[op&3], m_a[op>>2&3], 0); + m_d[op&3] = do_add(m_d[op&3], m_a[op>>2&3]); break; // sub an, dm case 0xd0: - m_d[op&3] = do_sub(m_d[op&3], m_a[op>>2&3], 0); + m_d[op&3] = do_sub(m_d[op&3], m_a[op>>2&3]); break; // cmp an, dm case 0xe0: - do_sub(m_d[op&3], m_a[op>>2&3], 0); + do_sub(m_d[op&3], m_a[op>>2&3]); break; // mov an, dm @@ -1123,7 +1124,7 @@ void mn10200_device::execute_run() // cmp dn, dm case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: - do_sub(m_d[op&3], m_d[op>>2&3], 0); + do_sub(m_d[op&3], m_d[op>>2&3]); break; // mov dn, mdr @@ -1221,22 +1222,22 @@ void mn10200_device::execute_run() // add imm24, dn case 0x60: case 0x61: case 0x62: case 0x63: - m_d[op&3] = do_add(m_d[op&3], read_arg24(m_pc), 0); + m_d[op&3] = do_add(m_d[op&3], read_arg24(m_pc)); break; // add imm24, an case 0x64: case 0x65: case 0x66: case 0x67: - m_a[op&3] = do_add(m_a[op&3], read_arg24(m_pc), 0); + m_a[op&3] = do_add(m_a[op&3], read_arg24(m_pc)); break; // sub imm24, dn case 0x68: case 0x69: case 0x6a: case 0x6b: - m_d[op&3] = do_sub(m_d[op&3], read_arg24(m_pc), 0); + m_d[op&3] = do_sub(m_d[op&3], read_arg24(m_pc)); break; // sub imm24, an case 0x6c: case 0x6d: case 0x6e: case 0x6f: - m_a[op&3] = do_sub(m_a[op&3], read_arg24(m_pc), 0); + m_a[op&3] = do_sub(m_a[op&3], read_arg24(m_pc)); break; // mov imm24, dn @@ -1251,12 +1252,12 @@ void mn10200_device::execute_run() // cmp imm24, dn case 0x78: case 0x79: case 0x7a: case 0x7b: - do_sub(m_d[op&3], read_arg24(m_pc), 0); + do_sub(m_d[op&3], read_arg24(m_pc)); break; // cmp imm24, an case 0x7c: case 0x7d: case 0x7e: case 0x7f: - do_sub(m_a[op&3], read_arg24(m_pc), 0); + do_sub(m_a[op&3], read_arg24(m_pc)); break; // mov (d24, an), dm @@ -1514,12 +1515,12 @@ void mn10200_device::execute_run() // add imm16, an case 0x08: case 0x09: case 0x0a: case 0x0b: - m_a[op&3] = do_add(m_a[op&3], (INT16)read_arg16(m_pc), 0); + m_a[op&3] = do_add(m_a[op&3], (INT16)read_arg16(m_pc)); break; // sub imm16, an case 0x0c: case 0x0d: case 0x0e: case 0x0f: - m_a[op&3] = do_sub(m_a[op&3], (INT16)read_arg16(m_pc), 0); + m_a[op&3] = do_sub(m_a[op&3], (INT16)read_arg16(m_pc)); break; // and imm16, psw @@ -1537,12 +1538,12 @@ void mn10200_device::execute_run() // add imm16, dn case 0x18: case 0x19: case 0x1a: case 0x1b: - m_d[op&3] = do_add(m_d[op&3], (INT16)read_arg16(m_pc), 0); + m_d[op&3] = do_add(m_d[op&3], (INT16)read_arg16(m_pc)); break; // sub imm16, dn case 0x1c: case 0x1d: case 0x1e: case 0x1f: - m_d[op&3] = do_sub(m_d[op&3], (INT16)read_arg16(m_pc), 0); + m_d[op&3] = do_sub(m_d[op&3], (INT16)read_arg16(m_pc)); break; // mov an, (abs16) @@ -1564,7 +1565,7 @@ void mn10200_device::execute_run() // cmp imm16, dn case 0x48: case 0x49: case 0x4a: case 0x4b: - do_sub(m_d[op&3], (INT16)read_arg16(m_pc), 0); + do_sub(m_d[op&3], (INT16)read_arg16(m_pc)); break; // xor imm16, dn diff --git a/src/emu/cpu/mn10200/mn10200.h b/src/emu/cpu/mn10200/mn10200.h index 61ebb96fb0c..d0e59530457 100644 --- a/src/emu/cpu/mn10200/mn10200.h +++ b/src/emu/cpu/mn10200/mn10200.h @@ -76,7 +76,7 @@ protected: virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return (clocks + 2 - 1) / 2; } // internal /2 divider virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return (cycles * 2); } // internal /2 divider virtual UINT32 execute_min_cycles() const { return 1; } - virtual UINT32 execute_max_cycles() const { return 13; } + virtual UINT32 execute_max_cycles() const { return 13+7; } // max opcode cycles + interrupt duration virtual UINT32 execute_input_lines() const { return 4; } virtual void execute_run(); virtual void execute_set_input(int inputnum, int state); @@ -193,11 +193,11 @@ private: int timer_tick_simple(int tmr); TIMER_CALLBACK_MEMBER( simple_timer_cb ); void illegal(UINT8 prefix, UINT8 op); - UINT32 do_add(UINT32 a, UINT32 b, UINT32 c); - UINT32 do_sub(UINT32 a, UINT32 b, UINT32 c); + UINT32 do_add(UINT32 a, UINT32 b, UINT32 c = 0); + UINT32 do_sub(UINT32 a, UINT32 b, UINT32 c = 0); void test_nz16(UINT16 v); void do_jsr(UINT32 to, UINT32 ret); - void do_branch(bool state); + void do_branch(int condition = 1); }; From 0ebc3e5033b3aa0284148ab5daf4d6ba41fad911 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 2 Jun 2015 17:15:15 +0200 Subject: [PATCH 102/284] vector06: updated to use the new wd fdc. system appears to be broken but loads some sectors from disk. --- scripts/src/lib.lua | 2 ++ src/lib/formats/vector06_dsk.c | 44 ++++++++++++++++++++++++++++++++++ src/lib/formats/vector06_dsk.h | 33 +++++++++++++++++++++++++ src/mess/drivers/vector06.c | 38 +++++++++++++---------------- src/mess/includes/vector06.h | 11 ++++++--- src/mess/machine/vector06.c | 18 +++++++++++--- 6 files changed, 118 insertions(+), 28 deletions(-) create mode 100644 src/lib/formats/vector06_dsk.c create mode 100644 src/lib/formats/vector06_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 611ed2ae9d9..5fc9603849e 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -383,6 +383,8 @@ project "formats" MAME_DIR .. "src/lib/formats/upd765_dsk.h", MAME_DIR .. "src/lib/formats/vdk_dsk.c", MAME_DIR .. "src/lib/formats/vdk_dsk.h", + MAME_DIR .. "src/lib/formats/vector06_dsk.c", + MAME_DIR .. "src/lib/formats/vector06_dsk.h", MAME_DIR .. "src/lib/formats/victor9k_dsk.c", MAME_DIR .. "src/lib/formats/victor9k_dsk.h", MAME_DIR .. "src/lib/formats/vg5k_cas.c", diff --git a/src/lib/formats/vector06_dsk.c b/src/lib/formats/vector06_dsk.c new file mode 100644 index 00000000000..b423f4b7154 --- /dev/null +++ b/src/lib/formats/vector06_dsk.c @@ -0,0 +1,44 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Vector 06 + + Disk image format + + TODO: + - Gap sizes + +***************************************************************************/ + +#include "vector06_dsk.h" + +vector06_format::vector06_format() : wd177x_format(formats) +{ +} + +const char *vector06_format::name() const +{ + return "vector06"; +} + +const char *vector06_format::description() const +{ + return "Vector 06 disk image"; +} + +const char *vector06_format::extensions() const +{ + return "fdd"; +} + +const vector06_format::format vector06_format::formats[] = +{ + { + floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM, + 2000, 5, 82, 2, 1024, {}, 1, {}, 80, 22, 24 + }, + {} +}; + +const floppy_format_type FLOPPY_VECTOR06_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/vector06_dsk.h b/src/lib/formats/vector06_dsk.h new file mode 100644 index 00000000000..cad2fa3ddf3 --- /dev/null +++ b/src/lib/formats/vector06_dsk.h @@ -0,0 +1,33 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Vector 06 + + Disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __VECTOR06_DSK_H__ +#define __VECTOR06_DSK_H__ + +#include "wd177x_dsk.h" + +class vector06_format : public wd177x_format +{ +public: + vector06_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_VECTOR06_FORMAT; + +#endif // __VECTOR06_DSK_H__ diff --git a/src/mess/drivers/vector06.c b/src/mess/drivers/vector06.c index 208a5feb15c..444692617a5 100644 --- a/src/mess/drivers/vector06.c +++ b/src/mess/drivers/vector06.c @@ -9,6 +9,7 @@ ****************************************************************************/ #include "includes/vector06.h" +#include "formats/vector06_dsk.h" /* Address maps */ @@ -23,10 +24,10 @@ static ADDRESS_MAP_START(vector06_io, AS_IO, 8, vector06_state) AM_RANGE( 0x00, 0x03) AM_READWRITE(vector06_8255_1_r, vector06_8255_1_w ) AM_RANGE( 0x04, 0x07) AM_READWRITE(vector06_8255_2_r, vector06_8255_2_w ) AM_RANGE( 0x0C, 0x0C) AM_WRITE(vector06_color_set) - AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", fd1793_device, data_r, data_w) - AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", fd1793_device, sector_r, sector_w) - AM_RANGE( 0x1A, 0x1A) AM_DEVREADWRITE("wd1793", fd1793_device, track_r, track_w) - AM_RANGE( 0x1B, 0x1B) AM_DEVREADWRITE("wd1793", fd1793_device, status_r, command_w) + AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", fd1793_t, data_r, data_w) + AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", fd1793_t, sector_r, sector_w) + AM_RANGE( 0x1a, 0x1a) AM_DEVREADWRITE("wd1793", fd1793_t, track_r, track_w) + AM_RANGE( 0x1b, 0x1b) AM_DEVREADWRITE("wd1793", fd1793_t, status_r, cmd_w) AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector06_disc_w) ADDRESS_MAP_END @@ -119,21 +120,15 @@ static INPUT_PORTS_START( vector06 ) INPUT_PORTS_END -static LEGACY_FLOPPY_OPTIONS_START(vector) - LEGACY_FLOPPY_OPTION(vector, "fdd", "Vector disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([82]) - SECTORS([5]) - SECTOR_LENGTH([1024]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -static const floppy_interface vector_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(vector), - NULL -}; +FLOPPY_FORMATS_MEMBER( vector06_state::floppy_formats ) + FLOPPY_VECTOR06_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( vector06_floppies ) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END + /* Machine driver */ static MACHINE_CONFIG_START( vector06, vector06_state ) @@ -176,11 +171,10 @@ static MACHINE_CONFIG_START( vector06, vector06_state ) MCFG_CASSETTE_ADD("cassette") MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) - MCFG_DEVICE_ADD("wd1793", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_DDEN_CALLBACK(VCC) + MCFG_FD1793x_ADD("wd1793", XTAL_1MHz) - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(vector_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("wd1793:0", vector06_floppies, "qd", vector06_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd1793:1", vector06_floppies, "qd", vector06_state::floppy_formats) /* cartridge */ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "vector06_cart") diff --git a/src/mess/includes/vector06.h b/src/mess/includes/vector06.h index a35e1467509..970965465ef 100644 --- a/src/mess/includes/vector06.h +++ b/src/mess/includes/vector06.h @@ -15,10 +15,9 @@ #include "sound/wave.h" #include "machine/i8255.h" #include "machine/ram.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "imagedev/cassette.h" #include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" @@ -32,16 +31,22 @@ public: m_cassette(*this, "cassette"), m_cart(*this, "cartslot"), m_fdc(*this, "wd1793"), + m_floppy0(*this, "wd1793:0"), + m_floppy1(*this, "wd1793:1"), m_ppi(*this, "ppi8255"), m_ppi2(*this, "ppi8255_2"), m_ram(*this, RAM_TAG), m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; required_device m_cassette; required_device m_cart; - required_device m_fdc; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; required_device m_ppi; required_device m_ppi2; required_device m_ram; diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c index e0c436a6239..b6f4e353fed 100644 --- a/src/mess/machine/vector06.c +++ b/src/mess/machine/vector06.c @@ -138,10 +138,22 @@ TIMER_CALLBACK_MEMBER(vector06_state::reset_check_callback) WRITE8_MEMBER( vector06_state::vector06_disc_w ) { -// something here needs to turn the motor on + floppy_image_device *floppy = NULL; - m_fdc->set_side (BIT(data, 2) ^ 1); - m_fdc->set_drive(BIT(data, 0)); + switch (data & 0x01) + { + case 0: floppy = m_floppy0->get_device(); break; + case 1: floppy = m_floppy1->get_device(); break; + } + + m_fdc->set_floppy(floppy); + + if (floppy) + { + // something here needs to turn the motor on + floppy->mon_w(0); + floppy->ss_w(!BIT(data, 2)); + } } void vector06_state::machine_start() From c325f48069737463c4ec6c72228e881232dec861 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jun 2015 18:24:18 +0200 Subject: [PATCH 103/284] correct zsg2 internal clock --- src/emu/sound/zsg2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c index e6b9f6af450..4f3f1a42ca9 100644 --- a/src/emu/sound/zsg2.c +++ b/src/emu/sound/zsg2.c @@ -47,7 +47,6 @@ TODO: - volume/panning is linear? volume slides are too steep - most music sounds tinny, probably due to missing DSP? - what is reg 0xa/0xc? seems related to volume -- chip should running at 31khz (divider of 768 instead of 192) - identify sample flags * bassdrum in shikigam level 1 music is a good hint: it should be one octave lower, indicating possible stereo sample, or base octave(like in ymf278) @@ -86,10 +85,9 @@ void zsg2_device::device_start() memset(&m_chan, 0, sizeof(m_chan)); - m_stream = stream_alloc(0, 2, clock() / 192); + m_stream = stream_alloc(0, 2, clock() / 768); m_mem_blocks = m_mem_base.length(); - m_mem_copy = auto_alloc_array_clear(machine(), UINT32, m_mem_blocks); m_full_samples = auto_alloc_array_clear(machine(), INT16, m_mem_blocks * 4 + 4); // +4 is for empty block @@ -214,7 +212,7 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in continue; m_chan[ch].step_ptr += m_chan[ch].step; - if (m_chan[ch].step_ptr & 0x40000) + if (m_chan[ch].step_ptr & 0x10000) { m_chan[ch].step_ptr &= 0xffff; if (++m_chan[ch].cur_pos >= m_chan[ch].end_pos) @@ -231,7 +229,7 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in m_chan[ch].samples = prepare_samples(m_chan[ch].page | m_chan[ch].cur_pos); } - INT32 sample = (m_chan[ch].samples[m_chan[ch].step_ptr >> 16 & 3] * m_chan[ch].vol) >> 16; + INT32 sample = (m_chan[ch].samples[m_chan[ch].step_ptr >> 14 & 3] * m_chan[ch].vol) >> 16; mix_l += (sample * m_chan[ch].panl + sample * (0x1f - m_chan[ch].panr)) >> 5; mix_r += (sample * m_chan[ch].panr + sample * (0x1f - m_chan[ch].panl)) >> 5; From c5891758cb9fb5cc4a56d2af3c3287fc5e29851f Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jun 2015 19:49:45 +0200 Subject: [PATCH 104/284] changed mn10200 fake i/o memmap to callbacks --- src/emu/cpu/mn10200/mn10200.c | 143 ++++++++++++++++++++++------------ src/emu/cpu/mn10200/mn10200.h | 88 ++++++++++++--------- src/mame/audio/taito_zm.c | 8 +- 3 files changed, 148 insertions(+), 91 deletions(-) diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c index 4a784b78844..0fdb1edd946 100644 --- a/src/emu/cpu/mn10200/mn10200.c +++ b/src/emu/cpu/mn10200/mn10200.c @@ -35,28 +35,88 @@ enum mn10200_flag FLAG_D15 = 0x8000 // ? }; -const device_type MN1020012A = &device_creator; -static ADDRESS_MAP_START( mn1020012_internal_map, AS_PROGRAM, 16, mn10200_device ) +const device_type MN1020012A = &device_creator; + +// internal memory maps +static ADDRESS_MAP_START( mn1020012a_internal_map, AS_PROGRAM, 16, mn10200_device ) AM_RANGE(0x00fc00, 0x00ffff) AM_READWRITE8(io_control_r, io_control_w, 0xffff) ADDRESS_MAP_END -mn10200_device::mn10200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : cpu_device(mconfig, MN1020012A, "MN1020012A", tag, owner, clock, "mn1020012a", __FILE__), - m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, ADDRESS_MAP_NAME(mn1020012_internal_map)), - m_io_config("data", ENDIANNESS_LITTLE, 8, 8, 0) + +// device definitions +mn1020012a_device::mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : mn10200_device(mconfig, MN1020012A, "MN1020012A", tag, owner, clock, ADDRESS_MAP_NAME(mn1020012a_internal_map), "mn1020012a", __FILE__) +{ } + + +// disasm +void mn10200_device::state_string_export(const device_state_entry &entry, std::string &str) { + switch (entry.index()) + { + case STATE_GENFLAGS: + strprintf(str, "S=%d irq=%s im=%d %c%c%c%c %c%c%c%c", + (m_psw >> 12) & 3, + m_psw & FLAG_IE ? "on " : "off", + (m_psw >> 8) & 7, + m_psw & FLAG_VX ? 'V' : '-', + m_psw & FLAG_CX ? 'C' : '-', + m_psw & FLAG_NX ? 'N' : '-', + m_psw & FLAG_ZX ? 'Z' : '-', + m_psw & FLAG_VF ? 'v' : '-', + m_psw & FLAG_CF ? 'c' : '-', + m_psw & FLAG_NF ? 'n' : '-', + m_psw & FLAG_ZF ? 'z' : '-'); + break; + } } +offs_t mn10200_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE( mn10200 ); + return CPU_DISASSEMBLE_NAME(mn10200)(this, buffer, pc, oprom, opram, options); +} + + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- +enum +{ + MN10200_PC = 0, + MN10200_PSW, + MN10200_MDR, + MN10200_D0, + MN10200_D1, + MN10200_D2, + MN10200_D3, + MN10200_A0, + MN10200_A1, + MN10200_A2, + MN10200_A3, + MN10200_NMICR, + MN10200_IAGR +}; + void mn10200_device::device_start() { m_program = &space(AS_PROGRAM); - m_io = &space(AS_IO); + + // resolve callbacks + m_read_port0.resolve_safe(0xff); + m_read_port1.resolve_safe(0xff); + m_read_port2.resolve_safe(0xff); + m_read_port3.resolve_safe(0xff); + m_read_port4.resolve_safe(0xff); + + m_write_port0.resolve_safe(); + m_write_port1.resolve_safe(); + m_write_port2.resolve_safe(); + m_write_port3.resolve_safe(); + m_write_port4.resolve_safe(); // init and register for savestates save_item(NAME(m_pc)); @@ -176,34 +236,6 @@ void mn10200_device::device_start() } -void mn10200_device::state_string_export(const device_state_entry &entry, std::string &str) -{ - switch (entry.index()) - { - case STATE_GENFLAGS: - strprintf(str, "S=%d irq=%s im=%d %c%c%c%c %c%c%c%c", - (m_psw >> 12) & 3, - m_psw & FLAG_IE ? "on " : "off", - (m_psw >> 8) & 7, - m_psw & FLAG_VX ? 'V' : '-', - m_psw & FLAG_CX ? 'C' : '-', - m_psw & FLAG_NX ? 'N' : '-', - m_psw & FLAG_ZX ? 'Z' : '-', - m_psw & FLAG_VF ? 'v' : '-', - m_psw & FLAG_CF ? 'c' : '-', - m_psw & FLAG_NF ? 'n' : '-', - m_psw & FLAG_ZF ? 'z' : '-'); - break; - } -} - - -offs_t mn10200_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) -{ - extern CPU_DISASSEMBLE( mn10200 ); - return CPU_DISASSEMBLE_NAME(mn10200)(this, buffer, pc, oprom, opram, options); -} - //------------------------------------------------- // device_reset - device-specific reset @@ -234,7 +266,10 @@ void mn10200_device::device_reset() } -// interrupts + +//------------------------------------------------- +// interrupts +//------------------------------------------------- void mn10200_device::take_irq(int level, int group) { @@ -332,7 +367,10 @@ void mn10200_device::execute_set_input(int irqnum, int state) } -// 8-bit timers + +//------------------------------------------------- +// timers +//------------------------------------------------- int mn10200_device::timer_tick_simple(int tmr) { @@ -405,7 +443,10 @@ TIMER_CALLBACK_MEMBER( mn10200_device::simple_timer_cb ) } -// opcode handlers + +//------------------------------------------------- +// opcode helpers +//------------------------------------------------- void mn10200_device::illegal(UINT8 prefix, UINT8 op) { @@ -490,6 +531,10 @@ void mn10200_device::do_branch(int condition) +//------------------------------------------------- +// execute loop +//------------------------------------------------- + void mn10200_device::execute_run() { while (m_cycles > 0) @@ -1645,7 +1690,10 @@ void mn10200_device::execute_run() } -// internal i/o + +//------------------------------------------------- +// internal i/o +//------------------------------------------------- WRITE8_MEMBER(mn10200_device::io_control_w) { @@ -2008,19 +2056,19 @@ WRITE8_MEMBER(mn10200_device::io_control_w) // outputs case 0x3c0: m_port[0].out = data; - m_io->write_byte(MN10200_PORT0, m_port[0].out | (m_port[0].dir ^ 0xff)); + m_write_port0(MN10200_PORT0, m_port[0].out | (m_port[0].dir ^ 0xff), 0xff); break; case 0x264: m_port[1].out = data; - m_io->write_byte(MN10200_PORT1, m_port[1].out | (m_port[1].dir ^ 0xff)); + m_write_port1(MN10200_PORT1, m_port[1].out | (m_port[1].dir ^ 0xff), 0xff); break; case 0x3c2: m_port[2].out = data & 0x0f; - m_io->write_byte(MN10200_PORT2, m_port[2].out | (m_port[2].dir ^ 0x0f)); + m_write_port2(MN10200_PORT2, m_port[2].out | (m_port[2].dir ^ 0x0f), 0xff); break; case 0x3c3: m_port[3].out = data & 0x1f; - m_io->write_byte(MN10200_PORT3, m_port[3].out | (m_port[3].dir ^ 0x1f)); + m_write_port3(MN10200_PORT3, m_port[3].out | (m_port[3].dir ^ 0x1f), 0xff); break; // directions (0=input, 1=output) @@ -2050,7 +2098,6 @@ WRITE8_MEMBER(mn10200_device::io_control_w) } - READ8_MEMBER(mn10200_device::io_control_r) { switch (offset) @@ -2152,13 +2199,13 @@ READ8_MEMBER(mn10200_device::io_control_r) // inputs case 0x3d0: - return m_io->read_byte(MN10200_PORT0) | m_port[0].dir; + return m_read_port0(MN10200_PORT0, 0xff) | m_port[0].dir; case 0x3d1: - return m_io->read_byte(MN10200_PORT1) | m_port[1].dir; + return m_read_port1(MN10200_PORT1, 0xff) | m_port[1].dir; case 0x3d2: - return (m_io->read_byte(MN10200_PORT2) & 0x0f) | m_port[2].dir; + return (m_read_port2(MN10200_PORT2, 0xff) & 0x0f) | m_port[2].dir; case 0x3d3: - return (m_io->read_byte(MN10200_PORT3) & 0x1f) | m_port[3].dir; + return (m_read_port3(MN10200_PORT3, 0xff) & 0x1f) | m_port[3].dir; // directions (0=input, 1=output) case 0x3e0: diff --git a/src/emu/cpu/mn10200/mn10200.h b/src/emu/cpu/mn10200/mn10200.h index d0e59530457..59be253f852 100644 --- a/src/emu/cpu/mn10200/mn10200.h +++ b/src/emu/cpu/mn10200/mn10200.h @@ -8,27 +8,14 @@ */ -#pragma once - #ifndef MN10200_H #define MN10200_H -enum -{ - MN10200_PC = 0, - MN10200_PSW, - MN10200_MDR, - MN10200_D0, - MN10200_D1, - MN10200_D2, - MN10200_D3, - MN10200_A0, - MN10200_A1, - MN10200_A2, - MN10200_A3, - MN10200_NMICR, - MN10200_IAGR -}; +// port setup +#define MCFG_MN10200_READ_PORT_CB(X, _devcb) \ + mn10200_device::set_read_port##X##_callback(*device, DEVCB_##_devcb); +#define MCFG_MN10200_WRITE_PORT_CB(X, _devcb) \ + mn10200_device::set_write_port##X##_callback(*device, DEVCB_##_devcb); enum { @@ -50,9 +37,6 @@ enum }; -extern const device_type MN1020012A; - - #define MN10200_NUM_PRESCALERS (2) #define MN10200_NUM_TIMERS_8BIT (10) #define MN10200_NUM_IRQ_GROUPS (31) @@ -62,7 +46,25 @@ class mn10200_device : public cpu_device { public: // construction/destruction - mn10200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mn10200_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor program, const char *shortname, const char *source) + : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) + , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program) + , m_read_port0(*this), m_read_port1(*this), m_read_port2(*this), m_read_port3(*this), m_read_port4(*this) + , m_write_port0(*this), m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this) + { } + + // static configuration helpers + template static devcb_base &set_read_port0_callback(device_t &device, _Object object) { return downcast(device).m_read_port0.set_callback(object); } + template static devcb_base &set_read_port1_callback(device_t &device, _Object object) { return downcast(device).m_read_port1.set_callback(object); } + template static devcb_base &set_read_port2_callback(device_t &device, _Object object) { return downcast(device).m_read_port2.set_callback(object); } + template static devcb_base &set_read_port3_callback(device_t &device, _Object object) { return downcast(device).m_read_port3.set_callback(object); } + template static devcb_base &set_read_port4_callback(device_t &device, _Object object) { return downcast(device).m_read_port4.set_callback(object); } + + template static devcb_base &set_write_port0_callback(device_t &device, _Object object) { return downcast(device).m_write_port0.set_callback(object); } + template static devcb_base &set_write_port1_callback(device_t &device, _Object object) { return downcast(device).m_write_port1.set_callback(object); } + template static devcb_base &set_write_port2_callback(device_t &device, _Object object) { return downcast(device).m_write_port2.set_callback(object); } + template static devcb_base &set_write_port3_callback(device_t &device, _Object object) { return downcast(device).m_write_port3.set_callback(object); } + template static devcb_base &set_write_port4_callback(device_t &device, _Object object) { return downcast(device).m_write_port4.set_callback(object); } DECLARE_READ8_MEMBER(io_control_r); DECLARE_WRITE8_MEMBER(io_control_w); @@ -82,10 +84,7 @@ protected: virtual void execute_set_input(int inputnum, int state); // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const - { - return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); - } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; } // device_state_interface overrides void state_string_export(const device_state_entry &entry, std::string &str); @@ -97,10 +96,11 @@ protected: private: address_space_config m_program_config; - address_space_config m_io_config; - address_space *m_program; - address_space *m_io; + + // i/o handlers + devcb_read8 m_read_port0, m_read_port1, m_read_port2, m_read_port3, m_read_port4; + devcb_write8 m_write_port0, m_write_port1, m_write_port2, m_write_port3, m_write_port4; int m_cycles; @@ -112,6 +112,10 @@ private: UINT16 m_mdr; // interrupts + void take_irq(int level, int group); + void check_irq(); + void check_ext_irq(); + UINT8 m_icrl[MN10200_NUM_IRQ_GROUPS]; UINT8 m_icrh[MN10200_NUM_IRQ_GROUPS]; @@ -122,6 +126,11 @@ private: bool m_possible_irq; // timers + void refresh_timer(int tmr); + void refresh_all_timers(); + int timer_tick_simple(int tmr); + TIMER_CALLBACK_MEMBER( simple_timer_cb ); + attotime m_sysclock_base; emu_timer *m_timer_timers[MN10200_NUM_TIMERS_8BIT]; @@ -185,13 +194,7 @@ private: inline void change_pc(UINT32 pc) { m_pc = pc & 0xffffff; } - void take_irq(int level, int group); - void check_irq(); - void check_ext_irq(); - void refresh_timer(int tmr); - void refresh_all_timers(); - int timer_tick_simple(int tmr); - TIMER_CALLBACK_MEMBER( simple_timer_cb ); + // opcode helpers void illegal(UINT8 prefix, UINT8 op); UINT32 do_add(UINT32 a, UINT32 b, UINT32 c = 0); UINT32 do_sub(UINT32 a, UINT32 b, UINT32 c = 0); @@ -201,4 +204,15 @@ private: }; -#endif +class mn1020012a_device : public mn10200_device +{ +public: + mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + + +extern const device_type MN1020012A; + + +#endif // MN10200_H diff --git a/src/mame/audio/taito_zm.c b/src/mame/audio/taito_zm.c index 74334c5081f..469e048c88f 100644 --- a/src/mame/audio/taito_zm.c +++ b/src/mame/audio/taito_zm.c @@ -114,11 +114,6 @@ ADDRESS_MAP_START( taitozoom_mn_map, AS_PROGRAM, 16, driver_device ) AM_RANGE(0xe00000, 0xe000ff) AM_DEVREADWRITE8("taito_zoom", taito_zoom_device, shared_ram_r, shared_ram_w, 0xffff) // M66220FP for comms with maincpu ADDRESS_MAP_END -static ADDRESS_MAP_START( taitozoom_mn_io_map, AS_IO, 8, driver_device ) - ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(MN10200_PORT1, MN10200_PORT1) AM_DEVREADWRITE("taito_zoom", taito_zoom_device, tms_ctrl_r, tms_ctrl_w) -ADDRESS_MAP_END - /*************************************************************************** @@ -178,8 +173,9 @@ MACHINE_CONFIG_FRAGMENT( taito_zoom_sound ) /* basic machine hardware */ MCFG_TAITO_ZOOM_ADD("taito_zoom") MCFG_CPU_ADD("mn10200", MN1020012A, XTAL_25MHz/2) + MCFG_MN10200_READ_PORT_CB(0, DEVREAD8("taito_zoom", taito_zoom_device, tms_ctrl_r)) + MCFG_MN10200_WRITE_PORT_CB(0, DEVWRITE8("taito_zoom", taito_zoom_device, tms_ctrl_w)) MCFG_CPU_PROGRAM_MAP(taitozoom_mn_map) - MCFG_CPU_IO_MAP(taitozoom_mn_io_map) MCFG_QUANTUM_TIME(attotime::from_hz(60000)) From 78f313bce93ccda6193672f481d3df0239d45327 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jun 2015 20:07:18 +0200 Subject: [PATCH 105/284] woops, wrong port --- src/mame/audio/taito_zm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/audio/taito_zm.c b/src/mame/audio/taito_zm.c index 469e048c88f..069a6536759 100644 --- a/src/mame/audio/taito_zm.c +++ b/src/mame/audio/taito_zm.c @@ -173,8 +173,8 @@ MACHINE_CONFIG_FRAGMENT( taito_zoom_sound ) /* basic machine hardware */ MCFG_TAITO_ZOOM_ADD("taito_zoom") MCFG_CPU_ADD("mn10200", MN1020012A, XTAL_25MHz/2) - MCFG_MN10200_READ_PORT_CB(0, DEVREAD8("taito_zoom", taito_zoom_device, tms_ctrl_r)) - MCFG_MN10200_WRITE_PORT_CB(0, DEVWRITE8("taito_zoom", taito_zoom_device, tms_ctrl_w)) + MCFG_MN10200_READ_PORT_CB(1, DEVREAD8("taito_zoom", taito_zoom_device, tms_ctrl_r)) + MCFG_MN10200_WRITE_PORT_CB(1, DEVWRITE8("taito_zoom", taito_zoom_device, tms_ctrl_w)) MCFG_CPU_PROGRAM_MAP(taitozoom_mn_map) MCFG_QUANTUM_TIME(attotime::from_hz(60000)) From c9f1843c45537707a1fcd8440de8b18a97b5f2ab Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 2 Jun 2015 20:31:53 +0200 Subject: [PATCH 106/284] forgot to actually hook up port K here --- src/mess/drivers/hh_melps4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mess/drivers/hh_melps4.c b/src/mess/drivers/hh_melps4.c index 1aaec668170..a5a8efb9180 100644 --- a/src/mess/drivers/hh_melps4.c +++ b/src/mess/drivers/hh_melps4.c @@ -230,7 +230,7 @@ public: DECLARE_WRITE8_MEMBER(plate_w); DECLARE_WRITE16_MEMBER(grid_w); DECLARE_WRITE_LINE_MEMBER(speaker_w); - DECLARE_READ8_MEMBER(input_r); + DECLARE_READ16_MEMBER(input_r); DECLARE_INPUT_CHANGED_MEMBER(reset_button); }; @@ -269,7 +269,7 @@ WRITE_LINE_MEMBER(cfrogger_state::speaker_w) m_speaker->level_w(state); } -READ8_MEMBER(cfrogger_state::input_r) +READ16_MEMBER(cfrogger_state::input_r) { // K0,K1: multiplexed inputs // K2: N/C @@ -309,6 +309,7 @@ static MACHINE_CONFIG_START( cfrogger, cfrogger_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M58846, XTAL_600kHz) + MCFG_MELPS4_READ_K_CB(READ16(cfrogger_state, input_r)) MCFG_MELPS4_WRITE_S_CB(WRITE8(cfrogger_state, plate_w)) MCFG_MELPS4_WRITE_F_CB(WRITE8(cfrogger_state, plate_w)) MCFG_MELPS4_WRITE_G_CB(WRITE8(cfrogger_state, plate_w)) From 9f9a22428e943ba59b164dcea339e4c05c5187f3 Mon Sep 17 00:00:00 2001 From: andrea-petrucci-1975 Date: Tue, 2 Jun 2015 20:33:20 +0200 Subject: [PATCH 107/284] Gameshark is a clone of Action Replay http://doc.kodewerx.org/hacking_n64.html#devices_gspro http://www.gamewinners.com/device/misc/blgameshark.htm Gameshark and Action Replay for N64 are the exact same device with different names. Action Replay was originally developed by Datel in the UK It was then sold by Interact with the Gameshark label in the U.S. Madcatz now owns that label. They're also called GameBuster in Germany. --- hash/n64.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hash/n64.xml b/hash/n64.xml index 3f7ae425852..2485690fd23 100644 --- a/hash/n64.xml +++ b/hash/n64.xml @@ -11754,7 +11754,7 @@ patched out (+ a fix for internal checksum) - + GameShark Pro (USA, v2.0) 19?? <unknown> @@ -11765,7 +11765,7 @@ patched out (+ a fix for internal checksum) - + GameShark Pro (USA, v3.3) 19?? <unknown> From 892395475198a3f8bbcc59b5a1490b1cd9f4a4bc Mon Sep 17 00:00:00 2001 From: balr0g Date: Tue, 2 Jun 2015 14:38:39 -0400 Subject: [PATCH 108/284] Minor license tag fix (nw) --- src/osd/modules/opengl/SDL1211_opengl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/modules/opengl/SDL1211_opengl.h b/src/osd/modules/opengl/SDL1211_opengl.h index b068ebe6452..2a5db6f3199 100644 --- a/src/osd/modules/opengl/SDL1211_opengl.h +++ b/src/osd/modules/opengl/SDL1211_opengl.h @@ -1,4 +1,4 @@ -// license:GPL-2.0+ +// license:LGPL-2.1+ // copyright-holders:Sam Lantinga /* SDL - Simple DirectMedia Layer From 06cc1e484d2a5838beb76fe540cbbf425a994843 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 3 Jun 2015 00:37:29 +0200 Subject: [PATCH 109/284] audit.c: fixed a crash occurring when trying to mount a CHD from the internal UI. [Fabio Priuli] out of whatsnew: this is the correct fix which replaces the hacky workaround that I had submitted earlier today... --- src/emu/audit.c | 8 +------- src/emu/ui/imgcntrl.c | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/emu/audit.c b/src/emu/audit.c index a6e9910680d..b8ab208d6a0 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -462,16 +462,10 @@ audit_record *media_auditor::audit_one_disk(const rom_entry *rom, const char *lo { // allocate and append a new record audit_record &record = m_record_list.append(*global_alloc(audit_record(*rom, audit_record::MEDIA_DISK))); - chd_error err; // open the disk chd_file source; - if (&m_enumerator.driver() != NULL) - err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag)); - else - // FIXME: this shouldn't be needed, but when trying to load a CDROM from the internal UI for some reason - // the enumerator is created with NULL driver() and we have to catch it by passing through the current options - err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(m_enumerator.find(m_enumerator.options().system_name())), rom, source, locationtag)); + chd_error err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag)); // if we succeeded, get the hashes if (err == CHDERR_NONE) diff --git a/src/emu/ui/imgcntrl.c b/src/emu/ui/imgcntrl.c index 15f487c4c2e..f1166bb3a8a 100644 --- a/src/emu/ui/imgcntrl.c +++ b/src/emu/ui/imgcntrl.c @@ -134,6 +134,7 @@ void ui_menu_control_device_image::load_software_part() std::string temp_name = std::string(sld->list_name()).append(":").append(swi->shortname()).append(":").append(swp->name()); driver_enumerator drivlist(machine().options(), machine().options().system_name()); + drivlist.next(); media_auditor auditor(drivlist); media_auditor::summary summary = auditor.audit_software(sld->list_name(), (software_info *)swi, AUDIT_VALIDATE_FAST); // if everything looks good, load software From dc729a982834c30606b9a0236a4a5bff8951f720 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Tue, 2 Jun 2015 23:44:51 +0100 Subject: [PATCH 110/284] add some custom RASTERIZER_ENTRY lines for gtfore series, seems to help with performance when lots of transparencies are used (nw) --- src/emu/video/voodoo.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index 1942aaa392f..9085286f405 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -6437,4 +6437,26 @@ RASTERIZER_ENTRY( 0x00602439, 0x00044119, 0x00000000, 0x000B0379, 0x00000009, 0x //RASTERIZER_ENTRY( 0x00424219, 0x00000000, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ //RASTERIZER_ENTRY( 0x0200421A, 0x00001510, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ +/* golden tee fore! series */ +RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x00000000, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x042210C0 ) +RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x000000C1, 0x00010FF9, 0x00000A09, 0x0C261A0F ) +RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x00000ACD, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C2610C4 ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C261ACD ) + #endif From 66fec3db6330eb9b55d553f0a6ab2450951e0de5 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 3 Jun 2015 08:02:20 +0200 Subject: [PATCH 111/284] fix for OG :) (nw) --- scripts/genie.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index b4915406b25..ba639398c64 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -665,7 +665,7 @@ end } end -- add -g if we need symbols, and ensure we have frame pointers -if _OPTIONS["SYMBOLS"]~=nil then +if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then buildoptions { "-g" .. _OPTIONS["SYMLEVEL"], "-fno-omit-frame-pointer", @@ -710,7 +710,7 @@ if _OPTIONS["PROFILE"] then } end -if _OPTIONS["SYMBOLS"]~=nil then +if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then flags { "Symbols", } From d92b8d522a1e0d904d9f42ee78d919ff4336f56e Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Wed, 3 Jun 2015 08:41:33 +0200 Subject: [PATCH 112/284] Solved the great Sherwood Forest mystery. DOS 3.3 inserts a short (3-4 cycles, roughly equivalent to one bit) delay between writing the header and the data bytes in the sector data block. [Peter Ferrie, Olivier Galibert, Richter Belmont] --- src/lib/formats/ap2_dsk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/formats/ap2_dsk.c b/src/lib/formats/ap2_dsk.c index 4425d3fae99..e20b96e438a 100644 --- a/src/lib/formats/ap2_dsk.c +++ b/src/lib/formats/ap2_dsk.c @@ -668,7 +668,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im } fpos += 256*16; - for(int i=0; i<51; i++) + for(int i=0; i<49; i++) raw_w(track_data, 10, 0x3fc); for(int i=0; i<16; i++) { int sector; @@ -698,6 +698,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im raw_w(track_data, 9, 0x01fe); raw_w(track_data, 24, 0xd5aaad); + raw_w(track_data, 1, 0); UINT8 pval = 0x00; for(int i=0; i<342; i++) { @@ -721,7 +722,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im raw_w(track_data, 8, translate6[pval]); raw_w(track_data, 24, 0xdeaaeb); } - raw_w(track_data, 4, 0xff); + raw_w(track_data, 8, 0xff); assert(track_data.size() == 51090); generate_track_from_levels(track, 0, track_data, 0, image); From d3bf4d41259956fc58f7d1d204089bf34dc9bfa6 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 3 Jun 2015 11:03:41 +0100 Subject: [PATCH 113/284] added the newer a7800 donkey kong XM enhanced demo files to the softlist. i've added the 'emulator compatible' images too, pokey sound doesn't seem to work with the regular ones, might be useful for debugging. eta seems to indicate it did at the point he removed the emulator compatible images for the older version, so when did it break? (nw) --- hash/a7800.xml | 114 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 26 deletions(-) diff --git a/hash/a7800.xml b/hash/a7800.xml index f6cc930eb8b..30b464f267c 100644 --- a/hash/a7800.xml +++ b/hash/a7800.xml @@ -2370,32 +2370,94 @@ almost nothing like the prototype. + + + - - Donkey Kong (PAL, Demo, XM enhanced) - 2012 - <homebrew> - - - - - - - - - + + Donkey Kong (PAL, Demo, XM enhanced, V1.2) + 2012 + <homebrew> + + + + + + + + + + + + Donkey Kong (NTSC, Demo, XM enhanced, V1.2) + 2012 + <homebrew> + + + + + + + + + + + + + Donkey Kong (PAL, Demo, XM enhanced, V1.2, for emulators) + 2012 + <homebrew> + + + + + + + + + + + + Donkey Kong (NTSC, Demo, XM enhanced, V1.2, for emulators) + 2012 + <homebrew> + + + + + + + + + + + + + Donkey Kong (PAL, Demo, XM enhanced, older) + 2012 + <homebrew> + + + + + + + + + + + + Donkey Kong (NTSC, Demo, XM enhanced, older) + 2012 + <homebrew> + + + + + + + + + - - Donkey Kong (NTSC, Demo, XM enhanced) - 2012 - <homebrew> - - - - - - - - - From f7fd6b95f52ebfdc78f960e7e19ed6c199049f5b Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 3 Jun 2015 11:31:52 +0100 Subject: [PATCH 114/284] ok, this is how you load the dev board version (nw) --- hash/a7800.xml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hash/a7800.xml b/hash/a7800.xml index 30b464f267c..2e8280c36f5 100644 --- a/hash/a7800.xml +++ b/hash/a7800.xml @@ -2371,8 +2371,6 @@ almost nothing like the prototype. - - Donkey Kong (PAL, Demo, XM enhanced, V1.2) @@ -2402,6 +2400,21 @@ almost nothing like the prototype. + + + Donkey Kong (PAL/NTSC, Demo, XM enhanced, V1.2, for CC2 board) + 2012 + <homebrew> + + + + + + + + + + Donkey Kong (PAL, Demo, XM enhanced, V1.2, for emulators) From d8f3c86b98912b66c376245535efc0f95e15809b Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 3 Jun 2015 11:42:12 +0100 Subject: [PATCH 115/284] new WORKING game Monkey Magic [Hau, Chack'n] (politics aside, this is the correct procedure and credit, everything has been submitted for inclusion) --- scripts/target/mame/arcade.lua | 1 + src/mame/arcade.lst | 1 + src/mame/drivers/mnkymgic.c | 413 +++++++++++++++++++++++++++++++++ 3 files changed, 415 insertions(+) create mode 100644 src/mame/drivers/mnkymgic.c diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index aababae90f6..639ad7c4385 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -2202,6 +2202,7 @@ files { createMAMEProjects(_target, _subtarget, "nintendo") files { MAME_DIR .. "src/mame/drivers/cham24.c", + MAME_DIR .. "src/mame/drivers/mnkymgic.c", MAME_DIR .. "src/mame/drivers/dkong.c", MAME_DIR .. "src/mame/audio/dkong.c", MAME_DIR .. "src/mame/video/dkong.c", diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 5d9bfd3bda2..3baa769e37e 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -1196,6 +1196,7 @@ superdqs // ???? (c) 1984 superdqa // ???? (c) 1984 // Nintendo games +mnkymgic // (c) 1979 Nintendo spacefev // (c) 1979 Nintendo spacefevo // (c) 1979 Nintendo spacefevo2 // (c) 1979 Nintendo diff --git a/src/mame/drivers/mnkymgic.c b/src/mame/drivers/mnkymgic.c new file mode 100644 index 00000000000..3a186352831 --- /dev/null +++ b/src/mame/drivers/mnkymgic.c @@ -0,0 +1,413 @@ +// license:BSD-3-Clause +// copyright-holders:Hau, Chack'n +/*************************************************************************** + + +Monkey Magic +(c)1979 Nintendo + + +--- Team Japump!!! --- +Dumped by Chack'n +Written by Hau +01/Jun/2015 +***************************************************************************/ + +#include "emu.h" +#include "cpu/i8085/i8085.h" +#include "sound/samples.h" + +#define USE_SAMPLES (1) + + +class mnkymgic_state : public driver_device +{ +public: + mnkymgic_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_videoram(*this, "videoram"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), +#if (USE_SAMPLES) + m_samples(*this, "samples") +#endif + { } + + /* devices */ + required_device m_maincpu; + required_shared_ptr m_videoram; + required_device m_gfxdecode; + required_device m_palette; +#if (USE_SAMPLES) + required_device m_samples; +#endif + + /* misc */ + tilemap_t *m_bg_tilemap; + UINT8 m_obj_ball_x; + UINT8 m_obj_ball_y; + UINT8 m_color_map; + UINT8 m_sound_state; + + DECLARE_WRITE8_MEMBER(mnkymgic_videoram_w); + DECLARE_WRITE8_MEMBER(mnkymgic_obj_ball_x_w); + DECLARE_WRITE8_MEMBER(mnkymgic_obj_ball_y_w); + DECLARE_WRITE8_MEMBER(mnkymgic_colormap_w); + DECLARE_WRITE8_MEMBER(mnkymgic_audio_w); + virtual void machine_start(); + virtual void machine_reset(); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + virtual void video_start(); + DECLARE_PALETTE_INIT(mnkymgic); + void draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_mnkymgic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; + + +/************************************* + * + * Video system + * + *************************************/ + +PALETTE_INIT_MEMBER(mnkymgic_state, mnkymgic) +{ + offs_t i; + + for (i = 0; i < palette.entries() / 2; i++) + { + palette.set_pen_color((i * 2) + 0, rgb_t::black); + palette.set_pen_color((i * 2) + 1, rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2))); + } +} + + +TILE_GET_INFO_MEMBER(mnkymgic_state::get_bg_tile_info) +{ + const UINT8 *prom = memregion("proms")->base(); + + int code = m_videoram[tile_index]; + int color = (prom[code + m_color_map] ^ 0xff) & 0x07; + + SET_TILE_INFO_MEMBER(0, code, color, 0); +} + + +void mnkymgic_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(mnkymgic_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 12, 32, 16); +} + +WRITE8_MEMBER(mnkymgic_state::mnkymgic_videoram_w) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset); +} + +WRITE8_MEMBER(mnkymgic_state::mnkymgic_obj_ball_x_w) +{ + m_obj_ball_x = data; +} + +WRITE8_MEMBER(mnkymgic_state::mnkymgic_obj_ball_y_w) +{ + m_obj_ball_y = data; +} + +WRITE8_MEMBER(mnkymgic_state::mnkymgic_colormap_w) +{ + m_color_map = (data & 0x08) << 4; +} + + +void mnkymgic_state::draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + offs_t offs_x, offs_y; + + if (m_obj_ball_x > 0x02 && m_obj_ball_x < 0xff && m_obj_ball_y > 0x02 && m_obj_ball_y < 0xff) + { + int ball_y = (((m_obj_ball_y & 0xf0) >> 4) * 12) + (m_obj_ball_y & 0x0f); + + for (offs_y = 0; offs_y < 4; offs_y++) + { + for (offs_x = 0; offs_x < 4; offs_x++) + { + bitmap.pix16(ball_y-offs_y, m_obj_ball_x-offs_x) = m_palette->pen(0x0f);; + } + } + } +} + + +UINT32 mnkymgic_state::screen_update_mnkymgic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(m_palette->black_pen(), cliprect); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_ball(bitmap, cliprect); + + return 0; +} + + +/************************************* + * + * Audio system + * + *************************************/ + +#define SAMPLE_SOUND1 0 +#define SAMPLE_SOUND2_1 1 +#define SAMPLE_SOUND2_2 2 +#define SAMPLE_SOUND3 3 +#define SAMPLE_SOUND4 4 +#define SAMPLE_SOUND5 5 +#define SAMPLE_SOUND6_1 6 +#define SAMPLE_SOUND6_2 7 + +#define CHANNEL_SOUND1 0 + + +#if (USE_SAMPLES) +WRITE8_MEMBER(mnkymgic_state::mnkymgic_audio_w) +{ + if (data != m_sound_state) + { + if (~data & 0x80) + { + switch (m_sound_state) + { + case 0xff: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND4); + break; + + case 0xfe: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND3); + break; + + case 0xfd: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND5); + break; + + case 0xfc: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND2_1); + break; + + case 0xfb: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND2_2); + break; + + case 0xfa: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6_1); + break; + + case 0xf9: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6_2); + break; + + case 0xf8: + m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1); + break; + + default: + break; + } + } + } + + m_sound_state = data; +} + + +static const char *const mnkymgic_sample_names[] = +{ + "*mnkymgic", + "1", + "2", + "2-2", + "3", + "4", + "5", + "6", + "6-2", + 0 +}; + +#endif + + +/************************************* + * + * Memory handlers + * + *************************************/ + +static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, mnkymgic_state ) + AM_RANGE(0x0000, 0x13ff) AM_ROM + AM_RANGE(0x2000, 0x21ff) AM_RAM + AM_RANGE(0x3000, 0x31ff) AM_RAM_WRITE(mnkymgic_videoram_w) AM_SHARE("videoram") + AM_RANGE(0x8002, 0x8002) AM_WRITE(mnkymgic_obj_ball_x_w) + AM_RANGE(0x8003, 0x8003) AM_WRITE(mnkymgic_obj_ball_y_w) + AM_RANGE(0x8004, 0x8004) AM_READ_PORT("VBLANK") +ADDRESS_MAP_END + + +/************************************* + * + * Port handlers + * + *************************************/ + +static ADDRESS_MAP_START( main_io_map, AS_IO, 8, mnkymgic_state ) + ADDRESS_MAP_GLOBAL_MASK(0xff) + AM_RANGE(0x80, 0x80) AM_WRITE(mnkymgic_colormap_w) + AM_RANGE(0x81, 0x81) AM_WRITE(mnkymgic_audio_w) + AM_RANGE(0x85, 0x85) AM_READ_PORT("PADDLE") + AM_RANGE(0x86, 0x86) AM_READ_PORT("INPUTS") + AM_RANGE(0x87, 0x87) AM_READ_PORT("DSW") +ADDRESS_MAP_END + + +/************************************* + * + * Port definitions + * + *************************************/ + +static INPUT_PORTS_START( mnkymgic ) + PORT_START("VBLANK") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") + + PORT_START("DSW") + PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x00, "6" ) + PORT_DIPSETTING( 0x08, "5" ) + PORT_DIPSETTING( 0x10, "4" ) + PORT_DIPSETTING( 0x18, "3" ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("INPUTS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PADDLE") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_CENTERDELTA(0) +INPUT_PORTS_END + + +/************************************* + * + * Graphics Layouts + * + *************************************/ + +static const gfx_layout charlayout = +{ + 8,12, + RGN_FRAC(1,1), + 1, + { 0 }, + { 3, 2, 1, 0, 7, 6, 5, 4 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8 }, + 8*16 +}; + +static GFXDECODE_START( mnkymgic ) + GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 ) +GFXDECODE_END + + +/************************************* + * + * Machine drivers + * + *************************************/ + +void mnkymgic_state::machine_start() +{ + /* Set up save state */ + save_item(NAME(m_obj_ball_x)); + save_item(NAME(m_obj_ball_y)); + save_item(NAME(m_color_map)); + save_item(NAME(m_sound_state)); +} + +void mnkymgic_state::machine_reset() +{ + m_obj_ball_x = 0; + m_obj_ball_y = 0; + m_sound_state = 0x80; +} + +static MACHINE_CONFIG_START( mnkymgic, mnkymgic_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", I8085A, 6144000/2) /* 3.072MHz ? */ + MCFG_CPU_PROGRAM_MAP(main_map) + MCFG_CPU_IO_MAP(main_io_map) + + MCFG_GFXDECODE_ADD("gfxdecode", "palette", mnkymgic) + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_SCREEN_SIZE(256, 256) + MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 191) + MCFG_SCREEN_UPDATE_DRIVER(mnkymgic_state, screen_update_mnkymgic) + MCFG_SCREEN_PALETTE("palette") + + MCFG_PALETTE_ADD("palette", 16) + MCFG_PALETTE_INIT_OWNER(mnkymgic_state, mnkymgic) + +#if (USE_SAMPLES) + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("samples", SAMPLES, 0) + MCFG_SAMPLES_CHANNELS(1) + MCFG_SAMPLES_NAMES(mnkymgic_sample_names) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) +#endif +MACHINE_CONFIG_END + + +/************************************* + * + * ROM definitions + * + *************************************/ + +ROM_START( mnkymgic ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1a.bin", 0x0000, 0x0400, CRC(ec772e2e) SHA1(7efc1bbb24b2ed73c518aea1c4ef4b9a93034e31) ) + ROM_LOAD( "2a.bin", 0x0400, 0x0400, CRC(e5d482ca) SHA1(208b808e9208bb6f5f5f89ffbeb5a885be33733a) ) + ROM_LOAD( "3a.bin", 0x0800, 0x0400, CRC(e8d38deb) SHA1(d7384234fb47e4b1d0421f58571fa748662b05f5) ) + ROM_LOAD( "4a.bin", 0x0c00, 0x0400, CRC(3048bd6c) SHA1(740051589f6ba44b2ee68edf76a3177bb973d78e) ) + ROM_LOAD( "5a.bin", 0x1000, 0x0400, CRC(2cab8f04) SHA1(203a3c005f18f968cd14c972bbb9fd7e0fc3b670) ) + + ROM_REGION( 0x600, "gfx1", ROMREGION_INVERT ) + ROM_LOAD( "6h.bin", 0x0000, 0x0200, CRC(b6321b6f) SHA1(06611f7419d2982e006a3e81b79677e59e194f38) ) /* tilemap */ + ROM_LOAD( "7h.bin", 0x0200, 0x0200, CRC(9ec0e82c) SHA1(29983f690a1b6134bb1983921f42c14898788095) ) + ROM_LOAD( "6j.bin", 0x0400, 0x0200, CRC(7ce83302) SHA1(1870610ff07ab11622e183e04e3fce29328ff291) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "7j.bin", 0x0000, 0x0200, CRC(b7eb8e1c) SHA1(b65a8efb88668dcf1c1d00e31a9b15a67c2972c8) ) /* tile palettes selector */ +ROM_END + + +/************************************* + * + * Game drivers + * + *************************************/ + +GAME(1979, mnkymgic, 0, mnkymgic, mnkymgic, driver_device, 0, ROT270, "Nintendo", "Monkey Magic (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) From e0fdf4c2a6d104c48e1a2ccaff5e572bd56644e4 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 3 Jun 2015 20:47:27 +1000 Subject: [PATCH 116/284] Commented out corrupted set to stop msx2 machines from crashing. --- hash/msx2_flop.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hash/msx2_flop.xml b/hash/msx2_flop.xml index 10a2cb31e3d..6537b0b4a9e 100644 --- a/hash/msx2_flop.xml +++ b/hash/msx2_flop.xml @@ -11171,11 +11171,12 @@ The following floppies came with the machines. - + The Tower? of Cabin - Cabin Panic (Jpn, Alt) From 527e70ca4033a7d5134606ec57989f60dd51745e Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 3 Jun 2015 12:46:16 +0100 Subject: [PATCH 117/284] apparently the ones listed as 'for MESS' are actually the ones that work on real hardware, and the others are hacked for prosystem emulator? (nw) --- hash/a7800.xml | 103 ++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/hash/a7800.xml b/hash/a7800.xml index 2e8280c36f5..c9419c1f050 100644 --- a/hash/a7800.xml +++ b/hash/a7800.xml @@ -2372,56 +2372,13 @@ almost nothing like the prototype. - + + Donkey Kong (PAL, Demo, XM enhanced, V1.2) 2012 <homebrew> - - - - - - - - - - Donkey Kong (NTSC, Demo, XM enhanced, V1.2) - 2012 - <homebrew> - - - - - - - - - - - - - Donkey Kong (PAL/NTSC, Demo, XM enhanced, V1.2, for CC2 board) - 2012 - <homebrew> - - - - - - - - - - - - - Donkey Kong (PAL, Demo, XM enhanced, V1.2, for emulators) - 2012 - <homebrew> - - @@ -2430,8 +2387,8 @@ almost nothing like the prototype. - - Donkey Kong (NTSC, Demo, XM enhanced, V1.2, for emulators) + + Donkey Kong (NTSC, Demo, XM enhanced, V1.2) 2012 <homebrew> @@ -2444,7 +2401,40 @@ almost nothing like the prototype. - + + + + + Donkey Kong (PAL, Demo, XM enhanced, V1.2, for prosystem emulator) + 2012 + <homebrew> + + + + + + + + + + + + Donkey Kong (NTSC, Demo, XM enhanced, V1.2, for prosystem emulator) + 2012 + <homebrew> + + + + + + + + + + + + + Donkey Kong (PAL, Demo, XM enhanced, older) 2012 @@ -2472,5 +2462,20 @@ almost nothing like the prototype. - + + + + Donkey Kong (PAL/NTSC, Demo, XM enhanced, older, for CC2 board) + 2012 + <homebrew> + + + + + + + + + + From 7717489f3ed419c5fb1814be5504e07e9c07b83a Mon Sep 17 00:00:00 2001 From: fulivi Date: Wed, 3 Jun 2015 14:22:59 +0200 Subject: [PATCH 118/284] hp64k: Preliminary version of HP Hybrid CPU (no interrupts & no DMA yet) --- scripts/src/cpu.lua | 16 + src/emu/cpu/hphybrid/hphybrid.c | 859 +++++++++++++++++++++++++++ src/emu/cpu/hphybrid/hphybrid.h | 141 +++++ src/emu/cpu/hphybrid/hphybrid_dasm.c | 281 +++++++++ src/mess/drivers/hp64k.c | 51 ++ 5 files changed, 1348 insertions(+) create mode 100644 src/emu/cpu/hphybrid/hphybrid.c create mode 100644 src/emu/cpu/hphybrid/hphybrid.h create mode 100644 src/emu/cpu/hphybrid/hphybrid_dasm.c create mode 100644 src/mess/drivers/hp64k.c diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 68d93da6ec5..fa01ecd34ca 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -631,6 +631,22 @@ if (CPUS["SH4"]~=null or _OPTIONS["with-tools"]) then table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sh4/sh4dasm.c") end +-------------------------------------------------- +-- HP Hybrid processor +---@src/emu/cpu/hphybrid/hphybrid.h,CPUS += HPHYBRID +-------------------------------------------------- + +if (CPUS["HPHYBRID"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/hphybrid/hphybrid.c", + MAME_DIR .. "src/emu/cpu/hphybrid/hphybrid.h", + } +end + +if (CPUS["HPHYBRID"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/hphybrid/hphybrid_dasm.c") +end + -------------------------------------------------- -- Hudsonsoft 6280 ---@src/emu/cpu/h6280/h6280.h,CPUS += H6280 diff --git a/src/emu/cpu/hphybrid/hphybrid.c b/src/emu/cpu/hphybrid/hphybrid.c new file mode 100644 index 00000000000..bef8da6ddb2 --- /dev/null +++ b/src/emu/cpu/hphybrid/hphybrid.c @@ -0,0 +1,859 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi + +#include "emu.h" +#include "debugger.h" +#include "hphybrid.h" + +enum { + HPHYBRID_A, + HPHYBRID_B, + HPHYBRID_C, + HPHYBRID_D, + HPHYBRID_P, + HPHYBRID_R, + HPHYBRID_IV, + HPHYBRID_PA, + HPHYBRID_DMAPA, + HPHYBRID_DMAMA, + HPHYBRID_DMAC, + HPHYBRID_I +}; + +#define BIT_MASK(n) (1U << (n)) + +// Macros to clear/set single bits +#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n)) +#define BIT_SET(w , n) ((w) |= BIT_MASK(n)) + +// Bits in m_flags +#define HPHYBRID_C_BIT 0 // Carry/extend +#define HPHYBRID_O_BIT 1 // Overflow +#define HPHYBRID_CB_BIT 2 // Cb +#define HPHYBRID_DB_BIT 3 // Db +#define HPHYBRID_INTEN_BIT 4 // Interrupt enable +#define HPHYBRID_DMAEN_BIT 5 // DMA enable +#define HPHYBRID_DMADIR_BIT 6 // DMA direction (1 = OUT) +#define HPHYBRID_HALT_BIT 7 // Halt flag +#define HPHYBRID_IRH_BIT 8 // IRH requested +#define HPHYBRID_IRL_BIT 9 // IRL requested +#define HPHYBRID_IRH_SVC_BIT 10 // IRH in service +#define HPHYBRID_IRL_SVC_BIT 11 // IRL in service + +#define HPHYBRID_IV_MASK 0xfff0 // IV mask + +#define CURRENT_PA (m_reg_PA[ 0 ]) + +#define HP_RESET_ADDR 0x0020 + +#define MAKE_IOADDR(pa , ic) (((pa) << HP_IOADDR_PA_SHIFT) | ((ic) << HP_IOADDR_IC_SHIFT)) + +const device_type HP_5061_3011 = &device_creator; + +hp_hybrid_cpu_device::hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) + : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__), + m_program_config("program", ENDIANNESS_BIG, 16, 16, -1), + m_io_config("io", ENDIANNESS_BIG, 16, 6, -1) +{ +} + +void hp_hybrid_cpu_device::device_start() +{ + m_reg_A = 0; + m_reg_B = 0; + m_reg_P = HP_RESET_ADDR; + m_reg_R = 0; + m_reg_C = 0; + m_reg_D = 0; + m_reg_IV = 0; + m_reg_PA[ 0 ] = 0; + m_reg_PA[ 1 ] = 0; + m_reg_PA[ 2 ] = 0; + m_flags = 0; + m_dmapa = 0; + m_dmama = 0; + m_dmac = 0; + m_reg_I = 0; + + { + state_add(HPHYBRID_A, "A", m_reg_A); + state_add(HPHYBRID_B, "B", m_reg_B); + state_add(HPHYBRID_C, "C", m_reg_C); + state_add(HPHYBRID_D, "D", m_reg_D); + state_add(HPHYBRID_P, "P", m_reg_P); + state_add(STATE_GENPC, "GENPC", m_reg_P).noshow(); + state_add(HPHYBRID_R, "R", m_reg_R); + state_add(STATE_GENSP, "GENSP", m_reg_R).noshow(); + state_add(HPHYBRID_IV, "IV", m_reg_IV); + state_add(HPHYBRID_PA, "PA", m_reg_PA[ 0 ]); + state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%9s"); + state_add(HPHYBRID_DMAPA , "DMAPA" , m_dmapa).noshow(); + state_add(HPHYBRID_DMAMA , "DMAMA" , m_dmama).noshow(); + state_add(HPHYBRID_DMAC , "DMAC" , m_dmac).noshow(); + state_add(HPHYBRID_I , "I" , m_reg_I).noshow(); + } + + m_program = &space(AS_PROGRAM); + m_direct = &m_program->direct(); + m_io = &space(AS_IO); + + save_item(NAME(m_reg_A)); + save_item(NAME(m_reg_B)); + save_item(NAME(m_reg_C)); + save_item(NAME(m_reg_D)); + save_item(NAME(m_reg_P)); + save_item(NAME(m_reg_R)); + save_item(NAME(m_reg_IV)); + save_item(NAME(m_reg_PA[0])); + save_item(NAME(m_reg_PA[1])); + save_item(NAME(m_reg_PA[2])); + save_item(NAME(m_flags)); + save_item(NAME(m_dmapa)); + save_item(NAME(m_dmama)); + save_item(NAME(m_dmac)); + save_item(NAME(m_reg_I)); + + m_icountptr = &m_icount; +} + +void hp_hybrid_cpu_device::device_reset() +{ + m_reg_P = HP_RESET_ADDR; + m_reg_I = RM(m_reg_P); + m_flags = 0; +} + +void hp_hybrid_cpu_device::execute_run() +{ + do { + debugger_instruction_hook(this, m_reg_P); + // TODO: check interrupts + // TODO: check dma + m_reg_I = execute_one(m_reg_I); + } while (m_icount > 0); +} + +void hp_hybrid_cpu_device::execute_set_input(int inputnum, int state) +{ +} + +/** + * Execute 1 instruction + * + * @param opcode Opcode to be executed + * + * @return Next opcode to be executed + */ +UINT16 hp_hybrid_cpu_device::execute_one(UINT16 opcode) +{ + if ((opcode & 0x7fe0) == 0x7000) { + // EXE + m_icount -= 8; + return RM(opcode & 0x1f); + } else { + m_reg_P = execute_one_sub(opcode); + return RM(m_reg_P); + } +} + +/** + * Execute 1 instruction (except EXE) + * + * @param opcode Opcode to be executed (no EXE instructions) + * + * @return new value of P register + */ +UINT16 hp_hybrid_cpu_device::execute_one_sub(UINT16 opcode) +{ + UINT16 ea; + UINT16 tmp; + + switch (opcode & 0x7800) { + case 0x0000: + // LDA + m_icount -= 13; + m_reg_A = RM(get_ea(opcode)); + break; + + case 0x0800: + // LDB + m_icount -= 13; + m_reg_B = RM(get_ea(opcode)); + break; + + case 0x1000: + // CPA + m_icount -= 16; + if (m_reg_A != RM(get_ea(opcode))) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x1800: + // CPB + m_icount -= 16; + if (m_reg_B != RM(get_ea(opcode))) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x2000: + // ADA + m_icount -= 13; + do_add(m_reg_A , RM(get_ea(opcode))); + break; + + case 0x2800: + // ADB + m_icount -= 13; + do_add(m_reg_B , RM(get_ea(opcode))); + break; + + case 0x3000: + // STA + m_icount -= 13; + WM(get_ea(opcode) , m_reg_A); + break; + + case 0x3800: + // STB + m_icount -= 13; + WM(get_ea(opcode) , m_reg_B); + break; + + case 0x4000: + // JSM + m_icount -= 17; + WM(++m_reg_R , m_reg_P); + return get_ea(opcode); + + case 0x4800: + // ISZ + m_icount -= 19; + ea = get_ea(opcode); + tmp = RM(ea) + 1; + WM(ea , tmp); + if (tmp == 0) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x5000: + // AND + m_icount -= 13; + m_reg_A &= RM(get_ea(opcode)); + break; + + case 0x5800: + // DSZ + m_icount -= 19; + ea = get_ea(opcode); + tmp = RM(ea) - 1; + WM(ea , tmp); + if (tmp == 0) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x6000: + // IOR + m_icount -= 13; + m_reg_A |= RM(get_ea(opcode)); + break; + + case 0x6800: + // JMP + m_icount -= 8; + return get_ea(opcode); + + default: + switch (opcode & 0xfec0) { + case 0x7400: + // RZA + // SZA + m_icount -= 14; + return get_skip_addr(opcode , m_reg_A == 0); + + case 0x7440: + // RIA + // SIA + m_icount -= 14; + return get_skip_addr(opcode , m_reg_A++ == 0); + + case 0x7480: + // SFS + // SFC + m_icount -= 14; + // TODO: read flag bit + return get_skip_addr(opcode , true); + + case 0x7C00: + // RZB + // SZB + m_icount -= 14; + return get_skip_addr(opcode , m_reg_B == 0); + + case 0x7C40: + // RIB + // SIB + m_icount -= 14; + return get_skip_addr(opcode , m_reg_B++ == 0); + + case 0x7c80: + // SSS + // SSC + m_icount -= 14; + // TODO: read status bit + return get_skip_addr(opcode , true); + + case 0x7cc0: + // SHS + // SHC + m_icount -= 14; + return get_skip_addr(opcode , !BIT(m_flags , HPHYBRID_HALT_BIT)); + + default: + switch (opcode & 0xfe00) { + case 0x7600: + // SLA + // RLA + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_A , 0); + + case 0x7e00: + // SLB + // RLB + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_B , 0); + + case 0xf400: + // SAP + // SAM + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_A , 15); + + case 0xf600: + // SOC + // SOS + m_icount -= 14; + return get_skip_addr_sc(opcode , m_flags , HPHYBRID_O_BIT); + + case 0xfc00: + // SBP + // SBM + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_B , 15); + + case 0xfe00: + // SEC + // SES + m_icount -= 14; + return get_skip_addr_sc(opcode , m_flags , HPHYBRID_C_BIT); + + default: + switch (opcode & 0xfff0) { + case 0xf100: + // AAR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + // A shift by 16 positions is equivalent to a shift by 15 + tmp = tmp > 15 ? 15 : tmp; + m_reg_A = ((m_reg_A ^ 0x8000) >> tmp) - (0x8000 >> tmp); + break; + + case 0xf900: + // ABR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + tmp = tmp > 15 ? 15 : tmp; + m_reg_B = ((m_reg_B ^ 0x8000) >> tmp) - (0x8000 >> tmp); + break; + + case 0xf140: + // SAR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_A >>= tmp; + break; + + case 0xf940: + // SBR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_B >>= tmp; + break; + + case 0xf180: + // SAL + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_A <<= tmp; + break; + + case 0xf980: + // SBL + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_B <<= tmp; + break; + + case 0xf1c0: + // RAR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_A = (m_reg_A >> tmp) | (m_reg_A << (16 - tmp)); + break; + + case 0xf9c0: + // RBR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_B = (m_reg_B >> tmp) | (m_reg_B << (16 - tmp)); + break; + + default: + if ((opcode & 0xf760) == 0x7160) { + // Place/withdraw instructions + m_icount -= 23; + do_pw(opcode); + } else if ((opcode & 0xff80) == 0xf080) { + // RET + m_icount -= 16; + if (BIT(opcode , 6)) { + // Pop PA stack + if (BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) { + BIT_CLR(m_flags , HPHYBRID_IRH_SVC_BIT); + memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); + } else if (BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { + BIT_CLR(m_flags , HPHYBRID_IRL_SVC_BIT); + memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); + } + } + tmp = RM(m_reg_R--) + (opcode & 0x1f); + return BIT(opcode , 5) ? tmp - 0x20 : tmp; + } else { + switch (opcode) { + case 0x7100: + // SDO + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_DMADIR_BIT); + break; + + case 0x7108: + // SDI + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_DMADIR_BIT); + break; + + case 0x7110: + // EIR + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_INTEN_BIT); + break; + + case 0x7118: + // DIR + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_INTEN_BIT); + break; + + case 0x7120: + // DMA + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_DMAEN_BIT); + break; + + case 0x7138: + // DDR + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_DMAEN_BIT); + break; + + case 0x7140: + // DBL + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_DB_BIT); + break; + + case 0x7148: + // CBL + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_CB_BIT); + break; + + case 0x7150: + // DBU + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_DB_BIT); + break; + + case 0x7158: + // CBU + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_CB_BIT); + break; + + case 0xf020: + // TCA + m_icount -= 9; + m_reg_A = ~m_reg_A; + do_add(m_reg_A , 1); + break; + + case 0xf060: + // CMA + m_icount -= 9; + m_reg_A = ~m_reg_A; + break; + + case 0xf820: + // TCB + m_icount -= 9; + m_reg_B = ~m_reg_B; + do_add(m_reg_B , 1); + break; + + case 0xf860: + // CMB + m_icount -= 9; + m_reg_B = ~m_reg_B; + break; + + default: + // Unrecognized instructions: NOP + // Execution time is fictional + m_icount -= 6; + } + } + } + } + } + } + + return m_reg_P + 1; +} + +void hp_hybrid_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) +{ + if (entry.index() == STATE_GENFLAGS) { + strprintf(str, "%s %s %c %c", + BIT(m_flags , HPHYBRID_DB_BIT) ? "Db":"..", + BIT(m_flags , HPHYBRID_CB_BIT) ? "Cb":"..", + BIT(m_flags , HPHYBRID_O_BIT) ? 'O':'.', + BIT(m_flags , HPHYBRID_C_BIT) ? 'E':'.'); + } +} + +offs_t hp_hybrid_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(hp_hybrid); + return CPU_DISASSEMBLE_NAME(hp_hybrid)(this, buffer, pc, oprom, opram, options); +} + +UINT16 hp_hybrid_cpu_device::get_ea(UINT16 opcode) +{ + UINT16 base; + UINT16 off; + + if (BIT(opcode , 10)) { + // Current page + base = m_reg_P; + } else { + // Base page + base = 0; + } + + off = opcode & 0x3ff; + if (off & 0x200) { + off -= 0x400; + } + + base += off; + + if (BIT(opcode , 15)) { + // Indirect addressing + m_icount -= 6; + return RM(base); + } else { + // Direct addressing + return base; + } +} + +void hp_hybrid_cpu_device::do_add(UINT16& addend1 , UINT16 addend2) +{ + UINT32 tmp = addend1 + addend2; + + if (BIT(tmp , 16)) { + // Carry + BIT_SET(m_flags , HPHYBRID_C_BIT); + } + + if (BIT((tmp ^ addend1) & (tmp ^ addend2) , 15)) { + // Overflow + BIT_SET(m_flags , HPHYBRID_O_BIT); + } + + addend1 = (UINT16)tmp; +} + +UINT16 hp_hybrid_cpu_device::get_skip_addr(UINT16 opcode , bool condition) const +{ + bool skip_val = BIT(opcode , 8) != 0; + + if (condition == skip_val) { + UINT16 off = opcode & 0x1f; + + if (BIT(opcode , 5)) { + off -= 0x20; + } + return m_reg_P + off; + } else { + return m_reg_P + 1; + } +} + +UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n) +{ + bool val = BIT(v , n); + + if (BIT(opcode , 7)) { + if (BIT(opcode , 6)) { + BIT_SET(v , n); + } else { + BIT_CLR(v , n); + } + } + + return get_skip_addr(opcode , val); +} + +void hp_hybrid_cpu_device::do_pw(UINT16 opcode) +{ + UINT16 tmp; + UINT16 reg_addr = opcode & 7; + UINT16 *ptr_reg; + UINT16 b_mask; + + if (BIT(opcode , 3)) { + ptr_reg = &m_reg_D; + b_mask = BIT_MASK(HPHYBRID_DB_BIT); + } else { + ptr_reg = &m_reg_C; + b_mask = BIT_MASK(HPHYBRID_CB_BIT); + } + + if (BIT(opcode , 4)) { + // Withdraw + if (BIT(opcode , 11)) { + // Byte + UINT32 tmp_addr = (UINT32)(*ptr_reg); + if (m_flags & b_mask) { + tmp_addr |= 0x10000; + } + tmp = RM((UINT16)(tmp_addr >> 1)); + if (BIT(tmp_addr , 0)) { + tmp &= 0xff; + } else { + tmp >>= 8; + } + } else { + // Word + tmp = RM(*ptr_reg); + } + WM(reg_addr , tmp); + + if (BIT(opcode , 7)) { + // Post-decrement + if ((*ptr_reg)-- == 0) { + m_flags ^= b_mask; + } + } else { + // Post-increment + if (++(*ptr_reg) == 0) { + m_flags ^= b_mask; + } + } + } else { + // Place + if (BIT(opcode , 7)) { + // Pre-decrement + if ((*ptr_reg)-- == 0) { + m_flags ^= b_mask; + } + } else { + // Pre-increment + if (++(*ptr_reg) == 0) { + m_flags ^= b_mask; + } + } + tmp = RM(reg_addr); + if (BIT(opcode , 11)) { + // Byte + UINT32 tmp_addr = (UINT32)(*ptr_reg); + if (m_flags & b_mask) { + tmp_addr |= 0x10000; + } + WMB(tmp_addr , (UINT8)tmp); + } else { + // Word + WM(*ptr_reg , tmp); + } + } +} + +UINT16 hp_hybrid_cpu_device::RM(UINT16 addr) +{ + UINT16 tmp; + + if (addr <= HP_REG_LAST_ADDR) { + // Memory mapped registers + switch (addr) { + case HP_REG_A_ADDR: + return m_reg_A; + + case HP_REG_B_ADDR: + return m_reg_B; + + case HP_REG_P_ADDR: + return m_reg_P; + + case HP_REG_R_ADDR: + return m_reg_R; + + case HP_REG_R4_ADDR: + case HP_REG_R5_ADDR: + case HP_REG_R6_ADDR: + case HP_REG_R7_ADDR: + return RIO(CURRENT_PA , addr - HP_REG_R4_ADDR); + + case HP_REG_IV_ADDR: + return m_reg_IV; + + case HP_REG_PA_ADDR: + return CURRENT_PA; + + case HP_REG_DMAPA_ADDR: + tmp = m_dmapa & HP_REG_PA_MASK; + if (BIT(m_flags , HPHYBRID_CB_BIT)) { + BIT_SET(tmp , 15); + } + if (BIT(m_flags , HPHYBRID_DB_BIT)) { + BIT_SET(tmp , 14); + } + return tmp; + + case HP_REG_DMAMA_ADDR: + return m_dmama; + + case HP_REG_DMAC_ADDR: + return m_dmac; + + case HP_REG_C_ADDR: + return m_reg_C; + + case HP_REG_D_ADDR: + return m_reg_D; + + default: + // Unknown registers are returned as 0 + return 0; + } + } else { + return m_direct->read_decrypted_word((offs_t)addr << 1); + } +} + +void hp_hybrid_cpu_device::WM(UINT16 addr , UINT16 v) +{ + if (addr <= HP_REG_LAST_ADDR) { + // Memory mapped registers + switch (addr) { + case HP_REG_A_ADDR: + m_reg_A = v; + break; + + case HP_REG_B_ADDR: + m_reg_B = v; + break; + + case HP_REG_P_ADDR: + m_reg_P = v; + break; + + case HP_REG_R_ADDR: + m_reg_R = v; + break; + + case HP_REG_R4_ADDR: + case HP_REG_R5_ADDR: + case HP_REG_R6_ADDR: + case HP_REG_R7_ADDR: + WIO(CURRENT_PA , addr - HP_REG_R4_ADDR , v); + break; + + case HP_REG_IV_ADDR: + m_reg_IV = v & HP_REG_IV_MASK; + break; + + case HP_REG_PA_ADDR: + CURRENT_PA = v & HP_REG_PA_MASK; + break; + + case HP_REG_DMAPA_ADDR: + m_dmapa = v & HP_REG_PA_MASK; + break; + + case HP_REG_DMAMA_ADDR: + m_dmama = v; + break; + + case HP_REG_DMAC_ADDR: + m_dmac = v; + break; + + case HP_REG_C_ADDR: + m_reg_C = v; + break; + + case HP_REG_D_ADDR: + m_reg_D = v; + break; + + default: + // Unknown registers are silently discarded + break; + } + } else { + m_program->write_word((offs_t)addr << 1 , v); + } +} + +void hp_hybrid_cpu_device::WMB(UINT32 addr , UINT8 v) +{ + if (addr <= (HP_REG_LAST_ADDR * 2 + 1)) { + // Cannot write bytes to registers + } else { + m_program->write_byte(addr , v); + } +} + +UINT16 hp_hybrid_cpu_device::RIO(UINT8 pa , UINT8 ic) +{ + return m_io->read_word(MAKE_IOADDR(pa, ic) << 1); +} + +void hp_hybrid_cpu_device::WIO(UINT8 pa , UINT8 ic , UINT16 v) +{ + m_io->write_word(MAKE_IOADDR(pa, ic) << 1 , v); +} + +hp_5061_3011_cpu_device::hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : hp_hybrid_cpu_device(mconfig, HP_5061_3011, "HP_5061_3011", tag, owner, clock, "5061-3011") +{ +} + diff --git a/src/emu/cpu/hphybrid/hphybrid.h b/src/emu/cpu/hphybrid/hphybrid.h new file mode 100644 index 00000000000..a9153580bee --- /dev/null +++ b/src/emu/cpu/hphybrid/hphybrid.h @@ -0,0 +1,141 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +// +// ***************************************** +// Emulator for HP "hybrid" processor series +// ***************************************** +// +// The HP hybrid processor series is composed of a few different models with different +// capabilities. The series was derived from HP's own 2116 processor by translating a +// discrete implementation of the 1960s into a multi-chip module (hence the "hybrid" name). +// This emulator currently supports the 5061-3011 version only. +// +// There is very little information around on this processor. +// For this emulator I mainly relied on these sources: +// - http://www.hp9845.net/ website +// - HP manual "Assembly development ROM manual for the HP9845": this is the most precious +// and "enabling" resource of all +// - US Patent 4,180,854 describing the HP9845 system +// - Some manual for the 2116 processor +// - Study of disassembly of firmware of HP64000 system +// - A lot of "educated" guessing + +#ifndef _HPHYBRID_H_ +#define _HPHYBRID_H_ + +// Input lines +#define HPHYBRID_IRH 0 // High-level interrupt +#define HPHYBRID_IRL 1 // Low-level interrupt +#define HPHYBRID_INT_LVLS 2 // Levels of interrupt + +#define HPHYBRID_DMAR 2 // DMA request +#define HPHYBRID_HALT 3 // "Halt" input +#define HPHYBRID_STS 4 // "Status" input +#define HPHYBRID_FLG 5 // "Flag" input + +// I/O addressing space (16-bit wide) +// Addresses into this space are composed as follows: +// b[5..2] = Peripheral address 0..15 +// b[1..0] = Register address (IC) 0..3 +#define HP_IOADDR_PA_SHIFT 2 +#define HP_IOADDR_IC_SHIFT 0 + +// Addresses of memory mapped registers +#define HP_REG_A_ADDR 0x0000 +#define HP_REG_B_ADDR 0x0001 +#define HP_REG_P_ADDR 0x0002 +#define HP_REG_R_ADDR 0x0003 +#define HP_REG_R4_ADDR 0x0004 +#define HP_REG_R5_ADDR 0x0005 +#define HP_REG_R6_ADDR 0x0006 +#define HP_REG_R7_ADDR 0x0007 +#define HP_REG_IV_ADDR 0x0008 +#define HP_REG_PA_ADDR 0x0009 +#define HP_REG_DMAPA_ADDR 0x000B +#define HP_REG_DMAMA_ADDR 0x000C +#define HP_REG_DMAC_ADDR 0x000D +#define HP_REG_C_ADDR 0x000e +#define HP_REG_D_ADDR 0x000f +#define HP_REG_LAST_ADDR 0x001f + +#define HP_REG_IV_MASK 0xfff0 +#define HP_REG_PA_MASK 0x000f + +class hp_hybrid_cpu_device : public cpu_device +{ +public: +protected: + hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_execute_interface overrides + virtual UINT32 execute_min_cycles() const { return 6; } + virtual UINT32 execute_max_cycles() const { return 25; } + virtual UINT32 execute_input_lines() const { return 2; } + virtual UINT32 execute_default_irq_vector() const { return 0xffff; } + virtual void execute_run(); + virtual void execute_set_input(int inputnum, int state); + + UINT16 execute_one(UINT16 opcode); + UINT16 execute_one_sub(UINT16 opcode); + + // device_memory_interface overrides + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); } + + // device_state_interface overrides + void state_string_export(const device_state_entry &entry, std::string &str); + + // device_disasm_interface overrides + virtual UINT32 disasm_min_opcode_bytes() const { return 2; } + virtual UINT32 disasm_max_opcode_bytes() const { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); + + private: + address_space_config m_program_config; + address_space_config m_io_config; + + address_space *m_program; + direct_read_data *m_direct; + address_space *m_io; + int m_icount; + + // State of processor + UINT16 m_reg_A; // Register A + UINT16 m_reg_B; // Register B + UINT16 m_reg_P; // Register P + UINT16 m_reg_R; // Register R + UINT16 m_reg_C; // Register C + UINT16 m_reg_D; // Register D + UINT16 m_reg_IV; // Register IV + UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long) + UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir) + UINT8 m_dmapa; // DMA peripheral address (4 bits) + UINT16 m_dmama; // DMA address + UINT16 m_dmac; // DMA counter + UINT16 m_reg_I; // Instruction register + + UINT16 get_ea(UINT16 opcode); + void do_add(UINT16& addend1 , UINT16 addend2); + UINT16 get_skip_addr(UINT16 opcode , bool condition) const; + UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n); + void do_pw(UINT16 opcode); + + UINT16 RM(UINT16 addr); + void WM(UINT16 addr , UINT16 v); + void WMB(UINT32 addr , UINT8 v); + UINT16 RIO(UINT8 pa , UINT8 ic); + void WIO(UINT8 pa , UINT8 ic , UINT16 v); +}; + +class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device +{ +public: + hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +extern const device_type HP_5061_3011; + +#endif /* _HPHYBRID_H_ */ diff --git a/src/emu/cpu/hphybrid/hphybrid_dasm.c b/src/emu/cpu/hphybrid/hphybrid_dasm.c new file mode 100644 index 00000000000..15897498292 --- /dev/null +++ b/src/emu/cpu/hphybrid/hphybrid_dasm.c @@ -0,0 +1,281 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +// ******************************************************************************** +// * HP "hybrid" processor disassembler +// ******************************************************************************** + +#include "emu.h" +#include "debugger.h" +#include "hphybrid.h" + +typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode); + +typedef struct { + UINT16 m_op_mask; + UINT16 m_opcode; + const char *m_mnemonic; + fn_dis_param m_param_fn; + UINT32 m_dasm_flags; +} dis_entry_t; + +static void addr_2_str(char *buffer , UINT16 addr , bool indirect) +{ + char *s = buffer + strlen(buffer); + + s += sprintf(s , "$%04x" , addr); + + switch (addr) { + case HP_REG_A_ADDR: + strcpy(s , "(A)"); + break; + + case HP_REG_B_ADDR: + strcpy(s , "(B)"); + break; + + case HP_REG_P_ADDR: + strcpy(s , "(P)"); + break; + + case HP_REG_R_ADDR: + strcpy(s , "(R)"); + break; + + case HP_REG_R4_ADDR: + strcpy(s , "(R4)"); + break; + + case HP_REG_R5_ADDR: + strcpy(s , "(R5)"); + break; + + case HP_REG_R6_ADDR: + strcpy(s , "(R6)"); + break; + + case HP_REG_R7_ADDR: + strcpy(s , "(R7)"); + break; + + case HP_REG_IV_ADDR: + strcpy(s , "(IV)"); + break; + + case HP_REG_PA_ADDR: + strcpy(s , "(PA)"); + break; + + case HP_REG_DMAPA_ADDR: + strcpy(s , "(DMAPA)"); + break; + + case HP_REG_DMAMA_ADDR: + strcpy(s , "(DMAMA)"); + break; + + case HP_REG_DMAC_ADDR: + strcpy(s , "(DMAC)"); + break; + + case HP_REG_C_ADDR: + strcpy(s , "(C)"); + break; + + case HP_REG_D_ADDR: + strcpy(s , "(D)"); + break; + } + + if (indirect) { + strcat(s , ",I"); + } +} + +static void param_none(char *buffer , offs_t pc , UINT16 opcode) +{ +} + +static void param_loc(char *buffer , offs_t pc , UINT16 opcode) +{ + UINT16 base; + UINT16 off; + + if (opcode & 0x0400) { + // Current page + base = pc; + } else { + // Base page + base = 0; + } + + off = opcode & 0x3ff; + if (off & 0x200) { + off -= 0x400; + } + + addr_2_str(buffer , base + off , (opcode & 0x8000) != 0); +} + +static void param_addr32(char *buffer , offs_t pc , UINT16 opcode) +{ + addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0); +} + +static void param_skip(char *buffer , offs_t pc , UINT16 opcode) +{ + UINT16 off = opcode & 0x3f; + if (off & 0x20) { + off -= 0x40; + } + addr_2_str(buffer , pc + off , false); +} + +static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode) +{ + param_skip(buffer, pc, opcode); + + if (opcode & 0x80) { + if (opcode & 0x40) { + strcat(buffer , ",S"); + } else { + strcat(buffer , ",C"); + } + } +} + +static void param_ret(char *buffer , offs_t pc , UINT16 opcode) +{ + char *s = buffer + strlen(buffer); + + int off = opcode & 0x3f; + + if (off & 0x20) { + off -= 0x40; + } + + s += sprintf(s , "%d" , off); + if (opcode & 0x40) { + strcpy(s , ",P"); + } +} + +static void param_n16(char *buffer , offs_t pc , UINT16 opcode) +{ + char *s = buffer + strlen(buffer); + + sprintf(s , "%u" , (opcode & 0xf) + 1); +} + +static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode) +{ + addr_2_str(buffer, opcode & 7, false); + + if (opcode & 0x80) { + strcat(buffer , ",D"); + } else { + strcat(buffer , ",I"); + } +} + +static const dis_entry_t dis_table[] = { + // *** BPC Instructions *** + {0xffff , 0x0000 , "NOP" , param_none , 0 }, + {0x7800 , 0x0000 , "LDA" , param_loc , 0 }, + {0x7800 , 0x0800 , "LDB" , param_loc , 0 }, + {0x7800 , 0x1000 , "CPA" , param_loc , 0 }, + {0x7800 , 0x1800 , "CPB" , param_loc , 0 }, + {0x7800 , 0x2000 , "ADA" , param_loc , 0 }, + {0x7800 , 0x2800 , "ADB" , param_loc , 0 }, + {0x7800 , 0x3000 , "STA" , param_loc , 0 }, + {0x7800 , 0x3800 , "STB" , param_loc , 0 }, + {0x7800 , 0x4000 , "JSM" , param_loc , DASMFLAG_STEP_OVER }, + {0x7800 , 0x4800 , "ISZ" , param_loc , 0 }, + {0x7800 , 0x5000 , "AND" , param_loc , 0 }, + {0x7800 , 0x5800 , "DSZ" , param_loc , 0 }, + {0x7800 , 0x6000 , "IOR" , param_loc , 0 }, + {0x7800 , 0x6800 , "JMP" , param_loc , 0 }, + {0x7fe0 , 0x7000 , "EXE" , param_addr32 , 0 }, + {0xffc0 , 0x7400 , "RZA" , param_skip , 0 }, + {0xffc0 , 0x7C00 , "RZB" , param_skip , 0 }, + {0xffc0 , 0x7440 , "RIA" , param_skip , 0 }, + {0xffc0 , 0x7C40 , "RIB" , param_skip , 0 }, + {0xffc0 , 0x7500 , "SZA" , param_skip , 0 }, + {0xffc0 , 0x7D00 , "SZB" , param_skip , 0 }, + {0xffc0 , 0x7540 , "SIA" , param_skip , 0 }, + {0xffc0 , 0x7D40 , "SIB" , param_skip , 0 }, + {0xffc0 , 0x7480 , "SFS" , param_skip , 0 }, + {0xffc0 , 0x7580 , "SFC" , param_skip , 0 }, + {0xffc0 , 0x7c80 , "SSS" , param_skip , 0 }, + {0xffc0 , 0x7d80 , "SSC" , param_skip , 0 }, + {0xffc0 , 0x7cc0 , "SHS" , param_skip , 0 }, + {0xffc0 , 0x7dc0 , "SHC" , param_skip , 0 }, + {0xff00 , 0x7600 , "SLA" , param_skip_sc , 0 }, + {0xff00 , 0x7e00 , "SLB" , param_skip_sc , 0 }, + {0xff00 , 0x7700 , "RLA" , param_skip_sc , 0 }, + {0xff00 , 0x7f00 , "RLB" , param_skip_sc , 0 }, + {0xff00 , 0xf400 , "SAP" , param_skip_sc , 0 }, + {0xff00 , 0xfc00 , "SBP" , param_skip_sc , 0 }, + {0xff00 , 0xf500 , "SAM" , param_skip_sc , 0 }, + {0xff00 , 0xfd00 , "SBM" , param_skip_sc , 0 }, + {0xff00 , 0xf600 , "SOC" , param_skip_sc , 0 }, + {0xff00 , 0xf700 , "SOS" , param_skip_sc , 0 }, + {0xff00 , 0xfe00 , "SEC" , param_skip_sc , 0 }, + {0xff00 , 0xff00 , "SES" , param_skip_sc , 0 }, + {0xffff , 0xf020 , "TCA" , param_none , 0 }, + {0xffff , 0xf820 , "TCB" , param_none , 0 }, + {0xffff , 0xf060 , "CMA" , param_none , 0 }, + {0xffff , 0xf860 , "CMB" , param_none , 0 }, + {0xff80 , 0xf080 , "RET" , param_ret , DASMFLAG_STEP_OUT }, + {0xfff0 , 0xf100 , "AAR" , param_n16 , 0 }, + {0xfff0 , 0xf900 , "ABR" , param_n16 , 0 }, + {0xffff , 0xf14f , "CLA" , param_none , 0 }, + {0xfff0 , 0xf140 , "SAR" , param_n16 , 0 }, + {0xffff , 0xf94f , "CLB" , param_none , 0 }, + {0xfff0 , 0xf940 , "SBR" , param_n16 , 0 }, + {0xfff0 , 0xf180 , "SAL" , param_n16 , 0 }, + {0xfff0 , 0xf980 , "SBL" , param_n16 , 0 }, + {0xfff0 , 0xf1c0 , "RAR" , param_n16 , 0 }, + {0xfff0 , 0xf9c0 , "RBR" , param_n16 , 0 }, + // *** IOC Instructions *** + {0xffff , 0x7100 , "SDO" , param_none , 0 }, + {0xffff , 0x7108 , "SDI" , param_none , 0 }, + {0xffff , 0x7110 , "EIR" , param_none , 0 }, + {0xffff , 0x7118 , "DIR" , param_none , 0 }, + {0xffff , 0x7120 , "DMA" , param_none , 0 }, + {0xffff , 0x7128 , "PCM" , param_none , 0 }, + {0xffff , 0x7138 , "DDR" , param_none , 0 }, + {0xffff , 0x7140 , "DBL" , param_none , 0 }, + {0xffff , 0x7148 , "CBL" , param_none , 0 }, + {0xffff , 0x7150 , "DBU" , param_none , 0 }, + {0xffff , 0x7158 , "CBU" , param_none , 0 }, + {0xff78 , 0x7160 , "PWC" , param_reg_id , 0 }, + {0xff78 , 0x7168 , "PWD" , param_reg_id , 0 }, + {0xff78 , 0x7960 , "PBC" , param_reg_id , 0 }, + {0xff78 , 0x7968 , "PBD" , param_reg_id , 0 }, + {0xff78 , 0x7170 , "WWC" , param_reg_id , 0 }, + {0xff78 , 0x7178 , "WWD" , param_reg_id , 0 }, + {0xff78 , 0x7970 , "WBC" , param_reg_id , 0 }, + {0xff78 , 0x7978 , "WBD" , param_reg_id , 0 }, + // *** END *** + {0 , 0 , NULL , NULL , 0 } +}; + +CPU_DISASSEMBLE(hp_hybrid) +{ + UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ]; + const dis_entry_t *p; + + for (p = dis_table; p->m_op_mask; p++) { + if ((opcode & p->m_op_mask) == p->m_opcode) { + strcpy(buffer , p->m_mnemonic); + strcat(buffer , " "); + p->m_param_fn(buffer , pc , opcode); + return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED; + } + } + + // Unknown opcode + strcpy(buffer , "???"); + + return 1 | DASMFLAG_SUPPORTED; +} diff --git a/src/mess/drivers/hp64k.c b/src/mess/drivers/hp64k.c new file mode 100644 index 00000000000..a2ec759839f --- /dev/null +++ b/src/mess/drivers/hp64k.c @@ -0,0 +1,51 @@ +// license:BSD-3-Clause +// copyright-holders:F. Ulivi +// +// *************************************** +// Driver for HP 64000 development system +// *************************************** +// + +#include "emu.h" +#include "cpu/hphybrid/hphybrid.h" + +class hp64k_state : public driver_device +{ +public: + hp64k_state(const machine_config &mconfig, device_type type, const char *tag); + +private: + required_device m_cpu; +}; + +static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 16 , hp64k_state) + AM_RANGE(0x0000 , 0x3fff) AM_ROM + AM_RANGE(0x8000 , 0xffff) AM_RAM +ADDRESS_MAP_END + +hp64k_state::hp64k_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig , type , tag), + m_cpu(*this , "cpu") +{ +} + +static MACHINE_CONFIG_START(hp64k , hp64k_state) + MCFG_CPU_ADD("cpu" , HP_5061_3011 , 6250000) + MCFG_CPU_PROGRAM_MAP(cpu_mem_map) + MCFG_QUANTUM_TIME(attotime::from_hz(100)) +MACHINE_CONFIG_END + +ROM_START(hp64k) + ROM_REGION(0x8000 , "cpu" , ROMREGION_16BIT | ROMREGION_BE | ROMREGION_INVERT) + ROM_LOAD16_BYTE("64100_80022.bin" , 0x0000 , 0x1000 , CRC(38b2aae5)) + ROM_LOAD16_BYTE("64100_80020.bin" , 0x0001 , 0x1000 , CRC(ac01b436)) + ROM_LOAD16_BYTE("64100_80023.bin" , 0x2000 , 0x1000 , CRC(6b4bc2ce)) + ROM_LOAD16_BYTE("64100_80021.bin" , 0x2001 , 0x1000 , CRC(74f9d33c)) + ROM_LOAD16_BYTE("64100_80026.bin" , 0x4000 , 0x1000 , CRC(a74e834b)) + ROM_LOAD16_BYTE("64100_80024.bin" , 0x4001 , 0x1000 , CRC(2e15a1d2)) + ROM_LOAD16_BYTE("64100_80027.bin" , 0x6000 , 0x1000 , CRC(b93c0e7a)) + ROM_LOAD16_BYTE("64100_80025.bin" , 0x6001 , 0x1000 , CRC(e6353085)) +ROM_END + +/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ +COMP( 1979, hp64k, 0, 0, hp64k, 0, driver_device, 0, "HP", "HP 64000" , GAME_NO_SOUND) From 25a8f0715d82270b06846afb6055ad2a0e5671e7 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 3 Jun 2015 17:03:50 +0200 Subject: [PATCH 119/284] reverted this commit --- scripts/target/mame/arcade.lua | 1 - src/mame/arcade.lst | 1 - src/mame/drivers/mnkymgic.c | 413 --------------------------------- 3 files changed, 415 deletions(-) delete mode 100644 src/mame/drivers/mnkymgic.c diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 639ad7c4385..aababae90f6 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -2202,7 +2202,6 @@ files { createMAMEProjects(_target, _subtarget, "nintendo") files { MAME_DIR .. "src/mame/drivers/cham24.c", - MAME_DIR .. "src/mame/drivers/mnkymgic.c", MAME_DIR .. "src/mame/drivers/dkong.c", MAME_DIR .. "src/mame/audio/dkong.c", MAME_DIR .. "src/mame/video/dkong.c", diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 3baa769e37e..5d9bfd3bda2 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -1196,7 +1196,6 @@ superdqs // ???? (c) 1984 superdqa // ???? (c) 1984 // Nintendo games -mnkymgic // (c) 1979 Nintendo spacefev // (c) 1979 Nintendo spacefevo // (c) 1979 Nintendo spacefevo2 // (c) 1979 Nintendo diff --git a/src/mame/drivers/mnkymgic.c b/src/mame/drivers/mnkymgic.c deleted file mode 100644 index 3a186352831..00000000000 --- a/src/mame/drivers/mnkymgic.c +++ /dev/null @@ -1,413 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Hau, Chack'n -/*************************************************************************** - - -Monkey Magic -(c)1979 Nintendo - - ---- Team Japump!!! --- -Dumped by Chack'n -Written by Hau -01/Jun/2015 -***************************************************************************/ - -#include "emu.h" -#include "cpu/i8085/i8085.h" -#include "sound/samples.h" - -#define USE_SAMPLES (1) - - -class mnkymgic_state : public driver_device -{ -public: - mnkymgic_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_videoram(*this, "videoram"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), -#if (USE_SAMPLES) - m_samples(*this, "samples") -#endif - { } - - /* devices */ - required_device m_maincpu; - required_shared_ptr m_videoram; - required_device m_gfxdecode; - required_device m_palette; -#if (USE_SAMPLES) - required_device m_samples; -#endif - - /* misc */ - tilemap_t *m_bg_tilemap; - UINT8 m_obj_ball_x; - UINT8 m_obj_ball_y; - UINT8 m_color_map; - UINT8 m_sound_state; - - DECLARE_WRITE8_MEMBER(mnkymgic_videoram_w); - DECLARE_WRITE8_MEMBER(mnkymgic_obj_ball_x_w); - DECLARE_WRITE8_MEMBER(mnkymgic_obj_ball_y_w); - DECLARE_WRITE8_MEMBER(mnkymgic_colormap_w); - DECLARE_WRITE8_MEMBER(mnkymgic_audio_w); - virtual void machine_start(); - virtual void machine_reset(); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void video_start(); - DECLARE_PALETTE_INIT(mnkymgic); - void draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mnkymgic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -}; - - -/************************************* - * - * Video system - * - *************************************/ - -PALETTE_INIT_MEMBER(mnkymgic_state, mnkymgic) -{ - offs_t i; - - for (i = 0; i < palette.entries() / 2; i++) - { - palette.set_pen_color((i * 2) + 0, rgb_t::black); - palette.set_pen_color((i * 2) + 1, rgb_t(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2))); - } -} - - -TILE_GET_INFO_MEMBER(mnkymgic_state::get_bg_tile_info) -{ - const UINT8 *prom = memregion("proms")->base(); - - int code = m_videoram[tile_index]; - int color = (prom[code + m_color_map] ^ 0xff) & 0x07; - - SET_TILE_INFO_MEMBER(0, code, color, 0); -} - - -void mnkymgic_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(mnkymgic_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 12, 32, 16); -} - -WRITE8_MEMBER(mnkymgic_state::mnkymgic_videoram_w) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset); -} - -WRITE8_MEMBER(mnkymgic_state::mnkymgic_obj_ball_x_w) -{ - m_obj_ball_x = data; -} - -WRITE8_MEMBER(mnkymgic_state::mnkymgic_obj_ball_y_w) -{ - m_obj_ball_y = data; -} - -WRITE8_MEMBER(mnkymgic_state::mnkymgic_colormap_w) -{ - m_color_map = (data & 0x08) << 4; -} - - -void mnkymgic_state::draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - offs_t offs_x, offs_y; - - if (m_obj_ball_x > 0x02 && m_obj_ball_x < 0xff && m_obj_ball_y > 0x02 && m_obj_ball_y < 0xff) - { - int ball_y = (((m_obj_ball_y & 0xf0) >> 4) * 12) + (m_obj_ball_y & 0x0f); - - for (offs_y = 0; offs_y < 4; offs_y++) - { - for (offs_x = 0; offs_x < 4; offs_x++) - { - bitmap.pix16(ball_y-offs_y, m_obj_ball_x-offs_x) = m_palette->pen(0x0f);; - } - } - } -} - - -UINT32 mnkymgic_state::screen_update_mnkymgic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(m_palette->black_pen(), cliprect); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_ball(bitmap, cliprect); - - return 0; -} - - -/************************************* - * - * Audio system - * - *************************************/ - -#define SAMPLE_SOUND1 0 -#define SAMPLE_SOUND2_1 1 -#define SAMPLE_SOUND2_2 2 -#define SAMPLE_SOUND3 3 -#define SAMPLE_SOUND4 4 -#define SAMPLE_SOUND5 5 -#define SAMPLE_SOUND6_1 6 -#define SAMPLE_SOUND6_2 7 - -#define CHANNEL_SOUND1 0 - - -#if (USE_SAMPLES) -WRITE8_MEMBER(mnkymgic_state::mnkymgic_audio_w) -{ - if (data != m_sound_state) - { - if (~data & 0x80) - { - switch (m_sound_state) - { - case 0xff: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND4); - break; - - case 0xfe: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND3); - break; - - case 0xfd: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND5); - break; - - case 0xfc: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND2_1); - break; - - case 0xfb: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND2_2); - break; - - case 0xfa: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6_1); - break; - - case 0xf9: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6_2); - break; - - case 0xf8: - m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1); - break; - - default: - break; - } - } - } - - m_sound_state = data; -} - - -static const char *const mnkymgic_sample_names[] = -{ - "*mnkymgic", - "1", - "2", - "2-2", - "3", - "4", - "5", - "6", - "6-2", - 0 -}; - -#endif - - -/************************************* - * - * Memory handlers - * - *************************************/ - -static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, mnkymgic_state ) - AM_RANGE(0x0000, 0x13ff) AM_ROM - AM_RANGE(0x2000, 0x21ff) AM_RAM - AM_RANGE(0x3000, 0x31ff) AM_RAM_WRITE(mnkymgic_videoram_w) AM_SHARE("videoram") - AM_RANGE(0x8002, 0x8002) AM_WRITE(mnkymgic_obj_ball_x_w) - AM_RANGE(0x8003, 0x8003) AM_WRITE(mnkymgic_obj_ball_y_w) - AM_RANGE(0x8004, 0x8004) AM_READ_PORT("VBLANK") -ADDRESS_MAP_END - - -/************************************* - * - * Port handlers - * - *************************************/ - -static ADDRESS_MAP_START( main_io_map, AS_IO, 8, mnkymgic_state ) - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x80, 0x80) AM_WRITE(mnkymgic_colormap_w) - AM_RANGE(0x81, 0x81) AM_WRITE(mnkymgic_audio_w) - AM_RANGE(0x85, 0x85) AM_READ_PORT("PADDLE") - AM_RANGE(0x86, 0x86) AM_READ_PORT("INPUTS") - AM_RANGE(0x87, 0x87) AM_READ_PORT("DSW") -ADDRESS_MAP_END - - -/************************************* - * - * Port definitions - * - *************************************/ - -static INPUT_PORTS_START( mnkymgic ) - PORT_START("VBLANK") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") - - PORT_START("DSW") - PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) ) - PORT_DIPSETTING( 0x00, "6" ) - PORT_DIPSETTING( 0x08, "5" ) - PORT_DIPSETTING( 0x10, "4" ) - PORT_DIPSETTING( 0x18, "3" ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("INPUTS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("PADDLE") - PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_CENTERDELTA(0) -INPUT_PORTS_END - - -/************************************* - * - * Graphics Layouts - * - *************************************/ - -static const gfx_layout charlayout = -{ - 8,12, - RGN_FRAC(1,1), - 1, - { 0 }, - { 3, 2, 1, 0, 7, 6, 5, 4 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8 }, - 8*16 -}; - -static GFXDECODE_START( mnkymgic ) - GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 ) -GFXDECODE_END - - -/************************************* - * - * Machine drivers - * - *************************************/ - -void mnkymgic_state::machine_start() -{ - /* Set up save state */ - save_item(NAME(m_obj_ball_x)); - save_item(NAME(m_obj_ball_y)); - save_item(NAME(m_color_map)); - save_item(NAME(m_sound_state)); -} - -void mnkymgic_state::machine_reset() -{ - m_obj_ball_x = 0; - m_obj_ball_y = 0; - m_sound_state = 0x80; -} - -static MACHINE_CONFIG_START( mnkymgic, mnkymgic_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", I8085A, 6144000/2) /* 3.072MHz ? */ - MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_IO_MAP(main_io_map) - - MCFG_GFXDECODE_ADD("gfxdecode", "palette", mnkymgic) - - /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 191) - MCFG_SCREEN_UPDATE_DRIVER(mnkymgic_state, screen_update_mnkymgic) - MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD("palette", 16) - MCFG_PALETTE_INIT_OWNER(mnkymgic_state, mnkymgic) - -#if (USE_SAMPLES) - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("samples", SAMPLES, 0) - MCFG_SAMPLES_CHANNELS(1) - MCFG_SAMPLES_NAMES(mnkymgic_sample_names) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) -#endif -MACHINE_CONFIG_END - - -/************************************* - * - * ROM definitions - * - *************************************/ - -ROM_START( mnkymgic ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1a.bin", 0x0000, 0x0400, CRC(ec772e2e) SHA1(7efc1bbb24b2ed73c518aea1c4ef4b9a93034e31) ) - ROM_LOAD( "2a.bin", 0x0400, 0x0400, CRC(e5d482ca) SHA1(208b808e9208bb6f5f5f89ffbeb5a885be33733a) ) - ROM_LOAD( "3a.bin", 0x0800, 0x0400, CRC(e8d38deb) SHA1(d7384234fb47e4b1d0421f58571fa748662b05f5) ) - ROM_LOAD( "4a.bin", 0x0c00, 0x0400, CRC(3048bd6c) SHA1(740051589f6ba44b2ee68edf76a3177bb973d78e) ) - ROM_LOAD( "5a.bin", 0x1000, 0x0400, CRC(2cab8f04) SHA1(203a3c005f18f968cd14c972bbb9fd7e0fc3b670) ) - - ROM_REGION( 0x600, "gfx1", ROMREGION_INVERT ) - ROM_LOAD( "6h.bin", 0x0000, 0x0200, CRC(b6321b6f) SHA1(06611f7419d2982e006a3e81b79677e59e194f38) ) /* tilemap */ - ROM_LOAD( "7h.bin", 0x0200, 0x0200, CRC(9ec0e82c) SHA1(29983f690a1b6134bb1983921f42c14898788095) ) - ROM_LOAD( "6j.bin", 0x0400, 0x0200, CRC(7ce83302) SHA1(1870610ff07ab11622e183e04e3fce29328ff291) ) - - ROM_REGION( 0x200, "proms", 0 ) - ROM_LOAD( "7j.bin", 0x0000, 0x0200, CRC(b7eb8e1c) SHA1(b65a8efb88668dcf1c1d00e31a9b15a67c2972c8) ) /* tile palettes selector */ -ROM_END - - -/************************************* - * - * Game drivers - * - *************************************/ - -GAME(1979, mnkymgic, 0, mnkymgic, mnkymgic, driver_device, 0, ROT270, "Nintendo", "Monkey Magic (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) From 8afcf3f9ce1c1950d5cb7453f4f5ac356121e8ad Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 3 Jun 2015 18:55:46 +0200 Subject: [PATCH 120/284] svi318: updated to use the new wd fdc. floppy support has been restored, which was broken for a long time. --- src/lib/formats/svi_dsk.c | 241 ++++++++++++++++--------------------- src/lib/formats/svi_dsk.h | 37 ++++-- src/mess/drivers/svi318.c | 45 +++---- src/mess/includes/svi318.h | 15 ++- src/mess/machine/svi318.c | 56 +++------ 5 files changed, 181 insertions(+), 213 deletions(-) diff --git a/src/lib/formats/svi_dsk.c b/src/lib/formats/svi_dsk.c index 491169bec28..0c76aace591 100644 --- a/src/lib/formats/svi_dsk.c +++ b/src/lib/formats/svi_dsk.c @@ -1,174 +1,143 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/********************************************************************* +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** - formats/svi_dsk.c + Spectravideo SVI-318/328 - SVI318 disk images + Disk image format -*********************************************************************/ - -#include -#include +***************************************************************************/ #include "svi_dsk.h" -#include "basicdsk.h" -static FLOPPY_IDENTIFY(svi_dsk_identify) +svi_format::svi_format() { - *vote = ((floppy_image_size(floppy) == (172032)) || (floppy_image_size(floppy) == (346112))) ? 100 : 0; - return FLOPPY_ERROR_SUCCESS; } -static int svi_get_heads_per_disk(floppy_image_legacy *floppy) +const char *svi_format::name() const { - return (floppy_image_size(floppy) == (172032)) ? 1 : 2; + return "svi"; } -static int svi_get_tracks_per_disk(floppy_image_legacy *floppy) +const char *svi_format::description() const { - return 40; + return "SVI-318/328 disk image"; } -static UINT64 svi_translate_offset(floppy_image_legacy *floppy, - int track, int head, int sector) +const char *svi_format::extensions() const { - UINT64 o; - if ((track==0) && (head==0)) - o = sector*128; - else - o = ((track*((floppy_image_size(floppy) == (172032)) ? 1 : 2)+head)*17+sector)*256-2048; /* (17*256)-(18*128)=2048 */ - - return o; + return "dsk"; } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +int svi_format::identify(io_generic *io, UINT32 form_factor) { - UINT64 offs; - /* translate the sector to a raw sector */ - if (!sector_is_index) + UINT64 size = io_generic_size(io); + + if (size == 172032 || size == 346112) + return 50; + + return 0; +} + +bool svi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +{ + UINT64 size = io_generic_size(io); + int head_count; + + switch (size) { - sector -= 1; + case 172032: head_count = 1; break; + case 346112: head_count = 2; break; + default: return false; } - /* check to see if we are out of range */ - if ((head < 0) || (head >= ((floppy_image_size(floppy) == (172032)) ? 1 : 2)) || (track < 0) || (track >= 40) - || (sector < 0) || (sector >= ((head==0 && track==0) ? 18 : 17))) - return FLOPPY_ERROR_SEEKERROR; - offs = svi_translate_offset(floppy, track, head, sector); - if (offset) - *offset = offs; - return FLOPPY_ERROR_SUCCESS; -} + int file_offset = 0; + for (int track = 0; track < 40; track++) + { + for (int head = 0; head < head_count ; head++) + { + int sector_count = (track == 0 && head == 0) ? 18 : 17; + int sector_size = (track == 0 && head == 0) ? 128 : 256; + desc_pc_sector sectors[20]; + UINT8 sector_data[5000]; + int sector_offset = 0; -static floperr_t internal_svi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) -{ - UINT64 offset; - floperr_t err; - err = get_offset(floppy, head, track, sector, sector_is_index, &offset); - if (err) - return err; + for (int i = 0; i < sector_count; i++) + { + sectors[i].track = track; + sectors[i].head = head; + sectors[i].sector = i + 1; + sectors[i].actual_size = sector_size; + sectors[i].size = sector_size >> 8; + sectors[i].deleted = false; + sectors[i].bad_crc = false; + sectors[i].data = §or_data[sector_offset]; - floppy_image_read(floppy, buffer, offset, buflen); - return FLOPPY_ERROR_SUCCESS; -} + io_generic_read(io, sectors[i].data, file_offset, sector_size); + sector_offset += sector_size; + file_offset += sector_size; + } - -static floperr_t internal_svi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam) -{ - UINT64 offset; - floperr_t err; - - err = get_offset(floppy, head, track, sector, sector_is_index, &offset); - if (err) - return err; - - floppy_image_write(floppy, buffer, offset, buflen); - return FLOPPY_ERROR_SUCCESS; -} - - - -static floperr_t svi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) -{ - return internal_svi_read_sector(floppy, head, track, sector, FALSE, buffer, buflen); -} - -static floperr_t svi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) -{ - return internal_svi_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam); -} - -static floperr_t svi_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) -{ - return internal_svi_read_sector(floppy, head, track, sector, TRUE, buffer, buflen); -} - -static floperr_t svi_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) -{ - return internal_svi_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam); -} - -static floperr_t svi_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) -{ - floperr_t err; - err = get_offset(floppy, head, track, sector, FALSE, NULL); - if (err) - return err; - - if (sector_length) { - *sector_length = (head==0 && track==0) ? 128 : 256; + if (track == 0 && head == 0) + build_wd_track_fm(track, head, image, 50000, sector_count, sectors, 10, 26, 11); + else + build_wd_track_mfm(track, head, image, 100000, sector_count, sectors, 32, 50, 22); + } } - return FLOPPY_ERROR_SUCCESS; + + return true; } - - -static floperr_t svi_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +bool svi_format::save(io_generic *io, floppy_image *image) { - sector_index += 1; - if (cylinder) - *cylinder = track; - if (side) - *side = head; - if (sector) - *sector = sector_index; - if (flags) - /* TODO: read DAM or DDAM and determine flags */ - *flags = 0; - return svi_get_sector_length(floppy, head, track, sector_index, sector_length); + UINT8 bitstream[500000/8]; + UINT8 sector_data[50000]; + desc_xs sectors[256]; + int track_size; + UINT64 file_offset = 0; + + int track_count, head_count; + image->get_actual_geometry(track_count, head_count); + + // initial fm track + generate_bitstream_from_track(0, 0, 4000, bitstream, track_size, image); + extract_sectors_from_bitstream_fm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data)); + + for (int i = 0; i < 18; i++) + { + io_generic_write(io, sectors[i + 1].data, file_offset, 128); + file_offset += 128; + } + + // rest are mfm tracks + for (int track = 0; track < track_count; track++) + { + for (int head = 0; head < head_count; head++) + { + // skip track 0, head 0 + if (track == 0) { if (head_count == 1) break; else head++; } + + generate_bitstream_from_track(track, head, 2000, bitstream, track_size, image); + extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data)); + + for (int i = 0; i < 17; i++) + { + io_generic_write(io, sectors[i + 1].data, file_offset, 256); + file_offset += 256; + } + } + } + + return true; } - -static FLOPPY_CONSTRUCT(svi_dsk_construct) +bool svi_format::supports_save() const { - struct FloppyCallbacks *callbacks; - callbacks = floppy_callbacks(floppy); - callbacks->read_sector = svi_read_sector; - callbacks->write_sector = svi_write_sector; - callbacks->read_indexed_sector = svi_read_indexed_sector; - callbacks->write_indexed_sector = svi_write_indexed_sector; - callbacks->get_sector_length = svi_get_sector_length; - callbacks->get_heads_per_disk = svi_get_heads_per_disk; - callbacks->get_tracks_per_disk = svi_get_tracks_per_disk; - callbacks->get_indexed_sector_info = svi_get_indexed_sector_info; - - return FLOPPY_ERROR_SUCCESS; + return true; } +const floppy_format_type FLOPPY_SVI_FORMAT = &floppy_image_format_creator; - -/* ----------------------------------------------------------------------- */ - -LEGACY_FLOPPY_OPTIONS_START( svi318 ) - LEGACY_FLOPPY_OPTION( svi_dsk, "dsk", "SVI-318 floppy disk image", svi_dsk_identify, svi_dsk_construct, NULL, NULL) - LEGACY_FLOPPY_OPTION( svi_cpm, "dsk", "SVI-728 DSDD CP/M disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([40]) - SECTORS([17]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END diff --git a/src/lib/formats/svi_dsk.h b/src/lib/formats/svi_dsk.h index 3b88c496dcb..6ffd74619a1 100644 --- a/src/lib/formats/svi_dsk.h +++ b/src/lib/formats/svi_dsk.h @@ -1,20 +1,35 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/********************************************************************* +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** - formats/svi_dsk.h + Spectravideo SVI-318/328 - SVI318 disk images + Disk image format -*********************************************************************/ +***************************************************************************/ -#ifndef SVI_DSK_H -#define SVI_DSK_H +#pragma once + +#ifndef __SVI_DSK_H__ +#define __SVI_DSK_H__ #include "flopimg.h" -/**************************************************************************/ +class svi_format : public floppy_image_format_t +{ +public: + svi_format(); -LEGACY_FLOPPY_OPTIONS_EXTERN(svi318); + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; -#endif /* SVI_DSK_H */ + virtual int identify(io_generic *io, UINT32 form_factor); + virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); + virtual bool save(io_generic *io, floppy_image *image); + virtual bool supports_save() const; +}; + +extern const floppy_format_type FLOPPY_SVI_FORMAT; + +#endif // __SVI_DSK_H__ diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c index 7db4cc0d366..147252b2cb1 100644 --- a/src/mess/drivers/svi318.c +++ b/src/mess/drivers/svi318.c @@ -245,12 +245,13 @@ WRITE_LINE_MEMBER(svi318_state::vdp_interrupt) m_maincpu->set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE)); } -static const floppy_interface svi318_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(svi318), - "floppy_5_25" -}; +FLOPPY_FORMATS_MEMBER( svi318_state::floppy_formats ) + FLOPPY_SVI_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( svi_floppies ) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END static MACHINE_CONFIG_FRAGMENT( svi318_cartslot ) MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "svi318_cart") @@ -307,16 +308,16 @@ static MACHINE_CONFIG_START( svi318, svi318_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) MCFG_CASSETTE_INTERFACE("svi318_cass") - MCFG_DEVICE_ADD("wd179x", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w)) + MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_cass") - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(svi318_floppy_interface) + MCFG_FD1793x_ADD("wd179x", XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w)) - /* Software lists */ - MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_flop") - MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_cass") + MCFG_FLOPPY_DRIVE_ADD("wd179x:0", svi_floppies, "dd", svi318_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd179x:1", svi_floppies, "dd", svi318_state::floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_flop") MCFG_FRAGMENT_ADD(svi318_cartslot) @@ -436,16 +437,16 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) MCFG_CASSETTE_INTERFACE("svi318_cass") - MCFG_DEVICE_ADD("wd179x", FD1793, 0) - MCFG_WD17XX_DEFAULT_DRIVE2_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w)) + MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_cass") - MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(svi318_floppy_interface) + MCFG_FD1793x_ADD("wd179x", XTAL_1MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w)) - /* Software lists */ - MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_flop") - MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_cass") + MCFG_FLOPPY_DRIVE_ADD("wd179x:0", svi_floppies, "dd", svi318_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("wd179x:1", svi_floppies, "dd", svi318_state::floppy_formats) + + MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_flop") MCFG_FRAGMENT_ADD(svi318_cartslot) diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h index 411f2f3a8a4..a699f6e9bfb 100644 --- a/src/mess/includes/svi318.h +++ b/src/mess/includes/svi318.h @@ -14,7 +14,7 @@ #include "cpu/z80/z80.h" #include "machine/i8255.h" #include "machine/ins8250.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/ram.h" #include "machine/buffer.h" #include "imagedev/cassette.h" @@ -44,22 +44,25 @@ public: m_ins8250_1(*this, "ins8250_1"), m_cart(*this, "cartslot"), m_fd1793(*this, "wd179x"), + m_floppy0(*this, "wd179x:0"), + m_floppy1(*this, "wd179x:1"), m_crtc(*this, "crtc"), m_line(*this, "LINE"), m_joysticks(*this, "JOYSTICKS"), m_buttons(*this, "BUTTONS"), m_palette(*this, "palette"), + m_floppy(NULL), m_bank1(*this, "bank1"), m_bank2(*this, "bank2"), m_bank3(*this, "bank3"), m_bank4(*this, "bank4") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + // FDC - UINT8 m_driveselect; int m_drq; int m_irq; - UINT8 m_heads[2]; DECLARE_WRITE8_MEMBER(ppi_w); DECLARE_READ8_MEMBER(psg_port_a_r); @@ -105,7 +108,9 @@ protected: required_device m_ins8250_0; required_device m_ins8250_1; required_device m_cart; - required_device m_fd1793; + required_device m_fd1793; + required_device m_floppy0; + required_device m_floppy1; optional_device m_crtc; required_ioport_array<11> m_line; required_ioport m_joysticks; @@ -134,6 +139,8 @@ private: // keyboard UINT8 m_keyboard_row; + floppy_image_device *m_floppy; + // centronics int m_centronics_busy; diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c index aa2525d365b..240a1cff9eb 100644 --- a/src/mess/machine/svi318.c +++ b/src/mess/machine/svi318.c @@ -223,23 +223,26 @@ WRITE_LINE_MEMBER(svi318_state::fdc_drq_w) WRITE8_MEMBER(svi318_state::fdc_drive_motor_w) { - switch (data & 3) - { - case 1: - m_fd1793->set_drive(0); - m_driveselect = 0; - break; - case 2: - m_fd1793->set_drive(1); - m_driveselect = 1; - break; - } + m_floppy = NULL; + + if (BIT(data, 0)) m_floppy = m_floppy0->get_device(); + if (BIT(data, 1)) m_floppy = m_floppy1->get_device(); + + m_fd1793->set_floppy(m_floppy); + + if (m_floppy0->get_device()) + m_floppy0->get_device()->mon_w(!BIT(data, 2)); + + if (m_floppy1->get_device()) + m_floppy1->get_device()->mon_w(!BIT(data, 3)); } WRITE8_MEMBER(svi318_state::fdc_density_side_w) { m_fd1793->dden_w(BIT(data, 0)); - m_fd1793->set_side(BIT(data, 1)); + + if (m_floppy) + m_floppy->ss_w(BIT(data, 1)); } READ8_MEMBER(svi318_state::fdc_irqdrq_r) @@ -445,10 +448,8 @@ void svi318_state::machine_start() } // register for savestates - save_item(NAME(m_driveselect)); save_item(NAME(m_drq)); save_item(NAME(m_irq)); - save_item(NAME(m_heads)); save_item(NAME(m_bank_switch)); save_item(NAME(m_bank_low)); @@ -465,34 +466,12 @@ void svi318_state::machine_start() machine().save().register_postload(save_prepost_delegate(FUNC(svi318_state::postload), this)); } - -static void svi318_load_proc(device_image_interface &image) -{ - svi318_state *state = image.device().machine().driver_data(); - int size = image.length(); - int id = floppy_get_drive(&image.device()); - - switch (size) - { - case 172032: /* SVI-328 SSDD */ - state->m_heads[id] = 1; - break; - case 346112: /* SVI-328 DSDD */ - state->m_heads[id] = 2; - break; - case 348160: /* SVI-728 DSDD CP/M */ - state->m_heads[id] = 2; - break; - } -} - void svi318_state::machine_reset() { m_keyboard_row = 0; m_centronics_busy = 0; m_svi806_present = 0; m_svi806_ram_enabled = 0; - m_driveselect = 0; m_drq = 0; m_irq = 0; @@ -504,9 +483,6 @@ void svi318_state::machine_reset() m_bank_switch = 0xff; set_banks(); - - for (int drive = 0; drive < 2; drive++) - floppy_get_device(machine(), drive)->floppy_install_load_proc(svi318_load_proc); } /* Memory */ @@ -760,7 +736,7 @@ WRITE8_MEMBER(svi318_state::io_ext_w) break; case 0x30: - m_fd1793->command_w(space, 0, data); + m_fd1793->cmd_w(space, 0, data); break; case 0x31: m_fd1793->track_w(space, 0, data); From 49168ace9212eb823e9def940f19f3c286cfa07a Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 3 Jun 2015 19:47:24 +0200 Subject: [PATCH 121/284] svi318: add some floppy disk images to the softlist --- hash/svi318_flop.xml | 46 +++++++++++++++++++++++++++++++++++++-- src/mess/machine/svi318.c | 1 - 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/hash/svi318_flop.xml b/hash/svi318_flop.xml index 8af9aace0fd..cec4a987cd9 100644 --- a/hash/svi318_flop.xml +++ b/hash/svi318_flop.xml @@ -6,7 +6,6 @@ Info Taken from here: http://www.samdal.com/svsoftware.htm These disks are not dumped: Wordstar dBase II -CP/M-80 2.22 Single Sided Disk According to http://www.tosecdev.org/forum/errors-contributions/spectravideo-svi-318-and-svi-328-(tosec)-549/ @@ -26,7 +25,7 @@ Rädda disketten (198x)(sv) --> - + CP/M-80 version 2.24 @@ -45,7 +44,50 @@ Rädda disketten (198x)(sv) + + + CP/M-80 2.22 + 1983 + Spectravideo + + + + + + + + + CP/M-80 2.24 for SV-605B + 1984 + Spectravideo + + + + + + + + + Disk Basic 1.0 + 1983? + Spectravideo + + + + + + + + + Z-CPR3 + 1985? + <unknown> + + + + + diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c index 240a1cff9eb..89ea87ce0e8 100644 --- a/src/mess/machine/svi318.c +++ b/src/mess/machine/svi318.c @@ -12,7 +12,6 @@ #include "includes/svi318.h" #include "cpu/z80/z80.h" #include "video/tms9928a.h" -#include "machine/wd17xx.h" #include "imagedev/flopdrv.h" #include "formats/svi_cas.h" #include "sound/ay8910.h" From ca8338d5a5605f06697c02f101a44f45009ac711 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 3 Jun 2015 19:56:13 +0200 Subject: [PATCH 122/284] Found some cycles by removing static declarations in some functions. (nw) --- src/emu/netlist/analog/nld_twoterm.c | 2 +- src/emu/netlist/devices/nld_4020.c | 4 ++-- src/emu/netlist/devices/nld_7404.c | 2 +- src/emu/netlist/devices/nld_74192.c | 2 +- src/emu/netlist/devices/nld_82S16.c | 2 -- src/emu/netlist/devices/nld_9310.c | 2 +- src/emu/netlist/devices/nld_9312.c | 4 ++-- src/emu/netlist/devices/nld_9316.c | 2 +- src/emu/netlist/nl_base.c | 28 +++++++++++++++++++++++++--- src/emu/netlist/nl_base.h | 6 +++--- src/emu/netlist/nl_time.h | 6 ++++-- src/emu/netlist/nl_util.h | 19 ++++++++++++------- src/emu/netlist/plib/plists.h | 6 +++--- 13 files changed, 56 insertions(+), 29 deletions(-) diff --git a/src/emu/netlist/analog/nld_twoterm.c b/src/emu/netlist/analog/nld_twoterm.c index 5c43a500d88..958ad33ab51 100644 --- a/src/emu/netlist/analog/nld_twoterm.c +++ b/src/emu/netlist/analog/nld_twoterm.c @@ -22,7 +22,7 @@ ATTR_COLD netlist_generic_diode::netlist_generic_diode() ATTR_COLD void netlist_generic_diode::set_param(const nl_double Is, const nl_double n, nl_double gmin) { - static const int csqrt2 = nl_math::sqrt(2.0); + static const double csqrt2 = nl_math::sqrt(2.0); m_Is = Is; m_n = n; m_gmin = gmin; diff --git a/src/emu/netlist/devices/nld_4020.c b/src/emu/netlist/devices/nld_4020.c index f0e160de8d3..93166b11fc4 100644 --- a/src/emu/netlist/devices/nld_4020.c +++ b/src/emu/netlist/devices/nld_4020.c @@ -76,7 +76,7 @@ NETLIB_UPDATE(4020) { sub.m_cnt = 0; sub.m_IP.inactivate(); - static const netlist_time reset_time = netlist_time::from_nsec(140); + /* static */ const netlist_time reset_time = netlist_time::from_nsec(140); OUTLOGIC(sub.m_Q[0], 0, reset_time); for (int i=3; i<14; i++) OUTLOGIC(sub.m_Q[i], 0, reset_time); @@ -87,7 +87,7 @@ NETLIB_UPDATE(4020) inline NETLIB_FUNC_VOID(4020_sub, update_outputs, (const UINT16 cnt)) { - static const netlist_time out_delayQn[14] = { + /* static */ const netlist_time out_delayQn[14] = { NLTIME_FROM_NS(180), NLTIME_FROM_NS(280), NLTIME_FROM_NS(380), NLTIME_FROM_NS(480), NLTIME_FROM_NS(580), NLTIME_FROM_NS(680), diff --git a/src/emu/netlist/devices/nld_7404.c b/src/emu/netlist/devices/nld_7404.c index 57050ac8cd8..2c812744db0 100644 --- a/src/emu/netlist/devices/nld_7404.c +++ b/src/emu/netlist/devices/nld_7404.c @@ -19,7 +19,7 @@ NETLIB_RESET(7404) NETLIB_UPDATE(7404) { - static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; + /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; UINT8 t = (INPLOGIC(m_I)) ^ 1; OUTLOGIC(m_Q, t, delay[t]); } diff --git a/src/emu/netlist/devices/nld_74192.c b/src/emu/netlist/devices/nld_74192.c index 785b0d48094..2343ff2055b 100644 --- a/src/emu/netlist/devices/nld_74192.c +++ b/src/emu/netlist/devices/nld_74192.c @@ -42,7 +42,7 @@ NETLIB_RESET(74192) } // FIXME: Timing -static const netlist_time delay[4] = +/* static */ const netlist_time delay[4] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(40), diff --git a/src/emu/netlist/devices/nld_82S16.c b/src/emu/netlist/devices/nld_82S16.c index a9f7b7c9072..1cf8d8e8182 100644 --- a/src/emu/netlist/devices/nld_82S16.c +++ b/src/emu/netlist/devices/nld_82S16.c @@ -7,8 +7,6 @@ #include "nld_82S16.h" -//static const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; - // FIXME: timing! // FIXME: optimize device (separate address decoder!) NETLIB_UPDATE(82S16) diff --git a/src/emu/netlist/devices/nld_9310.c b/src/emu/netlist/devices/nld_9310.c index 42787be9157..29b941d4417 100644 --- a/src/emu/netlist/devices/nld_9310.c +++ b/src/emu/netlist/devices/nld_9310.c @@ -156,7 +156,7 @@ inline NETLIB_FUNC_VOID(9310_sub, update_outputs_all, (const UINT8 cnt, const ne inline NETLIB_FUNC_VOID(9310_sub, update_outputs, (const UINT8 cnt)) { - static const netlist_time out_delay = NLTIME_FROM_NS(20); + /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20); #if 0 // for (int i=0; i<4; i++) // OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]); diff --git a/src/emu/netlist/devices/nld_9312.c b/src/emu/netlist/devices/nld_9312.c index a867ef6d986..7ed2c678f38 100644 --- a/src/emu/netlist/devices/nld_9312.c +++ b/src/emu/netlist/devices/nld_9312.c @@ -59,7 +59,7 @@ NETLIB_UPDATE(9312) const UINT8 G = INPLOGIC(m_G); if (G) { - static const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(19) }; + /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(19) }; OUTLOGIC(m_Y, 0, delay[0]); OUTLOGIC(m_YQ, 1, delay[1]); @@ -77,7 +77,7 @@ NETLIB_UPDATE(9312) m_B.activate(); m_C.activate(); } - static const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(28) }; + /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(28) }; const UINT8 chan = INPLOGIC(m_A) | (INPLOGIC(m_B)<<1) | (INPLOGIC(m_C)<<2); if (m_last_chan != chan) { diff --git a/src/emu/netlist/devices/nld_9316.c b/src/emu/netlist/devices/nld_9316.c index ce5b05cfbf0..dd922af52e3 100644 --- a/src/emu/netlist/devices/nld_9316.c +++ b/src/emu/netlist/devices/nld_9316.c @@ -151,7 +151,7 @@ inline NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const UINT8 cnt, const ne inline NETLIB_FUNC_VOID(9316_sub, update_outputs, (const UINT8 cnt)) { - static const netlist_time out_delay = NLTIME_FROM_NS(20); + /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20); #if 0 // for (int i=0; i<4; i++) // OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]); diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index e3f2361d337..47f9b8146af 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -422,12 +422,12 @@ ATTR_COLD void netlist_core_device_t::init(netlist_base_t &anetlist, const pstri #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update; - static_update = pFunc; + m_static_update = pFunc; #elif (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update; - static_update = reinterpret_cast((this->*pFunc)); + m_static_update = reinterpret_cast((this->*pFunc)); #elif (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL) - static_update = pmfp::get_mfp(&netlist_core_device_t::update, this); + m_static_update = pmfp::get_mfp(&netlist_core_device_t::update, this); #endif } @@ -685,7 +685,19 @@ ATTR_HOT /* inline */ void netlist_net_t::update_devs() m_in_queue = 2; /* mark as taken ... */ m_cur_Q = m_new_Q; +#if 0 + netlist_core_terminal_t * t[256]; + netlist_core_terminal_t *p = m_list_active.first(); + int cnt = 0; + while (p != NULL) + { + if ((p->state() & mask) != 0) + t[cnt++] = p; + p = m_list_active.next(p); + } + for (int i=0; inetdev().update_dev(); netlist_core_terminal_t *p = m_list_active.first(); while (p != NULL) @@ -693,6 +705,16 @@ ATTR_HOT /* inline */ void netlist_net_t::update_devs() p->update_dev(mask); p = m_list_active.next(p); } + +#else + netlist_core_terminal_t *p = m_list_active.first(); + + while (p != NULL) + { + p->update_dev(mask); + p = p->m_next; + } +#endif } ATTR_COLD void netlist_net_t::reset() diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index 07a99c8f0b1..7d9019d8859 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -1016,9 +1016,9 @@ public: inc_stat(stat_update_count); #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) - (this->*static_update)(); + (this->*m_static_update)(); #elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) - static_update(this); + m_static_update(this); #else update(); #endif @@ -1075,7 +1075,7 @@ protected: private: #if (NL_PMF_TYPE > NL_PMF_TYPE_VIRTUAL) - net_update_delegate static_update; + net_update_delegate m_static_update; #endif }; diff --git a/src/emu/netlist/nl_time.h b/src/emu/netlist/nl_time.h index a6ca27191e2..f5005af40fd 100644 --- a/src/emu/netlist/nl_time.h +++ b/src/emu/netlist/nl_time.h @@ -23,14 +23,14 @@ // net_list_time // ---------------------------------------------------------------------------------------- +#define RESOLUTION NETLIST_INTERNAL_RES + struct netlist_time { public: typedef UINT64 INTERNALTYPE; - static const INTERNALTYPE RESOLUTION = NETLIST_INTERNAL_RES; - ATTR_HOT /* inline */ netlist_time() : m_time(0) {} ATTR_HOT friend /* inline */ const netlist_time operator-(const netlist_time &left, const netlist_time &right); @@ -74,6 +74,8 @@ private: INTERNALTYPE m_time; }; +#undef RESOLUTION + template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist_time &nlt, const void *owner, const pstring &stname) { save_state_ptr(stname, DT_INT64, owner, sizeof(netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr(), false); diff --git a/src/emu/netlist/nl_util.h b/src/emu/netlist/nl_util.h index 020f8622208..bb5a564dd74 100644 --- a/src/emu/netlist/nl_util.h +++ b/src/emu/netlist/nl_util.h @@ -61,17 +61,22 @@ public: #if 0 inline static double fastexp_h(const double x) { - static const double ln2r = 1.442695040888963387; - static const double ln2 = 0.693147180559945286; - static const double c3 = 0.166666666666666667; + /* static */ const double ln2r = 1.442695040888963387; + /* static */ const double ln2 = 0.693147180559945286; + /* static */ const double c3 = 0.166666666666666667; + /* static */ const double c4 = 1.0 / 24.0; + /* static */ const double c5 = 1.0 / 120.0; const double y = x * ln2r; - const unsigned int t = y; + const UINT32 t = y; const double z = (x - ln2 * (double) t); - const double zz = z * z; - const double zzz = zz * z; + const double e = (1.0 + z * (1.0 + z * (0.5 + z * (c3 + z * (c4 + c5*z))))); - return (double)(1 << t)*(1.0 + z + 0.5 * zz + c3 * zzz); + if (t < 63) + //return (double)((UINT64) 1 << t)*(1.0 + z + 0.5 * zz + c3 * zzz+c4*zzzz+c5*zzzzz); + return (double)((UINT64) 1 << t) * e; + else + return pow(2.0, t)*e; } ATTR_HOT inline static double exp(const double x) diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h index 4f41c88ba3f..4c223ab9150 100644 --- a/src/emu/netlist/plib/plists.h +++ b/src/emu/netlist/plib/plists.h @@ -366,9 +366,9 @@ public: } private: - template static const pstring &get_name(const T *elem) { return elem->name(); } - template static const pstring &get_name(T *elem) { return elem->name(); } - template static const pstring &get_name(const T &elem) { return elem.name(); } + template const pstring &get_name(const T *elem) const { return elem->name(); } + template const pstring &get_name(T *elem) const { return elem->name(); } + template const pstring &get_name(const T &elem) const { return elem.name(); } }; From 381d3dd5723576ec75ef7979561bba2fc2933ec7 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 3 Jun 2015 19:54:24 +0200 Subject: [PATCH 123/284] Fixed superbug explosion overlay. [SoltanGris42, Couriersud] --- src/mame/layout/superbug.lay | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mame/layout/superbug.lay b/src/mame/layout/superbug.lay index 80dd0549bad..1672c4d6724 100644 --- a/src/mame/layout/superbug.lay +++ b/src/mame/layout/superbug.lay @@ -3,7 +3,10 @@ - + + + + From c01ee6740e362ce48e0fde3a5c1af612319f89b8 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Wed, 3 Jun 2015 21:59:26 +0200 Subject: [PATCH 124/284] (MESS) ti99: Removed legacy wd17xx controllers --- src/emu/bus/ti99_peb/bwg.c | 503 +------------------- src/emu/bus/ti99_peb/bwg.h | 108 ----- src/emu/bus/ti99_peb/peribox.c | 4 - src/emu/bus/ti99_peb/ti_fdc.c | 310 ------------- src/emu/bus/ti99_peb/ti_fdc.h | 81 ---- src/emu/machine/hdc9234.c | 48 +- src/mess/drivers/ti990_4.c | 15 +- src/mess/machine/ti99/990_dk.c | 815 +++++++++++++++++---------------- src/mess/machine/ti99/990_dk.h | 6 +- 9 files changed, 443 insertions(+), 1447 deletions(-) diff --git a/src/emu/bus/ti99_peb/bwg.c b/src/emu/bus/ti99_peb/bwg.c index c4776777da0..2ae171b9423 100644 --- a/src/emu/bus/ti99_peb/bwg.c +++ b/src/emu/bus/ti99_peb/bwg.c @@ -31,7 +31,7 @@ Known issues (Feb 2014): - 1. The BwG controller cannot run with the Geneve or other non-9900 computers. + - The BwG controller cannot run with the Geneve or other non-9900 computers. The reason for that is the wait state logic. It assumes that when executing MOVB @>5FF6,*R2, first a value from 5FF7 is attempted to be read, just as the TI console does. In that case, wait states are inserted if @@ -39,12 +39,6 @@ only and therefore circumvent the wait state generation. This is in fact not an emulation glitch but the behavior of the real expansion card. - Resolved issues (Feb 2014): - - 1. The BwG controller failed to read single-density disks. This only occurs - with the legacy implementation because the modern floppy implementation - reproduces the correct recording format on the medium, so the controller - actually detects FM or MFM. *******************************************************************************/ @@ -704,498 +698,3 @@ const rom_entry *snug_bwg_device::device_rom_region() const } const device_type TI99_BWG = &device_creator; - -// ========================================================================== - -#define FDCLEG_TAG "wd1773" - -/* - Legacy implementation -*/ -snug_bwg_legacy_device::snug_bwg_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_expansion_card_device(mconfig, TI99_BWG_LEG, "SNUG BwG Floppy Controller LEGACY", tag, owner, clock, "ti99_bwg_leg", __FILE__), - m_wd1773(*this, FDCLEG_TAG), - m_clock(*this, CLOCK_TAG) { } - -/* - Callback called at the end of DVENA pulse -*/ -void snug_bwg_legacy_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - m_DVENA = CLEAR_LINE; - set_ready_line(); -} - - -/* - Operate the wait state logic. -*/ -void snug_bwg_legacy_device::set_ready_line() -{ - // This is the wait state logic - if (TRACE_SIGNALS) logerror("bwg: address=%04x, DRQ=%d, INTRQ=%d, MOTOR=%d\n", m_address & 0xffff, m_DRQ, m_IRQ, m_DVENA); - line_state nready = (m_dataregLB && // Are we accessing 5ff7 - m_WAITena && // and the wait state generation is active (SBO 2) - (m_DRQ==CLEAR_LINE) && // and we are waiting for a byte - (m_IRQ==CLEAR_LINE) && // and there is no interrupt yet - (m_DVENA==ASSERT_LINE) // and the motor is turning? - )? ASSERT_LINE : CLEAR_LINE; // In that case, clear READY and thus trigger wait states - - if (TRACE_READY) if (nready==ASSERT_LINE) logerror("bwg: READY line = %d\n", (nready==CLEAR_LINE)? 1:0); - m_slot->set_ready((nready==CLEAR_LINE)? ASSERT_LINE : CLEAR_LINE); -} - -/* - Callback, called from the controller chip whenever DRQ/IRQ state change -*/ -WRITE_LINE_MEMBER( snug_bwg_legacy_device::intrq_w ) -{ - if (TRACE_SIGNALS) logerror("bwg: set intrq = %d\n", state); - m_IRQ = (line_state)state; - - // Note that INTB is actually not used in the TI-99 family. But the - // controller asserts the line nevertheless, probably intended for - // use in another planned TI system - m_slot->set_intb(state==ASSERT_LINE); - - // We need to explicitly set the READY line to release the datamux - set_ready_line(); -} - -WRITE_LINE_MEMBER( snug_bwg_legacy_device::drq_w ) -{ - if (TRACE_SIGNALS) logerror("bwg: set drq = %d\n", state); - m_DRQ = (line_state)state; - - // We need to explicitly set the READY line to release the datamux - set_ready_line(); -} - -SETADDRESS_DBIN_MEMBER( snug_bwg_legacy_device::setaddress_dbin ) -{ - // Selection login in the PAL and some circuits on the board - - // Is the card being selected? - m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); - - if (!m_inDsrArea) return; - - if (TRACE_ADDRESS) logerror("bwg: set address = %04x\n", offset & 0xffff); - - // Is the WD chip on the card being selected? - // We need the even and odd addresses for the wait state generation, - // but only the even addresses when we access it - m_WDsel0 = m_inDsrArea && !m_rtc_enabled - && ((state==ASSERT_LINE && ((m_address & 0x1ff8)==0x1ff0)) // read - || (state==CLEAR_LINE && ((m_address & 0x1ff8)==0x1ff8))); // write - - m_WDsel = m_WDsel0 && ((m_address & 1)==0); - - // Is the RTC selected on the card? (even addr) - m_RTCsel = m_inDsrArea && m_rtc_enabled && ((m_address & 0x1fe1)==0x1fe0); - - // RTC disabled: - // 5c00 - 5fef: RAM - // 5ff0 - 5fff: Controller (f0 = status, f2 = track, f4 = sector, f6 = data) - - // RTC enabled: - // 5c00 - 5fdf: RAM - // 5fe0 - 5fff: Clock (even addr) - - // Is RAM selected? We just check for the last 1K and let the RTC or WD - // just take control before - m_lastK = m_inDsrArea && ((m_address & 0x1c00)==0x1c00); - - // Is the data register port of the WD being selected? - // In fact, the address to read the data from is 5FF6, but the TI-99 datamux - // fetches both bytes from 5FF7 and 5FF6, the odd one first. The BwG uses - // the odd address to operate the READY line - m_dataregLB = m_WDsel0 && ((m_address & 0x07)==0x07); - - // Clear or assert the outgoing READY line - set_ready_line(); -} - -/* - Read a byte from ROM, RAM, FDC, or RTC. See setaddress_dbin for selection - logic. -*/ -READ8Z_MEMBER(snug_bwg_legacy_device::readz) -{ - if (m_inDsrArea && m_selected) - { - // 010x xxxx xxxx xxxx - if (m_lastK) - { - // ...1 11xx xxxx xxxx - if (m_rtc_enabled) - { - if (m_RTCsel) - { - // .... ..11 111x xxx0 - if (!space.debugger_access()) *value = m_clock->read(space, (m_address & 0x001e) >> 1); - if (TRACE_RW) logerror("bwg: read RTC: %04x -> %02x\n", m_address & 0xffff, *value); - } - else - { - *value = m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)]; - if (TRACE_RW) logerror("bwg: read ram: %04x (page %d)-> %02x\n", m_address & 0xffff, m_ram_page, *value); - } - } - else - { - if (m_WDsel) - { - // .... ..11 1111 0xx0 - // Note that the value is inverted again on the board, - // so we can drop the inversion - if (!space.debugger_access()) *value = m_wd1773->read(space, (m_address >> 1)&0x03); - if (TRACE_RW) logerror("bwg: read FDC: %04x -> %02x\n", m_address & 0xffff, *value); - if (TRACE_DATA) - { - if ((m_address & 0xffff)==0x5ff6) logerror("%02x ", *value); - else logerror("\n%04x: %02x", m_address&0xffff, *value); - } - } - else - { - *value = m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)]; - if (TRACE_RW) logerror("bwg: read ram: %04x (page %d)-> %02x\n", m_address & 0xffff, m_ram_page, *value); - } - } - } - else - { - *value = m_dsrrom[(m_rom_page<<13) | (m_address & 0x1fff)]; - if (TRACE_RW) logerror("bwg: read dsr: %04x (page %d)-> %02x\n", m_address & 0xffff, m_rom_page, *value); - } - } -} - -/* - Resets the drive geometry. This is required because the heuristic of - the default implementation sets the drive geometry to the geometry - of the medium. -*/ -void snug_bwg_legacy_device::set_geometry(legacy_floppy_image_device *drive, floppy_type_t type) -{ - // This assertion may fail when the names of the floppy devices change. - // Unfortunately, the wd17xx device assumes the floppy drives at root - // level, so we use an explicitly qualified tag. See peribox.h. - assert(drive != NULL); - drive->floppy_drive_set_geometry(type); -} - -void snug_bwg_legacy_device::set_all_geometries(floppy_type_t type) -{ - set_geometry(machine().device(PFLOPPY_0), type); - set_geometry(machine().device(PFLOPPY_1), type); - set_geometry(machine().device(PFLOPPY_2), type); -} - -/* - Write a byte - 4000 - 5bff: ROM, ignore write (4 banks) - - rtc disabled: - 5c00 - 5fef: RAM - 5ff0 - 5fff: Controller (f8 = command, fa = track, fc = sector, fe = data) - - rtc enabled: - 5c00 - 5fdf: RAM - 5fe0 - 5fff: Clock (even addr) -*/ -WRITE8_MEMBER(snug_bwg_legacy_device::write) -{ - if (m_inDsrArea && m_selected) - { - if (m_lastK) - { - if (m_rtc_enabled) - { - if (m_RTCsel) - { - // .... ..11 111x xxx0 - if (TRACE_RW) logerror("bwg: write RTC: %04x <- %02x\n", m_address & 0xffff, data); - if (!space.debugger_access()) m_clock->write(space, (m_address & 0x001e) >> 1, data); - } - else - { - if (TRACE_RW) logerror("bwg: write ram: %04x (page %d) <- %02x\n", m_address & 0xffff, m_ram_page, data); - m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data; - } - } - else - { - if (m_WDsel) - { - // .... ..11 1111 1xx0 - // Note that the value is inverted again on the board, - // so we can drop the inversion - if (TRACE_RW) logerror("bwg: write FDC: %04x <- %02x\n", m_address & 0xffff, data); - if (!space.debugger_access()) m_wd1773->write(space, (m_address >> 1)&0x03, data); - } - else - { - if (TRACE_RW) logerror("bwg: write ram: %04x (page %d) <- %02x\n", m_address & 0xffff, m_ram_page, data); - m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data; - } - } - } - } -} - -/* - CRU read handler. *=inverted. - bit 0: DSK4 connected* - bit 1: DSK1 connected* - bit 2: DSK2 connected* - bit 3: DSK3 connected* - bit 4: Dip 1 - bit 5: Dip 2 - bit 6: Dip 3 - bit 7: Dip 4 -*/ -READ8Z_MEMBER(snug_bwg_legacy_device::crureadz) -{ - UINT8 reply = 0; - - if ((offset & 0xff00)==m_cru_base) - { - if ((offset & 0x00ff)==0) - { - // Assume that we have 4 drives connected - // If we want to do that properly, we need to check the actually - // available drives (not the images!). But why should we connect less? - reply = 0x00; - - // DIP switches. Note that a closed switch means 0 - // xx01 1111 11 = only dsk1; 10 = 1+2, 01=1/2/3, 00=1-4 - - if (m_dip1 != 0) reply |= 0x10; - if (m_dip2 != 0) reply |= 0x20; - reply |= (m_dip34 << 6); - *value = ~reply; - } - else - *value = 0; - if (TRACE_CRU) logerror("bwg: Read CRU = %02x\n", *value); - } -} - -WRITE8_MEMBER(snug_bwg_legacy_device::cruwrite) -{ - int drive, drivebit; - - if ((offset & 0xff00)==m_cru_base) - { - int bit = (offset >> 1) & 0x0f; - switch (bit) - { - case 0: - /* (De)select the card. Indicated by a LED on the board. */ - m_selected = (data != 0); - if (TRACE_CRU) logerror("bwg: Map DSR (bit 0) = %d\n", m_selected); - break; - - case 1: - /* Activate motor */ - if (data && !m_strobe_motor) - { /* on rising edge, set motor_running for 4.23s */ - if (TRACE_CRU) logerror("bwg: trigger motor (bit 1)\n"); - m_DVENA = ASSERT_LINE; - m_motor_on_timer->adjust(attotime::from_msec(4230)); - } - m_strobe_motor = (data != 0); - break; - - case 2: - /* Set disk ready/hold (bit 2) */ - // 0: ignore IRQ and DRQ - // 1: TMS9900 is stopped until IRQ or DRQ are set - // OR the motor stops rotating - rotates for 4.23s after write - // to CRU bit 1 - if (TRACE_CRU) logerror("bwg: arm wait state logic (bit 2) = %d\n", data); - m_WAITena = (data != 0); - break; - - case 4: - case 5: - case 6: - case 8: - /* Select drive 0-2 (DSK1-DSK3) (bits 4-6) */ - /* Select drive 3 (DSK4) (bit 8) */ - drive = (bit == 8) ? 3 : (bit - 4); /* drive # (0-3) */ - if (TRACE_CRU) logerror("bwg: set drive (bit %d) = %d\n", bit, data); - drivebit = 1<set_drive(drive); - } - } - else - m_DSEL &= ~drivebit; - break; - - case 7: - /* Select side of disk (bit 7) */ - m_SIDE = data; - if (TRACE_CRU) logerror("bwg: set side (bit 7) = %d\n", data); - m_wd1773->set_side(m_SIDE); - break; - - case 10: - /* double density enable (active low) */ - if (TRACE_CRU) logerror("bwg: set double density (bit 10) = %d\n", data); - m_wd1773->dden_w((data != 0) ? ASSERT_LINE : CLEAR_LINE); - break; - - case 11: - /* EPROM A13 */ - if (data != 0) - m_rom_page |= 1; - else - m_rom_page &= 0xfe; // 11111110 - if (TRACE_CRU) logerror("bwg: set ROM page (bit 11) = %d, page = %d\n", bit, m_rom_page); - break; - - case 13: - /* RAM A10 */ - m_ram_page = data; - if (TRACE_CRU) logerror("bwg: set RAM page (bit 13) = %d, page = %d\n", bit, m_ram_page); - break; - - case 14: - /* Override FDC with RTC (active high) */ - if (TRACE_CRU) logerror("bwg: turn on RTC (bit 14) = %d\n", data); - m_rtc_enabled = (data != 0); - break; - - case 15: - /* EPROM A14 */ - if (data != 0) - m_rom_page |= 2; - else - m_rom_page &= 0xfd; // 11111101 - if (TRACE_CRU) logerror("bwg: set ROM page (bit 15) = %d, page = %d\n", bit, m_rom_page); - break; - - case 3: - if (TRACE_CRU) logerror("bwg: set head load (bit 3) = %d\n", data); - break; - case 9: - case 12: - /* Unused (bit 3, 9 & 12) */ - if (TRACE_CRU) logerror("bwg: set unknown bit %d = %d\n", bit, data); - break; - } - } -} - -void snug_bwg_legacy_device::device_start(void) -{ - logerror("bwg: BWG start\n"); - m_dsrrom = memregion(DSRROM)->base(); - m_buffer_ram = memregion(BUFFER)->base(); - m_motor_on_timer = timer_alloc(MOTOR_TIMER); - m_cru_base = 0x1100; -} - -void snug_bwg_legacy_device::device_reset() -{ - logerror("bwg: BWG reset\n"); - - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } - - m_strobe_motor = false; - m_DVENA = CLEAR_LINE; - m_DSEL = 0; - m_SIDE = 0; - ti99_set_80_track_drives(FALSE); - floppy_type_t type = FLOPPY_STANDARD_5_25_DSDD_40; - set_all_geometries(type); - m_DRQ = CLEAR_LINE; - m_IRQ = CLEAR_LINE; - m_WAITena = false; - m_rtc_enabled = false; - m_selected = false; - m_dataregLB = false; - m_inDsrArea = false; - - m_dip1 = ioport("BWGDIP1")->read(); - m_dip2 = ioport("BWGDIP2")->read(); - m_dip34 = ioport("BWGDIP34")->read(); - - m_rom_page = 0; - m_ram_page = 0; -} - -INPUT_PORTS_START( bwg_fdc_legacy ) - PORT_START( "BWGDIP1" ) - PORT_DIPNAME( 0x01, 0x00, "BwG step rate" ) - PORT_DIPSETTING( 0x00, "6 ms") - PORT_DIPSETTING( 0x01, "20 ms") - - PORT_START( "BWGDIP2" ) - PORT_DIPNAME( 0x01, 0x00, "BwG date/time display" ) - PORT_DIPSETTING( 0x00, "Hide") - PORT_DIPSETTING( 0x01, "Show") - - PORT_START( "BWGDIP34" ) - PORT_DIPNAME( 0x03, 0x03, "BwG drives" ) - PORT_DIPSETTING( 0x00, "DSK1 only") - PORT_DIPSETTING( 0x01, "DSK1-DSK2") - PORT_DIPSETTING( 0x02, "DSK1-DSK3") - PORT_DIPSETTING( 0x03, "DSK1-DSK4") -INPUT_PORTS_END - -MACHINE_CONFIG_FRAGMENT( bwg_fdc_legacy ) - MCFG_DEVICE_ADD(FDCLEG_TAG, WD1773, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(snug_bwg_legacy_device, intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(snug_bwg_legacy_device, drq_w)) - - MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0) - MCFG_MM58274C_MODE24(1) // 24 hour - MCFG_MM58274C_DAY1(0) // sunday -MACHINE_CONFIG_END - -ROM_START( bwg_fdc_legacy ) - ROM_REGION(0x8000, DSRROM, 0) - ROM_LOAD("bwg.bin", 0x0000, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */ - ROM_REGION(0x0800, BUFFER, 0) /* BwG RAM buffer */ - ROM_FILL(0x0000, 0x0400, 0x00) -ROM_END - -machine_config_constructor snug_bwg_legacy_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( bwg_fdc_legacy ); -} - -const rom_entry *snug_bwg_legacy_device::device_rom_region() const -{ - return ROM_NAME( bwg_fdc_legacy ); -} - -ioport_constructor snug_bwg_legacy_device::device_input_ports() const -{ - return INPUT_PORTS_NAME( bwg_fdc_legacy ); -} - -const device_type TI99_BWG_LEG = &device_creator; diff --git a/src/emu/bus/ti99_peb/bwg.h b/src/emu/bus/ti99_peb/bwg.h index 28e2f2f6dc6..a1012e06257 100644 --- a/src/emu/bus/ti99_peb/bwg.h +++ b/src/emu/bus/ti99_peb/bwg.h @@ -20,9 +20,6 @@ extern const device_type TI99_BWG; -/* - Implementation for modern floppy system. -*/ class snug_bwg_device : public ti_expansion_card_device { public: @@ -142,109 +139,4 @@ private: // Debugging bool m_debug_dataout; }; - -// ========================================================================= - -/* - Legacy implementation. -*/ - -#include "machine/wd17xx.h" - -extern const device_type TI99_BWG_LEG; - -class snug_bwg_legacy_device : public ti_expansion_card_device -{ -public: - snug_bwg_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - DECLARE_READ8Z_MEMBER(readz); - DECLARE_WRITE8_MEMBER(write); - DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin); - - DECLARE_WRITE_LINE_MEMBER( intrq_w ); - DECLARE_WRITE_LINE_MEMBER( drq_w ); - - DECLARE_READ8Z_MEMBER(crureadz); - DECLARE_WRITE8_MEMBER(cruwrite); - -protected: - virtual void device_start(void); - virtual void device_reset(void); - virtual const rom_entry *device_rom_region() const; - virtual machine_config_constructor device_mconfig_additions() const; - virtual ioport_constructor device_input_ports() const; - -private: - void set_ready_line(); - void set_all_geometries(floppy_type_t type); - void set_geometry(legacy_floppy_image_device *drive, floppy_type_t type); - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - - // Holds the status of the DRQ and IRQ lines. - line_state m_DRQ, m_IRQ; - - // DIP switch state - int m_dip1, m_dip2, m_dip34; - - // Page selection for ROM and RAM - int m_ram_page; // 0-1 - int m_rom_page; // 0-3 - - // When true, the READY line will be cleared (create wait states) when - // waiting for data from the controller. - bool m_WAITena; - - // Address in card area - bool m_inDsrArea; - - // WD selected - bool m_WDsel, m_WDsel0; - - // RTC selected - bool m_RTCsel; - - // last 1K area selected - bool m_lastK; - - // Data register +1 selected - bool m_dataregLB; - - /* Indicates whether the clock is mapped into the address space. */ - bool m_rtc_enabled; - - /* When TRUE, keeps DVENA high. */ - bool m_strobe_motor; - - // Signal DVENA. When TRUE, makes some drive turning. - line_state m_DVENA; - - // Recent address - int m_address; - - /* Indicates which drive has been selected. Values are 0, 1, 2, and 4. */ - // 000 = no drive - // 001 = drive 1 - // 010 = drive 2 - // 100 = drive 3 - int m_DSEL; - - /* Signal SIDSEL. 0 or 1, indicates the selected head. */ - int m_SIDE; - - // Link to the WD1773 controller on the board. - required_device m_wd1773; - - // Link to the real-time clock on the board. - required_device m_clock; - - // count 4.23s from rising edge of motor_on - emu_timer* m_motor_on_timer; - - // DSR ROM - UINT8* m_dsrrom; - - // Buffer RAM - UINT8* m_buffer_ram; -}; - #endif diff --git a/src/emu/bus/ti99_peb/peribox.c b/src/emu/bus/ti99_peb/peribox.c index 800acc9121f..c55fe82152c 100644 --- a/src/emu/bus/ti99_peb/peribox.c +++ b/src/emu/bus/ti99_peb/peribox.c @@ -431,16 +431,13 @@ SLOT_INTERFACE_END SLOT_INTERFACE_START( peribox_slot7 ) SLOT_INTERFACE("ide", TI99_IDE) SLOT_INTERFACE("usbsm", TI99_USBSM) - SLOT_INTERFACE("bwgleg", TI99_BWG_LEG) SLOT_INTERFACE("bwg", TI99_BWG) SLOT_INTERFACE("hfdc", TI99_HFDC_LEG) SLOT_INTERFACE("hfdcnew", TI99_HFDC) SLOT_INTERFACE_END SLOT_INTERFACE_START( peribox_slot8 ) - SLOT_INTERFACE("tifdcleg", TI99_FDC_LEG) SLOT_INTERFACE("tifdc", TI99_FDC) - SLOT_INTERFACE("bwgleg", TI99_BWG_LEG) SLOT_INTERFACE("bwg", TI99_BWG) SLOT_INTERFACE("hfdc", TI99_HFDC_LEG) SLOT_INTERFACE("hfdcnew", TI99_HFDC) @@ -497,7 +494,6 @@ SLOT_INTERFACE_START( peribox_slot7nobwg ) SLOT_INTERFACE_END SLOT_INTERFACE_START( peribox_slot8nobwg ) - SLOT_INTERFACE("tifdcleg", TI99_FDC_LEG) SLOT_INTERFACE("tifdc", TI99_FDC) SLOT_INTERFACE("hfdc", TI99_HFDC_LEG) SLOT_INTERFACE("hfdcnew", TI99_HFDC) diff --git a/src/emu/bus/ti99_peb/ti_fdc.c b/src/emu/bus/ti99_peb/ti_fdc.c index 44062149051..fe9d6133108 100644 --- a/src/emu/bus/ti99_peb/ti_fdc.c +++ b/src/emu/bus/ti99_peb/ti_fdc.c @@ -427,313 +427,3 @@ const rom_entry *ti_fdc_device::device_rom_region() const } const device_type TI99_FDC = &device_creator; -//=========================================================================== - -/*********************************************** - - Legacy implementation, to be removed - -***********************************************/ - -#define TI_FDCLEG_TAG "ti_dssd_controller_legacy" -#define FDCLEG_TAG "wd1771" - -ti_fdc_legacy_device::ti_fdc_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_expansion_card_device(mconfig, TI99_FDC_LEG, "TI-99 Standard DSSD Floppy Controller LEGACY", tag, owner, clock, "ti99_fdc_leg", __FILE__), - m_fd1771(*this, FDCLEG_TAG) { } - -/* - callback called at the end of DVENA pulse -*/ -void ti_fdc_legacy_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - m_DVENA = CLEAR_LINE; - if (TRACE_MOTOR) logerror("tifdc: Motor off\n"); - set_ready_line(); -} - -/* - Operate the wait state logic. -*/ -void ti_fdc_legacy_device::set_ready_line() -{ - // This is the wait state logic - if (TRACE_SIGNALS) logerror("tifdc: address=%04x, DRQ=%d, INTRQ=%d, MOTOR=%d\n", m_address & 0xffff, m_DRQ, m_IRQ, m_DVENA); - line_state nready = (m_WDsel && // Are we accessing 5ffx (even addr)? - m_WAITena && // and the wait state generation is active (SBO 2) - (m_DRQ==CLEAR_LINE) && // and we are waiting for a byte - (m_IRQ==CLEAR_LINE) && // and there is no interrupt yet - (m_DVENA==ASSERT_LINE) // and the motor is turning? - )? ASSERT_LINE : CLEAR_LINE; // In that case, clear READY and thus trigger wait states - - if (TRACE_READY) logerror("tifdc: READY line = %d\n", (nready==CLEAR_LINE)? 1:0); - m_slot->set_ready((nready==CLEAR_LINE)? ASSERT_LINE : CLEAR_LINE); -} - -SETADDRESS_DBIN_MEMBER( ti_fdc_legacy_device::setaddress_dbin ) -{ - // Selection login in the PAL and some circuits on the board - - // Is the card being selected? - m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); - - if (!m_inDsrArea) return; - - if (TRACE_ADDRESS) logerror("tifdc: set address = %04x\n", offset & 0xffff); - - // Is the WD chip on the card being selected? - m_WDsel = m_inDsrArea && ((m_address & 0x1ff1)==0x1ff0); - - // Clear or assert the outgoing READY line - set_ready_line(); -} - -READ8Z_MEMBER(ti_fdc_legacy_device::readz) -{ - if (m_inDsrArea && m_selected) - { - // only use the even addresses from 1ff0 to 1ff6. - // Note that data is inverted. - // 0101 1111 1111 0xx0 - UINT8 reply = 0; - - if (m_WDsel && ((m_address & 9)==0)) - { - if (!space.debugger_access()) reply = m_fd1771->read(space, (offset >> 1)&0x03); - if (TRACE_DATA) - { - if ((m_address & 0xffff)==0x5ff6) logerror("%02x ", ~reply & 0xff); - else logerror("\n%04x: %02x", m_address&0xffff, ~reply & 0xff); - } - } - else - { - reply = m_dsrrom[m_address & 0x1fff]; - } - *value = reply; - if (TRACE_RW) logerror("ti_fdc: %04x -> %02x\n", offset & 0xffff, *value); - } -} - -WRITE8_MEMBER(ti_fdc_legacy_device::write) -{ - if (m_inDsrArea && m_selected) - { - if (TRACE_RW) logerror("ti_fdc: %04x <- %02x\n", offset & 0xffff, ~data & 0xff); - // only use the even addresses from 1ff8 to 1ffe. - // Note that data is inverted. - // 0101 1111 1111 1xx0 - if (m_WDsel && ((m_address & 9)==8)) - { - if (!space.debugger_access()) m_fd1771->write(space, (offset >> 1)&0x03, data); - } - } -} - -/* - The CRU read handler. - bit 0: HLD pin - bit 1-3: drive n active - bit 4: 0: motor strobe on - bit 5: always 0 - bit 6: always 1 - bit 7: selected side -*/ -READ8Z_MEMBER(ti_fdc_legacy_device::crureadz) -{ - if ((offset & 0xff00)==m_cru_base) - { - int addr = offset & 0x07; - UINT8 reply = 0; - if (addr == 0) - { - // deliver bits 0-7 - // TODO: HLD pin - // The DVENA state is returned inverted - if (m_DVENA==ASSERT_LINE) reply |= ((m_DSEL)<<1); - else reply |= 0x10; - reply |= 0x40; - if (m_SIDSEL) reply |= 0x80; - } - *value = reply; - if (TRACE_CRU) logerror("tifdc: Read CRU = %02x\n", *value); - } -} - -WRITE8_MEMBER(ti_fdc_legacy_device::cruwrite) -{ - int drive, drivebit; - - if ((offset & 0xff00)==m_cru_base) - { - int bit = (offset >> 1) & 0x07; - switch (bit) - { - case 0: - /* (De)select the card. Indicated by a LED on the board. */ - m_selected = (data!=0); - if (TRACE_CRU) logerror("tifdc: Map DSR (bit 0) = %d\n", m_selected); - break; - case 1: - /* Activate motor */ - if (data==1 && m_lastval==0) - { /* on rising edge, set motor_running for 4.23s */ - if (TRACE_CRU) logerror("tifdc: trigger motor (bit 1)\n"); - m_DVENA = ASSERT_LINE; - if (TRACE_MOTOR) logerror("tifdc: motor on\n"); - set_ready_line(); - m_motor_on_timer->adjust(attotime::from_msec(4230)); - } - m_lastval = data; - break; - - case 2: - /* Set disk ready/hold (bit 2) */ - // 0: ignore IRQ and DRQ - // 1: TMS9900 is stopped until IRQ or DRQ are set - // OR the motor stops rotating - rotates for 4.23s after write - // to CRU bit 1 - m_WAITena = (data != 0); - if (TRACE_CRU) logerror("tifdc: arm wait state logic (bit 2) = %d\n", data); - break; - - case 3: - /* Load disk heads (HLT pin) (bit 3). Not implemented. */ - if (TRACE_CRU) logerror("tifdc: set head load (bit 3) = %d\n", data); - break; - - case 4: - case 5: - case 6: - /* Select drive X (bits 4-6) */ - drive = bit-4; /* drive # (0-2) */ - if (TRACE_CRU) logerror("tifdc: set drive (bit %d) = %d\n", bit, data); - drivebit = 1<set_drive(drive); - } - } - else - m_DSEL &= ~drivebit; - break; - - case 7: - /* Select side of disk (bit 7) */ - m_SIDSEL = data; - if (TRACE_CRU) logerror("tifdc: set side (bit 7) = %d\n", data); - m_fd1771->set_side(data); - break; - } - } -} - -/* - Resets the drive geometry. This is required because the heuristic of - the default implementation sets the drive geometry to the geometry - of the medium. -*/ -void ti_fdc_legacy_device::set_geometry(legacy_floppy_image_device *drive, floppy_type_t type) -{ - // This assertion may fail when the names of the floppy devices change. - // Unfortunately, the wd17xx device assumes the floppy drives at root - // level, so we use an explicitly qualified tag. See peribox.h. - assert (drive!=NULL); - drive->floppy_drive_set_geometry(type); -} - -void ti_fdc_legacy_device::set_all_geometries(floppy_type_t type) -{ - set_geometry(machine().device(PFLOPPY_0), type); - set_geometry(machine().device(PFLOPPY_1), type); - set_geometry(machine().device(PFLOPPY_2), type); -} - -/* - Callback, called from the controller chip whenever DRQ/IRQ state change -*/ -WRITE_LINE_MEMBER( ti_fdc_legacy_device::intrq_w ) -{ - if (TRACE_SIGNALS) logerror("ti_fdc: set irq = %d\n", state); - m_IRQ = (line_state)state; - // Note that INTB is actually not used in the TI-99 family. But the - // controller asserts the line nevertheless, probably intended for - // use in another planned TI system - m_slot->set_intb(state); - set_ready_line(); -} - -WRITE_LINE_MEMBER( ti_fdc_legacy_device::drq_w ) -{ - if (TRACE_SIGNALS) logerror("ti_fdc: set drq = %d\n", state); - m_DRQ = (line_state)state; - set_ready_line(); -} - -void ti_fdc_legacy_device::device_start(void) -{ - logerror("ti_fdc: TI FDC (legacy) start\n"); - m_dsrrom = memregion(DSRROM)->base(); - m_motor_on_timer = timer_alloc(MOTOR_TIMER); - m_cru_base = 0x1100; -} - -void ti_fdc_legacy_device::device_reset(void) -{ - logerror("ti_fdc: TI FDC (legacy) reset\n"); - m_DSEL = 0; - m_SIDSEL = 0; - m_DVENA = CLEAR_LINE; - m_lastval = 0; - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } - m_DRQ = CLEAR_LINE; - m_IRQ = CLEAR_LINE; - m_WAITena = false; - m_selected = false; - m_inDsrArea = false; - m_WDsel = false; - - ti99_set_80_track_drives(FALSE); - floppy_type_t type = FLOPPY_STANDARD_5_25_DSDD_40; - set_all_geometries(type); -} - -MACHINE_CONFIG_FRAGMENT( ti_fdc_legacy ) - MCFG_DEVICE_ADD(FDCLEG_TAG, FD1771, 0) - MCFG_WD17XX_DRIVE_TAGS(PFLOPPY_0, PFLOPPY_1, PFLOPPY_2, NULL) - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(ti_fdc_legacy_device, intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(ti_fdc_legacy_device, drq_w)) -MACHINE_CONFIG_END - -ROM_START( ti_fdc_legacy ) - ROM_REGION(0x2000, DSRROM, 0) - ROM_LOAD("disk.bin", 0x0000, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */ -ROM_END - -machine_config_constructor ti_fdc_legacy_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( ti_fdc_legacy ); -} - -const rom_entry *ti_fdc_legacy_device::device_rom_region() const -{ - return ROM_NAME( ti_fdc_legacy ); -} - -const device_type TI99_FDC_LEG = &device_creator; diff --git a/src/emu/bus/ti99_peb/ti_fdc.h b/src/emu/bus/ti99_peb/ti_fdc.h index 10a2f1cf737..9fedb1c2590 100644 --- a/src/emu/bus/ti99_peb/ti_fdc.h +++ b/src/emu/bus/ti99_peb/ti_fdc.h @@ -108,85 +108,4 @@ private: // Debugging bool m_debug_dataout; }; - -//=========================================================================== - -/*********************************************** - - Legacy implementation - -***********************************************/ - -#include "machine/wd17xx.h" -#include "imagedev/flopdrv.h" - -extern const device_type TI99_FDC_LEG; - -class ti_fdc_legacy_device : public ti_expansion_card_device -{ -public: - ti_fdc_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - DECLARE_READ8Z_MEMBER(readz); - DECLARE_WRITE8_MEMBER(write); - DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin); - - DECLARE_WRITE_LINE_MEMBER( intrq_w ); - DECLARE_WRITE_LINE_MEMBER( drq_w ); - - DECLARE_READ8Z_MEMBER(crureadz); - DECLARE_WRITE8_MEMBER(cruwrite); - -protected: - virtual void device_start(void); - virtual void device_reset(void); - virtual const rom_entry *device_rom_region() const; - virtual machine_config_constructor device_mconfig_additions() const; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - -private: - void set_ready_line(); - void set_all_geometries(floppy_type_t type); - void set_geometry(legacy_floppy_image_device *drive, floppy_type_t type); - - // Recent address - int m_address; - - // Holds the status of the DRQ and IRQ lines. - line_state m_DRQ, m_IRQ; - - // Needed for triggering the motor monoflop - UINT8 m_lastval; - - // Signal DVENA. When TRUE, makes some drive turning. - line_state m_DVENA; - - // When TRUE the CPU is halted while DRQ/IRQ are true. - bool m_WAITena; - - // WD chip selected - bool m_WDsel; - - // Set when address is in card area - bool m_inDsrArea; - - // Indicates which drive has been selected. Values are 0, 1, 2, and 4. - // 000 = no drive - // 001 = drive 1 - // 010 = drive 2 - // 100 = drive 3 - int m_DSEL; - - // Signal SIDSEL. 0 or 1, indicates the selected head. - int m_SIDSEL; - - // count 4.23s from rising edge of motor_on - emu_timer* m_motor_on_timer; - - // Link to the FDC1771 controller on the board. - required_device m_fd1771; - - // DSR ROM - UINT8* m_dsrrom; -}; - #endif diff --git a/src/emu/machine/hdc9234.c b/src/emu/machine/hdc9234.c index c77783e463c..a89c6e93184 100644 --- a/src/emu/machine/hdc9234.c +++ b/src/emu/machine/hdc9234.c @@ -24,37 +24,37 @@ #include "hdc9234.h" // Per-command debugging -#define TRACE_SELECT 1 -#define TRACE_STEP 1 -#define TRACE_RESTORE 1 -#define TRACE_SUBSTATES 1 -#define TRACE_READ 1 -#define TRACE_WRITE 1 -#define TRACE_READREG 1 -#define TRACE_SETREG 1 -#define TRACE_SETPTR 1 -#define TRACE_FORMAT 1 -#define TRACE_READTRACK 1 +#define TRACE_SELECT 0 +#define TRACE_STEP 0 +#define TRACE_RESTORE 0 +#define TRACE_SUBSTATES 0 +#define TRACE_READ 0 +#define TRACE_WRITE 0 +#define TRACE_READREG 0 +#define TRACE_SETREG 0 +#define TRACE_SETPTR 0 +#define TRACE_FORMAT 0 +#define TRACE_READTRACK 0 // Common states -#define TRACE_READID 1 -#define TRACE_VERIFY 1 -#define TRACE_TRANSFER 1 +#define TRACE_READID 0 +#define TRACE_VERIFY 0 +#define TRACE_TRANSFER 0 // Live states debugging -#define TRACE_LIVE 1 -#define TRACE_SHIFT 1 -#define TRACE_SYNC 1 +#define TRACE_LIVE 0 +#define TRACE_SHIFT 0 +#define TRACE_SYNC 0 // Misc debugging #define TRACE_DELAY 0 -#define TRACE_INT 1 -#define TRACE_LINES 1 -#define TRACE_INDEX 1 -#define TRACE_DMA 1 -#define TRACE_DONE 1 -#define TRACE_FAIL 1 -#define TRACE_AUXBUS 1 +#define TRACE_INT 0 +#define TRACE_LINES 0 +#define TRACE_INDEX 0 +#define TRACE_DMA 0 +#define TRACE_DONE 0 +#define TRACE_FAIL 0 +#define TRACE_AUXBUS 0 #define TRACE_DETAIL 0 diff --git a/src/mess/drivers/ti990_4.c b/src/mess/drivers/ti990_4.c index 156bcdfce06..382d345e4d7 100644 --- a/src/mess/drivers/ti990_4.c +++ b/src/mess/drivers/ti990_4.c @@ -44,7 +44,6 @@ TODO: #include "sound/beep.h" #include "video/733_asr.h" -#include "imagedev/flopdrv.h" #include "machine/ti99/990_dk.h" @@ -262,12 +261,12 @@ static ADDRESS_MAP_START(cru_map_v, AS_IO, 8, ti990_4_state ) ADDRESS_MAP_END -static const floppy_interface ti990_4_floppy_interface = +/* static const floppy_interface ti990_4_floppy_interface = { - FLOPPY_STANDARD_8_DSSD, - LEGACY_FLOPPY_OPTIONS_NAME(fd800), - NULL -}; + FLOPPY_STANDARD_8_DSSD, + LEGACY_FLOPPY_OPTIONS_NAME(fd800), + NULL +}; */ MACHINE_RESET_MEMBER(ti990_4_state,ti990_4) { @@ -300,7 +299,7 @@ static MACHINE_CONFIG_START( ti990_4, ti990_4_state ) MCFG_DEVICE_ADD("fd800", FD800, 0) MCFG_FD800_INT_HANDLER(WRITELINE(ti990_4_state, fd_interrupt)) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface) +// MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface) MACHINE_CONFIG_END static MACHINE_CONFIG_START( ti990_4v, ti990_4_state ) @@ -320,7 +319,7 @@ static MACHINE_CONFIG_START( ti990_4v, ti990_4_state ) MCFG_DEVICE_ADD("fd800", FD800, 0) MCFG_FD800_INT_HANDLER(WRITELINE(ti990_4_state, fd_interrupt)) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface) +// MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface) MACHINE_CONFIG_END /* diff --git a/src/mess/machine/ti99/990_dk.c b/src/mess/machine/ti99/990_dk.c index 31732b1a35d..ccdddbad62d 100644 --- a/src/mess/machine/ti99/990_dk.c +++ b/src/mess/machine/ti99/990_dk.c @@ -17,7 +17,6 @@ #include "emu.h" -#include "formats/basicdsk.h" #include "990_dk.h" /* status bits */ @@ -104,22 +103,22 @@ void fd800_machine_init(void (*interrupt_callback)(running_machine &machine, int */ int fd800_legacy_device::read_id(int unit, int head, int *cylinder_id, int *sector_id) { - /*UINT8 revolution_count;*/ - chrn_id id; + //UINT8 revolution_count;*/ + // chrn_id id; - /*revolution_count = 0;*/ + //revolution_count = 0;*/ /*while (revolution_count < 2)*/ /*{*/ - if (m_drv[unit].img->floppy_drive_get_next_id(head, &id)) - { - if (cylinder_id) - *cylinder_id = id.C; - if (sector_id) - *sector_id = id.R; - return TRUE; - } - /*}*/ + /* if (m_drv[unit].img->floppy_drive_get_next_id(head, &id)) + { + if (cylinder_id) + *cylinder_id = id.C; + if (sector_id) + *sector_id = id.R; + return TRUE; + } + }*/ return FALSE; } @@ -136,26 +135,26 @@ int fd800_legacy_device::read_id(int unit, int head, int *cylinder_id, int *sect */ int fd800_legacy_device::find_sector(int unit, int head, int sector, int *data_id) { - UINT8 revolution_count; - chrn_id id; +/* UINT8 revolution_count; + chrn_id id; - revolution_count = 0; - - while (revolution_count < 2) - { - if (m_drv[unit].img->floppy_drive_get_next_id(head, &id)) - { - /* compare id */ - if ((id.R == sector) && (id.N == 0)) - { - *data_id = id.data_id; - /* get ddam status */ - /*w->ddam = id.flags & ID_FLAG_DELETED_DATA;*/ - return TRUE; - } - } - } + revolution_count = 0; + while (revolution_count < 2) + { + if (m_drv[unit].img->floppy_drive_get_next_id(head, &id)) + { + // compare id + if ((id.R == sector) && (id.N == 0)) + { + *data_id = id.data_id; + // get ddam status + // w->ddam = id.flags & ID_FLAG_DELETED_DATA; + return TRUE; + } + } + } +*/ return FALSE; } @@ -170,56 +169,57 @@ int fd800_legacy_device::find_sector(int unit, int head, int sector, int *data_i */ int fd800_legacy_device::do_seek(int unit, int cylinder, int head) { - int retries; +/* int retries; - if (cylinder > 76) - { - m_stat_reg |= status_invalid_cmd; - return TRUE; - } + if (cylinder > 76) + { + m_stat_reg |= status_invalid_cmd; + return TRUE; + } - if (m_drv[unit].img == NULL || !m_drv[unit].img->exists()) - { - m_stat_reg |= status_drv_not_ready; /* right??? */ - return TRUE; - } + if (m_drv[unit].img == NULL || !m_drv[unit].img->exists()) + { + m_stat_reg |= status_drv_not_ready; + return TRUE; + } - if (m_drv[unit].log_cylinder[head] == -1) - { /* current track ID is unknown: read it */ - if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL)) - { - m_stat_reg |= status_ID_not_found; - return TRUE; - } - } - /* exit if we are already at the requested track */ - if (m_drv[unit].log_cylinder[head] == cylinder) - { - /*m_stat_reg |= status_OP_complete;*/ - return FALSE; - } - for (retries=0; retries<10; retries++) - { /* seek to requested track */ - m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].log_cylinder[head]); - /* update physical track position */ - if (m_drv[unit].phys_cylinder != -1) - m_drv[unit].phys_cylinder += cylinder-m_drv[unit].log_cylinder[head]; - /* read new track ID */ - if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL)) - { - m_drv[unit].log_cylinder[head] = -1; - m_stat_reg |= status_ID_not_found; - return TRUE; - } - /* exit if we have reached the requested track */ - if (m_drv[unit].log_cylinder[head] == cylinder) - { - /*m_stat_reg |= status_OP_complete;*/ - return FALSE; - } - } - /* track not found */ - m_stat_reg |= status_seek_err; + if (m_drv[unit].log_cylinder[head] == -1) + { + if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL)) + { + m_stat_reg |= status_ID_not_found; + return TRUE; + } + } + + if (m_drv[unit].log_cylinder[head] == cylinder) + { + + return FALSE; + } + for (retries=0; retries<10; retries++) + { + m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].log_cylinder[head]); + + if (m_drv[unit].phys_cylinder != -1) + m_drv[unit].phys_cylinder += cylinder-m_drv[unit].log_cylinder[head]; + + if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL)) + { + m_drv[unit].log_cylinder[head] = -1; + m_stat_reg |= status_ID_not_found; + return TRUE; + } + + if (m_drv[unit].log_cylinder[head] == cylinder) + { + + return FALSE; + } + } + + m_stat_reg |= status_seek_err; + */ return TRUE; } @@ -232,32 +232,32 @@ int fd800_legacy_device::do_seek(int unit, int cylinder, int head) */ int fd800_legacy_device::do_restore(int unit) { - int seek_count = 0; - int seek_complete; + int seek_complete = 0; +/* int seek_count = 0; - if (!m_drv[unit].img->exists()) - { - m_stat_reg |= status_drv_not_ready; /* right??? */ - return TRUE; - } + if (!m_drv[unit].img->exists()) + { + m_stat_reg |= status_drv_not_ready; + return TRUE; + } - /* limit iterations to 76 to prevent an endless loop if the disc is locked */ - while (!(seek_complete = !m_drv[unit].img->floppy_tk00_r()) && (seek_count < 76)) - { - m_drv[unit].img->floppy_drive_seek(-1); - seek_count++; - } - if (! seek_complete) - { - m_drv[unit].phys_cylinder = -1; - m_stat_reg |= status_seek_err; - } - else - { - m_drv[unit].phys_cylinder = 0; - /*m_stat_reg |= status_OP_complete;*/ - } + while (!(seek_complete = !m_drv[unit].img->floppy_tk00_r()) && (seek_count < 76)) + { + m_drv[unit].img->floppy_drive_seek(-1); + seek_count++; + } + if (! seek_complete) + { + m_drv[unit].phys_cylinder = -1; + m_stat_reg |= status_seek_err; + } + else + { + m_drv[unit].phys_cylinder = 0; + + } +*/ return ! seek_complete; } @@ -266,27 +266,28 @@ int fd800_legacy_device::do_restore(int unit) */ void fd800_legacy_device::do_read(void) { - int data_id; +/* int data_id; - if ((m_sector == 0) || (m_sector > 26)) - { - m_stat_reg |= status_invalid_cmd; - return; - } + if ((m_sector == 0) || (m_sector > 26)) + { + m_stat_reg |= status_invalid_cmd; + return; + } - if (!find_sector(m_unit, m_head, m_sector, &data_id)) - { - m_stat_reg |= status_ID_not_found; - return; - } + if (!find_sector(m_unit, m_head, m_sector, &data_id)) + { + m_stat_reg |= status_ID_not_found; + return; + } - m_drv[m_unit].img->floppy_drive_read_sector_data(m_head, data_id, m_buf, 128); - m_buf_pos = 0; - m_buf_mode = bm_read; - m_recv_buf = (m_buf[m_buf_pos<<1] << 8) | m_buf[(m_buf_pos<<1)+1]; + m_drv[m_unit].img->floppy_drive_read_sector_data(m_head, data_id, m_buf, 128); + m_buf_pos = 0; + m_buf_mode = bm_read; + m_recv_buf = (m_buf[m_buf_pos<<1] << 8) | m_buf[(m_buf_pos<<1)+1]; - m_stat_reg |= status_XFER_ready; - m_stat_reg |= status_OP_complete; /* right??? */ + m_stat_reg |= status_XFER_ready; + m_stat_reg |= status_OP_complete; +*/ } /* @@ -294,24 +295,24 @@ void fd800_legacy_device::do_read(void) */ void fd800_legacy_device::do_write(void) { - int data_id; +/* int data_id; - if (m_drv[m_unit].seclen < 64) - /* fill with 0s */ - memset(m_buf+(m_drv[m_unit].seclen<<1), 0, (64-m_drv[m_unit].seclen)<<1); + if (m_drv[m_unit].seclen < 64) + memset(m_buf+(m_drv[m_unit].seclen<<1), 0, (64-m_drv[m_unit].seclen)<<1); - if (!find_sector(m_unit, m_head, m_sector, &data_id)) - { - m_stat_reg |= status_ID_not_found; - return; - } + if (!find_sector(m_unit, m_head, m_sector, &data_id)) + { + m_stat_reg |= status_ID_not_found; + return; + } - m_drv[m_unit].img->floppy_drive_write_sector_data(m_head, data_id, m_buf, 128, m_ddam); - m_buf_pos = 0; - m_buf_mode = bm_write; + m_drv[m_unit].img->floppy_drive_write_sector_data(m_head, data_id, m_buf, 128, m_ddam); + m_buf_pos = 0; + m_buf_mode = bm_write; - m_stat_reg |= status_XFER_ready; - m_stat_reg |= status_OP_complete; /* right??? */ + m_stat_reg |= status_XFER_ready; + m_stat_reg |= status_OP_complete; +*/ } /* @@ -319,363 +320,365 @@ void fd800_legacy_device::do_write(void) */ void fd800_legacy_device::do_cmd(void) { - int unit; - int cylinder; - int head; - int seclen; - int sector; +/* + int unit; + int cylinder; + int head; + int seclen; + int sector; - if (m_buf_mode != bm_off) - { /* All commands in the midst of read or write are interpreted as Stop */ - unit = (m_cmd_reg >> 10) & 3; + if (m_buf_mode != bm_off) + { // All commands in the midst of read or write are interpreted as Stop + unit = (m_cmd_reg >> 10) & 3; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - m_buf_pos = 0; - m_buf_mode = bm_off; + m_buf_pos = 0; + m_buf_mode = bm_off; - m_stat_reg |= status_OP_complete; + m_stat_reg |= status_OP_complete; - m_stat_reg |= status_interrupt; - set_interrupt_line(); + m_stat_reg |= status_interrupt; + set_interrupt_line(); - return; - } + return; + } - switch (m_cmd_reg >> 12) - { - case 0: /* select - bits 16-25: 0s - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; + switch (m_cmd_reg >> 12) + { + case 0: // select + // bits 16-25: 0s + // bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if (!m_drv[unit].img->exists()) - m_stat_reg |= status_drv_not_ready; /* right??? */ - else if (m_drv[unit].img->is_readonly()) - m_stat_reg |= status_write_prot; - else - m_stat_reg |= status_OP_complete; + if (!m_drv[unit].img->exists()) + m_stat_reg |= status_drv_not_ready; // right??? + else if (m_drv[unit].img->is_readonly()) + m_stat_reg |= status_write_prot; + else + m_stat_reg |= status_OP_complete; - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 1: /* seek + case 1: // seek bits 16-22: cylinder number (0-76) bits 23-24: 0s bits 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - head = (m_cmd_reg >> 9) & 1; - cylinder = m_cmd_reg & 0x7f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + head = (m_cmd_reg >> 9) & 1; + cylinder = m_cmd_reg & 0x7f; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if (!do_seek(unit, cylinder, head)) - m_stat_reg |= status_OP_complete; + if (!do_seek(unit, cylinder, head)) + m_stat_reg |= status_OP_complete; - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 2: /* restore + case 2: // restore bits 16-25: 0s - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if (!do_restore(unit)) - m_stat_reg |= status_OP_complete; + if (!do_restore(unit)) + m_stat_reg |= status_OP_complete; - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 3: /* sector length + case 3: // sector length bits 16-22: sector word count (0-64) bits 23-25: 0s - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - seclen = m_cmd_reg & 0x7f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + seclen = m_cmd_reg & 0x7f; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if ((seclen > 64) || (seclen == 0)) - { - m_stat_reg |= status_invalid_cmd; - } - else - { - m_drv[unit].seclen = seclen; - m_stat_reg |= status_OP_complete; - } + if ((seclen > 64) || (seclen == 0)) + { + m_stat_reg |= status_invalid_cmd; + } + else + { + m_drv[unit].seclen = seclen; + m_stat_reg |= status_OP_complete; + } - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 4: /* read + case 4: // read bits 16-20: sector number (1-26) bits 21-23: 0s bit 24: no sequential sectoring (1=active) bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - head = (m_cmd_reg >> 9) & 1; - /*non_seq_mode = (m_cmd_reg >> 8) & 1;*/ - sector = m_cmd_reg & 0x1f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + head = (m_cmd_reg >> 9) & 1; + //non_seq_mode = (m_cmd_reg >> 8) & 1; + sector = m_cmd_reg & 0x1f; - m_unit = unit; - m_head = head; - m_sector = sector; - /*m_non_seq_mode = non_seq_mode;*/ + m_unit = unit; + m_head = head; + m_sector = sector; + //m_non_seq_mode = non_seq_mode; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - do_read(); + do_read(); - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 5: /* read ID + case 5: // read ID bits 16-24: 0s bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - head = (m_cmd_reg >> 9) & 1; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + head = (m_cmd_reg >> 9) & 1; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if (!read_id(unit, head, &cylinder, §or)) - { - m_stat_reg |= status_ID_not_found; - } - else - { - m_recv_buf = (cylinder << 8) | sector; - m_stat_reg |= status_OP_complete; - } + if (!read_id(unit, head, &cylinder, §or)) + { + m_stat_reg |= status_ID_not_found; + } + else + { + m_recv_buf = (cylinder << 8) | sector; + m_stat_reg |= status_OP_complete; + } - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 6: /* read unformatted + case 6: // read unformatted bits 16-20: sector number (1-26) bits 21-24: 0s bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - /* ... */ - break; + bits 26-27: unit number (0-3) + // ... + break; - case 7: /* write + case 7: // write bits 16-20: sector number (1-26) bits 21-24: 0s bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - head = (m_cmd_reg >> 9) & 1; - sector = m_cmd_reg & 0x1f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + head = (m_cmd_reg >> 9) & 1; + sector = m_cmd_reg & 0x1f; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if ((m_sector == 0) || (m_sector > 26)) - { - m_stat_reg |= status_invalid_cmd; - } - else - { - m_unit = unit; - m_head = head; - m_sector = sector; - m_ddam = 0; + if ((m_sector == 0) || (m_sector > 26)) + { + m_stat_reg |= status_invalid_cmd; + } + else + { + m_unit = unit; + m_head = head; + m_sector = sector; + m_ddam = 0; - m_buf_pos = 0; - m_buf_mode = bm_write; - m_stat_reg |= status_XFER_ready; - m_stat_reg |= status_OP_complete; /* right??? */ - } + m_buf_pos = 0; + m_buf_mode = bm_write; + m_stat_reg |= status_XFER_ready; + m_stat_reg |= status_OP_complete; // right??? + } - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 8: /* write delete + case 8: // write delete bits 16-20: sector number (1-26) bits 21-24: 0s bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - head = (m_cmd_reg >> 9) & 1; - sector = m_cmd_reg & 0x1f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + head = (m_cmd_reg >> 9) & 1; + sector = m_cmd_reg & 0x1f; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - if ((m_sector == 0) || (m_sector > 26)) - { - m_stat_reg |= status_invalid_cmd; - } - else - { - m_unit = unit; - m_head = head; - m_sector = sector; - m_ddam = 1; + if ((m_sector == 0) || (m_sector > 26)) + { + m_stat_reg |= status_invalid_cmd; + } + else + { + m_unit = unit; + m_head = head; + m_sector = sector; + m_ddam = 1; - m_buf_pos = 0; - m_buf_mode = bm_write; - m_stat_reg |= status_XFER_ready; - m_stat_reg |= status_OP_complete; /* right??? */ - } + m_buf_pos = 0; + m_buf_mode = bm_write; + m_stat_reg |= status_XFER_ready; + m_stat_reg |= status_OP_complete; // right??? + } - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 9: /* format track + case 9: // format track bits 16-23: track ID (0-255, normally current cylinder index, or 255 for bad track) bit 24: verify only (1 - verify, 0 - format & verify) bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - /* ... */ - break; + bits 26-27: unit number (0-3) + // ... + break; - case 10: /* load int mask + case 10: // load int mask bit 16: bad mask for interrupt (0 = unmask or enable interrupt) - bits 17-27: 0s */ - m_interrupt_f_f = m_cmd_reg & 1; - set_interrupt_line(); - break; + bits 17-27: 0s + m_interrupt_f_f = m_cmd_reg & 1; + set_interrupt_line(); + break; - case 11: /* stop + case 11: // stop bits 16-25: 0s - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; - /* reset status */ - m_stat_reg = unit << status_unit_shift; + // reset status + m_stat_reg = unit << status_unit_shift; - m_stat_reg |= status_OP_complete; + m_stat_reg |= status_OP_complete; - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 12: /* step head + case 12: // step head bits 16-22: track number (0-76) bits 23-25: 0s - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - cylinder = m_cmd_reg & 0x7f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + cylinder = m_cmd_reg & 0x7f; - if (cylinder > 76) - { - m_stat_reg |= status_invalid_cmd; - } - else if ((m_drv[unit].phys_cylinder != -1) || (!do_restore(unit))) - { - m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].phys_cylinder); - m_stat_reg |= status_OP_complete; - } + if (cylinder > 76) + { + m_stat_reg |= status_invalid_cmd; + } + else if ((m_drv[unit].phys_cylinder != -1) || (!do_restore(unit))) + { + m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].phys_cylinder); + m_stat_reg |= status_OP_complete; + } - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 13: /* maintenance commands + case 13: // maintenance commands bits 16-23: according to extended command code - bits 24-27: extended command code (0-7) */ - switch ((m_cmd_reg >> 8) & 15) - { - case 0: /* reset - bits 16-23: 0s */ - /* ... */ - break; - case 1: /* retry inhibit - bits 16-23: 0s */ - /* ... */ - break; - case 2: /* LED test + bits 24-27: extended command code (0-7) + switch ((m_cmd_reg >> 8) & 15) + { + case 0: // reset + bits 16-23: 0s + // ... + break; + case 1: // retry inhibit + bits 16-23: 0s + // ... + break; + case 2: // LED test bit 16: 1 bits 17-19: 0s bit 20: LED #2 enable bit 21: LED #3 enable bit 22: LED #4 enable - bit 23: enable LEDs */ - /* ... */ - break; - case 3: /* program error (a.k.a. invalid command) - bits 16-23: 0s */ - /* ... */ - break; - case 4: /* memory read + bit 23: enable LEDs + // ... + break; + case 3: // program error (a.k.a. invalid command) + bits 16-23: 0s + // ... + break; + case 4: // memory read bits 16-20: controller memory address (shifted left by 8 to generate 9900 address) - bits 21-23: 0s */ - /* ... */ - break; - case 5: /* RAM load + bits 21-23: 0s + // ... + break; + case 5: // RAM load bit 16: 0 - bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address) */ - /* ... */ - break; - case 6: /* RAM run + bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address) + // ... + break; + case 6: // RAM run bit 16: 0 - bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address) */ - /* ... */ - break; - case 7: /* power up simulation - bits 16-23: 0s */ - /* ... */ - break; - } - /* ... */ - break; + bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address) + // ... + break; + case 7: // power up simulation + bits 16-23: 0s + // ... + break; + } + // ... + break; - case 14: /* IPL + case 14: // IPL bits 16-22: track number (0-76) bit 23: 0 bit 24: no sequential sectoring (1=active) bit 25: head number (1=upper) - bits 26-27: unit number (0-3) */ - unit = (m_cmd_reg >> 10) & 3; - head = (m_cmd_reg >> 9) & 1; - /*non_seq_mode = (m_cmd_reg >> 8) & 1;*/ - cylinder = m_cmd_reg & 0x7f; + bits 26-27: unit number (0-3) + unit = (m_cmd_reg >> 10) & 3; + head = (m_cmd_reg >> 9) & 1; + //non_seq_mode = (m_cmd_reg >> 8) & 1; + cylinder = m_cmd_reg & 0x7f; - if (!do_seek(unit, cylinder, head)) - { - m_unit = unit; - m_head = head; - m_sector = 1; - /*m_non_seq_mode = non_seq_mode;*/ + if (!do_seek(unit, cylinder, head)) + { + m_unit = unit; + m_head = head; + m_sector = 1; + //m_non_seq_mode = non_seq_mode; - do_read(); - } + do_read(); + } - m_stat_reg |= status_interrupt; - set_interrupt_line(); - break; + m_stat_reg |= status_interrupt; + set_interrupt_line(); + break; - case 15: /* Clear Status port - bits 16-27: 0s */ - m_stat_reg = 0; - set_interrupt_line(); - break; - } + case 15: // Clear Status port + bits 16-27: 0s + m_stat_reg = 0; + set_interrupt_line(); + break; + } + */ } /* @@ -708,13 +711,13 @@ READ8_MEMBER( fd800_legacy_device::cru_r ) { case 0: case 1: - /* receive buffer */ + // receive buffer reply = m_recv_buf >> (offset*8); break; case 2: case 3: - /* status register */ + // status register reply = m_stat_reg >> ((offset-2)*8); break; } @@ -754,7 +757,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) case 13: case 14: case 15: - /* transmit buffer */ + // transmit buffer if (data) m_xmit_buf |= 1 << offset; else @@ -768,9 +771,9 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) case bm_read: m_buf_pos++; if (m_buf_pos == m_drv[m_unit].seclen) - { /* end of sector */ + { // end of sector if (m_sector == 26) - { /* end of track -> end command (right???) */ + { // end of track -> end command (right???) m_stat_reg &= ~status_XFER_ready; m_stat_reg |= status_OP_complete; m_stat_reg |= status_interrupt; @@ -778,7 +781,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) set_interrupt_line(); } else - { /* read next sector */ + { // read next sector m_sector++; m_stat_reg &= ~status_XFER_ready | status_OP_complete | status_interrupt; do_read(); @@ -795,11 +798,11 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) m_buf[(m_buf_pos<<1)+1] = m_xmit_buf & 0xff; m_buf_pos++; if (m_buf_pos == m_drv[m_unit].seclen) - { /* end of sector */ + { // end of sector do_write(); if (m_sector == 26) { - /* end of track -> end command (right???) */ + // end of track -> end command (right???) m_stat_reg &= ~status_XFER_ready; m_stat_reg |= status_OP_complete; m_stat_reg |= status_interrupt; @@ -807,7 +810,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) set_interrupt_line(); } else - { /* increment to next sector */ + { // increment to next sector m_sector++; m_stat_reg |= status_interrupt; set_interrupt_line(); @@ -834,7 +837,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) case 29: case 30: case 31: - /* command register */ + // command register if (data) m_cmd_reg |= 1 << (offset-16); else @@ -845,25 +848,25 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w ) } } +#if 0 LEGACY_FLOPPY_OPTIONS_START(fd800) -#if 1 - /* SSSD 8" */ + // SSSD 8" LEGACY_FLOPPY_OPTION(fd800, "dsk", "TI990 8\" SSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, HEADS([1]) TRACKS([77]) SECTORS([26]) SECTOR_LENGTH([128]) FIRST_SECTOR_ID([1])) -#elif 0 - /* DSSD 8" */ + + // DSSD 8" LEGACY_FLOPPY_OPTION(fd800, "dsk", "TI990 8\" DSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, HEADS([2]) TRACKS([77]) SECTORS([26]) SECTOR_LENGTH([128]) FIRST_SECTOR_ID([1])) -#endif LEGACY_FLOPPY_OPTIONS_END +#endif void fd800_legacy_device::device_start(void) { @@ -872,7 +875,7 @@ void fd800_legacy_device::device_start(void) for (int i=0; i Date: Wed, 3 Jun 2015 22:16:45 +0200 Subject: [PATCH 125/284] fix compile --- src/mame/drivers/chihiro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c index e54154eaee1..8f58e73b59e 100644 --- a/src/mame/drivers/chihiro.c +++ b/src/mame/drivers/chihiro.c @@ -864,7 +864,7 @@ static void dump_timer_command(running_machine &machine, int ref, int params, co debug_console_printf(machine, "Header.Inserted %d byte\n", space.read_byte(address + 3)); debug_console_printf(machine, "Header.SignalState %08X dword\n", space.read_dword_unaligned(address + 4)); debug_console_printf(machine, "Header.WaitListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 8), space.read_dword_unaligned(address + 12)); - debug_console_printf(machine, "DueTime %I64d qword\n", (INT64)space.read_qword_unaligned(address + 16)); + debug_console_printf(machine, "DueTime %" I64FMT "x qword\n", (INT64)space.read_qword_unaligned(address + 16)); debug_console_printf(machine, "TimerListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 24), space.read_dword_unaligned(address + 28)); debug_console_printf(machine, "Dpc %08X dword\n", space.read_dword_unaligned(address + 32)); debug_console_printf(machine, "Period %d dword\n", space.read_dword_unaligned(address + 36)); From 7cd3ebf18a308626aab25e15fc54109dd8091ae9 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 3 Jun 2015 22:52:06 +0200 Subject: [PATCH 126/284] Changed the way NETLIST_START(NAME) is located and called. This is done now solely by using a netlist_sources_t class. Netlist users just register sources like memregions, hardcoded strings, compiled netlists. Going forward this enables to eventually put macro model librariers into roms. The improvement comes with a price. Compiled netlists to be included must now be registered using LOCAL_SOURCE. [Couriersud] --- src/emu/machine/netlist.c | 12 ++++ src/emu/machine/netlist.h | 17 +++++- src/emu/netlist/nl_parser.c | 17 ++++-- src/emu/netlist/nl_parser.h | 102 +------------------------------ src/emu/netlist/nl_setup.c | 40 ++++++++++-- src/emu/netlist/nl_setup.h | 118 +++++++++++++++++++++++++++++++++++- src/mame/drivers/nl_pong.c | 2 + src/mame/drivers/pong.c | 4 +- src/mame/drivers/popeye.c | 4 ++ src/tools/nltool.c | 13 ++-- 10 files changed, 204 insertions(+), 125 deletions(-) diff --git a/src/emu/machine/netlist.c b/src/emu/machine/netlist.c index 794eaa28454..7b7767afea1 100644 --- a/src/emu/machine/netlist.c +++ b/src/emu/machine/netlist.c @@ -13,6 +13,7 @@ #include "netlist/nl_base.h" #include "netlist/nl_setup.h" #include "netlist/nl_factory.h" +#include "netlist/nl_parser.h" #include "netlist/devices/net_lib.h" #include "debugger.h" @@ -633,3 +634,14 @@ void netlist_mame_sound_device_t::sound_stream_update(sound_stream &stream, stre m_out[i]->buffer_reset(cur); } } + +// ---------------------------------------------------------------------------------------- +// memregion source support +// ---------------------------------------------------------------------------------------- + +bool netlist_source_memregion_t::parse(netlist_setup_t *setup, const pstring name) +{ + const char *mem = (const char *)downcast(setup->netlist()).machine().root_device().memregion(m_name.cstr())->base(); + netlist_parser p(*setup); + return p.parse(mem, name); +} diff --git a/src/emu/machine/netlist.h b/src/emu/machine/netlist.h index c6e8e2ce396..12b2148effa 100644 --- a/src/emu/machine/netlist.h +++ b/src/emu/machine/netlist.h @@ -60,8 +60,21 @@ // Extensions to interface netlist with MAME code .... // ---------------------------------------------------------------------------------------- -#define NETLIST_MEMREGION(_name) \ - setup.parse((char *)downcast(setup.netlist()).machine().root_device().memregion(_name)->base()); +class netlist_source_memregion_t : public netlist_source_t +{ +public: + netlist_source_memregion_t(pstring name) + : netlist_source_t(), m_name(name) + { + } + + bool parse(netlist_setup_t *setup, const pstring name); +private: + pstring m_name; +}; + +#define MEMREGION_SOURCE(_name) \ + setup.register_source(palloc(netlist_source_memregion_t, _name)); #define NETDEV_ANALOG_CALLBACK_MEMBER(_name) \ void _name(const double data, const attotime &time) diff --git a/src/emu/netlist/nl_parser.c b/src/emu/netlist/nl_parser.c index c7eb527d15a..d82333cbc4c 100644 --- a/src/emu/netlist/nl_parser.c +++ b/src/emu/netlist/nl_parser.c @@ -52,6 +52,7 @@ bool netlist_parser::parse(const char *buf, const pstring nlname) m_tok_PARAM = register_token("PARAM"); m_tok_NET_MODEL = register_token("NET_MODEL"); m_tok_INCLUDE = register_token("INCLUDE"); + m_tok_LOCAL_SOURCE = register_token("LOCAL_SOURCE"); m_tok_SUBMODEL = register_token("SUBMODEL"); m_tok_NETLIST_START = register_token("NETLIST_START"); m_tok_NETLIST_END = register_token("NETLIST_END"); @@ -124,6 +125,8 @@ void netlist_parser::parse_netlist(ATTR_UNUSED const pstring &nlname) net_submodel(); else if (token.is(m_tok_INCLUDE)) net_include(); + else if (token.is(m_tok_LOCAL_SOURCE)) + net_local_source(); else if (token.is(m_tok_TRUTHTABLE_START)) net_truthtable_start(); else if (token.is(m_tok_NETLIST_END)) @@ -210,8 +213,7 @@ void netlist_parser::net_submodel() require_token(m_tok_param_right); m_setup.namespace_push(name); - netlist_parser subparser(m_setup); - subparser.parse(m_buf, model); + m_setup.include(name); m_setup.namespace_pop(); } @@ -221,8 +223,15 @@ void netlist_parser::net_include() pstring name = get_identifier(); require_token(m_tok_param_right); - netlist_parser subparser(m_setup); - subparser.parse(m_buf, name); + m_setup.include(name); +} + +void netlist_parser::net_local_source() +{ + // This directive is only for hardcoded netlists. Ignore it here. + pstring name = get_identifier(); + require_token(m_tok_param_right); + } void netlist_parser::net_alias() diff --git a/src/emu/netlist/nl_parser.h b/src/emu/netlist/nl_parser.h index d275dee35aa..30faf341d67 100644 --- a/src/emu/netlist/nl_parser.h +++ b/src/emu/netlist/nl_parser.h @@ -31,6 +31,7 @@ public: void net_model(); void net_submodel(); void net_include(); + void net_local_source(); void net_truthtable_start(); protected: @@ -53,6 +54,7 @@ private: token_id_t m_tok_NETLIST_END; token_id_t m_tok_SUBMODEL; token_id_t m_tok_INCLUDE; + token_id_t m_tok_LOCAL_SOURCE; token_id_t m_tok_TRUTHTABLE_START; token_id_t m_tok_TRUTHTABLE_END; token_id_t m_tok_TT_HEAD; @@ -63,105 +65,5 @@ private: const char *m_buf; }; -class netlist_source_t -{ -public: - typedef plist_t list_t; - - enum source_e - { - EMPTY, - STRING, - PROC, - MEMORY - }; - - netlist_source_t() - : m_type(EMPTY), - m_setup_func(NULL), - m_setup_func_name(""), - m_mem(NULL) - { - } - - netlist_source_t(pstring name, void (*setup_func)(netlist_setup_t &)) - : m_type(PROC), - m_setup_func(setup_func), - m_setup_func_name(name), - m_mem(NULL) - { - } - - netlist_source_t(const char *mem) - : m_type(MEMORY), - m_setup_func(NULL), - m_setup_func_name(""), - m_mem(mem) - { - } - - ~netlist_source_t() { } - - bool parse(netlist_setup_t &setup, const pstring name) - { - switch (m_type) - { - case PROC: - if (name == m_setup_func_name) - { - m_setup_func(setup); - return true; - } - break; - case MEMORY: - { - netlist_parser p(setup); - return p.parse(m_mem, name); - } - break; - case STRING: - case EMPTY: - break; - } - return false; - } -private: - source_e m_type; - - void (*m_setup_func)(netlist_setup_t &); - pstring m_setup_func_name; - const char *m_mem; - -}; - -class netlist_sources_t -{ -public: - - netlist_sources_t() { } - - ~netlist_sources_t() - { - m_list.clear(); - } - - void add(netlist_source_t src) - { - m_list.add(src); - } - - void parse(netlist_setup_t &setup, const pstring name) - { - for (std::size_t i=0; i < m_list.size(); i++) - { - if (m_list[i].parse(setup, name)) - return; - } - setup.netlist().error("unable to find %s in source collection", name.cstr()); - } - -private: - netlist_source_t::list_t m_list; -}; #endif /* NL_PARSER_H_ */ diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 04145bc5ead..a9c39a3d8b7 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -24,6 +24,9 @@ static NETLIST_START(base) NET_REGISTER_DEV(gnd, GND) NET_REGISTER_DEV(netlistparams, NETLIST) + LOCAL_SOURCE(diode_models) + LOCAL_SOURCE(bjt_models) + INCLUDE(diode_models); INCLUDE(bjt_models); @@ -777,12 +780,6 @@ void netlist_setup_t::start_devices() netlist().start(); } -void netlist_setup_t::parse(const char *buf) -{ - netlist_parser parser(*this); - parser.parse(buf); -} - void netlist_setup_t::print_stats() const { #if (NL_KEEP_STATISTICS) @@ -797,3 +794,34 @@ void netlist_setup_t::print_stats() const } #endif } + +// ---------------------------------------------------------------------------------------- +// Sources +// ---------------------------------------------------------------------------------------- + +void netlist_sources_t::parse(netlist_setup_t *setup, const pstring name) +{ + for (std::size_t i=0; i < m_list.size(); i++) + { + if (m_list[i]->parse(setup, name)) + return; + } + setup->netlist().error("unable to find %s in source collection", name.cstr()); +} + +// ---------------------------------------------------------------------------------------- +// base sources +// ---------------------------------------------------------------------------------------- + + +bool netlist_source_string_t::parse(netlist_setup_t *setup, const pstring name) +{ + netlist_parser p(*setup); + return p.parse(m_str, name); +} + +bool netlist_source_mem_t::parse(netlist_setup_t *setup, const pstring name) +{ + netlist_parser p(*setup); + return p.parse(m_str, name); +} diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index f1f117e8fc6..78e48735690 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -57,14 +57,60 @@ ATTR_COLD void NETLIST_NAME(_name)(netlist_setup_t &setup) { #define NETLIST_END() } +#define LOCAL_SOURCE(_name) \ + setup.register_source(palloc(netlist_source_proc_t, # _name, &NETLIST_NAME(_name))); + #define INCLUDE(_name) \ - NETLIST_NAME(_name)(setup); + setup.include(# _name); #define SUBMODEL(_name, _model) \ setup.namespace_push(# _name); \ NETLIST_NAME(_model)(setup); \ setup.namespace_pop(); +class netlist_setup_t; + +// ---------------------------------------------------------------------------------------- +// A Generic netlist sources implementation +// ---------------------------------------------------------------------------------------- + +class netlist_source_t +{ +public: + typedef plist_t list_t; + + netlist_source_t() + {} + + virtual ~netlist_source_t() { } + + virtual bool parse(netlist_setup_t *setup, const pstring name) = 0; +private: +}; + + +class netlist_sources_t +{ +public: + + netlist_sources_t() { } + + ~netlist_sources_t() + { + m_list.clear_and_free(); + } + + void add(netlist_source_t *src) + { + m_list.add(src); + } + + void parse(netlist_setup_t *setup, const pstring name); + +private: + netlist_source_t::list_t m_list; +}; + // ---------------------------------------------------------------------------------------- // netlist_setup_t // ---------------------------------------------------------------------------------------- @@ -137,8 +183,6 @@ public: netlist_param_t *find_param(const pstring ¶m_in, bool required = true); - void parse(const char *buf); - void start_devices(); void resolve_inputs(); @@ -147,6 +191,14 @@ public: void namespace_push(const pstring &aname); void namespace_pop(); + /* parse a source */ + + void include(pstring netlist_name) { m_sources.parse(this, netlist_name); } + + /* register a source */ + + void register_source(netlist_source_t *src) { m_sources.add(src); } + netlist_factory_list_t &factory() { return *m_factory; } const netlist_factory_list_t &factory() const { return *m_factory; } @@ -173,6 +225,7 @@ private: int m_proxy_cnt; pstack_t m_stack; + netlist_sources_t m_sources; void connect_terminals(netlist_core_terminal_t &in, netlist_core_terminal_t &out); @@ -202,4 +255,63 @@ private: } }; +// ---------------------------------------------------------------------------------------- +// base sources +// ---------------------------------------------------------------------------------------- + + +class netlist_source_string_t : public netlist_source_t +{ +public: + + netlist_source_string_t(pstring source) + : netlist_source_t(), m_str(source) + { + } + + bool parse(netlist_setup_t *setup, const pstring name); + +private: + pstring m_str; +}; + + +class netlist_source_mem_t : public netlist_source_t +{ +public: + netlist_source_mem_t(const char *mem) + : netlist_source_t(), m_str(mem) + { + } + + bool parse(netlist_setup_t *setup, const pstring name); +private: + pstring m_str; +}; + +class netlist_source_proc_t : public netlist_source_t +{ +public: + netlist_source_proc_t(pstring name, void (*setup_func)(netlist_setup_t &)) + : m_setup_func(setup_func), + m_setup_func_name(name) + { + } + + bool parse(netlist_setup_t *setup, const pstring name) + { + if (name == m_setup_func_name) + { + m_setup_func(*setup); + return true; + } + else + return false; + } +private: + void (*m_setup_func)(netlist_setup_t &); + pstring m_setup_func_name; +}; + + #endif /* NLSETUP_H_ */ diff --git a/src/mame/drivers/nl_pong.c b/src/mame/drivers/nl_pong.c index c3373cbb91e..5e2652b53ad 100644 --- a/src/mame/drivers/nl_pong.c +++ b/src/mame/drivers/nl_pong.c @@ -29,6 +29,8 @@ NETLIST_END() NETLIST_START(pong_fast) + LOCAL_SOURCE(lib) + INCLUDE(lib) SOLVER(Solver, 48000) PARAM(Solver.PARALLEL, 0) // Don't do parallel solvers diff --git a/src/mame/drivers/pong.c b/src/mame/drivers/pong.c index 3f855cd247c..6a495760c60 100644 --- a/src/mame/drivers/pong.c +++ b/src/mame/drivers/pong.c @@ -216,7 +216,9 @@ private: static NETLIST_START(pong) - NETLIST_MEMREGION("maincpu") + MEMREGION_SOURCE("maincpu") + PARAM(NETLIST.USE_DEACTIVATE, 1) + INCLUDE(pong_schematics) NETLIST_END() diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c index a72ac4ad073..6ec651e3bed 100644 --- a/src/mame/drivers/popeye.c +++ b/src/mame/drivers/popeye.c @@ -51,6 +51,10 @@ NETLIST_END() static NETLIST_START(nl_popeye) + /* register hard coded netlists */ + + LOCAL_SOURCE(nl_popeye_imp_changer) + /* Standard stuff */ SOLVER(Solver, 48000) diff --git a/src/tools/nltool.c b/src/tools/nltool.c index f2cc7e0734c..c11bc5d3571 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -192,11 +192,8 @@ public: { // read the netlist ... - netlist_sources_t sources; - - sources.add(netlist_source_t(buffer)); - sources.parse(*m_setup, name); - //m_setup->parse(buffer); + m_setup->register_source(palloc(netlist_source_mem_t, buffer)); + m_setup->include(name); log_setup(); // start devices @@ -295,10 +292,8 @@ static void listdevices() nt.init(); const netlist_factory_list_t::list_t &list = nt.setup().factory().list(); - netlist_sources_t sources; - - sources.add(netlist_source_t("dummy", &netlist_dummy)); - sources.parse(nt.setup(),"dummy"); + nt.setup().register_source(palloc(netlist_source_proc_t, "dummy", &netlist_dummy)); + nt.setup().include("dummy"); nt.setup().start_devices(); nt.setup().resolve_inputs(); From 0da5dfaa1539a03efdc519ecc20086070cffd910 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 3 Jun 2015 23:08:28 +0200 Subject: [PATCH 127/284] proper fix for the missing towercab disk set. nw. --- hash/msx2_flop.xml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hash/msx2_flop.xml b/hash/msx2_flop.xml index 6537b0b4a9e..00c7bc7c54e 100644 --- a/hash/msx2_flop.xml +++ b/hash/msx2_flop.xml @@ -11171,12 +11171,26 @@ The following floppies came with the machines. - The Tower? of Cabin - Cabin Panic (Jpn, Alt) From 5f9be95354b415ad9dd71aea209729edbef62557 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 3 Jun 2015 23:09:28 +0200 Subject: [PATCH 128/284] fix compile by commenting unused private fields. nw. --- src/mess/machine/ti99/990_dk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mess/machine/ti99/990_dk.h b/src/mess/machine/ti99/990_dk.h index 52e63abc10e..63af5cfdc3c 100644 --- a/src/mess/machine/ti99/990_dk.h +++ b/src/mess/machine/ti99/990_dk.h @@ -52,10 +52,10 @@ private: int m_buf_pos; buf_mode_t m_buf_mode; int m_unit; - int m_head; +// int m_head; int m_sector; /*int m_non_seq_mode;*/ - int m_ddam; +// int m_ddam; struct { From 0798ea0646fd76f0c9a93b827b0b4a073c3fcd4d Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 3 Jun 2015 23:10:14 +0200 Subject: [PATCH 129/284] add validation entry for softlist items which might miss the nodes --- src/emu/softlist.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/emu/softlist.c b/src/emu/softlist.c index 9f6fd339b8b..b9719d29a33 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -557,6 +557,13 @@ void software_list_device::internal_validity_check(validity_checker &valid) break; } + // Did we lost the software parts? + if (swinfo->num_parts() == 0) + { + osd_printf_error("%s: %s has no part\n", filename(), swinfo->shortname()); + break; + } + // Second, since the xml is fine, run additional checks: // check for duplicate names From 9eebbcba2f3b6c94225cd2cdd2a1aae58f194711 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 3 Jun 2015 23:47:24 +0200 Subject: [PATCH 130/284] Fixed mario sound when netlist sound is enabled. (nw) --- src/mame/audio/mario.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c index 0a96e566937..a442b7bc1a1 100644 --- a/src/mame/audio/mario.c +++ b/src/mame/audio/mario.c @@ -193,7 +193,9 @@ NETLIST_END() static NETLIST_START(nl_mario) - /* Standard stuff */ + LOCAL_SOURCE(nl_mario_snd0) + LOCAL_SOURCE(nl_mario_snd7) + LOCAL_SOURCE(nl_mario_dac) SOLVER(Solver, 48000) PARAM(Solver.ACCURACY, 1e-8) From 71461592fcdf97dd683fb4d2ff61d768cf1df07c Mon Sep 17 00:00:00 2001 From: system11b Date: Wed, 3 Jun 2015 22:54:55 +0100 Subject: [PATCH 131/284] added paradisea and paradisee sets corrected comments in sidearms.c file from my last commit --- src/mame/arcade.lst | 4 +- src/mame/drivers/paradise.c | 82 +++++++++++++++++++++++++++++++++---- src/mame/drivers/sidearms.c | 4 +- 3 files changed, 80 insertions(+), 10 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 5d9bfd3bda2..936905bc904 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -9482,7 +9482,9 @@ skybump // (c) 1982 Venture Line suprridr // (c) 1983 Venture Line + Taito license // Yun Sung games -paradise // (c) >1994 Yun Sung +paradise // (c) 1994 Yun Sung +paradisea // (c) 1994 Yun Sung +paradisee // (c) 1994 Yun Sung (Escape license) paradlx // (c) >1994 Yun Sung para2dx // (c) >1994 Yun Sung penky // (c) 1995 Yun Sung diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index b3fb74d0cf4..470bf13b182 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -14,8 +14,8 @@ Sound Chips : 2 x AR17961 (OKI M6295) (only 1 in Torus) --------------------------------------------------------------------------- Year + Game Board# --------------------------------------------------------------------------- -94+ Paradise YS-1600 -94+ Paradise Deluxe YS-1604 +94 Paradise YS-1600 +94 Paradise Deluxe YS-1604 95 Target Ball YS-2002 96 Penky YS951004 96 Torus YS-0402? Looks identical @@ -27,8 +27,6 @@ Notes: paradise: I'm not sure it's working correctly: - The high scores table can't be entered !? -- The chance to play a bonus game is very slim. I think I got to play - a couple in total. Is there a way to trigger them !? penky: we need to delay the irqs at startup or it won't boot. Either one of ports 0x2003.r or 0x2005.w starts up the irq timer (confirmed via trojan) @@ -81,6 +79,11 @@ DIPSW-B (Slide Show) | Test | |on | -------------------------------------------------------------------- +2015/06/03 - System11 +Amended above comments - bonus round is triggered by percentage when you +beat a stage. Added 2 clones. Amended date to 1994 based on Distributor +sticker from Jan 95 and factory sticker 94*41. + ***************************************************************************/ #include "emu.h" @@ -802,8 +805,10 @@ YS-1604 | | |---------------------------------------------------------| -The year is not shown but must be >= 1994, since the development system -(cross compiler?) they used left a "1994.8-1989" in the rom +Year is assumed to be 1994 based on 94*41 factory sticker and 19/1/95 +operator sticker on a revised version PCB. The year is not shown but +must be >= 1994, since the development system (cross compiler?) they +used left a "1994.8-1989" in the rom ***************************************************************************/ @@ -833,6 +838,67 @@ ROM_START( paradise ) ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) ROM_END +/* No board ID, some tracks which are wire hacked on the YS board are + corrected on this variant - for example red on the edge connector, + would assume this is a later version. All ROMs have A-19 stickers + on them, this could be a bootleg set, hard to say since Yun-Sung + often made boards with no labels at all... Probably original code + since the same Microtek compiler was used*/ +ROM_START( paradisea ) + ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ + ROM_LOAD( "A-19.U128", 0x00000, 0x40000, CRC(d47ecb7e) SHA1(74e7a33f2fc4c7c830c53c50541c3d0efd152e98) ) + + ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */ + ROM_LOAD( "u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) ) + ROM_LOAD( "u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) ) + + ROM_REGION( 0x20000, "gfx2", ROMREGION_INVERT) /* 8x8x4 Background */ + ROM_LOAD( "u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) ) + + ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT) /* 8x8x8 Foreground */ + ROM_LOAD( "u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) ) + ROM_LOAD( "u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) ) + + ROM_REGION( 0x40000, "gfx4", ROMREGION_INVERT) /* 8x8x8 Midground */ + ROM_LOAD( "u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) ) + ROM_LOAD( "u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */ + ROM_LOAD( "u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) ) + + ROM_REGION( 0x80000, "oki2", 0 ) /* Samples (banked) */ + ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) +ROM_END + +/* Same board ID as main set, Escape labels on all ROMs + Suspect this is actually the newest revision due to improved slot + machine animation on 'girl select' compared to other sets */ +ROM_START( paradisee ) + ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ + ROM_LOAD( "Escape.U128", 0x00000, 0x40000, CRC(19b4e854) SHA1(7d7292017df67b7ed3a3e0059334866890c58b83) ) + + ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */ + ROM_LOAD( "u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) ) + ROM_LOAD( "u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) ) + + ROM_REGION( 0x20000, "gfx2", ROMREGION_INVERT) /* 8x8x4 Background */ + ROM_LOAD( "u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) ) + + ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT) /* 8x8x8 Foreground */ + ROM_LOAD( "u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) ) + ROM_LOAD( "u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) ) + + ROM_REGION( 0x40000, "gfx4", ROMREGION_INVERT) /* 8x8x8 Midground */ + ROM_LOAD( "u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) ) + ROM_LOAD( "u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */ + ROM_LOAD( "u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) ) + + ROM_REGION( 0x80000, "oki2", 0 ) /* Samples (banked) */ + ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) +ROM_END + ROM_START( paradlx ) ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "8.u128", 0x00000, 0x40000, CRC(3a45ac9e) SHA1(24e1b508ef582c8429e09929fea387f3a137f0e3) ) @@ -1244,7 +1310,9 @@ DRIVER_INIT_MEMBER(paradise_state,torus) ***************************************************************************/ -GAME( 199?, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise", GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994 +GAME( 1994, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise", GAME_SUPPORTS_SAVE ) +GAME( 1994, paradisea, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1994, paradisee, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (Escape)", GAME_SUPPORTS_SAVE ) GAME( 199?, paradlx, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // " GAME( 199?, para2dx, 0, paradise, para2dx, paradise_state, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // " GAME( 1995, tgtball, 0, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c index e0411daa06b..3b082deff16 100644 --- a/src/mame/drivers/sidearms.c +++ b/src/mame/drivers/sidearms.c @@ -14,8 +14,8 @@ MAY-2015 System11 - added turtshipko and turtshipkn. - amended comments for T-5 instances, A14 is tied high on the PCBs hence the need to load the higher half of the ROM only -- order of age is guessed - turtshipko has grey bullets and is the only revision to have these, probably fixed based on feedback before it was licensed to Sharp Image and Pacific Games - differences between US/JP/Korea versions previously in MAME are minimal. -- turtshipkn I assume is newer, the level order has changed and the disclaimer is in pure Korean however the orange bullets are retained. Given the 88/9 release date from the startup screen it would seem unlikely that this came out first, then got grey bullets and back to orange in time for it to still be a 1988 game in other countries. +- order of age is guessed - turtshipko has grey bullets and a different level order, 3x horizontal and then 3x vertical (as far as tested). Bullets probably fixed based on feedback before it was licensed to Sharp Image and Pacific Games - differences between US/JP/Korea versions previously in MAME are minimal. +- turtshipkn I assume is newer, the disclaimer is in pure Korean and the orange bullets are retained. Given the 88/9 release date from the startup screen it would seem unlikely that this came out first, then got grey bullets and back to orange in time for it to still be a 1988 game in other countries. JUL-2003 AAT From 09acd69622ffdf1008cfc33931b9f7300e8be60d Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 4 Jun 2015 00:08:16 +0200 Subject: [PATCH 132/284] added note --- src/mess/drivers/hh_hmcs40.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index fce417525f0..4de9a7160e0 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -55,6 +55,11 @@ *88 HD38820A 1984, Bandai Pair Match (1/2) *89 HD38820A 1984, Bandai Pair Match (2/2) + *75 HD44801A 1982, Alpha 8201 protection MCU (have dump) + + *35 HD44801B 1983, Alpha 8302 protection MCU (have dump) + *42 HD44801B 1984, Alpha 8303 protection MCU (have dump) + (* denotes not yet emulated by MESS, @ denotes it's in this driver) From 98d72fba974bc79861fc55d3b2f6e53d4b73de92 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 3 Jun 2015 16:46:59 -0700 Subject: [PATCH 133/284] nl_convert: fix compile on MSVC (struct and string in struct had same name) (nw) --- src/emu/netlist/tools/nl_convert.c | 2 +- src/emu/netlist/tools/nl_convert.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c index 10c3180ab67..b2970bdc2b0 100644 --- a/src/emu/netlist/tools/nl_convert.c +++ b/src/emu/netlist/tools/nl_convert.c @@ -152,7 +152,7 @@ double nl_convert_base_t::get_sp_val(const pstring &sin) return ret; } -nl_convert_base_t::sp_unit nl_convert_base_t::m_sp_units[] = { +nl_convert_base_t::_sp_unit nl_convert_base_t::m_sp_units[] = { {"T", "", 1.0e12 }, {"G", "", 1.0e9 }, {"MEG", "RES_M(%g)", 1.0e6 }, diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index 1e37d61e487..cf69b8dc18d 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -105,7 +105,7 @@ private: bool m_has_val; }; - struct sp_unit { + struct _sp_unit { pstring sp_unit; pstring nl_func; double mult; @@ -136,7 +136,7 @@ private: plist_t m_ext_alias; pnamedlist_t m_pins; - static sp_unit m_sp_units[]; + static _sp_unit m_sp_units[]; }; From 70b239008a5737cdc0e0db9d916c5aa6bb4dabfb Mon Sep 17 00:00:00 2001 From: briantro Date: Wed, 3 Jun 2015 18:55:39 -0500 Subject: [PATCH 134/284] vamphalf.c: Properly document the MR Kicker alt version - NW --- src/mame/drivers/vamphalf.c | 64 +++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c index 161b7bd5d02..2fe2ec733a7 100644 --- a/src/mame/drivers/vamphalf.c +++ b/src/mame/drivers/vamphalf.c @@ -32,9 +32,8 @@ - dquizgo2: bugged video test Notes: - - Mr Kicker is also known to exist (not dumped) on the F-E1-16-010 PCB that - Semicom also used for Toy Land Adventure & SemiComDate Quiz Go Go Episode 2 game. + + Mr Kicker: The F-E1-16-010 PCB version still needs proper speed ups Mr Kicker: Doesn't boot without a valid default eeprom, but no longer seems to fail after you get a high score (since eeprom rewrite). @@ -2177,7 +2176,6 @@ ROM_END Mr. Kicker (c) SemiCom SEMICOM-003b - +---------------------------------------------+ | +------+ | | YM3012 | U7 | | @@ -2218,12 +2216,56 @@ SW1 is the reset button SW2 is the setup button VR1 is the volume adjust pot + +F-E1-16-010 ++-----------------------------------------------+ +| VR1 YM3012 VROM1 | +| YM2151 M6295 ROML03 ROMU03| +| CRAM2 ROML02 ROMU02| +| CRAM1 ROML01 ROMU01| +| MEM1L ROML00 ROMU00| +|J MEM1U | +|A MEM2 +----------++----------+ | +|M | || | | +|M MEM3 |Quicklogic||Quicklogic| 2| +|A | QL2003- || QL2003- | 8| +| MEM6 | XPL84C || XPL84C | M| +| | || | H| +| MEM7 +----------++----------+ z| +| GAL | +| 93C46 ROM1* | +|P1 P2 50MHz E1-16T DRAM1 ROM2 | ++-----------------------------------------------+ + +Notes: +CPU - Hyperstone E1-16T @ 50.000MHz + +DRAM1 - LG Semi GM71C18163 1M x16 EDO DRAM (SOJ44) +CRAMx - W24M257AK-15 32K x8 SRAM (SOJ28) +MEMx - UM61256FK-15 32K x8 SRAM (SOJ28) + +Oki M6295 rebaged as AD-65 +YM3012/YM2151 rebaged as BS902/KA51 + + P1 - Reset push button + P2 - Setup push button +VR1 - Volume adjust pot + +ROMs: + ROML00 & ROMH00 - Macronix MX29F1610MC-12 SOP44 16MBit FlashROM + ROML01 & ROMH01 - Unpopulated space for MX29F1610MC-12 SOP44 16MBit FlashROM + ROML02 & ROMH02 - Unpopulated space for MX29F1610MC-12 SOP44 16MBit FlashROM + ROML03 & ROMH03 - Unpopulated space for MX29F1610MC-12 SOP44 16MBit FlashROM + VROM1 - MX 27C2000 2MBit DIP32 EPROM + * ROM1 - Unpopulated space for DIP32 EPROM (up to 4MBit) + ROM2 - 27C040 4MBit DIP32 EPROM + */ ROM_START( mrkicker ) ROM_REGION32_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */ /* rom0 empty */ - ROM_LOAD( "2-semicom.rom1", 0x080000, 0x080000, CRC(d3da29ca) SHA1(b843c650096a1c6d50f99e354ec0c93eb4406c5b) ) + ROM_LOAD( "2-semicom.rom1", 0x080000, 0x080000, CRC(d3da29ca) SHA1(b843c650096a1c6d50f99e354ec0c93eb4406c5b) ) /* SEMICOM-003b PCB */ ROM_REGION( 0x800000, "gfx1", 0 ) /* gfx data */ ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(c677aac3) SHA1(356073a29260e8e6c29dd12b2113b30140c6108c) ) @@ -2252,17 +2294,21 @@ ROM_END ROM_START( mrkickera ) ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */ - /* rom0 empty */ - ROM_LOAD( "3.rom2", 0x080000, 0x080000, CRC(3f7fa08b) SHA1(dbffd44d8387e6ed1a4b5ec85ccf64d69a108d88) ) + /* rom1 empty */ + ROM_LOAD( "3-semicom.rom2", 0x080000, 0x080000, CRC(3f7fa08b) SHA1(dbffd44d8387e6ed1a4b5ec85ccf64d69a108d88) ) /* F-E1-16-010 PCB */ ROM_REGION( 0x800000, "gfx1", 0 ) /* gfx data */ ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(c677aac3) SHA1(356073a29260e8e6c29dd12b2113b30140c6108c) ) ROM_LOAD32_WORD( "romh00", 0x000002, 0x200000, CRC(b6337d4a) SHA1(2f46e2933af7fd0f71083900d5e6e4f602ab4c66) ) /* roml01 empty */ /* romh01 empty */ + /* roml02 empty */ + /* romh02 empty */ + /* roml03 empty */ + /* romh03 empty */ ROM_REGION( 0x080000, "user2", 0 ) /* Oki Samples */ - ROM_LOAD( "at27c040.u7", 0x000000, 0x080000, CRC(e8141fcd) SHA1(256fd1987030e0a1df0a66a228c1fea996cda686) ) /* Mask ROM */ + ROM_LOAD( "11-semicom.vrom1", 0x000000, 0x080000, CRC(e8141fcd) SHA1(256fd1987030e0a1df0a66a228c1fea996cda686) ) /* same data as above */ /* $00000-$20000 stays the same in all sound banks, */ /* the second half of the bank is what gets switched */ @@ -2946,7 +2992,7 @@ GAME( 2000, misncrfta, misncrft, misncrft, common, vamphalf_state, misncrft, R GAME( 2000, mrdig, 0, mrdig, common, vamphalf_state, mrdig, ROT0, "Sun", "Mr. Dig", GAME_SUPPORTS_SAVE ) GAME( 2001, dtfamily, 0, coolmini, common, vamphalf_state, dtfamily, ROT0, "SemiCom", "Diet Family", GAME_SUPPORTS_SAVE ) GAME( 2001, finalgdr, 0, finalgdr, finalgdr, vamphalf_state, finalgdr, ROT0, "SemiCom", "Final Godori (Korea, version 2.20.5915)", GAME_SUPPORTS_SAVE ) -GAME( 2001, mrkicker, 0, mrkicker, finalgdr, vamphalf_state, mrkicker, ROT0, "SemiCom", "Mr. Kicker", GAME_SUPPORTS_SAVE ) +GAME( 2001, mrkicker, 0, mrkicker, finalgdr, vamphalf_state, mrkicker, ROT0, "SemiCom", "Mr. Kicker (SEMICOM-003b PCB)", GAME_SUPPORTS_SAVE ) GAME( 2001, mrkickera, mrkicker, coolmini, common, vamphalf_state, mrkickera,ROT0, "SemiCom", "Mr. Kicker (F-E1-16-010 PCB)", GAME_SUPPORTS_SAVE ) GAME( 2001, toyland, 0, coolmini, common, vamphalf_state, toyland, ROT0, "SemiCom", "Toy Land Adventure", GAME_SUPPORTS_SAVE ) GAME( 2001, wivernwg, 0, wyvernwg, common, vamphalf_state, wyvernwg, ROT270, "SemiCom", "Wivern Wings", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) From 3beb8a1277812ee237f3b33a838d7be75ac6395f Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 3 Jun 2015 17:05:28 -0700 Subject: [PATCH 135/284] nl_config: fix compile (nw) --- src/emu/netlist/nl_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index 30ba2fae678..439e779b1ce 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -47,7 +47,7 @@ */ // This will be autodetected -#define NL_PMF_TYPE 3 +//#define NL_PMF_TYPE 3 #define NL_PMF_TYPE_VIRTUAL 0 #define NL_PMF_TYPE_GNUC_PMF 1 From 4722952050c5ad920b194438a2084b9f4c26a2ef Mon Sep 17 00:00:00 2001 From: briantro Date: Wed, 3 Jun 2015 19:22:24 -0500 Subject: [PATCH 136/284] paradise.c: Clean up the recent submission a little - NW --- src/mame/drivers/paradise.c | 83 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index 470bf13b182..3dfb7e7e5c1 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -810,6 +810,14 @@ operator sticker on a revised version PCB. The year is not shown but must be >= 1994, since the development system (cross compiler?) they used left a "1994.8-1989" in the rom +Paradise (set 2): No board ID, although some tracks which are wire hacks on + YS-1600 PCB are corrected on this version. All roms are labeled as "A-19" + Except for the program rom all other data matches Paradise (set 1). + +The Escape version might be the newest revision due to improved slot machine + animation on 'girl select' compared to other sets. + NOTE: on this version of the PCB the above listed 4MHz OSC is repleace with + a 3.579545MHz OSC ***************************************************************************/ ROM_START( paradise ) @@ -838,65 +846,56 @@ ROM_START( paradise ) ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) ROM_END -/* No board ID, some tracks which are wire hacked on the YS board are - corrected on this variant - for example red on the edge connector, - would assume this is a later version. All ROMs have A-19 stickers - on them, this could be a bootleg set, hard to say since Yun-Sung - often made boards with no labels at all... Probably original code - since the same Microtek compiler was used*/ ROM_START( paradisea ) ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ - ROM_LOAD( "A-19.U128", 0x00000, 0x40000, CRC(d47ecb7e) SHA1(74e7a33f2fc4c7c830c53c50541c3d0efd152e98) ) + ROM_LOAD( "a-19.U128", 0x00000, 0x40000, CRC(d47ecb7e) SHA1(74e7a33f2fc4c7c830c53c50541c3d0efd152e98) ) ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */ - ROM_LOAD( "u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) ) - ROM_LOAD( "u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) ) + ROM_LOAD( "a-19.u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) ) + ROM_LOAD( "a-19.u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) ) ROM_REGION( 0x20000, "gfx2", ROMREGION_INVERT) /* 8x8x4 Background */ - ROM_LOAD( "u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) ) + ROM_LOAD( "a-19.u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) ) ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT) /* 8x8x8 Foreground */ - ROM_LOAD( "u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) ) - ROM_LOAD( "u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) ) + ROM_LOAD( "a-19.u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) ) + ROM_LOAD( "a-19.u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) ) ROM_REGION( 0x40000, "gfx4", ROMREGION_INVERT) /* 8x8x8 Midground */ - ROM_LOAD( "u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) ) - ROM_LOAD( "u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) ) + ROM_LOAD( "a-19.u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) ) + ROM_LOAD( "a-19.u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) ) ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */ - ROM_LOAD( "u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) ) + ROM_LOAD( "a-19.u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) ) ROM_REGION( 0x80000, "oki2", 0 ) /* Samples (banked) */ - ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) + ROM_LOAD( "a-19.u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) ROM_END -/* Same board ID as main set, Escape labels on all ROMs - Suspect this is actually the newest revision due to improved slot - machine animation on 'girl select' compared to other sets */ -ROM_START( paradisee ) +ROM_START( paradisee ) /* YS-1600 PCB. All labels are simply labeled "Escape" */ ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ - ROM_LOAD( "Escape.U128", 0x00000, 0x40000, CRC(19b4e854) SHA1(7d7292017df67b7ed3a3e0059334866890c58b83) ) + ROM_LOAD( "escape.U128", 0x00000, 0x40000, CRC(19b4e854) SHA1(7d7292017df67b7ed3a3e0059334866890c58b83) ) ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */ - ROM_LOAD( "u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) ) - ROM_LOAD( "u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) ) + ROM_LOAD( "escape.u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) ) + ROM_LOAD( "escape.u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) ) ROM_REGION( 0x20000, "gfx2", ROMREGION_INVERT) /* 8x8x4 Background */ - ROM_LOAD( "u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) ) + ROM_LOAD( "escape.u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) ) ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT) /* 8x8x8 Foreground */ - ROM_LOAD( "u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) ) - ROM_LOAD( "u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) ) + ROM_LOAD( "escape.u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) ) + ROM_LOAD( "escape.u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) ) ROM_REGION( 0x40000, "gfx4", ROMREGION_INVERT) /* 8x8x8 Midground */ - ROM_LOAD( "u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) ) - ROM_LOAD( "u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) ) + ROM_LOAD( "escape.u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) ) + ROM_LOAD( "escape.u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) ) ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */ - ROM_LOAD( "u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) ) + ROM_LOAD( "escape.u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) ) ROM_REGION( 0x80000, "oki2", 0 ) /* Samples (banked) */ - ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) + ROM_LOAD( "escape.u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) ) ROM_END ROM_START( paradlx ) @@ -925,8 +924,6 @@ ROM_START( paradlx ) ROM_LOAD( "9.u113", 0x00000, 0x80000, CRC(9c5337f0) SHA1(4d7a8069be4551aad9d7d32d835dcf91be079359) ) ROM_END - - ROM_START( para2dx ) ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */ ROM_LOAD( "pdx2_u128.bin", 0x00000, 0x40000, CRC(4cbd22e1) SHA1(ad69663109d3127f6472797ec8763097da94b7d4) ) @@ -1310,14 +1307,14 @@ DRIVER_INIT_MEMBER(paradise_state,torus) ***************************************************************************/ -GAME( 1994, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise", GAME_SUPPORTS_SAVE ) -GAME( 1994, paradisea, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 2)", GAME_SUPPORTS_SAVE ) -GAME( 1994, paradisee, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (Escape)", GAME_SUPPORTS_SAVE ) -GAME( 199?, paradlx, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // " -GAME( 199?, para2dx, 0, paradise, para2dx, paradise_state, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // " -GAME( 1995, tgtball, 0, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE ) -GAME( 1995, tgtballa, tgtball, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball", GAME_SUPPORTS_SAVE ) -GAME( 1996, penky, 0, penky, penky, paradise_state, tgtball, ROT0, "Yun Sung", "Penky", GAME_SUPPORTS_SAVE ) -GAME( 1996, torus, 0, torus, torus, paradise_state, torus, ROT90, "Yun Sung", "Torus", GAME_SUPPORTS_SAVE ) -GAME( 1998, madball, 0, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0", GAME_SUPPORTS_SAVE ) -GAME( 1997, madballn, madball, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0 (With Nudity)", GAME_SUPPORTS_SAVE ) +GAME( 1994, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1994, paradisea, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 2)", GAME_SUPPORTS_SAVE ) +GAME( 1994, paradisee, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (Escape)", GAME_SUPPORTS_SAVE ) +GAME( 199?, paradlx, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994 +GAME( 199?, para2dx, 0, paradise, para2dx, paradise_state, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994 +GAME( 1995, tgtball, 0, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE ) +GAME( 1995, tgtballa, tgtball, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball", GAME_SUPPORTS_SAVE ) +GAME( 1996, penky, 0, penky, penky, paradise_state, tgtball, ROT0, "Yun Sung", "Penky", GAME_SUPPORTS_SAVE ) +GAME( 1996, torus, 0, torus, torus, paradise_state, torus, ROT90, "Yun Sung", "Torus", GAME_SUPPORTS_SAVE ) +GAME( 1998, madball, 0, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0", GAME_SUPPORTS_SAVE ) +GAME( 1997, madballn, madball, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0 (With Nudity)", GAME_SUPPORTS_SAVE ) From 2b0255cdcfa5b11c724462200a7fe8c10015c967 Mon Sep 17 00:00:00 2001 From: briantro Date: Wed, 3 Jun 2015 19:24:36 -0500 Subject: [PATCH 137/284] paradise.c: Add a note about the other data being the same. - NW --- src/mame/drivers/paradise.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index 3dfb7e7e5c1..a43b3de520d 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -815,7 +815,9 @@ Paradise (set 2): No board ID, although some tracks which are wire hacks on Except for the program rom all other data matches Paradise (set 1). The Escape version might be the newest revision due to improved slot machine - animation on 'girl select' compared to other sets. + animation on 'girl select' compared to other sets. Except for the program + rom all other data matches Paradise (set 1). + NOTE: on this version of the PCB the above listed 4MHz OSC is repleace with a 3.579545MHz OSC ***************************************************************************/ From b107d24417d81f51e337710dae7a20cb2b9fbb43 Mon Sep 17 00:00:00 2001 From: briantro Date: Wed, 3 Jun 2015 19:29:42 -0500 Subject: [PATCH 138/284] paradise.c: Spelling, and set 2 is the PCB with different OSC. From the pic of the PCB for the Escape version it's not clear if the OSC is 4MHz or 3.579545MHz OSC --- src/mame/drivers/paradise.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index a43b3de520d..345048ec733 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -813,13 +813,12 @@ used left a "1994.8-1989" in the rom Paradise (set 2): No board ID, although some tracks which are wire hacks on YS-1600 PCB are corrected on this version. All roms are labeled as "A-19" Except for the program rom all other data matches Paradise (set 1). + NOTE: on this version of the PCB the above listed 4MHz OSC is replaced with + a 3.579545MHz OSC The Escape version might be the newest revision due to improved slot machine animation on 'girl select' compared to other sets. Except for the program rom all other data matches Paradise (set 1). - - NOTE: on this version of the PCB the above listed 4MHz OSC is repleace with - a 3.579545MHz OSC ***************************************************************************/ ROM_START( paradise ) From 6ca2937f70e0a526fa10b7f10dd64c4c0f62dc8a Mon Sep 17 00:00:00 2001 From: Stiletto Date: Wed, 3 Jun 2015 23:14:33 -0400 Subject: [PATCH 139/284] more games to gamelist (nw) more games to gamelist (nw) --- src/mame/drivers/aleisttl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mame/drivers/aleisttl.c b/src/mame/drivers/aleisttl.c index c9efe1a854b..1192b740f2f 100644 --- a/src/mame/drivers/aleisttl.c +++ b/src/mame/drivers/aleisttl.c @@ -4,8 +4,17 @@ Allied Leisure discrete hardware games + Chase (aka Chase1) (1976) + Deluxe Soccer (1973) + Fire Power (1975) + Fütsball (1975) + Galaxy Raider (1974) Hesitation (1974) AL-6500? + Hockey, Soccer, Tennis (1974) + Improbable (1974) + Knock Ball (1974) Paddle Battle (1973) + Ric-O-Chet (1973) Robot (1975) AL-7500 Ski (1975) Street Burners (1975) URL-8300 From d02e90482618d560ef1807d14d3d0be782f9606e Mon Sep 17 00:00:00 2001 From: Stiletto Date: Wed, 3 Jun 2015 23:18:22 -0400 Subject: [PATCH 140/284] updates to game list (nw) updates to game list (nw) --- src/mame/drivers/bailey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mame/drivers/bailey.c b/src/mame/drivers/bailey.c index 4ccf874269d..9ba1600648f 100644 --- a/src/mame/drivers/bailey.c +++ b/src/mame/drivers/bailey.c @@ -4,7 +4,10 @@ Bailey International discrete hardware games + Fighter Squadron (1976) Fun Four (1976) + Missile Command (1976) + Sebring (1976) ***************************************************************************/ From 1f840aa1bf8a93997193d19f4e5702a479e4c280 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Wed, 3 Jun 2015 23:21:51 -0400 Subject: [PATCH 141/284] updates to game list (nw) updates to game list (nw) --- src/mame/drivers/electra.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/electra.c b/src/mame/drivers/electra.c index 9dde18b782a..4ef8ee27d09 100644 --- a/src/mame/drivers/electra.c +++ b/src/mame/drivers/electra.c @@ -5,12 +5,15 @@ Electra discrete hardware games Game Name - Avenger (1975) EG-1020 + Avenger (1975) EG-1020 + Combo 3 (Tennis, Soccer, Hockey) (1975) Eliminator IV (1976) - Flying Fortress (1976) EG-1060 (Taito same name?) - Pace Car Pro (1975) EG-1000 - UFO Chase (1975) EG-1010 - Wings (1976) + Flying Fortress (1976) EG-1060 (Taito same name?) + Knockout (1975) + Pace Car Pro (1975) EG-1000 + Pace Race (1974?) + UFO Chase (1975) EG-1010 + Wings / Wings Cocktail (1976) ***************************************************************************/ From b4cf7a2121b41e63f2added35443481cdbe7d982 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Wed, 3 Jun 2015 23:28:41 -0400 Subject: [PATCH 142/284] updates to game list (nw) updates to game list (nw) --- src/mame/drivers/meadwttl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/meadwttl.c b/src/mame/drivers/meadwttl.c index 4313a7740c8..4aa84777f65 100644 --- a/src/mame/drivers/meadwttl.c +++ b/src/mame/drivers/meadwttl.c @@ -5,11 +5,15 @@ Meadows Discrete Game List Bombs Away (1976) + Bonkers (1977) Ckidzo (1976) Cobra Gunship (1976) Drop Zone 4 (1975) Flim Flam (1974) - 4 in 1 Meadows (197?) + Gridiron (1977) + Knock-Out (1977) + Meadows 4 in 1 (197?) + Star Shooter (1975) ***************************************************************************/ From 27c041b7f345872a594371dd679ac03e98a5df9a Mon Sep 17 00:00:00 2001 From: Stiletto Date: Wed, 3 Jun 2015 23:33:42 -0400 Subject: [PATCH 143/284] minor gamelist fix (nw) minor gamelist fix (nw) --- src/mame/drivers/ramtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/ramtek.c b/src/mame/drivers/ramtek.c index a7d0683580d..556ab3bd2f4 100644 --- a/src/mame/drivers/ramtek.c +++ b/src/mame/drivers/ramtek.c @@ -25,8 +25,8 @@ Game Name Clone Of --------------------------------------------------------------------------------- Batter Up (1974/??) Baseball (1974/10) - Crossfire (1974/01) (registered trademark?) Knock Out (Ramtek, 1974/09)? Countdown (1974/02) Wipe Out (Ramtek, 1974/01) + Crossfire (1974/01) (registered trademark?) Knock Out (Ramtek, 1974/09)? Elimination (1973/12?) (registered trademark?) unused name for Countdown (1974/02) Flip-Out (1974/05?) Clean Sweep (Ramtek, 1974/06) Hockey (1973/??) Hockey (Ramtek, 1973/11) From 27f0ed319d12c9bcf56495d5bc1b5834eee6dcc5 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Wed, 3 Jun 2015 23:50:34 -0400 Subject: [PATCH 144/284] update game list (nw) update game list (nw) --- src/mame/drivers/pse.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/pse.c b/src/mame/drivers/pse.c index d24aca5a0d0..a1408b00c3c 100644 --- a/src/mame/drivers/pse.c +++ b/src/mame/drivers/pse.c @@ -4,12 +4,21 @@ Project Support Engineering Games - Game Name DATA - -------------------------------- - Maneater (1975) YES - Knights in Armor (1976) YES - Desert Patrol (1977) YES - Game Tree (1978) YES + Game Name DATA + ------------------------------------- + 1-2-4 Cocktail Table (197?) UNKNOWN + Bazooka (1977) YES + Desert Patrol (1977) YES + Espana (cabinet) (197?) NO + Frenzy (1975) UNKNOWN + Game Tree (1978) YES + Hodge Podge (197?) UNKNOWN + Knights in Armor (1976) YES + Maneater (1975) YES + Play Five (1975?) UNKNOWN + Scandia (cabinet) (1975) NO + Two Game (1974) UNKNOWN + U.N. Command (1977) UNKNOWN ***************************************************************************/ From 80cecbfa9dc819d443061bb9f7716a87d44f27fb Mon Sep 17 00:00:00 2001 From: Stiletto Date: Thu, 4 Jun 2015 00:03:52 -0400 Subject: [PATCH 145/284] update to game list (nw) update to game list (nw) --- src/mame/drivers/exidyttl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/exidyttl.c b/src/mame/drivers/exidyttl.c index 5ae9538d674..a854c8e8d92 100644 --- a/src/mame/drivers/exidyttl.c +++ b/src/mame/drivers/exidyttl.c @@ -8,10 +8,13 @@ Exidy discrete hardware games Attack (1977) Death Race (1976) Destruction Derby (1975) - Spiders From Space (1976) + Hockey / Tennis (Thumper Bumper?) (1974) Score (1977) + Spiders From Space (1976) + Sting (1974) Super Death Chase (1977) - Table Football (1975) + Table Foosballer / Table Football (1975) + Table Pinball (1974) TV Pinball (1974) ***************************************************************************/ From f0979b157dfba14328be58df9a2920d476acaeff Mon Sep 17 00:00:00 2001 From: Stiletto Date: Thu, 4 Jun 2015 00:31:55 -0400 Subject: [PATCH 146/284] update game list (nw) update game list (nw) --- src/mame/drivers/atarittl.c | 66 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/src/mame/drivers/atarittl.c b/src/mame/drivers/atarittl.c index 19b39e59306..533b3a1b2a7 100644 --- a/src/mame/drivers/atarittl.c +++ b/src/mame/drivers/atarittl.c @@ -16,43 +16,45 @@ Suspected "same games" are grouped together. These are usually the exact same game but different cabinet/name. - Technical Manual #s Game Name(s) Atari Part #'s Data PROM/ROM Chip Numbers - -------------------+----------------------------------------------------+----------------------------------+---------+--------------------------------------- - TM-025 Anti-Aircraft (1975) A000951 YES 003127 - TM-058 Breakout/Breakout Cocktail (1976) A004533 NO - TM-048 Crash 'N Score/Stock Car (1975) A004256 YES 003186(x2), 003187(x2), 004248, 004247 + Technical Manual #s Game Name(s) Atari Part #'s Data PROM/ROM Chip Numbers + -------------------+---------------------------------------------------------+----------------------------------+---------+--------------------------------------- + TM-025 Anti-Aircraft (1975) A000951 YES 003127 + TM-058 Breakout/Breakout Cocktail (1976) A004533 NO + TM-048 Crash 'N Score/Stock Car (1975) A004256 YES 003186(x2), 003187(x2), 004248, 004247 TM-030 Crossfire (1975) - TM-003,005,011,020 Gran Trak 10/Trak 10/Formula K/Race Circuit (1974) A000872,A000872 K3RT YES 74186 Racetrack Prom (K5) - TM-004,021 Gran Trak 20/Trak 20/Twin Racer (1974) A001791(RT20),A001793(A20-K4DRTA) YES 74186 Racetrack prom (K5) - TM-006,035 Goal 4/World Cup/Coupe De Monde (1975) A000823 NO - TM-016 Gotcha/Gotcha Color? (1973) A000816 NO - TM-028 Highway/Hi-Way (1975) A003211 NO - TM-055 Indy 4 (1976) A003000,A006268,A006270 YES 003186, 003187, 005502-01, 05503-01 - TM-026 Indy 800 (1975) A003000,A003170,A003182 YES 003186-003189 (4) - A003184,A003191,A003198,A003199 - TM-027 Jet Fighter/Jet Fighter Cocktail (1975) A004254,A004255 YES 004250-004252, 004253-01 to 03 (3) - TM-077 LeMans (1976) A005844,A005845 YES 005837-01, 005838-01, 005839-01 - TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4) - TM-007 Pin Pong (1974) A001660 NO - TM-013 Pong/Super Pong (1972) A001433,A000423 NO - TM-015 Pong Cocktail (1974) NO - TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO - TM-018 Pursuit (1975) K8P-B 90128 NO - TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO - TM-009 Qwak!/Quack (1974) A000937,A000953 YES 72074/37-2530N (K9) - TM-001,032 Rebound/Volleyball (1974) A000517,A000846 NO - TM-047 Shark Jaws (1975) A003806 YES 004182, 004183 - TM-008 Space Race (1974) A000803 NO - TM-023 Spike (1974) SPIKE-(A or B) NO - TM-046 Steeplechase/Astroturf (1975) A003750 YES 003774 ROM Bugle (C8), 003773-01 "A" Horse (C4), 003773-02 "B" Horse (D4) - TM-057 Stunt Cycle (1976) A004128 YES 004275 ROM Motorcycle/Bus (1F), 004811 ROM Score Translator (D7) - TM-010,036,049 Tank/Tank Cocktail/Tank II (1974/1975) A003111 (K5T-F 90124) YES 90-2006 + TM-003,005,011,020 Gran Trak 10/Trak 10/Formula K/Race Circuit (1974) A000872,A000872 K3RT YES 74186 Racetrack Prom (K5) + TM-004,021 Gran Trak 20/Trak 20/Twin Racer (1974) A001791(RT20),A001793(A20-K4DRTA) YES 74186 Racetrack prom (K5) + TM-006,035 Goal 4/World Cup/Coupe De Monde (1975) A000823 NO + TM-016 Gotcha/Gotcha Color? (1973) A000816 NO + TM-028 Highway/Hi-Way (1975) A003211 NO + TM-055 Indy 4 (1976) A003000,A006268,A006270 YES 003186, 003187, 005502-01, 05503-01 + TM-026 Indy 800 (1975) A003000,A003170,A003182 YES 003186-003189 (4) + A003184,A003191,A003198,A003199 + TM-027 Jet Fighter/Jet Fighter Cocktail/Launch Aircraft (1975) A004254,A004255 YES 004250-004252, 004253-01 to 03 (3) + TM-077 LeMans (1976) A005844,A005845 YES 005837-01, 005838-01, 005839-01 + TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4) + TM-007 Pin Pong (1974) A001660 NO + TM-013 Pong/Super Pong (1972) A001433,A000423 NO + TM-015 Pong Cocktail/Coup Franc (1974) NO + TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO + TM-018 Pursuit (1975) K8P-B 90128 NO + TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO + TM-009 Qwak!/Quack (1974) A000937,A000953 YES 72074/37-2530N (K9) + TM-001,032 Rebound/Volleyball (1974) A000517,A000846 NO + TM-047 Shark Jaws (1975) A003806 YES 004182, 004183 + TM-008 Space Race (1974) A000803 NO + TM-023 Spike (1974) SPIKE-(A or B) NO + TM-046 Steeplechase/Astroturf (1975) A003750 YES 003774 ROM Bugle (C8), 003773-01 "A" Horse (C4), 003773-02 "B" Horse (D4) + TM-057 Stunt Cycle (1976) A004128 YES 004275 ROM Motorcycle/Bus (1F), 004811 ROM Score Translator (D7) + TM-010,036,049 Tank/Tank Cocktail/Tank II (1974/1975) A003111 (K5T-F 90124) YES 90-2006 TM-002 Touch Me (1974) NO - Not Known to be released or produced, but at least announced. - TM-024 Qwakers (Not Produced/Released) - TM-017 World Cup Football (Not Produced/Released) + TM-0?? Arcade Driver/Driver First Person (Not Produced/Released) (197?) + TM-0?? Dodgeball/Dodgem (Not Produced/Released) (1975) + TM-024 Qwakers (Not Produced/Released) (1974?) + TM-017 World Cup Football (Not Produced/Released) (1974) ***************************************************************************/ From c7e970abb9a3e6cf85d6c1de3331abda78a35dc1 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Thu, 4 Jun 2015 15:50:22 +1000 Subject: [PATCH 147/284] Correction of author. --- src/mess/drivers/ht68k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/drivers/ht68k.c b/src/mess/drivers/ht68k.c index 3a6f0328b17..e8ba7cdcf81 100644 --- a/src/mess/drivers/ht68k.c +++ b/src/mess/drivers/ht68k.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Robbbert +// copyright-holders:Miodrag Milanovic /*************************************************************************** Hawthorne Technology TinyGiant HT68k From 93e0b86024cd841efb930d77b689836e22a14927 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Thu, 4 Jun 2015 08:56:46 +0300 Subject: [PATCH 148/284] (MESS) abc80: Fixed cassette crash. (nw) --- src/mess/drivers/abc80.c | 11 ++++++----- src/mess/includes/abc80.h | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mess/drivers/abc80.c b/src/mess/drivers/abc80.c index 3bafffb10fc..269be656b95 100644 --- a/src/mess/drivers/abc80.c +++ b/src/mess/drivers/abc80.c @@ -333,15 +333,15 @@ WRITE8_MEMBER( abc80_state::pio_pb_w ) // cassette motor if (BIT(data, 5)) { - if (!m_cassette_timer->enabled()) if (LOG) logerror("%s %s started cassette motor\n", machine().time().as_string(), machine().describe_context()); + if (!m_motor) if (LOG) logerror("%s %s started cassette motor\n", machine().time().as_string(), machine().describe_context()); m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); - m_cassette_timer->enable(true); + m_motor = true; } else { - if (m_cassette_timer->enabled()) if (LOG) logerror("%s %s stopped cassette motor\n", machine().time().as_string(), machine().describe_context()); + if (m_motor) if (LOG) logerror("%s %s stopped cassette motor\n", machine().time().as_string(), machine().describe_context()); m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); - m_cassette_timer->enable(false); + m_motor = false; } // cassette data @@ -420,6 +420,8 @@ void abc80_state::device_timer(emu_timer &timer, device_timer_id id, int param, case TIMER_ID_CASSETTE: { + if (!m_motor) return; + int tape_in = m_cassette->input() > 0; if (m_tape_in != tape_in) @@ -469,7 +471,6 @@ void abc80_state::machine_start() // start timers m_cassette_timer = timer_alloc(TIMER_ID_CASSETTE); m_cassette_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100)); - m_cassette_timer->enable(false); // register for state saving save_item(NAME(m_key_data)); diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h index 4e169b4903e..253ed7e757d 100644 --- a/src/mess/includes/abc80.h +++ b/src/mess/includes/abc80.h @@ -84,6 +84,7 @@ public: m_line_prom(*this, "line"), m_attr_prom(*this, "attr"), m_video_ram(*this, "video_ram"), + m_motor(false), m_tape_in(1), m_tape_in_latch(1) { } @@ -164,6 +165,7 @@ public: int m_blink; // cassette state + bool m_motor; int m_tape_in; int m_tape_in_latch; From 5f72cb409c6194a1eaca27bf7474d7082ccdc097 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Thu, 4 Jun 2015 09:09:16 +0300 Subject: [PATCH 149/284] (MESS) abc80: State saving. (nw) --- src/mess/drivers/abc80.c | 3 +++ src/mess/video/abc80.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mess/drivers/abc80.c b/src/mess/drivers/abc80.c index 269be656b95..b64cb786b44 100644 --- a/src/mess/drivers/abc80.c +++ b/src/mess/drivers/abc80.c @@ -476,6 +476,9 @@ void abc80_state::machine_start() save_item(NAME(m_key_data)); save_item(NAME(m_key_strobe)); save_item(NAME(m_pio_astb)); + save_item(NAME(m_latch)); + save_item(NAME(m_blink)); + save_item(NAME(m_motor)); save_item(NAME(m_tape_in)); save_item(NAME(m_tape_in_latch)); } diff --git a/src/mess/video/abc80.c b/src/mess/video/abc80.c index 66212688466..30272f3b0ea 100644 --- a/src/mess/video/abc80.c +++ b/src/mess/video/abc80.c @@ -179,10 +179,6 @@ void abc80_state::video_start() // allocate memory m_video_ram.allocate(0x400); - - // register for state saving - save_item(NAME(m_blink)); - save_item(NAME(m_latch)); } From 3a571779c0c0a47aeebde26256ac6f0e5c7223c3 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Thu, 4 Jun 2015 08:33:26 +0200 Subject: [PATCH 150/284] trs80: updated to use the new wd fdc --- scripts/src/lib.lua | 4 +- src/lib/formats/trs80_dsk.c | 55 +++++++++++++++++++ src/lib/formats/trs80_dsk.h | 36 ++++++++++++ src/lib/formats/trs_dsk.c | 80 --------------------------- src/lib/formats/trs_dsk.h | 20 ------- src/mess/drivers/trs80.c | 67 +++++++++++++---------- src/mess/includes/trs80.h | 17 ++++-- src/mess/machine/trs80.c | 106 ++++++++++-------------------------- 8 files changed, 171 insertions(+), 214 deletions(-) create mode 100644 src/lib/formats/trs80_dsk.c create mode 100644 src/lib/formats/trs80_dsk.h delete mode 100644 src/lib/formats/trs_dsk.c delete mode 100644 src/lib/formats/trs_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 5fc9603849e..49cfc2bc2f2 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -369,8 +369,8 @@ project "formats" MAME_DIR .. "src/lib/formats/trd_dsk.h", MAME_DIR .. "src/lib/formats/trs_cas.c", MAME_DIR .. "src/lib/formats/trs_cas.h", - MAME_DIR .. "src/lib/formats/trs_dsk.c", - MAME_DIR .. "src/lib/formats/trs_dsk.h", + MAME_DIR .. "src/lib/formats/trs80_dsk.c", + MAME_DIR .. "src/lib/formats/trs80_dsk.h", MAME_DIR .. "src/lib/formats/tvc_cas.c", MAME_DIR .. "src/lib/formats/tvc_cas.h", MAME_DIR .. "src/lib/formats/tvc_dsk.c", diff --git a/src/lib/formats/trs80_dsk.c b/src/lib/formats/trs80_dsk.c new file mode 100644 index 00000000000..acd122144d1 --- /dev/null +++ b/src/lib/formats/trs80_dsk.c @@ -0,0 +1,55 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + TRS-80 + + JV1 disk image format + + Used by Jeff Vavasour's TRS-80 Emulators + + TODO: + - Gap sizes unverified + +***************************************************************************/ + +#include "trs80_dsk.h" + +trs80_format::trs80_format() : wd177x_format(formats) +{ +} + +const char *trs80_format::name() const +{ + return "trs80"; +} + +const char *trs80_format::description() const +{ + return "TRS-80 JV1 disk image"; +} + +const char *trs80_format::extensions() const +{ + return "dsk"; +} + +int trs80_format::get_track_dam_fm(const format &f, int head, int track) +{ + return (track == 17 && head == 0) ? FM_DDAM : FM_DAM; +} + +const trs80_format::format trs80_format::formats[] = +{ + { + floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM, + 4000, 10, 35, 1, 256, {}, 0, {}, 14, 11, 12 + }, + { + floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM, + 4000, 10, 40, 1, 256, {}, 0, {}, 14, 11, 12 + }, + {} +}; + +const floppy_format_type FLOPPY_TRS80_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/trs80_dsk.h b/src/lib/formats/trs80_dsk.h new file mode 100644 index 00000000000..988d7ee2a7d --- /dev/null +++ b/src/lib/formats/trs80_dsk.h @@ -0,0 +1,36 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + TRS-80 + + JV1 disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __TRS80_DSK_H__ +#define __TRS80_DSK_H__ + +#include "wd177x_dsk.h" + +class trs80_format : public wd177x_format +{ +public: + trs80_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +protected: + virtual int get_track_dam_fm(const format &f, int head, int track); + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_TRS80_FORMAT; + +#endif // __TRS80_DSK_H__ diff --git a/src/lib/formats/trs_dsk.c b/src/lib/formats/trs_dsk.c deleted file mode 100644 index 2bb87173167..00000000000 --- a/src/lib/formats/trs_dsk.c +++ /dev/null @@ -1,80 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nathan Woods -#include -#include -#include "trs_dsk.h" -#include "basicdsk.h" -#include "coco_dsk.h" - -/* ----------------------------------------------------------------------- - * JV1 (Jeff Vavasour 1) format - * - * Used by Jeff Vavasour's TRS-80 Emulators - * - * Very straight basic disk; 1 head, 10 sectors, 256 sector length - * ----------------------------------------------------------------------- */ - -#define TRS80_JV1_HEADS 1 -#define TRS80_JV1_SECTORS 10 -#define TRS80_JV1_SECTORLENGTH 256 -#define TRS80_JV1_FIRSTSECTORID 0 - -static FLOPPY_IDENTIFY( trs80_jv1_identify ) -{ - UINT64 size; - size = floppy_image_size(floppy); - *vote = (size % (TRS80_JV1_HEADS * TRS80_JV1_SECTORS * TRS80_JV1_SECTORLENGTH)) - ? 0 : 100; - return FLOPPY_ERROR_SUCCESS; -} - - -static UINT64 trs80_jv1_get_ddam(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector) -{ - // directory track is protected - if ((track==17) && (head==0)) { - return ID_FLAG_DELETED_DATA; - } - return 0; -} - -static FLOPPY_CONSTRUCT( trs80_jv1_construct ) -{ - struct basicdsk_geometry geometry; - - memset(&geometry, 0, sizeof(geometry)); - geometry.heads = TRS80_JV1_HEADS; - geometry.sectors = TRS80_JV1_SECTORS; - geometry.first_sector_id = TRS80_JV1_FIRSTSECTORID; - geometry.sector_length = TRS80_JV1_SECTORLENGTH; - geometry.get_ddam = trs80_jv1_get_ddam; - - if (params) - { - /* create */ - geometry.tracks = option_resolution_lookup_int(params, PARAM_TRACKS); - } - else - { - /* load */ - geometry.tracks = (int) (floppy_image_size(floppy) / geometry.heads - / geometry.sectors / geometry.sector_length); - } - return basicdsk_construct(floppy, &geometry); -} - - - -/* ----------------------------------------------------------------------- */ - -LEGACY_FLOPPY_OPTIONS_START( trs80 ) - LEGACY_FLOPPY_OPTION( trs80_jv1, "dsk", "TRS-80 JV1 disk image", trs80_jv1_identify, trs80_jv1_construct, NULL, - TRACKS([35]-255)) - LEGACY_FLOPPY_OPTION( trs80_dmk, "dsk,dmk", "TRS-80 DMK disk image", coco_dmk_identify, coco_dmk_construct, NULL, - HEADS([1]-2) - TRACKS([35]-255) - SECTORS(1-[10]-18) - SECTOR_LENGTH(128/[256]/512/1024/2048/4096/8192) - INTERLEAVE(0-[6]-17) - FIRST_SECTOR_ID([0]-1)) -LEGACY_FLOPPY_OPTIONS_END diff --git a/src/lib/formats/trs_dsk.h b/src/lib/formats/trs_dsk.h deleted file mode 100644 index a33cec6872b..00000000000 --- a/src/lib/formats/trs_dsk.h +++ /dev/null @@ -1,20 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nathan Woods -/********************************************************************* - - formats/trs_dsk.h - - TRS-80 disk images - -*********************************************************************/ - -#ifndef TRS_DSK_H -#define TRS_DSK_H - -#include "flopimg.h" - -/**************************************************************************/ - -LEGACY_FLOPPY_OPTIONS_EXTERN( trs80 ); - -#endif /* TRS_DSK_H */ diff --git a/src/mess/drivers/trs80.c b/src/mess/drivers/trs80.c index c57784bedc1..cccffe4f349 100644 --- a/src/mess/drivers/trs80.c +++ b/src/mess/drivers/trs80.c @@ -136,6 +136,8 @@ There don't seem to be any JV1 boot disks for Model III/4. ***************************************************************************/ #include "includes/trs80.h" +#include "formats/trs80_dsk.h" +#include "formats/dmk_dsk.h" static ADDRESS_MAP_START( trs80_map, AS_PROGRAM, 8, trs80_state ) @@ -158,10 +160,10 @@ static ADDRESS_MAP_START( model1_map, AS_PROGRAM, 8, trs80_state ) AM_RANGE(0x37e4, 0x37e7) AM_WRITE(trs80_cassunit_w) AM_RANGE(0x37e8, 0x37eb) AM_READWRITE(trs80_printer_r, trs80_printer_w) AM_RANGE(0x37ec, 0x37ec) AM_READ(trs80_wd179x_r) - AM_RANGE(0x37ec, 0x37ec) AM_DEVWRITE("wd179x", fd1793_device, command_w) - AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w) - AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w) - AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w) + AM_RANGE(0x37ec, 0x37ec) AM_DEVWRITE("fdc", fd1793_t, cmd_w) + AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w) + AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w) + AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w) AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x300) AM_READ(trs80_keyboard_r) AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(trs80_videoram_r, trs80_videoram_w) AM_SHARE("p_videoram") AM_RANGE(0x4000, 0xffff) AM_RAM @@ -208,10 +210,10 @@ static ADDRESS_MAP_START( model3_io, AS_IO, 8, trs80_state ) AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w) AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w) AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r) - AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w) - AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w) - AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w) - AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w) + AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w) + AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w) + AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w) + AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w) AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w) AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w) AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w) @@ -230,10 +232,10 @@ static ADDRESS_MAP_START( model4_io, AS_IO, 8, trs80_state ) AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w) AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w) AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r) - AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w) - AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w) - AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w) - AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w) + AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w) + AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w) + AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w) + AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w) AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w) AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w) AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w) @@ -253,10 +255,10 @@ static ADDRESS_MAP_START( model4p_io, AS_IO, 8, trs80_state ) AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w) AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w) AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r) - AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w) - AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w) - AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w) - AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w) + AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w) + AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w) + AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w) + AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w) AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w) AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w) AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w) @@ -277,10 +279,10 @@ static ADDRESS_MAP_START( meritum_io, AS_IO, 8, trs80_state ) // eg. port F0 should be 5, port F2 should have bit 3 set. //AM_RANGE(0x03, 0x03) unknown AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r) - AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w) - AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w) - AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w) - AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w) + AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w) + AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w) + AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w) + AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w) AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w) AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w) //AM_RANGE(0xfc, 0xfd) unknown @@ -545,12 +547,15 @@ static GFXDECODE_START(meritum) GFXDECODE_END -static const floppy_interface trs80_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(trs80), - NULL -}; +FLOPPY_FORMATS_MEMBER( trs80_state::floppy_formats ) + FLOPPY_TRS80_FORMAT, + FLOPPY_DMK_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( trs80_floppies ) + SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( trs80, trs80_state ) // the original model I, level I, with no extras /* basic machine hardware */ @@ -595,11 +600,13 @@ static MACHINE_CONFIG_DERIVED( model1, trs80 ) // model I, level II MCFG_QUICKLOAD_ADD("quickload", trs80_state, trs80_cmd, "cmd", 0.5) - MCFG_DEVICE_ADD("wd179x", FD1793, 0) // should be FD1771 or FD1791 but inverted data lines are too tricky to fix now - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(trs80_state,trs80_fdc_intrq_w)) + MCFG_FD1793x_ADD("fdc", XTAL_1MHz) // todo: should be fd1771 + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(trs80_state,trs80_fdc_intrq_w)) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(trs80_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", trs80_floppies, "sssd", trs80_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", trs80_floppies, "sssd", trs80_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:2", trs80_floppies, "", trs80_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:3", trs80_floppies, "", trs80_state::floppy_formats) MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) diff --git a/src/mess/includes/trs80.h b/src/mess/includes/trs80.h index 62925ff3a7c..e4ced5999ab 100644 --- a/src/mess/includes/trs80.h +++ b/src/mess/includes/trs80.h @@ -16,12 +16,11 @@ #include "machine/ay31015.h" #include "machine/buffer.h" #include "bus/centronics/ctronics.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "imagedev/cassette.h" #include "imagedev/flopdrv.h" #include "imagedev/snapquik.h" #include "formats/trs_cas.h" -#include "formats/trs_dsk.h" class trs80_state : public driver_device @@ -34,7 +33,11 @@ public: m_cent_data_out(*this, "cent_data_out"), m_cent_status_in(*this, "cent_status_in"), m_ay31015(*this, "tr1602"), - m_fdc(*this, "wd179x"), + m_fdc(*this, "fdc"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), + m_floppy2(*this, "fdc:2"), + m_floppy3(*this, "fdc:3"), m_speaker(*this, "speaker"), m_cassette(*this, "cassette"), m_p_videoram(*this, "p_videoram"), @@ -67,12 +70,18 @@ public: m_bank18(NULL), m_bank19(NULL) { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; optional_device m_centronics; optional_device m_cent_data_out; optional_device m_cent_status_in; optional_device m_ay31015; - optional_device m_fdc; + optional_device m_fdc; + optional_device m_floppy0; + optional_device m_floppy1; + optional_device m_floppy2; + optional_device m_floppy3; required_device m_speaker; required_device m_cassette; DECLARE_WRITE8_MEMBER ( trs80_ff_w ); diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c index e87ece1c1d1..980176e109e 100644 --- a/src/mess/machine/trs80.c +++ b/src/mess/machine/trs80.c @@ -490,8 +490,6 @@ WRITE8_MEMBER( trs80_state::trs80m4_ec_w ) m_port_ec = data & 0x7e; } -WRITE8_MEMBER( trs80_state::trs80m4_f4_w ) -{ /* Selection of drive and parameters - d6..d5 not emulated. A write also causes the selected drive motor to turn on for about 3 seconds. When the motor turns off, the drive is deselected. @@ -503,36 +501,24 @@ WRITE8_MEMBER( trs80_state::trs80m4_f4_w ) d2 1=select drive 2 d1 1=select drive 1 d0 1=select drive 0 */ +WRITE8_MEMBER( trs80_state::trs80m4_f4_w ) +{ + floppy_image_device *floppy = NULL; - UINT8 drive = 255; + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); + if (BIT(data, 2)) floppy = m_floppy2->get_device(); + if (BIT(data, 3)) floppy = m_floppy3->get_device(); - if (data & 1) - drive = 0; - else - if (data & 2) - drive = 1; - else - if (data & 4) - drive = 2; - else - if (data & 8) - drive = 3; + m_fdc->set_floppy(floppy); - m_head = (data & 16) ? 1 : 0; - - if (drive < 4) + if (floppy) { - m_fdc->set_drive(drive); - m_fdc->set_side(m_head); + floppy->mon_w(0); + floppy->ss_w(BIT(data, 4)); } m_fdc->dden_w(!BIT(data, 7)); - - /* CLEAR_LINE means to turn motors on */ - floppy_get_device(machine(), 0)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE); - floppy_get_device(machine(), 1)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE); - floppy_get_device(machine(), 2)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE); - floppy_get_device(machine(), 3)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE); } WRITE8_MEMBER( trs80_state::sys80_f8_w ) @@ -578,10 +564,10 @@ WRITE8_MEMBER( trs80_state::lnw80_fe_w ) mem.install_readwrite_handler (0x37e0, 0x37e3, read8_delegate(FUNC(trs80_state::trs80_irq_status_r), this), write8_delegate(FUNC(trs80_state::trs80_motor_w), this)); mem.install_readwrite_handler (0x37e8, 0x37eb, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this)); mem.install_read_handler (0x37ec, 0x37ec, read8_delegate(FUNC(trs80_state::trs80_wd179x_r), this)); - mem.install_write_handler (0x37ec, 0x37ec, write8_delegate(FUNC(fd1793_device::command_w),(fd1793_device*)m_fdc)); - mem.install_readwrite_handler (0x37ed, 0x37ed, read8_delegate(FUNC(fd1793_device::track_r),(fd1793_device*)m_fdc), write8_delegate(FUNC(fd1793_device::track_w),(fd1793_device*)m_fdc)); - mem.install_readwrite_handler (0x37ee, 0x37ee, read8_delegate(FUNC(fd1793_device::sector_r),(fd1793_device*)m_fdc), write8_delegate(FUNC(fd1793_device::sector_w),(fd1793_device*)m_fdc)); - mem.install_readwrite_handler (0x37ef, 0x37ef, read8_delegate(FUNC(fd1793_device::data_r),(fd1793_device*)m_fdc),write8_delegate( FUNC(fd1793_device::data_w),(fd1793_device*)m_fdc)); + mem.install_write_handler (0x37ec, 0x37ec, write8_delegate(FUNC(fd1793_t::cmd_w),(fd1793_t*)m_fdc)); + mem.install_readwrite_handler (0x37ed, 0x37ed, read8_delegate(FUNC(fd1793_t::track_r),(fd1793_t*)m_fdc), write8_delegate(FUNC(fd1793_t::track_w),(fd1793_t*)m_fdc)); + mem.install_readwrite_handler (0x37ee, 0x37ee, read8_delegate(FUNC(fd1793_t::sector_r),(fd1793_t*)m_fdc), write8_delegate(FUNC(fd1793_t::sector_w),(fd1793_t*)m_fdc)); + mem.install_readwrite_handler (0x37ef, 0x37ef, read8_delegate(FUNC(fd1793_t::data_r),(fd1793_t*)m_fdc),write8_delegate( FUNC(fd1793_t::data_w),(fd1793_t*)m_fdc)); mem.install_read_handler (0x3800, 0x38ff, 0, 0x0300, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this)); mem.install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this)); } @@ -745,59 +731,23 @@ READ8_MEMBER( trs80_state::trs80_irq_status_r ) WRITE8_MEMBER( trs80_state::trs80_motor_w ) { - UINT8 drive = 255; + floppy_image_device *floppy = NULL; - switch (data) + if (BIT(data, 0)) floppy = m_floppy0->get_device(); + if (BIT(data, 1)) floppy = m_floppy1->get_device(); + if (BIT(data, 2)) floppy = m_floppy2->get_device(); + if (BIT(data, 3)) floppy = m_floppy3->get_device(); + + m_fdc->set_floppy(floppy); + + if (floppy) { - case 1: - drive = 0; - m_head = 0; - break; - case 2: - drive = 1; - m_head = 0; - break; - case 4: - drive = 2; - m_head = 0; - break; - case 8: - drive = 3; - m_head = 0; - break; - /* These 3 combinations aren't official. Some manufacturers of double-sided disks - used drive select 4 to indicate the other side. */ - case 9: - drive = 0; - m_head = 1; - break; - case 10: - drive = 1; - m_head = 1; - break; - case 12: - drive = 2; - m_head = 1; - break; + floppy->mon_w(0); + floppy->ss_w(BIT(data, 4)); } - if (drive > 3) - { /* Turn motors off */ - floppy_get_device(machine(), 0)->floppy_mon_w(ASSERT_LINE); - floppy_get_device(machine(), 1)->floppy_mon_w(ASSERT_LINE); - floppy_get_device(machine(), 2)->floppy_mon_w(ASSERT_LINE); - floppy_get_device(machine(), 3)->floppy_mon_w(ASSERT_LINE); - return; - } - - m_fdc->set_drive(drive); - m_fdc->set_side(m_head); - - /* Turn motors on */ - floppy_get_device(machine(), 0)->floppy_mon_w(CLEAR_LINE); - floppy_get_device(machine(), 1)->floppy_mon_w(CLEAR_LINE); - floppy_get_device(machine(), 2)->floppy_mon_w(CLEAR_LINE); - floppy_get_device(machine(), 3)->floppy_mon_w(CLEAR_LINE); + // switch to fm + m_fdc->dden_w(1); } /************************************* From 5151a3476672b785b68fff6495561134b5c68839 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 4 Jun 2015 08:47:22 +0200 Subject: [PATCH 151/284] apparently tab after gamename causes parser error --- src/mame/arcade.lst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 936905bc904..c500948db04 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -670,7 +670,7 @@ phoenixb // (c) 1980 Amstar + Centuri license phoenixt // (c) 1980 Taito phoenixj // (c) 1980 Taito phoenix3 // bootleg -phoenixdal // bootleg D&L (No copyright/title) +phoenixdal // bootleg D&L (No copyright/title) phoenixc // bootleg phoenixc2 // bootleg phoenixc3 // bootleg @@ -730,7 +730,7 @@ nrallyx // (c) 1981 Namco nrallyxb // (c) 1981 Namco jungler // GX327 (c) 1981 Konami junglers // GX327 (c) 1981 Stern -jackler // 1 9 8 2 (Jungler Bootleg) +jackler // 1 9 8 2 (Jungler Bootleg) savanna // Olympia (c) 1982 (Jungler bootleg) tactcian // GX335 (c) 1982 Sega tactcian2 // GX335 (c) 1981 Sega @@ -1788,13 +1788,13 @@ horizon // (c) 1985 youjyudn // (c) 1986 (Japan) vigilant // (c) 1988 (World Rev E) -vigilanta // (c) 1988 (World Rev A) +vigilanta // (c) 1988 (World Rev A) vigilantb // (c) 1988 (US Rev B) -vigilantc // (c) 1988 (World Rev C) +vigilantc // (c) 1988 (World Rev C) vigilantd // (c) 1988 (Japan Rev D) -vigilantg // (c) 1988 (US Rev G) -vigilano // (c) 1988 (US) -vigilanbl // bootleg +vigilantg // (c) 1988 (US Rev G) +vigilano // (c) 1988 (US) +vigilanbl // bootleg kikcubic // (c) 1988 (Japan) kikcubicb // bootleg buccanrs // (c) 1989 Duintronic @@ -3015,8 +3015,8 @@ sidearmsj // 12/1986 (c) 1986 (Japan) turtship // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) turtshipj // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) turtshipk // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -turtshipko // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) -turtshipkn // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtshipko // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) +turtshipkn // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) dyger // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) dygera // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware) twinfalc // (c) 1989 Philko (Poara Enterprises license) (NOT A CAPCOM GAME but runs on modified Sidearms hardware) @@ -6639,7 +6639,7 @@ overdriva // GX789 (c) 1990 overdrivb // GX789 (c) 1990 gradius3 // GX945 (c) 1989 (World) gradius3j // GX945 (c) 1989 (Japan) -gradius3js // GX945 (c) 1989 (Japan, split) +gradius3js // GX945 (c) 1989 (Japan, split) gradius3a // GX945 (c) 1989 (Asia) // Konami 68020 games @@ -9372,7 +9372,7 @@ missmw96 // (c) 1996 Comad smissw // fantsia2 // (c) 1997 Comad fantsia2a // (c) 1997 Comad -fantsia2n // (c) 1998 Comad +fantsia2n // (c) 1998 Comad wownfant // (c) 2002 Comad pgalvip // (c) 1996 ACE International (Afega stickers on ROMs) pgalvipa // @@ -9483,8 +9483,8 @@ suprridr // (c) 1983 Venture Line + Taito license // Yun Sung games paradise // (c) 1994 Yun Sung -paradisea // (c) 1994 Yun Sung -paradisee // (c) 1994 Yun Sung (Escape license) +paradisea // (c) 1994 Yun Sung +paradisee // (c) 1994 Yun Sung (Escape license) paradlx // (c) >1994 Yun Sung para2dx // (c) >1994 Yun Sung penky // (c) 1995 Yun Sung From 67786d002210813f2a79b7ccdc50fdd084997d8c Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 4 Jun 2015 08:55:10 +0200 Subject: [PATCH 152/284] penta/vastar company correction from JJBoy --- src/mame/drivers/paradise.c | 2 +- src/mame/drivers/pengo.c | 2 +- src/mame/drivers/vastar.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index 345048ec733..3a3b05b38e4 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -1310,7 +1310,7 @@ DRIVER_INIT_MEMBER(paradise_state,torus) GAME( 1994, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 1)", GAME_SUPPORTS_SAVE ) GAME( 1994, paradisea, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 2)", GAME_SUPPORTS_SAVE ) -GAME( 1994, paradisee, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (Escape)", GAME_SUPPORTS_SAVE ) +GAME( 1994, paradisee, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung (Escape license)", "Paradise (Escape)", GAME_SUPPORTS_SAVE ) GAME( 199?, paradlx, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994 GAME( 199?, para2dx, 0, paradise, para2dx, paradise_state, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994 GAME( 1995, tgtball, 0, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c index 9426df6a282..3548c5b2580 100644 --- a/src/mame/drivers/pengo.c +++ b/src/mame/drivers/pengo.c @@ -723,5 +723,5 @@ GAME( 1982, pengo2u, pengo, pengo, pengo, driver_device, 0, ROT90, "Sega GAME( 1982, pengo3u, pengo, pengo, pengo, driver_device, 0, ROT90, "Sega", "Pengo (set 3 not encrypted)", GAME_SUPPORTS_SAVE ) GAME( 1982, pengo4, pengo, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 4)", GAME_SUPPORTS_SAVE ) GAME( 1982, pengob, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg", "Pengo (bootleg)", GAME_SUPPORTS_SAVE ) -GAME( 1982, penta, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg", "Penta", GAME_SUPPORTS_SAVE ) +GAME( 1982, penta, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg (Grinbee Shouji)", "Penta", GAME_SUPPORTS_SAVE ) // Grinbee Shouji was a subsidiary of Orca GAME( 1983, jrpacmbl, jrpacman, jrpacmbl, jrpacmbl, driver_device, 0, ROT90, "bootleg", "Jr. Pac-Man (Pengo hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/vastar.c b/src/mame/drivers/vastar.c index 28b5d9ebb11..891e030878a 100644 --- a/src/mame/drivers/vastar.c +++ b/src/mame/drivers/vastar.c @@ -643,8 +643,8 @@ ROM_START( pprobe ) ROM_END -GAME( 1983, vastar, 0, vastar, vastar, driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 1)", 0 ) -GAME( 1983, vastar2, vastar, vastar, vastar, driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 2)", 0 ) -GAME( 1983, vastar3, vastar, vastar, vastar, driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 3)", 0 ) -GAME( 1983, vastar4, vastar, vastar, vastar4,driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 4)", 0 ) +GAME( 1983, vastar, 0, vastar, vastar, driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 1)", 0 ) // Sesame Japan was a brand of Fujikousan +GAME( 1983, vastar2, vastar, vastar, vastar, driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 2)", 0 ) +GAME( 1983, vastar3, vastar, vastar, vastar, driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 3)", 0 ) +GAME( 1983, vastar4, vastar, vastar, vastar4,driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 4)", 0 ) GAME( 1985, pprobe, 0, vastar, pprobe, driver_device, 0, ROT90, "Crux / Kyugo?", "Planet Probe (prototype?)", 0 ) // has no Copyright, probably because Crux didn't have a trading name at this point? From 8d34522ee877032d02b43bb4f72bb2391d0a23ea Mon Sep 17 00:00:00 2001 From: Stiletto Date: Thu, 4 Jun 2015 03:02:31 -0400 Subject: [PATCH 153/284] update game list (nw) update game list (nw) --- src/mame/drivers/taitottl.c | 99 +++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/src/mame/drivers/taitottl.c b/src/mame/drivers/taitottl.c index 244e991f942..c0b7d3ee456 100644 --- a/src/mame/drivers/taitottl.c +++ b/src/mame/drivers/taitottl.c @@ -5,54 +5,57 @@ Taito Discrete Hardware Games - Game Name(s) Part #'s Data PROM/ROM Chip Numbers - ---------------------------------------------------------+--------------+---------+--------------------------------------- - Astro Race (11/1973) UNKNOWN - Attack (09/1976) UNKNOWN - Attack UFO (08/1974) UNKNOWN - Avenger (??/1976) (clone of Electra's Avenger) UNKNOWN - Ball Park/TT Ball Park (??/1974) UNKNOWN - Basketball (04/1974) UNKNOWN - Bombs Away (??/1977) UNKNOWN - Cisco/Fisco 400 (04/1977) UNKNOWN - Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) UNKNOWN - Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) UNKNOWN - Crashing Race (06/1976) UNKNOWN - Cross Fire (08/1977) (aka Bazooka) UNKNOWN - Davis Cup (12/1973) UNKNOWN - Dead Heat (??/1975) UNKNOWN - Elepong (07/1973) UNKNOWN - Flying Fortress (??/1977) UNKNOWN - Flying Fortress II (06/1977) UNKNOWN - Gunman (10/1977) YES 8 x 32bytes (or 11? ) - Interceptor (03/1976) UNKNOWN - Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes) - Pro Hockey (11/1973) UNKNOWN - Road Champion (04/1977) UNKNOWN - Road Champion S (06/1977) UNKNOWN - Soccer (11/1973) UNKNOWN - Soccer DX (??/1977) UNKNOWN - Speed Race (11/1974) UNKNOWN - Speed Race CL-5 (10/1978) UNKNOWN - Speed Race Color (10/1978) UNKNOWN - Speed Race DX (08/1975) UNKNOWN - Speed Race Twin (04/1976) UNKNOWN - Speed Race GP-5 (??/1980) UNKNOWN - Super Block (02/1978) UNKNOWN - Super Speed Race (12/1977) UNKNOWN - Super Speed Race V (07/1978) UNKNOWN - Super Speed Race GP-V (??/1980) UNKNOWN - Table Football (??/1977) UNKNOWN - Tahitian (??/1975) UNKNOWN - Tennis (??/1977) UNKNOWN - T. T. Block (08/1977) YES 1 x 2048bytes - T. T. Block C (05/1978) UNKNOWN - T. T. Block CU (08/1978) UNKNOWN - T. T. Speed Race (??/1978) UNKNOWN - Wall Block (08/1978) UNKNOWN - Wall Break (01/1977) UNKNOWN - Western Gun (09/1975) UNKNOWN - Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes) + Game Name(s) Part #'s Data PROM/ROM Chip Numbers + --------------------------------------------------------------+--------------+---------+--------------------------------------- + Astro Race (11/1973) UNKNOWN + Anti-Aircraft (1975) (clone of Atari's Anti-Aircraft) YES + Attack (09/1976) UNKNOWN + Attack UFO (08/1974) UNKNOWN + Avenger (??/1976) (clone of Electra's Avenger) YES + Ball Park/TT Ball Park (??/1974) (clone of Midway's Ball Park) YES + Basketball (04/1974) (clone of Midway's TV Basketball) YES + Bombs Away (??/1977) (clone of Meadows' Bombs Away) YES + Cisco/Fisco 400 (04/1977) UNKNOWN + Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) YES + Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) YES + Crashing Race (06/1976) UNKNOWN + Cross Fire (08/1977) (clone of PSE's Bazooka) YES + Davis Cup (12/1973) UNKNOWN + Dead Heat (??/1975) UNKNOWN + Elepong (07/1973) UNKNOWN + Flying Fortress (??/1977) UNKNOWN + Flying Fortress II (06/1977) UNKNOWN + Gunman (10/1977) YES 8 x 32bytes (or 11? ) + Interceptor (03/1976) UNKNOWN + Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes) + Pro Hockey (11/1973) UNKNOWN + Road Champion (04/1977) UNKNOWN + Road Champion S (06/1977) UNKNOWN + Soccer (11/1973) UNKNOWN + Soccer DX (??/1977) UNKNOWN + Speed Race (11/1974) UNKNOWN + Speed Race CL-5 (10/1978) UNKNOWN + Speed Race Color (10/1978) UNKNOWN + Speed Race DX (08/1975) UNKNOWN + Speed Race Twin (04/1976) UNKNOWN + Speed Race GP-5 (??/1980) UNKNOWN + Super Block (02/1978) UNKNOWN + Super High-Way (10/1977)? UNKNOWN + Super Speed Race (12/1977) UNKNOWN + Super Speed Race V (07/1978) UNKNOWN + Super Speed Race GP-V (??/1980) UNKNOWN + Table Football (??/1977) UNKNOWN + Tahitian (??/1975) UNKNOWN + Tennis (??/1977) UNKNOWN + T. T. Ball Park (??/1974) (clone of Midway's Ball Park) YES + T. T. Block (08/1977) YES 1 x 2048bytes + T. T. Block C (05/1978) UNKNOWN + T. T. Block CU (08/1978) UNKNOWN + T. T. Speed Race (??/1978) UNKNOWN + Wall Block (08/1978) UNKNOWN + Wall Break (01/1977) UNKNOWN + Western Gun (09/1975) UNKNOWN + Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes) ***************************************************************************/ From 9ab3e52d165f141b469002540fee2b413fbee0b0 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Thu, 4 Jun 2015 09:38:26 +0200 Subject: [PATCH 154/284] vdk_dsk: clean up --- src/lib/formats/vdk_dsk.c | 123 +++++++++++++++++--------------------- src/lib/formats/vdk_dsk.h | 9 ++- 2 files changed, 60 insertions(+), 72 deletions(-) diff --git a/src/lib/formats/vdk_dsk.c b/src/lib/formats/vdk_dsk.c index 325adab4d67..518d48ddd90 100644 --- a/src/lib/formats/vdk_dsk.c +++ b/src/lib/formats/vdk_dsk.c @@ -13,19 +13,8 @@ #include "emu.h" #include "vdk_dsk.h" -vdk_format::vdk_format() : wd177x_format(NULL) +vdk_format::vdk_format() { - m_format.form_factor = floppy_image::FF_525; - m_format.encoding = floppy_image::MFM; - m_format.cell_size = 2000; - m_format.sector_count = 18; -// m_format.track_count = 40/80 -// m_format.head_count = 1/2 - m_format.sector_base_size = 256; - m_format.sector_base_id = 1; - m_format.gap_1 = 32; - m_format.gap_2 = 24; - m_format.gap_3 = 22; } const char *vdk_format::name() const @@ -57,66 +46,55 @@ int vdk_format::identify(io_generic *io, UINT32 form_factor) bool vdk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) { UINT8 header[0x100]; - io_generic_read(io, header, 0, 100); + io_generic_read(io, header, 0, 0x100); + int header_size = header[3] * 0x100 + header[2]; + int track_count = header[8]; + int head_count = header[9]; - m_format.track_count = header[8]; - m_format.head_count = header[9]; + int file_offset = header_size; - switch (m_format.head_count) + for (int track = 0; track < track_count; track++) { - case 1: m_format.variant = floppy_image::SSDD; break; - case 2: m_format.variant = floppy_image::DSDD; break; - default: return false; - } + for (int head = 0; head < head_count ; head++) + { + desc_pc_sector sectors[SECTOR_COUNT]; + UINT8 sector_data[SECTOR_COUNT * SECTOR_SIZE]; + int sector_offset = 0; - floppy_image_format_t::desc_e *desc; - int current_size; - int end_gap_index; + for (int i = 0; i < SECTOR_COUNT; i++) + { + sectors[i].track = track; + sectors[i].head = head; + sectors[i].sector = FIRST_SECTOR_ID + i; + sectors[i].actual_size = SECTOR_SIZE; + sectors[i].size = SECTOR_SIZE >> 8; + sectors[i].deleted = false; + sectors[i].bad_crc = false; + sectors[i].data = §or_data[sector_offset]; - desc = get_desc_mfm(m_format, current_size, end_gap_index); + io_generic_read(io, sectors[i].data, file_offset, SECTOR_SIZE); - int total_size = 200000000 / m_format.cell_size; - int remaining_size = total_size - current_size; - if (remaining_size < 0) - throw emu_fatalerror("vdk_format: Incorrect track layout, max_size=%d, current_size=%d", total_size, current_size); + sector_offset += SECTOR_SIZE; + file_offset += SECTOR_SIZE; + } - // fixup the end gap - desc[end_gap_index].p2 = remaining_size / 16; - desc[end_gap_index + 1].p2 = remaining_size & 15; - desc[end_gap_index + 1].p1 >>= 16 - (remaining_size & 15); - - int track_size = compute_track_size(m_format); - - UINT8 sectdata[40*512]; - desc_s sectors[40]; - build_sector_description(m_format, sectdata, sectors); - - for(int track=0; track < m_format.track_count; track++) - for(int head=0; head < m_format.head_count; head++) { - io_generic_read(io, sectdata, header_size + get_image_offset(m_format, head, track), track_size); - generate_track(desc, track, head, sectors, m_format.sector_count, total_size, image); + build_wd_track_mfm(track, head, image, 100000, SECTOR_COUNT, sectors, 22, 32, 24); } - - image->set_variant(m_format.variant); + } return true; } bool vdk_format::save(io_generic *io, floppy_image *image) { - int tracks, heads; - image->get_actual_geometry(tracks, heads); + UINT8 bitstream[500000/8]; + UINT8 sector_data[50000]; + desc_xs sectors[256]; + UINT64 file_offset = 0; - m_format.track_count = tracks; - m_format.head_count = heads; - - switch (m_format.head_count) - { - case 1: m_format.variant = floppy_image::SSDD; break; - case 2: m_format.variant = floppy_image::DSDD; break; - default: return false; - } + int track_count, head_count; + image->get_actual_geometry(track_count, head_count); // write header UINT8 header[12]; @@ -129,30 +107,37 @@ bool vdk_format::save(io_generic *io, floppy_image *image) header[5] = 0x10; header[6] = 'M'; header[7] = 0x01; - header[8] = tracks; - header[9] = heads; + header[8] = track_count; + header[9] = head_count; header[10] = 0; header[11] = 0; - io_generic_write(io, header, 0, sizeof(header)); + io_generic_write(io, header, file_offset, sizeof(header)); + file_offset += sizeof(header); // write disk data - int track_size = compute_track_size(m_format); - - UINT8 sectdata[40*512]; - desc_s sectors[40]; - build_sector_description(m_format, sectdata, sectors); - - for (int track = 0; track < m_format.track_count; track++) + for (int track = 0; track < track_count; track++) { - for (int head = 0; head < m_format.head_count; head++) + for (int head = 0; head < head_count; head++) { - extract_sectors(image, m_format, sectors, track, head); - io_generic_write(io, sectdata, sizeof(header) + get_image_offset(m_format, head, track), track_size); + int track_size; + generate_bitstream_from_track(track, head, 2000, bitstream, track_size, image); + extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data)); + + for (int i = 0; i < SECTOR_COUNT; i++) + { + io_generic_write(io, sectors[FIRST_SECTOR_ID + i].data, file_offset, SECTOR_SIZE); + file_offset += SECTOR_SIZE; + } } } return true; } +bool vdk_format::supports_save() const +{ + return true; +} + const floppy_format_type FLOPPY_VDK_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/vdk_dsk.h b/src/lib/formats/vdk_dsk.h index be05865ce2a..5570c14eab8 100644 --- a/src/lib/formats/vdk_dsk.h +++ b/src/lib/formats/vdk_dsk.h @@ -15,9 +15,9 @@ #ifndef __VDK_DSK_H__ #define __VDK_DSK_H__ -#include "wd177x_dsk.h" +#include "flopimg.h" -class vdk_format : public wd177x_format +class vdk_format : public floppy_image_format_t { public: vdk_format(); @@ -29,9 +29,12 @@ public: virtual int identify(io_generic *io, UINT32 form_factor); virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); virtual bool save(io_generic *io, floppy_image *image); + virtual bool supports_save() const; private: - format m_format; + static const int SECTOR_SIZE = 256; + static const int SECTOR_COUNT = 18; + static const int FIRST_SECTOR_ID = 1; }; extern const floppy_format_type FLOPPY_VDK_FORMAT; From 76b61002a9ff907860f2d71f525c33483ecb3be2 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Thu, 4 Jun 2015 22:11:18 +1200 Subject: [PATCH 155/284] Used a latch for the VGA PEL shift register, should fix jerkiness in games that use it (it does in Raiden, at least). --- src/emu/video/pc_vga.c | 9 ++++++--- src/emu/video/pc_vga.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index 67a7ea5d0cd..7ce3eacf9c0 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -127,13 +127,15 @@ const device_type MACH8 = &device_creator; vga_device::vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), - m_palette(*this, "^palette") + m_palette(*this, "^palette"), + m_screen(*this,"^screen") { } vga_device::vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, VGA, "VGA", tag, owner, clock, "vga", __FILE__), - m_palette(*this, "^palette") + m_palette(*this, "^palette"), + m_screen(*this,"^screen") { } @@ -218,6 +220,7 @@ void svga_device::zero() TIMER_CALLBACK_MEMBER(vga_device::vblank_timer_cb) { vga.crtc.start_addr = vga.crtc.start_addr_latch; + vga.attribute.pel_shift = vga.attribute.pel_shift_latch; m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) ); } @@ -1765,7 +1768,7 @@ void vga_device::attribute_reg_write(UINT8 index, UINT8 data) case 0x10: vga.attribute.data[0x10] = data; break; case 0x11: vga.attribute.data[0x11] = data; break; case 0x12: vga.attribute.data[0x12] = data; break; - case 0x13: vga.attribute.pel_shift = vga.attribute.data[0x13] = data; break; + case 0x13: vga.attribute.pel_shift_latch = vga.attribute.data[0x13] = data; break; case 0x14: vga.attribute.data[0x14] = data; break; } } diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h index 613d38a1616..ee0504a95e1 100644 --- a/src/emu/video/pc_vga.h +++ b/src/emu/video/pc_vga.h @@ -208,6 +208,7 @@ protected: UINT8 index, data[0x15]; int state; UINT8 prot_bit; UINT8 pel_shift; + UINT8 pel_shift_latch; } attribute; @@ -229,6 +230,7 @@ protected: emu_timer *m_vblank_timer; required_device m_palette; + required_device m_screen; }; From 27138786f8a654be620b8059db8dfe7b211ceb74 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 4 Jun 2015 12:19:20 +0200 Subject: [PATCH 156/284] fixed .lst files whitespace problem [LnmVolbo] --- src/build/makelist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build/makelist.py b/src/build/makelist.py index eeaac070427..1f94814bf88 100644 --- a/src/build/makelist.py +++ b/src/build/makelist.py @@ -28,7 +28,7 @@ def parse_file(srcfile): if c==13 and line[srcptr]==10: srcptr+=1 continue - if c==' ': + if c==' ' or c==9: continue if in_comment==1 and c=='*' and line[srcptr]=='/' : srcptr+=1 From a444bc8e2514cf581f0ec077dfdcf191bd3883d8 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Thu, 4 Jun 2015 16:55:13 +0200 Subject: [PATCH 157/284] coco: updated to use the new wd fdc --- scripts/src/lib.lua | 2 + src/emu/bus/coco/coco_fdc.c | 85 +++++++++++------- src/emu/bus/coco/coco_fdc.h | 8 +- src/lib/formats/jvc_dsk.c | 174 ++++++++++++++++++++++++++++++++++++ src/lib/formats/jvc_dsk.h | 50 +++++++++++ 5 files changed, 283 insertions(+), 36 deletions(-) create mode 100644 src/lib/formats/jvc_dsk.c create mode 100644 src/lib/formats/jvc_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 49cfc2bc2f2..f562b98c3b1 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -265,6 +265,8 @@ project "formats" MAME_DIR .. "src/lib/formats/imd_dsk.h", MAME_DIR .. "src/lib/formats/ipf_dsk.c", MAME_DIR .. "src/lib/formats/ipf_dsk.h", + MAME_DIR .. "src/lib/formats/jvc_dsk.c", + MAME_DIR .. "src/lib/formats/jvc_dsk.h", MAME_DIR .. "src/lib/formats/kaypro_dsk.c", MAME_DIR .. "src/lib/formats/kaypro_dsk.h", MAME_DIR .. "src/lib/formats/kc_cas.c", diff --git a/src/emu/bus/coco/coco_fdc.c b/src/emu/bus/coco/coco_fdc.c index 49da5302b22..9be9039516d 100644 --- a/src/emu/bus/coco/coco_fdc.c +++ b/src/emu/bus/coco/coco_fdc.c @@ -73,7 +73,9 @@ #include "imagedev/flopdrv.h" #include "includes/coco.h" #include "imagedev/flopdrv.h" -#include "formats/coco_dsk.h" +#include "formats/dmk_dsk.h" +#include "formats/jvc_dsk.h" +#include "formats/vdk_dsk.h" /*************************************************************************** @@ -94,12 +96,15 @@ LOCAL VARIABLES ***************************************************************************/ -static const floppy_interface coco_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSHD, - LEGACY_FLOPPY_OPTIONS_NAME(coco), - "floppy_5_25" -}; +FLOPPY_FORMATS_MEMBER( coco_fdc_device::floppy_formats ) + FLOPPY_DMK_FORMAT, + FLOPPY_JVC_FORMAT, + FLOPPY_VDK_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( coco_fdc_floppies ) + SLOT_INTERFACE("qd", FLOPPY_525_QD) +SLOT_INTERFACE_END /*************************************************************************** @@ -149,15 +154,17 @@ WRITE_LINE_MEMBER( coco_fdc_device::fdc_drq_w ) //************************************************************************** static MACHINE_CONFIG_FRAGMENT(coco_fdc) - MCFG_DEVICE_ADD(WD_TAG, WD1773, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS - MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_intrq_w)) - MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_drq_w)) + MCFG_WD1773x_ADD(WD_TAG, XTAL_8MHz) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_intrq_w)) + MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_drq_w)) + + MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":0", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":1", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":2", coco_fdc_floppies, "", coco_fdc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":3", coco_fdc_floppies, "", coco_fdc_device::floppy_formats) MCFG_DEVICE_ADD(DISTO_TAG, MSM6242, XTAL_32_768kHz) MCFG_DS1315_ADD(CLOUD9_TAG) - - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface) MACHINE_CONFIG_END ROM_START( coco_fdc ) @@ -291,16 +298,17 @@ void coco_fdc_device::dskreg_w(UINT8 data) else if (data & 0x40) drive = 3; - legacy_floppy_image_device *floppy[4]; + floppy_image_device *floppy[4]; - floppy[0] = subdevice(FLOPPY_0); - floppy[1] = subdevice(FLOPPY_1); - floppy[2] = subdevice(FLOPPY_2); - floppy[3] = subdevice(FLOPPY_3); + floppy[0] = subdevice(WD_TAG ":0")->get_device(); + floppy[1] = subdevice(WD_TAG ":1")->get_device(); + floppy[2] = subdevice(WD_TAG ":2")->get_device(); + floppy[3] = subdevice(WD_TAG ":3")->get_device(); for (int i = 0; i < 4; i++) { - floppy[i]->floppy_mon_w(i == drive ? CLEAR_LINE : ASSERT_LINE); + if (floppy[i]) + floppy[i]->mon_w(i == drive ? CLEAR_LINE : ASSERT_LINE); } head = ((data & 0x40) && (drive != 3)) ? 1 : 0; @@ -309,8 +317,11 @@ void coco_fdc_device::dskreg_w(UINT8 data) update_lines(); - m_wd17xx->set_drive(drive); - m_wd17xx->set_side(head); + m_wd17xx->set_floppy(floppy[drive]); + + if (floppy[drive]) + floppy[drive]->ss_w(head); + m_wd17xx->dden_w(!BIT(m_dskreg, 5)); } @@ -379,7 +390,7 @@ WRITE8_MEMBER(coco_fdc_device::write) dskreg_w(data); break; case 8: - m_wd17xx->command_w(space, 0, data); + m_wd17xx->cmd_w(space, 0, data); break; case 9: m_wd17xx->track_w(space, 0, data); @@ -388,6 +399,7 @@ WRITE8_MEMBER(coco_fdc_device::write) m_wd17xx->sector_w(space, 0, data); break; case 11: + //printf("data w %02x\n", data); m_wd17xx->data_w(space, 0, data); break; }; @@ -413,10 +425,12 @@ WRITE8_MEMBER(coco_fdc_device::write) //************************************************************************** static MACHINE_CONFIG_FRAGMENT(dragon_fdc) - MCFG_DEVICE_ADD(WD2797_TAG, WD2797, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_WD2797x_ADD(WD2797_TAG, XTAL_1MHz) - MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":2", coco_fdc_floppies, "", coco_fdc_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":3", coco_fdc_floppies, "", coco_fdc_device::floppy_formats) MACHINE_CONFIG_END @@ -511,10 +525,20 @@ void dragon_fdc_device::dskreg_w(UINT8 data) data); } - if (data & 0x04) - m_wd2797->set_drive(data & 0x03); + floppy_image_device *floppy = NULL; + + switch (data & 0x03) + { + case 0: floppy = subdevice(WD2797_TAG ":0")->get_device(); break; + case 1: floppy = subdevice(WD2797_TAG ":1")->get_device(); break; + case 2: floppy = subdevice(WD2797_TAG ":2")->get_device(); break; + case 3: floppy = subdevice(WD2797_TAG ":3")->get_device(); break; + } + + m_wd2797->set_floppy(floppy); m_wd2797->dden_w(BIT(data, 3)); + m_dskreg = data; } @@ -556,12 +580,7 @@ WRITE8_MEMBER(dragon_fdc_device::write) switch(offset & 0xEF) { case 0: - m_wd2797->command_w(space, 0, data); - - /* disk head is encoded in the command byte */ - /* Only for type 3 & 4 commands */ - if (data & 0x80) - m_wd2797->set_side((data & 0x02) ? 1 : 0); + m_wd2797->cmd_w(space, 0, data); break; case 1: m_wd2797->track_w(space, 0, data); diff --git a/src/emu/bus/coco/coco_fdc.h b/src/emu/bus/coco/coco_fdc.h index 3456b00054f..8773a48bea4 100644 --- a/src/emu/bus/coco/coco_fdc.h +++ b/src/emu/bus/coco/coco_fdc.h @@ -9,7 +9,7 @@ #include "cococart.h" #include "machine/msm6242.h" #include "machine/ds1315.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" //************************************************************************** @@ -37,6 +37,8 @@ public: coco_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); coco_fdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + DECLARE_FLOPPY_FORMATS(floppy_formats); + // optional information overrides virtual machine_config_constructor device_mconfig_additions() const; virtual const rom_entry *device_rom_region() const; @@ -66,8 +68,8 @@ protected: UINT8 m_drq : 1; UINT8 m_intrq : 1; - optional_device m_wd17xx; /* WD17xx */ - optional_device m_wd2797; /* WD2797 */ + optional_device m_wd17xx; /* WD17xx */ + optional_device m_wd2797; /* WD2797 */ optional_device m_ds1315; /* DS1315 */ /* Disto RTC */ diff --git a/src/lib/formats/jvc_dsk.c b/src/lib/formats/jvc_dsk.c new file mode 100644 index 00000000000..20ee3508ee9 --- /dev/null +++ b/src/lib/formats/jvc_dsk.c @@ -0,0 +1,174 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + JVC + + Disk image format + + Named after its creator, Jeff Vavasour + + TODO: + - Support writing unusal formats? + +***************************************************************************/ + +#include "emu.h" +#include "jvc_dsk.h" + +jvc_format::jvc_format() +{ +} + +const char *jvc_format::name() const +{ + return "jvc"; +} + +const char *jvc_format::description() const +{ + return "JVC disk image"; +} + +const char *jvc_format::extensions() const +{ + return "jvc,dsk"; +} + +bool jvc_format::parse_header(io_generic *io, int &header_size, int &tracks, int &heads, int §ors, int §or_size, int &base_sector_id) +{ + UINT64 size = io_generic_size(io); + header_size = size % 256; + UINT8 header[5]; + + if (header_size > 0) + io_generic_read(io, header, 0, header_size); + + if (header_size > 5) + return false; + + // default values + heads = 1; + sectors = 18; + sector_size = 256; + base_sector_id = 1; + + switch (header_size) + { + case 5: emu_fatalerror("jvc_format: sector attribute flag unsupported\n"); + break; + case 4: base_sector_id = header[3]; + // no break + case 3: sector_size = 128 << header[2]; + // no break + case 2: heads = header[1]; + // no break + case 1: sectors = header[0]; + // no break + case 0: tracks = (size - header_size) / sector_size / sectors; + break; + } + + return tracks * heads * sectors * sector_size == (size - header_size); +} + +int jvc_format::identify(io_generic *io, UINT32 form_factor) +{ + int header_size, tracks, heads, sectors, sector_size, sector_base_id; + return parse_header(io, header_size, tracks, heads, sectors, sector_size, sector_base_id) ? 50 : 0; +} + +bool jvc_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +{ + int header_size, track_count, head_count, sector_count, sector_size, sector_base_id; + + if (!parse_header(io, header_size, track_count, head_count, sector_count, sector_size, sector_base_id)) + return false; + + // safety check + if (sector_count * sector_size > 10000) + emu_fatalerror("jvc_format: incorrect track layout\n"); + + int file_offset = header_size; + + for (int track = 0; track < track_count; track++) + { + for (int head = 0; head < head_count ; head++) + { + desc_pc_sector sectors[256]; + UINT8 sector_data[10000]; + int sector_offset = 0; + + for (int i = 0; i < sector_count; i++) + { + sectors[i].track = track; + sectors[i].head = head; + sectors[i].sector = sector_base_id + i; + sectors[i].actual_size = sector_size; + sectors[i].size = sector_size >> 8; + sectors[i].deleted = false; + sectors[i].bad_crc = false; + sectors[i].data = §or_data[sector_offset]; + + io_generic_read(io, sectors[i].data, file_offset, sector_size); + + sector_offset += sector_size; + file_offset += sector_size; + } + + build_wd_track_mfm(track, head, image, 100000, sector_count, sectors, 22, 32, 24); + } + } + + return true; +} + +bool jvc_format::save(io_generic *io, floppy_image *image) +{ + UINT8 bitstream[500000/8]; + UINT8 sector_data[50000]; + desc_xs sectors[256]; + UINT64 file_offset = 0; + + int track_count, head_count; + image->get_actual_geometry(track_count, head_count); + + // we'll write a header if the disk is two-sided + if (head_count == 2) + { + UINT8 header[2]; + header[0] = 18; + header[1] = 2; + io_generic_write(io, header, file_offset, sizeof(header)); + file_offset += sizeof(header); + } + + // write disk data + for (int track = 0; track < track_count; track++) + { + for (int head = 0; head < head_count; head++) + { + int track_size; + generate_bitstream_from_track(track, head, 2000, bitstream, track_size, image); + extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data)); + + for (int i = 0; i < 18; i++) + { + if (sectors[1 + i].size != 256) + emu_fatalerror("jvc_format: invalid sector size: %d\n", sectors[1 + i].size); + + io_generic_write(io, sectors[1 + i].data, file_offset, sectors[1 + i].size); + file_offset += sectors[1 + i].size; + } + } + } + + return true; +} + +bool jvc_format::supports_save() const +{ + return true; +} + +const floppy_format_type FLOPPY_JVC_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/jvc_dsk.h b/src/lib/formats/jvc_dsk.h new file mode 100644 index 00000000000..eaeeefb84aa --- /dev/null +++ b/src/lib/formats/jvc_dsk.h @@ -0,0 +1,50 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + JVC + + Disk image format + + Named after its creator, Jeff Vavasour + +***************************************************************************/ + +#pragma once + +#ifndef __JVC_DSK_H__ +#define __JVC_DSK_H__ + +#include "flopimg.h" + +class jvc_format : public floppy_image_format_t +{ +public: + jvc_format(); + + struct jvc_header + { + UINT8 sectors_per_track; + UINT8 side_count; + UINT8 sector_size; + UINT8 first_sector_id; + UINT8 sector_attribute_flag; + int header_size; + }; + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + + virtual int identify(io_generic *io, UINT32 form_factor); + virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); + virtual bool save(io_generic *io, floppy_image *image); + virtual bool supports_save() const; + +private: + bool parse_header(io_generic *io, int &header_size, int &tracks, int &heads, int §ors, int §or_size, int &base_sector_id); +}; + +extern const floppy_format_type FLOPPY_JVC_FORMAT; + +#endif // __JVC_DSK_H__ From 1c92d1000fbb37b0a22838cebd673a5f00068a68 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Thu, 4 Jun 2015 19:50:31 +0200 Subject: [PATCH 158/284] MFM HD work in progress; reading sectors --- src/emu/bus/ti99_peb/hfdc.c | 45 ++- src/emu/bus/ti99_peb/hfdc.h | 21 +- src/emu/machine/hdc9234.c | 617 ++++++++++++++++++++++++++++++------ src/emu/machine/hdc9234.h | 44 ++- src/emu/machine/ti99_hd.c | 499 ++++++++++++++++++++++++++++- src/emu/machine/ti99_hd.h | 114 ++++++- 6 files changed, 1172 insertions(+), 168 deletions(-) diff --git a/src/emu/bus/ti99_peb/hfdc.c b/src/emu/bus/ti99_peb/hfdc.c index e67172342ac..0e3c77190f4 100644 --- a/src/emu/bus/ti99_peb/hfdc.c +++ b/src/emu/bus/ti99_peb/hfdc.c @@ -74,12 +74,12 @@ #define CLK_ADDR 0x0fe0 #define RAM_ADDR 0x1000 -#define TRACE_EMU 1 +#define TRACE_EMU 0 #define TRACE_CRU 0 #define TRACE_COMP 0 #define TRACE_RAM 0 #define TRACE_ROM 0 -#define TRACE_LINES 1 +#define TRACE_LINES 0 #define TRACE_MOTOR 0 #define TRACE_DMA 0 #define TRACE_INT 0 @@ -515,12 +515,22 @@ void myarc_hfdc_device::harddisk_index_callback(mfm_harddisk_device *harddisk, i signal_drive_status(); } +/* + This is called back from the hard disk when READY becomes asserted. +*/ +void myarc_hfdc_device::harddisk_ready_callback(mfm_harddisk_device *harddisk, int state) +{ + /* if (TRACE_LINES) */ logerror("%s: HD READY = %d\n", tag(), state); + set_bits(m_status_latch, HDC_DS_READY, (state==ASSERT_LINE)); + signal_drive_status(); +} + /* This is called back from the hard disk when seek_complete becomes asserted. */ void myarc_hfdc_device::harddisk_skcom_callback(mfm_harddisk_device *harddisk, int state) { - /* if (TRACE_LINES) */ if (state==1) logerror("%s: HD seek complete\n", tag()); + /* if (TRACE_LINES) */ logerror("%s: HD seek complete = %d\n", tag(), state); set_bits(m_status_latch, HDC_DS_SKCOM, (state==ASSERT_LINE)); signal_drive_status(); } @@ -674,6 +684,7 @@ WRITE8_MEMBER( myarc_hfdc_device::auxbus_out ) // Dir = 0 -> outward m_current_harddisk->direction_in_w((data & 0x20)? ASSERT_LINE : CLEAR_LINE); m_current_harddisk->step_w((data & 0x10)? ASSERT_LINE : CLEAR_LINE); + m_current_harddisk->headsel_w(data & 0x0f); } // We are pushing the drive status after OUTPUT2 @@ -728,6 +739,7 @@ void myarc_hfdc_device::connect_harddisk_unit(int index) if (m_current_harddisk != NULL) { m_current_harddisk->setup_index_pulse_cb(mfm_harddisk_device::index_pulse_cb(FUNC(myarc_hfdc_device::harddisk_index_callback), this)); + m_current_harddisk->setup_ready_cb(mfm_harddisk_device::ready_cb(FUNC(myarc_hfdc_device::harddisk_ready_callback), this)); m_current_harddisk->setup_seek_complete_cb(mfm_harddisk_device::seek_complete_cb(FUNC(myarc_hfdc_device::harddisk_skcom_callback), this)); } else @@ -1012,9 +1024,9 @@ MACHINE_CONFIG_FRAGMENT( ti99_hfdc ) MCFG_FLOPPY_DRIVE_ADD("f4", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats) // NB: Hard disks don't go without image (other than floppy drives) - MCFG_MFM_HARDDISK_ADD("h1", hfdc_harddisks, NULL) - MCFG_MFM_HARDDISK_ADD("h2", hfdc_harddisks, NULL) - MCFG_MFM_HARDDISK_ADD("h3", hfdc_harddisks, NULL) + MCFG_MFM_HARDDISK_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE) + MCFG_MFM_HARDDISK_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE) + MCFG_MFM_HARDDISK_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE) MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0) MCFG_MM58274C_MODE24(1) // 24 hour @@ -1046,27 +1058,6 @@ ioport_constructor myarc_hfdc_device::device_input_ports() const const device_type TI99_HFDC = &device_creator; -mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): - device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__), - device_slot_interface(mconfig, *this) -{ -} - -mfm_harddisk_connector::~mfm_harddisk_connector() -{ -} - -mfm_harddisk_device *mfm_harddisk_connector::get_device() -{ - return dynamic_cast(get_card_device()); -} - -void mfm_harddisk_connector::device_start() -{ -} - -const device_type MFM_HD_CONNECTOR = &device_creator; - // ========================================================================= /* diff --git a/src/emu/bus/ti99_peb/hfdc.h b/src/emu/bus/ti99_peb/hfdc.h index f7d7e9053b5..19e7d0fc321 100644 --- a/src/emu/bus/ti99_peb/hfdc.h +++ b/src/emu/bus/ti99_peb/hfdc.h @@ -69,6 +69,7 @@ private: // Callbacks for the index hole and seek complete void floppy_index_callback(floppy_image_device *floppy, int state); void harddisk_index_callback(mfm_harddisk_device *harddisk, int state); + void harddisk_ready_callback(mfm_harddisk_device *harddisk, int state); void harddisk_skcom_callback(mfm_harddisk_device *harddisk, int state); // Operate the floppy motors @@ -182,26 +183,6 @@ private: int m_readyflags; }; -/* Connector for a MFM hard disk. See also floppy.c */ -class mfm_harddisk_connector : public device_t, - public device_slot_interface -{ -public: - mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ~mfm_harddisk_connector(); - - mfm_harddisk_device *get_device(); - -protected: - void device_start(); -}; - -extern const device_type MFM_HD_CONNECTOR; - -#define MCFG_MFM_HARDDISK_ADD(_tag, _slot_intf, _def_slot) \ - MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \ - MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false); - // ========================================================================= /* diff --git a/src/emu/machine/hdc9234.c b/src/emu/machine/hdc9234.c index a89c6e93184..183d1af2aaf 100644 --- a/src/emu/machine/hdc9234.c +++ b/src/emu/machine/hdc9234.c @@ -22,6 +22,7 @@ #include "emu.h" #include "hdc9234.h" +#include "formats/imageutl.h" // Per-command debugging #define TRACE_SELECT 0 @@ -335,12 +336,14 @@ enum SEARCH_IDAM, SEARCH_IDAM_FAILED, READ_TWO_MORE_A1_IDAM, + READ_IDENT, READ_ID_FIELDS_INTO_REGS, SEARCH_DAM, READ_TWO_MORE_A1_DAM, + READ_DATADEL_FLAG, SEARCH_DAM_FAILED, READ_SECTOR_DATA, - READ_SECTOR_DATA1, + READ_SECTOR_DATA_CONT, WRITE_DAM_AND_SECTOR, WRITE_SEC_SKIP_GAP2, WRITE_SEC_SKIP_GAP2_LOOP, @@ -463,6 +466,30 @@ bool hdc9234_device::on_track00() return (m_register_r[DRIVE_STATUS] & HDC_DS_TRK00)!=0; } +/* + Seek completed? +*/ +bool hdc9234_device::seek_complete() +{ + return (m_register_r[DRIVE_STATUS] & HDC_DS_SKCOM)!=0; +} + +/* + Index hole? +*/ +bool hdc9234_device::index_hole() +{ + return (m_register_r[DRIVE_STATUS] & HDC_DS_INDEX)!=0; +} + +/* + Drive ready? +*/ +bool hdc9234_device::drive_ready() +{ + return (m_register_r[DRIVE_STATUS] & HDC_DS_READY)!=0; +} + /* Accessor functions for specific parameters. */ @@ -545,11 +572,6 @@ int hdc9234_device::pulse_width() return time; } -bool hdc9234_device::rapid_steps() -{ - return (m_register_w[MODE] & MO_STEPRATE) == 0; -} - /* Delivers the sector size */ @@ -582,10 +604,41 @@ void hdc9234_device::wait_time(emu_timer *tm, const attotime &delay, int param) */ void hdc9234_device::wait_line(int line, line_state level, int substate, bool stopwrite) { - m_event_line = line; - m_line_level = level; - m_state_after_line = substate; - m_stopwrite = stopwrite; + bool line_at_level = true; + if (line == SEEKCOMP_LINE && (seek_complete() == (level==ASSERT_LINE))) + { + logerror("%s: SEEK_COMPLETE line is already %d\n", tag(), level); + } + else + { + if (line == INDEX_LINE && (index_hole() == (level==ASSERT_LINE))) + { + logerror("%s: INDEX line is already %d\n", tag(), level); + } + else + { + if (line == READY_LINE && (drive_ready() == (level==ASSERT_LINE))) + { + logerror("%s: READY line is already %d\n", tag(), level); + } + else + { + // The line is not yet at the desired level; hence, arm the trigger. + m_event_line = line; + m_line_level = level; + m_state_after_line = substate; + m_stopwrite = stopwrite; + line_at_level = false; + } + } + } + + if (line_at_level) + { + m_substate = substate; + m_state_after_line = UNDEF; + reenter_command_processing(); + } } // ================================================================== @@ -666,6 +719,7 @@ void hdc9234_device::read_id(int& cont, bool implied_seek, bool wait_seek_comple if (wait_seek_complete) { // We have to wait for SEEK COMPLETE + if (TRACE_READID && TRACE_SUBSTATES) logerror("%s: Waiting for SEEK COMPLETE\n", tag()); wait_line(SEEKCOMP_LINE, ASSERT_LINE, READ_ID_SEEK_COMPLETE, false); cont = WAIT; } @@ -1065,7 +1119,7 @@ void hdc9234_device::restore_drive() { case RESTORE_CHECK: // Track 0 has not been reached yet - if ((m_register_r[DRIVE_STATUS] & HDC_DS_READY)==0) + if (!drive_ready()) { if (TRACE_RESTORE) logerror("%s: restore command: Drive not ready\n", tag()); // Does not look like a success, but this takes into account @@ -1257,7 +1311,7 @@ void hdc9234_device::poll_drives() break; case POLL2: - if ((m_register_r[DRIVE_STATUS] & HDC_DS_SKCOM)!=0) + if (seek_complete()) { // Seek complete has been set m_substate = DONE; @@ -1404,7 +1458,7 @@ void hdc9234_device::seek_read_id() int cont = NEXT; bool step_enable = (current_command() & 0x04)==1; - bool wait_seek_comp = ((current_command() & 0x02)==1) || rapid_steps(); + bool wait_seek_comp = (current_command() & 0x02)==1; bool do_verify = (current_command() & 0x01)==1; while (cont == NEXT) @@ -1477,7 +1531,7 @@ void hdc9234_device::read_sectors() switch (m_substate & 0xf0) { case READ_ID: - read_id(cont, implied_seek, rapid_steps()); + read_id(cont, implied_seek, true); // Always check SEEK COMPLETE break; case VERIFY: verify(cont, logical); // for physical, only verify the first sector @@ -1522,14 +1576,13 @@ void hdc9234_device::read_track() switch (m_substate) { case WAITINDEX0: - // Do we happen to have an index hole right now? - if ((m_register_r[DRIVE_STATUS] & HDC_DS_INDEX)==0) + if (!index_hole()) { m_substate = WAITINDEX1; } else { - // Waiting for the index line going down + // We're above the index hole; wait for the index line going down wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false); cont = WAIT; } @@ -1650,15 +1703,14 @@ void hdc9234_device::format_track() switch (m_substate) { case WAITINDEX0: - // Do we happen to have an index hole right now? - if ((m_register_r[DRIVE_STATUS] & HDC_DS_INDEX)==0) + if (!index_hole()) { m_substate = WAITINDEX1; cont = NEXT; } else { - // Waiting for the index line going down + // We're above the index hole right now, so wait for the line going down wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false); cont = WAIT; } @@ -1734,7 +1786,7 @@ void hdc9234_device::write_sectors() switch (m_substate & 0xf0) { case READ_ID: - read_id(cont, implied_seek, rapid_steps()); + read_id(cont, implied_seek, true); // Always check SEEK COMPLETE break; case VERIFY: verify(cont, logical); @@ -1780,6 +1832,39 @@ std::string hdc9234_device::ttsn() return tts(machine().time()); } +bool hdc9234_device::found_mark(int state) +{ + bool ismark = false; + if (using_floppy()) + { + if (state==SEARCH_IDAM) ismark = (m_live_state.shift_reg == fm_mode()? 0xf57e : 0x4489); + else + { + // f56a 1x1x + ismark = fm_mode()? ((m_live_state.shift_reg & 0xfffa) == 0xf56a) : (m_live_state.shift_reg == 0x4489); + } + } + else + { + switch (m_hd_encoding) + { + case MFM_BITS: + case MFM_BYTE: + ismark = (m_live_state.shift_reg == 0x4489); + break; + case SEPARATED: + // 0 0 0 0 1 0 1 0 + // 1 0 1 0 0 0 0 1 + ismark = (m_live_state.data_reg == 0xa1 && m_live_state.clock_reg == 0x0a); + break; + case SEPARATED_SIMPLE: + ismark = (m_live_state.data_reg == 0xa1 && m_live_state.clock_reg == 0xff); + break; + } + } + return ismark; +} + /* The controller starts to read bits from the disk. This method takes an argument for the state machine called at the end. @@ -1799,7 +1884,7 @@ void hdc9234_device::live_start(int state) m_live_state.data_reg = 0; m_live_state.last_data_bit = false; - pll_reset(m_live_state.time, m_write); + if (using_floppy()) pll_reset(m_live_state.time, m_write); m_checkpoint_state = m_live_state; // Save checkpoint @@ -1807,6 +1892,7 @@ void hdc9234_device::live_start(int state) live_run(); m_last_live_state = UNDEF; + if (TRACE_LIVE) logerror("%s: [%s] Live start end\n", tag(), ttsn().c_str()); // delete } void hdc9234_device::live_run() @@ -1833,9 +1919,9 @@ void hdc9234_device::live_run_until(attotime limit) if (TRACE_LIVE) { if (limit == attotime::never) - logerror("%s: [%s] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); + logerror("%s: [%s live] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); else - logerror("%s: [%s] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); + logerror("%s: [%s live] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); } if (limit == attotime::never) @@ -1867,7 +1953,7 @@ void hdc9234_device::live_run_until(attotime limit) if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM) { - logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str()); + logerror("%s: [%s live] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str()); m_last_live_state = m_live_state.state; } @@ -1876,11 +1962,11 @@ void hdc9234_device::live_run_until(attotime limit) if (read_one_bit(limit)) { - if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str()); return; } // logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).c_str()); - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); // [1] p. 9: The ID field sync mark must be found within 33,792 byte times @@ -1895,7 +1981,7 @@ void hdc9234_device::live_run_until(attotime limit) // MFM case if (m_live_state.shift_reg == 0x4489) { - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); m_live_state.crc = 0x443b; m_live_state.data_separator_phase = false; m_live_state.bit_counter = 0; @@ -1926,14 +2012,14 @@ void hdc9234_device::live_run_until(attotime limit) if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_IDAM) { - logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str()); + logerror("%s: [%s live] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } // Beyond time limit? if (read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); if (m_live_state.bit_count_total > 33792*16) @@ -1955,12 +2041,12 @@ void hdc9234_device::live_run_until(attotime limit) m_live_state.state = SEARCH_IDAM; } else - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); // Continue break; } - if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg); + if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg); // Check for ident field (fe, ff, fd, fc) if ((m_live_state.data_reg & 0xfc) != 0xfc) @@ -1981,7 +2067,7 @@ void hdc9234_device::live_run_until(attotime limit) case READ_ID_FIELDS_INTO_REGS: if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS) { - logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str()); + logerror("%s: [%s live] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2022,7 +2108,7 @@ void hdc9234_device::live_run_until(attotime limit) case SEARCH_DAM: if (TRACE_LIVE && m_last_live_state != SEARCH_DAM) { - logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str()); + logerror("%s: [%s live] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2031,7 +2117,7 @@ void hdc9234_device::live_run_until(attotime limit) if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); if (!fm_mode()) @@ -2045,7 +2131,7 @@ void hdc9234_device::live_run_until(attotime limit) if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489) { - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); m_live_state.crc = 0x443b; m_live_state.data_separator_phase = false; m_live_state.bit_counter = 0; @@ -2079,14 +2165,14 @@ void hdc9234_device::live_run_until(attotime limit) case READ_TWO_MORE_A1_DAM: { if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_DAM) { - logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str()); + logerror("%s: [%s live] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } if(read_one_bit(limit)) return; - if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg, + if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg, get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter); // Repeat until we have collected 16 bits @@ -2103,12 +2189,12 @@ void hdc9234_device::live_run_until(attotime limit) return; } else - if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); // Continue break; } - if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg); + if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg); if ((m_live_state.data_reg & 0xff) == 0xf8) { @@ -2138,7 +2224,7 @@ void hdc9234_device::live_run_until(attotime limit) { if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA) { - logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str()); + logerror("%s: [%s live] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2163,13 +2249,13 @@ void hdc9234_device::live_run_until(attotime limit) // Repeat until we have collected 16 bits if (m_live_state.bit_counter & 15) break; - if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc); + if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc); int slot = (m_live_state.bit_counter >> 4)-1; if (slot < calc_sector_size()) { // Sector data - wait_for_realtime(READ_SECTOR_DATA1); + wait_for_realtime(READ_SECTOR_DATA_CONT); return; } else if (slot < calc_sector_size()+2) @@ -2184,7 +2270,7 @@ void hdc9234_device::live_run_until(attotime limit) } else { - if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] Sector read completed\n", tag(),tts(m_live_state.time).c_str()); wait_for_realtime(IDLE); } return; @@ -2193,10 +2279,10 @@ void hdc9234_device::live_run_until(attotime limit) break; } - case READ_SECTOR_DATA1: - if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA1) + case READ_SECTOR_DATA_CONT: + if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA_CONT) { - logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).c_str()); + logerror("%s: [%s live] READ_SECTOR_DATA_CONT\n", tag(),tts(m_live_state.time).c_str()); m_last_live_state = m_live_state.state; } @@ -2242,7 +2328,7 @@ void hdc9234_device::live_run_until(attotime limit) // 5. Write the CRC bytes if (TRACE_LIVE) - logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str()); + logerror("%s: [%s live] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str()); skip_on_track(m_gap2_size, WRITE_DAM_SYNC); break; @@ -2559,14 +2645,14 @@ void hdc9234_device::live_run_until(attotime limit) // The pause is implemented by doing dummy reads on the floppy if (read_one_bit(limit)) { - if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str()); return; } // Repeat until we have collected 16 bits if ((m_live_state.bit_counter & 15)==0) { - if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat); + if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s live] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat); wait_for_realtime(READ_TRACK_NEXT_BYTE); return; } @@ -2637,7 +2723,7 @@ void hdc9234_device::live_run_until(attotime limit) */ void hdc9234_device::live_run_hd_until(attotime limit) { -// int slot = 0; + int slot = 0; logerror("%s: live_run_hd\n", tag()); if (m_live_state.state == IDLE || m_live_state.next_state != -1) @@ -2646,19 +2732,239 @@ void hdc9234_device::live_run_hd_until(attotime limit) if (TRACE_LIVE) { if (limit == attotime::never) - logerror("%s: [%s] live_run_hd, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); + logerror("%s: [%s live] live_run_hd, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); else - logerror("%s: [%s] live_run_hd until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); + logerror("%s: [%s live] live_run_hd until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM"); } + + // We did not specify an upper time bound, so we take the next index pulse + if (m_harddisk != NULL) limit = m_harddisk->track_end_time(); + while (true) { switch (m_live_state.state) { - case SEARCH_IDAM: - break; + case SEARCH_IDAM: + // This bit will be set when the IDAM cannot be found + set_bits(m_register_r[CHIP_STATUS], CS_SYNCERR, false); + + if (read_from_mfmhd(limit)) + { + if (TRACE_LIVE) logerror("%s: [%s live] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str()); + return; + } + logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); + + // [1] p. 9: The ID field sync mark must be found within 33,792 byte times + if (m_live_state.bit_count_total > 33792*16) + { + wait_for_realtime(SEARCH_IDAM_FAILED); + return; + } + + if (found_mark(SEARCH_IDAM)) + { + if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(), tts(m_live_state.time).c_str()); + m_live_state.crc = 0x443b; + m_live_state.data_separator_phase = false; + m_live_state.bit_counter = 0; + + m_live_state.state = READ_IDENT; + } + break; + + case SEARCH_IDAM_FAILED: + set_bits(m_register_r[CHIP_STATUS], CS_SYNCERR, true); + m_live_state.state = IDLE; + return; + + case READ_IDENT: + if (read_from_mfmhd(limit)) return; + + // Ident bytes are 111111xx + if ((m_live_state.data_reg & 0xfc) != 0xfc) + { + // This may happen when we accidentally locked onto the DAM. Look for the next IDAM. + if (TRACE_LIVE) logerror("%s: Missing ident byte after A1\n", tag()); + m_live_state.state = SEARCH_IDAM; + } + else + { + m_register_r[CURRENT_IDENT] = m_live_state.data_reg; + m_live_state.state = READ_ID_FIELDS_INTO_REGS; + slot = 0; + } + break; + + case READ_ID_FIELDS_INTO_REGS: + + if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS) + { + logerror("%s: [%s live] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str()); + m_last_live_state = m_live_state.state; + } + + if (read_from_mfmhd(limit)) return; + + if (TRACE_LIVE) logerror("%s: slot %d = %02x, crc=%04x\n", tag(), slot, m_live_state.data_reg, m_live_state.crc); + m_register_r[id_field[slot++]] = m_live_state.data_reg; + + if(slot > 5) + { + // We successfully read the ID fields; let's wait for the machine time to catch up. + m_live_state.bit_count_total = 0; + + if ((current_command() & 0xfe) == 0x5a) + // Continue if we're reading a complete track + wait_for_realtime(READ_TRACK_ID_DONE); + else + // Live run is done here; it is the main state machine's turn again. + wait_for_realtime(IDLE); + return; + } + break; + + case SEARCH_DAM: + if (TRACE_LIVE && m_last_live_state != SEARCH_DAM) + { + logerror("%s: [%s live] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str()); + m_last_live_state = m_live_state.state; + } + set_bits(m_register_r[CHIP_STATUS], CS_DELDATA, false); + + if (read_from_mfmhd(limit)) return; + + logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); + + if (m_live_state.bit_counter > 30*16) + { + if (TRACE_FAIL) logerror("%s: SEARCH_DAM failed\n", tag()); + wait_for_realtime(SEARCH_DAM_FAILED); + return; + } + + if (found_mark(SEARCH_DAM)) + { + if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str()); + m_live_state.crc = 0x443b; + m_live_state.data_separator_phase = false; + m_live_state.bit_counter = 0; + m_live_state.state = READ_DATADEL_FLAG; + } + break; + + case READ_DATADEL_FLAG: + if (read_from_mfmhd(limit)) return; + + if ((m_live_state.data_reg & 0xff) == 0xf8) + { + if (TRACE_LIVE) logerror("%s: [%s live] Found deleted data mark F8 after DAM sync\n", tag(), tts(m_live_state.time).c_str()); + set_bits(m_register_r[CHIP_STATUS], CS_DELDATA, true); + } + else + { + if ((m_live_state.data_reg & 0xff) != 0xfb) + { + if (TRACE_FAIL) logerror("%s: [%s live] Missing FB/F8 data mark after DAM sync; found %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); + wait_for_realtime(SEARCH_DAM_FAILED); + return; + } + } + m_live_state.bit_counter = 0; + m_live_state.state = READ_SECTOR_DATA; + break; + + case SEARCH_DAM_FAILED: + if (TRACE_FAIL) logerror("%s: SEARCH_DAM failed\n", tag()); + m_live_state.state = IDLE; + return; + + case READ_SECTOR_DATA: + if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA) + { + logerror("%s: [%s live] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str()); + m_last_live_state = m_live_state.state; + } + + if (read_from_mfmhd(limit)) return; + + // Request bus release + // For hard disk, get it only for the first byte and then keep the bus until the last byte. + // HD: bit_counter increases by 16 for MFM_BYTE, SEPARATED(_SIMPLE) and by 1 for MFM_BIT + if (m_transfer_enabled && (m_live_state.bit_counter == 1 || m_live_state.bit_counter == 16)) + { + set_bits(m_register_r[INT_STATUS], ST_OVRUN, true); + m_out_dmarq(ASSERT_LINE); + } + + slot = (m_live_state.bit_counter >> 4)-1; + if (TRACE_LIVE) logerror("%s: [%s live] Found data value [%d/%d] = %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), slot, calc_sector_size(), m_live_state.data_reg, m_live_state.crc); + + if (slot < calc_sector_size()) + { + // For the first byte, allow for the DMA acknowledge to be set. + if (slot == 0) + { + wait_for_realtime(READ_SECTOR_DATA_CONT); + return; + } + else m_live_state.state = READ_SECTOR_DATA_CONT; + } + else if (slot < calc_sector_size()+2) + { + // CRC + if (slot == calc_sector_size()+1) + { + m_out_dip(CLEAR_LINE); + m_out_dmarq(CLEAR_LINE); + checkpoint(); + + if ((current_command() & 0xfe)==0x5a) + { + // Reading a track? Continue with next ID. + wait_for_realtime(READ_TRACK_ID); + } + else + { + if (TRACE_LIVE) logerror("%s: [%s live] Sector read completed\n", tag(),tts(m_live_state.time).c_str()); + wait_for_realtime(IDLE); + } + return; + } + } + break; + + case READ_SECTOR_DATA_CONT: + + // Did the system CPU send the DMA ACK in the meantime? + if ((m_register_r[INT_STATUS] & ST_OVRUN)!=0) + { + if (TRACE_FAIL) logerror("%s: No DMA ACK - buffer overrun\n", tag()); + set_bits(m_register_r[INT_STATUS], TC_DATAERR, true); + m_live_state.state = IDLE; + return; + } + + if (m_transfer_enabled) + { + m_register_r[DATA] = m_register_w[DATA] = m_live_state.data_reg; + // See above: For hard disk do it only for the first byte / bit + if (m_live_state.bit_counter == 1 || m_live_state.bit_counter == 16) + m_out_dip(ASSERT_LINE); + + m_out_dma(0, m_register_r[DATA], 0xff); + if (TRACE_LIVE) logerror("%s: [%s live] Byte %02x sent via DMA\n", tag(),tts(m_live_state.time).c_str(), m_register_r[DATA] & 0xff); + } + m_live_state.state = READ_SECTOR_DATA; + + break; + + default: + if (TRACE_LIVE) logerror("%s: Unknown state: %d\n", tag(), m_live_state.state); + break; } - return; } + m_last_live_state = UNDEF; } /* @@ -2675,33 +2981,43 @@ void hdc9234_device::live_sync() if(m_live_state.time > machine().time()) { // If so, we must roll back to the last checkpoint - if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); + if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying [%s live]\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); rollback(); + // and replay until we reach the machine time - live_run_until(machine().time()); - // Caught up, write on floppy image - m_pll.commit(m_floppy, m_live_state.time); + if (using_floppy()) + { + live_run_until(machine().time()); + // Caught up, commit bits from pll buffer to disk until live time (if there is something to write) + m_pll.commit(m_floppy, m_live_state.time); + } + else + { + // HD case + live_run_hd_until(machine().time()); + } } else { // We are behind machine time, so we will never get back to that // time, thus we can commit that position - if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); - // Write on floppy image - m_pll.commit(m_floppy, m_live_state.time); + if (TRACE_SYNC) logerror("%s: [%s] Committing [%s live]\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); + + // Commit bits from pll buffer to disk until live time (if there is something to write) + if (using_floppy()) + m_pll.commit(m_floppy, m_live_state.time); if (m_live_state.next_state != -1) - { m_live_state.state = m_live_state.next_state; - } if (m_live_state.state == IDLE) { - m_pll.stop_writing(m_floppy, m_live_state.time); + // Commit until live time and stop + if (using_floppy()) + m_pll.stop_writing(m_floppy, m_live_state.time); m_live_state.time = attotime::never; } } - m_live_state.next_state = -1; checkpoint(); } @@ -2711,12 +3027,13 @@ void hdc9234_device::live_abort() { if (!m_live_state.time.is_never() && m_live_state.time > machine().time()) { - if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().c_str(), tts(m_live_state.time).c_str()); + if (TRACE_LIVE) logerror("%s: [%s] Abort; rolling back and replaying [%s live]\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str()); rollback(); live_run_until(machine().time()); } - m_pll.stop_writing(m_floppy, m_live_state.time); + if (using_floppy()) m_pll.stop_writing(m_floppy, m_live_state.time); + m_live_state.time = attotime::never; m_live_state.state = IDLE; m_live_state.next_state = -1; @@ -2774,7 +3091,7 @@ void hdc9234_device::wait_for_realtime(int state) { m_live_state.next_state = state; m_timer->adjust(m_live_state.time - machine().time()); - if (TRACE_LIVE) logerror("%s: [%s] Waiting for real time [%s] to catch up\n", tag(), tts(m_live_state.time).c_str(), tts(machine().time()).c_str()); + if (TRACE_LIVE) logerror("%s: [%s live] Waiting for real time [%s] to catch up; next state = %d\n", tag(), tts(m_live_state.time).c_str(), ttsn().c_str(), state); } /* @@ -2897,7 +3214,7 @@ void hdc9234_device::encode_byte(UINT8 byte) m_live_state.bit_counter = 16; m_live_state.last_data_bit = raw & 1; m_live_state.shift_reg = m_live_state.shift_reg_save = raw; - if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), byte, raw); + if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s live] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), byte, raw); checkpoint(); } @@ -2911,7 +3228,7 @@ void hdc9234_device::encode_raw(UINT16 raw) m_live_state.bit_counter = 16; m_live_state.shift_reg = m_live_state.shift_reg_save = raw; m_live_state.last_data_bit = raw & 1; - if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), get_data_from_encoding(raw), raw); + if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s live] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), get_data_from_encoding(raw), raw); checkpoint(); } @@ -2940,12 +3257,86 @@ void hdc9234_device::pll_reset(const attotime &when, bool output) void hdc9234_device::checkpoint() { - // Write on floppy image - m_pll.commit(m_floppy, m_live_state.time); + // Commit bits from pll buffer to disk until live time (if there is something to write) + if (using_floppy()) m_pll.commit(m_floppy, m_live_state.time); m_checkpoint_state = m_live_state; m_checkpoint_pll = m_pll; } +// =========================================================================== + +// HD support +/* + Read the bit or complete byte from the hard disk at the point of time + specified by the time in the live_state. + Return true: the time limit has been reached + Return false: valid return + + Updates the CRC and the shift register. Also, the time is updated. + +*/ +bool hdc9234_device::read_from_mfmhd(const attotime &limit) +{ + UINT16 data = 0; + bool offlimit = m_harddisk->read(m_live_state.time, limit, data); + + // We have reached the time limit + if (offlimit) return true; + + if (m_hd_encoding == MFM_BITS) + { + // Push bit into shift register + m_live_state.shift_reg = (m_live_state.shift_reg << 1) | data; + m_live_state.bit_counter++; + // Used for timeout handling + m_live_state.bit_count_total++; + + // Clock bit (false) or data bit (true)? + if (m_live_state.data_separator_phase==true) + { + m_live_state.data_reg = (m_live_state.data_reg << 1) | data; + // Update CRC + if ((m_live_state.crc ^ (data ? 0x8000 : 0x0000)) & 0x8000) + m_live_state.crc = (m_live_state.crc << 1) ^ 0x1021; + else + m_live_state.crc = m_live_state.crc << 1; + } + + m_live_state.data_separator_phase = !m_live_state.data_separator_phase; + } + else + { + UINT16 separated = data; + m_live_state.shift_reg = data; + + if (m_hd_encoding == MFM_BYTE) + { + for (int i=0; i < 8; i++) + { + separated <<= 1; + if (data & 0x8000) separated |= 0x0100; + data <<= 1; + if (data & 0x8000) separated |= 0x0001; + data <<= 1; + } + } + + // Push byte into data / clock register + m_live_state.clock_reg = (separated >> 8) & 0xff; + m_live_state.data_reg = separated & 0xff; + m_live_state.bit_counter += 16; + // Used for timeout handling + m_live_state.bit_count_total += 16; + + // Update CRC + m_live_state.crc = ccitt_crc16_one(m_live_state.crc, m_live_state.data_reg); + m_live_state.data_separator_phase = false; + } + + return false; +} + + // =========================================================================== /* @@ -3074,6 +3465,7 @@ void hdc9234_device::process_command() void hdc9234_device::reenter_command_processing() { + if (TRACE_DELAY) logerror("%s: Re-enter command processing; live state = %d\n", tag(), m_live_state.state); // Do we have a live run on the track? if (m_live_state.state != IDLE) { @@ -3085,6 +3477,7 @@ void hdc9234_device::reenter_command_processing() // We're here when there is no live_run anymore // Where were we last time? // Take care not to restart commands because of the index callback + if (TRACE_DELAY) logerror("%s: Continue with substate %d\n", tag(), m_substate); if (m_executing && m_substate != UNDEF) (this->*m_command)(); auxbus_out(); } @@ -3184,31 +3577,36 @@ void hdc9234_device::auxbus_in(UINT8 data) (data&HDC_DS_SKCOM)? 1:0, (data&HDC_DS_TRK00)? 1:0, (data&HDC_DS_UDEF)? 1:0, (data&HDC_DS_WRPROT)? 1:0, (data&HDC_DS_READY)? 1:0, (data&HDC_DS_WRFAULT)? 1:0); - UINT8 prev = m_register_r[DRIVE_STATUS]; + + bool previndex = index_hole(); + bool prevready = drive_ready(); + bool prevskcom = seek_complete(); + m_register_r[DRIVE_STATUS] = data; - if ((prev & HDC_DS_INDEX) != (data & HDC_DS_INDEX)) - { - // Check whether index value changed - index_callback((data & HDC_DS_INDEX)? ASSERT_LINE : CLEAR_LINE); - } - - if ((prev & HDC_DS_READY) != (data & HDC_DS_READY)) - { - // Check whether ready value changed - ready_callback((data & HDC_DS_READY)? ASSERT_LINE : CLEAR_LINE); - } - - if ((prev & HDC_DS_SKCOM) != (data & HDC_DS_SKCOM)) - { - // Check whether seek complete value changed - seek_complete_callback((data & HDC_DS_SKCOM)? ASSERT_LINE : CLEAR_LINE); - } + // Call a handler if the respective flag changed + if (previndex != index_hole()) index_handler(); + if (prevready != drive_ready()) ready_handler(); + if (prevskcom != seek_complete()) seek_complete_handler(); } -void hdc9234_device::index_callback(int level) +bool hdc9234_device::waiting_for_line(int line, int level) { - if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().c_str(), level); + return (m_event_line == line && m_state_after_line != UNDEF && m_line_level == level); +} + +bool hdc9234_device::waiting_for_other_line(int line) +{ + return (m_state_after_line != UNDEF && m_event_line != line); +} + +/* + Handlers for incoming signal lines. +*/ +void hdc9234_device::index_handler() +{ + int level = index_hole()? ASSERT_LINE : CLEAR_LINE; + if (TRACE_LINES) logerror("%s: [%s] Index handler; level=%d\n", tag(), ttsn().c_str(), level); // Synchronize our position on the track live_sync(); @@ -3219,24 +3617,31 @@ void hdc9234_device::index_callback(int level) if (m_wait_for_index) m_stop_after_index = true; } - if (m_event_line == INDEX_LINE && level == m_line_level && m_state_after_line != UNDEF) + if (waiting_for_line(INDEX_LINE, level)) { if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().c_str(), level); m_substate = m_state_after_line; m_state_after_line = UNDEF; if (m_stopwrite) { - m_pll.stop_writing(m_floppy, m_live_state.time); + if (using_floppy()) m_pll.stop_writing(m_floppy, m_live_state.time); m_live_state.state = IDLE; } + reenter_command_processing(); + } + else + { + // Live processing waits for INDEX + // For harddisk we will continue processing on the falling edge + if (!waiting_for_other_line(INDEX_LINE) && (using_floppy() || level == CLEAR_LINE)) + reenter_command_processing(); } - - reenter_command_processing(); } -void hdc9234_device::ready_callback(int level) +void hdc9234_device::ready_handler() { - if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().c_str(), level); + int level = drive_ready()? ASSERT_LINE : CLEAR_LINE; + if (TRACE_LINES) logerror("%s: [%s] Ready handler; level=%d\n", tag(), ttsn().c_str(), level); // Set the interrupt status flag set_bits(m_register_r[INT_STATUS], ST_RDYCHNG, true); @@ -3251,7 +3656,8 @@ void hdc9234_device::ready_callback(int level) set_interrupt(ASSERT_LINE); } - if (m_event_line == READY_LINE && level == m_line_level && m_state_after_line != UNDEF) + // This is actually not needed, since we never wait for READY + if (waiting_for_line(READY_LINE, level)) { m_substate = m_state_after_line; m_state_after_line = UNDEF; @@ -3259,14 +3665,15 @@ void hdc9234_device::ready_callback(int level) } } -void hdc9234_device::seek_complete_callback(int level) +void hdc9234_device::seek_complete_handler() { - if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().c_str(), level); + int level = seek_complete()? ASSERT_LINE : CLEAR_LINE; + if (TRACE_LINES) logerror("%s: [%s] Seek complete handler; level=%d\n", tag(), ttsn().c_str(), level); // Synchronize our position on the track live_sync(); - if (m_event_line == SEEKCOMP_LINE && level == m_line_level && m_state_after_line != UNDEF) + if (waiting_for_line(SEEKCOMP_LINE, level)) { m_substate = m_state_after_line; m_state_after_line = UNDEF; @@ -3382,6 +3789,8 @@ void hdc9234_device::connect_floppy_drive(floppy_image_device* floppy) void hdc9234_device::connect_hard_drive(mfm_harddisk_device* harddisk) { m_harddisk = harddisk; + m_hd_encoding = m_harddisk->get_encoding(); + logerror("%s: HD encoding = %d\n", tag(), m_hd_encoding); } /* diff --git a/src/emu/machine/hdc9234.h b/src/emu/machine/hdc9234.h index 8317545c552..b6dad3fa4f2 100644 --- a/src/emu/machine/hdc9234.h +++ b/src/emu/machine/hdc9234.h @@ -173,10 +173,16 @@ private: // Timer callback void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - // Callbacks - void ready_callback(int level); - void index_callback(int level); - void seek_complete_callback(int level); + // Handlers for incoming signals + void ready_handler(); + void index_handler(); + void seek_complete_handler(); + + // Wait for this line? + bool waiting_for_line(int line, int level); + + // Wait for some other line? + bool waiting_for_other_line(int line); // Wait for some time to pass or for a line to change level void wait_time(emu_timer *tm, int microsec, int next_substate); @@ -212,6 +218,7 @@ private: int byte_counter; bool data_separator_phase; bool last_data_bit; + UINT8 clock_reg; UINT8 data_reg; int state; int next_state; @@ -241,11 +248,14 @@ private: void rollback(); void checkpoint(); + // Found a mark + bool found_mark(int state); + // Delivers the data bits from the given encoding UINT8 get_data_from_encoding(UINT16 raw); // ============================================== - // PLL functions and interface to floppy + // PLL functions and interface to floppy and harddisk // ============================================== // Phase-locked loops @@ -254,6 +264,9 @@ private: // Clock divider value UINT8 m_clock_divider; + // MFM HD encoding type + mfmhd_enc_t m_hd_encoding; + // Resets the PLL to the given time void pll_reset(const attotime &when, bool write); @@ -283,6 +296,9 @@ private: // Skips bytes on the track void skip_on_track(int count, int next_state); + // Read from the MFM HD + bool read_from_mfmhd(const attotime &limit); + // ============================================== // Command state machine // ============================================== @@ -368,6 +384,18 @@ private: // Are we in FM mode? bool fm_mode(); + // Seek completed? + bool seek_complete(); + + // Are we on track 0? + bool on_track00(); + + // Are we at the index hole? + bool index_hole(); + + // Is the attached drive ready? + bool drive_ready(); + // Delivers the desired head int desired_head(); @@ -398,12 +426,6 @@ private: // Sector size as read from the track int calc_sector_size(); - // Are we on track 0? - bool on_track00(); - - // Are we using rapid steps (needed to decide to wait for seek complete) - bool rapid_steps(); - // Is the currently selected drive a floppy drive? bool using_floppy(); diff --git a/src/emu/machine/ti99_hd.c b/src/emu/machine/ti99_hd.c index 1f3029a1200..5ad8fc1a535 100644 --- a/src/emu/machine/ti99_hd.c +++ b/src/emu/machine/ti99_hd.c @@ -45,25 +45,36 @@ enum STEP_SETTLE }; +#define TRACKSLOTS 5 +#define TRACKIMAGE_SIZE 10416 // Provide the buffer for a complete track, including preambles and gaps + mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source), device_slot_card_interface(mconfig, *this) { } +mfm_harddisk_device::~mfm_harddisk_device() +{ +} + void mfm_harddisk_device::device_start() { m_index_timer = timer_alloc(INDEX_TM); m_spinup_timer = timer_alloc(SPINUP_TM); m_seek_timer = timer_alloc(SEEK_TM); + m_spinup_time = attotime::from_msec(8000); + m_rev_time = attotime::from_hz(60); // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec) m_index_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); // Spinup may take up to 24 seconds - m_spinup_timer->adjust(attotime::from_msec(8000)); + m_spinup_timer->adjust(m_spinup_time); m_current_cylinder = 10; // for test purpose + + m_cache = global_alloc(mfmhd_trackimage_cache); } void mfm_harddisk_device::device_reset() @@ -76,16 +87,55 @@ void mfm_harddisk_device::device_reset() m_step_line = CLEAR_LINE; } +void mfm_harddisk_device::device_stop() +{ + global_free(m_cache); +} + +bool mfm_harddisk_device::call_load() +{ + logerror("call_load\n"); + bool loaded = harddisk_image_device::call_load(); + if (loaded==IMAGE_INIT_PASS) + { + m_cache->init(get_chd_file(), tag(), TRACKSLOTS, m_encoding); + } + else + { + logerror("Could not load CHD\n"); + } + return loaded; +} + void mfm_harddisk_device::setup_index_pulse_cb(index_pulse_cb cb) { m_index_pulse_cb = cb; } +void mfm_harddisk_device::setup_ready_cb(ready_cb cb) +{ + m_ready_cb = cb; +} + void mfm_harddisk_device::setup_seek_complete_cb(seek_complete_cb cb) { m_seek_complete_cb = cb; } +attotime mfm_harddisk_device::track_end_time() +{ + // We back up two microseconds before the track end to avoid the + // index pulse to appear earlier (because of rounding effects) + attotime nexttime = m_rev_time - attotime::from_nsec(2000); + if (!m_ready) + { + // estimate the next index time; during power-up we assume half the rotational speed + // Should never be relevant, though, because READY is false. + nexttime = nexttime * 2; + } + return (m_revolution_start_time.is_never())? attotime::never : (m_revolution_start_time + nexttime); +} + void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch (id) @@ -94,6 +144,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int /* Simple index hole handling. We assume that there is only a short pulse. */ if (!m_index_pulse_cb.isnull()) { + m_revolution_start_time = machine().time(); m_index_pulse_cb(this, ASSERT_LINE); m_index_pulse_cb(this, CLEAR_LINE); } @@ -101,6 +152,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int case SPINUP_TM: m_ready = true; logerror("%s: Spinup complete, drive is ready\n", tag()); + if (!m_ready_cb.isnull()) m_ready_cb(this, ASSERT_LINE); break; case SEEK_TM: switch (m_step_phase) @@ -128,7 +180,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int // Seek completed logerror("%s: Settling done at cylinder %d, seek complete\n", tag(), m_current_cylinder); m_seek_complete = true; - m_seek_complete_cb(this, ASSERT_LINE); + if (!m_seek_complete_cb.isnull()) m_seek_complete_cb(this, ASSERT_LINE); m_step_phase = STEP_COLLECT; } break; @@ -210,7 +262,7 @@ void mfm_harddisk_device::step_w(line_state line) { m_step_phase = STEP_COLLECT; m_seek_complete = false; - m_seek_complete_cb(this, CLEAR_LINE); + if (!m_seek_complete_cb.isnull()) m_seek_complete_cb(this, CLEAR_LINE); } // Counter will be adjusted according to the direction (+-1) @@ -226,6 +278,51 @@ void mfm_harddisk_device::step_w(line_state line) m_step_line = line; } +/* + Reading bytes from the hard disk. + This is the byte-level access to the hard disk. We deliver the next data byte + together with the clock byte. + + Returns true if the time limit will be exceeded before reading the complete byte. + Otherwise returns the byte at the given position together with the clock byte. +*/ +bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT16 &cdata) +{ + UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head); + + if (track==NULL) + { + // What shall we do in this case? + throw emu_fatalerror("Cannot read CHD image"); + } + + // Calculate the position in the track, given the from_when time and the revolution_start_time. + // Each cell takes 100 ns (10 MHz) + + int cell = (from_when - m_revolution_start_time).as_ticks(10000000); + + from_when += attotime::from_nsec(1600); + if (from_when > limit) return true; + + int position = cell / 16; + + // Reached the end + if (position >= 10416) + { + m_revolution_start_time += m_rev_time; + cell = (from_when - m_revolution_start_time).as_ticks(10000000); + position = cell / 16; + } + + // TODO: fix the actual issue + if (position < 0) position = 0; + + logerror("%s: Reading track %d head %d at position %d\n", tag(), m_current_cylinder, m_current_head, position); + cdata = track[position]; + + return false; +} + mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : mfm_harddisk_device(mconfig, MFM_HD_GENERIC, "Generic MFM hard disk (byte level)", tag, owner, clock, "mfm_harddisk", __FILE__) { @@ -233,6 +330,402 @@ mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, cons const device_type MFM_HD_GENERIC = &device_creator; +// =========================================================== +// Track cache +// The cache holds track images to be read by the controller. +// This is a write-back LRU cache. +// =========================================================== + +mfmhd_trackimage_cache::mfmhd_trackimage_cache(): + m_tracks(NULL) +{ + m_current_crc = 0; +} + +mfmhd_trackimage_cache::~mfmhd_trackimage_cache() +{ + mfmhd_trackimage* current = m_tracks; + logerror("%s: MFM HD cache destroy\n", tag()); + + // Still dirty? + while (current != NULL) + { + logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); + if (current->dirty) write_back(current); + global_free_array(current->encdata); + mfmhd_trackimage* currenttmp = current->next; + global_free(current); + current = currenttmp; + } +} + +/* + Initialize the cache by loading the first tracks. +*/ +void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int trackslots, mfmhd_enc_t encoding) +{ + m_encoding = encoding; + m_tagdev = dtag; + + logerror("%s: MFM HD cache init; using encoding %d\n", m_tagdev, encoding); + chd_error state = CHDERR_NONE; + mfmhd_trackimage* previous = NULL; + mfmhd_trackimage* current = NULL; + std::string metadata; + + m_chd = chdfile; + + if (chdfile==NULL) + { + logerror("%s: chdfile is null\n", tag()); + return; + } + + // Read the hard disk metadata + state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); + if (state != CHDERR_NONE) + { + throw emu_fatalerror("Failed to read CHD metadata"); + } + + // Parse the metadata + if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &m_cylinders, &m_heads, &m_sectors_per_track, &m_sectorsize) != 4) + { + throw emu_fatalerror("Invalid metadata"); + } + + // Load some tracks into the cache + for (int i=0; i < trackslots; i++) + { + logerror("%s: MFM HD allocate cache slot\n", tag()); + previous = current; + current = global_alloc(mfmhd_trackimage); + current->encdata = global_alloc_array(UINT16, TRACKIMAGE_SIZE); + + // Load the first tracks into the slots + state = load_track(current, i, 0, 32, 256, 4); + current->next = NULL; + + if (state != CHDERR_NONE) throw emu_fatalerror("Cannot load cylinder %d head %d from hard disk", i, 0); + + if (previous != NULL) + previous->next = current; + else + // Head + m_tracks = current; + } + + current = m_tracks; + + while (current != NULL) + { + logerror("%s: MFM HD cache: containing line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); + mfmhd_trackimage* currenttmp = current->next; + current = currenttmp; + } +} + +/* + Returns the linear sector number, given the CHS data. + + C,H,S + | 0,0,0 | 0,0,1 | 0,0,2 | ... + | 0,1,0 | 0,1,1 | 0,1,2 | ... + ... + | 1,0,0 | ... + ... +*/ +int mfmhd_trackimage_cache::chs_to_lba(int cylinder, int head, int sector) +{ + if ((cylinder < m_cylinders) && (head < m_heads) && (sector < m_sectors_per_track)) + { + return (cylinder * m_heads + head) * m_sectors_per_track + sector; + } + else return -1; +} + +/* + Delivers the track image. + First look up the track image in the cache. If not present, load it from + the CHD, convert it, and evict the least recently used line. + The searched track will be the first in m_tracks. +*/ +UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) +{ + // Search the cached track images + mfmhd_trackimage* current = m_tracks; + mfmhd_trackimage* previous = NULL; + + chd_error state = CHDERR_NONE; + + // Repeat the search. This loop should run at most twice; once for a direct hit, + // and twice on miss, then the second iteration will be a hit. + while (state == CHDERR_NONE) + { + // A simple linear search + while (current != NULL) + { + if (current->cylinder == cylinder && current->head == head) + { + // found it + // move it to the front of the chain for LRU + if (previous != NULL) + { + previous->next = current->next; // pull out here + current->next = m_tracks; // put the previous head into the next field + m_tracks = current; // set this line as new head + } + return current->encdata; + } + else + { + // Don't lose the pointer to the next tail + if (current->next != NULL) previous = current; + current = current->next; + } + } + // If we are here, we have a cache miss. + // Evict the last line + // Load the new line into that line + // Then look it up again, which will move it to the front + + // previous points to the second to last element + current = previous->next; + logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); + + if (current->dirty) write_back(current); + state = load_track(current, cylinder, head, 32, 256, 4); + } + // If we are here we have a CHD error. + return NULL; +} + +/* + Create MFM encoding. +*/ +void mfmhd_trackimage_cache::mfm_encode(mfmhd_trackimage* slot, int& position, UINT8 byte, int count) +{ + mfm_encode_mask(slot, position, byte, count, 0x00); +} + +void mfmhd_trackimage_cache::mfm_encode_a1(mfmhd_trackimage* slot, int& position) +{ + m_current_crc = 0xffff; + mfm_encode_mask(slot, position, 0xa1, 1, 0x04); + // 0x443b; CRC for A1 +} + +void mfmhd_trackimage_cache::mfm_encode_mask(mfmhd_trackimage* slot, int& position, UINT8 byte, int count, int mask) +{ + UINT16 encclock = 0; + UINT16 encdata = 0; + UINT8 thisbyte = byte; + bool mark = (mask != 0x00); + + m_current_crc = ccitt_crc16_one(m_current_crc, byte); + + for (int i=0; i < 8; i++) + { + encdata <<= 1; + encclock <<= 1; + + if (m_encoding == MFM_BITS || m_encoding == MFM_BYTE) + { + // skip one position for later interleaving + encdata <<= 1; + encclock <<= 1; + } + + if (thisbyte & 0x80) + { + // Encoding 1 => 01 + encdata |= 1; + m_lastbit = true; + } + else + { + // Encoding 0 => x0 + // If the bit in the mask is set, suppress the clock bit + // Also, if we use the simplified encoding, don't set the clock bits + if (m_lastbit == false && m_encoding != SEPARATED_SIMPLE && (mask & 0x80) == 0) encclock |= 1; + m_lastbit = false; + } + mask <<= 1; + // For simplified encoding, set all clock bits to indicate a mark + if (m_encoding == SEPARATED_SIMPLE && mark) encclock |= 1; + thisbyte <<= 1; + } + + if (m_encoding == MFM_BITS || m_encoding == MFM_BYTE) + encclock <<= 1; + else + encclock <<= 8; + + slot->encdata[position++] = (encclock | encdata); + + // When we write the byte multiple times, check whether the next encoding + // differs from the previous because of the last bit + + if (m_encoding == MFM_BITS || m_encoding == MFM_BYTE) + { + encclock &= 0x7fff; + if ((byte & 0x80)==0 && m_lastbit==false) encclock |= 0x8000; + } + + for (int j=1; j < count; j++) + { + slot->encdata[position++] = (encclock | encdata); + m_current_crc = ccitt_crc16_one(m_current_crc, byte); + } +} + +/* + Load a track from the CHD. +*/ +chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinder, int head, int sectorcount, int size, int interleave) +{ + chd_error state = CHDERR_NONE; + + UINT8 sector_content[1024]; + + logerror("%s: MFM HD cache: load cylinder=%d head=%d from CHD\n", tag(), cylinder, head); + + m_lastbit = false; + int position = 0; // will be incremented by each encode call + + // Gap 1 + mfm_encode(slot, position, 0x4e, 16); + + int sec_il_start = 0; + int sec_number = 0; + + // Round up + int delta = (sectorcount + interleave-1) / interleave; + + logerror("%02x %02x: ", cylinder&0xff, head&0xff); + for (int sector = 0; sector < sectorcount; sector++) + { + logerror("%02d ", sec_number); + // Sync gap + mfm_encode(slot, position, 0x00, 13); + + // Write IDAM + mfm_encode_a1(slot, position); + mfm_encode(slot, position, 0xfe); // ID field? + + // Write header + mfm_encode(slot, position, cylinder & 0xff); + mfm_encode(slot, position, head & 0xff); + mfm_encode(slot, position, sec_number); + mfm_encode(slot, position, (size >> 7)-1); + + // Write CRC for header. + int crc = m_current_crc; + mfm_encode(slot, position, (crc >> 8) & 0xff); + mfm_encode(slot, position, crc & 0xff); + + // Gap 2 + mfm_encode(slot, position, 0x4e, 3); + + // Sync + mfm_encode(slot, position, 0x00, 13); + + // Write DAM + mfm_encode_a1(slot, position); + mfm_encode(slot, position, 0xfb); + + // Get sector content from CHD + chd_error state = m_chd->read_units(chs_to_lba(cylinder, head, sec_number), sector_content); + if (state != CHDERR_NONE) + break; + + for (int i=0; i < size; i++) + mfm_encode(slot, position, sector_content[i]); + + // Write CRC for content. + crc = m_current_crc; + mfm_encode(slot, position, (crc >> 8) & 0xff); + mfm_encode(slot, position, crc & 0xff); + + // Gap 3 + mfm_encode(slot, position, 0x00, 3); + mfm_encode(slot, position, 0x4e, 19); + + // Calculate next sector number + sec_number += delta; + if (sec_number >= sectorcount) sec_number = ++sec_il_start; + } + + // Gap 4 + if (state == CHDERR_NONE) + { + // Fill the rest with 0x4e + mfm_encode(slot, position, 0x4e, TRACKIMAGE_SIZE-position); + logerror("\n"); + showtrack(slot->encdata, TRACKIMAGE_SIZE); + } + + slot->dirty = false; + slot->cylinder = cylinder; + slot->head = head; + + return state; +} + +/* + TODO: Maybe use a scheduled write-back in addition to the eviction. +*/ +void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) +{ + logerror("%s: MFM HD cache: write back cylinder=%d head=%d to CHD\n", tag(), slot->cylinder, slot->head); + slot->dirty = false; +} + +/* + For debugging. Outputs the byte array in a xxd-like way. +*/ +void mfmhd_trackimage_cache::showtrack(UINT16* enctrack, int length) +{ + for (int i=0; i < length; i+=16) + { + logerror("%07x: ", i); + for (int j=0; j < 16; j++) + { + logerror("%04x ", enctrack[i+j]); + } + logerror(" "); + logerror("\n"); + } +} + +// ================================================================ + +mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): + device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__), + device_slot_interface(mconfig, *this) +{ +} + +mfm_harddisk_connector::~mfm_harddisk_connector() +{ +} + +mfm_harddisk_device* mfm_harddisk_connector::get_device() +{ + return dynamic_cast(get_card_device()); +} + +void mfm_harddisk_connector::device_config_complete() +{ + mfm_harddisk_device *dev = get_device(); + if (dev != NULL) + dev->set_encoding(m_encoding); +} + +const device_type MFM_HD_CONNECTOR = &device_creator; + +// ================================================================ + // =========================================================================== // Legacy implementation // =========================================================================== diff --git a/src/emu/machine/ti99_hd.h b/src/emu/machine/ti99_hd.h index 7f2a5cddf7b..87de506398f 100644 --- a/src/emu/machine/ti99_hd.h +++ b/src/emu/machine/ti99_hd.h @@ -17,38 +17,112 @@ #include "emu.h" #include "imagedev/harddriv.h" +/* + Determine how data are passed from the hard disk to the controller. We + allow for different degrees of hardware emulation. +*/ +enum mfmhd_enc_t +{ + MFM_BITS, // One bit at a time + MFM_BYTE, // One data byte with interleaved clock bits + SEPARATED, // 8 clock bits (most sig byte), one data byte (least sig byte) + SEPARATED_SIMPLE // MSB: 00/FF (standard / mark) clock, LSB: one data byte +}; + +class mfmhd_trackimage +{ +public: + bool dirty; + int cylinder; + int head; + UINT16* encdata; // MFM encoding per byte + mfmhd_trackimage* next; +}; + +class mfmhd_trackimage_cache +{ +public: + mfmhd_trackimage_cache(); + ~mfmhd_trackimage_cache(); + void init(chd_file* chdfile, const char* tag, int trackslots, mfmhd_enc_t encoding); + UINT16* get_trackimage(int cylinder, int head); + +private: + void mfm_encode(mfmhd_trackimage* slot, int& position, UINT8 byte, int count=1); + void mfm_encode_a1(mfmhd_trackimage* slot, int& position); + void mfm_encode_mask(mfmhd_trackimage* slot, int& position, UINT8 byte, int count, int mask); + chd_error load_track(mfmhd_trackimage* slot, int cylinder, int head, int sectorcount, int size, int interleave); + void write_back(mfmhd_trackimage* timg); + int chs_to_lba(int cylinder, int head, int sector); + chd_file* m_chd; + + const char* m_tagdev; + mfmhd_trackimage* m_tracks; + mfmhd_enc_t m_encoding; + bool m_lastbit; + int m_current_crc; + int m_cylinders; + int m_heads; + int m_sectors_per_track; + int m_sectorsize; + void showtrack(UINT16* enctrack, int length); + const char* tag() { return m_tagdev; } +}; + class mfm_harddisk_device : public harddisk_image_device, public device_slot_card_interface { public: mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + ~mfm_harddisk_device(); typedef delegate index_pulse_cb; + typedef delegate ready_cb; typedef delegate seek_complete_cb; void setup_index_pulse_cb(index_pulse_cb cb); + void setup_ready_cb(ready_cb cb); void setup_seek_complete_cb(seek_complete_cb cb); + void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; } + mfmhd_enc_t get_encoding() { return m_encoding; } + // Active low lines. We're using ASSERT=0 / CLEAR=1 line_state ready_r() { return m_ready? ASSERT_LINE : CLEAR_LINE; } line_state seek_complete_r() { return m_seek_complete? ASSERT_LINE : CLEAR_LINE; } ; line_state trk00_r() { return m_current_cylinder==0? ASSERT_LINE : CLEAR_LINE; } + // Data output towards controller + bool read(attotime &from_when, const attotime &limit, UINT16 &data); + // Step void step_w(line_state line); void direction_in_w(line_state line); + // Head select + void headsel_w(int head) { m_current_head = head & 0x0f; } + + bool call_load(); + + // Tells us the time when the track ends (next index pulse) + attotime track_end_time(); + protected: void device_start(); + void device_stop(); void device_reset(); - emu_timer *m_index_timer, *m_spinup_timer, *m_seek_timer; - index_pulse_cb m_index_pulse_cb; - seek_complete_cb m_seek_complete_cb; void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + emu_timer *m_index_timer, *m_spinup_timer, *m_seek_timer; + index_pulse_cb m_index_pulse_cb; + ready_cb m_ready_cb; + seek_complete_cb m_seek_complete_cb; + private: + mfmhd_enc_t m_encoding; bool m_ready; int m_current_cylinder; + int m_current_head; int m_track_delta; int m_step_phase; bool m_seek_complete; @@ -57,6 +131,13 @@ private: bool m_autotruncation; line_state m_step_line; // keep the last state + attotime m_spinup_time; + attotime m_revolution_start_time; + attotime m_rev_time; + + mfmhd_trackimage_cache* m_cache; + + void prepare_track(int cylinder, int head); void head_move(); }; @@ -68,6 +149,33 @@ public: extern const device_type MFM_HD_GENERIC; +/* Connector for a MFM hard disk. See also floppy.c */ +class mfm_harddisk_connector : public device_t, + public device_slot_interface +{ +public: + mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ~mfm_harddisk_connector(); + + mfm_harddisk_device *get_device(); + + void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; } + +protected: + void device_start() { }; + void device_config_complete(); + +private: + mfmhd_enc_t m_encoding; +}; + +extern const device_type MFM_HD_CONNECTOR; + +#define MCFG_MFM_HARDDISK_ADD(_tag, _slot_intf, _def_slot, _enc) \ + MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ + static_cast(device)->set_encoding(_enc); + // =========================================================================== // Legacy implementation // =========================================================================== From b47963e5a208e96aa872824a8a98b5c93d8583e3 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Thu, 4 Jun 2015 20:55:45 +0300 Subject: [PATCH 159/284] pentagon.c: get to work all raster effects (nw) --- src/mess/drivers/pentagon.c | 20 ++++++++++++++++++++ src/mess/includes/spectrum.h | 2 +- src/mess/video/spectrum.c | 7 +++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/pentagon.c b/src/mess/drivers/pentagon.c index 874335ccd49..61265e75ab4 100644 --- a/src/mess/drivers/pentagon.c +++ b/src/mess/drivers/pentagon.c @@ -29,6 +29,8 @@ public: DECLARE_DIRECT_UPDATE_MEMBER(pentagon_direct); DECLARE_WRITE8_MEMBER(pentagon_port_7ffd_w); + DECLARE_WRITE8_MEMBER(pentagon_scr_w); + DECLARE_WRITE8_MEMBER(pentagon_scr2_w); DECLARE_MACHINE_RESET(pentagon); INTERRUPT_GEN_MEMBER(pentagon_interrupt); TIMER_CALLBACK_MEMBER(irq_on); @@ -132,6 +134,21 @@ WRITE8_MEMBER(pentagon_state::pentagon_port_7ffd_w) pentagon_update_memory(); } +WRITE8_MEMBER(pentagon_state::pentagon_scr_w) +{ + spectrum_UpdateScreenBitmap(); + + *((UINT8*)m_bank2->base() + offset) = data; +} + +WRITE8_MEMBER(pentagon_state::pentagon_scr2_w) +{ + if ((m_port_7ffd_data & 0x0f) == 0x0f || (m_port_7ffd_data & 0x0f) == 5) + spectrum_UpdateScreenBitmap(); + + *((UINT8*)m_bank4->base() + offset) = data; +} + void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch (id) @@ -184,6 +201,9 @@ MACHINE_RESET_MEMBER(pentagon_state,pentagon) space.install_read_bank(0x0000, 0x3fff, "bank1"); space.unmap_write(0x0000, 0x3fff); + space.install_write_handler(0x4000, 0x5aff, write8_delegate(FUNC(pentagon_state::pentagon_scr_w), this)); + space.install_write_handler(0xc000, 0xdaff, write8_delegate(FUNC(pentagon_state::pentagon_scr2_w), this)); + if (m_beta->started()) { if (strcmp(machine().system().name, "pent1024")==0) diff --git a/src/mess/includes/spectrum.h b/src/mess/includes/spectrum.h index d5dbae057b8..5795c1e3cc0 100644 --- a/src/mess/includes/spectrum.h +++ b/src/mess/includes/spectrum.h @@ -238,7 +238,7 @@ protected: optional_ioport m_io_plus4; void spectrum_UpdateBorderBitmap(); - void spectrum_UpdateScreenBitmap(); + void spectrum_UpdateScreenBitmap(bool eof = false); inline unsigned char get_display_color(unsigned char color, int invert); inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); void ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines); diff --git a/src/mess/video/spectrum.c b/src/mess/video/spectrum.c index 9eaed423e6f..c663aa5b865 100644 --- a/src/mess/video/spectrum.c +++ b/src/mess/video/spectrum.c @@ -71,7 +71,7 @@ void spectrum_state::screen_eof_spectrum(screen_device &screen, bool state) if (state) { spectrum_UpdateBorderBitmap(); - spectrum_UpdateScreenBitmap(); + spectrum_UpdateScreenBitmap(true); m_frame_number++; @@ -198,7 +198,7 @@ PALETTE_INIT_MEMBER(spectrum_state,spectrum) palette.set_pen_colors(0, spectrum_palette, ARRAY_LENGTH(spectrum_palette)); } -void spectrum_state::spectrum_UpdateScreenBitmap() +void spectrum_state::spectrum_UpdateScreenBitmap(bool eof) { unsigned int x = machine().first_screen()->hpos(); unsigned int y = machine().first_screen()->vpos(); @@ -206,6 +206,9 @@ void spectrum_state::spectrum_UpdateScreenBitmap() int height = m_screen_bitmap.height(); + if ((m_previous_screen_x == x) && (m_previous_screen_y == y) && !eof) + return; + if (m_screen_bitmap.valid()) { //printf("update screen from %d,%d to %d,%d\n", m_previous_screen_x, m_previous_screen_y, x, y); From 786e826c38cf302024c981b797c5e6b9c68f809c Mon Sep 17 00:00:00 2001 From: briantro Date: Thu, 4 Jun 2015 13:47:28 -0500 Subject: [PATCH 160/284] galaxian.c: Correct rom labels for the Stern Electronics license of The End. [caius] --- src/mame/drivers/galaxian.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index 83481bf31af..f48d47d4db5 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -9721,25 +9721,34 @@ ROM_START( theend ) ROM_LOAD( "6331-1j.86", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) ROM_END -ROM_START( theends ) +/* +All labels are in the form of: + +THE END (c) +RA3 13 +1980 STERN + +The above example is for IC13 +*/ +ROM_START( theends ) /* The Stern Electronics license */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ic13", 0x0000, 0x0800, CRC(90e5ab14) SHA1(b926801ab1cc1e2787a76ced6c7cffd6fce753d4) ) - ROM_LOAD( "ic14", 0x0800, 0x0800, CRC(950f0a07) SHA1(bde9f3c6cf060dc6f5b7652287b94e04bed7bcf7) ) - ROM_LOAD( "ic15", 0x1000, 0x0800, CRC(6786bcf5) SHA1(7556d3dc51d6a112b6357b8a36df05fd1a4d1cc9) ) - ROM_LOAD( "ic16", 0x1800, 0x0800, CRC(380a0017) SHA1(3354eb328a32537f722fe8a0949ddcab6cf21eb8) ) - ROM_LOAD( "ic17", 0x2000, 0x0800, CRC(af067b7f) SHA1(855c6ddf29fbfea004c7143fe29064abf53801ad) ) - ROM_LOAD( "ic18", 0x2800, 0x0800, CRC(a0411b93) SHA1(d644968758a1b73d13e09b24d24bfec82276e8f4) ) + ROM_LOAD( "the_end_ra3_13.ic13", 0x0000, 0x0800, CRC(90e5ab14) SHA1(b926801ab1cc1e2787a76ced6c7cffd6fce753d4) ) + ROM_LOAD( "the_end_ra3_14.ic14", 0x0800, 0x0800, CRC(950f0a07) SHA1(bde9f3c6cf060dc6f5b7652287b94e04bed7bcf7) ) + ROM_LOAD( "the_end_ra3_15.ic15", 0x1000, 0x0800, CRC(6786bcf5) SHA1(7556d3dc51d6a112b6357b8a36df05fd1a4d1cc9) ) + ROM_LOAD( "the_end_ra3_16.ic16", 0x1800, 0x0800, CRC(380a0017) SHA1(3354eb328a32537f722fe8a0949ddcab6cf21eb8) ) + ROM_LOAD( "the_end_ra3_17.ic17", 0x2000, 0x0800, CRC(af067b7f) SHA1(855c6ddf29fbfea004c7143fe29064abf53801ad) ) + ROM_LOAD( "the_end_ra3_18.ic18", 0x2800, 0x0800, CRC(a0411b93) SHA1(d644968758a1b73d13e09b24d24bfec82276e8f4) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "ic56", 0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) ) - ROM_LOAD( "ic55", 0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) ) + ROM_LOAD( "the_end_ra3_56.ic56", 0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) ) + ROM_LOAD( "the_end_ra3_55.ic55", 0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) ) ROM_REGION( 0x1000, "gfx1", 0 ) - ROM_LOAD( "ic30", 0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) ) - ROM_LOAD( "ic31", 0x0800, 0x0800, CRC(af6d09b6) SHA1(f3ad51dc88aa58fd39195ead978b039e0b0b585c) ) + ROM_LOAD( "the_end_ra3_30.ic30", 0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) ) + ROM_LOAD( "the_end_ra3_31.ic31", 0x0800, 0x0800, CRC(af6d09b6) SHA1(f3ad51dc88aa58fd39195ead978b039e0b0b585c) ) ROM_REGION( 0x0020, "proms", 0 ) - ROM_LOAD( "6331-1j.86", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) + ROM_LOAD( "6331-1j.86", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* no label for this chip */ ROM_END ROM_START( theendb ) From 0a794fd6ced96ea40653167af5877cc28c8c0db3 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 4 Jun 2015 22:31:47 +0200 Subject: [PATCH 161/284] srmp5.c: added save state support (nw) --- src/emu/sound/st0016.c | 5 +++++ src/mame/drivers/srmp5.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c index 4c75f3f7b02..d62332496cb 100644 --- a/src/emu/sound/st0016.c +++ b/src/emu/sound/st0016.c @@ -45,6 +45,11 @@ void st0016_device::device_start() { m_stream = stream_alloc(0, 2, 44100); m_ram_read_cb.resolve_safe(0); + + save_item(NAME(m_vpos)); + save_item(NAME(m_frac)); + save_item(NAME(m_lponce)); + save_item(NAME(m_regs)); } diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c index ec442c8ea2b..842340882b8 100644 --- a/src/mame/drivers/srmp5.c +++ b/src/mame/drivers/srmp5.c @@ -243,6 +243,15 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit void srmp5_state::machine_start() { membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000); + + save_item(NAME(m_input_select)); + save_item(NAME(m_cmd1)); + save_item(NAME(m_cmd2)); + save_item(NAME(m_cmd_stat)); + save_item(NAME(m_chrbank)); + save_pointer(NAME(m_tileram), 0x100000/2); + save_pointer(NAME(m_sprram), 0x80000/2); + save_item(NAME(m_vidregs)); } WRITE32_MEMBER(srmp5_state::bank_w) @@ -610,4 +619,4 @@ DRIVER_INIT_MEMBER(srmp5_state,srmp5) #endif } -GAME( 1994, srmp5, 0, srmp5, srmp5, srmp5_state, srmp5, ROT0, "Seta", "Super Real Mahjong P5", GAME_IMPERFECT_GRAPHICS) +GAME( 1994, srmp5, 0, srmp5, srmp5, srmp5_state, srmp5, ROT0, "Seta", "Super Real Mahjong P5", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) From 3a9f5f622a4799d67410f620b4c7fbbde1422fd5 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 4 Jun 2015 22:43:00 +0200 Subject: [PATCH 162/284] nbmj8991.c: added save state support (nw) --- src/mame/drivers/nbmj8991.c | 110 +++++++++++++++-------------------- src/mame/includes/nbmj8991.h | 40 ++++++++----- src/mame/video/nbmj8991.c | 65 ++++++++++++++++----- 3 files changed, 124 insertions(+), 91 deletions(-) diff --git a/src/mame/drivers/nbmj8991.c b/src/mame/drivers/nbmj8991.c index cf83c2ac81b..fedf55349c2 100644 --- a/src/mame/drivers/nbmj8991.c +++ b/src/mame/drivers/nbmj8991.c @@ -39,29 +39,15 @@ Notes: #include "machine/nvram.h" -WRITE8_MEMBER(nbmj8991_state::nbmj8991_soundbank_w) +WRITE8_MEMBER(nbmj8991_state::soundbank_w) { if (!(data & 0x80)) soundlatch_clear_byte_w(space, 0, 0); membank("bank1")->set_entry(data & 0x03); } -WRITE8_MEMBER(nbmj8991_state::nbmj8991_sound_w) -{ - soundlatch_byte_w(space, 0, data); -} - -READ8_MEMBER(nbmj8991_state::nbmj8991_sound_r) -{ - int data; - - data = soundlatch_byte_r(space,0); - return data; -} - void nbmj8991_state::machine_reset() { - device_t *audiocpu = m_audiocpu; - if (audiocpu != NULL && audiocpu->type() == Z80) + if (m_audiocpu) { membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x8000, 0x8000); membank("bank1")->set_entry(0); @@ -109,70 +95,70 @@ DRIVER_INIT_MEMBER(nbmj8991_state,tokimbsj) static ADDRESS_MAP_START( pstadium_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) - AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram") + AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w) + AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram") AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // finalbny ADDRESS_MAP_END static ADDRESS_MAP_START( triplew1_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram") - AM_RANGE(0xf200, 0xf20f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) + AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram") + AM_RANGE(0xf200, 0xf20f) AM_READWRITE(clut_r,clut_w) AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // mjgottub ADDRESS_MAP_END static ADDRESS_MAP_START( triplew2_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram") - AM_RANGE(0xf400, 0xf40f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) + AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram") + AM_RANGE(0xf400, 0xf40f) AM_READWRITE(clut_r,clut_w) AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( mjlstory_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram") - AM_RANGE(0xf700, 0xf70f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) + AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram") + AM_RANGE(0xf700, 0xf70f) AM_READWRITE(clut_r,clut_w) AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( galkoku_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) - AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(nbmj8991_palette_type1_w) AM_SHARE("paletteram") + AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w) + AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(palette_type1_w) AM_SHARE("paletteram") AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // hyouban ADDRESS_MAP_END static ADDRESS_MAP_START( galkaika_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) - AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(nbmj8991_palette_type2_w) AM_SHARE("paletteram") + AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w) + AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(palette_type2_w) AM_SHARE("paletteram") AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // tokimbsj ADDRESS_MAP_END static ADDRESS_MAP_START( tokyogal_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type2_w) AM_SHARE("paletteram") - AM_RANGE(0xf400, 0xf40f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) + AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type2_w) AM_SHARE("paletteram") + AM_RANGE(0xf400, 0xf40f) AM_READWRITE(clut_r,clut_w) AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( av2mj1bb_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram") - AM_RANGE(0xf500, 0xf50f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) + AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram") + AM_RANGE(0xf500, 0xf50f) AM_READWRITE(clut_r,clut_w) AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( av2mj2rg_map, AS_PROGRAM, 8, nbmj8991_state ) AM_RANGE(0x0000, 0xefff) AM_ROM - AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w) - AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram") + AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w) + AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram") AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( galkoku_io_map, AS_IO, 8, nbmj8991_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(nbmj8991_blitter_w) + AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(blitter_w) AM_RANGE(0x80, 0x81) AM_DEVWRITE("fmsnd", ym3812_device, write) AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r) AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w) @@ -186,7 +172,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( hyouban_io_map, AS_IO, 8, nbmj8991_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(nbmj8991_blitter_w) + AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(blitter_w) AM_RANGE(0x81, 0x81) AM_DEVREAD("fmsnd", ay8910_device, data_r) AM_RANGE(0x82, 0x83) AM_DEVWRITE("fmsnd", ay8910_device, data_address_w) AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r) @@ -201,8 +187,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( pstadium_io_map, AS_IO, 8, nbmj8991_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x7f) AM_WRITE(nbmj8991_blitter_w) - AM_RANGE(0x80, 0x80) AM_WRITE(nbmj8991_sound_w) + AM_RANGE(0x00, 0x7f) AM_WRITE(blitter_w) + AM_RANGE(0x80, 0x80) AM_WRITE(soundlatch_byte_w) AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r) AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w) AM_RANGE(0xb0, 0xb0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport2_r) //AM_WRITENOP @@ -214,8 +200,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( av2mj1bb_io_map, AS_IO, 8, nbmj8991_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x7f) AM_WRITE(nbmj8991_blitter_w) - AM_RANGE(0x80, 0x80) AM_WRITE(nbmj8991_sound_w) + AM_RANGE(0x00, 0x7f) AM_WRITE(blitter_w) + AM_RANGE(0x80, 0x80) AM_WRITE(soundlatch_byte_w) AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r) AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w) AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, vcrctrl_w) @@ -235,9 +221,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( nbmj8991_sound_io_map, AS_IO, 8, nbmj8991_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(nbmj8991_sound_r) AM_DEVWRITE("dac1", dac_device, write_unsigned8) + AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_DEVWRITE("dac1", dac_device, write_unsigned8) AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac2", dac_device, write_unsigned8) - AM_RANGE(0x04, 0x04) AM_WRITE(nbmj8991_soundbank_w) + AM_RANGE(0x04, 0x04) AM_WRITE(soundbank_w) AM_RANGE(0x06, 0x06) AM_WRITENOP AM_RANGE(0x80, 0x81) AM_DEVWRITE("fmsnd", ym3812_device, write) ADDRESS_MAP_END @@ -1401,7 +1387,7 @@ static MACHINE_CONFIG_START( nbmjdrv1, nbmj8991_state ) // galkoku MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(1024, 512) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_nbmj8991_type1) + MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_type1) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 256) @@ -1437,7 +1423,7 @@ static MACHINE_CONFIG_START( nbmjdrv2, nbmj8991_state ) // pstadium MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(1024, 512) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_nbmj8991_type2) + MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_type2) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 256) @@ -2148,21 +2134,21 @@ ROM_START( av2mj2rg ) ROM_END -GAME( 1989, galkoku, 0, galkoku, galkoku, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kokuhaku (Japan)", 0 ) -GAME( 1989, hyouban, galkoku, hyouban, hyouban, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Hyouban Musume [BET] (Japan)", 0 ) -GAME( 1989, galkaika, 0, galkaika, galkaika, nbmj8991_state, galkaika, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kaika (Japan)", 0 ) -GAME( 1989, tokyogal, 0, tokyogal, tokyogal, nbmj8991_state, tokyogal, ROT180, "Nichibutsu", "Tokyo Gal Zukan (Japan)", 0 ) -GAME( 1989, tokimbsj, tokyogal, tokimbsj, tokimbsj, nbmj8991_state, tokimbsj, ROT180, "Nichibutsu", "Tokimeki Bishoujo [BET] (Japan)", 0 ) -GAME( 1989, mcontest, 0, mcontest, mcontest, driver_device, 0, ROT180, "Nichibutsu", "Miss Mahjong Contest (Japan)", 0 ) -GAME( 1989, uchuuai, 0, uchuuai, uchuuai, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Uchuu yori Ai wo komete (Japan)", 0 ) -GAME( 1989, triplew1, 0, triplew1, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars (Japan)", 0 ) -GAME( 1990, pstadium, 0, pstadium, pstadium, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Panic Stadium (Japan)", 0 ) -GAME( 1990, triplew2, 0, triplew2, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars 2 (Japan)", 0 ) -GAME( 1990, ntopstar, 0, ntopstar, ntopstar, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Nerae! Top Star (Japan)", 0 ) -GAME( 1991, mjlstory, 0, mjlstory, mjlstory, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Jikken Love Story (Japan)", 0 ) -GAME( 1991, vanilla, 0, vanilla, vanilla, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Vanilla Syndrome (Japan)", 0 ) -GAME( 1991, finalbny, vanilla, finalbny, finalbny, nbmj8991_state, finalbny, ROT180, "Nichibutsu", "Mahjong Final Bunny [BET] (Japan)", 0 ) -GAME( 1991, qmhayaku, 0, qmhayaku, qmhayaku, driver_device, 0, ROT180, "Nichibutsu", "Quiz-Mahjong Hayaku Yatteyo! (Japan)", 0 ) -GAME( 1991, mjgottub, 0, mjgottub, mjgottub, driver_device, 0, ROT180, "Nichibutsu", "Medal Mahjong Gottsu ee-kanji [BET] (Japan)", 0 ) -GAME( 1991, av2mj1bb, 0, av2mj1bb, av2mj1bb, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.1 Bay Bridge no Seijo (Japan)", GAME_NOT_WORKING ) -GAME( 1991, av2mj2rg, 0, av2mj2rg, av2mj2rg, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.2 Rouge no Kaori (Japan)", GAME_NOT_WORKING ) +GAME( 1989, galkoku, 0, galkoku, galkoku, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kokuhaku (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, hyouban, galkoku, hyouban, hyouban, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Hyouban Musume [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, galkaika, 0, galkaika, galkaika, nbmj8991_state, galkaika, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kaika (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, tokyogal, 0, tokyogal, tokyogal, nbmj8991_state, tokyogal, ROT180, "Nichibutsu", "Tokyo Gal Zukan (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, tokimbsj, tokyogal, tokimbsj, tokimbsj, nbmj8991_state, tokimbsj, ROT180, "Nichibutsu", "Tokimeki Bishoujo [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, mcontest, 0, mcontest, mcontest, driver_device, 0, ROT180, "Nichibutsu", "Miss Mahjong Contest (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, uchuuai, 0, uchuuai, uchuuai, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Uchuu yori Ai wo komete (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, triplew1, 0, triplew1, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1990, pstadium, 0, pstadium, pstadium, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Panic Stadium (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1990, triplew2, 0, triplew2, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars 2 (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1990, ntopstar, 0, ntopstar, ntopstar, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Nerae! Top Star (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1991, mjlstory, 0, mjlstory, mjlstory, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Jikken Love Story (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1991, vanilla, 0, vanilla, vanilla, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Vanilla Syndrome (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1991, finalbny, vanilla, finalbny, finalbny, nbmj8991_state, finalbny, ROT180, "Nichibutsu", "Mahjong Final Bunny [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1991, qmhayaku, 0, qmhayaku, qmhayaku, driver_device, 0, ROT180, "Nichibutsu", "Quiz-Mahjong Hayaku Yatteyo! (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1991, mjgottub, 0, mjgottub, mjgottub, driver_device, 0, ROT180, "Nichibutsu", "Medal Mahjong Gottsu ee-kanji [BET] (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1991, av2mj1bb, 0, av2mj1bb, av2mj1bb, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.1 Bay Bridge no Seijo (Japan)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) +GAME( 1991, av2mj2rg, 0, av2mj2rg, av2mj2rg, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.2 Rouge no Kaori (Japan)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/nbmj8991.h b/src/mame/includes/nbmj8991.h index 580e171f66c..309041968cc 100644 --- a/src/mame/includes/nbmj8991.h +++ b/src/mame/includes/nbmj8991.h @@ -19,8 +19,14 @@ public: required_device m_nb1413m3; required_device m_screen; required_device m_palette; + required_shared_ptr m_generic_paletteram_8; + enum + { + TIMER_BLITTER + }; + int m_scrollx; int m_scrolly; int m_blitter_destx; @@ -39,26 +45,32 @@ public: UINT8 *m_videoram; UINT8 *m_clut; int m_flipscreen_old; - DECLARE_WRITE8_MEMBER(nbmj8991_soundbank_w); - DECLARE_WRITE8_MEMBER(nbmj8991_sound_w); - DECLARE_READ8_MEMBER(nbmj8991_sound_r); - DECLARE_WRITE8_MEMBER(nbmj8991_palette_type1_w); - DECLARE_WRITE8_MEMBER(nbmj8991_palette_type2_w); - DECLARE_WRITE8_MEMBER(nbmj8991_palette_type3_w); - DECLARE_WRITE8_MEMBER(nbmj8991_blitter_w); - DECLARE_READ8_MEMBER(nbmj8991_clut_r); - DECLARE_WRITE8_MEMBER(nbmj8991_clut_w); + emu_timer *m_blitter_timer; + + DECLARE_WRITE8_MEMBER(soundbank_w); + DECLARE_WRITE8_MEMBER(palette_type1_w); + DECLARE_WRITE8_MEMBER(palette_type2_w); + DECLARE_WRITE8_MEMBER(palette_type3_w); + DECLARE_WRITE8_MEMBER(blitter_w); + DECLARE_READ8_MEMBER(clut_r); + DECLARE_WRITE8_MEMBER(clut_w); DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_busyflag_r); + DECLARE_DRIVER_INIT(galkaika); DECLARE_DRIVER_INIT(tokimbsj); DECLARE_DRIVER_INIT(tokyogal); DECLARE_DRIVER_INIT(finalbny); virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update_nbmj8991_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_nbmj8991_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(blitter_timer_callback); - void nbmj8991_vramflip(); + + UINT32 screen_update_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void vramflip(); void update_pixel(int x, int y); - void nbmj8991_gfxdraw(); + void gfxdraw(); + + void postload(); + +protected: + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); }; diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c index 05250aea3b2..c07a598c27c 100644 --- a/src/mame/video/nbmj8991.c +++ b/src/mame/video/nbmj8991.c @@ -16,7 +16,7 @@ ******************************************************************************/ -WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type1_w) +WRITE8_MEMBER(nbmj8991_state::palette_type1_w) { int r, g, b; @@ -33,7 +33,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type1_w) m_palette->set_pen_color((offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b)); } -WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type2_w) +WRITE8_MEMBER(nbmj8991_state::palette_type2_w) { int r, g, b; @@ -50,7 +50,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type2_w) m_palette->set_pen_color((offset / 2), pal5bit(r), pal5bit(g), pal5bit(b)); } -WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type3_w) +WRITE8_MEMBER(nbmj8991_state::palette_type3_w) { int r, g, b; @@ -71,7 +71,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type3_w) ******************************************************************************/ -WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w) +WRITE8_MEMBER(nbmj8991_state::blitter_w) { int gfxlen = memregion("gfx1")->bytes(); @@ -84,13 +84,13 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w) case 0x04: m_blitter_sizex = data; break; case 0x05: m_blitter_sizey = data; /* writing here also starts the blit */ - nbmj8991_gfxdraw(); + gfxdraw(); break; case 0x06: m_blitter_direction_x = (data & 0x01) ? 1 : 0; m_blitter_direction_y = (data & 0x02) ? 1 : 0; m_flipscreen = (data & 0x04) ? 0 : 1; m_dispflag = (data & 0x10) ? 0 : 1; - nbmj8991_vramflip(); + vramflip(); break; case 0x07: break; case 0x10: m_blitter_destx = (m_blitter_destx & 0xff00) | data; break; @@ -115,12 +115,12 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w) } } -READ8_MEMBER(nbmj8991_state::nbmj8991_clut_r) +READ8_MEMBER(nbmj8991_state::clut_r) { return m_clut[offset]; } -WRITE8_MEMBER(nbmj8991_state::nbmj8991_clut_w) +WRITE8_MEMBER(nbmj8991_state::clut_w) { m_clut[((m_clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data; } @@ -129,7 +129,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_clut_w) ******************************************************************************/ -void nbmj8991_state::nbmj8991_vramflip() +void nbmj8991_state::vramflip() { int x, y; UINT8 color1, color2; @@ -165,12 +165,19 @@ void nbmj8991_state::update_pixel(int x, int y) m_tmpbitmap.pix16(y, x) = color; } -TIMER_CALLBACK_MEMBER(nbmj8991_state::blitter_timer_callback) +void nbmj8991_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - m_nb1413m3->m_busyflag = 1; + switch (id) + { + case TIMER_BLITTER: + m_nb1413m3->m_busyflag = 1; + break; + default: + assert_always(FALSE, "Unknown id in nbmj8991_state::device_timer"); + } } -void nbmj8991_state::nbmj8991_gfxdraw() +void nbmj8991_state::gfxdraw() { UINT8 *GFX = memregion("gfx1")->base(); int width = m_screen->width(); @@ -272,7 +279,7 @@ void nbmj8991_state::nbmj8991_gfxdraw() } m_nb1413m3->m_busyflag = 0; - machine().scheduler().timer_set(attotime::from_nsec(1650) * m_nb1413m3->m_busyctr, timer_expired_delegate(FUNC(nbmj8991_state::blitter_timer_callback),this)); + m_blitter_timer->adjust(attotime::from_nsec(1650) * m_nb1413m3->m_busyctr); } /****************************************************************************** @@ -281,6 +288,8 @@ void nbmj8991_state::nbmj8991_gfxdraw() ******************************************************************************/ void nbmj8991_state::video_start() { + m_blitter_timer = timer_alloc(TIMER_BLITTER); + int width = m_screen->width(); int height = m_screen->height(); @@ -288,9 +297,35 @@ void nbmj8991_state::video_start() m_videoram = auto_alloc_array(machine(), UINT8, width * height); m_clut = auto_alloc_array(machine(), UINT8, 0x800); memset(m_videoram, 0x00, (width * height * sizeof(UINT8))); + + m_screen_refresh = 1; + + save_item(NAME(m_scrollx)); + save_item(NAME(m_scrolly)); + save_item(NAME(m_blitter_destx)); + save_item(NAME(m_blitter_desty)); + save_item(NAME(m_blitter_sizex)); + save_item(NAME(m_blitter_sizey)); + save_item(NAME(m_blitter_src_addr)); + save_item(NAME(m_blitter_direction_x)); + save_item(NAME(m_blitter_direction_y)); + save_item(NAME(m_gfxrom)); + save_item(NAME(m_dispflag)); + save_item(NAME(m_flipscreen)); + save_item(NAME(m_clutsel)); + save_pointer(NAME(m_videoram), width * height); + save_pointer(NAME(m_clut), 0x800); + save_item(NAME(m_flipscreen_old)); + + machine().save().register_postload(save_prepost_delegate(FUNC(nbmj8991_state::postload), this)); } -UINT32 nbmj8991_state::screen_update_nbmj8991_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void nbmj8991_state::postload() +{ + m_screen_refresh = 1; +} + +UINT32 nbmj8991_state::screen_update_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; @@ -329,7 +364,7 @@ UINT32 nbmj8991_state::screen_update_nbmj8991_type1(screen_device &screen, bitma return 0; } -UINT32 nbmj8991_state::screen_update_nbmj8991_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 nbmj8991_state::screen_update_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; From cacb9bb1b5c45d4ec3bd885917fca04a298ba340 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 4 Jun 2015 23:21:16 +0200 Subject: [PATCH 163/284] added HLT line (it's used by alpha denshi protection mcu) --- src/emu/cpu/hmcs40/hmcs40.c | 28 +++++++++++++++++++++++++++- src/emu/cpu/hmcs40/hmcs40.h | 10 +++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c index 1adef6ea242..1d44e7d97ce 100644 --- a/src/emu/cpu/hmcs40/hmcs40.c +++ b/src/emu/cpu/hmcs40/hmcs40.c @@ -215,6 +215,7 @@ void hmcs40_cpu_device::device_start() m_prev_op = 0; m_i = 0; m_eint_line = 0; + m_halt = 0; m_pc = 0; m_prev_pc = 0; m_page = 0; @@ -242,6 +243,8 @@ void hmcs40_cpu_device::device_start() save_item(NAME(m_prev_op)); save_item(NAME(m_i)); save_item(NAME(m_eint_line)); + save_item(NAME(m_halt)); + save_item(NAME(m_timer_halted_remain)); save_item(NAME(m_pc)); save_item(NAME(m_prev_pc)); save_item(NAME(m_page)); @@ -477,9 +480,25 @@ void hmcs40_cpu_device::do_interrupt() void hmcs40_cpu_device::execute_set_input(int line, int state) { + state = (state) ? 1 : 0; + + // halt/unhalt mcu + if (line == HMCS40_INPUT_LINE_HLT && state != m_halt) + { + if (state) + { + m_timer_halted_remain = m_timer->remaining(); + m_timer->reset(); + } + else + m_timer->adjust(m_timer_halted_remain); + + m_halt = state; + return; + } + if (line != 0 && line != 1) return; - state = (state) ? 1 : 0; // external interrupt request on rising edge if (state && !m_int[line]) @@ -551,6 +570,13 @@ inline void hmcs40_cpu_device::increment_pc() void hmcs40_cpu_device::execute_run() { + // in HLT state, the internal clock is not running + if (m_halt) + { + m_icount = 0; + return; + } + while (m_icount > 0) { // LPU is handled 1 cycle later diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h index 9e722f595a6..8b912739541 100644 --- a/src/emu/cpu/hmcs40/hmcs40.h +++ b/src/emu/cpu/hmcs40/hmcs40.h @@ -26,7 +26,6 @@ #define MCFG_HMCS40_WRITE_D_CB(_devcb) \ hmcs40_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb); - enum { HMCS40_PORT_R0X = 0, @@ -39,6 +38,13 @@ enum HMCS40_PORT_R7X }; +enum +{ + HMCS40_INPUT_LINE_INT0 = 0, + HMCS40_INPUT_LINE_INT1, + HMCS40_INPUT_LINE_HLT +}; + // pinout reference @@ -181,6 +187,8 @@ protected: UINT8 m_i; // 4-bit immediate opcode param int m_eint_line; // which input_line caused an interrupt emu_timer *m_timer; + int m_halt; // internal HLT state + attotime m_timer_halted_remain; int m_icount; UINT16 m_pc; // Program Counter From f668e0465d59fbcfeeefd283dae13ff76fd209cc Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Fri, 5 Jun 2015 10:53:41 +1200 Subject: [PATCH 164/284] pc_vga: force PEL shift to 0 after a line compare, and move latch release to the end of VBLANK. Fixes Jazz Jackrabbit scrolling (do let me know if there are any regressions). --- src/emu/video/pc_vga.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index 7ce3eacf9c0..c494e4904ec 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -221,7 +221,7 @@ TIMER_CALLBACK_MEMBER(vga_device::vblank_timer_cb) { vga.crtc.start_addr = vga.crtc.start_addr_latch; vga.attribute.pel_shift = vga.attribute.pel_shift_latch; - m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) ); + m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) ); } void vga_device::device_start() @@ -471,7 +471,10 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect) if((line + yi) < (vga.crtc.line_compare & mask_comp)) curr_addr = addr; if((line + yi) == (vga.crtc.line_compare & mask_comp)) + { curr_addr = 0; + pel_shift = 0; + } bitmapline = &bitmap.pix32(line + yi); for (pos=curr_addr, c=0, column=0; columnconfigure((hblank_period), (vblank_period), visarea, refresh ); //popmessage("%d %d\n",vga.crtc.horz_total * 8,vga.crtc.vert_total); - m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) ); + m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) ); } void vga_device::recompute_params() From 6547846f4ecddaab259f2e2e87f8430ce79bd066 Mon Sep 17 00:00:00 2001 From: NJRoadfan Date: Thu, 4 Jun 2015 21:47:49 -0400 Subject: [PATCH 165/284] Improve Ensoniq 5503DOC Swap Mode If one oscillator is in swap mode, its partner should be treated as being in swap mode, even if it is set to one shot. This behavior is undocumented in literature from Ensoniq, but exploited by software developers. This change allows Ninjaforce's NinjaTracker to correctly play looped instruments. --- src/emu/sound/es5503.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c index fd2d52c4545..9364aa8065d 100644 --- a/src/emu/sound/es5503.c +++ b/src/emu/sound/es5503.c @@ -128,9 +128,10 @@ void es5503_device::halt_osc(int onum, int type, UINT32 *accumulator, int resshi *accumulator = altram << resshift; } + int omode = (pPartner->control>>1) & 3; // if swap mode, start the partner - if (mode == MODE_SWAP) + if ((mode == MODE_SWAP) || (omode == MODE_SWAP)) { pPartner->control &= ~1; // clear the halt bit pPartner->accumulator = 0; // and make sure it starts from the top (does this also need phase preservation?) From d2069090120011ca9a91631654dc5d655c6c7a30 Mon Sep 17 00:00:00 2001 From: briantro Date: Thu, 4 Jun 2015 23:08:43 -0500 Subject: [PATCH 166/284] Minor rom name correction for Stern's The End - NW --- src/mame/drivers/galaxian.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index f48d47d4db5..3accadfaf72 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -9741,7 +9741,7 @@ ROM_START( theends ) /* The Stern Electronics license */ ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "the_end_ra3_56.ic56", 0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) ) - ROM_LOAD( "the_end_ra3_55.ic55", 0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) ) + ROM_LOAD( "the_end_ra2_55.ic55", 0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) ) ROM_REGION( 0x1000, "gfx1", 0 ) ROM_LOAD( "the_end_ra3_30.ic30", 0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) ) From 70c0ad5b8021cb3e21ec2c5e0d8fbb5529482a59 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Fri, 5 Jun 2015 01:40:07 -0400 Subject: [PATCH 167/284] game list fixes from Diet Go Go Fan (nw) game list fixes from Diet Go Go Fan (nw) --- src/mame/drivers/meadwttl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mame/drivers/meadwttl.c b/src/mame/drivers/meadwttl.c index 4aa84777f65..070ba3006b6 100644 --- a/src/mame/drivers/meadwttl.c +++ b/src/mame/drivers/meadwttl.c @@ -5,13 +5,11 @@ Meadows Discrete Game List Bombs Away (1976) - Bonkers (1977) Ckidzo (1976) Cobra Gunship (1976) Drop Zone 4 (1975) Flim Flam (1974) Gridiron (1977) - Knock-Out (1977) Meadows 4 in 1 (197?) Star Shooter (1975) From c8976b314be1bc7c67b0409c79a9797f7fa9be39 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Fri, 5 Jun 2015 01:48:26 -0400 Subject: [PATCH 168/284] game list fixes from Diet Go Go Fan (nw) game list fixes from Diet Go Go Fan (nw) --- src/mame/drivers/taitottl.c | 102 ++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/mame/drivers/taitottl.c b/src/mame/drivers/taitottl.c index c0b7d3ee456..c1327509c02 100644 --- a/src/mame/drivers/taitottl.c +++ b/src/mame/drivers/taitottl.c @@ -5,57 +5,57 @@ Taito Discrete Hardware Games - Game Name(s) Part #'s Data PROM/ROM Chip Numbers - --------------------------------------------------------------+--------------+---------+--------------------------------------- - Astro Race (11/1973) UNKNOWN - Anti-Aircraft (1975) (clone of Atari's Anti-Aircraft) YES - Attack (09/1976) UNKNOWN - Attack UFO (08/1974) UNKNOWN - Avenger (??/1976) (clone of Electra's Avenger) YES - Ball Park/TT Ball Park (??/1974) (clone of Midway's Ball Park) YES - Basketball (04/1974) (clone of Midway's TV Basketball) YES - Bombs Away (??/1977) (clone of Meadows' Bombs Away) YES - Cisco/Fisco 400 (04/1977) UNKNOWN - Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) YES - Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) YES - Crashing Race (06/1976) UNKNOWN - Cross Fire (08/1977) (clone of PSE's Bazooka) YES - Davis Cup (12/1973) UNKNOWN - Dead Heat (??/1975) UNKNOWN - Elepong (07/1973) UNKNOWN - Flying Fortress (??/1977) UNKNOWN - Flying Fortress II (06/1977) UNKNOWN - Gunman (10/1977) YES 8 x 32bytes (or 11? ) - Interceptor (03/1976) UNKNOWN - Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes) - Pro Hockey (11/1973) UNKNOWN - Road Champion (04/1977) UNKNOWN - Road Champion S (06/1977) UNKNOWN - Soccer (11/1973) UNKNOWN - Soccer DX (??/1977) UNKNOWN - Speed Race (11/1974) UNKNOWN - Speed Race CL-5 (10/1978) UNKNOWN - Speed Race Color (10/1978) UNKNOWN - Speed Race DX (08/1975) UNKNOWN - Speed Race Twin (04/1976) UNKNOWN - Speed Race GP-5 (??/1980) UNKNOWN - Super Block (02/1978) UNKNOWN - Super High-Way (10/1977)? UNKNOWN - Super Speed Race (12/1977) UNKNOWN - Super Speed Race V (07/1978) UNKNOWN - Super Speed Race GP-V (??/1980) UNKNOWN - Table Football (??/1977) UNKNOWN - Tahitian (??/1975) UNKNOWN - Tennis (??/1977) UNKNOWN - T. T. Ball Park (??/1974) (clone of Midway's Ball Park) YES - T. T. Block (08/1977) YES 1 x 2048bytes - T. T. Block C (05/1978) UNKNOWN - T. T. Block CU (08/1978) UNKNOWN - T. T. Speed Race (??/1978) UNKNOWN - Wall Block (08/1978) UNKNOWN - Wall Break (01/1977) UNKNOWN - Western Gun (09/1975) UNKNOWN - Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes) + Game Name(s) Part #'s Data PROM/ROM Chip Numbers + ----------------------------------------------------------------+--------------+---------+--------------------------------------- + Astro Race (11/1973) (clone of Atari's Space Race) UNKNOWN + Anti-Aircraft (1975) (clone of Atari's Anti-Aircraft) YES + Attack (09/1976) UNKNOWN + Attack UFO (08/1974) UNKNOWN + Avenger (??/1976) (clone of Electra's Avenger) YES + Ball Park/TT Ball Park (??/1974) (clone of Midway's Ball Park) YES + Basketball (04/1974) (clone of Midway's TV Basketball) YES + Bombs Away (??/1977) (clone of Meadows' Bombs Away) YES + Cisco/Fisco 400 (04/1977) UNKNOWN + Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) YES + Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) YES + Crashing Race (06/1976) (clone of Atari's Crash'n Score?) UNKNOWN + Cross Fire (08/1977) (clone of PSE's Bazooka) YES + Davis Cup (12/1973) (clone of Atari's Coupe Davis / Pong Doubles?) UNKNOWN + Dead Heat (??/1975) UNKNOWN + Elepong (07/1973) UNKNOWN + Flying Fortress (??/1977) (clone of Electra's Flying Fortress?) UNKNOWN + Flying Fortress II (06/1977) UNKNOWN + Gunman (10/1977) YES 8 x 32bytes (or 11? ) + Interceptor (03/1976) UNKNOWN + Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes) + Pro Hockey (11/1973) UNKNOWN + Road Champion (04/1977) (clone of Williams' Road Champion?) UNKNOWN + Road Champion S (06/1977) UNKNOWN + Soccer (11/1973) UNKNOWN + Soccer DX (??/1977) UNKNOWN + Speed Race (11/1974) UNKNOWN + Speed Race CL-5 (10/1978) UNKNOWN + Speed Race Color (10/1978) UNKNOWN + Speed Race DX (08/1975) UNKNOWN + Speed Race Twin (04/1976) UNKNOWN + Speed Race GP-5 (??/1980) UNKNOWN + Super Block (02/1978) UNKNOWN + Super High-Way (10/1977)? UNKNOWN + Super Speed Race (12/1977) UNKNOWN + Super Speed Race V (07/1978) UNKNOWN + Super Speed Race GP-V (??/1980) UNKNOWN + Table Football (??/1977) (clone of Exidy's Table Football?) UNKNOWN + Tahitian (??/1975) UNKNOWN + Tennis (??/1977) UNKNOWN + T. T. Ball Park (??/1974) (clone of Midway's Ball Park) YES + T. T. Block (08/1977) YES 1 x 2048bytes + T. T. Block C (05/1978) UNKNOWN + T. T. Block CU (08/1978) UNKNOWN + T. T. Speed Race (??/1978) UNKNOWN + Wall Block (08/1978) UNKNOWN + Wall Break (01/1977) UNKNOWN + Western Gun (09/1975) UNKNOWN + Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes) ***************************************************************************/ From a2cadb6cf7adceb650ee2c97862692205680d8bb Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Fri, 5 Jun 2015 09:09:04 +0300 Subject: [PATCH 169/284] mos6526: Fixed port A/B read. [geecab] --- src/emu/machine/mos6526.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/emu/machine/mos6526.c b/src/emu/machine/mos6526.c index e65070d3d67..3d9561b36f7 100644 --- a/src/emu/machine/mos6526.c +++ b/src/emu/machine/mos6526.c @@ -809,12 +809,18 @@ READ8_MEMBER( mos6526_device::read ) switch (offset & 0x0f) { case PRA: - data = (m_read_pa(0) & ~m_ddra) | (m_pra & m_ddra); + if (m_ddra != 0xff) + data = (m_read_pa(0) & ~m_ddra) | (m_pra & m_ddra); + else + data = m_read_pa(0) & m_pra; m_pa_in = data; break; case PRB: - data = (m_read_pb(0) & ~m_ddrb) | (m_prb & m_ddrb); + if (m_ddrb != 0xff) + data = (m_read_pb(0) & ~m_ddrb) | (m_prb & m_ddrb); + else + data = m_read_pb(0) & m_prb; m_pb_in = data; if (CRA_PBON) From c414fffc306da58f69d8d1c8ee0253603b31c553 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 5 Jun 2015 10:21:08 +0200 Subject: [PATCH 170/284] thompson: updated to use the new wd fdc. same deal with as bbc: drives 0 and 1 are used for the controller with the wd, other legacy drives for other controllers (needs slotification). --- scripts/src/lib.lua | 2 ++ src/lib/formats/cd90_640_dsk.c | 56 ++++++++++++++++++++++++++++++++++ src/lib/formats/cd90_640_dsk.h | 33 ++++++++++++++++++++ src/mess/drivers/thomson.c | 20 ++++++++++-- src/mess/includes/thomson.h | 3 ++ src/mess/machine/thomflop.c | 36 +++++++--------------- 6 files changed, 122 insertions(+), 28 deletions(-) create mode 100644 src/lib/formats/cd90_640_dsk.c create mode 100644 src/lib/formats/cd90_640_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index f562b98c3b1..774e674db1a 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -182,6 +182,8 @@ project "formats" MAME_DIR .. "src/lib/formats/cbm_tap.h", MAME_DIR .. "src/lib/formats/ccvf_dsk.c", MAME_DIR .. "src/lib/formats/ccvf_dsk.h", + MAME_DIR .. "src/lib/formats/cd90_640_dsk.c", + MAME_DIR .. "src/lib/formats/cd90_640_dsk.h", MAME_DIR .. "src/lib/formats/cgen_cas.c", MAME_DIR .. "src/lib/formats/cgen_cas.h", MAME_DIR .. "src/lib/formats/cgenie_dsk.c", diff --git a/src/lib/formats/cd90_640_dsk.c b/src/lib/formats/cd90_640_dsk.c new file mode 100644 index 00000000000..1654d5d8c99 --- /dev/null +++ b/src/lib/formats/cd90_640_dsk.c @@ -0,0 +1,56 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Thompson CD90-640 FDC + + Disk image format + + TODO: + - Gap sizes unverified for FM + +***************************************************************************/ + +#include "cd90_640_dsk.h" + +cd90_640_format::cd90_640_format() : wd177x_format(formats) +{ +} + +const char *cd90_640_format::name() const +{ + return "cd90_640"; +} + +const char *cd90_640_format::description() const +{ + return "CD90-640 disk image"; +} + +const char *cd90_640_format::extensions() const +{ + return "fd"; +} + +const cd90_640_format::format cd90_640_format::formats[] = +{ + { + floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM, + 4000, 16, 40, 1, 128, {}, 1, {}, 14, 11, 12 + }, + { + floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM, + 2000, 16, 40, 1, 256, {}, 1, {}, 31, 22, 44 + }, + { + floppy_image::FF_525, floppy_image::DSSD, floppy_image::FM, + 4000, 16, 40, 2, 128, {}, 1, {}, 14, 11, 12 + }, + { + floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, + 2000, 16, 40, 2, 256, {}, 1, {}, 31, 22, 44 + }, + {} +}; + +const floppy_format_type FLOPPY_CD90_640_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/cd90_640_dsk.h b/src/lib/formats/cd90_640_dsk.h new file mode 100644 index 00000000000..ccf80508047 --- /dev/null +++ b/src/lib/formats/cd90_640_dsk.h @@ -0,0 +1,33 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + Thompson CD90-640 FDC + + Disk image format + +***************************************************************************/ + +#pragma once + +#ifndef __CD90_640_DSK_H__ +#define __CD90_640_DSK_H__ + +#include "wd177x_dsk.h" + +class cd90_640_format : public wd177x_format +{ +public: + cd90_640_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +private: + static const format formats[]; +}; + +extern const floppy_format_type FLOPPY_CD90_640_FORMAT; + +#endif // __CD90_640_DSK_H__ diff --git a/src/mess/drivers/thomson.c b/src/mess/drivers/thomson.c index 93730444be8..f68b45762f6 100644 --- a/src/mess/drivers/thomson.c +++ b/src/mess/drivers/thomson.c @@ -73,10 +73,11 @@ #include "includes/thomson.h" #include "bus/rs232/rs232.h" #include "machine/6821pia.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #include "machine/clock.h" #include "bus/centronics/ctronics.h" #include "imagedev/flopdrv.h" +#include "formats/cd90_640_dsk.h" #include "formats/basicdsk.h" #include "machine/ram.h" @@ -593,6 +594,17 @@ static const floppy_interface thomson_floppy_interface = NULL }; +FLOPPY_FORMATS_MEMBER( thomson_state::cd90_640_formats ) + FLOPPY_CD90_640_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( cd90_640_floppies ) + SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) + SLOT_INTERFACE("sd", FLOPPY_525_SD) + SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD) + SLOT_INTERFACE("dd", FLOPPY_525_DD) +SLOT_INTERFACE_END + /* ------------ driver ------------ */ @@ -649,8 +661,10 @@ static MACHINE_CONFIG_START( to7, thomson_state ) /* floppy */ MCFG_DEVICE_ADD("mc6843", MC6843, 0) - MCFG_DEVICE_ADD("wd2793", WD2793, 0) - MCFG_WD17XX_DEFAULT_DRIVE4_TAGS + MCFG_WD2793x_ADD("wd2793", XTAL_1MHz) + + MCFG_FLOPPY_DRIVE_ADD("wd2793:0", cd90_640_floppies, "dd", thomson_state::cd90_640_formats) + MCFG_FLOPPY_DRIVE_ADD("wd2793:1", cd90_640_floppies, "dd", thomson_state::cd90_640_formats) MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0) MCFG_DEVICE_CONFIG(thomson_floppy_interface) diff --git a/src/mess/includes/thomson.h b/src/mess/includes/thomson.h index ec24c79ea22..7aac073fa2a 100644 --- a/src/mess/includes/thomson.h +++ b/src/mess/includes/thomson.h @@ -28,6 +28,7 @@ #include "formats/thom_cas.h" #include "formats/thom_dsk.h" #include "machine/thomflop.h" +#include "imagedev/floppy.h" #include "machine/ram.h" #include "bus/generic/slot.h" @@ -116,6 +117,8 @@ public: { } + DECLARE_FLOPPY_FORMATS(cd90_640_formats); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER( to7_cartridge ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mo5_cartridge ); diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c index e418ed04e6b..bc84715d253 100644 --- a/src/mess/machine/thomflop.c +++ b/src/mess/machine/thomflop.c @@ -9,7 +9,7 @@ **********************************************************************/ #include "includes/thomson.h" -#include "machine/wd17xx.h" +#include "machine/wd_fdc.h" #define VERBOSE 0 /* 0, 1 or 2 */ @@ -275,7 +275,7 @@ static UINT8 to7_5p14_select; READ8_MEMBER( thomson_state::to7_5p14_r ) { - wd2793_device *fdc = machine().device("wd2793"); + wd2793_t *fdc = machine().device("wd2793"); if ( offset < 4 ) return fdc->read(space, offset ); @@ -290,37 +290,24 @@ READ8_MEMBER( thomson_state::to7_5p14_r ) WRITE8_MEMBER( thomson_state::to7_5p14_w ) { - wd2793_device *fdc = machine().device("wd2793"); + wd2793_t *fdc = machine().device("wd2793"); if ( offset < 4 ) fdc->write(space, offset, data ); else if ( offset == 8 ) { /* drive select */ - int drive = -1, side = 0; + floppy_image_device *floppy = NULL; - switch ( data & 7 ) - { - case 0: break; - case 2: drive = 0; side = 0; break; - case 3: drive = 1; side = 1; break; - case 4: drive = 2; side = 0; break; - case 5: drive = 3; side = 1; break; - default: - logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", machine().time().as_double(), m_maincpu->pc(), data ); - } + if (BIT(data, 1)) floppy = fdc->subdevice("0")->get_device(); + if (BIT(data, 2)) floppy = fdc->subdevice("1")->get_device(); - fdc->dden_w(BIT(data, 7)); + fdc->set_floppy(floppy); - to7_5p14_select = data; - - if ( drive != -1 ) + if (floppy) { thom_floppy_active( 0 ); - fdc->set_drive( drive ); - fdc->set_side( side ); - LOG(( "%f $%04x to7_5p14_w: $%02X set drive=%i side=%i density=%s\n", - machine().time().as_double(), m_maincpu->pc(), - data, drive, side, (BIT(data, 7) ? "FM" : "MFM"))); + floppy->mon_w(0); + floppy->ss_w(BIT(data, 0)); } } else @@ -332,7 +319,7 @@ WRITE8_MEMBER( thomson_state::to7_5p14_w ) void thomson_state::to7_5p14_reset() { - wd2793_device *fdc = machine().device("wd2793"); + wd2793_t *fdc = machine().device("wd2793"); LOG(( "to7_5p14_reset: CD 90-640 controller\n" )); fdc->reset(); } @@ -1911,7 +1898,6 @@ void thomson_state::thomson_index_callback(legacy_floppy_image_device *device, i break; case 2: - machine().device("wd2793")->index_pulse_callback(device, state); break; case 3: From 1c8c6405e91c25c38039e6c7b9ad997a595c9f8f Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Fri, 5 Jun 2015 10:48:22 +0200 Subject: [PATCH 171/284] goodbye old friend, you had a good run. --- scripts/src/machine.lua | 12 - scripts/target/mame/arcade.lua | 1 - scripts/target/mame/mess.lua | 1 - src/emu/machine/wd17xx.c | 2107 -------------------------------- src/emu/machine/wd17xx.h | 401 ------ 5 files changed, 2522 deletions(-) delete mode 100644 src/emu/machine/wd17xx.c delete mode 100644 src/emu/machine/wd17xx.h diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 67d18e7a44e..a11d535b673 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -2241,18 +2241,6 @@ if (MACHINES["WD11C00_17"]~=null) then } end ---------------------------------------------------- --- ---@src/emu/machine/wd17xx.h,MACHINES += WD17XX ---------------------------------------------------- - -if (MACHINES["WD17XX"]~=null) then - files { - MAME_DIR .. "src/emu/machine/wd17xx.c", - MAME_DIR .. "src/emu/machine/wd17xx.h", - } -end - --------------------------------------------------- -- --@src/emu/machine/wd2010.h,MACHINES += WD2010 diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index aababae90f6..3b178ee8c15 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -535,7 +535,6 @@ MACHINES["UPD765"] = true MACHINES["V3021"] = true MACHINES["WD_FDC"] = true MACHINES["WD11C00_17"] = true -MACHINES["WD17XX"] = true MACHINES["WD2010"] = true MACHINES["WD33C93"] = true MACHINES["X2212"] = true diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 86ba1bce400..e414158ea77 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -533,7 +533,6 @@ MACHINES["UPD765"] = true MACHINES["V3021"] = true MACHINES["WD_FDC"] = true MACHINES["WD11C00_17"] = true -MACHINES["WD17XX"] = true MACHINES["WD2010"] = true MACHINES["WD33C93"] = true MACHINES["WD7600"] = true diff --git a/src/emu/machine/wd17xx.c b/src/emu/machine/wd17xx.c deleted file mode 100644 index c87c2911877..00000000000 --- a/src/emu/machine/wd17xx.c +++ /dev/null @@ -1,2107 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nathan Woods, Kevin Thacker, Phill Harvey-Smith, Robbbert, Curt Coder -/*************************************************************************** - - !!! DEPRECATED, USE src/emu/wd_fdc.h FOR NEW DRIVERS !!! - - wd17xx.c - - Implementations of the Western Digital 17xx and 27xx families of - floppy disk controllers - - - Models: - - DAL DD Side Clock Remark - --------------------------------------------------------- - FD1771 1 or 2 MHz First model - FD1781 x 1 or 2 MHz - FD1791 x 1 or 2 MHz - FD1792 1 or 2 MHz - FD1793 x x 1 or 2 MHz - FD1794 x 1 or 2 MHz - FD1795 x x 1 or 2 MHz - FD1797 x x x 1 or 2 MHz - FD1761 x 1 MHz - FD1762 1 MHz ? - FD1763 x x 1 MHz - FD1764 x 1 MHz ? - FD1765 x x 1 MHz - FD1767 x x x 1 MHz - WD2791 x 1 or 2 MHz Internal data separator - WD2793 x x 1 or 2 MHz Internal data separator - WD2795 x x 1 or 2 MHz Internal data separator - WD2797 x x x 1 or 2 MHz Internal data separator - WD1770 x x 8 MHz Motor On signal - WD1772 x x 8 MHz Motor On signal, Faster stepping rates - WD1773 x x 8 MHz Enable precomp line - - Notes: - In general, later models include all features of earlier models - - DAL: Data access lines, x = TRUE; otherwise inverted - - DD: Double density support - - Side: Has side select support - - ?: Unknown if it really exists - - Clones: - - - SMC FD179x - - Fujitsu MB8876 -> FD1791, MB8877 -> FD1793 - - VLSI VL177x - - - Changelog: - - Kevin Thacker - - Removed disk image code and replaced it with floppy drive functions. - Any disc image is now useable with this code. - - Fixed write protect - - 2005-Apr-16 P.Harvey-Smith: - - Increased the delay in wd17xx_timed_read_sector_request and - wd17xx_timed_write_sector_request, to 40us to more closely match - what happens on the real hardware, this has fixed the NitrOS9 boot - problems. - - 2007-Nov-01 Wilbert Pol: - Needed these changes to get the MB8877 for Osborne-1 to work: - - Added support for multiple record read - - Changed the wd17xx_read_id to not return after DATADONEDELAY, but - the host should read the id data through the data register. This - was accomplished by making this change in the wd17xx_read_id - function: - - wd17xx_complete_command(device, DELAY_DATADONE); - + wd17xx_set_data_request(); - - 2009-May-10 Robbbert: - Further change to get the Kaypro II to work - - When wd17xx_read_id has generated the 6 data bytes, it should make - an IRQ and turn off the busy status. The timing for Osborne is - critical, it must be between 300 and 700 usec, I've settled on 400. - The Kaypro doesn't care timewise, but the busy flag must turn off - sometime or it hangs. - - w->status |= STA_2_BUSY; - + wd17xx_set_busy(device, attotime::from_usec(400)); - - 2009-June-4 Roberto Lavarone: - - Initial support for wd1771 - - Added simulation of head loaded feedback from drive - - Bugfix: busy flag was cleared too early - - 2009-June-21 Robbbert: - - The Bugfix above, while valid, caused the Osborne1 to fail. This - is because the delay must not exceed 14usec (found by extensive testing). - - The minimum delay is 1usec, need by z80netf while formatting a disk. - - http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=50889#Post50889 - explains the problems, testing done, and the test procedure for the z80netf. - - Thus, the delay is set to 10usec, and all the disks I have (not many) - seem to work. - - Note to anyone who wants to change something: Make sure that the - Osborne1 boots up! It is extremely sensitive to timing! - - For testing only: The osborne1 rom can be patched to make it much - more stable, by changing the byte at 0x0da7 from 0x28 to 0x18. - - 2009-June-25 Robbbert: - - Turns out kayproii not working, 10usec is too short.. but 11usec is ok. - Setting it to 12usec. - Really, this whole thing needs a complete rewrite. - - 2009-July-08 Roberto Lavarone: - - Fixed a bug in head load flag handling: einstein and samcoupe now working again - - 2009-September-30 Robbbert: - - Modified what status flags are returned after a Forced Interrupt, - to allow Microbee to boot CP/M. - - 2010-Jan-31 Phill Harvey-Smith - - The above bugfixes for the Kaypro/Osborne1 have borked the booting on the Dragon - Alpha. The Alpha it seems needs a delay of ay least 17us or the NMI generated by - INTRQ happens too early and doen't break out of the read/write bytes loops. - - I have made the delay settable by calling wd17xx_set_complete_command_delay, and - let it default to 12us, as required above, so that the Dragon Alpha works again. - This hopefully should not break the other machines. - - This should probably be considdered a minor hack but it does seem to work ! - - 2010-02-04 Phill Harvey-Smith - - Added multiple sector write as the RM Nimbus needs it. - - 2010-March-22 Curt Coder: - - Implemented immediate and index pulse interrupts. - - 2010-Dec-31 Phill Harvey-Smith - - Copied multi-sector write code from r7263, for some reason this had been - silently removed, but is required for the rmnimbus driver. - - 2011-Mar-08 Phill Harvey-Smith - - Triggering intrq now clears the DRQ bit in the status as well as the busy bit. - Execution of the READ_DAM command now correctly sets w->command. - - 2011-Apr-01 Curt Coder - - Set complete command delay to 16 usec (DD) / 32 usec (SD) and removed - the external delay setting hack. - - 2011-Jun-24 Curt Coder - - Added device types for all known variants, and enforced inverted DAL lines. - - 2011-Sep-18 Curt Coder - - Connected Side Select Output for variants that support it. - - TODO: - - What happens if a track is read that doesn't have any id's on it? - (e.g. unformatted disc) - - Rewrite into a C++ device - -***************************************************************************/ - - -#include "emu.h" -#include "formats/imageutl.h" -#include "machine/wd17xx.h" - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -#define VERBOSE 0 /* General logging */ -#define VERBOSE_DATA 0 /* Logging of each byte during read and write */ - -#define DELAY_ERROR 3 -#define DELAY_NOTREADY 1 -#define DELAY_DATADONE 3 - -#define TYPE_I 1 -#define TYPE_II 2 -#define TYPE_III 3 -#define TYPE_IV 4 - -#define FDC_STEP_RATE 0x03 /* Type I additional flags */ -#define FDC_STEP_VERIFY 0x04 /* verify track number */ -#define FDC_STEP_HDLOAD 0x08 /* load head */ -#define FDC_STEP_UPDATE 0x10 /* update track register */ - -#define FDC_RESTORE 0x00 /* Type I commands */ -#define FDC_SEEK 0x10 -#define FDC_STEP 0x20 -#define FDC_STEP_IN 0x40 -#define FDC_STEP_OUT 0x60 - -#define FDC_MASK_TYPE_I (FDC_STEP_HDLOAD|FDC_STEP_VERIFY|FDC_STEP_RATE) - -/* Type I commands status */ -#define STA_1_BUSY 0x01 /* controller is busy */ -#define STA_1_IPL 0x02 /* index pulse */ -#define STA_1_TRACK0 0x04 /* track 0 detected */ -#define STA_1_CRC_ERR 0x08 /* CRC error */ -#define STA_1_SEEK_ERR 0x10 /* seek error */ -#define STA_1_HD_LOADED 0x20 /* head loaded */ -#define STA_1_WRITE_PRO 0x40 /* floppy is write protected */ -#define STA_1_NOT_READY 0x80 /* drive not ready */ -#define STA_1_MOTOR_ON 0x80 /* status of the Motor On output (WD1770 and WD1772 only) */ - -/* Type II and III additional flags */ -#define FDC_DELETED_AM 0x01 /* read/write deleted address mark */ -#define FDC_SIDE_CMP_T 0x02 /* side compare track data */ -#define FDC_15MS_DELAY 0x04 /* delay 15ms before command */ -#define FDC_SIDE_CMP_S 0x08 /* side compare sector data */ -#define FDC_MULTI_REC 0x10 /* only for type II commands */ - -/* Type II commands */ -#define FDC_READ_SEC 0x80 /* read sector */ -#define FDC_WRITE_SEC 0xA0 /* write sector */ - -#define FDC_MASK_TYPE_II (FDC_MULTI_REC|FDC_SIDE_CMP_S|FDC_15MS_DELAY|FDC_SIDE_CMP_T|FDC_DELETED_AM) - -/* Type II commands status */ -#define STA_2_BUSY 0x01 -#define STA_2_DRQ 0x02 -#define STA_2_LOST_DAT 0x04 -#define STA_2_CRC_ERR 0x08 -#define STA_2_REC_N_FND 0x10 -#define STA_2_REC_TYPE 0x20 -#define STA_2_WRITE_PRO 0x40 -#define STA_2_NOT_READY 0x80 - -#define FDC_MASK_TYPE_III (FDC_SIDE_CMP_S|FDC_15MS_DELAY|FDC_SIDE_CMP_T|FDC_DELETED_AM) - -/* Type III commands */ -#define FDC_READ_DAM 0xc0 /* read data address mark */ -#define FDC_READ_TRK 0xe0 /* read track */ -#define FDC_WRITE_TRK 0xf0 /* write track (format) */ - -/* Type IV additional flags */ -#define FDC_IM0 0x01 /* interrupt mode 0 */ -#define FDC_IM1 0x02 /* interrupt mode 1 */ -#define FDC_IM2 0x04 /* interrupt mode 2 */ -#define FDC_IM3 0x08 /* interrupt mode 3 */ - -#define FDC_MASK_TYPE_IV (FDC_IM3|FDC_IM2|FDC_IM1|FDC_IM0) - -/* Type IV commands */ -#define FDC_FORCE_INT 0xd0 /* force interrupt */ - -/* structure describing a double density track */ -#define TRKSIZE_DD 6144 -#if 0 -static const UINT8 track_DD[][2] = { - {16, 0x4e}, /* 16 * 4E (track lead in) */ - { 8, 0x00}, /* 8 * 00 (pre DAM) */ - { 3, 0xf5}, /* 3 * F5 (clear CRC) */ - - { 1, 0xfe}, /* *** sector *** FE (DAM) */ - { 1, 0x80}, /* 4 bytes track,head,sector,seclen */ - { 1, 0xf7}, /* 1 * F7 (CRC) */ - {22, 0x4e}, /* 22 * 4E (sector lead in) */ - {12, 0x00}, /* 12 * 00 (pre AM) */ - { 3, 0xf5}, /* 3 * F5 (clear CRC) */ - { 1, 0xfb}, /* 1 * FB (AM) */ - { 1, 0x81}, /* x bytes sector data */ - { 1, 0xf7}, /* 1 * F7 (CRC) */ - {16, 0x4e}, /* 16 * 4E (sector lead out) */ - { 8, 0x00}, /* 8 * 00 (post sector) */ - { 0, 0x00}, /* end of data */ -}; -#endif - -/* structure describing a single density track */ -#define TRKSIZE_SD 3172 -#if 0 -static const UINT8 track_SD[][2] = { - {16, 0xff}, /* 16 * FF (track lead in) */ - { 8, 0x00}, /* 8 * 00 (pre DAM) */ - { 1, 0xfc}, /* 1 * FC (clear CRC) */ - - {11, 0xff}, /* *** sector *** 11 * FF */ - { 6, 0x00}, /* 6 * 00 (pre DAM) */ - { 1, 0xfe}, /* 1 * FE (DAM) */ - { 1, 0x80}, /* 4 bytes track,head,sector,seclen */ - { 1, 0xf7}, /* 1 * F7 (CRC) */ - {10, 0xff}, /* 10 * FF (sector lead in) */ - { 4, 0x00}, /* 4 * 00 (pre AM) */ - { 1, 0xfb}, /* 1 * FB (AM) */ - { 1, 0x81}, /* x bytes sector data */ - { 1, 0xf7}, /* 1 * F7 (CRC) */ - { 0, 0x00}, /* end of data */ -}; -#endif - - -/*************************************************************************** - HELPER FUNCTIONS -***************************************************************************/ - -static int wd17xx_has_dal(device_t *device) -{ - return (device->type() == FD1793 || device->type() == FD1794 || device->type() == FD1797 || - device->type() == FD1763 || device->type() == FD1764 || device->type() == FD1767 || - device->type() == WD1770 || device->type() == WD1772 || device->type() == WD1773 || - device->type() == WD2793 || device->type() == WD2797 || - device->type() == MB8877); -} - -static int wd17xx_is_sd_only(device_t *device) -{ - return (device->type() == FD1771 || device->type() == FD1792 || device->type() == FD1794 || device->type() == FD1762 || device->type() == FD1764); -} - -static int wd17xx_has_side_select(device_t *device) -{ - return (device->type() == FD1795 || device->type() == FD1797 || - device->type() == FD1765 || device->type() == FD1767 || - device->type() == WD2795 || device->type() == WD2797); -} - -int wd1770_device::wd17xx_dden() -{ - if (!m_in_dden_func.isnull()) - return m_in_dden_func(); - else - return m_dden; -} - - -/*************************************************************************** - IMPLEMENTATION -***************************************************************************/ - -/* clear a data request */ -void wd1770_device::wd17xx_clear_drq() -{ - m_status &= ~STA_2_DRQ; - - m_drq = CLEAR_LINE; - m_out_drq_func(m_drq); -} - -/* set data request */ -void wd1770_device::wd17xx_set_drq() -{ - if (m_status & STA_2_DRQ) - m_status |= STA_2_LOST_DAT; - - m_status |= STA_2_DRQ; - - m_drq = ASSERT_LINE; - m_out_drq_func(m_drq); -} - -/* clear interrupt request */ -void wd1770_device::wd17xx_clear_intrq() -{ - m_intrq = CLEAR_LINE; - m_out_intrq_func(m_intrq); -} - -/* set interrupt request */ -void wd1770_device::wd17xx_set_intrq() -{ - m_status &= ~STA_2_BUSY; - m_status &= ~STA_2_DRQ; - - m_intrq = ASSERT_LINE; - m_out_intrq_func(m_intrq); -} - -/* set intrq after delay */ -TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_command_callback ) -{ - if (m_last_command_data != FDC_FORCE_INT) - { - wd17xx_set_intrq(); - } -} - -/* write next byte to data register and set drq */ -TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_data_callback ) -{ - /* check if this is a write command */ - if( (m_command_type == TYPE_II && m_command == FDC_WRITE_SEC) || - (m_command_type == TYPE_III && m_command == FDC_WRITE_TRK) ) - { - /* we are ready for new data */ - wd17xx_set_drq(); - - return; - } - - /* any bytes remaining? */ - if (m_data_count >= 1) - { - /* yes */ - m_data = m_buffer[m_data_offset++]; - - if (VERBOSE_DATA) - logerror("wd17xx_data_callback: $%02X (data_count %d)\n", m_data, m_data_count); - - wd17xx_set_drq(); - - /* any bytes remaining? */ - if (--m_data_count < 1) - { - /* no */ - m_data_offset = 0; - - /* clear ddam type */ - m_status &=~STA_2_REC_TYPE; - - /* read a sector with ddam set? */ - if (m_command_type == TYPE_II && m_ddam != 0) - { - /* set it */ - m_status |= STA_2_REC_TYPE; - } - - /* check if we should handle the next sector for a multi record read */ - if (m_command_type == TYPE_II && m_command == FDC_READ_SEC && (m_read_cmd & 0x10)) - { - if (VERBOSE) - logerror("wd17xx_data_callback: multi sector read\n"); - - if (m_sector == 0xff) - m_sector = 0x01; - else - m_sector++; - - wd17xx_timed_read_sector_request(); - } - else - { - /* Delay the INTRQ 3 byte times because we need to read two CRC bytes and - compare them with a calculated CRC */ - wd17xx_complete_command(DELAY_DATADONE); - - if (VERBOSE) - logerror("wd17xx_data_callback: data read completed\n"); - } - } - else - { - /* requeue us for more data */ - m_timer_data->adjust(attotime::from_usec(wd17xx_dden() ? 128 : 32)); - } - } - else - { - logerror("wd17xx_data_callback: (no new data) $%02X (data_count %d)\n", m_data, m_data_count); - } -} - - -void wd1770_device::wd17xx_set_busy(const attotime &duration) -{ - m_status |= STA_1_BUSY; - - m_timer_cmd->adjust(duration); -} - - -/* BUSY COUNT DOESN'T WORK PROPERLY! */ - -void wd1770_device::wd17xx_command_restore() -{ - UINT8 step_counter; - - if (m_drive == NULL) - return; - - step_counter = 255; - -#if 0 - m_status |= STA_1_BUSY; -#endif - - /* setup step direction */ - m_direction = -1; - - m_command_type = TYPE_I; - - /* reset busy count */ - m_busy_count = 0; - - if (1) // image_slotexists(m_drive) : FIXME - { - /* keep stepping until track 0 is received or 255 steps have been done */ - while (m_drive->floppy_tk00_r() && (step_counter != 0)) - { - /* update time to simulate seek time busy signal */ - m_busy_count++; - m_drive->floppy_drive_seek(m_direction); - step_counter--; - } - } - - /* update track reg */ - m_track = 0; -#if 0 - /* simulate seek time busy signal */ - m_busy_count = 0; //m_busy_count * ((m_data & FDC_STEP_RATE) + 1); - - /* when command completes set irq */ - wd17xx_set_intrq(); -#endif - wd17xx_set_busy(attotime::from_usec(100)); -} - -/* - Write an entire track. Formats which do not define a write_track - function pointer will cause a silent return. - What is written to the image depends on the selected format. Sector - dumps have to extract the sectors in the track, while track dumps - may directly write the bytes. - (The if-part below may thus be removed.) -*/ -void wd1770_device::write_track() -{ - floppy_image_legacy *floppy; -#if 0 - int i; - for (i=0;i+4floppy_drive_format_sector(side,sector,track, - m_hd,sector,density?1:0,filler); - i += 128; /* at least... */ - } - else - i++; - } -#endif - - /* Get the size in bytes of the current track. For real hardware this - may vary per system in small degree, and there even for each track - and head, so we should not assume a fixed value here. - As we are using a buffered track writing, we have to find out how long - the track will become. The only object which can tell us is the - selected format. - */ - m_data_count = 0; - floppy = m_drive->flopimg_get_image(); - if (floppy != NULL) - m_data_count = floppy_get_track_size(floppy, m_hd, m_track); - - if (m_data_count==0) - { - if (wd17xx_is_sd_only(this)) - m_data_count = TRKSIZE_SD; - else - m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD; - } - - m_drive->floppy_drive_write_track_data_info_buffer( m_hd, (char *)m_buffer, &(m_data_count) ); - - m_data_offset = 0; - - wd17xx_set_drq(); - m_status |= STA_2_BUSY; - m_busy_count = 0; -} - -/* - Read an entire track. It is up to the format to deliver the data. Sector - dumps may be required to fantasize the missing track bytes, while track - dumps can directly deliver them. - (The if-part below may thus be removed.) -*/ -void wd1770_device::read_track() -{ - floppy_image_legacy *floppy; -#if 0 - UINT8 *psrc; /* pointer to track format structure */ - UINT8 *pdst; /* pointer to track buffer */ - int cnt; /* number of bytes to fill in */ - UINT16 crc; /* id or data CRC */ - UINT8 d; /* data */ - UINT8 t = m_track; /* track of DAM */ - UINT8 h = m_head; /* head of DAM */ - UINT8 s = m_sector_dam; /* sector of DAM */ - UINT16 l = m_sector_length; /* sector length of DAM */ - int i; - - for (i = 0; i < m_sec_per_track; i++) - { - m_dam_list[i][0] = t; - m_dam_list[i][1] = h; - m_dam_list[i][2] = i; - m_dam_list[i][3] = l >> 8; - } - - pdst = m_buffer; - - if (m_density) - { - psrc = track_DD[0]; /* double density track format */ - cnt = TRKSIZE_DD; - } - else - { - psrc = track_SD[0]; /* single density track format */ - cnt = TRKSIZE_SD; - } - - while (cnt > 0) - { - if (psrc[0] == 0) /* no more track format info ? */ - { - if (m_dam_cnt < m_sec_per_track) /* but more DAM info ? */ - { - if (m_density)/* DD track ? */ - psrc = track_DD[3]; - else - psrc = track_SD[3]; - } - } - - if (psrc[0] != 0) /* more track format info ? */ - { - cnt -= psrc[0]; /* subtract size */ - d = psrc[1]; - - if (d == 0xf5) /* clear CRC ? */ - { - crc = 0xffff; - d = 0xa1; /* store A1 */ - } - - for (i = 0; i < *psrc; i++) - *pdst++ = d; /* fill data */ - - if (d == 0xf7) /* store CRC ? */ - { - pdst--; /* go back one byte */ - *pdst++ = crc & 255; /* put CRC low */ - *pdst++ = crc / 256; /* put CRC high */ - cnt -= 1; /* count one more byte */ - } - else if (d == 0xfe)/* address mark ? */ - { - crc = 0xffff; /* reset CRC */ - } - else if (d == 0x80)/* sector ID ? */ - { - pdst--; /* go back one byte */ - t = *pdst++ = m_dam_list[m_dam_cnt][0]; /* track number */ - h = *pdst++ = m_dam_list[m_dam_cnt][1]; /* head number */ - s = *pdst++ = m_dam_list[m_dam_cnt][2]; /* sector number */ - l = *pdst++ = m_dam_list[m_dam_cnt][3]; /* sector length code */ - m_dam_cnt++; - crc = ccitt_crc16_one(crc, t); /* build CRC */ - crc = ccitt_crc16_one(crc, h); /* build CRC */ - crc = ccitt_crc16_one(crc, s); /* build CRC */ - crc = ccitt_crc16_one(crc, l); /* build CRC */ - l = (l == 0) ? 128 : l << 8; - } - else if (d == 0xfb)// data address mark ? - { - crc = 0xffff; // reset CRC - } - else if (d == 0x81)// sector DATA ? - { - pdst--; /* go back one byte */ - if (seek(w, t, h, s) == 0) - { - if (mame_fread(m_image_file, pdst, l) != l) - { - m_status = STA_2_CRC_ERR; - return; - } - } - else - { - m_status = STA_2_REC_N_FND; - return; - } - for (i = 0; i < l; i++) // build CRC of all data - crc = ccitt_crc16_one(crc, *pdst++); - cnt -= l; - } - psrc += 2; - } - else - { - *pdst++ = 0xff; /* fill track */ - cnt--; /* until end */ - } - } -#endif - /* Determine the track size. We cannot allow different sizes in this - design (see above, write_track). */ - m_data_count = 0; - floppy = m_drive->flopimg_get_image(); - if (floppy != NULL) - m_data_count = floppy_get_track_size(floppy, m_hd, m_track); - - if (m_data_count==0) - { - if (wd17xx_is_sd_only(this)) - m_data_count = TRKSIZE_SD; - else - m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD; - } - - m_drive->floppy_drive_read_track_data_info_buffer( m_hd, (char *)m_buffer, &(m_data_count) ); - - m_data_offset = 0; - - wd17xx_set_drq(); - m_status |= STA_2_BUSY; - m_busy_count = 0; -} - - -/* read the next data address mark */ -void wd1770_device::wd17xx_read_id() -{ - chrn_id id; - m_status &= ~(STA_2_CRC_ERR | STA_2_REC_N_FND); - - /* get next id from disc */ - if (m_drive->floppy_drive_get_next_id(m_hd, &id)) - { - UINT16 crc = 0xffff; - - m_data_offset = 0; - m_data_count = 6; - - /* for MFM */ - /* crc includes 3x0x0a1, and 1x0x0fe (id mark) */ - crc = ccitt_crc16_one(crc,0x0a1); - crc = ccitt_crc16_one(crc,0x0a1); - crc = ccitt_crc16_one(crc,0x0a1); - crc = ccitt_crc16_one(crc,0x0fe); - - m_buffer[0] = id.C; - m_buffer[1] = id.H; - m_buffer[2] = id.R; - m_buffer[3] = id.N; - crc = ccitt_crc16_one(crc, m_buffer[0]); - crc = ccitt_crc16_one(crc, m_buffer[1]); - crc = ccitt_crc16_one(crc, m_buffer[2]); - crc = ccitt_crc16_one(crc, m_buffer[3]); - /* crc is stored hi-byte followed by lo-byte */ - m_buffer[4] = crc>>8; - m_buffer[5] = crc & 255; - - m_sector = id.C; - - if (VERBOSE) - logerror("wd17xx_read_id: read id succeeded.\n"); - - wd17xx_timed_data_request(); - } - else - { - /* record not found */ - m_status |= STA_2_REC_N_FND; - //m_sector = m_track; - if (VERBOSE) - logerror("wd17xx_read_id: read id failed\n"); - - wd17xx_complete_command(DELAY_ERROR); - } -} - - - -void wd1770_device::index_pulse_callback(device_t *img, int state) -{ - if (img != m_drive) - return; - - m_idx = state; - - if (!state && m_idx && BIT(m_interrupt, 2)) - wd17xx_set_intrq(); - - if (m_hld_count) - m_hld_count--; -} - - - -int wd1770_device::wd17xx_locate_sector() -{ - UINT8 revolution_count; - chrn_id id; - revolution_count = 0; - - m_status &= ~STA_2_REC_N_FND; - - while (revolution_count!=4) - { - if (m_drive->floppy_drive_get_next_id(m_hd, &id)) - { - /* compare track */ - if (id.C == m_track) - { - /* compare head, if we were asked to */ - if (!wd17xx_has_side_select(this) || (id.H == m_head) || (m_head == (UINT8) ~0)) - { - /* compare id */ - if (id.R == m_sector) - { - m_sector_length = 1<<(id.N+7); - m_sector_data_id = id.data_id; - /* get ddam status */ - m_ddam = id.flags & ID_FLAG_DELETED_DATA; - /* got record type here */ - if (VERBOSE) - logerror("sector found! C:$%02x H:$%02x R:$%02x N:$%02x%s\n", id.C, id.H, id.R, id.N, m_ddam ? " DDAM" : ""); - return 1; - } - } - } - } - - /* index set? */ - if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX)) - { - /* update revolution count */ - revolution_count++; - } - } - return 0; -} - - -int wd1770_device::wd17xx_find_sector() -{ - if ( wd17xx_locate_sector() ) - { - return 1; - } - - /* record not found */ - m_status |= STA_2_REC_N_FND; - - if (VERBOSE) - logerror("track %d sector %d not found!\n", m_track, m_sector); - - wd17xx_complete_command(DELAY_ERROR); - - return 0; -} - -void wd1770_device::wd17xx_side_compare(UINT8 command) -{ - if (wd17xx_has_side_select(this)) - set_side((command & FDC_SIDE_CMP_T) ? 1 : 0); - - if (command & FDC_SIDE_CMP_T) - m_head = (command & FDC_SIDE_CMP_S) ? 1 : 0; - else - m_head = ~0; -} - -/* read a sector */ -void wd1770_device::wd17xx_read_sector() -{ - m_data_offset = 0; - - /* side compare? */ - wd17xx_side_compare(m_read_cmd); - - if (wd17xx_find_sector()) - { - m_data_count = m_sector_length; - - /* read data */ - m_drive->floppy_drive_read_sector_data(m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length); - - wd17xx_timed_data_request(); - - m_status |= STA_2_BUSY; - m_busy_count = 0; - } -} - - -/* called on error, or when command is actually completed */ -/* KT - I have used a timer for systems that use interrupt driven transfers. -A interrupt occurs after the last byte has been read. If it occurs at the time -when the last byte has been read it causes problems - same byte read again -or bytes missed */ -/* TJL - I have add a parameter to allow the emulation to specify the delay -*/ -void wd1770_device::wd17xx_complete_command(int delay) -{ - m_data_count = 0; - - m_hld_count = 2; - - /* set new timer */ - int usecs = wd17xx_dden() ? 32 : 16; - m_timer_cmd->adjust(attotime::from_usec(usecs)); - - /* Kill onshot read/write sector timers */ - m_timer_rs->adjust(attotime::never); - m_timer_ws->adjust(attotime::never); -} - - - -void wd1770_device::wd17xx_write_sector() -{ - /* at this point, the disc is write enabled, and data - * has been transfered into our buffer - now write it to - * the disc image or to the real disc - */ - - /* side compare? */ - wd17xx_side_compare(m_write_cmd); - - /* find sector */ - if (wd17xx_find_sector()) - { - m_data_count = m_sector_length; - - /* write data */ - m_drive->floppy_drive_write_sector_data(m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length, m_write_cmd & 0x01); - } -} - - - -/* verify the seek operation by looking for a id that has a matching track value */ -void wd1770_device::wd17xx_verify_seek() -{ - UINT8 revolution_count; - chrn_id id; - revolution_count = 0; - - if (VERBOSE) - logerror("doing seek verify\n"); - - m_status &= ~STA_1_SEEK_ERR; - - /* must be found within 5 revolutions otherwise error */ - while (revolution_count!=5) - { - if (m_drive->floppy_drive_get_next_id( m_hd, &id)) - { - /* compare track */ - if (id.C == m_track) - { - if (VERBOSE) - logerror("seek verify succeeded!\n"); - return; - } - } - - /* index set? */ - if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX)) - { - /* update revolution count */ - revolution_count++; - } - } - - m_status |= STA_1_SEEK_ERR; - - if (VERBOSE) - logerror("failed seek verify!\n"); -} - - - -/* callback to initiate read sector */ -TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_read_sector_callback ) -{ - /* ok, start that read! */ - - if (VERBOSE) - logerror("wd179x: Read Sector callback.\n"); - - if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) - wd17xx_complete_command(DELAY_NOTREADY); - else - wd17xx_read_sector(); -} - - - -/* callback to initiate write sector */ -TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_write_sector_callback ) -{ - /* ok, start that write! */ - - if (VERBOSE) - logerror("wd179x: Write Sector callback.\n"); - - if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) - wd17xx_complete_command(DELAY_NOTREADY); - else - { - /* drive write protected? */ - if (m_drive->floppy_wpt_r() == CLEAR_LINE) - { - m_status |= STA_2_WRITE_PRO; - - wd17xx_complete_command(DELAY_ERROR); - } - else - { - /* side compare? */ - wd17xx_side_compare(m_write_cmd); - - /* attempt to find it first before getting data from cpu */ - if (wd17xx_find_sector()) - { - /* request data */ - m_data_offset = 0; - m_data_count = m_sector_length; - - wd17xx_set_drq(); - - m_status |= STA_2_BUSY; - m_busy_count = 0; - } - } - } -} - - - -/* setup a timed data request - data request will be triggered in a few usecs time */ -void wd1770_device::wd17xx_timed_data_request() -{ - /* set new timer */ - m_timer_data->adjust(attotime::from_usec(wd17xx_dden() ? 128 : 32)); -} - - - -/* setup a timed read sector - read sector will be triggered in a few usecs time */ -void wd1770_device::wd17xx_timed_read_sector_request() -{ - /* set new timer */ - m_timer_rs->adjust(attotime::from_usec(m_pause_time)); -} - - - -/* setup a timed write sector - write sector will be triggered in a few usecs time */ -void wd1770_device::wd17xx_timed_write_sector_request() -{ - /* set new timer */ - m_timer_ws->adjust(attotime::from_usec(m_pause_time)); -} - - -/*************************************************************************** - INTERFACE -***************************************************************************/ - -/* use this to determine which drive is controlled by WD */ -void wd1770_device::set_drive(UINT8 drive) -{ - if (VERBOSE) - logerror("wd17xx_set_drive: $%02x\n", drive); - - if (m_floppy_drive_tags[drive] != NULL) - { - m_drive = siblingdevice(m_floppy_drive_tags[drive]); - } -} - -void wd1770_device::set_side(UINT8 head) -{ - if (VERBOSE) - { - if (head != m_hd) - logerror("wd17xx_set_side: $%02x\n", head); - } - - m_hd = head; -} - -void wd1770_device::set_pause_time(int usec) -{ - m_pause_time = usec; -} - - -/*************************************************************************** - DEVICE HANDLERS -***************************************************************************/ - -/* master reset */ -WRITE_LINE_MEMBER( wd1770_device::mr_w ) -{ - /* reset device when going from high to low */ - if (m_mr && state == CLEAR_LINE) - { - m_command = 0x03; - m_status &= ~STA_1_NOT_READY; /* ? */ - } - - /* execute restore command when going from low to high */ - if (m_mr == CLEAR_LINE && state) - { - wd17xx_command_restore(); - m_sector = 0x01; - } - - m_mr = state; -} - -/* ready and enable precomp (1773 only) */ -WRITE_LINE_MEMBER( wd1770_device::rdy_w ) -{ - m_rdy = state; -} - -/* motor on, 1770 and 1772 only */ -READ_LINE_MEMBER( wd1770_device::mo_r ) -{ - return m_mo; -} - -/* track zero */ -WRITE_LINE_MEMBER( wd1770_device::tr00_w ) -{ - m_tr00 = state; -} - -/* index pulse */ -WRITE_LINE_MEMBER( wd1770_device::idx_w ) -{ - m_idx = state; - - if (!state && m_idx && BIT(m_interrupt, 2)) - wd17xx_set_intrq(); -} - -/* write protect status */ -WRITE_LINE_MEMBER( wd1770_device::wprt_w ) -{ - m_wprt = state; -} - -/* double density enable */ -WRITE_LINE_MEMBER( wd1770_device::dden_w ) -{ - /* not supported on FD1771, FD1792, FD1794, FD1762 and FD1764 */ - if (wd17xx_is_sd_only(this)) - fatalerror("wd17xx_dden_w: double density input not supported on this model!\n"); - else if (!m_in_dden_func.isnull()) - logerror("wd17xx_dden_w: write has no effect because a read handler is already defined!\n"); - else - m_dden = state; -} - -/* data request */ -READ_LINE_MEMBER( wd1770_device::drq_r ) -{ - return m_drq; -} - -/* interrupt request */ -READ_LINE_MEMBER( wd1770_device::intrq_r ) -{ - return m_intrq; -} - -/* read the FDC status register. This clears IRQ line too */ -READ8_MEMBER( wd1770_device::status_r ) -{ - int result; - - if (!BIT(m_interrupt, 3)) - { - wd17xx_clear_intrq(); - } - - /* bit 7, 'not ready' or 'motor on' */ - if (type() == WD1770 || type() == WD1772) - { - m_status &= ~STA_1_MOTOR_ON; - m_status |= m_mo << 7; - } - else - { - m_status &= ~STA_1_NOT_READY; - if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) - m_status |= STA_1_NOT_READY; - } - - result = m_status; - - /* type 1 command or force int command? */ - if ((m_command_type==TYPE_I) || (m_command_type==TYPE_IV && ! m_was_busy)) - { - result &= ~(STA_1_IPL | STA_1_TRACK0); - - /* bit 1, index pulse */ - result |= m_idx << 1; - - /* bit 2, track 0 state, inverted */ - result |= !m_drive->floppy_tk00_r() << 2; - - if (m_command_type==TYPE_I) - { - if (m_hld_count) - m_status |= STA_1_HD_LOADED; - else - m_status &= ~ STA_1_HD_LOADED; - } - - /* bit 6, write protect, inverted */ - result |= !m_drive->floppy_wpt_r() << 6; - } - - /* eventually set data request bit */ -// m_status |= m_status_drq; - - if (VERBOSE) - { - if (m_data_count < 4) - logerror("%s: wd17xx_status_r: $%02X (data_count %d)\n", machine().describe_context(), result, m_data_count); - } - - return result ^ (wd17xx_has_dal(this) ? 0 : 0xff); -} - -/* read the FDC track register */ -READ8_MEMBER( wd1770_device::track_r ) -{ - if (VERBOSE) - logerror("%s: wd17xx_track_r: $%02X\n", machine().describe_context(), m_track); - - return m_track ^ (wd17xx_has_dal(this) ? 0 : 0xff); -} - -/* read the FDC sector register */ -READ8_MEMBER( wd1770_device::sector_r ) -{ - if (VERBOSE) - logerror("%s: wd17xx_sector_r: $%02X\n", machine().describe_context(), m_sector); - - return m_sector ^ (wd17xx_has_dal(this) ? 0 : 0xff); -} - -/* read the FDC data register */ -READ8_MEMBER( wd1770_device::data_r ) -{ - if (VERBOSE_DATA) - logerror("%s: wd17xx_data_r: %02x\n", machine().describe_context(), m_data); - - /* clear data request */ - wd17xx_clear_drq(); - - return m_data ^ (wd17xx_has_dal(this) ? 0 : 0xff); -} - -/* write the FDC command register */ -WRITE8_MEMBER( wd1770_device::command_w ) -{ - if (!wd17xx_has_dal(this)) data ^= 0xff; - - m_last_command_data = data; - - /* only the WD1770 and WD1772 have a 'motor on' line */ - if (type() == WD1770 || type() == WD1772) - { - m_mo = ASSERT_LINE; - m_drive->floppy_mon_w(CLEAR_LINE); - } - - m_drive->floppy_drive_set_ready_state(1,0); - - if (!BIT(m_interrupt, 3)) - { - wd17xx_clear_intrq(); - } - - /* clear write protected. On read sector, read track and read dam, write protected bit is clear */ - m_status &= ~((1<<6) | (1<<5) | (1<<4)); - - if ((data & ~FDC_MASK_TYPE_IV) == FDC_FORCE_INT) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X FORCE_INT (data_count %d)\n", machine().describe_context(), data, m_data_count); - - m_data_count = 0; - m_data_offset = 0; - m_was_busy = m_status & STA_2_BUSY; - m_status &= ~STA_2_BUSY; - - wd17xx_clear_drq(); - - if (!BIT(m_interrupt, 3) && BIT(data, 3)) - { - /* set immediate interrupt */ - wd17xx_set_intrq(); - } - - if (BIT(m_interrupt, 3)) - { - if (data == FDC_FORCE_INT) - { - /* clear immediate interrupt */ - m_interrupt = data & 0x0f; - } - else - { - /* keep immediate interrupt */ - m_interrupt = 0x08 | (data & 0x07); - } - } - else - { - m_interrupt = data & 0x0f; - } - - /* terminate command */ - wd17xx_complete_command(DELAY_ERROR); - - m_busy_count = 0; - m_command_type = TYPE_IV; - return; - } - - if (data & 0x80) - { - /*m_status_ipl = 0;*/ - - if ((data & ~FDC_MASK_TYPE_II) == FDC_READ_SEC) - { - if (VERBOSE) - { - logerror("%s: wd17xx_command_w $%02X READ_SEC (", machine().describe_context(), data); - logerror("cmd=%02X, trk=%02X, sec=%02X, dat=%02X)\n",m_command,m_track,m_sector,m_data); - } - m_read_cmd = data; - m_command = data & ~FDC_MASK_TYPE_II; - m_command_type = TYPE_II; - m_status &= ~STA_2_LOST_DAT; - m_status |= STA_2_BUSY; - wd17xx_clear_drq(); - - wd17xx_timed_read_sector_request(); - - return; - } - - if ((data & ~FDC_MASK_TYPE_II) == FDC_WRITE_SEC) - { - if (VERBOSE) - { - logerror("%s: wd17xx_command_w $%02X WRITE_SEC (", machine().describe_context(), data); - logerror("cmd=%02X, trk=%02X, sec=%02X, dat=%02X)\n",m_command,m_track,m_sector,m_data); - } - - m_write_cmd = data; - m_command = data & ~FDC_MASK_TYPE_II; - m_command_type = TYPE_II; - m_status &= ~STA_2_LOST_DAT; - m_status |= STA_2_BUSY; - wd17xx_clear_drq(); - - wd17xx_timed_write_sector_request(); - - return; - } - - if ((data & ~FDC_MASK_TYPE_III) == FDC_READ_TRK) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X READ_TRK\n", machine().describe_context(), data); - - m_command = data & ~FDC_MASK_TYPE_III; - m_command_type = TYPE_III; - m_status &= ~STA_2_LOST_DAT; - wd17xx_clear_drq(); -#if 1 -// m_status = seek(w, m_track, m_head, m_sector); - if (m_status == 0) - read_track(); -#endif - return; - } - - if ((data & ~FDC_MASK_TYPE_III) == FDC_WRITE_TRK) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X WRITE_TRK\n", machine().describe_context(), data); - - m_command_type = TYPE_III; - m_status &= ~STA_2_LOST_DAT; - wd17xx_clear_drq(); - - if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) - { - wd17xx_complete_command(DELAY_NOTREADY); - } - else - { - /* drive write protected? */ - if (m_drive->floppy_wpt_r() == CLEAR_LINE) - { - /* yes */ - m_status |= STA_2_WRITE_PRO; - /* quit command */ - wd17xx_complete_command(DELAY_ERROR); - } - else - { - m_command = data & ~FDC_MASK_TYPE_III; - m_data_offset = 0; - if (wd17xx_is_sd_only(this)) - m_data_count = TRKSIZE_SD; - else - m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD; - - wd17xx_set_drq(); - m_status |= STA_2_BUSY; - m_busy_count = 0; - } - } - return; - } - - if ((data & ~FDC_MASK_TYPE_III) == FDC_READ_DAM) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X READ_DAM\n", machine().describe_context(), data); - - m_command_type = TYPE_III; - m_command = data & ~FDC_MASK_TYPE_III; - m_status &= ~STA_2_LOST_DAT; - m_status |= STA_2_BUSY; - - wd17xx_clear_drq(); - - if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) - wd17xx_read_id(); - else - wd17xx_complete_command(DELAY_NOTREADY); - - return; - } - - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X unknown\n", machine().describe_context(), data); - - return; - } - - m_status |= STA_1_BUSY; - - /* clear CRC error */ - m_status &=~STA_1_CRC_ERR; - - if ((data & ~FDC_MASK_TYPE_I) == FDC_RESTORE) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X RESTORE\n", machine().describe_context(), data); - - wd17xx_command_restore(); - } - - if ((data & ~FDC_MASK_TYPE_I) == FDC_SEEK) - { - UINT8 newtrack; - - if (VERBOSE) - logerror("old track: $%02x new track: $%02x\n", m_track, m_data); - m_command_type = TYPE_I; - - /* setup step direction */ - if (m_track < m_data) - { - if (VERBOSE) - logerror("direction: +1\n"); - - m_direction = 1; - } - else if (m_track > m_data) - { - if (VERBOSE) - logerror("direction: -1\n"); - - m_direction = -1; - } - - newtrack = m_data; - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X SEEK (data_reg is $%02X)\n", machine().describe_context(), data, newtrack); - - /* reset busy count */ - m_busy_count = 0; - - /* keep stepping until reached track programmed */ - while (m_track != newtrack) - { - /* update time to simulate seek time busy signal */ - m_busy_count++; - - /* update track reg */ - m_track += m_direction; - - m_drive->floppy_drive_seek(m_direction); - } - - /* simulate seek time busy signal */ - m_busy_count = 0; //m_busy_count * ((data & FDC_STEP_RATE) + 1); -#if 0 - wd17xx_set_intrq(); -#endif - wd17xx_set_busy(attotime::from_usec(100)); - - } - - if ((data & ~(FDC_STEP_UPDATE | FDC_MASK_TYPE_I)) == FDC_STEP) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X STEP dir %+d\n", machine().describe_context(), data, m_direction); - - m_command_type = TYPE_I; - /* if it is a real floppy, issue a step command */ - /* simulate seek time busy signal */ - m_busy_count = 0; //((data & FDC_STEP_RATE) + 1); - - m_drive->floppy_drive_seek(m_direction); - - if (data & FDC_STEP_UPDATE) - m_track += m_direction; - -#if 0 - wd17xx_set_intrq(); -#endif - wd17xx_set_busy(attotime::from_usec(100)); - - - } - - if ((data & ~(FDC_STEP_UPDATE | FDC_MASK_TYPE_I)) == FDC_STEP_IN) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X STEP_IN\n", machine().describe_context(), data); - - m_command_type = TYPE_I; - m_direction = +1; - /* simulate seek time busy signal */ - m_busy_count = 0; //((data & FDC_STEP_RATE) + 1); - - m_drive->floppy_drive_seek(m_direction); - - if (data & FDC_STEP_UPDATE) - m_track += m_direction; -#if 0 - wd17xx_set_intrq(); -#endif - wd17xx_set_busy(attotime::from_usec(100)); - - } - - if ((data & ~(FDC_STEP_UPDATE | FDC_MASK_TYPE_I)) == FDC_STEP_OUT) - { - if (VERBOSE) - logerror("%s: wd17xx_command_w $%02X STEP_OUT\n", machine().describe_context(), data); - - m_command_type = TYPE_I; - m_direction = -1; - /* simulate seek time busy signal */ - m_busy_count = 0; //((data & FDC_STEP_RATE) + 1); - - /* for now only allows a single drive to be selected */ - m_drive->floppy_drive_seek(m_direction); - - if (data & FDC_STEP_UPDATE) - m_track += m_direction; - -#if 0 - wd17xx_set_intrq(); -#endif - wd17xx_set_busy(attotime::from_usec(100)); - } - - if (m_command_type == TYPE_I) - { - /* 0 is enable spin up sequence, 1 is disable spin up sequence */ - if ((data & FDC_STEP_HDLOAD)==0) - { - m_status |= STA_1_HD_LOADED; - m_hld_count = 2; - } - else - m_status &= ~STA_1_HD_LOADED; - - if (data & FDC_STEP_VERIFY) - { - /* verify seek */ - wd17xx_verify_seek(); - } - } -} - -/* write the FDC track register */ -WRITE8_MEMBER( wd1770_device::track_w ) -{ - if (!wd17xx_has_dal(this)) data ^= 0xff; - - m_track = data; - - if (VERBOSE) - logerror("%s: wd17xx_track_w $%02X\n", machine().describe_context(), data); -} - -/* write the FDC sector register */ -WRITE8_MEMBER( wd1770_device::sector_w ) -{ - if (!wd17xx_has_dal(this)) data ^= 0xff; - - m_sector = data; - - if (VERBOSE) - logerror("%s: wd17xx_sector_w $%02X\n", machine().describe_context(), data); -} - -/* write the FDC data register */ -WRITE8_MEMBER( wd1770_device::data_w ) -{ - if (!wd17xx_has_dal(this)) data ^= 0xff; - - if (m_data_count > 0) - { - wd17xx_clear_drq(); - - /* put byte into buffer */ - if (VERBOSE_DATA) - logerror("wd17xx_info buffered data: $%02X at offset %d.\n", data, m_data_offset); - - m_buffer[m_data_offset++] = data; - - if (--m_data_count < 1) - { - if (m_command == FDC_WRITE_TRK) - write_track(); - else - wd17xx_write_sector(); - - m_data_offset = 0; - - /* Check we should handle the next sector for a multi record write */ - if ( m_command_type == TYPE_II && m_command == FDC_WRITE_SEC && ( m_write_cmd & FDC_MULTI_REC ) ) - { - m_sector++; - if (wd17xx_locate_sector()) - { - m_data_count = m_sector_length; - - m_status |= STA_2_BUSY; - m_busy_count = 0; - - wd17xx_timed_data_request(); - } - } - else - { - wd17xx_complete_command(DELAY_DATADONE); - if (VERBOSE) - logerror("wd17xx_data_w(): multi data write completed\n"); - } -// wd17xx_complete_command( DELAY_DATADONE); - } - else - { - if (m_command == FDC_WRITE_TRK) - { - /* Process special data values according to WD17xx specification. - Note that as CRC values take up two bytes which are written on - every 0xf7 byte, this will cause the actual image to - grow larger than what was written from the system. So we need - to take the value of data_offset when writing the track. - */ - if (wd17xx_dden()) - { - switch (data) - { - case 0xf5: - case 0xf6: - /* not allowed in FM. */ - /* Take back the last write. */ - m_data_offset--; - break; - case 0xf7: - /* Take back the last write. */ - m_data_offset--; - /* write two crc bytes */ - m_buffer[m_data_offset++] = (m_crc>>8)&0xff; - m_buffer[m_data_offset++] = (m_crc&0xff); - m_crc_active = FALSE; - break; - case 0xf8: - case 0xf9: - case 0xfa: - case 0xfb: - case 0xfe: - /* Preset crc */ - m_crc = 0xffff; - /* AM is included in the CRC */ - m_crc = ccitt_crc16_one(m_crc, data); - m_crc_active = TRUE; - break; - case 0xfc: - /* Write index mark. No effect here as we do not store clock patterns. - Maybe later. */ - break; - case 0xfd: - /* Just write, don't use for CRC. */ - break; - default: - /* Byte already written. */ - if (m_crc_active) - m_crc = ccitt_crc16_one(m_crc, data); - } - } - else /* MFM */ - { - switch (data) - { - case 0xf5: - /* Take back the last write. */ - m_data_offset--; - /* Write a1 */ - m_buffer[m_data_offset++] = 0xa1; - /* Preset CRC */ - m_crc = 0xffff; - m_crc_active = TRUE; - break; - case 0xf6: - /* Take back the last write. */ - m_data_offset--; - /* Write c2 */ - m_buffer[m_data_offset++] = 0xc2; - break; - case 0xf7: - /* Take back the last write. */ - m_data_offset--; - /* write two crc bytes */ - m_buffer[m_data_offset++] = (m_crc>>8)&0xff; - m_buffer[m_data_offset++] = (m_crc&0xff); - m_crc_active = FALSE; - break; - case 0xf8: - case 0xf9: - case 0xfa: - case 0xfb: - case 0xfc: - case 0xfd: - /* Just write, don't use for CRC. */ - break; - case 0xfe: - /* AM is included in the CRC */ - if (m_crc_active) - m_crc = ccitt_crc16_one(m_crc, data); - break; - default: - /* Byte already written. */ - if (m_crc_active) - m_crc = ccitt_crc16_one(m_crc, data); - } - } - } - /* yes... setup a timed data request */ - wd17xx_timed_data_request(); - } - } - else - { - if (VERBOSE) - logerror("%s: wd17xx_data_w $%02X\n", machine().describe_context(), data); - } - m_data = data; -} - -READ8_MEMBER( wd1770_device::read ) -{ - UINT8 data = 0; - - switch (offset & 0x03) - { - case 0: data = status_r(space, 0); break; - case 1: data = track_r(space, 0); break; - case 2: data = sector_r(space, 0); break; - case 3: data = data_r(space, 0); break; - } - - return data; -} - -WRITE8_MEMBER( wd1770_device::write ) -{ - switch (offset & 0x03) - { - case 0: command_w(space, 0, data); break; - case 1: track_w(space, 0, data); break; - case 2: sector_w(space, 0, data); break; - case 3: data_w(space, 0, data); break; - } -} - - -/*************************************************************************** - MAME DEVICE INTERFACE -***************************************************************************/ - -const device_type FD1771 = &device_creator; - -fd1771_device::fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1771, "FD1771", tag, owner, clock, "fd1771", __FILE__) -{ -} - - -const device_type FD1781 = &device_creator; - -fd1781_device::fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1781, "FD1781", tag, owner, clock, "fd1781", __FILE__) -{ -} - - -const device_type FD1791 = &device_creator; - -fd1791_device::fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1791, "FD1791", tag, owner, clock, "fd1791", __FILE__) -{ -} - - -const device_type FD1792 = &device_creator; - -fd1792_device::fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1792, "FD1792", tag, owner, clock, "fd1792", __FILE__) -{ -} - - -const device_type FD1793 = &device_creator; - -fd1793_device::fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1793, "FD1793", tag, owner, clock, "fd1793", __FILE__) -{ -} - - -const device_type FD1794 = &device_creator; - -fd1794_device::fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1794, "FD1794", tag, owner, clock, "fd1794", __FILE__) -{ -} - - -const device_type FD1795 = &device_creator; - -fd1795_device::fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1795, "FD1795", tag, owner, clock, "fd1795", __FILE__) -{ -} - - -const device_type FD1797 = &device_creator; - -fd1797_device::fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1797, "FD1797", tag, owner, clock, "fd1797", __FILE__) -{ -} - - -const device_type FD1761 = &device_creator; - -fd1761_device::fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1761, "FD1761", tag, owner, clock, "fd1761", __FILE__) -{ -} - - -const device_type FD1762 = &device_creator; - -fd1762_device::fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1762, "FD1762", tag, owner, clock, "fd1762", __FILE__) -{ -} - - -const device_type FD1763 = &device_creator; - -fd1763_device::fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1763, "FD1763", tag, owner, clock, "fd1763", __FILE__) -{ -} - - -const device_type FD1764 = &device_creator; - -fd1764_device::fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1764, "FD1764", tag, owner, clock, "fd1764", __FILE__) -{ -} - - -const device_type FD1765 = &device_creator; - -fd1765_device::fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1765, "FD1765", tag, owner, clock, "fd1765", __FILE__) -{ -} - - -const device_type FD1767 = &device_creator; - -fd1767_device::fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, FD1767, "FD1767", tag, owner, clock, "fd1767", __FILE__) -{ -} - - -const device_type WD2791 = &device_creator; - -wd2791_device::wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, WD2791, "WD2791", tag, owner, clock, "wd2791", __FILE__) -{ -} - - -const device_type WD2793 = &device_creator; - -wd2793_device::wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, WD2793, "WD2793", tag, owner, clock, "wd2793", __FILE__) -{ -} - - -const device_type WD2795 = &device_creator; - -wd2795_device::wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, WD2795, "WD2795", tag, owner, clock, "wd2795", __FILE__) -{ -} - - -const device_type WD2797 = &device_creator; - -wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, WD2797, "WD2797_LEGACY", tag, owner, clock, "wd2797_l", __FILE__) -{ -} - - -const device_type WD1770 = &device_creator; - -wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, WD1770, "WD1770_LEGACY", tag, owner, clock, "wd1770_l", __FILE__), - m_out_intrq_func(*this), - m_out_drq_func(*this), - m_in_dden_func(*this) -{ - for (int i = 0; i < 4; i++) - m_floppy_drive_tags[i] = NULL; -} - -wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source), - m_out_intrq_func(*this), - m_out_drq_func(*this), - m_in_dden_func(*this) -{ - for (int i = 0; i < 4; i++) - m_floppy_drive_tags[i] = NULL; -} - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void wd1770_device::device_start() -{ - m_status = STA_1_TRACK0; - m_pause_time = 1000; - - /* allocate timers */ - m_timer_cmd = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_command_callback),this)); - m_timer_data = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_data_callback),this)); - m_timer_rs = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_read_sector_callback),this)); - m_timer_ws = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_write_sector_callback),this)); - - /* resolve callbacks */ - m_in_dden_func.resolve(); - m_out_intrq_func.resolve_safe(); - m_out_drq_func.resolve_safe(); - - /* stepping rate depends on the clock */ - m_stepping_rate[0] = 6; - m_stepping_rate[1] = 12; - m_stepping_rate[2] = 20; - m_stepping_rate[3] = 30; - -} - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -static void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state) -{ - wd1770_device *wd = downcast(controller); - wd->index_pulse_callback(img,state); -} - -void wd1770_device::device_reset() -{ - /* set the default state of some input lines */ - m_mr = ASSERT_LINE; - m_wprt = ASSERT_LINE; - m_dden = ASSERT_LINE; - - for (int i = 0; i < 4; i++) - { - if (m_floppy_drive_tags[i]) - { - legacy_floppy_image_device *img = siblingdevice(m_floppy_drive_tags[i]); - - if (img) - { - img->floppy_drive_set_controller(this); - img->floppy_drive_set_index_pulse_callback(wd17xx_index_pulse_callback); - img->floppy_drive_set_rpm(300.); - } - } - } - - set_drive(0); - - m_hd = 0; - m_hld_count = 0; - m_sector = 1; - m_last_command_data = 0; - m_interrupt = 0; - m_data_count = 0; - m_idx = 0; - wd17xx_command_restore(); -} - - -const device_type WD1772 = &device_creator; - -wd1772_device::wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, WD1772, "WD1772_LEGACY", tag, owner, clock, "wd1772_l", __FILE__) -{ -} - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void wd1772_device::device_start() -{ - wd1770_device::device_start(); - - /* the 1772 has faster track stepping rates */ - m_stepping_rate[0] = 6; - m_stepping_rate[1] = 12; - m_stepping_rate[2] = 2; - m_stepping_rate[3] = 3; -} - - -const device_type WD1773 = &device_creator; - -wd1773_device::wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, WD1773, "WD1773_LEGACY", tag, owner, clock, "wd1773_l", __FILE__) -{ -} - - -const device_type MB8866 = &device_creator; - -mb8866_device::mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, MB8866, "MB8866", tag, owner, clock, "mb8866", __FILE__) -{ -} - - -const device_type MB8876 = &device_creator; - -mb8876_device::mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, MB8876, "MB8876", tag, owner, clock, "mb8876", __FILE__) -{ -} - - -const device_type MB8877 = &device_creator; - -mb8877_device::mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : wd1770_device(mconfig, MB8877, "MB8877_LEGACY", tag, owner, clock, "mb8877_l", __FILE__) -{ -} diff --git a/src/emu/machine/wd17xx.h b/src/emu/machine/wd17xx.h deleted file mode 100644 index 7fe3e48ea1f..00000000000 --- a/src/emu/machine/wd17xx.h +++ /dev/null @@ -1,401 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nathan Woods, Kevin Thacker, Phill Harvey-Smith, Robbbert, Curt Coder -/********************************************************************* - - !!! DEPRECATED, USE src/emu/wd_fdc.h FOR NEW DRIVERS !!! - - wd17xx.h - - Implementations of the Western Digital 17xx and 27xx families of - floppy disk controllers - -*********************************************************************/ - -#ifndef __WD17XX_H__ -#define __WD17XX_H__ - -#include "imagedev/flopdrv.h" - - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -#define MCFG_WD17XX_DRIVE_TAGS(_tag1, _tag2, _tag3, _tag4) \ - wd1770_device::set_drive_tags(*device, _tag1, _tag2, _tag3, _tag4); - -#define MCFG_WD17XX_DEFAULT_DRIVE4_TAGS \ - MCFG_WD17XX_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3) - -#define MCFG_WD17XX_DEFAULT_DRIVE2_TAGS \ - MCFG_WD17XX_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, NULL, NULL) - -#define MCFG_WD17XX_DEFAULT_DRIVE1_TAGS \ - MCFG_WD17XX_DRIVE_TAGS(FLOPPY_0, NULL, NULL, NULL) - -#define MCFG_WD17XX_INTRQ_CALLBACK(_write) \ - devcb = &wd1770_device::set_intrq_wr_callback(*device, DEVCB_##_write); - -#define MCFG_WD17XX_DRQ_CALLBACK(_write) \ - devcb = &wd1770_device::set_drq_wr_callback(*device, DEVCB_##_write); - -#define MCFG_WD17XX_DDEN_CALLBACK(_write) \ - devcb = &wd1770_device::set_dden_rd_callback(*device, DEVCB_##_write); - - -/*************************************************************************** - MACROS -***************************************************************************/ - -class wd1770_device : public device_t -{ -public: - wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - - template static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).m_out_intrq_func.set_callback(object); } - template static devcb_base &set_drq_wr_callback(device_t &device, _Object object) { return downcast(device).m_out_drq_func.set_callback(object); } - template static devcb_base &set_dden_rd_callback(device_t &device, _Object object) { return downcast(device).m_in_dden_func.set_callback(object); } - - static void set_drive_tags(device_t &device, const char *tag1, const char *tag2, const char *tag3, const char *tag4) - { - wd1770_device &dev = downcast(device); - dev.m_floppy_drive_tags[0] = tag1; - dev.m_floppy_drive_tags[1] = tag2; - dev.m_floppy_drive_tags[2] = tag3; - dev.m_floppy_drive_tags[3] = tag4; - } - - /* the following are not strictly part of the wd179x hardware/emulation - but will be put here for now until the flopdrv code has been finalised more */ - void set_drive(UINT8); /* set drive wd179x is accessing */ - void set_side(UINT8); /* set side wd179x is accessing */ - - void set_pause_time(int usec); /* default is 40 usec if not set */ - void index_pulse_callback(device_t *img, int state); - - DECLARE_READ8_MEMBER( status_r ); - DECLARE_READ8_MEMBER( track_r ); - DECLARE_READ8_MEMBER( sector_r ); - DECLARE_READ8_MEMBER( data_r ); - - DECLARE_WRITE8_MEMBER( command_w ); - DECLARE_WRITE8_MEMBER( track_w ); - DECLARE_WRITE8_MEMBER( sector_w ); - DECLARE_WRITE8_MEMBER( data_w ); - - DECLARE_READ8_MEMBER( read ); - DECLARE_WRITE8_MEMBER( write ); - - WRITE_LINE_MEMBER( mr_w ); - WRITE_LINE_MEMBER( rdy_w ); - READ_LINE_MEMBER( mo_r ); - WRITE_LINE_MEMBER( tr00_w ); - WRITE_LINE_MEMBER( idx_w ); - WRITE_LINE_MEMBER( wprt_w ); - WRITE_LINE_MEMBER( dden_w ); - READ_LINE_MEMBER( drq_r ); - READ_LINE_MEMBER( intrq_r ); -protected: - // device-level overrides - virtual void device_start(); - virtual void device_reset(); - -protected: - int wd17xx_dden(); - void wd17xx_clear_drq(); - void wd17xx_set_drq(); - void wd17xx_clear_intrq(); - void wd17xx_set_intrq(); - TIMER_CALLBACK_MEMBER( wd17xx_command_callback ); - TIMER_CALLBACK_MEMBER( wd17xx_data_callback ); - void wd17xx_set_busy(const attotime &duration); - void wd17xx_command_restore(); - void write_track(); - void read_track(); - void wd17xx_read_id(); - int wd17xx_locate_sector(); - int wd17xx_find_sector(); - void wd17xx_side_compare(UINT8 command); - void wd17xx_read_sector(); - void wd17xx_complete_command(int delay); - void wd17xx_write_sector(); - void wd17xx_verify_seek(); - TIMER_CALLBACK_MEMBER( wd17xx_read_sector_callback ); - TIMER_CALLBACK_MEMBER( wd17xx_write_sector_callback ); - void wd17xx_timed_data_request(); - void wd17xx_timed_read_sector_request(); - void wd17xx_timed_write_sector_request(); - - // internal state - /* callbacks */ - devcb_write_line m_out_intrq_func; - devcb_write_line m_out_drq_func; - devcb_read_line m_in_dden_func; - - const char *m_floppy_drive_tags[4]; - - /* input lines */ - int m_mr; /* master reset */ - int m_rdy; /* ready, enable precomp */ - int m_tr00; /* track 00 */ - int m_idx; /* index */ - int m_wprt; /* write protect */ - int m_dden; /* double density */ - - /* output lines */ - int m_mo; /* motor on */ - int m_dirc; /* direction */ - int m_drq; /* data request */ - int m_intrq; /* interrupt request */ - - /* register */ - UINT8 m_data_shift; - UINT8 m_data; - UINT8 m_track; - UINT8 m_sector; - UINT8 m_command; - UINT8 m_status; - UINT8 m_interrupt; - - int m_stepping_rate[4]; /* track stepping rate in ms */ - - unsigned short m_crc; /* Holds the current CRC value for write_track CRC calculation */ - int m_crc_active; /* Flag indicating that CRC calculation in write_track is active. */ - - UINT8 m_track_reg; /* value of track register */ - UINT8 m_command_type; /* last command type */ - UINT8 m_head; /* current head # */ - - UINT8 m_read_cmd; /* last read command issued */ - UINT8 m_write_cmd; /* last write command issued */ - INT8 m_direction; /* last step direction */ - UINT8 m_last_command_data; /* last command data */ - - UINT8 m_status_drq; /* status register data request bit */ - UINT8 m_busy_count; /* how long to keep busy bit set */ - - UINT8 m_buffer[6144]; /* I/O buffer (holds up to a whole track) */ - UINT32 m_data_offset; /* offset into I/O buffer */ - INT32 m_data_count; /* transfer count from/into I/O buffer */ - - UINT8 *m_fmt_sector_data[256]; /* pointer to data after formatting a track */ - - UINT8 m_dam_list[256][4]; /* list of data address marks while formatting */ - int m_dam_data[256]; /* offset to data inside buffer while formatting */ - int m_dam_cnt; /* valid number of entries in the dam_list */ - UINT16 m_sector_length; /* sector length (byte) */ - - UINT8 m_ddam; /* ddam of sector found - used when reading */ - UINT8 m_sector_data_id; - int m_data_direction; - - int m_hld_count; /* head loaded counter */ - - /* timers to delay execution/completion of commands */ - emu_timer *m_timer_cmd, *m_timer_data, *m_timer_rs, *m_timer_ws; - - /* this is the drive currently selected */ - legacy_floppy_image_device *m_drive; - - /* this is the head currently selected */ - UINT8 m_hd; - - /* pause time when writing/reading sector */ - int m_pause_time; - - /* Were we busy when we received a FORCE_INT command */ - UINT8 m_was_busy; -}; - -extern ATTR_DEPRECATED const device_type WD1770; - -class fd1771_device : public wd1770_device -{ -public: - fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1771; - -class fd1781_device : public wd1770_device -{ -public: - fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1781; - -class fd1791_device : public wd1770_device -{ -public: - fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1791; - -class fd1792_device : public wd1770_device -{ -public: - fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1792; - -class fd1793_device : public wd1770_device -{ -public: - fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1793; - -class fd1794_device : public wd1770_device -{ -public: - fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1794; - -class fd1795_device : public wd1770_device -{ -public: - fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1795; - -class fd1797_device : public wd1770_device -{ -public: - fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1797; - -class fd1761_device : public wd1770_device -{ -public: - fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1761; - -class fd1762_device : public wd1770_device -{ -public: - fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1762; - -class fd1763_device : public wd1770_device -{ -public: - fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1763; - -class fd1764_device : public wd1770_device -{ -public: - fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1764; - -class fd1765_device : public wd1770_device -{ -public: - fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1765; - -class fd1767_device : public wd1770_device -{ -public: - fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type FD1767; - -class wd2791_device : public wd1770_device -{ -public: - wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type WD2791; - -class wd2793_device : public wd1770_device -{ -public: - wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type WD2793; - -class wd2795_device : public wd1770_device -{ -public: - wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type WD2795; - -class wd2797_device : public wd1770_device -{ -public: - wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type WD2797; - -class wd1772_device : public wd1770_device -{ -public: - wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -protected: - // device-level overrides - virtual void device_start(); -}; - -extern ATTR_DEPRECATED const device_type WD1772; - -class wd1773_device : public wd1770_device -{ -public: - wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type WD1773; - -class mb8866_device : public wd1770_device -{ -public: - mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type MB8866; - -class mb8876_device : public wd1770_device -{ -public: - mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type MB8876; - -class mb8877_device : public wd1770_device -{ -public: - mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); -}; - -extern ATTR_DEPRECATED const device_type MB8877; - - -#endif /* __WD17XX_H__ */ From e138491f22a77837cdd8c56697947f423720c246 Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 5 Jun 2015 18:18:08 +0200 Subject: [PATCH 172/284] Fixed a number of bugs - proxy savestates - solver savestates - 7490 both counts firing at the same time bug fix. and changed timed list to be resizable. [Couriersud] --- src/emu/machine/netlist.h | 4 +- src/emu/netlist/analog/nld_ms_direct.h | 17 ++ src/emu/netlist/analog/nld_ms_jakobi.h | 362 ----------------------- src/emu/netlist/analog/nld_ms_sor.h | 12 + src/emu/netlist/analog/nld_ms_sor_mat.h | 16 + src/emu/netlist/analog/nld_solver.c | 14 +- src/emu/netlist/analog/nld_solver.h | 3 + src/emu/netlist/analog/nld_twoterm.h | 4 +- src/emu/netlist/devices/nld_74123.c | 3 +- src/emu/netlist/devices/nld_7448.c | 2 - src/emu/netlist/devices/nld_7448.h | 1 - src/emu/netlist/devices/nld_7490.c | 32 +- src/emu/netlist/devices/nld_7493.c | 10 +- src/emu/netlist/devices/nld_7493.h | 1 + src/emu/netlist/devices/nld_legacy.c | 7 +- src/emu/netlist/devices/nld_system.c | 2 + src/emu/netlist/devices/nld_truthtable.h | 8 +- src/emu/netlist/nl_base.c | 30 +- src/emu/netlist/nl_base.h | 30 +- src/emu/netlist/nl_lists.h | 11 +- src/emu/netlist/nl_setup.c | 10 +- src/emu/netlist/nl_setup.h | 78 ++--- src/emu/netlist/tools/nl_convert.c | 72 ++--- src/emu/netlist/tools/nl_convert.h | 41 ++- src/mame/drivers/nl_pong.c | 4 + 25 files changed, 231 insertions(+), 543 deletions(-) delete mode 100644 src/emu/netlist/analog/nld_ms_jakobi.h diff --git a/src/emu/machine/netlist.h b/src/emu/machine/netlist.h index 12b2148effa..829124595b5 100644 --- a/src/emu/machine/netlist.h +++ b/src/emu/machine/netlist.h @@ -60,11 +60,11 @@ // Extensions to interface netlist with MAME code .... // ---------------------------------------------------------------------------------------- -class netlist_source_memregion_t : public netlist_source_t +class netlist_source_memregion_t : public netlist_setup_t::source_t { public: netlist_source_memregion_t(pstring name) - : netlist_source_t(), m_name(name) + : netlist_setup_t::source_t(), m_name(name) { } diff --git a/src/emu/netlist/analog/nld_ms_direct.h b/src/emu/netlist/analog/nld_ms_direct.h index b757f82c8b3..3c5d404d430 100644 --- a/src/emu/netlist/analog/nld_ms_direct.h +++ b/src/emu/netlist/analog/nld_ms_direct.h @@ -8,6 +8,8 @@ #ifndef NLD_MS_DIRECT_H_ #define NLD_MS_DIRECT_H_ +#include + #include "nld_solver.h" template @@ -206,6 +208,21 @@ ATTR_COLD void netlist_matrix_solver_direct_t::vsetup(netlist_a } #endif + + //ATTR_ALIGN nl_double m_A[_storage_N][((_storage_N + 7) / 8) * 8]; + save(NLNAME(m_RHS)); + save(NLNAME(m_last_RHS)); + save(NLNAME(m_last_V)); + + for (unsigned k = 0; k < N(); k++) + { + pstring num = pstring::sprintf("%d", k); + + save(m_terms[k]->go(),"GO" + num, m_terms[k]->count()); + save(m_terms[k]->gt(),"GT" + num, m_terms[k]->count()); + save(m_terms[k]->Idr(),"IDR" + num , m_terms[k]->count()); + } + } diff --git a/src/emu/netlist/analog/nld_ms_jakobi.h b/src/emu/netlist/analog/nld_ms_jakobi.h deleted file mode 100644 index 04da90a6176..00000000000 --- a/src/emu/netlist/analog/nld_ms_jakobi.h +++ /dev/null @@ -1,362 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_ms_direct1.h - * - */ - -#ifndef NLD_MS_GAUSS_SEIDEL_H_ -#define NLD_MS_GAUSS_SEIDEL_H_ - -#include "nld_solver.h" -#include "nld_ms_direct.h" - -template -class netlist_matrix_solver_SOR_t: public netlist_matrix_solver_direct_t -{ -public: - - netlist_matrix_solver_SOR_t(const netlist_solver_parameters_t ¶ms, int size) - : netlist_matrix_solver_direct_t(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size) - , m_lp_fact(0) - , m_gs_fail(0) - , m_gs_total(0) - { - const char *p = osd_getenv("NL_STATS"); - if (p != NULL) - m_log_stats = (bool) atoi(p); - else - m_log_stats = false; - } - - virtual ~netlist_matrix_solver_SOR_t() {} - - virtual void log_stats(); - - ATTR_HOT inline int vsolve_non_dynamic(); -protected: - ATTR_HOT virtual nl_double vsolve(); - -private: - nl_double m_lp_fact; - int m_gs_fail; - int m_gs_total; - bool m_log_stats; - -}; - -// ---------------------------------------------------------------------------------------- -// netlist_matrix_solver - Gauss - Seidel -// ---------------------------------------------------------------------------------------- - -template -void netlist_matrix_solver_SOR_t::log_stats() -{ - if (this->m_stat_calculations != 0 && m_log_stats) - { - printf("==============================================\n"); - printf("Solver %s\n", this->name().cstr()); - printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); - printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); - printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); - printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); - printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", - this->m_stat_calculations, - this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), - this->m_gs_fail, - 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, - (double) this->m_gs_total / (double) this->m_stat_calculations); - } -} - -template -ATTR_HOT nl_double netlist_matrix_solver_SOR_t::vsolve() -{ - /* - * enable linear prediction on first newton pass - */ - - if (USE_LINEAR_PREDICTION) - for (int k = 0; k < this->N(); k++) - { - this->m_last_V[k] = this->m_nets[k]->m_cur_Analog; - this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact; - } - else - for (int k = 0; k < this->N(); k++) - { - this->m_last_V[k] = this->m_nets[k]->m_cur_Analog; - } - - this->solve_base(this); - - if (USE_LINEAR_PREDICTION) - { - nl_double sq = 0; - nl_double sqo = 0; - const nl_double rez_cts = 1.0 / this->current_timestep(); - for (int k = 0; k < this->N(); k++) - { - const netlist_analog_net_t *n = this->m_nets[k]; - const nl_double nv = (n->m_cur_Analog - this->m_last_V[k]) * rez_cts ; - sq += nv * nv; - sqo += this->m_Vdelta[k] * this->m_Vdelta[k]; - this->m_Vdelta[k] = nv; - } - if (sqo > 1e-90) - m_lp_fact = std::min(nl_math::sqrt(sq/sqo), 2.0); - else - m_lp_fact = 0.0; - } - - - return this->compute_next_timestep(); -} - -template -ATTR_HOT inline int netlist_matrix_solver_SOR_t::vsolve_non_dynamic() -{ - /* The matrix based code looks a lot nicer but actually is 30% slower than - * the optimized code which works directly on the data structures. - * Need something like that for gaussian elimination as well. - */ - -#if 0 || USE_MATRIX_GS - static nl_double ws = 1.0; - ATTR_ALIGN nl_double new_v[_storage_N] = { 0.0 }; - const int iN = this->N(); - - bool resched = false; - - int resched_cnt = 0; - - this->build_LE(); - - { - nl_double frob; - frob = 0; - nl_double rmin = 1e99, rmax = -1e99; - for (int k = 0; k < iN; k++) - { - new_v[k] = this->m_nets[k]->m_cur_Analog; - nl_double s=0.0; - for (int i = 0; i < iN; i++) - { - frob += this->m_A[k][i] * this->m_A[k][i]; - s = s + nl_math::abs(this->m_A[k][i]); - } - - if (srmax) - rmax = s; - } -#if 0 - nl_double frobA = nl_math::sqrt(frob /(iN)); - if (1 &&frobA < 1.0) - //ws = 2.0 / (1.0 + nl_math::sqrt(1.0-frobA)); - ws = 2.0 / (2.0 - frobA); - else - ws = 1.0; - ws = 0.9; -#else - // calculate an estimate for rho. - // This is based on the Perron???Frobenius theorem for positive matrices. - // No mathematical proof here. The following estimates the - // optimal relaxation parameter pretty well. Unfortunately, the - // overhead is bigger than the gain. Consequently the fast GS below - // uses a fixed GS. One can however use this here to determine a - // suitable parameter. - nl_double rm = (rmax + rmin) * 0.5; - if (rm < 1.0) - ws = 2.0 / (1.0 + nl_math::sqrt(1.0-rm)); - else - ws = 1.0; - if (ws > 1.02 && rmax > 1.001) - printf("rmin %f rmax %f ws %f\n", rmin, rmax, ws); -#endif - } - - // Frobenius norm for (D-L)^(-1)U - //nl_double frobU; - //nl_double frobL; - //nl_double norm; - do { - resched = false; - nl_double cerr = 0.0; - //frobU = 0; - //frobL = 0; - //norm = 0; - - for (int k = 0; k < iN; k++) - { - nl_double Idrive = 0; - //nl_double norm_t = 0; - // Reduction loops need -ffast-math - for (int i = 0; i < iN; i++) - Idrive += this->m_A[k][i] * new_v[i]; - - for (int i = 0; i < iN; i++) - { - //if (i < k) frobL += this->m_A[k][i] * this->m_A[k][i] / this->m_A[k][k] /this-> m_A[k][k]; - //if (i > k) frobU += this->m_A[k][i] * this->m_A[k][i] / this->m_A[k][k] / this->m_A[k][k]; - //norm_t += nl_math::abs(this->m_A[k][i]); - } - - //if (norm_t > norm) norm = norm_t; - const nl_double new_val = (1.0-ws) * new_v[k] + ws * (this->m_RHS[k] - Idrive + this->m_A[k][k] * new_v[k]) / this->m_A[k][k]; - - const nl_double e = nl_math::abs(new_val - new_v[k]); - cerr = (e > cerr ? e : cerr); - new_v[k] = new_val; - } - - if (cerr > this->m_params.m_accuracy) - { - resched = true; - } - resched_cnt++; - //ATTR_UNUSED nl_double frobUL = nl_math::sqrt((frobU + frobL) / (double) (iN) / (double) (iN)); - } while (resched && (resched_cnt < this->m_params.m_gs_loops)); - //printf("Frobenius %f %f %f %f %f\n", nl_math::sqrt(frobU), nl_math::sqrt(frobL), frobUL, frobA, norm); - //printf("Omega Estimate1 %f %f\n", 2.0 / (1.0 + nl_math::sqrt(1-frobUL)), 2.0 / (1.0 + nl_math::sqrt(1-frobA)) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) )); - //printf("Omega Estimate2 %f %f\n", 2.0 / (2.0 - frobUL), 2.0 / (2.0 - frobA) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) )); - - - this->store(new_v, false); - - this->m_gs_total += resched_cnt; - if (resched) - { - //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS"); - this->m_gs_fail++; - int tmp = netlist_matrix_solver_direct_t::solve_non_dynamic(); - this->m_calculations++; - return tmp; - } - else { - this->m_calculations++; - - return resched_cnt; - } - -#else - const int iN = this->N(); - bool resched = false; - int resched_cnt = 0; - - /* ideally, we could get an estimate for the spectral radius of - * Inv(D - L) * U - * - * and estimate using - * - * omega = 2.0 / (1.0 + nl_math::sqrt(1-rho)) - */ - - const nl_double ws = this->m_params.m_sor; //1.045; //2.0 / (1.0 + /*sin*/(3.14159 * 5.5 / (double) (m_nets.count()+1))); - //const nl_double ws = 2.0 / (1.0 + sin(3.14159 * 4 / (double) (this->N()))); - - ATTR_ALIGN nl_double w[_storage_N]; - ATTR_ALIGN nl_double one_m_w[_storage_N]; - ATTR_ALIGN nl_double RHS[_storage_N]; - ATTR_ALIGN nl_double new_V[_storage_N]; - ATTR_ALIGN nl_double old_V[_storage_N]; - - for (int k = 0; k < iN; k++) - { - nl_double gtot_t = 0.0; - nl_double gabs_t = 0.0; - nl_double RHS_t = 0.0; - - new_V[k] = this->m_nets[k]->m_cur_Analog; - - { - const int term_count = this->m_terms[k]->count(); - const nl_double * const RESTRICT gt = this->m_terms[k]->gt(); - const nl_double * const RESTRICT go = this->m_terms[k]->go(); - const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr(); - const nl_double * const *other_cur_analog = this->m_terms[k]->other_curanalog(); - - for (int i = 0; i < term_count; i++) - { - gtot_t = gtot_t + gt[i]; - RHS_t = RHS_t + Idr[i]; - } - if (USE_GABS) - for (int i = 0; i < term_count; i++) - gabs_t = gabs_t + nl_math::abs(go[i]); - - for (int i = this->m_terms[k]->m_railstart; i < term_count; i++) - RHS_t = RHS_t + go[i] * *other_cur_analog[i]; - } - - RHS[k] = RHS_t; - - //if (nl_math::abs(gabs_t - nl_math::abs(gtot_t)) > 1e-20) - // printf("%d %e abs: %f tot: %f\n",k, gabs_t / gtot_t -1.0, gabs_t, gtot_t); - - gabs_t *= 0.95; // avoid rounding issues - if (!USE_GABS || gabs_t <= gtot_t) - { - w[k] = ws / gtot_t; - one_m_w[k] = 1.0 - ws; - } - else - { - //printf("abs: %f tot: %f\n", gabs_t, gtot_t); - w[k] = 1.0 / (gtot_t + gabs_t); - one_m_w[k] = 1.0 - 1.0 * gtot_t / (gtot_t + gabs_t); - } - - } - - const nl_double accuracy = this->m_params.m_accuracy; - - for (int k = 0; k < iN; k++) - old_V[k] = this->m_nets[k]->m_cur_Analog; - do { - resched = false; - - for (int k = 0; k < iN; k++) - { - const int * RESTRICT net_other = this->m_terms[k]->net_other(); - const int railstart = this->m_terms[k]->m_railstart; - const nl_double * RESTRICT go = this->m_terms[k]->go(); - - nl_double Idrive = 0.0; - for (int i = 0; i < railstart; i++) - //Idrive = Idrive + go[i] * new_V[net_other[i]]; - Idrive = Idrive + go[i] * old_V[net_other[i]]; - - //const nl_double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k]; - //resched = resched || (nl_math::abs(new_val - new_V[k]) > accuracy); - const nl_double new_val = old_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k]; - resched = resched || (nl_math::abs(new_val - old_V[k]) > accuracy); - new_V[k] = new_val; - } - for (int k = 0; k < iN; k++) - old_V[k] = new_V[k]; - - resched_cnt++; - } while (resched && (resched_cnt < this->m_params.m_gs_loops)); - - for (int k = 0; k < iN; k++) - this->m_nets[k]->m_cur_Analog = new_V[k]; - - this->m_gs_total += resched_cnt; - this->m_stat_calculations++; - - if (resched) - { - //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS"); - this->m_gs_fail++; - return netlist_matrix_solver_direct_t::vsolve_non_dynamic(); - } - else { - return resched_cnt; - } -#endif -} - - -#endif /* NLD_MS_GAUSS_SEIDEL_H_ */ diff --git a/src/emu/netlist/analog/nld_ms_sor.h b/src/emu/netlist/analog/nld_ms_sor.h index 93d645b3633..4219363e229 100644 --- a/src/emu/netlist/analog/nld_ms_sor.h +++ b/src/emu/netlist/analog/nld_ms_sor.h @@ -12,6 +12,8 @@ #ifndef NLD_MS_SOR_H_ #define NLD_MS_SOR_H_ +#include + #include "nld_solver.h" #include "nld_ms_direct.h" @@ -32,6 +34,7 @@ public: virtual void log_stats(); + virtual void vsetup(netlist_analog_net_t::list_t &nets); ATTR_HOT virtual int vsolve_non_dynamic(const bool newton_raphson); protected: ATTR_HOT virtual nl_double vsolve(); @@ -66,6 +69,15 @@ void netlist_matrix_solver_SOR_t::log_stats() } } +template +void netlist_matrix_solver_SOR_t::vsetup(netlist_analog_net_t::list_t &nets) +{ + netlist_matrix_solver_direct_t::vsetup(nets); + this->save(NLNAME(m_lp_fact)); + this->save(NLNAME(m_gs_fail)); + this->save(NLNAME(m_gs_total)); +} + template ATTR_HOT nl_double netlist_matrix_solver_SOR_t::vsolve() { diff --git a/src/emu/netlist/analog/nld_ms_sor_mat.h b/src/emu/netlist/analog/nld_ms_sor_mat.h index fd7d76a0157..4a788f8f403 100644 --- a/src/emu/netlist/analog/nld_ms_sor_mat.h +++ b/src/emu/netlist/analog/nld_ms_sor_mat.h @@ -12,9 +12,12 @@ #ifndef NLD_MS_SOR_MAT_H_ #define NLD_MS_SOR_MAT_H_ +#include + #include "nld_solver.h" #include "nld_ms_direct.h" + template class netlist_matrix_solver_SOR_mat_t: public netlist_matrix_solver_direct_t { @@ -37,6 +40,7 @@ public: virtual ~netlist_matrix_solver_SOR_mat_t() {} virtual void log_stats(); + virtual void vsetup(netlist_analog_net_t::list_t &nets); ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson); protected: @@ -77,6 +81,18 @@ void netlist_matrix_solver_SOR_mat_t::log_stats() } } +template +void netlist_matrix_solver_SOR_mat_t::vsetup(netlist_analog_net_t::list_t &nets) +{ + netlist_matrix_solver_direct_t::vsetup(nets); + this->save(NLNAME(m_omega)); + this->save(NLNAME(m_lp_fact)); + this->save(NLNAME(m_gs_fail)); + this->save(NLNAME(m_gs_total)); + this->save(NLNAME(m_Vdelta)); +} + + template ATTR_HOT nl_double netlist_matrix_solver_SOR_mat_t::vsolve() { diff --git a/src/emu/netlist/analog/nld_solver.c b/src/emu/netlist/analog/nld_solver.c index 41a13792490..947cda58cbb 100644 --- a/src/emu/netlist/analog/nld_solver.c +++ b/src/emu/netlist/analog/nld_solver.c @@ -173,15 +173,7 @@ ATTR_HOT void netlist_matrix_solver_t::update_dynamic() { /* update all non-linear devices */ for (std::size_t i=0; i < m_dynamic_devices.size(); i++) - switch (m_dynamic_devices[i]->family()) - { - case netlist_device_t::DIODE: - static_cast(m_dynamic_devices[i])->update_terminals(); - break; - default: - m_dynamic_devices[i]->update_terminals(); - break; - } + m_dynamic_devices[i]->update_terminals(); } ATTR_COLD void netlist_matrix_solver_t::start() @@ -189,6 +181,10 @@ ATTR_COLD void netlist_matrix_solver_t::start() register_output("Q_sync", m_Q_sync); register_input("FB_sync", m_fb_sync); connect(m_fb_sync, m_Q_sync); + + save(NLNAME(m_last_step)); + save(NLNAME(m_cur_ts)); + } ATTR_COLD void netlist_matrix_solver_t::reset() diff --git a/src/emu/netlist/analog/nld_solver.h b/src/emu/netlist/analog/nld_solver.h index 0ddd3fd2a0f..a774912ac00 100644 --- a/src/emu/netlist/analog/nld_solver.h +++ b/src/emu/netlist/analog/nld_solver.h @@ -61,6 +61,9 @@ class terms_t m_term.clear(); m_net_other.clear(); m_gt.clear(); + m_go.clear(); + m_Idr.clear(); + m_other_curanalog.clear(); } ATTR_COLD void add(netlist_terminal_t *term, int net_other); diff --git a/src/emu/netlist/analog/nld_twoterm.h b/src/emu/netlist/analog/nld_twoterm.h index 43b0f61a8f8..8088b684902 100644 --- a/src/emu/netlist/analog/nld_twoterm.h +++ b/src/emu/netlist/analog/nld_twoterm.h @@ -102,14 +102,14 @@ public: { } - ATTR_HOT inline void set(const nl_double G, const nl_double V, const nl_double I) + ATTR_HOT /* inline */ void set(const nl_double G, const nl_double V, const nl_double I) { /* GO, GT, I */ m_P.set( G, G, ( V) * G - I); m_N.set( G, G, ( -V) * G + I); } - ATTR_HOT inline nl_double deltaV() const + ATTR_HOT /* inline */ nl_double deltaV() const { return m_P.net().as_analog().Q_Analog() - m_N.net().as_analog().Q_Analog(); } diff --git a/src/emu/netlist/devices/nld_74123.c b/src/emu/netlist/devices/nld_74123.c index 5d301558c2d..618f4735e26 100644 --- a/src/emu/netlist/devices/nld_74123.c +++ b/src/emu/netlist/devices/nld_74123.c @@ -42,11 +42,12 @@ NETLIB_START(74123) connect(m_RN.m_R.m_P, m_RP.m_R.m_N); connect(m_CV, m_RN.m_R.m_P); + m_KP = 1.0 / (1.0 + exp(m_K.Value())); + save(NLNAME(m_last_trig)); save(NLNAME(m_state)); save(NLNAME(m_KP)); - m_KP = 1.0 / (1.0 + exp(m_K.Value())); } NETLIB_UPDATE(74123) diff --git a/src/emu/netlist/devices/nld_7448.c b/src/emu/netlist/devices/nld_7448.c index 7533449e8c5..3ee68f46c91 100644 --- a/src/emu/netlist/devices/nld_7448.c +++ b/src/emu/netlist/devices/nld_7448.c @@ -135,13 +135,11 @@ NETLIB_START(7448_sub) register_output("g", m_Q[6]); save(NLNAME(m_state)); - save(NLNAME(m_active)); } NETLIB_RESET(7448_sub) { m_state = 0; - m_active = 1; } NETLIB_UPDATE(7448_sub) diff --git a/src/emu/netlist/devices/nld_7448.h b/src/emu/netlist/devices/nld_7448.h index 676da1ac184..4cc3f346809 100644 --- a/src/emu/netlist/devices/nld_7448.h +++ b/src/emu/netlist/devices/nld_7448.h @@ -59,7 +59,6 @@ NETLIB_SUBDEVICE(7448_sub, netlist_logic_input_t m_RBIQ; UINT8 m_state; - int m_active; netlist_logic_output_t m_Q[7]; /* a .. g */ diff --git a/src/emu/netlist/devices/nld_7490.c b/src/emu/netlist/devices/nld_7490.c index 03317c96040..ec149da7fce 100644 --- a/src/emu/netlist/devices/nld_7490.c +++ b/src/emu/netlist/devices/nld_7490.c @@ -43,6 +43,9 @@ static const netlist_time delay[4] = NETLIB_UPDATE(7490) { + const netlist_sig_t new_A = INPLOGIC(m_A); + const netlist_sig_t new_B = INPLOGIC(m_B); + if (INPLOGIC(m_R91) & INPLOGIC(m_R92)) { m_cnt = 9; @@ -53,20 +56,23 @@ NETLIB_UPDATE(7490) m_cnt = 0; update_outputs(); } - else if (m_last_A && !INPLOGIC(m_A)) // High - Low + else { - m_cnt ^= 1; - OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]); + if (m_last_A && !new_A) // High - Low + { + m_cnt ^= 1; + OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]); + } + if (m_last_B && !new_B) // High - Low + { + m_cnt += 2; + if (m_cnt >= 10) + m_cnt &= 1; /* Output A is not reset! */ + update_outputs(); + } } - else if (m_last_B && !INPLOGIC(m_B)) // High - Low - { - m_cnt += 2; - if (m_cnt >= 10) - m_cnt = 0; - update_outputs(); - } - m_last_A = INPLOGIC(m_A); - m_last_B = INPLOGIC(m_B); + m_last_A = new_A; + m_last_B = new_B; } NETLIB_FUNC_VOID(7490, update_outputs, (void)) @@ -85,7 +91,7 @@ NETLIB_START(7490_dip) // register_subalias("4", ); --> NC // register_subalias("5", ); --> VCC register_subalias("6", m_R91); - register_subalias("7", m_R92); + register_subalias("7", m_R92); register_subalias("8", m_Q[2]); register_subalias("9", m_Q[1]); diff --git a/src/emu/netlist/devices/nld_7493.c b/src/emu/netlist/devices/nld_7493.c index 7f5be72fd6a..b558410d828 100644 --- a/src/emu/netlist/devices/nld_7493.c +++ b/src/emu/netlist/devices/nld_7493.c @@ -43,19 +43,24 @@ NETLIB_START(7493ff) register_output("Q", m_Q); save(NLNAME(m_reset)); + save(NLNAME(m_state)); } NETLIB_RESET(7493ff) { m_reset = 1; + m_state = 0; m_I.set_state(netlist_logic_t::STATE_INP_HL); } NETLIB_UPDATE(7493ff) { const netlist_time out_delay = NLTIME_FROM_NS(18); - //if (m_reset == 0) - OUTLOGIC(m_Q, (!m_Q.net().as_logic().new_Q()) & m_reset, out_delay); + if (m_reset != 0) + { + m_state ^= 1; + OUTLOGIC(m_Q, m_state, out_delay); + } } NETLIB_UPDATE(7493) @@ -71,6 +76,7 @@ NETLIB_UPDATE(7493) OUTLOGIC(C.m_Q, 0, NLTIME_FROM_NS(40)); OUTLOGIC(D.m_Q, 0, NLTIME_FROM_NS(40)); A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0; + A.m_state = B.m_state = C.m_state = D.m_state = 0; } else { diff --git a/src/emu/netlist/devices/nld_7493.h b/src/emu/netlist/devices/nld_7493.h index 1cdb1594076..c78b7dce4dc 100644 --- a/src/emu/netlist/devices/nld_7493.h +++ b/src/emu/netlist/devices/nld_7493.h @@ -74,6 +74,7 @@ NETLIB_SUBDEVICE(7493ff, netlist_logic_output_t m_Q; UINT8 m_reset; + UINT8 m_state; ); NETLIB_DEVICE(7493, diff --git a/src/emu/netlist/devices/nld_legacy.c b/src/emu/netlist/devices/nld_legacy.c index 6eadf46ad64..ed4e384bc2a 100644 --- a/src/emu/netlist/devices/nld_legacy.c +++ b/src/emu/netlist/devices/nld_legacy.c @@ -59,15 +59,16 @@ NETLIB_UPDATE_PARAM(nicDelay) NETLIB_UPDATE(nicDelay) { - if (INPLOGIC(m_I) && !m_last) + netlist_sig_t nval = INPLOGIC(m_I); + if (nval && !m_last) { // L_to_H OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(m_L_to_H.Value())); } - else if (!INPLOGIC(m_I) && m_last) + else if (!nval && m_last) { // H_to_L OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(m_H_to_L.Value())); } - m_last = INPLOGIC(m_I); + m_last = nval; } diff --git a/src/emu/netlist/devices/nld_system.c b/src/emu/netlist/devices/nld_system.c index d32b169151d..68057768bad 100644 --- a/src/emu/netlist/devices/nld_system.c +++ b/src/emu/netlist/devices/nld_system.c @@ -190,6 +190,8 @@ void nld_d_to_a_proxy::start() connect(m_RV.m_N, m_Q); m_Q.initial(0.0); + + save(NLNAME(m_last_state)); } void nld_d_to_a_proxy::reset() diff --git a/src/emu/netlist/devices/nld_truthtable.h b/src/emu/netlist/devices/nld_truthtable.h index dbeeb5ab57e..3036178bcfb 100644 --- a/src/emu/netlist/devices/nld_truthtable.h +++ b/src/emu/netlist/devices/nld_truthtable.h @@ -157,16 +157,17 @@ public: for (int k=0; m_ttp->m_timing_nt[k] != netlist_time::zero; k++) printf("%d %f\n", k, m_ttp->m_timing_nt[k].as_double() * 1000000.0); #endif - // FIXME: save state save(NLNAME(m_last_state)); save(NLNAME(m_ign)); save(NLNAME(m_active)); - } void reset() { m_active = 0; + m_ign = 0; + for (unsigned i = 0; i < m_NI; i++) + m_i[i].activate(); for (unsigned i=0; im_Q[i].net().num_cons()>0) m_active++; @@ -181,7 +182,7 @@ public: UINT32 state = 0; for (unsigned i = 0; i < m_NI; i++) { - if (!doOUT || (m_ign & (1<() + : netlist_timed_queue(512) , netlist_object_t(QUEUE, GENERIC) , pstate_callback_t() , m_qsize(0) + , m_times(512) + , m_names(512) { this->init_object(nl, "QUEUE"); } @@ -98,8 +101,8 @@ void netlist_queue_t::register_state(pstate_manager_t &manager, const pstring &m { NL_VERBOSE_OUT(("register_state\n")); manager.save_item(m_qsize, this, module + "." + "qsize"); - manager.save_item(m_times, this, module + "." + "times"); - manager.save_item(&(m_name[0][0]), this, module + "." + "names", sizeof(m_name)); + manager.save_item(&m_times[0], this, module + "." + "times", m_times.size()); + manager.save_item(&(m_names[0][0]), this, module + "." + "names", m_names.size() * 64); } void netlist_queue_t::on_pre_save() @@ -113,8 +116,8 @@ void netlist_queue_t::on_pre_save() pstring p = this->listptr()[i].object()->name(); int n = p.len(); n = std::min(63, n); - std::strncpy(&(m_name[i][0]), p, n); - m_name[i][n] = 0; + std::strncpy(&(m_names[i][0]), p, n); + m_names[i][n] = 0; } } @@ -125,9 +128,9 @@ void netlist_queue_t::on_post_load() NL_VERBOSE_OUT(("current time %f qsize %d\n", netlist().time().as_double(), m_qsize)); for (int i = 0; i < m_qsize; i++ ) { - netlist_net_t *n = netlist().find_net(&(m_name[i][0])); + netlist_net_t *n = netlist().find_net(&(m_names[i][0])); //NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n)); - //NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double())); + //NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double())); this->push(netlist_queue_t::entry_t(netlist_time::from_raw(m_times[i]), n)); } } @@ -186,11 +189,11 @@ netlist_base_t::netlist_base_t() : netlist_object_t(NETLIST, GENERIC), pstate_manager_t(), m_stop(netlist_time::zero), m_time(netlist_time::zero), + m_use_deactivate(0), m_queue(*this), m_mainclock(NULL), m_solver(NULL), m_gnd(NULL), - m_use_deactivate(0), m_setup(NULL) { } @@ -282,6 +285,7 @@ ATTR_COLD netlist_net_t *netlist_base_t::find_net(const pstring &name) ATTR_COLD void netlist_base_t::rebuild_lists() { + //printf("Rebuild Lists\n"); for (std::size_t i = 0; i < m_nets.size(); i++) m_nets[i]->rebuild_list(); } @@ -606,6 +610,7 @@ ATTR_HOT void netlist_net_t::inc_active(netlist_core_terminal_t &term) { m_active++; m_list_active.insert(term); + nl_assert(m_active <= num_cons()); if (m_active == 1) { if (netlist().use_deactivate()) @@ -634,6 +639,7 @@ ATTR_HOT void netlist_net_t::inc_active(netlist_core_terminal_t &term) ATTR_HOT void netlist_net_t::dec_active(netlist_core_terminal_t &term) { m_active--; + nl_assert(m_active >= 0); m_list_active.remove(term); if (m_active == 0 && netlist().use_deactivate()) railterminal().netdev().dec_active(); @@ -649,10 +655,17 @@ ATTR_COLD void netlist_net_t::rebuild_list() { /* rebuild m_list */ + unsigned cnt = 0; m_list_active.clear(); for (std::size_t i=0; i < m_core_terms.size(); i++) if (m_core_terms[i]->state() != netlist_logic_t::STATE_INP_PASSIVE) + { m_list_active.add(*m_core_terms[i]); + cnt++; + } + //if (cnt != m_active) + //printf("ARgh %s ==> %d != %d\n", name().cstr(), cnt, m_active); + m_active = cnt; } ATTR_COLD void netlist_net_t::save_register() @@ -759,6 +772,7 @@ ATTR_COLD void netlist_net_t::move_connections(netlist_net_t *dest_net) dest_net->register_con(*p); } m_core_terms.clear(); // FIXME: othernet needs to be free'd from memory + m_active = 0; } ATTR_COLD void netlist_net_t::merge_net(netlist_net_t *othernet) diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index 7d9019d8859..9b7059efb10 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -168,14 +168,6 @@ #define netlist_sig_t UINT8 -class netlist_core_device_t; - -#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) -typedef void (netlist_core_device_t::*net_update_delegate)(); -#elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) -typedef MEMBER_ABI void (*net_update_delegate)(netlist_core_device_t *); -#endif - //============================================================ // MACROS / netlist devices //============================================================ @@ -273,7 +265,7 @@ private: // Asserts //============================================================ -#ifdef MAME_DEBUG +#if defined(MAME_DEBUG) #define nl_assert(x) do { if (!(x)) throw nl_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) #else #define nl_assert(x) do { if (0) if (!(x)) throw nl_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) @@ -289,10 +281,10 @@ class netlist_logic_output_t; class netlist_analog_net_t; class netlist_logic_net_t; class netlist_net_t; -class netlist_param_t; class netlist_setup_t; class netlist_base_t; class netlist_matrix_solver_t; +class netlist_core_device_t; class NETLIB_NAME(gnd); class NETLIB_NAME(solver); @@ -1031,6 +1023,7 @@ public: ATTR_HOT netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const { + //printf("%s %d\n", inp.name().cstr(), inp.state()); nl_assert(inp.state() != netlist_logic_t::STATE_INP_PASSIVE); return inp.Q(); } @@ -1074,6 +1067,13 @@ protected: } private: + + #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF) + typedef void (netlist_core_device_t::*net_update_delegate)(); + #elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)) + typedef MEMBER_ABI void (*net_update_delegate)(netlist_core_device_t *); + #endif + #if (NL_PMF_TYPE > NL_PMF_TYPE_VIRTUAL) net_update_delegate m_static_update; #endif @@ -1123,7 +1123,7 @@ private: // netlist_queue_t // ----------------------------------------------------------------------------- -class netlist_queue_t : public netlist_timed_queue, +class netlist_queue_t : public netlist_timed_queue, public netlist_object_t, public pstate_callback_t { @@ -1140,8 +1140,8 @@ protected: private: int m_qsize; - netlist_time::INTERNALTYPE m_times[512]; - char m_name[512][64]; + parray_t m_times; + parray_t m_names; }; // ----------------------------------------------------------------------------- @@ -1263,13 +1263,14 @@ private: netlist_time m_stop; // target time for current queue processing netlist_time m_time; + bool m_use_deactivate; netlist_queue_t m_queue; + NETLIB_NAME(mainclock) * m_mainclock; NETLIB_NAME(solver) * m_solver; NETLIB_NAME(gnd) * m_gnd; - bool m_use_deactivate; NETLIB_NAME(netlistparams) *m_params; netlist_setup_t *m_setup; @@ -1334,6 +1335,7 @@ ATTR_HOT inline void netlist_logic_input_t::inactivate() { if (EXPECTED(!is_state(STATE_INP_PASSIVE))) { + //printf("inactivate %s\n", name().cstr()); set_state(STATE_INP_PASSIVE); net().as_logic().dec_active(*this); } diff --git a/src/emu/netlist/nl_lists.h b/src/emu/netlist/nl_lists.h index 94726cad80f..bb47c3137f6 100644 --- a/src/emu/netlist/nl_lists.h +++ b/src/emu/netlist/nl_lists.h @@ -11,12 +11,13 @@ #define NLLISTS_H_ #include "nl_config.h" +#include "plib/plists.h" // ---------------------------------------------------------------------------------------- // timed queue // ---------------------------------------------------------------------------------------- -template +template class netlist_timed_queue { NETLIST_PREVENT_COPYING(netlist_timed_queue) @@ -42,7 +43,8 @@ public: _Element m_object; }; - netlist_timed_queue() + netlist_timed_queue(unsigned list_size) + : m_list(list_size) { #if HAS_OPENMP && USE_OPENMP m_lock = 0; @@ -50,7 +52,7 @@ public: clear(); } - ATTR_HOT int capacity() const { return _Size; } + ATTR_HOT std::size_t capacity() const { return m_list.size(); } ATTR_HOT bool is_empty() const { return (m_end == &m_list[1]); } ATTR_HOT bool is_not_empty() const { return (m_end > &m_list[1]); } @@ -144,7 +146,8 @@ private: volatile INT32 m_lock; #endif entry_t * m_end; - entry_t m_list[_Size]; + //entry_t m_list[_Size]; + parray_t m_list; }; diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index a9c39a3d8b7..b33c9e1e995 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -62,6 +62,7 @@ netlist_setup_t::~netlist_setup_t() netlist().set_setup(NULL); pfree(m_factory); + m_sources.clear_and_free(); pstring::resetmem(); } @@ -799,21 +800,20 @@ void netlist_setup_t::print_stats() const // Sources // ---------------------------------------------------------------------------------------- -void netlist_sources_t::parse(netlist_setup_t *setup, const pstring name) +void netlist_setup_t::include(const pstring &netlist_name) { - for (std::size_t i=0; i < m_list.size(); i++) + for (std::size_t i=0; i < m_sources.size(); i++) { - if (m_list[i]->parse(setup, name)) + if (m_sources[i]->parse(this, netlist_name)) return; } - setup->netlist().error("unable to find %s in source collection", name.cstr()); + netlist().error("unable to find %s in source collection", netlist_name.cstr()); } // ---------------------------------------------------------------------------------------- // base sources // ---------------------------------------------------------------------------------------- - bool netlist_source_string_t::parse(netlist_setup_t *setup, const pstring name) { netlist_parser p(*setup); diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index 78e48735690..a97b1bad727 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -70,47 +70,6 @@ ATTR_COLD void NETLIST_NAME(_name)(netlist_setup_t &setup) class netlist_setup_t; -// ---------------------------------------------------------------------------------------- -// A Generic netlist sources implementation -// ---------------------------------------------------------------------------------------- - -class netlist_source_t -{ -public: - typedef plist_t list_t; - - netlist_source_t() - {} - - virtual ~netlist_source_t() { } - - virtual bool parse(netlist_setup_t *setup, const pstring name) = 0; -private: -}; - - -class netlist_sources_t -{ -public: - - netlist_sources_t() { } - - ~netlist_sources_t() - { - m_list.clear_and_free(); - } - - void add(netlist_source_t *src) - { - m_list.add(src); - } - - void parse(netlist_setup_t *setup, const pstring name); - -private: - netlist_source_t::list_t m_list; -}; - // ---------------------------------------------------------------------------------------- // netlist_setup_t // ---------------------------------------------------------------------------------------- @@ -123,6 +82,24 @@ class netlist_setup_t NETLIST_PREVENT_COPYING(netlist_setup_t) public: + // ---------------------------------------------------------------------------------------- + // A Generic netlist sources implementation + // ---------------------------------------------------------------------------------------- + + class source_t + { + public: + typedef plist_t list_t; + + source_t() + {} + + virtual ~source_t() { } + + virtual bool parse(netlist_setup_t *setup, const pstring name) = 0; + private: + }; + struct link_t { link_t() { } @@ -193,11 +170,11 @@ public: /* parse a source */ - void include(pstring netlist_name) { m_sources.parse(this, netlist_name); } + void include(const pstring &netlist_name); /* register a source */ - void register_source(netlist_source_t *src) { m_sources.add(src); } + void register_source(source_t *src) { m_sources.add(src); } netlist_factory_list_t &factory() { return *m_factory; } const netlist_factory_list_t &factory() const { return *m_factory; } @@ -225,7 +202,7 @@ private: int m_proxy_cnt; pstack_t m_stack; - netlist_sources_t m_sources; + source_t::list_t m_sources; void connect_terminals(netlist_core_terminal_t &in, netlist_core_terminal_t &out); @@ -260,12 +237,12 @@ private: // ---------------------------------------------------------------------------------------- -class netlist_source_string_t : public netlist_source_t +class netlist_source_string_t : public netlist_setup_t::source_t { public: netlist_source_string_t(pstring source) - : netlist_source_t(), m_str(source) + : netlist_setup_t::source_t(), m_str(source) { } @@ -276,11 +253,11 @@ private: }; -class netlist_source_mem_t : public netlist_source_t +class netlist_source_mem_t : public netlist_setup_t::source_t { public: netlist_source_mem_t(const char *mem) - : netlist_source_t(), m_str(mem) + : netlist_setup_t::source_t(), m_str(mem) { } @@ -289,11 +266,12 @@ private: pstring m_str; }; -class netlist_source_proc_t : public netlist_source_t +class netlist_source_proc_t : public netlist_setup_t::source_t { public: netlist_source_proc_t(pstring name, void (*setup_func)(netlist_setup_t &)) - : m_setup_func(setup_func), + : netlist_setup_t::source_t(), + m_setup_func(setup_func), m_setup_func_name(name) { } diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c index b2970bdc2b0..8347e263b20 100644 --- a/src/emu/netlist/tools/nl_convert.c +++ b/src/emu/netlist/tools/nl_convert.c @@ -7,14 +7,6 @@ #include "nl_convert.h" -#if 0 -#include -#include - -#include "plib/pstring.h" -#include "plib/plists.h" -#endif - /*------------------------------------------------- convert - convert a spice netlist -------------------------------------------------*/ @@ -30,7 +22,7 @@ void nl_convert_base_t::out(const char *format, ...) void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias) { - m_pins.add(palloc(sp_pin_alias_t, devname + "." + name, devname + "." + alias), false); + m_pins.add(palloc(pin_alias_t, devname + "." + name, devname + "." + alias), false); } void nl_convert_base_t::add_ext_alias(const pstring &alias) @@ -40,28 +32,28 @@ void nl_convert_base_t::add_ext_alias(const pstring &alias) void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, const pstring &amodel) { - devs.add(palloc(sp_dev_t, atype, aname, amodel), false); + m_devs.add(palloc(dev_t, atype, aname, amodel), false); } void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, double aval) { - devs.add(palloc(sp_dev_t, atype, aname, aval), false); + m_devs.add(palloc(dev_t, atype, aname, aval), false); } void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname) { - devs.add(palloc(sp_dev_t, atype, aname), false); + m_devs.add(palloc(dev_t, atype, aname), false); } void nl_convert_base_t::add_term(pstring netname, pstring termname) { - sp_net_t * net = m_nets.find_by_name(netname); + net_t * net = m_nets.find_by_name(netname); if (net == NULL) { - net = palloc(sp_net_t, netname); + net = palloc(net_t, netname); m_nets.add(net, false); } /* if there is a pin alias, translate ... */ - sp_pin_alias_t *alias = m_pins.find_by_name(termname); + pin_alias_t *alias = m_pins.find_by_name(termname); if (alias != NULL) net->terminals().add(alias->alias()); @@ -71,43 +63,43 @@ void nl_convert_base_t::add_term(pstring netname, pstring termname) void nl_convert_base_t::dump_nl() { - for (int i=0; iterminals()[0].cstr()); // if the aliased net only has this one terminal connected ==> don't dump if (net->terminals().size() == 1) net->set_no_export(); } - for (int i=0; ihas_value()) - out("%s(%s, %s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr()); - else if (devs[i]->has_model()) - out("%s(%s, \"%s\")\n", devs[i]->type().cstr(), - devs[i]->name().cstr(), devs[i]->model().cstr()); + if (m_devs[i]->has_value()) + out("%s(%s, %s)\n", m_devs[i]->type().cstr(), + m_devs[i]->name().cstr(), get_nl_val(m_devs[i]->value()).cstr()); + else if (m_devs[i]->has_model()) + out("%s(%s, \"%s\")\n", m_devs[i]->type().cstr(), + m_devs[i]->name().cstr(), m_devs[i]->model().cstr()); else - out("%s(%s)\n", devs[i]->type().cstr(), - devs[i]->name().cstr()); + out("%s(%s)\n", m_devs[i]->type().cstr(), + m_devs[i]->name().cstr()); } // print nets - for (int i=0; iis_no_export()) { //printf("Net %s\n", net->name().cstr()); out("NET_C(%s", net->terminals()[0].cstr() ); - for (int j=1; jterminals().size(); j++) + for (std::size_t j=1; jterminals().size(); j++) { out(", %s", net->terminals()[j].cstr() ); } out(")\n"); } } - devs.clear_and_free(); + m_devs.clear_and_free(); m_nets.clear_and_free(); m_pins.clear_and_free(); m_ext_alias.clear(); @@ -117,22 +109,22 @@ const pstring nl_convert_base_t::get_nl_val(const double val) { { int i = 0; - while (m_sp_units[i].sp_unit != "-" ) + while (m_units[i].m_unit != "-" ) { - if (m_sp_units[i].mult <= nl_math::abs(val)) + if (m_units[i].m_mult <= nl_math::abs(val)) break; i++; } - return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult); + return pstring::sprintf(m_units[i].m_func.cstr(), val / m_units[i].m_mult); } } double nl_convert_base_t::get_sp_unit(const pstring &unit) { int i = 0; - while (m_sp_units[i].sp_unit != "-") + while (m_units[i].m_unit != "-") { - if (m_sp_units[i].sp_unit == unit) - return m_sp_units[i].mult; + if (m_units[i].m_unit == unit) + return m_units[i].m_mult; i++; } fprintf(stderr, "Unit %s unknown\n", unit.cstr()); @@ -152,7 +144,7 @@ double nl_convert_base_t::get_sp_val(const pstring &sin) return ret; } -nl_convert_base_t::_sp_unit nl_convert_base_t::m_sp_units[] = { +nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = { {"T", "", 1.0e12 }, {"G", "", 1.0e9 }, {"MEG", "RES_M(%g)", 1.0e6 }, @@ -221,7 +213,7 @@ void nl_convert_spice_t::process_line(const pstring &line) if (tt[0].equals(".SUBCKT")) { out("NETLIST_START(%s)\n", tt[1].cstr()); - for (int i=2; i -#include +//#include +//#include #include "plib/pstring.h" #include "plib/plists.h" @@ -29,7 +29,7 @@ public: virtual ~nl_convert_base_t() { m_nets.clear_and_free(); - devs.clear_and_free(); + m_devs.clear_and_free(); m_pins.clear_and_free(); } @@ -57,10 +57,10 @@ protected: double get_sp_val(const pstring &sin); private: - struct sp_net_t + struct net_t { public: - sp_net_t(const pstring &aname) + net_t(const pstring &aname) : m_name(aname), m_no_export(false) {} const pstring &name() { return m_name;} @@ -74,18 +74,18 @@ private: pstring_list_t m_terminals; }; - struct sp_dev_t + struct dev_t { public: - sp_dev_t(const pstring &atype, const pstring &aname, const pstring &amodel) + dev_t(const pstring &atype, const pstring &aname, const pstring &amodel) : m_type(atype), m_name(aname), m_model(amodel), m_val(0), m_has_val(false) {} - sp_dev_t(const pstring &atype, const pstring &aname, double aval) + dev_t(const pstring &atype, const pstring &aname, double aval) : m_type(atype), m_name(aname), m_model(""), m_val(aval), m_has_val(true) {} - sp_dev_t(const pstring &atype, const pstring &aname) + dev_t(const pstring &atype, const pstring &aname) : m_type(atype), m_name(aname), m_model(""), m_val(0.0), m_has_val(false) {} @@ -105,16 +105,16 @@ private: bool m_has_val; }; - struct _sp_unit { - pstring sp_unit; - pstring nl_func; - double mult; + struct unit_t { + pstring m_unit; + pstring m_func; + double m_mult; }; - struct sp_pin_alias_t + struct pin_alias_t { public: - sp_pin_alias_t(const pstring &name, const pstring &alias) + pin_alias_t(const pstring &name, const pstring &alias) : m_name(name), m_alias(alias) {} const pstring &name() { return m_name; } @@ -124,19 +124,16 @@ private: pstring m_alias; }; - - - private: pstringbuffer m_buf; - pnamedlist_t devs; - pnamedlist_t m_nets; + pnamedlist_t m_devs; + pnamedlist_t m_nets; plist_t m_ext_alias; - pnamedlist_t m_pins; + pnamedlist_t m_pins; - static _sp_unit m_sp_units[]; + static unit_t m_units[]; }; diff --git a/src/mame/drivers/nl_pong.c b/src/mame/drivers/nl_pong.c index 5e2652b53ad..99fb0ad9330 100644 --- a/src/mame/drivers/nl_pong.c +++ b/src/mame/drivers/nl_pong.c @@ -12,11 +12,15 @@ #define FAST_CLOCK (1) #ifndef __PLIB_PREPROCESSOR__ +#if 0 +#define TTL_7400A_NAND(_name, _A, _B) TTL_7400_NAND(_name, _A, _B) +#else #define TTL_7400A_NAND(_name, _A, _B) \ NET_REGISTER_DEV_X(TTL_7400A_NAND, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) #endif +#endif NETLIST_START(lib) TRUTHTABLE_START(TTL_7400A_NAND, 2, 1, 0, "A,B") From a95d0e02c93f57925783c7e5d644f9bd0cf34624 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Fri, 5 Jun 2015 21:55:08 +0200 Subject: [PATCH 173/284] floppy: Ensure that get_next_transition always provide the next transition [O. Galibert] --- src/emu/imagedev/floppy.c | 29 ++++++++++++++++++++--------- src/emu/imagedev/floppy.h | 1 + 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c index 3f704959d9f..b79cc0c71bd 100644 --- a/src/emu/imagedev/floppy.c +++ b/src/emu/imagedev/floppy.c @@ -661,6 +661,22 @@ UINT32 floppy_image_device::find_position(attotime &base, const attotime &when) return (delta*floppy_ratio_1).as_ticks(1000000000/1000); } +attotime floppy_image_device::get_next_index_time(std::vector &buf, int index, int delta, attotime base) +{ + UINT32 next_position; + int cells = buf.size(); + if(index+delta < cells) + next_position = buf[index+delta] & floppy_image::TIME_MASK; + else { + if((buf[cells-1]^buf[0]) & floppy_image::MG_MASK) + delta--; + index = index + delta - cells + 1; + next_position = 200000000 + (buf[index] & floppy_image::TIME_MASK); + } + + return base + attotime::from_nsec((UINT64(next_position)*2000/floppy_ratio_1+1)/2); +} + attotime floppy_image_device::get_next_transition(const attotime &from_when) { if(!image || mon) @@ -679,15 +695,10 @@ attotime floppy_image_device::get_next_transition(const attotime &from_when) if(index == -1) return attotime::never; - UINT32 next_position; - if(index < cells-1) - next_position = buf[index+1] & floppy_image::TIME_MASK; - else if((buf[index]^buf[0]) & floppy_image::MG_MASK) - next_position = 200000000; - else - next_position = 200000000 + (buf[1] & floppy_image::TIME_MASK); - - return base + attotime::from_nsec((UINT64(next_position)*2000/floppy_ratio_1+1)/2); + attotime result = get_next_index_time(buf, index, 1, base); + if(result > from_when) + return result; + return get_next_index_time(buf, index, 2, base); } void floppy_image_device::write_flux(const attotime &start, const attotime &end, int transition_count, const attotime *transitions) diff --git a/src/emu/imagedev/floppy.h b/src/emu/imagedev/floppy.h index 98834facc65..1130260cb81 100644 --- a/src/emu/imagedev/floppy.h +++ b/src/emu/imagedev/floppy.h @@ -186,6 +186,7 @@ protected: int find_index(UINT32 position, const std::vector &buf); void write_zone(UINT32 *buf, int &cells, int &index, UINT32 spos, UINT32 epos, UINT32 mg); void commit_image(); + attotime get_next_index_time(std::vector &buf, int index, int delta, attotime base); }; class ui_menu_control_floppy_image : public ui_menu_control_device_image { From a1e92d76f6d8185f8192ac5c51d158ca1568aa80 Mon Sep 17 00:00:00 2001 From: Wilbert Pol Date: Fri, 5 Jun 2015 22:20:59 +0200 Subject: [PATCH 174/284] clifront.c: Parse ini files before looking for software. (nw) This way the hashpath setting will actually be used to search for software in software lists. This only occured when starting the emulator with the auto-search/mounting-software-feature: mame nes sonic this format worked ok: mame nes -floppy sonic --- src/emu/clifront.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emu/clifront.c b/src/emu/clifront.c index 094353041cc..f031a84ec0f 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -110,6 +110,8 @@ int cli_frontend::execute(int argc, char **argv) std::string option_errors; m_options.parse_command_line(argc, argv, option_errors); + m_options.parse_standard_inis(option_errors); + if (*(m_options.software_name()) != 0) { const game_driver *system = m_options.system(); @@ -175,7 +177,6 @@ int cli_frontend::execute(int argc, char **argv) } } - m_options.parse_standard_inis(option_errors); // parse the command line, adding any system-specific options if (!m_options.parse_command_line(argc, argv, option_errors)) { From 49cfff0a551fa5cd69143300e8ea7590a2d2ed8d Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Fri, 5 Jun 2015 21:53:08 -0400 Subject: [PATCH 175/284] Corrected labels for set "darkseal1" with a detailed pcb picture/dump which matched 100% - provided by system11. Also, changed integer values for xtals to presets. (nw) --- src/mame/drivers/darkseal.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c index cd382f78d32..17379f137f3 100644 --- a/src/mame/drivers/darkseal.c +++ b/src/mame/drivers/darkseal.c @@ -7,6 +7,8 @@ Dark Seal (Rev 4) (c) 1990 Data East Corporation (Japanese version) Gate Of Doom (Rev 4) (c) 1990 Data East Corporation (USA version) Gate of Doom (Rev 1) (c) 1990 Data East Corporation (USA version) + + Board: DE-0332-2 Emulation by Bryan McPhail, mish@tendril.co.uk @@ -225,11 +227,11 @@ GFXDECODE_END static MACHINE_CONFIG_START( darkseal, darkseal_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000,12000000) /* Custom chip 59 */ + MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* Custom chip 59 */ MCFG_CPU_PROGRAM_MAP(darkseal_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", darkseal_state, irq6_line_hold)/* VBL */ - MCFG_CPU_ADD("audiocpu", H6280, 32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ + MCFG_CPU_ADD("audiocpu", H6280, XTAL_32_22MHz/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */ MCFG_CPU_PROGRAM_MAP(sound_map) /* video hardware */ @@ -283,18 +285,18 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("ym1", YM2203, 32220000/8) + MCFG_SOUND_ADD("ym1", YM2203, XTAL_32_22MHz/8) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) - MCFG_YM2151_ADD("ym2", 32220000/9) + MCFG_YM2151_ADD("ym2", XTAL_32_22MHz/9) MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2 MCFG_SOUND_ROUTE(0, "mono", 0.55) MCFG_SOUND_ROUTE(1, "mono", 0.55) - MCFG_OKIM6295_ADD("oki1", 32220000/32, OKIM6295_PIN7_HIGH) + MCFG_OKIM6295_ADD("oki1", XTAL_32_22MHz/32, OKIM6295_PIN7_HIGH) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - MCFG_OKIM6295_ADD("oki2", 32220000/16, OKIM6295_PIN7_HIGH) + MCFG_OKIM6295_ADD("oki2", XTAL_32_22MHz/16, OKIM6295_PIN7_HIGH) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) MACHINE_CONFIG_END @@ -333,17 +335,17 @@ ROM_END ROM_START( darkseal1 ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ - ROM_LOAD16_BYTE( "ga_04.j12", 0x00000, 0x20000, CRC(a1a985a9) SHA1(eac3f43ff4016dcc21fe34b6bfed36e0d4b86959) ) - ROM_LOAD16_BYTE( "ga_01.h14", 0x00001, 0x20000, CRC(98bd2940) SHA1(88ac727c3797e646834266320a71aa159e2b2541) ) - ROM_LOAD16_BYTE( "ga_00.h12", 0x40000, 0x20000, CRC(fbf3ac63) SHA1(51af581ee951eedeb4aa413ecbebe8bf4d30613b) ) - ROM_LOAD16_BYTE( "ga_05.j14", 0x40001, 0x20000, CRC(d5e3ae3f) SHA1(12f6e92af115422c6ab6ef1d33675d1e1cd58e10) ) + ROM_LOAD16_BYTE( "FZ_04-4.J12", 0x00000, 0x20000, CRC(a1a985a9) SHA1(eac3f43ff4016dcc21fe34b6bfed36e0d4b86959) ) + ROM_LOAD16_BYTE( "FZ_01-1.H14", 0x00001, 0x20000, CRC(98bd2940) SHA1(88ac727c3797e646834266320a71aa159e2b2541) ) + ROM_LOAD16_BYTE( "FZ_00-2.H12", 0x40000, 0x20000, CRC(fbf3ac63) SHA1(51af581ee951eedeb4aa413ecbebe8bf4d30613b) ) + ROM_LOAD16_BYTE( "FZ_05-2.J14", 0x40001, 0x20000, CRC(d5e3ae3f) SHA1(12f6e92af115422c6ab6ef1d33675d1e1cd58e10) ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */ - ROM_LOAD( "fz_06-1.j15", 0x00000, 0x10000, CRC(c4828a6d) SHA1(fbfd0c85730bbe18401879cd68c19aaec9d482d8) ) + ROM_LOAD( "FZ_06-1.J15", 0x00000, 0x10000, CRC(c4828a6d) SHA1(fbfd0c85730bbe18401879cd68c19aaec9d482d8) ) ROM_REGION( 0x020000, "gfx1", 0 ) - ROM_LOAD( "fz_02.j1", 0x000000, 0x10000, CRC(3c9c3012) SHA1(086c2123725d4aa32838c0b6c82317d9c789c465) ) /* chars */ - ROM_LOAD( "fz_03.j2", 0x010000, 0x10000, CRC(264b90ed) SHA1(0bb1557673107c2d732a9374d5601a6eaf229473) ) + ROM_LOAD( "FZ_02-1.J1", 0x000000, 0x10000, CRC(3c9c3012) SHA1(086c2123725d4aa32838c0b6c82317d9c789c465) ) /* chars */ + ROM_LOAD( "FZ_03-1.J2", 0x010000, 0x10000, CRC(264b90ed) SHA1(0bb1557673107c2d732a9374d5601a6eaf229473) ) ROM_REGION( 0x080000, "gfx2", 0 ) ROM_LOAD( "mac-03.h3", 0x000000, 0x80000, CRC(9996f3dc) SHA1(fffd9ecfe142a0c7c3c9c521778ff9c55ea8b225) ) /* tiles 1 */ @@ -356,10 +358,10 @@ ROM_START( darkseal1 ) ROM_LOAD( "mac-01.b3", 0x080000, 0x80000, CRC(b28f7584) SHA1(e02ddd45130a7b50f80b6dd049059dba8071d768) ) ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */ - ROM_LOAD( "fz_08.l17", 0x00000, 0x20000, CRC(c9bf68e1) SHA1(c81e2534a814fe44c8787946a9fbe18f1743c3b4) ) + ROM_LOAD( "FZ_08-1.K17", 0x00000, 0x20000, CRC(c9bf68e1) SHA1(c81e2534a814fe44c8787946a9fbe18f1743c3b4) ) ROM_REGION( 0x40000, "oki2", 0 ) /* ADPCM samples */ - ROM_LOAD( "fz_07.k14", 0x00000, 0x20000, CRC(588dd3cb) SHA1(16c4e7670a4967768ddbfd52939d4e6e42268441) ) + ROM_LOAD( "FZ_07-.K14", 0x00000, 0x20000, CRC(588dd3cb) SHA1(16c4e7670a4967768ddbfd52939d4e6e42268441) ) ROM_END ROM_START( darksealj ) From 81040e483654de4d2cee1bc53cc55628573fab86 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Fri, 5 Jun 2015 23:17:13 -0400 Subject: [PATCH 176/284] Added missing video board PAL for xevious and clones. [caius] --- src/mame/drivers/galaga.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c index e30cdbca67b..59e998d6e29 100644 --- a/src/mame/drivers/galaga.c +++ b/src/mame/drivers/galaga.c @@ -2601,6 +2601,9 @@ ROM_START( xevious ) ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */ ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */ + ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */ + ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N */ + ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */ ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) ) ROM_LOAD( "xvi-1.5n", 0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) ) /* timing - not used */ @@ -2653,8 +2656,8 @@ ROM_START( xeviousa ) ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */ ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */ - ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */ - ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */ + ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */ + ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N - 137294-001*/ ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */ ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) ) @@ -2701,8 +2704,8 @@ ROM_START( xeviousb ) ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */ ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */ - ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */ - ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */ + ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */ + ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N - 137294-001*/ ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */ ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) ) @@ -2752,8 +2755,8 @@ ROM_START( xeviousc ) ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */ ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */ - ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */ - ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */ + ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */ + ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N - 137294-001*/ ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */ ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) ) From 4366f6cccb91df440f8c604a972a618dcf63bdd8 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Fri, 5 Jun 2015 23:19:59 -0400 Subject: [PATCH 177/284] New Clones Added ---------------- Space Attack (2k roms)(bootleg of Space Invaders) [MikeMcBike] --- src/mame/arcade.lst | 1 + src/mame/drivers/8080bw.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index c500948db04..2fd242d611b 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -1466,6 +1466,7 @@ claybust // (c) 1978 Model Racing gunchamp // (c) 1980 Model Racing gunchamps // (c) 1980 Model Racing (sshot.c) spaceatt // (c) 1978 Video Games GMBH +spaceattl // (c) 1978 Video Games GMBH/LICH galmonst // (c) Laguna S.A. spaceat2 // (c) 1980 Zenitone-Microsec Ltd spacecom // bootleg diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c index 5505f551a2e..b8f7d40fa47 100644 --- a/src/mame/drivers/8080bw.c +++ b/src/mame/drivers/8080bw.c @@ -3353,6 +3353,17 @@ ROM_START( spaceatt ) ROM_LOAD( "a", 0x1c00, 0x0400, CRC(211ac4a3) SHA1(e08e90a4e77cfa30400626a484c9f37c87ea13f9) ) ROM_END + +/* SPACE ATTACK set is from Video Games GmbH - Board Typ 1010 C / Top board shows Video-Games - 6302 LICH - 1034B + Contains same data as spaceatt but with added 00 fill to make larger roms (b+a=E1, 00fill+c=F1, f+00fill=G1, h+sv02=H1) */ +ROM_START( spaceattl ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "H1.bin", 0x0000, 0x0800, CRC(734f5ad8) SHA1(ff6200af4c9110d8181249cbcef1a8a40fa40b7f) ) + ROM_LOAD( "G1.bin", 0x0800, 0x0800, CRC(6bfaca4a) SHA1(16f48649b531bdef8c2d1446c429b5f414524350) ) + ROM_LOAD( "F1.bin", 0x1000, 0x0800, CRC(0ccead96) SHA1(537aef03468f63c5b9e11dd61e253f7ae17d9743) ) + ROM_LOAD( "E1.bin", 0x1800, 0x0800, CRC(19971ca7) SHA1(373900e6796aa681f35158e2c4c7665574990906) ) +ROM_END + ROM_START( spaceat2 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "spaceatt.h", 0x0000, 0x0800, CRC(a31d0756) SHA1(2b76929654ed0b180091348546dac29fc6e5438e) ) @@ -4696,6 +4707,7 @@ GAMEL(1979, cosmicm2, invaders, cosmicmo, cosmicmo, driver_device, 0, ROT270 GAMEL(1980?,sinvzen, invaders, invaders, sinvzen, driver_device, 0, ROT270, "Taito / Zenitone-Microsec Ltd.", "Super Invaders (Zenitone-Microsec)", GAME_SUPPORTS_SAVE, layout_invaders ) // unclassified, licensed or bootleg? GAMEL(1980, ultrainv, invaders, invaders, sicv, driver_device, 0, ROT270, "Taito / Konami", "Ultra Invaders", GAME_SUPPORTS_SAVE, layout_invaders ) // unclassified, licensed or bootleg? GAMEL(1978, spaceatt, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1978, spaceattl, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH/Lich)", "Space Attack (2k roms)(bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) GAMEL(1978, galmonst, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Laguna S.A.)", "Galaxy Monsters (Laguna S.A. Spanish bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) GAMEL(1980, spaceat2, invaders, invaders, spaceat2, driver_device, 0, ROT270, "bootleg (Video Games UK)", "Space Attack II (bootleg of Super Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) // bootleg of Zenitone-Microsec Super Invaders GAMEL(1979, spacecom, invaders, spacecom, spacecom, _8080bw_state, spacecom, ROT270, "bootleg", "Space Combat (bootleg of Space Invaders)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_spacecom ) From 6684d8af8efc0d2e46a4e7fc1da0fb9953fad11d Mon Sep 17 00:00:00 2001 From: Wilbert Pol Date: Sat, 6 Jun 2015 09:24:02 +0200 Subject: [PATCH 178/284] rspcp2: Moved m_op member into a struct so it can be allocated in the drc cache. Fixes MT5953. --- src/emu/cpu/rsp/rspcp2.c | 9 +- src/emu/cpu/rsp/rspcp2.h | 7 +- src/emu/cpu/rsp/rspcp2d.c | 208 +++++++++++++++++++------------------- 3 files changed, 115 insertions(+), 109 deletions(-) diff --git a/src/emu/cpu/rsp/rspcp2.c b/src/emu/cpu/rsp/rspcp2.c index 8371583c948..c7d15bec393 100644 --- a/src/emu/cpu/rsp/rspcp2.c +++ b/src/emu/cpu/rsp/rspcp2.c @@ -131,6 +131,7 @@ rsp_cop2::rsp_cop2(rsp_device &rsp, running_machine &machine) memset(m_v, 0, sizeof(m_v)); memset(m_vflag, 0, sizeof(m_vflag)); memset(m_accum, 0, sizeof(m_accum)); + m_rspcop2_state = (internal_rspcop2_state *)rsp.m_cache.alloc_near(sizeof(internal_rspcop2_state)); } rsp_cop2::~rsp_cop2() @@ -2567,7 +2568,7 @@ void rsp_cop2::handle_cop2(UINT32 op) inline void rsp_cop2::mfc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; UINT16 b1 = VREG_B(VS1REG, (el+0) & 0xf); @@ -2577,7 +2578,7 @@ inline void rsp_cop2::mfc2() inline void rsp_cop2::cfc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; if (RTREG) { switch(RDREG) @@ -2636,7 +2637,7 @@ inline void rsp_cop2::cfc2() inline void rsp_cop2::mtc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff; VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff; @@ -2644,7 +2645,7 @@ inline void rsp_cop2::mtc2() inline void rsp_cop2::ctc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; switch(RDREG) { case 0: diff --git a/src/emu/cpu/rsp/rspcp2.h b/src/emu/cpu/rsp/rspcp2.h index 15857bd687c..18e9d59fbff 100644 --- a/src/emu/cpu/rsp/rspcp2.h +++ b/src/emu/cpu/rsp/rspcp2.h @@ -135,8 +135,13 @@ protected: UINT16 SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive); UINT16 SATURATE_ACCUM1(int accum, UINT16 negative, UINT16 positive); - UINT32 m_op; + // Data that needs to be stored close to the generated DRC code + struct internal_rspcop2_state + { + UINT32 op; + }; + internal_rspcop2_state *m_rspcop2_state; rsp_device& m_rsp; running_machine& m_machine; UINT32 m_vres[8]; /* used for temporary vector results */ diff --git a/src/emu/cpu/rsp/rspcp2d.c b/src/emu/cpu/rsp/rspcp2d.c index 3a5ca09b9ee..779fea5819c 100644 --- a/src/emu/cpu/rsp/rspcp2d.c +++ b/src/emu/cpu/rsp/rspcp2d.c @@ -94,7 +94,7 @@ static void cfunc_ctc2(void *param); #define CLEAR_CLIP2_FLAG(x) { m_vflag[CLIP2][x & 7] = 0; } #define CACHE_VALUES() \ - const int op = m_op; \ + const int op = m_rspcop2_state->op; \ const int vdreg = VDREG; \ const int vs1reg = VS1REG; \ const int vs2reg = VS2REG; \ @@ -137,10 +137,10 @@ void rsp_cop2_drc::cfunc_unimplemented_opcode() if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0) { char string[200]; - rsp_dasm_one(string, ppc, m_op); + rsp_dasm_one(string, ppc, m_rspcop2_state->op); osd_printf_debug("%08X: %s\n", ppc, string); } - fatalerror("RSP: unknown opcode %02X (%08X) at %08X\n", m_op >> 26, m_op, ppc); + fatalerror("RSP: unknown opcode %02X (%08X) at %08X\n", m_rspcop2_state->op >> 26, m_rspcop2_state->op, ppc); } static void unimplemented_opcode(void *param) @@ -267,7 +267,7 @@ void rsp_cop2_drc::state_string_export(const int index, std::string &str) void rsp_cop2_drc::lbv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; UINT32 ea = 0; int dest = (op >> 16) & 0x1f; @@ -300,7 +300,7 @@ static void cfunc_lbv(void *param) void rsp_cop2_drc::lsv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xe; @@ -336,7 +336,7 @@ static void cfunc_lsv(void *param) void rsp_cop2_drc::llv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; UINT32 ea = 0; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; @@ -375,7 +375,7 @@ static void cfunc_llv(void *param) void rsp_cop2_drc::ldv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; UINT32 ea = 0; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; @@ -414,7 +414,7 @@ static void cfunc_ldv(void *param) void rsp_cop2_drc::lqv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int offset = (op & 0x7f); @@ -452,7 +452,7 @@ static void cfunc_lqv(void *param) void rsp_cop2_drc::lrv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -491,7 +491,7 @@ static void cfunc_lrv(void *param) void rsp_cop2_drc::lpv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -526,7 +526,7 @@ static void cfunc_lpv(void *param) void rsp_cop2_drc::luv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -561,7 +561,7 @@ static void cfunc_luv(void *param) void rsp_cop2_drc::lhv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -595,7 +595,7 @@ static void cfunc_lhv(void *param) void rsp_cop2_drc::lfv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -636,7 +636,7 @@ static void cfunc_lfv(void *param) void rsp_cop2_drc::lwv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -673,7 +673,7 @@ static void cfunc_lwv(void *param) void rsp_cop2_drc::ltv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -720,62 +720,62 @@ int rsp_cop2_drc::generate_lwc2(drcuml_block *block, rsp_device::compiler_state switch ((op >> 11) & 0x1f) { case 0x00: /* LBV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lbv, this); return TRUE; case 0x01: /* LSV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lsv, this); return TRUE; case 0x02: /* LLV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_llv, this); return TRUE; case 0x03: /* LDV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_ldv, this); return TRUE; case 0x04: /* LQV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lqv, this); return TRUE; case 0x05: /* LRV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lrv, this); return TRUE; case 0x06: /* LPV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lpv, this); return TRUE; case 0x07: /* LUV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_luv, this); return TRUE; case 0x08: /* LHV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lhv, this); return TRUE; case 0x09: /* LFV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lfv, this); return TRUE; case 0x0a: /* LWV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_lwv, this); return TRUE; case 0x0b: /* LTV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l UML_CALLC(block, cfunc_ltv, this); return TRUE; @@ -800,7 +800,7 @@ int rsp_cop2_drc::generate_lwc2(drcuml_block *block, rsp_device::compiler_state void rsp_cop2_drc::sbv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -831,7 +831,7 @@ static void cfunc_sbv(void *param) void rsp_cop2_drc::ssv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -868,7 +868,7 @@ static void cfunc_ssv(void *param) void rsp_cop2_drc::slv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -905,7 +905,7 @@ static void cfunc_slv(void *param) void rsp_cop2_drc::sdv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0x8; @@ -941,7 +941,7 @@ static void cfunc_sdv(void *param) void rsp_cop2_drc::sqv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -977,7 +977,7 @@ static void cfunc_sqv(void *param) void rsp_cop2_drc::srv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1017,7 +1017,7 @@ static void cfunc_srv(void *param) void rsp_cop2_drc::spv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1060,7 +1060,7 @@ static void cfunc_spv(void *param) void rsp_cop2_drc::suv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1103,7 +1103,7 @@ static void cfunc_suv(void *param) void rsp_cop2_drc::shv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1141,7 +1141,7 @@ static void cfunc_shv(void *param) void rsp_cop2_drc::sfv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1182,7 +1182,7 @@ static void cfunc_sfv(void *param) void rsp_cop2_drc::swv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1221,7 +1221,7 @@ static void cfunc_swv(void *param) void rsp_cop2_drc::stv() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1270,62 +1270,62 @@ int rsp_cop2_drc::generate_swc2(drcuml_block *block, rsp_device::compiler_state switch ((op >> 11) & 0x1f) { case 0x00: /* SBV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_sbv, this); return TRUE; case 0x01: /* SSV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_ssv, this); return TRUE; case 0x02: /* SLV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_slv, this); return TRUE; case 0x03: /* SDV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_sdv, this); return TRUE; case 0x04: /* SQV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_sqv, this); return TRUE; case 0x05: /* SRV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_srv, this); return TRUE; case 0x06: /* SPV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_spv, this); return TRUE; case 0x07: /* SUV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_suv, this); return TRUE; case 0x08: /* SHV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_shv, this); return TRUE; case 0x09: /* SFV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_sfv, this); return TRUE; case 0x0a: /* SWV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_swv, this); return TRUE; case 0x0b: /* STV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_stv, this); return TRUE; @@ -2079,7 +2079,7 @@ static void cfunc_vaddb(void *param) void rsp_cop2_drc::vsaw() { - const int op = m_op; + const int op = m_rspcop2_state->op; const int vdreg = VDREG; const int el = EL; @@ -3264,217 +3264,217 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil switch (op & 0x3f) { case 0x00: /* VMULF */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmulf, this); return TRUE; case 0x01: /* VMULU */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmulu, this); return TRUE; case 0x04: /* VMUDL */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmudl, this); return TRUE; case 0x05: /* VMUDM */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmudm, this); return TRUE; case 0x06: /* VMUDN */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmudn, this); return TRUE; case 0x07: /* VMUDH */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmudh, this); return TRUE; case 0x08: /* VMACF */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmacf, this); return TRUE; case 0x09: /* VMACU */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmacu, this); return TRUE; case 0x0c: /* VMADL */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmadl, this); return TRUE; case 0x0d: /* VMADM */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmadm, this); return TRUE; case 0x0e: /* VMADN */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmadn, this); return TRUE; case 0x0f: /* VMADH */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmadh, this); return TRUE; case 0x10: /* VADD */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vadd, this); return TRUE; case 0x11: /* VSUB */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vsub, this); return TRUE; case 0x13: /* VABS */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vabs, this); return TRUE; case 0x14: /* VADDC */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vaddc, this); return TRUE; case 0x15: /* VSUBC */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vsubc, this); return TRUE; case 0x16: /* VADDB */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vaddb, this); return TRUE; case 0x17: /* VSUBB (reserved, functionally identical to VADDB) */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vaddb, this); return TRUE; case 0x18: /* VACCB (reserved, functionally identical to VADDB) */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vaddb, this); return TRUE; case 0x19: /* VSUCB (reserved, functionally identical to VADDB) */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vaddb, this); return TRUE; case 0x1d: /* VSAW */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vsaw, this); return TRUE; case 0x20: /* VLT */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vlt, this); return TRUE; case 0x21: /* VEQ */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_veq, this); return TRUE; case 0x22: /* VNE */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vne, this); return TRUE; case 0x23: /* VGE */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vge, this); return TRUE; case 0x24: /* VCL */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vcl, this); return TRUE; case 0x25: /* VCH */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vch, this); return TRUE; case 0x26: /* VCR */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vcr, this); return TRUE; case 0x27: /* VMRG */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmrg, this); return TRUE; case 0x28: /* VAND */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vand, this); return TRUE; case 0x29: /* VNAND */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vnand, this); return TRUE; case 0x2a: /* VOR */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vor, this); return TRUE; case 0x2b: /* VNOR */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vnor, this); return TRUE; case 0x2c: /* VXOR */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vxor, this); return TRUE; case 0x2d: /* VNXOR */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vnxor, this); return TRUE; case 0x30: /* VRCP */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vrcp, this); return TRUE; case 0x31: /* VRCPL */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vrcpl, this); return TRUE; case 0x32: /* VRCPH */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vrcph, this); return TRUE; case 0x33: /* VMOV */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vmov, this); return TRUE; case 0x34: /* VRSQ */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vrsq, this); return TRUE; case 0x35: /* VRSQL */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vrsql, this); return TRUE; case 0x36: /* VRSQH */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_vrsqh, this); return TRUE; @@ -3483,7 +3483,7 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil return TRUE; default: - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, unimplemented_opcode, &m_rsp); return FALSE; } @@ -3496,7 +3496,7 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil void rsp_cop2_drc::mfc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; UINT16 b1 = VREG_B(VS1REG, (el+0) & 0xf); @@ -3511,7 +3511,7 @@ static void cfunc_mfc2(void *param) void rsp_cop2_drc::cfc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; if (RTREG) { switch(RDREG) @@ -3576,7 +3576,7 @@ static void cfunc_cfc2(void *param) void rsp_cop2_drc::mtc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff; VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff; @@ -3590,7 +3590,7 @@ static void cfunc_mtc2(void *param) void rsp_cop2_drc::ctc2() { - UINT32 op = m_op; + UINT32 op = m_rspcop2_state->op; switch(RDREG) { case 0: @@ -3706,7 +3706,7 @@ int rsp_cop2_drc::generate_cop2(drcuml_block *block, rsp_device::compiler_state case 0x00: /* MFCz */ if (RTREG != 0) { - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_mfc2, this); // callc mfc2 } return TRUE; @@ -3714,18 +3714,18 @@ int rsp_cop2_drc::generate_cop2(drcuml_block *block, rsp_device::compiler_state case 0x02: /* CFCz */ if (RTREG != 0) { - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_cfc2, this); // callc cfc2 } return TRUE; case 0x04: /* MTCz */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_mtc2, this); // callc mtc2 return TRUE; case 0x06: /* CTCz */ - UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l + UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l UML_CALLC(block, cfunc_ctc2, this); // callc ctc2 return TRUE; From ccd68e80db02cfbeb993e42800ada92c3e6e95f8 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Sat, 6 Jun 2015 07:19:52 -0400 Subject: [PATCH 179/284] Fix wording/setname for recently added set (spaceattl -> spaceatt2k). "Lich" is apparently a geographical location and not part of the company name. (nw) --- src/mame/arcade.lst | 2 +- src/mame/drivers/8080bw.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 2fd242d611b..37706f94f41 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -1466,7 +1466,7 @@ claybust // (c) 1978 Model Racing gunchamp // (c) 1980 Model Racing gunchamps // (c) 1980 Model Racing (sshot.c) spaceatt // (c) 1978 Video Games GMBH -spaceattl // (c) 1978 Video Games GMBH/LICH +spaceatt2k // (c) 1978 Video Games GMBH galmonst // (c) Laguna S.A. spaceat2 // (c) 1980 Zenitone-Microsec Ltd spacecom // bootleg diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c index b8f7d40fa47..cbfca8caeff 100644 --- a/src/mame/drivers/8080bw.c +++ b/src/mame/drivers/8080bw.c @@ -3356,7 +3356,7 @@ ROM_END /* SPACE ATTACK set is from Video Games GmbH - Board Typ 1010 C / Top board shows Video-Games - 6302 LICH - 1034B Contains same data as spaceatt but with added 00 fill to make larger roms (b+a=E1, 00fill+c=F1, f+00fill=G1, h+sv02=H1) */ -ROM_START( spaceattl ) +ROM_START( spaceatt2k ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "H1.bin", 0x0000, 0x0800, CRC(734f5ad8) SHA1(ff6200af4c9110d8181249cbcef1a8a40fa40b7f) ) ROM_LOAD( "G1.bin", 0x0800, 0x0800, CRC(6bfaca4a) SHA1(16f48649b531bdef8c2d1446c429b5f414524350) ) @@ -4707,7 +4707,7 @@ GAMEL(1979, cosmicm2, invaders, cosmicmo, cosmicmo, driver_device, 0, ROT270 GAMEL(1980?,sinvzen, invaders, invaders, sinvzen, driver_device, 0, ROT270, "Taito / Zenitone-Microsec Ltd.", "Super Invaders (Zenitone-Microsec)", GAME_SUPPORTS_SAVE, layout_invaders ) // unclassified, licensed or bootleg? GAMEL(1980, ultrainv, invaders, invaders, sicv, driver_device, 0, ROT270, "Taito / Konami", "Ultra Invaders", GAME_SUPPORTS_SAVE, layout_invaders ) // unclassified, licensed or bootleg? GAMEL(1978, spaceatt, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1978, spaceattl, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH/Lich)", "Space Attack (2k roms)(bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1978, spaceatt2k, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH)", "Space Attack (2k roms)(bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) GAMEL(1978, galmonst, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Laguna S.A.)", "Galaxy Monsters (Laguna S.A. Spanish bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) GAMEL(1980, spaceat2, invaders, invaders, spaceat2, driver_device, 0, ROT270, "bootleg (Video Games UK)", "Space Attack II (bootleg of Super Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) // bootleg of Zenitone-Microsec Super Invaders GAMEL(1979, spacecom, invaders, spacecom, spacecom, _8080bw_state, spacecom, ROT270, "bootleg", "Space Combat (bootleg of Space Invaders)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_spacecom ) From 13506b6b54360591f7182aed12be0d63618e2c84 Mon Sep 17 00:00:00 2001 From: Julian Sikorski Date: Sat, 6 Jun 2015 13:38:19 +0200 Subject: [PATCH 180/284] Added OPT_FLAGS back --- makefile | 5 +++++ scripts/genie.lua | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/makefile b/makefile index e9b302c711a..e96640a0d05 100644 --- a/makefile +++ b/makefile @@ -49,6 +49,7 @@ # MAP = 1 # PROFILE = 1 # ARCHOPTS = +# OPT_FLAGS = # LDOPTS = # USE_SYSTEM_LIB_EXPAT = 1 @@ -401,6 +402,10 @@ ifdef ARCHOPTS PARAMS += --ARCHOPTS='$(ARCHOPTS)' endif +ifdef OPT_FLAGS +PARAMS += --OPT_FLAGS='$(OPT_FLAGS)' +endif + ifdef MAP PARAMS += --MAP='$(MAP)' endif diff --git a/scripts/genie.lua b/scripts/genie.lua index ba639398c64..702ae917064 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -168,6 +168,11 @@ newoption { description = "ARCHOPTS.", } +newoption { + trigger = "OPT_FLAGS", + description = "OPT_FLAGS.", +} + newoption { trigger = "LDOPTS", description = "Additional linker options", @@ -739,6 +744,11 @@ if _OPTIONS["OPTIMIZE"] then _OPTIONS["ARCHOPTS"] } end + if _OPTIONS["OPT_FLAGS"] then + buildoptions { + _OPTIONS["OPT_FLAGS"] + } + end if _OPTIONS["LTO"]=="1" then -- -flto=4 -> 4 threads buildoptions { From e644a84b01ae6fd59dcee3197da6267336de2c80 Mon Sep 17 00:00:00 2001 From: arbee Date: Sat, 6 Jun 2015 07:44:33 -0400 Subject: [PATCH 181/284] Fix compile on Linux GCC 5.1.1 / Fedora 22 (nw) --- src/mess/drivers/apple2e.c | 24 ------------------------ src/mess/drivers/z80ne.c | 3 ++- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/mess/drivers/apple2e.c b/src/mess/drivers/apple2e.c index e270fa4d6fa..62b97a5b930 100644 --- a/src/mess/drivers/apple2e.c +++ b/src/mess/drivers/apple2e.c @@ -2973,30 +2973,6 @@ INPUT_PORTS_START( apple2ep ) PORT_INCLUDE(apple2_sysconfig) INPUT_PORTS_END -/* according to Steve Nickolas (author of Dapple), our original palette would - * have been more appropriate for an Apple IIgs. So we've substituted in the - * Robert Munafo palette instead, which is more accurate on 8-bit Apples - */ -static const rgb_t apple2_palette[] = -{ - rgb_t::black, - rgb_t(0xE3, 0x1E, 0x60), /* Dark Red */ - rgb_t(0x60, 0x4E, 0xBD), /* Dark Blue */ - rgb_t(0xFF, 0x44, 0xFD), /* Purple */ - rgb_t(0x00, 0xA3, 0x60), /* Dark Green */ - rgb_t(0x9C, 0x9C, 0x9C), /* Dark Gray */ - rgb_t(0x14, 0xCF, 0xFD), /* Medium Blue */ - rgb_t(0xD0, 0xC3, 0xFF), /* Light Blue */ - rgb_t(0x60, 0x72, 0x03), /* Brown */ - rgb_t(0xFF, 0x6A, 0x3C), /* Orange */ - rgb_t(0x9C, 0x9C, 0x9C), /* Light Grey */ - rgb_t(0xFF, 0xA0, 0xD0), /* Pink */ - rgb_t(0x14, 0xF5, 0x3C), /* Light Green */ - rgb_t(0xD0, 0xDD, 0x8D), /* Yellow */ - rgb_t(0x72, 0xFF, 0xD0), /* Aquamarine */ - rgb_t(0xFF, 0xFF, 0xFF) /* White */ -}; - static SLOT_INTERFACE_START(apple2_cards) SLOT_INTERFACE("diskii", A2BUS_DISKII) /* Disk II Controller Card */ SLOT_INTERFACE("diskiing", A2BUS_DISKIING) /* Disk II Controller Card, cycle-accurate version */ diff --git a/src/mess/drivers/z80ne.c b/src/mess/drivers/z80ne.c index f8e80e537a7..019c9ef4364 100644 --- a/src/mess/drivers/z80ne.c +++ b/src/mess/drivers/z80ne.c @@ -377,7 +377,7 @@ INPUT_PORTS_END /****************************************************************************** Machine Drivers ******************************************************************************/ - +#if 0 static const UINT32 lx388palette[] = { rgb_t(0x00, 0xff, 0x00), /* GREEN */ @@ -399,6 +399,7 @@ static const UINT32 lx388palette[] = rgb_t(0x40, 0x10, 0x00), /* ALPHANUMERIC DARK ORANGE */ rgb_t(0xff, 0xc4, 0x18) /* ALPHANUMERIC BRIGHT ORANGE */ }; +#endif FLOPPY_FORMATS_MEMBER( z80ne_state::floppy_formats ) FLOPPY_DMK_FORMAT From e097a7a7e01f3adcb12bc6f8f87d8752f2d12a57 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Sat, 6 Jun 2015 15:40:28 +0300 Subject: [PATCH 182/284] naomi.c: full dump of "Samba De Amigo" prototype [Arzeno Fabrice, MetalliC, rtw] --- src/mame/drivers/naomi.c | 52 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index 10977bd1859..7ee377c9d67 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -67,11 +67,6 @@ TODO (general): * Shootout Pool Medal * Shootout Pool Prize - - "com error occurred between Naomi BD and I/O BD" - * Samba de Amigo - * Samba de Amigo (prototype) - * Samba de Amigo Ver. 2000 - - other issues: * Death Crimson OX (boots now, but dies in YUV-mode movie; coining up before it appears to freeze the game) * La Keyboard (boots fine & attract mode looks OK, but no keyboard) @@ -275,7 +270,7 @@ Ferrari F355 Challenge (twin, prototype) no cart 22848P* 21 (64Mb) pre Ferrari F355 Challenge 2 (twin) no cart 23399 21 (64Mb) present 315-6206 317-0287-COM content is the same as regular 171-7919A cart House of the Dead 2 (prototype) no cart A1E2 21 (64Mb) present 315-6206 present no label on IC42 Inu No Osanpo / Dog Walking (Rev A) 840-0073C 22294A 16 (64Mb) present 315-6206 317-0316-JPN requires 837-13844 JVS IO with DIPSW 1 ON -Samba de Amigo (prototype) no cart * 21 (64Mb) present 315-6206 317-0270-COM * instead of EPROM have tiny PCB with 2 flashroms on it +Samba de Amigo (prototype) no cart * 21*(64Mb) present 315-6206 317-0270-COM * only first 14 flash roms contain game data, instead of EPROM have tiny PCB with 2 flashroms on it Soul Surfer (Rev A) 840-0095C 23838C 21 (64Mb) present 315-6206 not present Star Horse (server) 840-0055C 23626 17 (64Mb) present 315-6206 not present requires 837-13785 ARCNET&IO BD The King of Route 66 (Rev A) 840-0087C 23819A 20 (64Mb) present 315-6206 not present content is the same as regular 171-8132A cart @@ -323,7 +318,7 @@ Airline Pilots (deluxe) (Rev B) ? 21787B 11 (64Mb) Airline Pilots (Rev A) 840-0005C 21739A 11 (64Mb) present 315-6213 317-0251-COM Cosmic Smash 840-0044C 23428 8 (64Mb) ? 315-6213 317-0289-COM joystick + 2 buttons Cosmic Smash (Rev A) 840-0044C 23428A 8 (64Mb) ? 315-6213 317-0289-COM joystick + 2 buttons -Crazy Taxi 840-0002C 21684 13 (64Mb)* not present 315-6213 317-0248-COM * ic8 and ic9 are not present +Crazy Taxi 840-0002C 21684 13 (64Mb)* present 315-6213 317-0248-COM * ic8 and ic9 are not present Dead Or Alive 2 841-0003C 22121 21 (64Mb) present 315-6213 317-5048-COM joystick + 3 buttons Dead Or Alive 2 Millennium 841-0003C DOA2 M 21 (64Mb) present 315-6213 317-5048-COM joystick + 3 buttons Death Crimson OX 841-0016C 23524 10 (64Mb) present 315-6213 317-5066-COM @@ -5143,6 +5138,7 @@ IC16 64M A10B DDB4 */ +// Ver 3.8 (shown on Japan title only) ROM_START( samba ) NAOMI_BIOS NAOMI_DEFAULT_EEPROM @@ -5170,30 +5166,30 @@ ROM_START( samba ) ROM_PARAMETER( ":rom_board:segam2crypt:key", "280a8b5d" ) ROM_END -// !!! partial dump, only IC22 dumped. without correct flashroms contents game crashes at certain points. -// prototype - only works with US BIOS +// prototype - boots on USA BIOS only, have fewer regular songs, but have several sound tracks from Sega games instead (Afterburner, Outrun, Sonic, etc) ROM_START( sambap ) NAOMI_BIOS NAOMI_DEFAULT_EEPROM - ROM_REGION( 0x8800000, "rom_board", ROMREGION_ERASEFF) + ROM_REGION( 0x7800000, "rom_board", ROMREGION_ERASEFF) ROM_LOAD( "sambaproto.ic22",0x000000, 0x0400000, CRC(ca069449) SHA1(03c2498664df187a98b335f1757979ebcf45c591) ) - ROM_LOAD("mpr-22950.ic1", 0x0800000, 0x0800000, CRC(16dee15c) SHA1(b46849e492756ff406bf8956303472255fcf55a5) ) - ROM_LOAD("mpr-22951.ic2", 0x1000000, 0x0800000, CRC(f509496f) SHA1(41281576f7d58c8ede9c0a89bfd46a98d5b97033) ) - ROM_LOAD("mpr-22952.ic3", 0x1800000, 0x0800000, CRC(fb9b3ef0) SHA1(e9d44b673c273e97445a12186496a0594e291542) ) - ROM_LOAD("mpr-22953.ic4", 0x2000000, 0x0800000, CRC(07207ce0) SHA1(b802bb4e78f3737a4e333f819b9a4e0249037288) ) - ROM_LOAD("mpr-22954.ic5", 0x2800000, 0x0800000, CRC(c8e797d1) SHA1(fadbd1e24882787634229003245293ce79ba2617) ) - ROM_LOAD("mpr-22955.ic6", 0x3000000, 0x0800000, CRC(064ef007) SHA1(8325f9aa537ce329e71dce2b588a3d4fc176c37b) ) - ROM_LOAD("mpr-22956.ic7", 0x3800000, 0x0800000, CRC(fe8f2964) SHA1(3a33162f797cd93b7dbb313b531215e340719110) ) - ROM_LOAD("mpr-22957.ic8", 0x4000000, 0x0800000, CRC(74842c01) SHA1(b02884925270edb66831ab502a0aa2f9430adc9f) ) - ROM_LOAD("mpr-22958.ic9", 0x4800000, 0x0800000, CRC(b1ead447) SHA1(06b848eb7f592763768050a1ae82b4cac9499684) ) - ROM_LOAD("mpr-22959.ic10", 0x5000000, 0x0800000, CRC(d32d7983) SHA1(86a9e5eae4598b6998f0ea578d6152e66c1a0df1) ) - ROM_LOAD("mpr-22960.ic11", 0x5800000, 0x0800000, CRC(6c3b228e) SHA1(782c0fda106222be75b1973586c8bf78fd2186e7) ) - ROM_LOAD("mpr-22961.ic12s",0x6000000, 0x0800000, CRC(d6d26a8d) SHA1(7d416f8ac9fbbeb9bfe217ccc8eccf1644511110) ) - ROM_LOAD("mpr-22962.ic13s",0x6800000, 0x0800000, CRC(c2f41101) SHA1(0bf87cbffb7d6a5ab32543cef56c9759f475419a) ) - ROM_LOAD("mpr-22963.ic14s",0x7000000, 0x0800000, CRC(a53e9919) SHA1(d81eb79bc706f85ebfbc56a9b2889ae62d629e8e) ) - ROM_LOAD("mpr-22964.ic15s",0x7800000, 0x0800000, CRC(f581d5a3) SHA1(8cf769f5b0a48951246bb60e9cf58232bcee7bc8) ) - ROM_LOAD("mpr-22965.ic16s",0x8000000, 0x0800000, CRC(8f7bfa8a) SHA1(19f137b1552978d232785c4408805b71835585c6) ) + ROM_LOAD("ic1s", 0x00800000, 0x00800000, CRC(992a8390) SHA1(5842aaf0c9ed25f58429cae71f90d8e3e41a3efd) ) + ROM_LOAD("ic2s", 0x01000000, 0x00800000, CRC(330f9185) SHA1(dd2ee044a62179160cd69799ce3727e7cb401da8) ) + ROM_LOAD("ic3s", 0x01800000, 0x00800000, CRC(719ae0f9) SHA1(f08d1764f19023d510be5e02183eef18a9294a99) ) + ROM_LOAD("ic4s", 0x02000000, 0x00800000, CRC(941b8208) SHA1(4409d4d83546c57e7c046de2e8a1b25f40acb246) ) + ROM_LOAD("ic5s", 0x02800000, 0x00800000, CRC(6d12335e) SHA1(9d58040182d7f185733a3aebc833e98d2daec3a5) ) + ROM_LOAD("ic6s", 0x03000000, 0x00800000, CRC(197540ed) SHA1(b993344b4091c86bc823d6e73814baeab01b9c43) ) + ROM_LOAD("ic7s", 0x03800000, 0x00800000, CRC(2e0912ba) SHA1(fe010f41f7498a417d143b95617d1cbc8d5c5ec7) ) + ROM_LOAD("ic8s", 0x04000000, 0x00800000, CRC(10f6b6a2) SHA1(d73fef5edac937b8d294781bbd6197fd8185c589) ) + ROM_LOAD("ic9s", 0x04800000, 0x00800000, CRC(2b57ce5f) SHA1(0fcf78b3497b918dc1fbc62ffdd2863489eea3ab) ) + ROM_LOAD("ic10s", 0x05000000, 0x00800000, CRC(7d61643c) SHA1(e48023ec78143e85bdf4605deaba3f355601a856) ) + ROM_LOAD("ic11s", 0x05800000, 0x00800000, CRC(ca391126) SHA1(a3324b865c134ba9ec3ef33cd158107b55b8bd2e) ) + ROM_LOAD("ic12s", 0x06000000, 0x00800000, CRC(f028ae87) SHA1(ff868e33d8765c076d687af416a8d658169af2fb) ) + ROM_LOAD("ic13s", 0x06800000, 0x00800000, CRC(37a15a54) SHA1(11c247caf0cd0ed098d408d273affab87d794169) ) + ROM_LOAD("ic14s", 0x07000000, 0x00800000, CRC(e0730a2b) SHA1(79ac165cf8d8095ff1661e86d03ad6fd04d2d63c) ) + + ROM_REGION(0x84, "some_eeprom", 0) + ROM_LOAD( "sflash.ic37", 0x000000, 0x000084, CRC(69d54cc4) SHA1(e036b8537390b9941dbfcb8d3b42ded68c8e9d29) ) // 840-0020 1999 317-0270-COM Naomi ROM_PARAMETER( ":rom_board:segam2crypt:key", "280a8b5d" ) @@ -8991,8 +8987,8 @@ ROM_END /* 0017 */ GAME( 1999, otrigger, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS ) /* 0018 */ GAME( 1999, sgtetris, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Sega Tetris", GAME_FLAGS ) /* 0019 */ GAME( 1999, dybb99, naomi, naomim2, dybbnao, naomi_state, naomi, ROT0, "Sega", "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS) (Rev B)", GAME_FLAGS ) -/* 0020 */ GAME( 1999, samba, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (JPN) (Rev B)", GAME_FLAGS ) -/* none */ GAME( 1999, sambap, samba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (prototype)", GAME_FLAGS ) +/* 0020 */ GAME( 1999, samba, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (Rev B)", GAME_FLAGS ) +/* none */ GAME( 1999, sambap, samba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (USA, prototype)", GAME_FLAGS ) /* none */ GAME( 2000, virnbap, virnba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Virtua NBA (prototype)", GAME_FLAGS ) /* 0021 */ GAME( 2000, virnbao, virnba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS) (original)", GAME_FLAGS ) /* 0021-01*/GAME( 2000,virnba, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS ) From 6cd8271575238fef0f1d8c57d936b3e470a6916a Mon Sep 17 00:00:00 2001 From: Cesare Falco Date: Sat, 6 Jun 2015 16:32:04 +0200 Subject: [PATCH 183/284] Added new SDL_INI_PATH flag --- makefile | 5 +++++ scripts/src/osd/sdl.lua | 5 +++++ scripts/src/osd/sdl_cfg.lua | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/makefile b/makefile index e96640a0d05..ef9b07f7381 100644 --- a/makefile +++ b/makefile @@ -27,6 +27,7 @@ # USE_DISPATCH_GL = 0 # DIRECTINPUT = 7 # USE_SDL = 1 +# SDL_INI_PATH = .;$HOME/.mame/;ini; # SDL2_MULTIAPI = 1 # NO_USE_MIDI = 1 # DONT_USE_NETWORK = 1 @@ -474,6 +475,10 @@ ifdef USE_SDL PARAMS += --USE_SDL='$(USE_SDL)' endif +ifdef SDL_INI_PATH +PARAMS += --SDL_INI_PATH='$(SDL_INI_PATH)' +endif + ifdef CYGWIN_BUILD PARAMS += --CYGWIN_BUILD='$(CYGWIN_BUILD)' endif diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 0fc7d57d3b9..0358881562f 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -101,6 +101,11 @@ newoption { description = "link against specific GL-Library - also adds rpath to executable (overridden by USE_DISPATCH_GL)", } +newoption { + trigger = "SDL_INI_PATH", + description = "Default search path for .ini files", +} + newoption { trigger = "NO_X11", description = "Disable use of X11", diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index a26d80f197b..a204201d6f5 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -18,6 +18,11 @@ if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS[ } end +if _OPTIONS["SDL_INI_PATH"]~=nil then + defines { + "'INI_PATH=\"" .. _OPTIONS["SDL_INI_PATH"] .. "\"'", + } +end if _OPTIONS["NO_X11"]=="1" then defines { From ff128c4db05717dd80769a0989e8efed180f63dc Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sat, 6 Jun 2015 15:49:57 +0200 Subject: [PATCH 184/284] cgenie: change default rst key to f5 so that it doesn't interfere with the tab-ui --- src/mess/drivers/cgenie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c index 2c5ecb78546..3a5776814da 100644 --- a/src/mess/drivers/cgenie.c +++ b/src/mess/drivers/cgenie.c @@ -210,7 +210,7 @@ static INPUT_PORTS_START( cgenie ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L.P.") // marked as "L.P." in the manual, lightpen? PORT_START("RST") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_TAB) PORT_NAME("Rst") PORT_CHAR(9) PORT_CHANGED_MEMBER(DEVICE_SELF, cgenie_state, rst_callback, NULL) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F5) PORT_NAME("Rst") PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CHANGED_MEMBER(DEVICE_SELF, cgenie_state, rst_callback, NULL) INPUT_PORTS_END From 887742e3085d1d55d1ed75a12843c0fd0efc8715 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sat, 6 Jun 2015 18:37:41 +0200 Subject: [PATCH 185/284] cgenie: update, verify, clean, sort software lists. more to come. --- hash/cgenie_cart.xml | 17 +- hash/cgenie_cass.xml | 930 ++++++++++++++++++++++--------------------- 2 files changed, 493 insertions(+), 454 deletions(-) diff --git a/hash/cgenie_cart.xml b/hash/cgenie_cart.xml index f33f62e1d63..b3a951723f9 100644 --- a/hash/cgenie_cart.xml +++ b/hash/cgenie_cart.xml @@ -1,13 +1,13 @@ - - + Colour DOS Interface - 19?? + 1997 <homebrew?> + @@ -15,5 +15,16 @@ + + Colour-Monitor 2.0 + 198? + <unknown> + + + + + + + diff --git a/hash/cgenie_cass.xml b/hash/cgenie_cass.xml index 136d427bc5a..f77be698f80 100644 --- a/hash/cgenie_cass.xml +++ b/hash/cgenie_cass.xml @@ -3,936 +3,964 @@ - - - Andromeda - 1982 - TGC - + + + Andromeda (32k) + 1982 + TCG + + - + - - Andromeda (Alt) + + Andromeda (16k) 1982 - TGC - - + TCG + + - + - + Astronaut 1984 - N.A. Taylor - + N. A. Taylor + - + - + + + Basicode 1983 TCS - - + + - + - + + Basic +5 + 1983 + TCS + + + + + + + + + Basic-Packer 2.13 1983 TCS - - + - + - - Chopper - 198? - <unknown> - + + - - - - - - - - - Chopper (Autostart) - 1983 - Juergen Buchmueller - - - - - - - - - - - TCS Colour Basic Compiler Ver. 3.05 + + Colour Basic Compiler 3.05 1982 TCS - - + - + - - Colour Basic +5 - 1983 - TCS - - - - - - - - - - - EG 2000 Tape-Disk Converter Ver. 1.1 - 19?? + + Colourdemo + 198? <unknown> - - + + - - + + - + Colour Design 3.0 19?? <unknown> - - + - + - - Colour DOS - Interface - 1997 - Juergen Buchmueller - - - - - - - - - - - Colour-Forth v2.0 + + Colour-Forth 2.0 (with cassette support) 1983 TCS - - + - + - - Colour-Forth v2.0 (Alt) + + Colour-Forth 2.0 1983 TCS - - + - + - - Colour Kong (16k) - 1983 - TCS - + - - - - - - - - + Colour Kong (32k) 1983 TCS - - + + - + - - Colour Kong (16k, Alt) + + Colour Kong (16k) 1983 TCS - + + + + + + + + + + Colour Kong (16k, no autostart) + 1983 + TCS + + - + - - Colmon Vers.2 + + + + Colour-Monitor 2.0 198? <unknown> - - + - + - - Unknown program "MONROM" - 19?? - <unknown> - - - - - - - - - - + Colour-Monitor 3.0 1983 TCS - - + - + - + Colour-PASCAL 2.0 198? <unknown> - - + - + - + Colrot 1983 TCS - - + + - + - - Colour-SCHACH - 1983 - <unknown> - - - - - - - - - - + Colour Schach 1983 - TCS - - + <unknown> + + - - + + - + + Colour Schach (TCS) + 1983 + TCS + + + + + + + + + + + + + + + + + Chopper (TCS) + 198? + TCS + + + + + + + + + + + Chopper (1983) + 1983 + Jürgen Buchmüller + + + + + + + + + + + + Cosmic Attack 198? Kansas Software - - + + - + - - Crazy Paint (Later, Alt) + + Crazy Paint + 1983 + TCS + + + + + + + + + + + Crazy Paint (The Colour Connection) 1984 The Colour Connection - - + + - - + + - + + Crazy Paint (The Colour Connection, alternate) + 1984 + The Colour Connection + + + + + + + + + + + + + + Eagle 1983 TCS - - + + - + - + Eatman 1983 Computer Service W. Neumann - Molimerx Ltd. - - + + - + - + Eis 1983 TCS - - + + - + - + Eliminator 1984 - The Colour Connection - - + TCC + + - + - - Unknown program "FGR" - 19?? - <unknown> - + + + - - - - - - - - + Firebird 1983 - Heinz Hubben Software - - + Heinz Hübben Software + + - + - + Colour Genie Flugsimulator - 198? + 1984 TCS - - + - + - - Im Reich der Fraggles + + Im Reich der Fraggels 19?? <unknown> - - + - + - - Glueckspilz - 1983 - TCS? - + + + Glückspilz + 1983 + <unknown> + + - + - - Grafik Editor + + Grafik-Editor 1983 - TCS? - - + TCS + + - + + - + + Hektik + 1983 + TCS + + + + + + + + + + Helikopter 1983 - Heinz Hubben Software - - + Heinz Hübben Software + + - + - + Invasion aus dem Weltraum 1982 - Harald Boegeholz - - + TCS + + - + - Jet Set Billy 16K Version + Jet Set Billy (16k) 1984 Arcade Games - - + + - + - + + - + + + + Marienkäfer + 1984 + <unknown> + + + + + + + + + + + + Life 1983 TCS - - + + - + - + + + Lunar Lander 1983 TCS - - + + - + - + + + + + Mampf Man II 1983 TCS - - + + - + - - Marien Kaefer - 1984 - TCS? - + + + - - - - - - - - + Meteor 1983 TCS - - + + - + - Unknown program "MONROE" - 19?? + Unknown (data?) + 198? <unknown> - - + - + - + Motten 1982 TCS - - + + - + - + Musik 1983 TCS - - + - + - + + + Netzo 1983 TCS - - + + - + - + + + + + Pac Boy 1984 - Heinz Hubben Software - - + Heinz Hübben Software + + - + - - Crazy Paint - 1983 - TCS - + + + + + - - - - - - - - - Crazy Paint (Later) - 1984 - The Colour Connection - - - - - - - - - - + RS-232 Treiberprogramm - 19?? + 198? <unknown> - - + - + - + Saug 1983 TCS - - + + - + - - Screen Printer - 1983 - TCS - - - - - - - - - - + Scuttle - 1982 - TGC? - - + 198? + <unknown> + + - + - + + + Skramble 1983 Algray Software - - + + - + + - + + + Software-Schutz 1983 - Harald Boegeholz - - + Harald Bögeholz + - + - + Space Attack 1984 - The Colour Connection - - + TCC + + - + - + Spaceman 198? - TCS? - - + <unknown> + + - + - - Super-Basic - 19?? - Heinz Hubben Software - + + + Super-Basic + 198? + Heinz Hübben Software + - + - - Superhirn - 1982 - TTS - - - - - - - - - - + Super-Grafik 1984 The Colour Connection - - + + - + - - System Copy - 19?? - <unknown> - + + Superhirn + 198? + TTS + + + + + + + + + System Copy + 198? + <unknown> + + - + - - Tausend Fuss + + Tape-Disk Converter 1.11 + 198? + <unknown> + + + + + + + + + + Tausendfuss 1983 TCS - - + - + - + Toad Mania 1983 Gumboot Software - - + + - + - + Tracemon 1983 Juergen Buchmueller - - + + - + - + Triton Battle 19?? Schmidtke Electronic - - + + - + - + U-Boot-Jagd 198? - TGC? - - + <unknown> + - + Unknown multi-program tape - 19?? + 198? <unknown> - - + - + - - Zeichen Editor + + + + Zeicheneditor + 1983 TCS - - - - - - - - - - - Zeichen Editor (Alt) - 1983 - TCS - - + - + + + + + + + Zeicheneditor + (incl. SCREEN-Editor) + 1983 + TCS + + + + + + + + + + Zeichensätze (incl. Screen-Printer) + 1983 + TCS + + + + + From 8b0d40bfaf397b05c06b01e6254794c6cec27910 Mon Sep 17 00:00:00 2001 From: system11b Date: Sat, 6 Jun 2015 20:27:08 +0100 Subject: [PATCH 186/284] Added gundharac - chinese possibly bootleg version of Gundhara with split ROMs --- src/mame/arcade.lst | 1 + src/mame/drivers/seta.c | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 37706f94f41..9649c3f9b18 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -9114,6 +9114,7 @@ keroppi // (c) 1993 Sammy keroppij // (c) 1993 Sammy extdwnhl // (c) 1995 Sammy Japan gundhara // (c) 1995 Banpresto +gundharac // (c) 1995 Banpresto (Chinese, bootleg?) sokonuke // (c) 1995 Sammy Industries zombraid // (c) 1995 American Sammy zombraidp // (c) 1995 American Sammy diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index d456ec77f50..4b62c2122b0 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -10868,6 +10868,51 @@ ROM_START( gundhara ) ROM_CONTINUE( 0x000000, 0x080000 ) ROM_END +/* Chinese factory board, possibly bootleg but appears to come from the + same factory as normal boards. Modified layout allowing split ROMs */ +ROM_START( gundharac ) + ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */ + ROM_LOAD16_BYTE( "4.U3", 0x000000, 0x080000, CRC(14e9970a) SHA1(31964bd290cc94c40684adf3a5d129b1c3addc3b) ) + ROM_LOAD16_BYTE( "2.U4", 0x000001, 0x080000, CRC(96dfc658) SHA1(f570bc49758535eb00d93ecce9f75832f97a0d8d) ) + ROM_LOAD16_BYTE( "3.U103", 0x100000, 0x080000, CRC(312f58e2) SHA1(a74819d2f84a00c233489893f12c9ab1a98459cf) ) + ROM_LOAD16_BYTE( "1.U102", 0x100001, 0x080000, CRC(8d23a23c) SHA1(9e9a6488db424c81a97edcb7115cc070fe35c077) ) + + ROM_REGION( 0x800000, "gfx1", 0 ) /* Sprites */ + ROM_LOAD16_BYTE( "19.U140", 0x000000, 0x080000, CRC(32d92c28) SHA1(7ba67f715f094aacf2dc2399809e4dfc7e4ca241) ) + ROM_LOAD16_BYTE( "23.U142", 0x000001, 0x080000, CRC(ff44db9b) SHA1(76ecd3ce3b6b33f3ae0b0454d58cf37d545dd72c) ) + ROM_LOAD16_BYTE( "21.U141", 0x100000, 0x080000, CRC(1901dc08) SHA1(b19428a7510d6e28a39bdf6ecc9732e3c2d19214) ) + ROM_LOAD16_BYTE( "25.U143", 0x100001, 0x080000, CRC(877289a2) SHA1(7482320e319d7b641fabba5aeeaa1237b693a219) ) + ROM_LOAD16_BYTE( "18.U140-B", 0x200000, 0x080000, CRC(4f023fb0) SHA1(815765c9783e44762bf57a3fbfad4385c316343a) ) + ROM_LOAD16_BYTE( "22.U142-B", 0x200001, 0x080000, CRC(6f3fe7e7) SHA1(71bc347c06678f4ae7850799da6346c6447bf3c0) ) + ROM_LOAD16_BYTE( "20.U141-B", 0x300000, 0x080000, CRC(7f1932e0) SHA1(13262a7322ad29cf7c85461204a3518e900c6145) ) + ROM_LOAD16_BYTE( "24.U143-B", 0x300001, 0x080000, CRC(066a2e2b) SHA1(186729918a89535484ab86dd58caf20ccce81501) ) + ROM_LOAD16_BYTE( "9.U144", 0x400000, 0x080000, CRC(6b4a531f) SHA1(701d6b2d87a742c8a2ab36331bd843dcd3309eae) ) + ROM_LOAD16_BYTE( "13.U146", 0x400001, 0x080000, CRC(45be3df4) SHA1(36667bf5e4b80d17a9d7b6ce4df7498f94681c46) ) + ROM_LOAD16_BYTE( "11.U145", 0x500000, 0x080000, CRC(f5210aa5) SHA1(4834d905f699dbec1cdacea6b320271c291aa2a7) ) + ROM_LOAD16_BYTE( "15.U147", 0x500001, 0x080000, CRC(17003119) SHA1(a2edd65c98bc654b541dad3e3783d90931c97597) ) + ROM_LOAD16_BYTE( "8.U144-B", 0x600000, 0x080000, CRC(ad9d9338) SHA1(33d6c881a20e2150017cc26f929473291e561718) ) + ROM_LOAD16_BYTE( "12.U146-B", 0x600001, 0x080000, CRC(0fd4c062) SHA1(7f418d43d9ba884c504f6fe3c04b11724412ac6b) ) + ROM_LOAD16_BYTE( "10.U145-B", 0x700000, 0x080000, CRC(7c5d12b9) SHA1(6ee45c4da6994540852153752e2818a8ea8ecf1a) ) + ROM_LOAD16_BYTE( "14.U147-B", 0x700001, 0x080000, CRC(5a8af50f) SHA1(3b7937ba720fcbbc5e29c1b95a97c29e8ff5490a) ) + + ROM_REGION( 0x200000, "gfx2", 0 ) /* Layer 1 */ + ROM_LOAD16_BYTE( "5.U148", 0x000000, 0x080000, CRC(0c740f9b) SHA1(f6d135c3318ff0d50d40921aa108b1b332c1a086) ) + ROM_LOAD16_BYTE( "6.U150", 0x000001, 0x080000, CRC(ba60eb98) SHA1(7204269816332bbb3401d9f20a513372ffe78500) ) + ROM_LOAD16_BYTE( "7.U154", 0x100000, 0x080000, CRC(b768e666) SHA1(473fa52c16c0a9f321e6429947a3e0fc1ef22f7e) ) + + ROM_REGION( 0x400000, "gfx3", 0 ) /* Layer 2 */ + ROM_LOAD16_BYTE( "26.U164", 0x000000, 0x080000, CRC(be3ccaba) SHA1(98f8b83cbed00932866375d21f86ee5c9bddb2a6) ) + ROM_LOAD16_BYTE( "28.U166", 0x000001, 0x080000, CRC(8a650a4e) SHA1(1f6eda27b39ad052e3d9a8a72cb0a072e7be4487) ) + ROM_LOAD16_BYTE( "27.U165", 0x100000, 0x080000, CRC(47994ff0) SHA1(25211a9af01f77788578bb524619d95b5b86e241) ) + ROM_LOAD16_BYTE( "29.U167", 0x100001, 0x080000, CRC(453c3d3f) SHA1(151528b6b1e7f8c059d67dbaca61e7c382e9ce04) ) + ROM_LOAD16_BYTE( "16.U152", 0x200000, 0x080000, CRC(5ccc500b) SHA1(d3a2a5658cac8d788e0a1189c184309b8394b10a) ) + ROM_LOAD16_BYTE( "17.U153", 0x300000, 0x080000, CRC(5586d086) SHA1(e43d5e8834701f40389400f68a99353e67598f6d) ) + + ROM_REGION( 0x100000, "x1snd", 0 ) /* Samples */ + ROM_LOAD( "30.U69", 0x000000, 0x080000, CRC(3111a98a) SHA1(75e17a0113060a10551b2b8c17b19890eb7aa0a6) ) + ROM_LOAD( "31.U70", 0x080000, 0x080000, CRC(30cb2524) SHA1(85deb83262bbe481404705e163e5eb9362985b01) ) +ROM_END + ROM_START( sokonuke ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "001-001.bin", 0x000000, 0x080000, CRC(9d0aa3ca) SHA1(f641c46f2c6e7f82bb9184daac62938afb607c09) ) @@ -11668,6 +11713,7 @@ GAME( 1993, keroppij, keroppi, keroppij, keroppij,driver_device, 0, ROT GAME( 1995, extdwnhl, 0, extdwnhl, extdwnhl, driver_device, 0, ROT0, "Sammy Industries Japan", "Extreme Downhill (v1.5)", GAME_IMPERFECT_GRAPHICS ) GAME( 1995, gundhara, 0, gundhara, gundhara, driver_device, 0, ROT270, "Banpresto", "Gundhara", 0 ) +GAME( 1995, gundharac, gundhara,gundhara, gundhara, driver_device, 0, ROT270, "Banpresto", "Gundhara (Chinese, bootleg?)", 0 ) GAME( 1995, sokonuke, 0, extdwnhl, sokonuke, driver_device, 0, ROT0, "Sammy Industries", "Sokonuke Taisen Game (Japan)", GAME_IMPERFECT_SOUND ) From e14de8c687dc375d04357665b9877b3f521b9aa2 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sat, 6 Jun 2015 23:37:57 +0200 Subject: [PATCH 187/284] Core - Added emulation options for comm settings --- src/emu/emuopts.c | 7 +++++++ src/emu/emuopts.h | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index c537ce6dc4e..c7df63d76d1 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -160,6 +160,13 @@ const options_entry emu_options::s_option_entries[] = { OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" }, { OPTION_DEBUGSCRIPT, NULL, OPTION_STRING, "script for debugger" }, + // comm options + { NULL, NULL, OPTION_HEADER, "CORE COMM OPTIONS" }, + { OPTION_COMM_LOCAL_HOST, "0.0.0.0", OPTION_STRING, "local address to bind to" }, + { OPTION_COMM_LOCAL_PORT, "15112", OPTION_STRING, "local port to bind to" }, + { OPTION_COMM_REMOTE_HOST, "127.0.0.1", OPTION_STRING, "remote address to connect to" }, + { OPTION_COMM_REMOTE_PORT, "15112", OPTION_STRING, "remote port to connect to" }, + // misc options { NULL, NULL, OPTION_HEADER, "CORE MISC OPTIONS" }, { OPTION_DRC, "1", OPTION_BOOLEAN, "enable DRC cpu core if available" }, diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index ac2f18ac767..855e8eb19af 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -174,6 +174,12 @@ enum #define OPTION_UI_FONT "uifont" #define OPTION_RAMSIZE "ramsize" +// core comm options +#define OPTION_COMM_LOCAL_HOST "comm_localhost" +#define OPTION_COMM_LOCAL_PORT "comm_localport" +#define OPTION_COMM_REMOTE_HOST "comm_remotehost" +#define OPTION_COMM_REMOTE_PORT "comm_remoteport" + #define OPTION_CONFIRM_QUIT "confirm_quit" #define OPTION_UI_MOUSE "ui_mouse" @@ -343,6 +349,12 @@ public: const char *ui_font() const { return value(OPTION_UI_FONT); } const char *ram_size() const { return value(OPTION_RAMSIZE); } + // core comm options + const char *comm_localhost() const { return value(OPTION_COMM_LOCAL_HOST); } + const char *comm_localport() const { return value(OPTION_COMM_LOCAL_PORT); } + const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); } + const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); } + bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); } bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); } From 9027ce95756981dc2efa87a91049d5273ea34c8a Mon Sep 17 00:00:00 2001 From: Julian Sikorski Date: Sat, 6 Jun 2015 23:39:24 +0200 Subject: [PATCH 188/284] Added the ability to use system flac, jpeg, lua, sqlite3, portmidi and zlib based on wallyweek's work --- 3rdparty/lsqlite3/lsqlite3.c | 4 + makefile | 36 ++++ scripts/genie.lua | 56 +++++- scripts/src/3rdparty.lua | 42 ++++- scripts/src/emu.lua | 48 ++++- scripts/src/lib.lua | 13 +- scripts/src/main.lua | 41 ++++- scripts/src/tools.lua | 264 ++++++++++++++++++++++++--- scripts/target/ldplayer/ldplayer.lua | 10 +- scripts/target/mame/arcade.lua | 7 +- scripts/target/mame/dummy.lua | 10 +- scripts/target/mame/mess.lua | 6 +- scripts/target/mame/nl.lua | 9 +- scripts/target/mame/tiny.lua | 8 +- src/osd/modules/midi/portmidi.c | 4 + 15 files changed, 504 insertions(+), 54 deletions(-) diff --git a/3rdparty/lsqlite3/lsqlite3.c b/3rdparty/lsqlite3/lsqlite3.c index 415e9d84776..1026af451c9 100644 --- a/3rdparty/lsqlite3/lsqlite3.c +++ b/3rdparty/lsqlite3/lsqlite3.c @@ -47,7 +47,11 @@ #define luaL_openlib(L,name,reg,nup) luaL_setfuncs(L,reg,nup) #endif +#ifndef USE_SYSTEM_SQLITE #include "sqlite3/sqlite3.h" +#else +#include +#endif /* compile time features */ #if !defined(SQLITE_OMIT_PROGRESS_CALLBACK) diff --git a/makefile b/makefile index e96640a0d05..90dc6760c2d 100644 --- a/makefile +++ b/makefile @@ -53,6 +53,12 @@ # LDOPTS = # USE_SYSTEM_LIB_EXPAT = 1 +# USE_SYSTEM_LIB_ZLIB = 1 +# USE_SYSTEM_LIB_JPEG = 1 +# USE_SYSTEM_LIB_FLAC = 1 +# USE_SYSTEM_LIB_LUA = 1 +# USE_SYSTEM_LIB_SQLITE3 = 1 +# USE_SYSTEM_LIB_PORTMIDI = 1 # MESA_INSTALL_ROOT = /opt/mesa # SDL_INSTALL_ROOT = /opt/sdl2 @@ -294,6 +300,30 @@ ifndef USE_SYSTEM_LIB_EXPAT PARAMS += --with-bundled-expat endif +ifndef USE_SYSTEM_LIB_ZLIB +PARAMS += --with-bundled-zlib +endif + +ifndef USE_SYSTEM_LIB_JPEG +PARAMS += --with-bundled-jpeg +endif + +ifndef USE_SYSTEM_LIB_FLAC +PARAMS += --with-bundled-flac +endif + +ifndef USE_SYSTEM_LIB_LUA +PARAMS += --with-bundled-lua +endif + +ifndef USE_SYSTEM_LIB_SQLITE3 +PARAMS += --with-bundled-sqlite3 +endif + +ifndef USE_SYSTEM_LIB_PORTMIDI +PARAMS += --with-bundled-portmidi +endif + #------------------------------------------------- # distribution may change things #------------------------------------------------- @@ -1048,8 +1078,12 @@ CPPCHECK_PARAMS += -Isrc/osd/modules/render CPPCHECK_PARAMS += -Isrc/osd/windows CPPCHECK_PARAMS += -Isrc/emu/cpu/m68000 CPPCHECK_PARAMS += -I3rdparty +ifndef USE_SYSTEM_LIB_LUA CPPCHECK_PARAMS += -I3rdparty/lua/src +endif +ifndef USE_SYSTEM_LIB_ZLIB CPPCHECK_PARAMS += -I3rdparty/zlib +endif CPPCHECK_PARAMS += -I3rdparty/bgfx/include CPPCHECK_PARAMS += -I3rdparty/bx/include CPPCHECK_PARAMS += -Ibuild/generated/emu @@ -1062,7 +1096,9 @@ CPPCHECK_PARAMS += -DMAME_DEBUG CPPCHECK_PARAMS += -DMAME_PROFILER CPPCHECK_PARAMS += -DCRLF=3 CPPCHECK_PARAMS += -DLSB_FIRST +ifndef USE_SYSTEM_LIB_FLAC CPPCHECK_PARAMS += -DFLAC__NO_DLL +endif CPPCHECK_PARAMS += -DNATIVE_DRC=drcbe_x64 CPPCHECK_PARAMS += -DLUA_COMPAT_APIINTCASTS CPPCHECK_PARAMS += -DWIN32 diff --git a/scripts/genie.lua b/scripts/genie.lua index 702ae917064..7a591db050b 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -98,6 +98,36 @@ newoption { description = 'Build bundled Expat library', } +newoption { + trigger = 'with-bundled-zlib', + description = 'Build bundled Zlib library', +} + +newoption { + trigger = 'with-bundled-jpeg', + description = 'Build bundled JPEG library', +} + +newoption { + trigger = 'with-bundled-flac', + description = 'Build bundled FLAC library', +} + +newoption { + trigger = 'with-bundled-lua', + description = 'Build bundled LUA library', +} + +newoption { + trigger = 'with-bundled-sqlite3', + description = 'Build bundled SQLite library', +} + +newoption { + trigger = 'with-bundled-portmidi', + description = 'Build bundled PortMidi library', +} + newoption { trigger = "distro", description = "Choose distribution", @@ -596,9 +626,29 @@ else end -- need to ensure FLAC functions are statically linked -defines { - "FLAC__NO_DLL", -} +if _OPTIONS["with-bundled-flac"] then + defines { + "FLAC__NO_DLL", + } + end + +if not _OPTIONS["with-bundled-jpeg"] then + defines { + "USE_SYSTEM_JPEGLIB", + } + end + +if not _OPTIONS["with-bundled-portmidi"] then + defines { + "USE_SYSTEM_PORTMIDI", + } + end + +if not _OPTIONS["with-bundled-sqlite3"] then + defines { + "USE_SYSTEM_SQLITE", + } + end if _OPTIONS["NOASM"]=="1" then defines { diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 34c9a14599c..c2808c55dc5 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -34,6 +34,7 @@ end -- zlib library objects -------------------------------------------------- +if _OPTIONS["with-bundled-zlib"] then project "zlib" uuid "3d78bd2a-2bd0-4449-8087-42ddfaef7ec9" kind "StaticLib" @@ -71,6 +72,11 @@ project "zlib" "-Wshadow" } end +else +links { + "z", +} +end -------------------------------------------------- -- SoftFloat library objects @@ -112,6 +118,7 @@ project "softfloat" -- libJPEG library objects -------------------------------------------------- +if _OPTIONS["with-bundled-jpeg"] then project "jpeg" uuid "447c6800-dcfd-4c48-b72a-a8223bb409ca" kind "StaticLib" @@ -169,11 +176,17 @@ project "jpeg" "-Wshadow" } end +else +links { + "jpeg", +} +end -------------------------------------------------- -- libflac library objects -------------------------------------------------- +if _OPTIONS["with-bundled-flac"] then project "flac" uuid "b6fc19e8-073a-4541-bb7b-d24b548d424a" kind "StaticLib" @@ -223,6 +236,11 @@ project "flac" "-Wshadow" } end +else +links { + "FLAC", +} +end -------------------------------------------------- -- lib7z library objects @@ -268,6 +286,7 @@ project "7z" -- LUA library objects -------------------------------------------------- +if _OPTIONS["with-bundled-lua"] then project "lua" uuid "d9e2eed1-f1ab-4737-a6ac-863700b1a5a9" kind "StaticLib" @@ -342,6 +361,11 @@ project "lua" "-Wshadow" } end +else +links { + "lua", +} +end -------------------------------------------------- -- sqlite3 lua library objects @@ -362,8 +386,12 @@ project "lsqlite3" includedirs { MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/lua/src", } + if _OPTIONS["with-bundled-lua"] then + includedirs { + MAME_DIR .. "3rdparty/lua/src", + } + end files { MAME_DIR .. "3rdparty/lsqlite3/lsqlite3.c", @@ -435,6 +463,7 @@ project "jsoncpp" -- SQLite3 library objects -------------------------------------------------- +if _OPTIONS["with-bundled-sqlite3"] then project "sqllite3" uuid "5cb3d495-57ed-461c-81e5-80dc0857517d" kind "StaticLib" @@ -455,11 +484,17 @@ project "sqllite3" "-Wshadow" } end +else +links { + "sqlite3", +} +end -------------------------------------------------- -- portmidi library objects -------------------------------------------------- if _OPTIONS["NO_USE_MIDI"]~="1" then +if _OPTIONS["with-bundled-portmidi"] then project "portmidi" uuid "587f2da6-3274-4a65-86a2-f13ea315bb98" kind "StaticLib" @@ -514,6 +549,11 @@ project "portmidi" "-Wshadow" } end +else +links { + "portmidi", +} +end end -------------------------------------------------- -- BGFX library objects diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index f81ca07af5c..2cd14d3cac4 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -15,8 +15,6 @@ includedirs { MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/lua/src", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "emu", GEN_DIR .. "emu/layout", } @@ -25,6 +23,16 @@ if _OPTIONS["with-bundled-expat"] then MAME_DIR .. "3rdparty/expat/lib", } end +if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } +end +if _OPTIONS["with-bundled-lua"] then + includedirs { + MAME_DIR .. "3rdparty/lua/src", + } +end files { MAME_DIR .. "src/emu/emu.h", @@ -371,8 +379,6 @@ function emuProject(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/lua/src", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "emu", GEN_DIR .. "emu/layout", MAME_DIR .. "src/emu/cpu/m68000", @@ -382,6 +388,16 @@ function emuProject(_target, _subtarget) MAME_DIR .. "3rdparty/expat/lib", } end + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end + if _OPTIONS["with-bundled-lua"] then + includedirs { + MAME_DIR .. "3rdparty/lua/src", + } + end dofile(path.join("src", "cpu.lua")) @@ -410,8 +426,6 @@ function emuProject(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/lua/src", - MAME_DIR .. "3rdparty/zlib", MAME_DIR .. "src/mess", -- some mess bus devices need this MAME_DIR .. "src/mame", -- used for nes bus devices GEN_DIR .. "emu", @@ -422,6 +436,16 @@ function emuProject(_target, _subtarget) MAME_DIR .. "3rdparty/expat/lib", } end + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end + if _OPTIONS["with-bundled-lua"] then + includedirs { + MAME_DIR .. "3rdparty/lua/src", + } + end dofile(path.join("src", "bus.lua")) @@ -440,8 +464,6 @@ function emuProject(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/lua/src", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "emu", } if _OPTIONS["with-bundled-expat"] then @@ -449,6 +471,16 @@ function emuProject(_target, _subtarget) MAME_DIR .. "3rdparty/expat/lib", } end + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end + if _OPTIONS["with-bundled-lua"] then + includedirs { + MAME_DIR .. "3rdparty/lua/src", + } + end files { disasm_files diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 774e674db1a..dab7f0dc9c4 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -14,13 +14,17 @@ project "utils" MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", } if _OPTIONS["with-bundled-expat"] then includedirs { MAME_DIR .. "3rdparty/expat/lib", } end + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end files { MAME_DIR .. "src/lib/util/bitstream.h", @@ -110,9 +114,14 @@ project "formats" MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", } + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end + files { MAME_DIR .. "src/lib/formats/2d_dsk.c", MAME_DIR .. "src/lib/formats/2d_dsk.h", diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 809a18be70a..6bbdc01833c 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -95,16 +95,44 @@ function mainProject(_target, _subtarget) "expat", "softfloat", "jpeg", - "flac", "7z", "formats", "lua", "lsqlite3", - "sqllite3", - "zlib", "jsoncpp", "mongoose", } + + if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } + else + links { + "z", + } + end + + if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } + else + links { + "FLAC", + } + end + + if _OPTIONS["with-bundled-sqlite3"] then + links { + "sqllite3", + } + else + links { + "sqlite3", + } + end + if _OPTIONS["NO_USE_MIDI"]~="1" then links { "portmidi", @@ -130,11 +158,16 @@ function mainProject(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. _target .. "/layout", GEN_DIR .. "resource", } + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end + if _OPTIONS["targetos"]=="macosx" and (not override_resources) then linkoptions { "-sectcreate __TEXT __info_plist " .. GEN_DIR .. "/resource/" .. _subtarget .. "-Info.plist" diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index b7a88f038f7..4f58b12d641 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -24,10 +24,19 @@ end links { "utils", "expat", - "zlib", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -60,12 +69,30 @@ end links { "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -100,10 +127,19 @@ end links { "utils", "expat", - "zlib", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -138,12 +174,30 @@ links { "emu", "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/emu", @@ -179,12 +233,30 @@ end links { "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -218,12 +290,30 @@ end links { "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -257,10 +347,19 @@ end links { "utils", "expat", - "zlib", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -293,10 +392,19 @@ end links { "utils", "expat", - "zlib", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -329,10 +437,19 @@ end links { "utils", "expat", - "zlib", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -365,12 +482,30 @@ end links { "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -403,10 +538,19 @@ end links { "utils", "expat", - "zlib", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -439,13 +583,31 @@ end links { "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], "netlist", } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -480,12 +642,30 @@ links { "formats", "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib", @@ -521,12 +701,30 @@ links { "emu", "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib", @@ -562,12 +760,30 @@ links { "emu", "utils", "expat", - "zlib", - "flac", "7z", "ocore_" .. _OPTIONS["osd"], } +if _OPTIONS["with-bundled-zlib"] then + links { + "zlib", + } +else + links { + "z", + } +end + +if _OPTIONS["with-bundled-flac"] then + links { + "flac", + } +else + links { + "FLAC", + } +end + includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib", diff --git a/scripts/target/ldplayer/ldplayer.lua b/scripts/target/ldplayer/ldplayer.lua index f12fad0c7db..c8435c4a8ab 100644 --- a/scripts/target/ldplayer/ldplayer.lua +++ b/scripts/target/ldplayer/ldplayer.lua @@ -68,9 +68,13 @@ function createProjects_ldplayer_ldplayer(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "mame/layout", - } + } + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end files{ MAME_DIR .. "src/emu/drivers/emudummy.c", @@ -89,4 +93,4 @@ function linkProjects_ldplayer_ldplayer(_target, _subtarget) links { "drvldplayer", } -end \ No newline at end of file +end diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 3b178ee8c15..7204ce91985 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -774,9 +774,14 @@ function createMAMEProjects(_target, _subtarget, _name) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "mame/layout", } + + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } +end end function createProjects_mame_arcade(_target, _subtarget) diff --git a/scripts/target/mame/dummy.lua b/scripts/target/mame/dummy.lua index 145862828d5..dba163b35f8 100644 --- a/scripts/target/mame/dummy.lua +++ b/scripts/target/mame/dummy.lua @@ -29,9 +29,13 @@ function createProjects_mame_dummy(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "mess/layout", - } + } + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end files{ MAME_DIR .. "src/mess/drivers/coleco.c", @@ -43,4 +47,4 @@ function linkProjects_mame_dummy(_target, _subtarget) links { "mame_dummy", } -end \ No newline at end of file +end diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index e414158ea77..0533932f8bd 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -874,11 +874,15 @@ function createMESSProjects(_target, _subtarget, _name) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "mess/layout", GEN_DIR .. "mame/layout", MAME_DIR .. "src/emu/cpu/m68000", } + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end end function createProjects_mame_mess(_target, _subtarget) diff --git a/scripts/target/mame/nl.lua b/scripts/target/mame/nl.lua index 2ed0cae3e19..0ba36789c5b 100644 --- a/scripts/target/mame/nl.lua +++ b/scripts/target/mame/nl.lua @@ -96,9 +96,14 @@ function createProjects_mame_nl(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "mame/layout", - } + } + + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end files{ MAME_DIR .. "src/mame/drivers/pong.c", diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua index 9dc18d31d9a..5594593d113 100644 --- a/scripts/target/mame/tiny.lua +++ b/scripts/target/mame/tiny.lua @@ -92,9 +92,13 @@ function createProjects_mame_tiny(_target, _subtarget) MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", - MAME_DIR .. "3rdparty/zlib", GEN_DIR .. "mame/layout", - } + } + if _OPTIONS["with-bundled-zlib"] then + includedirs { + MAME_DIR .. "3rdparty/zlib", + } + end files{ MAME_DIR .. "src/mame/machine/ticket.c", diff --git a/src/osd/modules/midi/portmidi.c b/src/osd/modules/midi/portmidi.c index 78ac990d2b0..02dad28ffc1 100644 --- a/src/osd/modules/midi/portmidi.c +++ b/src/osd/modules/midi/portmidi.c @@ -10,7 +10,11 @@ #ifndef NO_USE_MIDI +#ifndef USE_SYSTEM_PORTMIDI #include "portmidi/pm_common/portmidi.h" +#else +#include +#endif #include "osdcore.h" #include "corealloc.h" #include "modules/osdmodule.h" From 5107c16ca6a4a05e8755c935d9b0ba23f5f4499a Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 7 Jun 2015 02:08:30 +0200 Subject: [PATCH 189/284] Fixed a number of bugs and some additions: - fixed bugs in the spice(Kicad) conversion - fixes submodel difference between inline and parsed netlist - added truthtable 7404 and 7486 models - aligned input and output naming for truthtable and specialised 74xx models. --- src/emu/netlist/analog/nld_fourterm.c | 1 + src/emu/netlist/analog/nld_opamps.h | 2 +- src/emu/netlist/analog/nld_solver.c | 9 +- src/emu/netlist/devices/nld_7400.c | 16 ++-- src/emu/netlist/devices/nld_7402.c | 16 ++-- src/emu/netlist/devices/nld_7404.c | 43 ++++++---- src/emu/netlist/devices/nld_7404.h | 9 +- src/emu/netlist/devices/nld_7408.c | 16 ++-- src/emu/netlist/devices/nld_7410.c | 18 ++-- src/emu/netlist/devices/nld_7411.c | 18 ++-- src/emu/netlist/devices/nld_7420.c | 16 ++-- src/emu/netlist/devices/nld_7425.c | 16 ++-- src/emu/netlist/devices/nld_7427.c | 18 ++-- src/emu/netlist/devices/nld_74279.c | 20 ++--- src/emu/netlist/devices/nld_7430.c | 16 ++-- src/emu/netlist/devices/nld_7432.c | 16 ++-- src/emu/netlist/devices/nld_7437.c | 16 ++-- src/emu/netlist/devices/nld_7486.c | 105 +++++++++++++---------- src/emu/netlist/devices/nld_7486.h | 10 ++- src/emu/netlist/devices/nld_9312.c | 24 +++--- src/emu/netlist/devices/nld_signal.h | 18 ++-- src/emu/netlist/devices/nld_truthtable.h | 43 ++++++---- src/emu/netlist/nl_parser.c | 8 +- src/emu/netlist/nl_setup.h | 2 +- src/emu/netlist/plib/pparser.c | 10 +++ src/emu/netlist/plib/pparser.h | 1 + src/emu/netlist/tools/nl_convert.c | 54 +++++++++--- 27 files changed, 316 insertions(+), 225 deletions(-) diff --git a/src/emu/netlist/analog/nld_fourterm.c b/src/emu/netlist/analog/nld_fourterm.c index e2457d8ee11..ad67ccbba4b 100644 --- a/src/emu/netlist/analog/nld_fourterm.c +++ b/src/emu/netlist/analog/nld_fourterm.c @@ -50,6 +50,7 @@ NETLIB_RESET(VCCS) const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A const nl_double GI = NL_FCONST(1.0) / m_RI.Value(); + //printf("VCCS %s RI %f\n", name().cstr(), m_RI.Value()); m_IP.set(GI); m_IN.set(GI); diff --git a/src/emu/netlist/analog/nld_opamps.h b/src/emu/netlist/analog/nld_opamps.h index 4433114a18c..722212b1763 100644 --- a/src/emu/netlist/analog/nld_opamps.h +++ b/src/emu/netlist/analog/nld_opamps.h @@ -19,7 +19,7 @@ // ---------------------------------------------------------------------------------------- #define LM3900(_name) \ - SUBMODEL(_name, opamp_lm3900) + SUBMODEL(opamp_lm3900, name) // ---------------------------------------------------------------------------------------- // Devices ... diff --git a/src/emu/netlist/analog/nld_solver.c b/src/emu/netlist/analog/nld_solver.c index 947cda58cbb..c7d4ac1cddc 100644 --- a/src/emu/netlist/analog/nld_solver.c +++ b/src/emu/netlist/analog/nld_solver.c @@ -508,6 +508,9 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start() case 12: ms = create_solver<12,12>(12, gs_threshold, use_specific); break; + case 87: + ms = create_solver<87,87>(87, gs_threshold, use_specific); + break; default: if (net_count <= 16) { @@ -521,9 +524,13 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start() { ms = create_solver<0,64>(net_count, gs_threshold, use_specific); } + else if (net_count <= 128) + { + ms = create_solver<0,128>(net_count, gs_threshold, use_specific); + } else { - netlist().error("Encountered netgroup with > 64 nets"); + netlist().error("Encountered netgroup with > 128 nets"); ms = NULL; /* tease compilers */ } diff --git a/src/emu/netlist/devices/nld_7400.c b/src/emu/netlist/devices/nld_7400.c index 758d5d1b667..91a1bfbf472 100644 --- a/src/emu/netlist/devices/nld_7400.c +++ b/src/emu/netlist/devices/nld_7400.c @@ -26,20 +26,20 @@ NETLIB_START(7400_dip) register_sub("3", m_3); register_sub("4", m_4); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); register_subalias("3", m_1.m_Q[0]); - register_subalias("4", m_2.m_i[0]); - register_subalias("5", m_2.m_i[1]); + register_subalias("4", m_2.m_I[0]); + register_subalias("5", m_2.m_I[1]); register_subalias("6", m_2.m_Q[0]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); register_subalias("8", m_3.m_Q[0]); - register_subalias("12", m_4.m_i[0]); - register_subalias("13", m_4.m_i[1]); + register_subalias("12", m_4.m_I[0]); + register_subalias("13", m_4.m_I[1]); register_subalias("11", m_4.m_Q[0]); } diff --git a/src/emu/netlist/devices/nld_7402.c b/src/emu/netlist/devices/nld_7402.c index 708dab04fcf..f64f5e4ba96 100644 --- a/src/emu/netlist/devices/nld_7402.c +++ b/src/emu/netlist/devices/nld_7402.c @@ -27,19 +27,19 @@ NETLIB_START(7402_dip) register_sub("4", m_4); register_subalias("1", m_1.m_Q[0]); - register_subalias("2", m_1.m_i[0]); - register_subalias("3", m_1.m_i[1]); + register_subalias("2", m_1.m_I[0]); + register_subalias("3", m_1.m_I[1]); register_subalias("4", m_2.m_Q[0]); - register_subalias("5", m_2.m_i[0]); - register_subalias("6", m_2.m_i[1]); + register_subalias("5", m_2.m_I[0]); + register_subalias("6", m_2.m_I[1]); - register_subalias("8", m_3.m_i[0]); - register_subalias("9", m_3.m_i[1]); + register_subalias("8", m_3.m_I[0]); + register_subalias("9", m_3.m_I[1]); register_subalias("10", m_3.m_Q[0]); - register_subalias("11", m_4.m_i[0]); - register_subalias("12", m_4.m_i[1]); + register_subalias("11", m_4.m_I[0]); + register_subalias("12", m_4.m_I[1]); register_subalias("13", m_4.m_Q[0]); } diff --git a/src/emu/netlist/devices/nld_7404.c b/src/emu/netlist/devices/nld_7404.c index 2c812744db0..8637da2fec6 100644 --- a/src/emu/netlist/devices/nld_7404.c +++ b/src/emu/netlist/devices/nld_7404.c @@ -7,10 +7,20 @@ #include "nld_7404.h" +#if 1 && (USE_TRUTHTABLE) +nld_7404::truthtable_t nld_7404::m_ttbl; +const char *nld_7404::m_desc[] = { + "A | Q ", + "0 | 1|22", + "1 | 0|15", + "" +}; +#else + NETLIB_START(7404) { - register_input("A", m_I); - register_output("Q", m_Q); + register_input("A", m_I[0]); + register_output("Q", m_Q[0]); } NETLIB_RESET(7404) @@ -20,9 +30,10 @@ NETLIB_RESET(7404) NETLIB_UPDATE(7404) { /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; - UINT8 t = (INPLOGIC(m_I)) ^ 1; - OUTLOGIC(m_Q, t, delay[t]); + UINT8 t = (INPLOGIC(m_I[0])) ^ 1; + OUTLOGIC(m_Q[0], t, delay[t]); } +#endif NETLIB_START(7404_dip) { @@ -33,23 +44,23 @@ NETLIB_START(7404_dip) register_sub("5", m_5); register_sub("6", m_6); - register_subalias("1", m_1.m_I); - register_subalias("2", m_1.m_Q); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_Q[0]); - register_subalias("3", m_2.m_I); - register_subalias("4", m_2.m_Q); + register_subalias("3", m_2.m_I[0]); + register_subalias("4", m_2.m_Q[0]); - register_subalias("5", m_3.m_I); - register_subalias("6", m_3.m_Q); + register_subalias("5", m_3.m_I[0]); + register_subalias("6", m_3.m_Q[0]); - register_subalias("8", m_4.m_Q); - register_subalias("9", m_4.m_I); + register_subalias("8", m_4.m_Q[0]); + register_subalias("9", m_4.m_I[0]); - register_subalias("10", m_5.m_Q); - register_subalias("11", m_5.m_I); + register_subalias("10", m_5.m_Q[0]); + register_subalias("11", m_5.m_I[0]); - register_subalias("12", m_6.m_Q); - register_subalias("13", m_6.m_I); + register_subalias("12", m_6.m_Q[0]); + register_subalias("13", m_6.m_I[0]); } NETLIB_UPDATE(7404_dip) diff --git a/src/emu/netlist/devices/nld_7404.h b/src/emu/netlist/devices/nld_7404.h index f74210bc958..0988d1d1e7c 100644 --- a/src/emu/netlist/devices/nld_7404.h +++ b/src/emu/netlist/devices/nld_7404.h @@ -32,11 +32,16 @@ #include "nld_signal.h" +#if 1 && (USE_TRUTHTABLE) +#include "nld_truthtable.h" +NETLIB_TRUTHTABLE(7404, 1, 1, 0); +#else NETLIB_DEVICE(7404, public: - netlist_logic_input_t m_I; - netlist_logic_output_t m_Q; + netlist_logic_input_t m_I[1]; + netlist_logic_output_t m_Q[1]; ); +#endif #define TTL_7404_INVERT(_name, _A) \ NET_REGISTER_DEV(7404, _name) \ diff --git a/src/emu/netlist/devices/nld_7408.c b/src/emu/netlist/devices/nld_7408.c index 4ecdc78469b..70cc8006f67 100644 --- a/src/emu/netlist/devices/nld_7408.c +++ b/src/emu/netlist/devices/nld_7408.c @@ -26,20 +26,20 @@ NETLIB_START(7408_dip) register_sub("3", m_3); register_sub("4", m_4); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); register_subalias("3", m_1.m_Q[0]); - register_subalias("4", m_2.m_i[0]); - register_subalias("5", m_2.m_i[1]); + register_subalias("4", m_2.m_I[0]); + register_subalias("5", m_2.m_I[1]); register_subalias("6", m_2.m_Q[0]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); register_subalias("8", m_3.m_Q[0]); - register_subalias("12", m_4.m_i[0]); - register_subalias("13", m_4.m_i[1]); + register_subalias("12", m_4.m_I[0]); + register_subalias("13", m_4.m_I[1]); register_subalias("11", m_4.m_Q[0]); } diff --git a/src/emu/netlist/devices/nld_7410.c b/src/emu/netlist/devices/nld_7410.c index d920398c68b..05ad04f2b1c 100644 --- a/src/emu/netlist/devices/nld_7410.c +++ b/src/emu/netlist/devices/nld_7410.c @@ -27,20 +27,20 @@ NETLIB_START(7410_dip) register_sub("2", m_2); register_sub("3", m_3); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); - register_subalias("3", m_2.m_i[0]); - register_subalias("4", m_2.m_i[1]); - register_subalias("5", m_2.m_i[2]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); + register_subalias("3", m_2.m_I[0]); + register_subalias("4", m_2.m_I[1]); + register_subalias("5", m_2.m_I[2]); register_subalias("6", m_2.m_Q[0]); register_subalias("8", m_3.m_Q[0]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); - register_subalias("11", m_3.m_i[2]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); + register_subalias("11", m_3.m_I[2]); register_subalias("12", m_1.m_Q[0]); - register_subalias("13", m_1.m_i[2]); + register_subalias("13", m_1.m_I[2]); } NETLIB_UPDATE(7410_dip) diff --git a/src/emu/netlist/devices/nld_7411.c b/src/emu/netlist/devices/nld_7411.c index 0664bd10c5c..3ac56fc11ef 100644 --- a/src/emu/netlist/devices/nld_7411.c +++ b/src/emu/netlist/devices/nld_7411.c @@ -25,20 +25,20 @@ NETLIB_START(7411_dip) register_sub("2", m_2); register_sub("3", m_3); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); - register_subalias("3", m_2.m_i[0]); - register_subalias("4", m_2.m_i[1]); - register_subalias("5", m_2.m_i[2]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); + register_subalias("3", m_2.m_I[0]); + register_subalias("4", m_2.m_I[1]); + register_subalias("5", m_2.m_I[2]); register_subalias("6", m_2.m_Q[0]); register_subalias("8", m_3.m_Q[0]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); - register_subalias("11", m_3.m_i[2]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); + register_subalias("11", m_3.m_I[2]); register_subalias("12", m_1.m_Q[0]); - register_subalias("13", m_1.m_i[2]); + register_subalias("13", m_1.m_I[2]); } NETLIB_UPDATE(7411_dip) diff --git a/src/emu/netlist/devices/nld_7420.c b/src/emu/netlist/devices/nld_7420.c index 59e649fc6f6..e45b91397bc 100644 --- a/src/emu/netlist/devices/nld_7420.c +++ b/src/emu/netlist/devices/nld_7420.c @@ -25,19 +25,19 @@ NETLIB_START(7420_dip) register_sub("1", m_1); register_sub("2", m_2); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); - register_subalias("4", m_1.m_i[2]); - register_subalias("5", m_1.m_i[3]); + register_subalias("4", m_1.m_I[2]); + register_subalias("5", m_1.m_I[3]); register_subalias("6", m_1.m_Q[0]); register_subalias("8", m_2.m_Q[0]); - register_subalias("9", m_2.m_i[0]); - register_subalias("10", m_2.m_i[1]); + register_subalias("9", m_2.m_I[0]); + register_subalias("10", m_2.m_I[1]); - register_subalias("12", m_2.m_i[2]); - register_subalias("13", m_2.m_i[3]); + register_subalias("12", m_2.m_I[2]); + register_subalias("13", m_2.m_I[3]); } diff --git a/src/emu/netlist/devices/nld_7425.c b/src/emu/netlist/devices/nld_7425.c index 59bb899c56b..a46f544297e 100644 --- a/src/emu/netlist/devices/nld_7425.c +++ b/src/emu/netlist/devices/nld_7425.c @@ -12,23 +12,23 @@ NETLIB_START(7425_dip) register_sub("1", m_1); register_sub("2", m_2); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); //register_subalias("3", ); X1 ==> NC - register_subalias("4", m_1.m_i[2]); - register_subalias("5", m_1.m_i[3]); + register_subalias("4", m_1.m_I[2]); + register_subalias("5", m_1.m_I[3]); register_subalias("6", m_1.m_Q[0]); register_subalias("8", m_2.m_Q[0]); - register_subalias("9", m_2.m_i[0]); - register_subalias("10", m_2.m_i[1]); + register_subalias("9", m_2.m_I[0]); + register_subalias("10", m_2.m_I[1]); //register_subalias("11", ); X2 ==> NC - register_subalias("12", m_2.m_i[2]); - register_subalias("13", m_2.m_i[3]); + register_subalias("12", m_2.m_I[2]); + register_subalias("13", m_2.m_I[3]); } diff --git a/src/emu/netlist/devices/nld_7427.c b/src/emu/netlist/devices/nld_7427.c index a363ddd5f3c..6551ee1840b 100644 --- a/src/emu/netlist/devices/nld_7427.c +++ b/src/emu/netlist/devices/nld_7427.c @@ -27,20 +27,20 @@ NETLIB_START(7427_dip) register_sub("2", m_2); register_sub("3", m_3); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); - register_subalias("3", m_2.m_i[0]); - register_subalias("4", m_2.m_i[1]); - register_subalias("5", m_2.m_i[2]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); + register_subalias("3", m_2.m_I[0]); + register_subalias("4", m_2.m_I[1]); + register_subalias("5", m_2.m_I[2]); register_subalias("6", m_2.m_Q[0]); register_subalias("8", m_3.m_Q[0]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); - register_subalias("11", m_3.m_i[2]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); + register_subalias("11", m_3.m_I[2]); register_subalias("12", m_1.m_Q[0]); - register_subalias("13", m_1.m_i[2]); + register_subalias("13", m_1.m_I[2]); } NETLIB_UPDATE(7427_dip) diff --git a/src/emu/netlist/devices/nld_74279.c b/src/emu/netlist/devices/nld_74279.c index 17fbc2e8b22..5740b59c6ed 100644 --- a/src/emu/netlist/devices/nld_74279.c +++ b/src/emu/netlist/devices/nld_74279.c @@ -125,23 +125,23 @@ NETLIB_START(74279_dip) register_sub("3", m_3); register_sub("4", m_4); - register_subalias("1", m_1.m_i[2]); //R - register_subalias("2", m_1.m_i[0]); - register_subalias("3", m_1.m_i[1]); + register_subalias("1", m_1.m_I[2]); //R + register_subalias("2", m_1.m_I[0]); + register_subalias("3", m_1.m_I[1]); register_subalias("4", m_1.m_Q[0]); - register_subalias("5", m_2.m_i[1]); //R - register_subalias("6", m_2.m_i[0]); + register_subalias("5", m_2.m_I[1]); //R + register_subalias("6", m_2.m_I[0]); register_subalias("7", m_2.m_Q[0]); register_subalias("9", m_3.m_Q[0]); - register_subalias("10", m_3.m_i[2]); //R - register_subalias("11", m_3.m_i[0]); - register_subalias("12", m_3.m_i[1]); + register_subalias("10", m_3.m_I[2]); //R + register_subalias("11", m_3.m_I[0]); + register_subalias("12", m_3.m_I[1]); register_subalias("13", m_4.m_Q[0]); - register_subalias("14", m_4.m_i[1]); //R - register_subalias("15", m_4.m_i[0]); + register_subalias("14", m_4.m_I[1]); //R + register_subalias("15", m_4.m_I[0]); } NETLIB_UPDATE(74279_dip) diff --git a/src/emu/netlist/devices/nld_7430.c b/src/emu/netlist/devices/nld_7430.c index 06d73997ad5..24d61d7b8ac 100644 --- a/src/emu/netlist/devices/nld_7430.c +++ b/src/emu/netlist/devices/nld_7430.c @@ -30,17 +30,17 @@ NETLIB_START(7430_dip) { register_sub("1", m_1); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); - register_subalias("3", m_1.m_i[2]); - register_subalias("4", m_1.m_i[3]); - register_subalias("5", m_1.m_i[4]); - register_subalias("6", m_1.m_i[5]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); + register_subalias("3", m_1.m_I[2]); + register_subalias("4", m_1.m_I[3]); + register_subalias("5", m_1.m_I[4]); + register_subalias("6", m_1.m_I[5]); register_subalias("8", m_1.m_Q[0]); - register_subalias("11", m_1.m_i[6]); - register_subalias("12", m_1.m_i[7]); + register_subalias("11", m_1.m_I[6]); + register_subalias("12", m_1.m_I[7]); } NETLIB_UPDATE(7430_dip) diff --git a/src/emu/netlist/devices/nld_7432.c b/src/emu/netlist/devices/nld_7432.c index e3dda241be7..0e176a323fc 100644 --- a/src/emu/netlist/devices/nld_7432.c +++ b/src/emu/netlist/devices/nld_7432.c @@ -27,19 +27,19 @@ NETLIB_START(7432_dip) register_sub("4", m_4); register_subalias("3", m_1.m_Q[0]); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); register_subalias("6", m_2.m_Q[0]); - register_subalias("4", m_2.m_i[0]); - register_subalias("5", m_2.m_i[1]); + register_subalias("4", m_2.m_I[0]); + register_subalias("5", m_2.m_I[1]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); register_subalias("8", m_3.m_Q[0]); - register_subalias("12", m_4.m_i[0]); - register_subalias("13", m_4.m_i[1]); + register_subalias("12", m_4.m_I[0]); + register_subalias("13", m_4.m_I[1]); register_subalias("11", m_4.m_Q[0]); } diff --git a/src/emu/netlist/devices/nld_7437.c b/src/emu/netlist/devices/nld_7437.c index ba078f81d11..f65c9fd016b 100644 --- a/src/emu/netlist/devices/nld_7437.c +++ b/src/emu/netlist/devices/nld_7437.c @@ -26,20 +26,20 @@ NETLIB_START(7437_dip) register_sub("3", m_3); register_sub("4", m_4); - register_subalias("1", m_1.m_i[0]); - register_subalias("2", m_1.m_i[1]); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); register_subalias("3", m_1.m_Q[0]); - register_subalias("4", m_2.m_i[0]); - register_subalias("5", m_2.m_i[1]); + register_subalias("4", m_2.m_I[0]); + register_subalias("5", m_2.m_I[1]); register_subalias("6", m_2.m_Q[0]); - register_subalias("9", m_3.m_i[0]); - register_subalias("10", m_3.m_i[1]); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); register_subalias("8", m_3.m_Q[0]); - register_subalias("12", m_4.m_i[0]); - register_subalias("13", m_4.m_i[1]); + register_subalias("12", m_4.m_I[0]); + register_subalias("13", m_4.m_I[1]); register_subalias("11", m_4.m_Q[0]); } diff --git a/src/emu/netlist/devices/nld_7486.c b/src/emu/netlist/devices/nld_7486.c index e4009b22180..1e8de4bf744 100644 --- a/src/emu/netlist/devices/nld_7486.c +++ b/src/emu/netlist/devices/nld_7486.c @@ -7,11 +7,22 @@ #include "nld_7486.h" +#if (USE_TRUTHTABLE) +nld_7486::truthtable_t nld_7486::m_ttbl; +const char *nld_7486::m_desc[] = { + "A , B | Q ", + "0,0|0|15", + "0,1|1|22", + "1,0|1|22", + "1,1|0|15", + "" +}; +#else NETLIB_START(7486) { - register_input("A", m_A); - register_input("B", m_B); - register_output("Q", m_Q); + register_input("A", m_I[0]); + register_input("B", m_I[1]); + register_output("Q", m_Q[0]); save(NLNAME(m_active)); } @@ -25,10 +36,41 @@ NETLIB_UPDATE(7486) { const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; - UINT8 t = INPLOGIC(m_A) ^ INPLOGIC(m_B); - OUTLOGIC(m_Q, t, delay[t]); + UINT8 t = INPLOGIC(m_I[0]) ^ INPLOGIC(m_I[1]); + OUTLOGIC(m_Q[0], t, delay[t]); } +ATTR_HOT void NETLIB_NAME(7486)::inc_active() +{ + const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; + nl_assert(netlist().use_deactivate()); + if (++m_active == 1) + { + m_I[0].activate(); + m_I[1].activate(); + + netlist_time mt = this->m_I[0].net().time(); + if (this->m_I[1].net().time() > mt) + mt = this->m_I[1].net().time(); + + UINT8 t = INPLOGIC(m_I[0]) ^ INPLOGIC(m_I[1]); + m_Q[0].net().set_Q_time(t, mt + delay[t]); + } +} + +ATTR_HOT void NETLIB_NAME(7486)::dec_active() +{ +#if 1 + nl_assert(netlist().use_deactivate()); + if (--m_active == 0) + { + m_I[0].inactivate(); + m_I[1].inactivate(); + } +#endif +} +#endif + NETLIB_START(7486_dip) { register_sub("1", m_1); @@ -36,21 +78,21 @@ NETLIB_START(7486_dip) register_sub("3", m_3); register_sub("4", m_4); - register_subalias("1", m_1.m_A); - register_subalias("2", m_1.m_B); - register_subalias("3", m_1.m_Q); + register_subalias("1", m_1.m_I[0]); + register_subalias("2", m_1.m_I[1]); + register_subalias("3", m_1.m_Q[0]); - register_subalias("4", m_2.m_A); - register_subalias("5", m_2.m_B); - register_subalias("6", m_2.m_Q); + register_subalias("4", m_2.m_I[0]); + register_subalias("5", m_2.m_I[1]); + register_subalias("6", m_2.m_Q[0]); - register_subalias("9", m_3.m_A); - register_subalias("10", m_3.m_B); - register_subalias("8", m_3.m_Q); + register_subalias("9", m_3.m_I[0]); + register_subalias("10", m_3.m_I[1]); + register_subalias("8", m_3.m_Q[0]); - register_subalias("12", m_4.m_A); - register_subalias("13", m_4.m_B); - register_subalias("11", m_4.m_Q); + register_subalias("12", m_4.m_I[0]); + register_subalias("13", m_4.m_I[1]); + register_subalias("11", m_4.m_Q[0]); } NETLIB_UPDATE(7486_dip) @@ -70,32 +112,3 @@ NETLIB_RESET(7486_dip) m_4.do_reset(); } -ATTR_HOT void NETLIB_NAME(7486)::inc_active() -{ - const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; - nl_assert(netlist().use_deactivate()); - if (++m_active == 1) - { - m_A.activate(); - m_B.activate(); - - netlist_time mt = this->m_A.net().time(); - if (this->m_B.net().time() > mt) - mt = this->m_B.net().time(); - - UINT8 t = INPLOGIC(m_A) ^ INPLOGIC(m_B); - m_Q.net().set_Q_time(t, mt + delay[t]); - } -} - -ATTR_HOT void NETLIB_NAME(7486)::dec_active() -{ -#if 1 - nl_assert(netlist().use_deactivate()); - if (--m_active == 0) - { - m_A.inactivate(); - m_B.inactivate(); - } -#endif -} diff --git a/src/emu/netlist/devices/nld_7486.h b/src/emu/netlist/devices/nld_7486.h index 5febda494f9..e5ad2cb3be7 100644 --- a/src/emu/netlist/devices/nld_7486.h +++ b/src/emu/netlist/devices/nld_7486.h @@ -39,16 +39,20 @@ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) +#if (USE_TRUTHTABLE) +#include "nld_truthtable.h" +NETLIB_TRUTHTABLE(7486, 2, 1, 0); +#else NETLIB_DEVICE(7486, public: - netlist_logic_input_t m_A; - netlist_logic_input_t m_B; - netlist_logic_output_t m_Q; + netlist_logic_input_t m_I[2]; + netlist_logic_output_t m_Q[1]; ATTR_HOT void inc_active(); ATTR_HOT void dec_active(); int m_active; ); +#endif #define TTL_7486_DIP(_name) \ NET_REGISTER_DEV(7486_dip, _name) diff --git a/src/emu/netlist/devices/nld_9312.c b/src/emu/netlist/devices/nld_9312.c index 7ed2c678f38..06b6c3c5f62 100644 --- a/src/emu/netlist/devices/nld_9312.c +++ b/src/emu/netlist/devices/nld_9312.c @@ -128,19 +128,19 @@ NETLIB_START(9312_dip) #if (1 && USE_TRUTHTABLE) - register_subalias("13", m_sub.m_i[0]); - register_subalias("12", m_sub.m_i[1]); - register_subalias("11", m_sub.m_i[2]); - register_subalias("10", m_sub.m_i[3]); + register_subalias("13", m_sub.m_I[0]); + register_subalias("12", m_sub.m_I[1]); + register_subalias("11", m_sub.m_I[2]); + register_subalias("10", m_sub.m_I[3]); - register_subalias("1", m_sub.m_i[4]); - register_subalias("2", m_sub.m_i[5]); - register_subalias("3", m_sub.m_i[6]); - register_subalias("4", m_sub.m_i[7]); - register_subalias("5", m_sub.m_i[8]); - register_subalias("6", m_sub.m_i[9]); - register_subalias("7", m_sub.m_i[10]); - register_subalias("9", m_sub.m_i[11]); + register_subalias("1", m_sub.m_I[4]); + register_subalias("2", m_sub.m_I[5]); + register_subalias("3", m_sub.m_I[6]); + register_subalias("4", m_sub.m_I[7]); + register_subalias("5", m_sub.m_I[8]); + register_subalias("6", m_sub.m_I[9]); + register_subalias("7", m_sub.m_I[10]); + register_subalias("9", m_sub.m_I[11]); register_subalias("15", m_sub.m_Q[0]); // Y register_subalias("14", m_sub.m_Q[1]); // YQ diff --git a/src/emu/netlist/devices/nld_signal.h b/src/emu/netlist/devices/nld_signal.h index f6ac5fd0924..0dc84e7e549 100644 --- a/src/emu/netlist/devices/nld_signal.h +++ b/src/emu/netlist/devices/nld_signal.h @@ -42,7 +42,7 @@ public: register_output("Q", m_Q[0]); for (int i=0; i < _numdev; i++) { - register_input(sIN[i], m_i[i]); + register_input(sIN[i], m_I[i]); } save(NLNAME(m_active)); } @@ -57,13 +57,13 @@ public: { for (int i = 0; i< _numdev; i++) { - this->m_i[i].activate(); - if (INPLOGIC(this->m_i[i]) == _check) + this->m_I[i].activate(); + if (INPLOGIC(this->m_I[i]) == _check) { for (int j = 0; j < i; j++) - this->m_i[j].inactivate(); + this->m_I[j].inactivate(); for (int j = i + 1; j < _numdev; j++) - this->m_i[j].inactivate(); + this->m_I[j].inactivate(); return _check ^ (1 ^ _invert); } } @@ -80,8 +80,8 @@ public: netlist_time mt = netlist_time::zero; for (int i = 0; i< _numdev; i++) { - if (this->m_i[i].net().time() > mt) - mt = this->m_i[i].net().time(); + if (this->m_I[i].net().time() > mt) + mt = this->m_I[i].net().time(); } netlist_sig_t r = process(); m_Q[0].net().set_Q_time(r, mt + times[r]); @@ -94,7 +94,7 @@ public: if (--m_active == 0) { for (int i = 0; i< _numdev; i++) - m_i[i].inactivate(); + m_I[i].inactivate(); } } @@ -107,7 +107,7 @@ public: } public: - netlist_logic_input_t m_i[_numdev]; + netlist_logic_input_t m_I[_numdev]; netlist_logic_output_t m_Q[1]; INT32 m_active; }; diff --git a/src/emu/netlist/devices/nld_truthtable.h b/src/emu/netlist/devices/nld_truthtable.h index 3036178bcfb..615f8d6b9b6 100644 --- a/src/emu/netlist/devices/nld_truthtable.h +++ b/src/emu/netlist/devices/nld_truthtable.h @@ -121,7 +121,7 @@ public: for (unsigned i=0; i < m_NI; i++) { inout[i] = inout[i].trim(); - register_input(inout[i], m_i[i]); + register_input(inout[i], m_I[i]); } for (unsigned i=0; i < m_NO; i++) { @@ -138,7 +138,7 @@ public: if (idx>=0) { //printf("connecting %s %d\n", out[i].cstr(), idx); - connect(m_Q[i], m_i[idx]); + connect(m_Q[i], m_I[idx]); // disable ignore for this inputs altogether. // FIXME: This shouldn't be necessary disabled_ignore |= (1<m_Q[i].net().num_cons()>0) m_active++; @@ -183,26 +183,27 @@ public: for (unsigned i = 0; i < m_NI; i++) { if (!doOUT || (m_ign & (1<m_i[i].net().time() > mt) - mt = this->m_i[i].net().time(); + if (this->m_I[i].net().time() > mt) + mt = this->m_I[i].net().time(); } const UINT32 nstate = state | (has_state ? (m_last_state << m_NI) : 0); - const UINT32 out = m_ttp->m_outs[nstate] & ((1 << m_NO) - 1); - m_ign = m_ttp->m_outs[nstate] >> m_NO; + const UINT32 outstate = m_ttp->m_outs[nstate]; + const UINT32 out = outstate & ((1 << m_NO) - 1); + m_ign = outstate >> m_NO; if (has_state) m_last_state = (state << m_NO) | out; #if 0 for (int i = 0; i < m_NI; i++) if (m_ign & (1 << i)) - m_i[i].inactivate(); + m_I[i].inactivate(); #endif const UINT32 timebase = nstate * m_NO; if (doOUT) @@ -214,10 +215,12 @@ public: for (unsigned i = 0; i < m_NO; i++) m_Q[i].net().set_Q_time((out >> i) & 1, mt + m_ttp->m_timing_nt[m_ttp->m_timing[timebase + i]]); - for (unsigned i = 0; i < m_NI; i++) - if (m_ign & (1 << i)) - m_i[i].inactivate(); - + if (m_NI > 1 || has_state) + { + for (unsigned i = 0; i < m_NI; i++) + if (m_ign & (1 << i)) + m_I[i].inactivate(); + } } ATTR_HOT void update() @@ -238,16 +241,24 @@ public: ATTR_HOT void dec_active() { nl_assert(netlist().use_deactivate()); + /* FIXME: + * Based on current measurements there is no point to disable + * 1 input devices. This should actually be a parameter so that we + * can decide for each individual gate whether it is benefitial to + * ignore deactivation. + */ + if (m_NI < 2) + return; if (has_state == 0) if (--m_active == 0) { for (unsigned i = 0; i< m_NI; i++) - m_i[i].inactivate(); + m_I[i].inactivate(); m_ign = (1<\n", tok.str().cstr()); + } + return tok.str(); +} + double ptokenizer::get_number_double() { token_t tok = get_token(); diff --git a/src/emu/netlist/plib/pparser.h b/src/emu/netlist/plib/pparser.h index 4dbaac67324..f4f8cff2171 100644 --- a/src/emu/netlist/plib/pparser.h +++ b/src/emu/netlist/plib/pparser.h @@ -86,6 +86,7 @@ public: token_t get_token(); pstring get_string(); pstring get_identifier(); + pstring get_identifier_or_number(); double get_number_double(); long get_number_long(); diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c index 8347e263b20..5453129dac1 100644 --- a/src/emu/netlist/tools/nl_convert.c +++ b/src/emu/netlist/tools/nl_convert.c @@ -230,22 +230,43 @@ void nl_convert_spice_t::process_line(const pstring &line) /* check for fourth terminal ... should be numeric net * including "0" or start with "N" (ltspice) */ - // FIXME: we need a is_long method .. ATTR_UNUSED int nval =tt[4].as_long(&cerr); + pstring model; + pstring pins ="CBE"; + if ((!cerr || tt[4].startsWith("N")) && tt.size() > 5) - add_device("QBJT", tt[0], tt[5]); + model = tt[5]; else - add_device("QBJT", tt[0], tt[4]); - add_term(tt[1], tt[0] + ".C"); - add_term(tt[2], tt[0] + ".B"); - add_term(tt[3], tt[0] + ".E"); + model = tt[4]; + pstring_list_t m(model,"{"); + if (m.size() == 2) + { + if (m[1].len() != 4) + fprintf(stderr, "error with model desc %s\n", model.cstr()); + pins = m[1].left(3); + } + add_device("QBJT_EB", tt[0], m[0]); + add_term(tt[1], tt[0] + "." + pins[0]); + add_term(tt[2], tt[0] + "." + pins[1]); + add_term(tt[3], tt[0] + "." + pins[2]); } break; case 'R': - val = get_sp_val(tt[3]); - add_device("RES", tt[0], val); - add_term(tt[1], tt[0] + ".1"); - add_term(tt[2], tt[0] + ".2"); + if (tt[0].startsWith("RV")) + { + val = get_sp_val(tt[4]); + add_device("POT", tt[0], val); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + add_term(tt[3], tt[0] + ".3"); + } + else + { + val = get_sp_val(tt[3]); + add_device("RES", tt[0], val); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + } break; case 'C': val = get_sp_val(tt[3]); @@ -265,11 +286,18 @@ void nl_convert_spice_t::process_line(const pstring &line) else fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr()); break; + case 'I': // Input pin special notation + { + val = get_sp_val(tt[2]); + add_device("ANALOG_INPUT", tt[0], val); + add_term(tt[1], tt[0] + ".Q"); + } + break; case 'D': - // FIXME: Rewrite resistor value add_device("DIODE", tt[0], tt[3]); - add_term(tt[1], tt[0] + ".A"); - add_term(tt[2], tt[0] + ".K"); + /* FIXME ==> does Kicad use different notation from LTSPICE */ + add_term(tt[1], tt[0] + ".K"); + add_term(tt[2], tt[0] + ".A"); break; case 'U': case 'X': From 3db351f5c914a4b904fd03dd3c376e14666579f0 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 7 Jun 2015 02:16:19 +0200 Subject: [PATCH 190/284] Added kidniki sound board netlist to nl_examples. Currently the netlist boils down to a 87x87 matrix. This is due to a total of 6 opamps which all are submodels and thus add their own internal nets. Gauss Seidel iterative solving comes to it's limits. nltool runs this at about 50% speed on my machine. Given the complexity this is quite good. Yet, any m62 game currently will not be playable. Time for a new cpu :-) [Andrew Gardner, Couriersud] --- nl_examples/kidniki.c | 381 ++++++++++++++++++++++++++++++++++++++++++ nl_examples/opamp.c | 14 +- 2 files changed, 392 insertions(+), 3 deletions(-) create mode 100644 nl_examples/kidniki.c diff --git a/nl_examples/kidniki.c b/nl_examples/kidniki.c new file mode 100644 index 00000000000..c03cf00af81 --- /dev/null +++ b/nl_examples/kidniki.c @@ -0,0 +1,381 @@ + +#include "netlist/devices/net_lib.h" +#include "netlist/analog/nld_bjt.h" + +NETLIST_START(dummy) +// EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: SAT 06 JUN 2015 01:06:26 PM CEST +// TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N +// TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0 +// SHEET NAME:/ +// IGNORED O_AUDIO0: O_AUDIO0 49 0 +// .END +SOLVER(Solver, 12000) +PARAM(Solver.ACCURACY, 1e-7) +PARAM(Solver.NR_LOOPS, 50) +PARAM(Solver.GS_LOOPS, 4) +PARAM(Solver.SOR_FACTOR, 1.0) +#if 0 +PARAM(Solver.SOR_FACTOR, 1) +PARAM(Solver.DYNAMIC_TS, 1) +PARAM(Solver.LTE, 1e1) +#endif +//FIXME proper models! +NET_MODEL(".model 2SC945 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)") +NET_MODEL(".model 1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") + +//NET_C(R44.1, XU1.7) + +/* + * Workaround: The simplified opamp model does not correctly + * model the internals of the inputs. + */ + +ANALOG_INPUT(VWORKAROUND, 1.821) +RES(RWORKAROUND, RES_K(27)) +NET_C(VWORKAROUND.Q, RWORKAROUND.1) +NET_C(XU1.6, RWORKAROUND.2) + +ANALOG_INPUT(I_V5, 5) +//ANALOG_INPUT(I_V0, 0) +ALIAS(I_V0.Q, GND) +#if 0 +ANALOG_INPUT(I_SD0, 0) +ANALOG_INPUT(I_BD0, 0) +ANALOG_INPUT(I_CH0, 0) +ANALOG_INPUT(I_OH0, 0) +ANALOG_INPUT(I_SOUNDIC0, 0) +ANALOG_INPUT(I_OKI0, 0) +ANALOG_INPUT(I_SOUND0, 0) +ANALOG_INPUT(I_SINH0, 0) +#else +TTL_INPUT(I_SD0, 1) +TTL_INPUT(I_BD0, 1) +//TTL_INPUT(I_CH0, 1) +CLOCK(I_CH0, 50) +TTL_INPUT(I_OH0, 1) +TTL_INPUT(I_SOUNDIC0, 1) +ANALOG_INPUT(I_OKI0, 0) +TTL_INPUT(I_SOUND0, 1) +TTL_INPUT(I_SINH0, 1) +#endif + +RES(R95, RES_K(330)) +TTL_7404_DIP(XU3) +CAP(C69, CAP_N(10)) +RES(R96, RES_K(150)) +RES(R103, RES_K(470)) +CAP(C73, CAP_N(10)) +RES(R102, RES_K(150)) +RES(R105, RES_K(470)) +CAP(C72, CAP_N(12)) +RES(R106, RES_K(150)) +RES(R108, RES_K(560)) +CAP(C77, CAP_N(12)) +RES(R107, RES_K(150)) +RES(R100, RES_K(560)) +CAP(C67, CAP_N(15)) +RES(R101, RES_K(150)) +RES(R98, RES_K(650)) +CAP(C68, CAP_N(15)) +RES(R97, RES_K(150)) +RES(R65, RES_K(1)) +CAP(C63, CAP_N(1)) +RES(R65_1, RES_K(27)) +RES(R30, RES_K(10)) +RES(R44, RES_K(100)) +CAP(C38, CAP_N(1)) +CAP(C39, CAP_N(1)) +RES(R38, 820) +CAP(C40, CAP_P(12)) +SUBMODEL(LM324_DIP,XU1) +RES(R48_2, RES_K(100)) +CAP(C45, CAP_N(22)) +RES(R54, RES_K(680)) +RES(R55, RES_K(510)) +RES(R45, RES_K(1)) +CAP(C44, CAP_U(1)) +RES(R66, RES_M(1)) +QBJT_EB(Q4, "2SC945") +RES(R70, RES_K(10)) +RES(R63, RES_K(1)) +RES(R69, RES_K(1)) +CAP(C49, CAP_N(3.3)) +CAP(C42, CAP_N(1.2)) +RES(R58, RES_K(39)) +RES(R57, 560) +CAP(C47, CAP_U(1)) +QBJT_EB(Q6, "2SC945") +CAP(C50, CAP_N(22)) +RES(R72, RES_K(100)) +RES(R67, RES_K(100)) +RES(R61, RES_K(100)) +CAP(C51, CAP_N(22)) +RES(R71, RES_K(100)) +RES(R68, RES_K(100)) +RES(R62, RES_K(100)) +QBJT_EB(Q5, "2SC945") +RES(R60, RES_K(39)) +RES(R59, 560) +CAP(C48, CAP_U(1)) +CAP(C43, CAP_N(1.2)) +RES(R46, RES_K(12)) +CAP(C35, CAP_N(1)) +CAP(C34, CAP_N(1)) +RES(R39, RES_K(22)) +RES(R41, RES_K(10)) +RES(R32, RES_K(4.7)) +CAP(C31, CAP_N(470)) +RES(R40, RES_K(10)) +RES(R27, RES_K(6.8)) +CAP(C28, CAP_U(1)) +RES(R28, RES_K(150)) +RES(R29, RES_K(2.7)) +RES(R31, RES_K(5.1)) +RES(R42, RES_K(150)) +RES(R51, RES_K(150)) +CAP(C36, CAP_N(6.5)) +CAP(C32, CAP_N(3.3)) +CAP(C41, CAP_U(1)) +RES(R43, 470) +SUBMODEL(LM358_DIP,XU2) +RES(R50, RES_K(22)) +CAP(C56, CAP_N(6.8)) +RES(R75, RES_K(10)) +RES(R74, RES_K(10)) +CAP(C53, CAP_N(27)) +CAP(C52, CAP_N(27)) +RES(R73, RES_K(10)) +RES(R76, RES_K(10)) +RES(R78, RES_K(3.3)) +RES(R77, RES_K(2.2)) +CAP(C58, CAP_U(47)) +RES(R49, RES_K(10)) +RES(R48, 470) +QBJT_EB(Q9, "2SC945") +QBJT_EB(Q10, "2SC945") +RES(R84, RES_K(1)) +CAP(C61, CAP_N(22)) +CAP(C60, CAP_N(22)) +RES(R87, RES_K(68)) +RES(R86, RES_K(10)) +RES(R93, RES_K(1)) +RES(R85, RES_M(2.2)) +CAP(C64, CAP_N(68)) +CAP(C65, CAP_N(68)) +CAP(C66, CAP_N(68)) +CAP(C76, CAP_N(68)) +RES(R94, RES_K(22)) +RES(R119, RES_K(22)) +RES(R104, RES_K(22)) +RES(R53, RES_K(100)) +RES(R34, RES_K(100)) +RES(R52, RES_K(100)) +CAP(C37, CAP_N(22)) +RES(R83, RES_K(12)) +RES(R81, 220) +RES(R82, RES_M(2.2)) +RES(R92, RES_K(22)) +RES(R89, RES_K(22)) +CAP(C62, CAP_N(6.8)) +CAP(C57, CAP_N(6.8)) +CAP(C59, CAP_N(6.8)) +RES(R90, RES_K(390)) +CAP(C33, CAP_U(1)) +RES(R37, RES_K(47)) +QBJT_EB(Q3, "2SC945") +RES(R35, RES_K(100)) +RES(R36, RES_K(100)) +RES(R91, RES_K(100)) +CAP(C70, CAP_N(22)) +DIODE(D4, "1S1588") +DIODE(D5, "1S1588") +DIODE(D3, "1S1588") +POT(RV1, RES_K(50)) +QBJT_EB(Q7, "2SC945") +NET_C(R95.1, XU3.2, R96.2) +NET_C(R95.2, XU3.1, C69.1) +NET_C(XU3.3, R103.2, C73.1) +NET_C(XU3.4, R103.1, R102.2) +NET_C(XU3.5, R105.2, C72.1) +NET_C(XU3.6, R105.1, R106.2) +NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1, R77.2, C58.1, R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) +NET_C(XU3.8, R108.1, R107.2) +NET_C(XU3.9, R108.2, C77.1) +NET_C(XU3.10, R100.1, R101.2) +NET_C(XU3.11, R100.2, C67.1) +NET_C(XU3.12, R98.1, R97.2) +NET_C(XU3.13, R98.2, C68.1) +NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, R78.1, R86.1, R83.1, Q3.C, I_V5.Q) +NET_C(R96.1, R102.1, R106.1, R107.1, R101.1, R97.1, R65.1, C63.2) +NET_C(C63.1, R65_1.2) +NET_C(R65_1.1, R44.2, C38.2, C40.2, XU1.6) +NET_C(R30.1, R41.1, R40.1, R76.2, R78.2, R77.1, C58.2) +NET_C(R30.2, XU1.5) +NET_C(R44.1, C39.1, C40.1, R48_2.2) +NET_C(C38.1, C39.2, R38.1) +NET_C(XU1.1, XU1.2, R39.1, R32.2) +NET_C(XU1.3, C34.1, R41.2) +NET_C(XU1.7, R45.2) +NET_C(XU1.8, XU1.9, R31.2, C36.2) +NET_C(XU1.10, R42.1, C32.2) +NET_C(XU1.12, C49.1, C31.1, R40.2, C61.1, C60.1) +NET_C(XU1.13, R27.1, R28.2) +NET_C(XU1.14, R28.1, R29.2, I_SINH0.Q) +NET_C(R48_2.1, C45.2, R54.1) +NET_C(C45.1, R55.1, Q7.B) +NET_C(R55.2, R90.2, C33.2, R37.1, Q3.E) +NET_C(R45.1, C44.2) +NET_C(C44.1, R66.2, Q4.B) +NET_C(Q4.C, C42.1, C43.1, R46.1, C35.2, D4.K, D5.K) +NET_C(R70.2, R69.2, Q7.C) +NET_C(R63.1, Q7.E) +NET_C(R69.1, C49.2) +NET_C(C42.2, R58.1, D5.A) +NET_C(R58.2, R57.1, C47.1) +NET_C(R57.2, Q6.E) +NET_C(Q6.B, R61.1) +NET_C(C50.1, R67.1, R61.2) +NET_C(C50.2, R72.1, I_OH0.Q) +NET_C(C51.1, R68.1, R62.2) +NET_C(C51.2, R71.1, I_CH0.Q) +NET_C(R62.1, Q5.B) +NET_C(Q5.E, R59.2) +NET_C(R60.1, C43.2, D4.A) +NET_C(R60.2, R59.1, C48.1) +NET_C(C35.1, C34.2, R39.2) +NET_C(R32.1, C31.2) +NET_C(R27.2, C28.2) +NET_C(R29.1, R31.1, R50.2, R49.1, RV1.1) +NET_C(R42.2, R51.1, C36.1) +NET_C(R51.2, C41.1) +NET_C(C41.2, R43.1, I_SOUNDIC0.Q) +NET_C(XU2.1, XU2.2, R73.1) +NET_C(XU2.3, R76.1, I_OKI0.Q) +NET_C(XU2.5, C56.2, R75.1) +NET_C(XU2.6, XU2.7, R50.1, C53.2) +NET_C(R75.2, R74.1, C53.1) +NET_C(R74.2, C52.2, R73.2) +NET_C(R49.2, R48.1, I_SOUND0.Q) +NET_C(Q9.E, R81.1) +NET_C(Q9.C, R84.2, R83.2, R82.1, C59.1) +NET_C(Q9.B, R82.2, C62.1) +NET_C(Q10.E, R93.1) +NET_C(Q10.C, R87.2, R86.2, R85.1, C76.1) +NET_C(Q10.B, R85.2, C64.1) +NET_C(R84.1, C61.2) +NET_C(C60.2, R87.1) +NET_C(C64.2, C65.1, R94.1, D3.K) +NET_C(C65.2, C66.1, R119.1) +NET_C(C66.2, C76.2, R104.1) +NET_C(R53.1, R52.2, C37.1) +NET_C(R34.1, C37.2, I_BD0.Q) +NET_C(R52.1, D3.A) +NET_C(R92.1, C62.2, C57.1) +NET_C(R89.1, C57.2, C59.2, R90.1) +NET_C(Q3.B, R35.1) +NET_C(R35.2, R36.2, C70.1) +NET_C(R91.2, C70.2, I_SD0.Q) +NETLIST_END() + + + +NETLIST_START(opamp) + + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * Bandwidth 1Mhz + * + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G1.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... + + ALIAS(GND, EBUF.ON) // GND terminal + ALIAS(VCC, DUMMY.I) // VCC terminal + DUMMY_INPUT(DUMMY) + + /* The opamp model */ + + VCCS(G1) + PARAM(G1.RI, RES_K(1000)) + PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000 + RES(RP1, 1000) + CAP(CP1, 1.59e-5) // <== change to 1.59e-3 for 10Khz bandwidth + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) + +// NET_C(EBUF.ON, GND) + + NET_C(G1.ON, GND) + NET_C(RP1.2, GND) + NET_C(CP1.2, GND) + NET_C(EBUF.IN, GND) + + NET_C(RP1.1, G1.OP) + NET_C(CP1.1, RP1.1) + + DIODE(DP,"1N914") + DIODE(DN,"1N914") + + NET_C(DP.K, VCC) + NET_C(DP.A, DN.K, RP1.1) + NET_C(DN.A, GND) + + NET_C(EBUF.IP, RP1.1) + +NETLIST_END() + +NETLIST_START(LM324_DIP) + SUBMODEL(opamp, op1) + SUBMODEL(opamp, op2) + SUBMODEL(opamp, op3) + SUBMODEL(opamp, op4) + + ALIAS( 1, op1.OUT) + ALIAS( 2, op1.MINUS) + ALIAS( 3, op1.PLUS) + + ALIAS( 7, op2.OUT) + ALIAS( 6, op2.MINUS) + ALIAS( 5, op2.PLUS) + + ALIAS( 8, op3.OUT) + ALIAS( 9, op3.MINUS) + ALIAS(10, op3.PLUS) + + ALIAS(14, op4.OUT) + ALIAS(13, op4.MINUS) + ALIAS(12, op4.PLUS) + + NET_C(op1.GND, op2.GND, op3.GND, op4.GND) + NET_C(op1.VCC, op2.VCC, op3.VCC, op4.VCC) + + ALIAS(11, op1.GND) + ALIAS( 4, op1.VCC) +NETLIST_END() + +NETLIST_START(LM358_DIP) + SUBMODEL(opamp, op1) + SUBMODEL(opamp, op2) + + ALIAS( 1, op1.OUT) + ALIAS( 2, op1.MINUS) + ALIAS( 3, op1.PLUS) + + ALIAS( 7, op2.OUT) + ALIAS( 6, op2.MINUS) + ALIAS( 5, op2.PLUS) + + + NET_C(op1.GND, op2.GND) + NET_C(op1.VCC, op2.VCC) + + ALIAS( 4, op1.GND) + ALIAS( 8, op1.VCC) +NETLIST_END() diff --git a/nl_examples/opamp.c b/nl_examples/opamp.c index 0073ddb35b0..01db8fb4383 100644 --- a/nl_examples/opamp.c +++ b/nl_examples/opamp.c @@ -16,14 +16,20 @@ NETLIST_START(main) //PARAM(Solver.CONVERG, 1.0) //PARAM(Solver.GS_LOOPS, 30) + // Tie up +5 to opamps thought it's not currently needed + // Stay compatible + ANALOG_INPUT(V5, 5) + NET_C(op.VCC, V5) + NET_C(op1.VCC, V5) + /* Opamp wired as impedance changer */ - SUBMODEL(op, opamp) + SUBMODEL(opamp, op) NET_C(op.GND, GND) NET_C(op.PLUS, clk) NET_C(op.MINUS, op.OUT) - SUBMODEL(op1, opamp) + SUBMODEL(opamp, op1) /* Wired as inverting amplifier connected to output of first opamp */ RES(R1, 100000) @@ -41,7 +47,7 @@ NETLIST_START(main) NET_C(RL.2, GND) NET_C(RL.1, op1.OUT) - LOG(logX, op1.OUT) + //LOG(logX, op1.OUT) //LOG(logY, clk) NETLIST_END() @@ -62,6 +68,8 @@ NETLIST_START(opamp) ALIAS(OUT, EBUF.OP) // Opamp output ... ALIAS(GND, EBUF.ON) // GND terminal + ALIAS(VCC, DUMMY.I) // VCC terminal + DUMMY_INPUT(DUMMY) /* The opamp model */ From cf7eb6a3963fd7d3b1052015dab919410d5f8ae0 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 7 Jun 2015 03:19:14 +0200 Subject: [PATCH 191/284] i8089: add support for DMA_WAIT_FOR_SOURCE_DRQ --- src/emu/cpu/i8089/i8089_channel.c | 16 ++++++++++++---- src/emu/cpu/i8089/i8089_channel.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/emu/cpu/i8089/i8089_channel.c b/src/emu/cpu/i8089/i8089_channel.c index 171a7ce0d24..eb5d49823c7 100644 --- a/src/emu/cpu/i8089/i8089_channel.c +++ b/src/emu/cpu/i8089/i8089_channel.c @@ -51,10 +51,13 @@ const device_type I8089_CHANNEL = &device_creator; i8089_channel::i8089_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, I8089_CHANNEL, "Intel 8089 I/O Channel", tag, owner, clock, "i8089_channel", __FILE__), m_write_sintr(*this), + m_iop(NULL), m_icount(0), m_xfer_pending(false), m_dma_value(0), - m_dma_state(DMA_IDLE) + m_dma_state(DMA_IDLE), + m_drq(0), + m_prio(PRIO_IDLE) { } @@ -74,6 +77,7 @@ void i8089_channel::device_start() save_item(NAME(m_xfer_pending)); save_item(NAME(m_dma_value)); save_item(NAME(m_dma_state)); + save_item(NAME(m_drq)); save_item(NAME(m_prio)); for (int i = 0; i < ARRAY_LENGTH(m_r); i++) @@ -246,11 +250,13 @@ int i8089_channel::execute_run() break; case DMA_WAIT_FOR_SOURCE_DRQ: - fatalerror("%s('%s'): wait for source drq not supported\n", shortname(), tag()); + if (m_drq) + m_dma_state = DMA_FETCH; + break; case DMA_FETCH: if (VERBOSE_DMA) - logerror("%s('%s'): entering state: DMA_FETCH", shortname(), tag()); + logerror("%s('%s'): entering state: DMA_FETCH\n", shortname(), tag()); // source is 16-bit? if (BIT(m_r[PSW].w, 1)) @@ -834,5 +840,7 @@ WRITE_LINE_MEMBER( i8089_channel::ext_w ) WRITE_LINE_MEMBER( i8089_channel::drq_w ) { if (VERBOSE) - logerror("%s('%s'): ext_w: %d\n", shortname(), tag(), state); + logerror("%s('%s'): drq_w: %d\n", shortname(), tag(), state); + + m_drq = state; } diff --git a/src/emu/cpu/i8089/i8089_channel.h b/src/emu/cpu/i8089/i8089_channel.h index 9b4034603e5..7c1f5a6e445 100644 --- a/src/emu/cpu/i8089/i8089_channel.h +++ b/src/emu/cpu/i8089/i8089_channel.h @@ -186,6 +186,7 @@ private: bool m_xfer_pending; UINT16 m_dma_value; int m_dma_state; + bool m_drq; // dma state enum From 244b8d315df563bccaf01518396450e7795f26ff Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 7 Jun 2015 03:20:28 +0200 Subject: [PATCH 192/284] apridisk: update for new floppy system --- src/lib/formats/apridisk.c | 271 +++++++++++++------------------------ src/lib/formats/apridisk.h | 48 ++++++- 2 files changed, 140 insertions(+), 179 deletions(-) diff --git a/src/lib/formats/apridisk.c b/src/lib/formats/apridisk.c index 46dfaf96c36..b19e2c26bd7 100644 --- a/src/lib/formats/apridisk.c +++ b/src/lib/formats/apridisk.c @@ -2,226 +2,147 @@ // copyright-holders:Dirk Best /*************************************************************************** - APRIDISK disk image format + APRIDISK + + Disk image format for the ACT Apricot ***************************************************************************/ -#include "emu.h" // fatalerror -#include "apridisk.h" +#include "emu.h" #include "imageutl.h" -#include "coretmpl.h" +#include "apridisk.h" -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -#define APR_HEADER_SIZE 128 - -/* sector types */ -#define APR_DELETED 0xe31d0000 -#define APR_MAGIC 0xe31d0001 -#define APR_COMMENT 0xe31d0002 -#define APR_CREATOR 0xe31d0003 - -/* compression type */ -#define APR_UNCOMPRESSED 0x9e90 -#define APR_COMPRESSED 0x3e5a - -static const char *apr_magic = "ACT Apricot disk image\x1a\x04"; - - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -struct apr_sector +apridisk_format::apridisk_format() { - int head; - int track; - int sector; - UINT8 data[512]; -}; - -struct apr_tag -{ - int heads; - int tracks; - int sectors_per_track; - struct apr_sector sectors[2880]; - char *comment; -}; - - -/*************************************************************************** - IMPLEMENTATION -***************************************************************************/ - -/* sector format: - * - * 00-03: sector type - * 04-05: compression type - * 06-07: header size - * 08-11: data size - * 12-13: track - * 14: head - * 15: sector - */ - -static floperr_t apr_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) -{ - struct apr_tag *tag = (apr_tag *)floppy_tag(floppy); -// printf("apr_read_sector %d %d %d\n", head, track, sector); - memcpy(buffer, tag->sectors[head * track * sector].data, buflen); - return FLOPPY_ERROR_SUCCESS; } -static floperr_t apr_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) +const char *apridisk_format::name() const { - struct apr_tag *tag = (apr_tag *)floppy_tag(floppy); -// printf("apr_read_indexed_sector %d %d %d\n", head, track, sector); - memcpy(buffer, tag->sectors[head * track * sector].data, buflen); - return FLOPPY_ERROR_SUCCESS; + return "apridisk"; } -/* sector length is always 512 byte */ -static floperr_t apr_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +const char *apridisk_format::description() const { - *sector_length = 512; - return FLOPPY_ERROR_SUCCESS; + return "APRIDISK disk image"; } -static int apr_get_heads_per_disk(floppy_image_legacy *floppy) +const char *apridisk_format::extensions() const { - struct apr_tag *tag = (apr_tag *)floppy_tag(floppy); - return tag->heads; + return "dsk"; } -static int apr_get_tracks_per_disk(floppy_image_legacy *floppy) -{ - struct apr_tag *tag = (apr_tag *)floppy_tag(floppy); - return tag->tracks; -} - -static floperr_t apr_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) -{ - struct apr_tag *tag = (apr_tag *)floppy_tag(floppy); - -// printf("apr_get_indexed_sector_info %d %d %d\n", head, track, sector_index); - - /* sanity checks */ - if (head < 0 || head > (tag->heads - 1)) return FLOPPY_ERROR_SEEKERROR; - if (track < 0 || track > (tag->tracks - 1)) return FLOPPY_ERROR_SEEKERROR; - if (sector_index < 0 || sector_index > (tag->sectors_per_track - 1)) return FLOPPY_ERROR_SEEKERROR; - - if (cylinder) *cylinder = tag->sectors[head * track * sector_index].track; - if (side) *side = tag->sectors[head * track * sector_index].head; - if (sector) *sector = tag->sectors[head * track * sector_index].sector; - if (sector_length) *sector_length = 512; - - return FLOPPY_ERROR_SUCCESS; -} - -FLOPPY_IDENTIFY( apridisk_identify ) +int apridisk_format::identify(io_generic *io, UINT32 form_factor) { UINT8 header[APR_HEADER_SIZE]; + io_generic_read(io, header, 0, APR_HEADER_SIZE); - /* get header */ - floppy_image_read(floppy, &header, 0, sizeof(header)); + const char magic[] = "ACT Apricot disk image\x1a\x04"; - /* look for the magic string */ - if (memcmp(header, apr_magic, sizeof(*apr_magic)) == 0) - *vote = 100; + if (memcmp(header, magic, sizeof(magic) - 1) == 0) + return 100; else - *vote = 0; - - return FLOPPY_ERROR_SUCCESS; + return 0; } -FLOPPY_CONSTRUCT( apridisk_construct ) +bool apridisk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) { - struct FloppyCallbacks *callbacks; - struct apr_tag *tag; + desc_pc_sector sectors[80][2][18]; + UINT8 sector_data[MAX_SECTORS * SECTOR_SIZE]; + UINT8 *data_ptr = sector_data; + int track_count = 0, head_count = 0, sector_count = 0; - int cur_sector = 0; - UINT8 sector_header[16]; - UINT64 pos = 128; - UINT32 type; + UINT64 file_size = io_generic_size(io); + UINT64 file_offset = APR_HEADER_SIZE; - tag = (apr_tag *)floppy_create_tag(floppy, sizeof(struct apr_tag)); - - if (!tag) - return FLOPPY_ERROR_OUTOFMEMORY; - - tag->heads = 0; - tag->tracks = 0; - tag->sectors_per_track = 0; - - floppy_image_read(floppy, §or_header, pos, 16); - type = pick_integer_le(§or_header, 0, 4); - - while (type == APR_DELETED || type == APR_MAGIC || type == APR_COMMENT || type == APR_CREATOR) + while (file_offset < file_size) { + // read sector header + UINT8 sector_header[16]; + io_generic_read(io, sector_header, file_offset, 16); + + UINT32 type = pick_integer_le(§or_header, 0, 4); UINT16 compression = pick_integer_le(§or_header, 4, 2); UINT16 header_size = pick_integer_le(§or_header, 6, 2); UINT32 data_size = pick_integer_le(§or_header, 8, 4); - tag->sectors[cur_sector].head = pick_integer_le(§or_header, 12, 1); - tag->sectors[cur_sector].sector = pick_integer_le(§or_header, 13, 1); - tag->sectors[cur_sector].track = pick_integer_le(§or_header, 14, 1); + file_offset += header_size; - pos += header_size; - - if (type == APR_MAGIC) + switch (type) { - if (compression == APR_UNCOMPRESSED) + case APR_SECTOR: + UINT8 head = pick_integer_le(§or_header, 12, 1); + UINT8 sector = pick_integer_le(§or_header, 13, 1); + UINT8 track = (UINT8) pick_integer_le(§or_header, 14, 2); + + track_count = MAX(track_count, track); + head_count = MAX(head_count, head); + sector_count = MAX(sector_count, sector); + + // build sector info + sectors[track][head][sector - 1].head = head; + sectors[track][head][sector - 1].sector = sector; + sectors[track][head][sector - 1].track = track; + sectors[track][head][sector - 1].size = SECTOR_SIZE >> 8; + sectors[track][head][sector - 1].actual_size = SECTOR_SIZE; + sectors[track][head][sector - 1].deleted = false; + sectors[track][head][sector - 1].bad_crc = false; + + // read sector data + switch (compression) { - floppy_image_read(floppy, &tag->sectors[cur_sector].data, pos, data_size); + case APR_COMPRESSED: + { + UINT8 comp[3]; + io_generic_read(io, comp, file_offset, 3); + UINT16 length = pick_integer_le(comp, 0, 2); - } - else if (compression == APR_COMPRESSED) - { - dynamic_buffer buffer(data_size); - UINT16 length; - UINT8 value; + if (length != SECTOR_SIZE) + fatalerror("apridisk_format: Invalid compression length %04x\n", length); - floppy_image_read(floppy, &buffer[0], pos, data_size); - - length = pick_integer_le(&buffer[0], 0, 2); - value = pick_integer_le(&buffer[0], 2, 1); - - /* not sure if this is possible */ - if (length != 512) { - fatalerror("Compression unsupported\n"); + memset(data_ptr, comp[2], SECTOR_SIZE); } + break; - memset(&tag->sectors[cur_sector].data, value, length); + case APR_UNCOMPRESSED: + io_generic_read(io, data_ptr, file_offset, SECTOR_SIZE); + break; + + default: + fatalerror("apridisk_format: Invalid compression %04x\n", compression); } - else - return FLOPPY_ERROR_INVALIDIMAGE; - tag->heads = MAX(tag->sectors[cur_sector].head, tag->heads); - tag->tracks = MAX(tag->sectors[cur_sector].track, tag->tracks); - tag->sectors_per_track = MAX(tag->sectors[cur_sector].sector, tag->sectors_per_track); + sectors[track][head][sector - 1].data = data_ptr; + data_ptr += SECTOR_SIZE; + + break; + } - /* seek to next sector */ - pos += data_size; - cur_sector++; - - floppy_image_read(floppy, §or_header, pos, 16); - type = pick_integer_le(§or_header, 0, 4); + file_offset += data_size; } - tag->heads++; - tag->tracks++; + // track/head index are zero-based, so increase the final count by 1 + track_count++; + head_count++; - callbacks = floppy_callbacks(floppy); - callbacks->read_sector = apr_read_sector; - callbacks->read_indexed_sector = apr_read_indexed_sector; - callbacks->get_sector_length = apr_get_sector_length; - callbacks->get_heads_per_disk = apr_get_heads_per_disk; - callbacks->get_tracks_per_disk = apr_get_tracks_per_disk; - callbacks->get_indexed_sector_info = apr_get_indexed_sector_info; + int cell_count = (sector_count == 18 ? 200000 : 100000); - return FLOPPY_ERROR_SUCCESS; + // now build our final track info + for (int track = 0; track < track_count; track++) + for (int head = 0; head < head_count; head++) + build_pc_track_mfm(track, head, image, cell_count, sector_count, sectors[track][head], 84, 80, 50, 22); + + return true; } + +bool apridisk_format::save(io_generic *io, floppy_image *image) +{ + return false; +} + +bool apridisk_format::supports_save() const +{ + return false; +} + +const floppy_format_type FLOPPY_APRIDISK_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/apridisk.h b/src/lib/formats/apridisk.h index d33743d8711..6eb5fc4617e 100644 --- a/src/lib/formats/apridisk.h +++ b/src/lib/formats/apridisk.h @@ -2,16 +2,56 @@ // copyright-holders:Dirk Best /*************************************************************************** - APRIDISK disk image format + APRIDISK + + Disk image format for the ACT Apricot ***************************************************************************/ +#pragma once + #ifndef __APRIDISK_H__ #define __APRIDISK_H__ #include "flopimg.h" -FLOPPY_IDENTIFY( apridisk_identify ); -FLOPPY_CONSTRUCT( apridisk_construct ); +class apridisk_format : public floppy_image_format_t +{ +public: + apridisk_format(); -#endif /* __APRIDISK_H__ */ + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + + virtual int identify(io_generic *io, UINT32 form_factor); + virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image); + virtual bool save(io_generic *io, floppy_image *image); + virtual bool supports_save() const; + +private: + static const int APR_HEADER_SIZE = 128; + + // sector types + enum + { + APR_DELETED = 0xe31d0000, + APR_SECTOR = 0xe31d0001, + APR_COMMENT = 0xe31d0002, + APR_CREATOR = 0xe31d0003 + }; + + // compression types + enum + { + APR_UNCOMPRESSED = 0x9e90, + APR_COMPRESSED = 0x3e5a + }; + + static const int SECTOR_SIZE = 512; + static const int MAX_SECTORS = 2880; // enough for a hd disk image +}; + +extern const floppy_format_type FLOPPY_APRIDISK_FORMAT; + +#endif // __APRIDISK_H__ From 0cf27a8f7dd959e93daff61851166e9830b7195e Mon Sep 17 00:00:00 2001 From: cracyc Date: Sat, 6 Jun 2015 21:00:35 -0500 Subject: [PATCH 193/284] m20: improve keyboard [Carl] --- scripts/target/mame/mess.lua | 1 + src/mess/drivers/m20.c | 124 ++----------------- src/mess/machine/m20_kbd.c | 225 +++++++++++++++++++++++++++++++++++ src/mess/machine/m20_kbd.h | 26 ++++ 4 files changed, 265 insertions(+), 111 deletions(-) create mode 100644 src/mess/machine/m20_kbd.c create mode 100644 src/mess/machine/m20_kbd.h diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index e414158ea77..83525789969 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -1880,6 +1880,7 @@ files { createMESSProjects(_target, _subtarget, "olivetti") files { MAME_DIR .. "src/mess/drivers/m20.c", + MAME_DIR .. "src/mess/machine/m20_kbd.c", MAME_DIR .. "src/mess/drivers/m24.c", MAME_DIR .. "src/mess/machine/m24_kbd.c", MAME_DIR .. "src/mess/machine/m24_z8000.c" diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c index 12b2a212a56..b55a9565be0 100644 --- a/src/mess/drivers/m20.c +++ b/src/mess/drivers/m20.c @@ -47,10 +47,8 @@ E I1 Vectored interrupt error #include "machine/pit8253.h" #include "machine/pic8259.h" #include "formats/m20_dsk.h" - -#include "machine/keyboard.h" - -#define KEYBOARD_TAG "keyboard" +#include "machine/m20_kbd.h" +#include "bus/rs232/rs232.h" class m20_state : public driver_device { @@ -91,12 +89,9 @@ public: DECLARE_WRITE16_MEMBER(m20_i8259_w); DECLARE_READ16_MEMBER(port21_r); DECLARE_WRITE16_MEMBER(port21_w); - DECLARE_WRITE_LINE_MEMBER(pic_irq_line_w); DECLARE_WRITE_LINE_MEMBER(tty_clock_tick_w); DECLARE_WRITE_LINE_MEMBER(kbd_clock_tick_w); DECLARE_WRITE_LINE_MEMBER(timer_tick_w); - DECLARE_WRITE_LINE_MEMBER(kbd_tx); - DECLARE_WRITE8_MEMBER(kbd_put); private: bool m_kbrecv_in_progress; @@ -107,13 +102,9 @@ private: void install_memory(); public: - DECLARE_DRIVER_INIT(m20); - virtual void video_start(); UINT32 screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(kbd_rxrdy_int); DECLARE_FLOPPY_FORMATS( floppy_formats ); - IRQ_CALLBACK_MEMBER(m20_irq_callback); }; @@ -122,10 +113,6 @@ public: #define PIXEL_CLOCK XTAL_4_433619MHz -void m20_state::video_start() -{ -} - UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,i; @@ -154,39 +141,6 @@ UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, return 0; } -/* TODO: correct hookup for keyboard, keyboard uses 8048 */ - -WRITE_LINE_MEMBER(m20_state::kbd_tx) -{ - UINT8 data; - - if (m_kbrecv_in_progress) { - m_kbrecv_bitcount++; - m_kbrecv_data = (m_kbrecv_data >> 1) | (state ? (1<<10) : 0); - if (m_kbrecv_bitcount == 11) { - data = (m_kbrecv_data >> 1) & 0xff; -// printf ("0x%02X received by keyboard\n", data); - switch (data) { - case 0x03: m_kbdi8251->receive_character(2); printf ("sending 2 back from kb...\n"); break; - case 0x0a: break; - case 0x80: m_kbdi8251->receive_character(0x80); printf ("sending 0x80 back from kb...\n");break; - default: logerror("m20: keyboard hack got unexpected %02x\n", data); break; - } - m_kbrecv_in_progress = 0; - } - } - else - { - if (state == 0) - { - m_kbrecv_in_progress = 1; - m_kbrecv_bitcount = 1; - m_kbrecv_data = state ? (1<<10) : 0; - } - } -} - - /* port21 = 0x21 !TTL latch ! (see hw1 document, fig 2-33, pg 2-47) @@ -253,20 +207,6 @@ WRITE16_MEMBER(m20_state::m20_i8259_w) m_i8259->write(space, offset, (data>>1)); } -WRITE_LINE_MEMBER( m20_state::pic_irq_line_w ) -{ - if (state) - { - //printf ("PIC raised VI\n"); - m_maincpu->set_input_line(1, ASSERT_LINE); - } - else - { - //printf ("PIC lowered VI\n"); - m_maincpu->set_input_line(1, CLEAR_LINE); - } -} - WRITE_LINE_MEMBER( m20_state::tty_clock_tick_w ) { m_ttyi8251->write_txc(state); @@ -795,13 +735,6 @@ static ADDRESS_MAP_START(m20_apb_io, AS_IO, 16, m20_state) ADDRESS_MAP_END #endif -static INPUT_PORTS_START( m20 ) -INPUT_PORTS_END - -DRIVER_INIT_MEMBER(m20_state,m20) -{ -} - IRQ_CALLBACK_MEMBER(m20_state::m20_irq_callback) { if (! irqline) @@ -832,41 +765,6 @@ void m20_state::machine_reset() } -WRITE_LINE_MEMBER(m20_state::kbd_rxrdy_int) -{ - m_i8259->ir4_w(state); -} - -static unsigned char kbxlat[] = -{ - 0x00, '\\', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', - '4', '5', '6', '7', '8', '9', '-', '^', '@', '[', ';', ':', ']', ',', '.', '/', - 0x00, '<', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', - 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', '!', '"', '#', - '$', '%', '&', '\'','(', ')', '=', 'x', 'x', '{', '+', '*', '}' -}; - -WRITE8_MEMBER( m20_state::kbd_put ) -{ - if (data) { - if (data == 0xd) data = 0xc1; - else if (data == 0x20) data = 0xc0; - else if (data == 8) data = 0x69; /* ^H */ - else if (data == 3) data = 0x64; /* ^C */ - else { - int i; - for (i = 0; i < sizeof(kbxlat); i++) - if (data == kbxlat[i]) { - data = i; - break; - } - } - printf("kbd_put called with 0x%02X\n", data); - m_kbdi8251->receive_character(data); - } -} - static SLOT_INTERFACE_START( m20_floppies ) SLOT_INTERFACE( "5dd", FLOPPY_525_DD ) SLOT_INTERFACE_END @@ -875,6 +773,10 @@ FLOPPY_FORMATS_MEMBER( m20_state::floppy_formats ) FLOPPY_M20_FORMAT FLOPPY_FORMATS_END +static SLOT_INTERFACE_START(keyboard) + SLOT_INTERFACE("m20", M20_KEYBOARD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( m20, m20_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", Z8001, MAIN_CLOCK) @@ -917,8 +819,8 @@ static MACHINE_CONFIG_START( m20, m20_state ) MCFG_DEVICE_ADD("ppi8255", I8255A, 0) MCFG_DEVICE_ADD("i8251_1", I8251, 0) - MCFG_I8251_TXD_HANDLER(WRITELINE(m20_state, kbd_tx)) - MCFG_I8251_RXRDY_HANDLER(WRITELINE(m20_state, kbd_rxrdy_int)) + MCFG_I8251_TXD_HANDLER(DEVWRITELINE("kbd", rs232_port_device, write_txd)) + MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE("i8259", pic8259_device, ir4_w)) MCFG_DEVICE_ADD("i8251_2", I8251, 0) @@ -930,10 +832,10 @@ static MACHINE_CONFIG_START( m20, m20_state ) MCFG_PIT8253_CLK2(1230782) MCFG_PIT8253_OUT2_HANDLER(WRITELINE(m20_state, timer_tick_w)) - MCFG_PIC8259_ADD("i8259", WRITELINE(m20_state, pic_irq_line_w), VCC, NULL) + MCFG_PIC8259_ADD("i8259", INPUTLINE("maincpu", 1), VCC, NULL) - MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) - MCFG_GENERIC_KEYBOARD_CB(WRITE8(m20_state, kbd_put)) + MCFG_RS232_PORT_ADD("kbd", keyboard, "m20") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE("i8251_1", i8251_device, write_rxd)) MCFG_SOFTWARE_LIST_ADD("flop_list","m20") MACHINE_CONFIG_END @@ -963,5 +865,5 @@ ROM_START(m40) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ -COMP( 1981, m20, 0, 0, m20, m20, m20_state, m20, "Olivetti", "Olivetti L1 M20", GAME_NOT_WORKING | GAME_NO_SOUND) -COMP( 1981, m40, m20, 0, m20, m20, m20_state, m20, "Olivetti", "Olivetti L1 M40", GAME_NOT_WORKING | GAME_NO_SOUND) +COMP( 1981, m20, 0, 0, m20, 0, driver_device, 0, "Olivetti", "Olivetti L1 M20", GAME_NOT_WORKING | GAME_NO_SOUND) +COMP( 1981, m40, m20, 0, m20, 0, driver_device, 0, "Olivetti", "Olivetti L1 M40", GAME_NOT_WORKING | GAME_NO_SOUND) diff --git a/src/mess/machine/m20_kbd.c b/src/mess/machine/m20_kbd.c new file mode 100644 index 00000000000..ecccffae775 --- /dev/null +++ b/src/mess/machine/m20_kbd.c @@ -0,0 +1,225 @@ +// license:BSD-3-Clause +// copyright-holders:Carl +// TODO: dump 8048 mcu + +#include "machine/m20_kbd.h" + +m20_keyboard_device::m20_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : + serial_keyboard_device(mconfig, M20_KEYBOARD, "M20 Keyboard", tag, owner, 0, "m20_keyboard", __FILE__) +{ +} + +void m20_keyboard_device::write(UINT8 data) +{ + switch(data) + { + case 0x03: + send_key(2); + break; + case 0x80: + send_key(0x80); + break; + } + return; +} + +UINT8 m20_keyboard_device::keyboard_handler(UINT8 last_code, UINT8 *scan_line) +{ + int i = *scan_line, j; + UINT8 code = 0, state = m_state[i]; + + if (i == 0) code = m_io_kbd0->read(); + else + if (i == 1) code = m_io_kbd1->read(); + else + if (i == 2) code = m_io_kbd2->read(); + else + if (i == 3) code = m_io_kbd3->read(); + else + if (i == 4) code = m_io_kbd4->read(); + else + if (i == 5) code = m_io_kbd5->read(); + else + if (i == 6) code = m_io_kbd6->read(); + else + if (i == 7) code = m_io_kbd7->read(); + else + if (i == 8) code = m_io_kbd8->read(); + + *scan_line = (*scan_line + 1) % 9; + + if(m_state[i] == code) + return 0; + + m_state[i] = code; + code = (state ^ code) & code; + + if(!code) + return 0; + + for(j = 0; j < 8; j++) + if((code >> j) == 1) + break; + + if(i >= 6) + code = 0xc0 + ((i - 6) << 3) + j; + else + code = (i << 3) + j; + + state = m_io_kbd9->read(); + if(state && (i <= 8)) + { + switch(state) + { + case 1: + code += 0x90; + break; + case 2: + code += 0x60; + break; + case 4: + case 8: + code += 0x30; + break; + } + } + + return code; +} + +// Italian layout +static INPUT_PORTS_START( m20_keyboard ) + PORT_START("TERM_LINE0") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_ESC) + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("<") PORT_CODE(KEYCODE_LALT) PORT_CHAR('<') PORT_CHAR('>') + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + + PORT_START("TERM_LINE1") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('?') + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + + PORT_START("TERM_LINE2") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + + PORT_START("TERM_LINE3") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xa0 0") PORT_CODE(KEYCODE_0) PORT_CHAR(0x85) PORT_CHAR('0') // a_GRAVE + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc2\xa3 1") PORT_CODE(KEYCODE_1) PORT_CHAR(0x9c) PORT_CHAR('1') // POUND + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(e_ACUTE " 2") PORT_CODE(KEYCODE_2) PORT_CHAR(0x82) PORT_CHAR('2') + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\" 3") PORT_CODE(KEYCODE_3) PORT_CHAR('"') PORT_CHAR('3') + + PORT_START("TERM_LINE4") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("' 4") PORT_CODE(KEYCODE_4) PORT_CHAR('\'') PORT_CHAR('4') + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("( 5") PORT_CODE(KEYCODE_5) PORT_CHAR('(') PORT_CHAR('5') + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("_ 6") PORT_CODE(KEYCODE_6) PORT_CHAR('_') PORT_CHAR('6') + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xa8 7") PORT_CODE(KEYCODE_7) PORT_CHAR(0x8a) PORT_CHAR('7') // e_GRAVE + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("^ 8") PORT_CODE(KEYCODE_8) PORT_CHAR('^') PORT_CHAR('8') + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xa7 9") PORT_CODE(KEYCODE_9) PORT_CHAR(0x87) PORT_CHAR('9') // c_CEDILLA + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(") \xc2\xb0") PORT_CODE(KEYCODE_MINUS) PORT_CHAR(')') PORT_CHAR(0xa7) // DEGREE + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("- +") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') PORT_CHAR('+') + + PORT_START("TERM_LINE5") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xac =") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0x8d) PORT_CHAR('=') // i_GRAVE + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("$ &") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('$') PORT_CHAR('&') + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xb9 %") PORT_CODE(KEYCODE_COLON) PORT_CHAR(0x8a) PORT_CHAR('%') // u_GRAVE + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("* \xc2\xa7") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('*') PORT_CHAR(0xf5) // SECTION + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("; .") PORT_CODE(KEYCODE_STOP) PORT_CHAR(';') PORT_CHAR('.') + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(": /") PORT_CODE(KEYCODE_SLASH) PORT_CHAR(':') PORT_CHAR('/') + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xb2") PORT_CODE(KEYCODE_RALT) PORT_CHAR(0x95) + + PORT_START("TERM_LINE6") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S1") PORT_CODE(KEYCODE_BACKSPACE) + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S2") PORT_CODE(KEYCODE_BACKSLASH) + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + + PORT_START("TERM_LINE7") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + + PORT_START("TERM_LINE8") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) + + PORT_START("TERM_LINE9") + PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("COMMAND") PORT_CODE(KEYCODE_TAB) + PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) + PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) + + PORT_START("TERM_LINEC") + + PORT_START("RS232_TXBAUD") + PORT_CONFNAME(0xff, RS232_BAUD_1200, "TX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_BAUD_1200, "1200") + + PORT_START("RS232_STARTBITS") + PORT_CONFNAME(0xff, RS232_STARTBITS_1, "Start Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_STARTBITS_1, "1") + + PORT_START("RS232_DATABITS") + PORT_CONFNAME(0xff, RS232_DATABITS_8, "Data Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_DATABITS_8, "8") + + PORT_START("RS232_PARITY") + PORT_CONFNAME(0xff, RS232_PARITY_NONE, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_PARITY_NONE, "None") + + PORT_START("RS232_STOPBITS") + PORT_CONFNAME(0xff, RS232_STOPBITS_2, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_STOPBITS_2, "2") +INPUT_PORTS_END + +ioport_constructor m20_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(m20_keyboard); +} + +void m20_keyboard_device::device_start() +{ + serial_keyboard_device::device_start(); + memset(m_state, '\0', sizeof(m_state)); + set_rcv_rate(1200); +} + +void m20_keyboard_device::rcv_complete() +{ + receive_register_extract(); + write(get_received_char()); +} + +const device_type M20_KEYBOARD = &device_creator; diff --git a/src/mess/machine/m20_kbd.h b/src/mess/machine/m20_kbd.h new file mode 100644 index 00000000000..a3b9e770e77 --- /dev/null +++ b/src/mess/machine/m20_kbd.h @@ -0,0 +1,26 @@ +// license:BSD-3-Clause +// copyright-holders:Carl +#ifndef M20KBD_H_ +#define M20KBD_H_ + +#include "bus/rs232/keyboard.h" + +class m20_keyboard_device : public serial_keyboard_device +{ +public: + m20_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ioport_constructor device_input_ports() const; + +protected: + virtual void device_start(); + virtual void rcv_complete(); + +private: + void write(UINT8 data); + virtual UINT8 keyboard_handler(UINT8 last_code, UINT8 *scan_line); + UINT8 m_state[16]; +}; + +extern const device_type M20_KEYBOARD; + +#endif /* M20KBD_H_ */ From 151e7e433d1c6ef80803688fa7b5cb4b8697fc5c Mon Sep 17 00:00:00 2001 From: system11b Date: Sun, 7 Jun 2015 04:18:45 +0100 Subject: [PATCH 194/284] Added gundharac clone (split ROM version of gundhara, possible factory boot) Corrected sound for a lot of games which were incorrectly set up as stereo. It is likely that nearly all the games are mono but I've only updated the ones I know are *definitely* wrong. --- src/mame/drivers/seta.c | 142 ++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 85 deletions(-) diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 4b62c2122b0..08c7af95f61 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -7777,11 +7777,10 @@ static MACHINE_CONFIG_START( twineagl, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,twineagl_1_layer) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -7886,12 +7885,11 @@ static MACHINE_CONFIG_START( usclssic, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ MCFG_X1_010_ADDRESS(0x1000) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -7982,11 +7980,10 @@ static MACHINE_CONFIG_START( metafox, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8021,11 +8018,10 @@ static MACHINE_CONFIG_START( atehate, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8070,11 +8066,10 @@ static MACHINE_CONFIG_START( blandia, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END static MACHINE_CONFIG_START( blandiap, seta_state ) @@ -8108,11 +8103,10 @@ static MACHINE_CONFIG_START( blandiap, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8147,11 +8141,10 @@ static MACHINE_CONFIG_START( blockcar, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8185,8 +8178,7 @@ static MACHINE_CONFIG_DERIVED( blockcarb, blockcar ) MCFG_DEVICE_REMOVE("x1snd") MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8222,11 +8214,10 @@ static MACHINE_CONFIG_START( daioh, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, XTAL_16MHz) /* 16 MHz, Verified from PCB audio */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8261,11 +8252,10 @@ static MACHINE_CONFIG_START( daiohp, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, XTAL_16MHz) /* 16 MHz, Verified from PCB audio */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END /*************************************************************************** @@ -8306,11 +8296,10 @@ static MACHINE_CONFIG_START( drgnunit, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END /* Same as qzkklogy, but with a 16MHz CPU and different @@ -8438,11 +8427,10 @@ static MACHINE_CONFIG_START( eightfrc, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8551,11 +8539,10 @@ static MACHINE_CONFIG_START( gundhara, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8597,11 +8584,10 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END static MACHINE_CONFIG_START( jjsquawb, seta_state ) @@ -8634,11 +8620,10 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END /*************************************************************************** @@ -8677,11 +8662,10 @@ static MACHINE_CONFIG_START( kamenrid, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END /*************************************************************************** @@ -8802,11 +8786,10 @@ static MACHINE_CONFIG_START( krzybowl, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8849,11 +8832,10 @@ static MACHINE_CONFIG_START( madshark, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END /*************************************************************************** @@ -8892,11 +8874,10 @@ static MACHINE_CONFIG_START( magspeed, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -8942,11 +8923,10 @@ static MACHINE_CONFIG_START( msgundam, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9103,11 +9083,10 @@ static MACHINE_CONFIG_START( rezon, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9145,11 +9124,10 @@ static MACHINE_CONFIG_START( thunderl, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9184,8 +9162,7 @@ static MACHINE_CONFIG_DERIVED( thunderlbl, thunderl ) MCFG_DEVICE_REMOVE("x1snd") MCFG_YM2151_ADD("ymsnd", 10000000/2) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9257,11 +9234,10 @@ static MACHINE_CONFIG_START( wits, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9296,11 +9272,10 @@ static MACHINE_CONFIG_START( umanclub, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9391,11 +9366,10 @@ static MACHINE_CONFIG_START( wrofaero, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9440,11 +9414,10 @@ static MACHINE_CONFIG_START( zingzip, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -9460,8 +9433,7 @@ static MACHINE_CONFIG_DERIVED( zingzipbl, zingzip ) MCFG_DEVICE_REMOVE("x1snd") MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END /*************************************************************************** @@ -9495,11 +9467,10 @@ static MACHINE_CONFIG_START( pairlove, seta_state ) MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers) /* sound hardware */ - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */ - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -10869,7 +10840,8 @@ ROM_START( gundhara ) ROM_END /* Chinese factory board, possibly bootleg but appears to come from the - same factory as normal boards. Modified layout allowing split ROMs */ + same factory as normal boards same as daiohc. Modified layout allowing + split ROMs */ ROM_START( gundharac ) ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "4.U3", 0x000000, 0x080000, CRC(14e9970a) SHA1(31964bd290cc94c40684adf3a5d129b1c3addc3b) ) From aae343fcedb49943bbcadeda9f3ad41172b6eecb Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 11:35:28 +0200 Subject: [PATCH 195/284] Placed back old corealloc otherwise NO_MEM_TRACKING do not have any meaning (nw) --- src/lib/util/corealloc.c | 35 ----------------------------------- src/lib/util/corealloc.h | 28 +++++++++++++++++++--------- 2 files changed, 19 insertions(+), 44 deletions(-) diff --git a/src/lib/util/corealloc.c b/src/lib/util/corealloc.c index 0f752aa1b7c..d4de33fe35d 100644 --- a/src/lib/util/corealloc.c +++ b/src/lib/util/corealloc.c @@ -96,41 +96,6 @@ bool memory_entry::s_tracking = false; memory_entry *memory_entry::s_hash[memory_entry::k_hash_prime] = { NULL }; memory_entry *memory_entry::s_freehead = NULL; -//************************************************************************** -// OPERATOR REPLACEMENTS -//************************************************************************** - -#ifndef NO_MEM_TRACKING - -// standard new/delete operators (try to avoid using) -void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } -void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } -void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } -void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } - -void* operator new(std::size_t size,const std::nothrow_t&) throw() { return malloc_file_line(size, NULL, 0, false, false, false); } -void* operator new[](std::size_t size, const std::nothrow_t&) throw() { return malloc_file_line(size, NULL, 0, true, false, false); } -void operator delete(void* ptr, const std::nothrow_t&) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } -void operator delete[](void* ptr, const std::nothrow_t&) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } - -#endif - -//************************************************************************** -// OPERATOR OVERLOADS - DEFINITIONS -//************************************************************************** - -// file/line new/delete operators -void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, false); } -void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, false); } -void operator delete(void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, false); } -void operator delete[](void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, true); } - -// file/line new/delete operators with zeroing -void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, true); } -void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, true); } -void operator delete(void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, false); } -void operator delete[](void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, true); } - //************************************************************************** diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index eb97e643686..5b002557769 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -51,23 +51,33 @@ void dump_unfreed_mem(UINT64 start = 0); //************************************************************************** -// OPERATOR OVERLOADS - DECLARATIONS +// INLINE FUNCTIONS //************************************************************************** // zeromem_t is a dummy class used to tell new to zero memory after allocation class zeromem_t { }; +#ifndef NO_MEM_TRACKING + +// standard new/delete operators (try to avoid using) +ATTR_FORCE_INLINE inline void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } +ATTR_FORCE_INLINE inline void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } +ATTR_FORCE_INLINE inline void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } +ATTR_FORCE_INLINE inline void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } + +#endif + // file/line new/delete operators -void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc); -void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc); -void operator delete(void *ptr, const char *file, int line); -void operator delete[](void *ptr, const char *file, int line); +ATTR_FORCE_INLINE inline void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, false); } +ATTR_FORCE_INLINE inline void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, false); } +ATTR_FORCE_INLINE inline void operator delete(void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, false); } +ATTR_FORCE_INLINE inline void operator delete[](void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, true); } // file/line new/delete operators with zeroing -void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc); -void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc); -void operator delete(void *ptr, const char *file, int line, const zeromem_t &); -void operator delete[](void *ptr, const char *file, int line, const zeromem_t &); +ATTR_FORCE_INLINE inline void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, true); } +ATTR_FORCE_INLINE inline void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, true); } +ATTR_FORCE_INLINE inline void operator delete(void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, false); } +ATTR_FORCE_INLINE inline void operator delete[](void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, true); } From ea2adadec4c4f1d46a6f79a6e3dcf9ac3ce94d4c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 11:37:27 +0200 Subject: [PATCH 196/284] Was Wilberts work (nw) --- src/emu/bus/isa/hdc.c | 2 +- src/emu/bus/isa/hdc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/bus/isa/hdc.c b/src/emu/bus/isa/hdc.c index 594cd686cb2..0740130df29 100644 --- a/src/emu/bus/isa/hdc.c +++ b/src/emu/bus/isa/hdc.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic +// copyright-holders:Wilbert Pol /********************************************************************** ISA 8 bit XT Hard Disk Controller diff --git a/src/emu/bus/isa/hdc.h b/src/emu/bus/isa/hdc.h index e8c6f68ce52..3d3890da8ea 100644 --- a/src/emu/bus/isa/hdc.h +++ b/src/emu/bus/isa/hdc.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic +// copyright-holders:Wilbert Pol /********************************************************************** ISA 8 bit XT Hard Disk Controller From da17662c84c6d3349e503e00929ac64b319fe22c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 12:24:49 +0200 Subject: [PATCH 197/284] Added license for David Graves (nw) --- src/mame/drivers/asuka.c | 2 +- src/mame/drivers/gcpinbal.c | 2 +- src/mame/drivers/groundfx.c | 2 +- src/mame/drivers/gunbustr.c | 2 +- src/mame/drivers/legionna.c | 2 +- src/mame/drivers/ninjaw.c | 2 +- src/mame/drivers/othunder.c | 2 +- src/mame/drivers/slapshot.c | 2 +- src/mame/drivers/superchs.c | 2 +- src/mame/drivers/taito_f2.c | 2 +- src/mame/drivers/taito_z.c | 2 +- src/mame/drivers/topspeed.c | 2 +- src/mame/drivers/undrfire.c | 2 +- src/mame/drivers/warriorb.c | 2 +- src/mame/drivers/wgp.c | 2 +- src/mame/includes/asuka.h | 2 +- src/mame/includes/gcpinbal.h | 2 +- src/mame/includes/groundfx.h | 2 +- src/mame/includes/gunbustr.h | 2 +- src/mame/includes/legionna.h | 2 +- src/mame/includes/ninjaw.h | 2 +- src/mame/includes/othunder.h | 2 +- src/mame/includes/slapshot.h | 2 +- src/mame/includes/superchs.h | 2 +- src/mame/includes/taito_f2.h | 2 +- src/mame/includes/taito_z.h | 2 +- src/mame/includes/taitoipt.h | 2 +- src/mame/includes/topspeed.h | 2 +- src/mame/includes/undrfire.h | 2 +- src/mame/includes/warriorb.h | 2 +- src/mame/includes/wgp.h | 2 +- src/mame/video/asuka.c | 2 +- src/mame/video/gcpinbal.c | 2 +- src/mame/video/groundfx.c | 2 +- src/mame/video/gunbustr.c | 2 +- src/mame/video/legionna.c | 2 +- src/mame/video/ninjaw.c | 2 +- src/mame/video/othunder.c | 2 +- src/mame/video/slapshot.c | 2 +- src/mame/video/superchs.c | 2 +- src/mame/video/taito_f2.c | 2 +- src/mame/video/taito_z.c | 2 +- src/mame/video/topspeed.c | 2 +- src/mame/video/undrfire.c | 2 +- src/mame/video/warriorb.c | 2 +- src/mame/video/wgp.c | 2 +- 46 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index 7617fe36f19..9bd425858ec 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Brian Troha /*************************************************************************** diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c index 252b4cb663c..086f409a1c8 100644 --- a/src/mame/drivers/gcpinbal.c +++ b/src/mame/drivers/gcpinbal.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, R. Belmont /*************************************************************************** diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c index 94466b9c6f6..a719cdd9223 100644 --- a/src/mame/drivers/groundfx.c +++ b/src/mame/drivers/groundfx.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves /*************************************************************************** diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c index 6d6b73a806f..c17c60159fb 100644 --- a/src/mame/drivers/gunbustr.c +++ b/src/mame/drivers/gunbustr.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves /**************************************************************************** diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c index 83f37daec27..6143c3df745 100644 --- a/src/mame/drivers/legionna.c +++ b/src/mame/drivers/legionna.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Angelo Salese, David Haywood, Tomasz Slanina /*************************************************************************** diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c index 6b2b7fe7fc3..e39d2665bf5 100644 --- a/src/mame/drivers/ninjaw.c +++ b/src/mame/drivers/ninjaw.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /*************************************************************************** diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c index 81134f2725b..631b3a368c2 100644 --- a/src/mame/drivers/othunder.c +++ b/src/mame/drivers/othunder.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /*************************************************************************** diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c index e7329d9e4a3..3a1b602f9c0 100644 --- a/src/mame/drivers/slapshot.c +++ b/src/mame/drivers/slapshot.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /*************************************************************************** diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c index 129dd90d7de..f19beb885cd 100644 --- a/src/mame/drivers/superchs.c +++ b/src/mame/drivers/superchs.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves /**************************************************************************** diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c index 562f64d8d28..80a69da57db 100644 --- a/src/mame/drivers/taito_f2.c +++ b/src/mame/drivers/taito_f2.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria /*************************************************************************** diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c index 459fb7ecdbf..2e641b04db5 100644 --- a/src/mame/drivers/taito_z.c +++ b/src/mame/drivers/taito_z.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /*************************************************************************** diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c index 1bab838ec81..f080a163f34 100644 --- a/src/mame/drivers/topspeed.c +++ b/src/mame/drivers/topspeed.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /***************+************************************************************ diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c index 077bb746270..57e1cb5a7e7 100644 --- a/src/mame/drivers/undrfire.c +++ b/src/mame/drivers/undrfire.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves /*************************************************************************** diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c index a1bd87c55e5..59a03d31071 100644 --- a/src/mame/drivers/warriorb.c +++ b/src/mame/drivers/warriorb.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /*************************************************************************** diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c index 03d8c97e055..1efa83564ed 100644 --- a/src/mame/drivers/wgp.c +++ b/src/mame/drivers/wgp.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /*************************************************************************** diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h index ec96ca568a4..9c0f1fdb8b7 100644 --- a/src/mame/includes/asuka.h +++ b/src/mame/includes/asuka.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Brian Troha /************************************************************************* diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h index 261f63545fe..57d0abf0eec 100644 --- a/src/mame/includes/gcpinbal.h +++ b/src/mame/includes/gcpinbal.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, R. Belmont #include "sound/okim6295.h" diff --git a/src/mame/includes/groundfx.h b/src/mame/includes/groundfx.h index 845c8982b67..c774d6784fc 100644 --- a/src/mame/includes/groundfx.h +++ b/src/mame/includes/groundfx.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "video/tc0100scn.h" #include "video/tc0480scp.h" diff --git a/src/mame/includes/gunbustr.h b/src/mame/includes/gunbustr.h index 8e3f15bfe0c..a8e291517e2 100644 --- a/src/mame/includes/gunbustr.h +++ b/src/mame/includes/gunbustr.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "machine/eepromser.h" #include "video/tc0480scp.h" diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h index 5b6cca2b169..ed64c30b16c 100644 --- a/src/mame/includes/legionna.h +++ b/src/mame/includes/legionna.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Angelo Salese, David Haywood, Tomasz Slanina #include "sound/okim6295.h" #include "audio/seibu.h" diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h index 9c3ef61f0a5..6a2f2a50770 100644 --- a/src/mame/includes/ninjaw.h +++ b/src/mame/includes/ninjaw.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/includes/othunder.h b/src/mame/includes/othunder.h index 3dc3e5ba4a9..3a7e3db10b4 100644 --- a/src/mame/includes/othunder.h +++ b/src/mame/includes/othunder.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h index 355cdcd4ae9..75f5607f1af 100644 --- a/src/mame/includes/slapshot.h +++ b/src/mame/includes/slapshot.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/includes/superchs.h b/src/mame/includes/superchs.h index 7e6cfaf9b70..45424c596a4 100644 --- a/src/mame/includes/superchs.h +++ b/src/mame/includes/superchs.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "machine/eepromser.h" #include "video/tc0480scp.h" diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h index 84709a891c5..98c9f772fbb 100644 --- a/src/mame/includes/taito_f2.h +++ b/src/mame/includes/taito_f2.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria #include "machine/taitoio.h" #include "sound/okim6295.h" diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h index 0e529cdd8e3..cad38ea63e9 100644 --- a/src/mame/includes/taito_z.h +++ b/src/mame/includes/taito_z.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/includes/taitoipt.h b/src/mame/includes/taitoipt.h index 7e79c8c2725..d41f6d05322 100644 --- a/src/mame/includes/taitoipt.h +++ b/src/mame/includes/taitoipt.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria /******************************************************************************* diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h index efecd20ac9d..b0ade884b72 100644 --- a/src/mame/includes/topspeed.h +++ b/src/mame/includes/topspeed.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/includes/undrfire.h b/src/mame/includes/undrfire.h index 982e91f5ae7..c17354b3763 100644 --- a/src/mame/includes/undrfire.h +++ b/src/mame/includes/undrfire.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "machine/eepromser.h" #include "video/tc0100scn.h" diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h index e1b12476c39..9040c66b46c 100644 --- a/src/mame/includes/warriorb.h +++ b/src/mame/includes/warriorb.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h index cde714d9dd3..6f2416a4326 100644 --- a/src/mame/includes/wgp.h +++ b/src/mame/includes/wgp.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves /************************************************************************* diff --git a/src/mame/video/asuka.c b/src/mame/video/asuka.c index 60d30f15bd4..7ae0cebbbac 100644 --- a/src/mame/video/asuka.c +++ b/src/mame/video/asuka.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Brian Troha #include "emu.h" #include "includes/asuka.h" diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c index a69fafb4c17..7c95e87381c 100644 --- a/src/mame/video/gcpinbal.c +++ b/src/mame/video/gcpinbal.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, R. Belmont #include "emu.h" #include "includes/gcpinbal.h" diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index de894dd98b8..d910db9aa37 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "emu.h" #include "includes/groundfx.h" diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c index ad0867d78d3..902cc232480 100644 --- a/src/mame/video/gunbustr.c +++ b/src/mame/video/gunbustr.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "emu.h" #include "includes/gunbustr.h" diff --git a/src/mame/video/legionna.c b/src/mame/video/legionna.c index b37c6d5ef05..5fccd7a222e 100644 --- a/src/mame/video/legionna.c +++ b/src/mame/video/legionna.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Angelo Salese, David Haywood, Tomasz Slanina /*************************************************************************** diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c index 3fd1ab35d58..360e96087a9 100644 --- a/src/mame/video/ninjaw.c +++ b/src/mame/video/ninjaw.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/ninjaw.h" diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c index a9de852b75d..7afd22b5c5f 100644 --- a/src/mame/video/othunder.c +++ b/src/mame/video/othunder.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/othunder.h" diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c index 78dffc81df3..f470e3d606b 100644 --- a/src/mame/video/slapshot.c +++ b/src/mame/video/slapshot.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/slapshot.h" diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c index 171ebd697e4..5783ef9c587 100644 --- a/src/mame/video/superchs.c +++ b/src/mame/video/superchs.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "emu.h" #include "includes/superchs.h" diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c index 0fc366488ac..9c073b6891d 100644 --- a/src/mame/video/taito_f2.c +++ b/src/mame/video/taito_f2.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria #include "emu.h" #include "includes/taito_f2.h" diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c index 13ca87b78f5..0b040bad155 100644 --- a/src/mame/video/taito_z.c +++ b/src/mame/video/taito_z.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/taito_z.h" diff --git a/src/mame/video/topspeed.c b/src/mame/video/topspeed.c index 84f7d9d98b4..ac04cfda610 100644 --- a/src/mame/video/topspeed.c +++ b/src/mame/video/topspeed.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/topspeed.h" diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c index f5e6e3606f8..bc476538eb4 100644 --- a/src/mame/video/undrfire.c +++ b/src/mame/video/undrfire.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Graves #include "emu.h" #include "includes/undrfire.h" diff --git a/src/mame/video/warriorb.c b/src/mame/video/warriorb.c index ce34a8a4606..33659f53af2 100644 --- a/src/mame/video/warriorb.c +++ b/src/mame/video/warriorb.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/warriorb.h" diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c index 602f2150af1..9cd1ef49871 100644 --- a/src/mame/video/wgp.c +++ b/src/mame/video/wgp.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:David Graves #include "emu.h" #include "includes/wgp.h" From 9e10a6a35a53817742b340030fda456987e13144 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sun, 7 Jun 2015 12:30:46 +0200 Subject: [PATCH 198/284] M1COMM - added simulation code based on http://www.mameworld.info/ubbthreads/showflat.php?Cat=&Number=297577 http://www.mameworld.info/ubbthreads/showflat.php?Cat=&Number=333324 --- src/mame/machine/m1comm.c | 281 +++++++++++++++++++++++++++++++++++++- src/mame/machine/m1comm.h | 18 +++ 2 files changed, 296 insertions(+), 3 deletions(-) diff --git a/src/mame/machine/m1comm.c b/src/mame/machine/m1comm.c index 7e734846b95..9b3c0758c6a 100644 --- a/src/mame/machine/m1comm.c +++ b/src/mame/machine/m1comm.c @@ -55,7 +55,7 @@ Notes: #define Z80_TAG "m1commcpu" -#define __M1COMM_VERBOSE__ +//#define __M1COMM_VERBOSE__ /************************************* * M1COMM Memory Map @@ -124,8 +124,21 @@ const rom_entry *m1comm_device::device_rom_region() const m1comm_device::m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, M1COMM, "MODEL-1 COMMUNICATION BD", tag, owner, clock, "m1comm", __FILE__), - m_commcpu(*this, Z80_TAG) + m_commcpu(*this, Z80_TAG), + m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ), + m_line_tx(OPEN_FLAG_READ) { + // prepare localhost "filename" + strcat(m_localhost, "socket."); + strcat(m_localhost, mconfig.options().comm_localhost()); + strcat(m_localhost, ":"); + strcat(m_localhost, mconfig.options().comm_localport()); + + // prepare remotehost "filename" + strcat(m_remotehost, "socket."); + strcat(m_remotehost, mconfig.options().comm_remotehost()); + strcat(m_remotehost, ":"); + strcat(m_remotehost, mconfig.options().comm_remoteport()); } //------------------------------------------------- @@ -258,11 +271,30 @@ READ8_MEMBER(m1comm_device::cn_r) WRITE8_MEMBER(m1comm_device::cn_w) { m_cn = data & 0x01; - + +#ifndef __M1COMM_SIMULATION__ if (!m_cn) device_reset(); else m_commcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); +#else + if (!m_cn) + { + // reset command + printf("M1COMM: board disabled\n"); + m_linkenable = 0x00; + } + else + { + // init command + printf("M1COMM: board enabled\n"); + m_linkenable = 0x01; + m_linkid = 0x00; + m_linkalive = 0x00; + m_linkcount = 0x00; + m_linktimer = 0x00E8; // 58 fps * 4s + } +#endif } READ8_MEMBER(m1comm_device::fg_r) @@ -280,6 +312,7 @@ WRITE8_MEMBER(m1comm_device::fg_w) void m1comm_device::check_vint_irq() { +#ifndef __M1COMM_SIMULATION__ if (m_syn & 0x02) { m_commcpu->set_input_line_and_vector(0, HOLD_LINE, 0xEF); @@ -287,4 +320,246 @@ void m1comm_device::check_vint_irq() printf("m1comm-INT5\n"); #endif } +#else + comm_tick(); +#endif +} + +#ifdef __M1COMM_SIMULATION__ +void m1comm_device::comm_tick(){ + if (m_linkenable == 0x01) + { + int frameStart = 0x0010; + int frameOffset = 0x0000; + int frameSize = 0x01C4; + int dataSize = frameSize + 1; + int togo = 0; + int recv = 0; + int idx = 0; + + bool isMaster = (m_shared[1] == 0x01); + bool isSlave = (m_shared[1] == 0x02); + bool isRelay = (m_shared[1] == 0x00); + + // if link not yet established... + if (m_linkalive == 0x00) + { + // check rx socket + if (!m_line_rx.is_open()) + { + printf("M1COMM: listen on %s\n", m_localhost); + m_line_rx.open(m_localhost); + } + + // check tx socket + if (!m_line_tx.is_open()) + { + printf("M1COMM: connect to %s\n", m_remotehost); + m_line_tx.open(m_remotehost); + } + + // if both sockets are there check ring + if ((m_line_rx.is_open()) && (m_line_tx.is_open())) + { + // try to read one messages + recv = m_line_rx.read(m_buffer, dataSize); + while (recv != 0) + { + // check if complete message + if (recv == dataSize) + { + // check if message id + idx = m_buffer[0]; + + // 0xFF - link id + if (idx == 0xFF) + { + if (isMaster) + { + // master gets first id and starts next state + m_linkid = 0x01; + m_linkcount = m_buffer[1]; + m_linktimer = 0x01; + } + else if (isSlave || isRelay) + { + // slave gets own id + if (isSlave) + { + m_buffer[1]++; + m_linkid = m_buffer[1]; + } + + // slave and relay forward message + m_line_tx.write(m_buffer, dataSize); + } + } + + // 0xFE - link size + else if (idx == 0xFE) + { + if (isSlave || isRelay) + { + m_linkcount = m_buffer[1]; + + // slave and relay forward message + m_line_tx.write(m_buffer, dataSize); + } + + // consider it done + printf("M1COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount); + m_linkalive = 0x01; + + // write to shared mem + m_shared[0] = 0x01; + m_shared[2] = m_linkid; + m_shared[3] = m_linkcount; + } + } + else + { + // got only part of a message - read the rest (and drop it) + // TODO: combine parts and push to "ring buffer" + togo = dataSize - recv; + while (togo > 0){ + recv = m_line_rx.read(m_buffer, togo); + togo -= recv; + } + printf("M1COMM: droped a message...\n"); + } + + if (m_linkalive == 0x00) + recv = m_line_rx.read(m_buffer, dataSize); + else + recv = 0; + } + + // if we are master and link is not yet established + if (isMaster && (m_linkalive == 0x00)) + { + // send first packet + if (m_linktimer == 0x00) + { + m_buffer[0] = 0xFF; + m_buffer[1] = 0x01; + m_line_tx.write(m_buffer, dataSize); + } + + // send second packet + else if (m_linktimer == 0x01) + { + m_buffer[0] = 0xFE; + m_buffer[1] = m_linkcount; + m_line_tx.write(m_buffer, dataSize); + + // consider it done + printf("M1COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount); + m_linkalive = 0x01; + + // write to shared mem + m_shared[0] = 0x01; + m_shared[2] = m_linkid; + m_shared[3] = m_linkcount; + } + + else if (m_linktimer > 0x02) + { + // decrease delay timer + m_linktimer--; + if (m_linktimer == 0x02) + m_linktimer = 0x00; + } + } + } + } + + // update "ring buffer" if link established + if (m_linkalive == 0x01) + { + int togo = 0; + // try to read one messages + int recv = m_line_rx.read(m_buffer, dataSize); + while (recv != 0) + { + // check if complete message + if (recv == dataSize) + { + // check if valid id + int idx = m_buffer[0]; + if (idx > 0 && idx <= m_linkcount) { + // if not our own message + if (idx != m_linkid) + { + // save message to "ring buffer" + frameOffset = frameStart + (idx * frameSize); + for (int j = 0x00 ; j < frameSize ; j++) + { + m_shared[frameOffset + j] = m_buffer[1 + j]; + } + + // forward message to other nodes + m_line_tx.write(m_buffer, dataSize); + } + } else { + if (!isMaster && idx == 0xF0){ + // 0xF0 - master addional bytes + for (int j = 0x06 ; j < 0x10 ; j++) + { + m_shared[j] = m_buffer[1 + j]; + } + + // forward message to other nodes + m_line_tx.write(m_buffer, dataSize); + } + } + } + else + { + // got only part of a message - read the rest (and drop it) + // TODO: combine parts and push to "ring buffer" + togo = dataSize - recv; + while (togo > 0){ + recv = m_line_rx.read(m_buffer, togo); + togo -= recv; + } + printf("M1COMM: droped a message...\n"); + } + recv = m_line_rx.read(m_buffer, dataSize); + } + + // update "ring buffer" if link established + // live relay does not send data + if (m_linkid != 0x00 && m_shared[5] == 0x01) + { + m_buffer[0] = m_linkid; + frameOffset = frameStart + (m_linkid * frameSize); + for (int j = 0x00 ; j < frameSize ; j++) + { + // push message to "ring buffer" + m_shared[frameOffset + j] = m_shared[frameStart + j]; + m_buffer[1 + j] = m_shared[frameStart + j]; + } + // push message to other nodes + m_line_tx.write(m_buffer, dataSize); + + // master sends some additional status bytes + if (isMaster){ + m_buffer[0] = 0xF0; + for (int j = 0x00 ; j < frameSize ; j++) + { + m_buffer[1 + j] = 0x00; + } + for (int j = 0x06 ; j < 0x10 ; j++) + { + m_buffer[1 + j] = m_shared[frameStart + j]; + } + // push message to other nodes + m_line_tx.write(m_buffer, dataSize); + } + } + // clear 05 + m_shared[5] = 0x00; + } + } +#endif } \ No newline at end of file diff --git a/src/mame/machine/m1comm.h b/src/mame/machine/m1comm.h index 90f2737f048..02cfceb3078 100644 --- a/src/mame/machine/m1comm.h +++ b/src/mame/machine/m1comm.h @@ -5,6 +5,8 @@ #ifndef __M1COMM_H__ #define __M1COMM_H__ +#define __M1COMM_SIMULATION__ + #include "emu.h" #include "cpu/z80/z80.h" @@ -72,6 +74,22 @@ private: UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored UINT8 m_cn; // bit0 is used to enable/disable the comm board UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0 + + emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink + emu_file m_line_tx; // tx line - is differential, simple serial and toslink + char m_localhost[256]; + char m_remotehost[256]; + UINT8 m_buffer[0x1000]; + +#ifdef __M1COMM_SIMULATION__ + UINT8 m_linkenable; + UINT16 m_linktimer; + UINT8 m_linkalive; + UINT8 m_linkid; + UINT8 m_linkcount; + + void comm_tick(); +#endif }; // device type definition From be9551fddeb30107b43d455e88cba3e6cd25db99 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 12:59:55 +0200 Subject: [PATCH 199/284] Fix for 64bit build size thanks to Peter Ferrie (nw) --- scripts/genie.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/genie.lua b/scripts/genie.lua index 7a591db050b..18f0fd1554c 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -509,6 +509,13 @@ if _OPTIONS["targetos"]=="windows" then configuration { } end + +configuration { "x64", "gmake" } + linkoptions { + "--image-base 0x100000000", + } +configuration { } + -- Avoid error when invoking genie --help. if (_ACTION == nil) then return false end From fabe12b2821736346505c32f1cbdc33247452817 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 13:06:35 +0200 Subject: [PATCH 200/284] should go like this (nw) --- scripts/genie.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 18f0fd1554c..47f7aa85770 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -512,7 +512,7 @@ end configuration { "x64", "gmake" } linkoptions { - "--image-base 0x100000000", + "-Wl,--image-base=0x100000000", } configuration { } From 041ba8bc2fa406abf9a38aaac74710f08d121dc2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 14:15:04 +0200 Subject: [PATCH 201/284] placed this back to disable warning on clang (nw) --- scripts/genie.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/genie.lua b/scripts/genie.lua index 47f7aa85770..dbb5bb21381 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -930,6 +930,7 @@ end end if (version >= 30400) then buildoptions { + "-Wno-inline-new-delete", "-Wno-constant-logical-operand", } end From 48fb1dfb855c3b459f7dd77d478062966c1f0613 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 16:47:41 +0200 Subject: [PATCH 202/284] lets make it just for mingw (nw) --- scripts/genie.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index dbb5bb21381..6e78efaf1b7 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -506,16 +506,12 @@ if _OPTIONS["targetos"]=="windows" then defines { "X64_WINDOWS_ABI", } + linkoptions { + "-Wl,--image-base=0x100000000", + } configuration { } end - -configuration { "x64", "gmake" } - linkoptions { - "-Wl,--image-base=0x100000000", - } -configuration { } - -- Avoid error when invoking genie --help. if (_ACTION == nil) then return false end From 995350c3f733f557e53aefbfb344ac739212679b Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 7 Jun 2015 10:22:08 +0200 Subject: [PATCH 203/284] apricotkb: fix license --- src/mess/machine/apricotkb.c | 4 ++-- src/mess/machine/apricotkb.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mess/machine/apricotkb.c b/src/mess/machine/apricotkb.c index a2520442d3e..6ceb0d6ba4d 100644 --- a/src/mess/machine/apricotkb.c +++ b/src/mess/machine/apricotkb.c @@ -1,5 +1,5 @@ -// license:GPL-2.0+ -// copyright-holders:Dirk Best +// license:BSD-3-Clause +// copyright-holders:Curt Coder /********************************************************************** Apricot keyboard emulation diff --git a/src/mess/machine/apricotkb.h b/src/mess/machine/apricotkb.h index b85dab77dcf..7b3d20a7a48 100644 --- a/src/mess/machine/apricotkb.h +++ b/src/mess/machine/apricotkb.h @@ -1,5 +1,5 @@ -// license:GPL-2.0+ -// copyright-holders:Dirk Best +// license:BSD-3-Clause +// copyright-holders:Curt Coder /********************************************************************** Apricot keyboard emulation From 18db93e799eb9ad8bf89c34e8c491a57e903675e Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Sun, 7 Jun 2015 17:03:00 +0200 Subject: [PATCH 204/284] apricot: use correct wd fdc type and fix floppy motor on, implement graphics mode, simulate sio irq m1 access. successfully boots from disk now. --- src/mess/drivers/apricot.c | 151 +++++++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 55 deletions(-) diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 322ddf731c7..2745b5e88bd 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -54,10 +54,41 @@ public: m_data_selector_rts(1), m_video_mode(0), m_display_on(1), - m_display_enabled(0) + m_display_enabled(0), + m_centronics_fault(1), + m_centronics_perror(1), + m_sio_irq(0) { } - required_device m_cpu; + DECLARE_FLOPPY_FORMATS(floppy_formats); + + DECLARE_WRITE8_MEMBER(i8089_ca1_w); + DECLARE_WRITE8_MEMBER(i8089_ca2_w); + DECLARE_WRITE8_MEMBER(i8255_portb_w); + DECLARE_READ8_MEMBER(i8255_portc_r); + DECLARE_WRITE8_MEMBER(i8255_portc_w); + DECLARE_WRITE_LINE_MEMBER(timer_out1); + DECLARE_WRITE_LINE_MEMBER(timer_out2); + DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w); + DECLARE_WRITE_LINE_MEMBER(sio_int_w); + IRQ_CALLBACK_MEMBER(irq_callback); + + DECLARE_WRITE_LINE_MEMBER(write_centronics_fault); + DECLARE_WRITE_LINE_MEMBER(write_centronics_perror); + + DECLARE_WRITE_LINE_MEMBER(apricot_mc6845_de) { m_display_enabled = state; }; + + DECLARE_WRITE_LINE_MEMBER(data_selector_dtr_w) { m_data_selector_dtr = state; }; + DECLARE_WRITE_LINE_MEMBER(data_selector_rts_w) { m_data_selector_rts = state; }; + + MC6845_UPDATE_ROW(crtc_update_row); + UINT32 screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + +protected: + virtual void machine_start(); + +private: + required_device m_cpu; required_device m_ram; required_device m_iop; required_device m_sn; @@ -68,33 +99,12 @@ public: required_device m_sio; required_device m_rs232; required_device m_centronics; - required_device m_fdc; + required_device m_fdc; required_device m_floppy0; required_device m_floppy1; required_device m_palette; required_shared_ptr m_screen_buffer; - DECLARE_WRITE8_MEMBER( i8089_ca1_w ); - DECLARE_WRITE8_MEMBER( i8089_ca2_w ); - DECLARE_WRITE8_MEMBER( i8255_portb_w ); - DECLARE_READ8_MEMBER( i8255_portc_r ); - DECLARE_WRITE8_MEMBER( i8255_portc_w ); - DECLARE_WRITE_LINE_MEMBER( timer_out1 ); - DECLARE_WRITE_LINE_MEMBER( timer_out2 ); - DECLARE_WRITE_LINE_MEMBER( wd2793_intrq_w ); - - DECLARE_WRITE_LINE_MEMBER( write_centronics_fault ); - DECLARE_WRITE_LINE_MEMBER( write_centronics_perror ); - - DECLARE_WRITE_LINE_MEMBER( apricot_mc6845_de ) { m_display_enabled = state; }; - - DECLARE_WRITE_LINE_MEMBER( data_selector_dtr_w ) { m_data_selector_dtr = state; }; - DECLARE_WRITE_LINE_MEMBER( data_selector_rts_w ) { m_data_selector_rts = state; }; - - MC6845_UPDATE_ROW( crtc_update_row ); - - virtual void machine_start(); - int m_data_selector_dtr; int m_data_selector_rts; @@ -103,10 +113,10 @@ public: int m_display_enabled; - UINT32 screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - int m_centronics_fault; int m_centronics_perror; + + int m_sio_irq; }; @@ -154,15 +164,29 @@ READ8_MEMBER( apricot_state::i8255_portc_r ) WRITE8_MEMBER( apricot_state::i8255_portb_w ) { + // bit 0, crt reset + // bit 1, not connected + m_display_on = BIT(data, 3); m_video_mode = BIT(data, 4); + floppy_image_device *floppy = NULL; + + // bit 5, enable disk select + // bit 6, disk select if (!BIT(data, 5)) - m_fdc->set_floppy(BIT(data, 6) ? m_floppy1->get_device() : m_floppy0->get_device()); + floppy = BIT(data, 6) ? m_floppy1->get_device() : m_floppy0->get_device(); + + m_fdc->set_floppy(floppy); + + // bit 2, head load (motor on is wired to be active once a disk has been inserted) + // we just let the motor run all the time for now + if (floppy) + floppy->mon_w(0); // switch video modes - m_crtc->set_clock( m_video_mode ? XTAL_15MHz / 10 : XTAL_15MHz / 16); - m_crtc->set_hpixels_per_column( m_video_mode ? 10 : 16); + m_crtc->set_clock(m_video_mode ? XTAL_15MHz / 10 : XTAL_15MHz / 16); + m_crtc->set_hpixels_per_column(m_video_mode ? 10 : 16); // PB7 Centronics transceiver direction. 0 = output, 1 = input } @@ -195,19 +219,30 @@ WRITE_LINE_MEMBER( apricot_state::timer_out2 ) } } +WRITE_LINE_MEMBER( apricot_state::sio_int_w ) +{ + m_sio_irq = state; + m_pic->ir5_w(state); +} + + //************************************************************************** // FLOPPY //************************************************************************** -WRITE_LINE_MEMBER( apricot_state::wd2793_intrq_w ) +WRITE_LINE_MEMBER( apricot_state::fdc_intrq_w ) { m_pic->ir4_w(state); m_iop->ext1_w(state); } +FLOPPY_FORMATS_MEMBER( apricot_state::floppy_formats ) + FLOPPY_APRIDISK_FORMAT +FLOPPY_FORMATS_END + static SLOT_INTERFACE_START( apricot_floppies ) - SLOT_INTERFACE( "d31v", SONY_OA_D31V ) - SLOT_INTERFACE( "d32w", SONY_OA_D32W ) + SLOT_INTERFACE("d31v", SONY_OA_D31V) + SLOT_INTERFACE("d32w", SONY_OA_D32W) SLOT_INTERFACE_END @@ -229,34 +264,35 @@ MC6845_UPDATE_ROW( apricot_state::crtc_update_row ) { UINT8 *ram = m_ram->pointer(); const pen_t *pen = m_palette->pens(); - int i, x; - if (m_video_mode) + for (int i = 0; i < x_count; i++) { - // text mode - for (i = 0; i < x_count; i++) + UINT16 code = m_screen_buffer[(ma + i) & 0x7ff]; + UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1); + UINT16 data = ram[offset + 1] << 8 | ram[offset]; + + if (m_video_mode) { - UINT16 code = m_screen_buffer[(ma + i) & 0x7ff]; - UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1); - UINT16 data = ram[offset + 1] << 8 | ram[offset]; int fill = 0; + if (i == cursor_x) fill = 1; // cursor? if (BIT(code, 12) && BIT(data, 14)) fill = 1; // strike-through? if (BIT(code, 13) && BIT(data, 15)) fill = 1; // underline? // draw 10 pixels of the character - for (x = 0; x <= 10; x++) + for (int x = 0; x <= 10; x++) { int color = fill ? 1 : BIT(data, x); if (BIT(code, 15)) color = !color; // reverse? bitmap.pix32(y, x + i*10) = pen[color ? 1 + BIT(code, 14) : 0]; } } - } - else - { - // graphics mode - fatalerror("Graphics mode not implemented!\n"); + else + { + // draw 16 pixels of the cell + for (int x = 0; x <= 16; x++) + bitmap.pix32(y, x + i*16) = pen[BIT(data, x)]; + } } } @@ -269,10 +305,15 @@ void apricot_state::machine_start() // install shared memory to the main cpu and the iop m_cpu->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); m_iop->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); +} - // motor on is connected to gnd - m_floppy0->get_device()->mon_w(0); - m_floppy1->get_device()->mon_w(0); +IRQ_CALLBACK_MEMBER( apricot_state::irq_callback ) +{ + // i86 lock is connected to the sio m1 input, simulate this + if (m_sio_irq) + m_sio->m1_r(); + + return m_pic->acknowledge(); } @@ -289,7 +330,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( apricot_io, AS_IO, 16, apricot_state ) AM_RANGE(0x00, 0x03) AM_DEVREADWRITE8("ic31", pic8259_device, read, write, 0x00ff) - AM_RANGE(0x40, 0x47) AM_DEVREADWRITE8("ic68", wd2793_t, read, write, 0x00ff) + AM_RANGE(0x40, 0x47) AM_DEVREADWRITE8("ic68", wd2797_t, read, write, 0x00ff) AM_RANGE(0x48, 0x4f) AM_DEVREADWRITE8("ic17", i8255_device, read, write, 0x00ff) AM_RANGE(0x50, 0x51) AM_MIRROR(0x06) AM_DEVWRITE8("ic7", sn76489_device, write, 0x00ff) AM_RANGE(0x58, 0x5f) AM_DEVREADWRITE8("ic16", pit8253_device, read, write, 0x00ff) @@ -311,7 +352,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_CPU_ADD("ic91", I8086, XTAL_15MHz / 3) MCFG_CPU_PROGRAM_MAP(apricot_mem) MCFG_CPU_IO_MAP(apricot_io) - MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("ic31", pic8259_device, inta_cb) + MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(apricot_state, irq_callback) // i/o cpu MCFG_CPU_ADD("ic71", I8089, XTAL_15MHz / 3) @@ -371,7 +412,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_Z80DART_OUT_WRDYA_CB(DEVWRITELINE("ic71", i8089_device, drq2_w)) MCFG_Z80DART_OUT_DTRB_CB(WRITELINE(apricot_state, data_selector_dtr_w)) MCFG_Z80DART_OUT_RTSB_CB(WRITELINE(apricot_state, data_selector_rts_w)) - MCFG_Z80DART_OUT_INT_CB(DEVWRITELINE("ic31", pic8259_device, ir5_w)) + MCFG_Z80DART_OUT_INT_CB(WRITELINE(apricot_state, sio_int_w)) // rs232 port MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, NULL) @@ -395,11 +436,11 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") // floppy - MCFG_WD2793x_ADD("ic68", XTAL_4MHz / 2) - MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(apricot_state, wd2793_intrq_w)) + MCFG_WD2797x_ADD("ic68", XTAL_4MHz / 2) + MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(apricot_state, fdc_intrq_w)) MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("ic71", i8089_device, drq1_w)) - MCFG_FLOPPY_DRIVE_ADD("ic68:0", apricot_floppies, "d32w", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("ic68:1", apricot_floppies, "d32w", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("ic68:0", apricot_floppies, "d32w", apricot_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("ic68:1", apricot_floppies, "d32w", apricot_state::floppy_formats) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( apricotxi, apricot ) From 6cade077e06bc84466f9e4d1c6b9d125a378310a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 17:27:58 +0200 Subject: [PATCH 205/284] and remove (nw) --- scripts/genie.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 6e78efaf1b7..bdd97f427c5 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -506,9 +506,6 @@ if _OPTIONS["targetos"]=="windows" then defines { "X64_WINDOWS_ABI", } - linkoptions { - "-Wl,--image-base=0x100000000", - } configuration { } end From b6ce8ee991c7e14ca214a2931bfbc4e4a5a0dc0f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 7 Jun 2015 17:37:34 +0200 Subject: [PATCH 206/284] Licenses for Raphael Nabet (nw) --- src/emu/cpu/apexc/apexc.c | 2 +- src/emu/cpu/apexc/apexc.h | 2 +- src/emu/cpu/apexc/apexcdsm.c | 2 +- src/emu/cpu/pdp1/pdp1.c | 2 +- src/emu/cpu/pdp1/pdp1.h | 2 +- src/emu/cpu/pdp1/pdp1dasm.c | 2 +- src/emu/cpu/pdp1/tx0.c | 2 +- src/emu/cpu/pdp1/tx0.h | 2 +- src/emu/cpu/pdp1/tx0dasm.c | 2 +- src/emu/cpu/tms9900/9900dasm.c | 2 +- src/emu/cpu/tms9900/99xxcore.h | 2 +- src/emu/imagedev/harddriv.c | 2 +- src/emu/imagedev/harddriv.h | 2 +- src/emu/machine/at29040a.c | 2 +- src/emu/machine/at29040a.h | 2 +- src/emu/machine/corvushd.c | 2 +- src/emu/machine/corvushd.h | 2 +- src/emu/machine/mm58274c.c | 2 +- src/emu/machine/mm58274c.h | 2 +- src/emu/machine/rtc65271.c | 2 +- src/emu/machine/rtc65271.h | 2 +- src/emu/machine/smc92x4.c | 2 +- src/emu/machine/smc92x4.h | 2 +- src/emu/machine/spchrom.c | 2 +- src/emu/machine/spchrom.h | 2 +- src/emu/machine/strata.c | 2 +- src/emu/machine/strata.h | 2 +- src/emu/sound/tms5220.c | 2 +- src/emu/sound/tms5220.h | 2 +- src/emu/video/tms3556.c | 2 +- src/emu/video/tms3556.h | 2 +- src/lib/util/avhuff.c | 256 ++++-- src/lib/util/aviio.c | 909 ++++++++++++++++++ src/lib/util/bitmap.c | 166 +++- src/lib/util/cdrom.c | 423 ++++++++- src/lib/util/chd.c | 1071 ++++++++++++++++------ src/lib/util/chdcd.c | 159 ++++ src/lib/util/chdcodec.c | 168 +++- src/lib/util/corealloc.c | 14 +- src/lib/util/corefile.c | 14 + src/lib/util/corestr.c | 22 + src/lib/util/coreutil.c | 21 + src/lib/util/cstrpool.c | 26 +- src/lib/util/delegate.c | 17 +- src/lib/util/flac.c | 15 +- src/lib/util/harddisk.c | 34 + src/lib/util/hashing.c | 30 +- src/lib/util/huffman.c | 18 +- src/lib/util/jedparse.c | 12 + src/lib/util/md5.c | 10 + src/lib/util/opresolv.c | 21 +- src/lib/util/options.c | 34 +- src/lib/util/palette.c | 15 +- src/lib/util/plaparse.c | 12 + src/lib/util/png.c | 36 + src/lib/util/pool.c | 8 + src/lib/util/sha1.c | 54 ++ src/lib/util/tagmap.c | 2 + src/lib/util/un7z.c | 8 + src/lib/util/unicode.c | 20 + src/lib/util/unzip.c | 154 ++++ src/lib/util/vbiparse.c | 32 + src/lib/util/xmlfile.c | 169 ++++ src/lib/util/zippath.c | 250 ++++- src/mess/audio/mac.c | 2 +- src/mess/drivers/apexc.c | 2 +- src/mess/drivers/concept.c | 2 +- src/mess/drivers/exelv.c | 2 +- src/mess/drivers/lisa.c | 2 +- src/mess/drivers/mac.c | 2 +- src/mess/drivers/pdp1.c | 2 +- src/mess/drivers/ti990_10.c | 2 +- src/mess/drivers/ti99_2.c | 2 +- src/mess/drivers/tm990189.c | 2 +- src/mess/drivers/tutor.c | 2 +- src/mess/drivers/tx0.c | 2 +- src/mess/includes/concept.h | 2 +- src/mess/includes/lisa.h | 2 +- src/mess/includes/mac.h | 2 +- src/mess/includes/pdp1.h | 2 +- src/mess/includes/tx0.h | 2 +- src/mess/machine/applefdc.c | 2 +- src/mess/machine/applefdc.h | 2 +- src/mess/machine/concept.c | 2 +- src/mess/machine/lisa.c | 2 +- src/mess/machine/mac.c | 2 +- src/mess/machine/smartmed.c | 2 +- src/mess/machine/smartmed.h | 2 +- src/mess/machine/sonydriv.c | 2 +- src/mess/machine/sonydriv.h | 2 +- src/mess/machine/ti99/990_dk.c | 2 +- src/mess/machine/ti99/990_dk.h | 2 +- src/mess/machine/ti99/990_hd.c | 2 +- src/mess/machine/ti99/990_hd.h | 2 +- src/mess/machine/ti99/990_tap.c | 2 +- src/mess/machine/ti99/990_tap.h | 2 +- src/mess/tools/imgtool/imghd.c | 2 +- src/mess/tools/imgtool/modules/concept.c | 2 +- src/mess/tools/imgtool/modules/fat.c | 2 +- src/mess/tools/imgtool/modules/fat.h | 2 +- src/mess/tools/imgtool/modules/mac.c | 2 +- src/mess/tools/imgtool/modules/macbin.c | 2 +- src/mess/tools/imgtool/modules/macutil.c | 2 +- src/mess/tools/imgtool/modules/macutil.h | 2 +- src/mess/tools/imgtool/modules/pc_flop.c | 2 +- src/mess/tools/imgtool/modules/pc_hard.c | 2 +- src/mess/tools/imgtool/modules/prodos.c | 2 +- src/mess/tools/imgtool/modules/ti99.c | 2 +- src/mess/tools/imgtool/modules/ti990hd.c | 2 +- src/mess/tools/imgtool/modules/vzdos.c | 2 +- src/mess/video/733_asr.c | 2 +- src/mess/video/733_asr.h | 2 +- src/mess/video/911_chr.h | 2 +- src/mess/video/911_key.h | 2 +- src/mess/video/911_vdt.c | 2 +- src/mess/video/911_vdt.h | 2 +- src/mess/video/crt.c | 2 +- src/mess/video/crt.h | 2 +- src/mess/video/mac.c | 2 +- src/mess/video/pdp1.c | 2 +- src/mess/video/tx0.c | 2 +- 121 files changed, 3756 insertions(+), 620 deletions(-) diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c index 7a982e01f53..77e5c919f44 100644 --- a/src/emu/cpu/apexc/apexc.c +++ b/src/emu/cpu/apexc/apexc.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* cpu/apexc/apexc.c: APE(X)C CPU emulation diff --git a/src/emu/cpu/apexc/apexc.h b/src/emu/cpu/apexc/apexc.h index 98ebc825f35..538d903ab44 100644 --- a/src/emu/cpu/apexc/apexc.h +++ b/src/emu/cpu/apexc/apexc.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* register names for apexc_get_reg & apexc_set_reg */ #pragma once diff --git a/src/emu/cpu/apexc/apexcdsm.c b/src/emu/cpu/apexc/apexcdsm.c index c79359c7025..81effc58b0e 100644 --- a/src/emu/cpu/apexc/apexcdsm.c +++ b/src/emu/cpu/apexc/apexcdsm.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* cpu/apexc/apexcsm.c : APE(X)C CPU disassembler diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c index 3c414bd5ed6..bb7beee4128 100644 --- a/src/emu/cpu/pdp1/pdp1.c +++ b/src/emu/cpu/pdp1/pdp1.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* * Note: Original Java source written by: diff --git a/src/emu/cpu/pdp1/pdp1.h b/src/emu/cpu/pdp1/pdp1.h index c4c9c8c465e..f4d1281aa07 100644 --- a/src/emu/cpu/pdp1/pdp1.h +++ b/src/emu/cpu/pdp1/pdp1.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet #pragma once diff --git a/src/emu/cpu/pdp1/pdp1dasm.c b/src/emu/cpu/pdp1/pdp1dasm.c index 036aa3e2f22..c8682ca1491 100644 --- a/src/emu/cpu/pdp1/pdp1dasm.c +++ b/src/emu/cpu/pdp1/pdp1dasm.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet #include "emu.h" #include "cpu/pdp1/pdp1.h" diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c index 1a3ab230f4b..03c8441d88f 100644 --- a/src/emu/cpu/pdp1/tx0.c +++ b/src/emu/cpu/pdp1/tx0.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* TX-0 emulator diff --git a/src/emu/cpu/pdp1/tx0.h b/src/emu/cpu/pdp1/tx0.h index bdb492bbfc3..e88172bc8ff 100644 --- a/src/emu/cpu/pdp1/tx0.h +++ b/src/emu/cpu/pdp1/tx0.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet #pragma once diff --git a/src/emu/cpu/pdp1/tx0dasm.c b/src/emu/cpu/pdp1/tx0dasm.c index 8eef06f832e..3d8a1daf9e1 100644 --- a/src/emu/cpu/pdp1/tx0dasm.c +++ b/src/emu/cpu/pdp1/tx0dasm.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet #include "emu.h" #include "cpu/pdp1/tx0.h" diff --git a/src/emu/cpu/tms9900/9900dasm.c b/src/emu/cpu/tms9900/9900dasm.c index 010908290ed..7b3153e6c4c 100644 --- a/src/emu/cpu/tms9900/9900dasm.c +++ b/src/emu/cpu/tms9900/9900dasm.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /***************************************************************************** * diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h index 794be20fcb4..cb94fac286f 100644 --- a/src/emu/cpu/tms9900/99xxcore.h +++ b/src/emu/cpu/tms9900/99xxcore.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /*************************************************************************** diff --git a/src/emu/imagedev/harddriv.c b/src/emu/imagedev/harddriv.c index 3134506e61b..bc39d53e4b3 100644 --- a/src/emu/imagedev/harddriv.c +++ b/src/emu/imagedev/harddriv.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, Miodrag Milanovic /********************************************************************* diff --git a/src/emu/imagedev/harddriv.h b/src/emu/imagedev/harddriv.h index c80044478b2..f72dc0553f1 100644 --- a/src/emu/imagedev/harddriv.h +++ b/src/emu/imagedev/harddriv.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, Miodrag Milanovic /********************************************************************* diff --git a/src/emu/machine/at29040a.c b/src/emu/machine/at29040a.c index 31be262b7c1..3285b265792 100644 --- a/src/emu/machine/at29040a.c +++ b/src/emu/machine/at29040a.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, Michael Zapf /* Atmel at29c040a flash EEPROM diff --git a/src/emu/machine/at29040a.h b/src/emu/machine/at29040a.h index 0dc6473edff..1af258fb719 100644 --- a/src/emu/machine/at29040a.h +++ b/src/emu/machine/at29040a.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, Michael Zapf /* ATMEL 29040a diff --git a/src/emu/machine/corvushd.c b/src/emu/machine/corvushd.c index 659945da93d..0444d3cb530 100644 --- a/src/emu/machine/corvushd.c +++ b/src/emu/machine/corvushd.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brett Wyer, Raphael Nabet // // corvus_hd diff --git a/src/emu/machine/corvushd.h b/src/emu/machine/corvushd.h index 324fef4f1bf..bc83fa2585d 100644 --- a/src/emu/machine/corvushd.h +++ b/src/emu/machine/corvushd.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Brett Wyer, Raphael Nabet /***************************************************************************** * diff --git a/src/emu/machine/mm58274c.c b/src/emu/machine/mm58274c.c index bc1b27daede..db2d1d07dcf 100644 --- a/src/emu/machine/mm58274c.c +++ b/src/emu/machine/mm58274c.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /*************************************************************************** diff --git a/src/emu/machine/mm58274c.h b/src/emu/machine/mm58274c.h index 729e1a65fad..225340721ea 100644 --- a/src/emu/machine/mm58274c.h +++ b/src/emu/machine/mm58274c.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet #ifndef __MM58274C_H__ #define __MM58274C_H__ diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c index 0e5b8802754..074b8d87f48 100644 --- a/src/emu/machine/rtc65271.c +++ b/src/emu/machine/rtc65271.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, R. Belmont /* rtc65271 emulation diff --git a/src/emu/machine/rtc65271.h b/src/emu/machine/rtc65271.h index 326ccf7d116..b81e92755d5 100644 --- a/src/emu/machine/rtc65271.h +++ b/src/emu/machine/rtc65271.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, R. Belmont /* rtc65271.h: include file for rtc65271.c diff --git a/src/emu/machine/smc92x4.c b/src/emu/machine/smc92x4.c index 6a87f8b4bf6..9154648b00d 100644 --- a/src/emu/machine/smc92x4.c +++ b/src/emu/machine/smc92x4.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, Michael Zapf /* HDC9224 and HDC9234 Hard and Floppy Disk Controller diff --git a/src/emu/machine/smc92x4.h b/src/emu/machine/smc92x4.h index 9cc80b815ea..d8b4720c87a 100644 --- a/src/emu/machine/smc92x4.h +++ b/src/emu/machine/smc92x4.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, Michael Zapf /* Interface */ diff --git a/src/emu/machine/spchrom.c b/src/emu/machine/spchrom.c index ae906840f43..a49590e9e00 100644 --- a/src/emu/machine/spchrom.c +++ b/src/emu/machine/spchrom.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf /* spchroms.c - This is an emulator for "typical" speech ROMs from TI, as used by TI99/4(a). diff --git a/src/emu/machine/spchrom.h b/src/emu/machine/spchrom.h index e45ba8092e5..520c7fc967b 100644 --- a/src/emu/machine/spchrom.h +++ b/src/emu/machine/spchrom.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf /* * Voice Synthesis Memory diff --git a/src/emu/machine/strata.c b/src/emu/machine/strata.c index 26da2fb3f72..01651eb90bd 100644 --- a/src/emu/machine/strata.c +++ b/src/emu/machine/strata.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, Michael Zapf /* Intel 28F640J5 Flash ROM emulation (could also handle 28F320J5 with minor diff --git a/src/emu/machine/strata.h b/src/emu/machine/strata.h index f68a30e5fef..c037a24396b 100644 --- a/src/emu/machine/strata.h +++ b/src/emu/machine/strata.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet, Michael Zapf /* strata.h: header file for strata.c diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c index 388862728ea..972780279f3 100644 --- a/src/emu/sound/tms5220.c +++ b/src/emu/sound/tms5220.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf /********************************************************************************************** diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h index 6a9b36b723e..7150ce5457b 100644 --- a/src/emu/sound/tms5220.h +++ b/src/emu/sound/tms5220.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf #pragma once diff --git a/src/emu/video/tms3556.c b/src/emu/video/tms3556.c index 819e18840d8..9d073bdbe0d 100644 --- a/src/emu/video/tms3556.c +++ b/src/emu/video/tms3556.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* tms3556 emulation diff --git a/src/emu/video/tms3556.h b/src/emu/video/tms3556.h index 8c153ab2d5b..a331b8333e3 100644 --- a/src/emu/video/tms3556.h +++ b/src/emu/video/tms3556.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /*************************************************************************** diff --git a/src/lib/util/avhuff.c b/src/lib/util/avhuff.c index dd589c6abdd..cb00ab23336 100644 --- a/src/lib/util/avhuff.c +++ b/src/lib/util/avhuff.c @@ -143,7 +143,6 @@ inline void avhuff_encoder::deltarle_encoder::encode_one(bitstream_out &bitbuf, //------------------------------------------------- // decode_one - decode data //------------------------------------------------- - inline UINT32 avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf) { // return RLE data if we still have some @@ -174,9 +173,13 @@ inline UINT32 avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf) // AVHUFF ENCODER //************************************************************************** -//------------------------------------------------- -// avhuff_encoder - constructor -//------------------------------------------------- +/** + * @fn avhuff_encoder::avhuff_encoder() + * + * @brief ------------------------------------------------- + * avhuff_encoder - constructor + * -------------------------------------------------. + */ avhuff_encoder::avhuff_encoder() { @@ -185,11 +188,19 @@ m_flac_encoder.set_num_channels(1); m_flac_encoder.set_strip_metadata(true); } - -//------------------------------------------------- -// encode_data - encode a block of data into a -// compressed data stream -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength) + * + * @brief ------------------------------------------------- + * encode_data - encode a block of data into a compressed data stream + * -------------------------------------------------. + * + * @param source Source for the. + * @param [in,out] dest If non-null, destination for the. + * @param [in,out] complength The complength. + * + * @return An avhuff_error. + */ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength) { @@ -266,11 +277,17 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3 return AVHERR_NONE; } - -//------------------------------------------------- -// raw_data_size - return the raw data size of -// a raw stream based on the header -//------------------------------------------------- +/** + * @fn UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) + * + * @brief ------------------------------------------------- + * raw_data_size - return the raw data size of a raw stream based on the header + * -------------------------------------------------. + * + * @param data The data. + * + * @return An UINT32. + */ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) { @@ -290,11 +307,23 @@ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) return size; } - -//------------------------------------------------- -// assemble_data - assemble a datastream from raw -// bits -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize) + * + * @brief ------------------------------------------------- + * assemble_data - assemble a datastream from raw bits + * -------------------------------------------------. + * + * @param [in,out] buffer The buffer. + * @param [in,out] bitmap The bitmap. + * @param channels The channels. + * @param numsamples The numsamples. + * @param [in,out] samples If non-null, the samples. + * @param [in,out] metadata If non-null, the metadata. + * @param metadatasize The metadatasize. + * + * @return An avhuff_error. + */ avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize) { @@ -348,11 +377,21 @@ avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 return AVHERR_NONE; } - -//------------------------------------------------- -// encode_audio - encode raw audio data to the -// destination -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes) + * + * @brief ------------------------------------------------- + * encode_audio - encode raw audio data to the destination + * -------------------------------------------------. + * + * @param source Source for the. + * @param channels The channels. + * @param samples The samples. + * @param [in,out] dest If non-null, destination for the. + * @param [in,out] sizes If non-null, the sizes. + * + * @return An avhuff_error. + */ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes) { @@ -471,11 +510,21 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int return AVHERR_NONE; } - -//------------------------------------------------- -// encode_video - encode raw video data to the -// destination -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) + * + * @brief ------------------------------------------------- + * encode_video - encode raw video data to the destination + * -------------------------------------------------. + * + * @param source Source for the. + * @param width The width. + * @param height The height. + * @param [in,out] dest If non-null, destination for the. + * @param [in,out] complength The complength. + * + * @return An avhuff_error. + */ avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) { @@ -483,11 +532,22 @@ avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int he return encode_video_lossless(source, width, height, dest, complength); } - -//------------------------------------------------- -// encode_video_lossless - do a lossless video -// encoding using deltas and huffman encoding -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) + * + * @brief ------------------------------------------------- + * encode_video_lossless - do a lossless video encoding using deltas and huffman + * encoding + * -------------------------------------------------. + * + * @param source Source for the. + * @param width The width. + * @param height The height. + * @param [in,out] dest If non-null, destination for the. + * @param [in,out] complength The complength. + * + * @return An avhuff_error. + */ avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) { @@ -540,10 +600,20 @@ avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int widt // DELTA-RLE ENCODER //************************************************************************** -//------------------------------------------------- -// rle_and_histo_bitmap - RLE compress and -// histogram a bitmap's worth of data -//------------------------------------------------- +/** + * @fn UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count) + * + * @brief ------------------------------------------------- + * rle_and_histo_bitmap - RLE compress and histogram a bitmap's worth of data + * -------------------------------------------------. + * + * @param source Source for the. + * @param items_per_row The items per row. + * @param item_advance The item advance. + * @param row_count Number of rows. + * + * @return null if it fails, else an UINT16*. + */ UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count) { @@ -608,18 +678,27 @@ UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *sour // AVHUFF DECODER //************************************************************************** -//------------------------------------------------- -// avhuff_decoder - constructor -//------------------------------------------------- +/** + * @fn avhuff_decoder::avhuff_decoder() + * + * @brief ------------------------------------------------- + * avhuff_decoder - constructor + * -------------------------------------------------. + */ avhuff_decoder::avhuff_decoder() { } - -//------------------------------------------------- -// configure - configure decompression parameters -//------------------------------------------------- +/** + * @fn void avhuff_decoder::configure(const avhuff_decompress_config &config) + * + * @brief ------------------------------------------------- + * configure - configure decompression parameters + * -------------------------------------------------. + * + * @param config The configuration. + */ void avhuff_decoder::configure(const avhuff_decompress_config &config) { @@ -632,11 +711,19 @@ void avhuff_decoder::configure(const avhuff_decompress_config &config) m_config.metadata = config.metadata; } - -//------------------------------------------------- -// decode_data - decode both audio and video from -// a raw data stream -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest) + * + * @brief ------------------------------------------------- + * decode_data - decode both audio and video from a raw data stream + * -------------------------------------------------. + * + * @param source Source for the. + * @param complength The complength. + * @param [in,out] dest If non-null, destination for the. + * + * @return An avhuff_error. + */ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest) { @@ -765,11 +852,25 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, return AVHERR_NONE; } - -//------------------------------------------------- -// decode_audio - decode audio from a compressed -// data stream -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes) + * + * @brief ------------------------------------------------- + * decode_audio - decode audio from a compressed data stream + * -------------------------------------------------. + * + * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error + * condition occurs. + * + * @param channels The channels. + * @param samples The samples. + * @param source Source for the. + * @param [in,out] dest If non-null, destination for the. + * @param dxor The dxor. + * @param sizes The sizes. + * + * @return An avhuff_error. + */ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes) { @@ -889,11 +990,23 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 return AVHERR_NONE; } - -//------------------------------------------------- -// decode_video - decode video from a compressed -// data stream -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) + * + * @brief ------------------------------------------------- + * decode_video - decode video from a compressed data stream + * -------------------------------------------------. + * + * @param width The width. + * @param height The height. + * @param source Source for the. + * @param complength The complength. + * @param [in,out] dest If non-null, destination for the. + * @param dstride The dstride. + * @param dxor The dxor. + * + * @return An avhuff_error. + */ avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) { @@ -904,11 +1017,24 @@ avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *so return AVHERR_INVALID_DATA; } - -//------------------------------------------------- -// decode_video_lossless - do a lossless video -// decoding using deltas and huffman encoding -//------------------------------------------------- +/** + * @fn avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) + * + * @brief ------------------------------------------------- + * decode_video_lossless - do a lossless video decoding using deltas and huffman + * encoding + * -------------------------------------------------. + * + * @param width The width. + * @param height The height. + * @param source Source for the. + * @param complength The complength. + * @param [in,out] dest If non-null, destination for the. + * @param dstride The dstride. + * @param dxor The dxor. + * + * @return An avhuff_error. + */ avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) { diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c index 0d0403809f8..dcc14428716 100644 --- a/src/lib/util/aviio.c +++ b/src/lib/util/aviio.c @@ -18,59 +18,207 @@ CONSTANTS ***************************************************************************/ +/** + * @def FILETYPE_READ + * + * @brief A macro that defines filetype read. + */ + #define FILETYPE_READ 1 + +/** + * @def FILETYPE_CREATE + * + * @brief A macro that defines filetype create. + */ + #define FILETYPE_CREATE 2 +/** @brief Size of the maximum riff. */ #define MAX_RIFF_SIZE (2UL * 1024 * 1024 * 1024 - 1024) /* just under 2GB */ +/** @brief The maximum avi size in gigabytes. */ #define MAX_AVI_SIZE_IN_GB (256) + +/** + * @def FOUR_GB + * + * @brief A macro that defines four gigabytes. + */ + #define FOUR_GB ((UINT64)1 << 32) +/** + * @def MAX_SOUND_CHANNELS + * + * @brief A macro that defines maximum sound channels. + */ + #define MAX_SOUND_CHANNELS 2 + +/** + * @def SOUND_BUFFER_MSEC + * + * @brief A macro that defines sound buffer msec. + */ + #define SOUND_BUFFER_MSEC 2000 /* milliseconds of sound buffering */ +/** @brief The chunktype riff. */ #define CHUNKTYPE_RIFF AVI_FOURCC('R','I','F','F') +/** @brief List of chunktypes. */ #define CHUNKTYPE_LIST AVI_FOURCC('L','I','S','T') +/** @brief The chunktype junk. */ #define CHUNKTYPE_JUNK AVI_FOURCC('J','U','N','K') +/** @brief The chunktype avih. */ #define CHUNKTYPE_AVIH AVI_FOURCC('a','v','i','h') +/** @brief The chunktype strh. */ #define CHUNKTYPE_STRH AVI_FOURCC('s','t','r','h') +/** @brief The chunktype strf. */ #define CHUNKTYPE_STRF AVI_FOURCC('s','t','r','f') +/** @brief The first chunktype index. */ #define CHUNKTYPE_IDX1 AVI_FOURCC('i','d','x','1') +/** @brief The chunktype indx. */ #define CHUNKTYPE_INDX AVI_FOURCC('i','n','d','x') +/** @brief The chunktype xxdb. */ #define CHUNKTYPE_XXDB AVI_FOURCC(0x00,0x00,'d','b') +/** @brief The chunktype xxdc. */ #define CHUNKTYPE_XXDC AVI_FOURCC(0x00,0x00,'d','c') +/** @brief The chunktype xxwb. */ #define CHUNKTYPE_XXWB AVI_FOURCC(0x00,0x00,'w','b') +/** @brief The chunktype ixxx. */ #define CHUNKTYPE_IXXX AVI_FOURCC('i','x',0x00,0x00) +/** @brief The chunktype xx mask. */ #define CHUNKTYPE_XX_MASK AVI_FOURCC(0x00,0x00,0xff,0xff) +/** @brief The listtype avi. */ #define LISTTYPE_AVI AVI_FOURCC('A','V','I',' ') +/** @brief The listtype avix. */ #define LISTTYPE_AVIX AVI_FOURCC('A','V','I','X') +/** @brief The listtype hdrl. */ #define LISTTYPE_HDRL AVI_FOURCC('h','d','r','l') +/** @brief The listtype strl. */ #define LISTTYPE_STRL AVI_FOURCC('s','t','r','l') +/** @brief The listtype movi. */ #define LISTTYPE_MOVI AVI_FOURCC('m','o','v','i') +/** @brief The streamtype vids. */ #define STREAMTYPE_VIDS AVI_FOURCC('v','i','d','s') +/** @brief The streamtype auds. */ #define STREAMTYPE_AUDS AVI_FOURCC('a','u','d','s') +/** @brief The handler bitmap. */ #define HANDLER_DIB AVI_FOURCC('D','I','B',' ') +/** @brief The handler hfyu. */ #define HANDLER_HFYU AVI_FOURCC('h','f','y','u') /* main AVI header files */ + +/** + * @def AVIF_HASINDEX + * + * @brief A macro that defines avif hasindex. + */ + #define AVIF_HASINDEX 0x00000010 + +/** + * @def AVIF_MUSTUSEINDEX + * + * @brief A macro that defines avif mustuseindex. + */ + #define AVIF_MUSTUSEINDEX 0x00000020 + +/** + * @def AVIF_ISINTERLEAVED + * + * @brief A macro that defines avif isinterleaved. + */ + #define AVIF_ISINTERLEAVED 0x00000100 + +/** + * @def AVIF_COPYRIGHTED + * + * @brief A macro that defines avif copyrighted. + */ + #define AVIF_COPYRIGHTED 0x00010000 + +/** + * @def AVIF_WASCAPTUREFILE + * + * @brief A macro that defines avif wascapturefile. + */ + #define AVIF_WASCAPTUREFILE 0x00020000 /* index definitions */ + +/** + * @def AVI_INDEX_OF_INDEXES + * + * @brief A macro that defines avi index of indexes. + */ + #define AVI_INDEX_OF_INDEXES 0x00 + +/** + * @def AVI_INDEX_OF_CHUNKS + * + * @brief A macro that defines avi index of chunks. + */ + #define AVI_INDEX_OF_CHUNKS 0x01 + +/** + * @def AVI_INDEX_IS_DATA + * + * @brief A macro that defines avi index is data. + */ + #define AVI_INDEX_IS_DATA 0x80 + +/** + * @def AVI_INDEX_2FIELD + * + * @brief A macro that defines avi index 2 field. + */ + #define AVI_INDEX_2FIELD 0x01 /* HuffYUV definitions */ + +/** + * @def HUFFYUV_PREDICT_LEFT + * + * @brief A macro that defines huffyuv predict left. + */ + #define HUFFYUV_PREDICT_LEFT 0 + +/** + * @def HUFFYUV_PREDICT_GRADIENT + * + * @brief A macro that defines huffyuv predict gradient. + */ + #define HUFFYUV_PREDICT_GRADIENT 1 + +/** + * @def HUFFYUV_PREDICT_MEDIAN + * + * @brief A macro that defines huffyuv predict median. + */ + #define HUFFYUV_PREDICT_MEDIAN 2 + +/** + * @def HUFFYUV_PREDICT_DECORR + * + * @brief A macro that defines huffyuv predict decorr. + */ + #define HUFFYUV_PREDICT_DECORR 0x40 @@ -79,96 +227,177 @@ TYPE DEFINITIONS ***************************************************************************/ +/** + * @struct avi_chunk + * + * @brief An avi chunk. + */ + struct avi_chunk { + /** @brief The offset. */ UINT64 offset; /* file offset of chunk header */ + /** @brief The size. */ UINT64 size; /* size of this chunk */ + /** @brief The type. */ UINT32 type; /* type of this chunk */ + /** @brief The listtype. */ UINT32 listtype; /* type of this list (if we are a list) */ }; +/** + * @struct avi_chunk_list + * + * @brief List of avi chunks. + */ struct avi_chunk_list { + /** @brief The offset. */ UINT64 offset; /* offset in the file of header */ + /** @brief The length. */ UINT32 length; /* length of the chunk including header */ }; +/** + * @struct huffyuv_table + * + * @brief A huffyuv table. + */ struct huffyuv_table { + /** @brief The shift[ 256]. */ UINT8 shift[256]; /* bit shift amounts */ + /** @brief The bits[ 256]. */ UINT32 bits[256]; /* bit match values */ + /** @brief The mask[ 256]. */ UINT32 mask[256]; /* bit mask values */ + /** @brief The baselookup[ 65536]. */ UINT16 baselookup[65536]; /* base lookup table */ + /** @brief The extralookup. */ UINT16 * extralookup; /* extra lookup tables */ }; +/** + * @struct huffyuv_data + * + * @brief A huffyuv data. + */ struct huffyuv_data { + /** @brief The predictor. */ UINT8 predictor; /* predictor */ + /** @brief The table[ 3]. */ huffyuv_table table[3]; /* array of tables */ }; +/** + * @struct avi_stream + * + * @brief An avi stream. + */ struct avi_stream { + /** @brief The type. */ UINT32 type; /* subtype of stream */ + /** @brief Describes the format to use. */ UINT32 format; /* format of stream data */ + /** @brief The rate. */ UINT32 rate; /* timescale for stream */ + /** @brief The scale. */ UINT32 scale; /* duration of one sample in the stream */ + /** @brief The samples. */ UINT32 samples; /* number of samples */ + /** @brief The chunk. */ avi_chunk_list * chunk; /* list of chunks */ + /** @brief The chunks. */ UINT32 chunks; /* chunks currently known */ + /** @brief The chunksalloc. */ UINT32 chunksalloc; /* number of chunks allocated */ + /** @brief The width. */ UINT32 width; /* width of video */ + /** @brief The height. */ UINT32 height; /* height of video */ + /** @brief The depth. */ UINT32 depth; /* depth of video */ + /** @brief The interlace. */ UINT8 interlace; /* interlace parameters */ + /** @brief The huffyuv. */ huffyuv_data * huffyuv; /* huffyuv decompression data */ + /** @brief The channels. */ UINT16 channels; /* audio channels */ + /** @brief The samplebits. */ UINT16 samplebits; /* audio bits per sample */ + /** @brief The samplerate. */ UINT32 samplerate; /* audio sample rate */ /* only used when creating */ + /** @brief The saved strh offset. */ UINT64 saved_strh_offset; /* writeoffset of strh chunk */ + /** @brief The saved indx offset. */ UINT64 saved_indx_offset; /* writeoffset of indx chunk */ }; +/** + * @struct avi_file + * + * @brief An avi file. + */ struct avi_file { /* shared data */ + /** @brief The file. */ osd_file * file; /* pointer to open file */ + /** @brief The type. */ int type; /* type of access (read/create) */ + /** @brief The information. */ avi_movie_info info; /* movie info structure */ + /** @brief The tempbuffer. */ UINT8 * tempbuffer; /* temporary buffer */ + /** @brief The tempbuffersize. */ UINT32 tempbuffersize; /* size of the temporary buffer */ /* only used when reading */ + /** @brief The streams. */ int streams; /* number of streams */ + /** @brief The stream. */ avi_stream * stream; /* allocated array of stream information */ + /** @brief The rootchunk. */ avi_chunk rootchunk; /* dummy root chunk that wraps the whole file */ /* only used when creating */ + /** @brief The writeoffs. */ UINT64 writeoffs; /* current file write offset */ + /** @brief The riffbase. */ UINT64 riffbase; /* base of the current RIFF */ + /** @brief The chunkstack[ 8]. */ avi_chunk chunkstack[8]; /* stack of chunks we are writing */ + /** @brief The chunksp. */ int chunksp; /* stack pointer for the current chunk */ + /** @brief The saved movi offset. */ UINT64 saved_movi_offset; /* writeoffset of movi list */ + /** @brief The saved avih offset. */ UINT64 saved_avih_offset; /* writeoffset of avih chunk */ + /** @brief The soundbuf. */ INT16 * soundbuf; /* buffer for sound data */ + /** @brief The soundbuf samples. */ UINT32 soundbuf_samples; /* length of sound buffer in samples */ + /** @brief The soundbuf chansamples[ maximum sound channels]. */ UINT32 soundbuf_chansamples[MAX_SOUND_CHANNELS]; /* samples in buffer for each channel */ + /** @brief The soundbuf chunks. */ UINT32 soundbuf_chunks; /* number of chunks completed so far */ + /** @brief The soundbuf frames. */ UINT32 soundbuf_frames; /* number of frames ahead of the video */ }; @@ -241,6 +470,16 @@ static void printf_chunk_recursive(avi_file *file, avi_chunk *chunk, int indent) from the given buffer -------------------------------------------------*/ +/** + * @fn INLINE UINT16 fetch_16bits(const UINT8 *data) + * + * @brief Fetches the 16bits. + * + * @param data The data. + * + * @return The 16bits. + */ + INLINE UINT16 fetch_16bits(const UINT8 *data) { return data[0] | (data[1] << 8); @@ -252,6 +491,16 @@ INLINE UINT16 fetch_16bits(const UINT8 *data) from the given buffer -------------------------------------------------*/ +/** + * @fn INLINE UINT32 fetch_32bits(const UINT8 *data) + * + * @brief Fetches the 32bits. + * + * @param data The data. + * + * @return The 32bits. + */ + INLINE UINT32 fetch_32bits(const UINT8 *data) { return data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); @@ -263,6 +512,16 @@ INLINE UINT32 fetch_32bits(const UINT8 *data) from the given buffer -------------------------------------------------*/ +/** + * @fn INLINE UINT64 fetch_64bits(const UINT8 *data) + * + * @brief Fetches the 64bits. + * + * @param data The data. + * + * @return The 64bits. + */ + INLINE UINT64 fetch_64bits(const UINT8 *data) { return (UINT64)data[0] | ((UINT64)data[1] << 8) | @@ -277,6 +536,15 @@ INLINE UINT64 fetch_64bits(const UINT8 *data) to the given buffer -------------------------------------------------*/ +/** + * @fn INLINE void put_16bits(UINT8 *data, UINT16 value) + * + * @brief Puts the 16bits. + * + * @param [in,out] data If non-null, the data. + * @param value The value. + */ + INLINE void put_16bits(UINT8 *data, UINT16 value) { data[0] = value >> 0; @@ -289,6 +557,15 @@ INLINE void put_16bits(UINT8 *data, UINT16 value) to the given buffer -------------------------------------------------*/ +/** + * @fn INLINE void put_32bits(UINT8 *data, UINT32 value) + * + * @brief Puts the 32bits. + * + * @param [in,out] data If non-null, the data. + * @param value The value. + */ + INLINE void put_32bits(UINT8 *data, UINT32 value) { data[0] = value >> 0; @@ -303,6 +580,15 @@ INLINE void put_32bits(UINT8 *data, UINT32 value) to the given buffer -------------------------------------------------*/ +/** + * @fn INLINE void put_64bits(UINT8 *data, UINT64 value) + * + * @brief Puts the 64bits. + * + * @param [in,out] data If non-null, the data. + * @param value The value. + */ + INLINE void put_64bits(UINT8 *data, UINT64 value) { data[0] = value >> 0; @@ -321,6 +607,16 @@ INLINE void put_64bits(UINT8 *data, UINT64 value) video stream -------------------------------------------------*/ +/** + * @fn INLINE avi_stream *get_video_stream(avi_file *file) + * + * @brief Gets video stream. + * + * @param [in,out] file If non-null, the file. + * + * @return null if it fails, else the video stream. + */ + INLINE avi_stream *get_video_stream(avi_file *file) { int streamnum; @@ -339,6 +635,18 @@ INLINE avi_stream *get_video_stream(avi_file *file) audio stream for the 'n'th channel -------------------------------------------------*/ +/** + * @fn INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) + * + * @brief Gets audio stream. + * + * @param [in,out] file If non-null, the file. + * @param channel The channel. + * @param [in,out] offset If non-null, the offset. + * + * @return null if it fails, else the audio stream. + */ + INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) { int streamnum; @@ -365,6 +673,19 @@ INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset) for a given chunk within a stream -------------------------------------------------*/ +/** + * @fn INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length) + * + * @brief Sets stream chunk information. + * + * @param [in,out] stream If non-null, the stream. + * @param index Zero-based index of the. + * @param offset The offset. + * @param length The length. + * + * @return An avi_error. + */ + INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length) { /* if we need to allocate more, allocate more */ @@ -398,6 +719,16 @@ INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 idx1 chunk -------------------------------------------------*/ +/** + * @fn INLINE UINT32 compute_idx1_size(avi_file *file) + * + * @brief Calculates the index 1 size. + * + * @param [in,out] file If non-null, the file. + * + * @return The calculated index 1 size. + */ + INLINE UINT32 compute_idx1_size(avi_file *file) { int chunks = 0; @@ -416,6 +747,17 @@ INLINE UINT32 compute_idx1_size(avi_file *file) a given stream -------------------------------------------------*/ +/** + * @fn INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) + * + * @brief Gets chunkid for stream. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * + * @return The chunkid for stream. + */ + INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) { UINT32 chunkid; @@ -435,6 +777,17 @@ INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream) number, get the first sample number -------------------------------------------------*/ +/** + * @fn INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) + * + * @brief Framenum to samplenum. + * + * @param [in,out] file If non-null, the file. + * @param framenum The framenum. + * + * @return An UINT32. + */ + INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) { return ((UINT64)file->info.audio_samplerate * (UINT64)framenum * (UINT64)file->info.video_sampletime + file->info.video_timescale - 1) / (UINT64)file->info.video_timescale; @@ -447,6 +800,17 @@ INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum) requested amount of data -------------------------------------------------*/ +/** + * @fn INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length) + * + * @brief Expand tempbuffer. + * + * @param [in,out] file If non-null, the file. + * @param length The length. + * + * @return An avi_error. + */ + INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length) { /* expand the tempbuffer to hold the data if necessary */ @@ -473,6 +837,17 @@ INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length) avi_open - open an AVI movie file for read -------------------------------------------------*/ +/** + * @fn avi_error avi_open(const char *filename, avi_file **file) + * + * @brief Queries if a given avi open. + * + * @param filename Filename of the file. + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + avi_error avi_open(const char *filename, avi_file **file) { avi_file *newfile = NULL; @@ -525,6 +900,18 @@ error: avi_create - create a new AVI movie file -------------------------------------------------*/ +/** + * @fn avi_error avi_create(const char *filename, const avi_movie_info *info, avi_file **file) + * + * @brief Avi create. + * + * @param filename Filename of the file. + * @param info The information. + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + avi_error avi_create(const char *filename, const avi_movie_info *info, avi_file **file) { avi_file *newfile = NULL; @@ -632,6 +1019,16 @@ error: avi_close - close an AVI movie file -------------------------------------------------*/ +/** + * @fn avi_error avi_close(avi_file *file) + * + * @brief Avi close. + * + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + avi_error avi_close(avi_file *file) { avi_error avierr = AVIERR_NONE; @@ -706,6 +1103,14 @@ avi_error avi_close(avi_file *file) avi_printf_chunks - print the chunks in a file -------------------------------------------------*/ +/** + * @fn void avi_printf_chunks(avi_file *file) + * + * @brief Avi printf chunks. + * + * @param [in,out] file If non-null, the file. + */ + void avi_printf_chunks(avi_file *file) { printf_chunk_recursive(file, &file->rootchunk, 0); @@ -717,6 +1122,16 @@ void avi_printf_chunks(avi_file *file) an avi_error -------------------------------------------------*/ +/** + * @fn const char *avi_error_string(avi_error err) + * + * @brief Avi error string. + * + * @param err The error. + * + * @return null if it fails, else a char*. + */ + const char *avi_error_string(avi_error err) { switch (err) @@ -748,6 +1163,16 @@ const char *avi_error_string(avi_error err) movie info -------------------------------------------------*/ +/** + * @fn const avi_movie_info *avi_get_movie_info(avi_file *file) + * + * @brief Avi get movie information. + * + * @param [in,out] file If non-null, the file. + * + * @return null if it fails, else an avi_movie_info*. + */ + const avi_movie_info *avi_get_movie_info(avi_file *file) { return &file->info; @@ -759,6 +1184,17 @@ const avi_movie_info *avi_get_movie_info(avi_file *file) to a sample index -------------------------------------------------*/ +/** + * @fn UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum) + * + * @brief Avi first sample in frame. + * + * @param [in,out] file If non-null, the file. + * @param framenum The framenum. + * + * @return An UINT32. + */ + UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum) { return framenum_to_samplenum(file, framenum); @@ -771,6 +1207,18 @@ UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum) converting to YUY16 format -------------------------------------------------*/ +/** + * @fn avi_error avi_read_video_frame(avi_file *file, UINT32 framenum, bitmap_yuy16 &bitmap) + * + * @brief Avi read video frame. + * + * @param [in,out] file If non-null, the file. + * @param framenum The framenum. + * @param [in,out] bitmap The bitmap. + * + * @return An avi_error. + */ + avi_error avi_read_video_frame(avi_file *file, UINT32 framenum, bitmap_yuy16 &bitmap) { avi_error avierr = AVIERR_NONE; @@ -829,6 +1277,20 @@ avi_error avi_read_video_frame(avi_file *file, UINT32 framenum, bitmap_yuy16 &bi data from an AVI file -------------------------------------------------*/ +/** + * @fn avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample, UINT32 numsamples, INT16 *output) + * + * @brief Avi read sound samples. + * + * @param [in,out] file If non-null, the file. + * @param channel The channel. + * @param firstsample The firstsample. + * @param numsamples The numsamples. + * @param [in,out] output If non-null, the output. + * + * @return An avi_error. + */ + avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample, UINT32 numsamples, INT16 *output) { avi_error avierr = AVIERR_NONE; @@ -935,6 +1397,17 @@ avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample of video in YUY16 format -------------------------------------------------*/ +/** + * @fn avi_error avi_append_video_frame(avi_file *file, bitmap_yuy16 &bitmap) + * + * @brief Avi append video frame. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] bitmap The bitmap. + * + * @return An avi_error. + */ + avi_error avi_append_video_frame(avi_file *file, bitmap_yuy16 &bitmap) { avi_stream *stream = get_video_stream(file); @@ -982,6 +1455,17 @@ avi_error avi_append_video_frame(avi_file *file, bitmap_yuy16 &bitmap) of video in RGB32 format -------------------------------------------------*/ +/** + * @fn avi_error avi_append_video_frame(avi_file *file, bitmap_rgb32 &bitmap) + * + * @brief Avi append video frame. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] bitmap The bitmap. + * + * @return An avi_error. + */ + avi_error avi_append_video_frame(avi_file *file, bitmap_rgb32 &bitmap) { avi_stream *stream = get_video_stream(file); @@ -1033,6 +1517,20 @@ avi_error avi_append_video_frame(avi_file *file, bitmap_rgb32 &bitmap) samples -------------------------------------------------*/ +/** + * @fn avi_error avi_append_sound_samples(avi_file *file, int channel, const INT16 *samples, UINT32 numsamples, UINT32 sampleskip) + * + * @brief Avi append sound samples. + * + * @param [in,out] file If non-null, the file. + * @param channel The channel. + * @param samples The samples. + * @param numsamples The numsamples. + * @param sampleskip The sampleskip. + * + * @return An avi_error. + */ + avi_error avi_append_sound_samples(avi_file *file, int channel, const INT16 *samples, UINT32 numsamples, UINT32 sampleskip) { UINT32 sampoffset = file->soundbuf_chansamples[channel]; @@ -1062,6 +1560,18 @@ avi_error avi_append_sound_samples(avi_file *file, int channel, const INT16 *sam memory -------------------------------------------------*/ +/** + * @fn static avi_error read_chunk_data(avi_file *file, const avi_chunk *chunk, UINT8 **buffer) + * + * @brief Reads chunk data. + * + * @param [in,out] file If non-null, the file. + * @param chunk The chunk. + * @param [in,out] buffer If non-null, the buffer. + * + * @return The chunk data. + */ + static avi_error read_chunk_data(avi_file *file, const avi_chunk *chunk, UINT8 **buffer) { file_error filerr; @@ -1090,6 +1600,18 @@ static avi_error read_chunk_data(avi_file *file, const avi_chunk *chunk, UINT8 * first chunk in a container -------------------------------------------------*/ +/** + * @fn static avi_error get_first_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk) + * + * @brief Gets the first chunk. + * + * @param [in,out] file If non-null, the file. + * @param parent The parent. + * @param [in,out] newchunk If non-null, the newchunk. + * + * @return The first chunk. + */ + static avi_error get_first_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk) { UINT64 startoffset = (parent != NULL && parent->type != 0) ? parent->offset + 12 : 0; @@ -1104,6 +1626,18 @@ static avi_error get_first_chunk(avi_file *file, const avi_chunk *parent, avi_ch next chunk in a container -------------------------------------------------*/ +/** + * @fn static avi_error get_next_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk) + * + * @brief Gets the next chunk. + * + * @param [in,out] file If non-null, the file. + * @param parent The parent. + * @param [in,out] newchunk If non-null, the newchunk. + * + * @return The next chunk. + */ + static avi_error get_next_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk) { UINT64 nextoffset = newchunk->offset + 8 + newchunk->size + (newchunk->size & 1); @@ -1116,6 +1650,19 @@ static avi_error get_next_chunk(avi_file *file, const avi_chunk *parent, avi_chu first chunk of a particular type in a container -------------------------------------------------*/ +/** + * @fn static avi_error find_first_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) + * + * @brief Searches for the first chunk. + * + * @param [in,out] file If non-null, the file. + * @param findme The findme. + * @param container The container. + * @param [out] result If non-null, the result. + * + * @return The found chunk. + */ + static avi_error find_first_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) { avi_error avierr; @@ -1133,6 +1680,19 @@ static avi_error find_first_chunk(avi_file *file, UINT32 findme, const avi_chunk next chunk of a particular type in a container -------------------------------------------------*/ +/** + * @fn static avi_error find_next_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) + * + * @brief Searches for the next chunk. + * + * @param [in,out] file If non-null, the file. + * @param findme The findme. + * @param container The container. + * @param [out] result If non-null, the result. + * + * @return The found chunk. + */ + static avi_error find_next_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) { avi_error avierr; @@ -1150,6 +1710,19 @@ static avi_error find_next_chunk(avi_file *file, UINT32 findme, const avi_chunk first list of a particular type in a container -------------------------------------------------*/ +/** + * @fn static avi_error find_first_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) + * + * @brief Searches for the first list. + * + * @param [in,out] file If non-null, the file. + * @param findme The findme. + * @param container The container. + * @param [out] result If non-null, the result. + * + * @return The found list. + */ + static avi_error find_first_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) { avi_error avierr; @@ -1167,6 +1740,19 @@ static avi_error find_first_list(avi_file *file, UINT32 findme, const avi_chunk next list of a particular type in a container -------------------------------------------------*/ +/** + * @fn static avi_error find_next_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) + * + * @brief Searches for the next list. + * + * @param [in,out] file If non-null, the file. + * @param findme The findme. + * @param container The container. + * @param [out] result If non-null, the result. + * + * @return The found list. + */ + static avi_error find_next_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result) { avi_error avierr; @@ -1184,6 +1770,19 @@ static avi_error find_next_list(avi_file *file, UINT32 findme, const avi_chunk * chunk relative to the current one -------------------------------------------------*/ +/** + * @fn static avi_error get_next_chunk_internal(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk, UINT64 offset) + * + * @brief Gets the next chunk internal. + * + * @param [in,out] file If non-null, the file. + * @param parent The parent. + * @param [in,out] newchunk If non-null, the newchunk. + * @param offset The offset. + * + * @return The next chunk internal. + */ + static avi_error get_next_chunk_internal(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk, UINT64 offset) { file_error filerr; @@ -1227,6 +1826,16 @@ static avi_error get_next_chunk_internal(avi_file *file, const avi_chunk *parent read_movie_data - get data about a movie -------------------------------------------------*/ +/** + * @fn static avi_error read_movie_data(avi_file *file) + * + * @brief Reads movie data. + * + * @param [in,out] file If non-null, the file. + * + * @return The movie data. + */ + static avi_error read_movie_data(avi_file *file) { avi_chunk riff, hdrl, avih, strl, strh, strf, indx, movi, idx1; @@ -1328,6 +1937,16 @@ error: from the streams we've read -------------------------------------------------*/ +/** + * @fn static avi_error extract_movie_info(avi_file *file) + * + * @brief Extracts the movie information described by file. + * + * @param [in,out] file If non-null, the file. + * + * @return The extracted movie information. + */ + static avi_error extract_movie_info(avi_file *file) { //avi_stream *audiostream; @@ -1389,6 +2008,17 @@ static avi_error extract_movie_info(avi_file *file) chunk -------------------------------------------------*/ +/** + * @fn static avi_error parse_avih_chunk(avi_file *file, avi_chunk *avih) + * + * @brief Parse avih chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] avih If non-null, the avih. + * + * @return An avi_error. + */ + static avi_error parse_avih_chunk(avi_file *file, avi_chunk *avih) { UINT8 *chunkdata = NULL; @@ -1420,6 +2050,18 @@ error: chunk -------------------------------------------------*/ +/** + * @fn static avi_error parse_strh_chunk(avi_file *file, avi_stream *stream, avi_chunk *strh) + * + * @brief Parse strh chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * @param [in,out] strh If non-null, the strh. + * + * @return An avi_error. + */ + static avi_error parse_strh_chunk(avi_file *file, avi_stream *stream, avi_chunk *strh) { UINT8 *chunkdata = NULL; @@ -1448,6 +2090,18 @@ error: chunk -------------------------------------------------*/ +/** + * @fn static avi_error parse_strf_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf) + * + * @brief Parse strf chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * @param [in,out] strf If non-null, the strf. + * + * @return An avi_error. + */ + static avi_error parse_strf_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf) { UINT8 *chunkdata = NULL; @@ -1492,6 +2146,18 @@ error: parse_indx_chunk - parse an indx chunk -------------------------------------------------*/ +/** + * @fn static avi_error parse_indx_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf) + * + * @brief Parse indx chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * @param [in,out] strf If non-null, the strf. + * + * @return An avi_error. + */ + static avi_error parse_indx_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf) { UINT32 entries, entry; @@ -1582,6 +2248,18 @@ error: parse_idx1_chunk - parse an idx1 chunk -------------------------------------------------*/ +/** + * @fn static avi_error parse_idx1_chunk(avi_file *file, UINT64 baseoffset, avi_chunk *idx1) + * + * @brief Parse index 1 chunk. + * + * @param [in,out] file If non-null, the file. + * @param baseoffset The baseoffset. + * @param [in,out] idx1 If non-null, the first index. + * + * @return An avi_error. + */ + static avi_error parse_idx1_chunk(avi_file *file, UINT64 baseoffset, avi_chunk *idx1) { UINT8 *chunkdata = NULL; @@ -1632,6 +2310,19 @@ error: chunk_open - open a new chunk for writing -------------------------------------------------*/ +/** + * @fn static avi_error chunk_open(avi_file *file, UINT32 type, UINT32 listtype, UINT32 estlength) + * + * @brief Queries if a given chunk open. + * + * @param [in,out] file If non-null, the file. + * @param type The type. + * @param listtype The listtype. + * @param estlength The estlength. + * + * @return An avi_error. + */ + static avi_error chunk_open(avi_file *file, UINT32 type, UINT32 listtype, UINT32 estlength) { file_error filerr; @@ -1690,6 +2381,16 @@ static avi_error chunk_open(avi_file *file, UINT32 type, UINT32 listtype, UINT32 chunk_close - finish writing an chunk -------------------------------------------------*/ +/** + * @fn static avi_error chunk_close(avi_file *file) + * + * @brief Chunk close. + * + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + static avi_error chunk_close(avi_file *file) { avi_chunk *chunk = &file->chunkstack[--file->chunksp]; @@ -1723,6 +2424,19 @@ static avi_error chunk_close(avi_file *file) chunk_write - write an chunk and its data -------------------------------------------------*/ +/** + * @fn static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT32 length) + * + * @brief Chunk write. + * + * @param [in,out] file If non-null, the file. + * @param type The type. + * @param data The data. + * @param length The length. + * + * @return An avi_error. + */ + static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT32 length) { file_error filerr; @@ -1794,6 +2508,21 @@ static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT original -------------------------------------------------*/ +/** + * @fn static avi_error chunk_overwrite(avi_file *file, UINT32 type, const void *data, UINT32 length, UINT64 *offset, int initial_write) + * + * @brief Chunk overwrite. + * + * @param [in,out] file If non-null, the file. + * @param type The type. + * @param data The data. + * @param length The length. + * @param [in,out] offset If non-null, the offset. + * @param initial_write The initial write. + * + * @return An avi_error. + */ + static avi_error chunk_overwrite(avi_file *file, UINT32 type, const void *data, UINT32 length, UINT64 *offset, int initial_write) { UINT64 savedoffset = 0; @@ -1826,6 +2555,16 @@ static avi_error chunk_overwrite(avi_file *file, UINT32 type, const void *data, set of AVI and stream headers -------------------------------------------------*/ +/** + * @fn static avi_error write_initial_headers(avi_file *file) + * + * @brief Writes an initial headers. + * + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + static avi_error write_initial_headers(avi_file *file) { avi_error avierr; @@ -1898,6 +2637,17 @@ static avi_error write_initial_headers(avi_file *file) chunk -------------------------------------------------*/ +/** + * @fn static avi_error write_avih_chunk(avi_file *file, int initial_write) + * + * @brief Writes an avih chunk. + * + * @param [in,out] file If non-null, the file. + * @param initial_write The initial write. + * + * @return An avi_error. + */ + static avi_error write_avih_chunk(avi_file *file, int initial_write) { avi_stream *video = get_video_stream(file); @@ -1923,6 +2673,18 @@ static avi_error write_avih_chunk(avi_file *file, int initial_write) chunk -------------------------------------------------*/ +/** + * @fn static avi_error write_strh_chunk(avi_file *file, avi_stream *stream, int initial_write) + * + * @brief Writes a strh chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * @param initial_write The initial write. + * + * @return An avi_error. + */ + static avi_error write_strh_chunk(avi_file *file, avi_stream *stream, int initial_write) { UINT8 buffer[56]; @@ -1966,6 +2728,17 @@ static avi_error write_strh_chunk(avi_file *file, avi_stream *stream, int initia chunk -------------------------------------------------*/ +/** + * @fn static avi_error write_strf_chunk(avi_file *file, avi_stream *stream) + * + * @brief Writes a strf chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * + * @return An avi_error. + */ + static avi_error write_strf_chunk(avi_file *file, avi_stream *stream) { /* video stream */ @@ -2019,6 +2792,18 @@ static avi_error write_strf_chunk(avi_file *file, avi_stream *stream) chunk -------------------------------------------------*/ +/** + * @fn static avi_error write_indx_chunk(avi_file *file, avi_stream *stream, int initial_write) + * + * @brief Writes an indx chunk. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] stream If non-null, the stream. + * @param initial_write The initial write. + * + * @return An avi_error. + */ + static avi_error write_indx_chunk(avi_file *file, avi_stream *stream, int initial_write) { UINT8 buffer[24 + 16 * MAX_AVI_SIZE_IN_GB / 4]; @@ -2115,6 +2900,16 @@ static avi_error write_indx_chunk(avi_file *file, avi_stream *stream, int initia write_idx1_chunk - write the idx1 chunk -------------------------------------------------*/ +/** + * @fn static avi_error write_idx1_chunk(avi_file *file) + * + * @brief Writes an index 1 chunk. + * + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + static avi_error write_idx1_chunk(avi_file *file) { UINT32 tempbuflength = compute_idx1_size(file) - 8; @@ -2164,6 +2959,16 @@ static avi_error write_idx1_chunk(avi_file *file) buffering system -------------------------------------------------*/ +/** + * @fn static avi_error soundbuf_initialize(avi_file *file) + * + * @brief Soundbuf initialize. + * + * @param [in,out] file If non-null, the file. + * + * @return An avi_error. + */ + static avi_error soundbuf_initialize(avi_file *file) { avi_stream *audio = get_audio_stream(file, 0, NULL); @@ -2197,6 +3002,17 @@ static avi_error soundbuf_initialize(avi_file *file) chunk data -------------------------------------------------*/ +/** + * @fn static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum) + * + * @brief Soundbuf write chunk. + * + * @param [in,out] file If non-null, the file. + * @param framenum The framenum. + * + * @return An avi_error. + */ + static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum) { avi_stream *stream = get_audio_stream(file, 0, NULL); @@ -2229,6 +3045,17 @@ static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum) buffers -------------------------------------------------*/ +/** + * @fn static avi_error soundbuf_flush(avi_file *file, int only_flush_full) + * + * @brief Soundbuf flush. + * + * @param [in,out] file If non-null, the file. + * @param only_flush_full The only flush full. + * + * @return An avi_error. + */ + static avi_error soundbuf_flush(avi_file *file, int only_flush_full) { avi_stream *stream = get_audio_stream(file, 0, NULL); @@ -2322,6 +3149,19 @@ static avi_error soundbuf_flush(avi_file *file, int only_flush_full) bitmap to an RGB encoded frame -------------------------------------------------*/ +/** + * @fn static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_rgb32 &bitmap, UINT8 *data, UINT32 numbytes) + * + * @brief RGB 32 compress to RGB. + * + * @param [in,out] stream If non-null, the stream. + * @param bitmap The bitmap. + * @param [in,out] data If non-null, the data. + * @param numbytes The numbytes. + * + * @return An avi_error. + */ + static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_rgb32 &bitmap, UINT8 *data, UINT32 numbytes) { int height = MIN(stream->height, bitmap.height()); @@ -2373,6 +3213,19 @@ static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_rgb32 &b encoded frame to a YUY16 bitmap -------------------------------------------------*/ +/** + * @fn static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap) + * + * @brief Yuv decompress to yuy 16. + * + * @param [in,out] stream If non-null, the stream. + * @param data The data. + * @param numbytes The numbytes. + * @param [in,out] bitmap The bitmap. + * + * @return An avi_error. + */ + static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap) { const UINT16 *dataend = (const UINT16 *)(data + numbytes); @@ -2412,6 +3265,19 @@ static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, bitmap to a YUV encoded frame -------------------------------------------------*/ +/** + * @fn static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_yuy16 &bitmap, UINT8 *data, UINT32 numbytes) + * + * @brief Yuy 16 compress to yuy. + * + * @param [in,out] stream If non-null, the stream. + * @param bitmap The bitmap. + * @param [in,out] data If non-null, the data. + * @param numbytes The numbytes. + * + * @return An avi_error. + */ + static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_yuy16 &bitmap, UINT8 *data, UINT32 numbytes) { const UINT16 *dataend = (const UINT16 *)(data + numbytes); @@ -2451,6 +3317,18 @@ static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_yuy16 &b tables -------------------------------------------------*/ +/** + * @fn static avi_error huffyuv_extract_tables(avi_stream *stream, const UINT8 *chunkdata, UINT32 size) + * + * @brief Huffyuv extract tables. + * + * @param [in,out] stream If non-null, the stream. + * @param chunkdata The chunkdata. + * @param size The size. + * + * @return An avi_error. + */ + static avi_error huffyuv_extract_tables(avi_stream *stream, const UINT8 *chunkdata, UINT32 size) { const UINT8 *chunkend = chunkdata + size; @@ -2590,6 +3468,19 @@ error: HuffYUV-encoded frame to a YUY16 bitmap -------------------------------------------------*/ +/** + * @fn static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap) + * + * @brief Huffyuv decompress to yuy 16. + * + * @param [in,out] stream If non-null, the stream. + * @param data The data. + * @param numbytes The numbytes. + * @param [in,out] bitmap The bitmap. + * + * @return An avi_error. + */ + static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap) { huffyuv_data *huffyuv = stream->huffyuv; @@ -2793,6 +3684,14 @@ static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *da return AVIERR_NONE; } +/** + * @fn static void u64toa(UINT64 val, char *output) + * + * @brief 64toas. + * + * @param val The value. + * @param [in,out] output If non-null, the output. + */ static void u64toa(UINT64 val, char *output) { @@ -2810,6 +3709,16 @@ static void u64toa(UINT64 val, char *output) about a chunk recursively -------------------------------------------------*/ +/** + * @fn static void printf_chunk_recursive(avi_file *file, avi_chunk *container, int indent) + * + * @brief Printf chunk recursive. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] container If non-null, the container. + * @param indent The indent. + */ + static void printf_chunk_recursive(avi_file *file, avi_chunk *container, int indent) { char size[20], offset[20]; diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c index a6e7b02f957..e9e941f3fc5 100644 --- a/src/lib/util/bitmap.c +++ b/src/lib/util/bitmap.c @@ -20,9 +20,9 @@ // CONSTANTS //************************************************************************** -// alignment values; 128 bytes is the largest cache line on typical -// architectures today +/** @brief alignment values; 128 bytes is the largest cache line on typical architectures today. */ const UINT32 BITMAP_OVERALL_ALIGN = 128; +/** @brief The bitmap rowbytes align. */ const UINT32 BITMAP_ROWBYTES_ALIGN = 128; @@ -61,9 +61,20 @@ inline void bitmap_t::compute_base(int xslop, int yslop) // BITMAP ALLOCATION/CONFIGURATION //************************************************************************** -//------------------------------------------------- -// bitmap_t - basic constructor -//------------------------------------------------- +/** + * @fn bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xslop, int yslop) + * + * @brief ------------------------------------------------- + * bitmap_t - basic constructor + * -------------------------------------------------. + * + * @param format Describes the format to use. + * @param bpp The bits per pixel. + * @param width The width. + * @param height The height. + * @param xslop The xslop. + * @param yslop The yslop. + */ bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xslop, int yslop) : m_alloc(NULL), @@ -76,6 +87,18 @@ bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xsl allocate(width, height, xslop, yslop); } +/** + * @fn bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int height, int rowpixels) + * + * @brief Constructor. + * + * @param format Describes the format to use. + * @param bpp The bits per pixel. + * @param [in,out] base If non-null, the base. + * @param width The width. + * @param height The height. + * @param rowpixels The rowpixels. + */ bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int height, int rowpixels) : m_alloc(NULL), @@ -91,6 +114,16 @@ bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int hei { } +/** + * @fn bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect) + * + * @brief Constructor. + * + * @param format Describes the format to use. + * @param bpp The bits per pixel. + * @param [in,out] source Source for the. + * @param subrect The subrect. + */ bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect) : m_alloc(NULL), @@ -109,10 +142,13 @@ bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectan assert(source.cliprect().contains(subrect)); } - -//------------------------------------------------- -// ~bitmap_t - basic destructor -//------------------------------------------------- +/** + * @fn bitmap_t::~bitmap_t() + * + * @brief ------------------------------------------------- + * ~bitmap_t - basic destructor + * -------------------------------------------------. + */ bitmap_t::~bitmap_t() { @@ -120,12 +156,19 @@ bitmap_t::~bitmap_t() reset(); } - -//------------------------------------------------- -// allocate -- (re)allocate memory for the bitmap -// at the given size, destroying anything that -// already exists -//------------------------------------------------- +/** + * @fn void bitmap_t::allocate(int width, int height, int xslop, int yslop) + * + * @brief ------------------------------------------------- + * allocate -- (re)allocate memory for the bitmap at the given size, destroying + * anything that already exists + * -------------------------------------------------. + * + * @param width The width. + * @param height The height. + * @param xslop The xslop. + * @param yslop The yslop. + */ void bitmap_t::allocate(int width, int height, int xslop, int yslop) { @@ -157,12 +200,19 @@ void bitmap_t::allocate(int width, int height, int xslop, int yslop) compute_base(xslop, yslop); } - -//------------------------------------------------- -// resize -- resize a bitmap, reusing existing -// memory if the new size is smaller than the -// current size -//------------------------------------------------- +/** + * @fn void bitmap_t::resize(int width, int height, int xslop, int yslop) + * + * @brief ------------------------------------------------- + * resize -- resize a bitmap, reusing existing memory if the new size is smaller than + * the current size + * -------------------------------------------------. + * + * @param width The width. + * @param height The height. + * @param xslop The xslop. + * @param yslop The yslop. + */ void bitmap_t::resize(int width, int height, int xslop, int yslop) { @@ -197,11 +247,13 @@ void bitmap_t::resize(int width, int height, int xslop, int yslop) compute_base(xslop, yslop); } - -//------------------------------------------------- -// reset -- reset to an invalid bitmap, deleting -// all allocated stuff -//------------------------------------------------- +/** + * @fn void bitmap_t::reset() + * + * @brief ------------------------------------------------- + * reset -- reset to an invalid bitmap, deleting all allocated stuff + * -------------------------------------------------. + */ void bitmap_t::reset() { @@ -218,11 +270,18 @@ void bitmap_t::reset() m_cliprect.set(0, -1, 0, -1); } - -//------------------------------------------------- -// wrap -- wrap an array of memory; the target -// bitmap does not own the memory -//------------------------------------------------- +/** + * @fn void bitmap_t::wrap(void *base, int width, int height, int rowpixels) + * + * @brief ------------------------------------------------- + * wrap -- wrap an array of memory; the target bitmap does not own the memory + * -------------------------------------------------. + * + * @param [in,out] base If non-null, the base. + * @param width The width. + * @param height The height. + * @param rowpixels The rowpixels. + */ void bitmap_t::wrap(void *base, int width, int height, int rowpixels) { @@ -237,12 +296,17 @@ void bitmap_t::wrap(void *base, int width, int height, int rowpixels) m_cliprect.set(0, m_width - 1, 0, m_height - 1); } - -//------------------------------------------------- -// wrap -- wrap a subrectangle of an existing -// bitmap by copying its fields; the target -// bitmap does not own the memory -//------------------------------------------------- +/** + * @fn void bitmap_t::wrap(const bitmap_t &source, const rectangle &subrect) + * + * @brief ------------------------------------------------- + * wrap -- wrap a subrectangle of an existing bitmap by copying its fields; the target + * bitmap does not own the memory + * -------------------------------------------------. + * + * @param source Source for the. + * @param subrect The subrect. + */ void bitmap_t::wrap(const bitmap_t &source, const rectangle &subrect) { @@ -262,11 +326,15 @@ void bitmap_t::wrap(const bitmap_t &source, const rectangle &subrect) m_cliprect.set(0, m_width - 1, 0, m_height - 1); } - -//------------------------------------------------- -// set_palette -- associate a palette with a -// bitmap -//------------------------------------------------- +/** + * @fn void bitmap_t::set_palette(palette_t *palette) + * + * @brief ------------------------------------------------- + * set_palette -- associate a palette with a bitmap + * -------------------------------------------------. + * + * @param [in,out] palette If non-null, the palette. + */ void bitmap_t::set_palette(palette_t *palette) { @@ -285,10 +353,16 @@ void bitmap_t::set_palette(palette_t *palette) } } - -//------------------------------------------------- -// fill -- fill a bitmap with a solid color -//------------------------------------------------- +/** + * @fn void bitmap_t::fill(UINT32 color, const rectangle &cliprect) + * + * @brief ------------------------------------------------- + * fill -- fill a bitmap with a solid color + * -------------------------------------------------. + * + * @param color The color. + * @param cliprect The cliprect. + */ void bitmap_t::fill(UINT32 color, const rectangle &cliprect) { diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c index 6655418583a..40f3caf4190 100644 --- a/src/lib/util/cdrom.c +++ b/src/lib/util/cdrom.c @@ -28,11 +28,41 @@ DEBUGGING ***************************************************************************/ +/** @brief The verbose. */ #define VERBOSE (0) #if VERBOSE + +/** + * @def LOG(x) do + * + * @brief A macro that defines log. + * + * @param x The void to process. + */ + #define LOG(x) do { if (VERBOSE) logerror x; } while (0) + +/** + * @fn void CLIB_DECL logerror(const char *text, ...) ATTR_PRINTF(1,2); + * + * @brief Logerrors the given text. + * + * @param text The text. + * + * @return A CLIB_DECL. + */ + void CLIB_DECL logerror(const char *text, ...) ATTR_PRINTF(1,2); #else + +/** + * @def LOG(x); + * + * @brief A macro that defines log. + * + * @param x The void to process. + */ + #define LOG(x) #endif @@ -42,18 +72,27 @@ void CLIB_DECL logerror(const char *text, ...) ATTR_PRINTF(1,2); CONSTANTS ***************************************************************************/ -const int SYNC_OFFSET = 0x000; // offset within sector -const int SYNC_NUM_BYTES = 12; // 12 bytes +/** @brief offset within sector. */ +const int SYNC_OFFSET = 0x000; +/** @brief 12 bytes. */ +const int SYNC_NUM_BYTES = 12; -const int MODE_OFFSET = 0x00f; // offset within sector +/** @brief offset within sector. */ +const int MODE_OFFSET = 0x00f; -const int ECC_P_OFFSET = 0x81c; // offset within sector -const int ECC_P_NUM_BYTES = 86; // 2 lots of 86 -const int ECC_P_COMP = 24; // 24 bytes each +/** @brief offset within sector. */ +const int ECC_P_OFFSET = 0x81c; +/** @brief 2 lots of 86. */ +const int ECC_P_NUM_BYTES = 86; +/** @brief 24 bytes each. */ +const int ECC_P_COMP = 24; +/** @brief The ECC q offset. */ const int ECC_Q_OFFSET = ECC_P_OFFSET + 2 * ECC_P_NUM_BYTES; -const int ECC_Q_NUM_BYTES = 52; // 2 lots of 52 -const int ECC_Q_COMP = 43; // 43 bytes each +/** @brief 2 lots of 52. */ +const int ECC_Q_NUM_BYTES = 52; +/** @brief 43 bytes each. */ +const int ECC_Q_COMP = 43; @@ -61,11 +100,21 @@ const int ECC_Q_COMP = 43; // 43 bytes each TYPE DEFINITIONS ***************************************************************************/ +/** + * @struct cdrom_file + * + * @brief A cdrom file. + */ + struct cdrom_file { + /** @brief The chd. */ chd_file * chd; /* CHD file */ + /** @brief The cdtoc. */ cdrom_toc cdtoc; /* TOC for the CD */ + /** @brief Information describing the track. */ chdcd_track_input_info track_info; /* track info */ + /** @brief The fhandle[ CD maximum tracks]. */ core_file * fhandle[CD_MAX_TRACKS];/* file handle */ }; @@ -80,6 +129,18 @@ struct cdrom_file and the track number -------------------------------------------------*/ +/** + * @fn INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) + * + * @brief Physical to chd lba. + * + * @param [in,out] file If non-null, the file. + * @param physlba The physlba. + * @param [in,out] tracknum The tracknum. + * + * @return An UINT32. + */ + INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) { UINT32 chdlba; @@ -102,6 +163,18 @@ INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &trac and the track number -------------------------------------------------*/ +/** + * @fn INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) + * + * @brief Logical to chd lba. + * + * @param [in,out] file If non-null, the file. + * @param loglba The loglba. + * @param [in,out] tracknum The tracknum. + * + * @return An UINT32. + */ + INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) { UINT32 chdlba, physlba; @@ -134,6 +207,16 @@ INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &trackn BASE FUNCTIONALITY ***************************************************************************/ +/** + * @fn cdrom_file *cdrom_open(const char *inputfile) + * + * @brief Queries if a given cdrom open. + * + * @param inputfile The inputfile. + * + * @return null if it fails, else a cdrom_file*. + */ + cdrom_file *cdrom_open(const char *inputfile) { int i; @@ -220,6 +303,16 @@ cdrom_file *cdrom_open(const char *inputfile) already-opened CHD file -------------------------------------------------*/ +/** + * @fn cdrom_file *cdrom_open(chd_file *chd) + * + * @brief Queries if a given cdrom open. + * + * @param [in,out] chd If non-null, the chd. + * + * @return null if it fails, else a cdrom_file*. + */ + cdrom_file *cdrom_open(chd_file *chd) { int i; @@ -308,6 +401,14 @@ cdrom_file *cdrom_open(chd_file *chd) cdrom_close - "close" a CD-ROM file -------------------------------------------------*/ +/** + * @fn void cdrom_close(cdrom_file *file) + * + * @brief Cdrom close. + * + * @param [in,out] file If non-null, the file. + */ + void cdrom_close(cdrom_file *file) { if (file == NULL) @@ -330,6 +431,22 @@ void cdrom_close(cdrom_file *file) CORE READ ACCESS ***************************************************************************/ +/** + * @fn chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UINT32 chdsector, UINT32 tracknum, UINT32 startoffs, UINT32 length) + * + * @brief Reads partial sector. + * + * @param [in,out] file If non-null, the file. + * @param [in,out] dest If non-null, destination for the. + * @param lbasector The lbasector. + * @param chdsector The chdsector. + * @param tracknum The tracknum. + * @param startoffs The startoffs. + * @param length The length. + * + * @return The partial sector. + */ + chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UINT32 chdsector, UINT32 tracknum, UINT32 startoffs, UINT32 length) { chd_error result = CHDERR_NONE; @@ -388,6 +505,20 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI from a CD-ROM -------------------------------------------------*/ +/** + * @fn UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys) + * + * @brief Cdrom read data. + * + * @param [in,out] file If non-null, the file. + * @param lbasector The lbasector. + * @param [in,out] buffer If non-null, the buffer. + * @param datatype The datatype. + * @param phys true to physical. + * + * @return An UINT32. + */ + UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys) { if (file == NULL) @@ -460,6 +591,19 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 a sector -------------------------------------------------*/ +/** + * @fn UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys) + * + * @brief Cdrom read subcode. + * + * @param [in,out] file If non-null, the file. + * @param lbasector The lbasector. + * @param [in,out] buffer If non-null, the buffer. + * @param phys true to physical. + * + * @return An UINT32. + */ + UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys) { if (file == NULL) @@ -497,6 +641,17 @@ UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool for a physical frame number -------------------------------------------------*/ +/** + * @fn UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame) + * + * @brief Cdrom get track. + * + * @param [in,out] file If non-null, the file. + * @param frame The frame. + * + * @return An UINT32. + */ + UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame) { UINT32 track = 0; @@ -516,6 +671,17 @@ UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame) that a track starts at -------------------------------------------------*/ +/** + * @fn UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track) + * + * @brief Cdrom get track start. + * + * @param [in,out] file If non-null, the file. + * @param track The track. + * + * @return An UINT32. + */ + UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track) { if (file == NULL) @@ -533,6 +699,17 @@ UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track) physical frame number that a track starts at -------------------------------------------------*/ +/** + * @fn UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track) + * + * @brief Cdrom get track start physical. + * + * @param [in,out] file If non-null, the file. + * @param track The track. + * + * @return An UINT32. + */ + UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track) { if (file == NULL) @@ -554,6 +731,16 @@ UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track) number -------------------------------------------------*/ +/** + * @fn int cdrom_get_last_track(cdrom_file *file) + * + * @brief Cdrom get last track. + * + * @param [in,out] file If non-null, the file. + * + * @return An int. + */ + int cdrom_get_last_track(cdrom_file *file) { if (file == NULL) @@ -568,6 +755,17 @@ int cdrom_get_last_track(cdrom_file *file) for a track -------------------------------------------------*/ +/** + * @fn int cdrom_get_adr_control(cdrom_file *file, int track) + * + * @brief Cdrom get address control. + * + * @param [in,out] file If non-null, the file. + * @param track The track. + * + * @return An int. + */ + int cdrom_get_adr_control(cdrom_file *file, int track) { if (file == NULL) @@ -586,6 +784,17 @@ int cdrom_get_adr_control(cdrom_file *file, int track) cdrom_get_track_type - return the track type -------------------------------------------------*/ +/** + * @fn int cdrom_get_track_type(cdrom_file *file, int track) + * + * @brief Cdrom get track type. + * + * @param [in,out] file If non-null, the file. + * @param track The track. + * + * @return An int. + */ + int cdrom_get_track_type(cdrom_file *file, int track) { if (file == NULL) @@ -600,6 +809,16 @@ int cdrom_get_track_type(cdrom_file *file, int track) CD-ROM -------------------------------------------------*/ +/** + * @fn const cdrom_toc *cdrom_get_toc(cdrom_file *file) + * + * @brief Cdrom get TOC. + * + * @param [in,out] file If non-null, the file. + * + * @return null if it fails, else a cdrom_toc*. + */ + const cdrom_toc *cdrom_get_toc(cdrom_file *file) { if (file == NULL) @@ -620,6 +839,16 @@ const cdrom_toc *cdrom_get_toc(cdrom_file *file) and track data size -------------------------------------------------*/ +/** + * @fn static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trktype, UINT32 *datasize) + * + * @brief Cdrom get information from type string. + * + * @param typestring The typestring. + * @param [in,out] trktype If non-null, the trktype. + * @param [in,out] datasize If non-null, the datasize. + */ + static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trktype, UINT32 *datasize) { if (!strcmp(typestring, "MODE1")) @@ -705,6 +934,15 @@ static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trkt and track data size -------------------------------------------------*/ +/** + * @fn void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info) + * + * @brief Cdrom convert type string to track information. + * + * @param typestring The typestring. + * @param [in,out] info If non-null, the information. + */ + void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info) { cdrom_get_info_from_type_string(typestring, &info->trktype, &info->datasize); @@ -716,6 +954,15 @@ void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track and pregap data size -------------------------------------------------*/ +/** + * @fn void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info) + * + * @brief Cdrom convert type string to pregap information. + * + * @param typestring The typestring. + * @param [in,out] info If non-null, the information. + */ + void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info) { cdrom_get_info_from_type_string(typestring, &info->pgtype, &info->pgdatasize); @@ -727,6 +974,15 @@ void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_trac and track subcode data size -------------------------------------------------*/ +/** + * @fn void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info) + * + * @brief Cdrom convert subtype string to track information. + * + * @param typestring The typestring. + * @param [in,out] info If non-null, the information. + */ + void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info) { if (!strcmp(typestring, "RW")) @@ -747,6 +1003,15 @@ void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_tr and track subcode data size -------------------------------------------------*/ +/** + * @fn void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info) + * + * @brief Cdrom convert subtype string to pregap information. + * + * @param typestring The typestring. + * @param [in,out] info If non-null, the information. + */ + void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info) { if (!strcmp(typestring, "RW")) @@ -766,6 +1031,16 @@ void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_t associated with the given type -------------------------------------------------*/ +/** + * @fn const char *cdrom_get_type_string(UINT32 trktype) + * + * @brief Cdrom get type string. + * + * @param trktype The trktype. + * + * @return null if it fails, else a char*. + */ + const char *cdrom_get_type_string(UINT32 trktype) { switch (trktype) @@ -788,6 +1063,16 @@ const char *cdrom_get_type_string(UINT32 trktype) associated with the given subcode type -------------------------------------------------*/ +/** + * @fn const char *cdrom_get_subtype_string(UINT32 subtype) + * + * @brief Cdrom get subtype string. + * + * @param subtype The subtype. + * + * @return null if it fails, else a char*. + */ + const char *cdrom_get_subtype_string(UINT32 subtype) { switch (subtype) @@ -809,6 +1094,17 @@ const char *cdrom_get_subtype_string(UINT32 subtype) TOC structure -------------------------------------------------*/ +/** + * @fn chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) + * + * @brief Cdrom parse metadata. + * + * @param [in,out] chd If non-null, the chd. + * @param [in,out] toc If non-null, the TOC. + * + * @return A chd_error. + */ + chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) { std::string metadata; @@ -975,6 +1271,17 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) cdrom_write_metadata - write metadata -------------------------------------------------*/ +/** + * @fn chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc) + * + * @brief Cdrom write metadata. + * + * @param [in,out] chd If non-null, the chd. + * @param toc The TOC. + * + * @return A chd_error. + */ + chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc) { chd_error err; @@ -1019,11 +1326,11 @@ chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc) return CHDERR_NONE; } - -//------------------------------------------------- -// ECC lookup tables -// pre-calculated tables for ECC data calcs -//------------------------------------------------- +/** + * @brief ------------------------------------------------- + * ECC lookup tables pre-calculated tables for ECC data calcs + * -------------------------------------------------. + */ static const UINT8 ecclow[256] = { @@ -1045,6 +1352,7 @@ static const UINT8 ecclow[256] = 0xfd, 0xff, 0xf9, 0xfb, 0xf5, 0xf7, 0xf1, 0xf3, 0xed, 0xef, 0xe9, 0xeb, 0xe5, 0xe7, 0xe1, 0xe3 }; +/** @brief The ecchigh[ 256]. */ static const UINT8 ecchigh[256] = { 0x00, 0xf4, 0xf5, 0x01, 0xf7, 0x03, 0x02, 0xf6, 0xf3, 0x07, 0x06, 0xf2, 0x04, 0xf0, 0xf1, 0x05, @@ -1065,13 +1373,12 @@ static const UINT8 ecchigh[256] = 0x50, 0xa4, 0xa5, 0x51, 0xa7, 0x53, 0x52, 0xa6, 0xa3, 0x57, 0x56, 0xa2, 0x54, 0xa0, 0xa1, 0x55 }; - -//------------------------------------------------- -// poffsets - each row represents the addresses -// used to calculate a byte of the ECC P data -// 86 (*2) ECC P bytes, 24 values represented by -// each -//------------------------------------------------- +/** + * @brief ------------------------------------------------- + * poffsets - each row represents the addresses used to calculate a byte of the ECC P + * data 86 (*2) ECC P bytes, 24 values represented by each + * -------------------------------------------------. + */ static const UINT16 poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] = { @@ -1163,13 +1470,12 @@ static const UINT16 poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] = { 0x055,0x0ab,0x101,0x157,0x1ad,0x203,0x259,0x2af,0x305,0x35b,0x3b1,0x407,0x45d,0x4b3,0x509,0x55f,0x5b5,0x60b,0x661,0x6b7,0x70d,0x763,0x7b9,0x80f } }; - -//------------------------------------------------- -// qoffsets - each row represents the addresses -// used to calculate a byte of the ECC Q data -// 52 (*2) ECC Q bytes, 43 values represented by -// each -//------------------------------------------------- +/** + * @brief ------------------------------------------------- + * qoffsets - each row represents the addresses used to calculate a byte of the ECC Q + * data 52 (*2) ECC Q bytes, 43 values represented by each + * -------------------------------------------------. + */ static const UINT16 qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] = { @@ -1240,11 +1546,19 @@ inline UINT8 ecc_source_byte(const UINT8 *sector, UINT32 offset) return (sector[MODE_OFFSET] == 2 && offset < 4) ? 0x00 : sector[SYNC_OFFSET + SYNC_NUM_BYTES + offset]; } - -//------------------------------------------------- -// ecc_compute_bytes - calculate an ECC value -// (P or Q) -//------------------------------------------------- +/** + * @fn void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 &val1, UINT8 &val2) + * + * @brief ------------------------------------------------- + * ecc_compute_bytes - calculate an ECC value (P or Q) + * -------------------------------------------------. + * + * @param sector The sector. + * @param row The row. + * @param rowlen The rowlen. + * @param [in,out] val1 The first value. + * @param [in,out] val2 The second value. + */ void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 &val1, UINT8 &val2) { @@ -1259,11 +1573,17 @@ void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 val2 ^= val1; } - -//------------------------------------------------- -// ecc_verify - verify the P and Q ECC codes in -// a sector -//------------------------------------------------- +/** + * @fn bool ecc_verify(const UINT8 *sector) + * + * @brief ------------------------------------------------- + * ecc_verify - verify the P and Q ECC codes in a sector + * -------------------------------------------------. + * + * @param sector The sector. + * + * @return true if it succeeds, false if it fails. + */ bool ecc_verify(const UINT8 *sector) { @@ -1287,11 +1607,16 @@ bool ecc_verify(const UINT8 *sector) return true; } - -//------------------------------------------------- -// ecc_generate - generate the P and Q ECC codes -// for a sector, overwriting any existing codes -//------------------------------------------------- +/** + * @fn void ecc_generate(UINT8 *sector) + * + * @brief ------------------------------------------------- + * ecc_generate - generate the P and Q ECC codes for a sector, overwriting any + * existing codes + * -------------------------------------------------. + * + * @param [in,out] sector If non-null, the sector. + */ void ecc_generate(UINT8 *sector) { @@ -1304,11 +1629,15 @@ void ecc_generate(UINT8 *sector) ecc_compute_bytes(sector, qoffsets[byte], ECC_Q_COMP, sector[ECC_Q_OFFSET + byte], sector[ECC_Q_OFFSET + ECC_Q_NUM_BYTES + byte]); } - -//------------------------------------------------- -// ecc_clear - erase the ECC P and Q cods to 0 -// within a sector -//------------------------------------------------- +/** + * @fn void ecc_clear(UINT8 *sector) + * + * @brief ------------------------------------------------- + * ecc_clear - erase the ECC P and Q cods to 0 within a sector + * -------------------------------------------------. + * + * @param [in,out] sector If non-null, the sector. + */ void ecc_clear(UINT8 *sector) { diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c index 3dd088c0121..f9bdf179f8a 100644 --- a/src/lib/util/chd.c +++ b/src/lib/util/chd.c @@ -57,23 +57,37 @@ enum // V5 compression types enum { + ///< codec #0 // these types are live when running - COMPRESSION_TYPE_0 = 0, // codec #0 - COMPRESSION_TYPE_1 = 1, // codec #1 - COMPRESSION_TYPE_2 = 2, // codec #2 - COMPRESSION_TYPE_3 = 3, // codec #3 - COMPRESSION_NONE = 4, // no compression; implicit length = hunkbytes - COMPRESSION_SELF = 5, // same as another block in this chd - COMPRESSION_PARENT = 6, // same as a hunk's worth of units in the parent chd + COMPRESSION_TYPE_0 = 0, + ///< codec #1 + COMPRESSION_TYPE_1 = 1, + ///< codec #2 + COMPRESSION_TYPE_2 = 2, + ///< codec #3 + COMPRESSION_TYPE_3 = 3, + ///< no compression; implicit length = hunkbytes + COMPRESSION_NONE = 4, + ///< same as another block in this chd + COMPRESSION_SELF = 5, + ///< same as a hunk's worth of units in the parent chd + COMPRESSION_PARENT = 6, + ///< start of small RLE run (4-bit length) // these additional pseudo-types are used for compressed encodings: - COMPRESSION_RLE_SMALL, // start of small RLE run (4-bit length) - COMPRESSION_RLE_LARGE, // start of large RLE run (8-bit length) - COMPRESSION_SELF_0, // same as the last COMPRESSION_SELF block - COMPRESSION_SELF_1, // same as the last COMPRESSION_SELF block + 1 - COMPRESSION_PARENT_SELF, // same block in the parent - COMPRESSION_PARENT_0, // same as the last COMPRESSION_PARENT block - COMPRESSION_PARENT_1 // same as the last COMPRESSION_PARENT block + 1 + COMPRESSION_RLE_SMALL, + ///< start of large RLE run (8-bit length) + COMPRESSION_RLE_LARGE, + ///< same as the last COMPRESSION_SELF block + COMPRESSION_SELF_0, + ///< same as the last COMPRESSION_SELF block + 1 + COMPRESSION_SELF_1, + ///< same block in the parent + COMPRESSION_PARENT_SELF, + ///< same as the last COMPRESSION_PARENT block + COMPRESSION_PARENT_0, + ///< same as the last COMPRESSION_PARENT block + 1 + COMPRESSION_PARENT_1 }; @@ -265,9 +279,13 @@ inline UINT8 chd_file::bits_for_value(UINT64 value) // CHD FILE MANAGEMENT //************************************************************************** -//------------------------------------------------- -// chd_file - constructor -//------------------------------------------------- +/** + * @fn chd_file::chd_file() + * + * @brief ------------------------------------------------- + * chd_file - constructor + * -------------------------------------------------. + */ chd_file::chd_file() : m_file(NULL), @@ -278,10 +296,13 @@ chd_file::chd_file() close(); } - -//------------------------------------------------- -// ~chd_file - destructor -//------------------------------------------------- +/** + * @fn chd_file::~chd_file() + * + * @brief ------------------------------------------------- + * ~chd_file - destructor + * -------------------------------------------------. + */ chd_file::~chd_file() { @@ -289,10 +310,15 @@ chd_file::~chd_file() close(); } - -//------------------------------------------------- -// sha1 - return our SHA1 value -//------------------------------------------------- +/** + * @fn sha1_t chd_file::sha1() + * + * @brief ------------------------------------------------- + * sha1 - return our SHA1 value + * -------------------------------------------------. + * + * @return A sha1_t. + */ sha1_t chd_file::sha1() { @@ -310,10 +336,18 @@ sha1_t chd_file::sha1() } } - -//------------------------------------------------- -// raw_sha1 - return our raw SHA1 value -//------------------------------------------------- +/** + * @fn sha1_t chd_file::raw_sha1() + * + * @brief ------------------------------------------------- + * raw_sha1 - return our raw SHA1 value + * -------------------------------------------------. + * + * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error + * condition occurs. + * + * @return A sha1_t. + */ sha1_t chd_file::raw_sha1() { @@ -335,10 +369,18 @@ sha1_t chd_file::raw_sha1() } } - -//------------------------------------------------- -// parent_sha1 - return our parent's SHA1 value -//------------------------------------------------- +/** + * @fn sha1_t chd_file::parent_sha1() + * + * @brief ------------------------------------------------- + * parent_sha1 - return our parent's SHA1 value + * -------------------------------------------------. + * + * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error + * condition occurs. + * + * @return A sha1_t. + */ sha1_t chd_file::parent_sha1() { @@ -360,11 +402,19 @@ sha1_t chd_file::parent_sha1() } } - -//------------------------------------------------- -// hunk_info - return information about this -// hunk -//------------------------------------------------- +/** + * @fn chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes) + * + * @brief ------------------------------------------------- + * hunk_info - return information about this hunk + * -------------------------------------------------. + * + * @param hunknum The hunknum. + * @param [in,out] compressor The compressor. + * @param [in,out] compbytes The compbytes. + * + * @return A chd_error. + */ chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes) { @@ -463,10 +513,15 @@ chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 return CHDERR_NONE; } - -//------------------------------------------------- -// set_raw_sha1 - set our SHA1 values -//------------------------------------------------- +/** + * @fn void chd_file::set_raw_sha1(sha1_t rawdata) + * + * @brief ------------------------------------------------- + * set_raw_sha1 - set our SHA1 values + * -------------------------------------------------. + * + * @param rawdata The rawdata. + */ void chd_file::set_raw_sha1(sha1_t rawdata) { @@ -484,10 +539,17 @@ void chd_file::set_raw_sha1(sha1_t rawdata) metadata_update_hash(); } - -//------------------------------------------------- -// set_parent_sha1 - set the parent SHA1 value -//------------------------------------------------- +/** + * @fn void chd_file::set_parent_sha1(sha1_t parent) + * + * @brief ------------------------------------------------- + * set_parent_sha1 - set the parent SHA1 value + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition occurs. + * + * @param parent The parent. + */ void chd_file::set_parent_sha1(sha1_t parent) { @@ -504,11 +566,21 @@ void chd_file::set_parent_sha1(sha1_t parent) file_write(m_parentsha1_offset, rawbuf, sizeof(rawbuf)); } - -//------------------------------------------------- -// create - create a new file with no parent -// using an existing opened file handle -//------------------------------------------------- +/** + * @fn chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) + * + * @brief ------------------------------------------------- + * create - create a new file with no parent using an existing opened file handle + * -------------------------------------------------. + * + * @param [in,out] file The file. + * @param logicalbytes The logicalbytes. + * @param hunkbytes The hunkbytes. + * @param unitbytes The unitbytes. + * @param compression The compression. + * + * @return A chd_error. + */ chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) { @@ -529,11 +601,21 @@ chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbyte return create_common(); } - -//------------------------------------------------- -// create - create a new file with a parent -// using an existing opened file handle -//------------------------------------------------- +/** + * @fn chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) + * + * @brief ------------------------------------------------- + * create - create a new file with a parent using an existing opened file handle + * -------------------------------------------------. + * + * @param [in,out] file The file. + * @param logicalbytes The logicalbytes. + * @param hunkbytes The hunkbytes. + * @param compression The compression. + * @param [in,out] parent The parent. + * + * @return A chd_error. + */ chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) { @@ -554,11 +636,21 @@ chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbyte return create_common(); } - -//------------------------------------------------- -// create - create a new file with no parent -// using a filename -//------------------------------------------------- +/** + * @fn chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) + * + * @brief ------------------------------------------------- + * create - create a new file with no parent using a filename + * -------------------------------------------------. + * + * @param filename Filename of the file. + * @param logicalbytes The logicalbytes. + * @param hunkbytes The hunkbytes. + * @param unitbytes The unitbytes. + * @param compression The compression. + * + * @return A chd_error. + */ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) { @@ -585,11 +677,21 @@ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hun return chderr; } - -//------------------------------------------------- -// create - create a new file with a parent -// using a filename -//------------------------------------------------- +/** + * @fn chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) + * + * @brief ------------------------------------------------- + * create - create a new file with a parent using a filename + * -------------------------------------------------. + * + * @param filename Filename of the file. + * @param logicalbytes The logicalbytes. + * @param hunkbytes The hunkbytes. + * @param compression The compression. + * @param [in,out] parent The parent. + * + * @return A chd_error. + */ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) { @@ -616,11 +718,19 @@ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hun return chderr; } - -//------------------------------------------------- -// open - open an existing file for read or -// read/write -//------------------------------------------------- +/** + * @fn chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent) + * + * @brief ------------------------------------------------- + * open - open an existing file for read or read/write + * -------------------------------------------------. + * + * @param filename Filename of the file. + * @param writeable true if writeable. + * @param [in,out] parent If non-null, the parent. + * + * @return A chd_error. + */ chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent) { @@ -648,11 +758,19 @@ chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent) return err; } - -//------------------------------------------------- -// open - open an existing file for read or -// read/write -//------------------------------------------------- +/** + * @fn chd_error chd_file::open(core_file &file, bool writeable, chd_file *parent) + * + * @brief ------------------------------------------------- + * open - open an existing file for read or read/write + * -------------------------------------------------. + * + * @param [in,out] file The file. + * @param writeable true if writeable. + * @param [in,out] parent If non-null, the parent. + * + * @return A chd_error. + */ chd_error chd_file::open(core_file &file, bool writeable, chd_file *parent) { @@ -667,10 +785,13 @@ chd_error chd_file::open(core_file &file, bool writeable, chd_file *parent) return open_common(writeable); } - -//------------------------------------------------- -// close - close a CHD file for access -//------------------------------------------------- +/** + * @fn void chd_file::close() + * + * @brief ------------------------------------------------- + * close - close a CHD file for access + * -------------------------------------------------. + */ void chd_file::close() { @@ -719,10 +840,28 @@ void chd_file::close() m_cachehunk = ~0; } - -//------------------------------------------------- -// read - read a single hunk from the CHD file -//------------------------------------------------- +/** + * @fn chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) + * + * @brief ------------------------------------------------- + * read - read a single hunk from the CHD file + * -------------------------------------------------. + * + * @exception CHDERR_NOT_OPEN Thrown when a chderr not open error condition occurs. + * @exception CHDERR_HUNK_OUT_OF_RANGE Thrown when a chderr hunk out of range error + * condition occurs. + * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error + * condition occurs. + * @exception CHDERR_REQUIRES_PARENT Thrown when a chderr requires parent error condition + * occurs. + * @exception CHDERR_READ_ERROR Thrown when a chderr read error error condition + * occurs. + * + * @param hunknum The hunknum. + * @param [in,out] buffer If non-null, the buffer. + * + * @return The hunk. + */ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) { @@ -850,10 +989,24 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) } } - -//------------------------------------------------- -// write - write a single hunk to the CHD file -//------------------------------------------------- +/** + * @fn chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) + * + * @brief ------------------------------------------------- + * write - write a single hunk to the CHD file + * -------------------------------------------------. + * + * @exception CHDERR_NOT_OPEN Thrown when a chderr not open error condition occurs. + * @exception CHDERR_HUNK_OUT_OF_RANGE Thrown when a chderr hunk out of range error + * condition occurs. + * @exception CHDERR_FILE_NOT_WRITEABLE Thrown when a chderr file not writeable error + * condition occurs. + * + * @param hunknum The hunknum. + * @param buffer The buffer. + * + * @return A chd_error. + */ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) { @@ -922,33 +1075,58 @@ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) } } - -//------------------------------------------------- -// read_units - read the given number of units -// from the CHD -//------------------------------------------------- +/** + * @fn chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count) + * + * @brief ------------------------------------------------- + * read_units - read the given number of units from the CHD + * -------------------------------------------------. + * + * @param unitnum The unitnum. + * @param [in,out] buffer If non-null, the buffer. + * @param count Number of. + * + * @return The units. + */ chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count) { return read_bytes(unitnum * UINT64(m_unitbytes), buffer, count * m_unitbytes); } - -//------------------------------------------------- -// write_units - write the given number of units -// to the CHD -//------------------------------------------------- +/** + * @fn chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count) + * + * @brief ------------------------------------------------- + * write_units - write the given number of units to the CHD + * -------------------------------------------------. + * + * @param unitnum The unitnum. + * @param buffer The buffer. + * @param count Number of. + * + * @return A chd_error. + */ chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count) { return write_bytes(unitnum * UINT64(m_unitbytes), buffer, count * m_unitbytes); } - -//------------------------------------------------- -// read_bytes - read from the CHD at a byte level, -// using the cache to handle partial hunks -//------------------------------------------------- +/** + * @fn chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) + * + * @brief ------------------------------------------------- + * read_bytes - read from the CHD at a byte level, using the cache to handle partial + * hunks + * -------------------------------------------------. + * + * @param offset The offset. + * @param [in,out] buffer If non-null, the buffer. + * @param bytes The bytes. + * + * @return The bytes. + */ chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) { @@ -988,11 +1166,20 @@ chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) return CHDERR_NONE; } - -//------------------------------------------------- -// write_bytes - write to the CHD at a byte level, -// using the cache to handle partial hunks -//------------------------------------------------- +/** + * @fn chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) + * + * @brief ------------------------------------------------- + * write_bytes - write to the CHD at a byte level, using the cache to handle partial + * hunks + * -------------------------------------------------. + * + * @param offset The offset. + * @param buffer The buffer. + * @param bytes The bytes. + * + * @return A chd_error. + */ chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) { @@ -1033,11 +1220,22 @@ chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) return CHDERR_NONE; } - -//------------------------------------------------- -// read_metadata - read the indexed metadata -// of the given type -//------------------------------------------------- +/** + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output) + * + * @brief ------------------------------------------------- + * read_metadata - read the indexed metadata of the given type + * -------------------------------------------------. + * + * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error + * condition occurs. + * + * @param searchtag The searchtag. + * @param searchindex The searchindex. + * @param [in,out] output The output. + * + * @return The metadata. + */ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output) { @@ -1066,6 +1264,21 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } } +/** + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output) + * + * @brief Reads a metadata. + * + * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error + * condition occurs. + * + * @param searchtag The searchtag. + * @param searchindex The searchindex. + * @param [in,out] output The output. + * + * @return The metadata. + */ + chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output) { // wrap this for clean reporting @@ -1089,6 +1302,23 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } } +/** + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen) + * + * @brief Reads a metadata. + * + * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error + * condition occurs. + * + * @param searchtag The searchtag. + * @param searchindex The searchindex. + * @param [in,out] output If non-null, the output. + * @param outputlen The outputlen. + * @param [in,out] resultlen The resultlen. + * + * @return The metadata. + */ + chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen) { // wrap this for clean reporting @@ -1112,6 +1342,23 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } } +/** + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags) + * + * @brief Reads a metadata. + * + * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error + * condition occurs. + * + * @param searchtag The searchtag. + * @param searchindex The searchindex. + * @param [in,out] output The output. + * @param [in,out] resulttag The resulttag. + * @param [in,out] resultflags The resultflags. + * + * @return The metadata. + */ + chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags) { // wrap this for clean reporting @@ -1137,11 +1384,21 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } } - -//------------------------------------------------- -// write_metadata - write the indexed metadata -// of the given type -//------------------------------------------------- +/** + * @fn chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags) + * + * @brief ------------------------------------------------- + * write_metadata - write the indexed metadata of the given type + * -------------------------------------------------. + * + * @param metatag The metatag. + * @param metaindex The metaindex. + * @param inputbuf The inputbuf. + * @param inputlen The inputlen. + * @param flags The flags. + * + * @return A chd_error. + */ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags) { @@ -1209,11 +1466,21 @@ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, c } } - -//------------------------------------------------- -// delete_metadata - remove the given metadata -// from the list -//------------------------------------------------- +/** + * @fn chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex) + * + * @brief ------------------------------------------------- + * delete_metadata - remove the given metadata from the list + * -------------------------------------------------. + * + * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error + * condition occurs. + * + * @param metatag The metatag. + * @param metaindex The metaindex. + * + * @return A chd_error. + */ chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex) { @@ -1237,11 +1504,19 @@ chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex) } } - -//------------------------------------------------- -// clone_all_metadata - clone the metadata from -// one CHD to a second -//------------------------------------------------- +/** + * @fn chd_error chd_file::clone_all_metadata(chd_file &source) + * + * @brief ------------------------------------------------- + * clone_all_metadata - clone the metadata from one CHD to a second + * -------------------------------------------------. + * + * @exception err Thrown when an error error condition occurs. + * + * @param [in,out] source Another instance to copy. + * + * @return A chd_error. + */ chd_error chd_file::clone_all_metadata(chd_file &source) { @@ -1276,12 +1551,18 @@ chd_error chd_file::clone_all_metadata(chd_file &source) } } - -//------------------------------------------------- -// compute_overall_sha1 - iterate through the -// metadata and compute the overall hash of the -// CHD file -//------------------------------------------------- +/** + * @fn sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) + * + * @brief ------------------------------------------------- + * compute_overall_sha1 - iterate through the metadata and compute the overall hash of + * the CHD file + * -------------------------------------------------. + * + * @param rawsha1 The first rawsha. + * + * @return The calculated overall sha 1. + */ sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) { @@ -1322,10 +1603,19 @@ sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) return overall_sha1.finish(); } - -//------------------------------------------------- -// codec_config - set internal codec parameters -//------------------------------------------------- +/** + * @fn chd_error chd_file::codec_configure(chd_codec_type codec, int param, void *config) + * + * @brief ------------------------------------------------- + * codec_config - set internal codec parameters + * -------------------------------------------------. + * + * @param codec The codec. + * @param param The parameter. + * @param [in,out] config If non-null, the configuration. + * + * @return A chd_error. + */ chd_error chd_file::codec_configure(chd_codec_type codec, int param, void *config) { @@ -1349,11 +1639,17 @@ chd_error chd_file::codec_configure(chd_codec_type codec, int param, void *confi } } - -//------------------------------------------------- -// error_string - return an error string for -// the given CHD error -//------------------------------------------------- +/** + * @fn const char *chd_file::error_string(chd_error err) + * + * @brief ------------------------------------------------- + * error_string - return an error string for the given CHD error + * -------------------------------------------------. + * + * @param err The error. + * + * @return null if it fails, else a char*. + */ const char *chd_file::error_string(chd_error err) { @@ -1401,10 +1697,16 @@ const char *chd_file::error_string(chd_error err) // INTERNAL HELPERS //************************************************************************** -//------------------------------------------------- -// guess_unitbytes - for older CHD formats, take -// a guess at the bytes/unit based on metadata -//------------------------------------------------- +/** + * @fn UINT32 chd_file::guess_unitbytes() + * + * @brief ------------------------------------------------- + * guess_unitbytes - for older CHD formats, take a guess at the bytes/unit based on + * metadata + * -------------------------------------------------. + * + * @return An UINT32. + */ UINT32 chd_file::guess_unitbytes() { @@ -1426,11 +1728,21 @@ UINT32 chd_file::guess_unitbytes() return m_hunkbytes; } - -//------------------------------------------------- -// parse_v3_header - parse the header from a v3 -// file and configure core parameters -//------------------------------------------------- +/** + * @fn void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1) + * + * @brief ------------------------------------------------- + * parse_v3_header - parse the header from a v3 file and configure core parameters + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition + * occurs. + * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error + * condition occurs. + * + * @param [in,out] rawheader If non-null, the rawheader. + * @param [in,out] parentsha1 The first parentsha. + */ void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1) { @@ -1479,11 +1791,21 @@ void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1) m_unitcount = (m_logicalbytes + m_unitbytes - 1) / m_unitbytes; } - -//------------------------------------------------- -// parse_v4_header - parse the header from a v4 -// file and configure core parameters -//------------------------------------------------- +/** + * @fn void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1) + * + * @brief ------------------------------------------------- + * parse_v4_header - parse the header from a v4 file and configure core parameters + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition + * occurs. + * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error + * condition occurs. + * + * @param [in,out] rawheader If non-null, the rawheader. + * @param [in,out] parentsha1 The first parentsha. + */ void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1) { @@ -1532,11 +1854,18 @@ void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1) m_unitcount = (m_logicalbytes + m_unitbytes - 1) / m_unitbytes; } - -//------------------------------------------------- -// parse_v5_header - read the header from a v5 -// file and configure core parameters -//------------------------------------------------- +/** + * @fn void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1) + * + * @brief ------------------------------------------------- + * parse_v5_header - read the header from a v5 file and configure core parameters + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition occurs. + * + * @param [in,out] rawheader If non-null, the rawheader. + * @param [in,out] parentsha1 The first parentsha. + */ void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1) { @@ -1575,11 +1904,18 @@ void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1) parentsha1 = be_read_sha1(&rawheader[m_parentsha1_offset]); } - -//------------------------------------------------- -// compress_v5_map - compress the v5 map and -// write it to the end of the file -//------------------------------------------------- +/** + * @fn chd_error chd_file::compress_v5_map() + * + * @brief ------------------------------------------------- + * compress_v5_map - compress the v5 map and write it to the end of the file + * -------------------------------------------------. + * + * @exception CHDERR_COMPRESSION_ERROR Thrown when a chderr compression error error + * condition occurs. + * + * @return A chd_error. + */ chd_error chd_file::compress_v5_map() { @@ -1782,10 +2118,16 @@ chd_error chd_file::compress_v5_map() } } - -//------------------------------------------------- -// decompress_v5_map - decompress the v5 map -//------------------------------------------------- +/** + * @fn void chd_file::decompress_v5_map() + * + * @brief ------------------------------------------------- + * decompress_v5_map - decompress the v5 map + * -------------------------------------------------. + * + * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error + * condition occurs. + */ void chd_file::decompress_v5_map() { @@ -1900,11 +2242,22 @@ void chd_file::decompress_v5_map() throw CHDERR_DECOMPRESSION_ERROR; } - -//------------------------------------------------- -// create_common - command path when creating a -// new CHD file -//------------------------------------------------- +/** + * @fn chd_error chd_file::create_common() + * + * @brief ------------------------------------------------- + * create_common - command path when creating a new CHD file + * -------------------------------------------------. + * + * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error + * condition occurs. + * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error + * condition occurs. + * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error + * condition occurs. + * + * @return The new common. + */ chd_error chd_file::create_common() { @@ -1999,11 +2352,28 @@ chd_error chd_file::create_common() return CHDERR_NONE; } - -//------------------------------------------------- -// open_common - common path when opening an -// existing CHD file for input -//------------------------------------------------- +/** + * @fn chd_error chd_file::open_common(bool writeable) + * + * @brief ------------------------------------------------- + * open_common - common path when opening an existing CHD file for input + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition + * occurs. + * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error + * condition occurs. + * @exception CHDERR_FILE_NOT_WRITEABLE Thrown when a chderr file not writeable error + * condition occurs. + * @exception CHDERR_INVALID_PARENT Thrown when a chderr invalid parent error condition + * occurs. + * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error + * condition occurs. + * + * @param writeable true if writeable. + * + * @return A chd_error. + */ chd_error chd_file::open_common(bool writeable) { @@ -2063,11 +2433,16 @@ chd_error chd_file::open_common(bool writeable) } } - -//------------------------------------------------- -// create_open_common - common code for handling -// creation and opening of a file -//------------------------------------------------- +/** + * @fn void chd_file::create_open_common() + * + * @brief ------------------------------------------------- + * create_open_common - common code for handling creation and opening of a file + * -------------------------------------------------. + * + * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error + * condition occurs. + */ void chd_file::create_open_common() { @@ -2091,12 +2466,24 @@ void chd_file::create_open_common() m_cache.resize(m_hunkbytes); } - -//------------------------------------------------- -// verify_proper_compression_append - verify that -// the given hunk is a proper candidate for -// appending to a compressed CHD -//------------------------------------------------- +/** + * @fn void chd_file::verify_proper_compression_append(UINT32 hunknum) + * + * @brief ------------------------------------------------- + * verify_proper_compression_append - verify that the given hunk is a proper candidate + * for appending to a compressed CHD + * -------------------------------------------------. + * + * @exception CHDERR_NOT_OPEN Thrown when a chderr not open error condition occurs. + * @exception CHDERR_HUNK_OUT_OF_RANGE Thrown when a chderr hunk out of range error + * condition occurs. + * @exception CHDERR_FILE_NOT_WRITEABLE Thrown when a chderr file not writeable error + * condition occurs. + * @exception CHDERR_COMPRESSION_ERROR Thrown when a chderr compression error error + * condition occurs. + * + * @param hunknum The hunknum. + */ void chd_file::verify_proper_compression_append(UINT32 hunknum) { @@ -2127,12 +2514,20 @@ void chd_file::verify_proper_compression_append(UINT32 hunknum) throw CHDERR_COMPRESSION_ERROR; } - -//------------------------------------------------- -// hunk_write_compressed - write a hunk to a -// compressed CHD, discovering the best -// technique -//------------------------------------------------- +/** + * @fn void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16) + * + * @brief ------------------------------------------------- + * hunk_write_compressed - write a hunk to a compressed CHD, discovering the best + * technique + * -------------------------------------------------. + * + * @param hunknum The hunknum. + * @param compression The compression. + * @param compressed The compressed. + * @param complength The complength. + * @param crc16 The CRC 16. + */ void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16) { @@ -2150,11 +2545,19 @@ void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UIN be_write(&rawmap[10], crc16, 2); } - -//------------------------------------------------- -// hunk_copy_from_self - mark a hunk as being a -// copy of another hunk in the same CHD -//------------------------------------------------- +/** + * @fn void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) + * + * @brief ------------------------------------------------- + * hunk_copy_from_self - mark a hunk as being a copy of another hunk in the same CHD + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error + * condition occurs. + * + * @param hunknum The hunknum. + * @param otherhunk The otherhunk. + */ void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) { @@ -2173,11 +2576,16 @@ void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) be_write(&rawmap[10], 0, 2); } - -//------------------------------------------------- -// hunk_copy_from_parent - mark a hunk as being a -// copy of a hunk from a parent CHD -//------------------------------------------------- +/** + * @fn void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) + * + * @brief ------------------------------------------------- + * hunk_copy_from_parent - mark a hunk as being a copy of a hunk from a parent CHD + * -------------------------------------------------. + * + * @param hunknum The hunknum. + * @param parentunit The parentunit. + */ void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) { @@ -2192,10 +2600,20 @@ void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) be_write(&rawmap[10], 0, 2); } - -//------------------------------------------------- -// metadata_find - find a metadata entry -//------------------------------------------------- +/** + * @fn bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume) + * + * @brief ------------------------------------------------- + * metadata_find - find a metadata entry + * -------------------------------------------------. + * + * @param metatag The metatag. + * @param metaindex The metaindex. + * @param [in,out] metaentry The metaentry. + * @param resume true to resume. + * + * @return true if it succeeds, false if it fails. + */ bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume) { @@ -2238,11 +2656,16 @@ bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata return false; } - -//------------------------------------------------- -// metadata_set_previous_next - set the 'next' -// offset of a piece of metadata -//------------------------------------------------- +/** + * @fn void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset) + * + * @brief ------------------------------------------------- + * metadata_set_previous_next - set the 'next' offset of a piece of metadata + * -------------------------------------------------. + * + * @param prevoffset The prevoffset. + * @param nextoffset The nextoffset. + */ void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset) { @@ -2267,11 +2690,13 @@ void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset) file_write(offset, rawbuf, sizeof(rawbuf)); } - -//------------------------------------------------- -// metadata_update_hash - compute the SHA1 -// hash of all metadata that requests it -//------------------------------------------------- +/** + * @fn void chd_file::metadata_update_hash() + * + * @brief ------------------------------------------------- + * metadata_update_hash - compute the SHA1 hash of all metadata that requests it + * -------------------------------------------------. + */ void chd_file::metadata_update_hash() { @@ -2290,11 +2715,18 @@ void chd_file::metadata_update_hash() file_write(m_sha1_offset, rawbuf, sizeof(rawbuf)); } - -//------------------------------------------------- -// metadata_hash_compare - compare two hash -// entries -//------------------------------------------------- +/** + * @fn int CLIB_DECL chd_file::metadata_hash_compare(const void *elem1, const void *elem2) + * + * @brief ------------------------------------------------- + * metadata_hash_compare - compare two hash entries + * -------------------------------------------------. + * + * @param elem1 The first element. + * @param elem2 The second element. + * + * @return A CLIB_DECL. + */ int CLIB_DECL chd_file::metadata_hash_compare(const void *elem1, const void *elem2) { @@ -2307,9 +2739,13 @@ int CLIB_DECL chd_file::metadata_hash_compare(const void *elem1, const void *ele // CHD COMPRESSOR //************************************************************************** -//------------------------------------------------- -// chd_file_compressor - constructor -//------------------------------------------------- +/** + * @fn chd_file_compressor::chd_file_compressor() + * + * @brief ------------------------------------------------- + * chd_file_compressor - constructor + * -------------------------------------------------. + */ chd_file_compressor::chd_file_compressor() : m_walking_parent(false), @@ -2330,10 +2766,13 @@ chd_file_compressor::chd_file_compressor() m_work_queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI); } - -//------------------------------------------------- -// ~chd_file_compressor - destructor -//------------------------------------------------- +/** + * @fn chd_file_compressor::~chd_file_compressor() + * + * @brief ------------------------------------------------- + * ~chd_file_compressor - destructor + * -------------------------------------------------. + */ chd_file_compressor::~chd_file_compressor() { @@ -2346,10 +2785,13 @@ chd_file_compressor::~chd_file_compressor() delete m_codecs[codecnum]; } - -//------------------------------------------------- -// compress_begin - initiate compression -//------------------------------------------------- +/** + * @fn void chd_file_compressor::compress_begin() + * + * @brief ------------------------------------------------- + * compress_begin - initiate compression + * -------------------------------------------------. + */ void chd_file_compressor::compress_begin() { @@ -2392,10 +2834,18 @@ void chd_file_compressor::compress_begin() m_write_hunk = 0; } - -//------------------------------------------------- -// compress_continue - continue compression -//------------------------------------------------- +/** + * @fn chd_error chd_file_compressor::compress_continue(double &progress, double &ratio) + * + * @brief ------------------------------------------------- + * compress_continue - continue compression + * -------------------------------------------------. + * + * @param [in,out] progress The progress. + * @param [in,out] ratio The ratio. + * + * @return A chd_error. + */ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio) { @@ -2538,11 +2988,18 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio return m_walking_parent ? CHDERR_WALKING_PARENT : CHDERR_COMPRESSING; } - -//------------------------------------------------- -// async_walk_parent - handle asynchronous parent -// walking operations -//------------------------------------------------- +/** + * @fn void *chd_file_compressor::async_walk_parent_static(void *param, int threadid) + * + * @brief ------------------------------------------------- + * async_walk_parent - handle asynchronous parent walking operations + * -------------------------------------------------. + * + * @param [in,out] param If non-null, the parameter. + * @param threadid The threadid. + * + * @return null if it fails, else a void*. + */ void *chd_file_compressor::async_walk_parent_static(void *param, int threadid) { @@ -2551,6 +3008,14 @@ void *chd_file_compressor::async_walk_parent_static(void *param, int threadid) return NULL; } +/** + * @fn void chd_file_compressor::async_walk_parent(work_item &item) + * + * @brief Asynchronous walk parent. + * + * @param [in,out] item The item. + */ + void chd_file_compressor::async_walk_parent(work_item &item) { // compute CRC-16 and SHA-1 hashes for each unit, unless we're the last one or we're uncompressed @@ -2565,11 +3030,18 @@ void chd_file_compressor::async_walk_parent(work_item &item) atomic_exchange32(&item.m_status, WS_COMPLETE); } - -//------------------------------------------------- -// async_compress_hunk - handle asynchronous -// hunk compression -//------------------------------------------------- +/** + * @fn void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid) + * + * @brief ------------------------------------------------- + * async_compress_hunk - handle asynchronous hunk compression + * -------------------------------------------------. + * + * @param [in,out] param If non-null, the parameter. + * @param threadid The threadid. + * + * @return null if it fails, else a void*. + */ void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid) { @@ -2578,6 +3050,15 @@ void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid) return NULL; } +/** + * @fn void chd_file_compressor::async_compress_hunk(work_item &item, int threadid) + * + * @brief Asynchronous compress hunk. + * + * @param [in,out] item The item. + * @param threadid The threadid. + */ + void chd_file_compressor::async_compress_hunk(work_item &item, int threadid) { // use our thread's codec @@ -2599,11 +3080,18 @@ void chd_file_compressor::async_compress_hunk(work_item &item, int threadid) atomic_exchange32(&item.m_status, WS_COMPLETE); } - -//------------------------------------------------- -// async_read - handle asynchronous source file -// reading -//------------------------------------------------- +/** + * @fn void *chd_file_compressor::async_read_static(void *param, int threadid) + * + * @brief ------------------------------------------------- + * async_read - handle asynchronous source file reading + * -------------------------------------------------. + * + * @param [in,out] param If non-null, the parameter. + * @param threadid The threadid. + * + * @return null if it fails, else a void*. + */ void *chd_file_compressor::async_read_static(void *param, int threadid) { @@ -2611,6 +3099,12 @@ void *chd_file_compressor::async_read_static(void *param, int threadid) return NULL; } +/** + * @fn void chd_file_compressor::async_read() + * + * @brief Asynchronous read. + */ + void chd_file_compressor::async_read() { // if in the error or complete state, stop @@ -2686,9 +3180,13 @@ void chd_file_compressor::async_read() // CHD COMPRESSOR HASHMAP //************************************************************************** -//------------------------------------------------- -// hashmap - constructor -//------------------------------------------------- +/** + * @fn chd_file_compressor::hashmap::hashmap() + * + * @brief ------------------------------------------------- + * hashmap - constructor + * -------------------------------------------------. + */ chd_file_compressor::hashmap::hashmap() : m_block_list(new entry_block(NULL)) @@ -2697,10 +3195,13 @@ chd_file_compressor::hashmap::hashmap() memset(m_map, 0, sizeof(m_map)); } - -//------------------------------------------------- -// ~hashmap - destructor -//------------------------------------------------- +/** + * @fn chd_file_compressor::hashmap::~hashmap() + * + * @brief ------------------------------------------------- + * ~hashmap - destructor + * -------------------------------------------------. + */ chd_file_compressor::hashmap::~hashmap() { @@ -2708,10 +3209,13 @@ chd_file_compressor::hashmap::~hashmap() delete m_block_list; } - -//------------------------------------------------- -// reset - reset the state of the map -//------------------------------------------------- +/** + * @fn void chd_file_compressor::hashmap::reset() + * + * @brief ------------------------------------------------- + * reset - reset the state of the map + * -------------------------------------------------. + */ void chd_file_compressor::hashmap::reset() { @@ -2728,10 +3232,18 @@ void chd_file_compressor::hashmap::reset() memset(m_map, 0, sizeof(m_map)); } - -//------------------------------------------------- -// find - find an item in the CRC map -//------------------------------------------------- +/** + * @fn UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) + * + * @brief ------------------------------------------------- + * find - find an item in the CRC map + * -------------------------------------------------. + * + * @param crc16 The CRC 16. + * @param sha1 The first sha. + * + * @return An UINT64. + */ UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) { @@ -2742,10 +3254,17 @@ UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) return NOT_FOUND; } - -//------------------------------------------------- -// add - add an item to the CRC map -//------------------------------------------------- +/** + * @fn void chd_file_compressor::hashmap::add(UINT64 itemnum, crc16_t crc16, sha1_t sha1) + * + * @brief ------------------------------------------------- + * add - add an item to the CRC map + * -------------------------------------------------. + * + * @param itemnum The itemnum. + * @param crc16 The CRC 16. + * @param sha1 The first sha. + */ void chd_file_compressor::hashmap::add(UINT64 itemnum, crc16_t crc16, sha1_t sha1) { diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c index a94b27c1590..d55b83f5a82 100644 --- a/src/lib/util/chdcd.c +++ b/src/lib/util/chdcd.c @@ -21,6 +21,18 @@ CONSTANTS & DEFINES ***************************************************************************/ +/** + * @def TOKENIZE(); + * + * @brief A macro that defines tokenize. + * + * @param linebuffer The linebuffer. + * @param i Zero-based index of the. + * @param sizeof(linebuffer) The sizeof(linebuffer) + * @param token The token. + * @param sizeof(token) The sizeof(token) + */ + #define TOKENIZE i = tokenize( linebuffer, i, sizeof(linebuffer), token, sizeof(token) ); @@ -29,6 +41,7 @@ GLOBAL VARIABLES ***************************************************************************/ +/** @brief The linebuffer[ 512]. */ static char linebuffer[512]; @@ -37,6 +50,16 @@ static char linebuffer[512]; IMPLEMENTATION ***************************************************************************/ +/** + * @fn static std::string get_file_path(std::string &path) + * + * @brief Gets file path. + * + * @param [in,out] path Full pathname of the file. + * + * @return The file path. + */ + static std::string get_file_path(std::string &path) { int pos = path.find_last_of('\\'); @@ -52,6 +75,16 @@ static std::string get_file_path(std::string &path) get_file_size - get the size of a file -------------------------------------------------*/ +/** + * @fn static UINT64 get_file_size(const char *filename) + * + * @brief Gets file size. + * + * @param filename Filename of the file. + * + * @return The file size. + */ + static UINT64 get_file_size(const char *filename) { osd_file *file; @@ -70,6 +103,20 @@ static UINT64 get_file_size(const char *filename) tokenize - get a token from the line buffer -------------------------------------------------*/ +/** + * @fn static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ) + * + * @brief Tokenizes. + * + * @param linebuffer The linebuffer. + * @param i Zero-based index of the. + * @param linebuffersize The linebuffersize. + * @param [in,out] token If non-null, the token. + * @param tokensize The tokensize. + * + * @return An int. + */ + static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize ) { int j = 0; @@ -114,6 +161,16 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to msf_to_frames - convert m:s:f into a number of frames -------------------------------------------------*/ +/** + * @fn static int msf_to_frames( char *token ) + * + * @brief Msf to frames. + * + * @param [in,out] token If non-null, the token. + * + * @return An int. + */ + static int msf_to_frames( char *token ) { int m = 0; @@ -140,6 +197,18 @@ static int msf_to_frames( char *token ) length in bytes of the data and the offset in bytes to where the data starts in the file. -------------------------------------------------*/ + +/** + * @fn static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) + * + * @brief Parse WAV sample. + * + * @param filename Filename of the file. + * @param [in,out] dataoffs If non-null, the dataoffs. + * + * @return An UINT32. + */ + static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) { unsigned long offset = 0; @@ -308,6 +377,16 @@ static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) return length; } +/** + * @fn UINT16 read_uint16(FILE *infile) + * + * @brief Reads uint 16. + * + * @param [in,out] infile If non-null, the infile. + * + * @return The uint 16. + */ + UINT16 read_uint16(FILE *infile) { UINT16 res = 0; @@ -320,6 +399,16 @@ UINT16 read_uint16(FILE *infile) return res; } +/** + * @fn UINT32 read_uint32(FILE *infile) + * + * @brief Reads uint 32. + * + * @param [in,out] infile If non-null, the infile. + * + * @return The uint 32. + */ + UINT32 read_uint32(FILE *infile) { UINT32 res = 0; @@ -332,6 +421,16 @@ UINT32 read_uint32(FILE *infile) return res; } +/** + * @fn UINT64 read_uint64(FILE *infile) + * + * @brief Reads uint 64. + * + * @param [in,out] infile If non-null, the infile. + * + * @return The uint 64. + */ + UINT64 read_uint64(FILE *infile) { UINT64 res0 = U64(0), res1 = U64(0); @@ -352,6 +451,18 @@ UINT64 read_uint64(FILE *infile) chdcd_parse_nero - parse a Nero .NRG file -------------------------------------------------*/ +/** + * @fn chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) + * + * @brief Chdcd parse nero. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A chd_error. + */ + chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) { FILE *infile; @@ -526,6 +637,18 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ chdcd_parse_iso - parse a .ISO file -------------------------------------------------*/ +/** + * @fn chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) + * + * @brief Chdcd parse ISO. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A chd_error. + */ + chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) { FILE *infile; @@ -591,6 +714,18 @@ chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i chdcd_parse_gdi - parse a Sega GD-ROM rip -------------------------------------------------*/ +/** + * @fn static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) + * + * @brief Chdcd parse GDI. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A chd_error. + */ + static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) { FILE *infile; @@ -711,6 +846,18 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_ chdcd_parse_cue - parse a CDRWin format CUE file -------------------------------------------------*/ +/** + * @fn chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) + * + * @brief Chdcd parse cue. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A chd_error. + */ + chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) { FILE *infile; @@ -994,6 +1141,18 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i chdcd_parse_toc - parse a CDRDAO format TOC file -------------------------------------------------*/ +/** + * @fn chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) + * + * @brief Chdcd parse TOC. + * + * @param tocfname The tocfname. + * @param [in,out] outtoc The outtoc. + * @param [in,out] outinfo The outinfo. + * + * @return A chd_error. + */ + chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo) { FILE *infile; diff --git a/src/lib/util/chdcodec.c b/src/lib/util/chdcodec.c index 3a7781fced8..753ce852dd3 100644 --- a/src/lib/util/chdcodec.c +++ b/src/lib/util/chdcodec.c @@ -1453,10 +1453,17 @@ UINT32 chd_cd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 * return complen; } - -//------------------------------------------------- -// blocksize - return the optimal block size -//------------------------------------------------- +/** + * @fn UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) + * + * @brief ------------------------------------------------- + * blocksize - return the optimal block size + * -------------------------------------------------. + * + * @param bytes The bytes. + * + * @return An UINT32. + */ UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) { @@ -1473,9 +1480,19 @@ UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) // CD FLAC DECOMPRESSOR //************************************************************************** -//------------------------------------------------- -// chd_cd_flac_decompressor - constructor -//------------------------------------------------- +/** + * @fn chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + * + * @brief ------------------------------------------------- + * chd_cd_flac_decompressor - constructor + * -------------------------------------------------. + * + * @exception CHDERR_CODEC_ERROR Thrown when a chderr codec error error condition occurs. + * + * @param [in,out] chd The chd. + * @param hunkbytes The hunkbytes. + * @param lossy true to lossy. + */ chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy), @@ -1503,21 +1520,34 @@ chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbyt throw CHDERR_CODEC_ERROR; } - -//------------------------------------------------- -// ~chd_cd_flac_decompressor - destructor -//------------------------------------------------- +/** + * @fn chd_cd_flac_decompressor::~chd_cd_flac_decompressor() + * + * @brief ------------------------------------------------- + * ~chd_cd_flac_decompressor - destructor + * -------------------------------------------------. + */ chd_cd_flac_decompressor::~chd_cd_flac_decompressor() { inflateEnd(&m_inflater); } - -//------------------------------------------------- -// decompress - decompress data using the FLAC -// codec -//------------------------------------------------- +/** + * @fn void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) + * + * @brief ------------------------------------------------- + * decompress - decompress data using the FLAC codec + * -------------------------------------------------. + * + * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error + * condition occurs. + * + * @param src Source for the. + * @param complen The complen. + * @param [in,out] dest If non-null, destination for the. + * @param destlen The destlen. + */ void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) { @@ -1562,9 +1592,17 @@ void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT // AVHUFF COMPRESSOR //************************************************************************** -//------------------------------------------------- -// chd_avhuff_compressor - constructor -//------------------------------------------------- +/** + * @fn chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + * + * @brief ------------------------------------------------- + * chd_avhuff_compressor - constructor + * -------------------------------------------------. + * + * @param [in,out] chd The chd. + * @param hunkbytes The hunkbytes. + * @param lossy true to lossy. + */ chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy), @@ -1581,10 +1619,24 @@ chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bo } } - -//------------------------------------------------- -// compress - compress data using the A/V codec -//------------------------------------------------- +/** + * @fn UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) + * + * @brief ------------------------------------------------- + * compress - compress data using the A/V codec + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_DATA Thrown when a chderr invalid data error condition + * occurs. + * @exception CHDERR_COMPRESSION_ERROR Thrown when a chderr compression error error + * condition occurs. + * + * @param src Source for the. + * @param srclen The srclen. + * @param [in,out] dest If non-null, destination for the. + * + * @return An UINT32. + */ UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) { @@ -1609,12 +1661,18 @@ UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *d return complen; } - -//------------------------------------------------- -// postinit - actual initialization of avhuff -// happens here, on the first attempt to compress -// or decompress data -//------------------------------------------------- +/** + * @fn void chd_avhuff_compressor::postinit() + * + * @brief ------------------------------------------------- + * postinit - actual initialization of avhuff happens here, on the first attempt to + * compress or decompress data + * -------------------------------------------------. + * + * @exception err Thrown when an error error condition occurs. + * @exception CHDERR_INVALID_METADATA Thrown when a chderr invalid metadata error condition + * occurs. + */ void chd_avhuff_compressor::postinit() { @@ -1646,20 +1704,38 @@ void chd_avhuff_compressor::postinit() // AVHUFF DECOMPRESSOR //************************************************************************** -//------------------------------------------------- -// chd_avhuff_decompressor - constructor -//------------------------------------------------- +/** + * @fn chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + * + * @brief ------------------------------------------------- + * chd_avhuff_decompressor - constructor + * -------------------------------------------------. + * + * @param [in,out] chd The chd. + * @param hunkbytes The hunkbytes. + * @param lossy true to lossy. + */ chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy) { } - -//------------------------------------------------- -// decompress - decompress data using the A/V -// codec -//------------------------------------------------- +/** + * @fn void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) + * + * @brief ------------------------------------------------- + * decompress - decompress data using the A/V codec + * -------------------------------------------------. + * + * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error + * condition occurs. + * + * @param src Source for the. + * @param complen The complen. + * @param [in,out] dest If non-null, destination for the. + * @param destlen The destlen. + */ void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) { @@ -1677,11 +1753,19 @@ void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 } } - -//------------------------------------------------- -// config - codec-specific configuration for the -// A/V codec -//------------------------------------------------- +/** + * @fn void chd_avhuff_decompressor::configure(int param, void *config) + * + * @brief ------------------------------------------------- + * config - codec-specific configuration for the A/V codec + * -------------------------------------------------. + * + * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error + * condition occurs. + * + * @param param The parameter. + * @param [in,out] config If non-null, the configuration. + */ void chd_avhuff_decompressor::configure(int param, void *config) { diff --git a/src/lib/util/corealloc.c b/src/lib/util/corealloc.c index d4de33fe35d..c8fcf7e3aa5 100644 --- a/src/lib/util/corealloc.c +++ b/src/lib/util/corealloc.c @@ -359,11 +359,15 @@ void memory_entry::release(memory_entry *entry, const char *file, int line) release_lock(); } - -//------------------------------------------------- -// report_unfreed - print a list of unfreed -// memory to the target file -//------------------------------------------------- +/** + * @fn void memory_entry::report_unfreed(UINT64 start) + * + * @brief ------------------------------------------------- + * report_unfreed - print a list of unfreed memory to the target file + * -------------------------------------------------. + * + * @param start The start. + */ void memory_entry::report_unfreed(UINT64 start) { diff --git a/src/lib/util/corefile.c b/src/lib/util/corefile.c index 823d37b8b55..30639615a58 100644 --- a/src/lib/util/corefile.c +++ b/src/lib/util/corefile.c @@ -1028,6 +1028,20 @@ static file_error osd_or_zlib_read(core_file *file, void *buffer, UINT64 offset, handles zlib-compressed data -------------------------------------------------*/ +/** + * @fn static file_error osd_or_zlib_write(core_file *file, const void *buffer, UINT64 offset, UINT32 length, UINT32 *actual) + * + * @brief OSD or zlib write. + * + * @param [in,out] file If non-null, the file. + * @param buffer The buffer. + * @param offset The offset. + * @param length The length. + * @param [in,out] actual If non-null, the actual. + * + * @return A file_error. + */ + static file_error osd_or_zlib_write(core_file *file, const void *buffer, UINT64 offset, UINT32 length, UINT32 *actual) { /* if no compression, just pass through */ diff --git a/src/lib/util/corestr.c b/src/lib/util/corestr.c index 8a78a672ac6..eb6f76ac4b4 100644 --- a/src/lib/util/corestr.c +++ b/src/lib/util/corestr.c @@ -294,12 +294,34 @@ std::string strmakeupper(std::string& str) return str; } +/** + * @fn std::string strmakelower(std::string& str) + * + * @brief Strmakelowers the given string. + * + * @param [in,out] str The string. + * + * @return A std::string. + */ + std::string strmakelower(std::string& str) { std::transform(str.begin(), str.end(), str.begin(), ::tolower); return str; } +/** + * @fn int strreplace(std::string &str, const std::string& search, const std::string& replace) + * + * @brief Strreplaces. + * + * @param [in,out] str The string. + * @param search The search. + * @param replace The replace. + * + * @return An int. + */ + int strreplace(std::string &str, const std::string& search, const std::string& replace) { int searchlen = search.length(); diff --git a/src/lib/util/coreutil.c b/src/lib/util/coreutil.c index fbc807caad3..2a2a27d712e 100644 --- a/src/lib/util/coreutil.c +++ b/src/lib/util/coreutil.c @@ -67,6 +67,18 @@ int gregorian_is_leap_year(int year) /* months are one counted */ + +/** + * @fn int gregorian_days_in_month(int month, int year) + * + * @brief Gregorian days in month. + * + * @param month The month. + * @param year The year. + * + * @return An int. + */ + int gregorian_days_in_month(int month, int year) { if (month == 2) @@ -82,6 +94,15 @@ int gregorian_days_in_month(int month, int year) MISC ***************************************************************************/ +/** + * @fn void rand_memory(void *memory, size_t length) + * + * @brief Random memory. + * + * @param [in,out] memory If non-null, the memory. + * @param length The length. + */ + void rand_memory(void *memory, size_t length) { static UINT32 seed = 0; diff --git a/src/lib/util/cstrpool.c b/src/lib/util/cstrpool.c index b77557c1056..36c5ff694bb 100644 --- a/src/lib/util/cstrpool.c +++ b/src/lib/util/cstrpool.c @@ -70,10 +70,13 @@ bool const_string_pool::contains(const char *string) return false; } - -//------------------------------------------------- -// pool_chunk - constructor -//------------------------------------------------- +/** + * @fn const_string_pool::pool_chunk::pool_chunk() + * + * @brief ------------------------------------------------- + * pool_chunk - constructor + * -------------------------------------------------. + */ const_string_pool::pool_chunk::pool_chunk() : m_next(NULL), @@ -81,10 +84,17 @@ const_string_pool::pool_chunk::pool_chunk() { } - -//------------------------------------------------- -// add - add a string to this pool -//------------------------------------------------- +/** + * @fn const char *const_string_pool::pool_chunk::add(const char *string) + * + * @brief ------------------------------------------------- + * add - add a string to this pool + * -------------------------------------------------. + * + * @param string The string to add. + * + * @return null if it fails, else a char*. + */ const char *const_string_pool::pool_chunk::add(const char *string) { diff --git a/src/lib/util/delegate.c b/src/lib/util/delegate.c index 6c688f72985..5abf04b3a32 100644 --- a/src/lib/util/delegate.c +++ b/src/lib/util/delegate.c @@ -32,11 +32,18 @@ delegate_mfp::raw_mfp_data delegate_mfp::s_null_mfp = { 0 }; #if (USE_DELEGATE_TYPE == DELEGATE_TYPE_INTERNAL) -//------------------------------------------------- -// delegate_convert_raw - given an object and -// an raw function, adjust the object base and -// return the actual final code pointer -//------------------------------------------------- +/** + * @fn delegate_generic_function delegate_mfp::convert_to_generic(delegate_generic_class *&object) const + * + * @brief ------------------------------------------------- + * delegate_convert_raw - given an object and an raw function, adjust the object base + * and return the actual final code pointer + * -------------------------------------------------. + * + * @param [in,out] object [in,out] If non-null, the object. + * + * @return The given data converted to a generic. + */ delegate_generic_function delegate_mfp::convert_to_generic(delegate_generic_class *&object) const { diff --git a/src/lib/util/flac.c b/src/lib/util/flac.c index d2f576e637e..2e1e999977d 100644 --- a/src/lib/util/flac.c +++ b/src/lib/util/flac.c @@ -608,10 +608,17 @@ FLAC__StreamDecoderWriteStatus flac_decoder::write_callback(const ::FLAC__Frame return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } - -//------------------------------------------------- -// error_callback - handle errors (ignore them) -//------------------------------------------------- +/** + * @fn void flac_decoder::error_callback_static(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) + * + * @brief ------------------------------------------------- + * error_callback - handle errors (ignore them) + * -------------------------------------------------. + * + * @param decoder The decoder. + * @param status The status. + * @param [in,out] client_data If non-null, information describing the client. + */ void flac_decoder::error_callback_static(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) { diff --git a/src/lib/util/harddisk.c b/src/lib/util/harddisk.c index 4760a5fd51f..4b041cf29a8 100644 --- a/src/lib/util/harddisk.c +++ b/src/lib/util/harddisk.c @@ -97,6 +97,16 @@ chd_file *hard_disk_get_chd(hard_disk_file *file) a hard disk -------------------------------------------------*/ +/** + * @fn hard_disk_info *hard_disk_get_info(hard_disk_file *file) + * + * @brief Hard disk get information. + * + * @param [in,out] file If non-null, the file. + * + * @return null if it fails, else a hard_disk_info*. + */ + hard_disk_info *hard_disk_get_info(hard_disk_file *file) { return &file->info; @@ -108,6 +118,18 @@ hard_disk_info *hard_disk_get_info(hard_disk_file *file) disk -------------------------------------------------*/ +/** + * @fn UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) + * + * @brief Hard disk read. + * + * @param [in,out] file If non-null, the file. + * @param lbasector The lbasector. + * @param [in,out] buffer If non-null, the buffer. + * + * @return An UINT32. + */ + UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) { chd_error err = file->chd->read_units(lbasector, buffer); @@ -120,6 +142,18 @@ UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) disk -------------------------------------------------*/ +/** + * @fn UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer) + * + * @brief Hard disk write. + * + * @param [in,out] file If non-null, the file. + * @param lbasector The lbasector. + * @param buffer The buffer. + * + * @return An UINT32. + */ + UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer) { chd_error err = file->chd->write_units(lbasector, buffer); diff --git a/src/lib/util/hashing.c b/src/lib/util/hashing.c index 1481de34a12..d7244d4edcf 100644 --- a/src/lib/util/hashing.c +++ b/src/lib/util/hashing.c @@ -214,10 +214,17 @@ bool crc16_t::from_string(const char *string, int length) return true; } - -//------------------------------------------------- -// as_string - convert to a string -//------------------------------------------------- +/** + * @fn const char *crc16_t::as_string(std::string &buffer) const + * + * @brief ------------------------------------------------- + * as_string - convert to a string + * -------------------------------------------------. + * + * @param [in,out] buffer The buffer. + * + * @return null if it fails, else a char*. + */ const char *crc16_t::as_string(std::string &buffer) const { @@ -225,11 +232,16 @@ const char *crc16_t::as_string(std::string &buffer) const return buffer.c_str(); } - -//------------------------------------------------- -// append - hash a block of data, appending to -// the currently-accumulated value -//------------------------------------------------- +/** + * @fn void crc16_creator::append(const void *data, UINT32 length) + * + * @brief ------------------------------------------------- + * append - hash a block of data, appending to the currently-accumulated value + * -------------------------------------------------. + * + * @param data The data. + * @param length The length. + */ void crc16_creator::append(const void *data, UINT32 length) { diff --git a/src/lib/util/huffman.c b/src/lib/util/huffman.c index 7e6d1906456..7f804aec222 100644 --- a/src/lib/util/huffman.c +++ b/src/lib/util/huffman.c @@ -730,10 +730,20 @@ huffman_8bit_decoder::huffman_8bit_decoder() { } - -//------------------------------------------------- -// decode - decode a full buffer -//------------------------------------------------- +/** + * @fn huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength) + * + * @brief ------------------------------------------------- + * decode - decode a full buffer + * -------------------------------------------------. + * + * @param source Source for the. + * @param slength The slength. + * @param [in,out] dest If non-null, destination for the. + * @param dlength The dlength. + * + * @return A huffman_error. + */ huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength) { diff --git a/src/lib/util/jedparse.c b/src/lib/util/jedparse.c index b8aa6d85418..37bee01fa85 100644 --- a/src/lib/util/jedparse.c +++ b/src/lib/util/jedparse.c @@ -410,6 +410,18 @@ int jedbin_parse(const void *data, size_t length, jed_data *result) based on the jed_data provided -------------------------------------------------*/ +/** + * @fn size_t jedbin_output(const jed_data *data, void *result, size_t length) + * + * @brief Jedbin output. + * + * @param data The data. + * @param [out] result If non-null, the result. + * @param length The length. + * + * @return A size_t. + */ + size_t jedbin_output(const jed_data *data, void *result, size_t length) { UINT8 *curdst = (UINT8 *)result; diff --git a/src/lib/util/md5.c b/src/lib/util/md5.c index 1fdcb26de03..7c571d9442e 100644 --- a/src/lib/util/md5.c +++ b/src/lib/util/md5.c @@ -153,6 +153,16 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx) * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ + +/** + * @fn void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) + * + * @brief Md 5 transform. + * + * @param buf The buffer. + * @param in The in. + */ + void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) { diff --git a/src/lib/util/opresolv.c b/src/lib/util/opresolv.c index 0cfa1030932..0dd9252d7b6 100644 --- a/src/lib/util/opresolv.c +++ b/src/lib/util/opresolv.c @@ -536,14 +536,31 @@ optreserr_t option_resolution_isvalidvalue(const char *specification, int option return OPTIONRESOLUTION_ERROR_PARAMOUTOFRANGE; } - +/** + * @fn int option_resolution_contains(const char *specification, int option_char) + * + * @brief Option resolution contains. + * + * @param specification The specification. + * @param option_char The option character. + * + * @return An int. + */ int option_resolution_contains(const char *specification, int option_char) { return strchr(specification, option_char) != NULL; } - +/** + * @fn const char *option_resolution_error_string(optreserr_t err) + * + * @brief Option resolution error string. + * + * @param err The error. + * + * @return null if it fails, else a char*. + */ const char *option_resolution_error_string(optreserr_t err) { diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 62c3cc0379a..b365c1dd0ff 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -709,10 +709,15 @@ void core_options::remove_entry(core_options::entry &delentry) m_entrylist.remove(delentry); } - -//------------------------------------------------- -// copyfrom - copy options from another set -//------------------------------------------------- +/** + * @fn void core_options::copyfrom(const core_options &src) + * + * @brief ------------------------------------------------- + * copyfrom - copy options from another set + * -------------------------------------------------. + * + * @param src Source for the. + */ void core_options::copyfrom(const core_options &src) { @@ -724,12 +729,21 @@ void core_options::copyfrom(const core_options &src) append_entry(*global_alloc(entry(curentry->name(), curentry->description(), curentry->flags(), curentry->default_value()))); } - -//------------------------------------------------- -// validate_and_set_data - make sure the data is -// of the appropriate type and within range, -// then set it -//------------------------------------------------- +/** + * @fn bool core_options::validate_and_set_data(core_options::entry &curentry, const char *newdata, int priority, std::string &error_string) + * + * @brief ------------------------------------------------- + * validate_and_set_data - make sure the data is of the appropriate type and within + * range, then set it + * -------------------------------------------------. + * + * @param [in,out] curentry The curentry. + * @param newdata The newdata. + * @param priority The priority. + * @param [in,out] error_string The error string. + * + * @return true if it succeeds, false if it fails. + */ bool core_options::validate_and_set_data(core_options::entry &curentry, const char *newdata, int priority, std::string &error_string) { diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c index 321f5ebca72..7e20e7e9cb7 100644 --- a/src/lib/util/palette.c +++ b/src/lib/util/palette.c @@ -467,11 +467,16 @@ void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_m } } - -//------------------------------------------------- -// update_adjusted_color - update a color index -// by group and index pair -//------------------------------------------------- +/** + * @fn void palette_t::update_adjusted_color(UINT32 group, UINT32 index) + * + * @brief ------------------------------------------------- + * update_adjusted_color - update a color index by group and index pair + * -------------------------------------------------. + * + * @param group The group. + * @param index Zero-based index of the. + */ void palette_t::update_adjusted_color(UINT32 group, UINT32 index) { diff --git a/src/lib/util/plaparse.c b/src/lib/util/plaparse.c index 03502e80560..f6228d2cbe9 100644 --- a/src/lib/util/plaparse.c +++ b/src/lib/util/plaparse.c @@ -294,6 +294,18 @@ static bool process_field(jed_data *data, const UINT8 **src, const UINT8 *srcend that has been loaded raw into memory -------------------------------------------------*/ +/** + * @fn int pla_parse(const void *data, size_t length, jed_data *result) + * + * @brief Pla parse. + * + * @param data The data. + * @param length The length. + * @param [out] result If non-null, the result. + * + * @return An int. + */ + int pla_parse(const void *data, size_t length, jed_data *result) { const UINT8 *src = (const UINT8 *)data; diff --git a/src/lib/util/png.c b/src/lib/util/png.c index 076b1b02965..224cdf8d3dc 100644 --- a/src/lib/util/png.c +++ b/src/lib/util/png.c @@ -1096,6 +1096,18 @@ png_error png_write_bitmap(core_file *fp, png_info *info, bitmap_t &bitmap, int ********************************************************************************/ +/** + * @fn png_error mng_capture_start(core_file *fp, bitmap_t &bitmap, double rate) + * + * @brief Mng capture start. + * + * @param [in,out] fp If non-null, the fp. + * @param [in,out] bitmap The bitmap. + * @param rate The rate. + * + * @return A png_error. + */ + png_error mng_capture_start(core_file *fp, bitmap_t &bitmap, double rate) { UINT8 mhdr[28]; @@ -1118,11 +1130,35 @@ png_error mng_capture_start(core_file *fp, bitmap_t &bitmap, double rate) return PNGERR_NONE; } +/** + * @fn png_error mng_capture_frame(core_file *fp, png_info *info, bitmap_t &bitmap, int palette_length, const rgb_t *palette) + * + * @brief Mng capture frame. + * + * @param [in,out] fp If non-null, the fp. + * @param [in,out] info If non-null, the information. + * @param [in,out] bitmap The bitmap. + * @param palette_length Length of the palette. + * @param palette The palette. + * + * @return A png_error. + */ + png_error mng_capture_frame(core_file *fp, png_info *info, bitmap_t &bitmap, int palette_length, const rgb_t *palette) { return write_png_stream(fp, info, bitmap, palette_length, palette); } +/** + * @fn png_error mng_capture_stop(core_file *fp) + * + * @brief Mng capture stop. + * + * @param [in,out] fp If non-null, the fp. + * + * @return A png_error. + */ + png_error mng_capture_stop(core_file *fp) { return write_chunk(fp, NULL, MNG_CN_MEND, 0); diff --git a/src/lib/util/pool.c b/src/lib/util/pool.c index 807d3568077..0ca2be3deaa 100644 --- a/src/lib/util/pool.c +++ b/src/lib/util/pool.c @@ -570,6 +570,14 @@ static void memory_error(const char *message) pool behavior -------------------------------------------------*/ +/** + * @fn int test_memory_pools(void) + * + * @brief Tests memory pools. + * + * @return An int. + */ + int test_memory_pools(void) { object_pool *pool; diff --git a/src/lib/util/sha1.c b/src/lib/util/sha1.c index b8de519c7bc..732828d9ccf 100644 --- a/src/lib/util/sha1.c +++ b/src/lib/util/sha1.c @@ -121,6 +121,14 @@ static void WRITE_UINT32(unsigned char* data, UINT32 val) /* Initialize the SHA values */ +/** + * @fn void sha1_init(struct sha1_ctx *ctx) + * + * @brief Sha 1 initialise. + * + * @param [in,out] ctx If non-null, the context. + */ + void sha1_init(struct sha1_ctx *ctx) { @@ -145,6 +153,15 @@ sha1_init(struct sha1_ctx *ctx) Note that this function destroys the data area */ +/** + * @fn static void sha1_transform(UINT32 *state, UINT32 *data) + * + * @brief Sha 1 transform. + * + * @param [in,out] state If non-null, the state. + * @param [in,out] data If non-null, the data. + */ + static void sha1_transform(UINT32 *state, UINT32 *data) { @@ -250,6 +267,15 @@ sha1_transform(UINT32 *state, UINT32 *data) state[4] += E; } +/** + * @fn static void sha1_block(struct sha1_ctx *ctx, const UINT8 *block) + * + * @brief Sha 1 block. + * + * @param [in,out] ctx If non-null, the context. + * @param block The block. + */ + static void sha1_block(struct sha1_ctx *ctx, const UINT8 *block) { @@ -267,6 +293,16 @@ sha1_block(struct sha1_ctx *ctx, const UINT8 *block) sha1_transform(ctx->digest, data); } +/** + * @fn void sha1_update(struct sha1_ctx *ctx, unsigned length, const UINT8 *buffer) + * + * @brief Sha 1 update. + * + * @param [in,out] ctx If non-null, the context. + * @param length The length. + * @param buffer The buffer. + */ + void sha1_update(struct sha1_ctx *ctx, unsigned length, const UINT8 *buffer) @@ -303,6 +339,14 @@ sha1_update(struct sha1_ctx *ctx, /* Final wrapup - pad to SHA1_DATA_SIZE-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first) */ +/** + * @fn void sha1_final(struct sha1_ctx *ctx) + * + * @brief Sha 1 final. + * + * @param [in,out] ctx If non-null, the context. + */ + void sha1_final(struct sha1_ctx *ctx) { @@ -346,6 +390,16 @@ sha1_final(struct sha1_ctx *ctx) sha1_transform(ctx->digest, data); } +/** + * @fn void sha1_digest(const struct sha1_ctx *ctx, unsigned length, UINT8 *digest) + * + * @brief Sha 1 digest. + * + * @param ctx The context. + * @param length The length. + * @param [in,out] digest If non-null, the digest. + */ + void sha1_digest(const struct sha1_ctx *ctx, unsigned length, diff --git a/src/lib/util/tagmap.c b/src/lib/util/tagmap.c index c8247899dcc..95b0ec4fabf 100644 --- a/src/lib/util/tagmap.c +++ b/src/lib/util/tagmap.c @@ -13,6 +13,8 @@ #include "tagmap.h" #ifdef MAME_DEBUG +/** @brief The tagmap finds. */ INT32 g_tagmap_finds = 0; +/** @brief true to enable, false to disable the tagmap counter. */ bool g_tagmap_counter_enabled = false; #endif diff --git a/src/lib/util/un7z.c b/src/lib/util/un7z.c index 149ead60e4d..57c7eeb0890 100644 --- a/src/lib/util/un7z.c +++ b/src/lib/util/un7z.c @@ -467,6 +467,14 @@ _7z_error _7z_file_decompress(_7z_file *new_7z, void *buffer, UINT32 length) _7z_file -------------------------------------------------*/ +/** + * @fn static void free__7z_file(_7z_file *_7z) + * + * @brief Free 7z file. + * + * @param [in,out] _7z If non-null, the 7z. + */ + static void free__7z_file(_7z_file *_7z) { if (_7z != NULL) diff --git a/src/lib/util/unicode.c b/src/lib/util/unicode.c index c87965415d7..7f264bc1fb6 100644 --- a/src/lib/util/unicode.c +++ b/src/lib/util/unicode.c @@ -308,6 +308,16 @@ int utf16f_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar) previous character in a string -------------------------------------------------*/ +/** + * @fn const char *utf8_previous_char(const char *utf8string) + * + * @brief UTF 8 previous character. + * + * @param utf8string The UTF 8string. + * + * @return null if it fails, else a char*. + */ + const char *utf8_previous_char(const char *utf8string) { while ((*--utf8string & 0xc0) == 0x80) @@ -322,6 +332,16 @@ const char *utf8_previous_char(const char *utf8string) UTF-8 characters -------------------------------------------------*/ +/** + * @fn int utf8_is_valid_string(const char *utf8string) + * + * @brief UTF 8 is valid string. + * + * @param utf8string The UTF 8string. + * + * @return An int. + */ + int utf8_is_valid_string(const char *utf8string) { int remaining_length = strlen(utf8string); diff --git a/src/lib/util/unzip.c b/src/lib/util/unzip.c index 264029052be..072e29c130d 100644 --- a/src/lib/util/unzip.c +++ b/src/lib/util/unzip.c @@ -67,8 +67,29 @@ #define ZIPCRC 0x0e #define ZIPSIZE 0x12 #define ZIPUNCMP 0x16 + +/** + * @def ZIPFNLN + * + * @brief A macro that defines zipfnln. + */ + #define ZIPFNLN 0x1a + +/** + * @def ZIPXTRALN + * + * @brief A macro that defines zipxtraln. + */ + #define ZIPXTRALN 0x1c + +/** + * @def ZIPNAME + * + * @brief A macro that defines zipname. + */ + #define ZIPNAME 0x1e @@ -77,11 +98,31 @@ INLINE FUNCTIONS ***************************************************************************/ +/** + * @fn INLINE UINT16 read_word(UINT8 *buf) + * + * @brief Reads a word. + * + * @param [in,out] buf If non-null, the buffer. + * + * @return The word. + */ + INLINE UINT16 read_word(UINT8 *buf) { return (buf[1] << 8) | buf[0]; } +/** + * @fn INLINE UINT32 read_dword(UINT8 *buf) + * + * @brief Reads a double word. + * + * @param [in,out] buf If non-null, the buffer. + * + * @return The double word. + */ + INLINE UINT32 read_dword(UINT8 *buf) { return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; @@ -93,6 +134,7 @@ INLINE UINT32 read_dword(UINT8 *buf) GLOBAL VARIABLES ***************************************************************************/ +/** @brief The zip cache[ zip cache size]. */ static zip_file *zip_cache[ZIP_CACHE_SIZE]; @@ -122,6 +164,17 @@ static zip_error decompress_data_type_8(zip_file *zip, UINT64 offset, void *buff zip_file_open - opens a ZIP file for reading -------------------------------------------------*/ +/** + * @fn zip_error zip_file_open(const char *filename, zip_file **zip) + * + * @brief Queries if a given zip file open. + * + * @param filename Filename of the file. + * @param [in,out] zip If non-null, the zip. + * + * @return A zip_error. + */ + zip_error zip_file_open(const char *filename, zip_file **zip) { zip_error ziperr = ZIPERR_NONE; @@ -213,6 +266,14 @@ error: to the cache -------------------------------------------------*/ +/** + * @fn void zip_file_close(zip_file *zip) + * + * @brief Zip file close. + * + * @param [in,out] zip If non-null, the zip. + */ + void zip_file_close(zip_file *zip) { int cachenum; @@ -243,6 +304,12 @@ void zip_file_close(zip_file *zip) cache and free all memory -------------------------------------------------*/ +/** + * @fn void zip_file_cache_clear(void) + * + * @brief Zip file cache clear. + */ + void zip_file_cache_clear(void) { int cachenum; @@ -267,6 +334,16 @@ void zip_file_cache_clear(void) in the ZIP -------------------------------------------------*/ +/** + * @fn const zip_file_header *zip_file_first_file(zip_file *zip) + * + * @brief Zip file first file. + * + * @param [in,out] zip If non-null, the zip. + * + * @return null if it fails, else a zip_file_header*. + */ + const zip_file_header *zip_file_first_file(zip_file *zip) { /* reset the position and go from there */ @@ -280,6 +357,16 @@ const zip_file_header *zip_file_first_file(zip_file *zip) in the ZIP -------------------------------------------------*/ +/** + * @fn const zip_file_header *zip_file_next_file(zip_file *zip) + * + * @brief Zip file next file. + * + * @param [in,out] zip If non-null, the zip. + * + * @return null if it fails, else a zip_file_header*. + */ + const zip_file_header *zip_file_next_file(zip_file *zip) { /* fix up any modified data */ @@ -337,6 +424,18 @@ const zip_file_header *zip_file_next_file(zip_file *zip) from a ZIP into the target buffer -------------------------------------------------*/ +/** + * @fn zip_error zip_file_decompress(zip_file *zip, void *buffer, UINT32 length) + * + * @brief Zip file decompress. + * + * @param [in,out] zip If non-null, the zip. + * @param [in,out] buffer If non-null, the buffer. + * @param length The length. + * + * @return A zip_error. + */ + zip_error zip_file_decompress(zip_file *zip, void *buffer, UINT32 length) { zip_error ziperr; @@ -384,6 +483,14 @@ zip_error zip_file_decompress(zip_file *zip, void *buffer, UINT32 length) zip_file -------------------------------------------------*/ +/** + * @fn static void free_zip_file(zip_file *zip) + * + * @brief Free zip file. + * + * @param [in,out] zip If non-null, the zip. + */ + static void free_zip_file(zip_file *zip) { if (zip != NULL) @@ -410,6 +517,16 @@ static void free_zip_file(zip_file *zip) read_ecd - read the ECD data -------------------------------------------------*/ +/** + * @fn static zip_error read_ecd(zip_file *zip) + * + * @brief Reads an ecd. + * + * @param [in,out] zip If non-null, the zip. + * + * @return The ecd. + */ + static zip_error read_ecd(zip_file *zip) { UINT32 buflen = 1024; @@ -484,6 +601,17 @@ static zip_error read_ecd(zip_file *zip) offset of the compressed data -------------------------------------------------*/ +/** + * @fn static zip_error get_compressed_data_offset(zip_file *zip, UINT64 *offset) + * + * @brief Gets compressed data offset. + * + * @param [in,out] zip If non-null, the zip. + * @param [in,out] offset If non-null, the offset. + * + * @return The compressed data offset. + */ + static zip_error get_compressed_data_offset(zip_file *zip, UINT64 *offset) { file_error error; @@ -521,6 +649,19 @@ static zip_error get_compressed_data_offset(zip_file *zip, UINT64 *offset) type 0 data (which is uncompressed) -------------------------------------------------*/ +/** + * @fn static zip_error decompress_data_type_0(zip_file *zip, UINT64 offset, void *buffer, UINT32 length) + * + * @brief Decompress the data type 0. + * + * @param [in,out] zip If non-null, the zip. + * @param offset The offset. + * @param [in,out] buffer If non-null, the buffer. + * @param length The length. + * + * @return A zip_error. + */ + static zip_error decompress_data_type_0(zip_file *zip, UINT64 offset, void *buffer, UINT32 length) { file_error filerr; @@ -542,6 +683,19 @@ static zip_error decompress_data_type_0(zip_file *zip, UINT64 offset, void *buff type 8 data (which is deflated) -------------------------------------------------*/ +/** + * @fn static zip_error decompress_data_type_8(zip_file *zip, UINT64 offset, void *buffer, UINT32 length) + * + * @brief Decompress the data type 8. + * + * @param [in,out] zip If non-null, the zip. + * @param offset The offset. + * @param [in,out] buffer If non-null, the buffer. + * @param length The length. + * + * @return A zip_error. + */ + static zip_error decompress_data_type_8(zip_file *zip, UINT64 offset, void *buffer, UINT32 length) { UINT32 input_remaining = zip->header.compressed_length; diff --git a/src/lib/util/vbiparse.c b/src/lib/util/vbiparse.c index 3f22e51c990..43cfb57c158 100644 --- a/src/lib/util/vbiparse.c +++ b/src/lib/util/vbiparse.c @@ -276,6 +276,18 @@ int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift) frame -------------------------------------------------*/ +/** + * @fn void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi) + * + * @brief Vbi parse all. + * + * @param source Source for the. + * @param sourcerowpixels The sourcerowpixels. + * @param sourcewidth The sourcewidth. + * @param sourceshift The sourceshift. + * @param [in,out] vbi If non-null, the vbi. + */ + void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi) { UINT32 bits[2][24]; @@ -338,6 +350,16 @@ void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, i into a smaller form for storage -------------------------------------------------*/ +/** + * @fn void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) + * + * @brief Vbi metadata pack. + * + * @param [in,out] dest If non-null, destination for the. + * @param framenum The framenum. + * @param vbi The vbi. + */ + void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) { dest[0] = framenum >> 16; @@ -364,6 +386,16 @@ void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) from a smaller form into the full structure -------------------------------------------------*/ +/** + * @fn void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source) + * + * @brief Vbi metadata unpack. + * + * @param [in,out] vbi If non-null, the vbi. + * @param [in,out] framenum If non-null, the framenum. + * @param source Source for the. + */ + void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source) { if (framenum != NULL) diff --git a/src/lib/util/xmlfile.c b/src/lib/util/xmlfile.c index 7956654a984..193717b30aa 100644 --- a/src/lib/util/xmlfile.c +++ b/src/lib/util/xmlfile.c @@ -451,6 +451,18 @@ int xml_get_attribute_int_format(xml_data_node *node, const char *attribute) found, return = the provided default -------------------------------------------------*/ +/** + * @fn float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue) + * + * @brief XML get attribute float. + * + * @param [in,out] node If non-null, the node. + * @param attribute The attribute. + * @param defvalue The defvalue. + * + * @return A float. + */ + float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue) { const char *string = xml_get_attribute_string(node, attribute, NULL); @@ -467,6 +479,18 @@ float xml_get_attribute_float(xml_data_node *node, const char *attribute, float string value on the node -------------------------------------------------*/ +/** + * @fn xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value) + * + * @brief XML set attribute. + * + * @param [in,out] node If non-null, the node. + * @param name The name. + * @param value The value. + * + * @return null if it fails, else an xml_attribute_node*. + */ + xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value) { xml_attribute_node *anode; @@ -495,6 +519,18 @@ xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, con integer value on the node -------------------------------------------------*/ +/** + * @fn xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value) + * + * @brief XML set attribute int. + * + * @param [in,out] node If non-null, the node. + * @param name The name. + * @param value The value. + * + * @return null if it fails, else an xml_attribute_node*. + */ + xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value) { char buffer[100]; @@ -508,6 +544,18 @@ xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, float value on the node -------------------------------------------------*/ +/** + * @fn xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value) + * + * @brief XML set attribute float. + * + * @param [in,out] node If non-null, the node. + * @param name The name. + * @param value The value. + * + * @return null if it fails, else an xml_attribute_node*. + */ + xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value) { char buffer[100]; @@ -526,6 +574,16 @@ xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *nam to ensure it doesn't contain embedded tags -------------------------------------------------*/ +/** + * @fn const char *xml_normalize_string(const char *string) + * + * @brief XML normalize string. + * + * @param string The string. + * + * @return null if it fails, else a char*. + */ + const char *xml_normalize_string(const char *string) { static char buffer[1024]; @@ -564,6 +622,16 @@ const char *xml_normalize_string(const char *string) systems -------------------------------------------------*/ +/** + * @fn static void *expat_malloc(size_t size) + * + * @brief Expat malloc. + * + * @param size The size. + * + * @return null if it fails, else a void*. + */ + static void *expat_malloc(size_t size) { UINT32 *result = (UINT32 *)malloc(size + 4 * sizeof(UINT32)); @@ -571,12 +639,31 @@ static void *expat_malloc(size_t size) return &result[4]; } +/** + * @fn static void expat_free(void *ptr) + * + * @brief Expat free. + * + * @param [in,out] ptr If non-null, the pointer. + */ + static void expat_free(void *ptr) { if (ptr != NULL) free(&((UINT32 *)ptr)[-4]); } +/** + * @fn static void *expat_realloc(void *ptr, size_t size) + * + * @brief Expat realloc. + * + * @param [in,out] ptr If non-null, the pointer. + * @param size The size. + * + * @return null if it fails, else a void*. + */ + static void *expat_realloc(void *ptr, size_t size) { void *newptr = expat_malloc(size); @@ -596,6 +683,17 @@ static void *expat_realloc(void *ptr, size_t size) expat_setup_parser - set up expat for parsing -------------------------------------------------*/ +/** + * @fn static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts) + * + * @brief Expat setup parser. + * + * @param [in,out] parse_info If non-null, information describing the parse. + * @param [in,out] opts If non-null, options for controlling the operation. + * + * @return An int. + */ + static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts) { XML_Memory_Handling_Suite memcallbacks; @@ -647,6 +745,16 @@ static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opt element -------------------------------------------------*/ +/** + * @fn static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes) + * + * @brief Expat element start. + * + * @param [in,out] data If non-null, the data. + * @param name The name. + * @param attributes The attributes. + */ + static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes) { xml_parse_info *parse_info = (xml_parse_info *) data; @@ -676,6 +784,16 @@ static void expat_element_start(void *data, const XML_Char *name, const XML_Char element data -------------------------------------------------*/ +/** + * @fn static void expat_data(void *data, const XML_Char *s, int len) + * + * @brief Expat data. + * + * @param [in,out] data If non-null, the data. + * @param s The const XML_Char * to process. + * @param len The length. + */ + static void expat_data(void *data, const XML_Char *s, int len) { xml_parse_info *parse_info = (xml_parse_info *) data; @@ -714,6 +832,15 @@ static void expat_data(void *data, const XML_Char *s, int len) of an element -------------------------------------------------*/ +/** + * @fn static void expat_element_end(void *data, const XML_Char *name) + * + * @brief Expat element end. + * + * @param [in,out] data If non-null, the data. + * @param name The name. + */ + static void expat_element_end(void *data, const XML_Char *name) { xml_parse_info *parse_info = (xml_parse_info *) data; @@ -764,6 +891,18 @@ static void expat_element_end(void *data, const XML_Char *name) add_child - add a new node to the parent -------------------------------------------------*/ +/** + * @fn static xml_data_node *add_child(xml_data_node *parent, const char *name, const char *value) + * + * @brief Adds a child. + * + * @param [in,out] parent If non-null, the parent. + * @param name The name. + * @param value The value. + * + * @return null if it fails, else an xml_data_node*. + */ + static xml_data_node *add_child(xml_data_node *parent, const char *name, const char *value) { xml_data_node **pnode; @@ -806,6 +945,18 @@ static xml_data_node *add_child(xml_data_node *parent, const char *name, const c given node -------------------------------------------------*/ +/** + * @fn static xml_attribute_node *add_attribute(xml_data_node *node, const char *name, const char *value) + * + * @brief Adds an attribute. + * + * @param [in,out] node If non-null, the node. + * @param name The name. + * @param value The value. + * + * @return null if it fails, else an xml_attribute_node*. + */ + static xml_attribute_node *add_attribute(xml_data_node *node, const char *name, const char *value) { xml_attribute_node *anode, **panode; @@ -849,6 +1000,16 @@ static xml_attribute_node *add_attribute(xml_data_node *node, const char *name, an XML node and its children to a file -------------------------------------------------*/ +/** + * @fn static void write_node_recursive(xml_data_node *node, int indent, core_file *file) + * + * @brief Writes a node recursive. + * + * @param [in,out] node If non-null, the node. + * @param indent The indent. + * @param [in,out] file If non-null, the file. + */ + static void write_node_recursive(xml_data_node *node, int indent, core_file *file) { xml_attribute_node *anode; @@ -892,6 +1053,14 @@ static void write_node_recursive(xml_data_node *node, int indent, core_file *fil the data allocated to an XML node -------------------------------------------------*/ +/** + * @fn static void free_node_recursive(xml_data_node *node) + * + * @brief Free node recursive. + * + * @param [in,out] node If non-null, the node. + */ + static void free_node_recursive(xml_data_node *node) { xml_attribute_node *anode, *nanode; diff --git a/src/lib/util/zippath.c b/src/lib/util/zippath.c index d24f8438509..8d22952223a 100644 --- a/src/lib/util/zippath.c +++ b/src/lib/util/zippath.c @@ -22,13 +22,25 @@ TYPE DEFINITIONS ***************************************************************************/ +/** + * @struct zippath_returned_directory + * + * @brief A zippath returned directory. + */ + struct zippath_returned_directory { + /** @brief The next. */ zippath_returned_directory *next; + /** @brief The name. */ std::string name; }; - +/** + * @class zippath_directory + * + * @brief A zippath directory. + */ class zippath_directory { @@ -41,16 +53,23 @@ public: returned_dirlist(NULL) { } /* common */ + /** @brief true to returned parent. */ bool returned_parent; + /** @brief The returned entry. */ osd_directory_entry returned_entry; /* specific to normal directories */ + /** @brief Pathname of the directory. */ osd_directory *directory; /* specific to ZIP directories */ + /** @brief true to called zip first. */ bool called_zip_first; + /** @brief The zipfile. */ zip_file *zipfile; + /** @brief The zipprefix. */ std::string zipprefix; + /** @brief The returned dirlist. */ zippath_returned_directory *returned_dirlist; }; @@ -69,9 +88,17 @@ static int is_7z_file(const char *path); PATH OPERATIONS ***************************************************************************/ -//============================================================ -// is_path_separator -//============================================================ +/** + * @fn int is_path_separator(char c) + * + * @brief ============================================================ + * is_path_separator + * ============================================================. + * + * @param c The character. + * + * @return An int. + */ int is_path_separator(char c) { @@ -82,6 +109,16 @@ int is_path_separator(char c) parse_parent_path - parses out the parent path -------------------------------------------------*/ +/** + * @fn static void parse_parent_path(const char *path, int *beginpos, int *endpos) + * + * @brief Parse parent path. + * + * @param path Full pathname of the file. + * @param [in,out] beginpos If non-null, the beginpos. + * @param [in,out] endpos If non-null, the endpos. + */ + static void parse_parent_path(const char *path, int *beginpos, int *endpos) { int length = strlen(path); @@ -111,6 +148,17 @@ static void parse_parent_path(const char *path, int *beginpos, int *endpos) zippath_parent - retrieves the parent directory -------------------------------------------------*/ +/** + * @fn std::string &zippath_parent(std::string &dst, const char *path) + * + * @brief Zippath parent. + * + * @param [in,out] dst Destination for the. + * @param path Full pathname of the file. + * + * @return A std::string& + */ + std::string &zippath_parent(std::string &dst, const char *path) { int pos; @@ -133,6 +181,17 @@ std::string &zippath_parent(std::string &dst, const char *path) directory basename -------------------------------------------------*/ +/** + * @fn std::string &zippath_parent_basename(std::string &dst, const char *path) + * + * @brief Zippath parent basename. + * + * @param [in,out] dst Destination for the. + * @param path Full pathname of the file. + * + * @return A std::string& + */ + std::string &zippath_parent_basename(std::string &dst, const char *path) { int beginpos, endpos; @@ -147,6 +206,18 @@ std::string &zippath_parent_basename(std::string &dst, const char *path) zippath_combine - combines two paths -------------------------------------------------*/ +/** + * @fn std::string &zippath_combine(std::string &dst, const char *path1, const char *path2) + * + * @brief Zippath combine. + * + * @param [in,out] dst Destination for the. + * @param path1 The first path. + * @param path2 The second path. + * + * @return A std::string& + */ + std::string &zippath_combine(std::string &dst, const char *path1, const char *path2) { if (!strcmp(path2, ".")) @@ -183,6 +254,16 @@ std::string &zippath_combine(std::string &dst, const char *path1, const char *pa file_error to a zip_error -------------------------------------------------*/ +/** + * @fn static file_error file_error_from_zip_error(zip_error ziperr) + * + * @brief File error from zip error. + * + * @param ziperr The ziperr. + * + * @return A file_error. + */ + static file_error file_error_from_zip_error(zip_error ziperr) { file_error filerr; @@ -216,6 +297,18 @@ static file_error file_error_from_zip_error(zip_error ziperr) from a zip file entry -------------------------------------------------*/ +/** + * @fn static file_error create_core_file_from_zip(zip_file *zip, const zip_file_header *header, core_file *&file) + * + * @brief Creates core file from zip. + * + * @param [in,out] zip If non-null, the zip. + * @param header The header. + * @param [in,out] file [in,out] If non-null, the file. + * + * @return The new core file from zip. + */ + static file_error create_core_file_from_zip(zip_file *zip, const zip_file_header *header, core_file *&file) { file_error filerr; @@ -251,6 +344,19 @@ done: zippath_fopen - opens a zip path file -------------------------------------------------*/ +/** + * @fn file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&file, std::string &revised_path) + * + * @brief Zippath fopen. + * + * @param filename Filename of the file. + * @param openflags The openflags. + * @param [in,out] file [in,out] If non-null, the file. + * @param [in,out] revised_path Full pathname of the revised file. + * + * @return A file_error. + */ + file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&file, std::string &revised_path) { file_error filerr = FILERR_NOT_FOUND; @@ -380,6 +486,16 @@ done: is_root - tests to see if this path is the root -------------------------------------------------*/ +/** + * @fn static int is_root(const char *path) + * + * @brief Is root. + * + * @param path Full pathname of the file. + * + * @return An int. + */ + static int is_root(const char *path) { int i = 0; @@ -402,6 +518,16 @@ static int is_root(const char *path) 7-zip file -------------------------------------------------*/ +/** + * @fn static int is_7z_file(const char *path) + * + * @brief Is 7z file. + * + * @param path Full pathname of the file. + * + * @return An int. + */ + static int is_7z_file(const char *path) { const char *s = strrchr(path, '.'); @@ -414,6 +540,16 @@ static int is_7z_file(const char *path) ZIP file -------------------------------------------------*/ +/** + * @fn static int is_zip_file(const char *path) + * + * @brief Is zip file. + * + * @param path Full pathname of the file. + * + * @return An int. + */ + static int is_zip_file(const char *path) { const char *s = strrchr(path, '.'); @@ -427,6 +563,16 @@ static int is_zip_file(const char *path) character is a path separator within a ZIP file -------------------------------------------------*/ +/** + * @fn static int is_zip_file_separator(char c) + * + * @brief Is zip file separator. + * + * @param c The character. + * + * @return An int. + */ + static int is_zip_file_separator(char c) { return (c == '/') || (c == '\\'); @@ -439,6 +585,16 @@ static int is_zip_file_separator(char c) character is a path separator within a ZIP path -------------------------------------------------*/ +/** + * @fn static int is_zip_path_separator(char c) + * + * @brief Is zip path separator. + * + * @param c The character. + * + * @return An int. + */ + static int is_zip_path_separator(char c) { return is_zip_file_separator(c) || is_path_separator(c); @@ -451,6 +607,17 @@ static int is_zip_path_separator(char c) character, normalizing separators as '/' -------------------------------------------------*/ +/** + * @fn static char next_path_char(const char *s, int *pos) + * + * @brief Next path character. + * + * @param s The const char * to process. + * @param [in,out] pos If non-null, the position. + * + * @return A char. + */ + static char next_path_char(const char *s, int *pos) { char result; @@ -493,6 +660,18 @@ static char next_path_char(const char *s, int *pos) type of a sub path in a zip file -------------------------------------------------*/ +/** + * @fn static const zip_file_header *zippath_find_sub_path(zip_file *zipfile, const char *subpath, osd_dir_entry_type *type) + * + * @brief Zippath find sub path. + * + * @param [in,out] zipfile If non-null, the zipfile. + * @param subpath The subpath. + * @param [in,out] type If non-null, the type. + * + * @return null if it fails, else a zip_file_header*. + */ + static const zip_file_header *zippath_find_sub_path(zip_file *zipfile, const char *subpath, osd_dir_entry_type *type) { int i, j; @@ -546,6 +725,19 @@ static const zip_file_header *zippath_find_sub_path(zip_file *zipfile, const cha true path and ZIP entry components -------------------------------------------------*/ +/** + * @fn static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_type, zip_file *&zipfile, std::string &newpath) + * + * @brief Zippath resolve. + * + * @param path Full pathname of the file. + * @param [in,out] entry_type Type of the entry. + * @param [in,out] zipfile [in,out] If non-null, the zipfile. + * @param [in,out] newpath The newpath. + * + * @return A file_error. + */ + static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_type, zip_file *&zipfile, std::string &newpath) { file_error err; @@ -641,6 +833,17 @@ done: zippath_opendir - opens a directory -------------------------------------------------*/ +/** + * @fn file_error zippath_opendir(const char *path, zippath_directory **directory) + * + * @brief Zippath opendir. + * + * @param path Full pathname of the file. + * @param [in,out] directory If non-null, pathname of the directory. + * + * @return A file_error. + */ + file_error zippath_opendir(const char *path, zippath_directory **directory) { file_error err; @@ -701,6 +904,14 @@ done: zippath_closedir - closes a directory -------------------------------------------------*/ +/** + * @fn void zippath_closedir(zippath_directory *directory) + * + * @brief Zippath closedir. + * + * @param [in,out] directory If non-null, pathname of the directory. + */ + void zippath_closedir(zippath_directory *directory) { if (directory->directory != NULL) @@ -726,6 +937,17 @@ void zippath_closedir(zippath_directory *directory) returns the relative path -------------------------------------------------*/ +/** + * @fn static const char *get_relative_path(zippath_directory *directory, const zip_file_header *header) + * + * @brief Gets relative path. + * + * @param [in,out] directory If non-null, pathname of the directory. + * @param header The header. + * + * @return null if it fails, else the relative path. + */ + static const char *get_relative_path(zippath_directory *directory, const zip_file_header *header) { const char *result = NULL; @@ -747,6 +969,16 @@ static const char *get_relative_path(zippath_directory *directory, const zip_fil zippath_readdir - reads a directory -------------------------------------------------*/ +/** + * @fn const osd_directory_entry *zippath_readdir(zippath_directory *directory) + * + * @brief Zippath readdir. + * + * @param [in,out] directory If non-null, pathname of the directory. + * + * @return null if it fails, else an osd_directory_entry*. + */ + const osd_directory_entry *zippath_readdir(zippath_directory *directory) { const osd_directory_entry *result = NULL; @@ -853,6 +1085,16 @@ const osd_directory_entry *zippath_readdir(zippath_directory *directory) a ZIP path or FALSE if not -------------------------------------------------*/ +/** + * @fn int zippath_is_zip(zippath_directory *directory) + * + * @brief Zippath is zip. + * + * @param [in,out] directory If non-null, pathname of the directory. + * + * @return An int. + */ + int zippath_is_zip(zippath_directory *directory) { return directory->zipfile != NULL; diff --git a/src/mess/audio/mac.c b/src/mess/audio/mac.c index b93b4d86e0d..7a0b7a93a62 100644 --- a/src/mess/audio/mac.c +++ b/src/mess/audio/mac.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /*************************************************************************** diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c index 01be1660fa9..bc5515274e9 100644 --- a/src/mess/drivers/apexc.c +++ b/src/mess/drivers/apexc.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet, Robbbert /* drivers/apexc.c : APEXC driver diff --git a/src/mess/drivers/concept.c b/src/mess/drivers/concept.c index 4d15dd5e213..947d4bfcfa7 100644 --- a/src/mess/drivers/concept.c +++ b/src/mess/drivers/concept.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet, Brett Wyer /* Corvus Concept driver diff --git a/src/mess/drivers/exelv.c b/src/mess/drivers/exelv.c index f66216e03d9..c48bd0234dc 100644 --- a/src/mess/drivers/exelv.c +++ b/src/mess/drivers/exelv.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* Experimental exelvision driver diff --git a/src/mess/drivers/lisa.c b/src/mess/drivers/lisa.c index e851ae42eaa..3bba439d0bc 100644 --- a/src/mess/drivers/lisa.c +++ b/src/mess/drivers/lisa.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /********************************************************************* diff --git a/src/mess/drivers/mac.c b/src/mess/drivers/mac.c index 65cdb2711ca..bc670603bdc 100644 --- a/src/mess/drivers/mac.c +++ b/src/mess/drivers/mac.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /**************************************************************************** diff --git a/src/mess/drivers/pdp1.c b/src/mess/drivers/pdp1.c index 4dc3645143c..66ec3979cfb 100644 --- a/src/mess/drivers/pdp1.c +++ b/src/mess/drivers/pdp1.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* diff --git a/src/mess/drivers/ti990_10.c b/src/mess/drivers/ti990_10.c index 8150b5437a4..f7f3f9ff219 100644 --- a/src/mess/drivers/ti990_10.c +++ b/src/mess/drivers/ti990_10.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* TI990/10 driver diff --git a/src/mess/drivers/ti99_2.c b/src/mess/drivers/ti99_2.c index b5cc6681e35..41ed9ac2a7b 100644 --- a/src/mess/drivers/ti99_2.c +++ b/src/mess/drivers/ti99_2.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* Experimental ti99/2 driver diff --git a/src/mess/drivers/tm990189.c b/src/mess/drivers/tm990189.c index b883c01ffcc..f6c778dd305 100644 --- a/src/mess/drivers/tm990189.c +++ b/src/mess/drivers/tm990189.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet, Robbbert /* Experimental tm990/189 ("University Module") driver. diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c index c675256be72..1978e64fdb0 100644 --- a/src/mess/drivers/tutor.c +++ b/src/mess/drivers/tutor.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* Experimental Tomy Tutor driver diff --git a/src/mess/drivers/tx0.c b/src/mess/drivers/tx0.c index c06cb542064..b00fcc1c714 100644 --- a/src/mess/drivers/tx0.c +++ b/src/mess/drivers/tx0.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* TX-0 diff --git a/src/mess/includes/concept.h b/src/mess/includes/concept.h index 73dcb5f7e4e..c9759c893a8 100644 --- a/src/mess/includes/concept.h +++ b/src/mess/includes/concept.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet, Brett Wyer /***************************************************************************** * diff --git a/src/mess/includes/lisa.h b/src/mess/includes/lisa.h index fc034a1059f..c52c53fb833 100644 --- a/src/mess/includes/lisa.h +++ b/src/mess/includes/lisa.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /***************************************************************************** * diff --git a/src/mess/includes/mac.h b/src/mess/includes/mac.h index 36b9bf6e5f9..6b0092501fd 100644 --- a/src/mess/includes/mac.h +++ b/src/mess/includes/mac.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /***************************************************************************** * diff --git a/src/mess/includes/pdp1.h b/src/mess/includes/pdp1.h index 80a7d297beb..ee2c5f7f703 100644 --- a/src/mess/includes/pdp1.h +++ b/src/mess/includes/pdp1.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /***************************************************************************** * diff --git a/src/mess/includes/tx0.h b/src/mess/includes/tx0.h index 83fc093a4b8..b961a415224 100644 --- a/src/mess/includes/tx0.h +++ b/src/mess/includes/tx0.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /***************************************************************************** * diff --git a/src/mess/machine/applefdc.c b/src/mess/machine/applefdc.c index cf9b08b206b..dac524308ba 100644 --- a/src/mess/machine/applefdc.c +++ b/src/mess/machine/applefdc.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont +// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /********************************************************************* applefdc.c diff --git a/src/mess/machine/applefdc.h b/src/mess/machine/applefdc.h index cd132a8e00a..38efb9036d2 100644 --- a/src/mess/machine/applefdc.h +++ b/src/mess/machine/applefdc.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont +// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /********************************************************************* applefdc.h diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c index 8c547c51903..7beeb8fe1d7 100644 --- a/src/mess/machine/concept.c +++ b/src/mess/machine/concept.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet, Brett Wyer /* Corvus Concept driver diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c index aee6ef4ba70..2e2b2bb6bc6 100644 --- a/src/mess/machine/lisa.c +++ b/src/mess/machine/lisa.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* experimental LISA driver diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c index 74bbaae1a00..7ce5a0ab2c4 100644 --- a/src/mess/machine/mac.c +++ b/src/mess/machine/mac.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /**************************************************************************** diff --git a/src/mess/machine/smartmed.c b/src/mess/machine/smartmed.c index fcbb3966dad..32e9c53bcaa 100644 --- a/src/mess/machine/smartmed.c +++ b/src/mess/machine/smartmed.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* smartmed.c: SmartMedia Flash ROM emulation diff --git a/src/mess/machine/smartmed.h b/src/mess/machine/smartmed.h index 1e6c1d0b50c..4f15cf35a0f 100644 --- a/src/mess/machine/smartmed.h +++ b/src/mess/machine/smartmed.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* smartmed.h: header file for smartmed.c diff --git a/src/mess/machine/sonydriv.c b/src/mess/machine/sonydriv.c index da47caaf37a..31c88e4f988 100644 --- a/src/mess/machine/sonydriv.c +++ b/src/mess/machine/sonydriv.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /********************************************************************* diff --git a/src/mess/machine/sonydriv.h b/src/mess/machine/sonydriv.h index 3ebd46cb601..52ecca6697a 100644 --- a/src/mess/machine/sonydriv.h +++ b/src/mess/machine/sonydriv.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /********************************************************************* diff --git a/src/mess/machine/ti99/990_dk.c b/src/mess/machine/ti99/990_dk.c index ccdddbad62d..5eb8ea58892 100644 --- a/src/mess/machine/ti99/990_dk.c +++ b/src/mess/machine/ti99/990_dk.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 990_dk.c: emulation of a TI FD800 'Diablo' floppy disk controller diff --git a/src/mess/machine/ti99/990_dk.h b/src/mess/machine/ti99/990_dk.h index 63af5cfdc3c..eb044b2974f 100644 --- a/src/mess/machine/ti99/990_dk.h +++ b/src/mess/machine/ti99/990_dk.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 990_dk.h: include file for 990_dk.c diff --git a/src/mess/machine/ti99/990_hd.c b/src/mess/machine/ti99/990_hd.c index 31c5b73d1e5..fa0cd00646b 100644 --- a/src/mess/machine/ti99/990_hd.c +++ b/src/mess/machine/ti99/990_hd.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 990_hd.c: emulation of a generic ti990 hard disk controller, for use with diff --git a/src/mess/machine/ti99/990_hd.h b/src/mess/machine/ti99/990_hd.h index aad7cec651c..4c5e85f928d 100644 --- a/src/mess/machine/ti99/990_hd.h +++ b/src/mess/machine/ti99/990_hd.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 990_hd.h: include file for 990_hd.c diff --git a/src/mess/machine/ti99/990_tap.c b/src/mess/machine/ti99/990_tap.c index 65a77b9dd9d..20ca2333f7b 100644 --- a/src/mess/machine/ti99/990_tap.c +++ b/src/mess/machine/ti99/990_tap.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 990_tap.c: emulation of a generic ti990 tape controller, for use with diff --git a/src/mess/machine/ti99/990_tap.h b/src/mess/machine/ti99/990_tap.h index aed56f24ee2..09e2e30da0a 100644 --- a/src/mess/machine/ti99/990_tap.h +++ b/src/mess/machine/ti99/990_tap.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 990_tap.h: include file for 990_tap.c diff --git a/src/mess/tools/imgtool/imghd.c b/src/mess/tools/imgtool/imghd.c index d48e8a0f0b2..8ac129751f9 100644 --- a/src/mess/tools/imgtool/imghd.c +++ b/src/mess/tools/imgtool/imghd.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet /* Code to interface the MESS image code with MAME's harddisk core. diff --git a/src/mess/tools/imgtool/modules/concept.c b/src/mess/tools/imgtool/modules/concept.c index 8cf115a9d4b..a5c5a37b1ad 100644 --- a/src/mess/tools/imgtool/modules/concept.c +++ b/src/mess/tools/imgtool/modules/concept.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* Handlers for concept floppy images diff --git a/src/mess/tools/imgtool/modules/fat.c b/src/mess/tools/imgtool/modules/fat.c index ce4bbff8c6d..4f2fca17c25 100644 --- a/src/mess/tools/imgtool/modules/fat.c +++ b/src/mess/tools/imgtool/modules/fat.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/fat.h b/src/mess/tools/imgtool/modules/fat.h index b46ad77a357..46f741999c3 100644 --- a/src/mess/tools/imgtool/modules/fat.h +++ b/src/mess/tools/imgtool/modules/fat.h @@ -1,3 +1,3 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet void fat_get_info(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info); diff --git a/src/mess/tools/imgtool/modules/mac.c b/src/mess/tools/imgtool/modules/mac.c index 8e2465bab4e..53ae4be3ec0 100644 --- a/src/mess/tools/imgtool/modules/mac.c +++ b/src/mess/tools/imgtool/modules/mac.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/macbin.c b/src/mess/tools/imgtool/modules/macbin.c index 5ecd20119ba..3ef85a039d1 100644 --- a/src/mess/tools/imgtool/modules/macbin.c +++ b/src/mess/tools/imgtool/modules/macbin.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/macutil.c b/src/mess/tools/imgtool/modules/macutil.c index 3f8b0b90c96..fe2e1ade51a 100644 --- a/src/mess/tools/imgtool/modules/macutil.c +++ b/src/mess/tools/imgtool/modules/macutil.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/macutil.h b/src/mess/tools/imgtool/modules/macutil.h index 1bb793467d9..71121dade31 100644 --- a/src/mess/tools/imgtool/modules/macutil.h +++ b/src/mess/tools/imgtool/modules/macutil.h @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/pc_flop.c b/src/mess/tools/imgtool/modules/pc_flop.c index d7d498ef829..916cf873c46 100644 --- a/src/mess/tools/imgtool/modules/pc_flop.c +++ b/src/mess/tools/imgtool/modules/pc_flop.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/pc_hard.c b/src/mess/tools/imgtool/modules/pc_hard.c index 9d3cfb79107..915032932c7 100644 --- a/src/mess/tools/imgtool/modules/pc_hard.c +++ b/src/mess/tools/imgtool/modules/pc_hard.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/prodos.c b/src/mess/tools/imgtool/modules/prodos.c index 1e781759a86..5800e2bf9f3 100644 --- a/src/mess/tools/imgtool/modules/prodos.c +++ b/src/mess/tools/imgtool/modules/prodos.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/tools/imgtool/modules/ti99.c b/src/mess/tools/imgtool/modules/ti99.c index f8d25e5a72f..220cbebdb27 100644 --- a/src/mess/tools/imgtool/modules/ti99.c +++ b/src/mess/tools/imgtool/modules/ti99.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* Handlers for ti99 disk images diff --git a/src/mess/tools/imgtool/modules/ti990hd.c b/src/mess/tools/imgtool/modules/ti990hd.c index 37bcc6dd928..2c2a6c3a13c 100644 --- a/src/mess/tools/imgtool/modules/ti990hd.c +++ b/src/mess/tools/imgtool/modules/ti990hd.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /* Handlers for ti990 disk images diff --git a/src/mess/tools/imgtool/modules/vzdos.c b/src/mess/tools/imgtool/modules/vzdos.c index 25e8dad5d38..d24d1286019 100644 --- a/src/mess/tools/imgtool/modules/vzdos.c +++ b/src/mess/tools/imgtool/modules/vzdos.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Raphael Nabet /**************************************************************************** diff --git a/src/mess/video/733_asr.c b/src/mess/video/733_asr.c index 5aabc4788be..da1286d69f5 100644 --- a/src/mess/video/733_asr.c +++ b/src/mess/video/733_asr.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 733 ASR emulation diff --git a/src/mess/video/733_asr.h b/src/mess/video/733_asr.h index 323e3f688fe..6182a21eb52 100644 --- a/src/mess/video/733_asr.h +++ b/src/mess/video/733_asr.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet #define asr733_chr_region ":gfx1" diff --git a/src/mess/video/911_chr.h b/src/mess/video/911_chr.h index de41d265a06..6d24b5d0415 100644 --- a/src/mess/video/911_chr.h +++ b/src/mess/video/911_chr.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* 911_chr.h: character definitions for 911_vdt.c diff --git a/src/mess/video/911_key.h b/src/mess/video/911_key.h index cf0e77d2148..108bf85fd7d 100644 --- a/src/mess/video/911_key.h +++ b/src/mess/video/911_key.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* key translation table for both US and UK terminals diff --git a/src/mess/video/911_vdt.c b/src/mess/video/911_vdt.c index 3c323cd10fe..c0d30600681 100644 --- a/src/mess/video/911_vdt.c +++ b/src/mess/video/911_vdt.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* TI 911 VDT core. To be operated with the TI 990 line of computers (can be connected to diff --git a/src/mess/video/911_vdt.h b/src/mess/video/911_vdt.h index 3c8bbe02521..7eb0f55dbc1 100644 --- a/src/mess/video/911_vdt.h +++ b/src/mess/video/911_vdt.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet #include "sound/beep.h" diff --git a/src/mess/video/crt.c b/src/mess/video/crt.c index 214b88c0078..d075600baf7 100644 --- a/src/mess/video/crt.c +++ b/src/mess/video/crt.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* video/crt.c diff --git a/src/mess/video/crt.h b/src/mess/video/crt.h index ccca938ad3b..cb0767ad0d9 100644 --- a/src/mess/video/crt.h +++ b/src/mess/video/crt.h @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /************************************************************************* diff --git a/src/mess/video/mac.c b/src/mess/video/mac.c index 1856aa4427e..baffedf186d 100644 --- a/src/mess/video/mac.c +++ b/src/mess/video/mac.c @@ -1,4 +1,4 @@ -// license:??? +// license:BSD-3-Clause // copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont /*************************************************************************** diff --git a/src/mess/video/pdp1.c b/src/mess/video/pdp1.c index e2735bb18b9..eea7b521679 100644 --- a/src/mess/video/pdp1.c +++ b/src/mess/video/pdp1.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* video/pdp1.c diff --git a/src/mess/video/tx0.c b/src/mess/video/tx0.c index c74fb8df1ad..4da8462a4af 100644 --- a/src/mess/video/tx0.c +++ b/src/mess/video/tx0.c @@ -1,4 +1,4 @@ -// license:??? +// license:GPL-2.0+ // copyright-holders:Raphael Nabet /* TX-0 From 05a79d2e2011ec9efe711019b796634ef8d0cfb0 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sun, 7 Jun 2015 17:50:19 +0200 Subject: [PATCH 207/284] MFM hard disk WIP; adding config options --- src/emu/bus/ti99_peb/hfdc.c | 16 +-- src/emu/machine/hdc9234.c | 35 ++++-- src/emu/machine/ti99_hd.c | 240 ++++++++++++++++++++++++++---------- src/emu/machine/ti99_hd.h | 52 +++++++- 4 files changed, 258 insertions(+), 85 deletions(-) diff --git a/src/emu/bus/ti99_peb/hfdc.c b/src/emu/bus/ti99_peb/hfdc.c index 0e3c77190f4..5d4f84795d1 100644 --- a/src/emu/bus/ti99_peb/hfdc.c +++ b/src/emu/bus/ti99_peb/hfdc.c @@ -510,7 +510,7 @@ void myarc_hfdc_device::floppy_index_callback(floppy_image_device *floppy, int s */ void myarc_hfdc_device::harddisk_index_callback(mfm_harddisk_device *harddisk, int state) { - /* if (TRACE_LINES) */ if (state==1) logerror("%s: HD index pulse\n", tag()); + if (TRACE_LINES) if (state==1) logerror("%s: HD index pulse\n", tag()); set_bits(m_status_latch, HDC_DS_INDEX, (state==ASSERT_LINE)); signal_drive_status(); } @@ -520,7 +520,7 @@ void myarc_hfdc_device::harddisk_index_callback(mfm_harddisk_device *harddisk, i */ void myarc_hfdc_device::harddisk_ready_callback(mfm_harddisk_device *harddisk, int state) { - /* if (TRACE_LINES) */ logerror("%s: HD READY = %d\n", tag(), state); + if (TRACE_LINES) logerror("%s: HD READY = %d\n", tag(), state); set_bits(m_status_latch, HDC_DS_READY, (state==ASSERT_LINE)); signal_drive_status(); } @@ -530,7 +530,7 @@ void myarc_hfdc_device::harddisk_ready_callback(mfm_harddisk_device *harddisk, i */ void myarc_hfdc_device::harddisk_skcom_callback(mfm_harddisk_device *harddisk, int state) { - /* if (TRACE_LINES) */ logerror("%s: HD seek complete = %d\n", tag(), state); + if (TRACE_LINES) logerror("%s: HD seek complete = %d\n", tag(), state); set_bits(m_status_latch, HDC_DS_SKCOM, (state==ASSERT_LINE)); signal_drive_status(); } @@ -1005,8 +1005,8 @@ static SLOT_INTERFACE_START( hfdc_floppies ) SLOT_INTERFACE_END static SLOT_INTERFACE_START( hfdc_harddisks ) - SLOT_INTERFACE( "generic", MFM_HD_GENERIC ) // Generic high-level emulation -// SLOT_INTERFACE( "seagatemfm", MFM_HD_SEAGATE ) // Seagate ST-225 and others + SLOT_INTERFACE( "generic", MFMHD_GENERIC ) // Generic high-level emulation + SLOT_INTERFACE( "st225", MFMHD_ST225 ) // Seagate ST-225 and others SLOT_INTERFACE_END MACHINE_CONFIG_FRAGMENT( ti99_hfdc ) @@ -1024,9 +1024,9 @@ MACHINE_CONFIG_FRAGMENT( ti99_hfdc ) MCFG_FLOPPY_DRIVE_ADD("f4", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats) // NB: Hard disks don't go without image (other than floppy drives) - MCFG_MFM_HARDDISK_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE) - MCFG_MFM_HARDDISK_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE) - MCFG_MFM_HARDDISK_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE) + MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20) + MCFG_MFM_HARDDISK_CONN_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20) + MCFG_MFM_HARDDISK_CONN_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20) MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0) MCFG_MM58274C_MODE24(1) // 24 hour diff --git a/src/emu/machine/hdc9234.c b/src/emu/machine/hdc9234.c index 183d1af2aaf..91c41fc21d6 100644 --- a/src/emu/machine/hdc9234.c +++ b/src/emu/machine/hdc9234.c @@ -607,19 +607,19 @@ void hdc9234_device::wait_line(int line, line_state level, int substate, bool st bool line_at_level = true; if (line == SEEKCOMP_LINE && (seek_complete() == (level==ASSERT_LINE))) { - logerror("%s: SEEK_COMPLETE line is already %d\n", tag(), level); + if (TRACE_LINES) logerror("%s: SEEK_COMPLETE line is already %d\n", tag(), level); } else { if (line == INDEX_LINE && (index_hole() == (level==ASSERT_LINE))) { - logerror("%s: INDEX line is already %d\n", tag(), level); + if (TRACE_LINES) logerror("%s: INDEX line is already %d\n", tag(), level); } else { if (line == READY_LINE && (drive_ready() == (level==ASSERT_LINE))) { - logerror("%s: READY line is already %d\n", tag(), level); + if (TRACE_LINES) logerror("%s: READY line is already %d\n", tag(), level); } else { @@ -2724,7 +2724,7 @@ void hdc9234_device::live_run_until(attotime limit) void hdc9234_device::live_run_hd_until(attotime limit) { int slot = 0; - logerror("%s: live_run_hd\n", tag()); + if (TRACE_LIVE) logerror("%s: live_run_hd\n", tag()); if (m_live_state.state == IDLE || m_live_state.next_state != -1) return; @@ -2745,6 +2745,12 @@ void hdc9234_device::live_run_hd_until(attotime limit) switch (m_live_state.state) { case SEARCH_IDAM: + if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM) + { + logerror("%s: [%s live] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str()); + m_last_live_state = m_live_state.state; + } + // This bit will be set when the IDAM cannot be found set_bits(m_register_r[CHIP_STATUS], CS_SYNCERR, false); @@ -2753,7 +2759,9 @@ void hdc9234_device::live_run_hd_until(attotime limit) if (TRACE_LIVE) logerror("%s: [%s live] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str()); return; } - logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); + + if (TRACE_LIVE) + if ((m_live_state.bit_counter & 0x000f)==0) logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); // [1] p. 9: The ID field sync mark must be found within 33,792 byte times if (m_live_state.bit_count_total > 33792*16) @@ -2781,6 +2789,9 @@ void hdc9234_device::live_run_hd_until(attotime limit) case READ_IDENT: if (read_from_mfmhd(limit)) return; + // Repeat until we have collected 16 bits (MFM_BITS; in the other modes this is always false) + if (m_live_state.bit_counter & 15) break; + // Ident bytes are 111111xx if ((m_live_state.data_reg & 0xfc) != 0xfc) { @@ -2806,6 +2817,9 @@ void hdc9234_device::live_run_hd_until(attotime limit) if (read_from_mfmhd(limit)) return; + // Repeat until we have collected 16 bits + if (m_live_state.bit_counter & 15) break; + if (TRACE_LIVE) logerror("%s: slot %d = %02x, crc=%04x\n", tag(), slot, m_live_state.data_reg, m_live_state.crc); m_register_r[id_field[slot++]] = m_live_state.data_reg; @@ -2834,7 +2848,8 @@ void hdc9234_device::live_run_hd_until(attotime limit) if (read_from_mfmhd(limit)) return; - logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); + if (TRACE_LIVE) + if ((m_live_state.bit_counter & 15)==0) logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg); if (m_live_state.bit_counter > 30*16) { @@ -2856,6 +2871,8 @@ void hdc9234_device::live_run_hd_until(attotime limit) case READ_DATADEL_FLAG: if (read_from_mfmhd(limit)) return; + if (m_live_state.bit_counter & 15) break; + if ((m_live_state.data_reg & 0xff) == 0xf8) { if (TRACE_LIVE) logerror("%s: [%s live] Found deleted data mark F8 after DAM sync\n", tag(), tts(m_live_state.time).c_str()); @@ -2897,6 +2914,9 @@ void hdc9234_device::live_run_hd_until(attotime limit) m_out_dmarq(ASSERT_LINE); } + // Repeat until we have collected 16 bits + if (m_live_state.bit_counter & 15) break; + slot = (m_live_state.bit_counter >> 4)-1; if (TRACE_LIVE) logerror("%s: [%s live] Found data value [%d/%d] = %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), slot, calc_sector_size(), m_live_state.data_reg, m_live_state.crc); @@ -3018,6 +3038,7 @@ void hdc9234_device::live_sync() m_live_state.time = attotime::never; } } + m_live_state.next_state = -1; checkpoint(); } @@ -3790,7 +3811,7 @@ void hdc9234_device::connect_hard_drive(mfm_harddisk_device* harddisk) { m_harddisk = harddisk; m_hd_encoding = m_harddisk->get_encoding(); - logerror("%s: HD encoding = %d\n", tag(), m_hd_encoding); + if (TRACE_DETAIL) logerror("%s: HD encoding = %d\n", tag(), m_hd_encoding); } /* diff --git a/src/emu/machine/ti99_hd.c b/src/emu/machine/ti99_hd.c index 5ad8fc1a535..49aeb5b69d1 100644 --- a/src/emu/machine/ti99_hd.c +++ b/src/emu/machine/ti99_hd.c @@ -14,22 +14,21 @@ **************************************************************************/ +// TODO: Format + #include "emu.h" #include "formats/imageutl.h" #include "harddisk.h" #include "ti99_hd.h" -#define TI99HD_BLOCKNOTFOUND -1 - -#define LOG logerror -#define VERBOSE 0 - -#define GAP1 16 -#define GAP2 8 -#define GAP3 15 -#define GAP4 340 -#define SYNC 13 +#define TRACE_STEPS 0 +#define TRACE_SIGNALS 0 +#define TRACE_READ 0 +#define TRACE_CACHE 0 +#define TRACE_RWTRACK 0 +#define TRACE_BITS 0 +#define TRACE_DETAIL 0 enum { @@ -48,10 +47,20 @@ enum #define TRACKSLOTS 5 #define TRACKIMAGE_SIZE 10416 // Provide the buffer for a complete track, including preambles and gaps +std::string mfm_harddisk_device::tts(const attotime &t) +{ + char buf[256]; + int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND; + sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000); + return buf; +} + mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source), device_slot_card_interface(mconfig, *this) { + m_spinupms = 10000; + m_cachelines = TRACKSLOTS; } mfm_harddisk_device::~mfm_harddisk_device() @@ -63,16 +72,13 @@ void mfm_harddisk_device::device_start() m_index_timer = timer_alloc(INDEX_TM); m_spinup_timer = timer_alloc(SPINUP_TM); m_seek_timer = timer_alloc(SEEK_TM); - m_spinup_time = attotime::from_msec(8000); m_rev_time = attotime::from_hz(60); // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec) m_index_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); - // Spinup may take up to 24 seconds - m_spinup_timer->adjust(m_spinup_time); - - m_current_cylinder = 10; // for test purpose + m_current_cylinder = 615; // Park position + m_spinup_timer->adjust(attotime::from_msec(m_spinupms)); m_cache = global_alloc(mfmhd_trackimage_cache); } @@ -85,6 +91,7 @@ void mfm_harddisk_device::device_reset() m_seek_inward = false; m_track_delta = 0; m_step_line = CLEAR_LINE; + m_recalibrated = false; } void mfm_harddisk_device::device_stop() @@ -94,15 +101,15 @@ void mfm_harddisk_device::device_stop() bool mfm_harddisk_device::call_load() { - logerror("call_load\n"); + setup_characteristics(); bool loaded = harddisk_image_device::call_load(); if (loaded==IMAGE_INIT_PASS) { - m_cache->init(get_chd_file(), tag(), TRACKSLOTS, m_encoding); + m_cache->init(get_chd_file(), tag(), m_max_cylinder, m_max_heads, m_cachelines, m_encoding); } else { - logerror("Could not load CHD\n"); + logerror("%s: Could not load CHD\n", tag()); } return loaded; } @@ -127,13 +134,21 @@ attotime mfm_harddisk_device::track_end_time() // We back up two microseconds before the track end to avoid the // index pulse to appear earlier (because of rounding effects) attotime nexttime = m_rev_time - attotime::from_nsec(2000); + attotime endtime = attotime::never; + if (!m_ready) { // estimate the next index time; during power-up we assume half the rotational speed // Should never be relevant, though, because READY is false. nexttime = nexttime * 2; } - return (m_revolution_start_time.is_never())? attotime::never : (m_revolution_start_time + nexttime); + + if (!m_revolution_start_time.is_never()) + { + endtime = m_revolution_start_time + nexttime; + if (TRACE_DETAIL) logerror("%s: Track start time = %s, end time = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(endtime).c_str()); + } + return endtime; } void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -142,18 +157,18 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int { case INDEX_TM: /* Simple index hole handling. We assume that there is only a short pulse. */ + m_revolution_start_time = machine().time(); if (!m_index_pulse_cb.isnull()) { - m_revolution_start_time = machine().time(); m_index_pulse_cb(this, ASSERT_LINE); m_index_pulse_cb(this, CLEAR_LINE); } break; + case SPINUP_TM: - m_ready = true; - logerror("%s: Spinup complete, drive is ready\n", tag()); - if (!m_ready_cb.isnull()) m_ready_cb(this, ASSERT_LINE); + recalibrate(); break; + case SEEK_TM: switch (m_step_phase) { @@ -169,7 +184,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int // Start the settle timer m_step_phase = STEP_SETTLE; m_seek_timer->adjust(attotime::from_usec(16800)); - logerror("%s: Arrived at target track %d, settling ...\n", tag(), m_current_cylinder); + if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Arrived at target cylinder %d, settling ...\n", tag(), m_current_cylinder); } break; case STEP_SETTLE: @@ -178,7 +193,17 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int else { // Seek completed - logerror("%s: Settling done at cylinder %d, seek complete\n", tag(), m_current_cylinder); + if (!m_recalibrated) + { + m_ready = true; + m_recalibrated = true; + if (TRACE_SIGNALS) logerror("%s: Spinup complete, drive recalibrated and positioned at cylinder %d; drive is READY\n", tag(), m_current_cylinder); + if (!m_ready_cb.isnull()) m_ready_cb(this, ASSERT_LINE); + } + else + { + if (TRACE_SIGNALS) logerror("%s: Settling done at cylinder %d, seek complete\n", tag(), m_current_cylinder); + } m_seek_complete = true; if (!m_seek_complete_cb.isnull()) m_seek_complete_cb(this, ASSERT_LINE); m_step_phase = STEP_COLLECT; @@ -188,11 +213,22 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int } } +void mfm_harddisk_device::recalibrate() +{ + if (TRACE_STEPS) logerror("%s: Recalibrate to track 0\n", tag()); + direction_in_w(CLEAR_LINE); + while (-m_track_delta < 620) + { + step_w(ASSERT_LINE); + step_w(CLEAR_LINE); + } +} + void mfm_harddisk_device::head_move() { int steps = m_track_delta; if (steps < 0) steps = -steps; - logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward"); + if (TRACE_STEPS) logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward"); int disttime = steps*200; m_step_phase = STEP_MOVING; @@ -208,7 +244,7 @@ void mfm_harddisk_device::head_move() void mfm_harddisk_device::direction_in_w(line_state line) { m_seek_inward = (line == ASSERT_LINE); - logerror("%s: Setting seek direction %s\n", tag(), m_seek_inward? "inward" : "outward"); + if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Setting seek direction %s\n", tag(), m_seek_inward? "inward" : "outward"); } /* @@ -267,10 +303,10 @@ void mfm_harddisk_device::step_w(line_state line) // Counter will be adjusted according to the direction (+-1) m_track_delta += (m_seek_inward)? +1 : -1; - logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta); + if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta); if (m_track_delta < -670 || m_track_delta > 670) { - logerror("%s: Excessive step pulses - doing auto-truncation\n", tag()); + if (TRACE_STEPS) logerror("%s: Excessive step pulses - doing auto-truncation\n", tag()); m_autotruncation = true; } m_seek_timer->adjust(attotime::from_usec(250)); @@ -296,39 +332,79 @@ bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT1 throw emu_fatalerror("Cannot read CHD image"); } + // We stop some few cells early each track, so lift the from_when time over + // the 2 microseconds. + if (from_when < m_revolution_start_time) from_when = m_revolution_start_time; + // Calculate the position in the track, given the from_when time and the revolution_start_time. // Each cell takes 100 ns (10 MHz) int cell = (from_when - m_revolution_start_time).as_ticks(10000000); - from_when += attotime::from_nsec(1600); + attotime fw = from_when; + + from_when += attotime::from_nsec((m_encoding==MFM_BITS)? 100 : 1600); if (from_when > limit) return true; - int position = cell / 16; + + int bytepos = cell / 16; // Reached the end - if (position >= 10416) + if (bytepos >= 10416) { + if (TRACE_DETAIL) logerror("%s: Reached end: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(fw).c_str()); m_revolution_start_time += m_rev_time; cell = (from_when - m_revolution_start_time).as_ticks(10000000); - position = cell / 16; + bytepos = cell / 16; } - // TODO: fix the actual issue - if (position < 0) position = 0; - - logerror("%s: Reading track %d head %d at position %d\n", tag(), m_current_cylinder, m_current_head, position); - cdata = track[position]; + if (bytepos < 0) + { + if (TRACE_DETAIL) logerror("%s: Negative cell number: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(fw).c_str()); + bytepos = 0; + } + if (m_encoding == MFM_BITS) + { + // We will deliver a single bit + int cellno = cell % 16; + cdata = ((track[bytepos] << cellno) & 0x8000) >> 15; + if (TRACE_BITS) logerror("%s: Reading (c=%d,h=%d,bit=%d) at cell %d [%s] = %d\n", tag(), m_current_cylinder, m_current_head, cellno, cell, tts(fw).c_str(), cdata); + } + else + { + // We will deliver a whole byte + if (TRACE_READ) logerror("%s: Reading (c=%d,h=%d) at position %d\n", tag(), m_current_cylinder, m_current_head, bytepos); + cdata = track[bytepos]; + } return false; } mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) -: mfm_harddisk_device(mconfig, MFM_HD_GENERIC, "Generic MFM hard disk (byte level)", tag, owner, clock, "mfm_harddisk", __FILE__) +: mfm_harddisk_device(mconfig, MFMHD_GENERIC, "Generic MFM hard disk", tag, owner, clock, "mfm_harddisk", __FILE__) { } -const device_type MFM_HD_GENERIC = &device_creator; +void mfm_hd_generic_device::setup_characteristics() +{ + m_max_cylinder = 0; + m_max_heads = 0; +} + +const device_type MFMHD_GENERIC = &device_creator; + +mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +: mfm_harddisk_device(mconfig, MFMHD_ST225, "Seagate ST-225 MFM hard disk", tag, owner, clock, "mfm_hd_st225", __FILE__) +{ +} + +void mfm_hd_st225_device::setup_characteristics() +{ + m_max_cylinder = 615; + m_max_heads = 4; +} + +const device_type MFMHD_ST225 = &device_creator; // =========================================================== // Track cache @@ -345,12 +421,12 @@ mfmhd_trackimage_cache::mfmhd_trackimage_cache(): mfmhd_trackimage_cache::~mfmhd_trackimage_cache() { mfmhd_trackimage* current = m_tracks; - logerror("%s: MFM HD cache destroy\n", tag()); + if (TRACE_CACHE) logerror("%s: MFM HD cache destroy\n", tag()); // Still dirty? while (current != NULL) { - logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); + if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); if (current->dirty) write_back(current); global_free_array(current->encdata); mfmhd_trackimage* currenttmp = current->next; @@ -362,12 +438,12 @@ mfmhd_trackimage_cache::~mfmhd_trackimage_cache() /* Initialize the cache by loading the first tracks. */ -void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int trackslots, mfmhd_enc_t encoding) +void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int maxcyl, int maxhead, int trackslots, mfmhd_enc_t encoding) { m_encoding = encoding; m_tagdev = dtag; - logerror("%s: MFM HD cache init; using encoding %d\n", m_tagdev, encoding); + if (TRACE_CACHE) logerror("%s: MFM HD cache init; using encoding %d\n", m_tagdev, encoding); chd_error state = CHDERR_NONE; mfmhd_trackimage* previous = NULL; mfmhd_trackimage* current = NULL; @@ -394,34 +470,43 @@ void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int track throw emu_fatalerror("Invalid metadata"); } - // Load some tracks into the cache - for (int i=0; i < trackslots; i++) + if (maxcyl != 0 && m_cylinders > maxcyl) { - logerror("%s: MFM HD allocate cache slot\n", tag()); + throw emu_fatalerror("Image geometry does not fit this kind of hard drive: drive=(%d,%d), image=(%d,%d)", maxcyl, maxhead, m_cylinders, m_heads); + } + + // Load some tracks into the cache + int track = 0; + int head = 0; + int cylinder = 0; + while (track < trackslots) + { + if (TRACE_CACHE && TRACE_DETAIL) logerror("%s: MFM HD allocate cache slot\n", tag()); previous = current; current = global_alloc(mfmhd_trackimage); current->encdata = global_alloc_array(UINT16, TRACKIMAGE_SIZE); // Load the first tracks into the slots - state = load_track(current, i, 0, 32, 256, 4); - current->next = NULL; + state = load_track(current, cylinder, head, 32, 256, 4); - if (state != CHDERR_NONE) throw emu_fatalerror("Cannot load cylinder %d head %d from hard disk", i, 0); + if (state != CHDERR_NONE) throw emu_fatalerror("Cannot load (c=%d,h=%d) from hard disk", cylinder, head); + + // We will read all heads per cylinder first, then go to the next cylinder. + if (++head >= m_heads) + { + head = 0; + cylinder++; + } + current->next = NULL; if (previous != NULL) previous->next = current; else // Head m_tracks = current; - } - current = m_tracks; - - while (current != NULL) - { - logerror("%s: MFM HD cache: containing line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); - mfmhd_trackimage* currenttmp = current->next; - current = currenttmp; + // Count the number of loaded tracks + track++; } } @@ -491,7 +576,7 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) // previous points to the second to last element current = previous->next; - logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); + if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line (c=%d,h=%d)\n", tag(), current->cylinder, current->head); if (current->dirty) write_back(current); state = load_track(current, cylinder, head, 32, 256, 4); @@ -588,7 +673,7 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde UINT8 sector_content[1024]; - logerror("%s: MFM HD cache: load cylinder=%d head=%d from CHD\n", tag(), cylinder, head); + if (TRACE_RWTRACK) logerror("%s: MFM HD cache: load (c=%d,h=%d) from CHD\n", tag(), cylinder, head); m_lastbit = false; int position = 0; // will be incremented by each encode call @@ -602,10 +687,10 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde // Round up int delta = (sectorcount + interleave-1) / interleave; - logerror("%02x %02x: ", cylinder&0xff, head&0xff); + if (TRACE_DETAIL) logerror("cyl=%02x head=%02x: sector sequence = ", cylinder&0xff, head&0xff); for (int sector = 0; sector < sectorcount; sector++) { - logerror("%02d ", sec_number); + if (TRACE_DETAIL) logerror("%02d ", sec_number); // Sync gap mfm_encode(slot, position, 0x00, 13); @@ -655,14 +740,17 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde sec_number += delta; if (sec_number >= sectorcount) sec_number = ++sec_il_start; } + if (TRACE_DETAIL) logerror("\n"); // Gap 4 if (state == CHDERR_NONE) { // Fill the rest with 0x4e mfm_encode(slot, position, 0x4e, TRACKIMAGE_SIZE-position); - logerror("\n"); - showtrack(slot->encdata, TRACKIMAGE_SIZE); + if (TRACE_DETAIL) + { + showtrack(slot->encdata, TRACKIMAGE_SIZE); + } } slot->dirty = false; @@ -677,7 +765,7 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde */ void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) { - logerror("%s: MFM HD cache: write back cylinder=%d head=%d to CHD\n", tag(), slot->cylinder, slot->head); + if (TRACE_RWTRACK) logerror("%s: MFM HD cache: write back (c=%d,h=%d) to CHD\n", tag(), slot->cylinder, slot->head); slot->dirty = false; } @@ -715,11 +803,22 @@ mfm_harddisk_device* mfm_harddisk_connector::get_device() return dynamic_cast(get_card_device()); } +void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int cache) +{ + m_encoding = encoding; + m_spinupms = spinupms; + m_cachesize = cache; +} + void mfm_harddisk_connector::device_config_complete() { mfm_harddisk_device *dev = get_device(); if (dev != NULL) + { dev->set_encoding(m_encoding); + dev->set_spinup_time(m_spinupms); + dev->set_cache_size(m_cachesize); + } } const device_type MFM_HD_CONNECTOR = &device_creator; @@ -732,6 +831,17 @@ const device_type MFM_HD_CONNECTOR = &device_creator; #include "smc92x4.h" +#define TI99HD_BLOCKNOTFOUND -1 + +#define LOG logerror +#define VERBOSE 0 + +#define GAP1 16 +#define GAP2 8 +#define GAP3 15 +#define GAP4 340 +#define SYNC 13 + mfm_harddisk_legacy_device::mfm_harddisk_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, TI99_MFMHD_LEG, "MFM Harddisk LEGACY", tag, owner, clock, "mfm_harddisk_leg", __FILE__) { diff --git a/src/emu/machine/ti99_hd.h b/src/emu/machine/ti99_hd.h index 87de506398f..02f5d4fb4e5 100644 --- a/src/emu/machine/ti99_hd.h +++ b/src/emu/machine/ti99_hd.h @@ -44,7 +44,7 @@ class mfmhd_trackimage_cache public: mfmhd_trackimage_cache(); ~mfmhd_trackimage_cache(); - void init(chd_file* chdfile, const char* tag, int trackslots, mfmhd_enc_t encoding); + void init(chd_file* chdfile, const char* tag, int maxcyl, int maxhead, int trackslots, mfmhd_enc_t encoding); UINT16* get_trackimage(int cylinder, int head); private: @@ -84,7 +84,11 @@ public: void setup_ready_cb(ready_cb cb); void setup_seek_complete_cb(seek_complete_cb cb); + // Configuration void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; } + void set_spinup_time(int spinupms) { m_spinupms = spinupms; } + void set_cache_size(int tracks) { m_cachelines = tracks; } + mfmhd_enc_t get_encoding() { return m_encoding; } // Active low lines. We're using ASSERT=0 / CLEAR=1 @@ -113,13 +117,21 @@ protected: void device_reset(); void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + virtual void setup_characteristics() = 0; + std::string tts(const attotime &t); + emu_timer *m_index_timer, *m_spinup_timer, *m_seek_timer; index_pulse_cb m_index_pulse_cb; ready_cb m_ready_cb; seek_complete_cb m_seek_complete_cb; + int m_max_cylinder; + int m_max_heads; + private: mfmhd_enc_t m_encoding; + int m_spinupms; + int m_cachelines; bool m_ready; int m_current_cylinder; int m_current_head; @@ -129,6 +141,7 @@ private: bool m_seek_inward; //bool m_seeking; bool m_autotruncation; + bool m_recalibrated; line_state m_step_line; // keep the last state attotime m_spinup_time; @@ -139,15 +152,30 @@ private: void prepare_track(int cylinder, int head); void head_move(); + void recalibrate(); }; class mfm_hd_generic_device : public mfm_harddisk_device { public: mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + void setup_characteristics(); }; -extern const device_type MFM_HD_GENERIC; +extern const device_type MFMHD_GENERIC; + +class mfm_hd_st225_device : public mfm_harddisk_device +{ +public: + mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + void setup_characteristics(); +}; + +extern const device_type MFMHD_ST225; /* Connector for a MFM hard disk. See also floppy.c */ class mfm_harddisk_connector : public device_t, @@ -159,7 +187,7 @@ public: mfm_harddisk_device *get_device(); - void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; } + void configure(mfmhd_enc_t encoding, int spinupms, int cache); protected: void device_start() { }; @@ -167,14 +195,28 @@ protected: private: mfmhd_enc_t m_encoding; + int m_spinupms; + int m_cachesize; }; extern const device_type MFM_HD_CONNECTOR; -#define MCFG_MFM_HARDDISK_ADD(_tag, _slot_intf, _def_slot, _enc) \ +/* + Add a harddisk connector. + Parameters: + _tag = Tag of the connector + _slot_intf = Selection of hard drives + _def_slot = Default hard drive + _enc = Encoding (see comments in ti99_hd.c) + _spinupms = Spinup time in milliseconds (some configurations assume that the + user has turned on the hard disk before turning on the system. We cannot + emulate this, so we allow for shorter times) + _cache = number of cached MFM tracks +*/ +#define MCFG_MFM_HARDDISK_CONN_ADD(_tag, _slot_intf, _def_slot, _enc, _spinupms, _cache) \ MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ - static_cast(device)->set_encoding(_enc); + static_cast(device)->configure(_enc, _spinupms, _cache); // =========================================================================== // Legacy implementation From 72794f8ff1c1e79bd0350bb52fb3757bdf04d004 Mon Sep 17 00:00:00 2001 From: balr0g Date: Sun, 7 Jun 2015 10:20:43 -0400 Subject: [PATCH 208/284] Use attribute unused for inlined new/delete. (nw) This is still not compliant code, and will probably break with LTO, but is a cleaner fix for the warning. Using this attribute also ensures that the linker doesn't remove the code. --- scripts/genie.lua | 1 - src/lib/util/corealloc.h | 8 ++++---- src/osd/osdcomm.h | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index bdd97f427c5..7a591db050b 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -923,7 +923,6 @@ end end if (version >= 30400) then buildoptions { - "-Wno-inline-new-delete", "-Wno-constant-logical-operand", } end diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index 5b002557769..a3f05ddd270 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -60,10 +60,10 @@ class zeromem_t { }; #ifndef NO_MEM_TRACKING // standard new/delete operators (try to avoid using) -ATTR_FORCE_INLINE inline void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } -ATTR_FORCE_INLINE inline void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } -ATTR_FORCE_INLINE inline void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } -ATTR_FORCE_INLINE inline void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } +ATTR_FORCE_INLINE ATTR_USED inline void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } +ATTR_FORCE_INLINE ATTR_USED inline void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } +ATTR_FORCE_INLINE ATTR_USED inline void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } +ATTR_FORCE_INLINE ATTR_USED inline void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } #endif diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index 2df16b8db02..e41d9663615 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -31,6 +31,7 @@ /* Some optimizations/warnings cleanups for GCC */ #if defined(__GNUC__) && (__GNUC__ >= 3) #define ATTR_UNUSED __attribute__((__unused__)) +#define ATTR_USED __attribute__((__used__)) #define ATTR_NORETURN __attribute__((noreturn)) #define ATTR_PRINTF(x,y) __attribute__((format(printf, x, y))) #define ATTR_MALLOC __attribute__((malloc)) From 021aa9eb6cf57bedcc99e28c505bc8470877607b Mon Sep 17 00:00:00 2001 From: balr0g Date: Sun, 7 Jun 2015 12:25:38 -0400 Subject: [PATCH 209/284] Nope. (nw) This reverts commit 72794f8ff1c1e79bd0350bb52fb3757bdf04d004. At least this provides a more useful stacktrace, if anyone wants to debug. --- scripts/genie.lua | 1 + src/lib/util/corealloc.h | 8 ++++---- src/osd/osdcomm.h | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 7a591db050b..bdd97f427c5 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -923,6 +923,7 @@ end end if (version >= 30400) then buildoptions { + "-Wno-inline-new-delete", "-Wno-constant-logical-operand", } end diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index a3f05ddd270..5b002557769 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -60,10 +60,10 @@ class zeromem_t { }; #ifndef NO_MEM_TRACKING // standard new/delete operators (try to avoid using) -ATTR_FORCE_INLINE ATTR_USED inline void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } -ATTR_FORCE_INLINE ATTR_USED inline void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } -ATTR_FORCE_INLINE ATTR_USED inline void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } -ATTR_FORCE_INLINE ATTR_USED inline void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } +ATTR_FORCE_INLINE inline void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } +ATTR_FORCE_INLINE inline void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } +ATTR_FORCE_INLINE inline void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } +ATTR_FORCE_INLINE inline void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } #endif diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index e41d9663615..2df16b8db02 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -31,7 +31,6 @@ /* Some optimizations/warnings cleanups for GCC */ #if defined(__GNUC__) && (__GNUC__ >= 3) #define ATTR_UNUSED __attribute__((__unused__)) -#define ATTR_USED __attribute__((__used__)) #define ATTR_NORETURN __attribute__((noreturn)) #define ATTR_PRINTF(x,y) __attribute__((format(printf, x, y))) #define ATTR_MALLOC __attribute__((malloc)) From 86d6b880388d1aba250e1e46b87c9799601ee322 Mon Sep 17 00:00:00 2001 From: ted green Date: Sun, 7 Jun 2015 12:23:22 -0600 Subject: [PATCH 210/284] voodoodefs.h -- Re-organized macros into function calls to help in optimization identification. The old macros can still used by setting USE_OLD_RASTER to 1. -- Made new functions use SSE2 implementation. rgbgen.h -- Added immediate add and mult add functions. rgbsse.h -- Added SSE2 implementation of immediate add and mult functions. voodoo.c -- Added comments for rasters. --- src/emu/video/rgbgen.h | 57 +- src/emu/video/rgbsse.h | 41 ++ src/emu/video/vooddefs.h | 1371 ++++++++++++++++++++++++++++++++++++-- src/emu/video/voodoo.c | 62 +- 4 files changed, 1466 insertions(+), 65 deletions(-) diff --git a/src/emu/video/rgbgen.h b/src/emu/video/rgbgen.h index 9eda032f361..db88f65b4a0 100644 --- a/src/emu/video/rgbgen.h +++ b/src/emu/video/rgbgen.h @@ -164,6 +164,18 @@ INLINE void rgbaint_add(rgbaint *color1, const rgbaint *color2) color1->b += color2->b; } +/*------------------------------------------------- + rgbaint_add_imm - add immediate INT16 to rgbaint value +-------------------------------------------------*/ + +INLINE void rgbaint_add_imm(rgbaint *color1, const INT16 imm) +{ + color1->a += imm; + color1->r += imm; + color1->g += imm; + color1->b += imm; +} + /*------------------------------------------------- rgbint_sub - subtract two rgbint values @@ -308,7 +320,6 @@ INLINE void rgbaint_blend(rgbaint *color1, const rgbaint *color2, UINT8 color1sc color1->b = (color1->b * scale1 + color2->b * scale2) >> 8; } - /*------------------------------------------------- rgbint_scale_and_clamp - scale the given color by an 8.8 scale factor, immediate or @@ -366,6 +377,50 @@ INLINE void rgbaint_scale_channel_and_clamp(rgbaint *color, const rgbaint *color if ((UINT16)color->b > 255) { color->b = (color->b < 0) ? 0 : 255; } } +INLINE void rgbaint_scale_immediate_add_and_clamp(rgbaint *color1, INT16 colorscale, const rgbaint *color2) +{ + color1->a = (color1->a * colorscale) >> 8; + color1->a += color2->a; + if ((UINT16)color1->a > 255) { color1->a = (color1->a < 0) ? 0 : 255; } + color1->r = (color1->r * colorscale) >> 8; + color1->r += color2->r; + if ((UINT16)color1->r > 255) { color1->r = (color1->r < 0) ? 0 : 255; } + color1->g = (color1->g * colorscale) >> 8; + color1->g += color2->g; + if ((UINT16)color1->g > 255) { color1->g = (color1->g < 0) ? 0 : 255; } + color1->b = (color1->b * colorscale) >> 8; + color1->b += color2->b; + if ((UINT16)color1->b > 255) { color1->b = (color1->b < 0) ? 0 : 255; } +} + +INLINE void rgbaint_scale_channel_add_and_clamp(rgbaint *color1, const rgbaint *colorscale, const rgbaint *color2) +{ + color1->a = (color1->a * colorscale->a) >> 8; + color1->a += color2->a; + if ((UINT16)color1->a > 255) { color1->a = (color1->a < 0) ? 0 : 255; } + color1->r = (color1->r * colorscale->r) >> 8; + color1->r += color2->r; + if ((UINT16)color1->r > 255) { color1->r = (color1->r < 0) ? 0 : 255; } + color1->g = (color1->g * colorscale->g) >> 8; + color1->g += color2->g; + if ((UINT16)color1->g > 255) { color1->g = (color1->g < 0) ? 0 : 255; } + color1->b = (color1->b * colorscale->b) >> 8; + color1->b += color2->b; + if ((UINT16)color1->b > 255) { color1->b = (color1->b < 0) ? 0 : 255; } +} + +INLINE void rgbaint_scale_channel_add_and_clamp(rgbaint *color1, const rgbaint *colorscale1, const rgbaint *color2, const rgbaint *colorscale2) +{ + color1->a = (color1->a * colorscale1->a + color2->a * colorscale2->a) >> 8; + if ((UINT16)color1->a > 255) { color1->a = (color1->a < 0) ? 0 : 255; } + color1->r = (color1->r * colorscale1->r + color2->r * colorscale2->r) >> 8; + if ((UINT16)color1->r > 255) { color1->r = (color1->r < 0) ? 0 : 255; } + color1->g = (color1->g * colorscale1->g + color2->g * colorscale2->g) >> 8; + if ((UINT16)color1->g > 255) { color1->g = (color1->g < 0) ? 0 : 255; } + color1->b = (color1->b * colorscale1->b + color2->b * colorscale2->b) >> 8; + if ((UINT16)color1->b > 255) { color1->b = (color1->b < 0) ? 0 : 255; } +} + /*------------------------------------------------- rgb_bilinear_filter - bilinear filter between diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h index 4822d5519f0..b2b677a7eba 100644 --- a/src/emu/video/rgbsse.h +++ b/src/emu/video/rgbsse.h @@ -146,6 +146,15 @@ INLINE void rgbaint_add(rgbaint *color1, const rgbaint *color2) *color1 = _mm_add_epi16(*color1, *color2); } +/*------------------------------------------------- + rgbaint_add_imm - add immediate INT16 to rgbaint value +-------------------------------------------------*/ +INLINE void rgbaint_add_imm(rgbaint *color1, const INT16 imm) +{ + __m128i temp = _mm_set_epi16(0, 0, 0, 0, imm, imm, imm, imm); + *color1 = _mm_add_epi16(*color1, temp); +} + /*------------------------------------------------- rgbint_sub - subtract two rgbint values @@ -306,6 +315,38 @@ INLINE void rgbint_scale_channel_and_clamp(rgbint *color, const rgbint *colorsca *color = _mm_min_epi16(*color, *(__m128i *)&rgbsse_statics.maxbyte); } +INLINE void rgbint_scale_immediate_add_and_clamp(rgbint *color1, INT16 colorscale, const rgbaint *color2) +{ + // color2 will get mutiplied by 2^8 (256) and then divided by 2^8 by the shift by 8 + __m128i mscale = _mm_unpacklo_epi16(_mm_set1_epi16(colorscale), _mm_set_epi16(0, 0, 0, 0, 256, 256, 256, 256)); + *color1 = _mm_unpacklo_epi16(*color1, *color2); + *color1 = _mm_madd_epi16(*color1, mscale); + *color1 = _mm_srli_epi32(*color1, 8); + *color1 = _mm_packs_epi32(*color1, *color1); + *color1 = _mm_min_epi16(*color1, *(__m128i *)&rgbsse_statics.maxbyte); +} + +INLINE void rgbaint_scale_channel_add_and_clamp(rgbaint *color1, const rgbaint *colorscale, const rgbaint *color2) +{ + // color2 will get mutiplied by 2^8 (256) and then divided by 2^8 by the shift by 8 + __m128i mscale = _mm_unpacklo_epi16(*colorscale, _mm_set_epi16(0, 0, 0, 0, 256, 256, 256, 256)); + *color1 = _mm_unpacklo_epi16(*color1, *color2); + *color1 = _mm_madd_epi16(*color1, mscale); + *color1 = _mm_srli_epi32(*color1, 8); + *color1 = _mm_packs_epi32(*color1, *color1); + *color1 = _mm_min_epi16(*color1, *(__m128i *)&rgbsse_statics.maxbyte); +} + +INLINE void rgbaint_scale_channel_add_and_clamp(rgbaint *color1, const rgbaint *colorscale1, const rgbaint *color2, const rgbaint *colorscale2) + +{ + __m128i mscale = _mm_unpacklo_epi16(*colorscale1, *colorscale2); + *color1 = _mm_unpacklo_epi16(*color1, *color2); + *color1 = _mm_madd_epi16(*color1, mscale); + *color1 = _mm_srli_epi32(*color1, 8); + *color1 = _mm_packs_epi32(*color1, *color1); + *color1 = _mm_min_epi16(*color1, *(__m128i *)&rgbsse_statics.maxbyte); +} /*------------------------------------------------- rgbaint_scale_and_clamp - scale the given diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index a64b0c22f66..24955024ef3 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -23,6 +23,9 @@ enum STALLED_UNTIL_FIFO_EMPTY }; +// Use old macro style or newer SSE2 optimized functions +#define USE_OLD_RASTER 0 + /* maximum number of TMUs */ #define MAX_TMU 2 @@ -2148,10 +2151,10 @@ while (0) #define CLAMPED_ARGB(ITERR, ITERG, ITERB, ITERA, FBZCP, RESULT) \ do \ { \ - INT32 r = (INT32)(ITERR) >> 12; \ - INT32 g = (INT32)(ITERG) >> 12; \ - INT32 b = (INT32)(ITERB) >> 12; \ - INT32 a = (INT32)(ITERA) >> 12; \ + r = (INT32)(ITERR) >> 12; \ + g = (INT32)(ITERG) >> 12; \ + b = (INT32)(ITERB) >> 12; \ + a = (INT32)(ITERA) >> 12; \ \ if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) \ { \ @@ -2193,6 +2196,93 @@ do } \ while (0) +/* use SSE on 64-bit implementations, where it can be assumed */ +#if (!defined(MAME_DEBUG) || defined(__OPTIMIZE__)) && (defined(__SSE2__) || defined(_MSC_VER)) && defined(PTR64) + +ATTR_FORCE_INLINE UINT32 clampARGB(INT32 iterr, INT32 iterg, INT32 iterb, INT32 itera, UINT32 FBZCP) +{ + rgb_t result; + rgbaint colorint; + rgba_comp_to_rgbaint(&colorint, (INT16) (itera>>12), (INT16) (iterr>>12), (INT16) (iterg>>12), (INT16) (iterb>>12)); + + if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) + { + //r &= 0xfff; + __m128i temp = _mm_set1_epi16(0xfff); + colorint = _mm_and_si128(*(__m128i *)&colorint, *(__m128i *)&temp); + //if (r == 0xfff) + temp = _mm_cmpeq_epi16(*(__m128i *)&colorint, *(__m128i *)&temp); + // result.rgb.r = 0; + colorint = _mm_andnot_si128(*(__m128i *)&temp, *(__m128i *)&colorint); + //else if (r == 0x100) + temp = _mm_set1_epi16(0x100); + temp = _mm_cmpeq_epi16(*(__m128i *)&colorint, *(__m128i *)&temp); + // result.rgb.r = 0xff; + colorint = _mm_or_si128(*(__m128i *)&colorint, *(__m128i *)&temp); + + result = rgbaint_to_rgba(&colorint); + } + else + { + result = rgbaint_to_rgba_clamp(&colorint); + } + return result; +} + +#else + +ATTR_FORCE_INLINE rgb_union clampARGB(INT32 iterr, INT32 iterg, INT32 iterb, INT32 itera, UINT32 FBZCP) +{ + rgb_union result; + INT16 r, g, b, a; + r = (INT16)(iterr >> 12); \ + g = (INT16)(iterg >> 12); \ + b = (INT16)(iterb >> 12); \ + a = (INT16)(itera >> 12); \ + + if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) + { + r &= 0xfff; + result.rgb.r = r; + if (r == 0xfff) + result.rgb.r = 0; + else if (r == 0x100) + result.rgb.r = 0xff; + + g &= 0xfff; + result.rgb.g = g; + if (g == 0xfff) + result.rgb.g = 0; + else if (g == 0x100) + result.rgb.g = 0xff; + + b &= 0xfff; + result.rgb.b = b; + if (b == 0xfff) + result.rgb.b = 0; + else if (b == 0x100) + result.rgb.b = 0xff; + + a &= 0xfff; + result.rgb.a = a; + if (a == 0xfff) + result.rgb.a = 0; + else if (a == 0x100) + result.rgb.a = 0xff; + } + else + { + result.rgb.r = (r < 0) ? 0 : (r > 0xff) ? 0xff : r; + result.rgb.g = (g < 0) ? 0 : (g > 0xff) ? 0xff : g; + result.rgb.b = (b < 0) ? 0 : (b > 0xff) ? 0xff : b; + result.rgb.a = (a < 0) ? 0 : (a > 0xff) ? 0xff : a; + } + return result; +} + +#endif + + #define CLAMPED_Z(ITERZ, FBZCP, RESULT) \ do \ @@ -2310,6 +2400,71 @@ do } \ while (0) +ATTR_FORCE_INLINE bool chromaKeyTest(voodoo_state *v, stats_block *stats, UINT32 fbzModeReg, rgb_union color) +{ + if (FBZMODE_ENABLE_CHROMAKEY(fbzModeReg)) + { + /* non-range version */ + if (!CHROMARANGE_ENABLE(v->reg[chromaRange].u)) + { + if (((color.u ^ v->reg[chromaKey].u) & 0xffffff) == 0) + { + stats->chroma_fail++; + return false; + } + } + + /* tricky range version */ + else + { + INT32 low, high, test; + int results = 0; + + /* check blue */ + low = v->reg[chromaKey].rgb.b; + high = v->reg[chromaRange].rgb.b; + test = color.rgb.b; + results = (test >= low && test <= high); + results ^= CHROMARANGE_BLUE_EXCLUSIVE(v->reg[chromaRange].u); + results <<= 1; + + /* check green */ + low = v->reg[chromaKey].rgb.g; + high = v->reg[chromaRange].rgb.g; + test = color.rgb.g; + results |= (test >= low && test <= high); + results ^= CHROMARANGE_GREEN_EXCLUSIVE(v->reg[chromaRange].u); + results <<= 1; + + /* check red */ + low = v->reg[chromaKey].rgb.r; + high = v->reg[chromaRange].rgb.r; + test = color.rgb.r; + results |= (test >= low && test <= high); + results ^= CHROMARANGE_RED_EXCLUSIVE(v->reg[chromaRange].u); + + /* final result */ + if (CHROMARANGE_UNION_MODE(v->reg[chromaRange].u)) + { + if (results != 0) + { + stats->chroma_fail++; + return false; + } + } + else + { + if (results == 7) + { + stats->chroma_fail++; + return false; + } + } + } + } + return true; +} + /************************************* @@ -2332,7 +2487,18 @@ do } \ while (0) - +ATTR_FORCE_INLINE bool alphaMaskTest(stats_block *stats, UINT32 fbzModeReg, UINT8 alpha) +{ + if (FBZMODE_ENABLE_ALPHA_MASK(fbzModeReg)) + { + if ((alpha & 1) == 0) + { + stats->afunc_fail++; + return false; + } + } + return true; +} /************************************* * @@ -2407,6 +2573,71 @@ do } \ while (0) +ATTR_FORCE_INLINE bool alphaTest(voodoo_state *v, stats_block *stats, UINT32 alphaModeReg, UINT8 alpha) +{ + if (ALPHAMODE_ALPHATEST(alphaModeReg)) + { + UINT8 alpharef = v->reg[alphaMode].rgb.a; + switch (ALPHAMODE_ALPHAFUNCTION(alphaModeReg)) + { + case 0: /* alphaOP = never */ + stats->afunc_fail++; + return false; + + case 1: /* alphaOP = less than */ + if (alpha >= alpharef) + { + stats->afunc_fail++; + return false; + } + break; + + case 2: /* alphaOP = equal */ + if (alpha != alpharef) + { + stats->afunc_fail++; + return false; + } + break; + + case 3: /* alphaOP = less than or equal */ + if (alpha > alpharef) + { + stats->afunc_fail++; + return false; + } + break; + + case 4: /* alphaOP = greater than */ + if (alpha <= alpharef) + { + stats->afunc_fail++; + return false; + } + break; + + case 5: /* alphaOP = not equal */ + if (alpha == alpharef) + { + stats->afunc_fail++; + return false; + } + break; + + case 6: /* alphaOP = greater than or equal */ + if (alpha < alpharef) + { + stats->afunc_fail++; + return false; + } + break; + + case 7: /* alphaOP = always */ + break; + } + } + return true; +} /************************************* @@ -2571,6 +2802,200 @@ do } \ while (0) +ATTR_FORCE_INLINE void alphaBlend(UINT32 FBZMODE, UINT32 ALPHAMODE, int ditherX, int dpix, int depthX, rgb_union preFog, rgb_union &color) +{ + if (ALPHAMODE_ALPHABLEND(ALPHAMODE)) + { + //int dpix = dest[XX]; + int dr, dg, db; + EXTRACT_565_TO_888(dpix, dr, dg, db); + int da = FBZMODE_ENABLE_ALPHA_PLANES(FBZMODE) ? depthX : 0xff; + //int sr = (RR); + //int sg = (GG); + //int sb = (BB); + //int sa = (AA); + int sa = color.rgb.a; + int ta; + int srcAlphaScale, destAlphaScale; + rgbaint srcScale, destScale; + + /* apply dither subtraction */ + if (FBZMODE_ALPHA_DITHER_SUBTRACT(FBZMODE)) + { + /* look up the dither value from the appropriate matrix */ + //int dith = DITHER[(XX) & 3]; + + /* subtract the dither value */ + dr += (15 - ditherX) >> 1; + dg += (15 - ditherX) >> 2; + db += (15 - ditherX) >> 1; + } + + /* blend the source alpha */ + srcAlphaScale = 0; + if (ALPHAMODE_SRCALPHABLEND(ALPHAMODE) == 4) + srcAlphaScale = 256; + //(AA) = sa; + + /* compute source portion */ + switch (ALPHAMODE_SRCRGBBLEND(ALPHAMODE)) + { + default: /* reserved */ + case 0: /* AZERO */ + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, 0, 0, 0); + //(RR) = (GG) = (BB) = 0; + break; + + case 1: /* ASRC_ALPHA */ + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, sa, sa, sa); + //(RR) = (sr * (sa + 1)) >> 8; + //(GG) = (sg * (sa + 1)) >> 8; + //(BB) = (sb * (sa + 1)) >> 8; + break; + + case 2: /* A_COLOR */ + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale-1, dr, dg, db); + rgbaint_add_imm(&srcScale, 1); + //(RR) = (sr * (dr + 1)) >> 8; + //(GG) = (sg * (dg + 1)) >> 8; + //(BB) = (sb * (db + 1)) >> 8; + break; + + case 3: /* ADST_ALPHA */ + ta = da + 1; + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, ta, ta, ta); + //(RR) = (sr * (da + 1)) >> 8; + //(GG) = (sg * (da + 1)) >> 8; + //(BB) = (sb * (da + 1)) >> 8; + break; + + case 4: /* AONE */ + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, 256, 256, 256); + break; + + case 5: /* AOMSRC_ALPHA */ + ta = (0x100 - sa); + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, ta, ta, ta); + //(RR) = (sr * (0x100 - sa)) >> 8; + //(GG) = (sg * (0x100 - sa)) >> 8; + //(BB) = (sb * (0x100 - sa)) >> 8; + break; + + case 6: /* AOM_COLOR */ + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, (0x100 - dr), (0x100 - dg), (0x100 - db)); + //(RR) = (sr * (0x100 - dr)) >> 8; + //(GG) = (sg * (0x100 - dg)) >> 8; + //(BB) = (sb * (0x100 - db)) >> 8; + break; + + case 7: /* AOMDST_ALPHA */ + ta = (0x100 - da); + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, ta, ta, ta); + //(RR) = (sr * (0x100 - da)) >> 8; + //(GG) = (sg * (0x100 - da)) >> 8; + //(BB) = (sb * (0x100 - da)) >> 8; + break; + + case 15: /* ASATURATE */ + ta = (sa < (0x100 - da)) ? sa : (0x100 - da); + rgba_comp_to_rgbaint(&srcScale, srcAlphaScale, ta, ta, ta); + //(RR) = (sr * (ta + 1)) >> 8; + //(GG) = (sg * (ta + 1)) >> 8; + //(BB) = (sb * (ta + 1)) >> 8; + break; + } + + /* blend the dest alpha */ + destAlphaScale = 0; + if (ALPHAMODE_DSTALPHABLEND(ALPHAMODE) == 4) + destAlphaScale = 256; + //(AA) += da; + + /* add in dest portion */ + switch (ALPHAMODE_DSTRGBBLEND(ALPHAMODE)) + { + default: /* reserved */ + case 0: /* AZERO */ + rgba_comp_to_rgbaint(&destScale, destAlphaScale, 0, 0, 0); + break; + + case 1: /* ASRC_ALPHA */ + rgba_comp_to_rgbaint(&destScale, destAlphaScale, sa, sa, sa); + rgbaint_add_imm(&destScale, 1); + //(RR) += (dr * (sa + 1)) >> 8; + //(GG) += (dg * (sa + 1)) >> 8; + //(BB) += (db * (sa + 1)) >> 8; + break; + + case 2: /* A_COLOR */ + rgba_to_rgbaint(&destScale, (rgb_t) (((destAlphaScale-1)<<24) | (color.u & 0x00ffffff))); + rgbaint_add_imm(&destScale, 1); + //(RR) += (dr * (sr + 1)) >> 8; + //(GG) += (dg * (sg + 1)) >> 8; + //(BB) += (db * (sb + 1)) >> 8; + break; + + case 3: /* ADST_ALPHA */ + ta = da + 1; + rgba_comp_to_rgbaint(&destScale, destAlphaScale, ta, ta, ta); + //(RR) += (dr * (da + 1)) >> 8; + //(GG) += (dg * (da + 1)) >> 8; + //(BB) += (db * (da + 1)) >> 8; + break; + + case 4: /* AONE */ + rgba_comp_to_rgbaint(&destScale, destAlphaScale, 256, 256, 256); + //(RR) += dr; + //(GG) += dg; + //(BB) += db; + break; + + case 5: /* AOMSRC_ALPHA */ + ta = (0x100 - sa); + rgba_comp_to_rgbaint(&destScale, destAlphaScale, ta, ta, ta); + //(RR) += (dr * (0x100 - sa)) >> 8; + //(GG) += (dg * (0x100 - sa)) >> 8; + //(BB) += (db * (0x100 - sa)) >> 8; + break; + + case 6: /* AOM_COLOR */ + rgba_comp_to_rgbaint(&destScale, destAlphaScale, (0x100 - color.rgb.r), (0x100 - color.rgb.g), (0x100 - color.rgb.b)); + //(RR) += (dr * (0x100 - sr)) >> 8; + //(GG) += (dg * (0x100 - sg)) >> 8; + //(BB) += (db * (0x100 - sb)) >> 8; + break; + + case 7: /* AOMDST_ALPHA */ + ta = (0x100 - da); + rgba_comp_to_rgbaint(&destScale, destAlphaScale, ta, ta, ta); + //(RR) += (dr * (0x100 - da)) >> 8; + //(GG) += (dg * (0x100 - da)) >> 8; + //(BB) += (db * (0x100 - da)) >> 8; + break; + + case 15: /* A_COLORBEFOREFOG */ + rgba_to_rgbaint(&destScale, (rgb_t) (((destAlphaScale-1)<<24) | (preFog.u & 0x00ffffff))); + rgbaint_add_imm(&destScale, 1); + //(RR) += (dr * (prefogr + 1)) >> 8; + //(GG) += (dg * (prefogg + 1)) >> 8; + //(BB) += (db * (prefogb + 1)) >> 8; + break; + } + // Main blend + rgbaint srcColor; + rgbaint destColor; + + rgba_to_rgbaint(&srcColor, (rgb_t) color.u); + rgba_comp_to_rgbaint(&destColor, da, dr, dg, db); + rgbaint_scale_channel_add_and_clamp(&srcColor, &srcScale, &destColor, &destScale); + color.u = rgbaint_to_rgba(&srcColor); + /* clamp */ + //CLAMP((RR), 0x00, 0xff); + //CLAMP((GG), 0x00, 0xff); + //CLAMP((BB), 0x00, 0xff); + //CLAMP((AA), 0x00, 0xff); + } +} /************************************* @@ -2690,6 +3115,134 @@ do } \ while (0) +ATTR_FORCE_INLINE void applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 fbzCpReg, const UINT8 ditherX, INT32 fogDepth, rgb_union &color, INT32 iterz, INT64 iterw, rgb_union iterargb) +{ + if (FOGMODE_ENABLE_FOG(fogModeReg)) + { + UINT32 color_alpha = color.u & 0xff000000; + rgbaint tmpA, tmpB; + + //INT32 fr, fg, fb; + + /* constant fog bypasses everything else */ + rgb_union fogColorLocal = v->reg[fogColor]; + rgba_to_rgbaint(&tmpB, (rgb_t) color.u); + if (FOGMODE_FOG_CONSTANT(fogModeReg)) + { + rgba_to_rgbaint(&tmpA, (rgb_t) fogColorLocal.u); + /* if fog_mult is 0, we add this to the original color */ + if (FOGMODE_FOG_MULT(fogModeReg) == 0) + { + rgbaint_add(&tmpA, &tmpB); + //color += fog; + } + + /* otherwise this just becomes the new color */ + //else + //{ + //color = fog; + //} + color.u = rgbaint_to_rgba_clamp(&tmpA); + } + /* non-constant fog comes from several sources */ + else + { + INT16 fogblend = 0; + + /* if fog_add is zero, we start with the fog color */ + if (FOGMODE_FOG_ADD(fogModeReg)) + fogColorLocal.u = 0; + //fr = fg = fb = 0; + + rgba_to_rgbaint(&tmpA, (rgb_t) fogColorLocal.u); + + /* if fog_mult is zero, we subtract the incoming color */ + if (!FOGMODE_FOG_MULT(fogModeReg)) + { + rgbint_sub(&tmpA, &tmpB); + //fog.rgb -= color.rgb; + //fr -= (RR); + //fg -= (GG); + //fb -= (BB); + } + + /* fog blending mode */ + switch (FOGMODE_FOG_ZALPHA(fogModeReg)) + { + case 0: /* fog table */ + { + INT32 delta = v->fbi.fogdelta[fogDepth >> 10]; + INT32 deltaval; + + /* perform the multiply against lower 8 bits of wfloat */ + deltaval = (delta & v->fbi.fogdelta_mask) * + ((fogDepth >> 2) & 0xff); + + /* fog zones allow for negating this value */ + if (FOGMODE_FOG_ZONES(fogModeReg) && (delta & 2)) + deltaval = -deltaval; + deltaval >>= 6; + + /* apply dither */ + if (FOGMODE_FOG_DITHER(fogModeReg)) + deltaval += ditherX; + deltaval >>= 4; + + /* add to the blending factor */ + fogblend = v->fbi.fogblend[fogDepth >> 10] + deltaval; + break; + } + + case 1: /* iterated A */ + fogblend = iterargb.rgb.a; + break; + + case 2: /* iterated Z */ + CLAMPED_Z(iterz, fbzCpReg, fogblend); + fogblend >>= 8; + break; + + case 3: /* iterated W - Voodoo 2 only */ + CLAMPED_W(iterw, fbzCpReg, fogblend); + break; + } + + /* perform the blend */ + fogblend++; + + //fr = (fr * fogblend) >> 8; + //fg = (fg * fogblend) >> 8; + //fb = (fb * fogblend) >> 8; + /* if fog_mult is 0, we add this to the original color */ + if (FOGMODE_FOG_MULT(fogModeReg) == 0) + { + rgbint_scale_immediate_add_and_clamp(&tmpA, fogblend, &tmpB); + //color += fog; + //(RR) += fr; + //(GG) += fg; + //(BB) += fb; + } + + /* otherwise this just becomes the new color */ + else + { + rgbaint_scale_immediate_and_clamp(&tmpA, fogblend); + //color = fog; + //(RR) = fr; + //(GG) = fg; + //(BB) = fb; + } + color.u = rgbaint_to_rgba(&tmpA); + } + + + /* clamp */ + //CLAMP((RR), 0x00, 0xff); + //CLAMP((GG), 0x00, 0xff); + //CLAMP((BB), 0x00, 0xff); + color.u = (color.u & 0x00ffffff) | color_alpha; + } +} /************************************* @@ -3041,7 +3594,6 @@ while (0) do \ { \ INT32 depthval, wfloat, fogdepth, biasdepth; \ - INT32 prefogr, prefogg, prefogb; \ INT32 r, g, b, a; \ \ (STATS)->pixels_in++; \ @@ -3206,19 +3758,104 @@ do } \ while (0) +ATTR_FORCE_INLINE bool depthTest(UINT16 zaColorReg, stats_block *stats, INT32 destDepth, UINT32 fbzModeReg, INT32 biasdepth) +{ + /* handle depth buffer testing */ + if (FBZMODE_ENABLE_DEPTHBUF(fbzModeReg)) + { + INT32 depthsource; + + /* the source depth is either the iterated W/Z+bias or a */ + /* constant value */ + if (FBZMODE_DEPTH_SOURCE_COMPARE(fbzModeReg) == 0) + depthsource = biasdepth; + else + depthsource = zaColorReg; + + /* test against the depth buffer */ + switch (FBZMODE_DEPTH_FUNCTION(fbzModeReg)) + { + case 0: /* depthOP = never */ + stats->zfunc_fail++; + return false; + + case 1: /* depthOP = less than */ + if (depthsource >= destDepth) + { + stats->zfunc_fail++; + return false; + } + break; + + case 2: /* depthOP = equal */ + if (depthsource != destDepth) + { + stats->zfunc_fail++; + return false; + } + break; + + case 3: /* depthOP = less than or equal */ + if (depthsource > destDepth) + { + stats->zfunc_fail++; + return false; + } + break; + + case 4: /* depthOP = greater than */ + if (depthsource <= destDepth) + { + stats->zfunc_fail++; + return false; + } + break; + + case 5: /* depthOP = not equal */ + if (depthsource == destDepth) + { + stats->zfunc_fail++; + return false; + } + break; + + case 6: /* depthOP = greater than or equal */ + if (depthsource < destDepth) + { + stats->zfunc_fail++; + return false; + } + break; + + case 7: /* depthOP = always */ + break; + } + } + return true; +} #define PIXEL_PIPELINE_END(VV, STATS, DITHER, DITHER4, DITHER_LOOKUP, XX, dest, depth, FBZMODE, FBZCOLORPATH, ALPHAMODE, FOGMODE, ITERZ, ITERW, ITERAXXX) \ \ - /* perform fogging */ \ - prefogr = r; \ - prefogg = g; \ - prefogb = b; \ - APPLY_FOGGING(VV, FOGMODE, FBZCOLORPATH, XX, DITHER4, r, g, b, \ - ITERZ, ITERW, ITERAXXX); \ - \ - /* perform alpha blending */ \ - APPLY_ALPHA_BLEND(FBZMODE, ALPHAMODE, XX, DITHER, r, g, b, a); \ - \ + if (USE_OLD_RASTER) { \ + /* perform fogging */ \ + INT32 prefogr, prefogg, prefogb; \ + prefogr = r; \ + prefogg = g; \ + prefogb = b; \ + APPLY_FOGGING(VV, FOGMODE, FBZCOLORPATH, XX, DITHER4, r, g, b, \ + ITERZ, ITERW, ITERAXXX); \ + \ + /* perform alpha blending */ \ + APPLY_ALPHA_BLEND(FBZMODE, ALPHAMODE, XX, DITHER, r, g, b, a); \ + } else { \ + /* perform fogging */ \ + rgb_union preFog; \ + preFog.u = color.u; \ + applyFogging(VV, FOGMODE, FBZCOLORPATH, DITHER4[XX&3], fogdepth, color, ITERZ, ITERW, ITERAXXX); \ + /* perform alpha blending */ \ + alphaBlend(FBZMODE, ALPHAMODE, DITHER[XX&3], dest[XX], depth[XX], preFog, color); \ + a = color.rgb.a; r = color.rgb.r; g = color.rgb.g; b = color.rgb.b; \ + } \ /* modify the pixel for debugging purposes */ \ MODIFY_PIXEL(VV); \ \ @@ -3391,7 +4028,7 @@ do } \ \ /* select zero or a_other */ \ - if (FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH) == 0) \ + if (!FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH)) \ a = c_other.rgb.a; \ else \ a = 0; \ @@ -3546,6 +4183,254 @@ do } \ while (0) +ATTR_FORCE_INLINE bool combineColor(voodoo_state *VV, stats_block *STATS, UINT32 FBZCOLORPATH, UINT32 FBZMODE, UINT32 ALPHAMODE, + rgb_union TEXELARGB, INT32 ITERZ, INT64 ITERW, rgb_union ITERARGB, rgb_union &color) +{ + rgb_union c_other; + rgb_union c_local; + + /* compute c_other */ + switch (FBZCP_CC_RGBSELECT(FBZCOLORPATH)) + { + case 0: /* iterated RGB */ + c_other.u = ITERARGB.u; + break; + + case 1: /* texture RGB */ + c_other.u = TEXELARGB.u; + break; + + case 2: /* color1 RGB */ + c_other.u = (VV)->reg[color1].u; + break; + + default: /* reserved - voodoo3 framebufferRGB */ + c_other.u = 0; + break; + } + + /* handle chroma key */ + if (!chromaKeyTest(VV, STATS, FBZMODE, c_other)) + return false; + //APPLY_CHROMAKEY(VV, STATS, FBZMODE, c_other); + + /* compute a_other */ + switch (FBZCP_CC_ASELECT(FBZCOLORPATH)) + { + case 0: /* iterated alpha */ + c_other.rgb.a = ITERARGB.rgb.a; + break; + + case 1: /* texture alpha */ + c_other.rgb.a = TEXELARGB.rgb.a; + break; + + case 2: /* color1 alpha */ + c_other.rgb.a = (VV)->reg[color1].rgb.a; + break; + + default: /* reserved */ + c_other.rgb.a = 0; + break; + } + + /* handle alpha mask */ + if (!alphaMaskTest(STATS, FBZMODE, c_other.rgb.a)) + return false; + //APPLY_ALPHAMASK(VV, STATS, FBZMODE, c_other.rgb.a); + + + /* compute c_local */ + if (FBZCP_CC_LOCALSELECT_OVERRIDE(FBZCOLORPATH) == 0) + { + if (FBZCP_CC_LOCALSELECT(FBZCOLORPATH) == 0) /* iterated RGB */ + c_local.u = ITERARGB.u; + else /* color0 RGB */ + c_local.u = (VV)->reg[color0].u; + } + else + { + if (!(TEXELARGB.rgb.a & 0x80)) /* iterated RGB */ + c_local.u = ITERARGB.u; + else /* color0 RGB */ + c_local.u = (VV)->reg[color0].u; + } + + /* compute a_local */ + switch (FBZCP_CCA_LOCALSELECT(FBZCOLORPATH)) + { + default: + case 0: /* iterated alpha */ + c_local.rgb.a = ITERARGB.rgb.a; + break; + + case 1: /* color0 alpha */ + c_local.rgb.a = (VV)->reg[color0].rgb.a; + break; + + case 2: /* clamped iterated Z[27:20] */ + { + int temp; + CLAMPED_Z(ITERZ, FBZCOLORPATH, temp); + c_local.rgb.a = (UINT8)temp; + break; + } + + case 3: /* clamped iterated W[39:32] */ + { + int temp; + CLAMPED_W(ITERW, FBZCOLORPATH, temp); /* Voodoo 2 only */ + c_local.rgb.a = (UINT8)temp; + break; + } + } + + UINT8 a_other = c_other.rgb.a; + UINT8 a_local = c_local.rgb.a; + UINT8 tmp; + rgb_union add_val = c_local; + rgbaint tmpA, tmpB, tmpC; + + + /* select zero or c_other */ + if (FBZCP_CC_ZERO_OTHER(FBZCOLORPATH)) + c_other.u &= 0xff000000; + //r = g = b = 0; + + /* select zero or a_other */ + if (FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH)) + c_other.u &= 0x00ffffff; + + rgba_to_rgbaint(&tmpA, (rgb_t) c_other.u); + + /* subtract a/c_local */ + if (FBZCP_CC_SUB_CLOCAL(FBZCOLORPATH) || (FBZCP_CCA_SUB_CLOCAL(FBZCOLORPATH))) + { + rgb_union sub_val = c_local; + + if (!FBZCP_CC_SUB_CLOCAL(FBZCOLORPATH)) + sub_val.u &= 0xff000000; + + if (!FBZCP_CCA_SUB_CLOCAL(FBZCOLORPATH)) + sub_val.u &= 0x00ffffff; + + rgba_to_rgbaint(&tmpB, (rgb_t) sub_val.u); + rgbint_sub(&tmpA, &tmpB); + } + + /* blend RGB */ + switch (FBZCP_CC_MSELECT(FBZCOLORPATH)) + { + default: /* reserved */ + case 0: /* 0 */ + c_local.u &= 0xff000000; + break; + + case 1: /* c_local */ + break; + + case 2: /* a_other */ + c_local.u = (c_local.u & 0xff000000) | (a_other<<16) | (a_other<<8) | (a_other); + break; + + case 3: /* a_local */ + c_local.u = (c_local.u & 0xff000000) | (a_local<<16) | (a_local<<8) | (a_local); + break; + + case 4: /* texture alpha */ + tmp = TEXELARGB.rgb.a; + c_local.u = (c_local.u & 0xff000000) | (tmp<<16) | (tmp<<8) | (tmp); + break; + + case 5: /* texture RGB (Voodoo 2 only) */ + c_local.u = (c_local.u & 0xff000000) | (TEXELARGB.u & 0x00ffffff); + break; + } + + /* blend alpha */ + switch (FBZCP_CCA_MSELECT(FBZCOLORPATH)) + { + default: /* reserved */ + case 0: /* 0 */ + c_local.u &= 0x00ffffff; + break; + + case 1: /* a_local */ + case 3: /* a_local */ + c_local.rgb.a = a_local; + break; + + case 2: /* a_other */ + c_local.rgb.a = a_other; + break; + + case 4: /* texture alpha */ + c_local.rgb.a = TEXELARGB.rgb.a; + break; + } + + /* reverse the RGB blend */ + if (!FBZCP_CC_REVERSE_BLEND(FBZCOLORPATH)) + c_local.u ^= 0x00ffffff; + + /* reverse the alpha blend */ + if (!FBZCP_CCA_REVERSE_BLEND(FBZCOLORPATH)) + c_local.u ^= 0xff000000; + + /* do the blend */ + //color.rgb.a = (color.rgb.a * (blenda + 1)) >> 8; + //color.rgb.r = (color.rgb.r * (blendr + 1)) >> 8; + //color.rgb.g = (color.rgb.g * (blendg + 1)) >> 8; + //color.rgb.b = (color.rgb.b * (blendb + 1)) >> 8; + + /* add clocal or alocal to alpha */ + if (!FBZCP_CCA_ADD_ACLOCAL(FBZCOLORPATH)) + add_val.u &= 0x00ffffff; + //color.rgb.a += c_local.rgb.a; + + /* add clocal or alocal to RGB */ + switch (FBZCP_CC_ADD_ACLOCAL(FBZCOLORPATH)) + { + case 3: /* reserved */ + case 0: /* nothing */ + add_val.u &= 0xff000000; + break; + + case 1: /* add c_local */ + break; + + case 2: /* add_alocal */ + add_val.u = (add_val.u & 0xff000000) | (a_local<<16) | (a_local<<8) | (a_local); + break; + } + + /* clamp */ + //CLAMP(color.rgb.a, 0x00, 0xff); + //CLAMP(color.rgb.r, 0x00, 0xff); + //CLAMP(color.rgb.g, 0x00, 0xff); + //CLAMP(color.rgb.b, 0x00, 0xff); + rgba_to_rgbaint(&tmpB, (rgb_t) c_local.u); + rgbaint_add_imm(&tmpB, 1); + rgba_to_rgbaint(&tmpC, (rgb_t) add_val.u); + rgbaint_scale_channel_add_and_clamp(&tmpA, &tmpB, &tmpC); + color.u = rgbaint_to_rgba(&tmpA); + + /* invert */ + if (FBZCP_CCA_INVERT_OUTPUT(FBZCOLORPATH)) + color.u ^= 0xff000000; + /* invert */ + if (FBZCP_CC_INVERT_OUTPUT(FBZCOLORPATH)) + color.u ^= 0x00ffffff; + + + /* handle alpha test */ + if (!alphaTest(VV, STATS, ALPHAMODE, color.rgb.a)) + return false; + //APPLY_ALPHATEST(VV, STATS, ALPHAMODE, color.rgb.a); + + return true; +} + /************************************* @@ -3639,47 +4524,78 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co iters1 = extra->starts1 + dy * extra->ds1dy + dx * extra->ds1dx; \ itert1 = extra->startt1 + dy * extra->dt1dy + dx * extra->dt1dx; \ } \ - \ + extra->info->hits++; \ /* loop in X */ \ for (x = startx; x < stopx; x++) \ { \ - rgb_union iterargb = { 0 }; \ + rgb_union iterargb; \ rgb_union texel = { 0 }; \ + rgb_union color; \ \ /* pixel pipeline part 1 handles depth setup and stippling */ \ - PIXEL_PIPELINE_BEGIN(v, stats, x, y, FBZCOLORPATH, FBZMODE, \ - iterz, iterw); \ - /* depth testing */ \ - DEPTH_TEST(v, stats, x, FBZMODE); \ - \ - /* run the texture pipeline on TMU1 to produce a value in texel */ \ - /* note that they set LOD min to 8 to "disable" a TMU */ \ - if (TMUS >= 2 && v->tmu[1].lodmin < (8 << 8)) \ - TEXTURE_PIPELINE(&v->tmu[1], x, dither4, TEXMODE1, texel, \ - v->tmu[1].lookup, extra->lodbase1, \ - iters1, itert1, iterw1, texel); \ - \ - /* run the texture pipeline on TMU0 to produce a final */ \ - /* result in texel */ \ - /* note that they set LOD min to 8 to "disable" a TMU */ \ - if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \ + PIXEL_PIPELINE_BEGIN(v, stats, x, y, FBZCOLORPATH, FBZMODE, iterz, iterw); \ + if (USE_OLD_RASTER) { \ + DEPTH_TEST(v, stats, x, FBZMODE); \ + \ + /* run the texture pipeline on TMU1 to produce a value in texel */ \ + /* note that they set LOD min to 8 to "disable" a TMU */ \ + if (TMUS >= 2 && v->tmu[1].lodmin < (8 << 8)) \ + TEXTURE_PIPELINE(&v->tmu[1], x, dither4, TEXMODE1, texel, \ + v->tmu[1].lookup, extra->lodbase1, \ + iters1, itert1, iterw1, texel); \ + \ + /* run the texture pipeline on TMU0 to produce a final */ \ + /* result in texel */ \ + /* note that they set LOD min to 8 to "disable" a TMU */ \ + if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \ + { \ + if (!v->send_config) \ + TEXTURE_PIPELINE(&v->tmu[0], x, dither4, TEXMODE0, texel, \ + v->tmu[0].lookup, extra->lodbase0, \ + iters0, itert0, iterw0, texel); \ + else \ + texel.u = v->tmu_config; \ + } \ + /* colorpath pipeline selects source colors and does blending */ \ + CLAMPED_ARGB(iterr, iterg, iterb, itera, FBZCOLORPATH, iterargb); \ + COLORPATH_PIPELINE(v, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, \ + iterz, iterw, iterargb); \ + } else { \ + /* depth testing */ \ + if (!depthTest((UINT16) v->reg[zaColor].u, stats, depth[x], FBZMODE, biasdepth)) \ + goto skipdrawdepth; \ + \ + /* run the texture pipeline on TMU1 to produce a value in texel */ \ + /* note that they set LOD min to 8 to "disable" a TMU */ \ + if (TMUS >= 2 && v->tmu[1].lodmin < (8 << 8)) { \ + INT32 tmp; \ + texel.u = genTexture(&v->tmu[1], dither4[x&3], TEXMODE1, v->tmu[1].lookup, extra->lodbase1, \ + iters1, itert1, iterw1, tmp); \ + } \ + /* run the texture pipeline on TMU0 to produce a final */ \ + /* result in texel */ \ + /* note that they set LOD min to 8 to "disable" a TMU */ \ + if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \ + { \ + rgb_union texelT0; \ + if (!v->send_config) \ { \ - if (!v->send_config) \ - { \ - TEXTURE_PIPELINE(&v->tmu[0], x, dither4, TEXMODE0, texel, \ - v->tmu[0].lookup, extra->lodbase0, \ - iters0, itert0, iterw0, texel); \ - } \ - else \ - { \ - texel.u=v->tmu_config; \ - } \ + INT32 lod0; \ + texelT0.u = genTexture(&v->tmu[0], dither4[x&3], TEXMODE0, v->tmu[0].lookup, extra->lodbase0, \ + iters0, itert0, iterw0, lod0); \ + texel.u = combineTexture(&v->tmu[0], TEXMODE0, texelT0, texel, lod0); \ } \ - \ - /* colorpath pipeline selects source colors and does blending */ \ - CLAMPED_ARGB(iterr, iterg, iterb, itera, FBZCOLORPATH, iterargb); \ - COLORPATH_PIPELINE(v, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, \ - iterz, iterw, iterargb); \ + else \ + { \ + texel.u=v->tmu_config; \ + } \ + } \ + \ + /* colorpath pipeline selects source colors and does blending */ \ + iterargb.u = clampARGB(iterr, iterg, iterb, itera, FBZCOLORPATH); \ + if (!combineColor(v, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, iterz, iterw, iterargb, color)) \ + goto skipdrawdepth; \ + } \ \ /* pixel pipeline part 2 handles fog, alpha, and final output */ \ PIXEL_PIPELINE_END(v, stats, dither, dither4, dither_lookup, x, dest, depth, \ @@ -3707,3 +4623,358 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co } \ } \ } + +ATTR_FORCE_INLINE UINT32 genTexture(tmu_state *TT, const UINT8 ditherX, const UINT32 TEXMODE, rgb_t *LOOKUP, INT32 LODBASE, INT64 ITERS, INT64 ITERT, INT64 ITERW, INT32 &lod) +{ + UINT32 result; + INT32 oow, s, t, ilod; + INT32 smax, tmax; + UINT32 texbase; + + /* determine the S/T/LOD values for this texture */ + lod = (LODBASE); + /* clamp W */ + if (TEXMODE_CLAMP_NEG_W(TEXMODE) && (ITERW) < 0) + { + s = t = 0; + } + else if (TEXMODE_ENABLE_PERSPECTIVE(TEXMODE)) + { + INT32 wLog; + oow = fast_reciplog((ITERW), &wLog); + lod += wLog; + s = ((INT64)oow * (ITERS)) >> 29; + t = ((INT64)oow * (ITERT)) >> 29; + } + else + { + s = (ITERS) >> 14; + t = (ITERT) >> 14; + } + + + /* clamp the LOD */ + lod += (TT)->lodbias; + if (TEXMODE_ENABLE_LOD_DITHER(TEXMODE)) + lod += ditherX << 4; + if (lod < (TT)->lodmin) + lod = (TT)->lodmin; + if (lod > (TT)->lodmax) + lod = (TT)->lodmax; + + /* now the LOD is in range; if we don't own this LOD, take the next one */ + ilod = lod >> 8; + if (!(((TT)->lodmask >> ilod) & 1)) + ilod++; + + /* fetch the texture base */ + texbase = (TT)->lodoffset[ilod]; + + /* compute the maximum s and t values at this LOD */ + smax = (TT)->wmask >> ilod; + tmax = (TT)->hmask >> ilod; + + /* determine whether we are point-sampled or bilinear */ + if ((lod == (TT)->lodmin && !TEXMODE_MAGNIFICATION_FILTER(TEXMODE)) || + (lod != (TT)->lodmin && !TEXMODE_MINIFICATION_FILTER(TEXMODE))) + { + /* point sampled */ + + UINT32 texel0; + + /* adjust S/T for the LOD and strip off the fractions */ + s >>= ilod + 18; + t >>= ilod + 18; + + /* clamp/wrap S/T if necessary */ + if (TEXMODE_CLAMP_S(TEXMODE)) + CLAMP(s, 0, smax); + if (TEXMODE_CLAMP_T(TEXMODE)) + CLAMP(t, 0, tmax); + s &= smax; + t &= tmax; + t *= smax + 1; + + /* fetch texel data */ + if (TEXMODE_FORMAT(TEXMODE) < 8) + { + texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; + result = (LOOKUP)[texel0]; + } + else + { + texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; + if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12) + result = (LOOKUP)[texel0]; + else + result = ((LOOKUP)[texel0 & 0xff] & 0xffffff) | ((texel0 & 0xff00) << 16); + } + } + else + { + /* bilinear filtered */ + + UINT32 texel0, texel1, texel2, texel3; + UINT32 sfrac, tfrac; + INT32 s1, t1; + + /* adjust S/T for the LOD and strip off all but the low 8 bits of */ + /* the fraction */ + s >>= ilod + 10; + t >>= ilod + 10; + + /* also subtract 1/2 texel so that (0.5,0.5) = a full (0,0) texel */ + s -= 0x80; + t -= 0x80; + + /* extract the fractions */ + sfrac = s & (TT)->bilinear_mask; + tfrac = t & (TT)->bilinear_mask; + + /* now toss the rest */ + s >>= 8; + t >>= 8; + s1 = s + 1; + t1 = t + 1; + + /* clamp/wrap S/T if necessary */ + if (TEXMODE_CLAMP_S(TEXMODE)) + { + if (s < 0) { + s = 0; + s1 = 0; + } else if (s >= smax) { + s = smax; + s1 = smax; + } + //CLAMP(s, 0, smax); + //CLAMP(s1, 0, smax); + } else { + s &= smax; + s1 &= smax; + } + + if (TEXMODE_CLAMP_T(TEXMODE)) + { + if (t < 0) { + t = 0; + t1 = 0; + } else if (t >= tmax) { + t = tmax; + t1 = tmax; + } + //CLAMP(t, 0, tmax); + //CLAMP(t1, 0, tmax); + } else { + t &= tmax; + t1 &= tmax; + } + t *= smax + 1; + t1 *= smax + 1; + + /* fetch texel data */ + if (TEXMODE_FORMAT(TEXMODE) < 8) + { + texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s)]; + texel1 = *(UINT8 *)&(TT)->ram[(texbase + t + s1)]; + texel2 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s)]; + texel3 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s1)]; + texel0 = (LOOKUP)[texel0]; + texel1 = (LOOKUP)[texel1]; + texel2 = (LOOKUP)[texel2]; + texel3 = (LOOKUP)[texel3]; + } + else + { + texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s))]; + texel1 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s1))]; + texel2 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s))]; + texel3 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s1))]; + if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12) + { + texel0 = (LOOKUP)[texel0]; + texel1 = (LOOKUP)[texel1]; + texel2 = (LOOKUP)[texel2]; + texel3 = (LOOKUP)[texel3]; + } + else + { + texel0 = ((LOOKUP)[texel0 & 0xff] & 0xffffff) | ((texel0 & 0xff00) << 16); + texel1 = ((LOOKUP)[texel1 & 0xff] & 0xffffff) | ((texel1 & 0xff00) << 16); + texel2 = ((LOOKUP)[texel2 & 0xff] & 0xffffff) | ((texel2 & 0xff00) << 16); + texel3 = ((LOOKUP)[texel3 & 0xff] & 0xffffff) | ((texel3 & 0xff00) << 16); + } + } + + /* weigh in each texel */ + result = rgba_bilinear_filter(texel0, texel1, texel2, texel3, sfrac, tfrac); + } + return result; +} + +ATTR_FORCE_INLINE UINT32 combineTexture(tmu_state *TT, const UINT32 TEXMODE, rgb_union c_local, rgb_union c_other, INT32 lod) +{ + UINT32 result; + //INT32 blendr, blendg, blendb, blenda; + //INT32 tr, tg, tb, ta; + UINT8 a_other = c_other.rgb.a; + UINT8 a_local = c_local.rgb.a; + rgb_union add_val = c_local; + UINT8 tmp; + rgbaint tmpA, tmpB, tmpC; + + /* select zero/other for RGB */ + if (TEXMODE_TC_ZERO_OTHER(TEXMODE)) + c_other.u &= 0xff000000; + + /* select zero/other for alpha */ + if (TEXMODE_TCA_ZERO_OTHER(TEXMODE)) + c_other.u &= 0x00ffffff; + + rgba_to_rgbaint(&tmpA, (rgb_t) c_other.u); + + if (TEXMODE_TC_SUB_CLOCAL(TEXMODE) || TEXMODE_TCA_SUB_CLOCAL(TEXMODE)) + { + rgb_union sub_val = c_local; + + /* potentially subtract c_local */ + if (!TEXMODE_TC_SUB_CLOCAL(TEXMODE)) + sub_val.u &= 0xff000000; + + if (!TEXMODE_TCA_SUB_CLOCAL(TEXMODE)) + sub_val.u &= 0x00ffffff; + + rgba_to_rgbaint(&tmpB, (rgb_t) sub_val.u); + rgbint_sub(&tmpA, &tmpB); + } + + /* blend RGB */ + switch (TEXMODE_TC_MSELECT(TEXMODE)) + { + default: /* reserved */ + case 0: /* zero */ + c_local.u &= 0xff000000; + break; + + case 1: /* c_local */ + break; + + case 2: /* a_other */ + c_local.u = (c_local.u & 0xff000000) | (a_other<<16) | (a_other<<8) | (a_other); + break; + + case 3: /* a_local */ + c_local.u = (c_local.u & 0xff000000) | (a_local<<16) | (a_local<<8) | (a_local); + break; + + case 4: /* LOD (detail factor) */ + if ((TT)->detailbias <= lod) + c_local.u &= 0xff000000; + else + { + tmp = ((((TT)->detailbias - lod) << (TT)->detailscale) >> 8); + if (tmp > (TT)->detailmax) + tmp = (TT)->detailmax; + c_local.u = (c_local.u & 0xff000000) | (tmp<<16) | (tmp<<8) | (tmp); + } + break; + + case 5: /* LOD fraction */ + tmp = lod & 0xff; + c_local.u = (c_local.u & 0xff000000) | (tmp<<16) | (tmp<<8) | (tmp); + break; + } + + /* blend alpha */ + switch (TEXMODE_TCA_MSELECT(TEXMODE)) + { + default: /* reserved */ + case 0: /* zero */ + c_local.u &= 0x00ffffff; + break; + + case 1: /* c_local */ + break; + + case 2: /* a_other */ + c_local.rgb.a = a_other; + break; + + case 3: /* a_local */ + break; + + case 4: /* LOD (detail factor) */ + if ((TT)->detailbias <= lod) + c_local.u &= 0x00ffffff; + else + { + tmp = ((((TT)->detailbias - lod) << (TT)->detailscale) >> 8); + if (tmp > (TT)->detailmax) + tmp = (TT)->detailmax; + c_local.rgb.a = tmp; + } + break; + + case 5: /* LOD fraction */ + c_local.rgb.a = lod & 0xff; + break; + } + + /* reverse the RGB blend */ + if (!TEXMODE_TC_REVERSE_BLEND(TEXMODE)) + { + c_local.u ^= 0x00ffffff; + } + + /* reverse the alpha blend */ + if (!TEXMODE_TCA_REVERSE_BLEND(TEXMODE)) + c_local.u ^= 0xff000000; + + /* do the blend */ + //tr = (tr * (blendr + 1)) >> 8; + //tg = (tg * (blendg + 1)) >> 8; + //tb = (tb * (blendb + 1)) >> 8; + //ta = (ta * (blenda + 1)) >> 8; + + /* add clocal or alocal to RGB */ + switch (TEXMODE_TC_ADD_ACLOCAL(TEXMODE)) + { + case 3: /* reserved */ + case 0: /* nothing */ + add_val.u &= 0xff000000; + break; + + case 1: /* add c_local */ + break; + + case 2: /* add_alocal */ + add_val.u = (add_val.u & 0xff000000) | (a_local << 16) | (a_local << 8) | (a_local << 0); + //tr += c_local.rgb.a; + //tg += c_local.rgb.a; + //tb += c_local.rgb.a; + break; + } + + /* add clocal or alocal to alpha */ + if (!TEXMODE_TCA_ADD_ACLOCAL(TEXMODE)) + add_val.u &= 0x00ffffff; + //ta += c_local.rgb.a; + + /* clamp */ + //result.rgb.r = (tr < 0) ? 0 : (tr > 0xff) ? 0xff : tr; + //result.rgb.g = (tg < 0) ? 0 : (tg > 0xff) ? 0xff : tg; + //result.rgb.b = (tb < 0) ? 0 : (tb > 0xff) ? 0xff : tb; + //result.rgb.a = (ta < 0) ? 0 : (ta > 0xff) ? 0xff : ta; + rgba_to_rgbaint(&tmpB, (rgb_t) c_local.u); + rgbaint_add_imm(&tmpB, 1); + rgba_to_rgbaint(&tmpC, (rgb_t) add_val.u); + rgbaint_scale_channel_add_and_clamp(&tmpA, &tmpB, &tmpC); + result = rgbaint_to_rgba(&tmpA); + + /* invert */ + if (TEXMODE_TC_INVERT_OUTPUT(TEXMODE)) + result ^= 0x00ffffff; + if (TEXMODE_TCA_INVERT_OUTPUT(TEXMODE)) + result ^= 0xff000000; + return result; +} diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index 9085286f405..6fb8097e8fa 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -892,7 +892,7 @@ static void swap_buffers(voodoo_state *v) /* periodically log rasterizer info */ v->stats.swaps++; - if (LOG_RASTERIZERS && v->stats.swaps % 100 == 0) + if (LOG_RASTERIZERS && v->stats.swaps % 1000 == 0) dump_rasterizer_stats(v); /* update the statistics (debug) */ @@ -3302,10 +3302,7 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, //PIXEL_PIPELINE_BEGIN(v, stats, x, y, v->reg[fbzColorPath].u, v->reg[fbzMode].u, iterz, iterw); // Start PIXEL_PIPE_BEGIN copy //#define PIXEL_PIPELINE_BEGIN(VV, STATS, XX, YY, FBZCOLORPATH, FBZMODE, ITERZ, ITERW) - do - { INT32 fogdepth, biasdepth; - INT32 prefogr, prefogg, prefogb; INT32 r, g, b, a; (stats)->pixels_in++; @@ -3334,7 +3331,7 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, if (((v->reg[stipple].u >> stipple_index) & 1) == 0) { v->stats.total_stippled++; - goto skipdrawdepth; + goto nextpixel; } } } @@ -3343,25 +3340,40 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, // Depth testing value for lfb pipeline writes is directly from write data, no biasing is used fogdepth = biasdepth = (UINT32) sw[pix]; - /* Perform depth testing */ - DEPTH_TEST(v, stats, x, v->reg[fbzMode].u); - /* use the RGBA we stashed above */ color.rgb.r = r = sr[pix]; color.rgb.g = g = sg[pix]; color.rgb.b = b = sb[pix]; color.rgb.a = a = sa[pix]; - /* apply chroma key, alpha mask, and alpha testing */ - APPLY_CHROMAKEY(v, stats, v->reg[fbzMode].u, color); - APPLY_ALPHAMASK(v, stats, v->reg[fbzMode].u, color.rgb.a); - APPLY_ALPHATEST(v, stats, v->reg[alphaMode].u, color.rgb.a); + if (USE_OLD_RASTER) { + /* Perform depth testing */ + DEPTH_TEST(v, stats, x, v->reg[fbzMode].u); + + /* apply chroma key, alpha mask, and alpha testing */ + APPLY_CHROMAKEY(v, stats, v->reg[fbzMode].u, color); + APPLY_ALPHAMASK(v, stats, v->reg[fbzMode].u, color.rgb.a); + APPLY_ALPHATEST(v, stats, v->reg[alphaMode].u, color.rgb.a); + } else { + /* Perform depth testing */ + if (!depthTest((UINT16) v->reg[zaColor].u, stats, depth[x], v->reg[fbzMode].u, biasdepth)) + goto nextpixel; + + /* handle chroma key */ + if (!chromaKeyTest(v, stats, v->reg[fbzMode].u, color)) + goto nextpixel; + /* handle alpha mask */ + if (!alphaMaskTest(stats, v->reg[fbzMode].u, color.rgb.a)) + goto nextpixel; + /* handle alpha test */ + if (!alphaTest(v, stats, v->reg[alphaMode].u, color.rgb.a)) + goto nextpixel; + } /* pixel pipeline part 2 handles color combine, fog, alpha, and final output */ PIXEL_PIPELINE_END(v, stats, dither, dither4, dither_lookup, x, dest, depth, v->reg[fbzMode].u, v->reg[fbzColorPath].u, v->reg[alphaMode].u, v->reg[fogMode].u, iterz, iterw, iterargb); - } nextpixel: /* advance our pointers */ x++; @@ -5658,6 +5670,7 @@ static raster_info *add_rasterizer(voodoo_state *v, const raster_info *cinfo) /* fill in the data */ info->hits = 0; info->polys = 0; + info->hash = hash; /* hook us into the hash table */ info->next = v->raster_hash[hash]; @@ -5760,7 +5773,7 @@ static void dump_rasterizer_stats(voodoo_state *v) break; /* print it */ - printf("RASTERIZER_ENTRY( 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X ) /* %c %8d %10d */\n", + printf("RASTERIZER_ENTRY( 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X ) /* %c %2d %8d %10d */\n", best->eff_color_path, best->eff_alpha_mode, best->eff_fog_mode, @@ -5768,6 +5781,7 @@ static void dump_rasterizer_stats(voodoo_state *v) best->eff_tex_mode_0, best->eff_tex_mode_1, best->is_generic ? '*' : ' ', + best->hash, best->polys, best->hits); @@ -6436,6 +6450,26 @@ RASTERIZER_ENTRY( 0x00602439, 0x00044119, 0x00000000, 0x000B0379, 0x00000009, 0x //RASTERIZER_ENTRY( 0x00002809, 0x00004110, 0x00000001, 0x00030FFB, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ //RASTERIZER_ENTRY( 0x00424219, 0x00000000, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ //RASTERIZER_ENTRY( 0x0200421A, 0x00001510, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ +/* gtfore06 ----> fbzColorPath alphaMode fogMode, fbzMode, texMode0, texMode1 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) /* 47 901402 15032233 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) /* 90 186896 9133452 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) /* 18 119615 9038715 */ +RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x000000C1, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 12 33459 3336035 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 45 166408 2416297 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C2610C4 ) /* 79 39422 2109850 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 26 9335 850817 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x00000ACD, 0x0C261ACD ) /* 9 8990 267028 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 61 2540 184702 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 5 1270 162503 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x00000000, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 84 7393 51970 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x042210C0 ) /* 2 9440 39646 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 67 990 13559 */ +RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 24 176 13213 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 20 348 7883 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) /* 70 2020 6048 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) /* 92 28 28 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) /* 55 18 540 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) /* * 19 2 24 */ /* golden tee fore! series */ RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) From f6c745640fe6c1a0d3e1b2116afc75027fe0a69d Mon Sep 17 00:00:00 2001 From: ted green Date: Sun, 7 Jun 2015 12:29:22 -0600 Subject: [PATCH 211/284] Clean up rasters for gtfore --- src/emu/video/voodoo.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index 6fb8097e8fa..a0c0d26e941 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -6450,7 +6450,7 @@ RASTERIZER_ENTRY( 0x00602439, 0x00044119, 0x00000000, 0x000B0379, 0x00000009, 0x //RASTERIZER_ENTRY( 0x00002809, 0x00004110, 0x00000001, 0x00030FFB, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ //RASTERIZER_ENTRY( 0x00424219, 0x00000000, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ //RASTERIZER_ENTRY( 0x0200421A, 0x00001510, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ -/* gtfore06 ----> fbzColorPath alphaMode fogMode, fbzMode, texMode0, texMode1 */ +/* gtfore06 ----> fbzColorPath alphaMode fogMode, fbzMode, texMode0, texMode1 hash */ RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) /* 47 901402 15032233 */ RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) /* 90 186896 9133452 */ RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) /* 18 119615 9038715 */ @@ -6469,28 +6469,6 @@ RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) /* 70 2020 6048 */ RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) /* 92 28 28 */ RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) /* 55 18 540 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) /* * 19 2 24 */ - -/* golden tee fore! series */ -RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x00000000, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x042210C0 ) -RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x000000C1, 0x00010FF9, 0x00000A09, 0x0C261A0F ) -RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x00000ACD, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C2610C4 ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C261ACD ) +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) /* 19 2 24 */ #endif From 49bbeae98e7176078c257076bd27b47fc47e317e Mon Sep 17 00:00:00 2001 From: balr0g Date: Sun, 7 Jun 2015 15:35:00 -0400 Subject: [PATCH 212/284] Revert "Placed back old corealloc otherwise NO_MEM_TRACKING do not have any meaning (nw)" (Requested by R.Belmont since this breaks build with GCC 5.1.) This reverts commit aae343fcedb49943bbcadeda9f3ad41172b6eecb. --- src/lib/util/corealloc.c | 35 +++++++++++++++++++++++++++++++++++ src/lib/util/corealloc.h | 28 +++++++++------------------- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/lib/util/corealloc.c b/src/lib/util/corealloc.c index c8fcf7e3aa5..40d7456546a 100644 --- a/src/lib/util/corealloc.c +++ b/src/lib/util/corealloc.c @@ -96,6 +96,41 @@ bool memory_entry::s_tracking = false; memory_entry *memory_entry::s_hash[memory_entry::k_hash_prime] = { NULL }; memory_entry *memory_entry::s_freehead = NULL; +//************************************************************************** +// OPERATOR REPLACEMENTS +//************************************************************************** + +#ifndef NO_MEM_TRACKING + +// standard new/delete operators (try to avoid using) +void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } +void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } +void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } +void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } + +void* operator new(std::size_t size,const std::nothrow_t&) throw() { return malloc_file_line(size, NULL, 0, false, false, false); } +void* operator new[](std::size_t size, const std::nothrow_t&) throw() { return malloc_file_line(size, NULL, 0, true, false, false); } +void operator delete(void* ptr, const std::nothrow_t&) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } +void operator delete[](void* ptr, const std::nothrow_t&) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } + +#endif + +//************************************************************************** +// OPERATOR OVERLOADS - DEFINITIONS +//************************************************************************** + +// file/line new/delete operators +void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, false); } +void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, false); } +void operator delete(void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, false); } +void operator delete[](void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, true); } + +// file/line new/delete operators with zeroing +void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, true); } +void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, true); } +void operator delete(void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, false); } +void operator delete[](void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, true); } + //************************************************************************** diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h index 5b002557769..eb97e643686 100644 --- a/src/lib/util/corealloc.h +++ b/src/lib/util/corealloc.h @@ -51,33 +51,23 @@ void dump_unfreed_mem(UINT64 start = 0); //************************************************************************** -// INLINE FUNCTIONS +// OPERATOR OVERLOADS - DECLARATIONS //************************************************************************** // zeromem_t is a dummy class used to tell new to zero memory after allocation class zeromem_t { }; -#ifndef NO_MEM_TRACKING - -// standard new/delete operators (try to avoid using) -ATTR_FORCE_INLINE inline void *operator new(std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, false, true, false); } -ATTR_FORCE_INLINE inline void *operator new[](std::size_t size) throw (std::bad_alloc) { return malloc_file_line(size, NULL, 0, true, true, false); } -ATTR_FORCE_INLINE inline void operator delete(void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, false); } -ATTR_FORCE_INLINE inline void operator delete[](void *ptr) throw() { if (ptr != NULL) free_file_line(ptr, NULL, 0, true); } - -#endif - // file/line new/delete operators -ATTR_FORCE_INLINE inline void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, false); } -ATTR_FORCE_INLINE inline void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, false); } -ATTR_FORCE_INLINE inline void operator delete(void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, false); } -ATTR_FORCE_INLINE inline void operator delete[](void *ptr, const char *file, int line) { if (ptr != NULL) free_file_line(ptr, file, line, true); } +void *operator new(std::size_t size, const char *file, int line) throw (std::bad_alloc); +void *operator new[](std::size_t size, const char *file, int line) throw (std::bad_alloc); +void operator delete(void *ptr, const char *file, int line); +void operator delete[](void *ptr, const char *file, int line); // file/line new/delete operators with zeroing -ATTR_FORCE_INLINE inline void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, false, true, true); } -ATTR_FORCE_INLINE inline void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc) { return malloc_file_line(size, file, line, true, true, true); } -ATTR_FORCE_INLINE inline void operator delete(void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, false); } -ATTR_FORCE_INLINE inline void operator delete[](void *ptr, const char *file, int line, const zeromem_t &) { if (ptr != NULL) free_file_line(ptr, file, line, true); } +void *operator new(std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc); +void *operator new[](std::size_t size, const char *file, int line, const zeromem_t &) throw (std::bad_alloc); +void operator delete(void *ptr, const char *file, int line, const zeromem_t &); +void operator delete[](void *ptr, const char *file, int line, const zeromem_t &); From 3035b82eaf5782950123a89a0a1e282546ba598b Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 7 Jun 2015 22:55:00 +0200 Subject: [PATCH 213/284] added note --- src/emu/cpu/hmcs40/hmcs40.c | 3 ++- src/emu/cpu/tms0980/tms0980.c | 19 +++++++++++-------- src/emu/cpu/ucom4/ucom4.c | 3 ++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c index 1d44e7d97ce..dabc9740004 100644 --- a/src/emu/cpu/hmcs40/hmcs40.c +++ b/src/emu/cpu/hmcs40/hmcs40.c @@ -90,7 +90,7 @@ ADDRESS_MAP_END // device definitions hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname) - : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, FAMILY_HMCS43, polarity, 3, 10, 11, ADDRESS_MAP_NAME(program_1k), 7, ADDRESS_MAP_NAME(data_80x4), shortname, __FILE__) + : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, FAMILY_HMCS43, polarity, 3 /* stack levels */, 10 /* pc width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1k), 7 /* data width */, ADDRESS_MAP_NAME(data_80x4), shortname, __FILE__) { } hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -188,6 +188,7 @@ void hmcs40_cpu_device::device_start() m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hmcs40_cpu_device::simple_timer_cb), this)); reset_prescaler(); + // resolve callbacks m_read_r0.resolve_safe(0); m_read_r1.resolve_safe(0); m_read_r2.resolve_safe(0); diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c index 50f61788086..8275f09d815 100644 --- a/src/emu/cpu/tms0980/tms0980.c +++ b/src/emu/cpu/tms0980/tms0980.c @@ -187,6 +187,7 @@ const device_type TMS0270 = &device_creator; // 40-pin DIP, // TMS0260 is similar? except opla is 32 instead of 48 terms +// internal memory maps static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1xxx_cpu_device) AM_RANGE(0x000, 0xfff) AM_ROM ADDRESS_MAP_END @@ -218,8 +219,9 @@ static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1xxx_cpu_device) ADDRESS_MAP_END +// device definitions tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) + : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) { } tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) @@ -316,7 +318,7 @@ tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char { } - +// machine configs static MACHINE_CONFIG_FRAGMENT(tms1000) // microinstructions PLA, output PLA @@ -402,7 +404,7 @@ machine_config_constructor tms0270_cpu_device::device_mconfig_additions() const } - +// disasm offs_t tms1000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { extern CPU_DISASSEMBLE(tms1000); @@ -448,16 +450,17 @@ void tms1xxx_cpu_device::device_start() m_program = &space(AS_PROGRAM); m_data = &space(AS_DATA); - m_read_k.resolve_safe(0); - m_write_o.resolve_safe(); - m_write_r.resolve_safe(); - m_power_off.resolve_safe(); - m_o_mask = (1 << m_o_pins) - 1; m_r_mask = (1 << m_r_pins) - 1; m_pc_mask = (1 << m_pc_bits) - 1; m_x_mask = (1 << m_x_bits) - 1; + // resolve callbacks + m_read_k.resolve_safe(0); + m_write_o.resolve_safe(); + m_write_r.resolve_safe(); + m_power_off.resolve_safe(); + // zerofill m_pc = 0; m_sr = 0; diff --git a/src/emu/cpu/ucom4/ucom4.c b/src/emu/cpu/ucom4/ucom4.c index 11d1513ed03..ceb074728e5 100644 --- a/src/emu/cpu/ucom4/ucom4.c +++ b/src/emu/cpu/ucom4/ucom4.c @@ -62,7 +62,7 @@ ADDRESS_MAP_END // device definitions upd553_cpu_device::upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ucom4_cpu_device(mconfig, NEC_D553, "uPD553", tag, owner, clock, NEC_UCOM43, 3, 11, ADDRESS_MAP_NAME(program_2k), 7, ADDRESS_MAP_NAME(data_96x4), "upd553", __FILE__) + : ucom4_cpu_device(mconfig, NEC_D553, "uPD553", tag, owner, clock, NEC_UCOM43, 3 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_2k), 7 /* data width */, ADDRESS_MAP_NAME(data_96x4), "upd553", __FILE__) { } upd650_cpu_device::upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) @@ -124,6 +124,7 @@ void ucom4_cpu_device::device_start() m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ucom4_cpu_device::simple_timer_cb), this)); + // resolve callbacks m_read_a.resolve_safe(0xf); m_read_b.resolve_safe(0xf); m_read_c.resolve_safe(0xf); From 91f9ef9f43b3f81625cf3d5939acd9fca5993835 Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 7 Jun 2015 17:23:40 -0500 Subject: [PATCH 214/284] new PE+ Poker games New Games Added -------------------------------------------- Player's Edge Plus (PP0021) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (PP0048) Joker Poker [BrianT, Jim] Player's Edge Plus (PP0085) Joker Poker (Two Pair or Better) [BrianT, Jim] Player's Edge Plus (PP0089) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (PP0130) Aces and Faces [BrianT, Jim] Player's Edge Plus (PP0132) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (PP0150) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (PP0181) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (PP0223) Deuces Joker Wild Poker [BrianT, Jim] Player's Edge Plus (PP0401) 4 of a Kind Bonus Poker [BrianT, Jim] Player's Edge Plus (PP0467) 4 of a Kind Bonus Poker [BrianT, Jim] Player's Edge Plus (PP0550) Joker Poker (Two Pair or Better) [BrianT, Jim] Player's Edge Plus (PP0750) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (PP0757) Double Down Stud Joker Poker [BrianT, Jim] Player's Edge Plus (PP0764) 4 of a Kind Bonus Poker [BrianT, Jim] Player's Edge Plus (PP0812) Deuces Joker Wild Poker [BrianT, Jim] Player's Edge Plus (X000489P+XP000038) Double Down Stud Deuces Wild Poker [BrianT, Jim] Player's Edge Plus (X000557P+XP000038) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (X000578P+XP000038) Standard Draw Poker [BrianT, Jim] Player's Edge Plus (X002312P+XP000112) Triple Bonus Poker Plus [BrianT, Jim] Player's Edge Plus (X002412P+XP000096) Standard Draw Poker (5 Decks) [BrianT, Jim] New Clones Added -------------------------------------------- Player's Edge Plus (PP0291) Deuces Wild Poker (set 2) [BrianT, Jim] Player's Edge Plus (PP0040) Standard Draw Poker (set 2) [BrianT, Jim] Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker (set 2) [BrianT, Jim] Player's Edge Plus (PP0423) Standard Draw Poker (set 2) [BrianT, Jim] --- src/mame/arcade.lst | 29 ++ src/mame/drivers/peplus.c | 707 +++++++++++++++++++++++++++++++++++++- 2 files changed, 718 insertions(+), 18 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index 37706f94f41..f1399302274 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -11142,10 +11142,12 @@ pepp0009 // (c) 1987 IGT - International Game Technology pepp0010 // (c) 1987 IGT - International Game Technology pepp0014 // (c) 1987 IGT - International Game Technology pepp0014a // (c) 1987 IGT - International Game Technology +pepp0021 // (c) 1987 IGT - International Game Technology pepp0023 // (c) 1987 IGT - International Game Technology pepp0038 // (c) 1987 IGT - International Game Technology pepp0040 // (c) 1987 IGT - International Game Technology pepp0040a // (c) 1987 IGT - International Game Technology +pepp0040b // (c) 1987 IGT - International Game Technology pepp0041 // (c) 1987 IGT - International Game Technology pepp0042 // (c) 1987 IGT - International Game Technology pepp0043 // (c) 1987 IGT - International Game Technology @@ -11155,6 +11157,7 @@ pepp0045 // (c) 1987 IGT - International Game Technology pepp0046 // (c) 1987 IGT - International Game Technology pepp0046a // (c) 1987 IGT - International Game Technology pepp0046b // (c) 1987 IGT - International Game Technology +pepp0048 // (c) 1987 IGT - International Game Technology pepp0051 // (c) 1987 IGT - International Game Technology pepp0053 // (c) 1987 IGT - International Game Technology pepp0055 // (c) 1987 IGT - International Game Technology @@ -11171,6 +11174,8 @@ pepp0063 // (c) 1987 IGT - International Game Technology pepp0064 // (c) 1987 IGT - International Game Technology pepp0065 // (c) 1987 IGT - International Game Technology pepp0083 // (c) 1987 IGT - International Game Technology +pepp0085 // (c) 1987 IGT - International Game Technology +pepp0089 // (c) 1987 IGT - International Game Technology pepp0103 // (c) 1987 IGT - International Game Technology pepp0116 // (c) 1987 IGT - International Game Technology pepp0116a // (c) 1987 IGT - International Game Technology @@ -11180,6 +11185,9 @@ pepp0125 // (c) 1987 IGT - International Game Technology pepp0126 // (c) 1987 IGT - International Game Technology pepp0127 // (c) 1987 IGT - International Game Technology pepp0127a // (c) 1987 IGT - International Game Technology +pepp0130 // (c) 1987 IGT - International Game Technology +pepp0132 // (c) 1987 IGT - International Game Technology +pepp0150 // (c) 1987 IGT - International Game Technology pepp0158 // (c) 1987 IGT - International Game Technology pepp0158a // (c) 1987 IGT - International Game Technology pepp0158b // (c) 1987 IGT - International Game Technology @@ -11189,6 +11197,7 @@ pepp0159 // (c) 1987 IGT - International Game Technology pepp0171 // (c) 1987 IGT - International Game Technology pepp0171a // (c) 1987 IGT - International Game Technology pepp0178 // (c) 1987 IGT - International Game Technology +pepp0181 // (c) 1987 IGT - International Game Technology pepp0188 // (c) 1987 IGT - International Game Technology pepp0188a // (c) 1987 IGT - International Game Technology pepp0190 // (c) 1987 IGT - International Game Technology @@ -11197,6 +11206,7 @@ pepp0190b // (c) 1987 IGT - International Game Technology pepp0197 // (c) 1987 IGT - International Game Technology pepp0197a // (c) 1987 IGT - International Game Technology pepp0197b // (c) 1987 IGT - International Game Technology +pepp0197c // (c) 1987 IGT - International Game Technology pepp0203 // (c) 1987 IGT - International Game Technology pepp0203a // (c) 1987 IGT - International Game Technology pepp0203b // (c) 1987 IGT - International Game Technology @@ -11205,6 +11215,7 @@ pepp0203d // (c) 1987 IGT - International Game Technology pepp0219 // (c) 1987 IGT - International Game Technology pepp0221 // (c) 1987 IGT - International Game Technology pepp0221a // (c) 1987 IGT - International Game Technology +pepp0223 // (c) 1987 IGT - International Game Technology pepp0224 // (c) 1987 IGT - International Game Technology pepp0224a // (c) 1987 IGT - International Game Technology pepp0230 // (c) 1987 IGT - International Game Technology @@ -11218,13 +11229,18 @@ pepp0274 // (c) 1987 IGT - International Game Technology pepp0288 // (c) 1987 IGT - International Game Technology pepp0290 // (c) 1987 IGT - International Game Technology pepp0291 // (c) 1987 IGT - International Game Technology +pepp0291a // (c) 1987 IGT - International Game Technology +pepp0401 // (c) 1987 IGT - International Game Technology pepp0409 // (c) 1987 IGT - International Game Technology pepp0410 // (c) 1987 IGT - International Game Technology +pepp0410a // (c) 1987 IGT - International Game Technology pepp0417 // (c) 1987 IGT - International Game Technology pepp0417a // (c) 1987 IGT - International Game Technology pepp0419 // (c) 1987 IGT - International Game Technology pepp0420 // (c) 1987 IGT - International Game Technology pepp0423 // (c) 1987 IGT - International Game Technology +pepp0423a // (c) 1987 IGT - International Game Technology +pepp0423b // (c) 1987 IGT - International Game Technology pepp0426 // (c) 1987 IGT - International Game Technology pepp0428 // (c) 1987 IGT - International Game Technology pepp0429 // (c) 1987 IGT - International Game Technology @@ -11239,6 +11255,7 @@ pepp0452 // (c) 1987 IGT - International Game Technology pepp0454 // (c) 1987 IGT - International Game Technology pepp0455 // (c) 1987 IGT - International Game Technology pepp0458 // (c) 1987 IGT - International Game Technology +pepp0467 // (c) 1987 IGT - International Game Technology pepp0488 // (c) 1987 IGT - International Game Technology pepp0508 // (c) 1987 IGT - International Game Technology pepp0509 // (c) 1987 IGT - International Game Technology @@ -11258,6 +11275,7 @@ pepp0538 // (c) 1987 IGT - International Game Technology pepp0540 // (c) 1987 IGT - International Game Technology pepp0542 // (c) 1987 IGT - International Game Technology pepp0542a // (c) 1987 IGT - International Game Technology +pepp0550 // (c) 1987 IGT - International Game Technology pepp0568 // (c) 1987 IGT - International Game Technology pepp0585 // (c) 1987 IGT - International Game Technology pepp0713 // (c) 1987 IGT - International Game Technology @@ -11265,9 +11283,13 @@ pepp0725 // (c) 1987 IGT - International Game Technology pepp0725a // (c) 1987 IGT - International Game Technology pepp0726 // (c) 1987 IGT - International Game Technology pepp0728 // (c) 1987 IGT - International Game Technology +pepp0750 // (c) 1987 IGT - International Game Technology +pepp0757 // (c) 1987 IGT - International Game Technology pepp0760 // (c) 1987 IGT - International Game Technology pepp0763 // (c) 1987 IGT - International Game Technology +pepp0764 // (c) 1987 IGT - International Game Technology pepp0775 // (c) 1987 IGT - International Game Technology +pepp0812 // (c) 1987 IGT - International Game Technology pepp0816 // (c) 1987 IGT - International Game Technology peip0028 // (c) 1987 IGT - International Game Technology peip0029 // (c) 1987 IGT - International Game Technology @@ -11373,6 +11395,7 @@ pex0455p // (c) 1995 IGT - International Game Technology pex0458p // (c) 1995 IGT - International Game Technology pex0459p // (c) 1995 IGT - International Game Technology pex0459pa // (c) 1995 IGT - International Game Technology +pex0489p // (c) 1995 IGT - International Game Technology pex0508p // (c) 1995 IGT - International Game Technology pex0514p // (c) 1995 IGT - International Game Technology pex0515p // (c) 1995 IGT - International Game Technology @@ -11380,7 +11403,9 @@ pex0516p // (c) 1995 IGT - International Game Technology pex0536p // (c) 1995 IGT - International Game Technology pex0537p // (c) 1995 IGT - International Game Technology pex0550p // (c) 1995 IGT - International Game Technology +pex0557p // (c) 1995 IGT - International Game Technology pex0568p // (c) 1995 IGT - International Game Technology +pex0578p // (c) 1995 IGT - International Game Technology pex0588p // (c) 1995 IGT - International Game Technology pex0581p // (c) 1995 IGT - International Game Technology pex0725p // (c) 1995 IGT - International Game Technology @@ -11392,6 +11417,7 @@ pex2010p // (c) 1995 IGT - International Game Technology pex2016p // (c) 1995 IGT - International Game Technology pex2017p // (c) 1995 IGT - International Game Technology pex2018p // (c) 1995 IGT - International Game Technology +pex2021p // (c) 1995 IGT - International Game Technology pex2025p // (c) 1995 IGT - International Game Technology pex2026p // (c) 1995 IGT - International Game Technology pex2027p // (c) 1995 IGT - International Game Technology @@ -11440,15 +11466,18 @@ pex2306p // (c) 1995 IGT - International Game Technology pex2307p // (c) 1995 IGT - International Game Technology pex2308p // (c) 1995 IGT - International Game Technology pex2310p // (c) 1995 IGT - International Game Technology +pex2312p // (c) 1995 IGT - International Game Technology pex2314p // (c) 1995 IGT - International Game Technology pex2374p // (c) 1995 IGT - International Game Technology pex2377p // (c) 1995 IGT - International Game Technology pex2386p // (c) 1995 IGT - International Game Technology +pex2412p // (c) 1995 IGT - International Game Technology pex2419p // (c) 1995 IGT - International Game Technology pex2420p // (c) 1995 IGT - International Game Technology pex2421p // (c) 1995 IGT - International Game Technology pex2440p // (c) 1995 IGT - International Game Technology pex2461p // (c) 1995 IGT - International Game Technology +pex2474p // (c) 1995 IGT - International Game Technology pex2478p // (c) 1995 IGT - International Game Technology pex2479p // (c) 1995 IGT - International Game Technology pex2480p // (c) 1995 IGT - International Game Technology diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 8bb4f4a01c2..5cb883996b1 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -1614,6 +1614,23 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END +ROM_START( pepp0021 ) /* Normal board : Standard Draw Poker (PP0021) */ +/* +REQUIRES Progressive link which is not currently supported +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0021_723-703.u68", 0x00000, 0x10000, CRC(58f2a68b) SHA1(72c0a29016b17f7e308a9e9b2d724771b5e26560) ) /* Game Version: 520, Library Version: 516, Video Lib Ver: 516 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + ROM_START( pepp0023 ) /* Normal board : Tens or Better (PP0023) */ /* PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus) @@ -1678,7 +1695,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END -ROM_START( pepp0040a ) /* Normal board : Standard Draw Poker (PP0040) - Multi Regional / Multi Currency - Tournament Mode capable */ +ROM_START( pepp0040a ) /* Normal board : Standard Draw Poker (PP0040) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + WA 1 2 3 4 5 7 20 50 300 800 + % Range: 91.0-93.0% Optimum: 95.0% Hit Frequency: 45.5% + Programs Available: PP0040, X000040P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0040_979-a0c.u68", 0x00000, 0x10000, CRC(fef4fbfe) SHA1(9f07a2bee990181c9eb40e40b957aa9555ae2586) ) /* Game Version: 979, Library Version: A0C */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + +ROM_START( pepp0040b ) /* Normal board : Standard Draw Poker (PP0040) - Multi Regional / Multi Currency - Tournament Mode capable */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- @@ -1889,6 +1927,24 @@ PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END +ROM_START( pepp0048 ) /* Normal board : Joker Poker (PP0048) */ +/* + Programs Available: PP0048 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0048_554-544.u68", 0x00000, 0x8000, CRC(c728af7e) SHA1(b4b56bfa34d2b4df22a8e29fae9b8e8f7d708089) ) /* Game Version: 554, Library Version: 544, Video Lib Ver: 544 */ + ROM_RELOAD( 0x08000, 0x8000) /* 32K version built using earlier gaming libraries */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + ROM_START( pepp0051 ) /* Normal board : Joker Poker (PP0051) */ /* w/J w/oJ @@ -2247,6 +2303,51 @@ PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END +ROM_START( pepp0085 ) /* Normal board : Joker Poker (Two Pair or Better) - Double Up always enabled */ +/* + w/J w/oJ +PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) +----------------------------------------------------------- + NA 1 2 4 5 8 16 100 100 400 100 800 + % Range: 93.2-95.2% Optimum: 97.2% Hit Frequency: 30.1% + Programs Available: PP0085 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0085_539-530.u68", 0x00000, 0x8000, CRC(f5325205) SHA1(737b25567633eca65ece42601ab0f3cf264fe150) ) /* Game Version: 539, Library Version: 530, Video Lib Ver: 530 */ + ROM_RELOAD( 0x08000, 0x8000) /* 32K version built using earlier gaming libraries */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + +ROM_START( pepp0089 ) /* Normal board : Standard Draw Poker (PP0089) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + P11A 1 2 3 4 5 9 25 50 250 800 + % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5% + Programs Available: PP0089 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0089_554-544.u68", 0x00000, 0x8000, CRC(1d3e1b84) SHA1(354cfb5c00c9a4c9779bb56ff4541e58cedd442e) ) /* Game Version: 554, Library Version: 544, Video Lib Ver: 544 */ + ROM_RELOAD( 0x08000, 0x8000) /* 32K version built using earlier gaming libraries */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + ROM_START( pepp0103 ) /* Normal board : Deuces Wild Poker 1-100 Coin (PP0103) */ /* w/D w/oD @@ -2419,7 +2520,7 @@ ROM_START( pepp0127 ) /* Normal board : Deuces Joker Wild Poker (PP0127) */ Wild JKR Wild JKR PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus) --------------------------------------------------------------------- - P65N 1 2 3 3 3 6 9 12 25 800 1000 2000 + P65N 1 2 3 3 3 6 9 12 25 250 1000 2000 % Range: 95.1-97.1% Optimum: 99.1% Hit Frequency: 50.4% Programs Available: PP0127 */ @@ -2442,7 +2543,7 @@ ROM_START( pepp0127a ) /* Normal board : Deuces Joker Wild Poker (PP0127) - Mult Wild JKR Wild JKR PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus) --------------------------------------------------------------------- - P65N 1 2 3 3 3 6 9 12 25 800 1000 2000 + P65N 1 2 3 3 3 6 9 12 25 250 1000 2000 % Range: 95.1-97.1% Optimum: 99.1% Hit Frequency: 50.4% Programs Available: PP0127 */ @@ -2459,6 +2560,71 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus) ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) ) ROM_END +ROM_START( pepp0130 ) /* Normal board : Aces & Faces (PP0130) */ +/* + + 2-10 J-K +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +------------------------------------------------------------------ + ???? 1 2 3 4 5 8 25 40 80 50 250 800 + % Range: 95.3-97.3% Optimum: 99.3% Hit Frequency: 45.5% + Programs Available: PP0130 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0130_a4y-a6g.u68", 0x00000, 0x10000, CRC(bf9293f2) SHA1(79f5247a2d5447c89e281c618b09c7f7790176a2) ) /* Game Version: A4Y, Library Version: A6G */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg954.u72", 0x00000, 0x8000, CRC(1f9cd61e) SHA1(92a2ca3765ad4eeb7ab96538d4278e0a99d16638) ) + ROM_LOAD( "mgo-cg954.u73", 0x08000, 0x8000, CRC(ac1dd15d) SHA1(41ddbb05edc3d274a27d4938c29e6a1e7c785cd7) ) + ROM_LOAD( "mbo-cg954.u74", 0x10000, 0x8000, CRC(cfcb5740) SHA1(8a94536f3b4315c1e6a16a8e5043a80205a3aabe) ) + ROM_LOAD( "mxo-cg954.u75", 0x18000, 0x8000, CRC(94f63723) SHA1(f53867cc1c07235ff2aba1854459085dd0643c89) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap953.u50", 0x0000, 0x0100, CRC(6ece50ad) SHA1(bc5761303b09625850ba50263607d11871ea3ed3) ) +ROM_END + +ROM_START( pepp0132 ) /* Normal board : Standard Draw Poker (PP0132) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +--------------------------------------------------------- + CA 1 2 3 4 6 9 25 50 250 800 + % Range: 95.5-97.5% Optimum: 99.5% Hit Frequency: 45.5% + Programs Available: PP0132, PP0447, X000447P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0132_896-914.u68", 0x00000, 0x10000, CRC(ad888692) SHA1(cbc78c546b8f4dc136cc376a0b7aed10faacbac6) ) /* Game Version: 896, Library Version: 914 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + +ROM_START( pepp0150 ) /* Normal board : Standard Draw Poker (PP0150) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + KK 1 2 3 4 6 9 25 50 500 500 + % Range: 94.9-96.9% Optimum: 98.9% Hit Frequency: 45.5% + Programs Available: PP0150, X000150P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0150_a45-a74.u68", 0x00000, 0x10000, CRC(8848dc4b) SHA1(121e885d253aa3c2a72de9e14d64e20d794e53bf) ) /* Game Version: A45, Library Version: A74 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + ROM_START( pepp0158 ) /* Normal board : 4 of a Kind Bonus Poker (PP0158) - 03/17/97 @ IGT L97-0628 */ /* 5-K 2-4 @@ -2662,6 +2828,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K* SF RF (Bonus) ROM_LOAD( "cap953.u50", 0x0000, 0x0100, CRC(6ece50ad) SHA1(bc5761303b09625850ba50263607d11871ea3ed3) ) ROM_END +ROM_START( pepp0181 ) /* Normal board : Standard Draw Poker (PP0181) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + BA 1 2 3 4 5 8 25 50 250 800 + % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3% + Programs Available: PP0181 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0181_648-667.u68", 0x00000, 0x10000, CRC(b38ff1e1) SHA1(ae8d725a3352000c57cef4b7e7a39dbad940e9de) ) /* Game Version: 648, Library Version: 667 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + ROM_START( pepp0188 ) /* Normal board : Standard Draw Poker (PP0188) */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) @@ -2794,7 +2982,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END -ROM_START( pepp0197a ) /* Normal board : Standard Draw Poker (PP0197) */ +ROM_START( pepp0197a ) /* Normal board : Standard Draw Poker (PP0197) - 10/23/95 @ IGT L95-2452 */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- @@ -2803,7 +2991,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) Programs Available: PP0197, X000197P & PP0419 - Non Double-up Only */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "pp0197_919-a0c.u68", 0x00000, 0x10000, CRC(ae817534) SHA1(b2454609e8275aab00797966c0f4e68eae2911cd) ) /* Game Version: 919, Library Version: A0C */ + ROM_LOAD( "pp0197_a14-a2n.u68", 0x00000, 0x10000, CRC(ef472672) SHA1(785ce02b13894e5cb7575e75533451b96e3f4e6d) ) /* Game Version: A14, Library Version: A2N */ ROM_REGION( 0x020000, "gfx1", 0 ) ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) @@ -2816,7 +3004,29 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END -ROM_START( pepp0197b ) /* Normal board : Standard Draw Poker (Auto Hold in options) (PP0197) */ +ROM_START( pepp0197b ) /* Normal board : Standard Draw Poker (PP0197) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + BA 1 2 3 4 5 8 25 50 250 800 + % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3% + Programs Available: PP0197, X000197P & PP0419 - Non Double-up Only +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0197_979-a0c.u68", 0x00000, 0x10000, CRC(ae817534) SHA1(b2454609e8275aab00797966c0f4e68eae2911cd) ) /* Game Version: 979, Library Version: A0C */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + +ROM_START( pepp0197c ) /* Normal board : Standard Draw Poker (Auto Hold in options) (PP0197) */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- @@ -3016,6 +3226,31 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END +ROM_START( pepp0223 ) /* Normal board : Deuces Joker Wild Poker (PP0223) */ +/* + With w/o w/o With + Wild JKR Wild JKR +PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus) +--------------------------------------------------------------------- + P76N 1 1 3 3 3 6 9 12 25 250 1000 2000 + % Range: 89.6-91.6% Optimum: 93.6% Hit Frequency: 50.3% + Programs Available: PP0223 + +Internally the program erroneously reports a 92.80% return. Superseded by PP0812 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0223_984-a0r.u68", 0x00000, 0x10000, CRC(7254255a) SHA1(345d5d567bcd2af9b374a3345a10f9999c34b2b5) ) /* Game Version: 984, Library Version: A0R */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg1215.u72", 0x00000, 0x8000, CRC(425f57be) SHA1(6d53ae86bec7189a35671a7f691e101a2ed4d8c4) ) /* 06/09/93 @ IGT L93-1585 */ + ROM_LOAD( "mgo-cg1215.u73", 0x08000, 0x8000, CRC(0f66cd94) SHA1(9ac0cd01aca87e045c4fd6045ed907a092d6b2ee) ) + ROM_LOAD( "mbo-cg1215.u74", 0x10000, 0x8000, CRC(10f89e44) SHA1(cdc34970b0325a24cfd5c187a4b4dbf42be8fc93) ) + ROM_LOAD( "mxo-cg1215.u75", 0x18000, 0x8000, CRC(73c24e43) SHA1(f09beaf374ad371db2701767ce6ac5bdb13c445a) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) ) +ROM_END + ROM_START( pepp0224 ) /* Normal board : Deuces Wild Poker (No Double-up) (PP0224) */ /* w/D w/oD @@ -3303,6 +3538,50 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) ) ROM_END +ROM_START( pepp0291a ) /* Normal board : Deuces Wild Poker (No Double-up) (PP0291) */ +/* + w/D w/oD +PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) +------------------------------------------------------------ + P62A 1 2 3 4 4 9 15 25 200 250 800 + % Range: 94.9-96.9% Optimum: 98.9% Hit Frequency: 44.4% + Programs Available: PP0125, PP0418, X000291P & PP0291 - Non Double-up Only +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0291_961-984.u68", 0x00000, 0x10000, CRC(64c83e70) SHA1(1c75c7c37a359d07b170ab644ebb98d4bce2affe) ) /* Game Version: 961, Library Version: 984 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg1215.u72", 0x00000, 0x8000, CRC(425f57be) SHA1(6d53ae86bec7189a35671a7f691e101a2ed4d8c4) ) /* 06/09/93 @ IGT L93-1585 */ + ROM_LOAD( "mgo-cg1215.u73", 0x08000, 0x8000, CRC(0f66cd94) SHA1(9ac0cd01aca87e045c4fd6045ed907a092d6b2ee) ) + ROM_LOAD( "mbo-cg1215.u74", 0x10000, 0x8000, CRC(10f89e44) SHA1(cdc34970b0325a24cfd5c187a4b4dbf42be8fc93) ) + ROM_LOAD( "mxo-cg1215.u75", 0x18000, 0x8000, CRC(73c24e43) SHA1(f09beaf374ad371db2701767ce6ac5bdb13c445a) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) ) +ROM_END + +ROM_START( pepp0401 ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) (PP0401) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +------------------------------------------------------------------ + P90A 1 2 3 4 5 8 25 40 80 50 250 800 + % Range: 94.0-96.0% Optimum: 98.0% Hit Frequency: 45.5% + Programs Available: PP0401 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0401_789-812.u68", 0x00000, 0x10000, CRC(caad4496) SHA1(cecb469d318f25a3ad49eb0014b57f61e54183c6) ) /* Game Version: 789, Library Version: 812 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */ + ROM_LOAD( "mgo-cg2003.u73", 0x08000, 0x8000, CRC(add0afc4) SHA1(0519bf2f36cb67140933b2c533e625544f27d16b) ) + ROM_LOAD( "mbo-cg2003.u74", 0x10000, 0x8000, CRC(8649dec0) SHA1(0024d3a8fd85279552910b14b69b225bda93957f) ) + ROM_LOAD( "mxo-cg2003.u75", 0x18000, 0x8000, CRC(904631cd) SHA1(d280a2f16b51a04b3f601db3535980a765c60e6f) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ +ROM_END + ROM_START( pepp0409 ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) (PP0409) */ /* 5-K 2-4 @@ -3329,6 +3608,28 @@ ROM_START( pepp0410 ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) ( /* 5-K 2-4 PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +------------------------------------------------------------------ + P101A 1 2 3 4 5 6 25 40 80 50 250 800 + % Range: 92.5-94.5% Optimum: 96.9% Hit Frequency: 45.5% + Programs Available: PP0265, X000265P, PP0403 & PP0410 - Non Double-up Only +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0410_a46-a75.u68", 0x00000, 0x10000, CRC(41e904ae) SHA1(b63a47c91b9f76f11bd14ccb16dbb4ac86fe7926) ) /* Game Version: A46, Library Version: A75, Game Lib ver: A0Y */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */ + ROM_LOAD( "mgo-cg2003.u73", 0x08000, 0x8000, CRC(add0afc4) SHA1(0519bf2f36cb67140933b2c533e625544f27d16b) ) + ROM_LOAD( "mbo-cg2003.u74", 0x10000, 0x8000, CRC(8649dec0) SHA1(0024d3a8fd85279552910b14b69b225bda93957f) ) + ROM_LOAD( "mxo-cg2003.u75", 0x18000, 0x8000, CRC(904631cd) SHA1(d280a2f16b51a04b3f601db3535980a765c60e6f) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ +ROM_END + +ROM_START( pepp0410a ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) (PP0410) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ------------------------------------------------------------------ P101A 1 2 3 4 5 6 25 40 80 50 250 800 % Range: 92.5-94.5% Optimum: 96.9% Hit Frequency: 45.5% @@ -3436,6 +3737,48 @@ ROM_END ROM_START( pepp0423 ) /* Normal board : Standard Draw Poker (No Double-up) (PP0423) */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + P11A 1 2 3 4 5 9 25 50 250 800 + % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5% + Programs Available: PP0423 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0423_a45-a74.u68", 0x00000, 0x10000, CRC(b717bb0f) SHA1(89243bec0dc5b2c3907ef6579dfc3fdd28977971) ) /* Game Version: A45, Library Version: A74 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + +ROM_START( pepp0423a ) /* Normal board : Standard Draw Poker (No Double-up) (PP0423) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + P11A 1 2 3 4 5 9 25 50 250 800 + % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5% + Programs Available: PP0423 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0423_896-914.u68", 0x00000, 0x10000, CRC(c996c539) SHA1(3874c294f4d223596ab537634aaf52bc0494ff85) ) /* Game Version: 896, Library Version: 914 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) + ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) ) + ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) ) + ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + +ROM_START( pepp0423b ) /* Normal board : Standard Draw Poker (No Double-up) (PP0423) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- P11A 1 2 3 4 5 9 25 50 250 800 % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5% @@ -3592,7 +3935,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) --------------------------------------------------------- CA 1 2 3 4 6 9 25 50 250 800 % Range: 95.5-97.5% Optimum: 99.5% Hit Frequency: 45.5% - Programs Available: PP0447, X000447P + Programs Available: PP0132, PP0447, X000447P */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "pp0447_a45-a74.u68", 0x00000, 0x10000, CRC(0ef0bb6c) SHA1(d0ef7a83417054f05d32d0a93ed0d5d618f4dfb9) ) /* Game Version: A45, Library Version: A74 */ @@ -3757,6 +4100,26 @@ PayTable As 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END +ROM_START( pepp0467 ) /* Normal board : Uknown Bonus Poker (PP0455) */ +/* +PayTable Js+ 2P 3K STR FL FH 4K ?? SF RF (Bonus) +----------------------------------------------------------- + ???? 1 2 3 4 5 8 25 25 50 250 800 + Programs Available: PP0467 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0467_823-851.u68", 0x00000, 0x10000, CRC(b19d48ae) SHA1(8a27a791e6f132d70d1ea02860e11fedb8515989) ) /* Game Version: 823, Library Version: 851 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2004.u72", 0x00000, 0x8000, CRC(e5e40ea5) SHA1(e0d9e50b30cc0c25c932b2bf444990df1fb2c38c) ) /* 08/31/94 @ IGT L95-0146 */ + ROM_LOAD( "mgo-cg2004.u73", 0x08000, 0x8000, CRC(12607f1e) SHA1(248e1ecee4e735f5943c50f8c350ca95b81509a7) ) + ROM_LOAD( "mbo-cg2004.u74", 0x10000, 0x8000, CRC(78c3fb9f) SHA1(2b9847c511888de507a008dec981778ca4dbcd6c) ) /* Supersedes CG740 */ + ROM_LOAD( "mxo-cg2004.u75", 0x18000, 0x8000, CRC(5aaa4480) SHA1(353c4ce566c944406fce21f2c5045c856ef7a609) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ +ROM_END + ROM_START( pepp0488 ) /* Normal board : Standard Draw Poker (PP0488) - 01/12/95 @ IGT L95-0175 */ /* PayTable Js+ TP 3K STR FL FH 4K SF RF (Bonus) @@ -4173,6 +4536,28 @@ PayTable As 2PR 3K STR FL FH 4K SF RF 5K RF (Bonus) ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ ROM_END +ROM_START( pepp0550 ) /* Normal board : Joker Poker (Two Pair or Better) (PP0550) */ +/* + w/J w/oJ +PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) +----------------------------------------------------------- + NA 1 2 4 5 8 16 100 100 400 100 800 + % Range: 93.2-95.2% Optimum: 97.2% Hit Frequency: 30.1% + Programs Available: PP0550, X000550P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0585_a6k-a9g.u68", 0x00000, 0x10000, CRC(1de4ee32) SHA1(0e06a43e7e3988cc2fddd1a57af724f5421d2ca4) ) /* Game Version: A6K, Library Version: A9G */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2004.u72", 0x00000, 0x8000, CRC(e5e40ea5) SHA1(e0d9e50b30cc0c25c932b2bf444990df1fb2c38c) ) /* 08/31/94 @ IGT L95-0146 */ + ROM_LOAD( "mgo-cg2004.u73", 0x08000, 0x8000, CRC(12607f1e) SHA1(248e1ecee4e735f5943c50f8c350ca95b81509a7) ) + ROM_LOAD( "mbo-cg2004.u74", 0x10000, 0x8000, CRC(78c3fb9f) SHA1(2b9847c511888de507a008dec981778ca4dbcd6c) ) /* Supersedes CG740 */ + ROM_LOAD( "mxo-cg2004.u75", 0x18000, 0x8000, CRC(5aaa4480) SHA1(353c4ce566c944406fce21f2c5045c856ef7a609) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ +ROM_END + ROM_START( pepp0568 ) /* Normal board : Joker Poker (PP0568) */ /* w/J w/oJ @@ -4326,6 +4711,41 @@ P437A/4K/5 1 1 3 4 5 6 50 80 160 50 250 800 ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ ROM_END +ROM_START( pepp0750 ) /* Normal board : Standard Draw Poker (PP0750) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + KQ 1 2 3 4 6 9 25 50 500 625 + % Range: 95.1-97.1% Optimum: 99.1% Hit Frequency: 45.5% + Programs Available: PP0750 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0750_979-a0c.u68", 0x00000, 0x10000, CRC(2224c865) SHA1(6080c29d69c847603b79b7b15f65b32e36d305d8) ) /* Game Version: 979, Library Version: A0C */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2004.u72", 0x00000, 0x8000, CRC(e5e40ea5) SHA1(e0d9e50b30cc0c25c932b2bf444990df1fb2c38c) ) /* 08/31/94 @ IGT L95-0146 */ + ROM_LOAD( "mgo-cg2004.u73", 0x08000, 0x8000, CRC(12607f1e) SHA1(248e1ecee4e735f5943c50f8c350ca95b81509a7) ) + ROM_LOAD( "mbo-cg2004.u74", 0x10000, 0x8000, CRC(78c3fb9f) SHA1(2b9847c511888de507a008dec981778ca4dbcd6c) ) /* Supersedes CG740 */ + ROM_LOAD( "mxo-cg2004.u75", 0x18000, 0x8000, CRC(5aaa4480) SHA1(353c4ce566c944406fce21f2c5045c856ef7a609) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ +ROM_END + +ROM_START( pepp0757 ) /* Normal board : Double Down Stud Joker Poker (PP0757) */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0757_a5v-a6d.u68", 0x00000, 0x10000, CRC(dcf3004f) SHA1(c095a874a8813f7100ec430e034530eeb93c4117) ) /* Game Version: A5V, Library Version: A6D */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2015.u72", 0x00000, 0x8000, CRC(7f73ee5c) SHA1(b6c5d423c8176555c1f32605c328ffbfcf94b656) ) /* Verified CG set for PP0760 set */ + ROM_LOAD( "mgo-cg2015.u73", 0x08000, 0x8000, CRC(de270e0e) SHA1(41b207f9380f623ab64dc42224275cccd43417ee) ) + ROM_LOAD( "mbo-cg2015.u74", 0x10000, 0x8000, CRC(02e623d9) SHA1(4c689293f5c5a8eb0b17861cf433ae1e01d83545) ) + ROM_LOAD( "mxo-cg2015.u75", 0x18000, 0x8000, CRC(0c96b7fc) SHA1(adde93f08db0b957daf77d57a7ab60af3b667f25) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ +ROM_END + ROM_START( pepp0760 ) /* Normal board : Double Down Stud Poker (PP0760) */ /* PayTable 8s-10s Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) @@ -4367,6 +4787,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ ROM_END +ROM_START( pepp0764 ) /* Normal board : 4 of a Kind Bonus Poker (PP0764) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +------------------------------------------------------------------ + P596A 1 1 3 6 8 10 25 40 80 50 250 800 + % Range: 91.8-93.8% Optimum: 95.8% Hit Frequency: 42.3% + Programs Available: PP0764, X000764P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0764_a46-a75.u68", 0x00000, 0x10000, CRC(9176732a) SHA1(4a9898334aa76c483757addb3a28ace71b008c7e) ) /* Game Version: A46, Library Version: A75, Game Lib ver: A0Y */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */ + ROM_LOAD( "mgo-cg2003.u73", 0x08000, 0x8000, CRC(add0afc4) SHA1(0519bf2f36cb67140933b2c533e625544f27d16b) ) + ROM_LOAD( "mbo-cg2003.u74", 0x10000, 0x8000, CRC(8649dec0) SHA1(0024d3a8fd85279552910b14b69b225bda93957f) ) + ROM_LOAD( "mxo-cg2003.u75", 0x18000, 0x8000, CRC(904631cd) SHA1(d280a2f16b51a04b3f601db3535980a765c60e6f) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */ +ROM_END + ROM_START( pepp0775 ) /* Normal board : Royal Deuces Poker or Royal Sevens Poker?? (PP0775) */ /* Paytable for Royal Deuces lined up with paytable from PP0775: @@ -4395,6 +4837,29 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) ROM_LOAD( "capx2312.u43", 0x0000, 0x0200, CRC(66971da6) SHA1(6984a68bc2f01009ad6a7a0705c00e715c29bb65) ) ROM_END +ROM_START( pepp0812 ) /* Normal board : Deuces Joker Wild Poker (PP0812) */ +/* + With w/o w/o With + Wild JKR Wild JKR +PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus) +--------------------------------------------------------------------- + P76N 1 1 3 3 3 6 9 12 25 250 1000 2000 + % Range: 89.6-91.6% Optimum: 93.6% Hit Frequency: 50.3% + Programs Available: PP0812 +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pp0812_a47-a76.u68", 0x00000, 0x10000, CRC(0de2a7ec) SHA1(fedb8da0608328a9d33e46af18de25004b1d03de) ) /* Game Version: A47, Library Version: A76 */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg1215.u72", 0x00000, 0x8000, CRC(425f57be) SHA1(6d53ae86bec7189a35671a7f691e101a2ed4d8c4) ) /* 06/09/93 @ IGT L93-1585 */ + ROM_LOAD( "mgo-cg1215.u73", 0x08000, 0x8000, CRC(0f66cd94) SHA1(9ac0cd01aca87e045c4fd6045ed907a092d6b2ee) ) + ROM_LOAD( "mbo-cg1215.u74", 0x10000, 0x8000, CRC(10f89e44) SHA1(cdc34970b0325a24cfd5c187a4b4dbf42be8fc93) ) + ROM_LOAD( "mxo-cg1215.u75", 0x18000, 0x8000, CRC(73c24e43) SHA1(f09beaf374ad371db2701767ce6ac5bdb13c445a) ) + + ROM_REGION( 0x100, "proms", 0 ) + ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) ) +ROM_END + ROM_START( pepp0816 ) /* Normal board : Treasure Chest Poker (PP0816) */ /* PayTable Js+ 2PR 3K STR FL FH 4K* SF RF (Bonus) @@ -6715,10 +7180,36 @@ PayTable Ks+ 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) ROM_LOAD( "x000459p.u66", 0x00000, 0x10000, CRC(03cef341) SHA1(3813c4781ca6d164880f6d06a7d6dbae29012e7d) ) /* Joker Poker */ ROM_REGION( 0x020000, "gfx1", 0 ) - ROM_LOAD( "mro-cg2296.u77", 0x00000, 0x8000, CRC(d0d92665) SHA1(2c686ee28b69ff975951ccafd8e5030fde640773) ) /* Slovenia + XP000155 */ - ROM_LOAD( "mgo-cg2296.u78", 0x08000, 0x8000, CRC(d05fd16e) SHA1(f66b5ba8b4cf4f97ed46ec44cef43fed29bdd492) ) - ROM_LOAD( "mbo-cg2296.u79", 0x10000, 0x8000, CRC(6db6a435) SHA1(7ea0d6df1f7e0c4fe389437bf04d1f5a798c68ef) ) - ROM_LOAD( "mxo-cg2296.u80", 0x18000, 0x8000, CRC(4faeb79e) SHA1(f69277b729ba88860efc6b9a3d4956f245cc2943) ) + ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) ) + ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) ) + ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) ) + ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + +ROM_START( pex0489p ) /* Superboard : Double Down Stud Deuces Wild Poker (X000489P+XP000038) */ +/* + + w/D w/oD +PayTable Ks+ 2P 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) +----------------------------------------------------------------------- + ???? 1 1 2 3 4 5 6 12 15 100 400 1000 2000 + % Range: 91.3-93.3% Optimum: 95.3% Hit Frequency: 45.3% + Programs Available: PP0489, X000489P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* Errors with INCOMPATIBLE EPROM error, no dumped program works with this DATA set */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x000489p.u66", 0x00000, 0x10000, CRC(73d21c66) SHA1(0f863037a34549f4255dedda70b4401d288eee01) ) /* Double Down Stud Deuces Wild Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */ + ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) ) + ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) ) + ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) ) ROM_REGION( 0x200, "proms", 0 ) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) @@ -6883,7 +7374,7 @@ PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) ----------------------------------------------------------- NA 1 2 4 5 8 16 100 100 400 100 800 % Range: 93.2-95.2% Optimum: 97.2% Hit Frequency: 30.1% - Programs Available: X000550P + Programs Available: PP0550, X000550P Internally the program erroneously reports a 95.50% return. Superseded by X002338P @@ -6904,6 +7395,30 @@ Internally the program erroneously reports a 95.50% return. Superseded by X00233 ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex0557p ) /* Superboard : Standard Draw Poker (X000557P+XP000038) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + WA 1 2 3 4 5 7 20 50 300 800 + % Range: 91.0-93.0% Optimum: 95.0% Hit Frequency: 45.5% + Programs Available: X000557P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x000557p.u66", 0x00000, 0x10000, CRC(98c16858) SHA1(d428ae712b7ee45ce6e4f7d9b1c75687655be140) ) /* Standard Draw Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */ + ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) ) + ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) ) + ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex0568p ) /* Superboard : Joker Poker (X000568P+XP000038) */ /* w/J w/oJ @@ -6929,6 +7444,30 @@ PayTable Ks+ 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex0578p ) /* Superboard : Standard Draw Poker (X000578P+XP000038) */ +/* +PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) +---------------------------------------------------------- + BA 1 2 3 4 5 8 25 50 250 1000 + % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3% + Programs Available: X000578P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x000578p.u66", 0x00000, 0x10000, CRC(08f34909) SHA1(b6f2f5b0aab289bb51cb67c85f0db0411321a2ae) ) /* Standard Draw Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */ + ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) ) + ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) ) + ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex0581p ) /* Superboard : 4 of a Kind Bonus Poker (X000581P+XP000038) */ /* 5-K 2-4 @@ -7204,6 +7743,34 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2021p ) /* Superboard : Lucky Deal Poker (X002021P+XP000112) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P566AL 1 1 3 5 7 10 25 40 80 50 250 800 + % Range: 94.2-98.2% Optimum: 98.2% Hit Frequency: 43.0% + Programs Available: X002021P + +Straights or Better on the initial deal PAY DOUBLE! + +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000112.u67", 0x00000, 0x10000, CRC(c1ae96ad) SHA1(da109602f0fbe9b225cdcd60be0613fd41014864) ) + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002021p.u66", 0x00000, 0x10000, CRC(bf7f6f41) SHA1(c04fcab15da546929f8e15037f33cd99da4ae286) ) /* Lucky Deal Poker */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) ) + ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) ) + ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) ) + ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2025p ) /* Superboard : Deuces Wild Bonus Poker (X002025P+XP000019) */ /* w/D 6-K 3-5 w/A w/oD @@ -8461,6 +9028,31 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A A,2-4 2-4 SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2312p ) /* Superboard : Triple Bonus Poker Plus (X002312P+XP000112) */ +/* + 5-K 2-4 +PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) +----------------------------------------------------------------- + P919BA 1 1 3 4 5 8 50 120 240 100 250 800 + % Range: 94.7-96.7% Optimum: 98.7% Hit Frequency: 44.7% + Programs Available: X002312P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000112.u67", 0x00000, 0x10000, CRC(c1ae96ad) SHA1(da109602f0fbe9b225cdcd60be0613fd41014864) ) + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002312p.u66", 0x00000, 0x10000, CRC(d3b405b5) SHA1(321ce89a12c7d4849379731f45482c567c25b3a1) ) /* Triple Bonus Poker Plus */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) ) + ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) ) + ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) ) + ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2314p ) /* Superboard : Triple Bonus Poker Plus (X002314P+XP000112) */ /* 5-K 2-4 @@ -8561,6 +9153,27 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2412p ) /* Superboard : Standard Draw with 5 decks (X002412P+XP000096) */ +/* + % Range: 93.7-95.7% Optimum: 97.7% Hit Frequency: 44.6% + Programs Available: X002412P +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000096.u67", 0x00000, 0x10000, CRC(5aca14e1) SHA1(13bcb8069f9d704983632bb60db119f7308f9d80) ) + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002412p.u66", 0x00000, 0x10000, CRC(43c250d1) SHA1(868a8ab1795b05c2e57a9b8bf3b2b6be688783e9) ) /* Deuces Wild Bonus Poker - French */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2315.u77", 0x00000, 0x8000, CRC(2c2bb000) SHA1(46135803c9a3066aaaccbf998d91ae3270ab99c4) ) + ROM_LOAD( "mgo-cg2315.u78", 0x08000, 0x8000, CRC(0be4e10e) SHA1(e050f0386edf6810d8bebaeb442eb9386af1b86f) ) + ROM_LOAD( "mbo-cg2315.u79", 0x10000, 0x8000, CRC(0942c045) SHA1(1ce6a0b32eaea64f27d4ee998716e0fddb64baf4) ) + ROM_LOAD( "mxo-cg2315.u80", 0x18000, 0x8000, CRC(93e3b230) SHA1(7a672fa5bef43208e3870e51e29c3c7b1d02e262) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx2315.u43", 0x0000, 0x0200, CRC(690869af) SHA1(e057ce63a687f566d3ef181ac1829107073783f7) ) +ROM_END + ROM_START( pex2419p ) /* Superboard : Deuces Wild Bonus Poker - French (X002419P+XP000064) */ /* Same payouts as X002027P English Deuces Wild Bonus Poker: @@ -8692,6 +9305,35 @@ PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) ROM_END +ROM_START( pex2474p ) /* Superboard : Double Double Bonus Plus (X002474P+XP000038) */ +/* + 2-4 + JJJ55 66633 222AA 4K 4A + QQQ55 88844 5-K 2-4 or with with +PayTable Js+ 2PR 3K STR FL FH KKK55 TTT55 4K 4K 44422 4A A,2-4 2-4 SF RF (Bonus) +-------------------------------------------------------------------------------------------------- + P505A 1 1 3 4 5 7 25 25 50 80 85 160 160 400 50 250 800 + % Range: 94.1-96.1% Optimum: 98.1% Hit Frequency: 44.8% + Programs Available: X002474P + +NOTE: This DATA rom is compatible with the Multi-Poker XMP00030 + CG2451 set below +*/ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* Errors with INCOMPATIBLE EPROM error, no dumped program works with this DATA set */ + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "x002474p.u66", 0x00000, 0x10000, CRC(74cc1423) SHA1(0522cee3a7e123ce51739c69f38915ca92bd03e5) ) /* Double Double Bonus Plus */ + + ROM_REGION( 0x020000, "gfx1", 0 ) + ROM_LOAD( "mro-cg2275.u77", 0x00000, 0x8000, CRC(15d5d6b8) SHA1(61b6821d4cc059732bc3831bf19bf01aa3910b31) ) + ROM_LOAD( "mgo-cg2275.u78", 0x08000, 0x8000, CRC(bcb49579) SHA1(d5d9f523304582fa6f0a0c69aade77629bdec006) ) + ROM_LOAD( "mbo-cg2275.u79", 0x10000, 0x8000, CRC(9f893787) SHA1(0b79d5cbac920394d5f5c04d0d9d3727e0060366) ) + ROM_LOAD( "mxo-cg2275.u80", 0x18000, 0x8000, CRC(6187c68b) SHA1(7777b141fd1379d37d93a228b2e2159476c2b89e) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) +ROM_END + ROM_START( pex2478p ) /* Superboard : Joker Poker - French (X002478P+XP000154) */ /* w/J w/oJ @@ -9275,7 +9917,7 @@ Jacks or Better CA 99.50% Double Bonus Poker P323A 99.10% */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "xmp00006.u67", 0x00000, 0x10000, CRC(d61f1677) SHA1(2eca1315d6aa310a54de2dfa369e443a07495b76) ) /* 07/25/96 @ IGT L96-2041 - Linkable Progressive */ + ROM_LOAD( "xmp00020.u67", 0x00000, 0x10000, CRC(0f6d0706) SHA1(fccf6c93daab0694d1e35e7cdd6bae303a3fddd9) ) /* Known to be found with XMP00003, XMP00006 or XMP00024 programs */ ROM_REGION( 0x10000, "user1", 0 ) @@ -9697,10 +10339,12 @@ GAMEL(1987, pepp0009, pepp0002, peplus, peplus_poker, peplus_state, nonplus, GAMEL(1987, pepp0010, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0010) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0014, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0014) Standard Draw Poker (International)", 0, layout_pe_poker ) GAMEL(1987, pepp0014a, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0014) Standard Draw Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0021, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0021) Standard Draw Poker", GAME_NOT_WORKING, layout_pe_poker) /* Progressive with link ONLY */ GAMEL(1987, pepp0023, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0023) 10's or Better", 0, layout_pe_poker ) GAMEL(1987, pepp0038, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0038) Standard Draw Poker", 0, layout_pe_poker ) -GAMEL(1987, pepp0040, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker", 0, layout_pe_poker ) -GAMEL(1987, pepp0040a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (International)", 0, layout_pe_poker ) +GAMEL(1987, pepp0040, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (set 1)", 0, layout_pe_poker ) +GAMEL(1987, pepp0040a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (set 2)", 0, layout_pe_poker ) +GAMEL(1987, pepp0040b, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (International)", 0, layout_pe_poker ) GAMEL(1987, pepp0041, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0041) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0042, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0042) 10's or Better", 0, layout_pe_poker ) GAMEL(1987, pepp0043, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0043) 10's or Better", 0, layout_pe_poker ) @@ -9710,6 +10354,7 @@ GAMEL(1987, pepp0045, pepp0002, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0046, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0046) 10's or Better (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0046a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0046) 10's or Better (International)",0, layout_pe_poker ) GAMEL(1987, pepp0046b, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0046) 10's or Better (set 2)", 0, layout_pe_poker ) +GAMEL(1987, pepp0048, pepp0053, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0048) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0051, pepp0053, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0051) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0053, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0053) Joker Poker (Aces or Better)", 0, layout_pe_poker ) GAMEL(1987, pepp0055, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0055) Deuces Wild Poker (set 1)", 0, layout_pe_poker ) @@ -9726,6 +10371,8 @@ GAMEL(1987, pepp0063, pepp0002, peplus, peplus_poker, peplus_state, nonplus, GAMEL(1987, pepp0064, pepp0053, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0064) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0065, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0065) Joker Poker (Aces or Better)", 0, layout_pe_poker ) GAMEL(1987, pepp0083, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0083) 10's or Better", 0, layout_pe_poker ) +GAMEL(1987, pepp0085, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0085) Joker Poker (Two Pair or Better)", 0, layout_pe_poker ) +GAMEL(1987, pepp0089, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0089) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0103, pepp0055, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0103) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0116, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0116) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0116a, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0116) Standard Draw Poker (Mirage)", 0, layout_pe_poker ) @@ -9735,6 +10382,9 @@ GAMEL(1987, pepp0125, pepp0055, peplus, peplus_poker, peplus_state, nonplus, GAMEL(1987, pepp0126, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0126) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0127, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0127) Deuces Joker Wild Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0127a, pepp0127, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0127) Deuces Joker Wild Poker (International)", 0, layout_pe_poker ) +GAMEL(1987, pepp0130, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0130) Aces and Faces", 0, layout_pe_poker ) +GAMEL(1987, pepp0132, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0132) Standard Draw Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0150, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0150) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0158, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0158a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0158b, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker (set 3)", 0, layout_pe_poker ) @@ -9744,6 +10394,7 @@ GAMEL(1987, pepp0159, pepp0002, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0171, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0171) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0171a, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0171) Joker Poker (International)", 0, layout_pe_poker ) GAMEL(1987, pepp0178, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0178) 4 of a Kind Bonus Poker (Operator selectable special 4 of a Kind)", 0, layout_pe_poker ) +GAMEL(1987, pepp0181, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0181) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0188, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0188) Standard Draw Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0188a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0188) Standard Draw Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0190, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0190) Deuces Wild Poker (set 1)", 0, layout_pe_poker ) @@ -9752,6 +10403,7 @@ GAMEL(1987, pepp0190b, pepp0055, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0197, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0197a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0197b, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 3)", 0, layout_pe_poker ) +GAMEL(1987, pepp0197c, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 4)", 0, layout_pe_poker ) GAMEL(1987, pepp0203, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0203) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0203a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0203) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0203b, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0203) 4 of a Kind Bonus Poker (set 3)", 0, layout_pe_poker ) @@ -9760,6 +10412,7 @@ GAMEL(1987, pepp0203d, pepp0158, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0219, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0219) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0221, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0221) Standard Draw Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0221a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0221) Standard Draw Poker (set 2)", 0, layout_pe_poker ) +GAMEL(1987, pepp0223, pepp0127, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0223) Deuces Joker Wild Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0224, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0224) Deuces Wild Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0224a, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0224) Deuces Wild Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0230, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0230) Standard Draw Poker", 0, layout_pe_poker ) @@ -9772,14 +10425,19 @@ GAMEL(1987, pepp0265b, pepp0158, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0274, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0274) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0288, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0288) Standard Draw Poker (Spanish)", 0, layout_pe_poker ) GAMEL(1987, pepp0290, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0290) Deuces Wild Poker", 0, layout_pe_poker ) -GAMEL(1987, pepp0291, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0291) Deuces Wild Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0291, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0291) Deuces Wild Poker (set 1)", 0, layout_pe_poker ) +GAMEL(1987, pepp0291a, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0291) Deuces Wild Poker (set 2)", 0, layout_pe_poker ) +GAMEL(1987, pepp0401, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0401) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0409, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0409) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) -GAMEL(1987, pepp0410, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0410, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker ) +GAMEL(1987, pepp0410a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0417, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0417) Deuces Wild Poker (set 1)", 0, layout_pe_poker ) GAMEL(1987, pepp0417a, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0417) Deuces Wild Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0419, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0419) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0420, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0420) Standard Draw Poker", 0, layout_pe_poker ) -GAMEL(1987, pepp0423, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0423, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker (set 1)", 0, layout_pe_poker ) +GAMEL(1987, pepp0423a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker (set 2)", 0, layout_pe_poker ) +GAMEL(1987, pepp0423b, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker (set 3)", 0, layout_pe_poker ) GAMEL(1987, pepp0426, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0426) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0428, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0428) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0429, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0429) Joker Poker (Aces or Better, set 1)", 0, layout_pe_poker ) @@ -9793,6 +10451,7 @@ GAMEL(1987, pepp0449a, pepp0002, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0452, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0452) Double Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0454, pepp0434, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0454) Bonus Poker Deluxe", 0, layout_pe_poker ) GAMEL(1987, pepp0455, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0455) Joker Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0467, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0467) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0458, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0458) Joker Poker (Aces or Better)", 0, layout_pe_poker ) GAMEL(1985, pepp0488, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0488) Standard Draw Poker (Arizona Charlie's)", 0, layout_pe_poker ) GAMEL(1987, pepp0508, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0508) Loose Deuce Deuces Wild! Poker",0, layout_pe_poker ) @@ -9813,6 +10472,7 @@ GAMEL(1987, pepp0538, pepp0514, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0540, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0540) Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0542, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0542) One Eyed Jacks Wild Poker (CG2243)", 0, layout_pe_poker ) GAMEL(1987, pepp0542a, pepp0542, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0542) One Eyed Jacks Wild Poker (CG2020)", 0, layout_pe_poker ) +GAMEL(1987, pepp0550, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0550) Joker Poker (Two Pair or Better)", 0, layout_pe_poker ) GAMEL(1987, pepp0568, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0568) Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0585, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0585) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0713, pepp0434, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0713) Bonus Poker Deluxe", 0, layout_pe_poker ) @@ -9820,9 +10480,13 @@ GAMEL(1987, pepp0725, pepp0514, peplus, peplus_poker, peplus_state, peplus, GAMEL(1987, pepp0725a, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0725) Double Bonus Poker (set 2)", 0, layout_pe_poker ) GAMEL(1987, pepp0726, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0726) Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0728, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0728) Double Bonus Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0750, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0750) Standard Draw Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0757, pepp0250, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0757) Double Down Stud Joker Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0760, pepp0250, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0760) Double Down Stud Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0763, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0763) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) +GAMEL(1987, pepp0764, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0764) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0775, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0775) Royal Deuces Poker??", GAME_IMPERFECT_GRAPHICS, layout_pe_poker ) /* Wrong CG graphics & CAP */ +GAMEL(1987, pepp0812, pepp0127, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0812) Deuces Joker Wild Poker", 0, layout_pe_poker ) GAMEL(1987, pepp0816, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0816) Treasure Chest Poker", GAME_IMPERFECT_GRAPHICS, layout_pe_poker ) /* Wrong CG graphics & CAP - Missing "Bonus" at MAX Bet for 4 of a Kind & Treasure Chest graphics */ /* Normal board : International Poker */ @@ -9940,6 +10604,7 @@ GAMEL(1995, pex0455p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex0458p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000458P+XP000038) Joker Poker (Aces or Better)", 0, layout_pe_poker ) GAMEL(1995, pex0459p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000459P+XP000038) Joker Poker", 0, layout_pe_poker ) GAMEL(1995, pex0459pa, pex0459p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000459P+XP000155) Joker Poker", 0, layout_pe_poker ) +GAMEL(1995, pex0489p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000489P+XP000038) Double Down Stud Deuces Wild Poker", GAME_NOT_WORKING, layout_pe_poker ) /* Needs unknown PE+ GAME POKER program to run */ GAMEL(1995, pex0508p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000508P+XP000038) Loose Deuce Deuces Wild! Poker", 0, layout_pe_poker ) GAMEL(1995, pex0514p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000514P+XP000038) Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex0515p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000515P+XP000038) Double Bonus Poker", 0, layout_pe_poker ) @@ -9947,7 +10612,9 @@ GAMEL(1995, pex0516p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex0536p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000536P+XP000038) Joker Poker", 0, layout_pe_poker ) GAMEL(1995, pex0537p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000537P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1995, pex0550p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000550P+XP000055) Joker Poker (Two Pair or Better)", 0, layout_pe_poker ) +GAMEL(1995, pex0557p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000557P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1995, pex0568p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000568P+XP000038) Joker Poker", 0, layout_pe_poker ) +GAMEL(1995, pex0578p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000578P+XP000038) Standard Draw Poker", 0, layout_pe_poker ) GAMEL(1995, pex0581p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000581P+XP000038) 4 of a Kind Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex0588p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000588P+XP000038) Joker Poker", 0, layout_pe_poker ) GAMEL(1995, pex0725p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000725P+XP000038) Double Bonus Poker", 0, layout_pe_poker ) @@ -9959,6 +10626,7 @@ GAMEL(1995, pex2010p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex2016p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002016P+XP000038) Full House Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2017p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002017P+XP000038) Full House Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2018p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002018P+XP000038) Full House Bonus Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2021p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002021P+XP000112) Lucky Deal Poker", 0, layout_pe_poker ) GAMEL(1995, pex2025p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002025P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2026p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002026P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2027p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002027P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker ) @@ -10007,15 +10675,18 @@ GAMEL(1995, pex2306p, 0, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pex2307p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002307P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2308p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002308P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2310p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002310P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker ) +GAMEL(1995, pex2312p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002312P+XP000112) Triple Bonus Poker Plus", 0, layout_pe_poker ) GAMEL(1995, pex2314p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002314P+XP000112) Triple Bonus Poker Plus", 0, layout_pe_poker ) GAMEL(1995, pex2374p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker", 0, layout_pe_poker ) GAMEL(1995, pex2377p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002377P+XP000112) Super Double Bonus Poker", 0, layout_pe_poker ) GAMEL(1995, pex2386p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002386P+XP000038) 4 of a Kind Bonus Poker", 0,layout_pe_poker ) +GAMEL(1995, pex2412p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002412P+XP000096) Standard Draw Poker (5 Decks)", 0, layout_pe_poker ) GAMEL(1995, pex2419p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002419P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2420p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002420P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2421p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002421P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2440p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002440P+XP000053) Deuces Wild Poker", 0, layout_pe_poker ) GAMEL(1995, pex2461p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002461P+XP000055) Joker Poker (Two Pair or Better)", 0, layout_pe_poker ) +GAMEL(1995, pex2474p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002474P+XP000038) Double Double Bonus Plus", GAME_NOT_WORKING, layout_pe_poker ) /* Needs unknown PE+ GAME POKER program to run */ GAMEL(1995, pex2478p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002478P+XP000154) Joker Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2479p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002479P+XP000154) Joker Poker - French", 0, layout_pe_poker ) GAMEL(1995, pex2480p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002480P+XP000154) Joker Poker (Aces or Better) - French", 0, layout_pe_poker ) From 9f6ac712a85c2c6cfe2ba28c479732671e1bc4dd Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 7 Jun 2015 17:36:59 -0500 Subject: [PATCH 215/284] new Bells & Whistle clone New Clone Added ----------------------------------------------- Bells & Whistles (Asia, Version M) [rtw, The Dumping Union] --- src/mame/arcade.lst | 3 ++- src/mame/drivers/tmnt.c | 33 +++++++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index f1399302274..4b26b9c3e67 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -6537,7 +6537,8 @@ lgtnfght // GX939 (c) 1990 (World) lgtnfghta // GX939 (c) 1990 (Asia) lgtnfghtu // GX939 (c) 1990 (US) trigon // GX939 (c) 1990 (Japan) -blswhstl // GX060 (c) 1991 +blswhstl // GX060 (c) 1991 (World) +blswhstla // GX060 (c) 1991 (Asia) detatwin // GX060 (c) 1991 (Japan) glfgreat // GX061 (c) 1991 glfgreatj // GX061 (c) 1991 (Japan) diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c index 9127510ddf4..202588c08e6 100644 --- a/src/mame/drivers/tmnt.c +++ b/src/mame/drivers/tmnt.c @@ -3265,6 +3265,31 @@ ROM_START( blswhstl ) ROM_LOAD( "blswhstl.nv", 0x0000, 0x080, CRC(87434e3f) SHA1(458d21cfc0ef3415c0b09d8d748263b9218bdb24) ) ROM_END +ROM_START( blswhstla ) + ROM_REGION( 0x80000, "maincpu", 0 ) /* 4*128k for 68000 code */ + ROM_LOAD16_BYTE( "060_m02.e09", 0x000000, 0x20000, CRC(bc9dd08f) SHA1(463634e1d8f3419b840beef0cedfc9c060166d0c) ) + ROM_LOAD16_BYTE( "060_m03.g09", 0x000001, 0x20000, CRC(7b6ee4a4) SHA1(d6c9d60058accd6f9ac6c2b9306057efc3fee461) ) + ROM_LOAD16_BYTE( "060_m09.e11", 0x040000, 0x20000, CRC(14628736) SHA1(87f7a65cffb87085b3e21043bd46fbb7db9266dd) ) + ROM_LOAD16_BYTE( "060_m10.g11", 0x040001, 0x20000, CRC(f738ad4a) SHA1(5aea4afa4bf935d3e92856eff745f61ed4d98165) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "060j01.f3", 0x0000, 0x10000, CRC(f9d9a673) SHA1(8e5631c20dc37913cc7fa84f7ef786ff1ef85f09) ) + + ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ + ROM_LOAD32_WORD_SWAP( "060e07.k16", 0x000000, 0x080000, CRC(c400edf3) SHA1(3f507df8804c1774e2e213f5eb8be0aa7e818d65) ) + ROM_LOAD32_WORD_SWAP( "060e08.k12", 0x000002, 0x080000, CRC(70dddba1) SHA1(2acb94f249cf89b3d53798a6ee1c960f84a04d2e) ) + + ROM_REGION( 0x100000, "k053245", 0 ) /* sprites */ + ROM_LOAD32_WORD_SWAP( "060e06.k7", 0x000000, 0x080000, CRC(09381492) SHA1(5a3008dec99a8e0043405e9c4f5145794b8606e0) ) + ROM_LOAD32_WORD_SWAP( "060e05.k3", 0x000002, 0x080000, CRC(32454241) SHA1(7a246b255ff30118c4f8e07e6ba03a22fd5ddc8a) ) + + ROM_REGION( 0x100000, "k053260", 0 ) /* samples for the 053260 */ + ROM_LOAD( "060e04.d1", 0x0000, 0x100000, CRC(c680395d) SHA1(acde593a5ec501e89c8aaca6c4fbacf707a727e1) ) + + ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error + ROM_LOAD( "blswhstl.nv", 0x0000, 0x080, CRC(87434e3f) SHA1(458d21cfc0ef3415c0b09d8d748263b9218bdb24) ) +ROM_END + ROM_START( detatwin ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 4*128k for 68000 code */ ROM_LOAD16_BYTE( "060_j02.e09", 0x000000, 0x20000, CRC(11b761ac) SHA1(1a143b0a43da48bdcfe085a2a9d1a2de0329fafd) ) @@ -3354,8 +3379,6 @@ ROM_START( glfgreatj ) ROM_LOAD( "061e04.1d", 0x0000, 0x100000, CRC(7921d8df) SHA1(19ca4850ec489cca245e90a41bfc22493cd52263) ) ROM_END - - ROM_START( tmnt2 ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */ ROM_LOAD16_BYTE( "063uaa02.8e", 0x000000, 0x20000, CRC(58d5c93d) SHA1(6618678ec2da33d2ee6335cca7c9d49e9148b799) ) @@ -3412,7 +3435,6 @@ ROM_START( tmnt22pu ) ROM_LOAD( "tmnt2_uda.nv", 0x0000, 0x080, CRC(44928d33) SHA1(44024927987f6bb8bdac3dbd1fdc81d7b55c0f5a) ) ROM_END - ROM_START( tmht22pe ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */ ROM_LOAD16_BYTE( "063eba02.8e", 0x000000, 0x20000, CRC(99409094) SHA1(18059da85c59eb6ce193111bb8c7bd6601b1e698) ) @@ -3441,7 +3463,6 @@ ROM_START( tmht22pe ) ROM_LOAD( "tmnt2_eba.nv", 0x0000, 0x080, CRC(c0a3ed50) SHA1(6deec720c7f1c607740076cb8b5b5becd175aed0) ) ROM_END - ROM_START( tmnt2a ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */ ROM_LOAD16_BYTE( "063ada02.8e", 0x000000, 0x20000, CRC(4f11b587) SHA1(111051da23ce7035405b4d12c0f18dcc1d6c8ddc) ) @@ -3470,7 +3491,6 @@ ROM_START( tmnt2a ) ROM_LOAD( "tmnt2_ada.nv", 0x0000, 0x080, CRC(063068a0) SHA1(c1da5319428fd8fb60305a2d7cc166596b2fe5a4) ) ROM_END - ROM_START( qgakumon ) ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*256k for 68000 code */ ROM_LOAD16_BYTE( "248jaa02.8e", 0x000000, 0x40000, CRC(fab79410) SHA1(8b1a8946ee65505608cf026c9fca87365ccef089) ) @@ -4118,7 +4138,8 @@ GAME( 1990, lgtnfghta, lgtnfght, lgtnfght, lgtnfght, driver_device, 0, GAME( 1990, lgtnfghtu, lgtnfght, lgtnfght, lgtnfght, driver_device, 0, ROT90, "Konami", "Lightning Fighters (US)", GAME_SUPPORTS_SAVE ) GAME( 1990, trigon, lgtnfght, lgtnfght, trigon, driver_device, 0, ROT90, "Konami", "Trigon (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1991, blswhstl, 0, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (Version L)", GAME_SUPPORTS_SAVE ) +GAME( 1991, blswhstl, 0, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (World, Version L)", GAME_SUPPORTS_SAVE ) +GAME( 1991, blswhstla, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (Asia, Version M)", GAME_SUPPORTS_SAVE ) GAME( 1991, detatwin, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Detana!! Twin Bee (Japan ver. J)", GAME_SUPPORTS_SAVE ) GAME( 1991, glfgreat, 0, glfgreat, glfgreat, driver_device, 0, ROT0, "Konami", "Golfing Greats", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) From e04357ece551e016a1dc5f3b416a7b878fd1b445 Mon Sep 17 00:00:00 2001 From: ted green Date: Sun, 7 Jun 2015 16:51:26 -0600 Subject: [PATCH 216/284] Default to old rasters until new are verified --- src/emu/video/vooddefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index 24955024ef3..cb2dd4c6cc1 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -24,7 +24,7 @@ enum }; // Use old macro style or newer SSE2 optimized functions -#define USE_OLD_RASTER 0 +#define USE_OLD_RASTER 1 /* maximum number of TMUs */ #define MAX_TMU 2 From 29b82e6ad39aa6d360d1f9fa064675ea664e66bf Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 8 Jun 2015 00:07:12 +0200 Subject: [PATCH 217/284] Document signals on PortA used for analog sound. (nw) --- src/mame/audio/irem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c index f9ae63c07bd..c25305148b4 100644 --- a/src/mame/audio/irem.c +++ b/src/mame/audio/irem.c @@ -154,6 +154,13 @@ WRITE8_MEMBER( irem_audio_device::ay8910_0_portb_w ) WRITE8_MEMBER( irem_audio_device::ay8910_1_porta_w ) { + /* + * 45L 21 IOA0 ==> 8D + * 45L 20 IOA1 ==> SD + * 45L 19 IOA2 ==> OH + * 45L 18 IOA3 ==> CH + * + */ #ifdef MAME_DEBUG if (data & 0x0f) popmessage("analog sound %x",data&0x0f); #endif From 3cf2f2444ffd14fe5a8cdf647f0196dd865cef48 Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 8 Jun 2015 01:37:06 +0200 Subject: [PATCH 218/284] Added some more discrete components. (nw) --- nl_examples/kidniki.c | 298 ++++++++++++++++++++++++------------------ 1 file changed, 172 insertions(+), 126 deletions(-) diff --git a/nl_examples/kidniki.c b/nl_examples/kidniki.c index c03cf00af81..8beb47c8249 100644 --- a/nl_examples/kidniki.c +++ b/nl_examples/kidniki.c @@ -1,6 +1,10 @@ #include "netlist/devices/net_lib.h" +#include "netlist/devices/nld_system.h" #include "netlist/analog/nld_bjt.h" +#define USE_FRONTIERS 0 +#define USE_FIXED_STV 0 +/* 1.767 */ NETLIST_START(dummy) // EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: SAT 06 JUN 2015 01:06:26 PM CEST @@ -11,9 +15,9 @@ NETLIST_START(dummy) // .END SOLVER(Solver, 12000) PARAM(Solver.ACCURACY, 1e-7) -PARAM(Solver.NR_LOOPS, 50) +PARAM(Solver.NR_LOOPS, 200) PARAM(Solver.GS_LOOPS, 4) -PARAM(Solver.SOR_FACTOR, 1.0) +PARAM(Solver.SOR_FACTOR, 1) #if 0 PARAM(Solver.SOR_FACTOR, 1) PARAM(Solver.DYNAMIC_TS, 1) @@ -30,7 +34,7 @@ NET_MODEL(".model 1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m * model the internals of the inputs. */ -ANALOG_INPUT(VWORKAROUND, 1.821) +ANALOG_INPUT(VWORKAROUND, 2.061) RES(RWORKAROUND, RES_K(27)) NET_C(VWORKAROUND.Q, RWORKAROUND.1) NET_C(XU1.6, RWORKAROUND.2) @@ -54,162 +58,203 @@ TTL_INPUT(I_BD0, 1) CLOCK(I_CH0, 50) TTL_INPUT(I_OH0, 1) TTL_INPUT(I_SOUNDIC0, 1) -ANALOG_INPUT(I_OKI0, 0) +ANALOG_INPUT(I_MSM2K0, 0) +ANALOG_INPUT(I_MSM3K0, 0) TTL_INPUT(I_SOUND0, 1) TTL_INPUT(I_SINH0, 1) #endif -RES(R95, RES_K(330)) -TTL_7404_DIP(XU3) -CAP(C69, CAP_N(10)) -RES(R96, RES_K(150)) -RES(R103, RES_K(470)) -CAP(C73, CAP_N(10)) -RES(R102, RES_K(150)) -RES(R105, RES_K(470)) -CAP(C72, CAP_N(12)) -RES(R106, RES_K(150)) -RES(R108, RES_K(560)) -CAP(C77, CAP_N(12)) -RES(R107, RES_K(150)) -RES(R100, RES_K(560)) -CAP(C67, CAP_N(15)) -RES(R101, RES_K(150)) -RES(R98, RES_K(650)) -CAP(C68, CAP_N(15)) -RES(R97, RES_K(150)) -RES(R65, RES_K(1)) -CAP(C63, CAP_N(1)) -RES(R65_1, RES_K(27)) -RES(R30, RES_K(10)) -RES(R44, RES_K(100)) +INCLUDE(kidniki_schematics) + +#if (USE_FRONTIERS) +OPTIMIZE_FRONTIER(C63.2, RES_K(27), RES_K(1)) +OPTIMIZE_FRONTIER(R31.2, RES_K(5.1), 50) +OPTIMIZE_FRONTIER(R29.2, RES_K(2.7), 50) +#endif + +NETLIST_END() + +NETLIST_START(kidniki_schematics) + +CAP(C200, CAP_N(100)) +CAP(C28, CAP_U(1)) +CAP(C31, CAP_N(470)) +CAP(C32, CAP_N(3.3)) +CAP(C33, CAP_U(1)) +CAP(C34, CAP_N(1)) +CAP(C35, CAP_N(1)) +CAP(C36, CAP_N(6.5)) +CAP(C37, CAP_N(22)) CAP(C38, CAP_N(1)) CAP(C39, CAP_N(1)) -RES(R38, 820) CAP(C40, CAP_P(12)) -SUBMODEL(LM324_DIP,XU1) -RES(R48_2, RES_K(100)) -CAP(C45, CAP_N(22)) -RES(R54, RES_K(680)) -RES(R55, RES_K(510)) -RES(R45, RES_K(1)) -CAP(C44, CAP_U(1)) -RES(R66, RES_M(1)) -QBJT_EB(Q4, "2SC945") -RES(R70, RES_K(10)) -RES(R63, RES_K(1)) -RES(R69, RES_K(1)) -CAP(C49, CAP_N(3.3)) -CAP(C42, CAP_N(1.2)) -RES(R58, RES_K(39)) -RES(R57, 560) -CAP(C47, CAP_U(1)) -QBJT_EB(Q6, "2SC945") -CAP(C50, CAP_N(22)) -RES(R72, RES_K(100)) -RES(R67, RES_K(100)) -RES(R61, RES_K(100)) -CAP(C51, CAP_N(22)) -RES(R71, RES_K(100)) -RES(R68, RES_K(100)) -RES(R62, RES_K(100)) -QBJT_EB(Q5, "2SC945") -RES(R60, RES_K(39)) -RES(R59, 560) -CAP(C48, CAP_U(1)) -CAP(C43, CAP_N(1.2)) -RES(R46, RES_K(12)) -CAP(C35, CAP_N(1)) -CAP(C34, CAP_N(1)) -RES(R39, RES_K(22)) -RES(R41, RES_K(10)) -RES(R32, RES_K(4.7)) -CAP(C31, CAP_N(470)) -RES(R40, RES_K(10)) -RES(R27, RES_K(6.8)) -CAP(C28, CAP_U(1)) -RES(R28, RES_K(150)) -RES(R29, RES_K(2.7)) -RES(R31, RES_K(5.1)) -RES(R42, RES_K(150)) -RES(R51, RES_K(150)) -CAP(C36, CAP_N(6.5)) -CAP(C32, CAP_N(3.3)) CAP(C41, CAP_U(1)) -RES(R43, 470) -SUBMODEL(LM358_DIP,XU2) -RES(R50, RES_K(22)) -CAP(C56, CAP_N(6.8)) -RES(R75, RES_K(10)) -RES(R74, RES_K(10)) -CAP(C53, CAP_N(27)) +CAP(C42, CAP_N(1.2)) +CAP(C43, CAP_N(1.2)) +CAP(C44, CAP_U(1)) +CAP(C45, CAP_N(22)) +CAP(C47, CAP_U(1)) +CAP(C48, CAP_N(470)) +CAP(C49, CAP_N(3.3)) +CAP(C50, CAP_N(22)) +CAP(C51, CAP_N(22)) CAP(C52, CAP_N(27)) -RES(R73, RES_K(10)) -RES(R76, RES_K(10)) -RES(R78, RES_K(3.3)) -RES(R77, RES_K(2.2)) -CAP(C58, CAP_U(47)) -RES(R49, RES_K(10)) -RES(R48, 470) -QBJT_EB(Q9, "2SC945") -QBJT_EB(Q10, "2SC945") -RES(R84, RES_K(1)) -CAP(C61, CAP_N(22)) +CAP(C53, CAP_N(27)) +CAP(C56, CAP_N(6.8)) +CAP(C57, CAP_N(6.8)) +CAP(C59, CAP_N(6.8)) CAP(C60, CAP_N(22)) -RES(R87, RES_K(68)) -RES(R86, RES_K(10)) -RES(R93, RES_K(1)) -RES(R85, RES_M(2.2)) +CAP(C61, CAP_N(22)) +CAP(C62, CAP_N(6.8)) +CAP(C63, CAP_N(1)) CAP(C64, CAP_N(68)) CAP(C65, CAP_N(68)) CAP(C66, CAP_N(68)) -CAP(C76, CAP_N(68)) -RES(R94, RES_K(22)) -RES(R119, RES_K(22)) -RES(R104, RES_K(22)) -RES(R53, RES_K(100)) -RES(R34, RES_K(100)) -RES(R52, RES_K(100)) -CAP(C37, CAP_N(22)) -RES(R83, RES_K(12)) -RES(R81, 220) -RES(R82, RES_M(2.2)) -RES(R92, RES_K(22)) -RES(R89, RES_K(22)) -CAP(C62, CAP_N(6.8)) -CAP(C57, CAP_N(6.8)) -CAP(C59, CAP_N(6.8)) -RES(R90, RES_K(390)) -CAP(C33, CAP_U(1)) -RES(R37, RES_K(47)) -QBJT_EB(Q3, "2SC945") -RES(R35, RES_K(100)) -RES(R36, RES_K(100)) -RES(R91, RES_K(100)) +CAP(C67, CAP_N(15)) +CAP(C68, CAP_N(15)) +CAP(C69, CAP_N(10)) CAP(C70, CAP_N(22)) +CAP(C72, CAP_N(12)) +CAP(C73, CAP_N(10)) +CAP(C76, CAP_N(68)) +CAP(C77, CAP_N(12)) + +DIODE(D3, "1S1588") DIODE(D4, "1S1588") DIODE(D5, "1S1588") -DIODE(D3, "1S1588") + POT(RV1, RES_K(50)) + +QBJT_EB(Q10, "2SC945") +QBJT_EB(Q3, "2SC945") +QBJT_EB(Q4, "2SC945") +QBJT_EB(Q5, "2SC945") +QBJT_EB(Q6, "2SC945") QBJT_EB(Q7, "2SC945") +QBJT_EB(Q9, "2SC945") + +SUBMODEL(LM324_DIP,XU1) +SUBMODEL(LM358_DIP,XU2) + +TTL_7404_DIP(XU3) + +RES(R100, RES_K(560)) +RES(R101, RES_K(150)) +RES(R102, RES_K(150)) +RES(R103, RES_K(470)) +RES(R104, RES_K(22)) +RES(R105, RES_K(470)) +RES(R106, RES_K(150)) +RES(R107, RES_K(150)) +RES(R108, RES_K(560)) +RES(R119, RES_K(22)) +RES(R200, RES_K(100)) +RES(R201, RES_K(100)) +RES(R27, RES_K(6.8)) +RES(R28, RES_K(150)) +RES(R29, RES_K(2.7)) +RES(R30, RES_K(10)) +RES(R31, RES_K(5.1)) +RES(R32, RES_K(4.7)) +RES(R34, RES_K(100)) +RES(R35, RES_K(100)) +RES(R36, RES_K(100)) +RES(R37, RES_K(47)) +RES(R38, 820) +RES(R39, RES_K(22)) +RES(R40, RES_K(10)) +RES(R41, RES_K(10)) +RES(R42, RES_K(150)) +RES(R43, 470) +RES(R44, RES_K(100)) +RES(R45, RES_K(1)) +RES(R46, RES_K(12)) +RES(R48, 470) +RES(R48_2, RES_K(100)) +RES(R49, RES_K(10)) +RES(R50, RES_K(22)) +RES(R51, RES_K(150)) +RES(R52, RES_K(100)) +RES(R53, RES_K(100)) +RES(R54, RES_K(680)) +RES(R55, RES_K(510)) +RES(R57, 560) +RES(R58, RES_K(39)) +RES(R59, 560) +RES(R60, RES_K(39)) +RES(R61, RES_K(100)) +RES(R62, RES_K(100)) +RES(R63, RES_K(1)) +RES(R65, RES_K(1)) +RES(R65_1, RES_K(27)) +RES(R66, RES_M(1)) +RES(R67, RES_K(100)) +RES(R68, RES_K(100)) +RES(R69, RES_K(1)) +RES(R70, RES_K(10)) +RES(R71, RES_K(100)) +RES(R72, RES_K(100)) +RES(R73, RES_K(10)) +RES(R74, RES_K(10)) +RES(R75, RES_K(10)) +RES(R76, RES_K(10)) +RES(R81, 220) +RES(R82, RES_M(2.2)) +RES(R83, RES_K(12)) +RES(R84, RES_K(1)) +RES(R85, RES_M(2.2)) +RES(R86, RES_K(10)) +RES(R87, RES_K(68)) +RES(R89, RES_K(22)) +RES(R90, RES_K(390)) +RES(R91, RES_K(100)) +RES(R92, RES_K(22)) +RES(R93, RES_K(1)) +RES(R94, RES_K(22)) +RES(R95, RES_K(330)) +RES(R96, RES_K(150)) +RES(R97, RES_K(150)) +RES(R98, RES_K(650)) + +#if USE_FIXED_STV +ANALOG_INPUT(STV, 2) +#else +RES(R78, RES_K(3.3)) +RES(R77, RES_K(2.2)) +CAP(C58, CAP_U(47)) +#endif + NET_C(R95.1, XU3.2, R96.2) NET_C(R95.2, XU3.1, C69.1) NET_C(XU3.3, R103.2, C73.1) NET_C(XU3.4, R103.1, R102.2) NET_C(XU3.5, R105.2, C72.1) NET_C(XU3.6, R105.1, R106.2) +#if USE_FIXED_STV +//FIXME: We should have a NET_C_REMOVE +NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1,/* R77.2, C58.1, */ R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) +#else NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1, R77.2, C58.1, R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) +#endif NET_C(XU3.8, R108.1, R107.2) NET_C(XU3.9, R108.2, C77.1) NET_C(XU3.10, R100.1, R101.2) NET_C(XU3.11, R100.2, C67.1) NET_C(XU3.12, R98.1, R97.2) NET_C(XU3.13, R98.2, C68.1) +#if USE_FIXED_STV +NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, /* R78.1, */ R86.1, R83.1, Q3.C, I_V5.Q) +#else NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, R78.1, R86.1, R83.1, Q3.C, I_V5.Q) +#endif NET_C(R96.1, R102.1, R106.1, R107.1, R101.1, R97.1, R65.1, C63.2) NET_C(C63.1, R65_1.2) NET_C(R65_1.1, R44.2, C38.2, C40.2, XU1.6) +#if USE_FIXED_STV +NET_C(R30.1, R41.1, R40.1, STV, R76.2, /* R78.2, R77.1, C58.2*/ STV) +#else NET_C(R30.1, R41.1, R40.1, R76.2, R78.2, R77.1, C58.2) +#endif NET_C(R30.2, XU1.5) NET_C(R44.1, C39.1, C40.1, R48_2.2) NET_C(C38.1, C39.2, R38.1) @@ -250,7 +295,7 @@ NET_C(R42.2, R51.1, C36.1) NET_C(R51.2, C41.1) NET_C(C41.2, R43.1, I_SOUNDIC0.Q) NET_C(XU2.1, XU2.2, R73.1) -NET_C(XU2.3, R76.1, I_OKI0.Q) +NET_C(XU2.3, R76.1, C200.2) NET_C(XU2.5, C56.2, R75.1) NET_C(XU2.6, XU2.7, R50.1, C53.2) NET_C(R75.2, R74.1, C53.1) @@ -275,10 +320,11 @@ NET_C(R89.1, C57.2, C59.2, R90.1) NET_C(Q3.B, R35.1) NET_C(R35.2, R36.2, C70.1) NET_C(R91.2, C70.2, I_SD0.Q) +NET_C(I_MSM3K0.Q, R200.2) +NET_C(I_MSM2K0.Q, R201.2) +NET_C(R200.1, R201.1, C200.1) NETLIST_END() - - NETLIST_START(opamp) /* Opamp model from From 7cd00086541935e9efb18a10346fea324646e6f8 Mon Sep 17 00:00:00 2001 From: couriersud Date: Mon, 8 Jun 2015 01:39:51 +0200 Subject: [PATCH 219/284] Made it more convenient to add frontiers (impedance barriers). These - at the right place - enable netlist to split a netlist into multiple smaller netlists. Side mark: The "old" discrete system assumed such a device in every node. (nw) --- src/emu/netlist/devices/net_lib.c | 2 +- src/emu/netlist/devices/nld_system.h | 29 ++++++++++++++++++-- src/emu/netlist/nl_parser.c | 16 +++++++++++ src/emu/netlist/nl_parser.h | 2 ++ src/emu/netlist/nl_setup.c | 30 ++++++++++++++++++++ src/emu/netlist/nl_setup.h | 1 + src/emu/netlist/plib/pparser.c | 12 +++++++- src/emu/netlist/tools/nl_convert.c | 41 ++++++++++++++++++++++------ 8 files changed, 120 insertions(+), 13 deletions(-) diff --git a/src/emu/netlist/devices/net_lib.c b/src/emu/netlist/devices/net_lib.c index f239beb1069..37eaf082493 100644 --- a/src/emu/netlist/devices/net_lib.c +++ b/src/emu/netlist/devices/net_lib.c @@ -52,7 +52,7 @@ void nl_initialize_factory(netlist_factory_list_t &factory) ENTRY(VCCS, VCCS, "-") ENTRY(CCCS, CCCS, "-") ENTRY(dummy_input, DUMMY_INPUT, "-") - ENTRY(frontier, FRONTIER, "+I,Q") + ENTRY(frontier, FRONTIER_DEV, "+I,G,Q") // not intended to be used directly ENTRY(QBJT_EB, QBJT_EB, "model") ENTRY(QBJT_switch, QBJT_SW, "model") ENTRY(ttl_input, TTL_INPUT, "IN") diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h index 84d1f30694d..2552ebe018b 100644 --- a/src/emu/netlist/devices/nld_system.h +++ b/src/emu/netlist/devices/nld_system.h @@ -44,19 +44,26 @@ #define DUMMY_INPUT(_name) \ NET_REGISTER_DEV(dummy_input, _name) -#define FRONTIER(_name, _IN, _OUT) \ +//FIXME: Usage discouraged, use OPTIMIZE_FRONTIER instead +#define FRONTIER_DEV(_name, _IN, _G, _OUT) \ NET_REGISTER_DEV(frontier, _name) \ NET_C(_IN, _name.I) \ + NET_C(_G, _name.G) \ NET_C(_OUT, _name.Q) +#define OPTIMIZE_FRONTIER(_attach, _r_in, _r_out) \ + setup.register_frontier(# _attach, _r_in, _r_out); + #define RES_SWITCH(_name, _IN, _P1, _P2) \ NET_REGISTER_DEV(res_sw, _name) \ NET_C(_IN, _name.I) \ NET_C(_P1, _name.1) \ NET_C(_P2, _name.2) + /* Default device to hold netlist parameters */ #define PARAMETERS(_name) \ NET_REGISTER_DEV(netlistparams, _name) + // ----------------------------------------------------------------------------- // mainclock // ----------------------------------------------------------------------------- @@ -207,12 +214,24 @@ protected: void start() { - register_input("I", m_I); - register_output("Q", m_Q); + register_param("RIN", m_p_RIN, 1.0e6); + register_param("ROUT", m_p_ROUT, 50.0); + + register_input("_I", m_I); + register_terminal("I",m_RIN.m_P); + register_terminal("G",m_RIN.m_N); + connect(m_I, m_RIN.m_P); + + register_output("_Q", m_Q); + register_terminal("_OP",m_ROUT.m_P); + register_terminal("Q",m_ROUT.m_N); + connect(m_Q, m_ROUT.m_P); } void reset() { + m_RIN.set(1.0 / m_p_RIN.Value(),0,0); + m_ROUT.set(1.0 / m_p_ROUT.Value(),0,0); } void update() @@ -221,9 +240,13 @@ protected: } private: + NETLIB_NAME(twoterm) m_RIN; + NETLIB_NAME(twoterm) m_ROUT; netlist_analog_input_t m_I; netlist_analog_output_t m_Q; + netlist_param_double_t m_p_RIN; + netlist_param_double_t m_p_ROUT; }; // ----------------------------------------------------------------------------- diff --git a/src/emu/netlist/nl_parser.c b/src/emu/netlist/nl_parser.c index 2810a9be861..bf52363df83 100644 --- a/src/emu/netlist/nl_parser.c +++ b/src/emu/netlist/nl_parser.c @@ -49,6 +49,7 @@ bool netlist_parser::parse(const char *buf, const pstring nlname) m_tok_ALIAS = register_token("ALIAS"); m_tok_NET_C = register_token("NET_C"); + m_tok_FRONTIER = register_token("OPTIMIZE_FRONTIER"); m_tok_PARAM = register_token("PARAM"); m_tok_NET_MODEL = register_token("NET_MODEL"); m_tok_INCLUDE = register_token("INCLUDE"); @@ -117,6 +118,8 @@ void netlist_parser::parse_netlist(ATTR_UNUSED const pstring &nlname) net_alias(); else if (token.is(m_tok_NET_C)) net_c(); + else if (token.is(m_tok_FRONTIER)) + frontier(); else if (token.is(m_tok_PARAM)) netdev_param(); else if (token.is(m_tok_NET_MODEL)) @@ -217,6 +220,19 @@ void netlist_parser::net_submodel() m_setup.namespace_pop(); } +void netlist_parser::frontier() +{ + // don't do much + pstring attachat = get_identifier(); + require_token(m_tok_comma); + double r_IN = eval_param(get_token()); + require_token(m_tok_comma); + double r_OUT = eval_param(get_token()); + require_token(m_tok_param_right); + + m_setup.register_frontier(attachat, r_IN, r_OUT); +} + void netlist_parser::net_include() { // don't do much diff --git a/src/emu/netlist/nl_parser.h b/src/emu/netlist/nl_parser.h index 30faf341d67..2f44ef9992d 100644 --- a/src/emu/netlist/nl_parser.h +++ b/src/emu/netlist/nl_parser.h @@ -25,6 +25,7 @@ public: void net_alias(); void netdev_param(); void net_c(); + void frontier(); void device(const pstring &dev_type); void netdev_netlist_start(); void netdev_netlist_end(); @@ -48,6 +49,7 @@ private: token_id_t m_tok_comma; token_id_t m_tok_ALIAS; token_id_t m_tok_NET_C; + token_id_t m_tok_FRONTIER; token_id_t m_tok_PARAM; token_id_t m_tok_NET_MODEL; token_id_t m_tok_NETLIST_START; diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index b33c9e1e995..a22c94519e6 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -295,6 +295,36 @@ void netlist_setup_t::register_link(const pstring &sin, const pstring &sout) // fatalerror("Error adding link %s<==%s to link list\n", sin.cstr(), sout.cstr()); } +void netlist_setup_t::register_frontier(const pstring attach, const double r_IN, const double r_OUT) +{ + static int frontier_cnt = 0; + pstring frontier_name = pstring::sprintf("frontier_%d", frontier_cnt); + frontier_cnt++; + netlist_device_t *front = register_dev("nld_frontier", frontier_name); + register_param(frontier_name + ".RIN", r_IN); + register_param(frontier_name + ".ROUT", r_OUT); + register_link(frontier_name + ".G", "GND"); + pstring attfn = build_fqn(attach); + bool found = false; + for (std::size_t i = 0; i < m_links.size(); i++) + { + if (m_links[i].e1 == attfn) + { + m_links[i].e1 = front->name() + ".I"; + found = true; + } + else if (m_links[i].e2 == attfn) + { + m_links[i].e2 = front->name() + ".I"; + found = true; + } + } + if (!found) + netlist().error("Frontier setup: found no occurrence of %s\n", attach.cstr()); + register_link(attach, frontier_name + ".Q"); +} + + void netlist_setup_t::register_param(const pstring ¶m, const double value) { // FIXME: there should be a better way diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index c7b2f08b64e..6cd5afc36f0 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -151,6 +151,7 @@ public: void register_link(const pstring &sin, const pstring &sout); void register_param(const pstring ¶m, const pstring &value); void register_param(const pstring ¶m, const double value); + void register_frontier(const pstring attach, const double r_IN, const double r_OUT); void register_object(netlist_device_t &dev, const pstring &name, netlist_object_t &obj); bool connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2); diff --git a/src/emu/netlist/plib/pparser.c b/src/emu/netlist/plib/pparser.c index 98b26a1b85f..a6e633f22bb 100644 --- a/src/emu/netlist/plib/pparser.c +++ b/src/emu/netlist/plib/pparser.c @@ -267,6 +267,7 @@ ATTR_COLD void ptokenizer::error(const char *format, ...) ppreprocessor::ppreprocessor() { + m_expr_sep.add("!"); m_expr_sep.add("("); m_expr_sep.add(")"); m_expr_sep.add("+"); @@ -294,11 +295,20 @@ double ppreprocessor::expr(const pstring_list_t &sexpr, std::size_t &start, int if (tok == "(") { start++; - val = expr(sexpr, start, prio); + val = expr(sexpr, start, /*prio*/ 0); if (sexpr[start] != ")") error("parsing error!"); start++; } + else if (tok == "!") + { + start++; + val = expr(sexpr, start, 90); + if (val != 0) + val = 0; + else + val = 1; + } else { tok=sexpr[start]; diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c index 5453129dac1..698bb6a5a4d 100644 --- a/src/emu/netlist/tools/nl_convert.c +++ b/src/emu/netlist/tools/nl_convert.c @@ -5,8 +5,30 @@ * */ +#include + #include "nl_convert.h" +template +static plist_t bubble(const pnamedlist_t &sl) +{ + plist_t ret(sl.size()); + for (int i=0; iname() > sl[ret[j]]->name()) + { + std::swap(ret[i], ret[j]); + } + } + } + return ret; +} + /*------------------------------------------------- convert - convert a spice netlist -------------------------------------------------*/ @@ -72,17 +94,20 @@ void nl_convert_base_t::dump_nl() if (net->terminals().size() == 1) net->set_no_export(); } + plist_t sorted = bubble(m_devs); for (std::size_t i=0; ihas_value()) - out("%s(%s, %s)\n", m_devs[i]->type().cstr(), - m_devs[i]->name().cstr(), get_nl_val(m_devs[i]->value()).cstr()); - else if (m_devs[i]->has_model()) - out("%s(%s, \"%s\")\n", m_devs[i]->type().cstr(), - m_devs[i]->name().cstr(), m_devs[i]->model().cstr()); + std::size_t j = sorted[i]; + + if (m_devs[j]->has_value()) + out("%s(%s, %s)\n", m_devs[j]->type().cstr(), + m_devs[j]->name().cstr(), get_nl_val(m_devs[j]->value()).cstr()); + else if (m_devs[j]->has_model()) + out("%s(%s, \"%s\")\n", m_devs[j]->type().cstr(), + m_devs[j]->name().cstr(), m_devs[j]->model().cstr()); else - out("%s(%s)\n", m_devs[i]->type().cstr(), - m_devs[i]->name().cstr()); + out("%s(%s)\n", m_devs[j]->type().cstr(), + m_devs[j]->name().cstr()); } // print nets for (std::size_t i=0; i Date: Sun, 7 Jun 2015 20:37:56 -0500 Subject: [PATCH 220/284] peplus.c: Minor corrects - NW --- src/mame/drivers/peplus.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 5cb883996b1..784a65f1019 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -1619,7 +1619,7 @@ ROM_START( pepp0021 ) /* Normal board : Standard Draw Poker (PP0021) */ REQUIRES Progressive link which is not currently supported */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "pp0021_723-703.u68", 0x00000, 0x10000, CRC(58f2a68b) SHA1(72c0a29016b17f7e308a9e9b2d724771b5e26560) ) /* Game Version: 520, Library Version: 516, Video Lib Ver: 516 */ + ROM_LOAD( "pp0021_723-703.u68", 0x00000, 0x10000, CRC(58f2a68b) SHA1(72c0a29016b17f7e308a9e9b2d724771b5e26560) ) /* Game Version: 723, Library Version: 703*/ ROM_REGION( 0x020000, "gfx1", 0 ) ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) @@ -2303,7 +2303,7 @@ PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END -ROM_START( pepp0085 ) /* Normal board : Joker Poker (Two Pair or Better) - Double Up always enabled */ +ROM_START( pepp0085 ) /* Normal board : Joker Poker (Two Pair or Better) (PP0085) - Double Up always enabled */ /* w/J w/oJ PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) @@ -2982,7 +2982,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END -ROM_START( pepp0197a ) /* Normal board : Standard Draw Poker (PP0197) - 10/23/95 @ IGT L95-2452 */ +ROM_START( pepp0197a ) /* Normal board : Standard Draw Poker (PP0197) - 07/29/96 @ IGT L96-1219 */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- @@ -4100,7 +4100,7 @@ PayTable As 2P 3K STR FL FH 4K SF RF 5K RF (Bonus) ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */ ROM_END -ROM_START( pepp0467 ) /* Normal board : Uknown Bonus Poker (PP0455) */ +ROM_START( pepp0467 ) /* Normal board : Uknown Bonus Poker (PP0467) */ /* PayTable Js+ 2P 3K STR FL FH 4K ?? SF RF (Bonus) ----------------------------------------------------------- @@ -7448,7 +7448,7 @@ ROM_START( pex0578p ) /* Superboard : Standard Draw Poker (X000578P+XP000038) */ /* PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus) ---------------------------------------------------------- - BA 1 2 3 4 5 8 25 50 250 1000 + BA 1 2 3 4 5 8 25 50 250 800 % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3% Programs Available: X000578P */ @@ -9157,6 +9157,9 @@ ROM_START( pex2412p ) /* Superboard : Standard Draw with 5 decks (X002412P+XP000 /* % Range: 93.7-95.7% Optimum: 97.7% Hit Frequency: 44.6% Programs Available: X002412P + +NOTE: This version uses 5 separate decks of cards, one deck for each HOLD button. + So things like a suited 5K are possible. Sadly, there's no paytable displayed */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xp000096.u67", 0x00000, 0x10000, CRC(5aca14e1) SHA1(13bcb8069f9d704983632bb60db119f7308f9d80) ) From a2357cde887978f179445352044aaf4be9f57b26 Mon Sep 17 00:00:00 2001 From: briantro Date: Sun, 7 Jun 2015 20:41:20 -0500 Subject: [PATCH 221/284] tmnt.c: Minor fix for consistency - NW --- src/mame/drivers/tmnt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c index 202588c08e6..883a874179e 100644 --- a/src/mame/drivers/tmnt.c +++ b/src/mame/drivers/tmnt.c @@ -4112,7 +4112,7 @@ DRIVER_INIT_MEMBER(tmnt_state,cuebrick) } // YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS -GAME( 1989, cuebrick, 0, cuebrick, cuebrick, tmnt_state, cuebrick, ROT0, "Konami", "Cue Brick (World version D)", GAME_SUPPORTS_SAVE ) +GAME( 1989, cuebrick, 0, cuebrick, cuebrick, tmnt_state, cuebrick, ROT0, "Konami", "Cue Brick (World, version D)", GAME_SUPPORTS_SAVE ) GAME( 1989, mia, 0, mia, mia, tmnt_state, mia, ROT0, "Konami", "M.I.A. - Missing in Action (version T)", GAME_SUPPORTS_SAVE ) GAME( 1989, mia2, mia, mia, mia, tmnt_state, mia, ROT0, "Konami", "M.I.A. - Missing in Action (version S)", GAME_SUPPORTS_SAVE ) @@ -4138,9 +4138,9 @@ GAME( 1990, lgtnfghta, lgtnfght, lgtnfght, lgtnfght, driver_device, 0, GAME( 1990, lgtnfghtu, lgtnfght, lgtnfght, lgtnfght, driver_device, 0, ROT90, "Konami", "Lightning Fighters (US)", GAME_SUPPORTS_SAVE ) GAME( 1990, trigon, lgtnfght, lgtnfght, trigon, driver_device, 0, ROT90, "Konami", "Trigon (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1991, blswhstl, 0, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (World, Version L)", GAME_SUPPORTS_SAVE ) -GAME( 1991, blswhstla, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (Asia, Version M)", GAME_SUPPORTS_SAVE ) -GAME( 1991, detatwin, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Detana!! Twin Bee (Japan ver. J)", GAME_SUPPORTS_SAVE ) +GAME( 1991, blswhstl, 0, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (World, version L)", GAME_SUPPORTS_SAVE ) +GAME( 1991, blswhstla, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (Asia, version M)", GAME_SUPPORTS_SAVE ) +GAME( 1991, detatwin, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Detana!! Twin Bee (Japan, version J)", GAME_SUPPORTS_SAVE ) GAME( 1991, glfgreat, 0, glfgreat, glfgreat, driver_device, 0, ROT0, "Konami", "Golfing Greats", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1991, glfgreatj, glfgreat, glfgreat, glfgreatj, driver_device, 0, ROT0, "Konami", "Golfing Greats (Japan)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) From aed0fa6b9be1d25303ac31c0397573fbef021b62 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 8 Jun 2015 09:35:04 +0300 Subject: [PATCH 222/284] build fix. (nw) --- src/mess/drivers/m20.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c index b55a9565be0..ad833a89f99 100644 --- a/src/mess/drivers/m20.c +++ b/src/mess/drivers/m20.c @@ -94,10 +94,10 @@ public: DECLARE_WRITE_LINE_MEMBER(timer_tick_w); private: - bool m_kbrecv_in_progress; - int m_kbrecv_bitcount; + //bool m_kbrecv_in_progress; + //int m_kbrecv_bitcount; offs_t m_memsize; - UINT16 m_kbrecv_data; + //UINT16 m_kbrecv_data; UINT8 m_port21; void install_memory(); From 5ba880cdb9e4c257797ba8f98e96e38bdd9c9d5d Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Mon, 8 Jun 2015 18:53:03 +1200 Subject: [PATCH 223/284] fix GCC 4.4 compile --- src/emu/netlist/tools/nl_convert.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index 9da50d4677c..8ffc357278e 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -12,6 +12,7 @@ //#include //#include +#include #include "plib/pstring.h" #include "plib/plists.h" From dc3240fb5130cf9f28918e3d55e9196076086516 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 8 Jun 2015 09:57:32 +0300 Subject: [PATCH 224/284] (MESS) victor9k: Verified FDC write clock. (nw) --- src/mess/machine/victor9k_fdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mess/machine/victor9k_fdc.c b/src/mess/machine/victor9k_fdc.c index 9fdf6f7c083..ae04084757b 100644 --- a/src/mess/machine/victor9k_fdc.c +++ b/src/mess/machine/victor9k_fdc.c @@ -253,7 +253,7 @@ victor_9000_fdc_t::victor_9000_fdc_t(const machine_config &mconfig, const char * m_via4_irq(CLEAR_LINE), m_via5_irq(CLEAR_LINE), m_via6_irq(CLEAR_LINE), - m_period(attotime::from_nsec(2130)) + m_period(attotime::from_hz(XTAL_15MHz/32)) { cur_live.tm = attotime::never; cur_live.state = IDLE; From 01eee78eca160d10ebee53f9dcfb87851e3f8a74 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 8 Jun 2015 09:57:51 +0300 Subject: [PATCH 225/284] (MESS) victor9k: Fixed keyboard. [Curt Coder] --- src/mess/drivers/victor9k.c | 39 +++++++++++++++++++++++++++++++----- src/mess/includes/victor9k.h | 21 ++++++++++++++----- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c index 677f5667741..a9bca20faaa 100644 --- a/src/mess/drivers/victor9k.c +++ b/src/mess/drivers/victor9k.c @@ -10,7 +10,6 @@ TODO: - - keyboard - expansion bus - Z80 card - Winchester DMA card (Xebec S1410 + Tandon TM502/TM603SE) @@ -28,6 +27,14 @@ +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define LOG 0 + + + //************************************************************************** // ADDRESS MAPS //************************************************************************** @@ -272,6 +279,13 @@ WRITE8_MEMBER( victor9k_state::via2_pa_w ) */ } +void victor9k_state::update_kback() +{ + int kback = !(!(m_kbrdy && !m_via2_irq) && !(m_kbackctl && m_via2_irq)); + + m_kb->kback_w(kback); +} + WRITE8_MEMBER( victor9k_state::via2_pb_w ) { /* @@ -290,7 +304,8 @@ WRITE8_MEMBER( victor9k_state::via2_pb_w ) */ // keyboard acknowledge - m_kb->kback_w(BIT(data, 1)); + m_kbackctl = BIT(data, 1); + update_kback(); // brightness m_brt = (data >> 2) & 0x07; @@ -299,6 +314,14 @@ WRITE8_MEMBER( victor9k_state::via2_pb_w ) m_cont = data >> 5; } +WRITE_LINE_MEMBER( victor9k_state::via2_irq_w ) +{ + m_via2_irq = state; + + m_pic->ir6_w(m_via2_irq); + update_kback(); +} + WRITE_LINE_MEMBER( victor9k_state::write_ria ) { @@ -360,14 +383,17 @@ WRITE_LINE_MEMBER( victor9k_state::via3_irq_w ) WRITE_LINE_MEMBER( victor9k_state::kbrdy_w ) { - //logerror("KBRDY %u\n", state); + if (LOG) logerror("KBRDY %u\n", state); m_via2->write_cb1(state); + + m_kbrdy = state; + update_kback(); } WRITE_LINE_MEMBER( victor9k_state::kbdata_w ) { - //logerror("KBDATA %u\n", state); + if (LOG) logerror("KBDATA %u\n", state); m_via2->write_cb2(state); m_via2->write_pa6(state); @@ -392,9 +418,12 @@ void victor9k_state::machine_start() save_item(NAME(m_brt)); save_item(NAME(m_cont)); save_item(NAME(m_via1_irq)); + save_item(NAME(m_via2_irq)); save_item(NAME(m_via3_irq)); save_item(NAME(m_fdc_irq)); save_item(NAME(m_ssda_irq)); + save_item(NAME(m_kbrdy)); + save_item(NAME(m_kbackctl)); // patch out SCP self test m_rom->base()[0x11ab] = 0xc3; @@ -499,7 +528,7 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state ) MCFG_DEVICE_ADD(M6522_2_TAG, VIA6522, XTAL_30MHz/30) MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(victor9k_state, via2_pa_w)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(victor9k_state, via2_pb_w)) - MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(I8259A_TAG, pic8259_device, ir6_w)) + MCFG_VIA6522_IRQ_HANDLER(WRITELINE(victor9k_state, via2_irq_w)) MCFG_DEVICE_ADD(M6522_3_TAG, VIA6522, XTAL_30MHz/30) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(victor9k_state, via3_pb_w)) diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h index dcc921b6729..89c5c0b1c4b 100644 --- a/src/mess/includes/victor9k.h +++ b/src/mess/includes/victor9k.h @@ -75,9 +75,12 @@ public: m_brt(0), m_cont(0), m_via1_irq(CLEAR_LINE), + m_via2_irq(CLEAR_LINE), m_via3_irq(CLEAR_LINE), m_fdc_irq(CLEAR_LINE), - m_ssda_irq(CLEAR_LINE) + m_ssda_irq(CLEAR_LINE), + m_kbrdy(1), + m_kbackctl(0) { } required_device m_maincpu; @@ -114,6 +117,7 @@ public: DECLARE_WRITE8_MEMBER( via2_pb_w ); DECLARE_WRITE_LINE_MEMBER( write_ria ); DECLARE_WRITE_LINE_MEMBER( write_rib ); + DECLARE_WRITE_LINE_MEMBER( via2_irq_w ); DECLARE_WRITE8_MEMBER( via3_pb_w ); DECLARE_WRITE_LINE_MEMBER( via3_irq_w ); @@ -128,18 +132,25 @@ public: MC6845_UPDATE_ROW( crtc_update_row ); - /* video state */ + DECLARE_WRITE_LINE_MEMBER( mux_serial_b_w ); + DECLARE_WRITE_LINE_MEMBER( mux_serial_a_w ); + + // video state int m_brt; int m_cont; - /* interrupts */ + // interrupts int m_via1_irq; + int m_via2_irq; int m_via3_irq; int m_fdc_irq; int m_ssda_irq; - DECLARE_WRITE_LINE_MEMBER(mux_serial_b_w); - DECLARE_WRITE_LINE_MEMBER(mux_serial_a_w); + // keyboard + int m_kbrdy; + int m_kbackctl; + + void update_kback(); }; #endif From 87edb3162b642682088c3a5d97c3358c7574fde0 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 8 Jun 2015 09:10:49 +0200 Subject: [PATCH 226/284] fix owner (nw) --- src/mess/tools/imgtool/modules/vzdos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mess/tools/imgtool/modules/vzdos.c b/src/mess/tools/imgtool/modules/vzdos.c index d24d1286019..bacaa448ef8 100644 --- a/src/mess/tools/imgtool/modules/vzdos.c +++ b/src/mess/tools/imgtool/modules/vzdos.c @@ -1,5 +1,5 @@ -// license:BSD-3-Clause -// copyright-holders:Raphael Nabet +// license:GPL-2.0+ +// copyright-holders:Dirk Best /**************************************************************************** vzdos.c From b2c3fb09e2de1178e5c9c9770d62054958b6dc79 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 10:24:56 +0200 Subject: [PATCH 227/284] apricotf/apricotp: use correct drive type, add apridisk format, remove legacy floppy options --- src/mess/drivers/apricotf.c | 9 +++++++-- src/mess/drivers/apricotp.c | 35 ++++++++++++++--------------------- src/mess/includes/apricotf.h | 4 +++- src/mess/includes/apricotp.h | 2 ++ 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/mess/drivers/apricotf.c b/src/mess/drivers/apricotf.c index 6acd59dab3f..df67ba10e95 100644 --- a/src/mess/drivers/apricotf.c +++ b/src/mess/drivers/apricotf.c @@ -25,6 +25,7 @@ */ #include "includes/apricotf.h" +#include "formats/apridisk.h" @@ -250,6 +251,10 @@ WRITE_LINE_MEMBER( f1_state::ctc_z2_w ) // floppy //------------------------------------------------- +FLOPPY_FORMATS_MEMBER( f1_state::floppy_formats ) + FLOPPY_APRIDISK_FORMAT +FLOPPY_FORMATS_END + static SLOT_INTERFACE_START( apricotf_floppies ) SLOT_INTERFACE( "d31v", SONY_OA_D31V ) SLOT_INTERFACE( "d32w", SONY_OA_D32W ) @@ -304,8 +309,8 @@ static MACHINE_CONFIG_START( act_f1, f1_state ) MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE(I8086_TAG, INPUT_LINE_NMI)) MCFG_WD_FDC_DRQ_CALLBACK(INPUTLINE(I8086_TAG, INPUT_LINE_TEST)) - MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", apricotf_floppies, "d32w", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", apricotf_floppies, "d32w", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", apricotf_floppies, "d32w", f1_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", apricotf_floppies, "d32w", f1_state::floppy_formats) MACHINE_CONFIG_END diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c index f19887f7c56..7ff45b011db 100644 --- a/src/mess/drivers/apricotp.c +++ b/src/mess/drivers/apricotp.c @@ -1,8 +1,8 @@ // license:LGPL-2.1+ -// copyright-holders:Angelo Salese, Dirk Best +// copyright-holders:Angelo Salese /*************************************************************************** - ACT Apricot F1 series + ACT Apricot FP preliminary driver by Angelo Salese @@ -25,6 +25,7 @@ */ #include "includes/apricotp.h" +#include "formats/apridisk.h" #include "apricotp.lh" @@ -211,10 +212,7 @@ void fp_state::lat_ls259_w(offs_t offset, int state) m_fdc->set_floppy(m_floppy); if (m_floppy) - { - m_floppy->set_rpm(600); m_floppy->mon_w(0); - } } break; } @@ -399,20 +397,6 @@ INPUT_PORTS_END */ -static SLOT_INTERFACE_START( fp_floppies ) - SLOT_INTERFACE( "35dd", FLOPPY_35_DD ) // Sony OA-D32W (600 rpm) -SLOT_INTERFACE_END -/* -static LEGACY_FLOPPY_OPTIONS_START( act ) - LEGACY_FLOPPY_OPTION( img2hd, "dsk", "2HD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([16]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -*/ - WRITE_LINE_MEMBER( fp_state::write_centronics_busy ) { m_centronics_busy = state; @@ -467,6 +451,15 @@ void fp_state::machine_reset() // MACHINE DRIVERS //************************************************************************** +FLOPPY_FORMATS_MEMBER( fp_state::floppy_formats ) + FLOPPY_APRIDISK_FORMAT +FLOPPY_FORMATS_END + +static SLOT_INTERFACE_START( fp_floppies ) + SLOT_INTERFACE("d32w", SONY_OA_D32W) +SLOT_INTERFACE_END + + //------------------------------------------------- // MACHINE_CONFIG( fp ) //------------------------------------------------- @@ -535,8 +528,8 @@ static MACHINE_CONFIG_START( fp, fp_state ) MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(I8259A_TAG, pic8259_device, ir1_w)) MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE(I8237_TAG, am9517a_device, dreq1_w)) - MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":0", fp_floppies, "35dd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":1", fp_floppies, NULL, floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", fp_floppies, "d32w", fp_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", fp_floppies, NULL, fp_state::floppy_formats) MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fp_state, write_centronics_busy)) diff --git a/src/mess/includes/apricotf.h b/src/mess/includes/apricotf.h index a010fbd8944..69d96633d79 100644 --- a/src/mess/includes/apricotf.h +++ b/src/mess/includes/apricotf.h @@ -1,4 +1,4 @@ -// license:BSD-3-Clause + // license:BSD-3-Clause // copyright-holders:Angelo Salese, Robbbert #pragma once @@ -60,6 +60,8 @@ public: m_palette(*this, "palette") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + virtual void machine_start(); required_device m_maincpu; diff --git a/src/mess/includes/apricotp.h b/src/mess/includes/apricotp.h index 9014954305d..f932245e4e2 100644 --- a/src/mess/includes/apricotp.h +++ b/src/mess/includes/apricotp.h @@ -74,6 +74,8 @@ public: m_video_ram(*this, "video_ram") { } + DECLARE_FLOPPY_FORMATS(floppy_formats); + required_device m_maincpu; required_device m_soundcpu; required_device m_dmac; From 7cd70226a37efebfaa9dcb5e8941ce629dbcd7d1 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 10:40:46 +0200 Subject: [PATCH 228/284] osborne1: remove legacy floppy options, use standard monochrome green palette --- src/mess/drivers/osborne1.c | 48 +++--------------------------------- src/mess/includes/osborne1.h | 1 - src/mess/machine/osborne1.c | 16 ++++++------ 3 files changed, 12 insertions(+), 53 deletions(-) diff --git a/src/mess/drivers/osborne1.c b/src/mess/drivers/osborne1.c index 076fd3d4a7e..2dfb9d67f05 100644 --- a/src/mess/drivers/osborne1.c +++ b/src/mess/drivers/osborne1.c @@ -144,14 +144,6 @@ static INPUT_PORTS_START( osborne1 ) INPUT_PORTS_END -PALETTE_INIT_MEMBER(osborne1_state, osborne1) -{ - palette.set_pen_color( 0, 0, 0, 0 ); /* Black */ - palette.set_pen_color( 1, 0, 255, 0 ); /* Full */ - palette.set_pen_color( 2, 0, 128, 0 ); /* Dimmed */ -} - - static const z80_daisy_config osborne1_daisy_chain[] = { /* { osborne1_z80_reset, osborne1_z80_irq_state, osborne1_z80_irq_ack, osborne1_z80_irq_reti, 0 }, */ @@ -159,6 +151,7 @@ static const z80_daisy_config osborne1_daisy_chain[] = { NULL } }; + /* * The Osborne-1 supports the following disc formats: * - Osborne single density: 40 tracks, 10 sectors per track, 256-byte sectors (100 KByte) @@ -168,46 +161,13 @@ static const z80_daisy_config osborne1_daisy_chain[] = * - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte) * */ - /* -static LEGACY_FLOPPY_OPTIONS_START(osborne1 ) - LEGACY_FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([10]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([5]) - SECTOR_LENGTH([1024]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([8]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([18]) - SECTOR_LENGTH([128]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([9]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -*/ static SLOT_INTERFACE_START( osborne1_floppies ) SLOT_INTERFACE( "525sssd", FLOPPY_525_SSSD ) // Siemens FDD 100-5, custom Osborne electronics SLOT_INTERFACE( "525ssdd", FLOPPY_525_SSDD ) // MPI 52(?), custom Osborne electronics SLOT_INTERFACE_END + /* F4 Character Displayer */ static const gfx_layout osborne1_charlayout = { @@ -226,6 +186,7 @@ static GFXDECODE_START( osborne1 ) GFXDECODE_ENTRY( "chargen", 0x0000, osborne1_charlayout, 0, 1 ) GFXDECODE_END + static MACHINE_CONFIG_START( osborne1, osborne1_state ) MCFG_CPU_ADD( "maincpu", Z80, MAIN_CLOCK/4 ) MCFG_CPU_PROGRAM_MAP( osborne1_mem) @@ -239,8 +200,7 @@ static MACHINE_CONFIG_START( osborne1, osborne1_state ) MCFG_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 512, 0, 416, 260, 0, 240 ) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", osborne1) - MCFG_PALETTE_ADD( "palette", 3 ) - MCFG_PALETTE_INIT_OWNER(osborne1_state, osborne1) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") MCFG_SPEAKER_STANDARD_MONO( "mono" ) MCFG_SOUND_ADD( "beeper", BEEP, 0 ) diff --git a/src/mess/includes/osborne1.h b/src/mess/includes/osborne1.h index 130f80006e1..52d39a09461 100644 --- a/src/mess/includes/osborne1.h +++ b/src/mess/includes/osborne1.h @@ -103,7 +103,6 @@ public: bool m_beep_state; DECLARE_DRIVER_INIT(osborne1); virtual void machine_reset(); - DECLARE_PALETTE_INIT(osborne1); TIMER_CALLBACK_MEMBER(osborne1_video_callback); TIMER_CALLBACK_MEMBER(setup_osborne1); diff --git a/src/mess/machine/osborne1.c b/src/mess/machine/osborne1.c index fbc1e370a7f..84cf5f2db46 100644 --- a/src/mess/machine/osborne1.c +++ b/src/mess/machine/osborne1.c @@ -369,14 +369,14 @@ TIMER_CALLBACK_MEMBER(osborne1_state::osborne1_video_callback) gfx = m_p_chargen[ (ra << 7) | ( chr & 0x7F ) ]; /* Display a scanline of a character */ - *p++ = BIT(gfx, 7) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 6) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 5) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 4) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 3) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 2) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 1) ? ( dim ? 1 : 2 ) : 0; - *p++ = BIT(gfx, 0) ? ( dim ? 1 : 2 ) : 0; + *p++ = BIT(gfx, 7) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 6) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 5) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 4) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 3) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 2) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 1) ? ( dim ? 2 : 1 ) : 0; + *p++ = BIT(gfx, 0) ? ( dim ? 2 : 1 ) : 0; } } From c277729276cf5c6845bbac96ffb128bb861fc269 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 10:45:26 +0200 Subject: [PATCH 229/284] apf: remove legacy floppy options --- src/mess/drivers/apf.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/mess/drivers/apf.c b/src/mess/drivers/apf.c index c873cc9c48c..d5ea1ec7aa1 100644 --- a/src/mess/drivers/apf.c +++ b/src/mess/drivers/apf.c @@ -62,6 +62,7 @@ ToDo: - Add back the disk support when we can get some info on it (6600, 6500-6503 wd179x disc controller? 6400, 6401) - Need to add back the disk format in the new wdc code + (40 tracks, 1 head, 8 sectors, 256 bytes sector length, first sector id 1) - Need disk-based software @@ -494,23 +495,6 @@ static SLOT_INTERFACE_START( apf_floppies ) SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD ) SLOT_INTERFACE_END -#if 0 -static LEGACY_FLOPPY_OPTIONS_START(apfimag) - LEGACY_FLOPPY_OPTION(apfimag, "apd", "APF disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([8]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -static const floppy_interface apfimag_floppy_interface = -{ - FLOPPY_STANDARD_5_25_SSDD_40, - LEGACY_FLOPPY_OPTIONS_NAME(apfimag), - NULL -}; -#endif static SLOT_INTERFACE_START(apf_cart) SLOT_INTERFACE_INTERNAL("std", APF_ROM_STD) From e4974b62f295e5f8897d11f3b50fbdbdbf8f213b Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 10:49:11 +0200 Subject: [PATCH 230/284] ms0515: remove legacy floppy options --- src/mess/drivers/ms0515.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/mess/drivers/ms0515.c b/src/mess/drivers/ms0515.c index c677c1656db..fdbf1ba5686 100644 --- a/src/mess/drivers/ms0515.c +++ b/src/mess/drivers/ms0515.c @@ -134,16 +134,8 @@ void ms0515_state::machine_reset() /* Input ports */ static INPUT_PORTS_START( ms0515 ) INPUT_PORTS_END -/* -static LEGACY_FLOPPY_OPTIONS_START(ms0515) - LEGACY_FLOPPY_OPTION(ms0515, "dsk", "MS0515 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([80]) - SECTORS([10]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([0])) -LEGACY_FLOPPY_OPTIONS_END -*/ + +// disk format: 80 tracks, 1 head, 10 sectors, 512 bytes sector length, first sector id 0 static SLOT_INTERFACE_START( ms0515_floppies ) SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // 720 KB From bde076d14a2548123229d5eb8b924563cc6f02bb Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 10:52:21 +0200 Subject: [PATCH 231/284] osbexec: remove legacy floppy options, use default monochrome green palette --- src/mess/drivers/osbexec.c | 49 +++----------------------------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/src/mess/drivers/osbexec.c b/src/mess/drivers/osbexec.c index 80323e29a0c..04479245194 100644 --- a/src/mess/drivers/osbexec.c +++ b/src/mess/drivers/osbexec.c @@ -113,7 +113,6 @@ public: DECLARE_READ8_MEMBER(osbexec_rtc_r); DECLARE_DRIVER_INIT(osbexec); virtual void machine_reset(); - DECLARE_PALETTE_INIT(osbexec); TIMER_CALLBACK_MEMBER(osbexec_video_callback); DECLARE_READ8_MEMBER(osbexec_pia0_a_r); DECLARE_WRITE8_MEMBER(osbexec_pia0_a_w); @@ -311,13 +310,6 @@ static INPUT_PORTS_START( osbexec ) INPUT_PORTS_END -PALETTE_INIT_MEMBER(osbexec_state, osbexec) -{ - palette.set_pen_color( 0, 0, 0, 0 ); /* Black */ - palette.set_pen_color( 1, 0, 255, 0 ); /* Full */ - palette.set_pen_color( 2, 0, 128, 0 ); /* Dimmed */ -} - void osbexec_state::video_start() { machine().first_screen()->register_screen_bitmap(m_bitmap); @@ -439,45 +431,12 @@ WRITE_LINE_MEMBER(osbexec_state::osbexec_pia1_irq) * - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte) * */ - /* -static LEGACY_FLOPPY_OPTIONS_START(osbexec ) - LEGACY_FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([10]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([5]) - SECTOR_LENGTH([1024]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([8]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([18]) - SECTOR_LENGTH([128]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([9]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -*/ static SLOT_INTERFACE_START( osborne2_floppies ) SLOT_INTERFACE( "525ssdd", FLOPPY_525_SSDD ) SLOT_INTERFACE_END + TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback) { int y = machine().first_screen()->vpos(); @@ -504,7 +463,7 @@ TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback) { UINT8 ch = m_vram[ row_addr + x ]; UINT8 attr = m_vram[ 0x1000 + row_addr + x ]; - UINT8 fg_col = ( attr & 0x80 ) ? 1 : 2; + UINT8 fg_col = ( attr & 0x80 ) ? 2 : 1; UINT8 font_bits = m_fontram[ ( ( attr & 0x10 ) ? 0x800 : 0 ) + ( ch & 0x7f ) * 16 + char_line ]; /* Check for underline */ @@ -575,9 +534,7 @@ static MACHINE_CONFIG_START( osbexec, osbexec_state ) MCFG_SCREEN_UPDATE_DRIVER(osbexec_state, screen_update) MCFG_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 768, 0, 640, 260, 0, 240 ) /* May not be correct */ MCFG_SCREEN_PALETTE("palette") - - MCFG_PALETTE_ADD( "palette", 3 ) - MCFG_PALETTE_INIT_OWNER(osbexec_state, osbexec) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") MCFG_SPEAKER_STANDARD_MONO( "mono" ) MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) From 01585019b51dfac5ce10737df1b60a51ee6c2068 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 10:55:32 +0200 Subject: [PATCH 232/284] v1050: remove legacy floppy options --- src/mess/drivers/v1050.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c index 06cb8b6a240..71b1d06018d 100644 --- a/src/mess/drivers/v1050.c +++ b/src/mess/drivers/v1050.c @@ -918,6 +918,8 @@ void v1050_state::update_fdc() } } +// disk format: 80 tracks, 1 head, 10 sectors, 512 bytes sector length, first sector id 1 + static SLOT_INTERFACE_START( v1050_floppies ) SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD ) // Teac FD 55E-02-U SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Teac FD 55-FV-35-U @@ -937,16 +939,6 @@ WRITE_LINE_MEMBER( v1050_state::fdc_drq_w ) update_fdc(); } -/* -static LEGACY_FLOPPY_OPTIONS_START( v1050 ) - LEGACY_FLOPPY_OPTION( v1050, "dsk", "Visual 1050 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([80]) - SECTORS([10]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -*/ // Machine Initialization From de73186266d9a40b633381f33982969c04e7a928 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 11:00:17 +0200 Subject: [PATCH 233/284] xerox820: remove legacy floppy options --- src/mess/drivers/xerox820.c | 38 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c index 114bee250ca..bb832463abe 100644 --- a/src/mess/drivers/xerox820.c +++ b/src/mess/drivers/xerox820.c @@ -35,6 +35,15 @@ Note: - MK-82 have same roms as original Big Board - MK-83 have 256K of RAM + + 8-inch formats + 77 tracks, 1 head, 26 sectors, 128 bytes sector length, first sector id 1 + 77 tracks, 1 head, 26 sectors, 256 bytes sector length, first sector id 1 + + 5.25-inch formats + 40 tracks, 1 head, 18 sectors, 128 bytes sector length, first sector id 1 + 40 tracks, 2 heads, 18 sectors, 128 bytes sector length, first sector id 1 + */ @@ -491,34 +500,7 @@ void xerox820ii_state::machine_reset() m_fdc->reset(); } -/* -static LEGACY_FLOPPY_OPTIONS_START( xerox820 ) - LEGACY_FLOPPY_OPTION( sssd8, "dsk", "8\" SSSD", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([26]) - SECTOR_LENGTH([128]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( ssdd8, "dsk", "8\" SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([77]) - SECTORS([26]) - SECTOR_LENGTH([256]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( sssd5, "dsk", "5.25\" SSSD", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([18]) - SECTOR_LENGTH([128]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION( ssdd5, "dsk", "5.25\" SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([40]) - SECTORS([18]) - SECTOR_LENGTH([128]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END -*/ + /* F4 Character Displayer */ static const gfx_layout xerox820_charlayout = From 126f95c7860165e16bb8f5611a38a32c7e5d8dd6 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 11:24:49 +0200 Subject: [PATCH 234/284] atarist_dsk: remove, no longer used --- scripts/src/lib.lua | 2 - src/lib/formats/atarist_dsk.c | 86 ----------------------------------- src/lib/formats/atarist_dsk.h | 20 -------- 3 files changed, 108 deletions(-) delete mode 100644 src/lib/formats/atarist_dsk.c delete mode 100644 src/lib/formats/atarist_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index dab7f0dc9c4..4639f86fdb8 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -167,8 +167,6 @@ project "formats" MAME_DIR .. "src/lib/formats/asst128_dsk.h", MAME_DIR .. "src/lib/formats/atari_dsk.c", MAME_DIR .. "src/lib/formats/atari_dsk.h", - MAME_DIR .. "src/lib/formats/atarist_dsk.c", - MAME_DIR .. "src/lib/formats/atarist_dsk.h", MAME_DIR .. "src/lib/formats/atom_tap.c", MAME_DIR .. "src/lib/formats/atom_tap.h", MAME_DIR .. "src/lib/formats/bbc_dsk.c", diff --git a/src/lib/formats/atarist_dsk.c b/src/lib/formats/atarist_dsk.c deleted file mode 100644 index eb559a940c4..00000000000 --- a/src/lib/formats/atarist_dsk.c +++ /dev/null @@ -1,86 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/********************************************************************* - - formats/atarist_dsk.c - - Atari ST disk images - -*********************************************************************/ - -#include - -#include "formats/atarist_dsk.h" -#include "formats/basicdsk.h" - -/* - - TODO: - - - MSA format - - STT format - - DIM format - -*/ - -/*************************************************************************** - CONSTANTS / MACROS -***************************************************************************/ - -#define LOG 0 - -/*************************************************************************** - IMPLEMENTATION -***************************************************************************/ - -/*------------------------------------------------- - FLOPPY_IDENTIFY( atarist_st_identify ) --------------------------------------------------*/ - -static FLOPPY_IDENTIFY( atarist_st_identify ) -{ - *vote = 100; - - return FLOPPY_ERROR_SUCCESS; -} - -/*------------------------------------------------- - FLOPPY_CONSTRUCT( atarist_st_construct ) --------------------------------------------------*/ - -static FLOPPY_CONSTRUCT( atarist_st_construct ) -{ - int heads = 0; - int tracks = 0; - int sectors = 0; - UINT8 bootsector[512]; - - floppy_image_read(floppy, bootsector, 0, 512); - sectors = bootsector[0x18]; - heads = bootsector[0x1a]; - tracks = (bootsector[0x13] | (bootsector[0x14] << 8)) / sectors / heads; - - struct basicdsk_geometry geometry; - memset(&geometry, 0, sizeof(geometry)); - - geometry.heads = heads; - geometry.first_sector_id = 1; - geometry.sector_length = 512; - geometry.tracks = tracks; - geometry.sectors = sectors; - - if (LOG) LOG_FORMATS("ST Heads %d Tracks %d Sectors %d\n", heads, tracks, sectors); - - return basicdsk_construct(floppy, &geometry); -} - -/*------------------------------------------------- - FLOPPY_CONSTRUCT(atarist_dsk_construct) --------------------------------------------------*/ - -LEGACY_FLOPPY_OPTIONS_START( atarist ) - LEGACY_FLOPPY_OPTION( atarist, "st", "Atari ST floppy disk image", atarist_st_identify, atarist_st_construct, NULL, NULL ) -/* LEGACY_FLOPPY_OPTION( atarist, "stt", "Atari ST floppy disk image", atarist_stt_identify, atarist_stt_construct, NULL, NULL ) - LEGACY_FLOPPY_OPTION( atarist, "msa", "Atari ST floppy disk image", atarist_msa_identify, atarist_msa_construct, NULL, NULL ) - LEGACY_FLOPPY_OPTION( atarist, "dim", "Atari ST floppy disk image", atarist_dim_identify, atarist_dim_construct, NULL, NULL )*/ -LEGACY_FLOPPY_OPTIONS_END diff --git a/src/lib/formats/atarist_dsk.h b/src/lib/formats/atarist_dsk.h deleted file mode 100644 index 6c86e456a5b..00000000000 --- a/src/lib/formats/atarist_dsk.h +++ /dev/null @@ -1,20 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/********************************************************************* - - formats/atarist_dsk.h - - atarist disk images - -*********************************************************************/ - -#ifndef ATARIST_DSK_H -#define ATARIST_DSK_H - -#include "flopimg.h" - -/**************************************************************************/ - -LEGACY_FLOPPY_OPTIONS_EXTERN(atarist); - -#endif /* ATARIST_DSK_H */ From b749e0a2f7a48e5dafc3e9df8a37c305dbe56c40 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 11:36:11 +0200 Subject: [PATCH 235/284] m20_dsk: remove legacy format --- src/lib/formats/m20_dsk.c | 166 -------------------------------------- src/lib/formats/m20_dsk.h | 7 -- 2 files changed, 173 deletions(-) diff --git a/src/lib/formats/m20_dsk.c b/src/lib/formats/m20_dsk.c index 8dbb403143b..5fec77cf1d5 100644 --- a/src/lib/formats/m20_dsk.c +++ b/src/lib/formats/m20_dsk.c @@ -14,173 +14,7 @@ *********************************************************************/ -#include -#include - #include "m20_dsk.h" -#include "basicdsk.h" - -static FLOPPY_IDENTIFY(m20_dsk_identify) -{ - *vote = (floppy_image_size(floppy) == 286720) ? 100 : 0; - return FLOPPY_ERROR_SUCCESS; -} - -static int m20_get_heads_per_disk(floppy_image_legacy *floppy) -{ - return 2; -} - -static int m20_get_tracks_per_disk(floppy_image_legacy *floppy) -{ - return 35; -} - -static UINT64 m20_translate_offset(floppy_image_legacy *floppy, int track, int head, int sector) -{ - return 256*(32*track+16*head+sector); -} - -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) -{ - UINT64 offs; - /* translate the sector to a raw sector */ - if (!sector_is_index) - { - sector -= 1; - } - - /* check to see if we are out of range */ - if ((head < 0) || (head >= 2) || (track < 0) || (track >= 35) || (sector < 0) || (sector >= 16)) - return FLOPPY_ERROR_SEEKERROR; - - offs = m20_translate_offset(floppy, track, head, sector); - if (offset) - *offset = offs; - return FLOPPY_ERROR_SUCCESS; -} - - - -static floperr_t internal_m20_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) -{ - UINT64 offset; - floperr_t err; - - //printf("internal_m20_read_sector: track = %d, head = %d, sector = %d, secisix = %d, buflen = %ld\n", track, head, sector, sector_is_index, (long)buflen); - err = get_offset(floppy, head, track, sector, sector_is_index, &offset); - if (err) - return err; - - floppy_image_read(floppy, buffer, offset, buflen); - return FLOPPY_ERROR_SUCCESS; -} - - - -static floperr_t internal_m20_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam) -{ - UINT64 offset; - floperr_t err; - - err = get_offset(floppy, head, track, sector, sector_is_index, &offset); - if (err) - return err; - - floppy_image_write(floppy, buffer, offset, buflen); - return FLOPPY_ERROR_SUCCESS; -} - - - -static floperr_t m20_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) -{ - return internal_m20_read_sector(floppy, head, track, sector, FALSE, buffer, buflen); -} - -static floperr_t m20_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) -{ - return internal_m20_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam); -} - -static floperr_t m20_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) -{ - return internal_m20_read_sector(floppy, head, track, sector, TRUE, buffer, buflen); -} - -static floperr_t m20_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) -{ - return internal_m20_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam); -} - -static floperr_t m20_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) -{ - floperr_t err; - err = get_offset(floppy, head, track, sector, FALSE, NULL); - if (err) - return err; - - if (sector_length) { - if (track == 0 && head == 0) - *sector_length = 128; - else - *sector_length = 256; - } - return FLOPPY_ERROR_SUCCESS; -} - - - -static floperr_t m20_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) -{ - sector_index += 1; - if (cylinder) - *cylinder = track; - if (side) - *side = head; - if (sector) - *sector = sector_index; - if (flags) - /* TODO: read DAM or DDAM and determine flags */ - *flags = 0; - return m20_get_sector_length(floppy, head, track, sector_index, sector_length); -} - - -static FLOPPY_CONSTRUCT(m20_dsk_construct) -{ - struct FloppyCallbacks *callbacks; - callbacks = floppy_callbacks(floppy); - callbacks->read_sector = m20_read_sector; - callbacks->write_sector = m20_write_sector; - callbacks->read_indexed_sector = m20_read_indexed_sector; - callbacks->write_indexed_sector = m20_write_indexed_sector; - callbacks->get_sector_length = m20_get_sector_length; - callbacks->get_heads_per_disk = m20_get_heads_per_disk; - callbacks->get_tracks_per_disk = m20_get_tracks_per_disk; - callbacks->get_indexed_sector_info = m20_get_indexed_sector_info; - - return FLOPPY_ERROR_SUCCESS; -} - - - -/* ----------------------------------------------------------------------- */ - -LEGACY_FLOPPY_OPTIONS_START( m20 ) - LEGACY_FLOPPY_OPTION(m20_dsk, "img", "M20 disk image", m20_dsk_identify, m20_dsk_construct, NULL, NULL) -LEGACY_FLOPPY_OPTIONS_END - - -/********************************************************************* - - formats/m20_dsk.c - - m20 format - -*********************************************************************/ - -#include "formats/m20_dsk.h" m20_format::m20_format() { diff --git a/src/lib/formats/m20_dsk.h b/src/lib/formats/m20_dsk.h index f4b23017953..e3f8c9cf411 100644 --- a/src/lib/formats/m20_dsk.h +++ b/src/lib/formats/m20_dsk.h @@ -13,13 +13,6 @@ #include "flopimg.h" -/**************************************************************************/ - -LEGACY_FLOPPY_OPTIONS_EXTERN(m20); - - -#include "wd177x_dsk.h" - class m20_format : public floppy_image_format_t { public: m20_format(); From 2cc9da11deb0b82cbfb19a7f976b55d9593f98ad Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 12:18:45 +0200 Subject: [PATCH 236/284] msx_dsk: remove legacy format --- src/lib/formats/msx_dsk.c | 22 +--------------------- src/lib/formats/msx_dsk.h | 11 +---------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/lib/formats/msx_dsk.c b/src/lib/formats/msx_dsk.c index 815c6fa5e2e..ab0b5bab529 100644 --- a/src/lib/formats/msx_dsk.c +++ b/src/lib/formats/msx_dsk.c @@ -8,27 +8,7 @@ *********************************************************************/ -#include - -#include "formats/msx_dsk.h" -#include "formats/basicdsk.h" - -LEGACY_FLOPPY_OPTIONS_START(msx) - LEGACY_FLOPPY_OPTION(msx, "dsk", "MSX SS", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([1]) - TRACKS([80]) - SECTORS([9]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) - LEGACY_FLOPPY_OPTION(msx, "dsk", "MSX DS", basicdsk_identify_default, basicdsk_construct_default, NULL, - HEADS([2]) - TRACKS([80]) - SECTORS([9]) - SECTOR_LENGTH([512]) - FIRST_SECTOR_ID([1])) -LEGACY_FLOPPY_OPTIONS_END - -/********************************************************************/ +#include "msx_dsk.h" //msx_format::msx_format() : wd177x_format(formats) msx_format::msx_format() : upd765_format(formats) diff --git a/src/lib/formats/msx_dsk.h b/src/lib/formats/msx_dsk.h index 8e26ec93128..94a5411c51a 100644 --- a/src/lib/formats/msx_dsk.h +++ b/src/lib/formats/msx_dsk.h @@ -11,15 +11,7 @@ #ifndef MSX_DSK_H #define MSX_DSK_H -#include "flopimg.h" - -/**************************************************************************/ - -LEGACY_FLOPPY_OPTIONS_EXTERN(msx); - -/**************************************************************************/ - -#include "wd177x_dsk.h" +//#include "wd177x_dsk.h" #include "upd765_dsk.h" //class msx_format : public wd177x_format { @@ -37,5 +29,4 @@ private: extern const floppy_format_type FLOPPY_MSX_FORMAT; - #endif /* MSX_DSK_H */ From f3885ffde57e43fb6258d84af83c68b64fe24f56 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 12:19:43 +0200 Subject: [PATCH 237/284] remove unneeded basicdsk.h include from a few files --- src/emu/bus/kc/d004.h | 1 - src/mess/includes/apricotf.h | 1 - src/mess/includes/cgc7900.h | 1 - src/mess/includes/msx.h | 1 - src/mess/includes/swtpc09.h | 1 - src/mess/includes/x1.h | 1 - src/mess/tools/imgtool/modules/thomson.c | 1 - 7 files changed, 7 deletions(-) diff --git a/src/emu/bus/kc/d004.h b/src/emu/bus/kc/d004.h index 6f120ecfe71..79f45cba03a 100644 --- a/src/emu/bus/kc/d004.h +++ b/src/emu/bus/kc/d004.h @@ -11,7 +11,6 @@ #include "cpu/z80/z80.h" #include "machine/upd765.h" #include "machine/ataintf.h" -#include "formats/basicdsk.h" #include "imagedev/harddriv.h" diff --git a/src/mess/includes/apricotf.h b/src/mess/includes/apricotf.h index 69d96633d79..bb2aa226757 100644 --- a/src/mess/includes/apricotf.h +++ b/src/mess/includes/apricotf.h @@ -9,7 +9,6 @@ #include "emu.h" #include "cpu/i86/i86.h" #include "cpu/z80/z80daisy.h" -#include "formats/basicdsk.h" #include "imagedev/flopdrv.h" #include "machine/apricotkb.h" #include "machine/buffer.h" diff --git a/src/mess/includes/cgc7900.h b/src/mess/includes/cgc7900.h index c55566b735e..d5b6dc86548 100644 --- a/src/mess/includes/cgc7900.h +++ b/src/mess/includes/cgc7900.h @@ -9,7 +9,6 @@ #include "emu.h" #include "cpu/m68000/m68000.h" #include "cpu/mcs48/mcs48.h" -#include "formats/basicdsk.h" #include "machine/ram.h" #include "machine/i8251.h" #include "sound/ay8910.h" diff --git a/src/mess/includes/msx.h b/src/mess/includes/msx.h index 866503cb164..0d7b3930508 100644 --- a/src/mess/includes/msx.h +++ b/src/mess/includes/msx.h @@ -23,7 +23,6 @@ #include "video/tms9928a.h" #include "imagedev/flopdrv.h" #include "imagedev/cassette.h" -#include "formats/basicdsk.h" #include "formats/fmsx_cas.h" #include "formats/msx_dsk.h" #include "hashfile.h" diff --git a/src/mess/includes/swtpc09.h b/src/mess/includes/swtpc09.h index de0b27288a5..222ffe5c11a 100644 --- a/src/mess/includes/swtpc09.h +++ b/src/mess/includes/swtpc09.h @@ -13,7 +13,6 @@ #include "cpu/m6809/m6809.h" #include "video/generic.h" #include "machine/wd_fdc.h" -#include "formats/basicdsk.h" #include "imagedev/flopdrv.h" #include "machine/6840ptm.h" #include "machine/6821pia.h" diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h index ec286064412..13ab9b6ce2e 100644 --- a/src/mess/includes/x1.h +++ b/src/mess/includes/x1.h @@ -23,7 +23,6 @@ #include "sound/wave.h" #include "imagedev/cassette.h" #include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" #include "formats/x1_tap.h" #include "bus/generic/slot.h" #include "bus/generic/carts.h" diff --git a/src/mess/tools/imgtool/modules/thomson.c b/src/mess/tools/imgtool/modules/thomson.c index bea02ef80f7..43684bc0aea 100644 --- a/src/mess/tools/imgtool/modules/thomson.c +++ b/src/mess/tools/imgtool/modules/thomson.c @@ -113,7 +113,6 @@ #include "imgtool.h" #include "iflopimg.h" -#include "formats/basicdsk.h" #include From 9e36b49d859f5c6f8ba1081a5cd254de46c77ef4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 8 Jun 2015 12:37:14 +0200 Subject: [PATCH 238/284] ladybug speedup (nw) --- src/mame/drivers/ladybug.c | 8 ++++---- src/mame/includes/ladybug.h | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c index b303d8b0f88..51613cf3235 100644 --- a/src/mame/drivers/ladybug.c +++ b/src/mame/drivers/ladybug.c @@ -202,7 +202,7 @@ INPUT_CHANGED_MEMBER(ladybug_state::coin2_inserted) CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r) { - return ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read(); + return m_p1_control->read(); } CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r) @@ -210,10 +210,10 @@ CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r) UINT32 ret; /* upright cabinet only uses a single set of controls */ - if (ioport("DSW0")->read() & 0x20) - ret = ioport(LADYBUG_P2_CONTROL_PORT_TAG)->read(); + if (m_port_dsw0->read() & 0x20) + ret = m_p2_control->read(); else - ret = ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read(); + ret = m_p1_control->read(); return ret; } diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h index bd78dd7e0e9..5a4b4561387 100644 --- a/src/mame/includes/ladybug.h +++ b/src/mame/includes/ladybug.h @@ -19,7 +19,10 @@ public: m_grid_data(*this, "grid_data"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_port_dsw0(*this, "DSW0"), + m_p1_control(*this, "CONTP1"), + m_p2_control(*this, "CONTP2") { } /* memory pointers */ required_shared_ptr m_videoram; @@ -51,6 +54,9 @@ public: required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + required_ioport m_port_dsw0; + optional_ioport m_p1_control; + optional_ioport m_p2_control; DECLARE_READ8_MEMBER(sraider_sound_low_r); DECLARE_READ8_MEMBER(sraider_sound_high_r); From c33d1518efdd0771dc035b8c6887d0d6709d3e0f Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 12:52:59 +0200 Subject: [PATCH 239/284] cpis_dsk: remove legacy format --- src/lib/formats/cpis_dsk.c | 99 +------------------------------------- src/lib/formats/cpis_dsk.h | 8 --- 2 files changed, 1 insertion(+), 106 deletions(-) diff --git a/src/lib/formats/cpis_dsk.c b/src/lib/formats/cpis_dsk.c index 088fcebb908..8246db7e82e 100644 --- a/src/lib/formats/cpis_dsk.c +++ b/src/lib/formats/cpis_dsk.c @@ -8,104 +8,7 @@ *********************************************************************/ -#include -#include - -#include "formats/cpis_dsk.h" -#include "formats/basicdsk.h" - - -static int compis_get_tracks_and_sectors(floppy_image_legacy *floppy, int *tracks, int *sectors) -{ - switch(floppy_image_size(floppy)) { - case 0x50000: /* 320 KB */ - *tracks = 40; - *sectors = 8; - break; - - case 0x5a000: /* 360 KB */ - *tracks = 40; - *sectors = 9; - break; - - case 0xa0000: /* 640 KB */ - *tracks = 80; - *sectors = 8; - break; - - case 0xb4000: /* 720 KB */ - *tracks = 80; - *sectors = 9; - break; - - case 0x12c000: /* 1200 KB */ - *tracks = 80; - *sectors = 15; - break; - - default: - return 0; - } - return 1; -} - - - -static FLOPPY_IDENTIFY(compis_dsk_identify) -{ - int dummy; - *vote = compis_get_tracks_and_sectors(floppy, &dummy, &dummy) ? 100 : 0; - return FLOPPY_ERROR_SUCCESS; -} - - - -static FLOPPY_CONSTRUCT(compis_dsk_construct) -{ - struct basicdsk_geometry geometry; - - memset(&geometry, 0, sizeof(geometry)); - geometry.heads = 1; - geometry.first_sector_id = 1; - geometry.sector_length = 512; - - if (params) - { - /* create */ - geometry.tracks = option_resolution_lookup_int(params, PARAM_TRACKS); - geometry.sectors = option_resolution_lookup_int(params, PARAM_SECTORS); - } - else - { - /* open */ - if (!compis_get_tracks_and_sectors(floppy, &geometry.tracks, &geometry.sectors)) - return FLOPPY_ERROR_INVALIDIMAGE; - } - - return basicdsk_construct(floppy, &geometry); -} - - - -/* ----------------------------------------------------------------------- */ - -LEGACY_FLOPPY_OPTIONS_START( compis ) - LEGACY_FLOPPY_OPTION( compis_dsk, "dsk", "Compis floppy disk image", compis_dsk_identify, compis_dsk_construct, NULL, - TRACKS(40/[80]) - SECTORS(8/[9]/15)) -LEGACY_FLOPPY_OPTIONS_END - - - -/********************************************************************* - - formats/cpis_dsk.c - - cpis format - -*********************************************************************/ - -#include "formats/cpis_dsk.h" +#include "cpis_dsk.h" cpis_format::cpis_format() : upd765_format(formats) { diff --git a/src/lib/formats/cpis_dsk.h b/src/lib/formats/cpis_dsk.h index e6e4e8bad20..3879c6a17c6 100644 --- a/src/lib/formats/cpis_dsk.h +++ b/src/lib/formats/cpis_dsk.h @@ -11,14 +11,6 @@ #ifndef CPIS_DSK_H #define CPIS_DSK_H -#include "flopimg.h" - - -/**************************************************************************/ - -LEGACY_FLOPPY_OPTIONS_EXTERN(compis); - - #include "upd765_dsk.h" class cpis_format : public upd765_format { From 6ba157cb67285370974259af715b18efa5097f15 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 13:15:03 +0200 Subject: [PATCH 240/284] vtech1_dsk: remove, no longer used --- scripts/src/lib.lua | 2 -- src/emu/bus/vtech/memexp/floppy.c | 2 +- src/lib/formats/vtech1_dsk.c | 41 ------------------------------- src/lib/formats/vtech1_dsk.h | 18 -------------- 4 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 src/lib/formats/vtech1_dsk.c delete mode 100644 src/lib/formats/vtech1_dsk.h diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 4639f86fdb8..996478276a6 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -404,8 +404,6 @@ project "formats" MAME_DIR .. "src/lib/formats/vt_cas.h", MAME_DIR .. "src/lib/formats/vt_dsk.c", MAME_DIR .. "src/lib/formats/vt_dsk.h", - MAME_DIR .. "src/lib/formats/vtech1_dsk.c", - MAME_DIR .. "src/lib/formats/vtech1_dsk.h", MAME_DIR .. "src/lib/formats/wavfile.c", MAME_DIR .. "src/lib/formats/wavfile.h", MAME_DIR .. "src/lib/formats/wd177x_dsk.c", diff --git a/src/emu/bus/vtech/memexp/floppy.c b/src/emu/bus/vtech/memexp/floppy.c index dccba3f09b5..201f91d8a92 100644 --- a/src/emu/bus/vtech/memexp/floppy.c +++ b/src/emu/bus/vtech/memexp/floppy.c @@ -10,7 +10,7 @@ ***************************************************************************/ #include "floppy.h" -#include "formats/vtech1_dsk.h" + //************************************************************************** // DEVICE DEFINITIONS diff --git a/src/lib/formats/vtech1_dsk.c b/src/lib/formats/vtech1_dsk.c deleted file mode 100644 index c0771ea7227..00000000000 --- a/src/lib/formats/vtech1_dsk.c +++ /dev/null @@ -1,41 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/********************************************************************* - - formats/vtech1_dsk.c - - VTech1 disk images - -*********************************************************************/ - -#include - -#include "formats/vtech1_dsk.h" - -static FLOPPY_IDENTIFY( vtech1_dsk_identify ) -{ - *vote = 100; - return FLOPPY_ERROR_SUCCESS; -} - - -static FLOPPY_CONSTRUCT( vtech1_dsk_construct ) -{ - return FLOPPY_ERROR_SUCCESS; -} - -LEGACY_FLOPPY_OPTIONS_START( vtech1_only ) - LEGACY_FLOPPY_OPTION( - vtech1_dsk, - "dsk", - "Laser floppy disk image", - vtech1_dsk_identify, - vtech1_dsk_construct, - NULL, - HEADS([1]) - TRACKS([40]) - SECTORS([16]) - SECTOR_LENGTH([154]) - FIRST_SECTOR_ID([0]) - ) -LEGACY_FLOPPY_OPTIONS_END0 diff --git a/src/lib/formats/vtech1_dsk.h b/src/lib/formats/vtech1_dsk.h deleted file mode 100644 index 338faf452e3..00000000000 --- a/src/lib/formats/vtech1_dsk.h +++ /dev/null @@ -1,18 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Miodrag Milanovic -/********************************************************************* - - formats/vtech1_dsk.h - - VTech1 disk images - -*********************************************************************/ - -#ifndef VTECH1_DSK_H -#define VTECH1_DSK_H - -#include "flopimg.h" - -LEGACY_FLOPPY_OPTIONS_EXTERN(vtech1_only); - -#endif /* VTECH1_DSK_H */ From 0229ff2fb678b4dd6705e64442a9c03742774f6a Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 13:18:39 +0200 Subject: [PATCH 241/284] vtech1/floppy: cleanup --- src/emu/bus/vtech/memexp/floppy.c | 12 ++++-------- src/emu/bus/vtech/memexp/floppy.h | 4 +--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/emu/bus/vtech/memexp/floppy.c b/src/emu/bus/vtech/memexp/floppy.c index 201f91d8a92..ef169703035 100644 --- a/src/emu/bus/vtech/memexp/floppy.c +++ b/src/emu/bus/vtech/memexp/floppy.c @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:Dirk Best +// copyright-holders:Dirk Best, Olivier Galibert /*************************************************************************** VTech Laser/VZ Floppy Controller Cartridge @@ -44,18 +44,14 @@ const rom_entry *floppy_controller_device::device_rom_region() const // machine configurations //------------------------------------------------- -FLOPPY_FORMATS_MEMBER( floppy_controller_device::floppy_formats ) - FLOPPY_MFI_FORMAT -FLOPPY_FORMATS_END - static SLOT_INTERFACE_START( laser_floppies ) - SLOT_INTERFACE( "525", FLOPPY_525_SSSD ) + SLOT_INTERFACE("525", FLOPPY_525_SSSD) SLOT_INTERFACE_END static MACHINE_CONFIG_FRAGMENT( floppy_controller ) MCFG_MEMEXP_SLOT_ADD("mem") - MCFG_FLOPPY_DRIVE_ADD("0", laser_floppies, "525", floppy_controller_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("1", laser_floppies, "525", floppy_controller_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("0", laser_floppies, "525", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("1", laser_floppies, "525", floppy_image_device::default_floppy_formats) MACHINE_CONFIG_END machine_config_constructor floppy_controller_device::device_mconfig_additions() const diff --git a/src/emu/bus/vtech/memexp/floppy.h b/src/emu/bus/vtech/memexp/floppy.h index 940c6abc2ea..91c332332c1 100644 --- a/src/emu/bus/vtech/memexp/floppy.h +++ b/src/emu/bus/vtech/memexp/floppy.h @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:Dirk Best +// copyright-holders:Dirk Best, Olivier Galibert /*************************************************************************** VTech Laser/VZ Floppy Controller Cartridge @@ -38,8 +38,6 @@ public: DECLARE_READ8_MEMBER(rd_r); DECLARE_READ8_MEMBER(wpt_r); - DECLARE_FLOPPY_FORMATS( floppy_formats ); - protected: virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; From 3ee1cb72ece11997d8d14d71a20c4dfa3c61b716 Mon Sep 17 00:00:00 2001 From: ted green Date: Mon, 8 Jun 2015 07:25:11 -0600 Subject: [PATCH 242/284] Fixed 32-bit compile --- src/emu/video/vooddefs.h | 6 ++++-- src/emu/video/voodoo.c | 39 ++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index cb2dd4c6cc1..8e76cdd1c3a 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -3159,7 +3159,7 @@ ATTR_FORCE_INLINE void applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 f /* if fog_mult is zero, we subtract the incoming color */ if (!FOGMODE_FOG_MULT(fogModeReg)) { - rgbint_sub(&tmpA, &tmpB); + rgbaint_sub(&tmpA, &tmpB); //fog.rgb -= color.rgb; //fr -= (RR); //fg -= (GG); @@ -4569,8 +4569,10 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co /* note that they set LOD min to 8 to "disable" a TMU */ \ if (TMUS >= 2 && v->tmu[1].lodmin < (8 << 8)) { \ INT32 tmp; \ + const rgb_union texelZero = {0}; \ texel.u = genTexture(&v->tmu[1], dither4[x&3], TEXMODE1, v->tmu[1].lookup, extra->lodbase1, \ iters1, itert1, iterw1, tmp); \ + texel.u = combineTexture(&v->tmu[1], TEXMODE1, texel, texelZero, tmp); \ } \ /* run the texture pipeline on TMU0 to produce a final */ \ /* result in texel */ \ @@ -4659,7 +4661,7 @@ ATTR_FORCE_INLINE UINT32 genTexture(tmu_state *TT, const UINT8 ditherX, const UI lod += ditherX << 4; if (lod < (TT)->lodmin) lod = (TT)->lodmin; - if (lod > (TT)->lodmax) + else if (lod > (TT)->lodmax) lod = (TT)->lodmax; /* now the LOD is in range; if we don't own this LOD, take the next one */ diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index a0c0d26e941..73c421b90d0 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -6451,24 +6451,25 @@ RASTERIZER_ENTRY( 0x00602439, 0x00044119, 0x00000000, 0x000B0379, 0x00000009, 0x //RASTERIZER_ENTRY( 0x00424219, 0x00000000, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ //RASTERIZER_ENTRY( 0x0200421A, 0x00001510, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */ /* gtfore06 ----> fbzColorPath alphaMode fogMode, fbzMode, texMode0, texMode1 hash */ -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) /* 47 901402 15032233 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) /* 90 186896 9133452 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) /* 18 119615 9038715 */ -RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x000000C1, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 12 33459 3336035 */ -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 45 166408 2416297 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C2610C4 ) /* 79 39422 2109850 */ -RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 26 9335 850817 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x00000ACD, 0x0C261ACD ) /* 9 8990 267028 */ -RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 61 2540 184702 */ -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 5 1270 162503 */ -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x00000000, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 84 7393 51970 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x042210C0 ) /* 2 9440 39646 */ -RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 67 990 13559 */ -RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 24 176 13213 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 20 348 7883 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) /* 70 2020 6048 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) /* 92 28 28 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) /* 55 18 540 */ -RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) /* 19 2 24 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) /* 18 1064626 69362127 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) /* 47 3272483 31242799 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x00000ACD, 0x0C261ACD ) /* 9 221917 12348555 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 26 57291 9357989 */ +RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x000000C1, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 12 97156 8530607 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) /* 55 110144 5265532 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 61 16644 1079382 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 5 8332 1065229 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 45 8148 505013 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x00000000, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 84 45233 248267 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) /* 90 10235 193036 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C261ACD ) /* * 29 3777 83777 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x042210C0 ) /* 2 24952 66761 */ +RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 24 661 50222 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) /* 92 12504 43720 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C2610C4 ) /* 79 2160 43650 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) /* 19 2796 30377 */ +RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 67 1962 14755 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* * 66 74 3951 */ +RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) /* 70 374 3691 */ #endif From efa55998b484d86d80569b077758df2210973df1 Mon Sep 17 00:00:00 2001 From: ted green Date: Mon, 8 Jun 2015 07:33:34 -0600 Subject: [PATCH 243/284] More fixes for 32 bit --- src/emu/video/rgbsse.h | 2 +- src/emu/video/vooddefs.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h index b2b677a7eba..88a345f316c 100644 --- a/src/emu/video/rgbsse.h +++ b/src/emu/video/rgbsse.h @@ -315,7 +315,7 @@ INLINE void rgbint_scale_channel_and_clamp(rgbint *color, const rgbint *colorsca *color = _mm_min_epi16(*color, *(__m128i *)&rgbsse_statics.maxbyte); } -INLINE void rgbint_scale_immediate_add_and_clamp(rgbint *color1, INT16 colorscale, const rgbaint *color2) +INLINE void rgbaint_scale_immediate_add_and_clamp(rgbaint *color1, INT16 colorscale, const rgbaint *color2) { // color2 will get mutiplied by 2^8 (256) and then divided by 2^8 by the shift by 8 __m128i mscale = _mm_unpacklo_epi16(_mm_set1_epi16(colorscale), _mm_set_epi16(0, 0, 0, 0, 256, 256, 256, 256)); diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index 8e76cdd1c3a..bc346133cfe 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -3216,7 +3216,7 @@ ATTR_FORCE_INLINE void applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 f /* if fog_mult is 0, we add this to the original color */ if (FOGMODE_FOG_MULT(fogModeReg) == 0) { - rgbint_scale_immediate_add_and_clamp(&tmpA, fogblend, &tmpB); + rgbaint_scale_immediate_add_and_clamp(&tmpA, fogblend, &tmpB); //color += fog; //(RR) += fr; //(GG) += fg; @@ -4315,7 +4315,7 @@ ATTR_FORCE_INLINE bool combineColor(voodoo_state *VV, stats_block *STATS, UINT32 sub_val.u &= 0x00ffffff; rgba_to_rgbaint(&tmpB, (rgb_t) sub_val.u); - rgbint_sub(&tmpA, &tmpB); + rgbaint_sub(&tmpA, &tmpB); } /* blend RGB */ @@ -4847,7 +4847,7 @@ ATTR_FORCE_INLINE UINT32 combineTexture(tmu_state *TT, const UINT32 TEXMODE, rgb sub_val.u &= 0x00ffffff; rgba_to_rgbaint(&tmpB, (rgb_t) sub_val.u); - rgbint_sub(&tmpA, &tmpB); + rgbaint_sub(&tmpA, &tmpB); } /* blend RGB */ From e4c911b02295fd0492dcab0a7d7578ff6b748c34 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 8 Jun 2015 15:41:43 +0200 Subject: [PATCH 244/284] spacefb.c: added save state support (nw) --- src/mame/audio/spacefb.c | 8 ++--- src/mame/drivers/spacefb.c | 61 +++++++++++++++++++++---------------- src/mame/includes/spacefb.h | 46 ++++++++++++++++++---------- src/mame/video/spacefb.c | 11 +++++-- 4 files changed, 76 insertions(+), 50 deletions(-) diff --git a/src/mame/audio/spacefb.c b/src/mame/audio/spacefb.c index 12cff3cbf78..16df34c04bf 100644 --- a/src/mame/audio/spacefb.c +++ b/src/mame/audio/spacefb.c @@ -13,25 +13,25 @@ #include "includes/spacefb.h" -READ8_MEMBER(spacefb_state::spacefb_audio_p2_r) +READ8_MEMBER(spacefb_state::audio_p2_r) { return (m_sound_latch & 0x18) << 1; } -READ8_MEMBER(spacefb_state::spacefb_audio_t0_r) +READ8_MEMBER(spacefb_state::audio_t0_r) { return m_sound_latch & 0x20; } -READ8_MEMBER(spacefb_state::spacefb_audio_t1_r) +READ8_MEMBER(spacefb_state::audio_t1_r) { return m_sound_latch & 0x04; } -WRITE8_MEMBER(spacefb_state::spacefb_port_1_w) +WRITE8_MEMBER(spacefb_state::port_1_w) { m_audiocpu->set_input_line(0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/spacefb.c b/src/mame/drivers/spacefb.c index e71440f1164..1cdb1cc1559 100644 --- a/src/mame/drivers/spacefb.c +++ b/src/mame/drivers/spacefb.c @@ -126,6 +126,18 @@ *************************************/ +void spacefb_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch(id) + { + case TIMER_INTERRUPT: + interrupt_callback(ptr, param); + break; + default: + assert_always(FALSE, "Unknown id in spacefb_state::device_timer"); + } +} + TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback) { int next_vpos; @@ -144,13 +156,6 @@ TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback) m_interrupt_timer->adjust(m_screen->time_until_pos(next_vpos)); } - -void spacefb_state::create_interrupt_timer() -{ - m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefb_state::interrupt_callback),this)); -} - - void spacefb_state::start_interrupt_timer() { m_interrupt_timer->adjust(m_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1)); @@ -166,7 +171,9 @@ void spacefb_state::start_interrupt_timer() void spacefb_state::machine_start() { - create_interrupt_timer(); + m_interrupt_timer = timer_alloc(TIMER_INTERRUPT); + + save_item(NAME(m_sound_latch)); } @@ -181,9 +188,9 @@ void spacefb_state::machine_reset() { address_space &space = m_maincpu->space(AS_IO); /* the 3 output ports are cleared on reset */ - spacefb_port_0_w(space, 0, 0); - spacefb_port_1_w(space, 0, 0); - spacefb_port_2_w(space, 0, 0); + port_0_w(space, 0, 0); + port_1_w(space, 0, 0); + port_2_w(space, 0, 0); start_interrupt_timer(); } @@ -226,18 +233,18 @@ static ADDRESS_MAP_START( spacefb_main_io_map, AS_IO, 8, spacefb_state ) AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_RANGE(0x04, 0x07) AM_READNOP /* yes, this is correct (1-of-8 decoder) */ - AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_WRITE(spacefb_port_0_w) - AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_WRITE(spacefb_port_1_w) - AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_WRITE(spacefb_port_2_w) + AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_WRITE(port_0_w) + AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_WRITE(port_1_w) + AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_WRITE(port_2_w) AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_WRITENOP ADDRESS_MAP_END static ADDRESS_MAP_START( spacefb_audio_io_map, AS_IO, 8, spacefb_state ) AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8) - AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(spacefb_audio_p2_r) - AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spacefb_audio_t0_r) - AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(spacefb_audio_t1_r) + AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(audio_p2_r) + AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(audio_t0_r) + AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r) ADDRESS_MAP_END @@ -344,7 +351,7 @@ static MACHINE_CONFIG_START( spacefb, spacefb_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(SPACEFB_PIXEL_CLOCK, SPACEFB_HTOTAL, SPACEFB_HBEND, SPACEFB_HBSTART, SPACEFB_VTOTAL, SPACEFB_VBEND, SPACEFB_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(spacefb_state, screen_update_spacefb) + MCFG_SCREEN_UPDATE_DRIVER(spacefb_state, screen_update) /* audio hardware */ MCFG_FRAGMENT_ADD(spacefb_audio) @@ -597,12 +604,12 @@ ROM_END * *************************************/ -GAME( 1980, spacefb, 0, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 04-u)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacefbe, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 1)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacefbe2,spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 2)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacefba, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 02-a)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacefbg, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo (Gremlin license)", "Space Firebird (Gremlin)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacebrd, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg (Karateco)", "Space Bird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacefbb, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg", "Space Firebird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, spacedem, spacefb, spacefb, spacedem, driver_device, 0, ROT270, "Nintendo (Fortrek license)", "Space Demon", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) -GAME( 1980, starwarr, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg? (Potomac Mortgage)", "Star Warrior", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) +GAME( 1980, spacefb, 0, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 04-u)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacefbe, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 1)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacefbe2,spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 2)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacefba, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 02-a)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacefbg, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo (Gremlin license)", "Space Firebird (Gremlin)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacebrd, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg (Karateco)", "Space Bird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacefbb, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg", "Space Firebird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, spacedem, spacefb, spacefb, spacedem, driver_device, 0, ROT270, "Nintendo (Fortrek license)", "Space Demon", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1980, starwarr, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg? (Potomac Mortgage)", "Star Warrior", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/spacefb.h b/src/mame/includes/spacefb.h index 8476eb7a917..aa141e635ac 100644 --- a/src/mame/includes/spacefb.h +++ b/src/mame/includes/spacefb.h @@ -31,32 +31,43 @@ class spacefb_state : public driver_device public: spacefb_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_samples(*this, "samples"), - m_screen(*this, "screen") { } + m_screen(*this, "screen"), + m_videoram(*this, "videoram") { } + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_samples; + required_device m_screen; + + required_shared_ptr m_videoram; UINT8 m_sound_latch; emu_timer *m_interrupt_timer; - required_shared_ptr m_videoram; UINT8 *m_object_present_map; UINT8 m_port_0; UINT8 m_port_2; UINT32 m_star_shift_reg; double m_color_weights_rg[3]; double m_color_weights_b[2]; - DECLARE_WRITE8_MEMBER(spacefb_port_0_w); - DECLARE_WRITE8_MEMBER(spacefb_port_2_w); - DECLARE_READ8_MEMBER(spacefb_audio_p2_r); - DECLARE_READ8_MEMBER(spacefb_audio_t0_r); - DECLARE_READ8_MEMBER(spacefb_audio_t1_r); - DECLARE_WRITE8_MEMBER(spacefb_port_1_w); + + DECLARE_WRITE8_MEMBER(port_0_w); + DECLARE_WRITE8_MEMBER(port_1_w); + DECLARE_WRITE8_MEMBER(port_2_w); + DECLARE_READ8_MEMBER(audio_p2_r); + DECLARE_READ8_MEMBER(audio_t0_r); + DECLARE_READ8_MEMBER(audio_t1_r); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - UINT32 screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + TIMER_CALLBACK_MEMBER(interrupt_callback); + void start_interrupt_timer(); + + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); inline void shift_star_generator(); void get_starfield_pens(pen_t *pens); void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -64,12 +75,15 @@ public: void draw_bullet(offs_t offs, pen_t pen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip); void draw_sprite(offs_t offs, pen_t *pens, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip); void draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void create_interrupt_timer(); - void start_interrupt_timer(); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_samples; - required_device m_screen; + +protected: + + enum + { + TIMER_INTERRUPT + }; + + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); }; /*----------- defined in audio/spacefb.c -----------*/ diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c index d5a829aaee2..2a6eca758b0 100644 --- a/src/mame/video/spacefb.c +++ b/src/mame/video/spacefb.c @@ -17,14 +17,14 @@ * *************************************/ -WRITE8_MEMBER(spacefb_state::spacefb_port_0_w) +WRITE8_MEMBER(spacefb_state::port_0_w) { m_screen->update_now(); m_port_0 = data; } -WRITE8_MEMBER(spacefb_state::spacefb_port_2_w) +WRITE8_MEMBER(spacefb_state::port_2_w) { m_screen->update_now(); m_port_2 = data; @@ -88,6 +88,11 @@ void spacefb_state::video_start() but most likely, the actual star position is random as the hardware uses whatever value is on the shift register on power-up */ m_star_shift_reg = 0x18f89; + + save_pointer(NAME(m_object_present_map), width * height); + save_item(NAME(m_port_0)); + save_item(NAME(m_port_2)); + save_item(NAME(m_star_shift_reg)); } @@ -391,7 +396,7 @@ void spacefb_state::draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect * *************************************/ -UINT32 spacefb_state::screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +UINT32 spacefb_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { draw_objects(bitmap, cliprect); draw_starfield(screen, bitmap, cliprect); From 80b2fd5662607a843500d86fb60f8f8101f06396 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 8 Jun 2015 16:04:39 +0200 Subject: [PATCH 245/284] shisen.c: added save state support, switched to configured banking (nw) --- src/mame/drivers/shisen.c | 22 +++++++++++----------- src/mame/includes/shisen.h | 28 ++++++++++++++++------------ src/mame/video/shisen.c | 21 ++++++++++----------- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/mame/drivers/shisen.c b/src/mame/drivers/shisen.c index fc71a4cfeff..cc5b58b7125 100644 --- a/src/mame/drivers/shisen.c +++ b/src/mame/drivers/shisen.c @@ -14,7 +14,7 @@ driver by Nicola Salmoria #include "sound/2151intf.h" #include "includes/shisen.h" -READ8_MEMBER(shisen_state::sichuan2_dsw1_r) +READ8_MEMBER(shisen_state::dsw1_r) { int ret = ioport("DSW1")->read(); @@ -33,7 +33,7 @@ READ8_MEMBER(shisen_state::sichuan2_dsw1_r) return ret; } -WRITE8_MEMBER(shisen_state::sichuan2_coin_w) +WRITE8_MEMBER(shisen_state::coin_w) { if ((data & 0xf9) != 0x01) logerror("coin ctrl = %02x\n",data); @@ -46,16 +46,16 @@ WRITE8_MEMBER(shisen_state::sichuan2_coin_w) static ADDRESS_MAP_START( shisen_map, AS_PROGRAM, 8, shisen_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") - AM_RANGE(0xc800, 0xcaff) AM_RAM_WRITE(sichuan2_paletteram_w) AM_SHARE("paletteram") - AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(sichuan2_videoram_w) AM_SHARE("videoram") + AM_RANGE(0xc800, 0xcaff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram") + AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0xe000, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( shisen_io_map, AS_IO, 8, shisen_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READWRITE(sichuan2_dsw1_r, sichuan2_coin_w) + AM_RANGE(0x00, 0x00) AM_READWRITE(dsw1_r, coin_w) AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2") AM_DEVWRITE("m72", m72_audio_device, sound_command_byte_w) - AM_RANGE(0x02, 0x02) AM_READ_PORT("P1") AM_WRITE(sichuan2_bankswitch_w) + AM_RANGE(0x02, 0x02) AM_READ_PORT("P1") AM_WRITE(bankswitch_w) AM_RANGE(0x03, 0x03) AM_READ_PORT("P2") AM_RANGE(0x04, 0x04) AM_READ_PORT("COIN") ADDRESS_MAP_END @@ -222,7 +222,7 @@ static MACHINE_CONFIG_START( shisen, shisen_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(shisen_state, screen_update_sichuan2) + MCFG_SCREEN_UPDATE_DRIVER(shisen_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", shisen) @@ -423,7 +423,7 @@ ROM_START( matchit ) /* no samples on this board */ ROM_END -GAME( 1989, matchit, 0, shisen, matchit, driver_device, 0, ROT0, "Tamtex", "Match It", 0 ) -GAME( 1989, shisen, matchit, shisen, shisen, driver_device, 0, ROT0, "Tamtex", "Shisensho - Joshiryo-Hen (Japan)", 0 ) -GAME( 1989, sichuan2, matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 1)", 0 ) -GAME( 1989, sichuan2a,matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 2)", 0 ) +GAME( 1989, matchit, 0, shisen, matchit, driver_device, 0, ROT0, "Tamtex", "Match It", GAME_SUPPORTS_SAVE ) +GAME( 1989, shisen, matchit, shisen, shisen, driver_device, 0, ROT0, "Tamtex", "Shisensho - Joshiryo-Hen (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1989, sichuan2, matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1989, sichuan2a,matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 2)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/shisen.h b/src/mame/includes/shisen.h index 43c11e1e6e0..a93ddf0e5c8 100644 --- a/src/mame/includes/shisen.h +++ b/src/mame/includes/shisen.h @@ -7,29 +7,33 @@ class shisen_state : public driver_device public: shisen_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_paletteram(*this, "paletteram"), - m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu"), m_audio (*this, "m72"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } - - required_shared_ptr m_paletteram; - required_shared_ptr m_videoram; + m_palette(*this, "palette"), + m_paletteram(*this, "paletteram"), + m_videoram(*this, "videoram") { } required_device m_maincpu; required_device m_audio; required_device m_gfxdecode; required_device m_palette; + required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + int m_gfxbank; tilemap_t *m_bg_tilemap; - DECLARE_READ8_MEMBER(sichuan2_dsw1_r); - DECLARE_WRITE8_MEMBER(sichuan2_coin_w); - DECLARE_WRITE8_MEMBER(sichuan2_videoram_w); - DECLARE_WRITE8_MEMBER(sichuan2_bankswitch_w); - DECLARE_WRITE8_MEMBER(sichuan2_paletteram_w); + + DECLARE_READ8_MEMBER(dsw1_r); + DECLARE_WRITE8_MEMBER(coin_w); + DECLARE_WRITE8_MEMBER(videoram_w); + DECLARE_WRITE8_MEMBER(bankswitch_w); + DECLARE_WRITE8_MEMBER(paletteram_w); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + virtual void video_start(); - UINT32 screen_update_sichuan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c index 411137174ba..09b44481daa 100644 --- a/src/mame/video/shisen.c +++ b/src/mame/video/shisen.c @@ -3,26 +3,21 @@ #include "emu.h" #include "includes/shisen.h" -WRITE8_MEMBER(shisen_state::sichuan2_videoram_w) +WRITE8_MEMBER(shisen_state::videoram_w) { m_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset / 2); } -WRITE8_MEMBER(shisen_state::sichuan2_bankswitch_w) +WRITE8_MEMBER(shisen_state::bankswitch_w) { - int bankaddress; - int bank; - UINT8 *RAM = memregion("maincpu")->base(); - if (data & 0xc0) logerror("bank switch %02x\n",data); /* bits 0-2 select ROM bank */ - bankaddress = 0x10000 + (data & 0x07) * 0x4000; - membank("bank1")->set_base(&RAM[bankaddress]); + membank("bank1")->set_entry(data & 0x07); /* bits 3-5 select gfx bank */ - bank = (data & 0x38) >> 3; + int bank = (data & 0x38) >> 3; if (m_gfxbank != bank) { @@ -33,7 +28,7 @@ WRITE8_MEMBER(shisen_state::sichuan2_bankswitch_w) /* bits 6-7 unknown */ } -WRITE8_MEMBER(shisen_state::sichuan2_paletteram_w) +WRITE8_MEMBER(shisen_state::paletteram_w) { m_paletteram[offset] = data; @@ -55,9 +50,13 @@ void shisen_state::video_start() { m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shisen_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); + + save_item(NAME(m_gfxbank)); } -UINT32 shisen_state::screen_update_sichuan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 shisen_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // on Irem boards, screen flip is handled in both hardware and software. // this game doesn't have cocktail mode so if there's software control we don't From 3fe76782eae65851f78c9192342638c4ebe921ea Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 14:48:49 +0200 Subject: [PATCH 246/284] pcd: fix copyright, use correct drive --- src/mess/drivers/pcd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c index fd1bdd664ed..3460beb278e 100644 --- a/src/mess/drivers/pcd.c +++ b/src/mess/drivers/pcd.c @@ -1,5 +1,5 @@ // license:GPL-2.0+ -// copyright-holders:Dirk Best +// copyright-holders:Dirk Best, Carl /*************************************************************************** Siemens PC-D @@ -436,9 +436,8 @@ ADDRESS_MAP_END //************************************************************************** static SLOT_INTERFACE_START( pcd_floppies ) - SLOT_INTERFACE("55f", TEAC_FD_55F) - SLOT_INTERFACE("55g", TEAC_FD_55G) - SLOT_INTERFACE("525dsqd", FLOPPY_525_QD) // the devices above cause a crash in floppy_image_format_t::generate_track_from_levels + SLOT_INTERFACE("55f", TEAC_FD_55F) // 80 tracks + SLOT_INTERFACE("55g", TEAC_FD_55G) // 77 tracks SLOT_INTERFACE_END FLOPPY_FORMATS_MEMBER( pcd_state::floppy_formats ) @@ -476,8 +475,8 @@ static MACHINE_CONFIG_START( pcd, pcd_state ) MCFG_WD_FDC_ENMF_CALLBACK(GND) // floppy drives - MCFG_FLOPPY_DRIVE_ADD("fdc:0", pcd_floppies, "525dsqd", pcd_state::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("fdc:1", pcd_floppies, "525dsqd", pcd_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", pcd_floppies, "55f", pcd_state::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("fdc:1", pcd_floppies, "55f", pcd_state::floppy_formats) // usart MCFG_DEVICE_ADD("usart1", MC2661, XTAL_4_9152MHz) From b9ec23859a72f57d33255f55b3c08dbb2698a0f4 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 15:06:24 +0200 Subject: [PATCH 247/284] apricotf/apricotp: cleanups (nw) --- src/mess/drivers/apricotf.c | 81 +++++++++++++++++++++- src/mess/drivers/apricotp.c | 116 +++++++++++++++++++++++++++++-- src/mess/includes/apricotf.h | 96 ------------------------- src/mess/includes/apricotp.h | 131 ----------------------------------- 4 files changed, 192 insertions(+), 232 deletions(-) delete mode 100644 src/mess/includes/apricotf.h delete mode 100644 src/mess/includes/apricotp.h diff --git a/src/mess/drivers/apricotf.c b/src/mess/drivers/apricotf.c index df67ba10e95..2aa58759f8c 100644 --- a/src/mess/drivers/apricotf.c +++ b/src/mess/drivers/apricotf.c @@ -24,10 +24,89 @@ */ -#include "includes/apricotf.h" +#include "emu.h" +#include "cpu/i86/i86.h" +#include "cpu/z80/z80daisy.h" +#include "imagedev/flopdrv.h" +#include "machine/apricotkb.h" +#include "machine/buffer.h" +#include "bus/centronics/ctronics.h" +#include "machine/wd_fdc.h" +#include "machine/z80ctc.h" +#include "machine/z80dart.h" #include "formats/apridisk.h" +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** + +#define SCREEN_TAG "screen" +#define I8086_TAG "10d" +#define Z80CTC_TAG "13d" +#define Z80SIO2_TAG "15d" +#define WD2797_TAG "5f" +#define CENTRONICS_TAG "centronics" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> f1_state + +class f1_state : public driver_device +{ +public: + f1_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, I8086_TAG), + m_ctc(*this, Z80CTC_TAG), + m_sio(*this, Z80SIO2_TAG), + m_fdc(*this, WD2797_TAG), + m_floppy0(*this, WD2797_TAG ":0"), + m_floppy1(*this, WD2797_TAG ":1"), + m_centronics(*this, CENTRONICS_TAG), + m_cent_data_out(*this, "cent_data_out"), + m_ctc_int(CLEAR_LINE), + m_sio_int(CLEAR_LINE), + m_p_scrollram(*this, "p_scrollram"), + m_p_paletteram(*this, "p_paletteram"), + m_palette(*this, "palette") + { } + + DECLARE_FLOPPY_FORMATS(floppy_formats); + + virtual void machine_start(); + + required_device m_maincpu; + required_device m_ctc; + required_device m_sio; + required_device m_fdc; + required_device m_floppy0; + required_device m_floppy1; + required_device m_centronics; + required_device m_cent_data_out; + int m_ctc_int; + int m_sio_int; + required_shared_ptr m_p_scrollram; + required_shared_ptr m_p_paletteram; + required_device m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + DECLARE_READ16_MEMBER( palette_r ); + DECLARE_WRITE16_MEMBER( palette_w ); + DECLARE_WRITE8_MEMBER( system_w ); + DECLARE_WRITE_LINE_MEMBER( sio_int_w ); + DECLARE_WRITE_LINE_MEMBER( ctc_int_w ); + DECLARE_WRITE_LINE_MEMBER( ctc_z1_w ); + DECLARE_WRITE_LINE_MEMBER( ctc_z2_w ); + + int m_40_80; + int m_200_256; +}; + //************************************************************************** // VIDEO diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c index 7ff45b011db..86073ccda98 100644 --- a/src/mess/drivers/apricotp.c +++ b/src/mess/drivers/apricotp.c @@ -24,15 +24,43 @@ */ -#include "includes/apricotp.h" +#include "emu.h" +#include "cpu/i86/i86.h" +#include "cpu/m6800/m6800.h" +#include "machine/am9517a.h" +#include "machine/apricotkb.h" +#include "bus/centronics/ctronics.h" +#include "machine/pic8259.h" +#include "machine/pit8253.h" +#include "machine/ram.h" +#include "machine/wd_fdc.h" +#include "machine/z80dart.h" +#include "sound/sn76496.h" +#include "video/mc6845.h" #include "formats/apridisk.h" #include "apricotp.lh" +//************************************************************************** +// MACROS / CONSTANTS +//************************************************************************** -//************************************************************************** -// MACROS/CONSTANTS -//************************************************************************** +#define I8086_TAG "ic7" +#define I8284_TAG "ic30" +#define I8237_TAG "ic17" +#define I8259A_TAG "ic51" +#define I8253A5_TAG "ic20" +#define TMS4500_TAG "ic42" +#define MC6845_TAG "ic69" +#define HD63B01V1_TAG "ic29" +#define AD7574_TAG "ic34" +#define AD1408_TAG "ic37" +#define Z80SIO0_TAG "ic6" +#define WD2797_TAG "ic5" +#define SN76489AN_TAG "ic13" +#define CENTRONICS_TAG "centronics" +#define SCREEN_LCD_TAG "screen0" +#define SCREEN_CRT_TAG "screen1" enum { @@ -46,6 +74,86 @@ enum }; +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> fp_state + +class fp_state : public driver_device +{ +public: + fp_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, I8086_TAG), + m_soundcpu(*this, HD63B01V1_TAG), + m_dmac(*this, I8237_TAG), + m_pic(*this, I8259A_TAG), + m_pit(*this, I8253A5_TAG), + m_sio(*this, Z80SIO0_TAG), + m_fdc(*this, WD2797_TAG), + m_crtc(*this, MC6845_TAG), + m_ram(*this, RAM_TAG), + m_floppy0(*this, WD2797_TAG":0"), + m_floppy1(*this, WD2797_TAG":1"), + m_floppy(NULL), + m_centronics(*this, CENTRONICS_TAG), + m_work_ram(*this, "work_ram"), + m_video_ram(*this, "video_ram") + { } + + DECLARE_FLOPPY_FORMATS(floppy_formats); + + required_device m_maincpu; + required_device m_soundcpu; + required_device m_dmac; + required_device m_pic; + required_device m_pit; + required_device m_sio; + required_device m_fdc; + required_device m_crtc; + required_device m_ram; + required_device m_floppy0; + required_device m_floppy1; + floppy_image_device *m_floppy; + required_device m_centronics; + + virtual void machine_start(); + virtual void machine_reset(); + + virtual void video_start(); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + MC6845_UPDATE_ROW(update_row); + DECLARE_READ16_MEMBER( mem_r ); + DECLARE_WRITE16_MEMBER( mem_w ); + DECLARE_READ8_MEMBER( prtr_snd_r ); + DECLARE_WRITE8_MEMBER( pint_clr_w ); + DECLARE_WRITE8_MEMBER( ls_w ); + DECLARE_WRITE8_MEMBER( contrast_w ); + DECLARE_WRITE8_MEMBER( palette_w ); + DECLARE_WRITE16_MEMBER( video_w ); + DECLARE_WRITE8_MEMBER( lat_w ); + + void lat_ls259_w(offs_t offset, int state); + + optional_shared_ptr m_work_ram; + + // video state + optional_shared_ptr m_video_ram; + UINT8 m_video; + + int m_centronics_busy; + int m_centronics_select; + int m_centronics_fault; + int m_centronics_perror; + + DECLARE_WRITE_LINE_MEMBER( write_centronics_busy ); + DECLARE_WRITE_LINE_MEMBER( write_centronics_select ); + DECLARE_WRITE_LINE_MEMBER( write_centronics_fault ); + DECLARE_WRITE_LINE_MEMBER( write_centronics_perror ); +}; + //************************************************************************** // VIDEO diff --git a/src/mess/includes/apricotf.h b/src/mess/includes/apricotf.h deleted file mode 100644 index bb2aa226757..00000000000 --- a/src/mess/includes/apricotf.h +++ /dev/null @@ -1,96 +0,0 @@ - // license:BSD-3-Clause -// copyright-holders:Angelo Salese, Robbbert -#pragma once - -#ifndef __APRICOTF__ -#define __APRICOTF__ - - -#include "emu.h" -#include "cpu/i86/i86.h" -#include "cpu/z80/z80daisy.h" -#include "imagedev/flopdrv.h" -#include "machine/apricotkb.h" -#include "machine/buffer.h" -#include "bus/centronics/ctronics.h" -#include "machine/wd_fdc.h" -#include "machine/z80ctc.h" -#include "machine/z80dart.h" -#include "rendlay.h" - - - -//************************************************************************** -// MACROS / CONSTANTS -//************************************************************************** - -#define SCREEN_TAG "screen" -#define I8086_TAG "10d" -#define Z80CTC_TAG "13d" -#define Z80SIO2_TAG "15d" -#define WD2797_TAG "5f" -#define CENTRONICS_TAG "centronics" - - - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> f1_state - -class f1_state : public driver_device -{ -public: - f1_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, I8086_TAG), - m_ctc(*this, Z80CTC_TAG), - m_sio(*this, Z80SIO2_TAG), - m_fdc(*this, WD2797_TAG), - m_floppy0(*this, WD2797_TAG ":0"), - m_floppy1(*this, WD2797_TAG ":1"), - m_centronics(*this, CENTRONICS_TAG), - m_cent_data_out(*this, "cent_data_out"), - m_ctc_int(CLEAR_LINE), - m_sio_int(CLEAR_LINE), - m_p_scrollram(*this, "p_scrollram"), - m_p_paletteram(*this, "p_paletteram"), - m_palette(*this, "palette") - { } - - DECLARE_FLOPPY_FORMATS(floppy_formats); - - virtual void machine_start(); - - required_device m_maincpu; - required_device m_ctc; - required_device m_sio; - required_device m_fdc; - required_device m_floppy0; - required_device m_floppy1; - required_device m_centronics; - required_device m_cent_data_out; - int m_ctc_int; - int m_sio_int; - required_shared_ptr m_p_scrollram; - required_shared_ptr m_p_paletteram; - required_device m_palette; - - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - DECLARE_READ16_MEMBER( palette_r ); - DECLARE_WRITE16_MEMBER( palette_w ); - DECLARE_WRITE8_MEMBER( system_w ); - DECLARE_WRITE_LINE_MEMBER( sio_int_w ); - DECLARE_WRITE_LINE_MEMBER( ctc_int_w ); - DECLARE_WRITE_LINE_MEMBER( ctc_z1_w ); - DECLARE_WRITE_LINE_MEMBER( ctc_z2_w ); - - int m_40_80; - int m_200_256; -}; - - - -#endif diff --git a/src/mess/includes/apricotp.h b/src/mess/includes/apricotp.h deleted file mode 100644 index f932245e4e2..00000000000 --- a/src/mess/includes/apricotp.h +++ /dev/null @@ -1,131 +0,0 @@ -// license:LGPL-2.1+ -// copyright-holders:Angelo Salese, Dirk Best -#pragma once - -#ifndef __APRICOTP__ -#define __APRICOTP__ - - -#include "emu.h" -#include "cpu/i86/i86.h" -#include "cpu/m6800/m6800.h" -#include "machine/am9517a.h" -#include "machine/apricotkb.h" -#include "bus/centronics/ctronics.h" -#include "machine/pic8259.h" -#include "machine/pit8253.h" -#include "machine/ram.h" -#include "machine/wd_fdc.h" -#include "machine/z80dart.h" -#include "sound/sn76496.h" -#include "video/mc6845.h" -#include "rendlay.h" - - - -//************************************************************************** -// MACROS / CONSTANTS -//************************************************************************** - -#define I8086_TAG "ic7" -#define I8284_TAG "ic30" -#define I8237_TAG "ic17" -#define I8259A_TAG "ic51" -#define I8253A5_TAG "ic20" -#define TMS4500_TAG "ic42" -#define MC6845_TAG "ic69" -#define HD63B01V1_TAG "ic29" -#define AD7574_TAG "ic34" -#define AD1408_TAG "ic37" -#define Z80SIO0_TAG "ic6" -#define WD2797_TAG "ic5" -#define SN76489AN_TAG "ic13" -#define CENTRONICS_TAG "centronics" -#define SCREEN_LCD_TAG "screen0" -#define SCREEN_CRT_TAG "screen1" - - - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> fp_state - -class fp_state : public driver_device -{ -public: - fp_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, I8086_TAG), - m_soundcpu(*this, HD63B01V1_TAG), - m_dmac(*this, I8237_TAG), - m_pic(*this, I8259A_TAG), - m_pit(*this, I8253A5_TAG), - m_sio(*this, Z80SIO0_TAG), - m_fdc(*this, WD2797_TAG), - m_crtc(*this, MC6845_TAG), - m_ram(*this, RAM_TAG), - m_floppy0(*this, WD2797_TAG":0"), - m_floppy1(*this, WD2797_TAG":1"), - m_floppy(NULL), - m_centronics(*this, CENTRONICS_TAG), - m_work_ram(*this, "work_ram"), - m_video_ram(*this, "video_ram") - { } - - DECLARE_FLOPPY_FORMATS(floppy_formats); - - required_device m_maincpu; - required_device m_soundcpu; - required_device m_dmac; - required_device m_pic; - required_device m_pit; - required_device m_sio; - required_device m_fdc; - required_device m_crtc; - required_device m_ram; - required_device m_floppy0; - required_device m_floppy1; - floppy_image_device *m_floppy; - required_device m_centronics; - - virtual void machine_start(); - virtual void machine_reset(); - - virtual void video_start(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - MC6845_UPDATE_ROW(update_row); - DECLARE_READ16_MEMBER( mem_r ); - DECLARE_WRITE16_MEMBER( mem_w ); - DECLARE_READ8_MEMBER( prtr_snd_r ); - DECLARE_WRITE8_MEMBER( pint_clr_w ); - DECLARE_WRITE8_MEMBER( ls_w ); - DECLARE_WRITE8_MEMBER( contrast_w ); - DECLARE_WRITE8_MEMBER( palette_w ); - DECLARE_WRITE16_MEMBER( video_w ); - DECLARE_WRITE8_MEMBER( lat_w ); - - void lat_ls259_w(offs_t offset, int state); - - optional_shared_ptr m_work_ram; - - // video state - optional_shared_ptr m_video_ram; - UINT8 m_video; - - int m_centronics_busy; - int m_centronics_select; - int m_centronics_fault; - int m_centronics_perror; - - DECLARE_WRITE_LINE_MEMBER( write_centronics_busy ); - DECLARE_WRITE_LINE_MEMBER( write_centronics_select ); - DECLARE_WRITE_LINE_MEMBER( write_centronics_fault ); - DECLARE_WRITE_LINE_MEMBER( write_centronics_perror ); -}; - - - -#endif From 1127eb2fc7e8fc873a946f9a098c4c3612ef84a6 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 8 Jun 2015 09:32:15 -0500 Subject: [PATCH 248/284] remove unneeded disabled code (nw) --- src/mess/drivers/m20.c | 3 -- src/mess/drivers/qx10.c | 68 ----------------------------------------- 2 files changed, 71 deletions(-) diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c index ad833a89f99..dc4c20ea2b5 100644 --- a/src/mess/drivers/m20.c +++ b/src/mess/drivers/m20.c @@ -94,10 +94,7 @@ public: DECLARE_WRITE_LINE_MEMBER(timer_tick_w); private: - //bool m_kbrecv_in_progress; - //int m_kbrecv_bitcount; offs_t m_memsize; - //UINT16 m_kbrecv_data; UINT8 m_port21; void install_memory(); diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c index 86d14dd1030..58050c4055f 100644 --- a/src/mess/drivers/qx10.c +++ b/src/mess/drivers/qx10.c @@ -466,74 +466,6 @@ READ8_MEMBER( qx10_state::get_slave_ack ) */ -#if 0 -READ8_MEMBER( qx10_state::upd7201_r ) -{ - if((offset & 2) == 0) - { - return m_keyb.rx; - } - //printf("R [%02x]\n",offset); - - return m_rs232c.rx; -} - -WRITE8_MEMBER( qx10_state::upd7201_w ) -{ - if((offset & 2) == 0) //keyb TX - { - switch(data & 0xe0) - { - case 0x00: - m_keyb.repeat_start_time = 300+(data & 0x1f)*25; - printf("keyb Set repeat start time, %d ms\n",m_keyb.repeat_start_time); - break; - case 0x20: - m_keyb.repeat_interval = 30+(data & 0x1f)*5; - printf("keyb Set repeat interval, %d ms\n",m_keyb.repeat_interval); - break; - case 0x40: - m_keyb.led[(data & 0xe) >> 1] = data & 1; - printf("keyb Set led %02x %s\n",((data & 0xe) >> 1),data & 1 ? "on" : "off"); - m_keyb.rx = (data & 0xf) | 0xc0; - m_pic_m->ir4_w(1); - break; - case 0x60: - printf("keyb Read LED status\n"); - // 0x80 + data - break; - case 0x80: - printf("keyb Read SW status\n"); - // 0xc0 + data - break; - case 0xa0: - m_keyb.repeat = data & 1; - //printf("keyb repeat flag issued %s\n",data & 1 ? "on" : "off"); - break; - case 0xc0: - m_keyb.enable = data & 1; - printf("keyb Enable flag issued %s\n",data & 1 ? "on" : "off"); - break; - case 0xe0: - printf("keyb Reset Issued, diagnostic is %s\n",data & 1 ? "on" : "off"); - m_keyb.rx = 0; - break; - } - } - else //RS-232c TX - { - //printf("RS-232c W %02x\n",data); - if(data == 0x01) //cheap, but needed for working inputs in "The QX-10 Diagnostic" - m_rs232c.rx = 0x04; - else if(data == 0x00) - m_rs232c.rx = 0xfe; - else - m_rs232c.rx = 0xff; - } - -} -#endif - READ8_MEMBER( qx10_state::vram_bank_r ) { return m_vram_bank; From 12879a404494d52aafe8ad92c7361aed08595968 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 8 Jun 2015 17:09:17 +0200 Subject: [PATCH 249/284] sprcros2.c: switched to configured banking, enabled save state support (nw) --- src/mame/drivers/sprcros2.c | 45 ++++++++++++++++--------------- src/mame/includes/sprcros2.h | 51 ++++++++++++++++++++---------------- src/mame/video/sprcros2.c | 18 ++++++------- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/src/mame/drivers/sprcros2.c b/src/mame/drivers/sprcros2.c index 473fbce281a..0dfb244cc01 100644 --- a/src/mame/drivers/sprcros2.c +++ b/src/mame/drivers/sprcros2.c @@ -64,10 +64,8 @@ Notes: -WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w) +WRITE8_MEMBER(sprcros2_state::m_port7_w) { - UINT8 *RAM = memregion("master")->base(); - //76543210 //x------- unused //-x------ bankswitch halves of scm-01.10k into c000-dfff @@ -78,17 +76,15 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w) //-------x nmi enable if((m_port7^data)&0x40) - membank("bank1")->set_base(&RAM[0x10000+((data&0x40)<<7)]); + membank("masterbank")->set_entry((data&0x40)>>6); machine().tilemap().set_flip_all(data&0x02?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 ); m_port7 = data; } -WRITE8_MEMBER(sprcros2_state::sprcros2_s_port3_w) +WRITE8_MEMBER(sprcros2_state::s_port3_w) { - UINT8 *RAM = memregion("slave")->base(); - //76543210 //xxxx---- unused //----x--- bankswitch halves of scs-27.5k into c000-dfff @@ -96,15 +92,15 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_s_port3_w) //-------x nmi enable if((m_s_port3^data)&0x08) - membank("bank2")->set_base(&RAM[0x10000+((data&0x08)<<10)]); + membank("slavebank")->set_entry((data&0x08)>>3); m_s_port3 = data; } static ADDRESS_MAP_START( sprcros2_master_map, AS_PROGRAM, 8, sprcros2_state ) AM_RANGE(0x0000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("bank1") - AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(sprcros2_fgvideoram_w) AM_SHARE("fgvideoram") + AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("masterbank") + AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram") AM_RANGE(0xe800, 0xe817) AM_RAM //always zero AM_RANGE(0xe818, 0xe83f) AM_RAM AM_SHARE("spriteram") AM_RANGE(0xe840, 0xefff) AM_RAM //always zero @@ -119,13 +115,13 @@ static ADDRESS_MAP_START( sprcros2_master_io_map, AS_IO, 8, sprcros2_state ) AM_RANGE(0x02, 0x02) AM_READ_PORT("EXTRA") AM_DEVWRITE("sn3", sn76489_device, write) AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1") AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW2") - AM_RANGE(0x07, 0x07) AM_WRITE(sprcros2_m_port7_w) + AM_RANGE(0x07, 0x07) AM_WRITE(m_port7_w) ADDRESS_MAP_END static ADDRESS_MAP_START( sprcros2_slave_map, AS_PROGRAM, 8, sprcros2_state ) AM_RANGE(0x0000, 0xbfff) AM_ROM - AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("bank2") - AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(sprcros2_bgvideoram_w) AM_SHARE("bgvideoram") + AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("slavebank") + AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram") AM_RANGE(0xe800, 0xefff) AM_RAM //always zero AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1") @@ -133,9 +129,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sprcros2_slave_io_map, AS_IO, 8, sprcros2_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_WRITE(sprcros2_bgscrollx_w) - AM_RANGE(0x01, 0x01) AM_WRITE(sprcros2_bgscrolly_w) - AM_RANGE(0x03, 0x03) AM_WRITE(sprcros2_s_port3_w) + AM_RANGE(0x00, 0x00) AM_WRITE(bgscrollx_w) + AM_RANGE(0x01, 0x01) AM_WRITE(bgscrolly_w) + AM_RANGE(0x03, 0x03) AM_WRITE(s_port3_w) ADDRESS_MAP_END static INPUT_PORTS_START( sprcros2 ) @@ -230,7 +226,7 @@ static GFXDECODE_START( sprcros2 ) GFXDECODE_ENTRY( "gfx3", 0, sprcros2_fglayout, 512, 64 ) GFXDECODE_END -TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::sprcros2_m_interrupt) +TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::m_interrupt) { int scanline = param; @@ -246,7 +242,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::sprcros2_m_interrupt) } } -INTERRUPT_GEN_MEMBER(sprcros2_state::sprcros2_s_interrupt) +INTERRUPT_GEN_MEMBER(sprcros2_state::s_interrupt) { if(m_s_port3&0x01) device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -254,6 +250,9 @@ INTERRUPT_GEN_MEMBER(sprcros2_state::sprcros2_s_interrupt) void sprcros2_state::machine_start() { + membank("masterbank")->configure_entries(0, 2, memregion("master")->base() + 0x10000, 0x2000); + membank("slavebank")->configure_entries(0, 2, memregion("slave")->base() + 0x10000, 0x2000); + save_item(NAME(m_port7)); save_item(NAME(m_s_port3)); } @@ -264,12 +263,12 @@ static MACHINE_CONFIG_START( sprcros2, sprcros2_state ) MCFG_CPU_ADD("master", Z80,10000000/2) MCFG_CPU_PROGRAM_MAP(sprcros2_master_map) MCFG_CPU_IO_MAP(sprcros2_master_io_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, sprcros2_m_interrupt, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, m_interrupt, "screen", 0, 1) MCFG_CPU_ADD("slave", Z80,10000000/2) MCFG_CPU_PROGRAM_MAP(sprcros2_slave_map) MCFG_CPU_IO_MAP(sprcros2_slave_io_map) - MCFG_CPU_PERIODIC_INT_DRIVER(sprcros2_state, sprcros2_s_interrupt, 2*60) //2 nmis + MCFG_CPU_PERIODIC_INT_DRIVER(sprcros2_state, s_interrupt, 2*60) //2 nmis /* video hardware */ @@ -278,7 +277,7 @@ static MACHINE_CONFIG_START( sprcros2, sprcros2_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(sprcros2_state, screen_update_sprcros2) + MCFG_SCREEN_UPDATE_DRIVER(sprcros2_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", sprcros2) @@ -372,5 +371,5 @@ ROM_START( sprcros2a ) ROM_LOAD( "sc-60.4k", 0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) ) //fg clut ROM_END -GAME( 1986, sprcros2, 0, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", 0 ) -GAME( 1986, sprcros2a,sprcros2, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", 0 ) +GAME( 1986, sprcros2, 0, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", GAME_SUPPORTS_SAVE ) +GAME( 1986, sprcros2a,sprcros2, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/sprcros2.h b/src/mame/includes/sprcros2.h index 4d6cdcfee2f..c0b312005d3 100644 --- a/src/mame/includes/sprcros2.h +++ b/src/mame/includes/sprcros2.h @@ -5,40 +5,45 @@ class sprcros2_state : public driver_device public: sprcros2_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_fgvideoram(*this, "fgvideoram"), - m_bgvideoram(*this, "bgvideoram"), - m_spriteram(*this, "spriteram"), m_master(*this,"master"), m_slave(*this,"slave"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } - - UINT8 m_s_port3; - UINT8 m_port7; - tilemap_t *m_bgtilemap; - tilemap_t *m_fgtilemap; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_spriteram; + m_palette(*this, "palette"), + m_fgvideoram(*this, "fgvideoram"), + m_bgvideoram(*this, "bgvideoram"), + m_spriteram(*this, "spriteram") { } required_device m_master; required_device m_slave; required_device m_gfxdecode; required_device m_palette; - DECLARE_WRITE8_MEMBER(sprcros2_m_port7_w); - DECLARE_WRITE8_MEMBER(sprcros2_s_port3_w); - DECLARE_WRITE8_MEMBER(sprcros2_fgvideoram_w); - DECLARE_WRITE8_MEMBER(sprcros2_bgvideoram_w); - DECLARE_WRITE8_MEMBER(sprcros2_bgscrollx_w); - DECLARE_WRITE8_MEMBER(sprcros2_bgscrolly_w); - TILE_GET_INFO_MEMBER(get_sprcros2_bgtile_info); - TILE_GET_INFO_MEMBER(get_sprcros2_fgtile_info); + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_spriteram; + + UINT8 m_s_port3; + UINT8 m_port7; + tilemap_t *m_bgtilemap; + tilemap_t *m_fgtilemap; + + DECLARE_WRITE8_MEMBER(m_port7_w); + DECLARE_WRITE8_MEMBER(s_port3_w); + DECLARE_WRITE8_MEMBER(fgvideoram_w); + DECLARE_WRITE8_MEMBER(bgvideoram_w); + DECLARE_WRITE8_MEMBER(bgscrollx_w); + DECLARE_WRITE8_MEMBER(bgscrolly_w); + + TILE_GET_INFO_MEMBER(get_bgtile_info); + TILE_GET_INFO_MEMBER(get_fgtile_info); + virtual void machine_start(); virtual void video_start(); DECLARE_PALETTE_INIT(sprcros2); - UINT32 screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(sprcros2_s_interrupt); - TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_m_interrupt); + + INTERRUPT_GEN_MEMBER(s_interrupt); + TIMER_DEVICE_CALLBACK_MEMBER(m_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c index c1745e0e8e1..a64da9bfafc 100644 --- a/src/mame/video/sprcros2.c +++ b/src/mame/video/sprcros2.c @@ -59,19 +59,19 @@ PALETTE_INIT_MEMBER(sprcros2_state, sprcros2) } } -WRITE8_MEMBER(sprcros2_state::sprcros2_fgvideoram_w) +WRITE8_MEMBER(sprcros2_state::fgvideoram_w) { m_fgvideoram[offset] = data; m_fgtilemap->mark_tile_dirty(offset&0x3ff); } -WRITE8_MEMBER(sprcros2_state::sprcros2_bgvideoram_w) +WRITE8_MEMBER(sprcros2_state::bgvideoram_w) { m_bgvideoram[offset] = data; m_bgtilemap->mark_tile_dirty(offset&0x3ff); } -WRITE8_MEMBER(sprcros2_state::sprcros2_bgscrollx_w) +WRITE8_MEMBER(sprcros2_state::bgscrollx_w) { if(m_port7&0x02) m_bgtilemap->set_scrollx(0, 0x100-data); @@ -79,12 +79,12 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_bgscrollx_w) m_bgtilemap->set_scrollx(0, data); } -WRITE8_MEMBER(sprcros2_state::sprcros2_bgscrolly_w) +WRITE8_MEMBER(sprcros2_state::bgscrolly_w) { m_bgtilemap->set_scrolly(0, data); } -TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_bgtile_info) +TILE_GET_INFO_MEMBER(sprcros2_state::get_bgtile_info) { UINT32 tile_number = m_bgvideoram[tile_index]; UINT8 attr = m_bgvideoram[tile_index + 0x400]; @@ -103,7 +103,7 @@ TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_bgtile_info) (attr&0x08)?TILE_FLIPX:0); } -TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_fgtile_info) +TILE_GET_INFO_MEMBER(sprcros2_state::get_fgtile_info) { UINT32 tile_number = m_fgvideoram[tile_index]; UINT8 attr = m_fgvideoram[tile_index + 0x400]; @@ -126,8 +126,8 @@ TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_fgtile_info) void sprcros2_state::video_start() { - m_bgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_bgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_fgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_fgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_bgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_fgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_fgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_fgtilemap->configure_groups(*m_gfxdecode->gfx(2), 0); } @@ -178,7 +178,7 @@ void sprcros2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect } } -UINT32 sprcros2_state::screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 sprcros2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bgtilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); From af38621a8bbab8976cd0f9c87a247e356f2d1147 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 8 Jun 2015 11:46:18 -0500 Subject: [PATCH 250/284] ax20: connect floppy, will read pc disks but requires it's own apparently unavailable msdos to boot (nw) --- src/mess/drivers/ax20.c | 47 +++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/src/mess/drivers/ax20.c b/src/mess/drivers/ax20.c index b2328c9406b..9e8ec2268e0 100644 --- a/src/mess/drivers/ax20.c +++ b/src/mess/drivers/ax20.c @@ -18,8 +18,7 @@ #include "emu.h" #include "cpu/i86/i86.h" -#include "imagedev/flopdrv.h" -#include "formats/basicdsk.h" +#include "bus/isa/fdc.h" class ax20_state : public driver_device { @@ -29,18 +28,37 @@ public: m_maincpu(*this, "maincpu"), m_p_vram(*this, "p_vram"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_fdc(*this, "fdc") { } required_device m_maincpu; + required_shared_ptr m_p_vram; + required_device m_gfxdecode; + required_device m_palette; + required_device m_fdc; virtual void machine_start(); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_vram; - required_device m_gfxdecode; - required_device m_palette; + DECLARE_READ8_MEMBER(unk_r); + DECLARE_WRITE8_MEMBER(tc_w); + DECLARE_WRITE8_MEMBER(ctl_w); }; +READ8_MEMBER(ax20_state::unk_r) +{ + return 0; +} + +WRITE8_MEMBER(ax20_state::tc_w) +{ + m_fdc->tc_w((data & 0xf0) == 0xf0); +} + +WRITE8_MEMBER(ax20_state::ctl_w) +{ + m_fdc->subdevice("0")->get_device()->mon_w(!(data & 1)); +} UINT32 ax20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { @@ -68,6 +86,10 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(ax20_io, AS_IO, 8, ax20_state) ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0xffc0, 0xffc0) AM_WRITE(tc_w) + AM_RANGE(0xffd0, 0xffd0) AM_WRITE(ctl_w) + AM_RANGE(0xffe0, 0xffe0) AM_READ(unk_r) + AM_RANGE(0xff80, 0xff81) AM_DEVICE("fdc", i8272a_device, map) ADDRESS_MAP_END /* Input ports */ @@ -94,12 +116,9 @@ static GFXDECODE_START( ax20 ) GFXDECODE_ENTRY( "chargen", 0x0000, ax20_charlayout, 0, 1 ) GFXDECODE_END -static const floppy_interface ax20_floppy_interface = -{ - FLOPPY_STANDARD_5_25_DSDD_40, // TODO - LEGACY_FLOPPY_OPTIONS_NAME(default), - NULL -}; +static SLOT_INTERFACE_START( ax20_floppies ) + SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) +SLOT_INTERFACE_END static MACHINE_CONFIG_START( ax20, ax20_state ) /* basic machine hardware */ @@ -118,8 +137,10 @@ static MACHINE_CONFIG_START( ax20, ax20_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", ax20) MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") + MCFG_I8272A_ADD("fdc", true) + /* Devices */ - MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, ax20_floppy_interface) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", ax20_floppies, "525dd", isa8_fdc_device::floppy_formats) MACHINE_CONFIG_END /* ROM definition */ From 9b4905c6b6a715e498982af958215e468826fade Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Mon, 8 Jun 2015 20:41:08 +0200 Subject: [PATCH 251/284] apricot: add an expansion slot interface and add two ram expansion cards. this will also be usuable by the apricot f series and portable. --- scripts/src/bus.lua | 17 +++ scripts/target/mame/mess.lua | 1 + src/emu/bus/apricot/cards.c | 14 +++ src/emu/bus/apricot/cards.h | 19 +++ src/emu/bus/apricot/expansion.c | 166 ++++++++++++++++++++++++++ src/emu/bus/apricot/expansion.h | 198 ++++++++++++++++++++++++++++++++ src/emu/bus/apricot/ram.c | 141 +++++++++++++++++++++++ src/emu/bus/apricot/ram.h | 69 +++++++++++ src/mess/drivers/apricot.c | 27 ++--- 9 files changed, 635 insertions(+), 17 deletions(-) create mode 100644 src/emu/bus/apricot/cards.c create mode 100644 src/emu/bus/apricot/cards.h create mode 100644 src/emu/bus/apricot/expansion.c create mode 100644 src/emu/bus/apricot/expansion.h create mode 100644 src/emu/bus/apricot/ram.c create mode 100644 src/emu/bus/apricot/ram.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 74ee8ac027e..10b6a0f0d52 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -162,6 +162,23 @@ if (BUSES["APF"]~=null) then end +--------------------------------------------------- +-- +--@src/emu/bus/apricot/expansion.h,BUSES += APRICOT_EXPANSION +--------------------------------------------------- + +if (BUSES["APRICOT_EXPANSION"]~=null) then + files { + MAME_DIR .. "src/emu/bus/apricot/expansion.c", + MAME_DIR .. "src/emu/bus/apricot/expansion.h", + MAME_DIR .. "src/emu/bus/apricot/cards.c", + MAME_DIR .. "src/emu/bus/apricot/cards.h", + MAME_DIR .. "src/emu/bus/apricot/ram.c", + MAME_DIR .. "src/emu/bus/apricot/ram.h", + } +end + + --------------------------------------------------- -- --@src/emu/bus/arcadia/slot.h,BUSES += ARCADIA diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 8c709bbebad..9161a265c3a 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -572,6 +572,7 @@ BUSES["ABCKB"] = true BUSES["ADAM"] = true BUSES["ADAMNET"] = true BUSES["APF"] = true +BUSES["APRICOT_EXPANSION"] = true BUSES["ARCADIA"] = true BUSES["ASTROCADE"] = true BUSES["BML3"] = true diff --git a/src/emu/bus/apricot/cards.c b/src/emu/bus/apricot/cards.c new file mode 100644 index 00000000000..b2369db7f90 --- /dev/null +++ b/src/emu/bus/apricot/cards.c @@ -0,0 +1,14 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot Expansion Slot Devices + +***************************************************************************/ + +#include "cards.h" + +SLOT_INTERFACE_START( apricot_expansion_cards ) + SLOT_INTERFACE("256k", APRICOT_256K_RAM) + SLOT_INTERFACE("128_512k", APRICOT_128_512K_RAM) +SLOT_INTERFACE_END diff --git a/src/emu/bus/apricot/cards.h b/src/emu/bus/apricot/cards.h new file mode 100644 index 00000000000..67766d51a8e --- /dev/null +++ b/src/emu/bus/apricot/cards.h @@ -0,0 +1,19 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot Expansion Slot Devices + +***************************************************************************/ + +#pragma once + +#ifndef __APRICOT_CARDS_H__ +#define __APRICOT_CARDS_H__ + +#include "emu.h" +#include "ram.h" + +SLOT_INTERFACE_EXTERN( apricot_expansion_cards ); + +#endif // __APRICOT_CARDS_H__ diff --git a/src/emu/bus/apricot/expansion.c b/src/emu/bus/apricot/expansion.c new file mode 100644 index 00000000000..26b18e0a551 --- /dev/null +++ b/src/emu/bus/apricot/expansion.c @@ -0,0 +1,166 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot Expansion Slot + +***************************************************************************/ + +#include "expansion.h" + + +//************************************************************************** +// EXPANSION SLOT DEVICE +//************************************************************************** + +const device_type APRICOT_EXPANSION_SLOT = &device_creator; + +//------------------------------------------------- +// apricot_expansion_slot_device - constructor +//------------------------------------------------- + +apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_EXPANSION_SLOT, "Apricot Expansion Slot", tag, owner, clock, "apricot_exp_slot", __FILE__), + device_slot_interface(mconfig, *this) +{ +} + +apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_config &mconfig, device_type type, const char *name, + const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : + device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_slot_interface(mconfig, *this) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void apricot_expansion_slot_device::device_start() +{ + device_apricot_expansion_card_interface *dev = dynamic_cast(get_card_device()); + + if (dev) + { + apricot_expansion_bus_device *bus = downcast(m_owner); + bus->add_card(dev); + } +} + + +//************************************************************************** +// EXPANSION BUS DEVICE +//************************************************************************** + +const device_type APRICOT_EXPANSION_BUS = &device_creator; + +//------------------------------------------------- +// apricot_expansion_bus_device - constructor +//------------------------------------------------- + +apricot_expansion_bus_device::apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_EXPANSION_BUS, "Apricot Expansion Bus", tag, owner, clock, "apricot_exp_bus", __FILE__), + m_program(NULL), + m_io(NULL), + m_dma1_handler(*this), + m_dma2_handler(*this), + m_ext1_handler(*this), + m_ext2_handler(*this), + m_int2_handler(*this), + m_int3_handler(*this) +{ +} + +//------------------------------------------------- +// apricot_expansion_bus_device - destructor +//------------------------------------------------- + +apricot_expansion_bus_device::~apricot_expansion_bus_device() +{ + m_dev.detach_all(); +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void apricot_expansion_bus_device::device_start() +{ + // resolve callbacks + m_dma1_handler.resolve_safe(); + m_dma2_handler.resolve_safe(); + m_ext1_handler.resolve_safe(); + m_ext2_handler.resolve_safe(); + m_int2_handler.resolve_safe(); + m_int3_handler.resolve_safe(); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void apricot_expansion_bus_device::device_reset() +{ + cpu_device *cpu = m_owner->subdevice(m_cpu_tag); +if (!cpu->started()) + printf("cpu not running yet\n"); + m_program = &cpu->space(AS_PROGRAM); + m_io = &cpu->space(AS_IO); +} + +//------------------------------------------------- +// add_card - add new card to our bus +//------------------------------------------------- + +void apricot_expansion_bus_device::add_card(device_apricot_expansion_card_interface *card) +{ + card->set_bus_device(this); + m_dev.append(*card); +} + +//------------------------------------------------- +// set_cpu_tag - set cpu we are attached to +//------------------------------------------------- + +void apricot_expansion_bus_device::set_cpu_tag(device_t &device, device_t *owner, const char *cpu_tag) +{ + apricot_expansion_bus_device &bus = dynamic_cast(device); + bus.m_cpu_tag = cpu_tag; +} + +// callbacks from slot device to the host +WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma1_w ) { m_dma1_handler(state); } +WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma2_w ) { m_dma2_handler(state); } +WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext1_w ) { m_ext1_handler(state); } +WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext2_w ) { m_ext2_handler(state); } +WRITE_LINE_MEMBER( apricot_expansion_bus_device::int2_w ) { m_int2_handler(state); } +WRITE_LINE_MEMBER( apricot_expansion_bus_device::int3_w ) { m_int3_handler(state); } + + +//************************************************************************** +// CARTRIDGE INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_apricot_expansion_card_interface - constructor +//------------------------------------------------- + +device_apricot_expansion_card_interface::device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device) : + device_slot_card_interface(mconfig, device), + m_next(NULL), + m_bus(NULL) +{ +} + +//------------------------------------------------- +// ~device_apricot_expansion_card_interface - destructor +//------------------------------------------------- + +device_apricot_expansion_card_interface::~device_apricot_expansion_card_interface() +{ +} + +void device_apricot_expansion_card_interface::set_bus_device(apricot_expansion_bus_device *bus) +{ + m_bus = bus; +} diff --git a/src/emu/bus/apricot/expansion.h b/src/emu/bus/apricot/expansion.h new file mode 100644 index 00000000000..7847345ac1b --- /dev/null +++ b/src/emu/bus/apricot/expansion.h @@ -0,0 +1,198 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot Expansion Slot + + A B + + -12V 32 +12V + +5V 31 +5V + DB0 30 DB1 + DB2 29 DB3 + DB4 28 DB5 + DB6 27 DB7 + AB10 26 AB9 + AB11 25 AB12 + /AMWC 24 /MRDC + /DMA2 23 DT/R + /DMA1 22 /IORC + /MWTC 21 /RES + /IOWC 20 /AIOWC + GND 19 GND + /CLK5 18 DEN + /IRDY 17 /MRDY + /EXT1 16 /EXT2 + /INT3 15 /ALE + AB6 14 /INT2 + AB8 13 AB7 + DB9 12 DB8 + DB11 11 DB10 + DB13 10 DB12 + DB15 9 DB14 + AB2 8 AB1 + AB4 7 AB3 + AB0 6 AB5 + AB14 5 AB13 + AB15 4 AB16 + AB17 3 AB18 + AB19 2 /BHE + NMI 1 CLK15 + +***************************************************************************/ + +#pragma once + +#ifndef __APRICOT_EXPANSION_H__ +#define __APRICOT_EXPANSION_H__ + +#include "emu.h" + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_EXPANSION_ADD(_tag, _cpu_tag) \ + MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_BUS, 0) \ + apricot_expansion_bus_device::set_cpu_tag(*device, owner, _cpu_tag); + +#define MCFG_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \ + MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) + +#define MCFG_EXPANSION_DMA1_HANDLER(_devcb) \ + devcb = &apricot_expansion_bus_device::set_dma1_handler(*device, DEVCB_##_devcb); + +#define MCFG_EXPANSION_DMA2_HANDLER(_devcb) \ + devcb = &apricot_expansion_bus_device::set_dma2_handler(*device, DEVCB_##_devcb); + +#define MCFG_EXPANSION_EXT1_HANDLER(_devcb) \ + devcb = &apricot_expansion_bus_device::set_ext1_handler(*device, DEVCB_##_devcb); + +#define MCFG_EXPANSION_EXT2_HANDLER(_devcb) \ + devcb = &apricot_expansion_bus_device::set_ext2_handler(*device, DEVCB_##_devcb); + +#define MCFG_EXPANSION_INT2_HANDLER(_devcb) \ + devcb = &apricot_expansion_bus_device::set_int2_handler(*device, DEVCB_##_devcb); + +#define MCFG_EXPANSION_INT3_HANDLER(_devcb) \ + devcb = &apricot_expansion_bus_device::set_int3_handler(*device, DEVCB_##_devcb); + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// forward declaration +class device_apricot_expansion_card_interface; + + +// ======================> apricot_expansion_slot_device + +class apricot_expansion_slot_device : public device_t, public device_slot_interface +{ +public: + // construction/destruction + apricot_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_expansion_slot_device(const machine_config &mconfig, device_type type, const char *name, + const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + + // device-level overrides + virtual void device_start(); +}; + +// device type definition +extern const device_type APRICOT_EXPANSION_SLOT; + + +// ======================> apricot_expansion_bus_device + +class apricot_expansion_bus_device : public device_t +{ +public: + // construction/destruction + apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + virtual ~apricot_expansion_bus_device(); + + template static devcb_base &set_dma1_handler(device_t &device, _Object object) + { return downcast(device).m_dma1_handler.set_callback(object); } + + template static devcb_base &set_dma2_handler(device_t &device, _Object object) + { return downcast(device).m_dma2_handler.set_callback(object); } + + template static devcb_base &set_ext1_handler(device_t &device, _Object object) + { return downcast(device).m_ext1_handler.set_callback(object); } + + template static devcb_base &set_ext2_handler(device_t &device, _Object object) + { return downcast(device).m_ext2_handler.set_callback(object); } + + template static devcb_base &set_int2_handler(device_t &device, _Object object) + { return downcast(device).m_int2_handler.set_callback(object); } + + template static devcb_base &set_int3_handler(device_t &device, _Object object) + { return downcast(device).m_int3_handler.set_callback(object); } + + // inline configuration + static void set_cpu_tag(device_t &device, device_t *owner, const char *cpu_tag); + + void add_card(device_apricot_expansion_card_interface *card); + + address_space *m_program; + address_space *m_io; + + // from cards + DECLARE_WRITE_LINE_MEMBER( dma1_w ); + DECLARE_WRITE_LINE_MEMBER( dma2_w ); + DECLARE_WRITE_LINE_MEMBER( ext1_w ); + DECLARE_WRITE_LINE_MEMBER( ext2_w ); + DECLARE_WRITE_LINE_MEMBER( int2_w ); + DECLARE_WRITE_LINE_MEMBER( int3_w ); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + +private: + simple_list m_dev; + + devcb_write_line m_dma1_handler; + devcb_write_line m_dma2_handler; + devcb_write_line m_ext1_handler; + devcb_write_line m_ext2_handler; + devcb_write_line m_int2_handler; + devcb_write_line m_int3_handler; + + // configuration + const char *m_cpu_tag; +}; + +// device type definition +extern const device_type APRICOT_EXPANSION_BUS; + + +// ======================> device_apricot_expansion_card_interface + +class device_apricot_expansion_card_interface : public device_slot_card_interface +{ +public: + // construction/destruction + device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device); + virtual ~device_apricot_expansion_card_interface(); + + void set_bus_device(apricot_expansion_bus_device *bus); + + device_apricot_expansion_card_interface *next() const { return m_next; } + device_apricot_expansion_card_interface *m_next; + +protected: + apricot_expansion_bus_device *m_bus; +}; + + +// include here so drivers don't need to +#include "cards.h" + + +#endif // __APRICOT_EXPANSION_H__ diff --git a/src/emu/bus/apricot/ram.c b/src/emu/bus/apricot/ram.c new file mode 100644 index 00000000000..fb24fba61db --- /dev/null +++ b/src/emu/bus/apricot/ram.c @@ -0,0 +1,141 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot RAM Expansions + +***************************************************************************/ + +#include "ram.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type APRICOT_256K_RAM = &device_creator; +const device_type APRICOT_128_512K_RAM = &device_creator; + + +//************************************************************************** +// APRICOT 256K RAM DEVICE +//************************************************************************** + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( apricot_256k ) + PORT_START("sw") + PORT_DIPNAME(0x01, 0x00, "Base Address") + PORT_DIPSETTING(0x00, "40000H") + PORT_DIPSETTING(0x01, "80000H") +INPUT_PORTS_END + +ioport_constructor apricot_256k_ram_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( apricot_256k ); +} + +//------------------------------------------------- +// apricot_256k_ram_device - constructor +//------------------------------------------------- + +apricot_256k_ram_device::apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_256K_RAM, "Apricot 256K RAM Expansion Board", tag, owner, clock, "apricot_256k_ram", __FILE__), + device_apricot_expansion_card_interface(mconfig, *this), + m_sw(*this, "sw") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void apricot_256k_ram_device::device_start() +{ + m_ram.resize(0x40000 / 2); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void apricot_256k_ram_device::device_reset() +{ + if (m_sw->read() == 0) + m_bus->m_program->install_ram(0x40000, 0x7ffff, &m_ram[0]); + else + m_bus->m_program->install_ram(0x80000, 0xbffff, &m_ram[0]); +} + + +//************************************************************************** +// APRICOT 128/512K RAM DEVICE +//************************************************************************** + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( apricot_128_512k ) + PORT_START("config") + PORT_CONFNAME(0x01, 0x01, "DRAM Size") + PORT_CONFSETTING(0x00, "64K") + PORT_CONFSETTING(0x01, "256K") + PORT_START("strap") + PORT_DIPNAME(0x03, 0x00, "Base Address") + PORT_DIPSETTING(0x00, "512K") + PORT_DIPSETTING(0x01, "256K - 384K") + PORT_DIPSETTING(0x02, "384K - 512K") +INPUT_PORTS_END + +ioport_constructor apricot_128_512k_ram_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( apricot_128_512k ); +} + +//------------------------------------------------- +// apricot_128_512k_ram_device - constructor +//------------------------------------------------- + +apricot_128_512k_ram_device::apricot_128_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_128_512K_RAM, "Apricot 128/512K RAM Expansion Board", tag, owner, clock, "apricot_128_512k_ram", __FILE__), + device_apricot_expansion_card_interface(mconfig, *this), + m_config(*this, "config"), + m_strap(*this, "strap") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void apricot_128_512k_ram_device::device_start() +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void apricot_128_512k_ram_device::device_reset() +{ + // 128 or 512k? + if (m_config->read() == 1) + { + m_ram.resize(0x80000 / 2); + + if (m_strap->read() == 0) + m_bus->m_program->install_ram(0x40000, 0xbffff, &m_ram[0]); + } + else + { + m_ram.resize(0x20000 / 2); + + if (m_strap->read() == 1) + m_bus->m_program->install_ram(0x40000, 0x5ffff, &m_ram[0]); + else if (m_strap->read() == 2) + m_bus->m_program->install_ram(0x60000, 0x7ffff, &m_ram[0]); + } +} diff --git a/src/emu/bus/apricot/ram.h b/src/emu/bus/apricot/ram.h new file mode 100644 index 00000000000..0610585376f --- /dev/null +++ b/src/emu/bus/apricot/ram.h @@ -0,0 +1,69 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot RAM Expansions + +***************************************************************************/ + +#pragma once + +#ifndef __APRICOT_RAM__ +#define __APRICOT_RAM__ + +#include "emu.h" +#include "expansion.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + + +// ======================> apricot_256k_ram_device + +class apricot_256k_ram_device : public device_t, public device_apricot_expansion_card_interface +{ +public: + // construction/destruction + apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + virtual void device_reset(); + +private: + required_ioport m_sw; + + std::vector m_ram; +}; + + +// ======================> apricot_128_512k_ram_device + +class apricot_128_512k_ram_device : public device_t, public device_apricot_expansion_card_interface +{ +public: + // construction/destruction + apricot_128_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + virtual void device_reset(); + +private: + required_ioport m_config; + required_ioport m_strap; + + std::vector m_ram; +}; + + +// device type definition +extern const device_type APRICOT_256K_RAM; +extern const device_type APRICOT_128_512K_RAM; + + +#endif // __APRICOT_RAM__ diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 2745b5e88bd..a45cce8e775 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -9,11 +9,8 @@ ***************************************************************************/ -#include "bus/centronics/ctronics.h" -#include "bus/rs232/rs232.h" #include "cpu/i86/i86.h" #include "cpu/i8089/i8089.h" -#include "machine/ram.h" #include "machine/pit8253.h" #include "machine/i8255.h" #include "machine/pic8259.h" @@ -23,6 +20,9 @@ #include "sound/sn76496.h" #include "imagedev/flopdrv.h" #include "formats/apridisk.h" +#include "bus/centronics/ctronics.h" +#include "bus/rs232/rs232.h" +#include "bus/apricot/expansion.h" //************************************************************************** @@ -35,7 +35,6 @@ public: apricot_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_cpu(*this, "ic91"), - m_ram(*this, RAM_TAG), m_iop(*this, "ic71"), m_sn(*this, "ic7"), m_crtc(*this, "ic30"), @@ -89,7 +88,6 @@ protected: private: required_device m_cpu; - required_device m_ram; required_device m_iop; required_device m_sn; required_device m_crtc; @@ -262,14 +260,13 @@ UINT32 apricot_state::screen_update_apricot(screen_device &screen, bitmap_rgb32 MC6845_UPDATE_ROW( apricot_state::crtc_update_row ) { - UINT8 *ram = m_ram->pointer(); const pen_t *pen = m_palette->pens(); for (int i = 0; i < x_count; i++) { UINT16 code = m_screen_buffer[(ma + i) & 0x7ff]; UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1); - UINT16 data = ram[offset + 1] << 8 | ram[offset]; + UINT16 data = m_cpu->space(AS_PROGRAM).read_word(offset); if (m_video_mode) { @@ -302,9 +299,6 @@ MC6845_UPDATE_ROW( apricot_state::crtc_update_row ) void apricot_state::machine_start() { - // install shared memory to the main cpu and the iop - m_cpu->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); - m_iop->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); } IRQ_CALLBACK_MEMBER( apricot_state::irq_callback ) @@ -322,8 +316,7 @@ IRQ_CALLBACK_MEMBER( apricot_state::irq_callback ) //************************************************************************** static ADDRESS_MAP_START( apricot_mem, AS_PROGRAM, 16, apricot_state ) -// AM_RANGE(0x00000, 0x3ffff) AM_RAMBANK("standard_ram") -// AM_RANGE(0x40000, 0xeffff) AM_RAMBANK("expansion_ram") + AM_RANGE(0x00000, 0x3ffff) AM_RAM AM_RANGE(0xf0000, 0xf0fff) AM_MIRROR(0x7000) AM_RAM AM_SHARE("screen_buffer") AM_RANGE(0xfc000, 0xfffff) AM_MIRROR(0x4000) AM_ROM AM_REGION("bootstrap", 0) ADDRESS_MAP_END @@ -382,11 +375,6 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_SOUND_ADD("ic7", SN76489, XTAL_4MHz / 2) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) - // internal ram - MCFG_RAM_ADD(RAM_TAG) - MCFG_RAM_DEFAULT_SIZE("256k") - MCFG_RAM_EXTRA_OPTIONS("384k,512k") // with 1 or 2 128k expansion boards - // devices MCFG_DEVICE_ADD("ic17", I8255A, 0) MCFG_I8255_IN_PORTA_CB(DEVREAD8("cent_data_in", input_buffer_device, read)) @@ -441,6 +429,11 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("ic71", i8089_device, drq1_w)) MCFG_FLOPPY_DRIVE_ADD("ic68:0", apricot_floppies, "d32w", apricot_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD("ic68:1", apricot_floppies, "d32w", apricot_state::floppy_formats) + + // expansion bus + MCFG_EXPANSION_ADD("exp", "ic91") + MCFG_EXPANSION_SLOT_ADD("exp:1", apricot_expansion_cards, NULL) + MCFG_EXPANSION_SLOT_ADD("exp:2", apricot_expansion_cards, NULL) MACHINE_CONFIG_END static MACHINE_CONFIG_DERIVED( apricotxi, apricot ) From dced6eab22c4d3a3e064fc25102c3bfd5ab3b4e0 Mon Sep 17 00:00:00 2001 From: ted green Date: Mon, 8 Jun 2015 13:58:51 -0600 Subject: [PATCH 252/284] One last 32 bit fix --- src/emu/video/vooddefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index bc346133cfe..24adb7b510c 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -2231,7 +2231,7 @@ ATTR_FORCE_INLINE UINT32 clampARGB(INT32 iterr, INT32 iterg, INT32 iterb, INT32 #else -ATTR_FORCE_INLINE rgb_union clampARGB(INT32 iterr, INT32 iterg, INT32 iterb, INT32 itera, UINT32 FBZCP) +ATTR_FORCE_INLINE UINT32 clampARGB(INT32 iterr, INT32 iterg, INT32 iterb, INT32 itera, UINT32 FBZCP) { rgb_union result; INT16 r, g, b, a; @@ -2277,7 +2277,7 @@ ATTR_FORCE_INLINE rgb_union clampARGB(INT32 iterr, INT32 iterg, INT32 iterb, INT result.rgb.b = (b < 0) ? 0 : (b > 0xff) ? 0xff : b; result.rgb.a = (a < 0) ? 0 : (a > 0xff) ? 0xff : a; } - return result; + return result.u; } #endif From 72dd919d34a8b4aed6e9f4197fda112f906581c7 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 9 Jun 2015 00:22:03 +0200 Subject: [PATCH 253/284] apricot: need to add ram this way, otherwise the iop can't access it --- src/mess/drivers/apricot.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index a45cce8e775..4df62c8ec80 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -11,6 +11,7 @@ #include "cpu/i86/i86.h" #include "cpu/i8089/i8089.h" +#include "machine/ram.h" #include "machine/pit8253.h" #include "machine/i8255.h" #include "machine/pic8259.h" @@ -36,6 +37,7 @@ public: driver_device(mconfig, type, tag), m_cpu(*this, "ic91"), m_iop(*this, "ic71"), + m_ram(*this, RAM_TAG), m_sn(*this, "ic7"), m_crtc(*this, "ic30"), m_ppi(*this, "ic17"), @@ -89,6 +91,7 @@ protected: private: required_device m_cpu; required_device m_iop; + required_device m_ram; required_device m_sn; required_device m_crtc; required_device m_ppi; @@ -299,6 +302,7 @@ MC6845_UPDATE_ROW( apricot_state::crtc_update_row ) void apricot_state::machine_start() { + membank("ram")->set_base(m_ram->pointer()); } IRQ_CALLBACK_MEMBER( apricot_state::irq_callback ) @@ -316,7 +320,7 @@ IRQ_CALLBACK_MEMBER( apricot_state::irq_callback ) //************************************************************************** static ADDRESS_MAP_START( apricot_mem, AS_PROGRAM, 16, apricot_state ) - AM_RANGE(0x00000, 0x3ffff) AM_RAM + AM_RANGE(0x00000, 0x3ffff) AM_RAMBANK("ram") AM_RANGE(0xf0000, 0xf0fff) AM_MIRROR(0x7000) AM_RAM AM_SHARE("screen_buffer") AM_RANGE(0xfc000, 0xfffff) AM_MIRROR(0x4000) AM_ROM AM_REGION("bootstrap", 0) ADDRESS_MAP_END @@ -355,6 +359,10 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_I8089_SINTR1(DEVWRITELINE("ic31", pic8259_device, ir0_w)) MCFG_I8089_SINTR2(DEVWRITELINE("ic31", pic8259_device, ir1_w)) + // ram + MCFG_RAM_ADD(RAM_TAG) + MCFG_RAM_DEFAULT_SIZE("256k") + // video hardware MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_SIZE(800, 400) From 4e254371e2b0c10ced187eb85240c6689042b0e2 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 9 Jun 2015 00:27:10 +0200 Subject: [PATCH 254/284] mc6845: always set bit 0 of maximum raster address in interlace video mode, fixes apricot screen height --- src/emu/video/mc6845.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c index 2b72a57b47d..7b9f0b1fc1f 100644 --- a/src/emu/video/mc6845.c +++ b/src/emu/video/mc6845.c @@ -453,7 +453,11 @@ READ_LINE_MEMBER( mc6845_device::vsync_r ) void mc6845_device::recompute_parameters(bool postload) { UINT16 hsync_on_pos, hsync_off_pos, vsync_on_pos, vsync_off_pos; - //UINT16 video_char_height = (MODE_INTERLACE_AND_VIDEO ? m_max_ras_addr + 1 : m_max_ras_addr) + 1; + + // needed for the apricot, correct? + if (MODE_INTERLACE_AND_VIDEO) + m_max_ras_addr |= 1; + UINT16 video_char_height = m_max_ras_addr + 1; // fix garbage at the bottom of the screen (eg victor9k) // Would be useful for 'interlace and video' mode support... // UINT16 frame_char_height = (MODE_INTERLACE_AND_VIDEO ? m_max_ras_addr / 2 : m_max_ras_addr) + 1; From dfd5a68ff67f7c976851c7f055667bd102407a16 Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 9 Jun 2015 00:32:50 +0200 Subject: [PATCH 255/284] Another go at fixing gcc 4.4 --- src/emu/netlist/plib/pstring.h | 1 + src/emu/netlist/tools/nl_convert.h | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/emu/netlist/plib/pstring.h b/src/emu/netlist/plib/pstring.h index 44a990c34a3..88a8922e98b 100644 --- a/src/emu/netlist/plib/pstring.h +++ b/src/emu/netlist/plib/pstring.h @@ -8,6 +8,7 @@ #define _PSTRING_H_ #include +#include #include "pconfig.h" diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h index 8ffc357278e..4a0efd020a7 100644 --- a/src/emu/netlist/tools/nl_convert.h +++ b/src/emu/netlist/tools/nl_convert.h @@ -10,10 +10,6 @@ #ifndef NL_CONVERT_H_ #define NL_CONVERT_H_ -//#include -//#include -#include - #include "plib/pstring.h" #include "plib/plists.h" #include "plib/pparser.h" From 8ba33d8d1e12796d821d43a0c31af72dedc87881 Mon Sep 17 00:00:00 2001 From: couriersud Date: Tue, 9 Jun 2015 00:34:39 +0200 Subject: [PATCH 256/284] Formatted kidniki.c (nl_examples) to be easier to read. (nw) --- nl_examples/kidniki.c | 599 +++++++++++++++++++++--------------------- 1 file changed, 301 insertions(+), 298 deletions(-) diff --git a/nl_examples/kidniki.c b/nl_examples/kidniki.c index 8beb47c8249..886c22c35b5 100644 --- a/nl_examples/kidniki.c +++ b/nl_examples/kidniki.c @@ -2,327 +2,330 @@ #include "netlist/devices/net_lib.h" #include "netlist/devices/nld_system.h" #include "netlist/analog/nld_bjt.h" + #define USE_FRONTIERS 0 #define USE_FIXED_STV 0 -/* 1.767 */ NETLIST_START(dummy) -// EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: SAT 06 JUN 2015 01:06:26 PM CEST -// TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N -// TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0 -// SHEET NAME:/ -// IGNORED O_AUDIO0: O_AUDIO0 49 0 -// .END -SOLVER(Solver, 12000) -PARAM(Solver.ACCURACY, 1e-7) -PARAM(Solver.NR_LOOPS, 200) -PARAM(Solver.GS_LOOPS, 4) -PARAM(Solver.SOR_FACTOR, 1) -#if 0 -PARAM(Solver.SOR_FACTOR, 1) -PARAM(Solver.DYNAMIC_TS, 1) -PARAM(Solver.LTE, 1e1) -#endif -//FIXME proper models! -NET_MODEL(".model 2SC945 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)") -NET_MODEL(".model 1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") + SOLVER(Solver, 12000) + PARAM(Solver.ACCURACY, 1e-8) + PARAM(Solver.NR_LOOPS, 200) + PARAM(Solver.GS_LOOPS, 4) + PARAM(Solver.SOR_FACTOR, 1) + #if 0 + PARAM(Solver.SOR_FACTOR, 1) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.LTE, 1e1) + #endif + //FIXME proper models! + NET_MODEL(".model 2SC945 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)") + NET_MODEL(".model 1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") -//NET_C(R44.1, XU1.7) + //NET_C(R44.1, XU1.7) -/* - * Workaround: The simplified opamp model does not correctly - * model the internals of the inputs. - */ + /* + * Workaround: The simplified opamp model does not correctly + * model the internals of the inputs. + */ -ANALOG_INPUT(VWORKAROUND, 2.061) -RES(RWORKAROUND, RES_K(27)) -NET_C(VWORKAROUND.Q, RWORKAROUND.1) -NET_C(XU1.6, RWORKAROUND.2) + ANALOG_INPUT(VWORKAROUND, 2.061) + RES(RWORKAROUND, RES_K(27)) + NET_C(VWORKAROUND.Q, RWORKAROUND.1) + NET_C(XU1.6, RWORKAROUND.2) -ANALOG_INPUT(I_V5, 5) -//ANALOG_INPUT(I_V0, 0) -ALIAS(I_V0.Q, GND) -#if 0 -ANALOG_INPUT(I_SD0, 0) -ANALOG_INPUT(I_BD0, 0) -ANALOG_INPUT(I_CH0, 0) -ANALOG_INPUT(I_OH0, 0) -ANALOG_INPUT(I_SOUNDIC0, 0) -ANALOG_INPUT(I_OKI0, 0) -ANALOG_INPUT(I_SOUND0, 0) -ANALOG_INPUT(I_SINH0, 0) -#else -TTL_INPUT(I_SD0, 1) -TTL_INPUT(I_BD0, 1) -//TTL_INPUT(I_CH0, 1) -CLOCK(I_CH0, 50) -TTL_INPUT(I_OH0, 1) -TTL_INPUT(I_SOUNDIC0, 1) -ANALOG_INPUT(I_MSM2K0, 0) -ANALOG_INPUT(I_MSM3K0, 0) -TTL_INPUT(I_SOUND0, 1) -TTL_INPUT(I_SINH0, 1) -#endif + ANALOG_INPUT(I_V5, 5) + //ANALOG_INPUT(I_V0, 0) + ALIAS(I_V0.Q, GND) + #if 0 + ANALOG_INPUT(I_SD0, 0) + ANALOG_INPUT(I_BD0, 0) + ANALOG_INPUT(I_CH0, 0) + ANALOG_INPUT(I_OH0, 0) + ANALOG_INPUT(I_SOUNDIC0, 0) + ANALOG_INPUT(I_OKI0, 0) + ANALOG_INPUT(I_SOUND0, 0) + ANALOG_INPUT(I_SINH0, 0) + #else + TTL_INPUT(I_SD0, 1) + //CLOCK(I_SD0, 5) + TTL_INPUT(I_BD0, 1) + //CLOCK(I_BD0, 5) + TTL_INPUT(I_CH0, 1) + //CLOCK(I_CH0, 5 ) + //TTL_INPUT(I_OH0, 1) + CLOCK(I_OH0, 5) + TTL_INPUT(I_SOUNDIC0, 1) + ANALOG_INPUT(I_MSM2K0, 0) + ANALOG_INPUT(I_MSM3K0, 0) + TTL_INPUT(I_SOUND0, 1) + TTL_INPUT(I_SINH0, 1) + #endif -INCLUDE(kidniki_schematics) + INCLUDE(kidniki_schematics) -#if (USE_FRONTIERS) -OPTIMIZE_FRONTIER(C63.2, RES_K(27), RES_K(1)) -OPTIMIZE_FRONTIER(R31.2, RES_K(5.1), 50) -OPTIMIZE_FRONTIER(R29.2, RES_K(2.7), 50) -#endif + #if (USE_FRONTIERS) + OPTIMIZE_FRONTIER(C63.2, RES_K(27), RES_K(1)) + OPTIMIZE_FRONTIER(R31.2, RES_K(5.1), 50) + OPTIMIZE_FRONTIER(R29.2, RES_K(2.7), 50) + #endif NETLIST_END() NETLIST_START(kidniki_schematics) + // EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: SAT 06 JUN 2015 01:06:26 PM CEST + // TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N + // TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0 + // SHEET NAME:/ + // IGNORED O_AUDIO0: O_AUDIO0 49 0 + // .END -CAP(C200, CAP_N(100)) -CAP(C28, CAP_U(1)) -CAP(C31, CAP_N(470)) -CAP(C32, CAP_N(3.3)) -CAP(C33, CAP_U(1)) -CAP(C34, CAP_N(1)) -CAP(C35, CAP_N(1)) -CAP(C36, CAP_N(6.5)) -CAP(C37, CAP_N(22)) -CAP(C38, CAP_N(1)) -CAP(C39, CAP_N(1)) -CAP(C40, CAP_P(12)) -CAP(C41, CAP_U(1)) -CAP(C42, CAP_N(1.2)) -CAP(C43, CAP_N(1.2)) -CAP(C44, CAP_U(1)) -CAP(C45, CAP_N(22)) -CAP(C47, CAP_U(1)) -CAP(C48, CAP_N(470)) -CAP(C49, CAP_N(3.3)) -CAP(C50, CAP_N(22)) -CAP(C51, CAP_N(22)) -CAP(C52, CAP_N(27)) -CAP(C53, CAP_N(27)) -CAP(C56, CAP_N(6.8)) -CAP(C57, CAP_N(6.8)) -CAP(C59, CAP_N(6.8)) -CAP(C60, CAP_N(22)) -CAP(C61, CAP_N(22)) -CAP(C62, CAP_N(6.8)) -CAP(C63, CAP_N(1)) -CAP(C64, CAP_N(68)) -CAP(C65, CAP_N(68)) -CAP(C66, CAP_N(68)) -CAP(C67, CAP_N(15)) -CAP(C68, CAP_N(15)) -CAP(C69, CAP_N(10)) -CAP(C70, CAP_N(22)) -CAP(C72, CAP_N(12)) -CAP(C73, CAP_N(10)) -CAP(C76, CAP_N(68)) -CAP(C77, CAP_N(12)) + CAP(C200, CAP_N(100)) + CAP(C28, CAP_U(1)) + CAP(C31, CAP_N(470)) + CAP(C32, CAP_N(3.3)) + CAP(C33, CAP_U(1)) + CAP(C34, CAP_N(1)) + CAP(C35, CAP_N(1)) + CAP(C36, CAP_N(6.5)) + CAP(C37, CAP_N(22)) + CAP(C38, CAP_N(1)) + CAP(C39, CAP_N(1)) + CAP(C40, CAP_P(12)) + CAP(C41, CAP_U(1)) + CAP(C42, CAP_N(1.2)) + CAP(C43, CAP_N(1.2)) + CAP(C44, CAP_U(1)) + CAP(C45, CAP_N(22)) + CAP(C47, CAP_U(1)) + CAP(C48, CAP_N(470)) + CAP(C49, CAP_N(3.3)) + CAP(C50, CAP_N(22)) + CAP(C51, CAP_N(22)) + CAP(C52, CAP_N(27)) + CAP(C53, CAP_N(27)) + CAP(C56, CAP_N(6.8)) + CAP(C57, CAP_N(6.8)) + CAP(C59, CAP_N(6.8)) + CAP(C60, CAP_N(22)) + CAP(C61, CAP_N(22)) + CAP(C62, CAP_N(6.8)) + CAP(C63, CAP_N(1)) + CAP(C64, CAP_N(68)) + CAP(C65, CAP_N(68)) + CAP(C66, CAP_N(68)) + CAP(C67, CAP_N(15)) + CAP(C68, CAP_N(15)) + CAP(C69, CAP_N(10)) + CAP(C70, CAP_N(22)) + CAP(C72, CAP_N(12)) + CAP(C73, CAP_N(10)) + CAP(C76, CAP_N(68)) + CAP(C77, CAP_N(12)) -DIODE(D3, "1S1588") -DIODE(D4, "1S1588") -DIODE(D5, "1S1588") + DIODE(D3, "1S1588") + DIODE(D4, "1S1588") + DIODE(D5, "1S1588") -POT(RV1, RES_K(50)) + POT(RV1, RES_K(50)) -QBJT_EB(Q10, "2SC945") -QBJT_EB(Q3, "2SC945") -QBJT_EB(Q4, "2SC945") -QBJT_EB(Q5, "2SC945") -QBJT_EB(Q6, "2SC945") -QBJT_EB(Q7, "2SC945") -QBJT_EB(Q9, "2SC945") + QBJT_EB(Q10, "2SC945") + QBJT_EB(Q3, "2SC945") + QBJT_EB(Q4, "2SC945") + QBJT_EB(Q5, "2SC945") + QBJT_EB(Q6, "2SC945") + QBJT_EB(Q7, "2SC945") + QBJT_EB(Q9, "2SC945") -SUBMODEL(LM324_DIP,XU1) -SUBMODEL(LM358_DIP,XU2) + SUBMODEL(LM324_DIP,XU1) + SUBMODEL(LM358_DIP,XU2) -TTL_7404_DIP(XU3) + TTL_7404_DIP(XU3) -RES(R100, RES_K(560)) -RES(R101, RES_K(150)) -RES(R102, RES_K(150)) -RES(R103, RES_K(470)) -RES(R104, RES_K(22)) -RES(R105, RES_K(470)) -RES(R106, RES_K(150)) -RES(R107, RES_K(150)) -RES(R108, RES_K(560)) -RES(R119, RES_K(22)) -RES(R200, RES_K(100)) -RES(R201, RES_K(100)) -RES(R27, RES_K(6.8)) -RES(R28, RES_K(150)) -RES(R29, RES_K(2.7)) -RES(R30, RES_K(10)) -RES(R31, RES_K(5.1)) -RES(R32, RES_K(4.7)) -RES(R34, RES_K(100)) -RES(R35, RES_K(100)) -RES(R36, RES_K(100)) -RES(R37, RES_K(47)) -RES(R38, 820) -RES(R39, RES_K(22)) -RES(R40, RES_K(10)) -RES(R41, RES_K(10)) -RES(R42, RES_K(150)) -RES(R43, 470) -RES(R44, RES_K(100)) -RES(R45, RES_K(1)) -RES(R46, RES_K(12)) -RES(R48, 470) -RES(R48_2, RES_K(100)) -RES(R49, RES_K(10)) -RES(R50, RES_K(22)) -RES(R51, RES_K(150)) -RES(R52, RES_K(100)) -RES(R53, RES_K(100)) -RES(R54, RES_K(680)) -RES(R55, RES_K(510)) -RES(R57, 560) -RES(R58, RES_K(39)) -RES(R59, 560) -RES(R60, RES_K(39)) -RES(R61, RES_K(100)) -RES(R62, RES_K(100)) -RES(R63, RES_K(1)) -RES(R65, RES_K(1)) -RES(R65_1, RES_K(27)) -RES(R66, RES_M(1)) -RES(R67, RES_K(100)) -RES(R68, RES_K(100)) -RES(R69, RES_K(1)) -RES(R70, RES_K(10)) -RES(R71, RES_K(100)) -RES(R72, RES_K(100)) -RES(R73, RES_K(10)) -RES(R74, RES_K(10)) -RES(R75, RES_K(10)) -RES(R76, RES_K(10)) -RES(R81, 220) -RES(R82, RES_M(2.2)) -RES(R83, RES_K(12)) -RES(R84, RES_K(1)) -RES(R85, RES_M(2.2)) -RES(R86, RES_K(10)) -RES(R87, RES_K(68)) -RES(R89, RES_K(22)) -RES(R90, RES_K(390)) -RES(R91, RES_K(100)) -RES(R92, RES_K(22)) -RES(R93, RES_K(1)) -RES(R94, RES_K(22)) -RES(R95, RES_K(330)) -RES(R96, RES_K(150)) -RES(R97, RES_K(150)) -RES(R98, RES_K(650)) + RES(R100, RES_K(560)) + RES(R101, RES_K(150)) + RES(R102, RES_K(150)) + RES(R103, RES_K(470)) + RES(R104, RES_K(22)) + RES(R105, RES_K(470)) + RES(R106, RES_K(150)) + RES(R107, RES_K(150)) + RES(R108, RES_K(560)) + RES(R119, RES_K(22)) + RES(R200, RES_K(100)) + RES(R201, RES_K(100)) + RES(R27, RES_K(6.8)) + RES(R28, RES_K(150)) + RES(R29, RES_K(2.7)) + RES(R30, RES_K(10)) + RES(R31, RES_K(5.1)) + RES(R32, RES_K(4.7)) + RES(R34, RES_K(100)) + RES(R35, RES_K(100)) + RES(R36, RES_K(100)) + RES(R37, RES_K(47)) + RES(R38, 820) + RES(R39, RES_K(22)) + RES(R40, RES_K(10)) + RES(R41, RES_K(10)) + RES(R42, RES_K(150)) + RES(R43, 470) + RES(R44, RES_K(100)) + RES(R45, RES_K(1)) + RES(R46, RES_K(12)) + RES(R48, 470) + RES(R48_2, RES_K(100)) + RES(R49, RES_K(10)) + RES(R50, RES_K(22)) + RES(R51, RES_K(150)) + RES(R52, RES_K(100)) + RES(R53, RES_K(100)) + RES(R54, RES_K(680)) + RES(R55, RES_K(510)) + RES(R57, 560) + RES(R58, RES_K(39)) + RES(R59, 560) + RES(R60, RES_K(39)) + RES(R61, RES_K(100)) + RES(R62, RES_K(100)) + RES(R63, RES_K(1)) + RES(R65, RES_K(1)) + RES(R65_1, RES_K(27)) + RES(R66, RES_M(1)) + RES(R67, RES_K(100)) + RES(R68, RES_K(100)) + RES(R69, RES_K(1)) + RES(R70, RES_K(10)) + RES(R71, RES_K(100)) + RES(R72, RES_K(100)) + RES(R73, RES_K(10)) + RES(R74, RES_K(10)) + RES(R75, RES_K(10)) + RES(R76, RES_K(10)) + RES(R81, 220) + RES(R82, RES_M(2.2)) + RES(R83, RES_K(12)) + RES(R84, RES_K(1)) + RES(R85, RES_M(2.2)) + RES(R86, RES_K(10)) + RES(R87, RES_K(68)) + RES(R89, RES_K(22)) + RES(R90, RES_K(390)) + RES(R91, RES_K(100)) + RES(R92, RES_K(22)) + RES(R93, RES_K(1)) + RES(R94, RES_K(22)) + RES(R95, RES_K(330)) + RES(R96, RES_K(150)) + RES(R97, RES_K(150)) + RES(R98, RES_K(650)) -#if USE_FIXED_STV -ANALOG_INPUT(STV, 2) -#else -RES(R78, RES_K(3.3)) -RES(R77, RES_K(2.2)) -CAP(C58, CAP_U(47)) -#endif + #if USE_FIXED_STV + ANALOG_INPUT(STV, 2) + #else + RES(R78, RES_K(3.3)) + RES(R77, RES_K(2.2)) + CAP(C58, CAP_U(47)) + #endif -NET_C(R95.1, XU3.2, R96.2) -NET_C(R95.2, XU3.1, C69.1) -NET_C(XU3.3, R103.2, C73.1) -NET_C(XU3.4, R103.1, R102.2) -NET_C(XU3.5, R105.2, C72.1) -NET_C(XU3.6, R105.1, R106.2) -#if USE_FIXED_STV -//FIXME: We should have a NET_C_REMOVE -NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1,/* R77.2, C58.1, */ R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) -#else -NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1, R77.2, C58.1, R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) -#endif -NET_C(XU3.8, R108.1, R107.2) -NET_C(XU3.9, R108.2, C77.1) -NET_C(XU3.10, R100.1, R101.2) -NET_C(XU3.11, R100.2, C67.1) -NET_C(XU3.12, R98.1, R97.2) -NET_C(XU3.13, R98.2, C68.1) -#if USE_FIXED_STV -NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, /* R78.1, */ R86.1, R83.1, Q3.C, I_V5.Q) -#else -NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, R78.1, R86.1, R83.1, Q3.C, I_V5.Q) -#endif -NET_C(R96.1, R102.1, R106.1, R107.1, R101.1, R97.1, R65.1, C63.2) -NET_C(C63.1, R65_1.2) -NET_C(R65_1.1, R44.2, C38.2, C40.2, XU1.6) -#if USE_FIXED_STV -NET_C(R30.1, R41.1, R40.1, STV, R76.2, /* R78.2, R77.1, C58.2*/ STV) -#else -NET_C(R30.1, R41.1, R40.1, R76.2, R78.2, R77.1, C58.2) -#endif -NET_C(R30.2, XU1.5) -NET_C(R44.1, C39.1, C40.1, R48_2.2) -NET_C(C38.1, C39.2, R38.1) -NET_C(XU1.1, XU1.2, R39.1, R32.2) -NET_C(XU1.3, C34.1, R41.2) -NET_C(XU1.7, R45.2) -NET_C(XU1.8, XU1.9, R31.2, C36.2) -NET_C(XU1.10, R42.1, C32.2) -NET_C(XU1.12, C49.1, C31.1, R40.2, C61.1, C60.1) -NET_C(XU1.13, R27.1, R28.2) -NET_C(XU1.14, R28.1, R29.2, I_SINH0.Q) -NET_C(R48_2.1, C45.2, R54.1) -NET_C(C45.1, R55.1, Q7.B) -NET_C(R55.2, R90.2, C33.2, R37.1, Q3.E) -NET_C(R45.1, C44.2) -NET_C(C44.1, R66.2, Q4.B) -NET_C(Q4.C, C42.1, C43.1, R46.1, C35.2, D4.K, D5.K) -NET_C(R70.2, R69.2, Q7.C) -NET_C(R63.1, Q7.E) -NET_C(R69.1, C49.2) -NET_C(C42.2, R58.1, D5.A) -NET_C(R58.2, R57.1, C47.1) -NET_C(R57.2, Q6.E) -NET_C(Q6.B, R61.1) -NET_C(C50.1, R67.1, R61.2) -NET_C(C50.2, R72.1, I_OH0.Q) -NET_C(C51.1, R68.1, R62.2) -NET_C(C51.2, R71.1, I_CH0.Q) -NET_C(R62.1, Q5.B) -NET_C(Q5.E, R59.2) -NET_C(R60.1, C43.2, D4.A) -NET_C(R60.2, R59.1, C48.1) -NET_C(C35.1, C34.2, R39.2) -NET_C(R32.1, C31.2) -NET_C(R27.2, C28.2) -NET_C(R29.1, R31.1, R50.2, R49.1, RV1.1) -NET_C(R42.2, R51.1, C36.1) -NET_C(R51.2, C41.1) -NET_C(C41.2, R43.1, I_SOUNDIC0.Q) -NET_C(XU2.1, XU2.2, R73.1) -NET_C(XU2.3, R76.1, C200.2) -NET_C(XU2.5, C56.2, R75.1) -NET_C(XU2.6, XU2.7, R50.1, C53.2) -NET_C(R75.2, R74.1, C53.1) -NET_C(R74.2, C52.2, R73.2) -NET_C(R49.2, R48.1, I_SOUND0.Q) -NET_C(Q9.E, R81.1) -NET_C(Q9.C, R84.2, R83.2, R82.1, C59.1) -NET_C(Q9.B, R82.2, C62.1) -NET_C(Q10.E, R93.1) -NET_C(Q10.C, R87.2, R86.2, R85.1, C76.1) -NET_C(Q10.B, R85.2, C64.1) -NET_C(R84.1, C61.2) -NET_C(C60.2, R87.1) -NET_C(C64.2, C65.1, R94.1, D3.K) -NET_C(C65.2, C66.1, R119.1) -NET_C(C66.2, C76.2, R104.1) -NET_C(R53.1, R52.2, C37.1) -NET_C(R34.1, C37.2, I_BD0.Q) -NET_C(R52.1, D3.A) -NET_C(R92.1, C62.2, C57.1) -NET_C(R89.1, C57.2, C59.2, R90.1) -NET_C(Q3.B, R35.1) -NET_C(R35.2, R36.2, C70.1) -NET_C(R91.2, C70.2, I_SD0.Q) -NET_C(I_MSM3K0.Q, R200.2) -NET_C(I_MSM2K0.Q, R201.2) -NET_C(R200.1, R201.1, C200.1) + NET_C(R95.1, XU3.2, R96.2) + NET_C(R95.2, XU3.1, C69.1) + NET_C(XU3.3, R103.2, C73.1) + NET_C(XU3.4, R103.1, R102.2) + NET_C(XU3.5, R105.2, C72.1) + NET_C(XU3.6, R105.1, R106.2) + #if USE_FIXED_STV + //FIXME: We should have a NET_C_REMOVE + NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1,/* R77.2, C58.1, */ R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) + #else + NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1, R77.2, C58.1, R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3) + #endif + NET_C(XU3.8, R108.1, R107.2) + NET_C(XU3.9, R108.2, C77.1) + NET_C(XU3.10, R100.1, R101.2) + NET_C(XU3.11, R100.2, C67.1) + NET_C(XU3.12, R98.1, R97.2) + NET_C(XU3.13, R98.2, C68.1) + #if USE_FIXED_STV + NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, /* R78.1, */ R86.1, R83.1, Q3.C, I_V5.Q) + #else + NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, R78.1, R86.1, R83.1, Q3.C, I_V5.Q) + #endif + NET_C(R96.1, R102.1, R106.1, R107.1, R101.1, R97.1, R65.1, C63.2) + NET_C(C63.1, R65_1.2) + NET_C(R65_1.1, R44.2, C38.2, C40.2, XU1.6) + #if USE_FIXED_STV + NET_C(R30.1, R41.1, R40.1, STV, R76.2, /* R78.2, R77.1, C58.2*/ STV) + #else + NET_C(R30.1, R41.1, R40.1, R76.2, R78.2, R77.1, C58.2) + #endif + NET_C(R30.2, XU1.5) + NET_C(R44.1, C39.1, C40.1, R48_2.2) + NET_C(C38.1, C39.2, R38.1) + NET_C(XU1.1, XU1.2, R39.1, R32.2) + NET_C(XU1.3, C34.1, R41.2) + NET_C(XU1.7, R45.2) + NET_C(XU1.8, XU1.9, R31.2, C36.2) + NET_C(XU1.10, R42.1, C32.2) + NET_C(XU1.12, C49.1, C31.1, R40.2, C61.1, C60.1) + NET_C(XU1.13, R27.1, R28.2) + NET_C(XU1.14, R28.1, R29.2, I_SINH0.Q) + NET_C(R48_2.1, C45.2, R54.1) + NET_C(C45.1, R55.1, Q7.B) + NET_C(R55.2, R90.2, C33.2, R37.1, Q3.E) + NET_C(R45.1, C44.2) + NET_C(C44.1, R66.2, Q4.B) + NET_C(Q4.C, C42.1, C43.1, R46.1, C35.2, D4.K, D5.K) + NET_C(R70.2, R69.2, Q7.C) + NET_C(R63.1, Q7.E) + NET_C(R69.1, C49.2) + NET_C(C42.2, R58.1, D5.A) + NET_C(R58.2, R57.1, C47.1) + NET_C(R57.2, Q6.E) + NET_C(Q6.B, R61.1) + NET_C(C50.1, R67.1, R61.2) + NET_C(C50.2, R72.1, I_OH0.Q) + NET_C(C51.1, R68.1, R62.2) + NET_C(C51.2, R71.1, I_CH0.Q) + NET_C(R62.1, Q5.B) + NET_C(Q5.E, R59.2) + NET_C(R60.1, C43.2, D4.A) + NET_C(R60.2, R59.1, C48.1) + NET_C(C35.1, C34.2, R39.2) + NET_C(R32.1, C31.2) + NET_C(R27.2, C28.2) + NET_C(R29.1, R31.1, R50.2, R49.1, RV1.1) + NET_C(R42.2, R51.1, C36.1) + NET_C(R51.2, C41.1) + NET_C(C41.2, R43.1, I_SOUNDIC0.Q) + NET_C(XU2.1, XU2.2, R73.1) + NET_C(XU2.3, R76.1, C200.2) + NET_C(XU2.5, C56.2, R75.1) + NET_C(XU2.6, XU2.7, R50.1, C53.2) + NET_C(R75.2, R74.1, C53.1) + NET_C(R74.2, C52.2, R73.2) + NET_C(R49.2, R48.1, I_SOUND0.Q) + NET_C(Q9.E, R81.1) + NET_C(Q9.C, R84.2, R83.2, R82.1, C59.1) + NET_C(Q9.B, R82.2, C62.1) + NET_C(Q10.E, R93.1) + NET_C(Q10.C, R87.2, R86.2, R85.1, C76.1) + NET_C(Q10.B, R85.2, C64.1) + NET_C(R84.1, C61.2) + NET_C(C60.2, R87.1) + NET_C(C64.2, C65.1, R94.1, D3.K) + NET_C(C65.2, C66.1, R119.1) + NET_C(C66.2, C76.2, R104.1) + NET_C(R53.1, R52.2, C37.1) + NET_C(R34.1, C37.2, I_BD0.Q) + NET_C(R52.1, D3.A) + NET_C(R92.1, C62.2, C57.1) + NET_C(R89.1, C57.2, C59.2, R90.1) + NET_C(Q3.B, R35.1) + NET_C(R35.2, R36.2, C70.1) + NET_C(R91.2, C70.2, I_SD0.Q) + NET_C(I_MSM3K0.Q, R200.2) + NET_C(I_MSM2K0.Q, R201.2) + NET_C(R200.1, R201.1, C200.1) NETLIST_END() NETLIST_START(opamp) From 7026b892942099c86e540ae375acad6b96b0dfa0 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Mon, 8 Jun 2015 19:31:21 -0400 Subject: [PATCH 257/284] changes to game list sync (nw) changes to game list sync (nw) --- src/mame/drivers/atarittl.c | 68 ++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/src/mame/drivers/atarittl.c b/src/mame/drivers/atarittl.c index 533b3a1b2a7..dc766dfb637 100644 --- a/src/mame/drivers/atarittl.c +++ b/src/mame/drivers/atarittl.c @@ -21,7 +21,7 @@ TM-025 Anti-Aircraft (1975) A000951 YES 003127 TM-058 Breakout/Breakout Cocktail (1976) A004533 NO TM-048 Crash 'N Score/Stock Car (1975) A004256 YES 003186(x2), 003187(x2), 004248, 004247 - TM-030 Crossfire (1975) + TM-030 Crossfire (1975) ??????? NO? TM-003,005,011,020 Gran Trak 10/Trak 10/Formula K/Race Circuit (1974) A000872,A000872 K3RT YES 74186 Racetrack Prom (K5) TM-004,021 Gran Trak 20/Trak 20/Twin Racer (1974) A001791(RT20),A001793(A20-K4DRTA) YES 74186 Racetrack prom (K5) TM-006,035 Goal 4/World Cup/Coupe De Monde (1975) A000823 NO @@ -35,7 +35,7 @@ TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4) TM-007 Pin Pong (1974) A001660 NO TM-013 Pong/Super Pong (1972) A001433,A000423 NO - TM-015 Pong Cocktail/Coup Franc (1974) NO + TM-015 Pong Cocktail/Coup Franc (1974) ??????? NO TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO TM-018 Pursuit (1975) K8P-B 90128 NO TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO @@ -47,7 +47,7 @@ TM-046 Steeplechase/Astroturf (1975) A003750 YES 003774 ROM Bugle (C8), 003773-01 "A" Horse (C4), 003773-02 "B" Horse (D4) TM-057 Stunt Cycle (1976) A004128 YES 004275 ROM Motorcycle/Bus (1F), 004811 ROM Score Translator (D7) TM-010,036,049 Tank/Tank Cocktail/Tank II (1974/1975) A003111 (K5T-F 90124) YES 90-2006 - TM-002 Touch Me (1974) NO + TM-002 Touch Me (1974) ??????? NO - Not Known to be released or produced, but at least announced. @@ -310,7 +310,7 @@ ROM_END /* // NO DUMPED ROMS -// Astroturf +// Astroturf (1975) ROM_START( astrotrf ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) @@ -319,12 +319,7 @@ ROM_START( astrotrf ) ROM_LOAD( "003773-02.c4", 0x0100, 0x0100, NO_DUMP ) // Graphics (Astroturf - Rev.A) ROM_END -// Crossfire -// Unclear if this is 100% TTL or if it uses a ROM: -// IC description in manual says a rom is used (74186 ROM) -// but the parts list in the same manual mentions no IC 74186! - -// Gran Trak 10 +// Gran Trak 10 / Trak 10 / Formula K / Race Circuit (1974) ROM_START( gtrak10 ) // Unknown size, assumed 2K Bytes ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) @@ -332,7 +327,7 @@ ROM_START( gtrak10 ) // Unknown size, assumed 2K Bytes ROM_LOAD( "74168.k5", 0x0000, 0x0800, NO_DUMP) // Racetrack ROM_END -// Gran Trak 20 +// Gran Trak 20 / Trak 20 / Twin Racer (1974) ROM_START( gtrak20 ) // Unknown size, assumed 2K Bytes ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) @@ -340,7 +335,7 @@ ROM_START( gtrak20 ) // Unknown size, assumed 2K Bytes ROM_LOAD( "74168.k5", 0x0000, 0x0800, NO_DUMP) // Racetrack ROM_END -// LeMans +// LeMans (1976) ROM_START( lemans ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) @@ -350,7 +345,7 @@ ROM_START( lemans ) ROM_LOAD( "005839-01.n6", 0x0200, 0x0100, NO_DUMP ) // Rom 3 ROM_END -// Qwak! +// Qwak! / Quack (1974) ROM_START( qwak ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) @@ -363,6 +358,16 @@ ROM_END /* // 100% TTL - NO ROMS +// Crossfire (1975) +// Unclear if this is 100% TTL or if it uses a ROM: +// IC description in manual says a rom is used (74186 ROM) +// but the parts list in the same manual mentions no IC 74186! +// Simulated in DICE without ROMs from schematics, so unlikely +// it uses any, and is in fact 100% TTL.. +ROM_START ( crossfir ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) +ROM_END + ROM_START( goal4 ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_END @@ -412,33 +417,34 @@ ROM_END GAME(1975, antiairc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Anti-Aircraft [TTL]", GAME_IS_SKELETON) -GAME(1975, crashnsc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Crash 'n Score [TTL]", GAME_IS_SKELETON) +GAME(1975, crashnsc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Crash 'n Score/Stock Car [TTL]", GAME_IS_SKELETON) GAME(1976, indy4, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Indy 4 [TTL]", GAME_IS_SKELETON) GAME(1975, indy800, 0, atarikee, 0, driver_device, 0, ROT90, "Atari/Kee", "Indy 800 [TTL]", GAME_IS_SKELETON) -GAME(1975, jetfight, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter (set 1) [TTL]", GAME_IS_SKELETON) -GAME(1975, jetfighta, jetfight, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter (set 2) [TTL]", GAME_IS_SKELETON) +GAME(1975, jetfight, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter/Jet Fighter Cocktail/Launch Aircraft (set 1) [TTL]", GAME_IS_SKELETON) +GAME(1975, jetfighta, jetfight, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter/Jet Fighter Cocktail/Launch Aircraft (set 2) [TTL]", GAME_IS_SKELETON) GAME(1976, outlaw, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Outlaw [TTL]", GAME_IS_SKELETON) GAME(1975, sharkjaw, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Horror Games", "Shark JAWS [TTL]",GAME_IS_SKELETON) GAME(1975, steeplec, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Steeplechase [TTL]", GAME_IS_SKELETON) GAME(1976, stuntcyc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Stunt Cycle [TTL]", GAME_IS_SKELETON) -GAME(1974, tank, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Tank/Tank II [TTL]", GAME_IS_SKELETON) +GAME(1974, tank, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Tank/Tank Cocktail/Tank II [TTL]", GAME_IS_SKELETON) // MISSING ROM DUMPS -//GAME(1975, astrotrf, steeplec, atarikee, 0, driver_device, 0, ROT0, "Atari", "Astroturf [TTL]",GAME_IS_SKELETON) +//GAME(1975, astrotrf, steeplec, atarikee, 0, driver_device, 0, ROT0, "Atari", "Astroturf [TTL]", GAME_IS_SKELETON) +//GAME(1974, gtrak10, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 10/Trak 10/Formula K/Race Circuit [TTL]", GAME_IS_SKELETON) //? +//GAME(1974, gtrak20, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 20/Trak 20/Twin Racer [TTL]", GAME_IS_SKELETON) //? //GAME(1976, lemans, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "LeMans [TTL]", GAME_IS_SKELETON) -//GAME(1974, gtrak10, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 10/Trak 10/Formula K/Race Circuit [TTL]",GAME_IS_SKELETON) //? -//GAME(1974, gtrak20, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 20/Trak 20/Twin Racer [TTL]",GAME_IS_SKELETON) //? //GAME(1974, quack, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Qwak!/Quack [TTL]", GAME_IS_SKELETON) // 100% TLL -//GAME(1974, coupedem, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Coupe De Monde [TTL]",GAME_IS_SKELETON) -//GAME(1975, goal4, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Goal 4/World Cup/Coupe De Monde [TTL]",GAME_IS_SKELETON) -//GAME(1973, gotchaat, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha [TTL]",GAME_IS_SKELETON) //? -//GAME(1973, gotchaatc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha Color [TTL]",GAME_IS_SKELETON) //? -//GAME(1975, highway, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Highway/Hiway [TTL]",GAME_IS_SKELETON) -//GAME(1974, pinpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pin Pong [TTL]",GAME_IS_SKELETON) -//GAME(1975, pursuit, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pursuit [TTL]",GAME_IS_SKELETON) -//GAME(1973, quadpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Quadrapong/Elimination [TTL]",GAME_IS_SKELETON) -//GAME(1974, rebound, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Rebound/Spike/Volleyball [TTL]",GAME_IS_SKELETON) -//GAME(1974, spacrace, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Space Race [TTL]",GAME_IS_SKELETON) -//GAME(1974, touchme, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Touch Me [TTL]",GAME_IS_SKELETON) //? +//GAME(1974, coupedem, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Coupe De Monde [TTL]", GAME_IS_SKELETON) +//GAME(1975, crossfir, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Crossfire [TTL]", GAME_IS_SKELETON) +//GAME(1975, goal4, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Goal 4/World Cup/Coupe De Monde [TTL]", GAME_IS_SKELETON) +//GAME(1973, gotchaat, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha [TTL]", GAME_IS_SKELETON) //? +//GAME(1973, gotchaatc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha Color [TTL]", GAME_IS_SKELETON) //? +//GAME(1975, highway, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Highway/Hiway [TTL]", GAME_IS_SKELETON) +//GAME(1974, pinpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pin Pong [TTL]", GAME_IS_SKELETON) +//GAME(1975, pursuit, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pursuit [TTL]", GAME_IS_SKELETON) +//GAME(1973, quadpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Quadrapong/Elimination [TTL]", GAME_IS_SKELETON) +//GAME(1974, rebound, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Rebound/Spike/Volleyball [TTL]", GAME_IS_SKELETON) +//GAME(1974, spacrace, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Space Race [TTL]", GAME_IS_SKELETON) +//GAME(1974, touchme, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Touch Me [TTL]", GAME_IS_SKELETON) //? From 16e576be68805c415d1c61f96e438348be630880 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Mon, 8 Jun 2015 19:33:48 -0400 Subject: [PATCH 258/284] (nw) (nw) --- src/mame/drivers/atarittl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/atarittl.c b/src/mame/drivers/atarittl.c index dc766dfb637..e49b36ad9c8 100644 --- a/src/mame/drivers/atarittl.c +++ b/src/mame/drivers/atarittl.c @@ -35,7 +35,7 @@ TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4) TM-007 Pin Pong (1974) A001660 NO TM-013 Pong/Super Pong (1972) A001433,A000423 NO - TM-015 Pong Cocktail/Coup Franc (1974) ??????? NO + TM-015 Pong Cocktail/Coup Franc (1974) ??????? NO TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO TM-018 Pursuit (1975) K8P-B 90128 NO TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO From a4fc1f2a003a7370ad0dacfc3917f44c59c4f025 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Mon, 8 Jun 2015 20:18:29 -0400 Subject: [PATCH 259/284] another little adjustment, sorry (nw) another little adjustment, sorry (nw) --- src/mame/drivers/atarittl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/atarittl.c b/src/mame/drivers/atarittl.c index e49b36ad9c8..a1a8a8390a2 100644 --- a/src/mame/drivers/atarittl.c +++ b/src/mame/drivers/atarittl.c @@ -20,6 +20,7 @@ -------------------+---------------------------------------------------------+----------------------------------+---------+--------------------------------------- TM-025 Anti-Aircraft (1975) A000951 YES 003127 TM-058 Breakout/Breakout Cocktail (1976) A004533 NO + TM-015 Cocktail Pong/Coup Franc (1974) ??????? NO TM-048 Crash 'N Score/Stock Car (1975) A004256 YES 003186(x2), 003187(x2), 004248, 004247 TM-030 Crossfire (1975) ??????? NO? TM-003,005,011,020 Gran Trak 10/Trak 10/Formula K/Race Circuit (1974) A000872,A000872 K3RT YES 74186 Racetrack Prom (K5) @@ -35,7 +36,6 @@ TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4) TM-007 Pin Pong (1974) A001660 NO TM-013 Pong/Super Pong (1972) A001433,A000423 NO - TM-015 Pong Cocktail/Coup Franc (1974) ??????? NO TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO TM-018 Pursuit (1975) K8P-B 90128 NO TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO From 110ec50118f5933ba2db847da7a5645499ba6be2 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Mon, 8 Jun 2015 20:26:15 -0400 Subject: [PATCH 260/284] Revert the brute force fix for the exidy/driver sound issues as it doesn't fix the problem and only slightly improves sound stability which still breaks and causes hangs/crashes in some games. (nw) --- src/mame/drivers/exidy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c index dee3157159f..706dab9d813 100644 --- a/src/mame/drivers/exidy.c +++ b/src/mame/drivers/exidy.c @@ -868,7 +868,7 @@ static MACHINE_CONFIG_DERIVED( venture, base ) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(venture_map) - MCFG_QUANTUM_PERFECT_CPU("maincpu") + MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* audio hardware */ MCFG_FRAGMENT_ADD(venture_audio) @@ -890,7 +890,7 @@ static MACHINE_CONFIG_DERIVED( mtrap, venture ) /* basic machine hardware */ - MCFG_QUANTUM_PERFECT_CPU("maincpu") + MCFG_QUANTUM_TIME(attotime::from_hz(1920)) /* audio hardware */ MCFG_FRAGMENT_ADD(mtrap_cvsd_audio) From d3ec864e018a0012fec32303c0719f97f66bac31 Mon Sep 17 00:00:00 2001 From: Stiletto Date: Mon, 8 Jun 2015 20:52:55 -0400 Subject: [PATCH 261/284] a couple of part/model numbers (nw) a couple of part/model numbers (nw) --- src/mame/drivers/exidyttl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/exidyttl.c b/src/mame/drivers/exidyttl.c index a854c8e8d92..9878e0692f0 100644 --- a/src/mame/drivers/exidyttl.c +++ b/src/mame/drivers/exidyttl.c @@ -4,7 +4,7 @@ Exidy discrete hardware games - Alley Rally (1975) + Alley Rally (1975) (AR-1A) Attack (1977) Death Race (1976) Destruction Derby (1975) @@ -15,7 +15,7 @@ Exidy discrete hardware games Super Death Chase (1977) Table Foosballer / Table Football (1975) Table Pinball (1974) - TV Pinball (1974) + TV Pinball (1974) (PB-4) ***************************************************************************/ From 01eef6ee909d7cde910ca22cc44a0e2b4c93c8a2 Mon Sep 17 00:00:00 2001 From: ted green Date: Mon, 8 Jun 2015 21:08:10 -0600 Subject: [PATCH 262/284] Fix msvc build --- src/emu/video/vooddefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index 24adb7b510c..437b3c84459 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -3147,7 +3147,7 @@ ATTR_FORCE_INLINE void applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 f /* non-constant fog comes from several sources */ else { - INT16 fogblend = 0; + INT32 fogblend = 0; /* if fog_add is zero, we start with the fog color */ if (FOGMODE_FOG_ADD(fogModeReg)) @@ -3216,7 +3216,7 @@ ATTR_FORCE_INLINE void applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 f /* if fog_mult is 0, we add this to the original color */ if (FOGMODE_FOG_MULT(fogModeReg) == 0) { - rgbaint_scale_immediate_add_and_clamp(&tmpA, fogblend, &tmpB); + rgbaint_scale_immediate_add_and_clamp(&tmpA, (INT16) fogblend, &tmpB); //color += fog; //(RR) += fr; //(GG) += fg; From 7ff62b4b455e08a797709abe9c9444bf9858c64b Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 9 Jun 2015 14:41:23 +0200 Subject: [PATCH 263/284] grchamp.c: added save state support (nw) --- src/mame/drivers/grchamp.c | 49 +++++++++++++++---------- src/mame/includes/grchamp.h | 71 ++++++++++++++++++++----------------- src/mame/video/grchamp.c | 8 ++--- 3 files changed, 73 insertions(+), 55 deletions(-) diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c index 799e3498574..d10424246a8 100644 --- a/src/mame/drivers/grchamp.c +++ b/src/mame/drivers/grchamp.c @@ -78,7 +78,20 @@ * *************************************/ -void grchamp_state::machine_reset() +void grchamp_state::machine_start() +{ + save_item(NAME(m_cpu0_out)); + save_item(NAME(m_cpu1_out)); + save_item(NAME(m_comm_latch)); + save_item(NAME(m_comm_latch2)); + save_item(NAME(m_ledlatch)); + save_item(NAME(m_ledaddr)); + save_item(NAME(m_ledram)); + save_item(NAME(m_collide)); + save_item(NAME(m_collmode)); +} + + void grchamp_state::machine_reset() { /* if the coin system is 1 way, lock Coin B (Page 40) */ coin_lockout_w(machine(), 1, (ioport("DSWB")->read() & 0x10) ? 1 : 0); @@ -92,14 +105,14 @@ void grchamp_state::machine_reset() * *************************************/ -INTERRUPT_GEN_MEMBER(grchamp_state::grchamp_cpu0_interrupt) +INTERRUPT_GEN_MEMBER(grchamp_state::cpu0_interrupt) { if (m_cpu0_out[0] & 0x01) device.execute().set_input_line(0, ASSERT_LINE); } -INTERRUPT_GEN_MEMBER(grchamp_state::grchamp_cpu1_interrupt) +INTERRUPT_GEN_MEMBER(grchamp_state::cpu1_interrupt) { if (m_cpu1_out[4] & 0x01) device.execute().set_input_line(0, ASSERT_LINE); @@ -409,22 +422,22 @@ READ8_MEMBER(grchamp_state::main_to_sub_comm_r) * *************************************/ -WRITE8_MEMBER(grchamp_state::grchamp_portA_0_w) +WRITE8_MEMBER(grchamp_state::portA_0_w) { m_discrete->write(space, GRCHAMP_A_DATA, data); } -WRITE8_MEMBER(grchamp_state::grchamp_portB_0_w) +WRITE8_MEMBER(grchamp_state::portB_0_w) { m_discrete->write(space, GRCHAMP_B_DATA, 255-data); } -WRITE8_MEMBER(grchamp_state::grchamp_portA_2_w) +WRITE8_MEMBER(grchamp_state::portA_2_w) { /* A0/A1 modify the output of AY8910 #2 */ /* A7 contributes to the discrete logic hanging off of AY8910 #0 */ } -WRITE8_MEMBER(grchamp_state::grchamp_portB_2_w) +WRITE8_MEMBER(grchamp_state::portB_2_w) { /* B0 connects elsewhere */ } @@ -505,9 +518,9 @@ ADDRESS_MAP_END /* complete memory map derived from schematics */ static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, grchamp_state ) AM_RANGE(0x0000, 0x1fff) AM_ROM - AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(grchamp_left_w) AM_SHARE("leftram") - AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(grchamp_right_w) AM_SHARE("rightram") - AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(grchamp_center_w) AM_SHARE("centerram") + AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(left_w) AM_SHARE("leftram") + AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(right_w) AM_SHARE("rightram") + AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(center_w) AM_SHARE("centerram") AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_RANGE(0x5000, 0x6fff) AM_ROM ADDRESS_MAP_END @@ -636,13 +649,13 @@ static MACHINE_CONFIG_START( grchamp, grchamp_state ) MCFG_CPU_ADD("maincpu", Z80, PIXEL_CLOCK/2) MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_IO_MAP(main_portmap) - MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, grchamp_cpu0_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, cpu0_interrupt) /* GAME BOARD */ MCFG_CPU_ADD("sub", Z80, PIXEL_CLOCK/2) MCFG_CPU_PROGRAM_MAP(sub_map) MCFG_CPU_IO_MAP(sub_portmap) - MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, grchamp_cpu1_interrupt) + MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, cpu1_interrupt) /* SOUND BOARD */ MCFG_CPU_ADD("audiocpu", Z80, SOUND_CLOCK/2) @@ -660,23 +673,23 @@ static MACHINE_CONFIG_START( grchamp, grchamp_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(grchamp_state, screen_update_grchamp) + MCFG_SCREEN_UPDATE_DRIVER(grchamp_state, screen_update) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ay1", AY8910, SOUND_CLOCK/4) /* 3B */ - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, grchamp_portA_0_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, grchamp_portB_0_w)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, portA_0_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, portB_0_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2) MCFG_SOUND_ADD("ay2", AY8910, SOUND_CLOCK/4) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2) MCFG_SOUND_ADD("ay3", AY8910, SOUND_CLOCK/4) /* 1B */ - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, grchamp_portA_2_w)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, grchamp_portB_2_w)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, portA_2_w)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, portB_2_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2) MCFG_SOUND_ADD("discrete", DISCRETE, 0) @@ -747,4 +760,4 @@ ROM_END * *************************************/ -GAMEL( 1981, grchamp, 0, grchamp, grchamp, driver_device, 0, ROT270, "Taito", "Grand Champion", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS, layout_grchamp ) +GAMEL( 1981, grchamp, 0, grchamp, grchamp, driver_device, 0, ROT270, "Taito", "Grand Champion", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_grchamp ) diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h index b14083bdae5..a9c4d4dbf66 100644 --- a/src/mame/includes/grchamp.h +++ b/src/mame/includes/grchamp.h @@ -13,19 +13,34 @@ class grchamp_state : public driver_device public: grchamp_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_radarram(*this, "radarram"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_leftram(*this, "leftram"), - m_rightram(*this, "rightram"), - m_centerram(*this, "centerram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_subcpu(*this, "sub"), m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_screen(*this, "screen") { } + m_screen(*this, "screen"), + m_radarram(*this, "radarram"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_leftram(*this, "leftram"), + m_rightram(*this, "rightram"), + m_centerram(*this, "centerram") { } + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_subcpu; + required_device m_discrete; + required_device m_gfxdecode; + required_device m_palette; + required_device m_screen; + + required_shared_ptr m_radarram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_leftram; + required_shared_ptr m_rightram; + required_shared_ptr m_centerram; UINT8 m_cpu0_out[16]; UINT8 m_cpu1_out[16]; @@ -40,13 +55,6 @@ public: UINT16 m_collide; UINT8 m_collmode; - required_shared_ptr m_radarram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_leftram; - required_shared_ptr m_rightram; - required_shared_ptr m_centerram; - bitmap_ind16 m_work_bitmap; tilemap_t * m_text_tilemap; tilemap_t * m_left_tilemap; @@ -64,37 +72,34 @@ public: DECLARE_WRITE8_MEMBER(main_to_sub_comm_w); DECLARE_READ8_MEMBER(main_to_sub_comm_r); UINT8 get_pc3259_bits(int offs); - DECLARE_WRITE8_MEMBER(grchamp_left_w); - DECLARE_WRITE8_MEMBER(grchamp_center_w); - DECLARE_WRITE8_MEMBER(grchamp_right_w); - DECLARE_WRITE8_MEMBER(grchamp_portA_0_w); - DECLARE_WRITE8_MEMBER(grchamp_portB_0_w); - DECLARE_WRITE8_MEMBER(grchamp_portA_2_w); - DECLARE_WRITE8_MEMBER(grchamp_portB_2_w); + DECLARE_WRITE8_MEMBER(left_w); + DECLARE_WRITE8_MEMBER(center_w); + DECLARE_WRITE8_MEMBER(right_w); + DECLARE_WRITE8_MEMBER(portA_0_w); + DECLARE_WRITE8_MEMBER(portB_0_w); + DECLARE_WRITE8_MEMBER(portA_2_w); + DECLARE_WRITE8_MEMBER(portB_2_w); + TILE_GET_INFO_MEMBER(get_text_tile_info); TILE_GET_INFO_MEMBER(get_left_tile_info); TILE_GET_INFO_MEMBER(get_right_tile_info); TILE_GET_INFO_MEMBER(get_center_tile_info); - DECLARE_PALETTE_INIT(grchamp); TILEMAP_MAPPER_MEMBER(get_memory_offset); + + DECLARE_PALETTE_INIT(grchamp); + virtual void machine_start(); virtual void machine_reset(); virtual void video_start(); - void palette_generate(); - UINT32 screen_update_grchamp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(grchamp_cpu0_interrupt); - INTERRUPT_GEN_MEMBER(grchamp_cpu1_interrupt); + + INTERRUPT_GEN_MEMBER(cpu0_interrupt); + INTERRUPT_GEN_MEMBER(cpu1_interrupt); TIMER_CALLBACK_MEMBER(main_to_sub_comm_sync_w); + + UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_objects(int y, UINT8 *objdata); int collision_check(bitmap_ind16 &bitmap, int which ); void draw_fog(bitmap_ind16 &bitmap, const rectangle &cliprect, int fog); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_subcpu; - required_device m_discrete; - required_device m_gfxdecode; - required_device m_palette; - required_device m_screen; }; /* Discrete Sound Input Nodes */ diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c index 42c9c9c4c03..668fe88cd01 100644 --- a/src/mame/video/grchamp.c +++ b/src/mame/video/grchamp.c @@ -53,19 +53,19 @@ PALETTE_INIT_MEMBER(grchamp_state, grchamp) } -WRITE8_MEMBER(grchamp_state::grchamp_left_w) +WRITE8_MEMBER(grchamp_state::left_w) { m_leftram[offset] = data; m_left_tilemap->mark_tile_dirty(offset); } -WRITE8_MEMBER(grchamp_state::grchamp_center_w) +WRITE8_MEMBER(grchamp_state::center_w) { m_centerram[offset] = data; m_center_tilemap->mark_tile_dirty(offset); } -WRITE8_MEMBER(grchamp_state::grchamp_right_w) +WRITE8_MEMBER(grchamp_state::right_w) { m_rightram[offset] = data; m_right_tilemap->mark_tile_dirty(offset); @@ -343,7 +343,7 @@ void grchamp_state::draw_objects(int y, UINT8 *objdata) } -UINT32 grchamp_state::screen_update_grchamp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +UINT32 grchamp_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { static const rgb_t objpix_lookup[8] = { From bb8ef78d03e10b0983dcca40fafa1b8607c5a61c Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 9 Jun 2015 16:57:51 +0200 Subject: [PATCH 264/284] i86: add very limited lock support (just enough for the apricot actually) --- src/emu/cpu/i86/i86.c | 8 ++++++++ src/emu/cpu/i86/i86.h | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c index 7a308da61a9..299d85b1f59 100644 --- a/src/emu/cpu/i86/i86.c +++ b/src/emu/cpu/i86/i86.c @@ -282,6 +282,8 @@ i8086_common_cpu_device::i8086_common_cpu_device(const machine_config &mconfig, , m_irq_state(0) , m_test_state(1) , m_pc(0) + , m_lock(false) + , m_lock_handler(*this) { static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; @@ -391,6 +393,8 @@ void i8086_common_cpu_device::device_start() state_add(STATE_GENFLAGS, "GENFLAGS", m_TF).callimport().callexport().formatstr("%16s").noshow(); m_icountptr = &m_icount; + + m_lock_handler.resolve_safe(); } @@ -438,6 +442,7 @@ void i8086_common_cpu_device::device_reset() m_dst = 0; m_src = 0; m_halt = false; + m_lock = false; } @@ -1910,7 +1915,9 @@ bool i8086_common_cpu_device::common_op(UINT8 op) break; case 0xe4: // i_inal + if (m_lock) m_lock_handler(1); m_regs.b[AL] = read_port_byte( fetch() ); + if (m_lock) { m_lock_handler(0); m_lock = false; } CLK(IN_IMM8); break; @@ -2011,6 +2018,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xf0: // i_lock logerror("%s: %06x: Warning - BUSLOCK\n", tag(), pc()); + m_lock = true; m_no_interrupt = 1; CLK(NOP); break; diff --git a/src/emu/cpu/i86/i86.h b/src/emu/cpu/i86/i86.h index ff1c56c2e92..6e48fecd71e 100644 --- a/src/emu/cpu/i86/i86.h +++ b/src/emu/cpu/i86/i86.h @@ -14,6 +14,10 @@ extern const device_type I8088; #define INPUT_LINE_TEST 20 +#define MCFG_I8086_LOCK_HANDLER(_write) \ + devcb = &i8086_common_cpu_device::set_lock_handler(*device, DEVCB_##_write); + + enum { I8086_PC=0, @@ -29,6 +33,9 @@ public: // construction/destruction i8086_common_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + template static devcb_base &set_lock_handler(device_t &device, _Object object) + { return downcast(device).m_lock_handler.set_callback(object); } + protected: enum { @@ -325,6 +332,9 @@ protected: UINT8 m_timing[200]; bool m_halt; + + bool m_lock; + devcb_write_line m_lock_handler; }; class i8086_cpu_device : public i8086_common_cpu_device From 9880a75bbd46713cb6b3cc1f45b9d372ed2697ae Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 9 Jun 2015 16:58:42 +0200 Subject: [PATCH 265/284] z80dart: add direct control/data access functions --- src/emu/machine/z80dart.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/emu/machine/z80dart.h b/src/emu/machine/z80dart.h index 27df3dabb82..2674f84758a 100644 --- a/src/emu/machine/z80dart.h +++ b/src/emu/machine/z80dart.h @@ -500,6 +500,16 @@ public: DECLARE_READ8_MEMBER( ba_cd_r ); DECLARE_WRITE8_MEMBER( ba_cd_w ); + DECLARE_READ8_MEMBER( da_r ) { return m_chanA->data_read(); } + DECLARE_WRITE8_MEMBER( da_w ) { m_chanA->data_write(data); } + DECLARE_READ8_MEMBER( db_r ) { return m_chanB->data_read(); } + DECLARE_WRITE8_MEMBER( db_w ) { m_chanB->data_write(data); } + + DECLARE_READ8_MEMBER( ca_r ) { return m_chanA->control_read(); } + DECLARE_WRITE8_MEMBER( ca_w ) { m_chanA->control_write(data); } + DECLARE_READ8_MEMBER( cb_r ) { return m_chanB->control_read(); } + DECLARE_WRITE8_MEMBER( cb_w ) { m_chanB->control_write(data); } + // interrupt acknowledge int m1_r(); From faa977641a2e9a55d49ab1172410d4088efe3391 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 9 Jun 2015 17:00:22 +0200 Subject: [PATCH 266/284] apricot: add initial keyboard support --- scripts/target/mame/mess.lua | 1 + src/mess/drivers/apricot.c | 57 +++--- src/mess/machine/apricotkb_hle.c | 286 +++++++++++++++++++++++++++++++ src/mess/machine/apricotkb_hle.h | 73 ++++++++ 4 files changed, 397 insertions(+), 20 deletions(-) create mode 100644 src/mess/machine/apricotkb_hle.c create mode 100644 src/mess/machine/apricotkb_hle.h diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 9161a265c3a..79e85e7f938 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -1021,6 +1021,7 @@ files { MAME_DIR .. "src/mess/drivers/apricotf.c", MAME_DIR .. "src/mess/drivers/apricotp.c", MAME_DIR .. "src/mess/machine/apricotkb.c", + MAME_DIR .. "src/mess/machine/apricotkb_hle.c", MAME_DIR .. "src/mess/drivers/victor9k.c", MAME_DIR .. "src/mess/machine/victor9kb.c", MAME_DIR .. "src/mess/machine/victor9k_fdc.c", diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 4df62c8ec80..400a31a70a0 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -19,6 +19,7 @@ #include "machine/wd_fdc.h" #include "video/mc6845.h" #include "sound/sn76496.h" +#include "machine/apricotkb_hle.h" #include "imagedev/flopdrv.h" #include "formats/apridisk.h" #include "bus/centronics/ctronics.h" @@ -58,11 +59,12 @@ public: m_display_enabled(0), m_centronics_fault(1), m_centronics_perror(1), - m_sio_irq(0) + m_bus_locked(0) { } DECLARE_FLOPPY_FORMATS(floppy_formats); + DECLARE_WRITE_LINE_MEMBER(i8086_lock_w); DECLARE_WRITE8_MEMBER(i8089_ca1_w); DECLARE_WRITE8_MEMBER(i8089_ca2_w); DECLARE_WRITE8_MEMBER(i8255_portb_w); @@ -71,8 +73,8 @@ public: DECLARE_WRITE_LINE_MEMBER(timer_out1); DECLARE_WRITE_LINE_MEMBER(timer_out2); DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w); - DECLARE_WRITE_LINE_MEMBER(sio_int_w); - IRQ_CALLBACK_MEMBER(irq_callback); + DECLARE_READ8_MEMBER(sio_ca_r); + DECLARE_READ8_MEMBER(sio_cb_r); DECLARE_WRITE_LINE_MEMBER(write_centronics_fault); DECLARE_WRITE_LINE_MEMBER(write_centronics_perror); @@ -117,7 +119,7 @@ private: int m_centronics_fault; int m_centronics_perror; - int m_sio_irq; + int m_bus_locked; }; @@ -220,10 +222,20 @@ WRITE_LINE_MEMBER( apricot_state::timer_out2 ) } } -WRITE_LINE_MEMBER( apricot_state::sio_int_w ) +READ8_MEMBER( apricot_state::sio_ca_r ) { - m_sio_irq = state; - m_pic->ir5_w(state); + if (m_bus_locked) + return m_sio->m1_r(); + + return m_sio->ca_r(space, offset); +} + +READ8_MEMBER( apricot_state::sio_cb_r ) +{ + if (m_bus_locked) + return m_sio->m1_r(); + + return m_sio->cb_r(space, offset); } @@ -305,13 +317,9 @@ void apricot_state::machine_start() membank("ram")->set_base(m_ram->pointer()); } -IRQ_CALLBACK_MEMBER( apricot_state::irq_callback ) +WRITE_LINE_MEMBER( apricot_state::i8086_lock_w ) { - // i86 lock is connected to the sio m1 input, simulate this - if (m_sio_irq) - m_sio->m1_r(); - - return m_pic->acknowledge(); + m_bus_locked = state; } @@ -331,7 +339,10 @@ static ADDRESS_MAP_START( apricot_io, AS_IO, 16, apricot_state ) AM_RANGE(0x48, 0x4f) AM_DEVREADWRITE8("ic17", i8255_device, read, write, 0x00ff) AM_RANGE(0x50, 0x51) AM_MIRROR(0x06) AM_DEVWRITE8("ic7", sn76489_device, write, 0x00ff) AM_RANGE(0x58, 0x5f) AM_DEVREADWRITE8("ic16", pit8253_device, read, write, 0x00ff) - AM_RANGE(0x60, 0x67) AM_DEVREADWRITE8("ic15", z80sio0_device, ba_cd_r, ba_cd_w, 0x00ff) + AM_RANGE(0x60, 0x61) AM_DEVREADWRITE8("ic15", z80sio0_device, da_r, da_w, 0x00ff) + AM_RANGE(0x62, 0x63) AM_READ8(sio_ca_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, ca_w, 0x00ff) + AM_RANGE(0x64, 0x65) AM_DEVREADWRITE8("ic15", z80sio0_device, db_r, db_w, 0x00ff) + AM_RANGE(0x66, 0x67) AM_READ8(sio_cb_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, cb_w, 0x00ff) AM_RANGE(0x68, 0x69) AM_MIRROR(0x04) AM_DEVWRITE8("ic30", mc6845_device, address_w, 0x00ff) AM_RANGE(0x6a, 0x6b) AM_MIRROR(0x04) AM_DEVREADWRITE8("ic30", mc6845_device, register_r, register_w, 0x00ff) AM_RANGE(0x70, 0x71) AM_MIRROR(0x04) AM_WRITE8(i8089_ca1_w, 0x00ff) @@ -349,7 +360,8 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_CPU_ADD("ic91", I8086, XTAL_15MHz / 3) MCFG_CPU_PROGRAM_MAP(apricot_mem) MCFG_CPU_IO_MAP(apricot_io) - MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(apricot_state, irq_callback) + MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("ic31", pic8259_device, inta_cb) + MCFG_I8086_LOCK_HANDLER(WRITELINE(apricot_state, i8086_lock_w)) // i/o cpu MCFG_CPU_ADD("ic71", I8089, XTAL_15MHz / 3) @@ -406,18 +418,23 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_Z80DART_OUT_DTRA_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) MCFG_Z80DART_OUT_RTSA_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts)) MCFG_Z80DART_OUT_WRDYA_CB(DEVWRITELINE("ic71", i8089_device, drq2_w)) + MCFG_Z80DART_OUT_TXDB_CB(DEVWRITELINE("keyboard", apricot_keyboard_hle_device, rxd_w)) MCFG_Z80DART_OUT_DTRB_CB(WRITELINE(apricot_state, data_selector_dtr_w)) MCFG_Z80DART_OUT_RTSB_CB(WRITELINE(apricot_state, data_selector_rts_w)) - MCFG_Z80DART_OUT_INT_CB(WRITELINE(apricot_state, sio_int_w)) + MCFG_Z80DART_OUT_INT_CB(DEVWRITELINE("ic31", pic8259_device, ir5_w)) // rs232 port MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, NULL) // note: missing a receive clock callback to support external clock mode // (m_data_selector_rts == 1 and m_data_selector_dtr == 0) - MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ic15", z80dart_device, rxa_w)) - MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ic15", z80dart_device, dcda_w)) - MCFG_RS232_DSR_HANDLER(DEVWRITELINE("ic15", z80dart_device, synca_w)) - MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ic15", z80dart_device, ctsa_w)) + MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ic15", z80sio0_device, rxa_w)) + MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ic15", z80sio0_device, dcda_w)) + MCFG_RS232_DSR_HANDLER(DEVWRITELINE("ic15", z80sio0_device, synca_w)) + MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ic15", z80sio0_device, ctsa_w)) + + // keyboard (hle) + MCFG_APRICOT_KEYBOARD_ADD("keyboard") + MCFG_APRICOT_KEYBOARD_TXD_HANDLER(DEVWRITELINE("ic15", z80sio0_device, rxb_w)) // centronics printer MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") diff --git a/src/mess/machine/apricotkb_hle.c b/src/mess/machine/apricotkb_hle.c new file mode 100644 index 00000000000..3b8664cc961 --- /dev/null +++ b/src/mess/machine/apricotkb_hle.c @@ -0,0 +1,286 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot Keyboard (HLE) + + Keyboard to System: + - 01-60: Key make codes + - 70-7f: Mouse codes + - 80: RAM test failed + - 81-e0: Key break codes + - e9: ROM test failed + - ea: X-on (keyboard ready to receive) + - eb: X-off (keyboard buffer full) + - ec: Reset request + - ed: Time prefix + - ee: Date prefix + - ef: Mouse header + - f0-f9: BCD data + - fa: Invalid clock data + - fb: Acknowledge firmware version/reset + + System to keyboard: + - 01-7f: Character codes for MicroScreen + - 80-cf: Cursor address + - d0: Clear screen + - d1: Cursor left + - d2: Cursor right + - d3: Cursor on + - d4: Cursor off + - d5: Display on + - d6: Display off + - e0: Query + - e1: Time and date request + - e2: Display time/data on MicroScreen + - e3: Set LED prefix + - e4: Set time and date + - e5: Mouse enable + - e6: Mouse disable + - e7: Execute processor diagnostics + - e8: Keyboard reset + - f0-f9: BCD data + - fa: Invalid clock data + +***************************************************************************/ + +#include "apricotkb_hle.h" + + +//************************************************************************** +// CONSTANTS / MACROS +//************************************************************************** + +#define APRICOT_KEY(_key, _index) \ + PORT_BIT(1 << _key, IP_ACTIVE_HIGH, IPT_KEYBOARD) \ + PORT_CHANGED_MEMBER(DEVICE_SELF, apricot_keyboard_hle_device, key_callback, (void *) _index) + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type APRICOT_KEYBOARD_HLE = &device_creator; + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( keyboard ) + PORT_START("keyboard_0") + PORT_BIT(1 << 0, IP_ACTIVE_HIGH, IPT_UNUSED) + APRICOT_KEY( 1, 0) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_NAME("Help") + APRICOT_KEY( 2, 0) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_NAME("Undo") + APRICOT_KEY( 3, 0) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) PORT_NAME("Repeat") + APRICOT_KEY( 4, 0) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_NAME("Calc") + APRICOT_KEY( 5, 0) PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) PORT_NAME("Print") + APRICOT_KEY( 6, 0) PORT_CODE(KEYCODE_CANCEL) PORT_CHAR(UCHAR_MAMEKEY(CANCEL)) PORT_NAME("Intr") + APRICOT_KEY( 7, 0) PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) PORT_NAME("Menu") + APRICOT_KEY( 8, 0) PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) PORT_NAME("Finish") + APRICOT_KEY( 9, 0) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_NAME("Function 1") + APRICOT_KEY(10, 0) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_NAME("Function 2") + APRICOT_KEY(11, 0) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_NAME("Function 3") + APRICOT_KEY(12, 0) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_NAME("Function 4") + APRICOT_KEY(13, 0) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_NAME("Function 5") + APRICOT_KEY(14, 0) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_NAME("Function 6") + APRICOT_KEY(15, 0) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('^') + APRICOT_KEY(16, 0) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + APRICOT_KEY(17, 0) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + APRICOT_KEY(18, 0) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + APRICOT_KEY(19, 0) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR(0xa3) // pound + APRICOT_KEY(20, 0) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + APRICOT_KEY(21, 0) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('$') + APRICOT_KEY(22, 0) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + APRICOT_KEY(23, 0) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + APRICOT_KEY(24, 0) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + APRICOT_KEY(25, 0) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + APRICOT_KEY(26, 0) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + APRICOT_KEY(27, 0) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + APRICOT_KEY(28, 0) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(9) + PORT_BIT(1 << 29, IP_ACTIVE_HIGH, IPT_UNUSED) // actually a dedicated % key + APRICOT_KEY(30, 0) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) + APRICOT_KEY(31, 0) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) + + PORT_START("keyboard_1") + APRICOT_KEY( 0, 1) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) + APRICOT_KEY( 1, 1) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) + APRICOT_KEY( 2, 1) PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) + APRICOT_KEY( 3, 1) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + APRICOT_KEY( 4, 1) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + APRICOT_KEY( 5, 1) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + APRICOT_KEY( 6, 1) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + APRICOT_KEY( 7, 1) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + APRICOT_KEY( 8, 1) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + APRICOT_KEY( 9, 1) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + APRICOT_KEY(10, 1) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + APRICOT_KEY(11, 1) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + APRICOT_KEY(12, 1) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + APRICOT_KEY(13, 1) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + APRICOT_KEY(14, 1) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + APRICOT_KEY(15, 1) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) + APRICOT_KEY(16, 1) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_NAME("Clear") + APRICOT_KEY(17, 1) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + APRICOT_KEY(18, 1) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + APRICOT_KEY(19, 1) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + APRICOT_KEY(20, 1) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + APRICOT_KEY(21, 1) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + APRICOT_KEY(22, 1) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + APRICOT_KEY(23, 1) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + APRICOT_KEY(24, 1) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + APRICOT_KEY(25, 1) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + APRICOT_KEY(26, 1) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + APRICOT_KEY(27, 1) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + APRICOT_KEY(28, 1) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + APRICOT_KEY(29, 1) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + APRICOT_KEY(30, 1) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') + APRICOT_KEY(31, 1) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + + PORT_START("keyboard_2") + APRICOT_KEY( 0, 2) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + APRICOT_KEY( 1, 2) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) + APRICOT_KEY( 2, 2) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) + APRICOT_KEY( 3, 2) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + APRICOT_KEY( 4, 2) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + APRICOT_KEY( 5, 2) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + APRICOT_KEY( 6, 2) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + APRICOT_KEY( 7, 2) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + APRICOT_KEY( 8, 2) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + APRICOT_KEY( 9, 2) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + APRICOT_KEY(10, 2) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + APRICOT_KEY(11, 2) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + APRICOT_KEY(12, 2) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + APRICOT_KEY(13, 2) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + APRICOT_KEY(14, 2) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + APRICOT_KEY(15, 2) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + APRICOT_KEY(16, 2) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + APRICOT_KEY(17, 2) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + APRICOT_KEY(18, 2) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + APRICOT_KEY(19, 2) PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) + APRICOT_KEY(20, 2) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + APRICOT_KEY(21, 2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + APRICOT_KEY(22, 2) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + APRICOT_KEY(23, 2) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + APRICOT_KEY(24, 2) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) + APRICOT_KEY(25, 2) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + APRICOT_KEY(26, 2) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(PAUSE)) PORT_NAME("Stop") + APRICOT_KEY(27, 2) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + APRICOT_KEY(28, 2) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + APRICOT_KEY(29, 2) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + APRICOT_KEY(30, 2) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + APRICOT_KEY(31, 2) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) + + PORT_START("keyboard_3") + APRICOT_KEY( 0, 3) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) +INPUT_PORTS_END + +ioport_constructor apricot_keyboard_hle_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( keyboard ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// apricot_keyboard_hle_device - constructor +//------------------------------------------------- + +apricot_keyboard_hle_device::apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_KEYBOARD_HLE, "Apricot Keyboard (HLE)", tag, owner, clock, "apricotkb_hle", __FILE__), + device_serial_interface(mconfig, *this), + m_txd_handler(*this), + m_rxd(1), + m_data_in(0), + m_data_out(0) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void apricot_keyboard_hle_device::device_start() +{ + // resolve callbacks + m_txd_handler.resolve_safe(); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void apricot_keyboard_hle_device::device_reset() +{ + receive_register_reset(); + transmit_register_reset(); + + set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); + set_rcv_rate(7800); + set_tra_rate(7800); +} + +//------------------------------------------------- +// device_timer - device-specific timer +//------------------------------------------------- + +void apricot_keyboard_hle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + device_serial_interface::device_timer(timer, id, param, ptr); +} + +void apricot_keyboard_hle_device::tra_callback() +{ + m_txd_handler(transmit_register_get_data_bit()); +} + +void apricot_keyboard_hle_device::tra_complete() +{ + if (m_data_out != 0) + { + transmit_register_setup(m_data_out); + m_data_out = 0; + } +} + +void apricot_keyboard_hle_device::rcv_callback() +{ + receive_register_update_bit(m_rxd); +} + +void apricot_keyboard_hle_device::rcv_complete() +{ + receive_register_extract(); + m_data_in = get_received_char(); + + // reset command? send keyboard ready + if (m_data_in == 0xe8) + transmit_register_setup(0xfb); +} + +WRITE_LINE_MEMBER( apricot_keyboard_hle_device::rxd_w ) +{ + m_rxd = state; + device_serial_interface::rx_w(m_rxd); +} + +INPUT_CHANGED_MEMBER( apricot_keyboard_hle_device::key_callback ) +{ + UINT32 oldvalue = oldval * field.mask(), newvalue = newval * field.mask(); + UINT32 delta = oldvalue ^ newvalue; + + for (int i = 0; i < 32; i++) + { + if (delta & (1 << i)) + { + UINT8 down = (newvalue & (1 << i)) ? 0x00 : 0x80; + UINT8 scancode = (FPTR) param * 32 + i; + scancode |= down; + transmit_register_setup(scancode); + break; + } + } + +} diff --git a/src/mess/machine/apricotkb_hle.h b/src/mess/machine/apricotkb_hle.h new file mode 100644 index 00000000000..e8cea1a516d --- /dev/null +++ b/src/mess/machine/apricotkb_hle.h @@ -0,0 +1,73 @@ +// license:GPL-2.0+ +// copyright-holders:Dirk Best +/*************************************************************************** + + ACT Apricot Keyboard (HLE) + +***************************************************************************/ + +#pragma once + +#ifndef __APRICOTKB_HLE__ +#define __APRICOTKB_HLE__ + +#include "emu.h" + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_APRICOT_KEYBOARD_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, APRICOT_KEYBOARD_HLE, 0) + +#define MCFG_APRICOT_KEYBOARD_TXD_HANDLER(_write) \ + devcb = &apricot_keyboard_hle_device::set_txd_handler(*device, DEVCB_##_write); + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> apricot_keyboard_hle_device + +class apricot_keyboard_hle_device : public device_t, public device_serial_interface +{ +public: + // construction/destruction + apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + template static devcb_base &set_txd_handler(device_t &device, _Object object) + { return downcast(device).m_txd_handler.set_callback(object); } + + DECLARE_WRITE_LINE_MEMBER(rxd_w); + DECLARE_INPUT_CHANGED_MEMBER(key_callback); + +protected: + // device_t overrides + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + virtual void device_reset(); + + // device_serial_interface overrides + virtual void tra_callback(); + virtual void tra_complete(); + virtual void rcv_callback(); + virtual void rcv_complete(); + + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + +private: + devcb_write_line m_txd_handler; + + int m_rxd; + + UINT8 m_data_in; + UINT8 m_data_out; +}; + + +// device type definition +extern const device_type APRICOT_KEYBOARD_HLE; + + +#endif // __APRICOTKB_HLE__ From fe7951f109403ea87041a911d8fa0d6436201ce6 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 9 Jun 2015 18:51:39 +0200 Subject: [PATCH 267/284] added internal artwork: ebaskb2.lay, efootb4.lay, h2hbaseb.lay, tbreakup.lay Games promoted to working: ------------------ Entex Electronic Basketball 2 [hap, Sean Riddle] Entex Color Football 4 [hap, Sean Riddle] Tomy Break Up [hap, Sean Riddle] --- src/mess/drivers/hh_tms1k.c | 99 +++++++++-------- src/mess/layout/ebaskb2.lay | 145 +++++++++++++++++++++++++ src/mess/layout/efootb4.lay | 166 +++++++++++++++++++++++++++++ src/mess/layout/h2hbaseb.lay | 201 ++++++++++++++++++++++++++++++----- src/mess/layout/tbreakup.lay | 131 +++++++++++++++++++++++ 5 files changed, 674 insertions(+), 68 deletions(-) create mode 100644 src/mess/layout/ebaskb2.lay create mode 100644 src/mess/layout/efootb4.lay create mode 100644 src/mess/layout/tbreakup.lay diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index d0eaa7b6ced..b7c3d51b405 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -87,6 +87,7 @@ brighter: tc4/h2hfootb(offense), bankshot(cue ball), ... - add softwarelist for tc4 cartridges? - stopthiep: unable to start a game (may be intentional?) + - tbreakup: some of the leds flicker (rom and PLAs doublechecked) ***************************************************************************/ @@ -104,6 +105,9 @@ #include "ebball.lh" #include "ebball2.lh" #include "ebball3.lh" +#include "ebaskb2.lh" +#include "efootb4.lh" +#include "einvader.lh" // test-layout(but still playable) #include "elecdet.lh" #include "gjackpot.lh" #include "gpoker.lh" @@ -118,11 +122,9 @@ #include "starwbc.lh" #include "stopthie.lh" #include "tandy12.lh" // clickable -//#include "tbreakup.lh" +#include "tbreakup.lh" #include "tc4.lh" -#include "einvader.lh" // test-layout(but still playable) - #include "hh_tms1k_test.lh" // common test-layout - use external artwork @@ -1622,7 +1624,7 @@ MACHINE_CONFIG_END Entex Color Football 4 * TMS1670 6009 MP7551 (die also labeled MP7551) - * * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1bit sound + * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1bit sound ***************************************************************************/ @@ -1680,16 +1682,16 @@ READ8_MEMBER(efootb4_state::read_k) static INPUT_PORTS_START( efootb4 ) PORT_START("IN.0") // R0 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // 1 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY // 2 + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // 3 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY // 4 PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY // 1 + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY // 2 + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY // 3 + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY // 4 PORT_START("IN.2") // R2 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Run") @@ -1723,8 +1725,7 @@ static MACHINE_CONFIG_START( efootb4, efootb4_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(efootb4_state, write_o)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) -// MCFG_DEFAULT_LAYOUT(layout_efootb4) - MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test) + MCFG_DEFAULT_LAYOUT(layout_efootb4) /* no video! */ @@ -1744,6 +1745,18 @@ MACHINE_CONFIG_END * TMS1100 6010 MP1218 (die also labeled MP1218) * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound + lamp translation table: led zz from game PCB = MESS lampyx: + + 11 = lamp90 21 = lamp91 31 = lamp92 41 = lamp93 51 = lamp95 + 12 = lamp80 22 = lamp81 32 = lamp82 42 = lamp83 52 = lamp85 + 13 = lamp70 23 = lamp71 33 = lamp72 43 = lamp73 53 = lamp84 + 14 = lamp60 24 = lamp61 34 = lamp62 44 = lamp63 54 = lamp75 + 15 = lamp50 25 = lamp51 35 = lamp52 45 = lamp53 55 = lamp74 + 16 = lamp40 26 = lamp41 36 = lamp42 46 = lamp43 56 = lamp65 + + A = lamp94 + B = lamp64 + ***************************************************************************/ class ebaskb2_state : public hh_tms1k_state @@ -1837,8 +1850,7 @@ static MACHINE_CONFIG_START( ebaskb2, ebaskb2_state ) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebaskb2_state, write_o)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) -// MCFG_DEFAULT_LAYOUT(layout_ebaskb2) - MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test) + MCFG_DEFAULT_LAYOUT(layout_ebaskb2) /* no video! */ @@ -4006,23 +4018,23 @@ MACHINE_CONFIG_END lamp translation table: led zz from game PCB = MESS lampyx: - 00 = - 10 = lamp25 20 = lamp44 - 01 = lamp27 11 = lamp35 21 = lamp53 - 02 = lamp37 12 = lamp45 22 = lamp42 - 03 = lamp47 13 = lamp55 - 04 = lamp57 14 = lamp54 - 05 = lamp26 15 = lamp33 - 06 = lamp36 16 = lamp43 - 07 = lamp46 17 = lamp23 - 08 = lamp56 18 = lamp34 - 09 = lamp24 19 = lamp32 + 00 = - 10 = lamp50 20 = lamp42 + 01 = lamp70 11 = lamp51 21 = lamp33 + 02 = lamp71 12 = lamp52 22 = lamp22 + 03 = lamp72 13 = lamp53 + 04 = lamp73 14 = lamp43 + 05 = lamp60 15 = lamp31 + 06 = lamp61 16 = lamp32 + 07 = lamp62 17 = lamp30 + 08 = lamp63 18 = lamp41 + 09 = lamp40 19 = lamp21 the 7seg panel is lamp0x and lamp1x(aka digit0/1), and the 8(2*4) * 3 rectangular leds panel, where x=0,1,2,3: - lamp7x lamp6x - lamp9x lamp8x - lamp11x lamp10x + lamp9x lamp11x + lamp8x lamp13x + lamp10x lamp12x ***************************************************************************/ @@ -4062,15 +4074,15 @@ void tbreakup_state::prepare_display() m_display_state[y] = (m_r >> y & 1) ? (m_o & 0x7f) : 0; } - // 22 round leds from expander port 7 and O2-O7 - for (int y = 0; y < 4; y++) - m_display_state[y+2] = (m_exp_port[6] >> y & 1) ? (m_o & 0xfc) : 0; + // 22 round leds from O2-O7 and expander port 7 + for (int y = 2; y < 8; y++) + m_display_state[y] = (m_o >> y & 1) ? m_exp_port[6] : 0; // 24 rectangular leds from expander ports 1-6 (not strobed) for (int y = 0; y < 6; y++) - m_display_state[y+6] = m_exp_port[y]; + m_display_state[y+8] = m_exp_port[y]; - set_display_size(8, 12); + set_display_size(8, 14); display_update(); } @@ -4146,7 +4158,7 @@ INPUT_CHANGED_MEMBER(tbreakup_state::skill_switch) void tbreakup_state::set_clock() { // MCU clock is from an analog circuit with resistor of 73K, PRO2 adds 100K - m_maincpu->set_unscaled_clock((m_inp_matrix[3]->read() & 1) ? 400000 : 350000); + m_maincpu->set_unscaled_clock((m_inp_matrix[3]->read() & 1) ? 500000 : 325000); } void tbreakup_state::machine_reset() @@ -4167,7 +4179,7 @@ void tbreakup_state::machine_start() static MACHINE_CONFIG_START( tbreakup, tbreakup_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1040, 400000) // see set_clock + MCFG_CPU_ADD("maincpu", TMS1040, 325000) // see set_clock MCFG_TMS1XXX_READ_K_CB(READ8(tbreakup_state, read_k)) MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tbreakup_state, write_r)) MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tbreakup_state, write_o)) @@ -4182,8 +4194,7 @@ static MACHINE_CONFIG_START( tbreakup, tbreakup_state ) MCFG_TMS1024_WRITE_PORT_CB(7, WRITE8(tbreakup_state, expander_w)) MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) -// MCFG_DEFAULT_LAYOUT(layout_tbreakup) - MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test) + MCFG_DEFAULT_LAYOUT(layout_tbreakup) /* no video! */ @@ -4307,7 +4318,7 @@ ROM_START( efootb4 ) ROM_LOAD( "6009_mp7551", 0x0000, 0x1000, CRC(54fa7244) SHA1(4d16bd825c4a2db76ca8a263c373ade15c20e270) ) ROM_REGION( 867, "maincpu:mpla", 0 ) - ROM_LOAD( "tms1400_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) + ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) ROM_REGION( 557, "maincpu:opla", 0 ) ROM_LOAD( "tms1400_efootb4_output.pla", 0, 557, CRC(5c87c753) SHA1(bde9d4aa1e57a718affd969475c0a1edcf60f444) ) ROM_END @@ -4351,7 +4362,7 @@ ROM_START( gjackpot ) ROM_LOAD( "mpf553", 0x0000, 0x1000, CRC(f45fd008) SHA1(8d5d6407a8a031a833ceedfb931f5c9d2725ecd0) ) ROM_REGION( 867, "maincpu:mpla", 0 ) - ROM_LOAD( "tms1400_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) + ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) ROM_REGION( 557, "maincpu:opla", 0 ) ROM_LOAD( "tms1400_gjackpot_output.pla", 0, 557, CRC(50e471a7) SHA1(9d862cb9f51a563882b62662c5bfe61b52e3df00) ) ROM_END @@ -4398,7 +4409,7 @@ ROM_START( astro ) ROM_LOAD( "mp1133", 0x0000, 0x1000, CRC(bc21109c) SHA1(05a433cce587d5c0c2d28b5fda5f0853ea6726bf) ) ROM_REGION( 867, "maincpu:mpla", 0 ) - ROM_LOAD( "tms1400_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) + ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) ROM_REGION( 557, "maincpu:opla", 0 ) ROM_LOAD( "tms1400_astro_output.pla", 0, 557, CRC(eb08957e) SHA1(62ae0d13a1eaafb34f1b27d7df51441b400ccd56) ) ROM_END @@ -4575,8 +4586,8 @@ CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Ent CONS( 1979, ebball2, 0, 0, ebball2, ebball2, driver_device, 0, "Entex", "Electronic Baseball 2 (Entex)", GAME_SUPPORTS_SAVE ) CONS( 1980, ebball3, 0, 0, ebball3, ebball3, driver_device, 0, "Entex", "Electronic Baseball 3 (Entex)", GAME_SUPPORTS_SAVE ) CONS( 1980, einvader, 0, 0, einvader, einvader, driver_device, 0, "Entex", "Space Invader (Entex, TMS1100)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) -CONS( 1980, efootb4 , 0, 0, efootb4, efootb4, driver_device, 0, "Entex", "Color Football 4 (Entex)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) -CONS( 1980, ebaskb2 , 0, 0, ebaskb2, ebaskb2, driver_device, 0, "Entex", "Electronic Basketball 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) +CONS( 1980, efootb4 , 0, 0, efootb4, efootb4, driver_device, 0, "Entex", "Color Football 4 (Entex)", GAME_SUPPORTS_SAVE ) +CONS( 1980, ebaskb2 , 0, 0, ebaskb2, ebaskb2, driver_device, 0, "Entex", "Electronic Basketball 2 (Entex)", GAME_SUPPORTS_SAVE ) CONS( 1980, raisedvl, 0, 0, raisedvl, raisedvl, driver_device, 0, "Entex", "Raise The Devil", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1979, gpoker, 0, 0, gpoker, gpoker, driver_device, 0, "Gakken", "Poker (Gakken, 1979 version)", GAME_SUPPORTS_SAVE ) @@ -4604,7 +4615,7 @@ CONS( 1982, mmerlin, 0, 0, mmerlin, mmerlin, driver_device, 0, "Par CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // some of the minigames: *** -CONS( 1979, tbreakup, 0, 0, tbreakup, tbreakup, driver_device, 0, "Tomy", "Break Up (Tomy)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) +CONS( 1979, tbreakup, 0, 0, tbreakup, tbreakup, driver_device, 0, "Tomy", "Break Up (Tomy)", GAME_SUPPORTS_SAVE ) // ***: As far as MESS is concerned, the game is emulated fine. But for it to be playable, it requires interaction // with other, unemulatable, things eg. game board/pieces, playing cards, pen & paper, etc. diff --git a/src/mess/layout/ebaskb2.lay b/src/mess/layout/ebaskb2.lay new file mode 100644 index 00000000000..5a0a3d376f7 --- /dev/null +++ b/src/mess/layout/ebaskb2.lay @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mess/layout/efootb4.lay b/src/mess/layout/efootb4.lay new file mode 100644 index 00000000000..71266b11448 --- /dev/null +++ b/src/mess/layout/efootb4.lay @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mess/layout/h2hbaseb.lay b/src/mess/layout/h2hbaseb.lay index 860ee6c23b6..ed35017c1b9 100644 --- a/src/mess/layout/h2hbaseb.lay +++ b/src/mess/layout/h2hbaseb.lay @@ -4,45 +4,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - + + + - - - - - - - - - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - diff --git a/src/mess/layout/tbreakup.lay b/src/mess/layout/tbreakup.lay new file mode 100644 index 00000000000..f203a23fee9 --- /dev/null +++ b/src/mess/layout/tbreakup.lay @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3778c95e95a7eefd3054fa5da530f048ad59a5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Mon, 8 Jun 2015 00:34:58 -0300 Subject: [PATCH 268/284] Initial minimal skeleton driver for Itautec I7000 computer. Thanks to Alexandre Souza (a.k.a. Tabajara). --- scripts/target/mame/mess.lua | 1 + src/mame/mess.lst | 1 + src/mess/drivers/i7000.c | 69 ++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 src/mess/drivers/i7000.c diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 79e85e7f938..a9aabf019af 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -2611,6 +2611,7 @@ files { MAME_DIR .. "src/mess/drivers/hunter2.c", MAME_DIR .. "src/emu/machine/nsc810.c", MAME_DIR .. "src/emu/machine/nsc810.h", + MAME_DIR .. "src/mess/drivers/i7000.c", MAME_DIR .. "src/mess/drivers/ibm6580.c", MAME_DIR .. "src/mess/drivers/ie15.c", MAME_DIR .. "src/mess/machine/ie15_kbd.c", diff --git a/src/mame/mess.lst b/src/mame/mess.lst index f3250b67668..316f8a4d2aa 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -2281,6 +2281,7 @@ elwro800 fk1 et3400 amu880 +i7000 interact jr100 jr100u diff --git a/src/mess/drivers/i7000.c b/src/mess/drivers/i7000.c new file mode 100644 index 00000000000..44479b3d5a8 --- /dev/null +++ b/src/mess/drivers/i7000.c @@ -0,0 +1,69 @@ +// license:GPL-2.0+ +// copyright-holders: Felipe Sanches +/*************************************************************************** + + Itautec I7000 + + driver by Felipe C. da S. Sanches + with tech info provided by Alexandre Souza (a.k.a. Tabajara). + +****************************************************************************/ + +#include "emu.h" +#include "cpu/z80/z80.h" //CPU was actually a NSC800 (Z80 compatible) + + +class i7000_state : public driver_device +{ +public: + i7000_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) { } + +// DECLARE_READ8_MEMBER( i7000_io_r ); +// DECLARE_WRITE8_MEMBER( i7000_io_w ); + + DECLARE_DRIVER_INIT(i7000); +}; + +DRIVER_INIT_MEMBER(i7000_state, i7000) +{ +} + +static ADDRESS_MAP_START(i7000_mem, AS_PROGRAM, 8, i7000_state) + AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) + AM_RANGE(0x1000, 0xffff) AM_RAM +ADDRESS_MAP_END + +/* +static ADDRESS_MAP_START( i7000_io , AS_IO, 8, i7000_state) + ADDRESS_MAP_UNMAP_HIGH + ADDRESS_MAP_GLOBAL_MASK (0xff) + AM_RANGE(0x00, 0xff) AM_READWRITE(i7000_io_r, i7000_io_w) +ADDRESS_MAP_END +*/ + +static MACHINE_CONFIG_START( i7000, i7000_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", NSC800, XTAL_4MHz) + MCFG_CPU_PROGRAM_MAP(i7000_mem) +// MCFG_CPU_IO_MAP(i7000_io) + +MACHINE_CONFIG_END + +ROM_START( i7000 ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "i7000_boot_v1_4r02_15_10_85_d52d.rom", 0x0000, 0x1000, CRC(622412e5) SHA1(bf187a095600fd46a739c35132a85b5f39b2f867) ) + + ROM_REGION( 0x0800, "gfx1", 0 ) + ROM_LOAD( "i7000_chargen.rom", 0x0000, 0x0800, CRC(7ba75183) SHA1(4af799f4a8bd385e1e4e5ece378df93e1133dc12) ) + + ROM_REGION( 0x1000, "drive", 0 ) + ROM_LOAD( "i7000_drive_ci01.rom", 0x0000, 0x1000, CRC(d8d6e5c1) SHA1(93e7db42fbfaa8243973321c7fc8c51ed80780be) ) + + ROM_REGION( 0x1000, "telex", 0 ) + ROM_LOAD( "i7000_telex_ci09.rom", 0x0000, 0x1000, CRC(c1c8fcc8) SHA1(cbf5fb600e587b998f190a9e3fb398a51d8a5e87) ) +ROM_END + +/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ +COMP( 1982, i7000, 0, 0, i7000, 0, i7000_state, i7000, "Itautec", "I-7000", GAME_NOT_WORKING | GAME_NO_SOUND) From 3490c921c310ba34ea787b4186f3d401577e706d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Tue, 9 Jun 2015 09:24:58 -0300 Subject: [PATCH 269/284] Adding a cartridge interface and a cartridges softlist for the Itautec I7000 computer. Thanks Alexandre Souza (Tabajara) for all of the cartridges data. --- hash/i7000_card.xml | 145 +++++++++++++++++++++++++++++++++++++++ src/mess/drivers/i7000.c | 26 ++++++- 2 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 hash/i7000_card.xml diff --git a/hash/i7000_card.xml b/hash/i7000_card.xml new file mode 100644 index 00000000000..974258b0fbd --- /dev/null +++ b/hash/i7000_card.xml @@ -0,0 +1,145 @@ + + + + + + I-7101 SET 78 COML v1.3 R01 + 198? + Itautec + + + + + + + + + I-7104 TELEX v1.0 R4 (Aug 31st, 1987) + 1987 + Itautec + + + + + + + + + + + + I-7105 REDATOR v1.2 R02 (Sept 16th, 1983) + 1983 + Itautec + + + + + + + + + + + + I-7106 SET 3278 v1.2 R00 (Mar 21st, 1985) + 1985 + Itautec + + + + + + + + + I-7107 SET VT52 v1.0 R02 (Feb 25th, 1986) + 1986 + Itautec + + + + + + + + + + I-7113 v1.2 R02 (Mar 4th, 1986) + 1986 + Itautec + + + + + + + + + I-7119 REDE LOCAL v1.0 R01 (Mar 21st, 1987) + 1987 + Itautec + + + + + + + + + + I-7120 TELEX II v1.0 R04 (Aug 31st, 1987) + 1987 + Itautec + + + + + + + + + + + + I-71XX REDATOR v1.2 R04 + 198? + Itautec + + + + + + + + + + + + I-71XX SETDISC + 198? + Itautec + + + + + + + + + + I-71XX VIDEOTEXTO + 198? + Itautec + + + + + + + + + diff --git a/src/mess/drivers/i7000.c b/src/mess/drivers/i7000.c index 44479b3d5a8..eacbec67efc 100644 --- a/src/mess/drivers/i7000.c +++ b/src/mess/drivers/i7000.c @@ -11,18 +11,23 @@ #include "emu.h" #include "cpu/z80/z80.h" //CPU was actually a NSC800 (Z80 compatible) - +#include "bus/generic/carts.h" class i7000_state : public driver_device { public: i7000_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_card(*this, "cardslot") + { } + + required_device m_card; // DECLARE_READ8_MEMBER( i7000_io_r ); // DECLARE_WRITE8_MEMBER( i7000_io_w ); DECLARE_DRIVER_INIT(i7000); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER( i7000_card ); }; DRIVER_INIT_MEMBER(i7000_state, i7000) @@ -42,6 +47,16 @@ static ADDRESS_MAP_START( i7000_io , AS_IO, 8, i7000_state) ADDRESS_MAP_END */ +DEVICE_IMAGE_LOAD_MEMBER( i7000_state, i7000_card ) +{ + UINT32 size = m_card->common_get_size("rom"); + + m_card->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_BIG); + m_card->common_load_rom(m_card->get_rom_base(), size, "rom"); + + return IMAGE_INIT_PASS; +} + static MACHINE_CONFIG_START( i7000, i7000_state ) /* basic machine hardware */ @@ -49,6 +64,13 @@ static MACHINE_CONFIG_START( i7000, i7000_state ) MCFG_CPU_PROGRAM_MAP(i7000_mem) // MCFG_CPU_IO_MAP(i7000_io) + /* Cartridge slot */ + MCFG_GENERIC_CARTSLOT_ADD("cardslot", generic_romram_plain_slot, "i7000_card") + MCFG_GENERIC_EXTENSIONS("rom") + MCFG_GENERIC_LOAD(i7000_state, i7000_card) + + /* Software lists */ + MCFG_SOFTWARE_LIST_ADD("card_list", "i7000_card") MACHINE_CONFIG_END ROM_START( i7000 ) From bbe27d0884e6bb9cff21c3bbc0715c41af6df23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Tue, 9 Jun 2015 09:58:09 -0300 Subject: [PATCH 270/284] Adding all of the Itautec I-7000 technical specs that are available up-to-now. --- src/mess/drivers/i7000.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/mess/drivers/i7000.c b/src/mess/drivers/i7000.c index eacbec67efc..cd0148b17ef 100644 --- a/src/mess/drivers/i7000.c +++ b/src/mess/drivers/i7000.c @@ -7,6 +7,39 @@ driver by Felipe C. da S. Sanches with tech info provided by Alexandre Souza (a.k.a. Tabajara). + The portuguese Wikipedia article available at + http://pt.wikipedia.org/wiki/Itautec_I-7000 + also provides a technical overview of this machine: + + The I-7000 was the first computer manufactured by Itautec + (http://www.itautec.com.br/pt-br/produtos). It was originally an 8 bit CP/M + computer that became an IBM PC-XT clone in later hardware revisions which + took the "I-7000 PC-XT" name. + + * Released in 1982 + * Operating System: SIM/M / BASIC + * CPU: National NSC800 D-4 at 4,00 MHz + * Memory: 64KB to 128KB + * keyboards: 80 keys (with a reduced numerical keypad and function keys) + * display: + - 40 X 25 text + - 80 X 25 text + - 160 X 100 (8 colors) + - 640 X 200 (monochrome, with an expansion board) + - 320 X 200 (16 colors, with an expansion board) + * Expansion slots: + - 1 frontal cart slot + - 4 internal expansion slots + * Ports: + - 1 composite video output for a color monitor + - 2 cassete interfaces + - 1 RS-232C serial port + - 1 parallel interface + * Storage: + - Cassetes recorder + - Up to 4 external floppy drives: 8" (FD/DD, 1,1MB) or 5" 1/4 + - Up to 1 external 10 MB hard-drive + ****************************************************************************/ #include "emu.h" @@ -34,9 +67,11 @@ DRIVER_INIT_MEMBER(i7000_state, i7000) { } +/*FIXME: we still need to figure out the proper memory map + for the maincpu and where the cartridge slot maps to. */ static ADDRESS_MAP_START(i7000_mem, AS_PROGRAM, 8, i7000_state) - AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) - AM_RANGE(0x1000, 0xffff) AM_RAM +/* guessed */ AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) +/* guessed */ AM_RANGE(0x1000, 0xffff) AM_RAM ADDRESS_MAP_END /* From f73fea5b5129be68e0cacbb03b98104aacb48018 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jun 2015 03:20:39 +0200 Subject: [PATCH 271/284] small fix --- src/mess/drivers/hh_tms1k.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index b7c3d51b405..5cf0d2ba650 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -4090,7 +4090,6 @@ WRITE8_MEMBER(tbreakup_state::expander_w) { // TMS1025 port 1-7 data m_exp_port[offset] = data; - prepare_display(); } WRITE16_MEMBER(tbreakup_state::write_r) From 038c9ddde33ac208f8cfda2530322f718ba01c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Wed, 10 Jun 2015 02:17:11 -0300 Subject: [PATCH 272/284] Initial 40x25 monochrom text-mode video emulation for the Itautec I-7000 computer. --- src/mess/drivers/i7000.c | 86 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 4 deletions(-) diff --git a/src/mess/drivers/i7000.c b/src/mess/drivers/i7000.c index cd0148b17ef..e0f160ed985 100644 --- a/src/mess/drivers/i7000.c +++ b/src/mess/drivers/i7000.c @@ -51,15 +51,22 @@ class i7000_state : public driver_device public: i7000_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_card(*this, "cardslot") - { } + m_card(*this, "cardslot"), + m_videoram(*this, "videoram") + { } + + virtual void video_start(); required_device m_card; + required_shared_ptr m_videoram; + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT8 *m_char_rom; // DECLARE_READ8_MEMBER( i7000_io_r ); // DECLARE_WRITE8_MEMBER( i7000_io_w ); DECLARE_DRIVER_INIT(i7000); + DECLARE_PALETTE_INIT(i7000); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( i7000_card ); }; @@ -67,11 +74,49 @@ DRIVER_INIT_MEMBER(i7000_state, i7000) { } +PALETTE_INIT_MEMBER(i7000_state, i7000) +{ + palette.set_pen_color(0, rgb_t(0x33, 0x33, 0x33)); + palette.set_pen_color(1, rgb_t(0xBB, 0xBB, 0xBB)); +} + +void i7000_state::video_start() +{ + // find memory regions + m_char_rom = memregion("gfx1")->base(); +} + +UINT32 i7000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + offs_t addr = 0; + + for (int sy = 0; sy < 25; sy++) + { + for (int sx = 0; sx < 40; sx++) + { + UINT8 data = m_videoram[addr++]; + for (int y = 0; y < 8; y++) + { + int color = m_char_rom[data*8 + y]; + for (int x = 0; x < 8; x++) + { + bitmap.pix16(sy*8 + y, sx*8 + 7 - x) = (color & 1); + color >>= 1; + } + } + } + } + + return 0; +} + /*FIXME: we still need to figure out the proper memory map for the maincpu and where the cartridge slot maps to. */ static ADDRESS_MAP_START(i7000_mem, AS_PROGRAM, 8, i7000_state) -/* guessed */ AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) -/* guessed */ AM_RANGE(0x1000, 0xffff) AM_RAM + AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) + AM_RANGE(0x1000, 0x1fff) AM_RAM + AM_RANGE(0x2000, 0xffff) AM_RAM AM_SHARE("videoram") +// AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("cardslot", 0) ADDRESS_MAP_END /* @@ -92,6 +137,25 @@ DEVICE_IMAGE_LOAD_MEMBER( i7000_state, i7000_card ) return IMAGE_INIT_PASS; } +#if 0 +static const gfx_layout i7000_charlayout = +{ + 8, 8, /* 8 x 8 characters */ + 256, /* 256 characters */ + 1, /* 1 bits per pixel */ + { 0 }, /* no bitplanes */ + /* x offsets */ + { 0, 1, 2, 3, 4, 5, 6, 7 }, + /* y offsets */ + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, + 8*8 /* every char takes 8 bytes */ +}; + +static GFXDECODE_START( i7000 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, i7000_charlayout, 0, 8 ) +GFXDECODE_END +#endif + static MACHINE_CONFIG_START( i7000, i7000_state ) /* basic machine hardware */ @@ -99,6 +163,20 @@ static MACHINE_CONFIG_START( i7000, i7000_state ) MCFG_CPU_PROGRAM_MAP(i7000_mem) // MCFG_CPU_IO_MAP(i7000_io) + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_SCREEN_SIZE(320, 200) /* 40x25 8x8 chars */ + MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) + + MCFG_SCREEN_UPDATE_DRIVER(i7000_state, screen_update) + MCFG_SCREEN_PALETTE("palette") + + MCFG_PALETTE_ADD("palette", 2) + MCFG_PALETTE_INIT_OWNER(i7000_state, i7000) + +// MCFG_GFXDECODE_ADD("gfxdecode", "palette", i7000) + /* Cartridge slot */ MCFG_GENERIC_CARTSLOT_ADD("cardslot", generic_romram_plain_slot, "i7000_card") MCFG_GENERIC_EXTENSIONS("rom") From 34d29b7e27b9ffa4e8fffeb38ec420f9ee4c9aed Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 9 Jun 2015 20:17:31 +0200 Subject: [PATCH 273/284] apricot: improve sio hookup, more disks load --- src/mess/drivers/apricot.c | 24 ++++++++++++++++++++---- src/mess/machine/apricotkb_hle.c | 6 +++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 400a31a70a0..36d0fd5b524 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -39,7 +39,6 @@ public: m_cpu(*this, "ic91"), m_iop(*this, "ic71"), m_ram(*this, RAM_TAG), - m_sn(*this, "ic7"), m_crtc(*this, "ic30"), m_ppi(*this, "ic17"), m_pic(*this, "ic31"), @@ -73,7 +72,9 @@ public: DECLARE_WRITE_LINE_MEMBER(timer_out1); DECLARE_WRITE_LINE_MEMBER(timer_out2); DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w); + DECLARE_READ8_MEMBER(sio_da_r); DECLARE_READ8_MEMBER(sio_ca_r); + DECLARE_READ8_MEMBER(sio_db_r); DECLARE_READ8_MEMBER(sio_cb_r); DECLARE_WRITE_LINE_MEMBER(write_centronics_fault); @@ -94,7 +95,6 @@ private: required_device m_cpu; required_device m_iop; required_device m_ram; - required_device m_sn; required_device m_crtc; required_device m_ppi; required_device m_pic; @@ -222,6 +222,14 @@ WRITE_LINE_MEMBER( apricot_state::timer_out2 ) } } +READ8_MEMBER( apricot_state::sio_da_r ) +{ + if (m_bus_locked) + return m_sio->m1_r(); + + return m_sio->da_r(space, offset); +} + READ8_MEMBER( apricot_state::sio_ca_r ) { if (m_bus_locked) @@ -238,6 +246,14 @@ READ8_MEMBER( apricot_state::sio_cb_r ) return m_sio->cb_r(space, offset); } +READ8_MEMBER( apricot_state::sio_db_r ) +{ + if (m_bus_locked) + return m_sio->m1_r(); + + return m_sio->db_r(space, offset); +} + //************************************************************************** // FLOPPY @@ -339,9 +355,9 @@ static ADDRESS_MAP_START( apricot_io, AS_IO, 16, apricot_state ) AM_RANGE(0x48, 0x4f) AM_DEVREADWRITE8("ic17", i8255_device, read, write, 0x00ff) AM_RANGE(0x50, 0x51) AM_MIRROR(0x06) AM_DEVWRITE8("ic7", sn76489_device, write, 0x00ff) AM_RANGE(0x58, 0x5f) AM_DEVREADWRITE8("ic16", pit8253_device, read, write, 0x00ff) - AM_RANGE(0x60, 0x61) AM_DEVREADWRITE8("ic15", z80sio0_device, da_r, da_w, 0x00ff) + AM_RANGE(0x60, 0x61) AM_READ8(sio_da_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, da_w, 0x00ff) AM_RANGE(0x62, 0x63) AM_READ8(sio_ca_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, ca_w, 0x00ff) - AM_RANGE(0x64, 0x65) AM_DEVREADWRITE8("ic15", z80sio0_device, db_r, db_w, 0x00ff) + AM_RANGE(0x64, 0x65) AM_READ8(sio_db_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, db_w, 0x00ff) AM_RANGE(0x66, 0x67) AM_READ8(sio_cb_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, cb_w, 0x00ff) AM_RANGE(0x68, 0x69) AM_MIRROR(0x04) AM_DEVWRITE8("ic30", mc6845_device, address_w, 0x00ff) AM_RANGE(0x6a, 0x6b) AM_MIRROR(0x04) AM_DEVREADWRITE8("ic30", mc6845_device, register_r, register_w, 0x00ff) diff --git a/src/mess/machine/apricotkb_hle.c b/src/mess/machine/apricotkb_hle.c index 3b8664cc961..e40677e5078 100644 --- a/src/mess/machine/apricotkb_hle.c +++ b/src/mess/machine/apricotkb_hle.c @@ -255,9 +255,9 @@ void apricot_keyboard_hle_device::rcv_complete() receive_register_extract(); m_data_in = get_received_char(); - // reset command? send keyboard ready - if (m_data_in == 0xe8) - transmit_register_setup(0xfb); + // reset command? send keyboard ready (likely needs a delay, just disable for now) +// if (m_data_in == 0xe8) +// transmit_register_setup(0xfb); } WRITE_LINE_MEMBER( apricot_keyboard_hle_device::rxd_w ) From 30fb2540c204e32a255fbb19c1d245315c216844 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 10 Jun 2015 09:10:54 +0200 Subject: [PATCH 274/284] apricot: split 128/512k ram card into two devices --- src/emu/bus/apricot/cards.c | 3 +- src/emu/bus/apricot/ram.c | 100 ++++++++++++++++++++++++------------ src/emu/bus/apricot/ram.h | 30 +++++++++-- 3 files changed, 95 insertions(+), 38 deletions(-) diff --git a/src/emu/bus/apricot/cards.c b/src/emu/bus/apricot/cards.c index b2369db7f90..9a97adffca6 100644 --- a/src/emu/bus/apricot/cards.c +++ b/src/emu/bus/apricot/cards.c @@ -9,6 +9,7 @@ #include "cards.h" SLOT_INTERFACE_START( apricot_expansion_cards ) + SLOT_INTERFACE("128k", APRICOT_128K_RAM) SLOT_INTERFACE("256k", APRICOT_256K_RAM) - SLOT_INTERFACE("128_512k", APRICOT_128_512K_RAM) + SLOT_INTERFACE("512k", APRICOT_512K_RAM) SLOT_INTERFACE_END diff --git a/src/emu/bus/apricot/ram.c b/src/emu/bus/apricot/ram.c index fb24fba61db..0a166c82e6d 100644 --- a/src/emu/bus/apricot/ram.c +++ b/src/emu/bus/apricot/ram.c @@ -14,7 +14,8 @@ //************************************************************************** const device_type APRICOT_256K_RAM = &device_creator; -const device_type APRICOT_128_512K_RAM = &device_creator; +const device_type APRICOT_128K_RAM = &device_creator; +const device_type APRICOT_512K_RAM = &device_creator; //************************************************************************** @@ -71,38 +72,33 @@ void apricot_256k_ram_device::device_reset() //************************************************************************** -// APRICOT 128/512K RAM DEVICE +// APRICOT 128K RAM DEVICE //************************************************************************** //------------------------------------------------- // input_ports - device-specific input ports //------------------------------------------------- -static INPUT_PORTS_START( apricot_128_512k ) - PORT_START("config") - PORT_CONFNAME(0x01, 0x01, "DRAM Size") - PORT_CONFSETTING(0x00, "64K") - PORT_CONFSETTING(0x01, "256K") +static INPUT_PORTS_START( apricot_128k ) PORT_START("strap") - PORT_DIPNAME(0x03, 0x00, "Base Address") + PORT_DIPNAME(0x03, 0x01, "Base Address") PORT_DIPSETTING(0x00, "512K") PORT_DIPSETTING(0x01, "256K - 384K") PORT_DIPSETTING(0x02, "384K - 512K") INPUT_PORTS_END -ioport_constructor apricot_128_512k_ram_device::device_input_ports() const +ioport_constructor apricot_128k_ram_device::device_input_ports() const { - return INPUT_PORTS_NAME( apricot_128_512k ); + return INPUT_PORTS_NAME( apricot_128k ); } //------------------------------------------------- // apricot_128_512k_ram_device - constructor //------------------------------------------------- -apricot_128_512k_ram_device::apricot_128_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - device_t(mconfig, APRICOT_128_512K_RAM, "Apricot 128/512K RAM Expansion Board", tag, owner, clock, "apricot_128_512k_ram", __FILE__), +apricot_128k_ram_device::apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_128K_RAM, "Apricot 128/512K RAM Expansion Board (128K)", tag, owner, clock, "apricot_128k_ram", __FILE__), device_apricot_expansion_card_interface(mconfig, *this), - m_config(*this, "config"), m_strap(*this, "strap") { } @@ -111,31 +107,71 @@ apricot_128_512k_ram_device::apricot_128_512k_ram_device(const machine_config &m // device_start - device-specific startup //------------------------------------------------- -void apricot_128_512k_ram_device::device_start() +void apricot_128k_ram_device::device_start() { + m_ram.resize(0x20000 / 2); } //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- -void apricot_128_512k_ram_device::device_reset() +void apricot_128k_ram_device::device_reset() { - // 128 or 512k? - if (m_config->read() == 1) - { - m_ram.resize(0x80000 / 2); - - if (m_strap->read() == 0) - m_bus->m_program->install_ram(0x40000, 0xbffff, &m_ram[0]); - } - else - { - m_ram.resize(0x20000 / 2); - - if (m_strap->read() == 1) - m_bus->m_program->install_ram(0x40000, 0x5ffff, &m_ram[0]); - else if (m_strap->read() == 2) - m_bus->m_program->install_ram(0x60000, 0x7ffff, &m_ram[0]); - } + if (m_strap->read() == 1) + m_bus->m_program->install_ram(0x40000, 0x5ffff, &m_ram[0]); + else if (m_strap->read() == 2) + m_bus->m_program->install_ram(0x60000, 0x7ffff, &m_ram[0]); +} + + +//************************************************************************** +// APRICOT 512K RAM DEVICE +//************************************************************************** + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( apricot_512k ) + PORT_START("strap") + PORT_DIPNAME(0x03, 0x00, "Base Address") + PORT_DIPSETTING(0x00, "512K") + PORT_DIPSETTING(0x01, "256K - 384K") + PORT_DIPSETTING(0x02, "384K - 512K") +INPUT_PORTS_END + +ioport_constructor apricot_512k_ram_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( apricot_512k ); +} + +//------------------------------------------------- +// apricot_128_512k_ram_device - constructor +//------------------------------------------------- + +apricot_512k_ram_device::apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, APRICOT_512K_RAM, "Apricot 128/512K RAM Expansion Board (512K)", tag, owner, clock, "apricot_512k_ram", __FILE__), + device_apricot_expansion_card_interface(mconfig, *this), + m_strap(*this, "strap") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void apricot_512k_ram_device::device_start() +{ + m_ram.resize(0x80000 / 2); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void apricot_512k_ram_device::device_reset() +{ + if (m_strap->read() == 0) + m_bus->m_program->install_ram(0x40000, 0xbffff, &m_ram[0]); } diff --git a/src/emu/bus/apricot/ram.h b/src/emu/bus/apricot/ram.h index 0610585376f..20ac01f2867 100644 --- a/src/emu/bus/apricot/ram.h +++ b/src/emu/bus/apricot/ram.h @@ -40,13 +40,33 @@ private: }; -// ======================> apricot_128_512k_ram_device +// ======================> apricot_128k_ram_device -class apricot_128_512k_ram_device : public device_t, public device_apricot_expansion_card_interface +class apricot_128k_ram_device : public device_t, public device_apricot_expansion_card_interface { public: // construction/destruction - apricot_128_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + virtual void device_reset(); + +private: + required_ioport m_strap; + + std::vector m_ram; +}; + + +// ======================> apricot_512k_ram_device + +class apricot_512k_ram_device : public device_t, public device_apricot_expansion_card_interface +{ +public: + // construction/destruction + apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: virtual ioport_constructor device_input_ports() const; @@ -54,7 +74,6 @@ protected: virtual void device_reset(); private: - required_ioport m_config; required_ioport m_strap; std::vector m_ram; @@ -63,7 +82,8 @@ private: // device type definition extern const device_type APRICOT_256K_RAM; -extern const device_type APRICOT_128_512K_RAM; +extern const device_type APRICOT_128K_RAM; +extern const device_type APRICOT_512K_RAM; #endif // __APRICOT_RAM__ From 7981db6aef088506e67a34402027c88f62b795d5 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 10 Jun 2015 09:15:28 +0200 Subject: [PATCH 275/284] Intel 8089 -> I8089 for consistency --- src/emu/cpu/i8089/i8089.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emu/cpu/i8089/i8089.c b/src/emu/cpu/i8089/i8089.c index 23b25d891a0..b81869bda1d 100644 --- a/src/emu/cpu/i8089/i8089.c +++ b/src/emu/cpu/i8089/i8089.c @@ -33,7 +33,7 @@ const device_type I8089 = &device_creator; //------------------------------------------------- i8089_device::i8089_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - cpu_device(mconfig, I8089, "Intel 8089", tag, owner, clock, "i8089", __FILE__), + cpu_device(mconfig, I8089, "I8089", tag, owner, clock, "i8089", __FILE__), m_icount(0), m_ch1(*this, "1"), m_ch2(*this, "2"), From 9de83ac835aaf4d0212a3aa9859c5b0f61a72f76 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 10 Jun 2015 09:58:44 +0200 Subject: [PATCH 276/284] i8089: add support for wait for destination drq --- src/emu/cpu/i8089/i8089_channel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emu/cpu/i8089/i8089_channel.c b/src/emu/cpu/i8089/i8089_channel.c index eb5d49823c7..fe7666ac17c 100644 --- a/src/emu/cpu/i8089/i8089_channel.c +++ b/src/emu/cpu/i8089/i8089_channel.c @@ -312,7 +312,9 @@ int i8089_channel::execute_run() fatalerror("%s('%s'): dma translate requested\n", shortname(), tag()); case DMA_WAIT_FOR_DEST_DRQ: - fatalerror("%s('%s'): wait for destination drq not supported\n", shortname(), tag()); + if (m_drq) + m_dma_state = DMA_STORE; + break; case DMA_STORE: if (VERBOSE_DMA) From 58e21376c9cc831b923196e00037e5048279c646 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 10 Jun 2015 09:59:15 +0200 Subject: [PATCH 277/284] apricot: fix iop ram access with expansion cards --- src/emu/bus/apricot/expansion.c | 34 +++++++++++++++++++++++++++++---- src/emu/bus/apricot/expansion.h | 18 +++++++++++++---- src/emu/bus/apricot/ram.c | 10 +++++----- src/mess/drivers/apricot.c | 1 + 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/src/emu/bus/apricot/expansion.c b/src/emu/bus/apricot/expansion.c index 26b18e0a551..7fe2b2a721c 100644 --- a/src/emu/bus/apricot/expansion.c +++ b/src/emu/bus/apricot/expansion.c @@ -62,6 +62,8 @@ apricot_expansion_bus_device::apricot_expansion_bus_device(const machine_config device_t(mconfig, APRICOT_EXPANSION_BUS, "Apricot Expansion Bus", tag, owner, clock, "apricot_exp_bus", __FILE__), m_program(NULL), m_io(NULL), + m_program_iop(NULL), + m_io_iop(NULL), m_dma1_handler(*this), m_dma2_handler(*this), m_ext1_handler(*this), @@ -102,10 +104,12 @@ void apricot_expansion_bus_device::device_start() void apricot_expansion_bus_device::device_reset() { cpu_device *cpu = m_owner->subdevice(m_cpu_tag); -if (!cpu->started()) - printf("cpu not running yet\n"); m_program = &cpu->space(AS_PROGRAM); m_io = &cpu->space(AS_IO); + + cpu_device *iop = m_owner->subdevice(m_iop_tag); + m_program_iop = &iop->space(AS_PROGRAM); + m_io_iop = &iop->space(AS_IO); } //------------------------------------------------- @@ -122,10 +126,20 @@ void apricot_expansion_bus_device::add_card(device_apricot_expansion_card_interf // set_cpu_tag - set cpu we are attached to //------------------------------------------------- -void apricot_expansion_bus_device::set_cpu_tag(device_t &device, device_t *owner, const char *cpu_tag) +void apricot_expansion_bus_device::set_cpu_tag(device_t &device, device_t *owner, const char *tag) { apricot_expansion_bus_device &bus = dynamic_cast(device); - bus.m_cpu_tag = cpu_tag; + bus.m_cpu_tag = tag; +} + +//------------------------------------------------- +// set_iop_tag - set iop we are attached to +//------------------------------------------------- + +void apricot_expansion_bus_device::set_iop_tag(device_t &device, device_t *owner, const char *tag) +{ + apricot_expansion_bus_device &bus = dynamic_cast(device); + bus.m_iop_tag = tag; } // callbacks from slot device to the host @@ -136,6 +150,18 @@ WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext2_w ) { m_ext2_handler(state WRITE_LINE_MEMBER( apricot_expansion_bus_device::int2_w ) { m_int2_handler(state); } WRITE_LINE_MEMBER( apricot_expansion_bus_device::int3_w ) { m_int3_handler(state); } +//------------------------------------------------- +// install_ram - attach ram to cpu/iop +//------------------------------------------------- + +void apricot_expansion_bus_device::install_ram(offs_t addrstart, offs_t addrend, void *baseptr) +{ + m_program->install_ram(addrstart, addrend, baseptr); + + if (m_program_iop) + m_program_iop->install_ram(addrstart, addrend, baseptr); +} + //************************************************************************** // CARTRIDGE INTERFACE diff --git a/src/emu/bus/apricot/expansion.h b/src/emu/bus/apricot/expansion.h index 7847345ac1b..91b3e8e31c8 100644 --- a/src/emu/bus/apricot/expansion.h +++ b/src/emu/bus/apricot/expansion.h @@ -57,6 +57,9 @@ MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_BUS, 0) \ apricot_expansion_bus_device::set_cpu_tag(*device, owner, _cpu_tag); +#define MCFG_EXPANSION_IOP_ADD(_tag) \ + apricot_expansion_bus_device::set_iop_tag(*device, owner, _tag); + #define MCFG_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \ MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_SLOT, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) @@ -134,13 +137,11 @@ public: { return downcast(device).m_int3_handler.set_callback(object); } // inline configuration - static void set_cpu_tag(device_t &device, device_t *owner, const char *cpu_tag); + static void set_cpu_tag(device_t &device, device_t *owner, const char *tag); + static void set_iop_tag(device_t &device, device_t *owner, const char *tag); void add_card(device_apricot_expansion_card_interface *card); - address_space *m_program; - address_space *m_io; - // from cards DECLARE_WRITE_LINE_MEMBER( dma1_w ); DECLARE_WRITE_LINE_MEMBER( dma2_w ); @@ -149,6 +150,8 @@ public: DECLARE_WRITE_LINE_MEMBER( int2_w ); DECLARE_WRITE_LINE_MEMBER( int3_w ); + void install_ram(offs_t addrstart, offs_t addrend, void *baseptr); + protected: // device-level overrides virtual void device_start(); @@ -157,6 +160,12 @@ protected: private: simple_list m_dev; + // address spaces we have access to + address_space *m_program; + address_space *m_io; + address_space *m_program_iop; + address_space *m_io_iop; + devcb_write_line m_dma1_handler; devcb_write_line m_dma2_handler; devcb_write_line m_ext1_handler; @@ -166,6 +175,7 @@ private: // configuration const char *m_cpu_tag; + const char *m_iop_tag; }; // device type definition diff --git a/src/emu/bus/apricot/ram.c b/src/emu/bus/apricot/ram.c index 0a166c82e6d..2221ae37227 100644 --- a/src/emu/bus/apricot/ram.c +++ b/src/emu/bus/apricot/ram.c @@ -65,9 +65,9 @@ void apricot_256k_ram_device::device_start() void apricot_256k_ram_device::device_reset() { if (m_sw->read() == 0) - m_bus->m_program->install_ram(0x40000, 0x7ffff, &m_ram[0]); + m_bus->install_ram(0x40000, 0x7ffff, &m_ram[0]); else - m_bus->m_program->install_ram(0x80000, 0xbffff, &m_ram[0]); + m_bus->install_ram(0x80000, 0xbffff, &m_ram[0]); } @@ -119,9 +119,9 @@ void apricot_128k_ram_device::device_start() void apricot_128k_ram_device::device_reset() { if (m_strap->read() == 1) - m_bus->m_program->install_ram(0x40000, 0x5ffff, &m_ram[0]); + m_bus->install_ram(0x40000, 0x5ffff, &m_ram[0]); else if (m_strap->read() == 2) - m_bus->m_program->install_ram(0x60000, 0x7ffff, &m_ram[0]); + m_bus->install_ram(0x60000, 0x7ffff, &m_ram[0]); } @@ -173,5 +173,5 @@ void apricot_512k_ram_device::device_start() void apricot_512k_ram_device::device_reset() { if (m_strap->read() == 0) - m_bus->m_program->install_ram(0x40000, 0xbffff, &m_ram[0]); + m_bus->install_ram(0x40000, 0xbffff, &m_ram[0]); } diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 36d0fd5b524..15f5f1d5982 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -473,6 +473,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) // expansion bus MCFG_EXPANSION_ADD("exp", "ic91") + MCFG_EXPANSION_IOP_ADD("ic71") MCFG_EXPANSION_SLOT_ADD("exp:1", apricot_expansion_cards, NULL) MCFG_EXPANSION_SLOT_ADD("exp:2", apricot_expansion_cards, NULL) MACHINE_CONFIG_END From eecc50b48a0306da0f15b69cefe435e0ef1dd73a Mon Sep 17 00:00:00 2001 From: fulivi Date: Wed, 10 Jun 2015 12:22:17 +0200 Subject: [PATCH 278/284] hp64k: Improved HP Hybrid CPU (still no DMA) --- src/emu/cpu/hphybrid/hphybrid.c | 1478 ++++++++++++++------------ src/emu/cpu/hphybrid/hphybrid.h | 114 +- src/emu/cpu/hphybrid/hphybrid_dasm.c | 422 ++++---- 3 files changed, 1041 insertions(+), 973 deletions(-) diff --git a/src/emu/cpu/hphybrid/hphybrid.c b/src/emu/cpu/hphybrid/hphybrid.c index bef8da6ddb2..8a50c78368d 100644 --- a/src/emu/cpu/hphybrid/hphybrid.c +++ b/src/emu/cpu/hphybrid/hphybrid.c @@ -1,23 +1,26 @@ // license:BSD-3-Clause // copyright-holders:F. Ulivi +// +// TODO: +// - DMA #include "emu.h" #include "debugger.h" #include "hphybrid.h" enum { - HPHYBRID_A, - HPHYBRID_B, - HPHYBRID_C, - HPHYBRID_D, - HPHYBRID_P, - HPHYBRID_R, - HPHYBRID_IV, - HPHYBRID_PA, - HPHYBRID_DMAPA, - HPHYBRID_DMAMA, - HPHYBRID_DMAC, - HPHYBRID_I + HPHYBRID_A, + HPHYBRID_B, + HPHYBRID_C, + HPHYBRID_D, + HPHYBRID_P, + HPHYBRID_R, + HPHYBRID_IV, + HPHYBRID_PA, + HPHYBRID_DMAPA, + HPHYBRID_DMAMA, + HPHYBRID_DMAC, + HPHYBRID_I }; #define BIT_MASK(n) (1U << (n)) @@ -29,8 +32,8 @@ enum { // Bits in m_flags #define HPHYBRID_C_BIT 0 // Carry/extend #define HPHYBRID_O_BIT 1 // Overflow -#define HPHYBRID_CB_BIT 2 // Cb -#define HPHYBRID_DB_BIT 3 // Db +#define HPHYBRID_CB_BIT 2 // Cb +#define HPHYBRID_DB_BIT 3 // Db #define HPHYBRID_INTEN_BIT 4 // Interrupt enable #define HPHYBRID_DMAEN_BIT 5 // DMA enable #define HPHYBRID_DMADIR_BIT 6 // DMA direction (1 = OUT) @@ -46,814 +49,877 @@ enum { #define HP_RESET_ADDR 0x0020 -#define MAKE_IOADDR(pa , ic) (((pa) << HP_IOADDR_PA_SHIFT) | ((ic) << HP_IOADDR_IC_SHIFT)) - const device_type HP_5061_3011 = &device_creator; hp_hybrid_cpu_device::hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) - : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__), - m_program_config("program", ENDIANNESS_BIG, 16, 16, -1), - m_io_config("io", ENDIANNESS_BIG, 16, 6, -1) +: cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__), + m_program_config("program", ENDIANNESS_BIG, 16, 16, -1), + m_io_config("io", ENDIANNESS_BIG, 16, 6, -1) { } void hp_hybrid_cpu_device::device_start() { - m_reg_A = 0; - m_reg_B = 0; - m_reg_P = HP_RESET_ADDR; - m_reg_R = 0; - m_reg_C = 0; - m_reg_D = 0; - m_reg_IV = 0; - m_reg_PA[ 0 ] = 0; - m_reg_PA[ 1 ] = 0; - m_reg_PA[ 2 ] = 0; - m_flags = 0; - m_dmapa = 0; - m_dmama = 0; - m_dmac = 0; - m_reg_I = 0; + m_reg_A = 0; + m_reg_B = 0; + m_reg_P = HP_RESET_ADDR; + m_reg_R = 0; + m_reg_C = 0; + m_reg_D = 0; + m_reg_IV = 0; + m_reg_PA[ 0 ] = 0; + m_reg_PA[ 1 ] = 0; + m_reg_PA[ 2 ] = 0; + m_flags = 0; + m_dmapa = 0; + m_dmama = 0; + m_dmac = 0; + m_reg_I = 0; - { - state_add(HPHYBRID_A, "A", m_reg_A); - state_add(HPHYBRID_B, "B", m_reg_B); - state_add(HPHYBRID_C, "C", m_reg_C); - state_add(HPHYBRID_D, "D", m_reg_D); - state_add(HPHYBRID_P, "P", m_reg_P); - state_add(STATE_GENPC, "GENPC", m_reg_P).noshow(); - state_add(HPHYBRID_R, "R", m_reg_R); - state_add(STATE_GENSP, "GENSP", m_reg_R).noshow(); - state_add(HPHYBRID_IV, "IV", m_reg_IV); - state_add(HPHYBRID_PA, "PA", m_reg_PA[ 0 ]); - state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%9s"); - state_add(HPHYBRID_DMAPA , "DMAPA" , m_dmapa).noshow(); - state_add(HPHYBRID_DMAMA , "DMAMA" , m_dmama).noshow(); - state_add(HPHYBRID_DMAC , "DMAC" , m_dmac).noshow(); - state_add(HPHYBRID_I , "I" , m_reg_I).noshow(); - } + { + state_add(HPHYBRID_A, "A", m_reg_A); + state_add(HPHYBRID_B, "B", m_reg_B); + state_add(HPHYBRID_C, "C", m_reg_C); + state_add(HPHYBRID_D, "D", m_reg_D); + state_add(HPHYBRID_P, "P", m_reg_P); + state_add(STATE_GENPC, "GENPC", m_reg_P).noshow(); + state_add(HPHYBRID_R, "R", m_reg_R); + state_add(STATE_GENSP, "GENSP", m_reg_R).noshow(); + state_add(HPHYBRID_IV, "IV", m_reg_IV); + state_add(HPHYBRID_PA, "PA", m_reg_PA[ 0 ]); + state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%9s"); + state_add(HPHYBRID_DMAPA , "DMAPA" , m_dmapa).noshow(); + state_add(HPHYBRID_DMAMA , "DMAMA" , m_dmama).noshow(); + state_add(HPHYBRID_DMAC , "DMAC" , m_dmac).noshow(); + state_add(HPHYBRID_I , "I" , m_reg_I).noshow(); + } - m_program = &space(AS_PROGRAM); - m_direct = &m_program->direct(); - m_io = &space(AS_IO); + m_program = &space(AS_PROGRAM); + m_direct = &m_program->direct(); + m_io = &space(AS_IO); - save_item(NAME(m_reg_A)); - save_item(NAME(m_reg_B)); - save_item(NAME(m_reg_C)); - save_item(NAME(m_reg_D)); - save_item(NAME(m_reg_P)); - save_item(NAME(m_reg_R)); - save_item(NAME(m_reg_IV)); - save_item(NAME(m_reg_PA[0])); - save_item(NAME(m_reg_PA[1])); - save_item(NAME(m_reg_PA[2])); - save_item(NAME(m_flags)); - save_item(NAME(m_dmapa)); - save_item(NAME(m_dmama)); - save_item(NAME(m_dmac)); - save_item(NAME(m_reg_I)); + save_item(NAME(m_reg_A)); + save_item(NAME(m_reg_B)); + save_item(NAME(m_reg_C)); + save_item(NAME(m_reg_D)); + save_item(NAME(m_reg_P)); + save_item(NAME(m_reg_R)); + save_item(NAME(m_reg_IV)); + save_item(NAME(m_reg_PA[0])); + save_item(NAME(m_reg_PA[1])); + save_item(NAME(m_reg_PA[2])); + save_item(NAME(m_flags)); + save_item(NAME(m_dmapa)); + save_item(NAME(m_dmama)); + save_item(NAME(m_dmac)); + save_item(NAME(m_reg_I)); - m_icountptr = &m_icount; + m_icountptr = &m_icount; } void hp_hybrid_cpu_device::device_reset() { - m_reg_P = HP_RESET_ADDR; - m_reg_I = RM(m_reg_P); - m_flags = 0; + m_reg_P = HP_RESET_ADDR; + m_reg_I = RM(m_reg_P); + m_flags = 0; } - + void hp_hybrid_cpu_device::execute_run() { - do { - debugger_instruction_hook(this, m_reg_P); - // TODO: check interrupts - // TODO: check dma - m_reg_I = execute_one(m_reg_I); - } while (m_icount > 0); + do { + debugger_instruction_hook(this, m_reg_P); + + // Check for interrupts + check_for_interrupts(); + + // TODO: check dma + m_reg_I = execute_one(m_reg_I); + } while (m_icount > 0); } void hp_hybrid_cpu_device::execute_set_input(int inputnum, int state) { + if (inputnum < HPHYBRID_INT_LVLS) { + if (state) { + BIT_SET(m_flags , HPHYBRID_IRH_BIT + inputnum); + } else { + BIT_CLR(m_flags , HPHYBRID_IRH_BIT + inputnum); + } + } } -/** +/** * Execute 1 instruction - * + * * @param opcode Opcode to be executed - * + * * @return Next opcode to be executed */ UINT16 hp_hybrid_cpu_device::execute_one(UINT16 opcode) { - if ((opcode & 0x7fe0) == 0x7000) { - // EXE - m_icount -= 8; - return RM(opcode & 0x1f); - } else { - m_reg_P = execute_one_sub(opcode); - return RM(m_reg_P); - } + if ((opcode & 0x7fe0) == 0x7000) { + // EXE + m_icount -= 8; + return RM(opcode & 0x1f); + } else { + m_reg_P = execute_one_sub(opcode); + return RM(m_reg_P); + } } -/** +/** * Execute 1 instruction (except EXE) - * + * * @param opcode Opcode to be executed (no EXE instructions) - * + * * @return new value of P register */ UINT16 hp_hybrid_cpu_device::execute_one_sub(UINT16 opcode) { - UINT16 ea; - UINT16 tmp; - - switch (opcode & 0x7800) { - case 0x0000: - // LDA - m_icount -= 13; - m_reg_A = RM(get_ea(opcode)); - break; + UINT16 ea; + UINT16 tmp; - case 0x0800: - // LDB - m_icount -= 13; - m_reg_B = RM(get_ea(opcode)); - break; + switch (opcode & 0x7800) { + case 0x0000: + // LDA + m_icount -= 13; + m_reg_A = RM(get_ea(opcode)); + break; - case 0x1000: - // CPA - m_icount -= 16; - if (m_reg_A != RM(get_ea(opcode))) { - // Skip next instruction - return m_reg_P + 2; - } - break; - - case 0x1800: - // CPB - m_icount -= 16; - if (m_reg_B != RM(get_ea(opcode))) { - // Skip next instruction - return m_reg_P + 2; - } - break; - - case 0x2000: - // ADA - m_icount -= 13; - do_add(m_reg_A , RM(get_ea(opcode))); - break; - - case 0x2800: - // ADB - m_icount -= 13; - do_add(m_reg_B , RM(get_ea(opcode))); - break; - - case 0x3000: - // STA - m_icount -= 13; - WM(get_ea(opcode) , m_reg_A); - break; - - case 0x3800: - // STB - m_icount -= 13; - WM(get_ea(opcode) , m_reg_B); - break; + case 0x0800: + // LDB + m_icount -= 13; + m_reg_B = RM(get_ea(opcode)); + break; - case 0x4000: - // JSM - m_icount -= 17; - WM(++m_reg_R , m_reg_P); - return get_ea(opcode); - - case 0x4800: - // ISZ - m_icount -= 19; - ea = get_ea(opcode); - tmp = RM(ea) + 1; - WM(ea , tmp); - if (tmp == 0) { - // Skip next instruction - return m_reg_P + 2; - } - break; - - case 0x5000: - // AND - m_icount -= 13; - m_reg_A &= RM(get_ea(opcode)); - break; - - case 0x5800: - // DSZ - m_icount -= 19; - ea = get_ea(opcode); - tmp = RM(ea) - 1; - WM(ea , tmp); - if (tmp == 0) { - // Skip next instruction - return m_reg_P + 2; - } - break; - - case 0x6000: - // IOR - m_icount -= 13; - m_reg_A |= RM(get_ea(opcode)); - break; - - case 0x6800: - // JMP - m_icount -= 8; - return get_ea(opcode); - - default: - switch (opcode & 0xfec0) { - case 0x7400: - // RZA - // SZA - m_icount -= 14; - return get_skip_addr(opcode , m_reg_A == 0); - - case 0x7440: - // RIA - // SIA - m_icount -= 14; - return get_skip_addr(opcode , m_reg_A++ == 0); - - case 0x7480: - // SFS - // SFC - m_icount -= 14; - // TODO: read flag bit - return get_skip_addr(opcode , true); - - case 0x7C00: - // RZB - // SZB - m_icount -= 14; - return get_skip_addr(opcode , m_reg_B == 0); - - case 0x7C40: - // RIB - // SIB - m_icount -= 14; - return get_skip_addr(opcode , m_reg_B++ == 0); - - case 0x7c80: - // SSS - // SSC - m_icount -= 14; - // TODO: read status bit - return get_skip_addr(opcode , true); - - case 0x7cc0: - // SHS - // SHC - m_icount -= 14; - return get_skip_addr(opcode , !BIT(m_flags , HPHYBRID_HALT_BIT)); - - default: - switch (opcode & 0xfe00) { - case 0x7600: - // SLA - // RLA - m_icount -= 14; - return get_skip_addr_sc(opcode , m_reg_A , 0); - - case 0x7e00: - // SLB - // RLB - m_icount -= 14; - return get_skip_addr_sc(opcode , m_reg_B , 0); - - case 0xf400: - // SAP - // SAM - m_icount -= 14; - return get_skip_addr_sc(opcode , m_reg_A , 15); - - case 0xf600: - // SOC - // SOS - m_icount -= 14; - return get_skip_addr_sc(opcode , m_flags , HPHYBRID_O_BIT); - - case 0xfc00: - // SBP - // SBM - m_icount -= 14; - return get_skip_addr_sc(opcode , m_reg_B , 15); - - case 0xfe00: - // SEC - // SES - m_icount -= 14; - return get_skip_addr_sc(opcode , m_flags , HPHYBRID_C_BIT); - - default: - switch (opcode & 0xfff0) { - case 0xf100: - // AAR - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - // A shift by 16 positions is equivalent to a shift by 15 - tmp = tmp > 15 ? 15 : tmp; - m_reg_A = ((m_reg_A ^ 0x8000) >> tmp) - (0x8000 >> tmp); - break; - - case 0xf900: - // ABR - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - tmp = tmp > 15 ? 15 : tmp; - m_reg_B = ((m_reg_B ^ 0x8000) >> tmp) - (0x8000 >> tmp); - break; - - case 0xf140: - // SAR - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - m_reg_A >>= tmp; - break; - - case 0xf940: - // SBR - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - m_reg_B >>= tmp; - break; - - case 0xf180: - // SAL - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - m_reg_A <<= tmp; - break; - - case 0xf980: - // SBL - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - m_reg_B <<= tmp; - break; - - case 0xf1c0: - // RAR - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - m_reg_A = (m_reg_A >> tmp) | (m_reg_A << (16 - tmp)); - break; - - case 0xf9c0: - // RBR - tmp = (opcode & 0xf) + 1; - m_icount -= (9 + tmp); - m_reg_B = (m_reg_B >> tmp) | (m_reg_B << (16 - tmp)); - break; - - default: - if ((opcode & 0xf760) == 0x7160) { - // Place/withdraw instructions - m_icount -= 23; - do_pw(opcode); - } else if ((opcode & 0xff80) == 0xf080) { - // RET - m_icount -= 16; - if (BIT(opcode , 6)) { - // Pop PA stack - if (BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) { - BIT_CLR(m_flags , HPHYBRID_IRH_SVC_BIT); - memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); - } else if (BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { - BIT_CLR(m_flags , HPHYBRID_IRL_SVC_BIT); - memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); - } - } - tmp = RM(m_reg_R--) + (opcode & 0x1f); - return BIT(opcode , 5) ? tmp - 0x20 : tmp; - } else { - switch (opcode) { - case 0x7100: - // SDO - m_icount -= 12; - BIT_SET(m_flags , HPHYBRID_DMADIR_BIT); - break; - - case 0x7108: - // SDI - m_icount -= 12; - BIT_CLR(m_flags , HPHYBRID_DMADIR_BIT); - break; - - case 0x7110: - // EIR - m_icount -= 12; - BIT_SET(m_flags , HPHYBRID_INTEN_BIT); - break; - - case 0x7118: - // DIR - m_icount -= 12; - BIT_CLR(m_flags , HPHYBRID_INTEN_BIT); - break; - - case 0x7120: - // DMA - m_icount -= 12; - BIT_SET(m_flags , HPHYBRID_DMAEN_BIT); - break; - - case 0x7138: - // DDR - m_icount -= 12; - BIT_CLR(m_flags , HPHYBRID_DMAEN_BIT); - break; - - case 0x7140: - // DBL - m_icount -= 12; - BIT_CLR(m_flags , HPHYBRID_DB_BIT); - break; - - case 0x7148: - // CBL - m_icount -= 12; - BIT_CLR(m_flags , HPHYBRID_CB_BIT); - break; - - case 0x7150: - // DBU - m_icount -= 12; - BIT_SET(m_flags , HPHYBRID_DB_BIT); - break; - - case 0x7158: - // CBU - m_icount -= 12; - BIT_SET(m_flags , HPHYBRID_CB_BIT); - break; - - case 0xf020: - // TCA - m_icount -= 9; - m_reg_A = ~m_reg_A; - do_add(m_reg_A , 1); - break; - - case 0xf060: - // CMA - m_icount -= 9; - m_reg_A = ~m_reg_A; - break; - - case 0xf820: - // TCB - m_icount -= 9; - m_reg_B = ~m_reg_B; - do_add(m_reg_B , 1); - break; - - case 0xf860: - // CMB - m_icount -= 9; - m_reg_B = ~m_reg_B; - break; - - default: - // Unrecognized instructions: NOP - // Execution time is fictional - m_icount -= 6; - } - } + case 0x1000: + // CPA + m_icount -= 16; + if (m_reg_A != RM(get_ea(opcode))) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x1800: + // CPB + m_icount -= 16; + if (m_reg_B != RM(get_ea(opcode))) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x2000: + // ADA + m_icount -= 13; + do_add(m_reg_A , RM(get_ea(opcode))); + break; + + case 0x2800: + // ADB + m_icount -= 13; + do_add(m_reg_B , RM(get_ea(opcode))); + break; + + case 0x3000: + // STA + m_icount -= 13; + WM(get_ea(opcode) , m_reg_A); + break; + + case 0x3800: + // STB + m_icount -= 13; + WM(get_ea(opcode) , m_reg_B); + break; + + case 0x4000: + // JSM + m_icount -= 17; + WM(++m_reg_R , m_reg_P); + return get_ea(opcode); + + case 0x4800: + // ISZ + m_icount -= 19; + ea = get_ea(opcode); + tmp = RM(ea) + 1; + WM(ea , tmp); + if (tmp == 0) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x5000: + // AND + m_icount -= 13; + m_reg_A &= RM(get_ea(opcode)); + break; + + case 0x5800: + // DSZ + m_icount -= 19; + ea = get_ea(opcode); + tmp = RM(ea) - 1; + WM(ea , tmp); + if (tmp == 0) { + // Skip next instruction + return m_reg_P + 2; + } + break; + + case 0x6000: + // IOR + m_icount -= 13; + m_reg_A |= RM(get_ea(opcode)); + break; + + case 0x6800: + // JMP + m_icount -= 8; + return get_ea(opcode); + + default: + switch (opcode & 0xfec0) { + case 0x7400: + // RZA + // SZA + m_icount -= 14; + return get_skip_addr(opcode , m_reg_A == 0); + + case 0x7440: + // RIA + // SIA + m_icount -= 14; + return get_skip_addr(opcode , m_reg_A++ == 0); + + case 0x7480: + // SFS + // SFC + m_icount -= 14; + // TODO: read flag bit + return get_skip_addr(opcode , true); + + case 0x7C00: + // RZB + // SZB + m_icount -= 14; + return get_skip_addr(opcode , m_reg_B == 0); + + case 0x7C40: + // RIB + // SIB + m_icount -= 14; + return get_skip_addr(opcode , m_reg_B++ == 0); + + case 0x7c80: + // SSS + // SSC + m_icount -= 14; + // TODO: read status bit + return get_skip_addr(opcode , true); + + case 0x7cc0: + // SHS + // SHC + m_icount -= 14; + return get_skip_addr(opcode , !BIT(m_flags , HPHYBRID_HALT_BIT)); + + default: + switch (opcode & 0xfe00) { + case 0x7600: + // SLA + // RLA + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_A , 0); + + case 0x7e00: + // SLB + // RLB + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_B , 0); + + case 0xf400: + // SAP + // SAM + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_A , 15); + + case 0xf600: + // SOC + // SOS + m_icount -= 14; + return get_skip_addr_sc(opcode , m_flags , HPHYBRID_O_BIT); + + case 0xfc00: + // SBP + // SBM + m_icount -= 14; + return get_skip_addr_sc(opcode , m_reg_B , 15); + + case 0xfe00: + // SEC + // SES + m_icount -= 14; + return get_skip_addr_sc(opcode , m_flags , HPHYBRID_C_BIT); + + default: + switch (opcode & 0xfff0) { + case 0xf100: + // AAR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + // A shift by 16 positions is equivalent to a shift by 15 + tmp = tmp > 15 ? 15 : tmp; + m_reg_A = ((m_reg_A ^ 0x8000) >> tmp) - (0x8000 >> tmp); + break; + + case 0xf900: + // ABR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + tmp = tmp > 15 ? 15 : tmp; + m_reg_B = ((m_reg_B ^ 0x8000) >> tmp) - (0x8000 >> tmp); + break; + + case 0xf140: + // SAR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_A >>= tmp; + break; + + case 0xf940: + // SBR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_B >>= tmp; + break; + + case 0xf180: + // SAL + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_A <<= tmp; + break; + + case 0xf980: + // SBL + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_B <<= tmp; + break; + + case 0xf1c0: + // RAR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_A = (m_reg_A >> tmp) | (m_reg_A << (16 - tmp)); + break; + + case 0xf9c0: + // RBR + tmp = (opcode & 0xf) + 1; + m_icount -= (9 + tmp); + m_reg_B = (m_reg_B >> tmp) | (m_reg_B << (16 - tmp)); + break; + + default: + if ((opcode & 0xf760) == 0x7160) { + // Place/withdraw instructions + m_icount -= 23; + do_pw(opcode); + } else if ((opcode & 0xff80) == 0xf080) { + // RET + m_icount -= 16; + if (BIT(opcode , 6)) { + // Pop PA stack + if (BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) { + BIT_CLR(m_flags , HPHYBRID_IRH_SVC_BIT); + memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); + } else if (BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { + BIT_CLR(m_flags , HPHYBRID_IRL_SVC_BIT); + memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); + } + } + tmp = RM(m_reg_R--) + (opcode & 0x1f); + return BIT(opcode , 5) ? tmp - 0x20 : tmp; + } else { + switch (opcode) { + case 0x7100: + // SDO + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_DMADIR_BIT); + break; + + case 0x7108: + // SDI + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_DMADIR_BIT); + break; + + case 0x7110: + // EIR + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_INTEN_BIT); + break; + + case 0x7118: + // DIR + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_INTEN_BIT); + break; + + case 0x7120: + // DMA + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_DMAEN_BIT); + break; + + case 0x7138: + // DDR + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_DMAEN_BIT); + break; + + case 0x7140: + // DBL + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_DB_BIT); + break; + + case 0x7148: + // CBL + m_icount -= 12; + BIT_CLR(m_flags , HPHYBRID_CB_BIT); + break; + + case 0x7150: + // DBU + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_DB_BIT); + break; + + case 0x7158: + // CBU + m_icount -= 12; + BIT_SET(m_flags , HPHYBRID_CB_BIT); + break; + + case 0xf020: + // TCA + m_icount -= 9; + m_reg_A = ~m_reg_A; + do_add(m_reg_A , 1); + break; + + case 0xf060: + // CMA + m_icount -= 9; + m_reg_A = ~m_reg_A; + break; + + case 0xf820: + // TCB + m_icount -= 9; + m_reg_B = ~m_reg_B; + do_add(m_reg_B , 1); + break; + + case 0xf860: + // CMB + m_icount -= 9; + m_reg_B = ~m_reg_B; + break; + + default: + // Unrecognized instructions: NOP + // Execution time is fictional + m_icount -= 6; + } + } + } + } } - } } - } - - return m_reg_P + 1; + + return m_reg_P + 1; } void hp_hybrid_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) { - if (entry.index() == STATE_GENFLAGS) { - strprintf(str, "%s %s %c %c", - BIT(m_flags , HPHYBRID_DB_BIT) ? "Db":"..", - BIT(m_flags , HPHYBRID_CB_BIT) ? "Cb":"..", - BIT(m_flags , HPHYBRID_O_BIT) ? 'O':'.', - BIT(m_flags , HPHYBRID_C_BIT) ? 'E':'.'); - } + if (entry.index() == STATE_GENFLAGS) { + strprintf(str, "%s %s %c %c", + BIT(m_flags , HPHYBRID_DB_BIT) ? "Db":"..", + BIT(m_flags , HPHYBRID_CB_BIT) ? "Cb":"..", + BIT(m_flags , HPHYBRID_O_BIT) ? 'O':'.', + BIT(m_flags , HPHYBRID_C_BIT) ? 'E':'.'); + } } offs_t hp_hybrid_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { - extern CPU_DISASSEMBLE(hp_hybrid); - return CPU_DISASSEMBLE_NAME(hp_hybrid)(this, buffer, pc, oprom, opram, options); + extern CPU_DISASSEMBLE(hp_hybrid); + return CPU_DISASSEMBLE_NAME(hp_hybrid)(this, buffer, pc, oprom, opram, options); } UINT16 hp_hybrid_cpu_device::get_ea(UINT16 opcode) { - UINT16 base; - UINT16 off; - - if (BIT(opcode , 10)) { - // Current page - base = m_reg_P; - } else { - // Base page - base = 0; - } + UINT16 base; + UINT16 off; - off = opcode & 0x3ff; - if (off & 0x200) { - off -= 0x400; - } + if (BIT(opcode , 10)) { + // Current page + base = m_reg_P; + } else { + // Base page + base = 0; + } - base += off; + off = opcode & 0x3ff; + if (off & 0x200) { + off -= 0x400; + } - if (BIT(opcode , 15)) { - // Indirect addressing - m_icount -= 6; - return RM(base); - } else { - // Direct addressing - return base; - } + base += off; + + if (BIT(opcode , 15)) { + // Indirect addressing + m_icount -= 6; + return RM(base); + } else { + // Direct addressing + return base; + } } void hp_hybrid_cpu_device::do_add(UINT16& addend1 , UINT16 addend2) { - UINT32 tmp = addend1 + addend2; + UINT32 tmp = addend1 + addend2; - if (BIT(tmp , 16)) { - // Carry - BIT_SET(m_flags , HPHYBRID_C_BIT); - } + if (BIT(tmp , 16)) { + // Carry + BIT_SET(m_flags , HPHYBRID_C_BIT); + } - if (BIT((tmp ^ addend1) & (tmp ^ addend2) , 15)) { - // Overflow - BIT_SET(m_flags , HPHYBRID_O_BIT); - } - - addend1 = (UINT16)tmp; + if (BIT((tmp ^ addend1) & (tmp ^ addend2) , 15)) { + // Overflow + BIT_SET(m_flags , HPHYBRID_O_BIT); + } + + addend1 = (UINT16)tmp; } UINT16 hp_hybrid_cpu_device::get_skip_addr(UINT16 opcode , bool condition) const { - bool skip_val = BIT(opcode , 8) != 0; - - if (condition == skip_val) { - UINT16 off = opcode & 0x1f; - - if (BIT(opcode , 5)) { - off -= 0x20; + bool skip_val = BIT(opcode , 8) != 0; + + if (condition == skip_val) { + UINT16 off = opcode & 0x1f; + + if (BIT(opcode , 5)) { + off -= 0x20; + } + return m_reg_P + off; + } else { + return m_reg_P + 1; } - return m_reg_P + off; - } else { - return m_reg_P + 1; - } } UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n) { - bool val = BIT(v , n); + bool val = BIT(v , n); - if (BIT(opcode , 7)) { - if (BIT(opcode , 6)) { - BIT_SET(v , n); - } else { - BIT_CLR(v , n); + if (BIT(opcode , 7)) { + if (BIT(opcode , 6)) { + BIT_SET(v , n); + } else { + BIT_CLR(v , n); + } } - } - - return get_skip_addr(opcode , val); + + return get_skip_addr(opcode , val); } void hp_hybrid_cpu_device::do_pw(UINT16 opcode) { - UINT16 tmp; - UINT16 reg_addr = opcode & 7; - UINT16 *ptr_reg; - UINT16 b_mask; + UINT16 tmp; + UINT16 reg_addr = opcode & 7; + UINT16 *ptr_reg; + UINT16 b_mask; - if (BIT(opcode , 3)) { - ptr_reg = &m_reg_D; - b_mask = BIT_MASK(HPHYBRID_DB_BIT); - } else { - ptr_reg = &m_reg_C; - b_mask = BIT_MASK(HPHYBRID_CB_BIT); - } + if (BIT(opcode , 3)) { + ptr_reg = &m_reg_D; + b_mask = BIT_MASK(HPHYBRID_DB_BIT); + } else { + ptr_reg = &m_reg_C; + b_mask = BIT_MASK(HPHYBRID_CB_BIT); + } - if (BIT(opcode , 4)) { - // Withdraw - if (BIT(opcode , 11)) { - // Byte - UINT32 tmp_addr = (UINT32)(*ptr_reg); - if (m_flags & b_mask) { - tmp_addr |= 0x10000; - } - tmp = RM((UINT16)(tmp_addr >> 1)); - if (BIT(tmp_addr , 0)) { - tmp &= 0xff; - } else { - tmp >>= 8; - } + if (BIT(opcode , 4)) { + // Withdraw + if (BIT(opcode , 11)) { + // Byte + UINT32 tmp_addr = (UINT32)(*ptr_reg); + if (m_flags & b_mask) { + tmp_addr |= 0x10000; + } + tmp = RM((UINT16)(tmp_addr >> 1)); + if (BIT(tmp_addr , 0)) { + tmp &= 0xff; + } else { + tmp >>= 8; + } + } else { + // Word + tmp = RM(*ptr_reg); + } + WM(reg_addr , tmp); + + if (BIT(opcode , 7)) { + // Post-decrement + if ((*ptr_reg)-- == 0) { + m_flags ^= b_mask; + } + } else { + // Post-increment + if (++(*ptr_reg) == 0) { + m_flags ^= b_mask; + } + } } else { - // Word - tmp = RM(*ptr_reg); + // Place + if (BIT(opcode , 7)) { + // Pre-decrement + if ((*ptr_reg)-- == 0) { + m_flags ^= b_mask; + } + } else { + // Pre-increment + if (++(*ptr_reg) == 0) { + m_flags ^= b_mask; + } + } + tmp = RM(reg_addr); + if (BIT(opcode , 11)) { + // Byte + UINT32 tmp_addr = (UINT32)(*ptr_reg); + if (m_flags & b_mask) { + tmp_addr |= 0x10000; + } + WMB(tmp_addr , (UINT8)tmp); + } else { + // Word + WM(*ptr_reg , tmp); + } } - WM(reg_addr , tmp); - - if (BIT(opcode , 7)) { - // Post-decrement - if ((*ptr_reg)-- == 0) { - m_flags ^= b_mask; - } +} + +void hp_hybrid_cpu_device::check_for_interrupts(void) +{ + if (!BIT(m_flags , HPHYBRID_INTEN_BIT) || BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) { + return; + } + + int irqline; + + if (BIT(m_flags , HPHYBRID_IRH_BIT)) { + // Service high-level interrupt + BIT_SET(m_flags , HPHYBRID_IRH_SVC_BIT); + irqline = HPHYBRID_IRH; + } else if (BIT(m_flags , HPHYBRID_IRL_BIT) && !BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { + // Service low-level interrupt + BIT_SET(m_flags , HPHYBRID_IRL_SVC_BIT); + irqline = HPHYBRID_IRL; } else { - // Post-increment - if (++(*ptr_reg) == 0) { - m_flags ^= b_mask; - } + return; } - } else { - // Place - if (BIT(opcode , 7)) { - // Pre-decrement - if ((*ptr_reg)-- == 0) { - m_flags ^= b_mask; - } + + // Get interrupt vector in low byte + UINT8 vector = (UINT8)standard_irq_callback(irqline); + UINT8 new_PA; + + // Get highest numbered 1 + // Don't know what happens if vector is 0, here we assume bit 7 = 1 + if (vector == 0) { + new_PA = 7; } else { - // Pre-increment - if (++(*ptr_reg) == 0) { - m_flags ^= b_mask; - } + for (new_PA = 7; new_PA && !BIT(vector , 7); new_PA--, vector <<= 1) { + } } - tmp = RM(reg_addr); - if (BIT(opcode , 11)) { - // Byte - UINT32 tmp_addr = (UINT32)(*ptr_reg); - if (m_flags & b_mask) { - tmp_addr |= 0x10000; - } - WMB(tmp_addr , (UINT8)tmp); - } else { - // Word - WM(*ptr_reg , tmp); + if (irqline == HPHYBRID_IRH) { + BIT_SET(new_PA , 3); } - } + + // Push PA stack + memmove(&m_reg_PA[ 1 ] , &m_reg_PA[ 0 ] , HPHYBRID_INT_LVLS); + + CURRENT_PA = new_PA; + + // Is this correct? Patent @ pg 210 suggests that the whole interrupt recognition sequence + // lasts for 32 cycles (6 are already accounted for in get_ea for one indirection) + m_icount -= 26; + + // Do a double-indirect JSM IV,I instruction + WM(++m_reg_R , m_reg_P); + m_reg_P = RM(get_ea(0xc008)); + m_reg_I = RM(m_reg_P); } UINT16 hp_hybrid_cpu_device::RM(UINT16 addr) { - UINT16 tmp; - - if (addr <= HP_REG_LAST_ADDR) { - // Memory mapped registers - switch (addr) { - case HP_REG_A_ADDR: - return m_reg_A; - - case HP_REG_B_ADDR: - return m_reg_B; - - case HP_REG_P_ADDR: - return m_reg_P; - - case HP_REG_R_ADDR: - return m_reg_R; - - case HP_REG_R4_ADDR: - case HP_REG_R5_ADDR: - case HP_REG_R6_ADDR: - case HP_REG_R7_ADDR: - return RIO(CURRENT_PA , addr - HP_REG_R4_ADDR); - - case HP_REG_IV_ADDR: - return m_reg_IV; - - case HP_REG_PA_ADDR: - return CURRENT_PA; - - case HP_REG_DMAPA_ADDR: - tmp = m_dmapa & HP_REG_PA_MASK; - if (BIT(m_flags , HPHYBRID_CB_BIT)) { - BIT_SET(tmp , 15); - } - if (BIT(m_flags , HPHYBRID_DB_BIT)) { - BIT_SET(tmp , 14); - } - return tmp; - - case HP_REG_DMAMA_ADDR: - return m_dmama; - - case HP_REG_DMAC_ADDR: - return m_dmac; + UINT16 tmp; - case HP_REG_C_ADDR: - return m_reg_C; + if (addr <= HP_REG_LAST_ADDR) { + // Memory mapped registers + switch (addr) { + case HP_REG_A_ADDR: + return m_reg_A; - case HP_REG_D_ADDR: - return m_reg_D; - - default: - // Unknown registers are returned as 0 - return 0; + case HP_REG_B_ADDR: + return m_reg_B; + + case HP_REG_P_ADDR: + return m_reg_P; + + case HP_REG_R_ADDR: + return m_reg_R; + + case HP_REG_R4_ADDR: + case HP_REG_R5_ADDR: + case HP_REG_R6_ADDR: + case HP_REG_R7_ADDR: + return RIO(CURRENT_PA , addr - HP_REG_R4_ADDR); + + case HP_REG_IV_ADDR: + // Correct? + if (!BIT(m_flags , HPHYBRID_IRH_SVC_BIT) && !BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { + return m_reg_IV; + } else { + return m_reg_IV | CURRENT_PA; + } + + case HP_REG_PA_ADDR: + return CURRENT_PA; + + case HP_REG_DMAPA_ADDR: + tmp = m_dmapa & HP_REG_PA_MASK; + if (BIT(m_flags , HPHYBRID_CB_BIT)) { + BIT_SET(tmp , 15); + } + if (BIT(m_flags , HPHYBRID_DB_BIT)) { + BIT_SET(tmp , 14); + } + return tmp; + + case HP_REG_DMAMA_ADDR: + return m_dmama; + + case HP_REG_DMAC_ADDR: + return m_dmac; + + case HP_REG_C_ADDR: + return m_reg_C; + + case HP_REG_D_ADDR: + return m_reg_D; + + default: + // Unknown registers are returned as 0 + return 0; + } + } else { + return m_direct->read_decrypted_word((offs_t)addr << 1); } - } else { - return m_direct->read_decrypted_word((offs_t)addr << 1); - } } void hp_hybrid_cpu_device::WM(UINT16 addr , UINT16 v) { - if (addr <= HP_REG_LAST_ADDR) { - // Memory mapped registers - switch (addr) { - case HP_REG_A_ADDR: - m_reg_A = v; - break; - - case HP_REG_B_ADDR: - m_reg_B = v; - break; - - case HP_REG_P_ADDR: - m_reg_P = v; - break; - - case HP_REG_R_ADDR: - m_reg_R = v; - break; - - case HP_REG_R4_ADDR: - case HP_REG_R5_ADDR: - case HP_REG_R6_ADDR: - case HP_REG_R7_ADDR: - WIO(CURRENT_PA , addr - HP_REG_R4_ADDR , v); - break; - - case HP_REG_IV_ADDR: - m_reg_IV = v & HP_REG_IV_MASK; - break; - - case HP_REG_PA_ADDR: - CURRENT_PA = v & HP_REG_PA_MASK; - break; - - case HP_REG_DMAPA_ADDR: - m_dmapa = v & HP_REG_PA_MASK; - break; - - case HP_REG_DMAMA_ADDR: - m_dmama = v; - break; - - case HP_REG_DMAC_ADDR: - m_dmac = v; - break; + if (addr <= HP_REG_LAST_ADDR) { + // Memory mapped registers + switch (addr) { + case HP_REG_A_ADDR: + m_reg_A = v; + break; - case HP_REG_C_ADDR: - m_reg_C = v; - break; + case HP_REG_B_ADDR: + m_reg_B = v; + break; - case HP_REG_D_ADDR: - m_reg_D = v; - break; - - default: - // Unknown registers are silently discarded - break; + case HP_REG_P_ADDR: + m_reg_P = v; + break; + + case HP_REG_R_ADDR: + m_reg_R = v; + break; + + case HP_REG_R4_ADDR: + case HP_REG_R5_ADDR: + case HP_REG_R6_ADDR: + case HP_REG_R7_ADDR: + WIO(CURRENT_PA , addr - HP_REG_R4_ADDR , v); + break; + + case HP_REG_IV_ADDR: + m_reg_IV = v & HP_REG_IV_MASK; + break; + + case HP_REG_PA_ADDR: + CURRENT_PA = v & HP_REG_PA_MASK; + break; + + case HP_REG_DMAPA_ADDR: + m_dmapa = v & HP_REG_PA_MASK; + break; + + case HP_REG_DMAMA_ADDR: + m_dmama = v; + break; + + case HP_REG_DMAC_ADDR: + m_dmac = v; + break; + + case HP_REG_C_ADDR: + m_reg_C = v; + break; + + case HP_REG_D_ADDR: + m_reg_D = v; + break; + + default: + // Unknown registers are silently discarded + break; + } + } else { + m_program->write_word((offs_t)addr << 1 , v); } - } else { - m_program->write_word((offs_t)addr << 1 , v); - } } void hp_hybrid_cpu_device::WMB(UINT32 addr , UINT8 v) { - if (addr <= (HP_REG_LAST_ADDR * 2 + 1)) { - // Cannot write bytes to registers - } else { - m_program->write_byte(addr , v); - } + if (addr <= (HP_REG_LAST_ADDR * 2 + 1)) { + // Cannot write bytes to registers + } else { + m_program->write_byte(addr , v); + } } UINT16 hp_hybrid_cpu_device::RIO(UINT8 pa , UINT8 ic) { - return m_io->read_word(MAKE_IOADDR(pa, ic) << 1); + return m_io->read_word(HP_MAKE_IOADDR(pa, ic) << 1); } - + void hp_hybrid_cpu_device::WIO(UINT8 pa , UINT8 ic , UINT16 v) { - m_io->write_word(MAKE_IOADDR(pa, ic) << 1 , v); + m_io->write_word(HP_MAKE_IOADDR(pa, ic) << 1 , v); } hp_5061_3011_cpu_device::hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : hp_hybrid_cpu_device(mconfig, HP_5061_3011, "HP_5061_3011", tag, owner, clock, "5061-3011") +: hp_hybrid_cpu_device(mconfig, HP_5061_3011, "HP_5061_3011", tag, owner, clock, "5061-3011") { } - diff --git a/src/emu/cpu/hphybrid/hphybrid.h b/src/emu/cpu/hphybrid/hphybrid.h index a9153580bee..1d24a1cfd14 100644 --- a/src/emu/cpu/hphybrid/hphybrid.h +++ b/src/emu/cpu/hphybrid/hphybrid.h @@ -10,13 +10,11 @@ // discrete implementation of the 1960s into a multi-chip module (hence the "hybrid" name). // This emulator currently supports the 5061-3011 version only. // -// There is very little information around on this processor. // For this emulator I mainly relied on these sources: // - http://www.hp9845.net/ website // - HP manual "Assembly development ROM manual for the HP9845": this is the most precious // and "enabling" resource of all // - US Patent 4,180,854 describing the HP9845 system -// - Some manual for the 2116 processor // - Study of disassembly of firmware of HP64000 system // - A lot of "educated" guessing @@ -40,6 +38,9 @@ #define HP_IOADDR_PA_SHIFT 2 #define HP_IOADDR_IC_SHIFT 0 +// Compose an I/O address from PA & IC +#define HP_MAKE_IOADDR(pa , ic) (((pa) << HP_IOADDR_PA_SHIFT) | ((ic) << HP_IOADDR_IC_SHIFT)) + // Addresses of memory mapped registers #define HP_REG_A_ADDR 0x0000 #define HP_REG_B_ADDR 0x0001 @@ -65,75 +66,76 @@ class hp_hybrid_cpu_device : public cpu_device { public: protected: - hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); - // device-level overrides - virtual void device_start(); - virtual void device_reset(); + // device-level overrides + virtual void device_start(); + virtual void device_reset(); - // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const { return 6; } - virtual UINT32 execute_max_cycles() const { return 25; } - virtual UINT32 execute_input_lines() const { return 2; } - virtual UINT32 execute_default_irq_vector() const { return 0xffff; } - virtual void execute_run(); - virtual void execute_set_input(int inputnum, int state); + // device_execute_interface overrides + virtual UINT32 execute_min_cycles() const { return 6; } + virtual UINT32 execute_max_cycles() const { return 25; } + virtual UINT32 execute_input_lines() const { return 2; } + virtual UINT32 execute_default_irq_vector() const { return 0xffff; } + virtual void execute_run(); + virtual void execute_set_input(int inputnum, int state); - UINT16 execute_one(UINT16 opcode); - UINT16 execute_one_sub(UINT16 opcode); + UINT16 execute_one(UINT16 opcode); + UINT16 execute_one_sub(UINT16 opcode); - // device_memory_interface overrides - virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); } + // device_memory_interface overrides + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); } - // device_state_interface overrides - void state_string_export(const device_state_entry &entry, std::string &str); + // device_state_interface overrides + void state_string_export(const device_state_entry &entry, std::string &str); - // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); + // device_disasm_interface overrides + virtual UINT32 disasm_min_opcode_bytes() const { return 2; } + virtual UINT32 disasm_max_opcode_bytes() const { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); + +private: + address_space_config m_program_config; + address_space_config m_io_config; - private: - address_space_config m_program_config; - address_space_config m_io_config; - - address_space *m_program; - direct_read_data *m_direct; - address_space *m_io; - int m_icount; + address_space *m_program; + direct_read_data *m_direct; + address_space *m_io; + int m_icount; - // State of processor - UINT16 m_reg_A; // Register A - UINT16 m_reg_B; // Register B - UINT16 m_reg_P; // Register P - UINT16 m_reg_R; // Register R - UINT16 m_reg_C; // Register C - UINT16 m_reg_D; // Register D - UINT16 m_reg_IV; // Register IV - UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long) - UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir) - UINT8 m_dmapa; // DMA peripheral address (4 bits) - UINT16 m_dmama; // DMA address - UINT16 m_dmac; // DMA counter - UINT16 m_reg_I; // Instruction register + // State of processor + UINT16 m_reg_A; // Register A + UINT16 m_reg_B; // Register B + UINT16 m_reg_P; // Register P + UINT16 m_reg_R; // Register R + UINT16 m_reg_C; // Register C + UINT16 m_reg_D; // Register D + UINT16 m_reg_IV; // Register IV + UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long) + UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir) + UINT8 m_dmapa; // DMA peripheral address (4 bits) + UINT16 m_dmama; // DMA address + UINT16 m_dmac; // DMA counter + UINT16 m_reg_I; // Instruction register - UINT16 get_ea(UINT16 opcode); - void do_add(UINT16& addend1 , UINT16 addend2); - UINT16 get_skip_addr(UINT16 opcode , bool condition) const; - UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n); - void do_pw(UINT16 opcode); + UINT16 get_ea(UINT16 opcode); + void do_add(UINT16& addend1 , UINT16 addend2); + UINT16 get_skip_addr(UINT16 opcode , bool condition) const; + UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n); + void do_pw(UINT16 opcode); + void check_for_interrupts(void); - UINT16 RM(UINT16 addr); - void WM(UINT16 addr , UINT16 v); - void WMB(UINT32 addr , UINT8 v); - UINT16 RIO(UINT8 pa , UINT8 ic); - void WIO(UINT8 pa , UINT8 ic , UINT16 v); + UINT16 RM(UINT16 addr); + void WM(UINT16 addr , UINT16 v); + void WMB(UINT32 addr , UINT8 v); + UINT16 RIO(UINT8 pa , UINT8 ic); + void WIO(UINT8 pa , UINT8 ic , UINT16 v); }; class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device { public: - hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; extern const device_type HP_5061_3011; diff --git a/src/emu/cpu/hphybrid/hphybrid_dasm.c b/src/emu/cpu/hphybrid/hphybrid_dasm.c index 15897498292..a74fb69963f 100644 --- a/src/emu/cpu/hphybrid/hphybrid_dasm.c +++ b/src/emu/cpu/hphybrid/hphybrid_dasm.c @@ -11,84 +11,84 @@ typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode); typedef struct { - UINT16 m_op_mask; - UINT16 m_opcode; - const char *m_mnemonic; - fn_dis_param m_param_fn; - UINT32 m_dasm_flags; + UINT16 m_op_mask; + UINT16 m_opcode; + const char *m_mnemonic; + fn_dis_param m_param_fn; + UINT32 m_dasm_flags; } dis_entry_t; static void addr_2_str(char *buffer , UINT16 addr , bool indirect) { - char *s = buffer + strlen(buffer); + char *s = buffer + strlen(buffer); - s += sprintf(s , "$%04x" , addr); + s += sprintf(s , "$%04x" , addr); - switch (addr) { - case HP_REG_A_ADDR: - strcpy(s , "(A)"); - break; - - case HP_REG_B_ADDR: - strcpy(s , "(B)"); - break; - - case HP_REG_P_ADDR: - strcpy(s , "(P)"); - break; - - case HP_REG_R_ADDR: - strcpy(s , "(R)"); - break; - - case HP_REG_R4_ADDR: - strcpy(s , "(R4)"); - break; - - case HP_REG_R5_ADDR: - strcpy(s , "(R5)"); - break; - - case HP_REG_R6_ADDR: - strcpy(s , "(R6)"); - break; - - case HP_REG_R7_ADDR: - strcpy(s , "(R7)"); - break; - - case HP_REG_IV_ADDR: - strcpy(s , "(IV)"); - break; - - case HP_REG_PA_ADDR: - strcpy(s , "(PA)"); - break; - - case HP_REG_DMAPA_ADDR: - strcpy(s , "(DMAPA)"); - break; - - case HP_REG_DMAMA_ADDR: - strcpy(s , "(DMAMA)"); - break; - - case HP_REG_DMAC_ADDR: - strcpy(s , "(DMAC)"); - break; - - case HP_REG_C_ADDR: - strcpy(s , "(C)"); - break; - - case HP_REG_D_ADDR: - strcpy(s , "(D)"); - break; - } + switch (addr) { + case HP_REG_A_ADDR: + strcpy(s , "(A)"); + break; - if (indirect) { - strcat(s , ",I"); - } + case HP_REG_B_ADDR: + strcpy(s , "(B)"); + break; + + case HP_REG_P_ADDR: + strcpy(s , "(P)"); + break; + + case HP_REG_R_ADDR: + strcpy(s , "(R)"); + break; + + case HP_REG_R4_ADDR: + strcpy(s , "(R4)"); + break; + + case HP_REG_R5_ADDR: + strcpy(s , "(R5)"); + break; + + case HP_REG_R6_ADDR: + strcpy(s , "(R6)"); + break; + + case HP_REG_R7_ADDR: + strcpy(s , "(R7)"); + break; + + case HP_REG_IV_ADDR: + strcpy(s , "(IV)"); + break; + + case HP_REG_PA_ADDR: + strcpy(s , "(PA)"); + break; + + case HP_REG_DMAPA_ADDR: + strcpy(s , "(DMAPA)"); + break; + + case HP_REG_DMAMA_ADDR: + strcpy(s , "(DMAMA)"); + break; + + case HP_REG_DMAC_ADDR: + strcpy(s , "(DMAC)"); + break; + + case HP_REG_C_ADDR: + strcpy(s , "(C)"); + break; + + case HP_REG_D_ADDR: + strcpy(s , "(D)"); + break; + } + + if (indirect) { + strcat(s , ",I"); + } } static void param_none(char *buffer , offs_t pc , UINT16 opcode) @@ -97,185 +97,185 @@ static void param_none(char *buffer , offs_t pc , UINT16 opcode) static void param_loc(char *buffer , offs_t pc , UINT16 opcode) { - UINT16 base; - UINT16 off; - - if (opcode & 0x0400) { - // Current page - base = pc; - } else { - // Base page - base = 0; - } + UINT16 base; + UINT16 off; - off = opcode & 0x3ff; - if (off & 0x200) { - off -= 0x400; - } + if (opcode & 0x0400) { + // Current page + base = pc; + } else { + // Base page + base = 0; + } - addr_2_str(buffer , base + off , (opcode & 0x8000) != 0); + off = opcode & 0x3ff; + if (off & 0x200) { + off -= 0x400; + } + + addr_2_str(buffer , base + off , (opcode & 0x8000) != 0); } static void param_addr32(char *buffer , offs_t pc , UINT16 opcode) { - addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0); + addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0); } static void param_skip(char *buffer , offs_t pc , UINT16 opcode) { - UINT16 off = opcode & 0x3f; - if (off & 0x20) { - off -= 0x40; - } - addr_2_str(buffer , pc + off , false); + UINT16 off = opcode & 0x3f; + if (off & 0x20) { + off -= 0x40; + } + addr_2_str(buffer , pc + off , false); } static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode) { - param_skip(buffer, pc, opcode); - - if (opcode & 0x80) { - if (opcode & 0x40) { - strcat(buffer , ",S"); - } else { - strcat(buffer , ",C"); + param_skip(buffer, pc, opcode); + + if (opcode & 0x80) { + if (opcode & 0x40) { + strcat(buffer , ",S"); + } else { + strcat(buffer , ",C"); + } } - } } static void param_ret(char *buffer , offs_t pc , UINT16 opcode) { - char *s = buffer + strlen(buffer); - - int off = opcode & 0x3f; - - if (off & 0x20) { - off -= 0x40; - } + char *s = buffer + strlen(buffer); - s += sprintf(s , "%d" , off); - if (opcode & 0x40) { - strcpy(s , ",P"); - } + int off = opcode & 0x3f; + + if (off & 0x20) { + off -= 0x40; + } + + s += sprintf(s , "%d" , off); + if (opcode & 0x40) { + strcpy(s , ",P"); + } } static void param_n16(char *buffer , offs_t pc , UINT16 opcode) { - char *s = buffer + strlen(buffer); + char *s = buffer + strlen(buffer); - sprintf(s , "%u" , (opcode & 0xf) + 1); + sprintf(s , "%u" , (opcode & 0xf) + 1); } static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode) { - addr_2_str(buffer, opcode & 7, false); + addr_2_str(buffer, opcode & 7, false); - if (opcode & 0x80) { - strcat(buffer , ",D"); - } else { - strcat(buffer , ",I"); - } + if (opcode & 0x80) { + strcat(buffer , ",D"); + } else { + strcat(buffer , ",I"); + } } static const dis_entry_t dis_table[] = { - // *** BPC Instructions *** - {0xffff , 0x0000 , "NOP" , param_none , 0 }, - {0x7800 , 0x0000 , "LDA" , param_loc , 0 }, - {0x7800 , 0x0800 , "LDB" , param_loc , 0 }, - {0x7800 , 0x1000 , "CPA" , param_loc , 0 }, - {0x7800 , 0x1800 , "CPB" , param_loc , 0 }, - {0x7800 , 0x2000 , "ADA" , param_loc , 0 }, - {0x7800 , 0x2800 , "ADB" , param_loc , 0 }, - {0x7800 , 0x3000 , "STA" , param_loc , 0 }, - {0x7800 , 0x3800 , "STB" , param_loc , 0 }, - {0x7800 , 0x4000 , "JSM" , param_loc , DASMFLAG_STEP_OVER }, - {0x7800 , 0x4800 , "ISZ" , param_loc , 0 }, - {0x7800 , 0x5000 , "AND" , param_loc , 0 }, - {0x7800 , 0x5800 , "DSZ" , param_loc , 0 }, - {0x7800 , 0x6000 , "IOR" , param_loc , 0 }, - {0x7800 , 0x6800 , "JMP" , param_loc , 0 }, - {0x7fe0 , 0x7000 , "EXE" , param_addr32 , 0 }, - {0xffc0 , 0x7400 , "RZA" , param_skip , 0 }, - {0xffc0 , 0x7C00 , "RZB" , param_skip , 0 }, - {0xffc0 , 0x7440 , "RIA" , param_skip , 0 }, - {0xffc0 , 0x7C40 , "RIB" , param_skip , 0 }, - {0xffc0 , 0x7500 , "SZA" , param_skip , 0 }, - {0xffc0 , 0x7D00 , "SZB" , param_skip , 0 }, - {0xffc0 , 0x7540 , "SIA" , param_skip , 0 }, - {0xffc0 , 0x7D40 , "SIB" , param_skip , 0 }, - {0xffc0 , 0x7480 , "SFS" , param_skip , 0 }, - {0xffc0 , 0x7580 , "SFC" , param_skip , 0 }, - {0xffc0 , 0x7c80 , "SSS" , param_skip , 0 }, - {0xffc0 , 0x7d80 , "SSC" , param_skip , 0 }, - {0xffc0 , 0x7cc0 , "SHS" , param_skip , 0 }, - {0xffc0 , 0x7dc0 , "SHC" , param_skip , 0 }, - {0xff00 , 0x7600 , "SLA" , param_skip_sc , 0 }, - {0xff00 , 0x7e00 , "SLB" , param_skip_sc , 0 }, - {0xff00 , 0x7700 , "RLA" , param_skip_sc , 0 }, - {0xff00 , 0x7f00 , "RLB" , param_skip_sc , 0 }, - {0xff00 , 0xf400 , "SAP" , param_skip_sc , 0 }, - {0xff00 , 0xfc00 , "SBP" , param_skip_sc , 0 }, - {0xff00 , 0xf500 , "SAM" , param_skip_sc , 0 }, - {0xff00 , 0xfd00 , "SBM" , param_skip_sc , 0 }, - {0xff00 , 0xf600 , "SOC" , param_skip_sc , 0 }, - {0xff00 , 0xf700 , "SOS" , param_skip_sc , 0 }, - {0xff00 , 0xfe00 , "SEC" , param_skip_sc , 0 }, - {0xff00 , 0xff00 , "SES" , param_skip_sc , 0 }, - {0xffff , 0xf020 , "TCA" , param_none , 0 }, - {0xffff , 0xf820 , "TCB" , param_none , 0 }, - {0xffff , 0xf060 , "CMA" , param_none , 0 }, - {0xffff , 0xf860 , "CMB" , param_none , 0 }, - {0xff80 , 0xf080 , "RET" , param_ret , DASMFLAG_STEP_OUT }, - {0xfff0 , 0xf100 , "AAR" , param_n16 , 0 }, - {0xfff0 , 0xf900 , "ABR" , param_n16 , 0 }, - {0xffff , 0xf14f , "CLA" , param_none , 0 }, - {0xfff0 , 0xf140 , "SAR" , param_n16 , 0 }, - {0xffff , 0xf94f , "CLB" , param_none , 0 }, - {0xfff0 , 0xf940 , "SBR" , param_n16 , 0 }, - {0xfff0 , 0xf180 , "SAL" , param_n16 , 0 }, - {0xfff0 , 0xf980 , "SBL" , param_n16 , 0 }, - {0xfff0 , 0xf1c0 , "RAR" , param_n16 , 0 }, - {0xfff0 , 0xf9c0 , "RBR" , param_n16 , 0 }, - // *** IOC Instructions *** - {0xffff , 0x7100 , "SDO" , param_none , 0 }, - {0xffff , 0x7108 , "SDI" , param_none , 0 }, - {0xffff , 0x7110 , "EIR" , param_none , 0 }, - {0xffff , 0x7118 , "DIR" , param_none , 0 }, - {0xffff , 0x7120 , "DMA" , param_none , 0 }, - {0xffff , 0x7128 , "PCM" , param_none , 0 }, - {0xffff , 0x7138 , "DDR" , param_none , 0 }, - {0xffff , 0x7140 , "DBL" , param_none , 0 }, - {0xffff , 0x7148 , "CBL" , param_none , 0 }, - {0xffff , 0x7150 , "DBU" , param_none , 0 }, - {0xffff , 0x7158 , "CBU" , param_none , 0 }, - {0xff78 , 0x7160 , "PWC" , param_reg_id , 0 }, - {0xff78 , 0x7168 , "PWD" , param_reg_id , 0 }, - {0xff78 , 0x7960 , "PBC" , param_reg_id , 0 }, - {0xff78 , 0x7968 , "PBD" , param_reg_id , 0 }, - {0xff78 , 0x7170 , "WWC" , param_reg_id , 0 }, - {0xff78 , 0x7178 , "WWD" , param_reg_id , 0 }, - {0xff78 , 0x7970 , "WBC" , param_reg_id , 0 }, - {0xff78 , 0x7978 , "WBD" , param_reg_id , 0 }, - // *** END *** - {0 , 0 , NULL , NULL , 0 } + // *** BPC Instructions *** + {0xffff , 0x0000 , "NOP" , param_none , 0 }, + {0x7800 , 0x0000 , "LDA" , param_loc , 0 }, + {0x7800 , 0x0800 , "LDB" , param_loc , 0 }, + {0x7800 , 0x1000 , "CPA" , param_loc , 0 }, + {0x7800 , 0x1800 , "CPB" , param_loc , 0 }, + {0x7800 , 0x2000 , "ADA" , param_loc , 0 }, + {0x7800 , 0x2800 , "ADB" , param_loc , 0 }, + {0x7800 , 0x3000 , "STA" , param_loc , 0 }, + {0x7800 , 0x3800 , "STB" , param_loc , 0 }, + {0x7800 , 0x4000 , "JSM" , param_loc , DASMFLAG_STEP_OVER }, + {0x7800 , 0x4800 , "ISZ" , param_loc , 0 }, + {0x7800 , 0x5000 , "AND" , param_loc , 0 }, + {0x7800 , 0x5800 , "DSZ" , param_loc , 0 }, + {0x7800 , 0x6000 , "IOR" , param_loc , 0 }, + {0x7800 , 0x6800 , "JMP" , param_loc , 0 }, + {0x7fe0 , 0x7000 , "EXE" , param_addr32 , 0 }, + {0xffc0 , 0x7400 , "RZA" , param_skip , 0 }, + {0xffc0 , 0x7C00 , "RZB" , param_skip , 0 }, + {0xffc0 , 0x7440 , "RIA" , param_skip , 0 }, + {0xffc0 , 0x7C40 , "RIB" , param_skip , 0 }, + {0xffc0 , 0x7500 , "SZA" , param_skip , 0 }, + {0xffc0 , 0x7D00 , "SZB" , param_skip , 0 }, + {0xffc0 , 0x7540 , "SIA" , param_skip , 0 }, + {0xffc0 , 0x7D40 , "SIB" , param_skip , 0 }, + {0xffc0 , 0x7480 , "SFS" , param_skip , 0 }, + {0xffc0 , 0x7580 , "SFC" , param_skip , 0 }, + {0xffc0 , 0x7c80 , "SSS" , param_skip , 0 }, + {0xffc0 , 0x7d80 , "SSC" , param_skip , 0 }, + {0xffc0 , 0x7cc0 , "SHS" , param_skip , 0 }, + {0xffc0 , 0x7dc0 , "SHC" , param_skip , 0 }, + {0xff00 , 0x7600 , "SLA" , param_skip_sc , 0 }, + {0xff00 , 0x7e00 , "SLB" , param_skip_sc , 0 }, + {0xff00 , 0x7700 , "RLA" , param_skip_sc , 0 }, + {0xff00 , 0x7f00 , "RLB" , param_skip_sc , 0 }, + {0xff00 , 0xf400 , "SAP" , param_skip_sc , 0 }, + {0xff00 , 0xfc00 , "SBP" , param_skip_sc , 0 }, + {0xff00 , 0xf500 , "SAM" , param_skip_sc , 0 }, + {0xff00 , 0xfd00 , "SBM" , param_skip_sc , 0 }, + {0xff00 , 0xf600 , "SOC" , param_skip_sc , 0 }, + {0xff00 , 0xf700 , "SOS" , param_skip_sc , 0 }, + {0xff00 , 0xfe00 , "SEC" , param_skip_sc , 0 }, + {0xff00 , 0xff00 , "SES" , param_skip_sc , 0 }, + {0xffff , 0xf020 , "TCA" , param_none , 0 }, + {0xffff , 0xf820 , "TCB" , param_none , 0 }, + {0xffff , 0xf060 , "CMA" , param_none , 0 }, + {0xffff , 0xf860 , "CMB" , param_none , 0 }, + {0xff80 , 0xf080 , "RET" , param_ret , DASMFLAG_STEP_OUT }, + {0xfff0 , 0xf100 , "AAR" , param_n16 , 0 }, + {0xfff0 , 0xf900 , "ABR" , param_n16 , 0 }, + {0xffff , 0xf14f , "CLA" , param_none , 0 }, + {0xfff0 , 0xf140 , "SAR" , param_n16 , 0 }, + {0xffff , 0xf94f , "CLB" , param_none , 0 }, + {0xfff0 , 0xf940 , "SBR" , param_n16 , 0 }, + {0xfff0 , 0xf180 , "SAL" , param_n16 , 0 }, + {0xfff0 , 0xf980 , "SBL" , param_n16 , 0 }, + {0xfff0 , 0xf1c0 , "RAR" , param_n16 , 0 }, + {0xfff0 , 0xf9c0 , "RBR" , param_n16 , 0 }, + // *** IOC Instructions *** + {0xffff , 0x7100 , "SDO" , param_none , 0 }, + {0xffff , 0x7108 , "SDI" , param_none , 0 }, + {0xffff , 0x7110 , "EIR" , param_none , 0 }, + {0xffff , 0x7118 , "DIR" , param_none , 0 }, + {0xffff , 0x7120 , "DMA" , param_none , 0 }, + {0xffff , 0x7128 , "PCM" , param_none , 0 }, + {0xffff , 0x7138 , "DDR" , param_none , 0 }, + {0xffff , 0x7140 , "DBL" , param_none , 0 }, + {0xffff , 0x7148 , "CBL" , param_none , 0 }, + {0xffff , 0x7150 , "DBU" , param_none , 0 }, + {0xffff , 0x7158 , "CBU" , param_none , 0 }, + {0xff78 , 0x7160 , "PWC" , param_reg_id , 0 }, + {0xff78 , 0x7168 , "PWD" , param_reg_id , 0 }, + {0xff78 , 0x7960 , "PBC" , param_reg_id , 0 }, + {0xff78 , 0x7968 , "PBD" , param_reg_id , 0 }, + {0xff78 , 0x7170 , "WWC" , param_reg_id , 0 }, + {0xff78 , 0x7178 , "WWD" , param_reg_id , 0 }, + {0xff78 , 0x7970 , "WBC" , param_reg_id , 0 }, + {0xff78 , 0x7978 , "WBD" , param_reg_id , 0 }, + // *** END *** + {0 , 0 , NULL , NULL , 0 } }; CPU_DISASSEMBLE(hp_hybrid) { - UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ]; - const dis_entry_t *p; + UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ]; + const dis_entry_t *p; - for (p = dis_table; p->m_op_mask; p++) { - if ((opcode & p->m_op_mask) == p->m_opcode) { - strcpy(buffer , p->m_mnemonic); - strcat(buffer , " "); - p->m_param_fn(buffer , pc , opcode); - return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED; + for (p = dis_table; p->m_op_mask; p++) { + if ((opcode & p->m_op_mask) == p->m_opcode) { + strcpy(buffer , p->m_mnemonic); + strcat(buffer , " "); + p->m_param_fn(buffer , pc , opcode); + return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED; + } } - } - // Unknown opcode - strcpy(buffer , "???"); + // Unknown opcode + strcpy(buffer , "???"); - return 1 | DASMFLAG_SUPPORTED; + return 1 | DASMFLAG_SUPPORTED; } From 9fc4731399cfb1791fcbac63e1976fce0dbd3f18 Mon Sep 17 00:00:00 2001 From: fulivi Date: Wed, 10 Jun 2015 12:23:23 +0200 Subject: [PATCH 279/284] hp64k: preliminary version of hp64k driver --- scripts/target/mame/mess.lua | 2 + src/emu/video/i8275.c | 4 +- src/mame/mess.lst | 1 + src/mess/drivers/hp64k.c | 454 +++++++++++++++++++++++++++++++++-- 4 files changed, 440 insertions(+), 21 deletions(-) diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 84bed8d6c66..da44410ce32 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -128,6 +128,7 @@ CPUS["UCOM4"] = true CPUS["HMCS40"] = true CPUS["E0C6200"] = true CPUS["MELPS4"] = true +CPUS["HPHYBRID"] = true -------------------------------------------------- -- specify available sound cores; some of these are @@ -1597,6 +1598,7 @@ files { MAME_DIR .. "src/mess/drivers/hp9845.c", MAME_DIR .. "src/mess/drivers/hp9k.c", MAME_DIR .. "src/mess/drivers/hp9k_3xx.c", + MAME_DIR .. "src/mess/drivers/hp64k.c", } createMESSProjects(_target, _subtarget, "hec2hrp") diff --git a/src/emu/video/i8275.c b/src/emu/video/i8275.c index 848ee9e8eed..59f50b04f70 100644 --- a/src/emu/video/i8275.c +++ b/src/emu/video/i8275.c @@ -315,7 +315,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, int vsp = 0; int rvv = 0; - UINT8 data = m_buffer[!m_buffer_dma][sx]; + UINT8 data = (end_of_row || m_end_of_screen) ? 0 : m_buffer[!m_buffer_dma][sx]; if (data & 0x80) { @@ -359,7 +359,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, m_end_of_screen = true; break; } - vsp = 1; + //vsp = 1; } else { diff --git a/src/mame/mess.lst b/src/mame/mess.lst index ccee3ef7c00..cf21a94aa67 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -1707,6 +1707,7 @@ hp9k340 hp9k370 hp9k380 hp9k382 +hp64k // SpectraVideo svi318 // SVI-318 (PAL) diff --git a/src/mess/drivers/hp64k.c b/src/mess/drivers/hp64k.c index a2ec759839f..641a7e30c88 100644 --- a/src/mess/drivers/hp64k.c +++ b/src/mess/drivers/hp64k.c @@ -5,47 +5,463 @@ // Driver for HP 64000 development system // *************************************** // +// Documentation used for this driver: +// [1] HP, manual 64100-90910, dec 83 rev. - Model 64100A mainframe service manual +// +// TODO: +// - Slot selection mechanism & low 32KW RAM +// - Periodic interrupt +// - Beeper +// - Various DIP switches +// - Floppy I/F +// - RS232 I/F #include "emu.h" #include "cpu/hphybrid/hphybrid.h" +#include "video/i8275.h" + +#define BIT_MASK(n) (1U << (n)) + +// Macros to clear/set single bits +#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n)) +#define BIT_SET(w , n) ((w) |= BIT_MASK(n)) class hp64k_state : public driver_device { public: - hp64k_state(const machine_config &mconfig, device_type type, const char *tag); + hp64k_state(const machine_config &mconfig, device_type type, const char *tag); + + //virtual void driver_start(); + //virtual void machine_start(); + virtual void video_start(); + virtual void machine_reset(); + + UINT8 hp64k_crtc_filter(UINT8 data); + DECLARE_WRITE16_MEMBER(hp64k_crtc_w); + DECLARE_WRITE_LINE_MEMBER(hp64k_crtc_drq_w); + DECLARE_WRITE_LINE_MEMBER(hp64k_crtc_vrtc_w); + + I8275_DRAW_CHARACTER_MEMBER(crtc_display_pixels); + + DECLARE_READ16_MEMBER(hp64k_rear_sw_r); + + IRQ_CALLBACK_MEMBER(hp64k_irq_callback); + void hp64k_update_irl(void); + DECLARE_WRITE16_MEMBER(hp64k_irl_mask_w); + + TIMER_DEVICE_CALLBACK_MEMBER(hp64k_kb_scan); + DECLARE_READ16_MEMBER(hp64k_kb_r); private: - required_device m_cpu; + required_device m_cpu; + required_device m_crtc; + required_device m_palette; + required_ioport m_io_key0; + required_ioport m_io_key1; + required_ioport m_io_key2; + required_ioport m_io_key3; + + // Character generator + const UINT8 *m_chargen; + + UINT32 m_crtc_ptr; + bool m_crtc_drq; + bool m_vrtc; + + // Interrupt handling + UINT8 m_irl_mask; + UINT8 m_irl_pending; + + // State of keyboard + ioport_value m_kb_state[ 4 ]; + UINT8 m_kb_row_col; + bool m_kb_scan_on; + bool m_kb_pressed; }; static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 16 , hp64k_state) - AM_RANGE(0x0000 , 0x3fff) AM_ROM - AM_RANGE(0x8000 , 0xffff) AM_RAM + AM_RANGE(0x0000 , 0x3fff) AM_ROM + AM_RANGE(0x8000 , 0x8001) AM_WRITE(hp64k_crtc_w) + AM_RANGE(0x8002 , 0xffff) AM_RAM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(cpu_io_map , AS_IO , 16 , hp64k_state) + // PA = 0, IC = [0..3] + // Keyboard input + AM_RANGE(HP_MAKE_IOADDR(0 , 0) , HP_MAKE_IOADDR(0 , 3)) AM_READ(hp64k_kb_r) + // PA = 7, IC = 2 + // Rear-panel switches + AM_RANGE(HP_MAKE_IOADDR(7 , 2) , HP_MAKE_IOADDR(7 , 2)) AM_READ(hp64k_rear_sw_r) + // PA = 12, IC = [0..3] + // Interrupt mask + AM_RANGE(HP_MAKE_IOADDR(12 , 0) , HP_MAKE_IOADDR(12 , 3)) AM_WRITE(hp64k_irl_mask_w) ADDRESS_MAP_END hp64k_state::hp64k_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig , type , tag), - m_cpu(*this , "cpu") + : driver_device(mconfig , type , tag), + m_cpu(*this , "cpu"), + m_crtc(*this , "crtc"), + m_palette(*this , "palette"), + m_io_key0(*this , "KEY0"), + m_io_key1(*this , "KEY1"), + m_io_key2(*this , "KEY2"), + m_io_key3(*this , "KEY3") { } +void hp64k_state::video_start() +{ + m_chargen = memregion("chargen")->base(); +} + +void hp64k_state::machine_reset() +{ + m_crtc_drq = false; + m_vrtc = false; + m_crtc_ptr = 0; + m_irl_mask = 0; + m_irl_pending = 0; + memset(&m_kb_state[ 0 ] , 0 , sizeof(m_kb_state)); + m_kb_row_col = 0; + m_kb_scan_on = true; +} + +UINT8 hp64k_state::hp64k_crtc_filter(UINT8 data) +{ + bool inv = (data & 0xe0) == 0xe0; + + return inv ? (data & 0xf2) : data; +} + +WRITE16_MEMBER(hp64k_state::hp64k_crtc_w) +{ + m_crtc->write(space , offset == 0 , hp64k_crtc_filter((UINT8)data)); +} + +WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_drq_w) +{ + bool crtc_drq = state != 0; + bool prev_crtc = m_crtc_drq; + m_crtc_drq = crtc_drq; + + if (!prev_crtc && crtc_drq) { + address_space& prog_space = m_cpu->space(AS_PROGRAM); + + UINT8 data = prog_space.read_byte(m_crtc_ptr); + m_crtc_ptr++; + + m_crtc->dack_w(prog_space , 0 , hp64k_crtc_filter(data)); + } +} + +WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_vrtc_w) +{ + bool vrtc = state != 0; + + if (!m_vrtc && vrtc) { + m_crtc_ptr = 0xf9f0 << 1; + } + m_vrtc = vrtc; +} + +I8275_DRAW_CHARACTER_MEMBER(hp64k_state::crtc_display_pixels) +{ + const rgb_t *palette = m_palette->palette()->entry_list_raw(); + UINT8 chargen_byte = m_chargen[ linecount | ((unsigned)charcode << 4) ]; + bool lvid , livid; + UINT16 pixels_lvid , pixels_livid; + unsigned i; + + if (vsp) { + pixels_lvid = pixels_livid = ~0; + } else if (lten) { + pixels_livid = ~0; + if (rvv) { + pixels_lvid = ~0; + } else { + pixels_lvid = 0; + } + } else if (rvv) { + pixels_lvid = ~0; + pixels_livid = (UINT16)chargen_byte << 1; + } else { + pixels_lvid = ~((UINT16)chargen_byte << 1); + pixels_livid = ~0; + } + + for (i = 0; i < 9; i++) { + lvid = (pixels_lvid & (1U << (8 - i))) != 0; + livid = (pixels_livid & (1U << (8 - i))) != 0; + + if (!lvid) { + // Normal brightness + bitmap.pix32(y , x + i) = palette[ 2 ]; + } else if (livid) { + // Black + bitmap.pix32(y , x + i) = palette[ 0 ]; + } else { + // Half brightness + bitmap.pix32(y , x + i) = palette[ 1 ]; + } + } + +} + +READ16_MEMBER(hp64k_state::hp64k_rear_sw_r) +{ + // TEST + return ~0; +} + +IRQ_CALLBACK_MEMBER(hp64k_state::hp64k_irq_callback) +{ + if (irqline == HPHYBRID_IRL) { + return 0xff00 | (m_irl_mask & m_irl_pending); + } else { + return ~0; + } +} + +void hp64k_state::hp64k_update_irl(void) +{ + m_cpu->set_input_line(HPHYBRID_IRL , (m_irl_mask & m_irl_pending) != 0); +} + +WRITE16_MEMBER(hp64k_state::hp64k_irl_mask_w) +{ + m_irl_mask = (UINT8)data; + hp64k_update_irl(); +} + +TIMER_DEVICE_CALLBACK_MEMBER(hp64k_state::hp64k_kb_scan) +{ + if (m_kb_scan_on) { + unsigned i; + + ioport_value input[ 4 ]; + input[ 0 ] = m_io_key0->read(); + input[ 1 ] = m_io_key1->read(); + input[ 2 ] = m_io_key2->read(); + input[ 3 ] = m_io_key3->read(); + + for (i = 0; i < 128; i++) { + if (++m_kb_row_col >= 128) { + m_kb_row_col = 0; + } + + ioport_value mask = BIT_MASK(m_kb_row_col & 0x1f); + unsigned idx = m_kb_row_col >> 5; + + if ((input[ idx ] ^ m_kb_state[ idx ]) & mask) { + // key changed state + m_kb_state[ idx ] ^= mask; + m_kb_pressed = (m_kb_state[ idx ] & mask) != 0; + m_kb_scan_on = false; + BIT_SET(m_irl_pending , 0); + hp64k_update_irl(); + break; + } + } + } +} + +READ16_MEMBER(hp64k_state::hp64k_kb_r) +{ + UINT16 ret = 0xff00 | m_kb_row_col; + + if (m_kb_pressed) { + BIT_SET(ret , 7); + } + + m_kb_scan_on = true; + BIT_CLR(m_irl_pending , 0); + hp64k_update_irl(); + + return ret; +} + +static INPUT_PORTS_START(hp64k) + // Keyboard is arranged in a 8 x 16 matrix. Of the 128 possible positions, only 77 are used. + // For key arrangement on the matrix, see [1] pg 334 + // Keys are mapped on bit b of KEYn + // where b = (row & 1) << 4 + column, n = row >> 1 + // column = [0..15] + // row = [0..7] + PORT_START("KEY0") + PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) + PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') + PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~') + PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('\\') PORT_CHAR('|') + PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_UNUSED) + + PORT_START("KEY1") + PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_NAME("RECALL") + PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_NAME("CLRLINE") + PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F11) PORT_NAME("CAPS") + PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("RESET") + PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_NAME("SK1") + PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_NAME("SK2") + PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_NAME("SK3") + PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_NAME("SK4") + PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_NAME("SK5") + PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_NAME("SK6") + PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_NAME("SK7") + PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_NAME("SK8") + PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_UNUSED) + + PORT_START("KEY2") + PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_NAME("INSCHAR") + PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_NAME("DELCHAR") + PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`') + PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('_') PORT_CHAR(UCHAR_MAMEKEY(DEL)) + PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_NAME("ROLLUP") + PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_PGDN) PORT_NAME("NEXTPG") + + PORT_START("KEY3") + PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED) + PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_NAME("ROLLDN") + PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_NAME("PREVPG") + +INPUT_PORTS_END + static MACHINE_CONFIG_START(hp64k , hp64k_state) - MCFG_CPU_ADD("cpu" , HP_5061_3011 , 6250000) - MCFG_CPU_PROGRAM_MAP(cpu_mem_map) - MCFG_QUANTUM_TIME(attotime::from_hz(100)) + MCFG_CPU_ADD("cpu" , HP_5061_3011 , 6250000) + MCFG_CPU_PROGRAM_MAP(cpu_mem_map) + MCFG_CPU_IO_MAP(cpu_io_map) + MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(hp64k_state , hp64k_irq_callback) + MCFG_QUANTUM_TIME(attotime::from_hz(100)) + + // Actual keyboard refresh rate should be between 1 and 2 kHz + MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp64k_state , hp64k_kb_scan , attotime::from_hz(100)) + + // Clock = 25 MHz / 9 * (112/114) + MCFG_DEVICE_ADD("crtc" , I8275 , 2729045) + MCFG_I8275_CHARACTER_WIDTH(9) + MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(hp64k_state , crtc_display_pixels) + MCFG_I8275_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_crtc_drq_w)) + MCFG_I8275_VRTC_CALLBACK(WRITELINE(hp64k_state , hp64k_crtc_vrtc_w)) + + MCFG_SCREEN_ADD("screen" , RASTER) + MCFG_SCREEN_UPDATE_DEVICE("crtc" , i8275_device , screen_update) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") MACHINE_CONFIG_END ROM_START(hp64k) - ROM_REGION(0x8000 , "cpu" , ROMREGION_16BIT | ROMREGION_BE | ROMREGION_INVERT) - ROM_LOAD16_BYTE("64100_80022.bin" , 0x0000 , 0x1000 , CRC(38b2aae5)) - ROM_LOAD16_BYTE("64100_80020.bin" , 0x0001 , 0x1000 , CRC(ac01b436)) - ROM_LOAD16_BYTE("64100_80023.bin" , 0x2000 , 0x1000 , CRC(6b4bc2ce)) - ROM_LOAD16_BYTE("64100_80021.bin" , 0x2001 , 0x1000 , CRC(74f9d33c)) - ROM_LOAD16_BYTE("64100_80026.bin" , 0x4000 , 0x1000 , CRC(a74e834b)) - ROM_LOAD16_BYTE("64100_80024.bin" , 0x4001 , 0x1000 , CRC(2e15a1d2)) - ROM_LOAD16_BYTE("64100_80027.bin" , 0x6000 , 0x1000 , CRC(b93c0e7a)) - ROM_LOAD16_BYTE("64100_80025.bin" , 0x6001 , 0x1000 , CRC(e6353085)) + ROM_REGION(0x8000 , "cpu" , ROMREGION_16BIT | ROMREGION_BE | ROMREGION_INVERT) + ROM_LOAD16_BYTE("64100_80022.bin" , 0x0000 , 0x1000 , CRC(38b2aae5) SHA1(bfd0f126bfaf3724dc501979ad2d46afc41913aa)) + ROM_LOAD16_BYTE("64100_80020.bin" , 0x0001 , 0x1000 , CRC(ac01b436) SHA1(be1e827ea1393a95abb02a52ab5cc35dc2cd96e4)) + ROM_LOAD16_BYTE("64100_80023.bin" , 0x2000 , 0x1000 , CRC(6b4bc2ce) SHA1(00e6c58ccae9640dc81cb3e92db90a8c69b02a93)) + ROM_LOAD16_BYTE("64100_80021.bin" , 0x2001 , 0x1000 , CRC(74f9d33c) SHA1(543a845a992b0ceac3e0491acdfb178df0adeb1f)) + ROM_LOAD16_BYTE("64100_80026.bin" , 0x4000 , 0x1000 , CRC(a74e834b) SHA1(a2ff9765628985d9bab4cb44ba23257a9b8d0965)) + ROM_LOAD16_BYTE("64100_80024.bin" , 0x4001 , 0x1000 , CRC(2e15a1d2) SHA1(ce4330f8f8015a26c02f0965b95baf7dfd615512)) + ROM_LOAD16_BYTE("64100_80027.bin" , 0x6000 , 0x1000 , CRC(b93c0e7a) SHA1(b239446d3d6e9d3dba6c0278b2771abe1623e1ad)) + ROM_LOAD16_BYTE("64100_80025.bin" , 0x6001 , 0x1000 , CRC(e6353085) SHA1(48d78835c798f2caf6ee539057676d4f3c8a4df9)) + + ROM_REGION(0x800 , "chargen" , 0) + ROM_LOAD("1816_1496_82S191.bin" , 0 , 0x800 , CRC(32a52664) SHA1(8b2a49a32510103ff424e8481d5ed9887f609f2f)) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ -COMP( 1979, hp64k, 0, 0, hp64k, 0, driver_device, 0, "HP", "HP 64000" , GAME_NO_SOUND) +COMP( 1979, hp64k, 0, 0, hp64k, hp64k, driver_device, 0, "HP", "HP 64000" , GAME_NO_SOUND) From 1c1860499f41efcf7df6fee3adda6d1557c31c35 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 10 Jun 2015 12:28:33 +0200 Subject: [PATCH 280/284] move some legacy formats over to imgtool since it's now the only user --- scripts/src/lib.lua | 4 ---- scripts/src/tools.lua | 4 ++++ src/{lib => mess/tools/imgtool}/formats/coco_dsk.c | 2 +- src/{lib => mess/tools/imgtool}/formats/coco_dsk.h | 2 +- src/{lib => mess/tools/imgtool}/formats/vt_dsk.c | 0 src/{lib => mess/tools/imgtool}/formats/vt_dsk.h | 2 +- src/mess/tools/imgtool/modules/amiga.c | 1 - 7 files changed, 7 insertions(+), 8 deletions(-) rename src/{lib => mess/tools/imgtool}/formats/coco_dsk.c (99%) rename src/{lib => mess/tools/imgtool}/formats/coco_dsk.h (94%) rename src/{lib => mess/tools/imgtool}/formats/vt_dsk.c (100%) rename src/{lib => mess/tools/imgtool}/formats/vt_dsk.h (92%) diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 996478276a6..d081ef6665f 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -197,8 +197,6 @@ project "formats" MAME_DIR .. "src/lib/formats/cgenie_dsk.h", MAME_DIR .. "src/lib/formats/coco_cas.c", MAME_DIR .. "src/lib/formats/coco_cas.h", - MAME_DIR .. "src/lib/formats/coco_dsk.c", - MAME_DIR .. "src/lib/formats/coco_dsk.h", MAME_DIR .. "src/lib/formats/comx35_dsk.c", MAME_DIR .. "src/lib/formats/comx35_dsk.h", MAME_DIR .. "src/lib/formats/concept_dsk.c", @@ -402,8 +400,6 @@ project "formats" MAME_DIR .. "src/lib/formats/vg5k_cas.h", MAME_DIR .. "src/lib/formats/vt_cas.c", MAME_DIR .. "src/lib/formats/vt_cas.h", - MAME_DIR .. "src/lib/formats/vt_dsk.c", - MAME_DIR .. "src/lib/formats/vt_dsk.h", MAME_DIR .. "src/lib/formats/wavfile.c", MAME_DIR .. "src/lib/formats/wavfile.h", MAME_DIR .. "src/lib/formats/wd177x_dsk.c", diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index 4f58b12d641..55f966eed2e 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -805,6 +805,10 @@ files { MAME_DIR .. "src/mess/tools/imgtool/imgterrs.c", MAME_DIR .. "src/mess/tools/imgtool/imghd.c", MAME_DIR .. "src/mess/tools/imgtool/charconv.c", + MAME_DIR .. "src/mess/tools/imgtool/formats/vt_dsk.c", + MAME_DIR .. "src/mess/tools/imgtool/formats/vt_dsk.h", + MAME_DIR .. "src/mess/tools/imgtool/formats/coco_dsk.c", + MAME_DIR .. "src/mess/tools/imgtool/formats/coco_dsk.h", MAME_DIR .. "src/mess/tools/imgtool/modules/amiga.c", MAME_DIR .. "src/mess/tools/imgtool/modules/macbin.c", MAME_DIR .. "src/mess/tools/imgtool/modules/rsdos.c", diff --git a/src/lib/formats/coco_dsk.c b/src/mess/tools/imgtool/formats/coco_dsk.c similarity index 99% rename from src/lib/formats/coco_dsk.c rename to src/mess/tools/imgtool/formats/coco_dsk.c index 1fa8c09ac22..9674ed9de11 100644 --- a/src/lib/formats/coco_dsk.c +++ b/src/mess/tools/imgtool/formats/coco_dsk.c @@ -14,7 +14,7 @@ #include "formats/coco_dsk.h" #include "formats/basicdsk.h" -#include "imageutl.h" +#include "formats/imageutl.h" #include "coretmpl.h" /* ----------------------------------------------------------------------- diff --git a/src/lib/formats/coco_dsk.h b/src/mess/tools/imgtool/formats/coco_dsk.h similarity index 94% rename from src/lib/formats/coco_dsk.h rename to src/mess/tools/imgtool/formats/coco_dsk.h index b190390d0cc..797911d40a1 100644 --- a/src/lib/formats/coco_dsk.h +++ b/src/mess/tools/imgtool/formats/coco_dsk.h @@ -11,7 +11,7 @@ #ifndef COCO_DSK_H #define COCO_DSK_H -#include "flopimg.h" +#include "formats/flopimg.h" /**************************************************************************/ diff --git a/src/lib/formats/vt_dsk.c b/src/mess/tools/imgtool/formats/vt_dsk.c similarity index 100% rename from src/lib/formats/vt_dsk.c rename to src/mess/tools/imgtool/formats/vt_dsk.c diff --git a/src/lib/formats/vt_dsk.h b/src/mess/tools/imgtool/formats/vt_dsk.h similarity index 92% rename from src/lib/formats/vt_dsk.h rename to src/mess/tools/imgtool/formats/vt_dsk.h index 7b5f1fe4098..a3f9a86b44e 100644 --- a/src/lib/formats/vt_dsk.h +++ b/src/mess/tools/imgtool/formats/vt_dsk.h @@ -11,7 +11,7 @@ #ifndef VT_DSK_H #define VT_DSK_H -#include "flopimg.h" +#include "formats/flopimg.h" LEGACY_FLOPPY_OPTIONS_EXTERN(vz); diff --git a/src/mess/tools/imgtool/modules/amiga.c b/src/mess/tools/imgtool/modules/amiga.c index d0a970fae66..7723748cbd2 100644 --- a/src/mess/tools/imgtool/modules/amiga.c +++ b/src/mess/tools/imgtool/modules/amiga.c @@ -21,7 +21,6 @@ #include "imgtool.h" #include "iflopimg.h" #include "formats/imageutl.h" -#include "formats/ami_dsk.h" From 2efe4c6553b024f7c341f075b2f4f6d70ca491e0 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 10 Jun 2015 15:11:52 +0200 Subject: [PATCH 281/284] gamegear: allow master gear adapter to see lightphaser offsets. [Enik Land] --- src/emu/bus/sega8/mgear.h | 1 + src/emu/bus/sega8/sega8_slot.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/emu/bus/sega8/mgear.h b/src/emu/bus/sega8/mgear.h index ea8a9bce362..2e4afa40466 100644 --- a/src/emu/bus/sega8/mgear.h +++ b/src/emu/bus/sega8/mgear.h @@ -23,6 +23,7 @@ public: virtual DECLARE_READ8_MEMBER(read_cart) { return m_subslot->read_cart(space, offset); } virtual DECLARE_WRITE8_MEMBER(write_cart) { m_subslot->write_cart(space, offset, data); } virtual DECLARE_WRITE8_MEMBER(write_mapper) { m_subslot->write_mapper(space, offset, data); } + virtual int get_lphaser_xoffs() { return m_subslot->m_cart ? m_subslot->m_cart->get_lphaser_xoffs() : -1; } virtual machine_config_constructor device_mconfig_additions() const; diff --git a/src/emu/bus/sega8/sega8_slot.h b/src/emu/bus/sega8/sega8_slot.h index 095dc6261f6..ac0fdd406cd 100644 --- a/src/emu/bus/sega8/sega8_slot.h +++ b/src/emu/bus/sega8/sega8_slot.h @@ -47,6 +47,7 @@ public: virtual DECLARE_READ8_MEMBER(read_cart) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_cart) {} virtual DECLARE_WRITE8_MEMBER(write_mapper) {} + virtual int get_lphaser_xoffs() { return m_lphaser_xoffs; } // a few carts (for SG1000) acts as a RAM expansion, taking control of the system RAM in 0xc000-0xffff virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} @@ -61,7 +62,6 @@ public: void set_late_battery(bool val) { m_late_battery_enable = val; } bool get_late_battery() { return m_late_battery_enable; } void set_lphaser_xoffs(int val) { m_lphaser_xoffs = val; } - int get_lphaser_xoffs() { return m_lphaser_xoffs; } void set_sms_mode(int val) { m_sms_mode = val; } int get_sms_mode() { return m_sms_mode; } From a7184aa5a3987fdf9bcac092f3bd7295830924c8 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 10 Jun 2015 15:12:48 +0200 Subject: [PATCH 282/284] fixed regression in falcon30, falcon40, tt030, tt030_de, tt030_fr, tt030_pl, tt030_uk drivers due to the wrong driver class being used. nw. --- src/mess/drivers/atarist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c index 46ad6a90e95..a7b56d5dcc9 100644 --- a/src/mess/drivers/atarist.c +++ b/src/mess/drivers/atarist.c @@ -2453,7 +2453,7 @@ MACHINE_CONFIG_END // MACHINE_CONFIG( tt030 ) //------------------------------------------------- -static MACHINE_CONFIG_DERIVED( tt030, st ) +static MACHINE_CONFIG_DERIVED( tt030, ste ) MACHINE_CONFIG_END @@ -2461,7 +2461,7 @@ MACHINE_CONFIG_END // MACHINE_CONFIG( falcon ) //------------------------------------------------- -static MACHINE_CONFIG_DERIVED( falcon, st ) +static MACHINE_CONFIG_DERIVED( falcon, ste ) MACHINE_CONFIG_END @@ -2469,7 +2469,7 @@ MACHINE_CONFIG_END // MACHINE_CONFIG( falcon40 ) //------------------------------------------------- -static MACHINE_CONFIG_DERIVED( falcon40, st ) +static MACHINE_CONFIG_DERIVED( falcon40, ste ) MACHINE_CONFIG_END From 1264bfaf9f32da46312c76b9f2dbe560bd9659b4 Mon Sep 17 00:00:00 2001 From: briantro Date: Wed, 10 Jun 2015 10:28:19 -0500 Subject: [PATCH 283/284] peplus.c: Misc minor doc corrections & white space - NW --- src/mame/drivers/peplus.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 784a65f1019..e8f89389c15 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -1619,7 +1619,7 @@ ROM_START( pepp0021 ) /* Normal board : Standard Draw Poker (PP0021) */ REQUIRES Progressive link which is not currently supported */ ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "pp0021_723-703.u68", 0x00000, 0x10000, CRC(58f2a68b) SHA1(72c0a29016b17f7e308a9e9b2d724771b5e26560) ) /* Game Version: 723, Library Version: 703*/ + ROM_LOAD( "pp0021_723-703.u68", 0x00000, 0x10000, CRC(58f2a68b) SHA1(72c0a29016b17f7e308a9e9b2d724771b5e26560) ) /* Game Version: 723, Library Version: 703 */ ROM_REGION( 0x020000, "gfx1", 0 ) ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) @@ -7195,7 +7195,7 @@ ROM_START( pex0489p ) /* Superboard : Double Down Stud Deuces Wild Poker (X00048 w/D w/oD PayTable Ks+ 2P 3K STR FL FH 4K SF 5K RF 4D RF (Bonus) ----------------------------------------------------------------------- - ???? 1 1 2 3 4 5 6 12 15 100 400 1000 2000 + ???? 1 1 2 3 4 5 6 12 15 100 400 1000 2000 % Range: 91.3-93.3% Optimum: 95.3% Hit Frequency: 45.3% Programs Available: PP0489, X000489P */ @@ -9921,7 +9921,7 @@ Double Bonus Poker P323A 99.10% */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xmp00020.u67", 0x00000, 0x10000, CRC(0f6d0706) SHA1(fccf6c93daab0694d1e35e7cdd6bae303a3fddd9) ) - /* Known to be found with XMP00003, XMP00006 or XMP00024 programs */ + /* Also known to be found with XMP00003, XMP00006 or XMP00024 programs */ ROM_REGION( 0x10000, "user1", 0 ) ROM_LOAD( "xm00006p.u66", 0x00000, 0x10000, CRC(b464ee79) SHA1(8768e52c66881c8f327055124ff31bcad79fd027) ) /* 03/08/96 @ IGT NV */ @@ -9999,11 +9999,11 @@ Combined average payout percent: 98.47% Game Type PayTable Payout ------------------------------------- -Aces & Faces ????? 99.20% +Aces & Faces ????? 99.30% Bonus Poker Deluxe P200A 98.50% Deuces Wild Poker P62A 98.90% Jacks or Better BB 97.80% -Double Aces & Faces ????? 99.30% +Double Aces & Faces ????? 99.20% */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "xmp00002.u67", 0x00000, 0x10000, CRC(d5624ac8) SHA1(6b778b0e7ddb81123c6038920b3447e05a0556b2) ) /* 09/07/95 @ IGT L95-2183 - Linkable Progressive */ @@ -10713,7 +10713,7 @@ GAMEL(1995, pexm002p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, GAMEL(1995, pexm003p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00003P+XMP00024) Multi-Poker", 0, layout_pe_poker ) GAMEL(1995, pexm004p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00004P+XMP00002) Multi-Poker", 0, layout_pe_poker ) GAMEL(1995, pexm005p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00005P+XMP00004) Multi-Poker", 0, layout_pe_poker ) -GAMEL(1995, pexm006p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00006P+XMP00006) Multi-Poker", 0, layout_pe_poker ) +GAMEL(1995, pexm006p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00006P+XMP00020) Multi-Poker", 0, layout_pe_poker ) GAMEL(1995, pexm007p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00007P+XMP00006) Multi-Poker", 0, layout_pe_poker ) GAMEL(1995, pexm008p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00008P+XMP00006) Multi-Poker", 0, layout_pe_poker ) GAMEL(1995, pexm009p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00009P+XMP00002) Multi-Poker", GAME_IMPERFECT_GRAPHICS, layout_pe_poker ) /* Needs unknown CG2??? graphics roms for correct MENU game banners */ From c9e38b3a45dc32d02f4000c3a5fb6b873dad28c0 Mon Sep 17 00:00:00 2001 From: briantro Date: Wed, 10 Jun 2015 10:30:20 -0500 Subject: [PATCH 284/284] --- src/mame/drivers/rohga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c index 8f4cda6f672..0e2a181503b 100644 --- a/src/mame/drivers/rohga.c +++ b/src/mame/drivers/rohga.c @@ -1454,7 +1454,7 @@ ROM_START( wizdfire ) ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ - ROM_LOAD( "mas10", 0x00000, 0x80000, CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) ) + ROM_LOAD( "mas10", 0x00000, 0x100000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ ROM_LOAD( "mas11", 0x00000, 0x80000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) ) @@ -1498,7 +1498,7 @@ ROM_START( wizdfireu ) ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ - ROM_LOAD( "mas10", 0x00000, 0x80000, CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) ) + ROM_LOAD( "mas10", 0x00000, 0x100000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ ROM_LOAD( "mas11", 0x00000, 0x80000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) ) @@ -1542,7 +1542,7 @@ ROM_START( darkseal2 ) ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) ) ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */ - ROM_LOAD( "mas10", 0x00000, 0x80000, BAD_DUMP CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) ) // Incorrect ROM for this version + ROM_LOAD( "mas10", 0x00000, 0x100000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) ) ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */ ROM_LOAD( "mas11", 0x00000, 0x80000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )