summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Michael Zapf <michael.zapf@mizapf.de>2013-10-28 23:52:43 +0000
committer Michael Zapf <michael.zapf@mizapf.de>2013-10-28 23:52:43 +0000
commit4d9d4e3ce5bba9639c74c1ffbcf0478903342360 (patch)
treecc54a8373fbe011b63eb8614c6a220f50e7380db /src/emu
parent366ee4d2617b42f97842878215b909a71d281316 (diff)
tms9995: Another fix for the decrementer, slowing it down. (nw)
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/cpu/tms9900/tms9995.c9
-rw-r--r--src/emu/cpu/tms9900/tms9995.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/emu/cpu/tms9900/tms9995.c b/src/emu/cpu/tms9900/tms9995.c
index dad9ea325a9..c2606121f7a 100644
--- a/src/emu/cpu/tms9900/tms9995.c
+++ b/src/emu/cpu/tms9900/tms9995.c
@@ -1247,7 +1247,13 @@ void tms9995_device::pulse_clock(int count)
else LOG("tms9995: pulse_clock\n");
}
m_request_auto_wait_state = false;
- if (m_flag[0] == false && m_flag[1] == true) trigger_decrementer();
+ if (m_flag[0] == false && m_flag[1] == true)
+ {
+ // Section 2.3.1.2.2: "by decreasing the count in the Decrementing
+ // Register by one for each fourth CLKOUT cycle"
+ m_decrementer_clkdiv = (m_decrementer_clkdiv+1)%4;
+ if (m_decrementer_clkdiv==0) trigger_decrementer();
+ }
}
}
@@ -1521,6 +1527,7 @@ void tms9995_device::service_interrupt()
m_word_access = false;
m_int1_active = false;
m_int4_active = false;
+ m_decrementer_clkdiv = 0;
m_pass = 0;
m_instindex = 0;
diff --git a/src/emu/cpu/tms9900/tms9995.h b/src/emu/cpu/tms9900/tms9995.h
index 303d98a8d1a..f18b81ccf3d 100644
--- a/src/emu/cpu/tms9900/tms9995.h
+++ b/src/emu/cpu/tms9900/tms9995.h
@@ -173,6 +173,8 @@ private:
bool m_mid_flag;
bool m_mid_active;
+ int m_decrementer_clkdiv;
+
// Flag field
int m_int_pending;