diff options
author | 2017-10-02 19:47:35 +0100 | |
---|---|---|
committer | 2017-10-02 19:47:35 +0100 | |
commit | c0ee79f3db1d019c74cd199a99398bb5a04065c5 (patch) | |
tree | 6f329845f63f85efe3471222d7bfa07982f88a62 /src/devices/cpu/sh/sh7604_wdt.cpp | |
parent | 48aabf412269e49dca22546bb408d6e34a9c79b7 (diff) |
use 'sh' instead of 'superh'
Diffstat (limited to 'src/devices/cpu/sh/sh7604_wdt.cpp')
-rw-r--r-- | src/devices/cpu/sh/sh7604_wdt.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/devices/cpu/sh/sh7604_wdt.cpp b/src/devices/cpu/sh/sh7604_wdt.cpp new file mode 100644 index 00000000000..16b40f30768 --- /dev/null +++ b/src/devices/cpu/sh/sh7604_wdt.cpp @@ -0,0 +1,83 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/*************************************************************************** + + SH7604 Watchdog Timer Controller + + TODO: + - Host CPU setter (clock and callback for irq and reset lines); + - memory map (needs to verify if ID write is ok); + +***************************************************************************/ + +#include "emu.h" +#include "sh7604_wdt.h" + + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +DEFINE_DEVICE_TYPE(SH7604_WDT, sh7604_wdt_device, "sh7604wdt", "SH7604 Watchdog Timer") + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +DEVICE_ADDRESS_MAP_START( wdt_regs, 8, sh7604_wdt_device ) +// AM_RANGE(0x00, 0x00) timer control/status +// AM_RANGE(0x01, 0x01) timer counter +// AM_RANGE(0x02, 0x02) write only, reset control register +// AM_RANGE(0x03, 0x03) read status register, write reset status register +ADDRESS_MAP_END + +//------------------------------------------------- +// sh7604_wdt_device - constructor +//------------------------------------------------- + +sh7604_wdt_device::sh7604_wdt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, SH7604_WDT, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sh7604_wdt_device::device_start() +{ +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sh7604_wdt_device::device_reset() +{ +} + + +//************************************************************************** +// READ/WRITE HANDLERS +//************************************************************************** + +READ8_MEMBER( sh7604_wdt_device::read ) +{ + return space.read_byte(offset); +} + +WRITE16_MEMBER( sh7604_wdt_device::write ) +{ + uint8_t id_param = data >> 8; + switch(id_param) + { + case 0xa5: space.write_byte(offset*2+0,data & 0xff); break; + case 0x5a: space.write_byte(offset*2+1,data & 0xff); break; + default: throw emu_fatalerror("%s: invalid id param write = %02x\n",tag(),id_param); + } +} |