mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
This commit is contained in:
commit
2d011e94cd
@ -126,21 +126,16 @@ int cellJpgDecDestroy(u32 mainHandle)
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellJpgDecOpen(u32 mainHandle, mem32_t subHandle, u32 src_addr, mem_ptr_t<CellJpgDecOpnInfo> openInfo)
|
int cellJpgDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellJpgDecSrc> src, mem_ptr_t<CellJpgDecOpnInfo> openInfo)
|
||||||
{
|
{
|
||||||
//u32 srcSelect = Memory.Read32(src_addr);
|
cellJpgDec.Warning("cellJpgDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||||
u32 fileName = Memory.Read32(src_addr+4);
|
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||||
//u32 fileOffset = Memory.Read32(src_addr+8);
|
|
||||||
//u32 fileSize = Memory.Read32(src_addr+12);
|
|
||||||
//u32 streamPtr = Memory.Read32(src_addr+16);
|
|
||||||
//u32 streamSize = Memory.Read32(src_addr+20);
|
|
||||||
//u32 spuThreadEnable = Memory.Read32(src_addr+24);
|
|
||||||
|
|
||||||
CellJpgDecSubHandle *current_subHandle = new CellJpgDecSubHandle;
|
CellJpgDecSubHandle *current_subHandle = new CellJpgDecSubHandle;
|
||||||
|
|
||||||
// Get file descriptor
|
// Get file descriptor
|
||||||
MemoryAllocator<be_t<u32>> fd;
|
MemoryAllocator<be_t<u32>> fd;
|
||||||
int ret = cellFsOpen(fileName, 0, fd, NULL, 0);
|
int ret = cellFsOpen(src->fileName, 0, fd, NULL, 0);
|
||||||
current_subHandle->fd = fd->ToLE();
|
current_subHandle->fd = fd->ToLE();
|
||||||
if(ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE;
|
if(ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE;
|
||||||
|
|
||||||
|
@ -17,15 +17,21 @@ enum
|
|||||||
CELL_PAMF_ERROR_EP_NOT_FOUND = 0x80610507,
|
CELL_PAMF_ERROR_EP_NOT_FOUND = 0x80610507,
|
||||||
};
|
};
|
||||||
|
|
||||||
int cellPamfGetHeaderSize()
|
int cellPamfGetHeaderSize(mem8_ptr_t pAddr, u64 fileSize, mem64_t pSize)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellPamf);
|
cellPamf.Warning("cellPamfGetHeaderSize(pAddr=0x%x, fileSize=%d, pSize_addr=0x%x)",
|
||||||
|
pAddr.GetAddr(), fileSize, pSize.GetAddr());
|
||||||
|
|
||||||
|
pSize = 2048; // PAMF headers seem to be always 2048 bytes in size
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellPamfGetHeaderSize2()
|
int cellPamfGetHeaderSize2(mem8_ptr_t pAddr, u64 fileSize, u32 attribute, mem64_t pSize)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(cellPamf);
|
cellPamf.Warning("cellPamfGetHeaderSize2(pAddr=0x%x, fileSize=%d, attribute=%d, pSize_addr=0x%x)",
|
||||||
|
pAddr.GetAddr(), fileSize, attribute, pSize.GetAddr());
|
||||||
|
|
||||||
|
pSize = 2048; // PAMF headers seem to be always 2048 bytes in size
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,13 +123,10 @@ int cellPngDecDestroy(u32 mainHandle)
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, u32 src_addr, u32 openInfo)
|
int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t<CellPngDecSrc> src, u32 openInfo)
|
||||||
{
|
{
|
||||||
cellPngDec.Warning("cellPngDecOpen(mainHandle=0x%x,subHandle=0x%x,src_addr=0x%x,openInfo=0x%x)", mainHandle, subHandle.GetAddr(), src_addr, openInfo);
|
cellPngDec.Warning("cellPngDecOpen(mainHandle=0x%x, subHandle=0x%x, src_addr=0x%x, openInfo=0x%x)",
|
||||||
|
mainHandle, subHandle.GetAddr(), src.GetAddr(), openInfo);
|
||||||
CellPngDecSrc* src;
|
|
||||||
|
|
||||||
src = (CellPngDecSrc*)Memory.GetMemFromAddr(src_addr);
|
|
||||||
|
|
||||||
CellPngDecSubHandle *current_subHandle = new CellPngDecSubHandle;
|
CellPngDecSubHandle *current_subHandle = new CellPngDecSubHandle;
|
||||||
|
|
||||||
|
@ -196,23 +196,35 @@ int cellFsStat(const u32 path_addr, mem_ptr_t<CellFsStat> sb)
|
|||||||
{
|
{
|
||||||
if(path.CmpNoCase(Emu.GetVFS().m_devices[i].GetPs3Path().RemoveLast(1)) == 0)
|
if(path.CmpNoCase(Emu.GetVFS().m_devices[i].GetPs3Path().RemoveLast(1)) == 0)
|
||||||
{
|
{
|
||||||
sys_fs.Log("cellFsFstat: '%s' is a mount point.", path.mb_str());
|
sys_fs.Log("cellFsStat: '%s' is a mount point.", path.mb_str());
|
||||||
sb->st_mode |= CELL_FS_S_IFDIR;
|
sb->st_mode |= CELL_FS_S_IFDIR;
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vfsFile f(path);
|
// TODO: Temporary solution until vfsDir is implemented
|
||||||
|
wxString real_path;
|
||||||
if(!f.IsOpened())
|
Emu.GetVFS().GetDevice(path, real_path);
|
||||||
|
struct stat s;
|
||||||
|
if(stat(real_path.c_str(), &s) == 0)
|
||||||
{
|
{
|
||||||
sys_fs.Warning("cellFsFstat: '%s' not found.", path.mb_str());
|
if(s.st_mode & S_IFDIR)
|
||||||
|
{
|
||||||
|
sb->st_mode |= CELL_FS_S_IFDIR;
|
||||||
|
}
|
||||||
|
else if(s.st_mode & S_IFREG)
|
||||||
|
{
|
||||||
|
vfsFile f(path);
|
||||||
|
sb->st_mode |= CELL_FS_S_IFREG;
|
||||||
|
sb->st_size = f.GetSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStat: '%s' not found.", path.mb_str());
|
||||||
return CELL_ENOENT;
|
return CELL_ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
sb->st_mode |= CELL_FS_S_IFREG; //TODO: dir CELL_FS_S_IFDIR
|
|
||||||
sb->st_size = f.GetSize();
|
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent)
|
|||||||
cbox_img_mode->Append("RGB");
|
cbox_img_mode->Append("RGB");
|
||||||
cbox_img_mode->Append("ARGB");
|
cbox_img_mode->Append("ARGB");
|
||||||
cbox_img_mode->Append("RGBA");
|
cbox_img_mode->Append("RGBA");
|
||||||
|
cbox_img_mode->Append("ABGR");
|
||||||
cbox_img_mode->Select(1); //ARGB
|
cbox_img_mode->Select(1); //ARGB
|
||||||
s_tools_img_mode.Add(cbox_img_mode);
|
s_tools_img_mode.Add(cbox_img_mode);
|
||||||
|
|
||||||
@ -119,7 +120,6 @@ MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent)
|
|||||||
SetSizerAndFit(&s_panel);
|
SetSizerAndFit(&s_panel);
|
||||||
|
|
||||||
//Events
|
//Events
|
||||||
//Connect( wxEVT_SIZE, wxSizeEventHandler(MemoryViewerPanel::OnResize) );
|
|
||||||
Connect(t_addr->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(MemoryViewerPanel::OnChangeToolsAddr) );
|
Connect(t_addr->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(MemoryViewerPanel::OnChangeToolsAddr) );
|
||||||
Connect(sc_bytes->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(MemoryViewerPanel::OnChangeToolsBytes) );
|
Connect(sc_bytes->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(MemoryViewerPanel::OnChangeToolsBytes) );
|
||||||
Connect(sc_bytes->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler(MemoryViewerPanel::OnChangeToolsBytes) );
|
Connect(sc_bytes->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler(MemoryViewerPanel::OnChangeToolsBytes) );
|
||||||
@ -128,7 +128,7 @@ MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent)
|
|||||||
Connect(b_next->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::Next));
|
Connect(b_next->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::Next));
|
||||||
Connect(b_fprev->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::fPrev));
|
Connect(b_fprev->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::fPrev));
|
||||||
Connect(b_fnext->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::fNext));
|
Connect(b_fnext->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::fNext));
|
||||||
Connect(b_img->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::ShowImage));
|
Connect(b_img->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MemoryViewerPanel::OnShowImage));
|
||||||
|
|
||||||
t_mem_addr ->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(MemoryViewerPanel::OnScrollMemory), NULL, this);
|
t_mem_addr ->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(MemoryViewerPanel::OnScrollMemory), NULL, this);
|
||||||
t_mem_hex ->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(MemoryViewerPanel::OnScrollMemory), NULL, this);
|
t_mem_hex ->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(MemoryViewerPanel::OnScrollMemory), NULL, this);
|
||||||
@ -138,15 +138,6 @@ MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent)
|
|||||||
ShowMemory();
|
ShowMemory();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*void MemoryViewerPanel::OnResize(wxSizeEvent& event)
|
|
||||||
{
|
|
||||||
const wxSize size(GetClientSize());
|
|
||||||
hex_wind->SetSize( size.GetWidth(), size.GetHeight() - 25);
|
|
||||||
hex_wind->SetColumnWidth(COL_COUNT, size.GetWidth() - m_colcount - 4);
|
|
||||||
|
|
||||||
event.Skip();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
void MemoryViewerPanel::OnChangeToolsAddr(wxCommandEvent& event)
|
void MemoryViewerPanel::OnChangeToolsAddr(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
t_addr->GetValue().ToULong((unsigned long *)&m_addr, 16);
|
t_addr->GetValue().ToULong((unsigned long *)&m_addr, 16);
|
||||||
@ -179,6 +170,15 @@ void MemoryViewerPanel::OnScrollMemory(wxMouseEvent& event)
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MemoryViewerPanel::OnShowImage(wxCommandEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
u32 addr = m_addr;
|
||||||
|
int mode = cbox_img_mode->GetSelection();
|
||||||
|
int sizex = sc_img_size_x->GetValue();
|
||||||
|
int sizey = sc_img_size_y->GetValue();
|
||||||
|
ShowImage(this, m_addr, mode, sizex, sizey, false);
|
||||||
|
}
|
||||||
|
|
||||||
void MemoryViewerPanel::ShowMemory()
|
void MemoryViewerPanel::ShowMemory()
|
||||||
{
|
{
|
||||||
wxString t_mem_addr_str;
|
wxString t_mem_addr_str;
|
||||||
@ -211,58 +211,70 @@ void MemoryViewerPanel::ShowMemory()
|
|||||||
t_mem_ascii->SetValue(t_mem_ascii_str);
|
t_mem_ascii->SetValue(t_mem_ascii_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryViewerPanel::ShowImage(wxCommandEvent& WXUNUSED(event))
|
void MemoryViewerPanel::ShowImage(wxWindow* parent, u32 addr, int mode, int width, int height, bool flipv)
|
||||||
{
|
{
|
||||||
wxString title = wxString::Format("Raw Image @ 0x%x", m_addr);
|
wxString title = wxString::Format("Raw Image @ 0x%x", addr);
|
||||||
int mode = cbox_img_mode->GetSelection();
|
|
||||||
int sizex = sc_img_size_x->GetValue();
|
wxFrame* f_image_viewer = new wxFrame(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize,
|
||||||
int sizey = sc_img_size_y->GetValue();
|
|
||||||
|
|
||||||
wxFrame* f_image_viewer = new wxFrame(this, wxID_ANY, title, wxDefaultPosition, wxDefaultSize,
|
|
||||||
wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX | wxCAPTION | wxCLIP_CHILDREN);
|
wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX | wxCAPTION | wxCLIP_CHILDREN);
|
||||||
f_image_viewer->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
|
f_image_viewer->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
|
||||||
f_image_viewer->SetAutoLayout(true);
|
f_image_viewer->SetAutoLayout(true);
|
||||||
f_image_viewer->SetClientSize(wxSize(sizex,sizey));
|
f_image_viewer->SetClientSize(wxSize(width, height));
|
||||||
f_image_viewer->Show();
|
f_image_viewer->Show();
|
||||||
|
|
||||||
wxClientDC dc_canvas(f_image_viewer);
|
wxClientDC dc_canvas(f_image_viewer);
|
||||||
u32 addr = m_addr;
|
|
||||||
for(int y = 0; y < sizex; y++)
|
unsigned char* originalBuffer = (unsigned char*)Memory.VirtualToRealAddr(addr);
|
||||||
|
unsigned char* convertedBuffer = (unsigned char*)malloc(width * height * 3);
|
||||||
|
switch(mode)
|
||||||
{
|
{
|
||||||
for(int x = 0; x < sizey; x++)
|
case(0): // RGB
|
||||||
{
|
memcpy(convertedBuffer, originalBuffer, width * height * 3);
|
||||||
char R,G,B;
|
break;
|
||||||
switch(mode)
|
|
||||||
{
|
case(1): // ARGB
|
||||||
case(0): //RGB
|
for (u32 y=0; y<height; y++){
|
||||||
R = Memory.IsGoodAddr(addr+0) ? Memory.Read8(addr+0) : 0;
|
for (u32 i=0, j=0; j<width*4; i+=3, j+=4){
|
||||||
G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0;
|
convertedBuffer[i+0 + y*width*3] = originalBuffer[j+1 + y*width*4];
|
||||||
B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0;
|
convertedBuffer[i+1 + y*width*3] = originalBuffer[j+2 + y*width*4];
|
||||||
dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3));
|
convertedBuffer[i+2 + y*width*3] = originalBuffer[j+3 + y*width*4];
|
||||||
dc_canvas.DrawPoint(x,y);
|
}
|
||||||
addr += 3;
|
}
|
||||||
break;
|
break;
|
||||||
case(1): //ARGB
|
|
||||||
//A = Memory.IsGoodAddr(addr+0) ? Memory.Read8(addr+0) : 0;
|
case(2): // RGBA
|
||||||
R = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0;
|
for (u32 y=0; y<height; y++){
|
||||||
G = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0;
|
for (u32 i=0, j=0; j<width*4; i+=3, j+=4){
|
||||||
B = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0;
|
convertedBuffer[i+0 + y*width*3] = originalBuffer[j+0 + y*width*4];
|
||||||
dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3));
|
convertedBuffer[i+1 + y*width*3] = originalBuffer[j+1 + y*width*4];
|
||||||
dc_canvas.DrawPoint(x,y);
|
convertedBuffer[i+2 + y*width*3] = originalBuffer[j+2 + y*width*4];
|
||||||
addr += 4;
|
}
|
||||||
break;
|
}
|
||||||
case(2): //RGBA
|
break;
|
||||||
R = Memory.IsGoodAddr(addr+0) ? Memory.Read8(addr+0) : 0;
|
|
||||||
G = Memory.IsGoodAddr(addr+1) ? Memory.Read8(addr+1) : 0;
|
case(3): // ABGR
|
||||||
B = Memory.IsGoodAddr(addr+2) ? Memory.Read8(addr+2) : 0;
|
for (u32 y=0; y<height; y++){
|
||||||
//A = Memory.IsGoodAddr(addr+3) ? Memory.Read8(addr+3) : 0;
|
for (u32 i=0, j=0; j<width*4; i+=3, j+=4){
|
||||||
dc_canvas.SetPen(wxPen(wxColour(R,G,B), 3));
|
convertedBuffer[i+0 + y*width*3] = originalBuffer[j+3 + y*width*4];
|
||||||
dc_canvas.DrawPoint(x,y);
|
convertedBuffer[i+1 + y*width*3] = originalBuffer[j+2 + y*width*4];
|
||||||
addr += 4;
|
convertedBuffer[i+2 + y*width*3] = originalBuffer[j+1 + y*width*4];
|
||||||
break;
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flip vertically
|
||||||
|
if (flipv){
|
||||||
|
for (u32 y=0; y<height/2; y++){
|
||||||
|
for (u32 x=0; x<width*3; x++){
|
||||||
|
const u8 t = convertedBuffer[x + y*width*3];
|
||||||
|
convertedBuffer[x + y*width*3] = convertedBuffer[x + (height-y-1)*width*3];
|
||||||
|
convertedBuffer[x + (height-y-1)*width*3] = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxImage img(width, height, convertedBuffer);
|
||||||
|
dc_canvas.DrawBitmap(img, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryViewerPanel::Next (wxCommandEvent& WXUNUSED(event)) { m_addr += m_colcount; ShowMemory(); }
|
void MemoryViewerPanel::Next (wxCommandEvent& WXUNUSED(event)) { m_addr += m_colcount; ShowMemory(); }
|
||||||
|
@ -4,13 +4,9 @@
|
|||||||
|
|
||||||
class MemoryViewerPanel : public wxFrame
|
class MemoryViewerPanel : public wxFrame
|
||||||
{
|
{
|
||||||
//static const uint LINE_COUNT = 50;
|
|
||||||
//static const uint COL_COUNT = 17;
|
|
||||||
|
|
||||||
u32 m_addr;
|
u32 m_addr;
|
||||||
u32 m_colcount;
|
u32 m_colcount;
|
||||||
u32 m_rowcount;
|
u32 m_rowcount;
|
||||||
//wxListView* hex_wind;
|
|
||||||
|
|
||||||
wxTextCtrl* t_addr;
|
wxTextCtrl* t_addr;
|
||||||
wxSpinCtrl* sc_bytes;
|
wxSpinCtrl* sc_bytes;
|
||||||
@ -31,10 +27,10 @@ public:
|
|||||||
exit = true;
|
exit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//virtual void OnResize(wxSizeEvent& event);
|
|
||||||
virtual void OnChangeToolsAddr(wxCommandEvent& event);
|
virtual void OnChangeToolsAddr(wxCommandEvent& event);
|
||||||
virtual void OnChangeToolsBytes(wxCommandEvent& event);
|
virtual void OnChangeToolsBytes(wxCommandEvent& event);
|
||||||
virtual void OnScrollMemory(wxMouseEvent& event);
|
virtual void OnScrollMemory(wxMouseEvent& event);
|
||||||
|
virtual void OnShowImage(wxCommandEvent& WXUNUSED(event));
|
||||||
|
|
||||||
virtual void Next(wxCommandEvent& event);
|
virtual void Next(wxCommandEvent& event);
|
||||||
virtual void Prev(wxCommandEvent& event);
|
virtual void Prev(wxCommandEvent& event);
|
||||||
@ -42,7 +38,8 @@ public:
|
|||||||
virtual void fPrev(wxCommandEvent& event);
|
virtual void fPrev(wxCommandEvent& event);
|
||||||
|
|
||||||
virtual void ShowMemory();
|
virtual void ShowMemory();
|
||||||
virtual void ShowImage(wxCommandEvent& WXUNUSED(event));
|
|
||||||
|
|
||||||
void SetPC(const uint pc) { m_addr = pc; }
|
void SetPC(const uint pc) { m_addr = pc; }
|
||||||
};
|
|
||||||
|
//Static methods
|
||||||
|
static void ShowImage(wxWindow* parent, u32 addr, int mode, int sizex, int sizey, bool flipv);
|
||||||
|
};
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
#include "Emu/GS/sysutil_video.h"
|
#include "Emu/GS/sysutil_video.h"
|
||||||
#include "Emu/GS/GCM.h"
|
#include "Emu/GS/GCM.h"
|
||||||
|
|
||||||
|
#include "MemoryViewer.h"
|
||||||
|
|
||||||
enum GCMEnumTypes
|
enum GCMEnumTypes
|
||||||
{
|
{
|
||||||
CELL_GCM,
|
CELL_GCM_ENUM,
|
||||||
CELL_GCM_PRIMITIVE,
|
CELL_GCM_PRIMITIVE_ENUM,
|
||||||
};
|
};
|
||||||
|
|
||||||
RSXDebugger::RSXDebugger(wxWindow* parent)
|
RSXDebugger::RSXDebugger(wxWindow* parent)
|
||||||
@ -95,14 +97,14 @@ RSXDebugger::RSXDebugger(wxWindow* parent)
|
|||||||
m_list_commands->InsertColumn(1, "Value", 0, 80);
|
m_list_commands->InsertColumn(1, "Value", 0, 80);
|
||||||
m_list_commands->InsertColumn(2, "Command", 0, 250);
|
m_list_commands->InsertColumn(2, "Command", 0, 250);
|
||||||
m_list_commands->InsertColumn(3, "Count", 0, 40);
|
m_list_commands->InsertColumn(3, "Count", 0, 40);
|
||||||
m_list_flags->InsertColumn(0, "Name", 0, 150);
|
m_list_flags->InsertColumn(0, "Name", 0, 170);
|
||||||
m_list_flags->InsertColumn(1, "Value", 0, 300);
|
m_list_flags->InsertColumn(1, "Value", 0, 270);
|
||||||
m_list_lightning->InsertColumn(0, "Name", 0, 150);
|
m_list_lightning->InsertColumn(0, "Name", 0, 170);
|
||||||
m_list_lightning->InsertColumn(1, "Value", 0, 300);
|
m_list_lightning->InsertColumn(1, "Value", 0, 270);
|
||||||
m_list_texture->InsertColumn(0, "Name", 0, 150);
|
m_list_texture->InsertColumn(0, "Name", 0, 170);
|
||||||
m_list_texture->InsertColumn(1, "Value", 0, 300);
|
m_list_texture->InsertColumn(1, "Value", 0, 270);
|
||||||
m_list_settings->InsertColumn(0, "Name", 0, 150);
|
m_list_settings->InsertColumn(0, "Name", 0, 170);
|
||||||
m_list_settings->InsertColumn(1, "Value", 0, 300);
|
m_list_settings->InsertColumn(1, "Value", 0, 270);
|
||||||
|
|
||||||
// Fill list
|
// Fill list
|
||||||
for(u32 i=0; i<m_item_count; i++)
|
for(u32 i=0; i<m_item_count; i++)
|
||||||
@ -186,6 +188,14 @@ RSXDebugger::RSXDebugger(wxWindow* parent)
|
|||||||
Connect(b_goto_get->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RSXDebugger::GoToGet));
|
Connect(b_goto_get->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RSXDebugger::GoToGet));
|
||||||
Connect(b_goto_put->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RSXDebugger::GoToPut));
|
Connect(b_goto_put->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RSXDebugger::GoToPut));
|
||||||
|
|
||||||
|
p_buffer_colorA->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(RSXDebugger::OnClickBuffer), NULL, this);
|
||||||
|
p_buffer_colorB->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(RSXDebugger::OnClickBuffer), NULL, this);
|
||||||
|
p_buffer_colorC->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(RSXDebugger::OnClickBuffer), NULL, this);
|
||||||
|
p_buffer_colorD->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(RSXDebugger::OnClickBuffer), NULL, this);
|
||||||
|
//Connect(p_buffer_depth->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RSXDebugger::OnClickBuffer));
|
||||||
|
//Connect(p_buffer_stencil->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RSXDebugger::OnClickBuffer));
|
||||||
|
p_buffer_tex->Connect(wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(RSXDebugger::OnClickBuffer), NULL, this);
|
||||||
|
|
||||||
m_list_commands->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(RSXDebugger::OnScrollMemory), NULL, this);
|
m_list_commands->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(RSXDebugger::OnScrollMemory), NULL, this);
|
||||||
m_list_flags->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(RSXDebugger::SetFlags), NULL, this);
|
m_list_flags->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(RSXDebugger::SetFlags), NULL, this);
|
||||||
|
|
||||||
@ -217,6 +227,32 @@ void RSXDebugger::OnScrollMemory(wxMouseEvent& event)
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RSXDebugger::OnClickBuffer(wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
if (!RSXReady()) return;
|
||||||
|
const GSRender& render = Emu.GetGSManager().GetRender();
|
||||||
|
const mem_ptr_t<gcmBuffer> buffers = render.m_gcm_buffers_addr;
|
||||||
|
|
||||||
|
// TODO: Is there any better way to choose the color buffers
|
||||||
|
#define SHOW_BUFFER(id) \
|
||||||
|
MemoryViewerPanel::ShowImage(this, render.m_local_mem_addr + re(buffers[id].offset), \
|
||||||
|
3, re(buffers[id].width), re(buffers[id].height), true);
|
||||||
|
|
||||||
|
if (event.GetId() == p_buffer_colorA->GetId()) SHOW_BUFFER(0);
|
||||||
|
if (event.GetId() == p_buffer_colorB->GetId()) SHOW_BUFFER(1);
|
||||||
|
if (event.GetId() == p_buffer_colorC->GetId()) SHOW_BUFFER(2);
|
||||||
|
if (event.GetId() == p_buffer_colorD->GetId()) SHOW_BUFFER(3);
|
||||||
|
if (event.GetId() == p_buffer_tex->GetId())
|
||||||
|
{
|
||||||
|
MemoryViewerPanel::ShowImage(this,
|
||||||
|
render.m_textures[0].m_offset, 0,
|
||||||
|
render.m_textures[0].m_width,
|
||||||
|
render.m_textures[0].m_height, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef SHOW_BUFFER
|
||||||
|
}
|
||||||
|
|
||||||
void RSXDebugger::GoToGet(wxCommandEvent& event)
|
void RSXDebugger::GoToGet(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if (!RSXReady()) return;
|
if (!RSXReady()) return;
|
||||||
@ -391,6 +427,13 @@ void RSXDebugger::GetTexture()
|
|||||||
m_list_texture->InsertItem(i, name); m_list_texture->SetItem(i, 1, value); i++;
|
m_list_texture->InsertItem(i, name); m_list_texture->SetItem(i, 1, value); i++;
|
||||||
|
|
||||||
LIST_TEXTURE_ADD("Texture #0 Address:", wxString::Format("0x%x", render.m_textures[0].m_offset));
|
LIST_TEXTURE_ADD("Texture #0 Address:", wxString::Format("0x%x", render.m_textures[0].m_offset));
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Cubemap:", render.m_textures[0].m_cubemap ? "True" : "False");
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Depth:", wxString::Format("0x%x", render.m_textures[0].m_depth));
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Dimension:", wxString::Format("0x%x", render.m_textures[0].m_dimension));
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Enabled:", render.m_textures[0].m_enabled ? "True" : "False");
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Format:", wxString::Format("0x%x", render.m_textures[0].m_format));
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Mipmap:", wxString::Format("0x%x", render.m_textures[0].m_mipmap));
|
||||||
|
LIST_TEXTURE_ADD("Texture #0 Pitch:", wxString::Format("0x%x", render.m_textures[0].m_pitch));
|
||||||
LIST_TEXTURE_ADD("Texture #0 Size:", wxString::Format("%d x %d",
|
LIST_TEXTURE_ADD("Texture #0 Size:", wxString::Format("%d x %d",
|
||||||
render.m_textures[0].m_width,
|
render.m_textures[0].m_width,
|
||||||
render.m_textures[0].m_height));
|
render.m_textures[0].m_height));
|
||||||
@ -410,7 +453,7 @@ void RSXDebugger::GetSettings()
|
|||||||
|
|
||||||
LIST_SETTINGS_ADD("Alpha func", !(render.m_set_alpha_func) ? "(none)" : wxString::Format("0x%x (%s)",
|
LIST_SETTINGS_ADD("Alpha func", !(render.m_set_alpha_func) ? "(none)" : wxString::Format("0x%x (%s)",
|
||||||
render.m_alpha_func,
|
render.m_alpha_func,
|
||||||
ParseGCMEnum(render.m_alpha_func, CELL_GCM)));
|
ParseGCMEnum(render.m_alpha_func, CELL_GCM_ENUM)));
|
||||||
LIST_SETTINGS_ADD("Blend color", !(render.m_set_blend_color) ? "(none)" : wxString::Format("R:%d, G:%d, B:%d, A:%d",
|
LIST_SETTINGS_ADD("Blend color", !(render.m_set_blend_color) ? "(none)" : wxString::Format("R:%d, G:%d, B:%d, A:%d",
|
||||||
render.m_blend_color_r,
|
render.m_blend_color_r,
|
||||||
render.m_blend_color_g,
|
render.m_blend_color_g,
|
||||||
@ -427,12 +470,13 @@ void RSXDebugger::GetSettings()
|
|||||||
LIST_SETTINGS_ADD("Context DMA Color C", wxString::Format("0x%x", render.m_context_dma_color_c));
|
LIST_SETTINGS_ADD("Context DMA Color C", wxString::Format("0x%x", render.m_context_dma_color_c));
|
||||||
LIST_SETTINGS_ADD("Context DMA Color D", wxString::Format("0x%x", render.m_context_dma_color_d));
|
LIST_SETTINGS_ADD("Context DMA Color D", wxString::Format("0x%x", render.m_context_dma_color_d));
|
||||||
LIST_SETTINGS_ADD("Context DMA Zeta", wxString::Format("0x%x", render.m_context_dma_z));
|
LIST_SETTINGS_ADD("Context DMA Zeta", wxString::Format("0x%x", render.m_context_dma_z));
|
||||||
|
LIST_SETTINGS_ADD("Depth bounds", wxString::Format("Min:%f, Max:%f", render.m_depth_bounds_min, render.m_depth_bounds_max));
|
||||||
LIST_SETTINGS_ADD("Depth func", !(render.m_set_depth_func) ? "(none)" : wxString::Format("0x%x (%s)",
|
LIST_SETTINGS_ADD("Depth func", !(render.m_set_depth_func) ? "(none)" : wxString::Format("0x%x (%s)",
|
||||||
render.m_depth_func,
|
render.m_depth_func,
|
||||||
ParseGCMEnum(render.m_depth_func, CELL_GCM)));
|
ParseGCMEnum(render.m_depth_func, CELL_GCM_ENUM)));
|
||||||
LIST_SETTINGS_ADD("Draw mode", wxString::Format("%d (%s)",
|
LIST_SETTINGS_ADD("Draw mode", wxString::Format("%d (%s)",
|
||||||
render.m_draw_mode,
|
render.m_draw_mode,
|
||||||
ParseGCMEnum(render.m_draw_mode, CELL_GCM_PRIMITIVE)));
|
ParseGCMEnum(render.m_draw_mode, CELL_GCM_PRIMITIVE_ENUM)));
|
||||||
LIST_SETTINGS_ADD("Scissor", wxString::Format("X:%d, Y:%d, W:%d, H:%d",
|
LIST_SETTINGS_ADD("Scissor", wxString::Format("X:%d, Y:%d, W:%d, H:%d",
|
||||||
render.m_scissor_x,
|
render.m_scissor_x,
|
||||||
render.m_scissor_y,
|
render.m_scissor_y,
|
||||||
@ -440,7 +484,7 @@ void RSXDebugger::GetSettings()
|
|||||||
render.m_scissor_h));
|
render.m_scissor_h));
|
||||||
LIST_SETTINGS_ADD("Stencil func", !(render.m_set_stencil_func) ? "(none)" : wxString::Format("0x%x (%s)",
|
LIST_SETTINGS_ADD("Stencil func", !(render.m_set_stencil_func) ? "(none)" : wxString::Format("0x%x (%s)",
|
||||||
render.m_stencil_func,
|
render.m_stencil_func,
|
||||||
ParseGCMEnum(render.m_stencil_func, CELL_GCM)));
|
ParseGCMEnum(render.m_stencil_func, CELL_GCM_ENUM)));
|
||||||
LIST_SETTINGS_ADD("Surface Pitch A", wxString::Format("0x%x", render.m_surface_pitch_a));
|
LIST_SETTINGS_ADD("Surface Pitch A", wxString::Format("0x%x", render.m_surface_pitch_a));
|
||||||
LIST_SETTINGS_ADD("Surface Pitch B", wxString::Format("0x%x", render.m_surface_pitch_b));
|
LIST_SETTINGS_ADD("Surface Pitch B", wxString::Format("0x%x", render.m_surface_pitch_b));
|
||||||
LIST_SETTINGS_ADD("Surface Pitch C", wxString::Format("0x%x", render.m_surface_pitch_c));
|
LIST_SETTINGS_ADD("Surface Pitch C", wxString::Format("0x%x", render.m_surface_pitch_c));
|
||||||
@ -487,7 +531,7 @@ wxString RSXDebugger::ParseGCMEnum(u32 value, u32 type)
|
|||||||
{
|
{
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case CELL_GCM:
|
case CELL_GCM_ENUM:
|
||||||
{
|
{
|
||||||
switch(value)
|
switch(value)
|
||||||
{
|
{
|
||||||
@ -528,7 +572,7 @@ wxString RSXDebugger::ParseGCMEnum(u32 value, u32 type)
|
|||||||
default: return "Wrong Value!";
|
default: return "Wrong Value!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case CELL_GCM_PRIMITIVE:
|
case CELL_GCM_PRIMITIVE_ENUM:
|
||||||
{
|
{
|
||||||
switch(value)
|
switch(value)
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
virtual void OnKeyDown(wxKeyEvent& event);
|
virtual void OnKeyDown(wxKeyEvent& event);
|
||||||
virtual void OnChangeToolsAddr(wxCommandEvent& event);
|
virtual void OnChangeToolsAddr(wxCommandEvent& event);
|
||||||
virtual void OnScrollMemory(wxMouseEvent& event);
|
virtual void OnScrollMemory(wxMouseEvent& event);
|
||||||
|
virtual void OnClickBuffer(wxMouseEvent& event);
|
||||||
|
|
||||||
virtual void GoToGet(wxCommandEvent& event);
|
virtual void GoToGet(wxCommandEvent& event);
|
||||||
virtual void GoToPut(wxCommandEvent& event);
|
virtual void GoToPut(wxCommandEvent& event);
|
||||||
|
@ -273,6 +273,7 @@
|
|||||||
<ClCompile Include="Emu\SysCalls\Modules\cellGcmSys.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellGcmSys.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellGifDec.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellGifDec.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellJpgDec.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellJpgDec.cpp" />
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\cellPamf.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellPngDec.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellPngDec.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellResc.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellResc.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellRtc.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellRtc.cpp" />
|
||||||
|
@ -364,6 +364,9 @@
|
|||||||
<ClCompile Include="Gui\RSXDebugger.cpp">
|
<ClCompile Include="Gui\RSXDebugger.cpp">
|
||||||
<Filter>Gui</Filter>
|
<Filter>Gui</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\cellPamf.cpp">
|
||||||
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="rpcs3.rc" />
|
<ResourceCompile Include="rpcs3.rc" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user