diff options
author | MetalliC <0vetal0@gmail.com> | 2019-08-29 01:19:30 +0300 |
---|---|---|
committer | MetalliC <0vetal0@gmail.com> | 2019-08-29 01:19:30 +0300 |
commit | e1d6982d89b56be682cec32201a4c59e309ef5e8 (patch) | |
tree | b37c418848aa68e8640613ea42b2635a1474677d | |
parent | b77d8ecb0382dab1f381412ec9a06706d5b44cb5 (diff) |
SH2 clock multiplier docs
-rw-r--r-- | src/devices/cpu/sh/sh2.cpp | 2 | ||||
-rw-r--r-- | src/devices/cpu/sh/sh2.h | 4 | ||||
-rw-r--r-- | src/devices/cpu/sh/sh2comn.cpp | 23 |
3 files changed, 21 insertions, 8 deletions
diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp index 28a952f0d22..a489291ae51 100644 --- a/src/devices/cpu/sh/sh2.cpp +++ b/src/devices/cpu/sh/sh2.cpp @@ -168,7 +168,7 @@ void sh2_device::sh7604_map(address_map &map) map(0xfffffe82, 0xfffffe83).rw(FUNC(sh2_device::rstcsr_r), FUNC(sh2_device::rstcsr_w)); // standby and cache control - map(0xfffffe91, 0xfffffe91).rw(FUNC(sh2_device::sbycr_r), FUNC(sh2_device::sbycr_w)); + map(0xfffffe90, 0xfffffe91).rw(FUNC(sh2_device::fmr_sbycr_r), FUNC(sh2_device::fmr_sbycr_w)); map(0xfffffe92, 0xfffffe92).rw(FUNC(sh2_device::ccr_r), FUNC(sh2_device::ccr_w)); // INTC second section diff --git a/src/devices/cpu/sh/sh2.h b/src/devices/cpu/sh/sh2.h index 1e5abeb795b..0226c346407 100644 --- a/src/devices/cpu/sh/sh2.h +++ b/src/devices/cpu/sh/sh2.h @@ -194,8 +194,8 @@ public: DECLARE_WRITE16_MEMBER( rstcsr_w ); // misc - DECLARE_READ8_MEMBER( sbycr_r ); - DECLARE_WRITE8_MEMBER( sbycr_w ); + DECLARE_READ16_MEMBER( fmr_sbycr_r ); + DECLARE_WRITE16_MEMBER( fmr_sbycr_w ); DECLARE_READ8_MEMBER( ccr_r ); DECLARE_WRITE8_MEMBER( ccr_w ); diff --git a/src/devices/cpu/sh/sh2comn.cpp b/src/devices/cpu/sh/sh2comn.cpp index 42ff2e358fb..bb17a818c17 100644 --- a/src/devices/cpu/sh/sh2comn.cpp +++ b/src/devices/cpu/sh/sh2comn.cpp @@ -887,16 +887,29 @@ WRITE16_MEMBER( sh2_device::rstcsr_w ) } } -READ8_MEMBER( sh2_device::sbycr_r ) +READ16_MEMBER( sh2_device::fmr_sbycr_r ) { return m_sbycr; } -WRITE8_MEMBER( sh2_device::sbycr_w ) +WRITE16_MEMBER( sh2_device::fmr_sbycr_w ) { - m_sbycr = data; - if (data & 0x1f) - logerror("SH2 module stop selected %02x\n",data); + switch (mem_mask) + { + case 0xff00: // FMR 8bit + logerror("SH2 set clock multiplier x%d\n", 1 << ((data >> 8) & 3)); + break; + case 0xffff: // FMR 16bit + // SH7604 docs says FMR register must be set using 8-bit write, however at practice 16-bit works too. + // has been verified for CPS3 custom SH2, SH7604 and SH7095 (clock multiplier feature is not officially documented for SH7095). + logerror("SH2 set clock multiplier x%d\n", 1 << (data & 3)); + break; + case 0x00ff: // SBYCR + m_sbycr = data; + if (data & 0x1f) + logerror("SH2 module stop selected %02x\n", data); + break; + } } READ8_MEMBER( sh2_device::ccr_r ) |