From 3b75a815b6a92c1c67aa287ddbd80faa212fb571 Mon Sep 17 00:00:00 2001 From: Ignacio Sanchez Gines <863613+drhelius@users.noreply.github.com> Date: Tue, 2 Jul 2024 19:26:12 +0200 Subject: [PATCH] TAX TAY TSX TXA TXS TYA opcodes --- src/huc6280.h | 2 +- src/huc6280_opcodes.cpp | 6 ++++++ src/huc6280_opcodes_inline.h | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/huc6280.h b/src/huc6280.h index 78527d1..2f72aa8 100644 --- a/src/huc6280.h +++ b/src/huc6280.h @@ -125,7 +125,7 @@ class HuC6280 void OPCodes_Store(EightBitRegister* reg, u16 address); void OPCodes_STZ(u16 address); void OPCodes_Swap(EightBitRegister* reg1, EightBitRegister* reg2); - void OPCodes_Transfer(EightBitRegister* reg, EightBitRegister* target); + void OPCodes_Transfer(EightBitRegister* source, EightBitRegister* dest); void InitOPCodeFunctors(); diff --git a/src/huc6280_opcodes.cpp b/src/huc6280_opcodes.cpp index c010fa4..9bb7c68 100644 --- a/src/huc6280_opcodes.cpp +++ b/src/huc6280_opcodes.cpp @@ -1017,6 +1017,7 @@ void HuC6280::OPCode0x89() void HuC6280::OPCode0x8A() { + // OK // TXA OPCodes_Transfer(&m_X, &m_A); } @@ -1114,6 +1115,7 @@ void HuC6280::OPCode0x97() void HuC6280::OPCode0x98() { + // OK // TYA OPCodes_Transfer(&m_Y, &m_A); } @@ -1127,6 +1129,7 @@ void HuC6280::OPCode0x99() void HuC6280::OPCode0x9A() { + // OK // TXS OPCodes_Transfer(&m_X, &m_S); } @@ -1224,6 +1227,7 @@ void HuC6280::OPCode0xA7() void HuC6280::OPCode0xA8() { + // OK // TAY OPCodes_Transfer(&m_A, &m_Y); } @@ -1237,6 +1241,7 @@ void HuC6280::OPCode0xA9() void HuC6280::OPCode0xAA() { + // OK // TAX OPCodes_Transfer(&m_A, &m_X); } @@ -1348,6 +1353,7 @@ void HuC6280::OPCode0xB9() void HuC6280::OPCode0xBA() { + // OK // TSX OPCodes_Transfer(&m_S, &m_X); } diff --git a/src/huc6280_opcodes_inline.h b/src/huc6280_opcodes_inline.h index d4d980c..43af9d7 100644 --- a/src/huc6280_opcodes_inline.h +++ b/src/huc6280_opcodes_inline.h @@ -469,11 +469,11 @@ inline void HuC6280::OPCodes_Swap(EightBitRegister* reg1, EightBitRegister* reg2 reg2->SetValue(temp); } -inline void HuC6280::OPCodes_Transfer(EightBitRegister* reg, EightBitRegister* target) +inline void HuC6280::OPCodes_Transfer(EightBitRegister* source, EightBitRegister* dest) { ClearFlag(FLAG_MEMORY); - u8 value = reg->GetValue(); - target->SetValue(value); + u8 value = source->GetValue(); + dest->SetValue(value); SetZeroFlagFromResult(value); SetNegativeFlagFromResult(value); }