And this code follows the definition in the UEFI spec so it is correct.

Thanks,

Andrew Fish

On Oct 30, 2013, at 2:53 AM, Ivy Yang <ivy_y...@phoenix.com> wrote:

> Hi,
> GraphicsConsoleConOutOutputString() prints mCrLfString (CR and LF) if the 
> CursorColumn is at or beyond the end of the line *after* printing
>  
> if (This->Mode->CursorColumn >= (INT32) MaxColumn) {
>         FlushCursor (This);
>         This->OutputString (This, mCrLfString);
>         FlushCursor (This);
> }
>  
> This would cause the whole screen scrolling up one row when it is printing 
> the last column of the last row.
> } else if (*WString == CHAR_LINEFEED) {
>      //
>       // If the cursor is at the bottom of the display, then scroll the 
> display one
>       // row, and do not update the cursor position. Otherwise, move the 
> cursor
>       // down one row.
>       //
>       if (This->Mode->CursorRow == (INT32) (MaxRow - 1)) {
>         if (GraphicsOutput != NULL) {
>           //
>           // Scroll Screen Up One Row
>           //
>           GraphicsOutput->Blt (
>                     GraphicsOutput,
>                     NULL,
>                     EfiBltVideoToVideo,
>                     DeltaX,
>                     DeltaY + EFI_GLYPH_HEIGHT,
>                     DeltaX,
>                     DeltaY,
>                     Width,
>                     Height,
>                     Delta
>                     );
> …..}
>  
> This works fine in Shell but would mess up the whole display if the 
> application does not expect to be scrolled, for example, in a form browser.
>  
> However, if the scroll can be done before printing, both Shell and form 
> browser can work just fine if the latter does not print beyond the last 
> column of the last row.
>  
> Index: GraphicsConsole.c
> ===================================================================
> --- GraphicsConsole.c  (revision 14817)
> +++ GraphicsConsole.c      (working copy)
> @@ -1068,6 +1068,16 @@
>        WString++;
>      } else {
> +      if (This->Mode->CursorColumn > (INT32) MaxColumn) {
> +        This->Mode->CursorColumn -= 2;
> +        This->OutputString (This, SpaceStr);
> +      }
> +
> +      if (This->Mode->CursorColumn >= (INT32) MaxColumn) {
> +        FlushCursor (This);
> +        This->OutputString (This, mCrLfString);
> +        FlushCursor (This);
> +      }
>        //
>        // Print the character at the current cursor position and move the 
> cursor
>        // right one column. If this moves the cursor past the right edge of 
> the
> @@ -1119,16 +1129,7 @@
>        //
>        WString += Count;
>        This->Mode->CursorColumn += (INT32) Index;
> -      if (This->Mode->CursorColumn > (INT32) MaxColumn) {
> -        This->Mode->CursorColumn -= 2;
> -        This->OutputString (This, SpaceStr);
> -      }
> -      if (This->Mode->CursorColumn >= (INT32) MaxColumn) {
> -        FlushCursor (This);
> -        This->OutputString (This, mCrLfString);
> -        FlushCursor (This);
> -      }
>      }
>    }
>  
>  
> Thanks,
> Ivy
>  
> ------------------------------------------------------------------------------
> Android is increasing in popularity, but the open development platform that
> developers love is also attractive to malware creators. Download this white
> paper to learn more about secure code signing practices that can help keep
> Android apps secure.
> http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to