diff --git a/source/ngc/fceugx.c b/source/ngc/fceugx.c index 6999a9b..b4246bc 100644 --- a/source/ngc/fceugx.c +++ b/source/ngc/fceugx.c @@ -93,6 +93,30 @@ void SyncSpeed() FrameTimer--; } +/**************************************************************************** + * ipl_set_config + * lowlevel Qoob Modchip disable + ***************************************************************************/ + +void ipl_set_config(unsigned char c) +{ + volatile unsigned long* exi = (volatile unsigned long*)0xCC006800; + unsigned long val,addr; + addr=0xc0000000; + val = c << 24; + exi[0] = ((((exi[0]) & 0x405) | 256) | 48); //select IPL + //write addr of IPL + exi[0 * 5 + 4] = addr; + exi[0 * 5 + 3] = ((4 - 1) << 4) | (1 << 2) | 1; + while (exi[0 * 5 + 3] & 1); + //write the ipl we want to send + exi[0 * 5 + 4] = val; + exi[0 * 5 + 3] = ((4 - 1) << 4) | (1 << 2) | 1; + while (exi[0 * 5 + 3] & 1); + + exi[0] &= 0x405; //deselect IPL +} + /**************************************************************************** * main * This is where it all happens! @@ -100,6 +124,9 @@ void SyncSpeed() int main(int argc, char *argv[]) { +#ifdef HW_DOL + ipl_set_config(6); // disable Qoob modchip +#endif #ifdef WII_DVD DI_Init(); // first