mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-08 20:14:53 +00:00
Finishing the TSB
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Created by anonymus-raccoon on 2/20/20.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include "../../Models/Int24.hpp"
|
||||
#include "../CPU.hpp"
|
||||
|
||||
@@ -9,9 +10,13 @@ namespace ComSquare::CPU
|
||||
{
|
||||
int CPU::TSB(uint24_t valueAddr, AddressingMode mode)
|
||||
{
|
||||
uint8_t value = this->_bus->read(valueAddr);
|
||||
uint16_t value = this->_bus->read(valueAddr);
|
||||
if (!this->_registers.p.m)
|
||||
value += this->_bus->read(valueAddr + 1) << 8u;
|
||||
value |= this->_registers.a;
|
||||
this->_bus->write(valueAddr, value);
|
||||
if (!this->_registers.p.m)
|
||||
this->_bus->write(valueAddr + 1, value >> 8u);
|
||||
|
||||
this->_registers.p.z = value == 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user