mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-11-18 11:06:15 +00:00
03975bd76b
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
29 lines
563 B
C++
29 lines
563 B
C++
#include "stdafx.h"
|
|
#include "FuseRegisterState.h"
|
|
#include <Processor.h>
|
|
|
|
Fuse::RegisterState::RegisterState()
|
|
: registers(NUMBER_OF_REGISTERS) {
|
|
}
|
|
|
|
void Fuse::RegisterState::read(std::ifstream& file) {
|
|
readExternal(file);
|
|
readInternal(file);
|
|
}
|
|
|
|
void Fuse::RegisterState::readExternal(std::ifstream& file) {
|
|
for (int idx = 0; idx < registers.size(); ++idx) {
|
|
int input;
|
|
file >> input;
|
|
registers[idx] = input;
|
|
}
|
|
}
|
|
|
|
void Fuse::RegisterState::readInternal(std::ifstream& file) {
|
|
file >> halted;
|
|
|
|
file >> std::dec;
|
|
file >> tstates;
|
|
file >> std::hex;
|
|
}
|