From f46e7c65c53b5b6987427c1559e86e17828c7ff5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 19 May 2022 10:47:57 -0400 Subject: [PATCH] Add AddressRegisterIndirect fetches. --- .../Implementation/68000Mk2Implementation.hpp | 170 +++++++++++++----- 1 file changed, 128 insertions(+), 42 deletions(-) diff --git a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp index b5c3d5881..1b4cbeb88 100644 --- a/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp +++ b/Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp @@ -24,24 +24,35 @@ enum ExecutionState: int { WaitForDTACK, /// Perform the proper sequence to fetch a byte or word operand. - FetchOperandbw, + FetchOperand_bw, /// Perform the proper sequence to fetch a long-word operand. - FetchOperandl, + FetchOperand_l, StoreOperand, // Specific addressing mode fetches. - FetchAddressRegisterIndirect, - FetchAddressRegisterIndirectWithPostincrement, - FetchAddressRegisterIndirectWithPredecrement, - FetchAddressRegisterIndirectWithDisplacement, - FetchAddressRegisterIndirectWithIndex8bitDisplacement, - FetchProgramCounterIndirectWithDisplacement, - FetchProgramCounterIndirectWithIndex8bitDisplacement, - FetchAbsoluteShort, - FetchAbsoluteLong, - FetchImmediateData, + FetchAddressRegisterIndirect_bw, + FetchAddressRegisterIndirectWithPostincrement_bw, + FetchAddressRegisterIndirectWithPredecrement_bw, + FetchAddressRegisterIndirectWithDisplacement_bw, + FetchAddressRegisterIndirectWithIndex8bitDisplacement_bw, + FetchProgramCounterIndirectWithDisplacement_bw, + FetchProgramCounterIndirectWithIndex8bitDisplacement_bw, + FetchAbsoluteShort_bw, + FetchAbsoluteLong_bw, + FetchImmediateData_bw, + + FetchAddressRegisterIndirect_l, + FetchAddressRegisterIndirectWithPostincrement_l, + FetchAddressRegisterIndirectWithPredecrement_l, + FetchAddressRegisterIndirectWithDisplacement_l, + FetchAddressRegisterIndirectWithIndex8bitDisplacement_l, + FetchProgramCounterIndirectWithDisplacement_l, + FetchProgramCounterIndirectWithIndex8bitDisplacement_l, + FetchAbsoluteShort_l, + FetchAbsoluteLong_l, + FetchImmediateData_l, // Various forms of perform; each of these will // perform the current instruction, then do the @@ -248,14 +259,14 @@ void Processor() == InstructionSet::M68k::DataSize::LongWord) { \ SetupDataAccess(temporary_address_, Microcycle::Read, Microcycle::SelectWord); \ - MoveToState(FetchOperandl); \ + MoveToState(FetchOperand_l); \ } else { \ if constexpr (InstructionSet::M68k::operand_size() == InstructionSet::M68k::DataSize::Byte) { \ SetupDataAccess(temporary_address_, Microcycle::Read, Microcycle::SelectByte); \ } else { \ SetupDataAccess(temporary_address_, Microcycle::Read, Microcycle::SelectWord); \ } \ - MoveToState(FetchOperandbw); \ + MoveToState(FetchOperand_bw); \ } switch(instruction_.operation) { @@ -281,6 +292,8 @@ void Processor