diff options
author | 2012-04-30 16:28:38 +0000 | |
---|---|---|
committer | 2012-04-30 16:28:38 +0000 | |
commit | 5b5ff6e8fbbde32aaa6e14fead24078d6308d515 (patch) | |
tree | f1fe9f61be77dc2d9d290361f73bcd9e874d9cd0 /src/emu/machine/i8155.c | |
parent | 0108fcf846b259ff069507d4b62f99bd33585d51 (diff) |
timer regs can be read too (used by meyc8088 diagnostics)
Diffstat (limited to 'src/emu/machine/i8155.c')
-rw-r--r-- | src/emu/machine/i8155.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/emu/machine/i8155.c b/src/emu/machine/i8155.c index 9f752781ce9..53798b1a3b9 100644 --- a/src/emu/machine/i8155.c +++ b/src/emu/machine/i8155.c @@ -386,7 +386,7 @@ READ8_MEMBER( i8155_device::io_r ) { UINT8 data = 0; - switch (offset & 0x03) + switch (offset & 0x07) { case REGISTER_STATUS: data = m_status; @@ -406,6 +406,14 @@ READ8_MEMBER( i8155_device::io_r ) case REGISTER_PORT_C: data = read_port(PORT_C); break; + + case REGISTER_TIMER_LOW: + data = m_counter & 0xff; + break; + + case REGISTER_TIMER_HIGH: + data = (m_counter >> 8 & 0x3f) | get_timer_mode(); + break; } return data; @@ -477,7 +485,7 @@ void i8155_device::register_w(int offset, UINT8 data) else { // load mode and CNT length and start immediately after loading (if timer is not running) - m_counter = m_count_length; + m_counter = m_count_length & 0x3fff; m_timer->adjust(attotime::zero, 0, attotime::from_hz(clock())); } break; |