Fixing rectangle memory endPage inclusivness

This commit is contained in:
Zoe Roux
2021-02-04 11:13:04 +01:00
parent 2e1ede5016
commit 04f9b9a8fc
5 changed files with 16 additions and 15 deletions

View File

@@ -13,7 +13,7 @@ namespace ComSquare::Memory
uint8_t bank = addr >> 16u;
uint16_t page = addr;
unsigned bankCount = bank - this->_startBank;
unsigned pageCount = this->_endPage - this->_startPage;
unsigned pageCount = this->_endPage + 1 - this->_startPage;
if (bank < this->_startBank || bank > this->_endBank)
throw InvalidAddress("Rectangle memory: Invalid Bank", addr);