@@ -431,6 +431,9 @@ et4000w32p_recalctimings(svga_t *svga)
431
431
et4000w32p_t * et4000 = (et4000w32p_t * ) svga -> priv ;
432
432
433
433
svga -> ma_latch |= (svga -> crtc [0x33 ] & 0x7 ) << 16 ;
434
+
435
+ svga -> hblankstart = (((svga -> crtc [0x3f ] & 0x10 ) >> 4 ) << 8 ) + svga -> crtc [2 ] + 1 ;
436
+
434
437
if (svga -> crtc [0x35 ] & 0x01 )
435
438
svga -> vblankstart += 0x400 ;
436
439
if (svga -> crtc [0x35 ] & 0x02 )
@@ -445,10 +448,11 @@ et4000w32p_recalctimings(svga_t *svga)
445
448
svga -> rowoffset += 0x100 ;
446
449
if (svga -> crtc [0x3F ] & 0x01 )
447
450
svga -> htotal += 256 ;
448
- if (svga -> attrregs [0x16 ] & 0x20 )
451
+ if (svga -> attrregs [0x16 ] & 0x20 ) {
449
452
svga -> hdisp <<= 1 ;
450
-
451
- svga -> hblankstart = (((svga -> crtc [0x3f ] & 0x10 ) >> 4 ) << 8 ) + svga -> crtc [2 ] + 1 ;
453
+ svga -> hblankstart <<= 1 ;
454
+ svga -> hblank_end_val <<= 1 ;
455
+ }
452
456
453
457
svga -> clock = (cpuclock * (double ) (1ULL << 32 )) / svga -> getclock ((svga -> miscout >> 2 ) & 3 , svga -> clock_gen );
454
458
@@ -474,32 +478,6 @@ et4000w32p_recalctimings(svga_t *svga)
474
478
}
475
479
}
476
480
477
- #if 0
478
- if (svga -> adv_flags & FLAG_NOSKEW ) {
479
- /* On the Cardex ET4000/W32p-based cards, adjust text mode clocks by 1. */
480
- if (!(svga -> gdcreg [6 ] & 1 ) && !(svga -> attrregs [0x10 ] & 1 )) { /* Text mode */
481
- svga -> ma_latch -- ;
482
-
483
- if (svga -> seqregs [1 ] & 8 ) /*40 column*/
484
- svga -> hdisp += (svga -> seqregs [1 ] & 1 ) ? 16 : 18 ;
485
- else
486
- svga -> hdisp += (svga -> seqregs [1 ] & 1 ) ? 8 : 9 ;
487
- } else {
488
- /* Also adjust the graphics mode clocks in some cases. */
489
- if ((svga -> gdcreg [5 ] & 0x40 ) && (svga -> bpp != 32 )) {
490
- if ((svga -> bpp == 15 ) || (svga -> bpp == 16 ) || (svga -> bpp == 24 ))
491
- svga -> hdisp += (svga -> seqregs [1 ] & 1 ) ? 16 : 18 ;
492
- else
493
- svga -> hdisp += (svga -> seqregs [1 ] & 1 ) ? 8 : 9 ;
494
- } else if ((svga -> gdcreg [5 ] & 0x40 ) == 0 ) {
495
- svga -> hdisp += (svga -> seqregs [1 ] & 1 ) ? 8 : 9 ;
496
- if (svga -> hdisp == 648 || svga -> hdisp == 808 || svga -> hdisp == 1032 )
497
- svga -> hdisp -= 8 ;
498
- }
499
- }
500
- }
501
- #endif
502
-
503
481
if (et4000 -> type == ET4000W32 ) {
504
482
if ((svga -> gdcreg [6 ] & 1 ) || (svga -> attrregs [0x10 ] & 1 )) {
505
483
if (svga -> gdcreg [5 ] & 0x40 ) {
@@ -522,8 +500,11 @@ et4000w32p_recalctimings(svga_t *svga)
522
500
switch (svga -> bpp ) {
523
501
case 15 :
524
502
case 16 :
525
- if ((svga -> gdcreg [6 ] & 1 ) || (svga -> attrregs [0x10 ] & 1 ))
503
+ if ((svga -> gdcreg [6 ] & 1 ) || (svga -> attrregs [0x10 ] & 1 )) {
526
504
svga -> hdisp >>= 1 ;
505
+ svga -> hblankstart >>= 1 ;
506
+ svga -> hblank_end_val >>= 1 ;
507
+ }
527
508
if (et4000 -> type <= ET4000W32P_REVC ) {
528
509
if (et4000 -> type == ET4000W32P_REVC ) {
529
510
if (svga -> hdisp != 1024 )
@@ -534,6 +515,8 @@ et4000w32p_recalctimings(svga_t *svga)
534
515
break ;
535
516
case 24 :
536
517
svga -> hdisp /= 3 ;
518
+ svga -> hblankstart /= 3 ;
519
+ svga -> hblank_end_val /= 3 ;
537
520
if (et4000 -> type <= ET4000W32P_REVC )
538
521
et4000 -> adjust_cursor = 2 ;
539
522
if ((et4000 -> type == ET4000W32P_DIAMOND ) && ((svga -> hdisp == (640 / 2 )) || (svga -> hdisp == 1232 ))) {
@@ -553,10 +536,6 @@ et4000w32p_recalctimings(svga_t *svga)
553
536
else
554
537
svga -> render = svga_render_text_80 ;
555
538
} else {
556
- if (svga -> adv_flags & FLAG_NOSKEW ) {
557
- svga -> ma_latch -- ;
558
- }
559
-
560
539
switch (svga -> gdcreg [5 ] & 0x60 ) {
561
540
case 0x00 :
562
541
if (et4000 -> rev == 5 )
@@ -2809,7 +2788,6 @@ et4000w32p_init(const device_t *info)
2809
2788
et4000 -> svga .ramdac = device_add (& stg_ramdac_device );
2810
2789
et4000 -> svga .clock_gen = et4000 -> svga .ramdac ;
2811
2790
et4000 -> svga .getclock = stg_getclock ;
2812
- et4000 -> svga .adv_flags |= FLAG_NOSKEW ;
2813
2791
break ;
2814
2792
2815
2793
case ET4000W32P_REVC :
@@ -2834,7 +2812,6 @@ et4000w32p_init(const device_t *info)
2834
2812
et4000 -> svga .ramdac = device_add (& stg_ramdac_device );
2835
2813
et4000 -> svga .clock_gen = et4000 -> svga .ramdac ;
2836
2814
et4000 -> svga .getclock = stg_getclock ;
2837
- et4000 -> svga .adv_flags |= FLAG_NOSKEW ;
2838
2815
break ;
2839
2816
2840
2817
case ET4000W32P_CARDEX :
@@ -2847,7 +2824,6 @@ et4000w32p_init(const device_t *info)
2847
2824
et4000 -> svga .ramdac = device_add (& stg_ramdac_device );
2848
2825
et4000 -> svga .clock_gen = et4000 -> svga .ramdac ;
2849
2826
et4000 -> svga .getclock = stg_getclock ;
2850
- et4000 -> svga .adv_flags |= FLAG_NOSKEW ;
2851
2827
break ;
2852
2828
2853
2829
case ET4000W32P_DIAMOND :
0 commit comments