diff --git a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm index 0a5d610a9..4b8284679 100644 --- a/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm +++ b/OSBindings/Mac/Clock SignalTests/68000ComparativeTests.mm @@ -156,7 +156,7 @@ 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:@[ - @"bcc.json", +// @"btst_bchg_bclr_bset.json", // Below this line are passing tests. @"abcd_sbcd.json", @@ -164,10 +164,11 @@ struct TestProcessor: public CPU::MC68000Mk2::BusHandler { @"addi_subi_cmpi.json", @"addq_subq.json", @"addx_subx.json", + @"bcc.json", @"dbcc_scc.json", @"eor_and_or.json", @"nbcd.json", - @"ext.json"]]; // 9/32 = ~28% done, as far as the tests go. + @"ext.json"]]; // 10/32 = ~31 % done, as far as the tests go. // _testSet = [NSSet setWithArray:@[@"ADDQ 05df"]]; } diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index 1b325fb15..157b65858 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -96,6 +96,8 @@ enum ExecutionState: int { Bcc_branch_taken, Bcc_b_branch_not_taken, Bcc_w_branch_not_taken, + + BSR, }; // MARK: - The state machine. @@ -247,18 +249,18 @@ void Processor( + instruction_, operand_[0], operand_[1], status_, *static_cast(this)); + + Prefetch(); // np + Prefetch(); // np + MoveToState(Decode); + // // Various states TODO. // @@ -1255,6 +1291,10 @@ template void ProcessorBase::complete_bcc(bool take_branch, IntT Bcc_b_branch_not_taken : Bcc_w_branch_not_taken; } +void ProcessorBase::bsr(uint32_t offset) { + program_counter_.l = instruction_address_.l + offset + 2; +} + // MARK: - External state. template diff --git a/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp b/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp index 6dea93a02..57ee1080a 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Storage.hpp @@ -79,7 +79,7 @@ struct ProcessorBase: public InstructionSet::M68k::NullFlowController { /// be used to populate microcycles, which may persist beyond an entry /// and exit of run_for (especially between an address announcement, and /// a data select). - uint32_t temporary_address_ = 0; + SlicedInt32 temporary_address_; /// A record of the exception to trigger. int exception_vector_ = 0; @@ -110,7 +110,7 @@ struct ProcessorBase: public InstructionSet::M68k::NullFlowController { inline void did_update_status(); template void complete_bcc(bool, IntT); inline void complete_dbcc(bool, bool, int16_t); - inline void bsr(uint32_t) {} + inline void bsr(uint32_t); inline void jsr(uint32_t) {} inline void jmp(uint32_t) {} inline void rtr() {}