RAM initial state...
Posted: Sat Oct 12, 2013 8:00 pm
From XRoar sourcecode:
If I understand this code correctly, than it's simply 4x 0xff then 4x 0x0 in a loop, right?
Is there someone who knowns why this is the initial state of RAM ?
EDIT: I do it just like that now, with: https://github.com/jedie/DragonPy/commi ... 286343R186
But i would like to know why is that so?
Code: Select all
/* Intialise RAM contents */
static void initialise_ram(void) {
int loc = 0, val = 0xff;
/* Don't know why, but RAM seems to start in this state: */
while (loc < 0x10000) {
machine_ram[loc++] = val;
machine_ram[loc++] = val;
machine_ram[loc++] = val;
machine_ram[loc++] = val;
if ((loc & 0xff) != 0)
val ^= 0xff;
}
}
Code: Select all
0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0...
EDIT: I do it just like that now, with: https://github.com/jedie/DragonPy/commi ... 286343R186
But i would like to know why is that so?