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
|
|
LeoModeSelectAsync
Syntax
#include <leo.h>
s32 LeoModeSelectAsync (LEOCmd *cmdBlock,
u32 standby, u32 sleep,
OSMesgQueue *mq);
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 see the "Programming Cautions" section of the N64 Disk Drive Programmer's Guide for more information about this.
Explanation
It provides a way to alter the wait-time specified for changes between the active, standby, and sleep modes to meet the needs of the game.
The N64 Disk Drive has the following three modes concerning the motor and the head:
Mode State of Motor State of Head
Active mode Spinning Not parked
Standby mode Spinning Parked
Sleep mode Stopped Parked
With the drive in active mode, if one of the mode-changing functions is not issued within a certain time (the default is 3 seconds), then the state automatically changes to standby mode in order to conserve power and protect the drive. Similarly, the state automatically changes from standby mode to sleep mode if a function is not issued within a default time of 1 second. (The functions LeoReadWrite, LeoSeek, LeoRezero, and LeoReadDiskID change the state to active mode upon execution, while LepSpdlMotor forces the change when issued.)
You can use the LeoModeSelectAsync function to alter the wait-time specified for changes between active, standby, and sleep modes to meet the needs of the game. As already mentioned, the defaults are 3 seconds and 1 second, but both times can be modified in 1 second intervals to specify a time of anywhere from 0 seconds to 10 seconds. To modify the times, call the function and specify in the standby argument the number of seconds to wait before going from active mode to standby mode, and specify in the sleep argument the number of seconds to wait before going from standby mode to sleep mode.
Caution
If the revised wait time is set to a long period, you could shorten the service life of the user�s N64 Disk Drive. Please use the default times if possible. There is no problem if you want to set the wait times shorter than the defaults. This function is related to internal processes, so call it only once at the time in your game when you make the initial settings.
Nothing needs to be set for the command block specified by the cmdBlock argument. When this function's processing finishes, an error code is returned to the mq queue. An error could arise, so the programmer needs to check this error code. For more information about the errors that may be returned, their causes and ways to deal with them, see the "Error-Handling Sequences" section of the N64 Disk Drive Programmer's Guide. The return value is -1 if Leo Manager has not been created, and 0 if it has.
Example
LEOCmd cmdBlock;
u32 error;
...
LeoModeSelectAsync (&cmdBlock, 4, 1, &diskQ);
osRecvMesg (&diskQ, (OSMesg *) &error,
OS_MESG_BLOCK);
See Also
Leo
LeoCreateLeoManager
LeoSpdlMotor
|
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
|
|