Made the debugger automatically get the PB address.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@751 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2008-10-03 01:31:11 +00:00
parent cf5251331e
commit b200cd9b73
7 changed files with 150 additions and 13 deletions

View File

@ -15,10 +15,13 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <iostream> // I hope this doesn't break anything
#include <stdio.h>
#include <stdarg.h>
#include "Common.h" // for Common::swap
#include "Globals.h"
#include "gdsp_interpreter.h"
// =======================================================================================
@ -27,17 +30,24 @@
void DebugLog(const char* _fmt, ...)
{
#if defined(_DEBUG) || defined(DEBUGFAST)
/* char Msg[512];
char Msg[512];
va_list ap;
va_start( ap, _fmt );
vsprintf( Msg, _fmt, ap );
va_end( ap );
OutputDebugString(Msg);
// Only show certain messages
std::string sMsg = Msg;
if(sMsg.find("Mail") != -1 || sMsg.find("AX") != -1)
// no match = -1
{
OutputDebugString(Msg);
g_dspInitialize.pLog(Msg);
}
g_dspInitialize.pLog(Msg);
*/
#endif
}
// =============
@ -61,3 +71,21 @@ void ErrorLog(const char* _fmt, ...)
}
// =======================================================================================
// For PB address detection
// --------------
u32 RAM_MASK = 0x1FFFFFF;
u16 Memory_Read_U16(u32 _uAddress)
{
_uAddress &= RAM_MASK;
return Common::swap16(*(u16*)&g_dsp.cpu_ram[_uAddress]);
}
u32 Memory_Read_U32(u32 _uAddress)
{
_uAddress &= RAM_MASK;
return Common::swap32(*(u32*)&g_dsp.cpu_ram[_uAddress]);
}
// =============