Newer
Older
AMI-Aptio-BIOS-Reversed / PurleyPlatPkg / Platform / Pei / EarlyVideoPei / VgaModeRead.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Full restructure
__int16 __thiscall VgaModeRead(int *this)
{
  int v3; // eax
  int v4; // ebx
  int v5; // ebx
  int v6; // ebx
  int v7; // ebx
  int v8; // ebx
  int v9; // ebx
  int v10; // ebx
  int v12; // [esp+Ch] [ebp-4h]

  v12 = VgaModeSetTiming(this);
  if ( (v12 & 0xFF00) != 0 && (_BYTE)v12 != 0 )
    return 0;
  v3 = PciRegReadViaBar(this, 0);
  if ( ((v3 | v12) & 0xFF00) != 0 && ((unsigned __int8)v3 | (unsigned __int8)v12) != 0 )
    return 0;
  v4 = PciRegReadViaBar(this, 1) | v3 | v12;
  if ( (v4 & 0xFF00) != 0 && (_BYTE)v4 != 0 )
    return 0;
  v5 = PciRegReadViaBar(this, 2) | v4;
  if ( (v5 & 0xFF00) != 0 && (_BYTE)v5 != 0 )
    return 0;
  v6 = PciRegReadViaBar(this, 3) | v5;
  if ( (v6 & 0xFF00) != 0 && (_BYTE)v6 != 0 )
    return 0;
  v7 = PciRegReadViaBar(this, 4) | v6;
  if ( (v7 & 0xFF00) != 0 && (_BYTE)v7 != 0 )
    return 0;
  v8 = PciRegReadViaBar(this, 5) | v7;
  if ( (v8 & 0xFF00) != 0 && (_BYTE)v8 != 0 )
    return 0;
  v9 = PciRegReadViaBar(this, 6) | v8;
  if ( (v9 & 0xFF00) != 0 && (_BYTE)v9 != 0 )
    return 0;
  v10 = PciRegReadViaBar(this, 7) | v9;
  if ( (v10 & 0xFF00) != 0 && (_BYTE)v10 != 0 )
    return 0;
  if ( !v10 )
    return 3;
  if ( (_BYTE)v10 )
    return 2;
  return 1;
}