mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2026-03-11 04:41:57 +00:00
Dump of all my C++ emulators, only Intel8080 integrated so far...
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
29
src/Processor.cpp
Normal file
29
src/Processor.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "stdafx.h"
|
||||
#include "Processor.h"
|
||||
|
||||
EightBit::Processor::Processor(Memory& memory)
|
||||
: m_memory(memory),
|
||||
cycles(0),
|
||||
m_halted(false) {
|
||||
pc.word = sp.word = 0;
|
||||
}
|
||||
|
||||
void EightBit::Processor::reset() {
|
||||
pc.word = 0;
|
||||
}
|
||||
|
||||
void EightBit::Processor::initialise() {
|
||||
sp.word = 0;
|
||||
reset();
|
||||
}
|
||||
|
||||
void EightBit::Processor::pushWord(register16_t value) {
|
||||
sp.word -= 2;
|
||||
setWord(sp.word, value);
|
||||
}
|
||||
|
||||
EightBit::register16_t EightBit::Processor::popWord() {
|
||||
auto value = getWord(sp.word);
|
||||
sp.word += 2;
|
||||
return value;
|
||||
}
|
||||
Reference in New Issue
Block a user