From 6e32ebfffdef016a6a89499bc70ed0af108593b6 Mon Sep 17 00:00:00 2001 From: Sour Date: Thu, 21 Feb 2019 00:40:32 -0500 Subject: [PATCH] CPU: MVN/MVP set the value of DBR to the destination bank --- Core/Cpu.Instructions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/Cpu.Instructions.cpp b/Core/Cpu.Instructions.cpp index 52701c5..f5a55d6 100644 --- a/Core/Cpu.Instructions.cpp +++ b/Core/Cpu.Instructions.cpp @@ -614,7 +614,8 @@ Move operations ****************/ void Cpu::MVN() { - uint32_t destBank = (_operand << 16) & 0xFF0000; + _state.DBR = _operand & 0xFF; + uint32_t destBank = _state.DBR << 16; uint32_t srcBank = (_operand << 8) & 0xFF0000; do { uint8_t value = ReadData(srcBank | _state.X); @@ -628,7 +629,8 @@ void Cpu::MVN() void Cpu::MVP() { - uint32_t destBank = (_operand << 16) & 0xFF0000; + _state.DBR = _operand & 0xFF; + uint32_t destBank = _state.DBR << 16; uint32_t srcBank = (_operand << 8) & 0xFF0000; do { uint8_t value = ReadData(srcBank | _state.X);