openMSX
|
#include <CPU.hh>
Classes | |
class | CPURegs |
Public Types | |
enum | Reg8 { A, F, B, C, D, E, H, L, IXH, IXL, IYH, IYL, REG_I, REG_R, DUMMY } |
enum | Reg16 { AF, BC, DE, HL, IX, IY, SP } |
Public Member Functions | |
virtual void | execute (bool fastForward)=0 |
TODO. More... | |
virtual void | exitCPULoopSync ()=0 |
Request to exit the main CPU emulation loop. More... | |
virtual void | exitCPULoopAsync ()=0 |
Similar to exitCPULoopSync(), but this method may be called from any thread. More... | |
virtual void | warp (EmuTime::param time)=0 |
Sets the CPU its current time. More... | |
virtual EmuTime::param | getCurrentTime () const =0 |
Returns the CPU its current time. More... | |
virtual void | wait (EmuTime::param time)=0 |
Wait till an absolute moment in time (fast forward). More... | |
virtual void | waitCycles (unsigned cycles)=0 |
Wait for a number of cycles. More... | |
virtual void | setNextSyncPoint (EmuTime::param time)=0 |
Inform CPU of new (possibly earlier) sync point. More... | |
virtual void | invalidateMemCache (unsigned start, unsigned num)=0 |
Invalidate the CPU its cache for the interval [start, start + num * CacheLine::SIZE). More... | |
virtual bool | isM1Cycle (unsigned address) const =0 |
See MSXCPU::isM1Cycle(). More... | |
virtual void | disasmCommand (const std::vector< TclObject > &tokens, TclObject &result) const =0 |
CPURegs & | getRegisters () |
void | setPaused (bool paused) |
(un)pause CPU. More... | |
Static Public Attributes | |
static const byte | S_FLAG = 0x80 |
static const byte | Z_FLAG = 0x40 |
static const byte | Y_FLAG = 0x20 |
static const byte | H_FLAG = 0x10 |
static const byte | X_FLAG = 0x08 |
static const byte | V_FLAG = 0x04 |
static const byte | P_FLAG = V_FLAG |
static const byte | N_FLAG = 0x02 |
static const byte | C_FLAG = 0x01 |
Protected Member Functions | |
CPU (bool r800) | |
virtual | ~CPU () |
Protected Attributes | |
CPURegs | R |
Static Protected Attributes | |
static byte | ZSTable [256] |
static byte | ZSXYTable [256] |
static byte | ZSPTable [256] |
static byte | ZSPXYTable [256] |
static byte | ZSPHTable [256] |
static const byte | ZS0 = Z_FLAG |
static const byte | ZSXY0 = Z_FLAG |
static const byte | ZSP0 = Z_FLAG | V_FLAG |
static const byte | ZSPXY0 = Z_FLAG | V_FLAG |
static const byte | ZS255 = S_FLAG |
static const byte | ZSXY255 = S_FLAG | X_FLAG | Y_FLAG |
Additional Inherited Members |
enum openmsx::CPU::Reg16 |
enum openmsx::CPU::Reg8 |
|
protected |
|
pure virtual |
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::disasmCommand().
|
pure virtual |
TODO.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
|
pure virtual |
Similar to exitCPULoopSync(), but this method may be called from any thread.
Although now the loop will only be exited 'soon'.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::exitCPULoopAsync().
|
pure virtual |
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).
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::exitCPULoopSync(), and setPaused().
|
pure virtual |
Returns the CPU its current time.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
|
inline |
Definition at line 441 of file CPU.hh.
References R.
Referenced by openmsx::MSXCPUDebuggable::read(), setPaused(), and openmsx::MSXCPUDebuggable::write().
|
pure virtual |
Invalidate the CPU its cache for the interval [start, start + num * CacheLine::SIZE).
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::invalidateMemCache().
|
pure virtual |
See MSXCPU::isM1Cycle().
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::isM1Cycle().
|
pure virtual |
Inform CPU of new (possibly earlier) sync point.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::setNextSyncPoint().
void openmsx::CPU::setPaused | ( | bool | paused) |
(un)pause CPU.
During pause the CPU executes NOP instructions continuously (just like during HALT). Used by turbor hw pause.
Definition at line 48 of file CPU.cc.
References exitCPULoopSync(), getRegisters(), and openmsx::CPU::CPURegs::setExtHALT().
Referenced by openmsx::MSXCPU::setPaused().
|
pure virtual |
Wait till an absolute moment in time (fast forward).
Synchronsization points between the current time and the specified time do get executed.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::wait().
|
pure virtual |
Wait for a number of cycles.
Can be used to insert an extra delay when accessing specific IO devices.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
Referenced by openmsx::MSXCPU::waitCycles().
|
pure virtual |
Sets the CPU its current time.
This is used to 'warp' a CPU when you switch between Z80/R800.
Implemented in openmsx::CPUCore< CPU_POLICY >, openmsx::CPUCore< openmsx::R800TYPE >, and openmsx::CPUCore< openmsx::Z80TYPE >.
|
static |
Definition at line 38 of file CPU.hh.
Referenced by openmsx::CondC::operator()(), and openmsx::CondNC::operator()().
|
static |
|
protected |
Definition at line 466 of file CPU.hh.
Referenced by getRegisters().
|
static |
Definition at line 30 of file CPU.hh.
Referenced by CPU(), openmsx::CondM::operator()(), and openmsx::CondP::operator()().
|
static |
Definition at line 35 of file CPU.hh.
Referenced by CPU(), openmsx::CondPE::operator()(), and openmsx::CondPO::operator()().
|
static |
|
static |
|
static |
Definition at line 31 of file CPU.hh.
Referenced by CPU(), openmsx::CondZ::operator()(), and openmsx::CondNZ::operator()().
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |