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:
Henrik Rydgård authored and GitHub committed 2026-08-11 23:52:17 +02:00
commit 4d8a5d74e7
79 files changed
+978 -1020

No files matched your search

+4 -2
View File
@@ -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) {
+6 -5
View File
@@ -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);
+6 -4
View File
@@ -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;