mirror of
https://github.com/tdinucci/6502-emulator.git
synced 2024-11-27 02:49:50 +00:00
20 lines
672 B
C++
20 lines
672 B
C++
#include "test-utils.h"
|
|
|
|
unique_ptr<Machine> create_machine(vector<uint8_t> code) {
|
|
auto machine = make_unique<Machine>(false);
|
|
machine->load(code, CODE_LOAD_ADDR);
|
|
|
|
return machine;
|
|
}
|
|
|
|
bool are_flags_set(const StatusRegister& reg, const RegisterFlagSet& flags) {
|
|
return
|
|
flags.carry == reg.is_carry_set() &&
|
|
flags.zero == reg.is_zero_set() &&
|
|
flags.interupt_disable == reg.is_interupt_disable_set() &&
|
|
flags.decimal == reg.is_interupt_disable_set() &&
|
|
flags.brk == reg.is_break_set() &&
|
|
flags.overflow == reg.is_overflow_set() &&
|
|
flags.negative == reg.is_negative_set();
|
|
}
|