Performance: watch out for unnecessary virtualised methods.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-01-06 17:13:02 +00:00
parent 28f11b15bb
commit 108f66632e
3 changed files with 10 additions and 13 deletions

View File

@ -125,8 +125,8 @@ namespace EightBit {
MEMPTR().word++;
}
virtual void getWordViaMemptr(register16_t& value);
virtual void setWordViaMemptr(register16_t value);
void getWordViaMemptr(register16_t& value);
void setWordViaMemptr(register16_t value);
//

View File

@ -106,8 +106,14 @@ namespace EightBit {
void halt() { --PC().word; lower(HALT()); }
void proceed() { ++PC().word; raise(HALT()); }
virtual uint8_t fetchByte();
virtual void fetchWord(register16_t& output);
uint8_t fetchByte() {
return getByte(PC().word++);
}
void fetchWord(register16_t& output) {
output.low = fetchByte();
output.high = fetchByte();
}
void fetchWord() {
fetchWord(MEMPTR());

View File

@ -27,12 +27,3 @@ int EightBit::Processor::singleStep() {
reset();
return step();
}
uint8_t EightBit::Processor::fetchByte() {
return getByte(PC().word++);
}
void EightBit::Processor::fetchWord(register16_t& output) {
output.low = fetchByte();
output.high = fetchByte();
}