mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-26 23:55:40 +00:00
e8e02ba685
- updated debugger classes to compile again with all recent changes. - improved debugger classes to allow them to work in multi-threaded emulator and be able to handle CPUs on different threads. - added debug classes for new Z80 and Musashi 68K CPU cores. - added logging of cycle counts and frames. - moved all Supermodel specific code & configuration to CSupermodelDebugger. - added all Model 3 CPUs (PPC, sound board 68K, DSB 68K/Z80 and drive board Z80) to CSupermodelDebugger. - added persisting of custom entry points in saved debug state to CCodeAnalyser. - fixed bug with listing I/O ports in CConsoleDebugger and added displaying of cycle counts and CPU speeds when listing CPUs.
101 lines
2.3 KiB
C++
101 lines
2.3 KiB
C++
#ifdef SUPERMODEL_DEBUGGER
|
|
#ifndef INCLUDED_PPCDEBUG_H
|
|
#define INCLUDED_PPCDEBUG_H
|
|
|
|
#include "Debugger/CPUDebug.h"
|
|
#include "CPU/Bus.h"
|
|
#include "Types.h"
|
|
|
|
#define PPCSPECIAL_LR 0
|
|
#define PPCSPECIAL_FPSCR 1
|
|
|
|
namespace Debugger
|
|
{
|
|
static UINT32 GetSpecialReg(CCPUDebug *cpu, unsigned id);
|
|
static bool SetSpecialReg(CCPUDebug *cpu, unsigned id, UINT32 data);
|
|
static UINT32 GetSPR(CCPUDebug *cpu, unsigned id);
|
|
static bool SetSPR(CCPUDebug *cpu, unsigned id, UINT32 data);
|
|
static UINT32 GetGPR(CCPUDebug *cpu, unsigned id);
|
|
static bool SetGPR(CCPUDebug *cpu, unsigned id, UINT32 data);
|
|
static double GetFPR(CCPUDebug *cpu, unsigned id);
|
|
static bool SetFRP(CCPUDebug *cpu, unsigned id, double data);
|
|
|
|
/*
|
|
* CCPUDebug implementation for the PowerPC PPC603 emulator.
|
|
*/
|
|
class CPPCDebug : public CCPUDebug, public ::CBus
|
|
{
|
|
private:
|
|
char m_crNames[32][5];
|
|
char m_gprNames[32][4];
|
|
char m_fprNames[32][4];
|
|
|
|
::CBus *m_bus;
|
|
|
|
UINT8 m_irqState;
|
|
|
|
public:
|
|
CPPCDebug(const char *name);
|
|
|
|
virtual ~CPPCDebug();
|
|
|
|
// CCPUDebug methods
|
|
|
|
void AttachToCPU();
|
|
|
|
::CBus *AttachBus(::CBus *bus);
|
|
|
|
void DetachFromCPU();
|
|
|
|
::CBus *DetachBus();
|
|
|
|
void CheckException(UINT16 exCode);
|
|
|
|
UINT32 GetResetAddr();
|
|
|
|
bool UpdatePC(UINT32 pc);
|
|
|
|
bool ForceException(CException *ex);
|
|
|
|
bool ForceInterrupt(CInterrupt *in);
|
|
|
|
UINT64 ReadMem(UINT32 addr, unsigned dataSize);
|
|
|
|
bool WriteMem(UINT32 addr, unsigned dataSize, UINT64 data);
|
|
|
|
int Disassemble(UINT32 addr, char *mnemonic, char *operands);
|
|
|
|
EOpFlags GetOpFlags(UINT32 addr, UINT32 opcode);
|
|
|
|
bool GetJumpAddr(UINT32 addr, UINT32 opcode, UINT32 &jumpAddr);
|
|
|
|
bool GetJumpRetAddr(UINT32 addr, UINT32 opcode, UINT32 &retAddr);
|
|
|
|
bool GetReturnAddr(UINT32 addr, UINT32 opcode, UINT32 &retAddr);
|
|
|
|
bool GetHandlerAddr(CException *ex, UINT32 &handlerAddr);
|
|
|
|
bool GetHandlerAddr(CInterrupt *in, UINT32 &handlerAddr);
|
|
|
|
// CBus methods
|
|
|
|
UINT8 Read8(UINT32 addr);
|
|
|
|
UINT16 Read16(UINT32 addr);
|
|
|
|
UINT32 Read32(UINT32 addr);
|
|
|
|
UINT64 Read64(UINT32 addr);
|
|
|
|
void Write8(UINT32 addr, UINT8 data);
|
|
|
|
void Write16(UINT32 addr, UINT16 data);
|
|
|
|
void Write32(UINT32 addr, UINT32 data);
|
|
|
|
void Write64(UINT32 addr, UINT64 data);
|
|
};
|
|
}
|
|
|
|
#endif // INCLUDED_PPCDEBUG_H
|
|
#endif // SUPERMODEL_DEBUGGER
|