#include <mos6510.h>
Cycle-exact 6502/6510 emulation core.
Code is based on work by Simon A. White sidpl.nosp@m.ay2@.nosp@m.yahoo.nosp@m..com. Original Java port by Ken Händel. Later on, it has been hacked to improve compatibility with Lorenz suite on VICE's test suite.
- Author
- alankila
Create new CPU emu
- Parameters
-
| void MOS6510::alr_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ANDs the contents of the A register with an immediate value and then LSRs the result.
| void MOS6510::anc_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - ANC ANDs the contents of the A register with an immediate value and then moves bit 7 of A into the Carry flag. This opcode works basically identically to AND #immed. except that the Carry flag is set to the same state that the Negative flag is set to.
| void MOS6510::arr_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ANDs the contents of the A register with an immediate value and then RORs the result (Implementation based on that of Frodo C64 Emulator)
| void MOS6510::aso_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ASLs the contents of a memory location and then ORs the result with the accumulator.
| void MOS6510::axa_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode stores the result of A AND X AND the high byte of the target address of the operand +1 in memory.
| void MOS6510::axs_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - AXS ANDs the contents of the A and X registers (without changing the contents of either register) and stores the result in memory. AXS does not affect any flags in the processor status register.
| void MOS6510::calculateInterruptTriggerCycle |
( |
| ) |
|
|
inlineprotected |
Evaluate when to execute an interrupt. Calling this method can also result in the decision that no interrupt at all needs to be scheduled.
| void MOS6510::clearIRQ |
( |
| ) |
|
Inform CPU that IRQ is no longer pulled low.
| virtual uint8_t MOS6510::cpuRead |
( |
uint_least16_t |
addr | ) |
|
|
pure virtual |
Get data from system environment
- Parameters
-
- Returns
- data byte CPU requested
Implemented in c64cpu.
| virtual void MOS6510::cpuWrite |
( |
uint_least16_t |
addr, |
|
|
uint8_t |
data |
|
) |
| |
|
pure virtual |
Write data to system environment
- Parameters
-
Implemented in c64cpu.
| void MOS6510::dcm_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode DECs the contents of a memory location and then CMPs the result with the A register.
| void MOS6510::eventWithoutSteals |
( |
| ) |
|
|
protected |
When AEC signal is high, no stealing is possible
| void MOS6510::eventWithSteals |
( |
| ) |
|
|
protected |
When AEC signal is low, steals permitted
| void MOS6510::FetchDataByte |
( |
| ) |
|
|
inlineprotected |
Fetch value, increment PC
Addressing Modes:
| void MOS6510::FetchHighAddr |
( |
| ) |
|
|
inlineprotected |
Fetch high address byte, increment PC (Absolute Addressing)
Low byte must have been obtained first!
Addressing Modes:
| void MOS6510::FetchHighAddrX |
( |
| ) |
|
|
inlineprotected |
Fetch high byte of address, add index register X to low address byte,
increment PC
Addressing Modes:
| void MOS6510::FetchHighAddrX2 |
( |
| ) |
|
|
inlineprotected |
| void MOS6510::FetchHighAddrY |
( |
| ) |
|
|
inlineprotected |
Fetch high byte of address, add index register Y to low address byte,
increment PC
Addressing Modes:
| void MOS6510::FetchHighAddrY2 |
( |
| ) |
|
|
inlineprotected |
| void MOS6510::FetchHighEffAddr |
( |
| ) |
|
|
inlineprotected |
Fetch effective address high
Addressing Modes:
-
Indirect
-
Indexed Indirect (pre X)
| void MOS6510::FetchHighEffAddrY |
( |
| ) |
|
|
inlineprotected |
Fetch effective address high, add Y to low byte of effective address
Addressing Modes:
-
Indirect indexed (post Y)
| void MOS6510::FetchHighEffAddrY2 |
( |
| ) |
|
|
inlineprotected |
| void MOS6510::FetchHighPointer |
( |
| ) |
|
|
inlineprotected |
Fetch pointer address high, increment PC
Addressing Modes:
| void MOS6510::FetchLowAddr |
( |
| ) |
|
|
inlineprotected |
Fetch low address byte, increment PC
Addressing Modes:
-
Stack Manipulation
-
Absolute
-
Zero Page
-
Zero Page Indexed
-
Absolute Indexed
-
Absolute Indirect
| void MOS6510::FetchLowAddrX |
( |
| ) |
|
|
inlineprotected |
Read from address, add index register X to it
Addressing Modes:
| void MOS6510::FetchLowAddrY |
( |
| ) |
|
|
inlineprotected |
Read from address, add index register Y to it
Addressing Modes:
| void MOS6510::FetchLowEffAddr |
( |
| ) |
|
|
inlineprotected |
Fetch effective address low
Addressing Modes:
-
Indirect
-
Indexed Indirect (pre X)
-
Indirect indexed (post Y)
| void MOS6510::FetchLowPointer |
( |
| ) |
|
|
inlineprotected |
Fetch pointer address low, increment PC
Addressing Modes:
-
Absolute Indirect
-
Indirect indexed (post Y)
| void MOS6510::FetchLowPointerX |
( |
| ) |
|
|
inlineprotected |
Add X to it
Addressing Modes:
| void MOS6510::Initialise |
( |
| ) |
|
|
protected |
Initialise CPU Emulation (Registers)
| void MOS6510::ins_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode INCs the contents of a memory location and then SBCs the result from the A register.
| void MOS6510::las_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ANDs the contents of a memory location with the contents of the stack pointer register and stores the result in the accumulator, the X register, and the stack pointer. Affected flags: N Z.
| void MOS6510::lax_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode loads both the accumulator and the X register with the contents of a memory location.
| void MOS6510::lse_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - LSE LSRs the contents of a memory location and then EORs the result with the accumulator.
| void MOS6510::oal_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ORs the A register with #xx, ANDs the result with an immediate value, and then stores the result in both A and X. xx may be EE,EF,FE, OR FF, but most emulators seem to use EE
| void MOS6510::PopHighPC |
( |
| ) |
|
|
inlineprotected |
Increment stack and pull program counter high byte from stack.
| void MOS6510::PopLowPC |
( |
| ) |
|
|
inlineprotected |
Increment stack and pull program counter low byte from stack.
increment S, Pop P off stack
| void MOS6510::PushHighPC |
( |
| ) |
|
|
inlineprotected |
Push Program Counter High Byte on stack, decrement S
| void MOS6510::PushLowPC |
( |
| ) |
|
|
inlineprotected |
Push Program Counter Low Byte on stack, decrement S
Push P on stack, decrement S
| void MOS6510::PutEffAddrDataByte |
( |
| ) |
|
|
inlineprotected |
Write Cycle_Data to effective address.
| void MOS6510::rla_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - RLA ROLs the contents of a memory location and then ANDs the result with the accumulator.
| void MOS6510::rra_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - RRA RORs the contents of a memory location and then ADCs the result with the accumulator.
| void MOS6510::say_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ANDs the contents of the Y register with <ab+1> and stores the result in memory.
| void MOS6510::setFlagsNZ |
( |
uint8_t |
value | ) |
|
|
inlineprotected |
Set N and Z flag values.
- Parameters
-
| void MOS6510::setRDY |
( |
bool |
newRDY | ) |
|
Handle bus access signals. When RDY line is asserted, the CPU will pause when executing the next read operation.
- Parameters
-
| rdy | new state for RDY signal |
| void MOS6510::throwAwayFetch |
( |
| ) |
|
|
inlineprotected |
Read the next opcode byte from memory (and throw it away)
| void MOS6510::throwAwayRead |
( |
| ) |
|
|
inlineprotected |
Issue throw-away read. Some people use these to ACK CIA IRQs.
| void MOS6510::triggerIRQ |
( |
| ) |
|
Pull IRQ line low on CPU.
| void MOS6510::triggerNMI |
( |
| ) |
|
Trigger NMI interrupt on the CPU. Calling this method flags that CPU must enter the NMI routine at earliest opportunity. There is no way to cancel NMI request once given.
| void MOS6510::triggerRST |
( |
| ) |
|
This forces the CPU to abort whatever it is doing and immediately enter the RST interrupt handling sequence. The implementation is not compatible: instructions actually get aborted mid-execution. However, there is no possible way to trigger this signal from programs, so it's OK.
| void MOS6510::xas_instr |
( |
| ) |
|
|
inlineprotected |
Undocumented - This opcode ANDs the contents of the X register with <ab+1> and stores the result in memory.
Current instruction and subcycle within instruction
Table of CPU opcode implementations
| int MOS6510::interruptCycle |
|
protected |
When IRQ was triggered. -MAX means "during some previous instruction", MAX means "no IRQ"
| bool MOS6510::irqAssertedOnPin |
|
protected |
Represents an instruction subcycle that writes
Represents an instruction subcycle that reads
RDY pin state (stop CPU on read)
| const int MOS6510::SR_INTERRUPT = 2 |
|
static |
Status register interrupt bit.
The documentation for this class was generated from the following files: