mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-22 22:45:52 +00:00
Finishing the SEP
This commit is contained in:
@@ -277,6 +277,8 @@ namespace ComSquare::CPU
|
||||
case Instructions::LDY_ABSY: this->LDY(this->_getAbsoluteIndexedByYAddr()); return 4 + !this->_registers.p.m + this->_hasIndexCrossedPageBoundary;
|
||||
case Instructions::LDY_DPY: this->LDY(this->_getDirectIndexedByYAddr()); return 4 + !this->_registers.p.m + this->_registers.dl != 0;
|
||||
|
||||
case Instructions::SEP: this->SEP(this->_getImmediateAddr()); return 3;
|
||||
|
||||
default:
|
||||
throw InvalidOpcode("CPU", opcode);
|
||||
}
|
||||
|
||||
+3
-1
@@ -258,7 +258,9 @@ namespace ComSquare::CPU
|
||||
LDY_ABS = 0xAC,
|
||||
LDY_DP = 0xA4,
|
||||
LDY_ABSY = 0xBC,
|
||||
LDY_DPY = 0xB4
|
||||
LDY_DPY = 0xB4,
|
||||
|
||||
SEP = 0xE2
|
||||
};
|
||||
|
||||
//! @brief The main CPU
|
||||
|
||||
@@ -8,6 +8,6 @@ namespace ComSquare::CPU
|
||||
{
|
||||
void CPU::SEP(uint24_t addr)
|
||||
{
|
||||
|
||||
this->_registers.p.flags |= this->_bus->read(addr);
|
||||
}
|
||||
}
|
||||
+19
-17
@@ -9,20 +9,22 @@
|
||||
#include "../../sources/SNES.hpp"
|
||||
#include "../../sources/Memory/MemoryBus.hpp"
|
||||
using namespace ComSquare;
|
||||
//
|
||||
//Test(SEP, setall)
|
||||
//{
|
||||
// auto pair = Init();
|
||||
// pair.second.wram->_data[0] = 0xFF;
|
||||
// pair.second.cpu->SEP(0x0);
|
||||
// auto data = pair.second.cpu->_registers.p.flags;
|
||||
// cr_assert_eq(data, 0xFF, "The flag should be 0xFF but it was %b", data);
|
||||
//}
|
||||
//
|
||||
//Test(SEP, setsome)
|
||||
//{
|
||||
// auto pair = Init();
|
||||
// pair.second.wram->_data[0] = 0b10110101;
|
||||
// pair.second.cpu->SEP(0x0);
|
||||
// cr_assert_eq(pair.second.cpu->_registers.p.flags, 0xFF);
|
||||
//}
|
||||
|
||||
Test(SEP, setall)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.wram->_data[0] = 0xFF;
|
||||
pair.second.cpu->SEP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0xFF, "The flag should be 0xFF but it was %x", data);
|
||||
}
|
||||
|
||||
Test(SEP, setsome)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.wram->_data[0] = 0b10110101;
|
||||
pair.second.cpu->_registers.p.flags = 0b01000000;
|
||||
pair.second.cpu->SEP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0b11110101, "The flag should be 245 but it was %i", data);
|
||||
}
|
||||
Reference in New Issue
Block a user