mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-03 02:23:49 +00:00
Fixing a bug with the write in 0x0
This commit is contained in:
@@ -441,4 +441,15 @@ namespace ComSquare::CPU
|
||||
base += this->_registers.dbr << 16u;
|
||||
return base + this->_registers.y;
|
||||
}
|
||||
|
||||
unsigned CPU::STA(uint24_t addr)
|
||||
{
|
||||
if (this->_registers.p.m)
|
||||
this->_bus->write(addr, this->_registers.al);
|
||||
else {
|
||||
this->_bus->write(addr, this->_registers.al);
|
||||
this->_bus->write(addr + 1, this->_registers.ah);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -288,6 +288,8 @@ namespace ComSquare::CPU
|
||||
//! @brief Add with carry - Adds operand to the Accumulator; adds an additional 1 if carry is set.
|
||||
//! @return The number of extra cycles that this operation took.
|
||||
unsigned ADC(uint24_t valueAddr);
|
||||
//! @brief Store the accumulator to memory.
|
||||
unsigned STA(uint24_t addr);
|
||||
public:
|
||||
explicit CPU(std::shared_ptr<Memory::MemoryBus> bus, Cartridge::Header &cartridgeHeader);
|
||||
//! @brief This function continue to execute the Cartridge code.
|
||||
|
||||
Reference in New Issue
Block a user