diff options
61 files changed, 787 insertions, 310 deletions
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 515c55a222c..cb80c5403f4 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -360,6 +360,22 @@ if (CPUS["ESRIP"]~=null or _OPTIONS["with-tools"]) then end -------------------------------------------------- +-- Seiko Epson E0C6200 series +---@src/emu/cpu/e0c6200/e0c6200.h,CPUS += E0C6200 +-------------------------------------------------- + +if (CPUS["E0C6200"]~=null) then + files { + MAME_DIR .. "src/emu/cpu/e0c6200/e0c6200.c", + MAME_DIR .. "src/emu/cpu/e0c6200/e0c6200.h", + } +end + +if (CPUS["E0C6200"]~=null or _OPTIONS["with-tools"]) then + table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/e0c6200/e0c6200d.c") +end + +-------------------------------------------------- -- RCA COSMAC ---@src/emu/cpu/cosmac/cosmac.h,CPUS += COSMAC -------------------------------------------------- diff --git a/scripts/target/mame/mame.lua b/scripts/target/mame/mame.lua index 44120517e4b..b8959dc8c63 100644 --- a/scripts/target/mame/mame.lua +++ b/scripts/target/mame/mame.lua @@ -100,7 +100,7 @@ CPUS["SM8500"] = true CPUS["MINX"] = true CPUS["SSEM"] = true CPUS["AVR8"] = true -CPUS["TMS0980"] = true +--CPUS["TMS0980"] = true CPUS["I4004"] = true CPUS["SUPERFX"] = true CPUS["Z8"] = true @@ -123,9 +123,10 @@ CPUS["ALTO2"] = true --CPUS["W65816"] = true CPUS["ARC"] = true CPUS["ARCOMPACT"] = true -CPUS["AMIS2000"] = true -CPUS["UCOM4"] = true +--CPUS["AMIS2000"] = true +--CPUS["UCOM4"] = true CPUS["HMCS40"] = true +--CPUS["E0C6200"] = true -------------------------------------------------- -- specify available sound cores diff --git a/scripts/target/mess/mess.lua b/scripts/target/mess/mess.lua index c60b8f16d09..5c1c1a7e3f5 100644 --- a/scripts/target/mess/mess.lua +++ b/scripts/target/mess/mess.lua @@ -103,7 +103,7 @@ CPUS["SUPERFX"] = true CPUS["Z8"] = true CPUS["I8008"] = true CPUS["SCMP"] = true -CPUS["MN10200"] = true +--CPUS["MN10200"] = true CPUS["COSMAC"] = true CPUS["UNSP"] = true CPUS["HCD62121"] = true @@ -123,6 +123,7 @@ CPUS["ARCOMPACT"] = true CPUS["AMIS2000"] = true CPUS["UCOM4"] = true CPUS["HMCS40"] = true +CPUS["E0C6200"] = true -------------------------------------------------- -- specify available sound cores; some of these are diff --git a/src/emu/cpu/amis2000/amis2000.h b/src/emu/cpu/amis2000/amis2000.h index ba565205b21..d04127eec16 100644 --- a/src/emu/cpu/amis2000/amis2000.h +++ b/src/emu/cpu/amis2000/amis2000.h @@ -83,7 +83,7 @@ protected: virtual void execute_run(); // 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_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 1; } diff --git a/src/emu/cpu/e0c6200/e0c6200.c b/src/emu/cpu/e0c6200/e0c6200.c new file mode 100644 index 00000000000..4674aa3d01e --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200.c @@ -0,0 +1,104 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Seiko Epson E0C6200 CPU core and E0C62 MCU family + + References: + - 1998 MF297-06a E0C6200/E0C6200A Core CPU Manual + - 1998 MF1049-01a E0C6S46 Technical Manual + + TODO: + - niks + +*/ + +#include "e0c6200.h" +#include "debugger.h" + +#include "e0c6200op.inc" + + +const device_type EPSON_E0C6S46 = &device_creator<e0c6s46_device>; + + +// internal memory maps +static ADDRESS_MAP_START(program_1k, AS_PROGRAM, 16, e0c6200_cpu_device) + AM_RANGE(0x0000, 0x03ff) AM_ROM +ADDRESS_MAP_END + + +static ADDRESS_MAP_START(data_64x4, AS_DATA, 8, e0c6200_cpu_device) + AM_RANGE(0x00, 0x3f) AM_RAM +ADDRESS_MAP_END + + +// device definitions +e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : e0c6200_cpu_device(mconfig, EPSON_E0C6S46, "E0C6S46", tag, owner, clock, 10, ADDRESS_MAP_NAME(program_1k), 6, ADDRESS_MAP_NAME(data_64x4), "e0c6s46", __FILE__) +{ } + + +// disasm +void e0c6200_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) +{ + switch (entry.index()) + { + case STATE_GENFLAGS: + break; + + default: break; + } +} + +offs_t e0c6200_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +{ + extern CPU_DISASSEMBLE(e0c6200); + return CPU_DISASSEMBLE_NAME(e0c6200)(this, buffer, pc, oprom, opram, options); +} + + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void e0c6200_cpu_device::device_start() +{ + m_program = &space(AS_PROGRAM); + m_data = &space(AS_DATA); + m_prgmask = (1 << m_prgwidth) - 1; + m_datamask = (1 << m_datawidth) - 1; + + // zerofill + + // register for savestates + + // register state for debugger + + m_icountptr = &m_icount; +} + + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void e0c6200_cpu_device::device_reset() +{ +} + + + +//------------------------------------------------- +// execute +//------------------------------------------------- + +void e0c6200_cpu_device::execute_run() +{ + while (m_icount > 0) + { + m_icount--; + } +} diff --git a/src/emu/cpu/e0c6200/e0c6200.h b/src/emu/cpu/e0c6200/e0c6200.h new file mode 100644 index 00000000000..c4bd04b2254 --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200.h @@ -0,0 +1,73 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Seiko Epson E0C6200 CPU core and E0C62 MCU family + +*/ + +#ifndef _E06200_H_ +#define _E06200_H_ + +#include "emu.h" + + +class e0c6200_cpu_device : public cpu_device +{ +public: + // construction/destruction + e0c6200_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) + : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) + , m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, 0, program) + , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) + , m_prgwidth(prgwidth) + , m_datawidth(datawidth) + { } + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_execute_interface overrides + virtual UINT32 execute_min_cycles() const { return 5; } + virtual UINT32 execute_max_cycles() const { return 12; } + virtual UINT32 execute_input_lines() const { return 1; } + virtual void execute_run(); + + // 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_DATA) ? &m_data_config : NULL); } + + // 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); + + void state_string_export(const device_state_entry &entry, std::string &str); + + address_space_config m_program_config; + address_space_config m_data_config; + address_space *m_program; + address_space *m_data; + + int m_prgwidth; + int m_datawidth; + int m_prgmask; + int m_datamask; + + int m_icount; +}; + + +class e0c6s46_device : public e0c6200_cpu_device +{ +public: + e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + + +extern const device_type EPSON_E0C6S46; + + +#endif /* _E06200_H_ */ diff --git a/src/emu/cpu/e0c6200/e0c6200d.c b/src/emu/cpu/e0c6200/e0c6200d.c new file mode 100644 index 00000000000..def8eb9bee7 --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200d.c @@ -0,0 +1,18 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Seiko Epson E0C6200 disassembler + +*/ + +#include "emu.h" +#include "debugger.h" +#include "e0c6200.h" + + + +CPU_DISASSEMBLE(e0c6200) +{ + return 2; +} diff --git a/src/emu/cpu/e0c6200/e0c6200op.inc b/src/emu/cpu/e0c6200/e0c6200op.inc new file mode 100644 index 00000000000..946fdf6a4d5 --- /dev/null +++ b/src/emu/cpu/e0c6200/e0c6200op.inc @@ -0,0 +1 @@ +// E0C6200 opcode handlers diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h index b5967a4d640..9e722f595a6 100644 --- a/src/emu/cpu/hmcs40/hmcs40.h +++ b/src/emu/cpu/hmcs40/hmcs40.h @@ -153,7 +153,7 @@ protected: virtual void execute_run(); // 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_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 2; } diff --git a/src/emu/cpu/tms0980/tms0980.h b/src/emu/cpu/tms0980/tms0980.h index a291c95de92..15caeedeedb 100644 --- a/src/emu/cpu/tms0980/tms0980.h +++ b/src/emu/cpu/tms0980/tms0980.h @@ -90,7 +90,7 @@ protected: virtual void execute_run(); // 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_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 1; } diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 53882e3a59e..54084f631f8 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -35,7 +35,7 @@ tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , device_video_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_LITTLE, 16, 32, 3) - , m_reset_deferred(FALSE) + , m_halt_on_reset(FALSE) , m_pixclock(0) , m_pixperclock(0) , m_output_int_cb(*this) @@ -648,6 +648,8 @@ void tms340x0_device::device_reset() /* HALT the CPU if requested, and remember to re-read the starting PC */ /* the first time we are run */ + m_reset_deferred = m_halt_on_reset; + if (m_reset_deferred) { io_register_w(*m_program, REG_HSTCTLH, 0x8000, 0xffff); @@ -714,11 +716,10 @@ void tms340x0_device::execute_run() m_icount = 0; return; } - /* if the CPU's reset was deferred, do it now */ if (m_reset_deferred) { - m_reset_deferred = 0; + m_reset_deferred = FALSE; m_pc = RLONG(0xffffffe0); } diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h index b9420def0ae..e46fbe29783 100644 --- a/src/emu/cpu/tms34010/tms34010.h +++ b/src/emu/cpu/tms34010/tms34010.h @@ -240,7 +240,7 @@ public: // construction/destruction tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); - static void set_halt_on_reset(device_t &device, bool reset_deferred) { downcast<tms340x0_device &>(device).m_reset_deferred = reset_deferred; } + static void set_halt_on_reset(device_t &device, bool halt_on_reset) { downcast<tms340x0_device &>(device).m_halt_on_reset = halt_on_reset; } static void set_pixel_clock(device_t &device, UINT32 pixclock) { downcast<tms340x0_device &>(device).m_pixclock = pixclock; } static void set_pixels_per_clock(device_t &device, int pixperclock) { downcast<tms340x0_device &>(device).m_pixperclock = pixperclock; } static void set_scanline_ind16_callback(device_t &device, scanline_ind16_cb_delegate callback) { downcast<tms340x0_device &>(device).m_scanline_ind16_cb = callback; } @@ -327,7 +327,8 @@ protected: INT32 m_gfxcycles; UINT8 m_pixelshift; UINT8 m_is_34020; - bool m_reset_deferred; /* /HCS pin, which determines HALT state after reset */ + bool m_reset_deferred; + bool m_halt_on_reset; /* /HCS pin, which determines HALT state after reset */ UINT8 m_hblank_stable; UINT8 m_external_host_access; UINT8 m_executing; diff --git a/src/emu/cpu/ucom4/ucom4.h b/src/emu/cpu/ucom4/ucom4.h index 5c4cd18eac4..5e2bff9a62c 100644 --- a/src/emu/cpu/ucom4/ucom4.h +++ b/src/emu/cpu/ucom4/ucom4.h @@ -144,7 +144,7 @@ protected: virtual void execute_run(); // 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_DATA) ? &m_data_config : NULL); } + virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); } // device_disasm_interface overrides virtual UINT32 disasm_min_opcode_bytes() const { return 1; } diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h index c581b4b6de2..09751221393 100644 --- a/src/emu/inpttype.h +++ b/src/emu/inpttype.h @@ -20,7 +20,7 @@ typelist.append(*global_alloc(input_type_entry(IPT_##_type, IPG_##_group, (_player == 0) ? _player : (_player) - 1, (_player == 0) ? #_type : ("P" #_player "_" #_type), _name, _seq, _decseq, _incseq))); /* These input port macros expand to a great deal of code and break compilers */ -#if defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ == 4 && __GNUC_PATCHLEVEL__ >= 4) +#if defined(__GNUC__) && __GNUC__ == 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ == 4 && __GNUC_PATCHLEVEL__ >= 4) #pragma GCC optimize ("O1") #endif #ifdef _MSC_VER diff --git a/src/emu/machine/netlist.h b/src/emu/machine/netlist.h index ae3bbab7cbf..98560ed4c13 100644 --- a/src/emu/machine/netlist.h +++ b/src/emu/machine/netlist.h @@ -593,7 +593,7 @@ private: netlist_analog_input_t m_in; netlist_analog_output_delegate m_callback; netlist_mame_cpu_device_t *m_cpu_device; - netlist_state_t<nl_double> m_last; + nl_double m_last; }; // ---------------------------------------------------------------------------------------- diff --git a/src/emu/netlist/analog/nld_ms_direct.h b/src/emu/netlist/analog/nld_ms_direct.h index 42e29d04b33..71780de6893 100644 --- a/src/emu/netlist/analog/nld_ms_direct.h +++ b/src/emu/netlist/analog/nld_ms_direct.h @@ -21,7 +21,7 @@ public: ATTR_COLD virtual void vsetup(netlist_analog_net_t::list_t &nets); ATTR_COLD virtual void reset() { netlist_matrix_solver_t::reset(); } - ATTR_HOT inline const int N() const { if (m_N == 0) return m_dim; else return m_N; } + ATTR_HOT inline const int N() const { return (m_N == 0 ? m_dim : m_N); } ATTR_HOT inline int vsolve_non_dynamic(); @@ -52,7 +52,6 @@ protected: terms_t *m_rails_temp; private: - vector_ops_t *m_row_ops[_storage_N + 1]; int m_dim; nl_double m_lp_fact; @@ -72,9 +71,7 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::~netlist_matrix_solver_direct_t for (int k = 0; k < N(); k++) { nl_free(m_terms[k]); - nl_free(m_row_ops[k]); } - nl_free(m_row_ops[N()]); //delete[] m_last_RHS; //delete[] m_RHS; nl_free_array(m_terms); @@ -243,16 +240,12 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::build_LE() const nl_double * RESTRICT gt = m_terms[k]->gt(); const nl_double * RESTRICT go = m_terms[k]->go(); const nl_double * RESTRICT Idr = m_terms[k]->Idr(); -#if VECTALT - for (int i = 0; i < terms_count; i++) { rhsk = rhsk + Idr[i]; akk = akk + gt[i]; } -#else - m_terms[k]->ops()->sum2(Idr, gt, rhsk, akk); -#endif + nl_double * const * RESTRICT other_cur_analog = m_terms[k]->other_curanalog(); for (int i = m_terms[k]->m_railstart; i < terms_count; i++) { @@ -345,13 +338,8 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::gauss_LE( const nl_double f1 = - m_A[j][i] * f; if (f1 != 0.0) { -#if 0 && VECTALT for (int k = i + 1; k < kN; k++) m_A[j][k] += m_A[i][k] * f1; -#else - // addmult gives some performance increase here... - m_row_ops[kN - (i + 1)]->addmult(&m_A[j][i+1], &m_A[i][i+1], f1) ; -#endif m_RHS[j] += m_RHS[i] * f1; } } @@ -464,9 +452,7 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t( for (int k = 0; k < N(); k++) { m_terms[k] = nl_alloc(terms_t); - m_row_ops[k] = vector_ops_t::create_ops(k); } - m_row_ops[N()] = vector_ops_t::create_ops(N()); } template <int m_N, int _storage_N> @@ -481,9 +467,7 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t( for (int k = 0; k < N(); k++) { m_terms[k] = nl_alloc(terms_t); - m_row_ops[k] = vector_ops_t::create_ops(k); } - m_row_ops[N()] = vector_ops_t::create_ops(N()); } diff --git a/src/emu/netlist/analog/nld_ms_gauss_seidel.h b/src/emu/netlist/analog/nld_ms_gauss_seidel.h index a3641c0b29b..be7c60d7ca1 100644 --- a/src/emu/netlist/analog/nld_ms_gauss_seidel.h +++ b/src/emu/netlist/analog/nld_ms_gauss_seidel.h @@ -260,6 +260,7 @@ ATTR_HOT inline int netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::vsolv 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++) { @@ -275,21 +276,15 @@ ATTR_HOT inline int netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::vsolv 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(); -#if VECTALT + 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++) + if (USE_GABS) gabs_t = gabs_t + fabs(go[i]); -#else - if (USE_GABS) - this->m_terms[k]->ops()->sum2a(gt, Idr, go, gtot_t, RHS_t, gabs_t); - else - this->m_terms[k]->ops()->sum2(gt, Idr, gtot_t, RHS_t); -#endif + } + for (int i = this->m_terms[k]->m_railstart; i < term_count; i++) RHS_t = RHS_t + go[i] * *other_cur_analog[i]; } diff --git a/src/emu/netlist/analog/nld_solver.c b/src/emu/netlist/analog/nld_solver.c index 62b1661abcf..d8815f48f33 100644 --- a/src/emu/netlist/analog/nld_solver.c +++ b/src/emu/netlist/analog/nld_solver.c @@ -39,39 +39,6 @@ #include "omp.h" #endif -vector_ops_t *vector_ops_t::create_ops(const int size) -{ - switch (size) - { - case 1: - return nl_alloc(vector_ops_impl_t<1>); - case 2: - return nl_alloc(vector_ops_impl_t<2>); - case 3: - return nl_alloc(vector_ops_impl_t<3>); - case 4: - return nl_alloc(vector_ops_impl_t<4>); - case 5: - return nl_alloc(vector_ops_impl_t<5>); - case 6: - return nl_alloc(vector_ops_impl_t<6>); - case 7: - return nl_alloc(vector_ops_impl_t<7>); - case 8: - return nl_alloc(vector_ops_impl_t<8>); - case 9: - return nl_alloc(vector_ops_impl_t<9>); - case 10: - return nl_alloc(vector_ops_impl_t<10>); - case 11: - return nl_alloc(vector_ops_impl_t<11>); - case 12: - return nl_alloc(vector_ops_impl_t<12>); - default: - return nl_alloc(vector_ops_impl_t<0>, size); - } -} - ATTR_COLD void terms_t::add(netlist_terminal_t *term, int net_other) { m_term.add(term); @@ -556,7 +523,7 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start() break; } - register_sub(*ms, pstring::sprintf("Solver %d",m_mat_solvers.count())); + register_sub(*ms, pstring::sprintf("Solver_%d",m_mat_solvers.count())); ms->vsetup(groups[i]); diff --git a/src/emu/netlist/analog/nld_solver.h b/src/emu/netlist/analog/nld_solver.h index a0cdec5c786..44e5ccf0158 100644 --- a/src/emu/netlist/analog/nld_solver.h +++ b/src/emu/netlist/analog/nld_solver.h @@ -48,107 +48,6 @@ struct netlist_solver_parameters_t netlist_time m_nt_sync_delay; }; -class vector_ops_t -{ -public: - - vector_ops_t(int size) - : m_dim(size) - { - } - - virtual ~vector_ops_t() {} - - virtual const nl_double sum(const nl_double * v) = 0; - virtual void sum2(const nl_double * RESTRICT v1, const nl_double * RESTRICT v2, nl_double & RESTRICT s1, nl_double & RESTRICT s2) = 0; - virtual void addmult(nl_double * RESTRICT v1, const nl_double * RESTRICT v2, const nl_double &mult) = 0; - virtual void sum2a(const nl_double * RESTRICT v1, const nl_double * RESTRICT v2, const nl_double * RESTRICT v3abs, nl_double & RESTRICT s1, nl_double & RESTRICT s2, nl_double & RESTRICT s3abs) = 0; - - virtual const nl_double sumabs(const nl_double * v) = 0; - - static vector_ops_t *create_ops(const int size); - -protected: - int m_dim; - -private: - -}; - -template <int m_N> -class vector_ops_impl_t : public vector_ops_t -{ -public: - - vector_ops_impl_t() - : vector_ops_t(m_N) - { - } - - vector_ops_impl_t(int size) - : vector_ops_t(size) - { - nl_assert(m_N == 0); - } - - virtual ~vector_ops_impl_t() {} - - ATTR_HOT inline const int N() const { if (m_N == 0) return m_dim; else return m_N; } - - const nl_double sum(const nl_double * v) - { - const nl_double * RESTRICT vl = v; - nl_double tmp = 0.0; - for (int i=0; i < N(); i++) - tmp += vl[i]; - return tmp; - } - - void sum2(const nl_double * RESTRICT v1, const nl_double * RESTRICT v2, nl_double & RESTRICT s1, nl_double & RESTRICT s2) - { - const nl_double * RESTRICT v1l = v1; - const nl_double * RESTRICT v2l = v2; - for (int i=0; i < N(); i++) - { - s1 += v1l[i]; - s2 += v2l[i]; - } - } - - void addmult(nl_double * RESTRICT v1, const nl_double * RESTRICT v2, const nl_double &mult) - { - nl_double * RESTRICT v1l = v1; - const nl_double * RESTRICT v2l = v2; - for (int i=0; i < N(); i++) - { - v1l[i] += v2l[i] * mult; - } - } - - void sum2a(const nl_double * RESTRICT v1, const nl_double * RESTRICT v2, const nl_double * RESTRICT v3abs, nl_double & RESTRICT s1, nl_double & RESTRICT s2, nl_double & RESTRICT s3abs) - { - const nl_double * RESTRICT v1l = v1; - const nl_double * RESTRICT v2l = v2; - const nl_double * RESTRICT v3l = v3abs; - for (int i=0; i < N(); i++) - { - s1 += v1l[i]; - s2 += v2l[i]; - s3abs += fabs(v3l[i]); - } - } - - const nl_double sumabs(const nl_double * v) - { - const nl_double * RESTRICT vl = v; - nl_double tmp = 0.0; - for (int i=0; i < N(); i++) - tmp += fabs(vl[i]); - return tmp; - } - -private: -}; class ATTR_ALIGNED(64) terms_t { diff --git a/src/emu/netlist/devices/nld_4020.h b/src/emu/netlist/devices/nld_4020.h index 3ecf7923a38..10d5fa4e1da 100644 --- a/src/emu/netlist/devices/nld_4020.h +++ b/src/emu/netlist/devices/nld_4020.h @@ -47,7 +47,7 @@ NETLIB_SUBDEVICE(4020_sub, netlist_ttl_input_t m_IP; - netlist_state_t<UINT16> m_cnt; + UINT16 m_cnt; netlist_ttl_output_t m_Q[14]; ); diff --git a/src/emu/netlist/devices/nld_4066.c b/src/emu/netlist/devices/nld_4066.c index f512fdd598d..a7021d67345 100644 --- a/src/emu/netlist/devices/nld_4066.c +++ b/src/emu/netlist/devices/nld_4066.c @@ -20,10 +20,10 @@ NETLIB_RESET(4066) NETLIB_UPDATE(4066) { - nl_double sup = (m_supply.get()->vdd() - m_supply.get()->vss()); + nl_double sup = (m_supply->vdd() - m_supply->vss()); nl_double low = 0.45 * sup; nl_double high = 0.55 * sup; - nl_double in = INPANALOG(m_control) - m_supply.get()->vss(); + nl_double in = INPANALOG(m_control) - m_supply->vss(); nl_double rON = m_base_r * 5.0 / sup; nl_double R = -1.0; diff --git a/src/emu/netlist/devices/nld_4066.h b/src/emu/netlist/devices/nld_4066.h index 63bb7b764e3..d70b4047803 100644 --- a/src/emu/netlist/devices/nld_4066.h +++ b/src/emu/netlist/devices/nld_4066.h @@ -40,8 +40,8 @@ public: netlist_analog_input_t m_control; NETLIB_NAME(R) m_R; - netlist_state_t<NETLIB_NAME(vdd_vss) *>m_supply; - netlist_state_t<nl_double> m_base_r; + NETLIB_NAME(vdd_vss) *m_supply; + nl_double m_base_r; ); NETLIB_DEVICE(4066_dip, diff --git a/src/emu/netlist/devices/nld_74107.h b/src/emu/netlist/devices/nld_74107.h index 8f96841d3c0..150516a00c3 100644 --- a/src/emu/netlist/devices/nld_74107.h +++ b/src/emu/netlist/devices/nld_74107.h @@ -80,9 +80,9 @@ NETLIB_SUBDEVICE(74107Asub, netlist_ttl_output_t m_Q; netlist_ttl_output_t m_QQ; - netlist_state_t<netlist_sig_t> m_Q1; - netlist_state_t<netlist_sig_t> m_Q2; - netlist_state_t<netlist_sig_t> m_F; + netlist_sig_t m_Q1; + netlist_sig_t m_Q2; + netlist_sig_t m_F; ATTR_HOT void newstate(const netlist_sig_t state); diff --git a/src/emu/netlist/devices/nld_74123.h b/src/emu/netlist/devices/nld_74123.h index de030f38db4..a5c9f430577 100644 --- a/src/emu/netlist/devices/nld_74123.h +++ b/src/emu/netlist/devices/nld_74123.h @@ -59,9 +59,9 @@ public: netlist_analog_input_t m_CV; - netlist_state_t<netlist_sig_t> m_last_trig; - netlist_state_t<UINT8> m_state; - netlist_state_t<double> m_KP; + netlist_sig_t m_last_trig; + UINT8 m_state; + double m_KP; netlist_param_double_t m_K; netlist_param_double_t m_RI; diff --git a/src/emu/netlist/devices/nld_74153.h b/src/emu/netlist/devices/nld_74153.h index 5f633ef00f0..03c942f9a70 100644 --- a/src/emu/netlist/devices/nld_74153.h +++ b/src/emu/netlist/devices/nld_74153.h @@ -66,7 +66,7 @@ NETLIB_SUBDEVICE(74153sub, netlist_ttl_output_t m_Y; - netlist_state_t<int> m_chan; + int m_chan; ); NETLIB_DEVICE(74153, diff --git a/src/emu/netlist/devices/nld_74175.h b/src/emu/netlist/devices/nld_74175.h index 47b094f1ba2..08c825ca09e 100644 --- a/src/emu/netlist/devices/nld_74175.h +++ b/src/emu/netlist/devices/nld_74175.h @@ -50,8 +50,8 @@ NETLIB_SUBDEVICE(74175_sub, netlist_ttl_output_t m_Q[4]; netlist_ttl_output_t m_QQ[4]; - netlist_state_t<netlist_sig_t> m_clrq; - netlist_state_t<UINT8> m_data; + netlist_sig_t m_clrq; + UINT8 m_data; ); NETLIB_DEVICE(74175, diff --git a/src/emu/netlist/devices/nld_74192.h b/src/emu/netlist/devices/nld_74192.h index 2b5ba415940..036358db9b5 100644 --- a/src/emu/netlist/devices/nld_74192.h +++ b/src/emu/netlist/devices/nld_74192.h @@ -47,9 +47,9 @@ NETLIB_DEVICE(74192, netlist_ttl_input_t m_CU; netlist_ttl_input_t m_CD; - netlist_state_t<INT8> m_cnt; - netlist_state_t<UINT8> m_last_CU; - netlist_state_t<UINT8> m_last_CD; + INT8 m_cnt; + UINT8 m_last_CU; + UINT8 m_last_CD; netlist_ttl_output_t m_Q[4]; netlist_ttl_output_t m_BORROWQ; diff --git a/src/emu/netlist/devices/nld_74193.h b/src/emu/netlist/devices/nld_74193.h index fc2a7de8105..ffe92f5fd94 100644 --- a/src/emu/netlist/devices/nld_74193.h +++ b/src/emu/netlist/devices/nld_74193.h @@ -46,9 +46,9 @@ NETLIB_DEVICE(74193, netlist_ttl_input_t m_CU; netlist_ttl_input_t m_CD; - netlist_state_t<INT8> m_cnt; - netlist_state_t<UINT8> m_last_CU; - netlist_state_t<UINT8> m_last_CD; + INT8 m_cnt; + UINT8 m_last_CU; + UINT8 m_last_CD; netlist_ttl_output_t m_Q[4]; netlist_ttl_output_t m_BORROWQ; diff --git a/src/emu/netlist/devices/nld_7448.h b/src/emu/netlist/devices/nld_7448.h index f1b0fd7fcaa..2c06638f93a 100644 --- a/src/emu/netlist/devices/nld_7448.h +++ b/src/emu/netlist/devices/nld_7448.h @@ -49,7 +49,7 @@ NETLIB_SUBDEVICE(7448_sub, netlist_ttl_input_t m_D; netlist_ttl_input_t m_RBIQ; - netlist_state_t<UINT8> m_state; + UINT8 m_state; netlist_ttl_output_t m_a; netlist_ttl_output_t m_b; diff --git a/src/emu/netlist/devices/nld_7474.h b/src/emu/netlist/devices/nld_7474.h index 3452400dd54..d2d8ac08cf2 100644 --- a/src/emu/netlist/devices/nld_7474.h +++ b/src/emu/netlist/devices/nld_7474.h @@ -57,7 +57,7 @@ NETLIB_SUBDEVICE(7474sub, netlist_ttl_input_t m_CLK; - netlist_state_t<UINT8> m_nextD; + INT8 m_nextD; netlist_ttl_output_t m_Q; netlist_ttl_output_t m_QQ; diff --git a/src/emu/netlist/devices/nld_7483.h b/src/emu/netlist/devices/nld_7483.h index 82a3e2f4f8f..d2da6ecc517 100644 --- a/src/emu/netlist/devices/nld_7483.h +++ b/src/emu/netlist/devices/nld_7483.h @@ -55,7 +55,7 @@ NETLIB_DEVICE(7483, netlist_ttl_input_t m_B3; netlist_ttl_input_t m_B4; - netlist_state_t<UINT8> m_lastr; + UINT8 m_lastr; netlist_ttl_output_t m_S1; netlist_ttl_output_t m_S2; diff --git a/src/emu/netlist/devices/nld_7486.c b/src/emu/netlist/devices/nld_7486.c index 4eddfb828ef..301eb2dee2f 100644 --- a/src/emu/netlist/devices/nld_7486.c +++ b/src/emu/netlist/devices/nld_7486.c @@ -16,9 +16,10 @@ NETLIB_RESET(7486) { } +static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; + NETLIB_UPDATE(7486) { - static 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]); } diff --git a/src/emu/netlist/devices/nld_7490.h b/src/emu/netlist/devices/nld_7490.h index 1a83dbaa711..4b4d84ff612 100644 --- a/src/emu/netlist/devices/nld_7490.h +++ b/src/emu/netlist/devices/nld_7490.h @@ -80,9 +80,9 @@ NETLIB_DEVICE(7490, netlist_ttl_input_t m_A; netlist_ttl_input_t m_B; - netlist_state_t<UINT8> m_cnt; - netlist_state_t<UINT8> m_last_A; - netlist_state_t<UINT8> m_last_B; + UINT8 m_cnt; + UINT8 m_last_A; + UINT8 m_last_B; netlist_ttl_output_t m_Q[4]; ); diff --git a/src/emu/netlist/devices/nld_7493.h b/src/emu/netlist/devices/nld_7493.h index 4ff18ec9e18..8c856048a7c 100644 --- a/src/emu/netlist/devices/nld_7493.h +++ b/src/emu/netlist/devices/nld_7493.h @@ -73,7 +73,7 @@ NETLIB_SUBDEVICE(7493ff, netlist_ttl_input_t m_I; netlist_ttl_output_t m_Q; - netlist_state_t<UINT8> m_reset; + UINT8 m_reset; ); NETLIB_DEVICE(7493, diff --git a/src/emu/netlist/devices/nld_74ls629.h b/src/emu/netlist/devices/nld_74ls629.h index c32c0c283ad..c571b5c29ed 100644 --- a/src/emu/netlist/devices/nld_74ls629.h +++ b/src/emu/netlist/devices/nld_74ls629.h @@ -40,8 +40,8 @@ NETLIB_SUBDEVICE(SN74LS629clk, netlist_logic_output_t m_Y; netlist_time m_inc; - netlist_state_t<netlist_sig_t> m_enableq; - netlist_state_t<netlist_sig_t> m_out; + netlist_sig_t m_enableq; + netlist_sig_t m_out; ); NETLIB_DEVICE_WITH_PARAMS(SN74LS629, diff --git a/src/emu/netlist/devices/nld_82S16.c b/src/emu/netlist/devices/nld_82S16.c index 368a9060138..5a7328f0b86 100644 --- a/src/emu/netlist/devices/nld_82S16.c +++ b/src/emu/netlist/devices/nld_82S16.c @@ -84,7 +84,10 @@ NETLIB_START(82S16_dip) register_input("12", m_WEQ); register_input("13", m_DIN); - register_output("6", m_DOUTQ);} + register_output("6", m_DOUTQ); + + save(NLNAME(m_ram)); +} NETLIB_RESET(82S16_dip) { diff --git a/src/emu/netlist/devices/nld_82S16.h b/src/emu/netlist/devices/nld_82S16.h index 6992e252ca3..1d3c64e0ca6 100644 --- a/src/emu/netlist/devices/nld_82S16.h +++ b/src/emu/netlist/devices/nld_82S16.h @@ -33,7 +33,6 @@ NETLIB_DEVICE(82S16, - UINT8 m_ram[256]; netlist_ttl_input_t m_A[8]; netlist_ttl_input_t m_CE1Q; netlist_ttl_input_t m_CE2Q; @@ -41,6 +40,9 @@ NETLIB_DEVICE(82S16, netlist_ttl_input_t m_WEQ; netlist_ttl_input_t m_DIN; netlist_ttl_output_t m_DOUTQ; + + //netlist_state_t<UINT8[256]> m_ram; + UINT8 m_ram[256]; ); NETLIB_DEVICE_DERIVED(82S16_dip, 82S16, diff --git a/src/emu/netlist/devices/nld_9310.c b/src/emu/netlist/devices/nld_9310.c index 9d31f2cf13c..2f5a790cf6e 100644 --- a/src/emu/netlist/devices/nld_9310.c +++ b/src/emu/netlist/devices/nld_9310.c @@ -94,7 +94,7 @@ NETLIB_UPDATE(9310_sub) update_outputs(m_cnt); OUTLOGIC(m_RC, m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(20)); #else - switch (m_cnt.get()) + switch (m_cnt) { case MAXCNT - 1: m_cnt = MAXCNT; @@ -114,7 +114,7 @@ NETLIB_UPDATE(9310_sub) } else { - m_cnt = m_ABCD.get()->read_ABCD(); + m_cnt = m_ABCD->read_ABCD(); update_outputs_all(m_cnt, NLTIME_FROM_NS(22)); OUTLOGIC(m_RC, m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); } diff --git a/src/emu/netlist/devices/nld_9310.h b/src/emu/netlist/devices/nld_9310.h index 35d6f14a3c1..95e3061bdca 100644 --- a/src/emu/netlist/devices/nld_9310.h +++ b/src/emu/netlist/devices/nld_9310.h @@ -81,10 +81,10 @@ NETLIB_SUBDEVICE(9310_sub, netlist_ttl_input_t m_CLK; - netlist_state_t<UINT8> m_cnt; - netlist_state_t<NETLIB_NAME(9310_subABCD) *> m_ABCD; - netlist_state_t<netlist_sig_t> m_loadq; - netlist_state_t<netlist_sig_t> m_ent; + UINT8 m_cnt; + NETLIB_NAME(9310_subABCD) *m_ABCD; + netlist_sig_t m_loadq; + netlist_sig_t m_ent; netlist_ttl_output_t m_QA; netlist_ttl_output_t m_QB; diff --git a/src/emu/netlist/devices/nld_9312.c b/src/emu/netlist/devices/nld_9312.c index 2bdaf0714d5..1565a5dada9 100644 --- a/src/emu/netlist/devices/nld_9312.c +++ b/src/emu/netlist/devices/nld_9312.c @@ -20,7 +20,7 @@ */ #include "nld_9312.h" -//#if (USE_TRUTHTABLE) +#if (USE_TRUTHTABLE) nld_9312::truthtable_t nld_9312::m_ttbl; /* FIXME: Data changes are propagating faster than changing selects A,B,C @@ -50,13 +50,78 @@ const char *nld_9312::m_desc[] = { " 1, 1, 1, 0, X, X, X, X, X, X, X, 1| 1, 0|33,28", "" }; -//#endif +#endif + +NETLIB_UPDATE(9312) +{ + const UINT8 G = INPLOGIC(m_G); + if ((m_last_G ^ G) == 1) + { + static const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(19) }; + OUTLOGIC(m_Y, !G, delay[!G]); + OUTLOGIC(m_YQ, G, delay[G]); + if (G) + { + m_A.inactivate(); + m_B.inactivate(); + m_C.inactivate(); + } else { + m_A.activate(); + m_B.activate(); + m_C.activate(); + } + m_last_G = G; + } + if (!G) + { + 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) + { + m_D[m_last_chan].inactivate(); + m_D[chan].activate(); + } + const UINT8 val = INPLOGIC(m_D[chan]); + OUTLOGIC(m_Y, val, delay[val]); + OUTLOGIC(m_YQ, !val, delay[!val]); + m_last_chan = chan; + } +} + +NETLIB_START(9312) +{ + register_input("G", m_G); + register_input("A", m_A); + register_input("B", m_B); + register_input("C", m_C); + + register_input("D0", m_D[0]); + register_input("D1", m_D[1]); + register_input("D2", m_D[2]); + register_input("D3", m_D[3]); + register_input("D4", m_D[4]); + register_input("D5", m_D[5]); + register_input("D6", m_D[6]); + register_input("D7", m_D[7]); + + register_output("Y", m_Y); + register_output("YQ", m_YQ); + + m_last_chan = 0; + m_last_G = 0; +} + +NETLIB_RESET(9312) +{ +} NETLIB_START(9312_dip) { register_sub(m_sub, "1"); +#if (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]); @@ -73,6 +138,27 @@ NETLIB_START(9312_dip) register_subalias("15", m_sub.m_Q[0]); // Y register_subalias("14", m_sub.m_Q[1]); // YQ + +#else + + register_subalias("13", m_sub.m_C); + register_subalias("12", m_sub.m_B); + register_subalias("11", m_sub.m_A); + register_subalias("10", m_sub.m_G); + + register_subalias("1", m_sub.m_D[0]); + register_subalias("2", m_sub.m_D[1]); + register_subalias("3", m_sub.m_D[2]); + register_subalias("4", m_sub.m_D[3]); + register_subalias("5", m_sub.m_D[4]); + register_subalias("6", m_sub.m_D[5]); + register_subalias("7", m_sub.m_D[6]); + register_subalias("9", m_sub.m_D[7]); + + register_subalias("15", m_sub.m_Y); // Y + register_subalias("14", m_sub.m_YQ); // YQ + +#endif } NETLIB_UPDATE(9312_dip) diff --git a/src/emu/netlist/devices/nld_9312.h b/src/emu/netlist/devices/nld_9312.h index 677197d00cf..055419808dc 100644 --- a/src/emu/netlist/devices/nld_9312.h +++ b/src/emu/netlist/devices/nld_9312.h @@ -41,10 +41,27 @@ #define TTL_9312(_name) \ NET_REGISTER_DEV(9312, _name) -//#if (USE_TRUTHTABLE) +#if (USE_TRUTHTABLE) #include "nld_truthtable.h" NETLIB_TRUTHTABLE(9312, 12, 2, 0); -//#endif +#else + +NETLIB_DEVICE(9312, +public: +// C, B, A, G,D0,D1,D2,D3,D4,D5,D6,D7| Y,YQ + netlist_ttl_input_t m_A; + netlist_ttl_input_t m_B; + netlist_ttl_input_t m_C; + netlist_ttl_input_t m_G; + netlist_ttl_input_t m_D[8]; + netlist_ttl_output_t m_Y; + netlist_ttl_output_t m_YQ; + + UINT8 m_last_chan; + UINT8 m_last_G; +); + +#endif #define TTL_9312_DIP(_name) \ diff --git a/src/emu/netlist/devices/nld_9316.c b/src/emu/netlist/devices/nld_9316.c index 1de05bdd9bb..e62927f41bc 100644 --- a/src/emu/netlist/devices/nld_9316.c +++ b/src/emu/netlist/devices/nld_9316.c @@ -89,12 +89,7 @@ NETLIB_UPDATE(9316_sub) { if (m_loadq) { -#if 0 - m_cnt = (m_cnt < MAXCNT) ? m_cnt + 1 : 0; - update_outputs(m_cnt); - OUTLOGIC(m_RC, m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(20)); -#else - switch (m_cnt.get()) + switch (m_cnt) { case MAXCNT - 1: m_cnt = MAXCNT; @@ -109,12 +104,12 @@ NETLIB_UPDATE(9316_sub) default: m_cnt++; update_outputs(m_cnt); + break; } -#endif } else { - m_cnt = m_ABCD.get()->read_ABCD(); + m_cnt = m_ABCD->read_ABCD(); OUTLOGIC(m_RC, m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); update_outputs_all(m_cnt, NLTIME_FROM_NS(22)); } diff --git a/src/emu/netlist/devices/nld_9316.h b/src/emu/netlist/devices/nld_9316.h index 316face36d9..57de7efee51 100644 --- a/src/emu/netlist/devices/nld_9316.h +++ b/src/emu/netlist/devices/nld_9316.h @@ -85,16 +85,17 @@ NETLIB_SUBDEVICE(9316_sub, netlist_ttl_input_t m_CLK; - netlist_state_t<UINT8> m_cnt; - netlist_state_t<NETLIB_NAME(9316_subABCD) *> m_ABCD; - netlist_state_t<netlist_sig_t> m_loadq; - netlist_state_t<netlist_sig_t> m_ent; - netlist_ttl_output_t m_QA; netlist_ttl_output_t m_QB; netlist_ttl_output_t m_QC; netlist_ttl_output_t m_QD; netlist_ttl_output_t m_RC; + + UINT8 m_cnt; + NETLIB_NAME(9316_subABCD) *m_ABCD; + netlist_sig_t m_loadq; + netlist_sig_t m_ent; + ); NETLIB_DEVICE(9316, diff --git a/src/emu/netlist/devices/nld_legacy.h b/src/emu/netlist/devices/nld_legacy.h index f9e085bf65f..5ace1a82b90 100644 --- a/src/emu/netlist/devices/nld_legacy.h +++ b/src/emu/netlist/devices/nld_legacy.h @@ -46,7 +46,7 @@ NETLIB_DEVICE_WITH_PARAMS(nicDelay, netlist_param_int_t m_L_to_H; netlist_param_int_t m_H_to_L; - netlist_state_t<UINT8> m_last; + UINT8 m_last; ); diff --git a/src/emu/netlist/devices/nld_log.h b/src/emu/netlist/devices/nld_log.h index 700e38d22ec..bf0bbe31a0d 100644 --- a/src/emu/netlist/devices/nld_log.h +++ b/src/emu/netlist/devices/nld_log.h @@ -28,7 +28,7 @@ NETLIB_DEVICE(log, ~NETLIB_NAME(log)(); netlist_analog_input_t m_I; protected: - netlist_state_t<FILE *> m_file; + FILE * m_file; ); #define LOGD(_name, _I, _I2) \ diff --git a/src/emu/netlist/devices/nld_ne555.c b/src/emu/netlist/devices/nld_ne555.c index 3a3646a01c8..c360c1088e2 100644 --- a/src/emu/netlist/devices/nld_ne555.c +++ b/src/emu/netlist/devices/nld_ne555.c @@ -79,7 +79,7 @@ NETLIB_UPDATE(NE555) m_ff = false; } - bool out = (!INPLOGIC(m_RESET) ? false : m_ff.get()); + bool out = (!INPLOGIC(m_RESET) ? false : m_ff); if (m_last_out && !out) { diff --git a/src/emu/netlist/devices/nld_ne555.h b/src/emu/netlist/devices/nld_ne555.h index 1d70dc9e170..2d42675a386 100644 --- a/src/emu/netlist/devices/nld_ne555.h +++ b/src/emu/netlist/devices/nld_ne555.h @@ -37,8 +37,8 @@ NETLIB_DEVICE(NE555, netlist_analog_input_t m_TRIG; netlist_analog_output_t m_OUT; - netlist_state_t<bool> m_last_out; - netlist_state_t<bool> m_ff; + bool m_last_out; + bool m_ff; inline nl_double clamp(const nl_double v, const nl_double a, const nl_double b); diff --git a/src/emu/netlist/devices/nld_signal.h b/src/emu/netlist/devices/nld_signal.h index 965d1cd36d8..e73e941d8c2 100644 --- a/src/emu/netlist/devices/nld_signal.h +++ b/src/emu/netlist/devices/nld_signal.h @@ -148,7 +148,7 @@ public: ATTR_HOT ATTR_ALIGN void update() { - const netlist_time times[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22)}; + static const netlist_time times[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22)}; // FIXME: this check is needed because update is called during startup as well //if (m_active == 0 && netlist().use_deactivate()) diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h index 4ae3f9e0844..350e62cbffe 100644 --- a/src/emu/netlist/devices/nld_system.h +++ b/src/emu/netlist/devices/nld_system.h @@ -219,7 +219,7 @@ protected: ATTR_HOT ATTR_ALIGN void update_param(); private: - netlist_state_t<UINT8> m_last_state; + UINT8 m_last_state; }; diff --git a/src/emu/netlist/devices/nld_truthtable.h b/src/emu/netlist/devices/nld_truthtable.h index a503a77d856..62b8533d0f1 100644 --- a/src/emu/netlist/devices/nld_truthtable.h +++ b/src/emu/netlist/devices/nld_truthtable.h @@ -65,6 +65,7 @@ public: register_output(out[i].trim(), m_Q[i]); } } + m_ign = 0; setup_tt(); // FIXME: save state } @@ -191,18 +192,19 @@ public: UINT32 state = 0; for (int i = 0; i < m_NI; i++) { - m_i[i].activate(); + if ((m_ign & (1<<i)) != 0) + m_i[i].activate(); state |= (INPLOGIC(m_i[i]) << i); } const UINT32 nstate = state | (has_state ? (m_last_state << m_NI) : 0); const UINT32 out = m_ttp->m_outs[nstate] & ((1 << m_NO) - 1); - const UINT32 ign = m_ttp->m_outs[nstate] >> m_NO; + m_ign = m_ttp->m_outs[nstate] >> m_NO; if (has_state) m_last_state = (state << m_NO) | out; for (int i = 0; i < m_NI; i++) - if (ign & (1 << i)) + if (m_ign & (1 << i)) m_i[i].inactivate(); for (int i = 0; i < m_NO; i++) @@ -235,6 +237,7 @@ public: private: UINT32 m_last_state; + UINT32 m_ign; INT32 m_active; truthtable_t *m_ttp; diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index c0c46858777..8d2e2b42dc0 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -362,8 +362,9 @@ ATTR_COLD void netlist_base_t::log(const char *format, ...) const ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily) : netlist_object_t(DEVICE, afamily) #if (NL_KEEP_STATISTICS) - , total_time(0) - , stat_count(0) + , stat_total_time(0) + , stat_update_count(0) + , stat_call_count(0) #endif { } @@ -383,6 +384,14 @@ ATTR_COLD netlist_core_device_t::~netlist_core_device_t() { } +ATTR_COLD void netlist_core_device_t::start_dev() +{ +#if (NL_KEEP_STATISTICS) + netlist().m_started_devices.add(this, false); +#endif + start(); +} + ATTR_HOT ATTR_ALIGN const netlist_sig_t netlist_core_device_t::INPLOGIC_PASSIVE(netlist_logic_input_t &inp) { if (inp.state() != netlist_input_t::STATE_INP_PASSIVE) @@ -596,19 +605,20 @@ ATTR_COLD void netlist_net_t::save_register() netlist_object_t::save_register(); } -ATTR_HOT ATTR_ALIGN static inline void update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) +ATTR_HOT /*ATTR_ALIGN*/ static inline void update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) { + netlist_core_device_t &netdev = inp->netdev(); + inc_stat(netdev.stat_call_count); if ((inp->state() & mask) != 0) { - netlist_core_device_t &netdev = inp->netdev(); - begin_timing(netdev.total_time); - inc_stat(netdev.stat_count); + begin_timing(netdev.stat_total_time); + inc_stat(netdev.stat_update_count); netdev.update_dev(); - end_timing(netdev.total_time); + end_timing(netdev.stat_total_time); } } -ATTR_HOT ATTR_ALIGN inline void netlist_net_t::update_devs() +ATTR_HOT /*ATTR_ALIGN*/ inline void netlist_net_t::update_devs() { //assert(m_num_cons != 0); nl_assert(this->isRailNet()); diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index fb318a7ce70..7dbb80b7777 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -301,23 +301,6 @@ extern const netlist_logic_family_desc_t &netlist_family_CD4000; // ----------------------------------------------------------------------------- -// netlist_state_t -// ----------------------------------------------------------------------------- - -template< typename X> -class netlist_state_t { -public: - inline netlist_state_t() : m_x(static_cast<X>(0)) {} - inline netlist_state_t(const X& x_) : m_x(x_) {} - inline const X& get() const { return m_x; } - inline X& ref() { return m_x; } - inline operator const X&() const { return m_x; } - inline operator X&() { return m_x; } -private: - X m_x; -}; - -// ----------------------------------------------------------------------------- // netlist_object_t // ----------------------------------------------------------------------------- @@ -365,11 +348,6 @@ public: ATTR_COLD const pstring &name() const; PSTATE_INTERFACE_DECL() - template<typename C> ATTR_COLD void save(netlist_state_t<C> &state, - const pstring &stname) - { - save(state.ref(), stname); - } ATTR_HOT inline const type_t type() const { return m_objtype; } ATTR_HOT inline const family_t family() const { return m_family; } @@ -995,10 +973,7 @@ public: update(); #endif } - ATTR_HOT inline void start_dev() - { - start(); - } + ATTR_COLD void start_dev(); ATTR_HOT const netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp); @@ -1033,8 +1008,9 @@ public: #if (NL_KEEP_STATISTICS) /* stats */ - osd_ticks_t total_time; - INT32 stat_count; + osd_ticks_t stat_total_time; + INT32 stat_update_count; + INT32 stat_call_count; #endif #if USE_PMFDELEGATES @@ -1205,6 +1181,9 @@ public: pnamedlist_t<netlist_device_t *> m_devices; netlist_net_t::list_t m_nets; +#if (NL_KEEP_STATISTICS) + pnamedlist_t<netlist_core_device_t *> m_started_devices; +#endif protected: diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index 8387f7b2918..487bbae44b6 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -726,10 +726,10 @@ void netlist_setup_t::print_stats() const { #if (NL_KEEP_STATISTICS) { - for (netlist_device_t * const *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry)) + for (netlist_core_device_t * const *entry = netlist().m_started_devices.first(); entry != NULL; entry = netlist().m_started_devices.next(entry)) { //entry->object()->s - printf("Device %20s : %12d %15ld\n", (*entry)->name().cstr(), (*entry)->stat_count, (long int) (*entry)->total_time / ((*entry)->stat_count + 1)); + 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); diff --git a/src/emu/netlist/pstate.h b/src/emu/netlist/pstate.h index 3dad87c2333..0ec2f8ba4fd 100644 --- a/src/emu/netlist/pstate.h +++ b/src/emu/netlist/pstate.h @@ -16,13 +16,17 @@ // ---------------------------------------------------------------------------------------- #define PSTATE_INTERFACE_DECL() \ - template<typename C> ATTR_COLD void save(C &state, const pstring &stname); + template<typename C> ATTR_COLD void save(C &state, const pstring &stname); \ + template<typename C, std::size_t N> ATTR_COLD void save(C (&state)[N], const pstring &stname); \ + template<typename C> ATTR_COLD void save(C *state, const pstring &stname, const int count); #define PSTATE_INTERFACE(obj, manager, module) \ template<typename C> ATTR_COLD void obj::save(C &state, const pstring &stname) \ - { \ - manager->save_item(state, this, module + "." + stname); \ - } + { manager->save_item(state, this, module + "." + stname); } \ + template<typename C, std::size_t N> ATTR_COLD void obj::save(C (&state)[N], const pstring &stname) \ + { manager->save_state_ptr(module + "." + stname, nl_datatype<C>::type, this, sizeof(state[0]), N, &(state[0]), false); } \ + template<typename C> ATTR_COLD void obj::save(C *state, const pstring &stname, const int count) \ + { manager->save_state_ptr(module + "." + stname, nl_datatype<C>::type, this, sizeof(C), count, state, false); } enum pstate_data_type_e { NOT_SUPPORTED, @@ -140,9 +144,11 @@ public: inline const pstate_entry_t::list_t &save_list() const { return m_save; } -protected: + // FIXME: should be protected ATTR_COLD void save_state_ptr(const pstring &stname, const pstate_data_type_e, const void *owner, const int size, const int count, void *ptr, bool is_ptr); +protected: + private: pstate_entry_t::list_t m_save; }; diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c index 596a4930ea8..8df43358f10 100644 --- a/src/mame/drivers/harddriv.c +++ b/src/mame/drivers/harddriv.c @@ -5289,7 +5289,7 @@ GAME( 1990, racedrivcg4, racedriv, racedrivc_machine, racedrivc, driver_device, GAME( 1990, racedrivc2, racedriv, racedrivc1_machine, racedrivc, driver_device, 0,ROT0, "Atari Games", "Race Drivin' (compact, rev 2)", 0 ) GAME( 1990, racedrivc1, racedriv, racedrivc1_machine, racedrivc, driver_device, 0,ROT0, "Atari Games", "Race Drivin' (compact, rev 1)", 0 ) -GAMEL( 1990, racedrivpan, racedriv, racedriv_panorama_machine, racedriv_pan, driver_device, 0, ROT0, "Atari Games", "Race Drivin' Panorama (prototype, rev 2.1)", GAME_NOT_WORKING, layout_racedrivpan ) // picking roadster crashes the side monitors? +GAMEL( 1990, racedrivpan, racedriv, racedriv_panorama_machine, racedriv_pan, driver_device, 0, ROT0, "Atari Games", "Race Drivin' Panorama (prototype, rev 2.1)", 0, layout_racedrivpan ) GAME( 1991, steeltal, 0, steeltal_machine, steeltal, driver_device, 0, ROT0, "Atari Games", "Steel Talons (rev 2)", 0 ) GAME( 1991, steeltalg, steeltal, steeltal_machine, steeltal, driver_device, 0, ROT0, "Atari Games", "Steel Talons (German, rev 2)", 0 ) diff --git a/src/mame/drivers/nl_breakout.c b/src/mame/drivers/nl_breakout.c index 9768084d84c..947ca65cb8e 100644 --- a/src/mame/drivers/nl_breakout.c +++ b/src/mame/drivers/nl_breakout.c @@ -109,7 +109,7 @@ CIRCUIT_LAYOUT( breakout ) #else SOLVER(Solver, 48000) PARAM(Solver.ACCURACY, 1e-6) - PARAM(Solver.GS_THRESHOLD, 2) + PARAM(Solver.GS_THRESHOLD, 6) //PARAM(Solver.SOR_FACTOR, 1) #endif diff --git a/src/mame/drivers/ramtek.c b/src/mame/drivers/ramtek.c index 1acc131ed9a..db56a739839 100644 --- a/src/mame/drivers/ramtek.c +++ b/src/mame/drivers/ramtek.c @@ -9,7 +9,7 @@ Deluxe Baseball (1975/06) YES 550188 Hockey (1973/11) YES 500699 500629 Horoscope (1976) UNKNOWN - Knock Out (1974/09)? UNKNOWN + Knock Out (1974/09) YES 550300 Lie Detector (1976) UNKNOWN Unreleased Unreleased Sea Battle (1976/04) UNKNOWN Soccer (1973/11) YES 500880 500889 @@ -22,10 +22,10 @@ Game Name Clone Of --------------------------------------------------------------------------------- - Batter Up (1974/??) Deluxe Baseball (Ramtek, 1975/06) + Batter Up (1974/??) Baseball (1974/10) Crossfire (1974/01) (registered trademark?) Knock Out (Ramtek, 1974/09)? Countdown (1974/02) Wipe Out (Ramtek, 1974/01) - Elimination (1973/12?) (registered trademark?) unknown + 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) Hockey (Cocktail) (1973/??) Soccer (Ramtek, 1973/11) @@ -162,6 +162,13 @@ ROM_START( cleanswp ) ROM_LOAD( "501074.k3", 0x0000, 0x0020, CRC(515a34ba) SHA1(471ca9d99851591ff11a87d18b88871edd7fd268) ) // number character generation ROM_END +// Knockout - believed to be Knockout - XTAL is 10.733 MHz +/* contains 4 proms (soldered in) labelled : +5H - 55030604 +9C - 500399 +4B - 550306-02 +3B - 550306-03 +2B - 550306-01 */ ROM_START( ramtek3 ) // maybe Hockey? ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) diff --git a/src/mame/video/chihiro.c b/src/mame/video/chihiro.c index c9f11aaeb1a..3cc9175d0d7 100644 --- a/src/mame/video/chihiro.c +++ b/src/mame/video/chihiro.c @@ -494,8 +494,8 @@ int vertex_program_simulator::step() { int p1, p2; float tmp[3 * 4]; - float tmpv[4]; - float tmps[4]; + float tmpv[4] = { 0, 0, 0, 0}; + float tmps[4] = { 0, 0, 0, 0}; instruction::decoded *d; #if 0 // useful while debugging to see what instrucion is being executed diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index ec8755a8319..ff43e57257f 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -40,8 +40,8 @@ @29 HD38820A 1981, Coleco Pac-Man (ver 2) *32 HD38820A 198?, Gakken Super Cobra *38 HD38820A 1982, Entex Crazy Climber - *42 HD38820A 1982, Entex Stargate (have dump, +COP411 for audio) - *43 HD38820A 1982, Entex Turtles (have dump, +COP411 for audio) + @42 HD38820A 1982, Entex Stargate + @43 HD38820A 1982, Entex Turtles @45 HD38820A 1982, Coleco Donkey Kong @49 HD38820A 1983, Bandai Zackman @61 HD38820A 1983, Coleco Ms. Pac-Man @@ -69,6 +69,7 @@ #include "emu.h" #include "cpu/hmcs40/hmcs40.h" +#include "cpu/cop400/cop400.h" #include "sound/speaker.h" #include "hh_hmcs40_test.lh" // common test-layout - use external artwork @@ -1875,7 +1876,7 @@ WRITE16_MEMBER(egalaxn2_state::grid_w) m_inp_mux = data >> 1 & 0xf; // D1-D15: vfd matrix grid - m_grid = data >> 1; + m_grid = data >> 1 & 0x7fff; prepare_display(); } @@ -1967,7 +1968,7 @@ MACHINE_CONFIG_END NOTE!: MESS external artwork is recommended ***************************************************************************/ - +#if 0 class epacman2_state : public egalaxn2_state { public: @@ -1975,7 +1976,7 @@ public: : egalaxn2_state(mconfig, type, tag) { } }; - +#endif // handlers are identical to Galaxian 2, so we can use those // config @@ -2010,18 +2011,295 @@ static INPUT_PORTS_START( epacman2 ) PORT_CONFSETTING( 0x00, "2" ) INPUT_PORTS_END -static MACHINE_CONFIG_START( epacman2, epacman2_state ) + + + + +/*************************************************************************** + + Entex Turtles (manufactured in Japan) + * PCB label 560359 + * Hitachi QFP HD38820A43 MCU + * COP411L sub MCU, labeled COP411L-KED/N + * cyan/red/green VFD display NEC FIP15BM32T + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + +class eturtles_state : public hh_hmcs40_state +{ +public: + eturtles_state(const machine_config &mconfig, device_type type, const char *tag) + : hh_hmcs40_state(mconfig, type, tag), + m_cop_irq(0) + { } + + virtual void prepare_display(); + DECLARE_WRITE8_MEMBER(plate_w); + DECLARE_WRITE16_MEMBER(grid_w); + + UINT8 m_cop_irq; + DECLARE_WRITE_LINE_MEMBER(speaker_w); + DECLARE_WRITE8_MEMBER(cop_irq_w); + DECLARE_READ8_MEMBER(cop_latch_r); + DECLARE_READ8_MEMBER(cop_ack_r); + + void update_int(); + DECLARE_INPUT_CHANGED_MEMBER(input_changed); + +protected: + virtual void machine_start(); +}; + +// handlers (maincpu side first) + +void eturtles_state::prepare_display() +{ + UINT16 grid = BITSWAP16(m_grid,15,1,14,13,12,11,10,9,8,7,6,5,4,3,2,0); + UINT32 plate = BITSWAP32(m_plate,31,30,11,12,18,19,16,17,22,15,20,21,27,26,23,25,24,2,3,1,0,6,4,5,10,9,2,8,7,14,1,13); + display_matrix(30, 15, plate | (grid >> 5 & 8), grid); // grid 8 also forces plate 3 high +} + +WRITE8_MEMBER(eturtles_state::plate_w) +{ + m_r[offset] = data; + + // R0x-R6x: vfd matrix plate + int shift = offset * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + prepare_display(); +} + +WRITE16_MEMBER(eturtles_state::grid_w) +{ + m_d = data; + + // D1-D6: input mux + UINT8 inp_mux = data >> 1 & 0x3f; + if (inp_mux != m_inp_mux) + { + m_inp_mux = inp_mux; + update_int(); + } + + // D1-D15: vfd matrix grid + m_grid = data >> 1 & 0x7fff; + prepare_display(); +} + +void eturtles_state::update_int() +{ + // INT0/1 on multiplexed inputs, and from COP D0 + UINT8 inp = read_inputs(6); + set_interrupt(0, (inp & 1) | m_cop_irq); + set_interrupt(1, inp & 2); +} + + +// COP side + +WRITE_LINE_MEMBER(eturtles_state::speaker_w) +{ + // SK: speaker out + m_speaker->level_w(!state); +} + +WRITE8_MEMBER(eturtles_state::cop_irq_w) +{ + // D0: maincpu INT0 (active low) + m_cop_irq = ~data & 1; + update_int(); +} + +READ8_MEMBER(eturtles_state::cop_latch_r) +{ + // L0-L3: soundlatch from maincpu R0x + return m_r[0]; +} + +READ8_MEMBER(eturtles_state::cop_ack_r) +{ + // G0: ack from maincpu D0 + return m_d & 1; +} + + +// config + +static INPUT_PORTS_START( eturtles ) + PORT_START("IN.0") // D1 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + + PORT_START("IN.1") // D2 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + + PORT_START("IN.2") // D3 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + + PORT_START("IN.3") // D4 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + + PORT_START("IN.4") // D5 INT0/1 + PORT_CONFNAME( 0x01, 0x01, "Skill Level" ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_CONFSETTING( 0x01, "1" ) + PORT_CONFSETTING( 0x00, "2" ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + + PORT_START("IN.5") // D6 INT0/1 + PORT_CONFNAME( 0x03, 0x00, "Players" ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_CONFSETTING( 0x02, "0 (Demo)" ) + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x01, "2" ) +INPUT_PORTS_END + +INPUT_CHANGED_MEMBER(eturtles_state::input_changed) +{ + update_int(); +} + + +void eturtles_state::machine_start() +{ + hh_hmcs40_state::machine_start(); + + // register for savestates + save_item(NAME(m_cop_irq)); +} + +static MACHINE_CONFIG_START( eturtles, eturtles_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - MCFG_HMCS40_READ_R_CB(0, READ8(egalaxn2_state, input_r)) - MCFG_HMCS40_WRITE_R_CB(1, WRITE8(egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(2, WRITE8(egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(3, WRITE8(egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(4, WRITE8(egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(5, WRITE8(egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_R_CB(6, WRITE8(egalaxn2_state, plate_w)) - MCFG_HMCS40_WRITE_D_CB(WRITE16(egalaxn2_state, grid_w)) + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(eturtles_state, grid_w)) + + MCFG_CPU_ADD("audiocpu", COP411, 215000) // approximation + MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, COP400_MICROBUS_DISABLED) // guessed + MCFG_COP400_WRITE_SK_CB(WRITELINE(eturtles_state, speaker_w)) + MCFG_COP400_WRITE_D_CB(WRITE8(eturtles_state, cop_irq_w)) + MCFG_COP400_READ_L_CB(READ8(eturtles_state, cop_latch_r)) + MCFG_COP400_READ_G_CB(READ8(eturtles_state, cop_ack_r)) + + MCFG_QUANTUM_PERFECT_CPU("maincpu") + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + +/*************************************************************************** + + Entex Stargate (manufactured in Japan) + * PCB label 5603521/31 + * Hitachi QFP HD38820A42 MCU + * COP411L sub MCU, labeled ~/B8236 COP411L-KEC/N + * cyan/red/green VFD display NEC FIP15AM32T (EL628-003) no. 2-421, with partial color overlay + + NOTE!: MESS external artwork is recommended + +***************************************************************************/ + +class estargte_state : public eturtles_state +{ +public: + estargte_state(const machine_config &mconfig, device_type type, const char *tag) + : eturtles_state(mconfig, type, tag) + { } + + virtual void prepare_display(); + DECLARE_READ8_MEMBER(cop_data_r); +}; + +// handlers (most of it is handled in eturtles_state above) + +void estargte_state::prepare_display() +{ + UINT16 grid = BITSWAP16(m_grid,15,0,14,13,12,11,10,9,8,7,6,5,4,3,2,1); + UINT32 plate = BITSWAP32(m_plate,31,30,29,15,17,19,21,23,25,27,26,24,3,22,20,18,16,14,12,10,8,6,4,2,0,1,3,5,7,9,11,13); + display_matrix(29, 14, plate, grid); +} + +READ8_MEMBER(estargte_state::cop_data_r) +{ + // L0-L3: soundlatch from maincpu R0x + // L7: ack from maincpu D0 + return m_r[0] | (m_d << 7 & 0x80); +} + + +// config + +static INPUT_PORTS_START( estargte ) + PORT_START("IN.0") // D1 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) PORT_NAME("Inviso") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) PORT_NAME("Smart Bomb") + + PORT_START("IN.1") // D2 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) PORT_NAME("Fire") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) PORT_NAME("Change Direction") + + PORT_START("IN.2") // D3 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + + PORT_START("IN.3") // D4 INT0/1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) PORT_NAME("Thrust") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.4") // D5 INT0/1 + PORT_CONFNAME( 0x01, 0x00, "Players" ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_CONFSETTING( 0x00, "0 (Demo)" ) // yes, same value as 1-player, hold the Inviso button at boot to enter demo mode + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x01, "2" ) + PORT_CONFNAME( 0x02, 0x02, "Skill Level" ) PORT_CHANGED_MEMBER(DEVICE_SELF, eturtles_state, input_changed, NULL) + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x02, "2" ) + + PORT_START("IN.5") // D6 INT0/1 + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + +static MACHINE_CONFIG_START( estargte, estargte_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation + MCFG_HMCS40_WRITE_R_CB(0, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(eturtles_state, plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(eturtles_state, grid_w)) + + MCFG_CPU_ADD("audiocpu", COP411, 190000) // approximation + MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, COP400_MICROBUS_DISABLED) // guessed + MCFG_COP400_WRITE_SK_CB(WRITELINE(eturtles_state, speaker_w)) + MCFG_COP400_WRITE_D_CB(WRITE8(eturtles_state, cop_irq_w)) + MCFG_COP400_READ_L_CB(READ8(estargte_state, cop_data_r)) + + MCFG_QUANTUM_PERFECT_CPU("maincpu") MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) @@ -3104,6 +3382,26 @@ ROM_START( epacman2 ) ROM_END +ROM_START( estargte ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38820a42", 0x0000, 0x1000, CRC(5f6d55a6) SHA1(0da32149790fa5f16097338fc80536b462169e0c) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 0x0200, "audiocpu", 0 ) + ROM_LOAD( "cop411l-kec_n", 0x0000, 0x0200, CRC(fbd3c2d3) SHA1(65b8b24d38678c3fa970bfd639e9449a75a28927) ) +ROM_END + + +ROM_START( eturtles ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "hd38820a43", 0x0000, 0x1000, CRC(446aa4e2) SHA1(d1c0fb14ea7081def53b1174964b39eed1e5d5e6) ) + ROM_CONTINUE( 0x1e80, 0x0100 ) + + ROM_REGION( 0x0200, "audiocpu", 0 ) + ROM_LOAD( "cop411l-ked_n", 0x0000, 0x0200, CRC(503d26e9) SHA1(a53d24d62195bfbceff2e4a43199846e0950aef6) ) +ROM_END + + ROM_START( ghalien ) ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "hd38800a04", 0x0000, 0x1000, CRC(019c3328) SHA1(9f1029c5c479f78350952c4f18747341ba5ea7a0) ) @@ -3180,7 +3478,9 @@ CONS( 1981, cpacmanr1, cpacman, 0, cpacman, cpacman, driver_device, 0, "Colec CONS( 1983, cmspacmn, 0, 0, cmspacmn, cmspacmn, driver_device, 0, "Coleco", "Ms. Pac-Man (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1981, egalaxn2, 0, 0, egalaxn2, egalaxn2, driver_device, 0, "Entex", "Galaxian 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) -CONS( 1981, epacman2, 0, 0, epacman2, epacman2, driver_device, 0, "Entex", "Pac Man 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1981, epacman2, 0, 0, egalaxn2, epacman2, driver_device, 0, "Entex", "Pac Man 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1982, estargte, 0, 0, estargte, estargte, driver_device, 0, "Entex", "Stargate (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) +CONS( 1982, eturtles, 0, 0, eturtles, eturtles, driver_device, 0, "Entex", "Turtles (Entex)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1980, ghalien, 0, 0, ghalien, ghalien, driver_device, 0, "Gakken", "Heiankyo Alien (Gakken)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) CONS( 1982, gckong, 0, 0, gckong, gckong, driver_device, 0, "Gakken", "Crazy Kong (Gakken)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index 0bf1bfcebc4..a966d3f93c8 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -24,6 +24,7 @@ *MP1296 TMS1100? 1982, Entex Black Knight *MP1312 TMS1100 198?, Tandy/RadioShack Science Fair Microcomputer Trainer @MP1525 TMS1170 1980, Coleco Head to Head Baseball + *MP1604 ? 1981, Hanzawa Twinvader III/Tandy Cosmic Fire Away 3000 @MP2105 TMS1370 1979, Gakken Poker *MP2139 TMS1370? 1982, Gakken Galaxy Invader 1000 *MP2788 ? 1980, Bandai Flight Time (? note: VFD-capable) @@ -31,6 +32,7 @@ @MP3226 TMS1000 1978, Milton Bradley Simon (model 4850) @MP3301A TMS1000 1979, Milton Bradley Big Trak *MP3320A TMS1000 1979, Coleco Head to Head Basketball + *M32001 TMS1000 1981, Coleco Quiz Wiz Challenger (note: MP3398, MP3399, M3200x?) MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.c @MP3404 TMS1100 1978, Parker Brothers Merlin @MP3405 TMS1100 1979, Coleco Amaze-A-Tron @@ -45,10 +47,12 @@ @MP3476 TMS1100 1979, Milton Bradley Super Simon MP3479 TMS1100 1980, MicroVision cartridge: Baseball MP3481 TMS1100 1979, MicroVision cartridge: Connect Four + *MP3491 TMS1100 1980, Mattel Horserace Analyzer MP3496 TMS1100 1980, MicroVision cartridge: Sea Duel - M34009 TMS1100 1981, MicroVision cartridge: Alien Raiders (note: MP3498, MP3499, M34000, ..) + M34009 TMS1100 1981, MicroVision cartridge: Alien Raiders (note: MP3498, MP3499, M3400x..) M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster + *M34078A TMS1100 1983, Milton Bradley Arcade Mania @MP6100A TMS0980 1979, Ideal Electronic Detective @MP6101B TMS0980 1979, Parker Brothers Stop Thief *MP6361 ? 1983, Defender Strikes (? note: VFD-capable) @@ -894,7 +898,7 @@ MACHINE_CONFIG_END This is a head to head electronic tabletop LED-display sports console. One cartridge(Football) was included with the console, the other three were - sold separately. Gameplay has emphasis on strategy, read the official manual + sold in a pack. Gameplay has emphasis on strategy, read the official manual on how to play. Remember that you can rotate the view in MESS: rotate left for Home(P1) orientation, rotate right for Visitor(P2) orientation. diff --git a/src/mess/mess.lst b/src/mess/mess.lst index f7c729c90af..7f0831a93db 100644 --- a/src/mess/mess.lst +++ b/src/mess/mess.lst @@ -2203,6 +2203,8 @@ cpacmanr1 // Coleco (rev 1) cmspacmn // Coleco egalaxn2 // Entex epacman2 // Entex +estargte // Entex +eturtles // Entex ghalien // Gakken gckong // Gakken gdigdug // Gakken |