How To Get The Error Type; Code 1: Pseudo-Code For Error-Handling - Nintendo GameCube Manuallines

Hide thumbs Also See for GameCube:
Table of Contents

Advertisement

3.4 How to Get the Error Type

This section explains how to get the error type in applications.
The error type shows the device driver's status. The device driver status can be obtained by calling
the function DVDGetDriveStatus.
Note:
As mentioned in Section 3.2
when commands cannot be processed properly. So, no errors will occur if no commands have
been executed. For example, even if the Disc Cover is opened, the function
DVDGetDriveStatus will not return DVD_STATE_COVER_OPEN (described below) if there
is no command being executed. The functions DVDGetFileInfoStatus and
DVDGetCommandBlockStatus behave in the same manner.
The following list indicates states the function will return when an error has occurred.
-
DVD_STATE_COVER_OPEN
-
DVD_STATE_NO_DISK
-
DVD_STATE_WRONG_DISK
-
DVD_STATE_RETRY
-
DVD_STATE_FATAL_ERROR
There are other states that can be returned from the function DVDGetDriveStatus(). They are not
mentioned here because they do not indicate errors, and this document focuses on error handling.
Refer to the Nintendo GameCube
Note: For a game that has multiple Game Discs, DVD_STATE_MOTOR_STOPPED is returned when
Game Discs are exchanged. See Section 4
Below is pseudo-code for handling errors. See "errorhandling.c" in Patch 2, dated 5/22/01, or later of
the Nintendo GameCubeTM Software Development Kit for an operational demo.
DVDReadAsync();
do{
status = DVDGetDriveStatus();
switch (status){
case DVD_STATE_COVER_OPEN:
show_message_for_cover_open_on_screen();
break;
case DVD_STATE_NO_DISK:
show_message_for_no_disk_on_screen();
break;
case DVD_STATE_WRONG_DISK:
show_message_for_wrong_disk_on_screen();
break;
case DVD_STATE_RETRY:
show_message_for_retry_on_screen();
break;
case DVD_STATE_FATAL_ERROR:
show_message_for_fatal_error_on_screen();
break;
}
} while (status != DVD_STATE_END) && (status != DVD_STATE_FATAL_ERROR);

Code 1: Pseudo-code for Error-handling

In order to display an appropriate error message when a problem occurs, this routine calls the function
DVDGetDriveStatus every frame and polls the state.
The APIs that access the optical disc drive only return when processing is completed or if a fatal error
occurs. "Return" here means that callback is called (callback is specified with an asynchronous
function), or API ends processing and returns a value (with a synchronous function).
You can also use the function DVDGetFileInfoStatus or DVDGetCommandBlockStatus to get
the error state. These return the states of the designated file info and command block. The function
DVDGetDriveStatus returns the state of the currently executing request.
© 2001-2002 Nintendo of America Inc.
"Error Types that Developers Need to
TM
Function Reference Manual for details on other states.
"Games with Multiple Game
7
Optical Disc Drive Guidelines
Resolve", errors only occur
Discs" for details.
DOL-06-0026-001-A5
Released: 4/18/02

Advertisement

Table of Contents
loading

Table of Contents