openMSX
|
#include <CPUCore.hh>
Public Member Functions | |
CPUCore (MSXMotherBoard &motherboard, const std::string &name, const BooleanSetting &traceSetting, TclCallback &diHaltCallback, EmuTime::param time) | |
void | setInterface (MSXCPUInterface *interf) |
void | doReset (EmuTime::param time) |
Reset the CPU. More... | |
void | execute (bool fastForward) |
void | exitCPULoopSync () |
Request to exit the main CPU emulation loop. More... | |
void | exitCPULoopAsync () |
Similar to exitCPULoopSync(), but this method may be called from any thread. More... | |
void | warp (EmuTime::param time) |
EmuTime::param | getCurrentTime () const |
void | wait (EmuTime::param time) |
EmuTime | waitCycles (EmuTime::param time, unsigned cycles) |
void | setNextSyncPoint (EmuTime::param time) |
auto | getCacheLines () |
bool | isM1Cycle (unsigned address) const |
void | disasmCommand (Interpreter &interp, span< const TclObject > tokens, TclObject &result) const |
void | raiseIRQ () |
Raises the maskable interrupt count. More... | |
void | lowerIRQ () |
Lowers the maskable interrupt count. More... | |
void | raiseNMI () |
Raises the non-maskable interrupt count. More... | |
void | lowerNMI () |
Lowers the non-maskable interrupt count. More... | |
void | setFreq (unsigned freq) |
Change the clock freq. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
template<bool PRE_PB, bool POST_PB> | |
NEVER_INLINE byte | RDMEMslow (unsigned address, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE byte | RDMEM_impl2 (unsigned address, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE byte | RDMEM_impl (unsigned address, unsigned cc) |
template<unsigned PC_OFFSET> | |
ALWAYS_INLINE byte | RDMEM_OPCODE (unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
NEVER_INLINE unsigned | RD_WORD_slow (unsigned address, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE unsigned | RD_WORD_impl2 (unsigned address, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE unsigned | RD_WORD_impl (unsigned address, unsigned cc) |
template<unsigned PC_OFFSET> | |
ALWAYS_INLINE unsigned | RD_WORD_PC (unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
NEVER_INLINE void | WRMEMslow (unsigned address, byte value, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE void | WRMEM_impl2 (unsigned address, byte value, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE void | WRMEM_impl (unsigned address, byte value, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
NEVER_INLINE void | WR_WORD_rev_slow (unsigned address, unsigned value, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE void | WR_WORD_rev2 (unsigned address, unsigned value, unsigned cc) |
template<bool PRE_PB, bool POST_PB> | |
ALWAYS_INLINE void | WR_WORD_rev (unsigned address, unsigned value, unsigned cc) |
template<Reg8 R8> | |
ALWAYS_INLINE byte | get8 () const |
template<Reg16 R16> | |
ALWAYS_INLINE unsigned | get16 () const |
template<Reg8 R8> | |
ALWAYS_INLINE void | set8 (byte x) |
template<Reg16 R16> | |
ALWAYS_INLINE void | set16 (unsigned x) |
![]() | |
CPURegs (bool r800) | |
byte | getA () const |
byte | getF () const |
byte | getB () const |
byte | getC () const |
byte | getD () const |
byte | getE () const |
byte | getH () const |
byte | getL () const |
byte | getA2 () const |
byte | getF2 () const |
byte | getB2 () const |
byte | getC2 () const |
byte | getD2 () const |
byte | getE2 () const |
byte | getH2 () const |
byte | getL2 () const |
byte | getIXh () const |
byte | getIXl () const |
byte | getIYh () const |
byte | getIYl () const |
byte | getPCh () const |
byte | getPCl () const |
byte | getSPh () const |
byte | getSPl () const |
unsigned | getAF () const |
unsigned | getBC () const |
unsigned | getDE () const |
unsigned | getHL () const |
unsigned | getAF2 () const |
unsigned | getBC2 () const |
unsigned | getDE2 () const |
unsigned | getHL2 () const |
unsigned | getIX () const |
unsigned | getIY () const |
unsigned | getPC () const |
unsigned | getSP () const |
byte | getIM () const |
byte | getI () const |
byte | getR () const |
bool | getIFF1 () const |
bool | getIFF2 () const |
byte | getHALT () const |
void | setA (byte x) |
void | setF (byte x) |
void | setB (byte x) |
void | setC (byte x) |
void | setD (byte x) |
void | setE (byte x) |
void | setH (byte x) |
void | setL (byte x) |
void | setA2 (byte x) |
void | setF2 (byte x) |
void | setB2 (byte x) |
void | setC2 (byte x) |
void | setD2 (byte x) |
void | setE2 (byte x) |
void | setH2 (byte x) |
void | setL2 (byte x) |
void | setIXh (byte x) |
void | setIXl (byte x) |
void | setIYh (byte x) |
void | setIYl (byte x) |
void | setPCh (byte x) |
void | setPCl (byte x) |
void | setSPh (byte x) |
void | setSPl (byte x) |
void | setAF (unsigned x) |
void | setBC (unsigned x) |
void | setDE (unsigned x) |
void | setHL (unsigned x) |
void | setAF2 (unsigned x) |
void | setBC2 (unsigned x) |
void | setDE2 (unsigned x) |
void | setHL2 (unsigned x) |
void | setIX (unsigned x) |
void | setIY (unsigned x) |
void | setPC (unsigned x) |
void | setSP (unsigned x) |
void | setIM (byte x) |
void | setI (byte x) |
void | setR (byte x) |
void | setIFF1 (bool x) |
void | setIFF2 (bool x) |
void | setHALT (bool x) |
void | setExtHALT (bool x) |
void | incR (byte x) |
void | setCurrentEI () |
void | setCurrentLDAI () |
void | setCurrentCall () |
void | setCurrentPopRet () |
bool | prevWasEI () const |
bool | prevWasLDAI () const |
bool | prev2WasCall () const |
bool | prevWasPopRet () const |
void | endInstruction () |
void | clearPrevious () |
void | checkNoCurrentFlags () const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Friends | |
class | MSXCPU |
class | Z80TYPE |
class | R800TYPE |
Definition at line 49 of file CPUCore.hh.
openmsx::CPUCore< T >::CPUCore | ( | MSXMotherBoard & | motherboard, |
const std::string & | name, | ||
const BooleanSetting & | traceSetting, | ||
TclCallback & | diHaltCallback, | ||
EmuTime::param | time | ||
) |
Definition at line 283 of file CPUCore.cc.
References openmsx::CPUCore< CPU_POLICY >::doReset().
void openmsx::CPUCore< T >::disasmCommand | ( | Interpreter & | interp, |
span< const TclObject > | tokens, | ||
TclObject & | result | ||
) | const |
Definition at line 512 of file CPUCore.cc.
References openmsx::TclObject::addListElement(), openmsx::dasm(), span< ElementType, Extent >::size(), and xrange().
void openmsx::CPUCore< T >::doReset | ( | EmuTime::param | time | ) |
Reset the CPU.
Definition at line 334 of file CPUCore.cc.
Referenced by openmsx::CPUCore< CPU_POLICY >::CPUCore().
void openmsx::CPUCore< T >::execute | ( | bool | fastForward | ) |
Definition at line 2539 of file CPUCore.cc.
void openmsx::CPUCore< T >::exitCPULoopAsync |
Similar to exitCPULoopSync(), but this method may be called from any thread.
Although now the loop will only be exited 'soon'.
Definition at line 397 of file CPUCore.cc.
void openmsx::CPUCore< T >::exitCPULoopSync |
Request to exit the main CPU emulation loop.
This method may only be called from the main thread. The CPU loop will immediately be exited (current instruction will be finished, but no new instruction will be executed).
Definition at line 402 of file CPUCore.cc.
References openmsx::Thread::isMainThread().
ALWAYS_INLINE unsigned openmsx::CPUCore< CPU_POLICY >::get16 | ( | ) | const |
Definition at line 2663 of file CPUCore.cc.
References openmsx::AF, openmsx::BC, openmsx::DE, openmsx::HL, openmsx::IX, openmsx::IY, openmsx::SP, and UNREACHABLE.
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::get8 | ( | ) | const |
Definition at line 2645 of file CPUCore.cc.
References openmsx::A, openmsx::B, openmsx::C, openmsx::D, openmsx::DUMMY, openmsx::E, openmsx::F, openmsx::H, openmsx::IXH, openmsx::IXL, openmsx::IYH, openmsx::IYL, openmsx::L, openmsx::REG_I, openmsx::REG_R, and UNREACHABLE.
|
inline |
Definition at line 82 of file CPUCore.hh.
EmuTime::param openmsx::CPUCore< T >::getCurrentTime |
Definition at line 329 of file CPUCore.cc.
bool openmsx::CPUCore< T >::isM1Cycle | ( | unsigned | address | ) | const |
Definition at line 463 of file CPUCore.cc.
void openmsx::CPUCore< T >::lowerIRQ |
Lowers the maskable interrupt count.
Devices should call MSXCPU::lowerIRQ instead, or use the IRQHelper class.
Definition at line 441 of file CPUCore.cc.
void openmsx::CPUCore< T >::lowerNMI |
Lowers the non-maskable interrupt count.
Devices should call MSXCPU::lowerNMI instead, or use the IRQHelper class.
Definition at line 457 of file CPUCore.cc.
void openmsx::CPUCore< T >::raiseIRQ |
Raises the maskable interrupt count.
Devices should call MSXCPU::raiseIRQ instead, or use the IRQHelper class.
Definition at line 432 of file CPUCore.cc.
void openmsx::CPUCore< T >::raiseNMI |
Raises the non-maskable interrupt count.
Devices should call MSXCPU::raiseNMI instead, or use the IRQHelper class.
Definition at line 447 of file CPUCore.cc.
ALWAYS_INLINE unsigned openmsx::CPUCore< CPU_POLICY >::RD_WORD_impl | ( | unsigned | address, |
unsigned | cc | ||
) |
Definition at line 661 of file CPUCore.cc.
ALWAYS_INLINE unsigned openmsx::CPUCore< CPU_POLICY >::RD_WORD_impl2 | ( | unsigned | address, |
unsigned | cc | ||
) |
Definition at line 647 of file CPUCore.cc.
References openmsx::CacheLine::BITS, likely, openmsx::CacheLine::LOW, and Endian::read_UA_L16().
ALWAYS_INLINE unsigned openmsx::CPUCore< CPU_POLICY >::RD_WORD_PC | ( | unsigned | cc | ) |
Definition at line 667 of file CPUCore.cc.
NEVER_INLINE unsigned openmsx::CPUCore< CPU_POLICY >::RD_WORD_slow | ( | unsigned | address, |
unsigned | cc | ||
) |
Definition at line 640 of file CPUCore.cc.
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEM_impl | ( | unsigned | address, |
unsigned | cc | ||
) |
Definition at line 614 of file CPUCore.cc.
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEM_impl2 | ( | unsigned | address, |
unsigned | cc | ||
) |
Definition at line 601 of file CPUCore.cc.
References openmsx::CacheLine::BITS, and likely.
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEM_OPCODE | ( | unsigned | cc | ) |
Definition at line 620 of file CPUCore.cc.
NEVER_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEMslow | ( | unsigned | address, |
unsigned | cc | ||
) |
Definition at line 575 of file CPUCore.cc.
References openmsx::CacheLine::BITS, openmsx::CacheLine::HIGH, and openmsx::NonCachedRead.
void openmsx::CPUCore< T >::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 4391 of file CPUCore.cc.
References openmsx::serialize().
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::set16 | ( | unsigned | x | ) |
Definition at line 2691 of file CPUCore.cc.
References openmsx::AF, openmsx::BC, openmsx::DE, openmsx::HL, openmsx::IX, openmsx::IY, openmsx::SP, UNREACHABLE, and openmsx::x.
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::set8 | ( | byte | x | ) |
Definition at line 2673 of file CPUCore.cc.
References openmsx::A, openmsx::B, openmsx::C, openmsx::D, openmsx::DUMMY, openmsx::E, openmsx::F, openmsx::H, openmsx::IXH, openmsx::IXL, openmsx::IYH, openmsx::IYL, openmsx::L, openmsx::REG_I, openmsx::REG_R, UNREACHABLE, and openmsx::x.
void openmsx::CPUCore< T >::setFreq | ( | unsigned | freq | ) |
Change the clock freq.
Definition at line 539 of file CPUCore.cc.
|
inline |
Definition at line 56 of file CPUCore.hh.
void openmsx::CPUCore< T >::setNextSyncPoint | ( | EmuTime::param | time | ) |
Definition at line 496 of file CPUCore.cc.
void openmsx::CPUCore< T >::wait | ( | EmuTime::param | time | ) |
Definition at line 479 of file CPUCore.cc.
EmuTime openmsx::CPUCore< T >::waitCycles | ( | EmuTime::param | time, |
unsigned | cycles | ||
) |
Definition at line 486 of file CPUCore.cc.
void openmsx::CPUCore< T >::warp | ( | EmuTime::param | time | ) |
Definition at line 323 of file CPUCore.cc.
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WR_WORD_rev | ( | unsigned | address, |
unsigned | value, | ||
unsigned | cc | ||
) |
Definition at line 777 of file CPUCore.cc.
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WR_WORD_rev2 | ( | unsigned | address, |
unsigned | value, | ||
unsigned | cc | ||
) |
Definition at line 762 of file CPUCore.cc.
References openmsx::CacheLine::BITS, likely, openmsx::CacheLine::LOW, and Endian::write_UA_L16().
NEVER_INLINE void openmsx::CPUCore< CPU_POLICY >::WR_WORD_rev_slow | ( | unsigned | address, |
unsigned | value, | ||
unsigned | cc | ||
) |
Definition at line 755 of file CPUCore.cc.
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WRMEM_impl | ( | unsigned | address, |
byte | value, | ||
unsigned | cc | ||
) |
Definition at line 719 of file CPUCore.cc.
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WRMEM_impl2 | ( | unsigned | address, |
byte | value, | ||
unsigned | cc | ||
) |
Definition at line 705 of file CPUCore.cc.
References openmsx::CacheLine::BITS, and likely.
NEVER_INLINE void openmsx::CPUCore< CPU_POLICY >::WRMEMslow | ( | unsigned | address, |
byte | value, | ||
unsigned | cc | ||
) |
Definition at line 679 of file CPUCore.cc.
References openmsx::CacheLine::BITS, openmsx::CacheLine::HIGH, and openmsx::NonCachedWrite.
|
friend |
Definition at line 477 of file CPUCore.hh.
|
friend |
Definition at line 479 of file CPUCore.hh.
|
friend |
Definition at line 478 of file CPUCore.hh.