EightBit/Z80/fusetest_Z80/FuseRegisterState.cpp
Adrian Conlon fe3794e011 Simplify register16_t usage a little.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
2018-09-16 12:00:29 +01:00

33 lines
607 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] = input;
}
}
void Fuse::RegisterState::readInternal(std::ifstream& file) {
file >> i;
file >> r;
file >> iff1;
file >> iff2;
file >> im;
file >> halted;
file >> std::dec;
file >> tstates;
file >> std::hex;
}