#include <cpu.h>
Public Types | |
enum class | AccessType { Control , Data } |
Public Member Functions | |
Cpu (Memory &mem, CpuCallbacks &callbacks) | |
void | Reset (bool hard=false) |
void | RunOpcode () |
void | ExecuteInstruction (uint8_t opcode) |
void | LogInstructions (uint16_t PC, uint8_t opcode, uint16_t operand, bool immediate, bool accumulator_mode) |
void | SetIrq (bool state) |
void | Nmi () |
void | DoInterrupt () |
void | SetFlags (uint8_t val) |
void | SetZN (uint16_t value, bool byte) |
bool | m () |
bool | xf () |
int | GetAccumulatorSize () const |
int | GetIndexSize () const |
void | SetAccumulatorSize (bool set) |
void | SetIndexSize (bool set) |
void | SetNegativeFlag (bool set) |
void | SetOverflowFlag (bool set) |
void | SetBreakFlag (bool set) |
void | SetDecimalFlag (bool set) |
void | SetInterruptFlag (bool set) |
void | SetZeroFlag (bool set) |
void | SetCarryFlag (bool set) |
bool | GetNegativeFlag () const |
bool | GetOverflowFlag () const |
bool | GetBreakFlag () const |
bool | GetDecimalFlag () const |
bool | GetInterruptFlag () const |
bool | GetZeroFlag () const |
bool | GetCarryFlag () const |
uint8_t | ReadOpcode () |
uint16_t | ReadOpcodeWord (bool int_check=false) |
uint8_t | ReadByte (uint32_t address) |
uint16_t | ReadWord (uint32_t address, uint32_t address_high, bool int_check=false) |
uint32_t | ReadWordLong (uint32_t address) |
void | WriteByte (uint32_t address, uint8_t value) |
void | WriteWord (uint32_t address, uint32_t address_high, uint16_t value, bool reversed=false, bool int_check=false) |
void | WriteLong (uint32_t address, uint32_t value) |
void | PushByte (uint8_t value) |
void | PushWord (uint16_t value, bool int_check=false) |
void | PushLong (uint32_t value) |
uint8_t | PopByte () |
uint16_t | PopWord (bool int_check=false) |
uint32_t | PopLong () |
void | DoBranch (bool check) |
void | set_int_delay (bool delay) |
uint32_t | Absolute (uint32_t *low) |
uint32_t | AbsoluteIndexedX () |
uint32_t | AdrAbx (uint32_t *low, bool write) |
uint32_t | AbsoluteIndexedY () |
uint32_t | AdrAby (uint32_t *low, bool write) |
void | AdrImp () |
uint32_t | AdrIdx (uint32_t *low) |
uint32_t | AdrIdp (uint32_t *low) |
uint32_t | AdrIdy (uint32_t *low, bool write) |
uint32_t | AdrIdl (uint32_t *low) |
uint32_t | AdrIly (uint32_t *low) |
uint32_t | AdrIsy (uint32_t *low) |
uint32_t | Immediate (uint32_t *low, bool xFlag) |
uint16_t | AbsoluteIndexedIndirect () |
uint16_t | AbsoluteIndirect () |
uint32_t | AbsoluteIndirectLong () |
uint32_t | AbsoluteLong () |
uint32_t | AdrAbl (uint32_t *low) |
uint32_t | AbsoluteLongIndexedX () |
uint32_t | AdrAlx (uint32_t *low) |
void | BlockMove (uint16_t source, uint16_t dest, uint16_t length) |
uint16_t | DirectPage () |
uint32_t | AdrDp (uint32_t *low) |
uint16_t | DirectPageIndexedX () |
uint32_t | AdrDpx (uint32_t *low) |
uint16_t | DirectPageIndexedY () |
uint32_t | AdrDpy (uint32_t *low) |
uint16_t | DirectPageIndexedIndirectX () |
uint16_t | DirectPageIndirect () |
uint32_t | DirectPageIndirectLong () |
uint16_t | DirectPageIndirectIndexedY () |
uint32_t | DirectPageIndirectLongIndexedY () |
uint16_t | Immediate (bool index_size=false) |
uint16_t | StackRelative () |
uint32_t | AdrSr (uint32_t *low) |
uint32_t | StackRelativeIndirectIndexedY () |
void | ADC (uint16_t operand) |
void | AND (uint32_t address, bool immediate=false) |
void | ANDAbsoluteLong (uint32_t address) |
void | ASL (uint16_t address) |
void | BCC (int8_t offset) |
void | BCS (int8_t offset) |
void | BEQ (int8_t offset) |
void | BIT (uint16_t address) |
void | BMI (int8_t offset) |
void | BNE (int8_t offset) |
void | BPL (int8_t offset) |
void | BRA (int8_t offset) |
void | BRK () |
void | BRL (int16_t offset) |
void | BVC (int8_t offset) |
void | BVS (int8_t offset) |
void | CLC () |
void | CLD () |
void | CLI () |
void | CLV () |
void | CMP (uint32_t address, bool immediate=false) |
void | COP () |
void | CPX (uint32_t address, bool immediate=false) |
void | CPY (uint32_t address, bool immediate=false) |
void | DEC (uint32_t address, bool accumulator=false) |
void | DEX () |
void | DEY () |
void | EOR (uint32_t address, bool immediate=false) |
void | INC (uint32_t address, bool accumulator=false) |
void | INX () |
void | INY () |
void | JMP (uint16_t address) |
void | JML (uint16_t address) |
void | JSR (uint16_t address) |
void | JSL (uint16_t address) |
void | LDA (uint16_t address, bool immediate=false, bool direct_page=false, bool data_bank=false) |
void | LDX (uint16_t address, bool immediate=false) |
void | LDY (uint16_t address, bool immediate=false) |
void | LSR (uint16_t address, bool accumulator=false) |
void | MVN () |
void | MVP () |
void | NOP () |
void | ORA (uint32_t low, uint32_t high) |
void | PEA () |
void | PEI () |
void | PER () |
void | PHA () |
void | PHB () |
void | PHD () |
void | PHK () |
void | PHP () |
void | PHX () |
void | PHY () |
void | PLA () |
void | PLB () |
void | PLD () |
void | PLP () |
void | PLX () |
void | PLY () |
void | REP () |
void | ROL (uint32_t address, bool accumulator=false) |
void | ROR (uint32_t address, bool accumulator=false) |
void | RTI () |
void | RTL () |
void | RTS () |
void | SBC (uint32_t operand, bool immediate=false) |
void | SEC () |
void | SED () |
void | SEI () |
void | SEP () |
void | STA (uint32_t address) |
void | STP () |
void | STX (uint16_t address) |
void | STY (uint16_t address) |
void | STZ (uint16_t address) |
void | TAX () |
void | TAY () |
void | TCD () |
void | TCS () |
void | TDC () |
void | TRB (uint16_t address) |
void | TSB (uint16_t address) |
void | TSC () |
void | TSX () |
void | TXA () |
void | TXS () |
void | TXY () |
void | TYA () |
void | TYX () |
void | WAI () |
void | WDM () |
void | XBA () |
void | XCE () |
void | And (uint32_t low, uint32_t high) |
void | Eor (uint32_t low, uint32_t high) |
void | Adc (uint32_t low, uint32_t high) |
void | Sbc (uint32_t low, uint32_t high) |
void | Cmp (uint32_t low, uint32_t high) |
void | Cpx (uint32_t low, uint32_t high) |
void | Cpy (uint32_t low, uint32_t high) |
void | Bit (uint32_t low, uint32_t high) |
void | Lda (uint32_t low, uint32_t high) |
void | Ldx (uint32_t low, uint32_t high) |
void | Ldy (uint32_t low, uint32_t high) |
void | Sta (uint32_t low, uint32_t high) |
void | Stx (uint32_t low, uint32_t high) |
void | Sty (uint32_t low, uint32_t high) |
void | Stz (uint32_t low, uint32_t high) |
void | Ror (uint32_t low, uint32_t high) |
void | Rol (uint32_t low, uint32_t high) |
void | Lsr (uint32_t low, uint32_t high) |
void | Asl (uint32_t low, uint32_t high) |
void | Inc (uint32_t low, uint32_t high) |
void | Dec (uint32_t low, uint32_t high) |
void | Tsb (uint32_t low, uint32_t high) |
void | Trb (uint32_t low, uint32_t high) |
uint16_t | SP () const |
void | SetSP (uint16_t value) |
bool | IsBreakpoint (uint32_t address) |
void | SetBreakpoint (uint32_t address) |
void | ClearBreakpoint (uint32_t address) |
void | ClearBreakpoints () |
auto | GetBreakpoints () |
void | CheckInt () |
auto | mutable_log_instructions () -> bool * |
Public Attributes | |
std::vector< uint32_t > | breakpoints_ |
std::vector< InstructionEntry > | instruction_log_ |
uint16_t | A = 0 |
uint16_t | X = 0 |
uint16_t | Y = 0 |
uint16_t | D = 0 |
uint8_t | DB = 0 |
uint8_t | PB = 0 |
uint16_t | PC = 0 |
uint8_t | E = 1 |
uint8_t | status = 0b00110000 |
Private Member Functions | |
void | compare (uint16_t register_value, uint16_t memory_value) |
void | SetFlag (uint8_t mask, bool set) |
bool | GetFlag (uint8_t mask) const |
Private Attributes | |
bool | log_instructions_ = false |
bool | waiting_ = false |
bool | stopped_ = false |
bool | irq_wanted_ = false |
bool | nmi_wanted_ = false |
bool | reset_wanted_ = false |
bool | int_wanted_ = false |
bool | int_delay_ = false |
CpuCallbacks | callbacks_ |
Memory & | memory |
|
strong |
|
inlineexplicit |
Definition at line 34 of file cpu.h.
References callbacks_, and memory.
void yaze::emu::Cpu::Reset | ( | bool | hard = false | ) |
Definition at line 15 of file cpu.cc.
References A, D, DB, E, int_delay_, int_wanted_, irq_wanted_, nmi_wanted_, PB, PC, reset_wanted_, status, stopped_, waiting_, X, and Y.
void yaze::emu::Cpu::RunOpcode | ( | ) |
Definition at line 37 of file cpu.cc.
References callbacks_, CheckInt(), DoInterrupt(), E, ExecuteInstruction(), int_wanted_, irq_wanted_, nmi_wanted_, PB, PC, ReadByte(), ReadOpcode(), ReadWord(), reset_wanted_, SetDecimalFlag(), SetFlags(), SetInterruptFlag(), SetSP(), SP(), status, stopped_, and waiting_.
void yaze::emu::Cpu::ExecuteInstruction | ( | uint8_t | opcode | ) |
Definition at line 104 of file cpu.cc.
References A, Absolute(), Adc(), AdrAbl(), AdrAbx(), AdrAby(), AdrAlx(), AdrDp(), AdrDpx(), AdrDpy(), AdrIdl(), AdrIdp(), AdrIdx(), AdrIdy(), AdrIly(), AdrImp(), AdrIsy(), AdrSr(), And(), Asl(), Bit(), callbacks_, CheckInt(), Cmp(), Cpx(), Cpy(), D, DB, Dec(), DoBranch(), E, Eor(), GetAccumulatorSize(), GetCarryFlag(), GetIndexSize(), GetNegativeFlag(), GetOverflowFlag(), GetZeroFlag(), Immediate(), Inc(), Lda(), Ldx(), Ldy(), log_instructions_, LogInstructions(), Lsr(), ORA(), PB, PC, PopByte(), PopWord(), PushByte(), PushWord(), ReadByte(), ReadOpcode(), ReadOpcodeWord(), ReadWord(), Rol(), Ror(), Sbc(), SetCarryFlag(), SetDecimalFlag(), SetFlags(), SetInterruptFlag(), SetOverflowFlag(), SetSP(), SetZeroFlag(), SetZN(), SP(), Sta(), status, stopped_, Stx(), Sty(), Stz(), Trb(), Tsb(), waiting_, WriteByte(), X, and Y.
Referenced by RunOpcode().
void yaze::emu::Cpu::LogInstructions | ( | uint16_t | PC, |
uint8_t | opcode, | ||
uint16_t | operand, | ||
bool | immediate, | ||
bool | accumulator_mode ) |
Definition at line 1802 of file cpu.cc.
References A, D, DB, yaze::core::FeatureFlags::get(), instruction_log_, opcode_to_mnemonic, PB, PC, SP(), status, X, and Y.
Referenced by ExecuteInstruction().
|
inline |
Definition at line 44 of file cpu.h.
References irq_wanted_.
|
inline |
Definition at line 45 of file cpu.h.
References nmi_wanted_.
void yaze::emu::Cpu::DoInterrupt | ( | ) |
Definition at line 87 of file cpu.cc.
References callbacks_, int_wanted_, nmi_wanted_, PB, PC, PushByte(), PushWord(), ReadWord(), SetDecimalFlag(), SetInterruptFlag(), and status.
Referenced by RunOpcode().
|
inline |
Definition at line 87 of file cpu.h.
References E, GetIndexSize(), SetAccumulatorSize(), SetIndexSize(), SetSP(), SP(), status, X, and Y.
Referenced by ExecuteInstruction(), and RunOpcode().
|
inline |
|
inline |
Definition at line 111 of file cpu.h.
References GetAccumulatorSize().
|
inline |
Definition at line 112 of file cpu.h.
References GetIndexSize().
|
inline |
|
inline |
|
inline |
Definition at line 115 of file cpu.h.
References SetFlag().
Referenced by SetFlags().
|
inline |
Definition at line 116 of file cpu.h.
References SetFlag().
Referenced by SetFlags().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 122 of file cpu.h.
References SetFlag().
Referenced by DoInterrupt(), ExecuteInstruction(), and RunOpcode().
|
inline |
Definition at line 123 of file cpu.h.
References SetFlag().
Referenced by DoInterrupt(), ExecuteInstruction(), and RunOpcode().
|
inline |
|
inline |
|
inline |
Definition at line 128 of file cpu.h.
References GetFlag().
Referenced by ExecuteInstruction().
|
inline |
Definition at line 129 of file cpu.h.
References GetFlag().
Referenced by ExecuteInstruction().
|
inline |
|
inline |
|
inline |
Definition at line 132 of file cpu.h.
References GetFlag().
Referenced by CheckInt().
|
inline |
Definition at line 133 of file cpu.h.
References GetFlag().
Referenced by ExecuteInstruction().
|
inline |
|
inline |
Definition at line 138 of file cpu.h.
References PB, PC, and ReadByte().
Referenced by AdrAbl(), AdrAlx(), AdrDp(), AdrDpx(), AdrDpy(), AdrIdl(), AdrIdp(), AdrIdx(), AdrIdy(), AdrIly(), AdrIsy(), AdrSr(), DirectPage(), DirectPageIndexedX(), DirectPageIndexedY(), DirectPageIndirectLong(), DirectPageIndirectLongIndexedY(), DoBranch(), ExecuteInstruction(), ReadOpcodeWord(), RunOpcode(), and StackRelative().
|
inline |
Definition at line 140 of file cpu.h.
References CheckInt(), and ReadOpcode().
Referenced by Absolute(), AdrAbl(), AdrAbx(), AdrAby(), AdrAlx(), and ExecuteInstruction().
|
inline |
Definition at line 147 of file cpu.h.
References callbacks_.
Referenced by Adc(), AdrIdl(), AdrIly(), AdrImp(), And(), Asl(), Bit(), Cmp(), Cpx(), Cpy(), Dec(), Eor(), ExecuteInstruction(), Inc(), Lda(), Ldx(), Ldy(), Lsr(), ORA(), PopByte(), ReadOpcode(), ReadWord(), ReadWordLong(), Rol(), Ror(), RunOpcode(), Sbc(), Trb(), and Tsb().
|
inline |
Definition at line 148 of file cpu.h.
References CheckInt(), and ReadByte().
Referenced by Adc(), AdrIdl(), AdrIdp(), AdrIdx(), AdrIdy(), AdrIly(), AdrIsy(), And(), Asl(), Bit(), Cmp(), Cpx(), Cpy(), Dec(), DoInterrupt(), Eor(), ExecuteInstruction(), Inc(), Lda(), Ldx(), Ldy(), Lsr(), ORA(), Rol(), Ror(), RunOpcode(), Sbc(), Trb(), and Tsb().
|
inline |
Definition at line 155 of file cpu.h.
References ReadByte().
Referenced by DirectPageIndirectLong(), and DirectPageIndirectLongIndexedY().
|
inline |
|
inline |
|
inline |
Definition at line 178 of file cpu.h.
References callbacks_.
|
inline |
Definition at line 184 of file cpu.h.
References callbacks_, E, SetSP(), and SP().
Referenced by DoInterrupt(), ExecuteInstruction(), PushLong(), and PushWord().
|
inline |
Definition at line 189 of file cpu.h.
References CheckInt(), and PushByte().
Referenced by DoInterrupt(), ExecuteInstruction(), and PushLong().
|
inline |
Definition at line 194 of file cpu.h.
References PushByte(), and PushWord().
|
inline |
Definition at line 199 of file cpu.h.
References E, ReadByte(), SetSP(), and SP().
Referenced by ExecuteInstruction(), PopLong(), and PopWord().
|
inline |
Definition at line 204 of file cpu.h.
References CheckInt(), and PopByte().
Referenced by ExecuteInstruction(), and PopLong().
|
inline |
|
inline |
Definition at line 215 of file cpu.h.
References callbacks_, CheckInt(), PC, and ReadOpcode().
Referenced by ExecuteInstruction().
|
inline |
Definition at line 225 of file cpu.h.
References int_delay_.
uint32_t yaze::emu::Cpu::Absolute | ( | uint32_t * | low | ) |
Definition at line 97 of file addressing.cc.
References DB, and ReadOpcodeWord().
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AbsoluteIndexedX | ( | ) |
uint32_t yaze::emu::Cpu::AdrAbx | ( | uint32_t * | low, |
bool | write ) |
Definition at line 103 of file addressing.cc.
References callbacks_, DB, GetIndexSize(), ReadOpcodeWord(), and X.
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AbsoluteIndexedY | ( | ) |
uint32_t yaze::emu::Cpu::AdrAby | ( | uint32_t * | low, |
bool | write ) |
Definition at line 112 of file addressing.cc.
References callbacks_, DB, GetIndexSize(), ReadOpcodeWord(), and Y.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::AdrImp | ( | ) |
Definition at line 6 of file addressing.cc.
References callbacks_, CheckInt(), int_wanted_, PB, PC, and ReadByte().
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AdrIdx | ( | uint32_t * | low | ) |
Definition at line 158 of file addressing.cc.
References callbacks_, D, DB, ReadOpcode(), ReadWord(), and X.
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AdrIdp | ( | uint32_t * | low | ) |
Definition at line 44 of file addressing.cc.
References callbacks_, D, DB, ReadOpcode(), and ReadWord().
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AdrIdy | ( | uint32_t * | low, |
bool | write ) |
Definition at line 52 of file addressing.cc.
References callbacks_, D, DB, GetIndexSize(), ReadOpcode(), ReadWord(), and Y.
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AdrIdl | ( | uint32_t * | low | ) |
Definition at line 63 of file addressing.cc.
References callbacks_, D, ReadByte(), ReadOpcode(), and ReadWord().
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AdrIly | ( | uint32_t * | low | ) |
Definition at line 72 of file addressing.cc.
References callbacks_, D, ReadByte(), ReadOpcode(), ReadWord(), and Y.
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AdrIsy | ( | uint32_t * | low | ) |
Definition at line 88 of file addressing.cc.
References callbacks_, DB, ReadOpcode(), ReadWord(), SP(), and Y.
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::Immediate | ( | uint32_t * | low, |
bool | xFlag ) |
Definition at line 18 of file addressing.cc.
References GetAccumulatorSize(), GetIndexSize(), PB, and PC.
Referenced by ExecuteInstruction().
uint16_t yaze::emu::Cpu::AbsoluteIndexedIndirect | ( | ) |
uint16_t yaze::emu::Cpu::AbsoluteIndirect | ( | ) |
uint32_t yaze::emu::Cpu::AbsoluteIndirectLong | ( | ) |
uint32_t yaze::emu::Cpu::AbsoluteLong | ( | ) |
uint32_t yaze::emu::Cpu::AdrAbl | ( | uint32_t * | low | ) |
Definition at line 121 of file addressing.cc.
References ReadOpcode(), and ReadOpcodeWord().
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::AbsoluteLongIndexedX | ( | ) |
uint32_t yaze::emu::Cpu::AdrAlx | ( | uint32_t * | low | ) |
Definition at line 128 of file addressing.cc.
References ReadOpcode(), ReadOpcodeWord(), and X.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::BlockMove | ( | uint16_t | source, |
uint16_t | dest, | ||
uint16_t | length ) |
uint16_t yaze::emu::Cpu::DirectPage | ( | ) |
Definition at line 142 of file addressing.cc.
References D, and ReadOpcode().
uint32_t yaze::emu::Cpu::AdrDp | ( | uint32_t * | low | ) |
Definition at line 135 of file addressing.cc.
References callbacks_, D, and ReadOpcode().
Referenced by ExecuteInstruction().
uint16_t yaze::emu::Cpu::DirectPageIndexedX | ( | ) |
Definition at line 147 of file addressing.cc.
References D, GetAccumulatorSize(), ReadOpcode(), and X.
uint32_t yaze::emu::Cpu::AdrDpx | ( | uint32_t * | low | ) |
Definition at line 28 of file addressing.cc.
References callbacks_, D, ReadOpcode(), and X.
Referenced by ExecuteInstruction().
uint16_t yaze::emu::Cpu::DirectPageIndexedY | ( | ) |
Definition at line 153 of file addressing.cc.
References ReadOpcode(), and Y.
uint32_t yaze::emu::Cpu::AdrDpy | ( | uint32_t * | low | ) |
Definition at line 36 of file addressing.cc.
References callbacks_, D, ReadOpcode(), and Y.
Referenced by ExecuteInstruction().
uint16_t yaze::emu::Cpu::DirectPageIndexedIndirectX | ( | ) |
uint16_t yaze::emu::Cpu::DirectPageIndirect | ( | ) |
uint32_t yaze::emu::Cpu::DirectPageIndirectLong | ( | ) |
Definition at line 167 of file addressing.cc.
References D, ReadOpcode(), and ReadWordLong().
uint16_t yaze::emu::Cpu::DirectPageIndirectIndexedY | ( | ) |
uint32_t yaze::emu::Cpu::DirectPageIndirectLongIndexedY | ( | ) |
Definition at line 173 of file addressing.cc.
References D, GetAccumulatorSize(), ReadOpcode(), ReadWordLong(), and Y.
uint16_t yaze::emu::Cpu::Immediate | ( | bool | index_size = false | ) |
uint16_t yaze::emu::Cpu::StackRelative | ( | ) |
Definition at line 181 of file addressing.cc.
References ReadOpcode(), and SP().
uint32_t yaze::emu::Cpu::AdrSr | ( | uint32_t * | low | ) |
Definition at line 81 of file addressing.cc.
References callbacks_, ReadOpcode(), and SP().
Referenced by ExecuteInstruction().
uint32_t yaze::emu::Cpu::StackRelativeIndirectIndexedY | ( | ) |
void yaze::emu::Cpu::ADC | ( | uint16_t | operand | ) |
void yaze::emu::Cpu::AND | ( | uint32_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::ANDAbsoluteLong | ( | uint32_t | address | ) |
void yaze::emu::Cpu::ASL | ( | uint16_t | address | ) |
void yaze::emu::Cpu::BCC | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BCS | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BEQ | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BIT | ( | uint16_t | address | ) |
void yaze::emu::Cpu::BMI | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BNE | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BPL | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BRA | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BRK | ( | ) |
void yaze::emu::Cpu::BRL | ( | int16_t | offset | ) |
void yaze::emu::Cpu::BVC | ( | int8_t | offset | ) |
void yaze::emu::Cpu::BVS | ( | int8_t | offset | ) |
void yaze::emu::Cpu::CLC | ( | ) |
void yaze::emu::Cpu::CLD | ( | ) |
void yaze::emu::Cpu::CLI | ( | ) |
void yaze::emu::Cpu::CLV | ( | ) |
void yaze::emu::Cpu::CMP | ( | uint32_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::COP | ( | ) |
void yaze::emu::Cpu::CPX | ( | uint32_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::CPY | ( | uint32_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::DEC | ( | uint32_t | address, |
bool | accumulator = false ) |
void yaze::emu::Cpu::DEX | ( | ) |
void yaze::emu::Cpu::DEY | ( | ) |
void yaze::emu::Cpu::EOR | ( | uint32_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::INC | ( | uint32_t | address, |
bool | accumulator = false ) |
void yaze::emu::Cpu::INX | ( | ) |
void yaze::emu::Cpu::INY | ( | ) |
void yaze::emu::Cpu::JMP | ( | uint16_t | address | ) |
void yaze::emu::Cpu::JML | ( | uint16_t | address | ) |
void yaze::emu::Cpu::JSR | ( | uint16_t | address | ) |
void yaze::emu::Cpu::JSL | ( | uint16_t | address | ) |
void yaze::emu::Cpu::LDA | ( | uint16_t | address, |
bool | immediate = false, | ||
bool | direct_page = false, | ||
bool | data_bank = false ) |
void yaze::emu::Cpu::LDX | ( | uint16_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::LDY | ( | uint16_t | address, |
bool | immediate = false ) |
void yaze::emu::Cpu::LSR | ( | uint16_t | address, |
bool | accumulator = false ) |
void yaze::emu::Cpu::MVN | ( | ) |
void yaze::emu::Cpu::MVP | ( | ) |
void yaze::emu::Cpu::NOP | ( | ) |
void yaze::emu::Cpu::ORA | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 376 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetNegativeFlag(), and SetZeroFlag().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::PEA | ( | ) |
void yaze::emu::Cpu::PEI | ( | ) |
void yaze::emu::Cpu::PER | ( | ) |
void yaze::emu::Cpu::PHA | ( | ) |
void yaze::emu::Cpu::PHB | ( | ) |
void yaze::emu::Cpu::PHD | ( | ) |
void yaze::emu::Cpu::PHK | ( | ) |
void yaze::emu::Cpu::PHP | ( | ) |
void yaze::emu::Cpu::PHX | ( | ) |
void yaze::emu::Cpu::PHY | ( | ) |
void yaze::emu::Cpu::PLA | ( | ) |
void yaze::emu::Cpu::PLB | ( | ) |
void yaze::emu::Cpu::PLD | ( | ) |
void yaze::emu::Cpu::PLP | ( | ) |
void yaze::emu::Cpu::PLX | ( | ) |
void yaze::emu::Cpu::PLY | ( | ) |
void yaze::emu::Cpu::REP | ( | ) |
void yaze::emu::Cpu::ROL | ( | uint32_t | address, |
bool | accumulator = false ) |
void yaze::emu::Cpu::ROR | ( | uint32_t | address, |
bool | accumulator = false ) |
void yaze::emu::Cpu::RTI | ( | ) |
void yaze::emu::Cpu::RTL | ( | ) |
void yaze::emu::Cpu::RTS | ( | ) |
void yaze::emu::Cpu::SBC | ( | uint32_t | operand, |
bool | immediate = false ) |
void yaze::emu::Cpu::SEC | ( | ) |
void yaze::emu::Cpu::SED | ( | ) |
void yaze::emu::Cpu::SEI | ( | ) |
void yaze::emu::Cpu::SEP | ( | ) |
void yaze::emu::Cpu::STA | ( | uint32_t | address | ) |
void yaze::emu::Cpu::STP | ( | ) |
void yaze::emu::Cpu::STX | ( | uint16_t | address | ) |
void yaze::emu::Cpu::STY | ( | uint16_t | address | ) |
void yaze::emu::Cpu::STZ | ( | uint16_t | address | ) |
void yaze::emu::Cpu::TAX | ( | ) |
void yaze::emu::Cpu::TAY | ( | ) |
void yaze::emu::Cpu::TCD | ( | ) |
void yaze::emu::Cpu::TCS | ( | ) |
void yaze::emu::Cpu::TDC | ( | ) |
void yaze::emu::Cpu::TRB | ( | uint16_t | address | ) |
void yaze::emu::Cpu::TSB | ( | uint16_t | address | ) |
void yaze::emu::Cpu::TSC | ( | ) |
void yaze::emu::Cpu::TSX | ( | ) |
void yaze::emu::Cpu::TXA | ( | ) |
void yaze::emu::Cpu::TXS | ( | ) |
void yaze::emu::Cpu::TXY | ( | ) |
void yaze::emu::Cpu::TYA | ( | ) |
void yaze::emu::Cpu::TYX | ( | ) |
void yaze::emu::Cpu::WAI | ( | ) |
void yaze::emu::Cpu::WDM | ( | ) |
void yaze::emu::Cpu::XBA | ( | ) |
void yaze::emu::Cpu::XCE | ( | ) |
void yaze::emu::Cpu::And | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 6 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), and SetZN().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Eor | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 18 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), and SetZN().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Adc | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 30 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), GetCarryFlag(), GetDecimalFlag(), ReadByte(), ReadWord(), SetCarryFlag(), SetOverflowFlag(), and SetZN().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Sbc | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 70 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), GetCarryFlag(), GetDecimalFlag(), ReadByte(), ReadWord(), SetCarryFlag(), SetOverflowFlag(), and SetZN().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Cmp | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 114 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetCarryFlag(), and SetZN().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Cpx | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 129 of file instructions.cc.
References CheckInt(), GetIndexSize(), ReadByte(), ReadWord(), SetCarryFlag(), SetZN(), and X.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Cpy | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 144 of file instructions.cc.
References CheckInt(), GetIndexSize(), ReadByte(), ReadWord(), SetCarryFlag(), SetZN(), and Y.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Bit | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 159 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetNegativeFlag(), SetOverflowFlag(), and SetZeroFlag().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Lda | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 176 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), and SetZN().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Ldx | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 186 of file instructions.cc.
References CheckInt(), GetIndexSize(), ReadByte(), ReadWord(), SetZN(), and X.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Ldy | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 196 of file instructions.cc.
References CheckInt(), GetIndexSize(), ReadByte(), ReadWord(), SetZN(), and Y.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Sta | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 206 of file instructions.cc.
References A, CheckInt(), GetAccumulatorSize(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Stx | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 215 of file instructions.cc.
References CheckInt(), GetIndexSize(), WriteByte(), WriteWord(), and X.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Sty | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 224 of file instructions.cc.
References CheckInt(), GetIndexSize(), WriteByte(), WriteWord(), and Y.
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Stz | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 233 of file instructions.cc.
References CheckInt(), GetAccumulatorSize(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Ror | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 242 of file instructions.cc.
References callbacks_, CheckInt(), GetAccumulatorSize(), GetCarryFlag(), ReadByte(), ReadWord(), SetCarryFlag(), SetZN(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Rol | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 263 of file instructions.cc.
References callbacks_, CheckInt(), GetAccumulatorSize(), GetCarryFlag(), ReadByte(), ReadWord(), SetCarryFlag(), SetZN(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Lsr | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 280 of file instructions.cc.
References callbacks_, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetCarryFlag(), SetZN(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Asl | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 299 of file instructions.cc.
References callbacks_, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetCarryFlag(), SetZN(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Inc | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 316 of file instructions.cc.
References callbacks_, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetZN(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Dec | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 331 of file instructions.cc.
References callbacks_, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetZN(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Tsb | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 346 of file instructions.cc.
References A, callbacks_, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetZeroFlag(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
void yaze::emu::Cpu::Trb | ( | uint32_t | low, |
uint32_t | high ) |
Definition at line 361 of file instructions.cc.
References A, callbacks_, CheckInt(), GetAccumulatorSize(), ReadByte(), ReadWord(), SetZeroFlag(), WriteByte(), and WriteWord().
Referenced by ExecuteInstruction().
|
inline |
Definition at line 718 of file cpu.h.
References memory.
Referenced by AdrIsy(), AdrSr(), ExecuteInstruction(), LogInstructions(), PopByte(), PushByte(), RunOpcode(), SetFlags(), and StackRelative().
|
inline |
Definition at line 719 of file cpu.h.
References memory.
Referenced by ExecuteInstruction(), PopByte(), PushByte(), RunOpcode(), and SetFlags().
|
inline |
Definition at line 721 of file cpu.h.
References breakpoints_.
|
inline |
Definition at line 725 of file cpu.h.
References breakpoints_.
|
inline |
Definition at line 726 of file cpu.h.
References breakpoints_.
|
inline |
Definition at line 731 of file cpu.h.
References breakpoints_.
|
inline |
Definition at line 735 of file cpu.h.
References breakpoints_.
|
inline |
Definition at line 737 of file cpu.h.
References GetInterruptFlag(), int_delay_, int_wanted_, irq_wanted_, and nmi_wanted_.
Referenced by Adc(), AdrImp(), And(), Asl(), Bit(), Cmp(), Cpx(), Cpy(), Dec(), DoBranch(), Eor(), ExecuteInstruction(), Inc(), Lda(), Ldx(), Ldy(), Lsr(), ORA(), PopWord(), PushWord(), ReadOpcodeWord(), ReadWord(), Rol(), Ror(), RunOpcode(), Sbc(), Sta(), Stx(), Sty(), Stz(), Trb(), Tsb(), and WriteWord().
|
inline |
Definition at line 743 of file cpu.h.
References log_instructions_.
|
inlineprivate |
Definition at line 746 of file cpu.h.
References GetIndexSize(), SetCarryFlag(), SetNegativeFlag(), and SetZeroFlag().
|
inlineprivate |
Definition at line 763 of file cpu.h.
References status.
Referenced by SetAccumulatorSize(), SetBreakFlag(), SetCarryFlag(), SetDecimalFlag(), SetIndexSize(), SetInterruptFlag(), SetNegativeFlag(), SetOverflowFlag(), and SetZeroFlag().
|
inlineprivate |
Definition at line 771 of file cpu.h.
References status.
Referenced by GetBreakFlag(), GetCarryFlag(), GetDecimalFlag(), GetInterruptFlag(), GetNegativeFlag(), GetOverflowFlag(), and GetZeroFlag().
std::vector<uint32_t> yaze::emu::Cpu::breakpoints_ |
Definition at line 47 of file cpu.h.
Referenced by ClearBreakpoint(), ClearBreakpoints(), GetBreakpoints(), IsBreakpoint(), and SetBreakpoint().
std::vector<InstructionEntry> yaze::emu::Cpu::instruction_log_ |
Definition at line 48 of file cpu.h.
Referenced by LogInstructions().
uint16_t yaze::emu::Cpu::A = 0 |
uint16_t yaze::emu::Cpu::X = 0 |
Definition at line 66 of file cpu.h.
Referenced by AdrAbx(), AdrAlx(), AdrDpx(), AdrIdx(), Cpx(), DirectPageIndexedX(), ExecuteInstruction(), Ldx(), LogInstructions(), Reset(), SetFlags(), and Stx().
uint16_t yaze::emu::Cpu::Y = 0 |
Definition at line 67 of file cpu.h.
Referenced by AdrAby(), AdrDpy(), AdrIdy(), AdrIly(), AdrIsy(), Cpy(), DirectPageIndexedY(), DirectPageIndirectLongIndexedY(), ExecuteInstruction(), Ldy(), LogInstructions(), Reset(), SetFlags(), and Sty().
uint16_t yaze::emu::Cpu::D = 0 |
Definition at line 68 of file cpu.h.
Referenced by AdrDp(), AdrDpx(), AdrDpy(), AdrIdl(), AdrIdp(), AdrIdx(), AdrIdy(), AdrIly(), DirectPage(), DirectPageIndexedX(), DirectPageIndirectLong(), DirectPageIndirectLongIndexedY(), ExecuteInstruction(), LogInstructions(), and Reset().
uint8_t yaze::emu::Cpu::DB = 0 |
Definition at line 69 of file cpu.h.
Referenced by Absolute(), AdrAbx(), AdrAby(), AdrIdp(), AdrIdx(), AdrIdy(), AdrIsy(), ExecuteInstruction(), LogInstructions(), and Reset().
uint8_t yaze::emu::Cpu::PB = 0 |
Definition at line 70 of file cpu.h.
Referenced by AdrImp(), DoInterrupt(), ExecuteInstruction(), Immediate(), LogInstructions(), ReadOpcode(), Reset(), and RunOpcode().
uint16_t yaze::emu::Cpu::PC = 0 |
Definition at line 71 of file cpu.h.
Referenced by AdrImp(), DoBranch(), DoInterrupt(), ExecuteInstruction(), Immediate(), LogInstructions(), ReadOpcode(), Reset(), and RunOpcode().
uint8_t yaze::emu::Cpu::E = 1 |
Definition at line 72 of file cpu.h.
Referenced by ExecuteInstruction(), PopByte(), PushByte(), Reset(), RunOpcode(), and SetFlags().
uint8_t yaze::emu::Cpu::status = 0b00110000 |
Definition at line 73 of file cpu.h.
Referenced by DoInterrupt(), ExecuteInstruction(), GetAccumulatorSize(), GetFlag(), GetIndexSize(), LogInstructions(), Reset(), RunOpcode(), SetFlag(), and SetFlags().
|
private |
Definition at line 773 of file cpu.h.
Referenced by ExecuteInstruction(), and mutable_log_instructions().
|
private |
Definition at line 775 of file cpu.h.
Referenced by ExecuteInstruction(), Reset(), and RunOpcode().
|
private |
Definition at line 776 of file cpu.h.
Referenced by ExecuteInstruction(), Reset(), and RunOpcode().
|
private |
Definition at line 778 of file cpu.h.
Referenced by CheckInt(), Reset(), RunOpcode(), and SetIrq().
|
private |
Definition at line 779 of file cpu.h.
Referenced by CheckInt(), DoInterrupt(), Nmi(), Reset(), and RunOpcode().
|
private |
Definition at line 780 of file cpu.h.
Referenced by Reset(), and RunOpcode().
|
private |
Definition at line 781 of file cpu.h.
Referenced by AdrImp(), CheckInt(), DoInterrupt(), Reset(), and RunOpcode().
|
private |
Definition at line 782 of file cpu.h.
Referenced by CheckInt(), Reset(), and set_int_delay().
|
private |
Definition at line 784 of file cpu.h.
Referenced by AdrAbx(), AdrAby(), AdrDp(), AdrDpx(), AdrDpy(), AdrIdl(), AdrIdp(), AdrIdx(), AdrIdy(), AdrIly(), AdrImp(), AdrIsy(), AdrSr(), Asl(), Cpu(), Dec(), DoBranch(), DoInterrupt(), ExecuteInstruction(), Inc(), Lsr(), PushByte(), ReadByte(), Rol(), Ror(), RunOpcode(), Trb(), Tsb(), WriteByte(), WriteLong(), and WriteWord().
|
private |