m5074x.cpp: Protect interrupt request bits against being set by writes

- m740: A few more timing corrections
This commit is contained in:
AJR 2020-10-29 11:26:51 -04:00
parent 282a8d49a9
commit bf80796b15
2 changed files with 18 additions and 26 deletions

View File

@ -164,16 +164,13 @@ void m5074x_device::execute_set_input(int inputnum, int state)
{
switch (inputnum)
{
case M5074X_INT1_LINE:
if (state == ASSERT_LINE)
{
m_intctrl |= IRQ_INTREQ;
}
else
{
m_intctrl &= ~IRQ_INTREQ;
}
break;
case M5074X_INT1_LINE:
// FIXME: edge-triggered
if (state == ASSERT_LINE)
{
m_intctrl |= IRQ_INTREQ;
}
break;
}
recalc_irqs();
@ -442,12 +439,13 @@ void m5074x_device::tmrirq_w(offs_t offset, uint8_t data)
break;
case 5:
m_intctrl = data;
// Interrupt request bits can only be reset
m_intctrl = data & (m_intctrl | ~(IRQ_CNTRREQ | IRQ_INTREQ));
recalc_irqs();
break;
case 6:
m_tmrctrl = data;
m_tmrctrl = data & (m_tmrctrl | ~TMRC_TMRXREQ);
recalc_irqs();
break;
}
@ -589,25 +587,19 @@ void m50753_device::execute_set_input(int inputnum, int state)
switch (inputnum)
{
case M50753_INT1_LINE:
// FIXME: edge-triggered
if (state == ASSERT_LINE)
{
m_intctrl |= IRQ_50753_INT1REQ;
}
else
{
m_intctrl &= ~IRQ_50753_INT1REQ;
}
break;
case M50753_INT2_LINE:
// FIXME: edge-triggered
if (state == ASSERT_LINE)
{
m_intctrl |= IRQ_50753_INT2REQ;
}
else
{
m_intctrl &= ~IRQ_50753_INT2REQ;
}
break;
}

View File

@ -126,16 +126,15 @@ rrf_zpg
prefetch();
bra_rel
TMP = read_pc();
read_pc_noinc();
if(page_changing(PC, int8_t(TMP))) {
read_arg(set_l(PC, PC+int8_t(TMP)));
}
TMP = read_pc_noinc();
read_arg(set_l(PC, PC+1));
PC++;
read_arg(set_l(PC, PC+int8_t(TMP)));
PC += int8_t(TMP);
prefetch();
jmp_zpi
TMP2 = read_pc();
TMP2 = read_pc_noinc();
TMP = read(TMP2 & 0xff);
TMP = set_h(TMP, read((TMP2+1) & 0xff));
PC = TMP;
@ -359,6 +358,7 @@ andt_zpx
com_zpg
TMP = read_pc();
TMP2 = read(TMP);
read(TMP);
TMP2 ^= 0xff;
set_nz(TMP2);
write(TMP, TMP2);