Skip to content

Commit acdc2c7

Browse files
authored
Merge pull request 86Box#3943 from 86Box/tc1995
Restore correct CGA compatible mode behavior in (S)VGA.
2 parents 7678a86 + f0f5227 commit acdc2c7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/video/vid_svga.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ svga_recalctimings(svga_t *svga)
618618
svga->ma_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5);
619619
svga->ca_adj = 0;
620620

621-
svga->rowcount = svga->crtc[9] & 31;
621+
svga->rowcount = svga->crtc[9] & 0x1f;
622622

623623
svga->hdisp_time = svga->hdisp;
624624
svga->render = svga_render_blank;
@@ -639,27 +639,26 @@ svga_recalctimings(svga_t *svga)
639639
svga->hdisp *= (svga->seqregs[1] & 8) ? 16 : 8;
640640
svga->hdisp_old = svga->hdisp;
641641

642-
if ((svga->bpp <= 8) || ((svga->gdcreg[5] & 0x60) == 0x00)) {
642+
if ((svga->bpp <= 8) || ((svga->gdcreg[5] & 0x60) <= 0x20)) {
643643
if ((svga->gdcreg[5] & 0x60) == 0x00) {
644644
if (svga->seqregs[1] & 8) /*Low res (320)*/
645645
svga->render = svga_render_4bpp_lowres;
646646
else
647647
svga->render = svga_render_4bpp_highres;
648+
} else if ((svga->gdcreg[5] & 0x60) == 0x20) {
649+
if (svga->seqregs[1] & 8) /*Low res (320)*/
650+
svga->render = svga_render_2bpp_lowres;
651+
else
652+
svga->render = svga_render_2bpp_highres;
648653
} else {
649654
svga->map8 = svga->pallook;
650-
if (svga->attrregs[0x10] & 0x40) /*Low res (320)*/
655+
if (svga->lowres) /*Low res (320)*/
651656
svga->render = svga_render_8bpp_lowres;
652657
else
653658
svga->render = svga_render_8bpp_highres;
654659
}
655660
} else {
656661
switch (svga->gdcreg[5] & 0x60) {
657-
case 0x20: /*4 colours*/
658-
if (svga->seqregs[1] & 8) /*Low res (320)*/
659-
svga->render = svga_render_2bpp_lowres;
660-
else
661-
svga->render = svga_render_2bpp_highres;
662-
break;
663662
case 0x40:
664663
case 0x60: /*256+ colours*/
665664
switch (svga->bpp) {

0 commit comments

Comments
 (0)