From f75db1b297ae37038fa1e1c4420d306af5cac002 Mon Sep 17 00:00:00 2001 From: Sour Date: Wed, 20 Feb 2019 20:00:59 -0500 Subject: [PATCH] CPU: Fixed MVN/MVP instructions using the wrong src/dest banks --- Core/Cpu.Instructions.cpp | 8 ++++---- Core/DisassemblyInfo.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/Cpu.Instructions.cpp b/Core/Cpu.Instructions.cpp index 316c66d..e82b152 100644 --- a/Core/Cpu.Instructions.cpp +++ b/Core/Cpu.Instructions.cpp @@ -614,8 +614,8 @@ Move operations ****************/ void Cpu::MVN() { - uint32_t srcBank = (_operand << 16) & 0xFF0000; - uint32_t destBank = (_operand << 8) & 0xFF0000; + uint32_t destBank = (_operand << 16) & 0xFF0000; + uint32_t srcBank = (_operand << 8) & 0xFF0000; while(_state.A != 0xFFFF) { uint8_t value = ReadData(srcBank | _state.X); Write(destBank | _state.Y, value); @@ -628,8 +628,8 @@ void Cpu::MVN() void Cpu::MVP() { - uint32_t srcBank = (_operand << 16) & 0xFF0000; - uint32_t destBank = (_operand << 8) & 0xFF0000; + uint32_t destBank = (_operand << 16) & 0xFF0000; + uint32_t srcBank = (_operand << 8) & 0xFF0000; while(_state.A != 0xFFFF) { uint8_t value = ReadData(srcBank | _state.X); Write(destBank | _state.Y, value); diff --git a/Core/DisassemblyInfo.cpp b/Core/DisassemblyInfo.cpp index 42bf0b0..f2f3fb2 100644 --- a/Core/DisassemblyInfo.cpp +++ b/Core/DisassemblyInfo.cpp @@ -54,7 +54,7 @@ void DisassemblyInfo::GetDisassembly(string &out, uint32_t memoryAddr) case AddrMode::AbsLng: str.Write(operand); break; case AddrMode::AbsLngJmp: str.Write(operand); break; case AddrMode::Acc: break; - case AddrMode::BlkMov: str.Write(operand[0], operand[1], " <- ", operand[2], operand[3]); break; //TODO + case AddrMode::BlkMov: str.Write(operand[1], operand[2], " -> ", operand[3], operand[4]); break; case AddrMode::DirIdxIndX: str.Write('(', operand, ",X)"); break; case AddrMode::DirIdxX: str.Write(operand, ",X"); break; case AddrMode::DirIdxY: str.Write(operand, ",Y"); break;