Make ExperimentFlags a singleton, remove inheritance relationships

This commit is contained in:
scawful
2024-12-31 18:13:53 -05:00
parent 5e1e2901ff
commit d3eca0f950
16 changed files with 69 additions and 82 deletions

View File

@@ -1803,7 +1803,7 @@ void Cpu::ExecuteInstruction(uint8_t opcode) {
void Cpu::LogInstructions(uint16_t PC, uint8_t opcode, uint16_t operand,
bool immediate, bool accumulator_mode) {
if (flags()->kLogInstructions) {
if (core::ExperimentFlags::get().kLogInstructions) {
std::ostringstream oss;
oss << "$" << std::uppercase << std::setw(2) << std::setfill('0')
<< static_cast<int>(PB) << ":" << std::hex << PC << ": 0x"

View File

@@ -34,7 +34,7 @@ class InstructionEntry {
std::string instruction; // Human-readable instruction text
};
class Cpu : public core::ExperimentFlags {
class Cpu {
public:
explicit Cpu(Memory& mem, Clock& vclock, CpuCallbacks& callbacks)
: memory(mem), clock(vclock), callbacks_(callbacks) {}