mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Merge pull request #22086 from hrydgard/read-u32-more
Some fixes to Claude's paranoia, more memory access function cleanup
This commit is contained in:
79 files changed
+978
-1020
No files matched your search
@@ -954,8 +954,10 @@ void CtrlDisAsmView::NopInstructions(u32 selectRangeStart, u32 selectRangeEnd) {
|
||||
// Route the memory writes to the CPU thread instead of poking at it directly from this GUI
|
||||
// thread - see Core_RunOnCPUThread() in Core.h.
|
||||
Core_RunOnCPUThread([&] {
|
||||
for (u32 addr = selectRangeStart; addr < selectRangeEnd; addr += 4) {
|
||||
Memory::Write_U32(0, addr);
|
||||
if (Memory::IsValidRange(selectRangeStart, selectRangeEnd - selectRangeStart)) {
|
||||
for (u32 addr = selectRangeStart; addr < selectRangeEnd; addr += 4) {
|
||||
Memory::WriteUnchecked_U32(0, addr);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentMIPS) {
|
||||
|
||||
@@ -338,11 +338,12 @@ void CtrlDisplayListView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
||||
char *temp = new char[space];
|
||||
|
||||
char *p = temp, *end = temp + space;
|
||||
for (u32 pos = selectRangeStart; pos < selectRangeEnd && p < end; pos += instructionSize)
|
||||
{
|
||||
u32 opcode = Memory::Read_U32(pos);
|
||||
GPUDebugOp op = gpu->DisassembleOp(pos, opcode);
|
||||
p += snprintf(p, end - p, "%s\r\n", op.desc.c_str());
|
||||
if (Memory::IsValid4AlignedRange(selectRangeStart, selectRangeEnd - selectRangeStart)) {
|
||||
for (u32 pos = selectRangeStart; pos < selectRangeEnd && p < end; pos += instructionSize) {
|
||||
u32 opcode = Memory::ReadUnchecked_U32(pos);
|
||||
GPUDebugOp op = gpu->DisassembleOp(pos, opcode);
|
||||
p += snprintf(p, end - p, "%s\r\n", op.desc.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
W32Util::CopyTextToClipboard(wnd, temp);
|
||||
|
||||
@@ -77,10 +77,12 @@ static void BindPreviewProgram(GLSLProgram *&prog) {
|
||||
u32 CGEDebugger::PrimPreviewOp() {
|
||||
DisplayList list;
|
||||
if (gpu != nullptr && gpu->GetCurrentDisplayList(list)) {
|
||||
const u32 op = Memory::Read_U32(list.pc);
|
||||
const u32 cmd = op >> 24;
|
||||
if (cmd == GE_CMD_PRIM || cmd == GE_CMD_BEZIER || cmd == GE_CMD_SPLINE) {
|
||||
return op;
|
||||
if (Memory::IsValid4AlignedAddress(list.pc)) {
|
||||
const u32 op = Memory::ReadUnchecked_U32(list.pc);
|
||||
const u32 cmd = op >> 24;
|
||||
if (cmd == GE_CMD_PRIM || cmd == GE_CMD_BEZIER || cmd == GE_CMD_SPLINE) {
|
||||
return op;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user