make 15bpp actualyl 15bpp

This commit is contained in:
starfrost013
2025-03-25 20:38:57 +00:00
parent 64f05c2526
commit 8b6185eeb1
5 changed files with 10 additions and 8 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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++)
{

View File

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

View File

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