|
|
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
OP
Expert
|
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! 
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
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
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:
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
Serious User
|
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:
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
Expert
|
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: Cowabanga]
#256716
03/18/09 15:22
03/18/09 15:22
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
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
Serious User
|
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
Expert
|
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
Serious User
|
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
Expert
|
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
|
|
|
|