Add patch 1340216 from vasyl. Speeds up the new and slower chain4 mode a bit.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2361
This commit is contained in:
parent
5783f7ff82
commit
48ca454da6
2 changed files with 21 additions and 14 deletions
|
@ -27,8 +27,10 @@
|
|||
#define VGA_PARTS 4
|
||||
|
||||
typedef Bit8u * (* VGA_Line_Handler)(Bitu vidstart,Bitu panning,Bitu line);
|
||||
typedef void (* VGA_FrameStart_Handler)();
|
||||
|
||||
static VGA_Line_Handler VGA_DrawLine;
|
||||
static VGA_FrameStart_Handler VGA_FrameStart;
|
||||
static Bit8u TempLine[1280];
|
||||
|
||||
static Bit8u * VGA_Draw_1BPP_Line(Bitu vidstart,Bitu panning,Bitu line) {
|
||||
|
@ -132,19 +134,14 @@ static Bit8u * VGA_Draw_VGA_Line(Bitu vidstart,Bitu panning,Bitu line) {
|
|||
}
|
||||
|
||||
static Bit8u * VGA_Draw_VGAChained_Line(Bitu vidstart,Bitu panning,Bitu line) {
|
||||
if(vga.config.compatible_chain4) {
|
||||
if(vga.crtc.underline_location & 0x40) {
|
||||
Bitu readindex = vidstart*4+panning;
|
||||
Bit32u* draw = (Bit32u*)TempLine;
|
||||
for(Bitu x=0;x<vga.draw.blocks*4;x++) {
|
||||
*draw = vga.mem.latched[readindex&0xfffc].d;
|
||||
draw ++;
|
||||
readindex += 4;
|
||||
}
|
||||
return TempLine;
|
||||
}
|
||||
}
|
||||
return &vga.mem.linear[vidstart*4+panning];
|
||||
return &vga.mem.linear[512*1024+((vidstart*4+panning)&0xffff)];
|
||||
}
|
||||
|
||||
static void VGA_StartFrame_VGA() {
|
||||
if(vga.config.compatible_chain4 && (vga.crtc.underline_location & 0x40))
|
||||
VGA_DrawLine=VGA_Draw_VGAChained_Line;
|
||||
else
|
||||
VGA_DrawLine = VGA_Draw_VGA_Line;
|
||||
}
|
||||
|
||||
static Bit8u * VGA_Draw_VGA_Line_HWMouse(Bitu vidstart, Bitu panning, Bitu line) {
|
||||
|
@ -286,6 +283,8 @@ void VGA_SetBlinking(Bitu enabled) {
|
|||
}
|
||||
|
||||
static void VGA_VerticalTimer(Bitu val) {
|
||||
if (VGA_FrameStart)
|
||||
VGA_FrameStart();
|
||||
vga.config.retrace=false;
|
||||
PIC_AddEvent(VGA_VerticalTimer,vga.draw.delay.vtotal);
|
||||
PIC_AddEvent(VGA_VerticalDisplayEnd,vga.draw.delay.vend);
|
||||
|
@ -450,11 +449,14 @@ void VGA_SetupDrawing(Bitu val) {
|
|||
Bitu height=vdispend;
|
||||
bool doubleheight=false;
|
||||
bool doublewidth=false;
|
||||
VGA_FrameStart = NULL;
|
||||
switch (vga.mode) {
|
||||
case M_VGA:
|
||||
doublewidth=true;
|
||||
width<<=2;
|
||||
VGA_DrawLine=VGA_Draw_VGAChained_Line;
|
||||
// Proper line handler is selected at the beginning of the frame
|
||||
// VGA_DrawLine=VGA_Draw_VGAChained_Line;
|
||||
VGA_FrameStart=VGA_StartFrame_VGA;
|
||||
break;
|
||||
case M_LIN8:
|
||||
width<<=3;
|
||||
|
|
|
@ -49,6 +49,11 @@ static Bitu VGA_Chain4ReadHandler(PhysPt start) {
|
|||
static void VGA_Chain4WriteHandler(PhysPt start, Bit8u val) {
|
||||
// No need to check for compatible chains here, this one is only enabled if that bit is set
|
||||
vga.mem.linear[((start&~3)<<2)|(start&3)] = val;
|
||||
// Linearized version for faster rendering
|
||||
vga.mem.linear[512*1024+start] = val;
|
||||
// And replicate the first line
|
||||
if (start < 320)
|
||||
vga.mem.linear[512*1024+start+64*1024] = val;
|
||||
}
|
||||
|
||||
//Nice one from DosEmu
|
||||
|
|
Loading…
Add table
Reference in a new issue