C# Class NesHd.Core.CPU.Cpu

The 6502
显示文件 Open project: afonsof/nes-hd Class Usage Examples

Public Properties

Property Type Description
CycleCounter int
CyclesPerScanline int
Flag_B bool
Flag_C bool
Flag_D bool
Flag_I bool
Flag_N bool
Flag_V bool
Flag_Z bool
IRQNextTime bool
OpCode byte
PrevPc ushort
REG_A byte
REG_PC ushort
REG_S byte
REG_X byte
REG_Y byte

Public Methods

Method Description
Cpu ( System.Memory memory, TvFormat tvFormat, NesEngine engine ) : System

The 6502

Push16 ( ushort data ) : void
PushStatus ( ) : void
Reset ( ) : void
Run ( ) : void

Run the cpu looping

SetTvFormat ( TvFormat format ) : void
SoftReset ( ) : void
StatusRegister ( ) : byte
TogglePause ( ) : void

Pause the cpu

Private Methods

Method Description
AAC ( byte M, int count, ushort bytes ) : void
AAX ( byte M ) : byte
ADC ( byte M, int count, ushort bytes ) : void
AND ( byte M, int count, ushort bytes ) : void
ARR ( byte M ) : void
ASL ( byte M ) : byte
ASR ( byte M ) : void
ATX ( byte M ) : void
AXA ( byte M ) : byte
AXS ( byte M ) : void
Absolute ( byte A, byte B ) : byte
AbsoluteWrite ( byte A, byte B, byte data ) : byte
AbsoluteX ( byte A, byte B, bool CheckPage ) : byte
AbsoluteXWrite ( byte A, byte B, byte data ) : byte
AbsoluteY ( byte A, byte B, bool CheckPage ) : byte
AbsoluteYWrite ( byte A, byte B, byte data ) : byte
BCC ( byte arg1 ) : void
BCS ( byte arg1 ) : void
BEQ ( byte arg1 ) : void
BIT ( byte M, int count, ushort bytes ) : void
BMI ( byte arg1 ) : void
BNE ( byte arg1 ) : void
BPL ( byte arg1 ) : void
BRK ( ) : void
BVC ( byte arg1 ) : void
BVS ( byte arg1 ) : void
CLC ( ) : void
CLD ( ) : void
CLI ( ) : void
CLV ( ) : void
CMP ( byte M, int count, ushort bytes ) : void
CPX ( byte M, int count, ushort bytes ) : void
CPY ( byte M, int count, ushort bytes ) : void
DCP ( byte M, int count, ushort bytes ) : void
DEC ( byte M ) : byte
DEX ( ) : void
DEY ( ) : void
DOP ( int count, ushort bytes ) : void
EOR ( byte M, int count, ushort bytes ) : void
INC ( byte M ) : byte
INX ( ) : void
INY ( ) : void
IRQ ( ) : void
ISC ( byte M, int count, ushort bytes ) : void
IndirectX ( byte A ) : byte
IndirectXWrite ( byte A, byte data ) : byte
IndirectY ( byte A, bool CheckPage ) : byte
IndirectYWrite ( byte A, byte data ) : byte
InitializeCPU ( TvFormat FORMAT ) : void

Initialize and set the timing of the cpu

JSR ( byte arg1, byte arg2 ) : void
KIL ( ) : void
LAR ( byte M, int count, ushort bytes ) : void
LAX ( byte M, int count, ushort bytes ) : void
LDA ( ) : void
LDX ( ) : void
LDY ( ) : void
LSR ( byte M ) : byte
MakeAddress ( byte c, byte d ) : ushort

get two bytes into a correct address

NOP ( ) : void
ORA ( byte M, int count, ushort bytes ) : void
PHA ( ) : void
PHP ( ) : void
PLA ( ) : void
PLP ( ) : void
Pull16 ( ) : ushort
Pull8 ( ) : byte
PullStatus ( ) : void
Push8 ( byte data ) : void
RLA ( byte M, int count, ushort bytes ) : void
ROL ( byte M ) : byte
ROR ( byte M ) : byte
RRA ( byte M, int count, ushort bytes ) : void
RTI ( ) : void
RTS ( ) : void
SBC ( byte M, int count, ushort bytes ) : void
SEC ( ) : void
SED ( ) : void
SEI ( ) : void
SLO ( byte M, int count, ushort bytes ) : void
SRE ( byte M, int count, ushort bytes ) : void
SXA ( byte M ) : byte
SYA ( byte M ) : byte
TAX ( ) : void
TAY ( ) : void
TOP ( int count, ushort bytes ) : void
TSX ( ) : void
TXA ( ) : void
TXS ( ) : void
TYA ( ) : void
XAA ( int count, ushort bytes ) : void
XAS ( byte M, byte arg1 ) : byte
ZeroPage ( ushort A ) : byte
ZeroPageWrite ( ushort A, byte data ) : byte
ZeroPageX ( ushort A ) : byte
ZeroPageXWrite ( ushort A, byte data ) : byte
ZeroPageY ( ushort A ) : byte
ZeroPageYWrite ( ushort A, byte data ) : byte

Method Details

Cpu() public method

The 6502
public Cpu ( System.Memory memory, TvFormat tvFormat, NesEngine engine ) : System
memory System.Memory The memory
tvFormat TvFormat The TV format
engine NesEngine
return System

Push16() public method

public Push16 ( ushort data ) : void
data ushort
return void

PushStatus() public method

public PushStatus ( ) : void
return void

Reset() public method

public Reset ( ) : void
return void

Run() public method

Run the cpu looping
public Run ( ) : void
return void

SetTvFormat() public method

public SetTvFormat ( TvFormat format ) : void
format TvFormat
return void

SoftReset() public method

public SoftReset ( ) : void
return void

StatusRegister() public method

public StatusRegister ( ) : byte
return byte

TogglePause() public method

Pause the cpu
public TogglePause ( ) : void
return void

Property Details

CycleCounter public_oe property

public int CycleCounter
return int

CyclesPerScanline public_oe property

public int CyclesPerScanline
return int

Flag_B public_oe property

public bool Flag_B
return bool

Flag_C public_oe property

public bool Flag_C
return bool

Flag_D public_oe property

public bool Flag_D
return bool

Flag_I public_oe property

public bool Flag_I
return bool

Flag_N public_oe property

public bool Flag_N
return bool

Flag_V public_oe property

public bool Flag_V
return bool

Flag_Z public_oe property

public bool Flag_Z
return bool

IRQNextTime public_oe property

public bool IRQNextTime
return bool

OpCode public_oe property

public byte OpCode
return byte

PrevPc public_oe property

public ushort PrevPc
return ushort

REG_A public_oe property

public byte REG_A
return byte

REG_PC public_oe property

public ushort REG_PC
return ushort

REG_S public_oe property

public byte REG_S
return byte

REG_X public_oe property

public byte REG_X
return byte

REG_Y public_oe property

public byte REG_Y
return byte