added an AX disasm with (few) comments. Moved some code around to prepare to share some breakpoint code between the ppc and dsp

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3566 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-06-28 11:47:39 +00:00
parent f49e479d09
commit 7c92dada85
23 changed files with 2625 additions and 56 deletions

View file

@ -2003,10 +2003,6 @@
RelativePath=".\Src\Debugger\Debugger_SymbolMap.h"
>
</File>
<File
RelativePath=".\Src\Debugger\DebugInterface.h"
>
</File>
<File
RelativePath=".\Src\Debugger\Dump.cpp"
>

View file

@ -22,16 +22,13 @@
#include "../PowerPC/PPCSymbolDB.h"
#include "Debugger_BreakPoints.h"
BreakPoints g_breakpoints;
MemChecks g_memchecks;
void TMemCheck::Action(u32 iValue, u32 addr, bool write, int size, u32 pc)
{
if ((write && OnWrite) || (!write && OnRead))
{
if (Log)
{
DEBUG_LOG(MEMMAP,"CHK %08x %s%i at %08x (%s)",
DEBUG_LOG(MEMMAP, "CHK %08x %s%i at %08x (%s)",
iValue, write ? "Write" : "Read", // read or write
size*8, addr, // address
g_symbolDB.GetDescription(addr) // symbol map description

View file

@ -77,8 +77,6 @@ private:
u32 m_iBreakOnCount;
};
extern BreakPoints g_breakpoints;
// Memory breakpoints
class MemChecks
@ -96,7 +94,5 @@ public:
void Clear();
};
extern MemChecks g_memchecks;
#endif

View file

@ -41,7 +41,7 @@ void AddAutoBreakpoints()
{
Symbol *symbol = g_symbolDB.GetSymbolFromName(bps[i]);
if (symbol)
g_breakpoints.Add(symbol->address, false);
PowerPC::breakpoints.Add(symbol->address, false);
}
#endif
#endif

View file

@ -104,18 +104,18 @@ bool PPCDebugInterface::isAlive()
bool PPCDebugInterface::isBreakpoint(unsigned int address)
{
return g_breakpoints.IsAddressBreakPoint(address);
return PowerPC::breakpoints.IsAddressBreakPoint(address);
}
void PPCDebugInterface::setBreakpoint(unsigned int address)
{
if (g_breakpoints.Add(address))
if (PowerPC::breakpoints.Add(address))
jit.NotifyBreakpoint(address, true);
}
void PPCDebugInterface::clearBreakpoint(unsigned int address)
{
if (g_breakpoints.Remove(address))
if (PowerPC::breakpoints.Remove(address))
jit.NotifyBreakpoint(address, false);
}
@ -123,10 +123,10 @@ void PPCDebugInterface::clearAllBreakpoints() {}
void PPCDebugInterface::toggleBreakpoint(unsigned int address)
{
if (g_breakpoints.IsAddressBreakPoint(address))
g_breakpoints.Remove(address);
if (PowerPC::breakpoints.IsAddressBreakPoint(address))
PowerPC::breakpoints.Remove(address);
else
g_breakpoints.Add(address);
PowerPC::breakpoints.Add(address);
}
void PPCDebugInterface::insertBLR(unsigned int address, unsigned int value)

View file

@ -4,7 +4,7 @@
#include <string>
#include "DebugInterface.h"
#include "Debugger_Breakpoints.h"
//wrapper between disasm control and Dolphin debugger
class PPCDebugInterface : public DebugInterface

View file

@ -132,7 +132,7 @@ void PatchFunctions()
Symbol *symbol = g_symbolDB.GetSymbolFromName(OSPatches[i].m_szPatchName);
if (symbol > 0)
{
g_breakpoints.Add(symbol->address, false);
PowerPC::breakpoints.Add(symbol->address, false);
INFO_LOG(HLE,"Adding BP to %s %08x", OSBreakPoints[i].m_szPatchName, symbol->address);
}
}

View file

@ -21,7 +21,6 @@
#include "WII_IOB.h"
#include "../Core.h"
#include "../PowerPC/PowerPC.h"
#include "../Debugger/Debugger_BreakPoints.h"
namespace Memory
{
@ -254,7 +253,7 @@ u8 Read_U8(const u32 _Address)
u8 _var = 0;
ReadFromHardware<u8>(_var, _Address, _Address, FLAG_READ);
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -269,7 +268,7 @@ u16 Read_U16(const u32 _Address)
u16 _var = 0;
ReadFromHardware<u16>(_var, _Address, _Address, FLAG_READ);
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -291,7 +290,7 @@ u32 Read_U32(const u32 _Address)
u32 _var = 0;
ReadFromHardware<u32>(_var, _Address, _Address, FLAG_READ);
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -307,7 +306,7 @@ u64 Read_U64(const u32 _Address)
u64 _var = 0;
ReadFromHardware<u64>(_var, _Address, _Address, FLAG_READ);
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -321,7 +320,7 @@ u64 Read_U64(const u32 _Address)
void Write_U8(const u8 _Data, const u32 _Address)
{
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -335,7 +334,7 @@ void Write_U8(const u8 _Data, const u32 _Address)
void Write_U16(const u16 _Data, const u32 _Address)
{
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -350,7 +349,7 @@ void Write_U16(const u16 _Data, const u32 _Address)
void Write_U32(const u32 _Data, const u32 _Address)
{
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;
@ -364,7 +363,7 @@ void Write_U32(const u32 _Data, const u32 _Address)
void Write_U64(const u64 _Data, const u32 _Address)
{
#ifndef NOCHECK
TMemCheck *mc = g_memchecks.GetMemCheck(_Address);
TMemCheck *mc = PowerPC::memchecks.GetMemCheck(_Address);
if (mc)
{
mc->numHits++;

View file

@ -21,7 +21,6 @@
#include "../PPCTables.h"
#include "Interpreter.h"
#include "../../Debugger/Debugger_SymbolMap.h"
#include "../../Debugger/Debugger_BreakPoints.h"
#include "../../CoreTiming.h"
#include "../../Core.h"
#include "PowerPCDisasm.h"
@ -166,7 +165,7 @@ void Run()
#endif
//2: check for breakpoint
if (g_breakpoints.IsAddressBreakPoint(PC))
if (PowerPC::breakpoints.IsAddressBreakPoint(PC))
{
#ifdef SHOW_HISTORY
NOTICE_LOG(POWERPC, "----------------------------");
@ -187,8 +186,8 @@ void Run()
#endif
INFO_LOG(POWERPC, "Hit Breakpoint - %08x", PC);
CCPU::Break();
if (g_breakpoints.IsTempBreakPoint(PC))
g_breakpoints.Remove(PC);
if (PowerPC::breakpoints.IsTempBreakPoint(PC))
PowerPC::breakpoints.Remove(PC);
Host_UpdateDisasmDialog();
return;

View file

@ -25,7 +25,6 @@
#include "../../Core.h"
#include "../../PatchEngine.h"
#include "../../CoreTiming.h"
#include "../../Debugger/Debugger_BreakPoints.h"
#include "../../ConfigManager.h"
#include "../PowerPC.h"
#include "../Profiler.h"
@ -550,7 +549,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitB
}
// If starting from the breakpointed instruction, we don't break.
if (em_address != ops[i].address && g_breakpoints.IsAddressBreakPoint(ops[i].address))
if (em_address != ops[i].address && PowerPC::breakpoints.IsAddressBreakPoint(ops[i].address))
{
}

View file

@ -42,6 +42,9 @@ volatile CPUState state = CPU_STEPPING;
static CoreMode mode;
BreakPoints breakpoints;
MemChecks memchecks;
void CompactCR()
{
u32 new_cr = ppcState.cr_fast[0] << 28;

View file

@ -20,6 +20,7 @@
#include "Common.h"
#include "Gekko.h"
#include "../Debugger/Debugger_BreakPoints.h"
class PointerWrap;
@ -73,6 +74,9 @@ enum CPUState
extern PowerPCState ppcState;
extern BreakPoints breakpoints;
extern MemChecks memchecks;
void Init();
void Shutdown();
void DoState(PointerWrap &p);

View file

@ -31,7 +31,7 @@
#include "DSPCore.h"
#include "DSPAnalyzer.h"
#include "gdsp_interface.h"
#include "DSPHWInterface.h"
#include "DSPIntUtil.h"
namespace DSPInterpreter {

View file

@ -26,7 +26,6 @@
#include "Common.h"
#include "DSPCore.h"
// #include "DSPInterpreter.h"
#include "DSPStacks.h"
// Stacks. The stacks are outside the DSP RAM, in dedicated hardware.

View file

@ -20,7 +20,7 @@
#include "Host.h"
#include "Debugger.h"
#include "StringUtil.h"
#include "Debugger/Debugger_BreakPoints.h"
#include "PowerPC/PowerPC.h"
BEGIN_EVENT_TABLE(BreakPointDlg,wxDialog)
@ -72,7 +72,7 @@ void BreakPointDlg::OnOK(wxCommandEvent& /*event*/)
u32 Address = 0;
if (AsciiToHex(AddressString.mb_str(), Address))
{
g_breakpoints.Add(Address);
PowerPC::breakpoints.Add(Address);
Host_UpdateBreakPointView();
Close();
}

View file

@ -19,9 +19,9 @@
#include "Common.h"
#include "BreakpointView.h"
#include "Debugger/Debugger_BreakPoints.h"
#include "Debugger/Debugger_SymbolMap.h"
#include "PowerPC/PPCSymbolDB.h"
#include "PowerPC/PowerPC.h"
BEGIN_EVENT_TABLE(CBreakPointView, wxListCtrl)
@ -47,7 +47,7 @@ void CBreakPointView::Update()
InsertColumn(4, wxT("Flags"), wxLIST_FORMAT_CENTER, 100);
char szBuffer[64];
const BreakPoints::TBreakPoints& rBreakPoints = g_breakpoints.GetBreakPoints();
const BreakPoints::TBreakPoints& rBreakPoints = PowerPC::breakpoints.GetBreakPoints();
for (size_t i = 0; i < rBreakPoints.size(); i++)
{
const TBreakPoint& rBP = rBreakPoints[i];
@ -74,7 +74,7 @@ void CBreakPointView::Update()
}
}
const MemChecks::TMemChecks& rMemChecks = g_memchecks.GetMemChecks();
const MemChecks::TMemChecks& rMemChecks = PowerPC::memchecks.GetMemChecks();
for (size_t i = 0; i < rMemChecks.size(); i++)
{
const TMemCheck& rMemCheck = rMemChecks[i];
@ -115,8 +115,8 @@ void CBreakPointView::DeleteCurrentSelection()
if (Item >= 0)
{
u32 Address = (u32)GetItemData(Item);
g_breakpoints.DeleteByAddress(Address);
g_memchecks.DeleteByAddress(Address);
PowerPC::breakpoints.DeleteByAddress(Address);
PowerPC::memchecks.DeleteByAddress(Address);
Update();
}
}

View file

@ -23,7 +23,7 @@
#include "BreakPointDlg.h"
#include "MemoryCheckDlg.h"
#include "Host.h"
#include "Debugger/Debugger_BreakPoints.h" // for TMemCheck
#include "PowerPC/PowerPC.h"
#include <wx/mstream.h>
@ -205,7 +205,7 @@ CBreakPointWindow::OnDelete(wxCommandEvent& event)
void
CBreakPointWindow::OnClear(wxCommandEvent& event)
{
g_breakpoints.Clear();
PowerPC::breakpoints.Clear();
}
// ============
@ -244,7 +244,7 @@ CBreakPointWindow::OnAddBreakPointMany(wxCommandEvent& event)
u32 Address = 0;
if (AsciiToHex(line.c_str(), Address))
{
g_breakpoints.Add(Address);
PowerPC::breakpoints.Add(Address);
}
}
// only update after we are done with the loop
@ -346,7 +346,7 @@ CBreakPointWindow::OnAddMemoryCheckMany(wxCommandEvent& event)
MemCheck.Log = true;
//MemCheck.Break = false; // this is also what sets Active "on" in the breakpoint window
// so don't think it's off because we are only writing this to the log
g_memchecks.Add(MemCheck);
PowerPC::memchecks.Add(MemCheck);
}
}
// update after we are done with the loop

View file

@ -20,7 +20,7 @@
#include "Debugger.h"
#include "StringUtil.h"
#include "Host.h"
#include "Debugger/Debugger_BreakPoints.h"
#include "PowerPC/PowerPC.h"
BEGIN_EVENT_TABLE(MemoryCheckDlg,wxDialog)
EVT_CLOSE(MemoryCheckDlg::OnClose)
@ -91,7 +91,7 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& /*event*/)
MemCheck.Log = true;
MemCheck.Break = true;
g_memchecks.Add(MemCheck);
PowerPC::memchecks.Add(MemCheck);
Host_UpdateBreakPointView();
Close();
}

View file

@ -40,9 +40,9 @@ IUCode* UCodeFactory(u32 _CRC, CMailHandler& _rMailHandler)
case 0x65d6cc6f: // CARD
return new CUCode_CARD(_rMailHandler);
case 0x3ad3b7ac: // Naruto3
case 0x3ad3b7ac: // Naruto3, Paper Mario - The Thousand Year Door
case 0x3daf59b9: // Alien Hominid
case 0x4e8a8b21: // spdemo, ctaxi, 18 wheeler, disney, monkeyball2,cubivore,puzzlecollection,wario,
case 0x4e8a8b21: // spdemo, ctaxi, 18 wheeler, disney, monkeyball 1/2,cubivore,puzzlecollection,wario,
// capcom vs snk, naruto2, lost kingdoms, star fox, mario party 4, mortal kombat,
// smugglers run warzone, smash brothers, sonic mega collection, ZooCube
// nddemo, starfox

View file

@ -88,6 +88,7 @@ u32 DSPHost_CodeLoaded(const u8 *ptr, int size)
switch (ector_crc) {
case 0x86840740: success = DSPSymbols::ReadAnnotatedAssembly("../../Docs/DSP/DSP_UC_Zelda.txt"); break;
case 0x42f64ac4: success = DSPSymbols::ReadAnnotatedAssembly("../../Docs/DSP/DSP_UC_Luigi.txt"); break;
case 0x4e8a8b21: success = DSPSymbols::ReadAnnotatedAssembly("../../Docs/DSP/DSP_UC_AX1.txt"); break;
default: success = false; break;
}

View file

@ -147,7 +147,7 @@ void ReadData()
{
//INFO_LOG(CONSOLE, "Writing data to the Wiimote\n");
SEvent& rEvent = m_EventWriteQueue.front();
wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, m_EventWriteQueue.size());
wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, (int)m_EventWriteQueue.size());
m_EventWriteQueue.pop();
#ifdef _WIN32

2565
docs/DSP/DSP_UC_AX1.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,8 @@
// ector-CRC: 42f64ac4
// Notable differences:
// Luigi init:
//
// Luigi init (not using mail exception):
// sbset #0x02
// sbset #0x03
// sbclr #0x04
@ -16,7 +17,7 @@
// clr15
// m0
// Zelda init:
// Zelda init (using mail exception):
// sbclr #0x02 !
// sbclr #0x03 !
// sbclr #0x04
@ -26,6 +27,16 @@
// clr15
// m0
// AX1 init (not using mail exception, same as Luigi init):
// sbset #0x02
// sbset #0x03
// sbclr #0x04
// sbset #0x05
// sbset #0x06
// set16
// clr15
// m0
// exception vectors