Load XPRAM default values if signature not found. i.e. don't hang on first

boot.
This commit is contained in:
gbeauche 2004-04-06 19:47:56 +00:00
parent 689d017cbd
commit ec2511fd99

View File

@ -638,6 +638,36 @@ int main(int argc, char **argv)
// Load NVRAM
XPRAMInit();
// Load XPRAM default values if signature not found
if (XPRAM[0x130c] != 0x4e || XPRAM[0x130d] != 0x75
|| XPRAM[0x130e] != 0x4d || XPRAM[0x130f] != 0x63) {
D(bug("Loading XPRAM default values\n"));
memset(XPRAM + 0x1300, 0, 0x100);
XPRAM[0x130c] = 0x4e; // "NuMc" signature
XPRAM[0x130d] = 0x75;
XPRAM[0x130e] = 0x4d;
XPRAM[0x130f] = 0x63;
XPRAM[0x1301] = 0x80; // InternalWaitFlags = DynWait (don't wait for SCSI devices upon bootup)
XPRAM[0x1310] = 0xa8; // Standard PRAM values
XPRAM[0x1311] = 0x00;
XPRAM[0x1312] = 0x00;
XPRAM[0x1313] = 0x22;
XPRAM[0x1314] = 0xcc;
XPRAM[0x1315] = 0x0a;
XPRAM[0x1316] = 0xcc;
XPRAM[0x1317] = 0x0a;
XPRAM[0x131c] = 0x00;
XPRAM[0x131d] = 0x02;
XPRAM[0x131e] = 0x63;
XPRAM[0x131f] = 0x00;
XPRAM[0x1308] = 0x13;
XPRAM[0x1309] = 0x88;
XPRAM[0x130a] = 0x00;
XPRAM[0x130b] = 0xcc;
XPRAM[0x1376] = 0x00; // OSDefault = MacOS
XPRAM[0x1377] = 0x01;
}
// Set boot volume
i16 = PrefsFindInt32("bootdrive");
XPRAM[0x1378] = i16 >> 8;