7.5 Other Important Functions


7.5.1 Issued when a preNMI Occurs u

LeoReset ( ) function

#include <PR/leo.h>

void LeoReset(void);

When a preNMI occurs, the above function should be called as quickly as possible.

If reading or writing is in progress when a preNMI occurs and processing of the block being accessed is terminated, this function terminates the reading or writing so that the subsequent block is not accessed. Because occurrence of an NMI during PI bus use is extremely critical, please be sure to issue a call to LeoReset()at the occurrence of a preNMI, which precedes an NMI.

The function returns the LEO_ERROR_WAITING_NMI error for interrupted commands and for commands that are issued but not executed following LeoReset( ) execution.


7.5.2 Clearing a Reset

LeoResetClear ( ) function

#include <PR/leo.h>

void LeoResetClear(void);

The LeoResetClear() function is used only when a POWERONRESET_DEVICERESET_OCCURED error occurs with the first instance of LeoReadDiskID() in games started from Game Pak ROM. For details, please see "Section 7.1, Initialization Functions."

Use of the LeoResetClear() function in any instances but the above is prohibited. Occurrence of a POWERONRESET_DEVICERESET_OCCURRED error in any other instance is considered a drive abnormality, and the error should be displayed on the screen. For details, please see "Chapter 10, Error-Handling Sequences."


7.5.3 Clearing the Command Queue

LeoClearQueue ( )function

#include <PR/leo.h>

void LeoClearQueue(void);

Clears any commands remaining in the command queue at that time. Commands being executed cannot be canceled. A COMMAND_TERMINATED error is returned for cleared commands. The LeoClearQueue() function itself returns no errors as long as the leo manager has been started.


7.5.4 Restarting

LeoBootGame ( ) function

#include <PR/leo.h>

void LeoBootGame(void *bootaddr);

Performs a restart. For an overview of restarting and details on using this function, see Section 15.1, "Rebooting."


7.5.5 Checking whether a drive is connected

LeoDriveExist ( ) function

#include <PR/leo.h>

u32 LeoDriveExist(void);

Checks whether a drive is connected. Returns 1 if a drive is connected and 0 if not.

The function determines whether a drive is connected by checking whether DDROM is present. Note that, as a result, if the function is used when a development drive is used and no IPLROM cassette is connected, the function will incorrectly determine that there is no drive connected.