From c614c13e0edcd9675b990505c03a19dc33743417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Sun, 23 Oct 2005 19:47:18 +0000 Subject: [PATCH] fix INT10_GetDACBlock; add gray scale summing (from VGABIOS) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2353 --- src/ints/int10.cpp | 21 +++++++++++++++------ src/ints/int10.h | 2 +- src/ints/int10_modes.cpp | 6 ++++++ src/ints/int10_pal.cpp | 17 ++++++++++++++++- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/ints/int10.cpp b/src/ints/int10.cpp index 90ff9fc8..6edfe462 100644 --- a/src/ints/int10.cpp +++ b/src/ints/int10.cpp @@ -176,6 +176,9 @@ static Bitu INT10_Handler(void) { case 0x1A: /* GET VIDEO DAC COLOR PAGE */ INT10_GetDACPage(®_bl,®_bh); break; + case 0x1B: /* PERFORM GRAY-SCALE SUMMING */ + INT10_PerformGrayScaleSumming(reg_bx,reg_cx); + break; default: LOG(LOG_INT10,LOG_ERROR)("Function 10:Unhandled EGA/VGA Palette Function %2X",reg_al); } @@ -274,12 +277,18 @@ graphics_chars: if (machinetype) { diff --git a/src/ints/int10_pal.cpp b/src/ints/int10_pal.cpp index 480d3d76..ed13342f 100644 --- a/src/ints/int10_pal.cpp +++ b/src/ints/int10_pal.cpp @@ -154,7 +154,7 @@ void INT10_SetDACBlock(Bit16u index,Bit16u count,PhysPt data) { } void INT10_GetDACBlock(Bit16u index,Bit16u count,PhysPt data) { - IO_Write(VGAREG_DAC_WRITE_ADDRESS,(Bit8u)index); + IO_Write(VGAREG_DAC_READ_ADDRESS,(Bit8u)index); for (;count>0;count--) { mem_writeb(data++,IO_Read(VGAREG_DAC_DATA)); mem_writeb(data++,IO_Read(VGAREG_DAC_DATA)); @@ -239,3 +239,18 @@ void INT10_SetColorSelect(Bit8u val) { INT10_SetSinglePaletteRegister( 3, val ); } } + +void INT10_PerformGrayScaleSumming(Bit16u start_reg,Bit16u count) { + if (count>0x100) count=0x100; + for (Bitu ct=0; ct> 8; + Bit8u ic=(i>0x3f) ? 0x3f : ((Bit8u)(i & 0xff)); + INT10_SetSingleDacRegister(start_reg+ct,ic,ic,ic); + } +}