@@ -722,7 +722,31 @@ mystique_out(uint16_t addr, uint8_t val, void *priv)
722
722
if (mystique -> crtcext_idx < 6 )
723
723
mystique -> crtcext_regs [mystique -> crtcext_idx ] = val ;
724
724
725
- if (mystique -> crtcext_idx == 4 ) {
725
+ if ((mystique -> type >= MGA_1064SG ) && (mystique -> crtcext_idx == 0 ) &&
726
+ (mystique -> crtcext_regs [3 ] & CRTCX_R3_MGAMODE )) {
727
+ svga -> rowoffset = svga -> crtc [0x13 ] |
728
+ ((mystique -> crtcext_regs [0 ] & CRTCX_R0_OFFSET_MASK ) << 4 );
729
+ svga -> rowoffset <<= 1 ;
730
+ svga -> ma_latch = ((mystique -> crtcext_regs [0 ] & CRTCX_R0_STARTADD_MASK ) << 16 ) |
731
+ (svga -> crtc [0xc ] << 8 ) | svga -> crtc [0xd ];
732
+ if (mystique -> pci_regs [0x41 ] & (OPTION_INTERLEAVE >> 8 )) {
733
+ svga -> rowoffset <<= 1 ;
734
+ svga -> ma_latch <<= 1 ;
735
+ }
736
+
737
+ svga -> ma_latch <<= 1 ;
738
+ if (svga -> ma_latch != mystique -> ma_latch_old ) {
739
+ if (svga -> interlace && svga -> oddeven )
740
+ svga -> maback = (svga -> maback - (mystique -> ma_latch_old << 2 )) +
741
+ (svga -> ma_latch << 2 ) + (svga -> rowoffset << 1 );
742
+ else
743
+ svga -> maback = (svga -> maback - (mystique -> ma_latch_old << 2 )) +
744
+ (svga -> ma_latch << 2 );
745
+ mystique -> ma_latch_old = svga -> ma_latch ;
746
+ }
747
+ }
748
+
749
+ if (mystique -> crtcext_idx == 4 ) {
726
750
if (svga -> gdcreg [6 ] & 0xc ) {
727
751
/*64k banks*/
728
752
svga -> read_bank = (val & 0x7f ) << 16 ;
@@ -817,21 +841,6 @@ mystique_vblank_start(svga_t *svga)
817
841
svga -> ma_latch = ((mystique -> crtcext_regs [0 ] & CRTCX_R0_STARTADD_MASK ) << 16 ) | (svga -> crtc [0xc ] << 8 ) | svga -> crtc [0xd ];
818
842
if (mystique -> pci_regs [0x41 ] & (OPTION_INTERLEAVE >> 8 ))
819
843
svga -> ma_latch <<= 1 ;
820
-
821
- if (mystique -> type >= MGA_1064SG ) {
822
- /*Mystique, unlike most SVGA cards, allows display start to take
823
- effect mid-screen*/
824
- svga -> ma_latch <<= 1 ;
825
- /* Only change maback so the new display start will take effect on the next
826
- horizontal retrace. */
827
- if (svga -> ma_latch != mystique -> ma_latch_old ) {
828
- if (svga -> interlace && svga -> oddeven )
829
- svga -> maback = (svga -> maback - (mystique -> ma_latch_old << 2 )) + (svga -> ma_latch << 2 ) + (svga -> rowoffset << 1 );
830
- else
831
- svga -> maback = (svga -> maback - (mystique -> ma_latch_old << 2 )) + (svga -> ma_latch << 2 );
832
- mystique -> ma_latch_old = svga -> ma_latch ;
833
- }
834
- }
835
844
}
836
845
}
837
846
@@ -906,10 +915,28 @@ mystique_recalctimings(svga_t *svga)
906
915
svga -> hdisp_time = svga -> hdisp ;
907
916
svga -> rowoffset = svga -> crtc [0x13 ] | ((mystique -> crtcext_regs [0 ] & CRTCX_R0_OFFSET_MASK ) << 4 );
908
917
909
- if (mystique -> pci_regs [0x41 ] & (OPTION_INTERLEAVE >> 8 ))
918
+ if (mystique -> pci_regs [0x41 ] & (OPTION_INTERLEAVE >> 8 )) {
910
919
svga -> rowoffset <<= 1 ;
920
+ if (mystique -> type >= MGA_1064SG )
921
+ svga -> ma_latch <<= 1 ;
922
+ }
911
923
912
924
if (mystique -> type >= MGA_1064SG ) {
925
+ /*Mystique, unlike most SVGA cards, allows display start to take
926
+ effect mid-screen*/
927
+ svga -> ma_latch <<= 1 ;
928
+ /* Only change maback so the new display start will take effect on the next
929
+ horizontal retrace. */
930
+ if (svga -> ma_latch != mystique -> ma_latch_old ) {
931
+ if (svga -> interlace && svga -> oddeven )
932
+ svga -> maback = (svga -> maback - (mystique -> ma_latch_old << 2 )) +
933
+ (svga -> ma_latch << 2 ) + (svga -> rowoffset << 1 );
934
+ else
935
+ svga -> maback = (svga -> maback - (mystique -> ma_latch_old << 2 )) +
936
+ (svga -> ma_latch << 2 );
937
+ mystique -> ma_latch_old = svga -> ma_latch ;
938
+ }
939
+
913
940
svga -> rowoffset <<= 1 ;
914
941
switch (mystique -> xmulctrl & XMULCTRL_DEPTH_MASK ) {
915
942
case XMULCTRL_DEPTH_8 :
@@ -960,13 +987,15 @@ mystique_recalctimings(svga_t *svga)
960
987
}
961
988
svga -> packed_chain4 = 1 ;
962
989
svga -> line_compare = mystique_line_compare ;
963
- svga -> vblank_start = mystique_vblank_start ;
990
+ if (mystique -> type < MGA_1064SG )
991
+ svga -> vblank_start = mystique_vblank_start ;
964
992
} else {
965
993
svga -> packed_chain4 = 0 ;
966
994
svga -> line_compare = NULL ;
967
- svga -> vblank_start = NULL ;
968
995
if (mystique -> type >= MGA_1064SG )
969
996
svga -> bpp = 8 ;
997
+ else
998
+ svga -> vblank_start = NULL ;
970
999
}
971
1000
972
1001
svga -> fb_only = svga -> packed_chain4 ;
0 commit comments