MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / DVDCheckDisk

Function DVDCheckDisk

src/dolphin/src/dvd/dvd.c:1484–1556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1482}
1483
1484BOOL DVDCheckDisk(void)
1485{
1486 BOOL enabled;
1487 s32 retVal;
1488 s32 state;
1489 u32 coverReg;
1490
1491 enabled = OSDisableInterrupts();
1492
1493 if (FatalErrorFlag)
1494 {
1495 state = -1;
1496 }
1497 else if (PausingFlag)
1498 {
1499 state = 8;
1500 }
1501 else
1502 {
1503 if (executing == (DVDCommandBlock*)NULL)
1504 {
1505 state = 0;
1506 }
1507 else if (executing == &DummyCommandBlock)
1508 {
1509 state = 0;
1510 }
1511 else
1512 {
1513 state = executing->state;
1514 }
1515 }
1516
1517 switch (state)
1518 {
1519 case 1:
1520 case 9:
1521 case 10:
1522 case 2:
1523 retVal = TRUE;
1524 break;
1525
1526 case -1:
1527 case 11:
1528 case 7:
1529 case 3:
1530 case 4:
1531 case 5:
1532 case 6:
1533 retVal = FALSE;
1534 break;
1535
1536 case 0:
1537 case 8:
1538 coverReg = __DIRegs[1];
1539 if (((coverReg >> 2) & 1) || (coverReg & 1))
1540 {
1541 retVal = FALSE;

Callers 5

ReadApploaderFunction · 0.85
CheckResetButtonMethod · 0.85
IsDiskIDedMethod · 0.85
SetDVDStateMethod · 0.85
CheckDVDAndResetStateMethod · 0.85

Calls 1

OSDisableInterruptsFunction · 0.85

Tested by

no test coverage detected