From f170901c5563d093b14180dd6c06ba1d063c1fdd Mon Sep 17 00:00:00 2001 From: starfrost013 Date: Tue, 15 Apr 2025 01:07:41 +0100 Subject: [PATCH] some logging fixes --- src/video/nv/nv3/classes/nv3_class_010_blit.c | 6 +++--- src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c | 1 + src/video/nv/nv3/render/nv3_render_blit.c | 4 ++-- src/video/nv/nv3/subsystems/nv3_pgraph.c | 1 + src/video/nv/nv3/subsystems/nv3_pramdac.c | 3 +-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/video/nv/nv3/classes/nv3_class_010_blit.c b/src/video/nv/nv3/classes/nv3_class_010_blit.c index b1dc30ea0..5f58ce6f9 100644 --- a/src/video/nv/nv3/classes/nv3_class_010_blit.c +++ b/src/video/nv/nv3/classes/nv3_class_010_blit.c @@ -35,19 +35,19 @@ void nv3_class_010_method(uint32_t param, uint32_t method_id, nv3_ramin_context_ case NV3_BLIT_POSITION_IN: nv3->pgraph.blit.point_in.x = (param & 0xFFFF); nv3->pgraph.blit.point_in.y = ((param >> 16) & 0xFFFF); - nv_log("Method Execution: S2SB POINT_IN %04x,%04x\n", nv3->pgraph.blit.point_in.x, nv3->pgraph.blit.point_in.y); + nv_log("Method Execution: S2SB POINT_IN %d,%d\n", nv3->pgraph.blit.point_in.x, nv3->pgraph.blit.point_in.y); break; case NV3_BLIT_POSITION_OUT: nv3->pgraph.blit.point_out.x = (param & 0xFFFF); nv3->pgraph.blit.point_out.y = ((param >> 16) & 0xFFFF); - nv_log("Method Execution: S2SB POINT_OUT %04x,%04x\n", nv3->pgraph.blit.point_out.x, nv3->pgraph.blit.point_out.y); + nv_log("Method Execution: S2SB POINT_OUT %d,%d\n", nv3->pgraph.blit.point_out.x, nv3->pgraph.blit.point_out.y); break; case NV3_BLIT_SIZE: /* This is the last one*/ nv3->pgraph.blit.size.w = (param & 0xFFFF); nv3->pgraph.blit.size.h = ((param >> 16) & 0xFFFF); - nv_log("Method Execution: S2SB Size %04x,%04x grobj_0=0x%08x\n", nv3->pgraph.blit.size.w, nv3->pgraph.blit.size.h, grobj.grobj_0); + nv_log("Method Execution: S2SB Size %d,%d grobj_0=0x%08x\n", nv3->pgraph.blit.size.w, nv3->pgraph.blit.size.h, grobj.grobj_0); /* Some of these seem to have sizes of 0, so skip */ if (nv3->pgraph.blit.size.h == 0 diff --git a/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c b/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c index 87cf01812..5a1d08733 100644 --- a/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c +++ b/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c @@ -32,6 +32,7 @@ void nv3_class_01c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_ { /* We need this for a lot of methods, so may as well store it here. */ uint32_t src_buffer_id = (grobj.grobj_0 >> NV3_PGRAPH_CONTEXT_SWITCH_SRC_BUFFER) & 0x03; + switch (method_id) { diff --git a/src/video/nv/nv3/render/nv3_render_blit.c b/src/video/nv/nv3/render/nv3_render_blit.c index 788cb4ca2..ed8858ee3 100644 --- a/src/video/nv/nv3/render/nv3_render_blit.c +++ b/src/video/nv/nv3/render/nv3_render_blit.c @@ -142,8 +142,8 @@ void nv3_render_blit_screen2screen(nv3_grobj_t grobj) if ((grobj.grobj_0 >> NV3_PGRAPH_CONTEXT_SWITCH_DST_BUFFER2_ENABLED) & 0x01) dst_buffer = 2; if ((grobj.grobj_0 >> NV3_PGRAPH_CONTEXT_SWITCH_DST_BUFFER3_ENABLED) & 0x01) dst_buffer = 3; - nv3_position_16_t old_position; - nv3_position_16_t new_position; + nv3_position_16_t old_position = {0}; + nv3_position_16_t new_position = {0}; /* If src_buffer != dst_buffer, the positions and src/dst buffer seem to be swapped. Some kind of hardware errata (?), otherwise, I have no explanation for this behaviour. */ diff --git a/src/video/nv/nv3/subsystems/nv3_pgraph.c b/src/video/nv/nv3/subsystems/nv3_pgraph.c index 43befe49c..20cb97076 100644 --- a/src/video/nv/nv3/subsystems/nv3_pgraph.c +++ b/src/video/nv/nv3/subsystems/nv3_pgraph.c @@ -85,6 +85,7 @@ nv_register_t pgraph_registers[] = { { NV3_PGRAPH_STATUS, "PGRAPH Status", NULL, NULL }, { NV3_PGRAPH_TRAPPED_ADDRESS, "PGRAPH Trapped Address", NULL, NULL }, { NV3_PGRAPH_TRAPPED_DATA, "PGRAPH Trapped Data", NULL, NULL }, + { NV3_PGRAPH_INSTANCE, "PGRAPH Object Instance", NULL, NULL}, { NV3_PGRAPH_TRAPPED_INSTANCE, "PGRAPH Trapped Object Instance", NULL, NULL }, { NV3_PGRAPH_DMA_INTR_0, "PGRAPH DMA Interrupt Status (unimplemented)", NULL, NULL }, { NV3_PGRAPH_DMA_INTR_EN_0, "PGRAPH DMA Interrupt Enable (unimplemented)", NULL, NULL }, diff --git a/src/video/nv/nv3/subsystems/nv3_pramdac.c b/src/video/nv/nv3/subsystems/nv3_pramdac.c index f9f8b670c..b24d3d201 100644 --- a/src/video/nv/nv3/subsystems/nv3_pramdac.c +++ b/src/video/nv/nv3/subsystems/nv3_pramdac.c @@ -418,14 +418,13 @@ void nv3_pramdac_write(uint32_t address, uint32_t value) nv3->pramdac.user_read_mode_address = value; break; case NV3_USER_DAC_WRITE_MODE_ADDRESS: - /* This seems to get reset to 0 after 256 writes, but, the palette is 768 bytes in size. Clearly there's some mechanism here, but I'm not sure what it is. So let's just reset if we reach 768. */ if (nv3->pramdac.user_write_mode_address >= NV3_USER_DAC_PALETTE_SIZE) nv3->pramdac.user_write_mode_address = value; - + break; case NV3_USER_DAC_PALETTE_DATA: /* I doubt NV actually read this in their drivers, but it's worth doing anyway */