The Spc700 class represents the SPC700 processor. More...
#include <spc700.h>
Classes | |
struct | Flags |
Public Member Functions | |
Spc700 (ApuCallbacks &callbacks) | |
uint8_t | FlagsToByte (Flags flags) |
Flags | ByteToFlags (uint8_t byte) |
void | Reset (bool hard=false) |
void | RunOpcode () |
void | ExecuteInstructions (uint8_t opcode) |
void | LogInstruction (uint16_t initial_pc, uint8_t opcode) |
uint8_t | read (uint16_t address) |
uint16_t | read_word (uint16_t address) |
uint8_t | ReadOpcode () |
uint16_t | ReadOpcodeWord () |
void | DoBranch (uint8_t value, bool check) |
void | write (uint16_t address, uint8_t value) |
void | push_byte (uint8_t value) |
void | push_word (uint16_t value) |
uint8_t | pull_byte () |
uint16_t | pull_word () |
uint16_t | imm () |
uint8_t | dp () |
uint16_t | dpx () |
uint8_t | get_dp_addr () |
uint8_t | abs_bit (uint16_t *adr) |
uint16_t | dp_dp (uint8_t *src) |
uint16_t | ind () |
uint16_t | ind_ind (uint8_t *srcVal) |
uint16_t | dp_word (uint16_t *low) |
uint16_t | ind_p () |
uint16_t | abs_x () |
uint16_t | abs_y () |
uint16_t | idx () |
uint16_t | idy () |
uint16_t | dp_y () |
uint16_t | dp_imm (uint8_t *srcVal) |
uint16_t | abs () |
int8_t | rel () |
uint8_t | dp_plus_x () |
uint8_t | dp_plus_y () |
uint16_t | dp_plus_x_indirect () |
uint16_t | dp_indirect_plus_y () |
uint8_t | i () |
uint8_t | i_postinc () |
uint16_t | addr_plus_i () |
uint16_t | addr_plus_i_indexed () |
void | MOV (uint16_t adr) |
void | MOV_ADDR (uint16_t address, uint8_t operand) |
void | MOVY (uint16_t adr) |
void | MOVX (uint16_t adr) |
void | MOVS (uint16_t adr) |
void | MOVSX (uint16_t adr) |
void | MOVSY (uint16_t adr) |
void | ADC (uint16_t adr) |
void | ADCM (uint16_t &dest, uint8_t operand) |
void | SBC (uint16_t adr) |
void | SBCM (uint16_t &dest, uint8_t operand) |
void | CMP (uint16_t adr) |
void | CMPX (uint16_t adr) |
void | CMPM (uint16_t dst, uint8_t value) |
void | CMPY (uint16_t adr) |
void | AND (uint16_t adr) |
void | ANDM (uint16_t dest, uint8_t operand) |
void | OR (uint16_t adr) |
void | ORM (uint16_t dest, uint8_t operand) |
void | EOR (uint16_t adr) |
void | EORM (uint16_t dest, uint8_t operand) |
void | ASL (uint16_t operand) |
void | LSR (uint16_t adr) |
void | ROL (uint16_t operand) |
void | ROR (uint16_t adr) |
void | XCN (uint8_t operand, bool isImmediate=false) |
void | INC (uint16_t adr) |
void | DEC (uint16_t operand) |
void | MOVW (uint16_t &dest, uint16_t operand) |
void | INCW (uint16_t &operand) |
void | DECW (uint16_t &operand) |
void | ADDW (uint16_t &dest, uint16_t operand) |
void | SUBW (uint16_t &dest, uint16_t operand) |
void | CMPW (uint16_t operand) |
void | MUL (uint8_t operand) |
void | DIV (uint8_t operand) |
void | BRA (int8_t offset) |
void | BEQ (int8_t offset) |
void | BNE (int8_t offset) |
void | BCS (int8_t offset) |
void | BCC (int8_t offset) |
void | BVS (int8_t offset) |
void | BVC (int8_t offset) |
void | BMI (int8_t offset) |
void | BPL (int8_t offset) |
void | BBS (uint8_t bit, uint8_t operand) |
void | BBC (uint8_t bit, uint8_t operand) |
void | JMP (uint16_t address) |
void | CALL (uint16_t address) |
void | PCALL (uint8_t offset) |
void | TCALL (uint8_t offset) |
void | BRK () |
void | RET () |
void | RETI () |
void | PUSH (uint8_t operand) |
void | POP (uint8_t &operand) |
void | SET1 (uint8_t bit, uint8_t &operand) |
void | CLR1 (uint8_t bit, uint8_t &operand) |
void | TSET1 (uint8_t bit, uint8_t &operand) |
void | TCLR1 (uint8_t bit, uint8_t &operand) |
void | AND1 (uint8_t bit, uint8_t &operand) |
void | OR1 (uint8_t bit, uint8_t &operand) |
void | EOR1 (uint8_t bit, uint8_t &operand) |
void | NOT1 (uint8_t bit, uint8_t &operand) |
void | MOV1 (uint8_t bit, uint8_t &operand) |
void | CLRC () |
void | SETC () |
void | NOTC () |
void | CLRV () |
void | CLRP () |
void | SETP () |
void | EI () |
void | DI () |
void | NOP () |
void | SLEEP () |
void | STOP () |
Public Attributes | |
uint8_t | A = 0x00 |
uint8_t | X = 0x00 |
uint8_t | Y = 0x00 |
uint16_t | YA = 0x00 |
uint16_t | PC = 0xFFC0 |
uint8_t | SP = 0x00 |
Flags | PSW |
Private Attributes | |
ApuCallbacks | callbacks_ |
std::vector< std::string > | log_ |
bool | stopped_ |
bool | reset_wanted_ |
uint8_t | opcode |
uint32_t | step = 0 |
uint32_t | bstep |
uint16_t | adr |
uint16_t | adr1 |
uint8_t | dat |
uint16_t | dat16 |
uint8_t | param |
const uint8_t | ipl_rom_ [64] |
The Spc700 class represents the SPC700 processor.
The Spc700 class provides the functionality to execute instructions, read and write memory, and handle various addressing modes. It also contains registers and flags specific to the SPC700.
AudioRam
object for memory access.
|
inlineexplicit |
|
inline |
|
inline |
void yaze::emu::Spc700::ExecuteInstructions | ( | uint8_t | opcode | ) |
void yaze::emu::Spc700::LogInstruction | ( | uint16_t | initial_pc, |
uint8_t | opcode ) |
|
inline |
|
inline |
|
inline |
uint16_t yaze::emu::Spc700::imm | ( | ) |
Definition at line 79 of file addressing.cc.
uint8_t yaze::emu::Spc700::dp | ( | ) |
Definition at line 82 of file addressing.cc.
uint16_t yaze::emu::Spc700::dpx | ( | ) |
Definition at line 19 of file addressing.cc.
uint8_t yaze::emu::Spc700::get_dp_addr | ( | ) |
uint8_t yaze::emu::Spc700::abs_bit | ( | uint16_t * | adr | ) |
Definition at line 61 of file addressing.cc.
uint16_t yaze::emu::Spc700::dp_dp | ( | uint8_t * | src | ) |
Definition at line 114 of file addressing.cc.
uint16_t yaze::emu::Spc700::ind | ( | ) |
Definition at line 8 of file addressing.cc.
uint16_t yaze::emu::Spc700::ind_ind | ( | uint8_t * | srcVal | ) |
Definition at line 55 of file addressing.cc.
uint16_t yaze::emu::Spc700::dp_word | ( | uint16_t * | low | ) |
Definition at line 67 of file addressing.cc.
uint16_t yaze::emu::Spc700::ind_p | ( | ) |
Definition at line 73 of file addressing.cc.
uint16_t yaze::emu::Spc700::abs_x | ( | ) |
Definition at line 31 of file addressing.cc.
uint16_t yaze::emu::Spc700::abs_y | ( | ) |
Definition at line 37 of file addressing.cc.
uint16_t yaze::emu::Spc700::idx | ( | ) |
Definition at line 13 of file addressing.cc.
uint16_t yaze::emu::Spc700::idy | ( | ) |
Definition at line 43 of file addressing.cc.
uint16_t yaze::emu::Spc700::dp_y | ( | ) |
Definition at line 25 of file addressing.cc.
uint16_t yaze::emu::Spc700::dp_imm | ( | uint8_t * | srcVal | ) |
Definition at line 50 of file addressing.cc.
uint16_t yaze::emu::Spc700::abs | ( | ) |
Definition at line 119 of file addressing.cc.
int8_t yaze::emu::Spc700::rel | ( | ) |
Definition at line 121 of file addressing.cc.
uint8_t yaze::emu::Spc700::dp_plus_x | ( | ) |
Definition at line 87 of file addressing.cc.
uint8_t yaze::emu::Spc700::dp_plus_y | ( | ) |
Definition at line 94 of file addressing.cc.
uint16_t yaze::emu::Spc700::dp_plus_x_indirect | ( | ) |
Definition at line 101 of file addressing.cc.
uint16_t yaze::emu::Spc700::dp_indirect_plus_y | ( | ) |
Definition at line 108 of file addressing.cc.
uint8_t yaze::emu::Spc700::i | ( | ) |
Definition at line 126 of file addressing.cc.
uint8_t yaze::emu::Spc700::i_postinc | ( | ) |
Definition at line 128 of file addressing.cc.
uint16_t yaze::emu::Spc700::addr_plus_i | ( | ) |
Definition at line 134 of file addressing.cc.
uint16_t yaze::emu::Spc700::addr_plus_i_indexed | ( | ) |
Definition at line 140 of file addressing.cc.
void yaze::emu::Spc700::MOV | ( | uint16_t | adr | ) |
Definition at line 41 of file instructions.cc.
void yaze::emu::Spc700::MOV_ADDR | ( | uint16_t | address, |
uint8_t | operand ) |
Definition at line 47 of file instructions.cc.
void yaze::emu::Spc700::MOVY | ( | uint16_t | adr | ) |
Definition at line 14 of file instructions.cc.
void yaze::emu::Spc700::MOVX | ( | uint16_t | adr | ) |
Definition at line 8 of file instructions.cc.
void yaze::emu::Spc700::MOVS | ( | uint16_t | adr | ) |
Definition at line 20 of file instructions.cc.
void yaze::emu::Spc700::MOVSX | ( | uint16_t | adr | ) |
Definition at line 27 of file instructions.cc.
void yaze::emu::Spc700::MOVSY | ( | uint16_t | adr | ) |
Definition at line 34 of file instructions.cc.
void yaze::emu::Spc700::ADC | ( | uint16_t | adr | ) |
Definition at line 53 of file instructions.cc.
void yaze::emu::Spc700::ADCM | ( | uint16_t & | dest, |
uint8_t | operand ) |
Definition at line 64 of file instructions.cc.
void yaze::emu::Spc700::SBC | ( | uint16_t | adr | ) |
Definition at line 76 of file instructions.cc.
void yaze::emu::Spc700::SBCM | ( | uint16_t & | dest, |
uint8_t | operand ) |
Definition at line 87 of file instructions.cc.
void yaze::emu::Spc700::CMP | ( | uint16_t | adr | ) |
Definition at line 125 of file instructions.cc.
void yaze::emu::Spc700::CMPX | ( | uint16_t | adr | ) |
Definition at line 100 of file instructions.cc.
void yaze::emu::Spc700::CMPM | ( | uint16_t | dst, |
uint8_t | value ) |
Definition at line 116 of file instructions.cc.
void yaze::emu::Spc700::CMPY | ( | uint16_t | adr | ) |
Definition at line 108 of file instructions.cc.
void yaze::emu::Spc700::AND | ( | uint16_t | adr | ) |
Definition at line 133 of file instructions.cc.
void yaze::emu::Spc700::ANDM | ( | uint16_t | dest, |
uint8_t | operand ) |
Definition at line 139 of file instructions.cc.
void yaze::emu::Spc700::OR | ( | uint16_t | adr | ) |
Definition at line 146 of file instructions.cc.
void yaze::emu::Spc700::ORM | ( | uint16_t | dest, |
uint8_t | operand ) |
Definition at line 152 of file instructions.cc.
void yaze::emu::Spc700::EOR | ( | uint16_t | adr | ) |
Definition at line 159 of file instructions.cc.
void yaze::emu::Spc700::EORM | ( | uint16_t | dest, |
uint8_t | operand ) |
Definition at line 165 of file instructions.cc.
void yaze::emu::Spc700::ASL | ( | uint16_t | operand | ) |
Definition at line 172 of file instructions.cc.
void yaze::emu::Spc700::LSR | ( | uint16_t | adr | ) |
Definition at line 181 of file instructions.cc.
void yaze::emu::Spc700::ROL | ( | uint16_t | operand | ) |
Definition at line 200 of file instructions.cc.
void yaze::emu::Spc700::ROR | ( | uint16_t | adr | ) |
Definition at line 190 of file instructions.cc.
void yaze::emu::Spc700::XCN | ( | uint8_t | operand, |
bool | isImmediate = false ) |
Definition at line 211 of file instructions.cc.
void yaze::emu::Spc700::INC | ( | uint16_t | adr | ) |
Definition at line 219 of file instructions.cc.
void yaze::emu::Spc700::DEC | ( | uint16_t | operand | ) |
Definition at line 226 of file instructions.cc.
void yaze::emu::Spc700::MOVW | ( | uint16_t & | dest, |
uint16_t | operand ) |
Definition at line 233 of file instructions.cc.
void yaze::emu::Spc700::INCW | ( | uint16_t & | operand | ) |
Definition at line 239 of file instructions.cc.
void yaze::emu::Spc700::DECW | ( | uint16_t & | operand | ) |
Definition at line 245 of file instructions.cc.
void yaze::emu::Spc700::ADDW | ( | uint16_t & | dest, |
uint16_t | operand ) |
Definition at line 251 of file instructions.cc.
void yaze::emu::Spc700::SUBW | ( | uint16_t & | dest, |
uint16_t | operand ) |
Definition at line 260 of file instructions.cc.
void yaze::emu::Spc700::CMPW | ( | uint16_t | operand | ) |
Definition at line 269 of file instructions.cc.
void yaze::emu::Spc700::MUL | ( | uint8_t | operand | ) |
Definition at line 276 of file instructions.cc.
void yaze::emu::Spc700::DIV | ( | uint8_t | operand | ) |
Definition at line 283 of file instructions.cc.
void yaze::emu::Spc700::BRA | ( | int8_t | offset | ) |
Definition at line 296 of file instructions.cc.
void yaze::emu::Spc700::BEQ | ( | int8_t | offset | ) |
Definition at line 298 of file instructions.cc.
void yaze::emu::Spc700::BNE | ( | int8_t | offset | ) |
Definition at line 304 of file instructions.cc.
void yaze::emu::Spc700::BCS | ( | int8_t | offset | ) |
Definition at line 310 of file instructions.cc.
void yaze::emu::Spc700::BCC | ( | int8_t | offset | ) |
Definition at line 316 of file instructions.cc.
void yaze::emu::Spc700::BVS | ( | int8_t | offset | ) |
Definition at line 322 of file instructions.cc.
void yaze::emu::Spc700::BVC | ( | int8_t | offset | ) |
Definition at line 328 of file instructions.cc.
void yaze::emu::Spc700::BMI | ( | int8_t | offset | ) |
Definition at line 334 of file instructions.cc.
void yaze::emu::Spc700::BPL | ( | int8_t | offset | ) |
Definition at line 340 of file instructions.cc.
void yaze::emu::Spc700::BBS | ( | uint8_t | bit, |
uint8_t | operand ) |
Definition at line 346 of file instructions.cc.
void yaze::emu::Spc700::BBC | ( | uint8_t | bit, |
uint8_t | operand ) |
Definition at line 352 of file instructions.cc.
void yaze::emu::Spc700::JMP | ( | uint16_t | address | ) |
Definition at line 360 of file instructions.cc.
void yaze::emu::Spc700::CALL | ( | uint16_t | address | ) |
Definition at line 362 of file instructions.cc.
void yaze::emu::Spc700::PCALL | ( | uint8_t | offset | ) |
Definition at line 370 of file instructions.cc.
void yaze::emu::Spc700::TCALL | ( | uint8_t | offset | ) |
Definition at line 378 of file instructions.cc.
void yaze::emu::Spc700::BRK | ( | ) |
Definition at line 386 of file instructions.cc.
void yaze::emu::Spc700::RET | ( | ) |
Definition at line 394 of file instructions.cc.
void yaze::emu::Spc700::RETI | ( | ) |
Definition at line 400 of file instructions.cc.
void yaze::emu::Spc700::PUSH | ( | uint8_t | operand | ) |
Definition at line 407 of file instructions.cc.
void yaze::emu::Spc700::POP | ( | uint8_t & | operand | ) |
Definition at line 412 of file instructions.cc.
void yaze::emu::Spc700::SET1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 417 of file instructions.cc.
void yaze::emu::Spc700::CLR1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 419 of file instructions.cc.
void yaze::emu::Spc700::TSET1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 421 of file instructions.cc.
void yaze::emu::Spc700::TCLR1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 426 of file instructions.cc.
void yaze::emu::Spc700::AND1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 431 of file instructions.cc.
void yaze::emu::Spc700::OR1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 437 of file instructions.cc.
void yaze::emu::Spc700::EOR1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 443 of file instructions.cc.
void yaze::emu::Spc700::NOT1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 449 of file instructions.cc.
void yaze::emu::Spc700::MOV1 | ( | uint8_t | bit, |
uint8_t & | operand ) |
Definition at line 455 of file instructions.cc.
void yaze::emu::Spc700::CLRC | ( | ) |
Definition at line 460 of file instructions.cc.
void yaze::emu::Spc700::SETC | ( | ) |
Definition at line 462 of file instructions.cc.
void yaze::emu::Spc700::NOTC | ( | ) |
Definition at line 464 of file instructions.cc.
void yaze::emu::Spc700::CLRV | ( | ) |
Definition at line 466 of file instructions.cc.
void yaze::emu::Spc700::CLRP | ( | ) |
Definition at line 468 of file instructions.cc.
void yaze::emu::Spc700::SETP | ( | ) |
Definition at line 470 of file instructions.cc.
void yaze::emu::Spc700::EI | ( | ) |
Definition at line 472 of file instructions.cc.
void yaze::emu::Spc700::DI | ( | ) |
Definition at line 474 of file instructions.cc.
void yaze::emu::Spc700::NOP | ( | ) |
Definition at line 476 of file instructions.cc.
void yaze::emu::Spc700::SLEEP | ( | ) |
Definition at line 478 of file instructions.cc.
void yaze::emu::Spc700::STOP | ( | ) |
Definition at line 480 of file instructions.cc.
|
private |
|
private |