From 4b35899a12e36b2270802db5fd15e1fa69c1d921 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 21 May 2022 20:59:34 -0400 Subject: [PATCH] Bcc: properly establish offset. --- .../68000ComparativeTests.mm | 40 +++++++++---------- .../Implementation/68000Mk2Implementation.hpp | 20 ++++++++-- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 4fd301f75..d5d5eca3a 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -156,30 +156,30 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { // To limit tests run to a subset of files and/or of tests, uncomment and fill in below. _fileSet = [NSSet setWithArray:@[ -// @"divu_divs.json", + @"divu_divs.json", // Below this line are passing tests. -// @"abcd_sbcd.json", -// @"add_sub.json", -// @"addi_subi_cmpi.json", -// @"addq_subq.json", -// @"addx_subx.json", -// @"bcc.json", -// @"btst_bchg_bclr_bset.json", -// @"chk.json", -// @"cmp.json", + @"abcd_sbcd.json", + @"add_sub.json", + @"addi_subi_cmpi.json", + @"addq_subq.json", + @"addx_subx.json", + @"bcc.json", + @"btst_bchg_bclr_bset.json", + @"chk.json", + @"cmp.json", @"dbcc_scc.json", -// @"eor_and_or.json", -// @"eori_andi_ori.json", -// @"ext.json", -// @"jsr.json", -// @"movem.json", -// @"movep.json", -// @"nbcd.json", -// @"ext.json", -// @"swap.json", + @"eor_and_or.json", + @"eori_andi_ori.json", + @"ext.json", + @"jsr.json", + @"movem.json", + @"movep.json", + @"nbcd.json", + @"ext.json", + @"swap.json", ]]; // 19/32 = 59 % done, as far as the tests go. - _testSet = [NSSet setWithArray:@[@"DBcc 0051"]]; +// _testSet = [NSSet setWithArray:@[@"Bcc 6000 [79]"]]; } - (void)testAll { diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index 5c875733e..82ccf79f7 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -127,7 +127,8 @@ enum ExecutionState: int { DBcc_condition_true, DBcc_counter_overflow, - Bcc, + Bcc_b, + Bcc_w, Bcc_branch_taken, Bcc_b_branch_not_taken, Bcc_w_branch_not_taken, @@ -592,8 +593,8 @@ void Processor( + instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + + // Next state was set by complete_bcc. + break; + + BeginState(Bcc_w): + operand_[0].w = prefetch_.w; + InstructionSet::M68k::perform( instruction_, operand_[0], operand_[1], status_, *static_cast(this));