libeg/screen.c
BOOLEAN egSetTextMode(UINT32 RequestedMode) {
    UINTN i = 0, Width, Height;
    EFI_STATUS Status;
    BOOLEAN ChangedIt = FALSE;

    if ((RequestedMode != DONT_CHANGE_TEXT_MODE) && (RequestedMode != ST->ConOut->Mode->Mode)) {
        Status = refit_call2_wrapper(ST->ConOut->SetMode, ST->ConOut, RequestedMode);
        if (Status == EFI_SUCCESS) {
            ChangedIt = TRUE;
        } else {
            SwitchToText(FALSE);
            do {
                Status = refit_call4_wrapper(ST->ConOut->QueryMode, ST->ConOut, i, &Width, &Height);
            } while (++i < ST->ConOut->Mode->MaxMode);

            SwitchToGraphics();
        } // if/else successful change
    } // if need to change mode
    return ChangedIt;
}
// Set a text mode.
// Returns TRUE if the mode actually changed, FALSE otherwise.
// Note that a FALSE return value can mean either an error or no change
// necessary.
Set a text mode.
Returns TRUE if the mode actually changed, FALSE otherwise.
Note that a FALSE return value can mean either an error or no change
necessary.
Set a text mode . Returns TRUE if the mode actually changed FALSE otherwise . Note that a FALSE return value can mean either an error or no change necessary .
BOOLEAN egSetTextMode(UINT32 RequestedMode) {
    UINTN i = 0, Width, Height;
    EFI_STATUS Status;
    BOOLEAN ChangedIt = FALSE;
    if ((RequestedMode != DONT_CHANGE_TEXT_MODE) && (RequestedMode != ST->ConOut->Mode->Mode)) {
        Status = refit_call2_wrapper(ST->ConOut->SetMode, ST->ConOut, RequestedMode);
        if (Status == EFI_SUCCESS) {
            ChangedIt = TRUE;
        } else {
            SwitchToText(FALSE);
            do {
                Status = refit_call4_wrapper(ST->ConOut->QueryMode, ST->ConOut, i, &Width, &Height);
            } while (++i < ST->ConOut->Mode->MaxMode);
            SwitchToGraphics();
        } 
    } 
    return ChangedIt;
}
BOOLEAN egSetTextMode ( UINT32 RequestedMode ) { UINTN i = 0 , Width , Height ; EFI_STATUS Status ; BOOLEAN ChangedIt = FALSE ; if ( ( RequestedMode != DONT_CHANGE_TEXT_MODE ) && ( RequestedMode != ST -> ConOut -> Mode -> Mode ) ) { Status = refit_call2_wrapper ( ST -> ConOut -> SetMode , ST -> ConOut , RequestedMode ) ; if ( Status == EFI_SUCCESS ) { ChangedIt = TRUE ; } else { SwitchToText ( FALSE ) ; do { Status = refit_call4_wrapper ( ST -> ConOut -> QueryMode , ST -> ConOut , i , & Width , & Height ) ; } while ( ++ i < ST -> ConOut -> Mode -> MaxMode ) ; SwitchToGraphics ( ) ; } } return ChangedIt ; }
Set a text mode.
Set a text mode .
// if/else successful change // if need to change mode