Skip to content
Snippets Groups Projects
Commit eeaafcc0 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard
Browse files

Added automatic CMOS RAM checksum calculation.

parent 382e2024
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ static BYTE cmosimage[64] =
0x40, 0xb1, 0x00, 0x9c, 0x01, 0x80, 0x02, 0x00,
0x1c, 0x00, 0x00, 0xad, 0x02, 0x10, 0x00, 0x00,
0x08, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x58,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x19,
0x00, 0x1c, 0x19, 0x81, 0x00, 0x0e, 0x00, 0x80,
0x1b, 0x7b, 0x21, 0x00, 0x00, 0x00, 0x05, 0x5f
};
......@@ -52,6 +52,18 @@ static char port_permissions[0x10000];
#endif /* DIRECT_IO_ACCESS */
static void IO_FixCMOSCheckSum()
{
WORD sum = 0;
int i;
for (i=0x10; i < 0x2d; i++)
sum += cmosimage[i];
cmosimage[0x2e] = sum >> 8; /* yes, this IS hi byte !! */
cmosimage[0x2f] = sum & 0xff;
TRACE(int, "calculated hi %02x, lo %02x\n", cmosimage[0x2e], cmosimage[0x2f]);
}
/**********************************************************************
* IO_port_init
*/
......@@ -188,6 +200,7 @@ void IO_port_init()
do_IO_port_init_read_or_write(temp, IO_WRITE);
}
#endif /* DIRECT_IO_ACCESS */
IO_FixCMOSCheckSum();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment