Lots of whitespace changes after importing the project into Eclipse

This commit is contained in:
Seth Morabito committed 2008-12-06 14:39:54 -08:00
1 parent a6abc2cd23
commit e3300d3166
6 files changed
+164 -33

No files matched your search

+34 -13
View File
@@ -5,35 +5,33 @@ package com.loomcom.j6502;
*/
public class Cpu {
/**
* The Address Decoder responsible for routing memory
* read/write requests to the correct IO devices. Any
* simulated device can be
*/
AddressDecoder m_adc;
/**
* The Program Counter.
*/
int m_pc;
private int m_pc;
/**
* The system stack pointer.
*/
int m_sp;
private int m_sp;
/**
* The internal
* Reference to the simulator
*/
private Simulator m_sim;
public Cpu() {
reset();
public Cpu(Simulator sim) {
reset();
this.m_sim = sim;
}
/**
* Reset the CPU to known initial values.
*/
public void reset() {
m_sp = 0x01ff;
/* locations fffc and fffd hold the reset vector address */
m_pc = 0xfffc;
}
/**
@@ -47,6 +45,29 @@ public class Cpu {
*/
public void nmiInterrupt() {
}
/**
* @return An address specified by the two bytes immediately following the
* Program Counter.
*/
private int readAddress() {
return readAddress(m_pc);
}
/**
* Read the two bytes located at <tt>addr</tt> and <tt>addr + 1</tt>,
* and return the address held there.
*
* @param address
* @return The address specified in the two bytes at location <tt>addr</tt>
*/
private int readAddress(int address) {
return (m_sim.read(address)<<8 & m_sim.read(address+1));
}
public Simulator getSimulator() {
return m_sim;
}
}