From 290ab7a4dcc60f5a9f9b8841bd3b9c0d3a198eb0 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Thu, 11 Jan 2018 00:02:44 +0000 Subject: [PATCH] More 8080 simplifications. No need to have it act like a Z80 under the hood. Signed-off-by: Adrian Conlon --- Intel8080/src/Intel8080.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Intel8080/src/Intel8080.cpp b/Intel8080/src/Intel8080.cpp index 36b6b7d..44ba0d9 100644 --- a/Intel8080/src/Intel8080.cpp +++ b/Intel8080/src/Intel8080.cpp @@ -338,15 +338,11 @@ void EightBit::Intel8080::execute(uint8_t& a, uint8_t& f, int x, int y, int z, i case 0: switch (p) { case 0: // LD (BC),A - MEMPTR() = BC(); - setByte(MEMPTR().word++, a); - MEMPTR().high = a; + setByte(BC(), a); addCycles(7); break; case 1: // LD (DE),A - MEMPTR() = DE(); - setByte(MEMPTR().word++, a); - MEMPTR().high = a; + setByte(DE(), a); addCycles(7); break; case 2: // LD (nn),HL @@ -356,8 +352,7 @@ void EightBit::Intel8080::execute(uint8_t& a, uint8_t& f, int x, int y, int z, i break; case 3: // LD (nn),A fetchWord(); - setByte(MEMPTR().word++, a); - MEMPTR().high = a; + setByte(MEMPTR(), a); addCycles(13); break; default: @@ -367,13 +362,11 @@ void EightBit::Intel8080::execute(uint8_t& a, uint8_t& f, int x, int y, int z, i case 1: switch (p) { case 0: // LD A,(BC) - MEMPTR() = BC(); - a = getByte(MEMPTR().word++); + a = getByte(BC()); addCycles(7); break; case 1: // LD A,(DE) - MEMPTR() = DE(); - a = getByte(MEMPTR().word++); + a = getByte(DE()); addCycles(7); break; case 2: // LD HL,(nn) @@ -383,7 +376,7 @@ void EightBit::Intel8080::execute(uint8_t& a, uint8_t& f, int x, int y, int z, i break; case 3: // LD A,(nn) fetchWord(); - a = getByte(MEMPTR().word++); + a = getByte(MEMPTR()); addCycles(13); break; default: