Add Processor::pokeWord to define an endian specific 16-bit word write.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2018-10-14 10:05:43 +01:00
parent 9445e7d1c4
commit 7e527ff093
5 changed files with 15 additions and 2 deletions
+6 -1
View File
@@ -27,7 +27,7 @@ EightBit::register16_t EightBit::LittleEndianProcessor::getWordPaged(const uint8
void EightBit::LittleEndianProcessor::setWordPaged(const uint8_t page, const uint8_t offset, const register16_t value) {
setBytePaged(page, offset, value.low);
++BUS().ADDRESS().low;
BUS().read(value.high);
BUS().write(value.high);
}
EightBit::register16_t EightBit::LittleEndianProcessor::fetchWord() {
@@ -52,3 +52,8 @@ EightBit::register16_t EightBit::LittleEndianProcessor::peekWord(const register1
const auto high = BUS().peek(address + 1);
return register16_t(low, high);
}
void EightBit::LittleEndianProcessor::pokeWord(const register16_t address, const register16_t value) {
BUS().poke(address, value.low);
BUS().poke(address + 1, value.high);
}