When linear framebuffer base is mapped, it's fb_only time, fixes gibberish fonts and corrupt mouse cursor on BeOS releases using the S3 Trio/Virge cards.
Slight cleanup of the XGA card and fixed more possible cursor issues.
This commit is contained in:
@@ -3128,6 +3128,10 @@ static void s3_recalctimings(svga_t *svga)
|
||||
if (s3->width == 1280 || s3->width == 1600 || (s3->card_type == S3_SPEA_MERCURY_P64V ||
|
||||
s3->card_type == S3_NUMBER9_9FX_771))
|
||||
svga->hdisp <<= 1;
|
||||
if (s3->card_type == S3_NUMBER9_9FX_771) {
|
||||
if (svga->hdisp == 832)
|
||||
svga->hdisp -= 32;
|
||||
}
|
||||
if (s3->card_type == S3_MIROVIDEO40SV_ERGO_968 || s3->card_type == S3_MIROCRYSTAL20SV_964 ||
|
||||
s3->card_type == S3_MIROCRYSTAL20SD_864 || s3->card_type == S3_PHOENIX_VISION968 ||
|
||||
s3->card_type == S3_SPEA_MERCURY_P64V) {
|
||||
@@ -3378,12 +3382,9 @@ s3_updatemapping(s3_t *s3)
|
||||
|
||||
mem_mapping_set_addr(&s3->linear_mapping, s3->linear_base, s3->linear_size);
|
||||
}
|
||||
if (s3->chip >= S3_TRIO64V)
|
||||
svga->fb_only = 1;
|
||||
svga->fb_only = 1;
|
||||
} else {
|
||||
if (s3->chip >= S3_TRIO64V)
|
||||
svga->fb_only = 0;
|
||||
|
||||
svga->fb_only = 0;
|
||||
mem_mapping_disable(&s3->linear_mapping);
|
||||
}
|
||||
|
||||
|
||||
@@ -777,7 +777,6 @@ static void s3_virge_recalctimings(svga_t *svga)
|
||||
|
||||
if ((svga->crtc[0x67] & 0xc) != 0xc) /*VGA mode*/
|
||||
{
|
||||
svga->fb_only = 0;
|
||||
svga->ma_latch |= (virge->ma_ext << 16);
|
||||
if (svga->crtc[0x51] & 0x30) svga->rowoffset += (svga->crtc[0x51] & 0x30) << 4;
|
||||
else if (svga->crtc[0x43] & 0x04) svga->rowoffset += 0x100;
|
||||
@@ -820,8 +819,6 @@ static void s3_virge_recalctimings(svga_t *svga)
|
||||
}
|
||||
else /*Streams mode*/
|
||||
{
|
||||
svga->fb_only = 1;
|
||||
|
||||
if (virge->streams.buffer_ctrl & 1)
|
||||
svga->ma_latch = virge->streams.pri_fb1 >> 2;
|
||||
else
|
||||
|
||||
@@ -115,6 +115,9 @@ xga_recalctimings(svga_t *svga)
|
||||
xga->h_total = (xga->htotal + 1) << 3;
|
||||
|
||||
xga->rowoffset = (xga->hdisp + 1);
|
||||
if ((xga->disp_cntl_2 & 7) == 4) {
|
||||
xga->rowoffset = 0x80;
|
||||
}
|
||||
|
||||
xga->interlace = !!(xga->disp_cntl_1 & 0x08);
|
||||
xga->rowcount = (xga->disp_cntl_2 & 0xc0) >> 6;
|
||||
@@ -311,8 +314,10 @@ xga_ext_out_reg(xga_t *xga, svga_t *svga, uint8_t idx, uint8_t val)
|
||||
xga->cursor_data_on = 1;
|
||||
else if (xga->sprite_pos >= 1)
|
||||
xga->cursor_data_on = 1;
|
||||
else if (xga->aperture_cntl == 0)
|
||||
xga->cursor_data_on = 0;
|
||||
else if (xga->aperture_cntl == 0) {
|
||||
if (xga->linear_endian_reverse)
|
||||
xga->cursor_data_on = 0;
|
||||
}
|
||||
}
|
||||
if ((xga->sprite_pos > 16) && (xga->sprite_pos <= 0x1ff))
|
||||
xga->cursor_data_on = 0;
|
||||
@@ -803,7 +808,6 @@ xga_accel_read_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int
|
||||
byte2 = byte;
|
||||
return byte2;
|
||||
case 4: /*16-bit*/
|
||||
width >>= 1;
|
||||
addr += (y * (width) << 1);
|
||||
addr += (x << 1);
|
||||
if (!skip) {
|
||||
@@ -867,7 +871,6 @@ xga_accel_write_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, ui
|
||||
mem_writeb_phys(addr, pixel & 0xff);
|
||||
break;
|
||||
case 4: /*16-bit*/
|
||||
width >>= 1;
|
||||
addr += (y * (width) << 1);
|
||||
addr += (x << 1);
|
||||
if (!skip) {
|
||||
@@ -2151,7 +2154,7 @@ xga_render_16bpp(xga_t *xga, svga_t *svga)
|
||||
xga->lastline_draw = xga->displine;
|
||||
|
||||
for (x = 0; x <= (xga->h_disp); x += 8) {
|
||||
uint32_t dat = *(uint32_t *)(&xga->vram[(xga->ma + (x << 1)) & xga->vram_mask]);
|
||||
dat = *(uint32_t *)(&xga->vram[(xga->ma + (x << 1)) & xga->vram_mask]);
|
||||
p[x] = video_16to32[dat & 0xffff];
|
||||
p[x + 1] = video_16to32[dat >> 16];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user