From d502e18d24ca2e2424175307386e262c37f8b5f5 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 5 Nov 2019 21:05:27 -0500 Subject: st2xxx: Add many more register stubs (nw) --- src/devices/cpu/m6502/st2204.cpp | 69 ++++++++++++++++++++++++++++++++ src/devices/cpu/m6502/st2204.h | 21 +++++++++- src/devices/cpu/m6502/st2205u.cpp | 65 ++++++++++++++++++++++++++++++ src/devices/cpu/m6502/st2205u.h | 23 ++++++++++- src/devices/cpu/m6502/st2xxx.cpp | 83 +++++++++++++++++++++++++++++++++++++++ src/devices/cpu/m6502/st2xxx.h | 38 +++++++++++++++++- 6 files changed, 296 insertions(+), 3 deletions(-) diff --git a/src/devices/cpu/m6502/st2204.cpp b/src/devices/cpu/m6502/st2204.cpp index 7bea561baf4..222e3790b6f 100644 --- a/src/devices/cpu/m6502/st2204.cpp +++ b/src/devices/cpu/m6502/st2204.cpp @@ -38,6 +38,8 @@ st2204_device::st2204_device(const machine_config &mconfig, const char *tag, dev address_map_constructor(FUNC(st2204_device::int_map), this), 26, // logical; only 23 address lines are brought out false) + , m_tmode{0} + , m_tcntr{0} , m_dms(0) , m_dmd(0) , m_dcnth(0) @@ -58,6 +60,8 @@ void st2204_device::device_start() init_base_timer(0x0020); + save_item(NAME(m_tmode)); + save_item(NAME(m_tcntr)); save_item(NAME(m_dms)); save_item(NAME(m_dmd)); save_item(NAME(m_dcnth)); @@ -85,11 +89,22 @@ void st2204_device::device_start() state_add(ST_PMCR, "PMCR", m_pmcr); state_add(ST_BTEN, "BTEN", [this]() { return m_bten; }, [this](u8 data) { bten_w(data); }).mask(0x1f); state_add(ST_BTSR, "BTSR", m_btsr).mask(0x1f); + state_add(ST_T0M, "T0M", m_tmode[0]).mask(0x37); + state_add(ST_T0C, "T0C", m_tcntr[0]); + state_add(ST_T1M, "T1M", m_tmode[1]).mask(0x1f); + state_add(ST_T1C, "T1C", m_tcntr[1]); state_add(ST_SYS, "SYS", [this]() { return m_sys; }, [this](u8 data) { sys_w(data); }); + state_add(ST_MISC, "MISC", m_misc).mask(st2xxx_misc_mask()); state_add(ST_LSSA, "LSSA", m_lssa); state_add(ST_LVPW, "LVPW", m_lvpw); state_add(ST_LXMAX, "LXMAX", m_lxmax); state_add(ST_LYMAX, "LYMAX", m_lymax); + state_add(ST_LPAN, "LPAN", m_lpan).mask(st2xxx_lpan_mask()); + state_add(ST_LCTR, "LCTR", m_lctr).mask(st2xxx_lctr_mask()); + state_add(ST_LCKR, "LCKR", m_lckr).mask(st2xxx_lckr_mask()); + state_add(ST_LFRA, "LFRA", m_lfra).mask(0x3f); + state_add(ST_LAC, "LAC", m_lac).mask(0x1f); + state_add(ST_LPWM, "LPWM", m_lpwm).mask(st2xxx_lpwm_mask()); state_add(ST_DMS, "DMS", m_dms); state_add(ST_DMR, "DMR", downcast(*mintf).dmr).mask(0x7ff); state_add(ST_DMD, "DMD", m_dmd); @@ -98,6 +113,9 @@ void st2204_device::device_start() void st2204_device::device_reset() { st2xxx_device::device_reset(); + + m_tmode[0] = m_tmode[1] = 0; + m_tcntr[0] = m_tcntr[1] = 0; } const char *st2204_device::st2xxx_irq_name(int i) const @@ -204,6 +222,46 @@ unsigned st2204_device::st2xxx_bt_divider(int n) const return 0; } +u8 st2204_device::t0m_r() +{ + return m_tmode[0]; +} + +void st2204_device::t0m_w(u8 data) +{ + m_tmode[0] = data & 0x37; +} + +u8 st2204_device::t0c_r() +{ + return m_tcntr[0]; +} + +void st2204_device::t0c_w(u8 data) +{ + m_tcntr[0] = data; +} + +u8 st2204_device::t1m_r() +{ + return m_tmode[1]; +} + +void st2204_device::t1m_w(u8 data) +{ + m_tmode[1] = data & 0x1f; +} + +u8 st2204_device::t1c_r() +{ + return m_tcntr[1]; +} + +void st2204_device::t1c_w(u8 data) +{ + m_tcntr[1] = data; +} + u8 st2204_device::dmsl_r() { return m_dms & 0xff; @@ -304,6 +362,10 @@ void st2204_device::int_map(address_map &map) map(0x000f, 0x000f).rw(FUNC(st2204_device::pmcr_r), FUNC(st2204_device::pmcr_w)); map(0x0020, 0x0020).rw(FUNC(st2204_device::bten_r), FUNC(st2204_device::bten_w)); map(0x0021, 0x0021).rw(FUNC(st2204_device::btsr_r), FUNC(st2204_device::btclr_all_w)); + map(0x0024, 0x0024).rw(FUNC(st2204_device::t0m_r), FUNC(st2204_device::t0m_w)); + map(0x0025, 0x0025).rw(FUNC(st2204_device::t0c_r), FUNC(st2204_device::t0c_w)); + map(0x0026, 0x0026).rw(FUNC(st2204_device::t1m_r), FUNC(st2204_device::t1m_w)); + map(0x0027, 0x0027).rw(FUNC(st2204_device::t1c_r), FUNC(st2204_device::t1c_w)); // Source/destination registers are not readable on ST2202, but may be readable here (count register isn't) map(0x0028, 0x0028).rw(FUNC(st2204_device::dmsl_r), FUNC(st2204_device::dmsl_w)); map(0x0029, 0x0029).rw(FUNC(st2204_device::dmsh_r), FUNC(st2204_device::dmsh_w)); @@ -319,6 +381,7 @@ void st2204_device::int_map(address_map &map) map(0x0035, 0x0035).rw(FUNC(st2204_device::drrh_r), FUNC(st2204_device::drrh_w)); map(0x0036, 0x0036).rw(FUNC(st2204_device::dmrl_r), FUNC(st2204_device::dmrl_w)); map(0x0037, 0x0037).rw(FUNC(st2204_device::dmrh_r), FUNC(st2204_device::dmrh_w)); + map(0x0038, 0x0038).rw(FUNC(st2204_device::misc_r), FUNC(st2204_device::misc_w)); map(0x003c, 0x003c).rw(FUNC(st2204_device::ireql_r), FUNC(st2204_device::ireql_w)); map(0x003d, 0x003d).rw(FUNC(st2204_device::ireqh_r), FUNC(st2204_device::ireqh_w)); map(0x003e, 0x003e).rw(FUNC(st2204_device::ienal_r), FUNC(st2204_device::ienal_w)); @@ -328,6 +391,12 @@ void st2204_device::int_map(address_map &map) map(0x0042, 0x0042).w(FUNC(st2204_device::lvpw_w)); map(0x0043, 0x0043).rw(FUNC(st2204_device::lxmax_r), FUNC(st2204_device::lxmax_w)); map(0x0044, 0x0044).rw(FUNC(st2204_device::lymax_r), FUNC(st2204_device::lymax_w)); + map(0x0045, 0x0045).rw(FUNC(st2204_device::lpan_r), FUNC(st2204_device::lpan_w)); + map(0x0047, 0x0047).rw(FUNC(st2204_device::lctr_r), FUNC(st2204_device::lctr_w)); + map(0x0048, 0x0048).w(FUNC(st2204_device::lckr_w)); + map(0x0049, 0x0049).w(FUNC(st2204_device::lfra_w)); + map(0x004a, 0x004a).rw(FUNC(st2204_device::lac_r), FUNC(st2204_device::lac_w)); + map(0x004b, 0x004b).rw(FUNC(st2204_device::lpwm_r), FUNC(st2204_device::lpwm_w)); map(0x004c, 0x004c).rw(FUNC(st2204_device::pl_r), FUNC(st2204_device::pl_w)); map(0x004e, 0x004e).w(FUNC(st2204_device::pcl_w)); map(0x0080, 0x287f).ram(); // 2800-287F possibly not present in earlier versions diff --git a/src/devices/cpu/m6502/st2204.h b/src/devices/cpu/m6502/st2204.h index fbc1f69563d..d0e2fa48358 100644 --- a/src/devices/cpu/m6502/st2204.h +++ b/src/devices/cpu/m6502/st2204.h @@ -17,7 +17,11 @@ class st2204_device : public st2xxx_device { public: enum { - ST_DMS = ST_LYMAX + 1, + ST_T0M = ST_LPWM + 1, + ST_T0C, + ST_T1M, + ST_T1C, + ST_DMS, ST_DMD }; @@ -31,7 +35,12 @@ protected: virtual const char *st2xxx_irq_name(int i) const override; virtual unsigned st2xxx_bt_divider(int n) const override; virtual u8 st2xxx_sys_mask() const override { return 0xff; } + virtual u8 st2xxx_misc_mask() const override { return 0x1f; } virtual bool st2xxx_has_dma() const override { return true; } + virtual u8 st2xxx_lpan_mask() const override { return 0x07; } + virtual u8 st2xxx_lctr_mask() const override { return 0xff; } + virtual u8 st2xxx_lckr_mask() const override { return 0x1f; } + virtual u8 st2xxx_lpwm_mask() const override { return 0x3f; } private: class mi_st2204 : public mi_st2xxx { @@ -53,6 +62,14 @@ private: u8 pmcr_r(); void pmcr_w(u8 data); + u8 t0m_r(); + void t0m_w(u8 data); + u8 t0c_r(); + void t0c_w(u8 data); + u8 t1m_r(); + void t1m_w(u8 data); + u8 t1c_r(); + void t1c_w(u8 data); u8 dmsl_r(); void dmsl_w(u8 data); u8 dmsh_r(); @@ -71,6 +88,8 @@ private: void int_map(address_map &map); + u8 m_tmode[2]; + u8 m_tcntr[2]; u16 m_dms; u16 m_dmd; u8 m_dcnth; diff --git a/src/devices/cpu/m6502/st2205u.cpp b/src/devices/cpu/m6502/st2205u.cpp index 180300cdb64..98fc82be705 100644 --- a/src/devices/cpu/m6502/st2205u.cpp +++ b/src/devices/cpu/m6502/st2205u.cpp @@ -41,6 +41,9 @@ st2205u_device::st2205u_device(const machine_config &mconfig, const char *tag, d 26, // logical; only 23 address lines are brought out true) , m_btc(0) + , m_tc_12bit{0} + , m_t4c(0) + , m_tien(0) , m_lvctr(0) { } @@ -61,6 +64,10 @@ void st2205u_device::device_start() init_base_timer(0x0040); save_item(NAME(m_btc)); + save_item(NAME(m_tc_12bit)); + save_item(NAME(m_t4c)); + save_item(NAME(m_tien)); + save_item(NAME(m_lvctr)); save_item(NAME(intf->brr)); save_pointer(NAME(intf->ram), 0x8000); @@ -86,14 +93,25 @@ void st2205u_device::device_start() state_add(ST_PDL, "PDL", m_pdata[6]); state_add(ST_PCL, "PCL", m_pctrl[6]); state_add(ST_PMCR, "PMCR", m_pmcr); + state_add(ST_MISC, "MISC", m_misc).mask(st2xxx_misc_mask()); state_add(ST_SYS, "SYS", [this]() { return m_sys; }, [this](u8 data) { sys_w(data); }).mask(0xfe); state_add(ST_BTEN, "BTEN", [this]() { return m_bten; }, [this](u8 data) { bten_w(data); }); state_add(ST_BTSR, "BTREQ", m_btsr); state_add(ST_BTC, "BTC", m_btc); + for (int i = 0; i < 4; i++) + state_add(ST_T0C + i, string_format("T%dC", i).c_str(), m_tc_12bit[i]); + state_add(ST_T4C, "T4C", m_t4c); + state_add(ST_TIEN, "TIEN", m_tien); state_add(ST_LSSA, "LSSA", m_lssa); state_add(ST_LVPW, "LVPW", m_lvpw); state_add(ST_LXMAX, "LXMAX", m_lxmax); state_add(ST_LYMAX, "LYMAX", m_lymax); + state_add(ST_LPAN, "LPAN", m_lpan).mask(st2xxx_lpan_mask()); + state_add(ST_LCTR, "LCTR", m_lctr).mask(st2xxx_lctr_mask()); + state_add(ST_LCKR, "LCKR", m_lckr).mask(st2xxx_lckr_mask()); + state_add(ST_LFRA, "LFRA", m_lfra).mask(0x3f); + state_add(ST_LAC, "LAC", m_lac).mask(0x1f); + state_add(ST_LPWM, "LPWM", m_lpwm).mask(st2xxx_lpwm_mask()); state_add(ST_LVCTR, "LVCTR", m_lvctr).mask(0x0f); } @@ -105,6 +123,10 @@ void st2205u_device::device_reset() m_btc = 0; + std::fill(std::begin(m_tc_12bit), std::end(m_tc_12bit), 0); + m_t4c = 0; + m_tien = 0; + m_lvctr = 0; } @@ -292,6 +314,39 @@ void st2205u_device::btc_w(u8 data) m_btc = data; } +u8 st2205u_device::tc_12bit_r(offs_t offset) +{ + return (m_tc_12bit[offset >> 1] >> (BIT(offset, 0) ? 8 : 0)) & 0x00ff; +} + +void st2205u_device::tc_12bit_w(offs_t offset, u8 data) +{ + if (BIT(offset, 0)) + m_tc_12bit[offset >> 1] = (m_tc_12bit[offset >> 1] & 0x00ff) | u16(data) << 8; + else + m_tc_12bit[offset >> 1] = (m_tc_12bit[offset >> 1] & 0xff00) | data; +} + +u8 st2205u_device::t4c_r() +{ + return m_t4c; +} + +void st2205u_device::t4c_w(u8 data) +{ + m_t4c = data; +} + +u8 st2205u_device::tien_r() +{ + return m_tien; +} + +void st2205u_device::tien_w(u8 data) +{ + m_tien = data; +} + u8 st2205u_device::lvctr_r() { return m_lvctr | 0x01; @@ -350,9 +405,12 @@ void st2205u_device::int_map(address_map &map) map(0x0008, 0x000d).rw(FUNC(st2205u_device::pctrl_r), FUNC(st2205u_device::pctrl_w)); map(0x000e, 0x000e).rw(FUNC(st2205u_device::pfc_r), FUNC(st2205u_device::pfc_w)); map(0x000f, 0x000f).rw(FUNC(st2205u_device::pfd_r), FUNC(st2205u_device::pfd_w)); + map(0x0020, 0x0027).rw(FUNC(st2205u_device::tc_12bit_r), FUNC(st2205u_device::tc_12bit_w)); + map(0x0028, 0x0028).rw(FUNC(st2205u_device::tien_r), FUNC(st2205u_device::tien_w)); map(0x002a, 0x002a).rw(FUNC(st2205u_device::bten_r), FUNC(st2205u_device::bten_w)); map(0x002b, 0x002b).rw(FUNC(st2205u_device::btsr_r), FUNC(st2205u_device::btclr_w)); map(0x002c, 0x002c).rw(FUNC(st2205u_device::btc_r), FUNC(st2205u_device::btc_w)); + map(0x002d, 0x002d).rw(FUNC(st2205u_device::t4c_r), FUNC(st2205u_device::t4c_w)); map(0x0030, 0x0030).rw(FUNC(st2205u_device::irrl_r), FUNC(st2205u_device::irrl_w)); map(0x0031, 0x0031).rw(FUNC(st2205u_device::irrh_r), FUNC(st2205u_device::irrh_w)); map(0x0032, 0x0032).rw(FUNC(st2205u_device::prrl_r), FUNC(st2205u_device::prrl_w)); @@ -361,6 +419,7 @@ void st2205u_device::int_map(address_map &map) map(0x0035, 0x0035).rw(FUNC(st2205u_device::drrh_r), FUNC(st2205u_device::drrh_w)); map(0x0036, 0x0036).rw(FUNC(st2205u_device::brrl_r), FUNC(st2205u_device::brrl_w)); map(0x0037, 0x0037).rw(FUNC(st2205u_device::brrh_r), FUNC(st2205u_device::brrh_w)); + map(0x0038, 0x0038).rw(FUNC(st2205u_device::misc_r), FUNC(st2205u_device::misc_w)); map(0x0039, 0x0039).rw(FUNC(st2205u_device::sys_r), FUNC(st2205u_device::sys_w)); map(0x003a, 0x003a).rw(FUNC(st2205u_device::pmcr_r), FUNC(st2205u_device::pmcr_w)); map(0x003c, 0x003c).rw(FUNC(st2205u_device::ireql_r), FUNC(st2205u_device::ireql_w)); @@ -372,6 +431,12 @@ void st2205u_device::int_map(address_map &map) map(0x0042, 0x0042).w(FUNC(st2205u_device::lvpw_w)); map(0x0043, 0x0043).rw(FUNC(st2205u_device::lxmax_r), FUNC(st2205u_device::lxmax_w)); map(0x0044, 0x0044).rw(FUNC(st2205u_device::lymax_r), FUNC(st2205u_device::lymax_w)); + map(0x0045, 0x0045).rw(FUNC(st2205u_device::lpan_r), FUNC(st2205u_device::lpan_w)); + map(0x0047, 0x0047).rw(FUNC(st2205u_device::lctr_r), FUNC(st2205u_device::lctr_w)); + map(0x0048, 0x0048).w(FUNC(st2205u_device::lckr_w)); + map(0x0049, 0x0049).w(FUNC(st2205u_device::lfra_w)); + map(0x004a, 0x004a).rw(FUNC(st2205u_device::lac_r), FUNC(st2205u_device::lac_w)); + map(0x004b, 0x004b).rw(FUNC(st2205u_device::lpwm_r), FUNC(st2205u_device::lpwm_w)); map(0x004e, 0x004e).rw(FUNC(st2205u_device::pl_r), FUNC(st2205u_device::pl_w)); map(0x004f, 0x004f).rw(FUNC(st2205u_device::pcl_r), FUNC(st2205u_device::pcl_w)); map(0x0057, 0x0057).rw(FUNC(st2205u_device::lvctr_r), FUNC(st2205u_device::lvctr_w)); diff --git a/src/devices/cpu/m6502/st2205u.h b/src/devices/cpu/m6502/st2205u.h index 5eafabb9c74..9d9958873ea 100644 --- a/src/devices/cpu/m6502/st2205u.h +++ b/src/devices/cpu/m6502/st2205u.h @@ -17,7 +17,13 @@ class st2205u_device : public st2xxx_device { public: enum { - ST_BTC = ST_LYMAX + 1, + ST_BTC = ST_LPWM + 1, + ST_T0C, + ST_T1C, + ST_T2C, + ST_T3C, + ST_T4C, + ST_TIEN, ST_BRR, ST_LVCTR }; @@ -32,7 +38,13 @@ protected: virtual const char *st2xxx_irq_name(int i) const override; virtual unsigned st2xxx_bt_divider(int n) const override; virtual u8 st2xxx_sys_mask() const override { return 0xfe; } + virtual u8 st2xxx_misc_mask() const override { return 0x0f; } + virtual bool st2xxx_wdten_on_reset() const override { return true; } virtual bool st2xxx_has_dma() const override { return true; } + virtual u8 st2xxx_lpan_mask() const override { return 0x0f; } + virtual u8 st2xxx_lctr_mask() const override { return 0xef; } + virtual u8 st2xxx_lckr_mask() const override { return 0x3f; } + virtual u8 st2xxx_lpwm_mask() const override { return 0xff; } private: class mi_st2205u : public mi_st2xxx { @@ -68,6 +80,12 @@ private: void pmcr_w(u8 data); u8 btc_r(); void btc_w(u8 data); + u8 tc_12bit_r(offs_t offset); + void tc_12bit_w(offs_t offset, u8 data); + u8 t4c_r(); + void t4c_w(u8 data); + u8 tien_r(); + void tien_w(u8 data); u8 lvctr_r(); void lvctr_w(u8 data); @@ -83,6 +101,9 @@ private: void int_map(address_map &map); u8 m_btc; + u16 m_tc_12bit[4]; + u8 m_t4c; + u8 m_tien; u8 m_lvctr; }; diff --git a/src/devices/cpu/m6502/st2xxx.cpp b/src/devices/cpu/m6502/st2xxx.cpp index 8cb901bcd2d..b8cad3534e2 100644 --- a/src/devices/cpu/m6502/st2xxx.cpp +++ b/src/devices/cpu/m6502/st2xxx.cpp @@ -50,12 +50,19 @@ st2xxx_device::st2xxx_device(const machine_config &mconfig, device_type type, co , m_bt_mask(0) , m_bt_ireq(0) , m_sys(0) + , m_misc(0) , m_ireq(0) , m_iena(0) , m_lssa(0) , m_lvpw(0) , m_lxmax(0) , m_lymax(0) + , m_lpan(0) + , m_lctr(0) + , m_lckr(0) + , m_lfra(0) + , m_lac(0) + , m_lpwm(0) { program_config.m_internal_map = std::move(internal_map); } @@ -143,12 +150,21 @@ void st2xxx_device::save_common_registers() save_item(NAME(m_btsr)); } save_item(NAME(m_sys)); + if (st2xxx_misc_mask() != 0) + save_item(NAME(m_misc)); save_item(NAME(m_ireq)); save_item(NAME(m_iena)); save_item(NAME(m_lssa)); save_item(NAME(m_lvpw)); save_item(NAME(m_lxmax)); save_item(NAME(m_lymax)); + if (st2xxx_lpan_mask() != 0) + save_item(NAME(m_lpan)); + save_item(NAME(m_lctr)); + save_item(NAME(m_lckr)); + save_item(NAME(m_lfra)); + save_item(NAME(m_lac)); + save_item(NAME(m_lpwm)); } void st2xxx_device::device_reset() @@ -183,12 +199,19 @@ void st2xxx_device::device_reset() // reset miscellaneous registers m_sys = 0; + m_misc = st2xxx_wdten_on_reset() ? 0x0c : 0; // reset LCDC registers m_lssa = 0; m_lvpw = 0; m_lxmax = 0; m_lymax = 0; + m_lpan = 0; + m_lctr = 0x80; + m_lckr = 0; + m_lfra = 0; + m_lac = 0; + m_lpwm = 0; } u8 st2xxx_device::acknowledge_irq() @@ -364,6 +387,16 @@ void st2xxx_device::sys_w(u8 data) downcast(*mintf).irr_enable = BIT(data, 1); } +u8 st2xxx_device::misc_r() +{ + return m_misc; +} + +void st2xxx_device::misc_w(u8 data) +{ + m_misc = data & st2xxx_misc_mask(); +} + u8 st2xxx_device::irrl_r() { return downcast(*mintf).irr & 0xff; @@ -571,4 +604,54 @@ void st2xxx_device::lymax_w(u8 data) m_lymax = data; } +u8 st2xxx_device::lpan_r() +{ + return m_lpan; +} + +void st2xxx_device::lpan_w(u8 data) +{ + m_lpan = data & st2xxx_lpan_mask(); +} + +u8 st2xxx_device::lctr_r() +{ + return m_lctr; +} + +void st2xxx_device::lctr_w(u8 data) +{ + m_lctr = data & st2xxx_lctr_mask(); +} + +void st2xxx_device::lckr_w(u8 data) +{ + m_lckr = data & st2xxx_lckr_mask(); +} + +void st2xxx_device::lfra_w(u8 data) +{ + m_lfra = data & 0x3f; +} + +u8 st2xxx_device::lac_r() +{ + return m_lac; +} + +void st2xxx_device::lac_w(u8 data) +{ + m_lac = data & 0x1f; +} + +u8 st2xxx_device::lpwm_r() +{ + return m_lpwm; +} + +void st2xxx_device::lpwm_w(u8 data) +{ + m_lpwm = data & st2xxx_lpwm_mask(); +} + #include "cpu/m6502/st2xxx.hxx" diff --git a/src/devices/cpu/m6502/st2xxx.h b/src/devices/cpu/m6502/st2xxx.h index 08d9589a5cd..38b573fee4c 100644 --- a/src/devices/cpu/m6502/st2xxx.h +++ b/src/devices/cpu/m6502/st2xxx.h @@ -39,12 +39,19 @@ public: ST_PRR, ST_DRR, ST_DMR, + ST_MISC, ST_IREQ, ST_IENA, ST_LSSA, ST_LVPW, ST_LXMAX, - ST_LYMAX + ST_LYMAX, + ST_LPAN, + ST_LCTR, + ST_LCKR, + ST_LFRA, + ST_LAC, + ST_LPWM }; auto in_pa_callback() { return m_in_port_cb[0].bind(); } @@ -76,7 +83,13 @@ protected: virtual const char *st2xxx_irq_name(int i) const = 0; virtual unsigned st2xxx_bt_divider(int n) const = 0; virtual u8 st2xxx_sys_mask() const = 0; + virtual u8 st2xxx_misc_mask() const = 0; + virtual bool st2xxx_wdten_on_reset() const { return false; } virtual bool st2xxx_has_dma() const { return false; } + virtual u8 st2xxx_lpan_mask() const = 0; + virtual u8 st2xxx_lctr_mask() const = 0; + virtual u8 st2xxx_lckr_mask() const = 0; + virtual u8 st2xxx_lpwm_mask() const = 0; class mi_st2xxx : public memory_interface { public: @@ -123,6 +136,8 @@ protected: u8 sys_r(); void sys_w(u8 data); + u8 misc_r(); + void misc_w(u8 data); u8 irrl_r(); void irrl_w(u8 data); @@ -163,6 +178,16 @@ protected: void lxmax_w(u8 data); u8 lymax_r(); void lymax_w(u8 data); + u8 lpan_r(); + void lpan_w(u8 data); + u8 lctr_r(); + void lctr_w(u8 data); + void lckr_w(u8 data); + void lfra_w(u8 data); + u8 lac_r(); + void lac_w(u8 data); + u8 lpwm_r(); + void lpwm_w(u8 data); #define O(o) void o ## _full(); void o ## _partial() @@ -185,18 +210,29 @@ protected: u8 m_psel[7]; u8 m_pfun[2]; u8 m_pmcr; + u8 m_bten; u8 m_btsr; emu_timer *m_base_timer[8]; u8 m_bt_mask; u16 m_bt_ireq; + u8 m_sys; + u8 m_misc; + u16 m_ireq; u16 m_iena; + u16 m_lssa; u8 m_lvpw; u8 m_lxmax; u8 m_lymax; + u8 m_lpan; + u8 m_lctr; + u8 m_lckr; + u8 m_lfra; + u8 m_lac; + u8 m_lpwm; }; #endif // MAME_CPU_M6502_ST2XXX_H -- cgit v1.2.3