Fix bugged scratchpad reads/writes
* Looking at the console output introduced in the previous commit, it was obvious that it was very wrong. Booting the same BIOS file with PCSX2 reports: Initialize memory (rev:3.17, ctm:393Mhz, cpuclk:295Mhz ) * It turns out that the problem wasn't with the CPU, but the string printing function. The BIOS writes the numbers it calculates to the scratchpad and the print function reads them from there. But there were 2 issues with the current implementation 1. addr & 0x3FFC is ignoring the last 2 bits which makes 8bit writes/reads broken. 2. Always casting to uint32_t* instead of the type provided T* results in byte write overriding whole 32bit sections of the scratchpad, destroying critical data.
Please register or sign in to comment