1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-16 22:28:57 +00:00

Merge branch '68000Mk2' into InMacintosh

This commit is contained in:
Thomas Harte 2022-05-27 10:34:11 -04:00
commit c367ddff1b
2 changed files with 17 additions and 16 deletions

View File

@ -45,7 +45,7 @@ template <Model model, Operation t_operation> constexpr uint8_t operand_flags(Op
//
// Single-operand write.
//
case Operation::MOVEfromSR: case Operation::MOVEfromUSP:
case Operation::MOVEfromUSP:
return StoreOp1;
//
@ -66,8 +66,9 @@ template <Model model, Operation t_operation> constexpr uint8_t operand_flags(Op
return FetchOp1 | StoreOp1;
//
// CLR, which is model-dependent.
// CLR and MOVE SR, which are model-dependent.
//
case Operation::MOVEfromSR:
case Operation::CLRb: case Operation::CLRw: case Operation::CLRl:
if constexpr (model == Model::M68000) {
return FetchOp1 | StoreOp1;

View File

@ -86,16 +86,16 @@ enum ExecutionState: int {
FetchAbsoluteLong_l,
FetchImmediateData_l,
CalcEffectiveAddress,
CalcAddressRegisterIndirect,
CalcAddressRegisterIndirectWithPostincrement,
CalcAddressRegisterIndirectWithPredecrement,
CalcAddressRegisterIndirectWithDisplacement,
CalcAddressRegisterIndirectWithIndex8bitDisplacement,
CalcProgramCounterIndirectWithDisplacement,
CalcProgramCounterIndirectWithIndex8bitDisplacement,
CalcAbsoluteShort,
CalcAbsoluteLong,
CalcEffectiveAddress, // -
CalcAddressRegisterIndirect, // -
CalcAddressRegisterIndirectWithPostincrement, // -
CalcAddressRegisterIndirectWithPredecrement, // -
CalcAddressRegisterIndirectWithDisplacement, // np
CalcAddressRegisterIndirectWithIndex8bitDisplacement, // n np n
CalcProgramCounterIndirectWithDisplacement, // np
CalcProgramCounterIndirectWithIndex8bitDisplacement, // n np n
CalcAbsoluteShort, // np
CalcAbsoluteLong, // np np
// Various forms of perform; each of these will
// perform the current instruction, then do the
@ -943,14 +943,12 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
Duplicate(MOVEtoCCR, MOVEtoSR);
StdCASE(MOVEtoSR, perform_state_ = MOVEtoCCRSR);
StdCASE(MOVEfromSR, {
if(instruction_.mode(0) == Mode::DataRegisterDirect) {
post_ea_state_ = Perform_np_n;
perform_state_ = Perform_np_n;
} else {
post_ea_state_ = Perform_np;
perform_state_ = Perform_np;
}
MoveToStateSpecific(CalcEffectiveAddress);
});
SpecialCASE(RTR);
@ -1324,6 +1322,7 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
BeginState(CalcAddressRegisterIndirectWithIndex8bitDisplacement):
effective_address_[next_operand_].l = d8Xn(registers_[8 + instruction_.reg(next_operand_)].l);
IdleBus(1); // n
Prefetch(); // np
IdleBus(1); // n
MoveToStateDynamic(post_ea_state_);
@ -1359,6 +1358,7 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
BeginState(CalcProgramCounterIndirectWithIndex8bitDisplacement):
effective_address_[next_operand_].l = d8Xn(program_counter_.l - 2);
IdleBus(1); // n
Prefetch(); // np
IdleBus(1); // n
MoveToStateDynamic(post_ea_state_);