Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/devices/cpu/z80/z80.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,11 +789,9 @@ void z80_device::execute_set_input(int inputnum, int state)
switch (inputnum)
{
case Z80_INPUT_LINE_BUSRQ:
m_busrq_state = state;
if (state != CLEAR_LINE)
if (m_busrq_state == CLEAR_LINE && state != CLEAR_LINE)
set_service_attention<SA_BUSRQ, 1>();
else
set_service_attention<SA_BUSRQ, 0>();
m_busrq_state = state;
break;

case INPUT_LINE_NMI:
Expand Down
13 changes: 6 additions & 7 deletions src/devices/cpu/z80/z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface
devcb_write_line m_busack_cb;

static constexpr u8 SA_BUSRQ = 0;
static constexpr u8 SA_BUSACK = 1;
static constexpr u8 SA_NMI_PENDING = 2;
static constexpr u8 SA_IRQ_ON = 3;
static constexpr u8 SA_HALT = 4;
static constexpr u8 SA_AFTER_EI = 5;
static constexpr u8 SA_AFTER_LDAIR = 6;
static constexpr u8 SA_NSC800_IRQ_ON = 7;
static constexpr u8 SA_NMI_PENDING = 1;
static constexpr u8 SA_IRQ_ON = 2;
static constexpr u8 SA_HALT = 3;
static constexpr u8 SA_AFTER_EI = 4;
static constexpr u8 SA_AFTER_LDAIR = 5;
static constexpr u8 SA_NSC800_IRQ_ON = 6;
u8 m_service_attention; // bitmap for required handling in service step

PAIR16 m_prvpc;
Expand Down
11 changes: 6 additions & 5 deletions src/devices/cpu/z80/z80.lst
Original file line number Diff line number Diff line change
Expand Up @@ -1048,17 +1048,18 @@ ffff
if (m_busrq_state) { // SA_BUSRQ
if (!m_busack_state) {
m_busack_state = 1;
set_service_attention<SA_BUSACK, 1>();
m_busack_cb(1);
}
if (m_icount > 0)
m_icount = 0;
m_ref = 0xffff00;
return;
} else if (m_busack_state) { // SA_BUSACK
m_busack_state = 0;
set_service_attention<SA_BUSACK, 0>();
m_busack_cb(0);
} else {
set_service_attention<SA_BUSRQ, 0>();
if (m_busack_state) {
m_busack_state = 0;
m_busack_cb(0);
}
}
@check_interrupts
set_service_attention<SA_AFTER_EI, 0>();
Expand Down
Loading