This commit is contained in:
kudzu_cp 2008-02-06 16:42:43 +00:00
parent c45f83141c
commit ff695a9202
3 changed files with 33 additions and 19 deletions

View file

@ -34,6 +34,32 @@ namespace KudzuTest {
Console.WriteLine("Dictionary test");
//Console.WriteLine(" " + Tests.Dictionary());
Console.WriteLine();
Console.WriteLine("Concat conversion test");
Console.WriteLine(" " + Tests.ConcatConversion());
//Console.WriteLine(" " + Tests.ConcatConversion2());
//Console.WriteLine(" " + Tests.ConcatConversion3());
Console.WriteLine();
}
//Fail - Returns in hex, and also wrong value
static public object ConcatConversion() {
int x = 1000;
return x + " Euros, but should be 1000. Not even correct by value";
}
//Fail - Crashes
static public object ConcatConversion2() {
UInt32 y = 100;
UInt32 z = 100;
return y + "-" + z;
}
//Fail - crashes...
static public object ConcatConversion3() {
UInt32 y = 100;
UInt32 z = 100;
return y.ToString() + "-" + z.ToString();
}
//Fail - IL2CPU error on compile

View file

@ -23,34 +23,20 @@ namespace Cosmos.Hardware.PC.Bus {
UInt32 xDeviceID = xUInt32 >> 16;
if (xVendorID != 0xFFFF) {
string xVendor = xDeviceIDs.FindVendor(xVendorID);
//string xVendorName = null;
if (xVendor == null) {
// xVendorName = xVendorID.ToString();
xVendor = xVendorID.ToString();
}
//Console.Write("Location: ");
Console.Write(xBus.ToString());
Console.Write("-");
Console.Write(xSlot.ToString());
Console.Write("-");
Console.Write(xFunction.ToString());
if(xVendor != null)
{
Console.Write("(");
Console.Write(xVendor);
Console.Write(")");
}
Console.Write(" ");
Console.Write(xVendor);
Console.Write(": ");
Console.Write(xDeviceID.ToString());
Console.Write("UInt32: ");
Console.WriteLine(xUInt32.ToString());
//Console.Write("Vendor: ");
//Console.WriteLine(xVendorName);
//Console.Write("Device: ");
//Console.WriteLine(xDeviceID.ToString());
//Console.WriteLine();
Console.WriteLine();
}
}
}

View file

@ -33,6 +33,8 @@ namespace Cosmos.Hardware.Bus {
public DeviceIDs() {
mVendors.Add(0x8086, "Intel");
mVendors.Add(0x1013, "Cirrus Logic");
mVendors.Add(0x10EC, "Realtek Semiconductor Co., Ltd.");
}
public string FindVendor(UInt32 aVendorID) {