- Continued refactoring of address decoding.

- Device read and write may now throw MemoryAccessException, and appropriate
  throws clauses have been added throughout the code.
This commit is contained in:
Seth J. Morabito committed 2010-01-09 16:53:04 -08:00
1 parent a01090a16e
commit ac88786df7
21 files changed
+465 -446

No files matched your search

@@ -1,7 +1,8 @@
package com.loomcom.symon;
import com.loomcom.symon.devices.Memory;
import com.loomcom.symon.exceptions.MemoryRangeException;
import com.loomcom.symon.exceptions.MemoryAccessException;
import junit.framework.TestCase;
public class CpuAbsoluteYModeTest extends TestCase {
@@ -47,7 +48,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* ORA - Logical Inclusive OR - $19 */
public void test_ORA() {
public void test_ORA() throws MemoryAccessException {
// Set some initial values in memory
bus.write(0x2c30, 0x00);
bus.write(0x2c32, 0x11);
@@ -93,7 +94,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* AND - Logical AND - $39 */
public void test_AND() {
public void test_AND() throws MemoryAccessException {
bus.write(0x1a30, 0x00);
bus.write(0x1a31, 0x11);
bus.write(0x1a32, 0xff);
@@ -153,7 +154,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* EOR - Exclusive OR - $59 */
public void test_EOR() {
public void test_EOR() throws MemoryAccessException {
bus.write(0xab40, 0x00);
bus.write(0xab41, 0xff);
bus.write(0xab42, 0x33);
@@ -189,7 +190,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* ADC - Add with Carry - $79 */
public void test_ADC() {
public void test_ADC() throws MemoryAccessException {
bus.write(0xab40, 0x01);
bus.write(0xab41, 0xff);
@@ -275,7 +276,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
assertTrue(cpu.getCarryFlag());
}
public void test_ADC_IncludesCarry() {
public void test_ADC_IncludesCarry() throws MemoryAccessException {
bus.write(0xab40, 0x01);
bus.loadProgram(0xa9, 0x00, // LDA #$00
@@ -292,7 +293,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
assertFalse(cpu.getCarryFlag());
}
public void test_ADC_DecimalMode() {
public void test_ADC_DecimalMode() throws MemoryAccessException {
bus.write(0xab40, 0x01);
bus.write(0xab41, 0x99);
@@ -378,7 +379,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* STA - Store Accumulator - $99 */
public void test_STA() {
public void test_STA() throws MemoryAccessException {
cpu.setYRegister(0x30);
cpu.setAccumulator(0x00);
@@ -409,7 +410,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* LDX - Load X Register - $be */
public void test_LDX() {
public void test_LDX() throws MemoryAccessException {
bus.write(0xab45, 0x00);
bus.write(0xab46, 0x0f);
bus.write(0xab47, 0x80);
@@ -438,7 +439,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* LDA - Load Accumulator - $b9 */
public void test_LDA() {
public void test_LDA() throws MemoryAccessException {
bus.write(0xab42, 0x00);
bus.write(0xab43, 0x0f);
bus.write(0xab44, 0x80);
@@ -467,7 +468,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* CMP - Compare Accumulator - $d9 */
public void test_CMP() {
public void test_CMP() throws MemoryAccessException {
bus.write(0xab40, 0x00);
bus.write(0xab41, 0x80);
bus.write(0xab42, 0xff);
@@ -498,7 +499,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
/* SBC - Subtract with Carry - $f9 */
public void test_SBC() {
public void test_SBC() throws MemoryAccessException {
bus.write(0xab40, 0x01);
bus.loadProgram(0xa9, 0x00, // LDA #$00
@@ -556,7 +557,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
assertTrue(cpu.getCarryFlag());
}
public void test_SBC_IncludesNotOfCarry() {
public void test_SBC_IncludesNotOfCarry() throws MemoryAccessException {
bus.write(0xab40, 0x01);
// Subtrace with Carry Flag cleared
@@ -601,7 +602,7 @@ public class CpuAbsoluteYModeTest extends TestCase {
}
public void test_SBC_DecimalMode() {
public void test_SBC_DecimalMode() throws MemoryAccessException {
bus.write(0xab40, 0x01);
bus.write(0xab50, 0x11);