2.4 Errors

In the very simple examples given in sections 2.2 and 2.3, it was assumed that reading from the disk always terminated normally. In reality, however, errors in disk access must be considered. What are called errors here are broadly divided into the following two types.

  1. Errors caused by the user after ejecting the disk.
  2. Errors occurring with hardware defects such as disk deterioration.

The second type of error, that resulting from hardware failure, occurs rarely. However, routines must be provided for handling such errors. Routines for handling the first type of error are of course also necessary. There also are cases in which errors can be anticipated. With games that come in two-disk sets, for example, the user is prompted to exchange disks. This is accomplished with error messages such as "disk does not exist" to indicate whether the user ejected the disk and "disk reinserted" to confirm whether the user reinserted the disk.

For more information on sequences recommended by Nintendo for error-handling, please see "Chapter 10, Error-Handling Sequences." The sample program ddspgame also is described in this section. Please use this description as a reference in determining how best to handle errors.