N64® Functions Menu

al - Audio Library Functions
etc - String Manipulation Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential





LeoCreateLeoManager
LeoCJCreateLeoManager
LeoCACreateLeoManager

Syntax
#include <leo.h>

// To start an N64 Disk Drive game:
s32 LeoCreateLeoManager(OSPri cmdPri,
   OSPri intPri, OSMesg *cmdBuf,
   s32 cmdMsgCnt);

// To start a Japanese Game Pak game:
s32 LeoCJCreateLeoManager(OSPri cmdPri,
   OSPri intPri, OSMesg *cmdBuf,
   s32 cmdMsgCnt);

// To start an American Game Pak game:
s32 LeoCACreateLeoManager(OSPri cmdPri,
   OSPri intPri, OSMesg *cmdBuf,
   s32 cmdMsgCnt);
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 the N64 Disk Drive Programmer's Guide (Section 12: Prohibitions and Cautions) to learn more about this.

Explanation
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 LeoCJCreateLeoManager or LeoCACreateLeoManager to initialize Game Paks that can also use the N64 Disk Drive. 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. Therefore the LeoCreateLeoManager function is for use with games that are used exclusively on disk with the N64 Disk Drive.

A Game Pak can allow disk access, so call LeoCJCreateLeoManager for Japan or LeoCACreateLeoManager for America if you plan to use a Game Pak in concert with the N64 Disk Drive. For a more detailed explanation, see the "Library Functions" section of the N64 Disk Drive Programmer's Guide.

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: When more of these commands than the size specified in cmdMsgCnt are executed together, LEO_ERROR_QUE_FULL is returned and processing stops proceeding normally, so you need to make sure you secure enough room.

After you 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 Programmer's Guide.

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 for each of the three Leo Manager creation functions:
  • LEO_ERROR_GOOD for normal termination
  • LEO_ERROR_DEVICE_COMMUNICATION_FAILURE if there is a problem communicating with N64 Disk Drive. The primary cause is a loose connector.
See Also
Leo
LeoReadWrite
LeoByteToLBA
LeoLBAToByte
LeoSeek
LeoSpdlMotor
LeoInquiry
LeoTestUnitReady
LeoRezero
LeoClearQueue
LeoReadDiskID
LeoReadCapacity
LeoGetKAdr
LeoGetAAdr
LeoGetAAdr2
LeoReset
LeoResetClear
LeoModeSelectAsync
LeoTestUnitReady


Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.

Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated April, 1999