From ec8f1b0fe0c0189826c5bd213cb31174fe3feb01 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 29 Aug 2023 16:55:39 -0400 Subject: [PATCH] Vary seed between processors. --- OSBindings/Mac/Clock SignalTests/65816ComparativeTests.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/65816ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/65816ComparativeTests.mm index 9426756d8..fb35314b5 100644 --- a/OSBindings/Mac/Clock SignalTests/65816ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/65816ComparativeTests.mm @@ -131,10 +131,10 @@ template void print_registers(FILE *fil using Register = CPU::MOS6502Esque::Register; fprintf(file, "\"pc\": %d, ", (processor.value_of(Register::ProgramCounter) + pc_offset) & 65535); fprintf(file, "\"s\": %d, ", processor.value_of(Register::StackPointer)); - fprintf(file, "\"p\": %d, ", processor.value_of(Register::Flags)); fprintf(file, "\"a\": %d, ", processor.value_of(Register::A)); fprintf(file, "\"x\": %d, ", processor.value_of(Register::X)); fprintf(file, "\"y\": %d, ", processor.value_of(Register::Y)); + fprintf(file, "\"p\": %d, ", processor.value_of(Register::Flags)); if constexpr (has_emulation) { fprintf(file, "\"dbr\": %d, ", processor.value_of(Register::DataBank)); fprintf(file, "\"d\": %d, ", processor.value_of(Register::Direct)); @@ -169,7 +169,8 @@ template void generate() { for(int operation = 0; operation < (has_emulation ? 512 : 256); operation++) { // Make tests repeatable, at least for any given instance of // the runtime. - srand(65816 + operation); + constexpr auto type_offset = int(CPU::MOS6502Esque::Type::TWDC65816) - int(type); + srand(65816 + operation + type_offset); const bool is_emulated = operation & 256; const uint8_t opcode = operation & 255;