From 8b6185eeb19021b37c70f8d6c9c4560d0c10d8f6 Mon Sep 17 00:00:00 2001 From: starfrost013 Date: Tue, 25 Mar 2025 20:38:57 +0000 Subject: [PATCH] make 15bpp actualyl 15bpp --- src/video/nv/nv3/classes/nv3_class_011_image.c | 1 + src/video/nv/nv3/nv3_core.c | 2 +- src/video/nv/nv3/render/nv3_render_blit.c | 1 + src/video/nv/nv3/render/nv3_render_core.c | 2 ++ src/video/nv/nv3/render/nv3_render_primitives.c | 12 +++++------- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/video/nv/nv3/classes/nv3_class_011_image.c b/src/video/nv/nv3/classes/nv3_class_011_image.c index 8dee40a21..b05013f5a 100644 --- a/src/video/nv/nv3/classes/nv3_class_011_image.c +++ b/src/video/nv/nv3/classes/nv3_class_011_image.c @@ -102,6 +102,7 @@ void nv3_class_011_method(uint32_t param, uint32_t method_id, nv3_ramin_context_ break; //2pixels packed into one param + case 15: case 16: pixel1 = (param) & 0xFFFF; nv3_render_write_pixel(nv3->pgraph.image_current_position, pixel1, grobj); diff --git a/src/video/nv/nv3/nv3_core.c b/src/video/nv/nv3/nv3_core.c index b1d96f8d9..5016329a9 100644 --- a/src/video/nv/nv3/nv3_core.c +++ b/src/video/nv/nv3/nv3_core.c @@ -519,7 +519,7 @@ void nv3_recalc_timings(svga_t* svga) } else { - svga->bpp = 16; // HACK: DO NOT change this + svga->bpp = 15; // HACK: DO NOT change this svga->lowres = 0; svga->render = svga_render_15bpp_highres; } diff --git a/src/video/nv/nv3/render/nv3_render_blit.c b/src/video/nv/nv3/render/nv3_render_blit.c index ce836520b..539871884 100644 --- a/src/video/nv/nv3/render/nv3_render_blit.c +++ b/src/video/nv/nv3/render/nv3_render_blit.c @@ -56,6 +56,7 @@ void nv3_render_blit_screen2screen(nv3_grobj_t grobj) } } break; + case 15: case 16: //16bpp for (int32_t y = nv3->pgraph.blit.point_out.y; y < end_y; y++) { diff --git a/src/video/nv/nv3/render/nv3_render_core.c b/src/video/nv/nv3/render/nv3_render_core.c index 7ef08e665..d1563cd76 100644 --- a/src/video/nv/nv3/render/nv3_render_core.c +++ b/src/video/nv/nv3/render/nv3_render_core.c @@ -227,6 +227,7 @@ uint32_t nv3_render_get_vram_address(nv3_position_16_t position, nv3_grobj_t gro { case 8: break; + case 15: case 16: vram_x = position.x << 1; break; @@ -375,6 +376,7 @@ void nv3_render_write_pixel(nv3_position_16_t position, uint32_t color, nv3_grob nv3->nvbase.svga.changedvram[pixel_addr_vram >> 12] = changeframecount; break; + case 15: case 16: uint16_t* vram_16 = (uint16_t*)(nv3->nvbase.svga.vram); pixel_addr_vram >>= 1; diff --git a/src/video/nv/nv3/render/nv3_render_primitives.c b/src/video/nv/nv3/render/nv3_render_primitives.c index 6190040a5..4695d05b7 100644 --- a/src/video/nv/nv3/render/nv3_render_primitives.c +++ b/src/video/nv/nv3/render/nv3_render_primitives.c @@ -65,6 +65,7 @@ void nv3_render_text_1bpp(bool bit, nv3_grobj_t grobj) case 8: final_color = (nv3->pgraph.win95_gdi_text.color1_d & 0xFF); /* do we need to add anything? mul blend perhaps? */ break; + case 15: case 16: final_color = (nv3->pgraph.win95_gdi_text.color1_d & 0xFFFF); /* do we need to add anything? mul blend perhaps? */ break; @@ -114,7 +115,7 @@ void nv3_render_gdi_type_d(nv3_grobj_t grobj, uint32_t param) } /* 2-colour 1bpp color-expanded text from [7-0] */ -void nv3_render_text_1bpp_2color(uint8_t byte, nv3_grobj_t grobj) +void nv3_render_text_1bpp_2color(uint32_t byte, nv3_grobj_t grobj) { for (int32_t bit_num = 0; bit_num <= 7; bit_num++) { @@ -123,10 +124,6 @@ void nv3_render_text_1bpp_2color(uint8_t byte, nv3_grobj_t grobj) uint16_t clip_x = nv3->pgraph.win95_gdi_text.point_e.x + nv3->pgraph.win95_gdi_text.size_out_e.w; uint16_t clip_y = nv3->pgraph.win95_gdi_text.point_e.y + nv3->pgraph.win95_gdi_text.size_out_e.h; - /* they send more data than they need */ - if (nv3->pgraph.win95_gdi_text_current_position.y >= clip_y) - bit = false; - // if it's a 0 bit we don't need to do anything uint32_t final_color; @@ -136,6 +133,7 @@ void nv3_render_text_1bpp_2color(uint8_t byte, nv3_grobj_t grobj) case 8: final_color = (bit) ? (nv3->pgraph.win95_gdi_text.color1_e & 0xFF) : (nv3->pgraph.win95_gdi_text.color0_e & 0xFF); /* do we need to add anything? mul blend perhaps? */ break; + case 15: case 16: final_color = (bit) ? (nv3->pgraph.win95_gdi_text.color1_e & 0xFFFF) : (nv3->pgraph.win95_gdi_text.color0_e & 0xFFFF); /* do we need to add anything? mul blend perhaps? */ break; @@ -143,7 +141,7 @@ void nv3_render_text_1bpp_2color(uint8_t byte, nv3_grobj_t grobj) final_color = (bit) ? nv3->pgraph.win95_gdi_text.color1_e : nv3->pgraph.win95_gdi_text.color0_e; /* do we need to add anything? mul blend perhaps? */ break; } - + nv3_render_write_pixel(nv3->pgraph.win95_gdi_text_current_position, final_color, grobj); /* increment the position - the bitmap is stored horizontally backward */ @@ -152,7 +150,7 @@ void nv3_render_text_1bpp_2color(uint8_t byte, nv3_grobj_t grobj) /* see if we need to go to the next line */ if (nv3->pgraph.win95_gdi_text_current_position.x < nv3->pgraph.win95_gdi_text.point_e.x) { - nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_e.x + (nv3->pgraph.win95_gdi_text.size_in_e.w - 1); + nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_e.x + (nv3->pgraph.win95_gdi_text.size_out_e.w - 1); nv3->pgraph.win95_gdi_text_current_position.y++; }