From e7df2b9b1991ada9e17ba18d1e5c018f4ef13bec Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 10 Dec 2019 08:25:18 +0000 Subject: [PATCH] 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. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4298 --- src/hardware/vga_draw.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hardware/vga_draw.cpp b/src/hardware/vga_draw.cpp index 80217750..168d9dc0 100644 --- a/src/hardware/vga_draw.cpp +++ b/src/hardware/vga_draw.cpp @@ -395,7 +395,7 @@ static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart, Bitu line) { *draw++=(fg&mask1) | (bg&~mask1); *draw++=(fg&mask2) | (bg&~mask2); } - if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x8)) goto skip_cursor; + if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x10)) goto skip_cursor; font_addr = (vga.draw.cursor.address-vidstart) >> 1; if (font_addr>=0 && font_addr<(Bits)vga.draw.blocks) { if (line> 1; if (font_addr>=0 && font_addr<(Bits)vga.draw.blocks) { if (line= vga.draw.cursor.sline) && + if ((vga.draw.cursor.count&0x10) && (line >= vga.draw.cursor.sline) && (line <= vga.draw.cursor.eline) && vga.draw.cursor.enabled) { // the adress of the attribute that makes up the cell the cursor is in Bits attr_addr = (vga.draw.cursor.address-vidstart) >> 1; @@ -564,7 +564,7 @@ static Bit8u* VGA_TEXT_Xlat16_Draw_Line(Bitu vidstart, Bitu line) { } } // draw the text mode cursor if needed - if ((vga.draw.cursor.count&0x8) && (line >= vga.draw.cursor.sline) && + if ((vga.draw.cursor.count&0x10) && (line >= vga.draw.cursor.sline) && (line <= vga.draw.cursor.eline) && vga.draw.cursor.enabled) { // the adress of the attribute that makes up the cell the cursor is in Bits attr_addr = (vga.draw.cursor.address-vidstart) >> 1; @@ -834,7 +834,9 @@ static void VGA_VerticalTimer(Bitu /*val*/) { E_Exit("This new machine needs implementation in VGA_VerticalTimer too."); break; } + //Check if we can actually render, else skip the rest (frameskip) + vga.draw.cursor.count++; // Do this here, else the cursor speed depends on the frameskip if (vga.draw.vga_override || !RENDER_StartUpdate()) return; @@ -902,7 +904,7 @@ static void VGA_VerticalTimer(Bitu /*val*/) { else vga.draw.linear_mask = 0x3fff; // CGA, Tandy 4 pages vga.draw.cursor.address=vga.config.cursor_start*2; vga.draw.address *= 2; - vga.draw.cursor.count++; + //vga.draw.cursor.count++; //Moved before the frameskip test. /* check for blinking and blinking change delay */ FontMask[1]=(vga.draw.blinking & (vga.draw.cursor.count >> 4)) ? 0 : 0xffffffff;