mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-04-24 07:16:37 +00:00
Try to correct "one definition rule" problems:
1) No forward declarations 2) No virtual methods defined inline. Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
+23
-1
@@ -16,4 +16,26 @@ void EightBit::IntelProcessor::initialise() {
|
||||
void EightBit::IntelProcessor::reset() {
|
||||
Processor::reset();
|
||||
SP().word = AF().word = BC().word = DE().word = HL().word = Mask16;
|
||||
}
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::push(uint8_t value) {
|
||||
setByte(--SP().word, value);
|
||||
}
|
||||
|
||||
uint8_t EightBit::IntelProcessor::pop() {
|
||||
return getByte(SP().word++);
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::getWordViaMemptr(register16_t& value) {
|
||||
memptrReference();
|
||||
value.low = getByte();
|
||||
BUS().ADDRESS().word++;
|
||||
value.high = getByte();
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::setWordViaMemptr(register16_t value) {
|
||||
memptrReference();
|
||||
setByte(value.low);
|
||||
BUS().ADDRESS().word++;
|
||||
setByte(value.high);
|
||||
}
|
||||
|
||||
@@ -28,3 +28,18 @@ int EightBit::Processor::run(int limit) {
|
||||
int EightBit::Processor::singleStep() {
|
||||
return step();
|
||||
}
|
||||
|
||||
uint8_t EightBit::Processor::fetchByte() {
|
||||
return getByte(PC().word++);
|
||||
}
|
||||
|
||||
void EightBit::Processor::fetchWord(register16_t& output) {
|
||||
output.low = fetchByte();
|
||||
output.high = fetchByte();
|
||||
}
|
||||
|
||||
int EightBit::Processor::fetchExecute() {
|
||||
if (!powered())
|
||||
return 0;
|
||||
return execute(fetchByte());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user