diff options
author | 2016-06-23 17:08:31 +0200 | |
---|---|---|
committer | 2016-06-23 17:08:31 +0200 | |
commit | 82c526ea38997907bf1edf95abf5b73a20118ca8 (patch) | |
tree | e7e5a912d817566dfd693b02411ad9a18d29b18e /src/devices/cpu/tms32010 | |
parent | b4e62ef6cca1c2b894c1288825966df2b0a32aa8 (diff) |
tms32010.cpp: devcb instead of memory map for bio line (nw)
Diffstat (limited to 'src/devices/cpu/tms32010')
-rw-r--r-- | src/devices/cpu/tms32010/tms32010.cpp | 19 | ||||
-rw-r--r-- | src/devices/cpu/tms32010/tms32010.h | 14 |
2 files changed, 14 insertions, 19 deletions
diff --git a/src/devices/cpu/tms32010/tms32010.cpp b/src/devices/cpu/tms32010/tms32010.cpp index ab49c52b603..7625ff96646 100644 --- a/src/devices/cpu/tms32010/tms32010.cpp +++ b/src/devices/cpu/tms32010/tms32010.cpp @@ -71,7 +71,6 @@ #define M_RDOP_ARG(A) TMS32010_RDOP_ARG(A) #define P_IN(A) TMS32010_In(A) #define P_OUT(A,V) TMS32010_Out(A,V) -#define BIO_IN TMS32010_BIO_In const device_type TMS32010 = &device_creator<tms32010_device>; @@ -102,7 +101,8 @@ tms32010_device::tms32010_device(const machine_config &mconfig, const char *tag, : cpu_device(mconfig, TMS32010, "TMS32010", tag, owner, clock, "tms32010", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 12, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 8, -1, ADDRESS_MAP_NAME(tms32010_ram)) - , m_io_config("io", ENDIANNESS_BIG, 16, 4+1, -1) + , m_io_config("io", ENDIANNESS_BIG, 16, 4, -1) + , m_bio_in(*this) , m_addr_mask(0x0fff) { } @@ -112,7 +112,8 @@ tms32010_device::tms32010_device(const machine_config &mconfig, device_type type : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 16, 12, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 8, -1, ADDRESS_MAP_NAME(tms32015_ram)) - , m_io_config("io", ENDIANNESS_BIG, 16, 4+1, -1) + , m_io_config("io", ENDIANNESS_BIG, 16, 4, -1) + , m_bio_in(*this) , m_addr_mask(addr_mask) { } @@ -157,14 +158,6 @@ offs_t tms32010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 #define IND (m_AR[ARP] & 0xff) /* address used in indirect memory access operations */ - -/**************************************************************************** - * Read the state of the BIO pin - */ - -#define TMS32010_BIO_In (m_io->read_word(TMS32010_BIO<<1)) - - /**************************************************************************** * Input a word from given I/O port */ @@ -448,7 +441,7 @@ void tms32010_device::bgz() } void tms32010_device::bioz() { - if (BIO_IN != CLEAR_LINE) { + if (m_bio_in() != CLEAR_LINE) { m_PC = M_RDOP_ARG(m_PC); m_icount -= add_branch_cycle(); } @@ -842,6 +835,8 @@ void tms32010_device::device_start() m_data = &space(AS_DATA); m_io = &space(AS_IO); + m_bio_in.resolve_safe(0); + m_PREVPC = 0; m_ALU.d = 0; m_Preg.d = 0; diff --git a/src/devices/cpu/tms32010/tms32010.h b/src/devices/cpu/tms32010/tms32010.h index b7d77827a09..61e36279e17 100644 --- a/src/devices/cpu/tms32010/tms32010.h +++ b/src/devices/cpu/tms32010/tms32010.h @@ -18,13 +18,8 @@ -/**************************************************************************** - * Use this in the I/O port address fields of your driver for the BIO pin - * i.e, - * AM_RANGE(TMS32010_BIO, TMS32010_BIO) AM_READ(twincobr_bio_line_r) - */ - -#define TMS32010_BIO 0x10 /* BIO input */ +#define MCFG_TMS32010_BIO_IN_CB(_devcb) \ + devcb = &tms32010_device::set_bio_in_cb(*device, DEVCB_##_devcb); /* BIO input */ #define TMS32010_INT_PENDING 0x80000000 @@ -50,6 +45,9 @@ public: // construction/destruction tms32010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); tms32010_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int addr_mask); + + // static configuration helpers + template<class _Object> static devcb_base & set_bio_in_cb(device_t &device, _Object object) { return downcast<tms32010_device &>(device).m_bio_in.set_callback(object); } protected: // device-level overrides @@ -80,6 +78,8 @@ private: address_space_config m_program_config; address_space_config m_data_config; address_space_config m_io_config; + + devcb_read_line m_bio_in; typedef void ( tms32010_device::*opcode_func ) (); struct tms32010_opcode |