From 6abf8212d661f578fe54c5b072cf4261c632271a Mon Sep 17 00:00:00 2001 From: mbirth Date: Wed, 8 Dec 2004 09:54:31 +0000 Subject: [PATCH] modified Analyzer.dof modified AnalyzerU.dfm modified AnalyzerU.pas modified SMBus.pas + Support for VIA VT82C686A/B * moved ZlIOStarted-checking from OnFormCreate to OnPCIScanClick * changed variable names in SMBus.pas for better understanding --- Analyzer.dof | 4 ++-- AnalyzerU.dfm | 1 - AnalyzerU.pas | 22 +++++++++------------- SMBus.pas | 13 ++++++++++--- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Analyzer.dof b/Analyzer.dof index 6690411..1c94b0e 100644 --- a/Analyzer.dof +++ b/Analyzer.dof @@ -115,7 +115,7 @@ AutoIncBuild=1 MajorVer=1 MinorVer=0 Release=0 -Build=4 +Build=5 Debug=0 PreRelease=0 Special=0 @@ -126,7 +126,7 @@ CodePage=1252 [Version Info Keys] CompanyName= FileDescription=Parses SONY VAIO security eeprom dump and extracts some interesting information. -FileVersion=1.0.0.4 +FileVersion=1.0.0.5 InternalName=Analyzer LegalCopyright= LegalTrademarks= diff --git a/AnalyzerU.dfm b/AnalyzerU.dfm index 2818eff..32dacba 100644 --- a/AnalyzerU.dfm +++ b/AnalyzerU.dfm @@ -11,7 +11,6 @@ object AForm: TAForm Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False - OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object LabelHeading: TLabel diff --git a/AnalyzerU.pas b/AnalyzerU.pas index b93fa07..bc8ced3 100644 --- a/AnalyzerU.pas +++ b/AnalyzerU.pas @@ -62,7 +62,6 @@ type ComboSMB: TComboBox; procedure ButtonOpenClick(Sender: TObject); procedure ButtonPCIScanClick(Sender: TObject); - procedure FormCreate(Sender: TObject); procedure ButtonSMBReadClick(Sender: TObject); procedure ButtonSMBScanClick(Sender: TObject); private @@ -261,18 +260,15 @@ end; procedure TAForm.ButtonPCIScanClick(Sender: TObject); begin - Screen.Cursor := crHourGlass; - MyPCI := Scan_PCI(Application, AForm.LabelStatus); - Screen.Cursor := crDefault; - if (MyPCI.SMB_Address <> 0) AND (MyPCI.Vendor_Name <> '') then begin - AForm.LabelStatus.Caption := 'SMBus-Controller: '+MyPCI.Vendor_Name+' '+MyPCI.Device_Name+' Rev '+IntToStr(MyPCI.Rev)+' at addr 0x'+IntToHex(MyPCI.SMB_Address,4); - EnableGroup(AForm.GroupSMBus, true); - end; -end; - -procedure TAForm.FormCreate(Sender: TObject); -begin - if NOT ZlIOStarted then ShowMessage('The driver ZLPORTIO.SYS could not be loaded. The program won''t be able to read out SMBus under Windows NT/2000/XP! Make sure, the file is in path or in the program directory.'); + if ZlIOStarted then begin + Screen.Cursor := crHourGlass; + MyPCI := Scan_PCI(Application, AForm.LabelStatus); + Screen.Cursor := crDefault; + if (MyPCI.SMB_Address <> 0) AND (MyPCI.Vendor_Name <> '') then begin + AForm.LabelStatus.Caption := 'SMBus-Controller: '+MyPCI.Vendor_Name+' '+MyPCI.Device_Name+' Rev '+IntToStr(MyPCI.Rev)+' at addr 0x'+IntToHex(MyPCI.SMB_Address,4); + EnableGroup(AForm.GroupSMBus, true); + end; + end else ShowMessage('The driver ZLPORTIO.SYS could not be loaded. The program won''t be able to read out SMBus under Windows NT/2000/XP! Make sure, the file is in path or in the program directory.'); end; function PowerInt(base, exp: integer): Int64; diff --git a/SMBus.pas b/SMBus.pas index d3a569d..440851c 100644 --- a/SMBus.pas +++ b/SMBus.pas @@ -20,7 +20,7 @@ interface function Scan_PCI(Application: TApplication; Status: TLabel): PCI_Info; function smbGetReg(BaseAddr: word; Reg: byte; Slave: byte): word; - function smbGetArray(BaseAddr: word; Reg: byte; Slave: byte; len: byte): TSMBData; + function smbGetArray(BaseAddr: word; regfrom: byte; Slave: byte; regto: byte): TSMBData; implementation @@ -100,6 +100,13 @@ begin PCI_Structure.Vendor_Name := 'Intel®'; PCI_Structure.Device_Name := '82801DB/DBM'; end; + $30571106: + begin + PCI_Structure.SMB_Address := Get_PCI_Reg(Bus, Dev, Fun, $90) and $FFF0; + PCI_Structure.Rev := Get_PCI_Reg(Bus, Dev, Fun, 8) and $FF; + PCI_Structure.Vendor_Name := 'VIA®'; + PCI_Structure.Device_Name := 'VT82C686A/B'; + end; else PCI_Structure.SMB_Address := 0; PCI_Structure.Rev := 0; @@ -211,14 +218,14 @@ begin Result := (Data and $ff); end; -function smbGetArray(BaseAddr: word; Reg: byte; Slave: byte; len: byte): TSMBData; +function smbGetArray(BaseAddr: word; regfrom: byte; Slave: byte; regto: byte): TSMBData; var Data: cardinal; i: byte; begin smbWaitForFree(BaseAddr); PortWriteB(BaseAddr + 5, 0); PortWriteB(BaseAddr + 6, 0); - for i:=reg to reg+len-1 do begin + for i:=regfrom to regto do begin smbWaitForFree(BaseAddr); PortWriteB(BaseAddr + 3, i); PortWriteB(BaseAddr + 4, (Slave shl 1) or RW_READ);