libeg/screen.c
EFI_STATUS egSetMode(INT32 Next)
{
  EFI_STATUS  Status = EFI_UNSUPPORTED;
  UINT32      MaxMode;
  UINTN       SizeOfInfo;
  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
  INT32      Mode;
  UINT32     Index = 0;

  if (GraphicsOutput == NULL) {
    return EFI_UNSUPPORTED;
  }

  MaxMode = GraphicsOutput->Mode->MaxMode;
  Mode = GraphicsOutput->Mode->Mode;
  while (EFI_ERROR(Status) && Index <= MaxMode) {
    Mode = Mode + Next;
    Mode = (Mode >= (INT32)MaxMode)?0:Mode;
    Mode = (Mode < 0)?((INT32)MaxMode - 1):Mode;
    Status = GraphicsOutput->QueryMode(GraphicsOutput, (UINT32)Mode, &SizeOfInfo, &Info);
    if (Status == EFI_SUCCESS) {
      Status = GopSetModeAndReconnectTextOut((UINT32)Mode);
      egScreenWidth = GraphicsOutput->Mode->Info->HorizontalResolution;
      egScreenHeight = GraphicsOutput->Mode->Info->VerticalResolution;
    }
    Index++;
  }

  return Status;
}
// Make the necessary system calls to identify the set the current graphics mode.
Make the necessary system calls to identify the set the current graphics mode.
Make the necessary system calls to identify the set the current graphics mode .
EFI_STATUS egSetMode(INT32 Next)
{
  EFI_STATUS  Status = EFI_UNSUPPORTED;
  UINT32      MaxMode;
  UINTN       SizeOfInfo;
  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
  INT32      Mode;
  UINT32     Index = 0;
  if (GraphicsOutput == NULL) {
    return EFI_UNSUPPORTED;
  }
  MaxMode = GraphicsOutput->Mode->MaxMode;
  Mode = GraphicsOutput->Mode->Mode;
  while (EFI_ERROR(Status) && Index <= MaxMode) {
    Mode = Mode + Next;
    Mode = (Mode >= (INT32)MaxMode)?0:Mode;
    Mode = (Mode < 0)?((INT32)MaxMode - 1):Mode;
    Status = GraphicsOutput->QueryMode(GraphicsOutput, (UINT32)Mode, &SizeOfInfo, &Info);
    if (Status == EFI_SUCCESS) {
      Status = GopSetModeAndReconnectTextOut((UINT32)Mode);
      egScreenWidth = GraphicsOutput->Mode->Info->HorizontalResolution;
      egScreenHeight = GraphicsOutput->Mode->Info->VerticalResolution;
    }
    Index++;
  }
  return Status;
}
EFI_STATUS egSetMode ( INT32 Next ) { EFI_STATUS Status = EFI_UNSUPPORTED ; UINT32 MaxMode ; UINTN SizeOfInfo ; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION * Info ; INT32 Mode ; UINT32 Index = 0 ; if ( GraphicsOutput == NULL ) { return EFI_UNSUPPORTED ; } MaxMode = GraphicsOutput -> Mode -> MaxMode ; Mode = GraphicsOutput -> Mode -> Mode ; while ( EFI_ERROR ( Status ) && Index <= MaxMode ) { Mode = Mode + Next ; Mode = ( Mode >= ( INT32 ) MaxMode ) ? 0 : Mode ; Mode = ( Mode < 0 ) ? ( ( INT32 ) MaxMode - 1 ) : Mode ; Status = GraphicsOutput -> QueryMode ( GraphicsOutput , ( UINT32 ) Mode , & SizeOfInfo , & Info ) ; if ( Status == EFI_SUCCESS ) { Status = GopSetModeAndReconnectTextOut ( ( UINT32 ) Mode ) ; egScreenWidth = GraphicsOutput -> Mode -> Info -> HorizontalResolution ; egScreenHeight = GraphicsOutput -> Mode -> Info -> VerticalResolution ; } Index ++ ; } return Status ; }
Make the necessary system calls to identify the set the current graphics mode.
Make the necessary system calls to identify the set the current graphics mode .