From 12565966de97e2d066ec18d3485654decec9f388 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Tue, 2 Jan 2018 23:24:52 +0000 Subject: [PATCH] Remove some assertions from the 6502 implementation. Signed-off-by: Adrian Conlon --- M6502/inc/mos6502.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/M6502/inc/mos6502.h b/M6502/inc/mos6502.h index b8a7941..05f60ed 100644 --- a/M6502/inc/mos6502.h +++ b/M6502/inc/mos6502.h @@ -263,9 +263,6 @@ namespace EightBit { void AM_00(int bbb, uint8_t value) { switch (bbb) { - case 0b000: - assert(false); - break; case 0b001: AM_ZeroPage(value); break; @@ -278,6 +275,7 @@ namespace EightBit { case 0b111: AM_AbsoluteX(value); break; + case 0b000: case 0b010: case 0b100: case 0b110: @@ -407,9 +405,6 @@ namespace EightBit { void AM_10_x(int bbb, uint8_t value) { switch (bbb) { - case 0b000: - assert(false); - break; case 0b001: AM_ZeroPage(value); break; @@ -425,6 +420,7 @@ namespace EightBit { case 0b111: AM_AbsoluteY(value); break; + case 0b000: case 0b100: case 0b110: throw std::domain_error("Illegal addressing mode"); @@ -464,8 +460,6 @@ namespace EightBit { case 0b001: AM_ZeroPage(value); break; - case 0b010: - throw std::domain_error("Illegal addressing mode"); case 0b011: AM_Absolute(value); break; @@ -475,11 +469,12 @@ namespace EightBit { case 0b101: AM_ZeroPageY(value); break; - case 0b110: - throw std::domain_error("Illegal addressing mode"); case 0b111: AM_AbsoluteY(value); break; + case 0b010: + case 0b110: + throw std::domain_error("Illegal addressing mode"); default: UNREACHABLE; } @@ -516,8 +511,6 @@ namespace EightBit { case 0b001: AM_ZeroPage(value); break; - case 0b010: - throw std::domain_error("Illegal addressing mode"); case 0b011: AM_Absolute(value); break; @@ -529,9 +522,12 @@ namespace EightBit { break; case 0b110: AM_AbsoluteY(value); + break; case 0b111: AM_AbsoluteX(value); break; + case 0b010: + throw std::domain_error("Illegal addressing mode"); default: UNREACHABLE; }