From f7ad534db9599779152cf61f0d65a2b2e2b636ac Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 8 Apr 2023 20:23:34 -0400 Subject: h83003: Expose all four TEND outputs --- src/devices/cpu/h8/h83003.cpp | 14 ++++++-------- src/devices/cpu/h8/h83003.h | 8 +++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/devices/cpu/h8/h83003.cpp b/src/devices/cpu/h8/h83003.cpp index 84be5879454..caea06c3cd4 100644 --- a/src/devices/cpu/h8/h83003.cpp +++ b/src/devices/cpu/h8/h83003.cpp @@ -29,8 +29,7 @@ h83003_device::h83003_device(const machine_config &mconfig, const char *tag, dev sci0(*this, "sci0"), sci1(*this, "sci1"), watchdog(*this, "watchdog"), - tend0_cb(*this), - tend1_cb(*this) + tend_cb(*this) { syscr = 0; } @@ -191,10 +190,10 @@ void h83003_device::device_add_mconfig(machine_config &config) void h83003_device::execute_set_input(int inputnum, int state) { - if(inputnum == H8_INPUT_LINE_TEND0 && !tend0_cb.isnull()) - tend0_cb(state); - else if(inputnum == H8_INPUT_LINE_TEND1 && !tend1_cb.isnull()) - tend1_cb(state); + if(inputnum >= H8_INPUT_LINE_TEND0 && inputnum <= H8_INPUT_LINE_TEND3) { + if(!tend_cb[inputnum - H8_INPUT_LINE_TEND0].isnull()) + tend_cb[inputnum - H8_INPUT_LINE_TEND0](state); + } else if(inputnum >= H8_INPUT_LINE_DREQ0 && inputnum <= H8_INPUT_LINE_DREQ3) dma->set_input(inputnum, state); else @@ -265,8 +264,7 @@ void h83003_device::device_start() h8h_device::device_start(); dma_device = dma; - tend0_cb.resolve(); - tend1_cb.resolve(); + tend_cb.resolve_all(); } void h83003_device::device_reset() diff --git a/src/devices/cpu/h8/h83003.h b/src/devices/cpu/h8/h83003.h index 6c4f7cfaced..9d1fbc2fb7e 100644 --- a/src/devices/cpu/h8/h83003.h +++ b/src/devices/cpu/h8/h83003.h @@ -29,8 +29,10 @@ class h83003_device : public h8h_device { public: h83003_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - auto tend0() { return tend0_cb.bind(); } - auto tend1() { return tend1_cb.bind(); } + auto tend0() { return tend_cb[0].bind(); } + auto tend1() { return tend_cb[1].bind(); } + auto tend2() { return tend_cb[2].bind(); } + auto tend3() { return tend_cb[3].bind(); } void set_mode_a20() { mode_a20 = true; } void set_mode_a24() { mode_a20 = false; } @@ -68,7 +70,7 @@ protected: uint8_t syscr; uint8_t rtmcsr; - devcb_write_line tend0_cb, tend1_cb; + devcb_write_line::array<4> tend_cb; virtual void update_irq_filter() override; virtual void interrupt_taken() override; -- cgit v1.2.3