Advertisement
Dwack

SMCConfig Fan Settings

May 29th, 2013
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. UINT XConfigStaticMainChecksumCalc(PBYTE data)
  2. {
  3.     UINT i, len, sum = 0;
  4.     data += 0x10;
  5.     for(i=0, len=252; i<len; i++)
  6.         sum += data[i]&0xFF;
  7.     sum = (~sum)&0xFFFF;
  8.     return ((sum&0xFF00)<<8)+((sum&0xFF)<<24);
  9. }
  10.  
  11. VOID XConfigTest()
  12. {
  13.     u16 settingSize;
  14.     XCONFIG_STATIC_SETTINGS a;
  15.     ExGetXConfigSetting(XCONFIG_STATIC_CATEGORY, XCONFIG_STATIC_DATA, NULL, NULL, &settingSize);
  16.     ExGetXConfigSetting(XCONFIG_STATIC_CATEGORY, XCONFIG_STATIC_DATA, &a, settingSize, NULL);
  17.     // Full Speed = 0x7F
  18.     // default was 1 : 0x3C on my Xenon XDK
  19.     // a.SMCConfig.fanOrCpu.Enable = 1;
  20.     // a.SMCConfig.fanOrGpu.Enable = 1;
  21.     a.SMCConfig.fanOrCpu.Speed = 0x3C;
  22.     a.SMCConfig.fanOrGpu.Speed = 0x3C;
  23.     a.CheckSum = XConfigStaticMainChecksumCalc((BYTE*)&a);
  24.     ExSetXConfigSetting(XCONFIG_STATIC_CATEGORY, XCONFIG_STATIC_DATA, &a, settingSize);
  25.     DbgPrint("Done\n");
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement