mirror of
https://github.com/holub/mame
synced 2025-06-09 22:33:00 +03:00
m6809: fix overflow flag problem with SBC8 and ADC8 (nw)
This commit is contained in:
parent
d9bc537f94
commit
81bcc067e4
@ -239,8 +239,8 @@ CMP8:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SBC8:
|
SBC8:
|
||||||
m_temp.w = (uint16_t)read_operand() + (m_cc & CC_C ? 1 : 0);
|
m_temp.b.l = read_operand();
|
||||||
regop8() = set_flags(CC_NZVC, regop8(), m_temp.b.l, regop8() - m_temp.w);
|
regop8() = set_flags(CC_NZVC, regop8(), m_temp.b.l, regop8() - m_temp.b.l - (m_cc & CC_C ? 1 : 0));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AND8:
|
AND8:
|
||||||
@ -259,8 +259,8 @@ EOR8:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ADC8:
|
ADC8:
|
||||||
m_temp.w = (uint16_t)read_operand() + (m_cc & CC_C ? 1 : 0);
|
m_temp.b.l = read_operand();
|
||||||
regop8() = set_flags(add8_sets_h() ? CC_HNZVC : CC_NZVC, regop8(), m_temp.b.l, regop8() + m_temp.w);
|
regop8() = set_flags(add8_sets_h() ? CC_HNZVC : CC_NZVC, regop8(), m_temp.b.l, regop8() + m_temp.b.l + (m_cc & CC_C ? 1 : 0));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OR8:
|
OR8:
|
||||||
@ -332,9 +332,9 @@ SYNC:
|
|||||||
// massaging the PC this way makes the debugger's behavior more
|
// massaging the PC this way makes the debugger's behavior more
|
||||||
// intuitive
|
// intuitive
|
||||||
m_pc.w--;
|
m_pc.w--;
|
||||||
|
|
||||||
@eat_remaining();
|
@eat_remaining();
|
||||||
|
|
||||||
// unmassage...
|
// unmassage...
|
||||||
m_pc.w++;
|
m_pc.w++;
|
||||||
}
|
}
|
||||||
@ -396,7 +396,7 @@ LBSR:
|
|||||||
JSR:
|
JSR:
|
||||||
@eat(2);
|
@eat(2);
|
||||||
goto GOTO_SUBROUTINE;
|
goto GOTO_SUBROUTINE;
|
||||||
|
|
||||||
GOTO_SUBROUTINE:
|
GOTO_SUBROUTINE:
|
||||||
@write_memory(--m_s.w, m_pc.b.l);
|
@write_memory(--m_s.w, m_pc.b.l);
|
||||||
@write_memory(--m_s.w, m_pc.b.h);
|
@write_memory(--m_s.w, m_pc.b.h);
|
||||||
@ -442,7 +442,7 @@ CWAI:
|
|||||||
m_pc.w -= 2;
|
m_pc.w -= 2;
|
||||||
|
|
||||||
@eat_remaining();
|
@eat_remaining();
|
||||||
|
|
||||||
// unmassage...
|
// unmassage...
|
||||||
m_pc.w += 2;
|
m_pc.w += 2;
|
||||||
}
|
}
|
||||||
@ -526,7 +526,7 @@ SOFTWARE_INTERRUPT:
|
|||||||
m_temp.w = entire_state_registers();
|
m_temp.w = entire_state_registers();
|
||||||
%PUSH_REGISTERS;
|
%PUSH_REGISTERS;
|
||||||
goto INTERRUPT_VECTOR;
|
goto INTERRUPT_VECTOR;
|
||||||
|
|
||||||
DIRECT:
|
DIRECT:
|
||||||
@set_ea(((uint16_t)m_dp << 8) | read_opcode_arg());
|
@set_ea(((uint16_t)m_dp << 8) | read_opcode_arg());
|
||||||
@eat(hd6309_native_mode() ? 0 : 1);
|
@eat(hd6309_native_mode() ? 0 : 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user