Kernel/debug - Panic to VT for the first nested panic
[tpg/acess2.git] / AcessNative / acesskernel_src / video.c
index 5408b56..da18f48 100644 (file)
@@ -166,10 +166,12 @@ Uint64 Video_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Bu
                
                LOG("buffer = %p", Buffer);
                
+               Offset /= 4;
                startX = Offset % giUI_Width;
                startY = Offset / giUI_Width;
-               
-               if( Length + startX < giUI_Width )
+               Length /= 4;
+
+               if( startX + Length < giUI_Width )
                {
                        // Single line
                        UI_BlitBitmap(
@@ -177,6 +179,15 @@ Uint64 Video_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Bu
                                Length, 1,
                                Buffer);
                }
+               else if( startX == 0 )
+               {
+                       int     lines = Length / giUI_Width;
+                       int     rem = Length % giUI_Width;
+                       UI_BlitBitmap(0, startY, giUI_Width, lines, Buffer);
+                       if( rem ) {
+                               UI_BlitBitmap(0, startY + lines, rem, 1, (Uint32*)Buffer + lines*giUI_Width);
+                       }
+               }
                else
                {
                        // First scanline (partial or full)

UCC git Repository :: git.ucc.asn.au