public function initMemory()
{
//Initialize the RAM:
$this->memory = $this->getTypedArray(0x10000, 0, 'uint8');
$this->frameBuffer = $this->getTypedArray(23040, 0xffffff, 'int32');
$this->gbPalette = $this->arrayPad(12, 0);
//32-bit signed
$this->gbColorizedPalette = $this->arrayPad(12, 0);
//32-bit signed
$this->gbcRawPalette = $this->arrayPad(0x80, -1000);
//32-bit signed
$this->gbcPalette = [0x40];
//32-bit signed
//Initialize the GBC Palette:
$address = 0x3f;
while ($address >= 0) {
$this->gbcPalette[$address] = $address < 0x20 ? -1 : 0;
--$address;
}
}