|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.monkeycoder.monkeynes.hardware.NesCpu
This is the brain of the NES. It contains registers, does the work of the OpCodes,
and keeps track of machine cycles.
Originally part of the MonkeyNES project.
| Field Summary | |
static int |
IRQ_VECTOR
|
static int |
NMI_VECTOR
|
static int |
RESET_VECTOR
|
static int |
STACK_PAGE
|
| Constructor Summary | |
NesCpu(NesMainMemory inMainMem,
NesVideoMemory inVidMem)
Creates a new NesCpu. |
|
| Method Summary | |
boolean |
crossesPageBoundry(int inOpCode,
int byte1,
int byte2)
Determines whether or not an operation is going to cross a page boundry. |
void |
doCycle()
Called to tell the CPU to do a cycle. |
int |
getAccumulatorValue()
Gets the value of the Accumulator (ACC) register. |
int |
getAvailCycles()
Gets the number of cycles the CPU has waiting to be used by the next operation. |
int |
getNeedCycles()
Gets the number of cycles the CPU is waiting for before completing the next operation. |
int |
getOpAddress(int inOpCode,
int byte1,
int byte2)
Gets the address at which the parameter value is located. |
int |
getOpValue(int inOpCode,
int byte1,
int byte2)
Gets the parameter value based on the OpCode. |
int |
getProcessorStatusValue()
Gets the value of the Processor Status (PS) register. |
int |
getProgramCounterValue()
Gets the value of the Program Counter (PC) register. |
int |
getStackPointerValue()
Gets the value of the Stack Pointer (SP) register. |
int |
getXIndexValue()
Gets the value of the X-Index (IX) register. |
int |
getYIndexValue()
Gets the value of the Y-Index (IX) register. |
void |
powerOff()
Called to tell the CPU that power is now off. |
void |
powerOn()
Called to tell the CPU that power is now on. |
void |
reset()
Called to tell the CPU that a reset interrupt was triggered. |
void |
setAccumulatorValue(int inValue)
Sets the value of the Accumulator (ACC) register. |
void |
setProcessorStatusValue(int inValue)
Sets the value of the Processor Status (PS) register. |
void |
setProgramCounterValue(int inValue)
Sets the value of the Program Counter (PC) register. |
void |
setStackPointerValue(int inValue)
Sets the value of the Stack Pointer (SP) register. |
void |
setXIndexValue(int inValue)
Sets the value of the X-Index (IX) register. |
void |
setYIndexValue(int inValue)
Sets the value of the Y-Index (IX) register. |
int |
testExecuteInstruction(int inOpCode,
int inByte1,
int inByte2)
For use by the OpCode Test Shell. |
ExecutedInstructionInfo |
testStepInstruction()
For use by the OpCode Test Shell. |
boolean |
willBranch(int inOpCode)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int STACK_PAGE
public static int NMI_VECTOR
public static int RESET_VECTOR
public static int IRQ_VECTOR
| Constructor Detail |
public NesCpu(NesMainMemory inMainMem,
NesVideoMemory inVidMem)
inMainMem - Main memory bank accessed by this CPU.inVidMem - Video memory bank accessed by this CPU.| Method Detail |
public void powerOn()
public void reset()
public void powerOff()
public void doCycle()
public int getOpValue(int inOpCode,
int byte1,
int byte2)
inOpCode - The OpCode whose mode will be used to determine the value.byte1 - The first byte of the param used to lookup the full value.byte2 - The second byte of the param used to lookup the full value.
getOpAddress(int,int,int)
public int getOpAddress(int inOpCode,
int byte1,
int byte2)
inOpCode - The OpCode whose mode will be used to determine the value.byte1 - The first byte of the param used to lookup the full value.byte2 - The second byte of the param used to lookup the full value.
getOpValue(int,int,int)
public boolean crossesPageBoundry(int inOpCode,
int byte1,
int byte2)
inOpCode - The OpCode whose mode will be used to determine the boundry crossing effect.byte1 - The first byte of the param used.byte2 - The second byte of the param used.
public boolean willBranch(int inOpCode)
public int testExecuteInstruction(int inOpCode,
int inByte1,
int inByte2)
inOpCode - The raw OpCode value.inByte1 - The first byte of raw parameter data.inByte2 - The second byte of raw parameter data.
OpCodeTestShellGuipublic ExecutedInstructionInfo testStepInstruction()
OpCodeTestShellGuipublic int getProgramCounterValue()
public int getStackPointerValue()
public int getAccumulatorValue()
public int getXIndexValue()
public int getYIndexValue()
public int getProcessorStatusValue()
public void setProgramCounterValue(int inValue)
public void setStackPointerValue(int inValue)
public void setAccumulatorValue(int inValue)
public void setXIndexValue(int inValue)
public void setYIndexValue(int inValue)
public void setProcessorStatusValue(int inValue)
public int getNeedCycles()
public int getAvailCycles()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||