Newer
Older
AMI-Aptio-BIOS-Reversed / PurleyPlatPkg / Platform / Pei / EarlyVideoPei / VgaModeSetResolution.c
@Ajax Dong Ajax Dong 2 days ago 827 bytes Full restructure
int __thiscall VgaModeSetResolution(int *this)
{
  int v2; // edi
  int v3; // ecx
  int v4; // ecx
  int v5; // ecx
  int v6; // eax
  int v7; // edx
  int v8; // ecx
  int v9; // ecx
  int v10; // eax
  int v11; // edx
  int v12; // ecx

  v2 = *(this + 15);
  PciRegWrite(v2, 509607936, -1360193021);
  PciRegWrite(v3, 509608068, 0x10000);
  PciRegWrite(v4, 509608072, 0);
  PciRegWrite(v5, 510533632, 378054824);
  do
  {
    VgaModeProgramAll(this);
    VgaModeProgramCrtc(this);
    if ( (PciRegRead(v2, 510533744) & 0x1000000) != 0 )
      VgaDisplayModeSet(this);
    else
      VgaModeProgramDisplay(this);
  }
  while ( !VgaModeDisable(this) );
  v6 = PciRegRead(v2, 510533696);
  PciRegWrite(v8, v7, v6 | 0x41);
  v10 = PciRegRead(v9, 510533644);
  PciRegWrite(v12, v11, v10 & 0xE9FFFFFF | 0x10000000);
  return 1;
}