Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (AndrewAMD, fogman, Grant, juanex), 972 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
sys_processor, sys_ram. #256702
03/18/09 14:19
03/18/09 14:19
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline OP
Expert
Cowabanga  Offline OP
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Hello,

It would be cool if you can put these variables.

sys_processor -> Calculates the Processor speed by Mhz.
Example:

if(sys_processor == 2000) {...}

sys_ram -> Calculates the RAM size by MB.
Example:

if(sys_ram == 1024) {...}


Thanks in advance! smile

Last edited by Cowabanga; 03/18/09 15:20.
Re: sys_processor, sys_ram, sys_videomemory. [Re: Cowabanga] #256708
03/18/09 14:49
03/18/09 14:49
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Cowabanga

sys_videomemory -> Calculates the VideoCard's memory by MB.

you can use d3d_texfree to know how many kbs are free. If you want to know the size in MB you can create a function like this one:

Code:
function get_videomemory()
{
  var temp;
  temp = d3d_texfree;
  temp = temp / 1000;
  return(temp);
}

...

void main()
{
   ...
   if(get_videomemory > 512)
   {
      printf("more than 512 Mb video memory free");
   }
   ...
}


not tested, but this should work.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: sys_processor, sys_ram, sys_videomemory. [Re: WretchedSid] #256710
03/18/09 15:04
03/18/09 15:04
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
You have to use 1024 and not 1000 and temp is also not needed.

Better version:

Code:

function get_videomemory()
{
  return(d3d_texfree/1024);
}

...

void main()
{
   ...
   if(get_videomemory > 512)
   {
      printf("more than 512 Mb video memory free");
   }
   ...
}



ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: sys_processor, sys_ram, sys_videomemory. [Re: Dark_samurai] #256712
03/18/09 15:13
03/18/09 15:13
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Yep you are right. I created this without thinking about, your function is indeed better. But afaik you should use 1000 because this var use kilobyte and not kibibyte but I´m not sure.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: sys_processor, sys_ram, sys_videomemory. [Re: WretchedSid] #256715
03/18/09 15:20
03/18/09 15:20
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline OP
Expert
Cowabanga  Offline OP
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
OK. Now we have the VideoCard's memory calculation.

But i'm waiting for adding these 2 variables.

Re: sys_processor, sys_ram, sys_videomemory. [Re: Cowabanga] #256716
03/18/09 15:22
03/18/09 15:22
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
If you want, i can write a dll for you to read this out.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: sys_processor, sys_ram, sys_videomemory. [Re: WretchedSid] #256729
03/18/09 16:48
03/18/09 16:48
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
As far as I know you can use DX functions with Lite-C, so I'm sure there are functions that return those values.

@Sylar: 1 Bit (*8)= 1 Byte (*1024)= 1 kiloByte (*1024)= 1 MegaByte ...
What do you mean with kibibyte? Do you mean kilobits?


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: sys_processor, sys_ram, sys_videomemory. [Re: Dark_samurai] #256733
03/18/09 17:07
03/18/09 17:07
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
@Dark_samurai: Ich bin der Meinung das "/1000" richtig ist, weil ein Kibibyte ist 1024 bytes groß und ein Kilobyte 1000 bytes. Und da ich glaube das die Funktion die größe in Kilobytes zurückgibt, muss man das ganze dann auch durch 1000 teilen.

@Cowabanga: Here http://www.zshare.net/download/57233756ab381109/ is an .dll that provides sys_ram and sys_cpu. A small sample.c is also included. But both functions arent absolute precise.

Last edited by Sylar; 03/18/09 17:16.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: sys_processor, sys_ram, sys_videomemory. [Re: WretchedSid] #256736
03/18/09 17:31
03/18/09 17:31
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
@Sylar: Hab Kibibyte mal gegooglet:

Irgendwer hat mal vorgeschlagen, dass ab sofort Kilobyte 10 als Basis hat und Kibibyte 2 als Basis, da es immer Unklarheiten gab. Hat sich aber nicht wirklich durchgesetzt.

Sprich: In der Informatik meint man bei Kilobyte in 99% der Fälle das der Basis 2. Und in Schulen etc. wird es auch mit Basis 2 gelehrt (zumindest habe ich es so gelernt).

Ich weis natürlich nicht wie JCL das implementiert hat, aber ich schätze mal, dass er Basis 2 verwendet.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: sys_processor, sys_ram, sys_videomemory. [Re: Dark_samurai] #256737
03/18/09 17:44
03/18/09 17:44
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Kay, ich hab es halt so gelernt und bin deswegen immer ein bisschen unsicher. Vllt. kann JCL das ganze ja mal aufklären...


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 1 of 2 1 2

Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1