diff --git a/dlls/winedos/int10.c b/dlls/winedos/int10.c index 4132f58235..fbe04eb4c8 100644 --- a/dlls/winedos/int10.c +++ b/dlls/winedos/int10.c @@ -1272,8 +1272,13 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) break; case 0x0c: /* WRITE GRAPHICS PIXEL */ - /* Not in graphics mode, can ignore w/o error */ - FIXME("Write Graphics Pixel - Not Supported\n"); + + /* Only supported in CGA mode for now */ + if(data->VideoMode >= 4 && data->VideoMode <= 6) + { + VGA_WritePixel(AL_reg(context), BH_reg(context), CX_reg(context), DX_reg(context)); + } + else FIXME("Write pixel not implemented for current mode\n"); break; case 0x0d: /* READ GRAPHICS PIXEL */ diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c index f25599418b..772038c24a 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -1083,6 +1083,37 @@ void VGA_SetPaletteIndex(unsigned index) vga_fb_palette_index = index; } +/********************************************************************** + * VGA_WritePixel + * + * Write data to the framebuffer + * This is a property of the CGA controller, but might be supported + * later by other framebuffer types + */ +void VGA_WritePixel(unsigned color, unsigned page, unsigned col, unsigned row) +{ + int off; + int bits; + int pos; + + /* Calculate CGA byte offset */ + char *data = vga_fb_window_data; + off = row & 1 ? (8 * 1024) : 0; + off += (80 * (row/2)); + off += col/4; + + /* Calculate bits offset */ + pos = 6 - (col%4 * 2); + + /* Clear current data */ + bits = 0x03 << pos; + data[off] &= ~bits; + + /* Set new data */ + bits = color << pos; + data[off] |= bits; +} + /*** TEXT MODE ***/ /* prepare the text mode video memory copy that is used to only diff --git a/dlls/winedos/vga.h b/dlls/winedos/vga.h index 60444a90af..10f5c49607 100644 --- a/dlls/winedos/vga.h +++ b/dlls/winedos/vga.h @@ -42,6 +42,7 @@ void VGA_ShowMouse(BOOL show); void VGA_UpdatePalette(void); void VGA_SetPaletteIndex(unsigned index); void VGA_SetBright(BOOL bright); +void VGA_WritePixel(unsigned color, unsigned page, unsigned col, unsigned row); /* text mode */ void VGA_InitAlphaMode(unsigned*Xres,unsigned*Yres);