openMSX
Public Member Functions | Friends | List of all members
openmsx::CPUCore< CPU_POLICY > Class Template Referencefinal

#include <CPUCore.hh>

Inheritance diagram for openmsx::CPUCore< CPU_POLICY >:
Inheritance graph
[legend]
Collaboration diagram for openmsx::CPUCore< CPU_POLICY >:
Collaboration graph
[legend]

Public Member Functions

 CPUCore (MSXMotherBoard &motherboard, const std::string &name, const BooleanSetting &traceSetting, TclCallback &diHaltCallback, EmuTime::param time)
 
void setInterface (MSXCPUInterface *interface_)
 
void doReset (EmuTime::param time)
 Reset the CPU.
 
void execute (bool fastForward)
 
void exitCPULoopSync ()
 Request to exit the main CPU emulation loop.
 
void exitCPULoopAsync ()
 Similar to exitCPULoopSync(), but this method may be called from any thread.
 
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)
 
CacheLines getCacheLines ()
 
bool isM1Cycle (unsigned address) const
 
void disasmCommand (Interpreter &interp, std::span< const TclObject > tokens, TclObject &result) const
 
void raiseIRQ ()
 Raises the maskable interrupt count.
 
void lowerIRQ ()
 Lowers the maskable interrupt count.
 
void raiseNMI ()
 Raises the non-maskable interrupt count.
 
void lowerNMI ()
 Lowers the non-maskable interrupt count.
 
void setFreq (unsigned freq)
 Change the clock freq.
 
BooleanSettinggetFreqLockedSetting ()
 
IntegerSettinggetFreqValueSetting ()
 
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 word RD_WORD_slow (unsigned address, unsigned cc)
 
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE word RD_WORD_impl2 (unsigned address, unsigned cc)
 
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE word RD_WORD_impl (unsigned address, unsigned cc)
 
template<unsigned PC_OFFSET>
ALWAYS_INLINE word 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, word value, unsigned cc)
 
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE void WR_WORD_rev2 (unsigned address, word value, unsigned cc)
 
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE void WR_WORD_rev (unsigned address, word value, unsigned cc)
 
template<Reg8 R8>
ALWAYS_INLINE byte get8 () const
 
template<Reg16 R16>
ALWAYS_INLINE word get16 () const
 
template<Reg8 R8>
ALWAYS_INLINE void set8 (byte x)
 
template<Reg16 R16>
ALWAYS_INLINE void set16 (word x)
 
- Public Member Functions inherited from openmsx::CPURegs
 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
 
word getAF () const
 
word getBC () const
 
word getDE () const
 
word getHL () const
 
word getAF2 () const
 
word getBC2 () const
 
word getDE2 () const
 
word getHL2 () const
 
word getIX () const
 
word getIY () const
 
word getPC () const
 
word 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 (word x)
 
void setBC (word x)
 
void setDE (word x)
 
void setHL (word x)
 
void setAF2 (word x)
 
void setBC2 (word x)
 
void setDE2 (word x)
 
void setHL2 (word x)
 
void setIX (word x)
 
void setIY (word x)
 
void setPC (word x)
 
void setSP (word 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
 

Detailed Description

template<typename CPU_POLICY>
class openmsx::CPUCore< CPU_POLICY >

Definition at line 55 of file CPUCore.hh.

Constructor & Destructor Documentation

◆ CPUCore()

template<typename T >
openmsx::CPUCore< T >::CPUCore ( MSXMotherBoard motherboard,
const std::string &  name,
const BooleanSetting traceSetting,
TclCallback diHaltCallback,
EmuTime::param  time 
)

Definition at line 292 of file CPUCore.cc.

References openmsx::CPUCore< CPU_POLICY >::doReset().

Member Function Documentation

◆ disasmCommand()

template<typename T >
void openmsx::CPUCore< T >::disasmCommand ( Interpreter interp,
std::span< const TclObject tokens,
TclObject result 
) const

Definition at line 517 of file CPUCore.cc.

References openmsx::TclObject::addListElement(), openmsx::dasm(), and xrange().

◆ doReset()

template<typename T >
void openmsx::CPUCore< T >::doReset ( EmuTime::param  time)

Reset the CPU.

Definition at line 339 of file CPUCore.cc.

Referenced by openmsx::CPUCore< CPU_POLICY >::CPUCore().

◆ execute()

template<typename T >
void openmsx::CPUCore< T >::execute ( bool  fastForward)

Definition at line 2562 of file CPUCore.cc.

◆ exitCPULoopAsync()

template<typename T >
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 402 of file CPUCore.cc.

◆ exitCPULoopSync()

template<typename T >
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 407 of file CPUCore.cc.

References openmsx::Thread::isMainThread().

◆ get16()

template<typename CPU_POLICY >
template<Reg16 R16>
ALWAYS_INLINE word openmsx::CPUCore< CPU_POLICY >::get16 ( ) const

◆ get8()

template<typename CPU_POLICY >
template<Reg8 R8>
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::get8 ( ) const

◆ getCacheLines()

template<typename CPU_POLICY >
CacheLines openmsx::CPUCore< CPU_POLICY >::getCacheLines ( )
inline

Definition at line 88 of file CPUCore.hh.

◆ getCurrentTime()

template<typename T >
EmuTime::param openmsx::CPUCore< T >::getCurrentTime ( ) const

Definition at line 334 of file CPUCore.cc.

◆ getFreqLockedSetting()

template<typename CPU_POLICY >
BooleanSetting & openmsx::CPUCore< CPU_POLICY >::getFreqLockedSetting ( )
inline

Definition at line 126 of file CPUCore.hh.

◆ getFreqValueSetting()

template<typename CPU_POLICY >
IntegerSetting & openmsx::CPUCore< CPU_POLICY >::getFreqValueSetting ( )
inline

Definition at line 127 of file CPUCore.hh.

◆ isM1Cycle()

template<typename T >
bool openmsx::CPUCore< T >::isM1Cycle ( unsigned  address) const

Definition at line 468 of file CPUCore.cc.

◆ lowerIRQ()

template<typename T >
void openmsx::CPUCore< T >::lowerIRQ ( )

Lowers the maskable interrupt count.

Devices should call MSXCPU::lowerIRQ instead, or use the IRQHelper class.

Definition at line 446 of file CPUCore.cc.

◆ lowerNMI()

template<typename T >
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 462 of file CPUCore.cc.

◆ raiseIRQ()

template<typename T >
void openmsx::CPUCore< T >::raiseIRQ ( )

Raises the maskable interrupt count.

Devices should call MSXCPU::raiseIRQ instead, or use the IRQHelper class.

Definition at line 437 of file CPUCore.cc.

◆ raiseNMI()

template<typename T >
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 452 of file CPUCore.cc.

◆ RD_WORD_impl()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE word openmsx::CPUCore< CPU_POLICY >::RD_WORD_impl ( unsigned  address,
unsigned  cc 
)

Definition at line 667 of file CPUCore.cc.

◆ RD_WORD_impl2()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE word openmsx::CPUCore< CPU_POLICY >::RD_WORD_impl2 ( unsigned  address,
unsigned  cc 
)

◆ RD_WORD_PC()

template<typename CPU_POLICY >
template<unsigned PC_OFFSET>
ALWAYS_INLINE word openmsx::CPUCore< CPU_POLICY >::RD_WORD_PC ( unsigned  cc)

Definition at line 673 of file CPUCore.cc.

◆ RD_WORD_slow()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
NEVER_INLINE word openmsx::CPUCore< CPU_POLICY >::RD_WORD_slow ( unsigned  address,
unsigned  cc 
)

Definition at line 646 of file CPUCore.cc.

◆ RDMEM_impl()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEM_impl ( unsigned  address,
unsigned  cc 
)

Definition at line 620 of file CPUCore.cc.

◆ RDMEM_impl2()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEM_impl2 ( unsigned  address,
unsigned  cc 
)

Definition at line 607 of file CPUCore.cc.

References openmsx::CacheLine::BITS.

◆ RDMEM_OPCODE()

template<typename CPU_POLICY >
template<unsigned PC_OFFSET>
ALWAYS_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEM_OPCODE ( unsigned  cc)

Definition at line 626 of file CPUCore.cc.

◆ RDMEMslow()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
NEVER_INLINE byte openmsx::CPUCore< CPU_POLICY >::RDMEMslow ( unsigned  address,
unsigned  cc 
)

◆ serialize()

template<typename T >
template<typename Archive >
void openmsx::CPUCore< T >::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 4421 of file CPUCore.cc.

◆ set16()

template<typename CPU_POLICY >
template<Reg16 R16>
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::set16 ( word  x)

◆ set8()

template<typename CPU_POLICY >
template<Reg8 R8>
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::set8 ( byte  x)

◆ setFreq()

template<typename T >
void openmsx::CPUCore< T >::setFreq ( unsigned  freq)

Change the clock freq.

Definition at line 545 of file CPUCore.cc.

◆ setInterface()

template<typename CPU_POLICY >
void openmsx::CPUCore< CPU_POLICY >::setInterface ( MSXCPUInterface interface_)
inline

Definition at line 62 of file CPUCore.hh.

◆ setNextSyncPoint()

template<typename T >
void openmsx::CPUCore< T >::setNextSyncPoint ( EmuTime::param  time)

Definition at line 501 of file CPUCore.cc.

◆ wait()

template<typename T >
void openmsx::CPUCore< T >::wait ( EmuTime::param  time)

Definition at line 484 of file CPUCore.cc.

◆ waitCycles()

template<typename T >
EmuTime openmsx::CPUCore< T >::waitCycles ( EmuTime::param  time,
unsigned  cycles 
)

Definition at line 491 of file CPUCore.cc.

◆ warp()

template<typename T >
void openmsx::CPUCore< T >::warp ( EmuTime::param  time)

Definition at line 328 of file CPUCore.cc.

◆ WR_WORD_rev()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WR_WORD_rev ( unsigned  address,
word  value,
unsigned  cc 
)

Definition at line 783 of file CPUCore.cc.

◆ WR_WORD_rev2()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WR_WORD_rev2 ( unsigned  address,
word  value,
unsigned  cc 
)

◆ WR_WORD_rev_slow()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
NEVER_INLINE void openmsx::CPUCore< CPU_POLICY >::WR_WORD_rev_slow ( unsigned  address,
word  value,
unsigned  cc 
)

Definition at line 761 of file CPUCore.cc.

◆ WRMEM_impl()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WRMEM_impl ( unsigned  address,
byte  value,
unsigned  cc 
)

Definition at line 725 of file CPUCore.cc.

◆ WRMEM_impl2()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
ALWAYS_INLINE void openmsx::CPUCore< CPU_POLICY >::WRMEM_impl2 ( unsigned  address,
byte  value,
unsigned  cc 
)

Definition at line 711 of file CPUCore.cc.

References openmsx::CacheLine::BITS.

◆ WRMEMslow()

template<typename CPU_POLICY >
template<bool PRE_PB, bool POST_PB>
NEVER_INLINE void openmsx::CPUCore< CPU_POLICY >::WRMEMslow ( unsigned  address,
byte  value,
unsigned  cc 
)

Friends And Related Symbol Documentation

◆ MSXCPU

template<typename CPU_POLICY >
friend class MSXCPU
friend

Definition at line 486 of file CPUCore.hh.

◆ R800TYPE

template<typename CPU_POLICY >
friend class R800TYPE
friend

Definition at line 488 of file CPUCore.hh.

◆ Z80TYPE

template<typename CPU_POLICY >
friend class Z80TYPE
friend

Definition at line 487 of file CPUCore.hh.


The documentation for this class was generated from the following files: