2017-06-05 22:24:08 +00:00
|
|
|
#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;
|
2018-09-16 11:00:29 +00:00
|
|
|
registers[idx] = input;
|
2017-06-05 22:24:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|