MemoryView can now view ARAM (rightclick -> toggle memory). Add "search for instruction" capability to debugger. Code cleanup, log zelda pb type (9 all the time in Zelda Four Swords)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3479 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
1 parent
9d9ce4274b
commit
51cbdea782
19 files changed
+199
-194
No files matched your search
@@ -11,7 +11,7 @@ protected:
|
||||
|
||||
public:
|
||||
virtual void disasm(unsigned int /*address*/, char *dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");}
|
||||
virtual void getRawMemoryString(unsigned int /*address*/, char *dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");}
|
||||
virtual void getRawMemoryString(int memory, unsigned int /*address*/, char *dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");}
|
||||
virtual int getInstructionSize(int /*instruction*/) {return 1;}
|
||||
virtual bool isAlive() {return true;}
|
||||
virtual bool isBreakpoint(unsigned int /*address*/) {return false;}
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
virtual void clearAllBreakpoints() {}
|
||||
virtual void toggleBreakpoint(unsigned int /*address*/){}
|
||||
virtual unsigned int readMemory(unsigned int /*address*/){return 0;}
|
||||
virtual unsigned int readExtraMemory(int memory, unsigned int address){return 0;}
|
||||
virtual unsigned int readInstruction(unsigned int /*address*/){return 0;}
|
||||
virtual unsigned int getPC() {return 0;}
|
||||
virtual void setPC(unsigned int /*address*/) {}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "PPCDebugInterface.h"
|
||||
#include "PowerPCDisasm.h"
|
||||
#include "../Core.h"
|
||||
#include "../HW/DSP.h"
|
||||
#include "../HW/Memmap.h"
|
||||
#include "../PowerPC/PowerPC.h"
|
||||
#include "../PowerPC/Jit64/Jit.h"
|
||||
@@ -51,17 +52,17 @@ void PPCDebugInterface::disasm(unsigned int address, char *dest, int max_size)
|
||||
}
|
||||
}
|
||||
|
||||
void PPCDebugInterface::getRawMemoryString(unsigned int address, char *dest, int max_size)
|
||||
void PPCDebugInterface::getRawMemoryString(int memory, unsigned int address, char *dest, int max_size)
|
||||
{
|
||||
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||
{
|
||||
if (Memory::IsRAMAddress(address, true))
|
||||
if (memory || Memory::IsRAMAddress(address, true))
|
||||
{
|
||||
snprintf(dest, max_size, "%08X", readMemory(address));
|
||||
snprintf(dest, max_size, "%08X%s", readExtraMemory(memory, address), memory ? " (ARAM)" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(dest, "--------");
|
||||
strcpy(dest, memory ? "--ARAM--" : "--------");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -75,6 +76,22 @@ unsigned int PPCDebugInterface::readMemory(unsigned int address)
|
||||
return Memory::ReadUnchecked_U32(address);
|
||||
}
|
||||
|
||||
unsigned int PPCDebugInterface::readExtraMemory(int memory, unsigned int address)
|
||||
{
|
||||
switch (memory)
|
||||
{
|
||||
case 0:
|
||||
return Memory::ReadUnchecked_U32(address);
|
||||
case 1:
|
||||
return (DSP::ReadARAM(address) << 24) |
|
||||
(DSP::ReadARAM(address + 1) << 16) |
|
||||
(DSP::ReadARAM(address + 2) << 8) |
|
||||
(DSP::ReadARAM(address + 3));
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int PPCDebugInterface::readInstruction(unsigned int address)
|
||||
{
|
||||
return Memory::Read_Instruction(address);
|
||||
|
||||
@@ -12,7 +12,7 @@ class PPCDebugInterface : public DebugInterface
|
||||
public:
|
||||
PPCDebugInterface(){}
|
||||
virtual void disasm(unsigned int address, char *dest, int max_size);
|
||||
virtual void getRawMemoryString(unsigned int address, char *dest, int max_size);
|
||||
virtual void getRawMemoryString(int memory, unsigned int address, char *dest, int max_size);
|
||||
virtual int getInstructionSize(int instruction) {return 4;}
|
||||
virtual bool isAlive();
|
||||
virtual bool isBreakpoint(unsigned int address);
|
||||
@@ -21,6 +21,11 @@ public:
|
||||
virtual void clearAllBreakpoints();
|
||||
virtual void toggleBreakpoint(unsigned int address);
|
||||
virtual unsigned int readMemory(unsigned int address);
|
||||
|
||||
enum {
|
||||
EXTRAMEM_ARAM = 1,
|
||||
};
|
||||
virtual unsigned int readExtraMemory(int memory, unsigned int address);
|
||||
virtual unsigned int readInstruction(unsigned int address);
|
||||
virtual unsigned int getPC();
|
||||
virtual void setPC(unsigned int address);
|
||||
|
||||
@@ -474,6 +474,7 @@ void UpdateAudioDMA()
|
||||
// Latch new parameters
|
||||
g_audioDMA.BlocksLeft = g_audioDMA.AudioDMAControl.NumBlocks;
|
||||
g_audioDMA.ReadAddress = g_audioDMA.SourceAddress;
|
||||
DEBUG_LOG(DSPLLE, "ADMA read addresses: %08x", g_audioDMA.ReadAddress);
|
||||
GenerateDSPInterrupt(DSP::INT_AID);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -11,11 +11,12 @@ static int histl2;
|
||||
static int histr1;
|
||||
static int histr2;
|
||||
|
||||
short ADPDecodeSample(int bits, int q, int *hist1p, int *hist2p) {
|
||||
int hist, cur;
|
||||
short ADPDecodeSample(int bits, int q, int *hist1p, int *hist2p)
|
||||
{
|
||||
const int hist1 = *hist1p;
|
||||
const int hist2 = *hist2p;
|
||||
|
||||
int hist;
|
||||
switch (q >> 4)
|
||||
{
|
||||
case 0:
|
||||
@@ -35,7 +36,7 @@ short ADPDecodeSample(int bits, int q, int *hist1p, int *hist2p) {
|
||||
if (hist > 0x1fffff) hist = 0x1fffff;
|
||||
if (hist < -0x200000) hist = -0x200000;
|
||||
|
||||
cur = (((short)(bits << 12) >> (q & 0xf)) << 6) + hist;
|
||||
int cur = (((short)(bits << 12) >> (q & 0xf)) << 6) + hist;
|
||||
|
||||
*hist2p = *hist1p;
|
||||
*hist1p = cur;
|
||||
|
||||
@@ -108,7 +108,6 @@ void ps_div(UGeckoInstruction _inst)
|
||||
{
|
||||
rPS0(_inst.FD) = static_cast<float>(rPS0(_inst.FA) / rPS0(_inst.FB));
|
||||
rPS1(_inst.FD) = static_cast<float>(rPS1(_inst.FA) / rPS1(_inst.FB));
|
||||
FPSCR.FI = 0;
|
||||
if (fabs(rPS0(_inst.FB)) == 0.0) {
|
||||
FPSCR.ZX = 1;
|
||||
}
|
||||
@@ -119,12 +118,14 @@ void ps_res(UGeckoInstruction _inst)
|
||||
{
|
||||
rPS0(_inst.FD) = 1.0f / static_cast<float>(rPS0(_inst.FB));
|
||||
rPS1(_inst.FD) = 1.0f / static_cast<float>(rPS1(_inst.FB));
|
||||
if (fabs(rPS0(_inst.FB)) == 0.0) {
|
||||
FPSCR.ZX = 1;
|
||||
}
|
||||
if (_inst.Rc) Helper_UpdateCR1(rPS0(_inst.FD));
|
||||
}
|
||||
|
||||
void ps_rsqrte(UGeckoInstruction _inst)
|
||||
{
|
||||
// PanicAlert("ps_rsqrte");
|
||||
rPS0(_inst.FD) = static_cast<double>(1.0f / sqrtf((float)rPS0(_inst.FB)));
|
||||
rPS1(_inst.FD) = static_cast<double>(1.0f / sqrtf((float)rPS1(_inst.FB)));
|
||||
if (fabs(rPS0(_inst.FB)) == 0.0) {
|
||||
|
||||
@@ -687,7 +687,7 @@ void InitTables()
|
||||
}
|
||||
|
||||
#define OPLOG
|
||||
#define OP_TO_LOG "mffs"
|
||||
#define OP_TO_LOG "mtfsb0x"
|
||||
|
||||
#ifdef OPLOG
|
||||
namespace {
|
||||
@@ -695,6 +695,12 @@ namespace {
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *GetInstructionName(UGeckoInstruction _inst)
|
||||
{
|
||||
const GekkoOPInfo *info = GetOpInfo(_inst);
|
||||
return info ? info->opname : 0;
|
||||
}
|
||||
|
||||
void CompileInstruction(UGeckoInstruction _inst)
|
||||
{
|
||||
(jit.*dynaOpTable[_inst.OPCD])(_inst);
|
||||
@@ -712,9 +718,9 @@ void CompileInstruction(UGeckoInstruction _inst)
|
||||
}
|
||||
}
|
||||
|
||||
bool IsValidInstruction(UGeckoInstruction _instCode)
|
||||
bool IsValidInstruction(UGeckoInstruction _inst)
|
||||
{
|
||||
const GekkoOPInfo *info = GetOpInfo(_instCode);
|
||||
const GekkoOPInfo *info = GetOpInfo(_inst);
|
||||
return info != 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,8 +102,6 @@ class Jit64;
|
||||
namespace PPCTables
|
||||
{
|
||||
|
||||
|
||||
|
||||
typedef void (Jit64::*_recompilerInstruction) (UGeckoInstruction instCode);
|
||||
typedef void (*_interpreterInstruction)(UGeckoInstruction instCode);
|
||||
|
||||
@@ -115,6 +113,7 @@ void CountInstruction(UGeckoInstruction _inst);
|
||||
void PrintInstructionRunCounts();
|
||||
void LogCompiledInstructions();
|
||||
void CompileInstruction(UGeckoInstruction _inst);
|
||||
const char *GetInstructionName(UGeckoInstruction _inst);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in new issue
Block a user