Implement registry stores.
[wine] / dlls / winedos / vga.c
index bf3580a..0883cf9 100644 (file)
@@ -28,7 +28,6 @@
 #include "wingdi.h"
 #include "winuser.h"
 #include "wincon.h"
-#include "miscemu.h"
 #include "dosexe.h"
 #include "vga.h"
 #include "ddraw.h"
@@ -289,7 +288,7 @@ static void CALLBACK set_timer_rate( ULONG_PTR arg )
 {
     LARGE_INTEGER when;
 
-    when.s.LowPart = when.s.HighPart = 0;
+    when.u.LowPart = when.u.HighPart = 0;
     SetWaitableTimer( VGA_timer, &when, arg, VGA_Poll, 0, FALSE );
 }
 
@@ -346,14 +345,14 @@ static BOOL VGA_IsTimerRunning(void)
     return VGA_timer_thread ? TRUE : FALSE;
 }
 
-HANDLE VGA_AlphaConsole(void)
+static HANDLE VGA_AlphaConsole(void)
 {
     /* this assumes that no Win32 redirection has taken place, but then again,
      * only 16-bit apps are likely to use this part of Wine... */
     return GetStdHandle(STD_OUTPUT_HANDLE);
 }
 
-char*VGA_AlphaBuffer(void)
+static char*VGA_AlphaBuffer(void)
 {
     return (char *)0xb8000;
 }
@@ -496,8 +495,7 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth)
       newSize = 256 * 1024;
 
     if(vga_fb_size < newSize) {
-      if(vga_fb_data)
-        HeapFree(GetProcessHeap(), 0, vga_fb_data);
+      HeapFree(GetProcessHeap(), 0, vga_fb_data);
       vga_fb_data = HeapAlloc(GetProcessHeap(), 0, newSize);
       vga_fb_size = newSize;
     }
@@ -528,7 +526,7 @@ int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth)
     return 0;
 }
 
-void VGA_Exit(void)
+static void VGA_Exit(void)
 {
     if (lpddraw) MZ_RunInThread(VGA_DoExit, 0);
 }
@@ -653,14 +651,46 @@ int VGA_GetWindowStart()
     return vga_fb_window;
 }
 
+
+/**********************************************************************
+ *         VGA_DoShowMouse
+ *
+ * Callback for VGA_ShowMouse.
+ */
+static WINAPI void VGA_DoShowMouse( ULONG_PTR show )
+{
+    INT rv;
+
+    do
+    {
+        rv = ShowCursor( show );
+    }
+    while( show ? (rv < 0) : (rv >= 0) );
+}
+
+
+/**********************************************************************
+ *         VGA_ShowMouse
+ *
+ * If argument is TRUE, unconditionally show mouse cursor.
+ * If argument is FALSE, unconditionally hide mouse cursor.
+ * This only works in graphics mode.
+ */
+void VGA_ShowMouse( BOOL show )
+{
+    if (lpddraw)
+        MZ_RunInThread( VGA_DoShowMouse, (ULONG_PTR)show );
+}
+
+
 /*** TEXT MODE ***/
 
 /* prepare the text mode video memory copy that is used to only
  * update the video memory line that did get updated. */
-void VGA_PrepareVideoMemCopy(unsigned Xres, unsigned Yres)
+static void VGA_PrepareVideoMemCopy(unsigned Xres, unsigned Yres)
 {
     char *p, *p2;
-    int i;
+    unsigned int i;
 
     /*
      * Allocate space for char + attr.
@@ -803,12 +833,17 @@ void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count)
 
 void VGA_PutChar(BYTE ascii)
 {
+    DWORD w;
+
     EnterCriticalSection(&vga_lock);
 
     switch(ascii) {
     case '\b':
         if (vga_text_x)
+        {
             vga_text_x--;
+            VGA_PutCharAt(vga_text_x, vga_text_y, ' ', 0);
+        }
         break;
 
     case '\t':
@@ -850,7 +885,7 @@ void VGA_PutChar(BYTE ascii)
      * If we don't have a console, write directly to standard output.
      */
     if(!vga_text_console)
-        WriteFile(VGA_AlphaConsole(), &ascii, 1, NULL, NULL);
+        WriteFile(VGA_AlphaConsole(), &ascii, 1, &w, NULL);
 
     LeaveCriticalSection(&vga_lock);
 }