No I understand that Saroo is 4MB by default and all I need to do is check for the 4MB or RAM. If the RAM isn't found then configure for a RAM cartridge. If I want the Sega RAM cartridge to work for the Saroo, its got to be setup saroo side. Config set to 4MB and if required the code bypass for the A-Bus timings to stop them being set. The Saroo has all the support you need you just have to set it up first.So tl;dr, it's patching the game to change it's A-Bus settings, as I already told you. You can even dig further into Saroo's firmware and see they modified the BIOS to call their patching when a CD is used, because if they didn't running the game from a CD would also have these issues. So your AI is now mostly agreeing with me.
And no, setting the 4MB option in the Saroo config doesn't resolve this, the patch to change the A-Bus settings is still needed. Don't believe me? Change the product ID in IP.BIN for a game like Vampire Savior and then boot it with the Saroo set to 4MB mode. It's still going to be a glitchy mess because the A-Bus setting patch wont get applied.
Want to try and setup the Saroo so the demo works?
I've written the patch in the X-Men style without touching
out.iso: the Saroo applies it in RAM when the demo boots. I haven't tested it on the Saroo.It's simpler than the X-Men patch. The demo is a single program with no loaded modules, so it needs no loader hooks or jump handlers. Like
xmvsf_handle2, it turns each instruction that writes the RAM-cart setup into a nop (0x0009) inside dram_cart_init:| Address | Original | Writes |
|---|---|---|
0x0600471A | 2121 | 0x257EFFFE = 1 (cart enable) |
0x06004724 | 2212 | ASR0 = 0x23301FF0 (A-Bus timing) |
0x0600472C | 2212 | AREF = 0x13 (refresh) |
0x0600474E | 2192 | ASR0 restore (only if detection fails) |
0x06004752 | 2182 | AREF restore (only if detection fails) |
EXRAMTEST V1.000 from out.iso without changing it. None of the five instructions sits in a branch delay slot, so replacing them is safe. The ID check and bank test run as before, and the Saroo answers 5C with 4 MB.Option 1: /SAROO/saroocfg.txt, no firmware rebuild. Four-digit
M_ values are 16-bit writes, applied at boot once the program is in RAM.# 4MBRAM Test - skip the official RAM cart bus setup
[EXRAMTEST V1.000]
exmem_4M
M_0600471A=0009
M_06004724=0009
M_0600472C=0009
M_0600474E=0009
M_06004752=0009
Option 2: Firm_Saturn/game_patch.c, needs a firmware rebuild.
/**********************************************************/
// 4MBRAM Test (EXRAMTEST V1.000)
// 0x060047EC: 23301ff0
void exramtest_patch(void)
{
ssctrl_set(MASK_EXMEM, CS0_RAM4M); // the default, made explicit
*(u16*)(0x0600471A) = 0x0009; // 0x257EFFFE = 1 (cart enable)
*(u16*)(0x06004724) = 0x0009; // ASR0 = 0x23301FF0
*(u16*)(0x0600472C) = 0x0009; // AREF = 0x13
*(u16*)(0x0600474E) = 0x0009; // ASR0 restore (failure path)
*(u16*)(0x06004752) = 0x0009; // AREF restore (failure path)
}
plus
{"EXRAMTEST", "EXRAMTEST", exramtest_patch}, in game_dbs[].