branch update for HEAD-2003021201
[reactos.git] / drivers / dd / vga / display / objects / offscreen.c
index 4c8fba8..b01ad60 100644 (file)
@@ -54,7 +54,8 @@ VGADDI_BltFromSavedScreenBits(ULONG DestX,
   for (i = 0; i < SizeY; i++)
     {
       DestOffset = (PUCHAR)vidmem + (i + DestY) * 80 + (DestX >> 3);
-      for (j = 0; j < SizeX; j++, SrcOffset++, DestOffset++)
+         //FIXME: in the loop below we should treat the case when SizeX is not divisible by 8, i.e. partial bytes
+      for (j = 0; j < SizeX>>3; j++, SrcOffset++, DestOffset++)
        {
          (VOID)READ_REGISTER_UCHAR(SrcOffset);
          WRITE_REGISTER_UCHAR(DestOffset, 0);
@@ -86,7 +87,8 @@ VGADDI_BltToSavedScreenBits(PSAVED_SCREEN_BITS Dest,
   for (i = 0; i < SizeY; i++)
     {
       SrcOffset = (PUCHAR)vidmem + (SourceY + i) * 80 + (SourceX >> 3);
-      for (j = 0; j < SizeX; j++, SrcOffset++, DestOffset++)
+         //FIXME: in the loop below we should treat the case when SizeX is not divisible by 8, i.e. partial bytes
+         for (j = 0; j < SizeX>>3; j++, SrcOffset++, DestOffset++)
        {
          (VOID)READ_REGISTER_UCHAR(SrcOffset);
          WRITE_REGISTER_UCHAR(DestOffset, 0);
@@ -107,7 +109,7 @@ VGADDI_FreeSavedScreenBits(PSAVED_SCREEN_BITS SavedBits)
     {
       PSAVED_SCREEN_BITS Previous;
 
-      Previous = CONTAINING_RECORD(SavedBits->ListEntry.Blink, 
+      Previous = CONTAINING_RECORD(SavedBits->ListEntry.Blink,
                                   SAVED_SCREEN_BITS, ListEntry);
       if (Previous->Free)
        {
@@ -121,7 +123,7 @@ VGADDI_FreeSavedScreenBits(PSAVED_SCREEN_BITS SavedBits)
     {
       PSAVED_SCREEN_BITS Next;
 
-      Next = CONTAINING_RECORD(SavedBits->ListEntry.Flink, SAVED_SCREEN_BITS, 
+      Next = CONTAINING_RECORD(SavedBits->ListEntry.Flink, SAVED_SCREEN_BITS,
                               ListEntry);
       if (Next->Free)
        {