AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Comparing functions

Ein Thema von Razor · begonnen am 28. Aug 2007 · letzter Beitrag vom 8. Nov 2007
Antwort Antwort
Seite 4 von 9   « Erste     234 56     Letzte »    
Muetze1
(Gast)

n/a Beiträge
 
#31

Re: Comparing functions

  Alt 4. Nov 2007, 19:59
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?
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#32

Re: Comparing functions

  Alt 4. Nov 2007, 19:59
That'd be a new kind of OOP. Methods being hidden to the class itself and only accessable by others.
Markus Kinzler
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#33

Re: Comparing functions

  Alt 4. Nov 2007, 20:05
Okay guys if you help me with this i promise i will post the final and finished product ...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....
Miniaturansicht angehängter Grafiken
untitleda_429.jpg  
  Mit Zitat antworten Zitat
Muetze1
(Gast)

n/a Beiträge
 
#34

Re: Comparing functions

  Alt 4. Nov 2007, 21:56
Take a look in the help to get the facts about cardinal and dword and their sizes, properties, etc.
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#35

Re: Comparing functions

  Alt 4. Nov 2007, 22:02
Muetze1 you said something bout dividing by 4 what did you mean?
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#36

Re: Comparing functions

  Alt 4. Nov 2007, 22:07
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:
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
Or.....


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!!!!
  Mit Zitat antworten Zitat
devidespe

Registriert seit: 7. Sep 2006
Ort: Berlin
434 Beiträge
 
Delphi 10.4 Sydney
 
#37

Re: Comparing functions

  Alt 5. Nov 2007, 07:12
Zitat von Razor:
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:
To help you with this problem I need a view into OMCDrv.pas, because the GetPCIRDWord function have to be validated.
Devid
  Mit Zitat antworten Zitat
Alt 5. Nov 2007, 07:28     Erstellt von Razor
Dieser Beitrag wurde von Matze gelöscht. - Grund: Beitrag auf Wunsch von Razor ausgeblendet.
Benutzerbild von Mackhack
Mackhack

Registriert seit: 29. Nov 2003
Ort: San Diego, CA/USA
1.446 Beiträge
 
Delphi 2006 Architect
 
#38

Re: Comparing functions

  Alt 5. Nov 2007, 07:31
What is that unit exactly for? Sounds like an interesting project!
Um etwas Neues zu schaffen muss man seine Ohren vor den Nein-sagern verschliessen um seinen Geist öffnen zu können.
(George Lukas)
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#39

Re: Comparing functions

  Alt 5. Nov 2007, 07:32
As i said the project will be realased when finished but hilfeee!!!
  Mit Zitat antworten Zitat
Benutzerbild von Mackhack
Mackhack

Registriert seit: 29. Nov 2003
Ort: San Diego, CA/USA
1.446 Beiträge
 
Delphi 2006 Architect
 
#40

Re: Comparing functions

  Alt 5. Nov 2007, 07:33
Zitat von Razor:
As i said the project will be realased when finished but hilfeee!!!
Ok, is crystal clear and we all do understand it but I still would like to know what this is for and the unit you just posted so we might be able to help more out here!
Um etwas Neues zu schaffen muss man seine Ohren vor den Nein-sagern verschliessen um seinen Geist öffnen zu können.
(George Lukas)
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 4 von 9   « Erste     234 56     Letzte »    


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:56 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz