Author: aandrejevic Date: Sun Nov 3 03:22:36 2013 New Revision: 60842
URL: http://svn.reactos.org/svn/reactos?rev=60842&view=rev Log: [NTVDM] Halfplement the BIOS palette control command (INT 10h, AH = 10h).
Modified: branches/ntvdm/subsystems/ntvdm/bios.c
Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?re... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sun Nov 3 03:22:36 2013 @@ -914,6 +914,134 @@ break; }
+ /* Palette Control */ + case 0x10: + { + switch (getAL()) + { + /* Set Single Palette Register */ + case 0x00: + { + /* Reset the flip-flop */ + VgaReadPort(VGA_STAT_COLOR); + + /* Write the index */ + VgaWritePort(VGA_AC_INDEX, getBL()); + + /* Write the data */ + VgaWritePort(VGA_AC_WRITE, getBH()); + + break; + } + + /* Set Overscan Color */ + case 0x01: + { + /* Reset the flip-flop */ + VgaReadPort(VGA_STAT_COLOR); + + /* Write the index */ + VgaWritePort(VGA_AC_INDEX, VGA_AC_OVERSCAN_REG); + + /* Write the data */ + VgaWritePort(VGA_AC_WRITE, getBH()); + + break; + } + + /* Set All Palette Registers */ + case 0x02: + { + INT i; + LPBYTE Buffer = SEG_OFF_TO_PTR(getES(), getDX()); + + /* Set the palette registers */ + for (i = 0; i <= VGA_AC_PAL_F_REG; i++) + { + /* Reset the flip-flop */ + VgaReadPort(VGA_STAT_COLOR); + + /* Write the index */ + VgaWritePort(VGA_AC_INDEX, i); + + /* Write the data */ + VgaWritePort(VGA_AC_WRITE, Buffer[i]); + } + + /* Set the overscan register */ + VgaWritePort(VGA_AC_INDEX, VGA_AC_OVERSCAN_REG); + VgaWritePort(VGA_AC_WRITE, Buffer[VGA_AC_PAL_F_REG + 1]); + + break; + } + + /* Get Single Palette Register */ + case 0x07: + { + /* Reset the flip-flop */ + VgaReadPort(VGA_STAT_COLOR); + + /* Write the index */ + VgaWritePort(VGA_AC_INDEX, getBL()); + + /* Read the data */ + setBH(VgaReadPort(VGA_AC_READ)); + + break; + } + + /* Get Overscan Color */ + case 0x08: + { + /* Reset the flip-flop */ + VgaReadPort(VGA_STAT_COLOR); + + /* Write the index */ + VgaWritePort(VGA_AC_INDEX, VGA_AC_OVERSCAN_REG); + + /* Read the data */ + setBH(VgaReadPort(VGA_AC_READ)); + + break; + } + + /* Get All Palette Registers */ + case 0x09: + { + INT i; + LPBYTE Buffer = SEG_OFF_TO_PTR(getES(), getDX()); + + /* Get the palette registers */ + for (i = 0; i <= VGA_AC_PAL_F_REG; i++) + { + /* Reset the flip-flop */ + VgaReadPort(VGA_STAT_COLOR); + + /* Write the index */ + VgaWritePort(VGA_AC_INDEX, i); + + /* Read the data */ + Buffer[i] = VgaReadPort(VGA_AC_READ); + } + + /* Get the overscan register */ + VgaWritePort(VGA_AC_INDEX, VGA_AC_OVERSCAN_REG); + Buffer[VGA_AC_PAL_F_REG + 1] = VgaReadPort(VGA_AC_READ); + + break; + } + + default: + { + DPRINT1("BIOS Palette Control Sub-command AL = 0x%02X NOT IMPLEMENTED\n", + getAL()); + break; + } + } + + break; + } + /* Scroll Window */ case 0x12: {