diff --git a/Source/Core/Common/Src/CommonPaths.h b/Source/Core/Common/Src/CommonPaths.h index e1cfbecfe7..12b521c02d 100644 --- a/Source/Core/Common/Src/CommonPaths.h +++ b/Source/Core/Common/Src/CommonPaths.h @@ -109,7 +109,8 @@ #define WII_JAP_SETTING "setting-jpn.txt" #define WII_SYSCONF "SYSCONF" -#define MEMORY_DUMP_FILE "mainram.dump" +#define RAM_DUMP "ram.raw" +#define ARAM_DUMP "aram.raw" // Shorts - dirs // User dirs @@ -155,7 +156,8 @@ #define LOGGER_CONFIG_FILE FULL_CONFIG_DIR LOGGER_CONFIG #define TOTALDB_FILE FULL_SYSDATA_DIR TOTALDB -#define MAINRAM_DUMP_FILE FULL_DUMP_DIR MEMORY_DUMP_FILE +#define MAINRAM_DUMP_FILE FULL_DUMP_DIR RAM_DUMP +#define ARAM_DUMP_FILE FULL_DUMP_DIR ARAM_DUMP #define GC_SRAM_FILE FULL_USERDATA_DIR GC_USER_DIR DIR_SEP GC_SRAM #define MAIN_LOG_FILE FULL_LOGS_DIR MAIN_LOG diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index e7a649a99a..3e95ecc910 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -69,15 +69,6 @@ enum AR_DMA_CNT_L = 0x502A }; -// aram size and mask -enum -{ - ARAM_SIZE = 0x01000000, // 16 MB - ARAM_MASK = 0x00FFFFFF, - WII_MASK = 0x017FFFFF, // 24 MB - WII_MEM2 = 0x03FFFFFF // 64 MB -}; - // UARAMCount union UARAMCount { diff --git a/Source/Core/Core/Src/HW/DSP.h b/Source/Core/Core/Src/HW/DSP.h index 1449dabe16..6fd25a952c 100644 --- a/Source/Core/Core/Src/HW/DSP.h +++ b/Source/Core/Core/Src/HW/DSP.h @@ -31,6 +31,15 @@ enum DSPInterruptType INT_AID = 2 }; +// aram size and mask +enum +{ + ARAM_SIZE = 0x01000000, // 16 MB + ARAM_MASK = 0x00FFFFFF, + WII_MASK = 0x017FFFFF, // 24 MB + WII_MEM2 = 0x03FFFFFF // 64 MB +}; + void Init(); void Shutdown(); void DoState(PointerWrap &p); diff --git a/Source/Core/DebuggerWX/Src/MemoryView.h b/Source/Core/DebuggerWX/Src/MemoryView.h index 70c1371f85..6a2d1b36e4 100644 --- a/Source/Core/DebuggerWX/Src/MemoryView.h +++ b/Source/Core/DebuggerWX/Src/MemoryView.h @@ -35,7 +35,8 @@ public: void OnMouseUpR(wxMouseEvent& event); void OnPopupMenu(wxCommandEvent& event); - u32 GetSelection() {return(selection);} + u32 GetSelection() { return selection ; } + int GetMemoryType() { return memory; } void Center(u32 addr) { diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp index a93d095d14..20bdc7c1e6 100644 --- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp +++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp @@ -35,6 +35,7 @@ #include "LogManager.h" #include "HW/Memmap.h" +#include "HW/DSP.h" // ugly that this lib included code from the main #include "../../DolphinWX/Src/Globals.h" @@ -208,18 +209,41 @@ void CMemoryWindow::OnHostMessage(wxCommandEvent& event) } } -// this is a simple main 1Tsram dump, // so we can view memory in a tile/hex viewer for data analysis void CMemoryWindow::OnDumpMemory( wxCommandEvent& event ) { - FILE* pDumpFile = fopen(MAINRAM_DUMP_FILE, "wb"); - if (pDumpFile) + switch (memview->GetMemoryType()) { - if (Memory::m_pRAM) + case 0: + default: { - fwrite(Memory::m_pRAM, Memory::REALRAM_SIZE, 1, pDumpFile); + FILE* pDumpFile = fopen(MAINRAM_DUMP_FILE, "wb"); + if (pDumpFile) + { + if (Memory::m_pRAM) + { + fwrite(Memory::m_pRAM, Memory::REALRAM_SIZE, 1, pDumpFile); + } + fclose(pDumpFile); + delete pDumpFile; + } } - fclose(pDumpFile); - } -} + break; + case 1: + { + FILE* pDumpFile = fopen(ARAM_DUMP_FILE, "wb"); + if (pDumpFile) + { + u8* aram = DSP::GetARAMPtr(); + if (aram) + { + fwrite(aram, DSP::ARAM_SIZE, 1, pDumpFile); + } + fclose(pDumpFile); + delete pDumpFile; + } + } + break; + } +}