PDA

View Full Version : NBCCCalc by money11465



money11465
01-05-2007, 06:13 PM
I come here every once in a while, and this is obviously the first time I've registered. I reside mainly at Overclock.net, and I've written a program regarding the somewhat time-consuming process to calculate each time you want to raise your FSB or lower your multi. Here is what I posted (http://www.overclock.net/intel-motherboards/145610-nbcccalc-money11465.html):

In regards to the Northbridge straps and their toughness to reason with sometimes, especially when non-stock multipliers come into play, I wrote a quick program that asks you your Conroe chip, your multiplier, and your FSB. It then tells you about your Northbridge Core Clock, your strap, and your CPU speed. It is nice to be able to quickly calculate if for example downscaling the multi might help or not with performance. You want to be on as low a strap as possible because higher straps mean higher latencies. However, FSB is still more important, much like RAM timings vs. speed. In an ideal configuration, your FSB would be pushing the Northbridge Core Clock so it is just under the ceiling for another strap. Also please note that most boards do not implement all of the straps yet, i.e. on the P5B-Deluxe only the 1066 and 1600 straps are in place, so any reported straps that are non-existent on your board are really the one below it (i.e. the 1333 strap is really still the 1066 on the P5B-Deluxe). Furthermore, you may notice that straps are "pushed forward" on some boards, for example the latency settings that should have occurred at 1333 occur at 1600; My program refers to the straps by when they occur, not by the settings. To learn more about straps and the such, visit these threads:
http://www.xtremesystems.org/forums/...d.php?t=114998
http://www.overclock.net/intel-mothe...p965-975x.html
I have included both Zip and RAR versions for your convenience. If you'd like to redistribute it, that's fine, and if you post it somewhere please link back to this thread. Enjoy!
I have attached a Zip archive for your convenience, but if you post somewhere else please give me credit and link to the thread at Overclock.net. Here is another link to the thread (http://www.overclock.net/intel-motherboards/145610-nbcccalc-money11465.html).

eshbach
01-05-2007, 09:26 PM
i think a bit of input checking would be good. i accidentally typed a "g" and the program threw and exception and crashed.

instead of this:



private void TextBox1_TextChanged(object sender, EventArgs e)
{
if (Operators.CompareString(this.TextBox1.Text, "", false) != 0)
{
this.fsb = Conversions.ToInteger(this.TextBox1.Text);
}
else
{
this.fsb = 0;
}
this.calcnbcc();
}



I would do this:



private void TextBox1_TextChanged(object sender, EventArgs e)
{
if (!int.TryParse(this.TextBox1.Text, out this.fsb))
this.fsb = 0;
this.calcnbcc();
}


It's simpler and won't blow up with bad input.

money11465
01-05-2007, 09:45 PM
i think a bit of input checking would be good. i accidentally typed a "g" and the program threw and exception and crashed.

instead of this:



private void TextBox1_TextChanged(object sender, EventArgs e)
{
if (Operators.CompareString(this.TextBox1.Text, "", false) != 0)
{
this.fsb = Conversions.ToInteger(this.TextBox1.Text);
}
else
{
this.fsb = 0;
}
this.calcnbcc();
}



I would do this:



private void TextBox1_TextChanged(object sender, EventArgs e)
{
if (!int.TryParse(this.TextBox1.Text, out this.fsb))
this.fsb = 0;
this.calcnbcc();
}


It's simpler and won't blow up with bad input.
That's weird. I tried it, too, but it shouldn't happen because it actually casts the input to an integer, so that even if you type a letter it should cast it. Hmm.

BTW, did you decompile it? If so, I'd like the name of it! It works quite well.

eshbach
01-05-2007, 09:52 PM
That's weird. I tried it, too, but it shouldn't happen because it actually casts the input to an integer, so that even if you type a letter it should cast it. Hmm.

BTW, did you decompile it? If so, I'd like the name of it! It works quite well.

Casting will always throw an exception if the source data is not in the correct format. The standard practice would be something like:



int number;
try
{
number = int.Parse(SomeString);
}
catch
{
number = 0;
}
finally
{
callAFunctionOrSomething();
}


but .NET 2.0 gives us the lovely TryParse function which can assign to an output variable. You pass it the input string and the output int, and if it can make the conversion it will do the assignment and return true. if it can't make the assignment it returns false. so all you do is:



int number;
if (!int.TryParse(SomeString, out number))
{
number = 0;
}
callAFunctionOrSomething();




The decompiler I used was called .NET Reflector and you can download it here: http://www.aisto.com/roeder/dotnet/