Author: aandrejevic
Date: Sat Aug 10 17:06:04 2013
New Revision: 59687
URL:
http://svn.reactos.org/svn/reactos?rev=59687&view=rev
Log:
Synchronize with trunk to fix spec2def issue.
[NTVDM]
Implement write modes and latch register for VGA.
Modified:
branches/ntvdm/ (props changed)
branches/ntvdm/dll/win32/samsrv/samsrv.h
branches/ntvdm/dll/win32/samsrv/setup.c
branches/ntvdm/drivers/hid/hidparse/ (props changed)
branches/ntvdm/drivers/hid/hidusb/ (props changed)
branches/ntvdm/drivers/usb/usbehci/ (props changed)
branches/ntvdm/drivers/usb/usbhub/ (props changed)
branches/ntvdm/drivers/usb/usbohci/ (props changed)
branches/ntvdm/lib/drivers/libusb/common_interfaces.h (props changed)
branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp (props changed)
branches/ntvdm/lib/drivers/libusb/hub_controller.cpp (props changed)
branches/ntvdm/lib/drivers/libusb/libusb.cpp (props changed)
branches/ntvdm/lib/drivers/libusb/libusb.h (props changed)
branches/ntvdm/lib/drivers/libusb/memory_manager.cpp (props changed)
branches/ntvdm/lib/drivers/libusb/misc.cpp (props changed)
branches/ntvdm/lib/drivers/libusb/purecall.cpp (props changed)
branches/ntvdm/lib/drivers/libusb/usb_device.cpp (props changed)
branches/ntvdm/subsystems/ntvdm/CMakeLists.txt
branches/ntvdm/subsystems/ntvdm/vga.c
branches/ntvdm/tools/spec2def/spec2def.c
Propchange: branches/ntvdm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -15,4 +15,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:59241-59683
+/trunk/reactos:59241-59686
Modified: branches/ntvdm/dll/win32/samsrv/samsrv.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/samsrv.h…
==============================================================================
--- branches/ntvdm/dll/win32/samsrv/samsrv.h [iso-8859-1] (original)
+++ branches/ntvdm/dll/win32/samsrv/samsrv.h [iso-8859-1] Sat Aug 10 17:06:04 2013
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <limits.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
Modified: branches/ntvdm/dll/win32/samsrv/setup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/setup.c?…
==============================================================================
--- branches/ntvdm/dll/win32/samsrv/setup.c [iso-8859-1] (original)
+++ branches/ntvdm/dll/win32/samsrv/setup.c [iso-8859-1] Sat Aug 10 17:06:04 2013
@@ -577,7 +577,7 @@
FixedData.DomainModifiedCount.QuadPart = 0;
FixedData.MaxPasswordAge.QuadPart = -(6LL * 7LL * 24LL * 60LL * 60LL *
TICKS_PER_SECOND); /* 6 weeks */
FixedData.MinPasswordAge.QuadPart = 0;
/* right now */
-// FixedData.ForceLogoff.QuadPart = // very far in the future aka never
+ FixedData.ForceLogoff.QuadPart = LLONG_MAX;
/* very far in the future aka never */
FixedData.LockoutDuration.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND);
/* 30 minutes */
FixedData.LockoutObservationWindow.QuadPart = -(30LL * 60LL * TICKS_PER_SECOND);
/* 30 minutes */
FixedData.ModifiedCountAtLastPromotion.QuadPart = 0;
Propchange: branches/ntvdm/drivers/hid/hidparse/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -18,5 +18,5 @@
/branches/usb-bringup/drivers/hid/hidparse:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk/drivers/hid/hidparse:55020-55543,55548-55554
/branches/wlan-bringup/drivers/hid/hidparse:54809-54998
-/trunk/reactos/drivers/hid/hidparse:59241-59683
+/trunk/reactos/drivers/hid/hidparse:59241-59686
/trunk/reactos/drivers/usb/hidparse:48236-51323
Propchange: branches/ntvdm/drivers/hid/hidusb/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -18,5 +18,5 @@
/branches/usb-bringup/drivers/hid/hidusb:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk/drivers/hid/hidusb:55020-55543,55548-55554
/branches/wlan-bringup/drivers/hid/hidusb:54809-54998
-/trunk/reactos/drivers/hid/hidusb:59241-59683
+/trunk/reactos/drivers/hid/hidusb:59241-59686
/trunk/reactos/drivers/usb/hidusb:48236-51323
Propchange: branches/ntvdm/drivers/usb/usbehci/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new:54809-54998
-/trunk/reactos/drivers/usb/usbehci:59241-59683
+/trunk/reactos/drivers/usb/usbehci:59241-59686
Propchange: branches/ntvdm/drivers/usb/usbhub/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbhub:55524-55543,55548-55554
/branches/wlan-bringup/drivers/usb/usbhub:54809-54998
/branches/wlan-bringup/drivers/usb/usbhub_new:54809-54998
-/trunk/reactos/drivers/usb/usbhub:59241-59683
+/trunk/reactos/drivers/usb/usbhub:59241-59686
Propchange: branches/ntvdm/drivers/usb/usbohci/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -19,4 +19,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbohci:55019-55543,55548-55554
/branches/wlan-bringup/drivers/usb/usbohci:54809-54998
/trunk/reactos/drivers/usb/usbehci_new:48236-51323
-/trunk/reactos/drivers/usb/usbohci:59241-59683
+/trunk/reactos/drivers/usb/usbohci:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/common_interfaces.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/interfaces.h:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/interfaces.h:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/interfaces.h:54809-54998
-/trunk/reactos/lib/drivers/libusb/common_interfaces.h:59241-59683
+/trunk/reactos/lib/drivers/libusb/common_interfaces.h:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/hcd_controller.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/hcd_controller.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/hcd_controller.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/hcd_controller.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/hcd_controller.cpp:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/hub_controller.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/hub_controller.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/hub_controller.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/hub_controller.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/hub_controller.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/hub_controller.cpp:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/libusb.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/usbehci.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/usbehci.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/libusb.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/libusb.cpp:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/libusb.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/usbehci.h:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/usbehci.h:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/usbehci.h:54809-54998
-/trunk/reactos/lib/drivers/libusb/libusb.h:59241-59683
+/trunk/reactos/lib/drivers/libusb/libusb.h:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/memory_manager.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/memory_manager.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/memory_manager.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/memory_manager.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/memory_manager.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/memory_manager.cpp:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/misc.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/misc.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/misc.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/misc.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/misc.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/misc.cpp:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/purecall.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/purecall.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/purecall.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/purecall.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/purecall.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/purecall.cpp:59241-59686
Propchange: branches/ntvdm/lib/drivers/libusb/usb_device.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 10 17:06:04 2013
@@ -27,4 +27,4 @@
/branches/usb-bringup-trunk/drivers/usb/usbehci/usb_device.cpp:55524-55543,55548-55554,55556-55567
/branches/wlan-bringup/drivers/usb/usbehci/usb_device.cpp:54809-54998
/branches/wlan-bringup/drivers/usb/usbehci_new/usb_device.cpp:54809-54998
-/trunk/reactos/lib/drivers/libusb/usb_device.cpp:59241-59683
+/trunk/reactos/lib/drivers/libusb/usb_device.cpp:59241-59686
Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/CMakeLis…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Sat Aug 10 17:06:04 2013
@@ -13,8 +13,8 @@
ps2.c
vga.c
ntvdm.c
- ntvdm.rc)
-# ${CMAKE_CURRENT_BINARY_DIR}/ntvdm.def
+ ntvdm.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/ntvdm.def)
add_executable(ntvdm ${SOURCE})
set_module_type(ntvdm win32cui UNICODE)
Modified: branches/ntvdm/subsystems/ntvdm/vga.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Sat Aug 10 17:06:04 2013
@@ -19,6 +19,7 @@
static CONST DWORD MemoryLimit[] = { 0xAFFFF, 0xAFFFF, 0xB7FFF, 0xBFFFF };
static BYTE VgaMemory[VGA_NUM_BANKS * VGA_BANK_SIZE];
+static BYTE VgaLatchRegisters[VGA_NUM_BANKS] = {0, 0, 0, 0};
static BYTE VgaMiscRegister;
static BYTE VgaSeqIndex = VGA_SEQ_RESET_REG;
static BYTE VgaSeqRegisters[VGA_SEQ_MAX_REG];
@@ -117,6 +118,66 @@
return Offset;
}
+static inline BYTE VgaTranslateByteForWriting(BYTE Data, BYTE Plane)
+{
+ BYTE WriteMode = VgaGcRegisters[VGA_GC_MODE_REG] & 3;
+ BYTE LogicalOperation = (VgaGcRegisters[VGA_GC_ROTATE_REG] >> 3) & 3;
+ BYTE RotateCount = VgaGcRegisters[VGA_GC_ROTATE_REG] & 7;
+ BYTE BitMask = VgaGcRegisters[VGA_GC_BITMASK_REG];
+
+ if (WriteMode == 1)
+ {
+ /* In write mode 1 just return the latch register */
+ return VgaLatchRegisters[Plane];
+ }
+
+ if (WriteMode != 2)
+ {
+ /* Write modes 0 and 3 rotate the data to the right first */
+ Data = LOBYTE(((DWORD)Data >> RotateCount) | ((DWORD)Data << (8 -
RotateCount)));
+ }
+ else
+ {
+ /* Write mode 2 expands the appropriate bit to all 8 bits */
+ Data = (Data & (1 << Plane)) ? 0xFF : 0x00;
+ }
+
+ if (WriteMode == 0)
+ {
+ /*
+ * In write mode 0, the enable set/reset register decides if the
+ * set/reset bit should be expanded to all 8 bits.
+ */
+ if (VgaGcRegisters[VGA_GC_ENABLE_RESET_REG] & (1 << Plane))
+ {
+ /* Copy the bit from the set/reset register to all 8 bits */
+ Data = (VgaGcRegisters[VGA_GC_RESET_REG] & (1 << Plane)) ? 0xFF :
0x00;
+ }
+ }
+
+ if (WriteMode != 3)
+ {
+ /* Write modes 0 and 2 then perform a logical operation on the data and latch */
+ if (LogicalOperation == 1) Data &= VgaLatchRegisters[Plane];
+ else if (LogicalOperation == 2) Data |= VgaLatchRegisters[Plane];
+ else if (LogicalOperation == 3) Data ^= VgaLatchRegisters[Plane];
+ }
+ else
+ {
+ /* For write mode 3, we AND the bitmask with the data, which is used as the new
bitmask */
+ BitMask &= Data;
+
+ /* Then we expand the bit in the set/reset field */
+ Data = (VgaGcRegisters[VGA_GC_RESET_REG] & (1 << Plane)) ? 0xFF :
0x00;
+ }
+
+ /* Bits cleared in the bitmask are replaced with latch register bits */
+ Data = (Data & BitMask) | (VgaLatchRegisters[Plane] & (~BitMask));
+
+ /* Return the byte */
+ return Data;
+}
+
static inline VOID VgaMarkForUpdate(SHORT Row, SHORT Column)
{
DPRINT("VgaMarkForUpdate: Row %d, Column %d\n", Row, Column);
@@ -694,6 +755,12 @@
{
VideoAddress = VgaTranslateReadAddress(Address + i);
+ /* Load the latch registers */
+ VgaLatchRegisters[0] = VgaMemory[LOWORD(VideoAddress)];
+ VgaLatchRegisters[1] = VgaMemory[VGA_BANK_SIZE + LOWORD(VideoAddress)];
+ VgaLatchRegisters[2] = VgaMemory[(2 * VGA_BANK_SIZE) + LOWORD(VideoAddress)];
+ VgaLatchRegisters[3] = VgaMemory[(3 * VGA_BANK_SIZE) + LOWORD(VideoAddress)];
+
/* Copy the value to the buffer */
Buffer[i] = VgaMemory[VideoAddress];
}
@@ -745,7 +812,7 @@
}
/* Copy the value to the VGA memory */
- VgaMemory[VideoAddress + j * VGA_BANK_SIZE] = Buffer[i];
+ VgaMemory[VideoAddress + j * VGA_BANK_SIZE] =
VgaTranslateByteForWriting(Buffer[i], j);
}
}
}
Modified: branches/ntvdm/tools/spec2def/spec2def.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/tools/spec2def/spec2def.c…
==============================================================================
--- branches/ntvdm/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ branches/ntvdm/tools/spec2def/spec2def.c [iso-8859-1] Sat Aug 10 17:06:04 2013
@@ -306,7 +306,7 @@
{
fprintf(file,
"; File generated automatically, do not edit!\n\n"
- "LIBRARY %s\n\n"
+ "NAME %s\n\n"
"EXPORTS\n",
libname);
}