I have a loader for retail&backup gamecube games on a wii, while the actual loader runs in gamecube mode. Currently i can't run Eternal Darkness retail disc, because i get a read error on the startup screen. Then i read that ejecting and reinserting the disc helps, so i tried that and the drive didn't read anything after ejecting the disc once. Then i found this function in the code which i'm not using:
Code: Select all
/** After calling this function, the DVD drive can be reseted (needed for disc change). */
void wii_dvd_reset_unlock(void)
{
volatile unsigned long *pi_cmd = (unsigned long *) 0xCC003024;
volatile unsigned long *ios_magic = (unsigned long *) 0x800030F8;
volatile unsigned long *ios_sync_base = (unsigned long *) 0x800030E0;
volatile unsigned long *phys_ios_magic = (unsigned long *) 0xC00030F8;
debug_printf("wii_dvd_reset_unlock()\n");
/* I assume this will synchronize with Starlet/MIOS. */
*pi_cmd |= 7;
*ios_magic = 0xDEAEBEEF;
DCFlushRange((void *) ios_sync_base, 32);
while(*phys_ios_magic != 0) {
/* I assume this waits for Starlet. */
}
}
Code: Select all
unsigned long ack_cover_interrupt(void)
{
unsigned int val;
val = dvd[0];
//debug_printf("DISR 0x%x\n", val);
dvd[0] = val;
return val;
}
unsigned long get_cover_status(void)
{
unsigned int val;
val = dvd[1];
//debug_printf("DICVR 0x%x\n", val);
dvd[1] = val;
return val & 0x05;
}
void dvd_reset(void)
{
unsigned long v;
debug_printf("dvd_reset()\n");
/* Clear cover interrupt. */
dvd[1] = 2;
v = piio[9];
piio[9] = (v & ~4) | 1;
usleep(1000);
piio[9] = v | 5;
}
// reset the drive
unsigned int cvstatus;
ack_cover_interrupt();
dvd_reset();
/* Wait until reset is finished. */
do {
cvstatus = get_cover_status();
} while ((cvstatus & 0x01) != 0);
Code: Select all
Eternal Darkness ## retail ## drive not allowed to reset ## no reset in the loader
read error on startup screen, ejecting and reinserting disc does nothing
Eternal Darkness ## retail ## drive allowed to reset ## no reset in the loader
read error on startup screen, ejecting and reinserting disc helps to skip this
Eternal Darkness ## retail ## drive allowed to reset ## force reset in the loader
*edit: read error on startup screen, ejecting and reinserting disc helps to skip this
Eternal Darkness ## backup on multi game disc ## drive not allowed to reset ## no reset in the loader
no error on startup screen, ejecting and reinserting disc does nothing
Eternal Darkness ## backup on multi game disc ## drive allowed to reset ## no reset in the loader
read error on startup screen, ejecting and reinserting disc does nothing
Eternal Darkness ## backup on multi game disc ## drive allowed to reset ## force reset in the loader
read error on startup screen, ejecting and reinserting disc does nothing
Maybe this is important as well, i call this function too, and it returns true for this game.
Code: Select all
bool dvd_set_streaming(void)
{
u8 dvdheader[0x20];
memcpy(dvdheader,(void*)0x80000000,0x20);
if (dvdheader[8] == 0x01)
{
dvd[0] = 0x2E;
dvd[2] = 0xE4010000;
dvd[7] = 1;
while (dvd[7] & 1);
return true;
}
else
{
dvd[0] = 0x2E;
dvd[2] = 0xE4000000;
dvd[7] = 1;
while (dvd[7] & 1);
return false;
}
}