EightBit/LR35902/fusetest_LR35902/FuseRegisterState.cpp
Adrian.Conlon f0515ae65f First stab at a port of the fuse tests to LR35902.
Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
2017-08-10 20:34:17 +01:00

28 lines
545 B
C++

#include "stdafx.h"
#include "FuseRegisterState.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].word = input;
}
}
void Fuse::RegisterState::readInternal(std::ifstream& file) {
file >> halted;
file >> std::dec;
file >> tstates;
file >> std::hex;
}