mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-04-22 08:16:54 +00:00
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:
+3
-7
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user