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

Function cbForStateGettingError

src/dolphin/src/dvd/dvd.c:274–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274static void cbForStateGettingError(u32 intType)
275{
276 u32 error;
277 u32 status;
278 u32 errorCategory;
279 u32 resume;
280
281 if (intType == 16)
282 {
283 executing->state = -1;
284 stateTimeout();
285 return;
286 }
287
288 if (intType & 2)
289 {
290 executing->state = -1;
291 stateError(0x1234567);
292 return;
293 }
294
295 error = __DIRegs[8];
296 status = error & 0xff000000;
297
298 errorCategory = CategorizeError(error);
299
300 if (errorCategory == 1)
301 {
302 executing->state = -1;
303 stateError(error);
304 return;
305 }
306
307 if ((errorCategory == 2) || (errorCategory == 3))
308 {
309 resume = 0;
310 }
311 else
312 {
313 if (status == 0x01000000)
314 resume = 4;
315 else if (status == 0x02000000)
316 resume = 6;
317 else if (status == 0x03000000)
318 resume = 3;
319 else
320 resume = 5;
321 }
322
323 if (CheckCancel(resume))
324 return;
325
326 if (errorCategory == 2)
327 {
328 __DVDStoreErrorCode(error);
329 stateGoToRetry();
330 return;
331 }

Callers

nothing calls this directly

Calls 9

stateTimeoutFunction · 0.85
stateErrorFunction · 0.85
CategorizeErrorFunction · 0.85
CheckCancelFunction · 0.85
__DVDStoreErrorCodeFunction · 0.85
stateGoToRetryFunction · 0.85
DVDLowSeekFunction · 0.85
stateMotorStoppedFunction · 0.85
stateCoverClosedFunction · 0.85

Tested by

no test coverage detected