Page 1 of 1

PSY-Q library initialization sequence

Posted: November 29th, 2018, 8:58 am
by lamb_of_senpai
I can't seem to find a clear answer from the documentation in what order the various libraries should be initialized. It doesn't seem to *really* matter, although in the libmcx section of the library overview it does mention that libmcx's interrupts can interfere with libcard or libmcrd if they're not initialized in a particular order.

I noticed this as I was implementing libds, where calling DsInit() resets the SPU (same thing happens with CdInit). So when running in mednafen or epsxe with the bios intro turned on, it leads to the last bit of the playstation boot sound looping infinitely, since it is evidently trapped in the buffer and doesn't know it's still playing (i think... i suppose it could something to do with the reverb). So it got me wondering if there's a proper boot sequence to follow, since none of the games I run in the same emulators have this issue, so they must be doing something different.

The documentation does say to only call SpuInit() after DsInit(), but I see no mention anywhere of any callbacks you should to wait for before initializing libraries, and I can't seem to find an example with a really complete init sequence.

Re: PSY-Q library initialization sequence

Posted: November 29th, 2018, 6:08 pm
by Shadow
The Memory Card libs need to be initialised in a particular order because I think it trashes the interrupt vector table if you get it wrong. You must also de-init them in the reverse order the same way you initialised them or you will trash the interrupt vector.