MemoryWindow will now dump aram instead of ram - if you are viewing aram

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3624 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-06-30 21:11:39 +00:00
parent e6d78bcf3c
commit 656ba06e40
5 changed files with 47 additions and 20 deletions

View File

@ -109,7 +109,8 @@
#define WII_JAP_SETTING "setting-jpn.txt" #define WII_JAP_SETTING "setting-jpn.txt"
#define WII_SYSCONF "SYSCONF" #define WII_SYSCONF "SYSCONF"
#define MEMORY_DUMP_FILE "mainram.dump" #define RAM_DUMP "ram.raw"
#define ARAM_DUMP "aram.raw"
// Shorts - dirs // Shorts - dirs
// User dirs // User dirs
@ -155,7 +156,8 @@
#define LOGGER_CONFIG_FILE FULL_CONFIG_DIR LOGGER_CONFIG #define LOGGER_CONFIG_FILE FULL_CONFIG_DIR LOGGER_CONFIG
#define TOTALDB_FILE FULL_SYSDATA_DIR TOTALDB #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 GC_SRAM_FILE FULL_USERDATA_DIR GC_USER_DIR DIR_SEP GC_SRAM
#define MAIN_LOG_FILE FULL_LOGS_DIR MAIN_LOG #define MAIN_LOG_FILE FULL_LOGS_DIR MAIN_LOG

View File

@ -69,15 +69,6 @@ enum
AR_DMA_CNT_L = 0x502A 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 // UARAMCount
union UARAMCount union UARAMCount
{ {

View File

@ -31,6 +31,15 @@ enum DSPInterruptType
INT_AID = 2 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 Init();
void Shutdown(); void Shutdown();
void DoState(PointerWrap &p); void DoState(PointerWrap &p);

View File

@ -35,7 +35,8 @@ public:
void OnMouseUpR(wxMouseEvent& event); void OnMouseUpR(wxMouseEvent& event);
void OnPopupMenu(wxCommandEvent& event); void OnPopupMenu(wxCommandEvent& event);
u32 GetSelection() {return(selection);} u32 GetSelection() { return selection ; }
int GetMemoryType() { return memory; }
void Center(u32 addr) void Center(u32 addr)
{ {

View File

@ -35,6 +35,7 @@
#include "LogManager.h" #include "LogManager.h"
#include "HW/Memmap.h" #include "HW/Memmap.h"
#include "HW/DSP.h"
// ugly that this lib included code from the main // ugly that this lib included code from the main
#include "../../DolphinWX/Src/Globals.h" #include "../../DolphinWX/Src/Globals.h"
@ -208,9 +209,13 @@ 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 // so we can view memory in a tile/hex viewer for data analysis
void CMemoryWindow::OnDumpMemory( wxCommandEvent& event ) void CMemoryWindow::OnDumpMemory( wxCommandEvent& event )
{
switch (memview->GetMemoryType())
{
case 0:
default:
{ {
FILE* pDumpFile = fopen(MAINRAM_DUMP_FILE, "wb"); FILE* pDumpFile = fopen(MAINRAM_DUMP_FILE, "wb");
if (pDumpFile) if (pDumpFile)
@ -220,6 +225,25 @@ void CMemoryWindow::OnDumpMemory( wxCommandEvent& event )
fwrite(Memory::m_pRAM, Memory::REALRAM_SIZE, 1, pDumpFile); fwrite(Memory::m_pRAM, Memory::REALRAM_SIZE, 1, pDumpFile);
} }
fclose(pDumpFile); fclose(pDumpFile);
delete 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;
}
}