![]() |
Comparing functions
From IO driver #1
Delphi-Quellcode:
procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; var pdata: DWord);
procedure SetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; pdata: DWord); From IO driver #2
Delphi-Quellcode:
function GetPCRD(Bus, Dev, Func, Reg : byte): dword;
procedure SetPCRD(Bus, Dev, Func, Reg : byte; value : dword); Can driver 2 functions be used same as driver 1 in this way
Delphi-Quellcode:
var
dwResult : DWORD; begin //-------Reading a temperature of the Core0---------- dwResult:=GetPCRD(0,24,$03,$E4); SetPCRD(0,24,$03,$E4, dwResult and not (1 shl 2)); //Core0 select dwResult:=GetPCRD(0,24,$03,$E4); C0:= Format('%d °C',[(dwResult shr 16 and $FF)-49]); Label0.Caption := C0; Form1.Caption:= C0; Application.Title:= C0; if not Core2Present then Exit; //-------Reading a temperature of the Core1---------- dwResult:=GetPCRD(0,24,$03,$E4); SetPCRD(0,24,$03,$E4, dwResult or (1 shl 2)); //Core1 select dwResult:=GetPCRD(0,24,$03,$E4); Label1.Caption := Format('%d °C',[(dwResult shr 16 and $FF)-49]); I have tried it this way but i can't even compile this becouse IDE gives an error Internal L1333 error.:(
Delphi-Quellcode:
var
pdata : DWORD; begin //-------Reading a temperature of the Core0---------- GetPCIRDWord(0,24,$03,$E4,pdata); SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2)); //Core0 select GetPCIRDWord(0,24,$03,$E4,pdata); C0:= Format('%d °C',[(pdata shr 16 and $FF)-49]); Label0.Caption := C0; Form1.Caption:= C0; Application.Title:= C0; if not Core2Present then Exit; //-------Reading a temperature of the Core1---------- GetPCIRDWord(0,24,$03,$E4,pdata); SetPCIRDWord(0,24,$03,$E4, pdata or (1 shl 2)); //Core1 select GetPCIRDWord(0,24,$03,$E4,pdata); Label1.Caption := Format('%d °C',[(pdata shr 16 and $FF)-49]); Thanks! |
Re: Comparing functions
Did you write this code or did you copy and paste it again like all the other code fragments you've showed us so far?
|
Re: Comparing functions
Zitat:
I don't know how you could expect meeting your deadline without having any knowledge about the pure Delphi-basics at all. Sorry man, but if you don't even get the meaning of these lines you've posted... |
Re: Comparing functions
Yes i do understand them,they both read dword from pci bus,but maybe is it better to join the 2 driver to 1 single driver?What you think about that?
|
Re: Comparing functions
Both driver offer the same functionality so device which one to use and then change your code to use the selected one...
|
Re: Comparing functions
So basicly here goes for an old version of a driver and a new version of a driver wich has also x64,x86.But why does it delphi give out L1333 internal error I dont understand this... :oops:
The second driver also provides msr read functions basicly both do.... :!: |
Re: Comparing functions
Where does this highly interesting code comes from ?
|
Re: Comparing functions
Basicly this can't compile...:x
Delphi-Quellcode:
var
pdata:Cardinal; begin omcdrv.GetPCIRDWord(0,24,$03,$E4,pdata); // Here i get Internal error L1333 omcdrv.SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2)); C0:= Format('%d °C',[(pdata shr 16 and $FF)-49]); Label0.Caption := C0; //procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; var pdata: Cardinal); |
Re: Comparing functions
Zitat:
![]() |
Re: Comparing functions
Yes that is AMD64 Core Temperature!Posted by hathor made by deamonES...Do i need to say more?
|
Re: Comparing functions
Maybe someone can write an example how to use PortIO (getpcrd,setpcrd) with omcdrv (GetPCIRDWord,SetPCIRDWord).
I dont understand what Muetze ment. |
Re: Comparing functions
What did we say about double-posting?
You're doing it again, so take this (again) as a warning to NOT double post. Muetze confused a word. He did not mean device but decide. You have to decide what driver is needed to be called and then you have to call the function of the correct driver. |
Re: Comparing functions
He said both offer same functionality so i have to decide wich one to use but its impossible to use 2 becouse i get BSOD(BLUE SCREEN OF DEATH)if i use it,get it? :zwinker:
As i said an example would be perfect just how to make this compilable omcdrv.GetPCIRDWord(0,24,$03,$E4,pdata); |
Re: Comparing functions
Zitat:
Zitat:
That you can't use both is completly logical and so you have to decide which one to use. So decide and then change the sources to use onyl the selected one... |
Re: Comparing functions
[delphi]Alright alright and thanks buuut
[pre]procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; var pdata: Cardinal); procedure SetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; pdata: Cardinal); omcdrv.GetPCIRDWord(0,24,$03,$E4,pdata); [/pre] [pre]var dwresult:dword; function GetPCRD(Bus, Dev, Func, Reg : byte): dword; procedure SetPCRD(Bus, Dev, Func, Reg : byte; value : dword); dwResult:=GetPCRD(0,24,$03,$E4); [/pre] Now how in heaven can i change this this arent theh same functions... |
Re: Comparing functions
Delphi-Quellcode:
dwBus = Bus
procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; var pdata: Cardinal);
function GetPCRD(Bus, Dev, Func, Reg : byte): dword; dwDev = Dev dwFunc = Func offs = Reg div 4 pData = result
Delphi-Quellcode:
dwBus = Bus
procedure SetPCIRDWord(dwBus, dwDev, dwFunc, offs: byte; pdata: Cardinal);
procedure SetPCRD(Bus, Dev, Func, Reg : byte; value : dword); dwDev = Dev dwFunc = Func offs = Reg div 4 pData = value |
Re: Comparing functions
Zitat:
Delphi-Quellcode:
var
pdata:cardinal; begin GetPCIRDWord(0,24,$03,$E4,pdata) form1.caption:=pdata //??? |
Re: Comparing functions
Basicly it is ok so, but I think you have to divide the given offset by four. The code is ok, but the line with the question-marks are Delphi basics and not hw specific.
|
Re: Comparing functions
|
Re: Comparing functions
![]() other search result says clear all DCU's and build again |
Re: Comparing functions
:wall: Muetze can you test this please!
Delphi-Quellcode:
//omcdrv.tGetPCIRDWord(0,24,03,$E4 ,pdata) ; //Compile omcdrv.tGetPCIRDWord(0,24,03,$E4 ,pdata) ; //WONT Compile [Fatal Error]Internal L1333 |
Re: Comparing functions
Can somebody test this please.Becouse only then i will know that it isnt my delphi that is wrong and currupted. :oops:
|
Re: Comparing functions
*push*
|
Re: Comparing functions
For crying out loud,cant nobody test this?
|
Re: Comparing functions
Oh, sorry. I've tested it some days ago and it works without any problems. Even due the fact of an internal error, I would suggest to reinstall Delphi or install the updates.
Works on D5 Ent UP 2 and D7 Ent UP1... |
Re: Comparing functions
Thank you!!!!!!!!
Now i know my delphi is currupted:? |
Re: Comparing functions
No sadly this still won't work i have tried every possilbe combo but no,and yea my delphi dosent need update and its not curruped.
So help still needed. |
Re: Comparing functions
i know its basics but how to call this
tPCIIO = class(TInterfacedObject, IPCIIO) private FIPortIORef: IPortIO; procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: Byte; var pdata: DWord); <<<<<< +This procedure SetPCIRDWord(dwBus, dwDev, dwFunc, offs: Byte; pdata: DWord); <<<<<<< This procedure GetPCIRWord(dwBus, dwDev, dwFunc, offs: Byte; var pdata: Word); procedure GetPCIRByte(dwBus, dwDev, dwFunc, offs: Byte; var pdata: Byte); procedure SetPCIRByte(dwBus, dwDev, dwFunc, offs, pdata: Byte); function ProbeDevice(dwBus, dwDev: Byte): boolean; procedure FindDevice(VendorID, DeviceID: DWord; var fPCIDevice: tPCIDevice); public constructor Create(const IPortIORef: IPortIO); destructor Destroy; override; end; |
Re: Comparing functions
1.
Zitat:
|
Re: Comparing functions
I know but how exactly...i know becouse they are private only inside and not outside.
But i call it via
Delphi-Quellcode:
procedure tform1.load;
var omc:tomcdrv; begin {omc.>what goes here to have > procedure GetPCIRDWord(dwBus, dwDev, dwFunc, offs: Byte; var pdata: DWord); with pdata:dword and not pdata:cardinal becouse it wont work} end; |
Re: Comparing functions
Learn the basics. It is increadibly how you show us your missing knowledge...
Ok, back to topic: what do you think does "outside" and "inside" mean? |
Re: Comparing functions
That'd be a new kind of OOP. Methods being hidden to the class itself and only accessable by others.
|
Re: Comparing functions
Liste der Anhänge anzeigen (Anzahl: 1)
Okay guys if you help me with this i promise i will post the final and finished product :-D ...and yea i have a looot to learn.newbie i am...
Back to the problem..i made a pic So why is it there var pdata:cardinal and in the omcdrv.pas its var pdata:dword; dont really really get it; and plus why cant i call that function.... :shock: |
Re: Comparing functions
Take a look in the help to get the facts about cardinal and dword and their sizes, properties, etc.
|
Re: Comparing functions
Muetze1 you said something bout dividing by 4 what did you mean? :?
|
Re: Comparing functions
Anyways i wanted to post this also...
Old functions
Delphi-Quellcode:
function GetPCRD(Bus, Dev, Func, Reg : byte): dword;
begin SetPortLong($0CF8, $80000000 or (dword(Bus) shl 16) or ((dword(Dev) and $1f) shl 11) or ((dword(Func) and $07) shl 8) or (Reg and $fc)); GetPCRD:=GetPortLong($0CFC); end; procedure SetPCRD(Bus, Dev, Func, Reg : byte; value : dword); begin SetPortLong($0CF8,$80000000 or (dword(Bus) shl 16) or ((dword(Dev) and $1f) shl 11) or ((dword(Func) and $07) shl 8) or (Reg and $fc)); SetPortLong($0CFC, value); end; New functions
Delphi-Quellcode:
procedure tPCIIO.GetPCIRDWord( dwBus, dwDev, dwFunc, offs : byte; var pdata:DWord );
begin FIPortIORef.WritePortL(PCRAddress,$80000000 or (longint(dwBus) shl 16) or ((longint(dwDev) and $1f) shl 11) or ((longint(dwFunc) and $07 ) shl 8) or (offs and $fc)); pdata := FIPortIORef.ReadPortL(PCRData); end; procedure tPCIIO.SetPCIRDWord(dwBus, dwDev, dwFunc, offs:byte; pdata:DWord); //var IPort: IPortIO; begin //IPort := oHWIO.IPortIORef; FIPortIORef.WritePortL(PCRAddress,$80000000 or (longint(dwBus) shl 16) or ((longint(dwDev) and $1f) shl 11) or ((longint(dwFunc) and $07) shl 8) or (offs and $fc)); FIPortIORef.WritePortL(PCRData, pdata); end; What i tried to do
Delphi-Quellcode:
Or.....
procedure tmainfrm.amd64x2start;
var C0:string; GetInstance:tomcdrv; pdata: DWord; begin GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata); GetInstance.IPCIIORef.SetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2)); GetInstance.IPCIIORef.GetPCIRDWord(0,24,$03,$E4,pdata); C0:=Format('%d °C',[(pdata shr 16 and $FF)-49]); RzLabel99.caption:=C0; //But then i get [Warning] Temperatures.inc(117): Variable 'GetInstance' might not have been initialized
Delphi-Quellcode:
procedure tmainfrm.amd64x2start;
var C0:string; pdata: DWord; begin OMCDRV.tGetPCIRDWord(0,24,$03,$E4,pdata); OMCDRV.tSetPCIRDWord(0,24,$03,$E4, pdata and not (1 shl 2)); OMCDRV.tGetPCIRDWord(0,24,$03,$E4,pdata); C0:=Format('%d °C',[(pdata shr 16 and $FF)-49]); RzLabel99.caption:=C0; //But then i get [Fatal Error]Internal error: BA1993 or [Fatal Error] Internal error: L1333 Hilfee!!!! :wall: |
Re: Comparing functions
Zitat:
|
Re: Comparing functions
What is that unit exactly for? Sounds like an interesting project!
|
Re: Comparing functions
As i said the project will be realased when finished but hilfeee!!! :(
|
Re: Comparing functions
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:38 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz