~i30817/dosbox/trunk

« back to all changes in this revision

Viewing changes to src/hardware/vga_draw.cpp

  • Committer: qbix79
  • Date: 2019-12-10 08:25:18 UTC
  • Revision ID: svn-v4:ed541006-0bf7-43e9-8c4d-6fc63c346d47:dosbox/trunk:4298
Set cursor speed to the vga standard of 32 frames for a full period. Hope that this is correct for the other machines as well. Fix that frameskip would slow down the cursor blinking speed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
395
395
                *draw++=(fg&mask1) | (bg&~mask1);
396
396
                *draw++=(fg&mask2) | (bg&~mask2);
397
397
        }
398
 
        if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x8)) goto skip_cursor;
 
398
        if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x10)) goto skip_cursor;
399
399
        font_addr = (vga.draw.cursor.address-vidstart) >> 1;
400
400
        if (font_addr>=0 && font_addr<(Bits)vga.draw.blocks) {
401
401
                if (line<vga.draw.cursor.sline) goto skip_cursor;
444
444
                        *draw++=(fg&mask2) | (bg&~mask2);
445
445
                }
446
446
        }
447
 
        if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x8)) goto skip_cursor;
 
447
        if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x10)) goto skip_cursor;
448
448
        font_addr = (vga.draw.cursor.address-vidstart) >> 1;
449
449
        if (font_addr>=0 && font_addr<(Bits)vga.draw.blocks) {
450
450
                if (line<vga.draw.cursor.sline) goto skip_cursor;
506
506
                }
507
507
        }
508
508
        // draw the text mode cursor if needed
509
 
        if ((vga.draw.cursor.count&0x8) && (line >= vga.draw.cursor.sline) &&
 
509
        if ((vga.draw.cursor.count&0x10) && (line >= vga.draw.cursor.sline) &&
510
510
                (line <= vga.draw.cursor.eline) && vga.draw.cursor.enabled) {
511
511
                // the adress of the attribute that makes up the cell the cursor is in
512
512
                Bits attr_addr = (vga.draw.cursor.address-vidstart) >> 1;
564
564
                }
565
565
        }
566
566
        // draw the text mode cursor if needed
567
 
        if ((vga.draw.cursor.count&0x8) && (line >= vga.draw.cursor.sline) &&
 
567
        if ((vga.draw.cursor.count&0x10) && (line >= vga.draw.cursor.sline) &&
568
568
                (line <= vga.draw.cursor.eline) && vga.draw.cursor.enabled) {
569
569
                // the adress of the attribute that makes up the cell the cursor is in
570
570
                Bits attr_addr = (vga.draw.cursor.address-vidstart) >> 1;
834
834
                E_Exit("This new machine needs implementation in VGA_VerticalTimer too.");
835
835
                break;
836
836
        }
 
837
 
837
838
        //Check if we can actually render, else skip the rest (frameskip)
 
839
        vga.draw.cursor.count++; // Do this here, else the cursor speed depends on the frameskip
838
840
        if (vga.draw.vga_override || !RENDER_StartUpdate())
839
841
                return;
840
842
 
902
904
                else vga.draw.linear_mask = 0x3fff; // CGA, Tandy 4 pages
903
905
                vga.draw.cursor.address=vga.config.cursor_start*2;
904
906
                vga.draw.address *= 2;
905
 
                vga.draw.cursor.count++;
 
907
                //vga.draw.cursor.count++; //Moved before the frameskip test.
906
908
                /* check for blinking and blinking change delay */
907
909
                FontMask[1]=(vga.draw.blinking & (vga.draw.cursor.count >> 4)) ?
908
910
                        0 : 0xffffffff;