LeoCACreateLeoManager LeoCACreateLeoManager (function)

LeoCreateLeoManager, LeoCJCreateLeoManager, LeoCACreateLeoManager

Creates Leo Manager

Syntax

#include <PR/leo.h> /* leo.h */

(Disk startup game)

s32 LeoCreateLeoManager(OSPri cmdPri, OSPri intPri, 
OSMesg *cmdBuf, s32 cmdMsgCnt);

(Game Pak game for Japan)

s32 LeoCJCreateLeoManager(OSPri cmdPri, OSPri intPri, 
OSMesg *cmdBuf, s32 cmdMsgCnt);

(Game Pak game for United States)

s32 LeoCACreateLeoManager(OSPri cmdPri, OSPri intPri, 
OSMesg *cmdBuf, s32 cmdMsgCnt);

Description

Note: None of the N64 Disk Drive-related instructions involve ROM DMA (including DMA to ROM in the drive). In fact, the instructions are designed on the assumption that ROM DMA will not be carried out. Please refer to "Section 12: Prohibitions and Cautions" in the N64 Disk Drive Programming Manual to learn more about this.

They create and start the device driver called Leo Manager, which must be started up before any other N64 Disk Drive-related function is called. Leo Manager comprises two Leo Manager system threads: the command thread and the interrupt thread. The command thread accepts and executes commands coming from the application side, while the interrupt thread performs internal interrupt handling. The priority level of these two functions on the call side are specified with cmdPri and intPri, respectively. For the convenience of internal processing, please specify intPri as OS_PRIORITY_LEOMGR (defined with leo.h, giving it the same priority level as PI Manager) and specify cmdPri with a slightly lower priority level.

Call LeoCreateLeoManager to initialize disk startup games. Call LeoC*CreateLeoManagerto initialize Game Paks. Use LeoCJCreateLeoManager for Japanese Game Paks and LeoCACreateLeoManager for American Game Paks. (Functions for other countries will be released later.) A "disk startup game" is a game that can make use of disks only; they cannot be used in combination with a Game Pak while a "game pak startup game" can allow disk access from Game Pak. For more details, see the "7.7 Disk Startup and Game Pak Startup" section in the N64 Disk Drive Programming Manual.

The cmdBuf and cmdMsgCnt arguments specify the buffer pointer and the size of Leo Manager's received command queue. The received command queue is used when the following functions are executed:

LeoReadWrite
LeoSeek
LeoSpdlMotor
LeoTestUnitReady
LeoReadDiskID
LeoReadRTC
LeoSetRTC
LeoModeSelectAsync

When more of these commands than the size specified in cmdMsgCnt are issued together, LEO_ERROR_QUE_FULL is returned and processing stops proceeding normally, so you need to make sure you secure enough room.

Note: After using Leo*CreateLeoManager to create Leo Manager, immediately call the LeoReadDiskID) function to determine (in the case of a disk startup game) whether the disk inserted at the time is equivalent to the disk in the IPL, or (in the case of a Game Pak game) whether the ID has been read and stored in RDRAM. For more information, see the "Error-Handling Sequences" section of the N64 Disk Drive Programming Manual.

You can clear the commands held in the received command queue by calling the LeoClearQueue function. Cleared commands are returned as a LEO_COMMAND_TERMINATED error.

The following values are returned from Leo*CreateLeoManager functions:

LEO_ERROR_GOOD

Normal termination

LEO_ERROR_DEVICE_COMMUNICATION_FAILURE

There is a problem communicating with N64 Disk Drive. The primary cause is a loose connector.

See Also

LeoReadWrite, LeoReadDiskID, LeoSpdlMotor, LeoSeek, LeoByteToLBA, LeoLBAToByte, LeoReset, LeoResetClear, LeoGetKAdr, LeoGetAAdr, LeoGetAAdr2, LeoModeSelectAsync, LeoTestUnitReady, LeoRezero, LeoClearQueue, LeoReadCapacity, and LeoInquiry

Revision History

04/30/1999 Changed Format