1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 00:29:34 +00:00

Bcc: properly establish offset.

This commit is contained in:
Thomas Harte 2022-05-21 20:59:34 -04:00
parent 1304e930eb
commit 4b35899a12
2 changed files with 36 additions and 24 deletions

View File

@ -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. // To limit tests run to a subset of files and/or of tests, uncomment and fill in below.
_fileSet = [NSSet setWithArray:@[ _fileSet = [NSSet setWithArray:@[
// @"divu_divs.json", @"divu_divs.json",
// Below this line are passing tests. // Below this line are passing tests.
// @"abcd_sbcd.json", @"abcd_sbcd.json",
// @"add_sub.json", @"add_sub.json",
// @"addi_subi_cmpi.json", @"addi_subi_cmpi.json",
// @"addq_subq.json", @"addq_subq.json",
// @"addx_subx.json", @"addx_subx.json",
// @"bcc.json", @"bcc.json",
// @"btst_bchg_bclr_bset.json", @"btst_bchg_bclr_bset.json",
// @"chk.json", @"chk.json",
// @"cmp.json", @"cmp.json",
@"dbcc_scc.json", @"dbcc_scc.json",
// @"eor_and_or.json", @"eor_and_or.json",
// @"eori_andi_ori.json", @"eori_andi_ori.json",
// @"ext.json", @"ext.json",
// @"jsr.json", @"jsr.json",
// @"movem.json", @"movem.json",
// @"movep.json", @"movep.json",
// @"nbcd.json", @"nbcd.json",
// @"ext.json", @"ext.json",
// @"swap.json", @"swap.json",
]]; // 19/32 = 59 % done, as far as the tests go. ]]; // 19/32 = 59 % done, as far as the tests go.
_testSet = [NSSet setWithArray:@[@"DBcc 0051"]]; // _testSet = [NSSet setWithArray:@[@"Bcc 6000 [79]"]];
} }
- (void)testAll { - (void)testAll {

View File

@ -127,7 +127,8 @@ enum ExecutionState: int {
DBcc_condition_true, DBcc_condition_true,
DBcc_counter_overflow, DBcc_counter_overflow,
Bcc, Bcc_b,
Bcc_w,
Bcc_branch_taken, Bcc_branch_taken,
Bcc_b_branch_not_taken, Bcc_b_branch_not_taken,
Bcc_w_branch_not_taken, Bcc_w_branch_not_taken,
@ -592,8 +593,8 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
StdCASE(DBcc, MoveToState(DBcc)); StdCASE(DBcc, MoveToState(DBcc));
StdCASE(Bccb, perform_state_ = Bcc); StdCASE(Bccb, MoveToState(Bcc_b));
StdCASE(Bccw, perform_state_ = Bcc); StdCASE(Bccw, MoveToState(Bcc_w));
StdCASE(BSRb, perform_state_ = BSR); StdCASE(BSRb, perform_state_ = BSR);
StdCASE(BSRw, perform_state_ = BSR); StdCASE(BSRw, perform_state_ = BSR);
@ -1449,7 +1450,18 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
// //
// Bcc [.b and .w] // Bcc [.b and .w]
// //
BeginState(Bcc): BeginState(Bcc_b):
operand_[0].b = uint8_t(opcode_);
InstructionSet::M68k::perform<InstructionSet::M68k::Model::M68000>(
instruction_, operand_[0], operand_[1], status_, *static_cast<ProcessorBase *>(this));
// Next state was set by complete_bcc.
break;
BeginState(Bcc_w):
operand_[0].w = prefetch_.w;
InstructionSet::M68k::perform<InstructionSet::M68k::Model::M68000>( InstructionSet::M68k::perform<InstructionSet::M68k::Model::M68000>(
instruction_, operand_[0], operand_[1], status_, *static_cast<ProcessorBase *>(this)); instruction_, operand_[0], operand_[1], status_, *static_cast<ProcessorBase *>(this));