mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-03-04 07:31:02 +00:00
Add support for 6502 pin 38 (SO: set overflow)
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
290ab7a4dc
commit
ac95670cfc
@ -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;
|
||||
};
|
||||
}
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user