From 9f5d36fefaad002c5d719c35ceb0a97688ae838e Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 17 May 2023 10:13:23 +0200 Subject: smc1102: improve lcd timing --- src/devices/cpu/mn1400/mn1400.cpp | 7 ------- src/devices/cpu/mn1400/mn1400base.cpp | 7 +++++++ src/devices/cpu/tms1000/smc1102.cpp | 9 +++++++-- src/mame/handheld/hh_tms1k.cpp | 1 + src/mame/sega/315_5296.cpp | 9 +++++---- src/mame/sega/315_5296.h | 28 +++++++++++----------------- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/devices/cpu/mn1400/mn1400.cpp b/src/devices/cpu/mn1400/mn1400.cpp index 974e8a9393c..590c6ef1798 100644 --- a/src/devices/cpu/mn1400/mn1400.cpp +++ b/src/devices/cpu/mn1400/mn1400.cpp @@ -4,13 +4,6 @@ Matsushita MN1400, MN1405 -TODO: -- counter input pin (CSLCT and SNS1) -- are illegal opcodes 0x38/0xe0 and 0x39/0xe1 branch-always and branch-never? - right now they're implemented as such -- is branch emulation correct when near the end of a page? -- add other MCUs when needed - */ #include "emu.h" diff --git a/src/devices/cpu/mn1400/mn1400base.cpp b/src/devices/cpu/mn1400/mn1400base.cpp index 0db736add33..c9aa9c34cc0 100644 --- a/src/devices/cpu/mn1400/mn1400base.cpp +++ b/src/devices/cpu/mn1400/mn1400base.cpp @@ -31,6 +31,13 @@ MN1456A: MN1455 with double amount ROM/RAM MN148x: DAC for TV/VTR tuner MN1427: support for FM audio tuner +TODO: +- counter input pin (CSLCT and SNS1) +- are illegal opcodes 0x38/0xe0 and 0x39/0xe1 branch-always and branch-never? + right now they're implemented as such +- is branch emulation correct when near the end of a page? +- add other MCUs when needed + */ #include "emu.h" diff --git a/src/devices/cpu/tms1000/smc1102.cpp b/src/devices/cpu/tms1000/smc1102.cpp index 6e6b84ac7ec..cf8e1dceb6c 100644 --- a/src/devices/cpu/tms1000/smc1102.cpp +++ b/src/devices/cpu/tms1000/smc1102.cpp @@ -19,7 +19,6 @@ SMC1112 die notes (SMC1102 is assumed to be the same): - no output PLA TODO: -- LCD refresh timing is unknown - add (micro)instructions PLA if it turns out it can be customized - add halt opcode @@ -252,6 +251,13 @@ void smc1102_cpu_device::execute_run() } } + // overall, LCD refresh rate is 64Hz + if ((m_div & 0x1ff) == 0) + { + for (int i = 0; i < 4; i++) + m_write_segs(i, m_lcd_ram[i]); + } + // 4 cycles per opcode instead of 6 switch (m_subcycle) { @@ -309,7 +315,6 @@ void smc1102_cpu_device::op_tsg() { // TSG: transfer LCD S/R to RAM m_lcd_ram[m_opcode & 3] = m_lcd_sr; - m_write_segs(m_opcode & 3, m_lcd_sr); } void smc1102_cpu_device::op_intdis() diff --git a/src/mame/handheld/hh_tms1k.cpp b/src/mame/handheld/hh_tms1k.cpp index 2adb5d55450..1e9ee0d5734 100644 --- a/src/mame/handheld/hh_tms1k.cpp +++ b/src/mame/handheld/hh_tms1k.cpp @@ -75,6 +75,7 @@ on Joerg Woerner's datamath.org: http://www.datamath.org/IC_List.htm *MP0121 TMS1000 1979, Waddingtons Compute-A-Tune @MP0154 TMS1000 1979, Fonas 2 Player Baseball @MP0158 TMS1000 1979, Entex Soccer (6003) + *MP0159 TMS1000 1979, Tomy Volleyball @MP0163 TMS1000 1979, A-One LSI Match Number/LJN Electronic Concentration @MP0166 TMS1000 1980, A-One Arrange Ball/LJN Computer Impulse/Tandy Zingo (model 60-2123) @MP0168 TMS1000 1979, Conic Multisport/Tandy Sports Arena (model 60-2158) diff --git a/src/mame/sega/315_5296.cpp b/src/mame/sega/315_5296.cpp index 99d28a3b6fd..532147ccfbb 100644 --- a/src/mame/sega/315_5296.cpp +++ b/src/mame/sega/315_5296.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:hap, Charles MacDonald +// copyright-holders:hap +// thanks-to:Charles MacDonald /********************************************************************** Sega 315-5296 I/O chip @@ -32,7 +33,7 @@ DEFINE_DEVICE_TYPE(SEGA_315_5296, sega_315_5296_device, "315_5296", "Sega 315-52 // sega_315_5296_device - constructor //------------------------------------------------- -sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : +sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, SEGA_315_5296, tag, owner, clock), m_in_port_cb(*this), m_out_port_cb(*this), @@ -81,7 +82,7 @@ void sega_315_5296_device::device_reset() //------------------------------------------------- -uint8_t sega_315_5296_device::read(offs_t offset) +u8 sega_315_5296_device::read(offs_t offset) { offset &= 0x3f; @@ -122,7 +123,7 @@ uint8_t sega_315_5296_device::read(offs_t offset) } -void sega_315_5296_device::write(offs_t offset, uint8_t data) +void sega_315_5296_device::write(offs_t offset, u8 data) { offset &= 0x3f; diff --git a/src/mame/sega/315_5296.h b/src/mame/sega/315_5296.h index 36e78c32253..377c53c7124 100644 --- a/src/mame/sega/315_5296.h +++ b/src/mame/sega/315_5296.h @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:hap, Charles MacDonald +// copyright-holders:hap +// thanks-to:Charles MacDonald /********************************************************************** Sega 315-5296 I/O chip @@ -12,17 +13,10 @@ #pragma once - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> sega_315_5296_device - class sega_315_5296_device : public device_t { public: - sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // configuration helpers auto in_pa_callback() { return m_in_port_cb[0].bind(); } @@ -47,12 +41,12 @@ public: auto out_cnt1_callback() { return m_out_cnt_cb[1].bind(); } auto out_cnt2_callback() { return m_out_cnt_cb[2].bind(); } - void set_ddr_override(uint8_t mask) { m_dir_override = mask; } + void set_ddr_override(u8 mask) { m_dir_override = mask; } - uint8_t read(offs_t offset); - void write(offs_t offset, uint8_t data); + u8 read(offs_t offset); + void write(offs_t offset, u8 data); - uint8_t debug_peek_output(offs_t offset) const { return m_output_latch[offset & 7]; } + u8 debug_peek_output(offs_t offset) const { return m_output_latch[offset & 7]; } protected: // device-level overrides @@ -64,10 +58,10 @@ private: devcb_write8::array<8> m_out_port_cb; devcb_write_line::array<3> m_out_cnt_cb; - uint8_t m_output_latch[8]; - uint8_t m_cnt; - uint8_t m_dir; - uint8_t m_dir_override; + u8 m_output_latch[8]; + u8 m_cnt; + u8 m_dir; + u8 m_dir_override; }; // device type definition -- cgit v1.2.3