From 6ebcbdb0026466120d29c2a90fd38f5cc454c7e9 Mon Sep 17 00:00:00 2001 From: starfrost013 Date: Tue, 29 Apr 2025 21:11:32 +0100 Subject: [PATCH] minor cleanups --- src/video/nv/nv3/render/nv3_render_core.c | 14 ++++++++++++-- src/video/nv/nv3/subsystems/nv3_pramin.c | 8 ++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/video/nv/nv3/render/nv3_render_core.c b/src/video/nv/nv3/render/nv3_render_core.c index 6a1823883..42392a9ce 100644 --- a/src/video/nv/nv3/render/nv3_render_core.c +++ b/src/video/nv/nv3/render/nv3_render_core.c @@ -301,8 +301,6 @@ nv3_coord_16_t nv3_render_get_dfb_position(uint32_t vram_address) else if (nv3->nvbase.svga.bpp == 32) pitch <<= 2; - //vram_address -= nv3->pgraph.boffset[0]; - pos.y = (vram_address / pitch); pos.x = (vram_address % pitch); @@ -529,6 +527,10 @@ void nv3_render_ensure_screen_size(void) /* Blit to the monitor from DFB, 8bpp */ void nv3_render_current_bpp_dfb_8(uint32_t address) { + /* Broken as fuck early vbios does this. Wtf? */ + if (!nv3->nvbase.svga.hdisp) + return; + nv3_coord_16_t size = {0}; size.x = size.y = 1; @@ -543,6 +545,10 @@ void nv3_render_current_bpp_dfb_8(uint32_t address) /* Blit to the monitor from DFB, 15/16bpp */ void nv3_render_current_bpp_dfb_16(uint32_t address) { + /* Broken as fuck early vbios does this. Wtf? */ + if (!nv3->nvbase.svga.hdisp) + return; + nv3_coord_16_t size = {0}; size.x = size.y = 1; @@ -564,6 +570,10 @@ void nv3_render_current_bpp_dfb_16(uint32_t address) /* Blit to the monitor from DFB, 32bpp */ void nv3_render_current_bpp_dfb_32(uint32_t address) { + /* Broken as fuck early vbios does this. Wtf? */ + if (!nv3->nvbase.svga.hdisp) + return; + nv3_coord_16_t size = {0}; size.x = size.y = 1; diff --git a/src/video/nv/nv3/subsystems/nv3_pramin.c b/src/video/nv/nv3/subsystems/nv3_pramin.c index 8556822f5..4cd6d10c3 100644 --- a/src/video/nv/nv3/subsystems/nv3_pramin.c +++ b/src/video/nv/nv3/subsystems/nv3_pramin.c @@ -96,14 +96,14 @@ uint16_t nv3_ramin_read16(uint32_t addr, void* priv) // Read 32-bit ramin uint32_t nv3_ramin_read32(uint32_t addr, void* priv) { - if (!nv3) return 0x00; + if (!nv3) + return 0x00; addr &= (nv3->nvbase.svga.vram_max - 1); // why does this not work in one line - svga_t* svga = &nv3->nvbase.svga; - uint32_t* vram_32bit = (uint32_t*)svga->vram; - uint32_t raw_addr = addr; // saved after and + uint32_t* vram_32bit = (uint32_t*)nv3->nvbase.svga.vram; + uint32_t raw_addr = addr; // saved after and logged addr ^= (nv3->nvbase.svga.vram_max - 0x10); addr >>= 2; // what