Add support for 6502 pin 38 (SO: set overflow)

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-01-12 20:13:35 +00:00
parent 290ab7a4dc
commit ac95670cfc
2 changed files with 10 additions and 0 deletions

View File

@ -53,6 +53,8 @@ namespace EightBit {
uint8_t& S() { return s; }
uint8_t& P() { return p; }
PinLevel& SO() { return m_soLine; } // In
protected:
virtual void reset() final;
@ -664,5 +666,7 @@ namespace EightBit {
std::array<int, 0x100> m_timings;
std::array<opcode_decoded_t, 0x100> m_decodedOpcodes;
PinLevel m_soLine = Low;
};
}

View File

@ -32,6 +32,8 @@ EightBit::MOS6502::MOS6502(Bus& bus)
A() = 0;
P() = RF;
S() = Mask8;
raise(SO());
}
int EightBit::MOS6502::step() {
@ -39,6 +41,10 @@ int EightBit::MOS6502::step() {
auto returned = 0;
if (LIKELY(powered())) {
ExecutingInstruction.fire(*this);
if (UNLIKELY(lowered(SO()))) {
P() |= VF;
raise(SO());
}
if (UNLIKELY(lowered(NMI()))) {
raise(NMI());
interrupt(NMIvector);