mirror of
https://github.com/zoriya/ComSquare.git
synced 2025-12-20 06:05:11 +00:00
Solving a bug with the Rectangle memory
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
// Created by anonymus-raccoon on 1/29/20.
|
// Created by anonymus-raccoon on 1/29/20.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
#include "IRectangleMemory.hpp"
|
#include "IRectangleMemory.hpp"
|
||||||
#include "../Exceptions/InvalidAddress.hpp"
|
#include "../Exceptions/InvalidAddress.hpp"
|
||||||
|
|
||||||
@@ -44,8 +45,8 @@ namespace ComSquare::Memory
|
|||||||
uint8_t bank = addr >> 16u;
|
uint8_t bank = addr >> 16u;
|
||||||
uint16_t page = addr;
|
uint16_t page = addr;
|
||||||
|
|
||||||
if (this->_startBank <= bank && bank < this->_endBank)
|
if (this->_startBank <= bank && bank <= this->_endBank)
|
||||||
if (this->_startPage <= page && page < this->_endPage)
|
if (this->_startPage <= page && page <= this->_endPage)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace ComSquare::Memory
|
|||||||
{
|
{
|
||||||
auto it = std::find_if(this->_memoryAccessors.begin(), this->_memoryAccessors.end(), [addr](std::shared_ptr<IMemory> &accessor)
|
auto it = std::find_if(this->_memoryAccessors.begin(), this->_memoryAccessors.end(), [addr](std::shared_ptr<IMemory> &accessor)
|
||||||
{
|
{
|
||||||
|
// std::cout << "Accessor: " << std::hex << accessor->getStart() << " Has access:: " << accessor->hasMemoryAt(addr) << std::endl;
|
||||||
return accessor->hasMemoryAt(addr);
|
return accessor->hasMemoryAt(addr);
|
||||||
});
|
});
|
||||||
if (it == this->_memoryAccessors.end())
|
if (it == this->_memoryAccessors.end())
|
||||||
|
|||||||
Reference in New Issue
Block a user