More memory cleanup

This commit is contained in:
Henrik Rydgård committed 2026-08-11 20:12:10 +02:00
1 parent cd052ea640
commit 3bd41376da
43 files changed
+574 -527

No files matched your search

+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;