Lot's of small niggles corrected across the EightBit libraries

This commit is contained in:
Adrian Conlon
2024-03-18 13:03:41 +00:00
parent 739ce39360
commit 8b6c4a205e
21 changed files with 44 additions and 66 deletions

View File

@@ -18,14 +18,14 @@ void EightBit::BigEndianProcessor::setWord(const register16_t value) {
}
EightBit::register16_t EightBit::BigEndianProcessor::getWordPaged() {
const auto high = getBytePaged();
const auto high = memoryRead();
++BUS().ADDRESS().low;
const auto low = memoryRead();
return { low, high };
}
void EightBit::BigEndianProcessor::setWordPaged(const register16_t value) {
setBytePaged(value.high);
memoryWrite(value.high);
++BUS().ADDRESS().low;
memoryWrite(value.low);
}

View File

@@ -8,6 +8,6 @@ EightBit::ClockedChip::ClockedChip(const ClockedChip& rhs) noexcept
bool EightBit::ClockedChip::operator==(const EightBit::ClockedChip& rhs) const noexcept {
return
Device::operator==(rhs)
Chip::operator==(rhs)
&& cycles() == rhs.cycles();
}

View File

@@ -96,13 +96,13 @@ int EightBit::IntelProcessor::jrConditional(const int condition) {
}
void EightBit::IntelProcessor::ret() {
Processor::ret();
LittleEndianProcessor::ret();
MEMPTR() = PC();
}
bool EightBit::IntelProcessor::operator==(const EightBit::IntelProcessor& rhs) const noexcept {
return
Processor::operator==(rhs)
LittleEndianProcessor::operator==(rhs)
&& HALT() == rhs.HALT()
&& MEMPTR() == rhs.MEMPTR()
&& SP() == rhs.SP()

View File

@@ -21,14 +21,14 @@ void EightBit::LittleEndianProcessor::setWord(const register16_t value) {
}
EightBit::register16_t EightBit::LittleEndianProcessor::getWordPaged() {
const auto low = getBytePaged();
const auto low = memoryRead();
++BUS().ADDRESS().low;
const auto high = memoryRead();
return { low, high };
}
void EightBit::LittleEndianProcessor::setWordPaged(register16_t value) {
setBytePaged(value.low);
memoryWrite(value.low);
++BUS().ADDRESS().low;
memoryWrite(value.high);
}

View File

@@ -60,14 +60,6 @@ uint8_t EightBit::Processor::busRead() {
return BUS().read();
}
uint8_t EightBit::Processor::getBytePaged(const uint8_t page, const uint8_t offset) {
return memoryRead(register16_t(offset, page));
}
void EightBit::Processor::setBytePaged(const uint8_t page, const uint8_t offset, const uint8_t value) {
memoryWrite(register16_t(offset, page), value);
}
EightBit::register16_t EightBit::Processor::getWordPaged(register16_t address) {
BUS().ADDRESS() = address;
return getWordPaged();