Remove duplicated code (from const definitions) the performance benefit isn't worth the amount of duplicated code.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2018-06-24 20:58:20 +01:00
parent feb5e7ad60
commit cac871cf2b
30 changed files with 50 additions and 259 deletions
+3 -7
View File
@@ -1,11 +1,11 @@
#include "stdafx.h"
#include "Bus.h"
uint8_t EightBit::Bus::peek() const {
uint8_t EightBit::Bus::peek() {
return reference();
}
uint8_t EightBit::Bus::peek(const uint16_t address) const {
uint8_t EightBit::Bus::peek(const uint16_t address) {
return reference(address);
}
@@ -17,7 +17,7 @@ void EightBit::Bus::poke(const uint16_t address, const uint8_t value) {
reference(address) = value;
}
uint16_t EightBit::Bus::peekWord(const uint16_t address) const {
uint16_t EightBit::Bus::peekWord(const uint16_t address) {
const auto low = peek(address);
const auto high = peek(address + 1);
return register16_t(low, high).word;
@@ -41,10 +41,6 @@ void EightBit::Bus::write(const uint8_t value) {
write();
}
uint8_t EightBit::Bus::reference() const {
return reference(ADDRESS().word);
}
uint8_t& EightBit::Bus::reference() {
return reference(ADDRESS().word);
}