Newer
Older
AMI-Aptio-BIOS-Reversed / PurleyPlatPkg / Platform / Pei / EarlyVideoPei / VgaModeSetTiming.c
@Ajax Dong Ajax Dong 2 days ago 554 bytes Full restructure
int __thiscall VgaModeSetTiming(int *this)
{
  int v1; // ecx
  int v2; // ecx
  int v3; // esi
  int v4; // eax
  int v5; // edx
  int v6; // esi
  int v7; // ecx

  PciRegWrite(*this, 510525552, 0);
  PciRegWrite(v1, 510525552, 5);
  v3 = 0;
  while ( 1 )
  {
    v4 = PciRegRead(v2, 510525552) & 0x1000;
    if ( (unsigned int)++v3 > 0x4C4B40 )
      break;
    if ( v4 )
    {
      v6 = PciRegRead(v2, 510525560);
      PciRegWrite(v7, 510525552, 0);
      return (unsigned __int16)v6 | HIWORD(v6);
    }
  }
  PciRegWrite(v2, v5, 0);
  return -1;
}