N64® Functions Menu

al - Audio Library 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

   

LeoRezero

Format
#include <leo.h>

s32 LeoRezero (LEOCmd *cmdBlock,
   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. To learn more about this, please see the "Programming Cautions" section of the N64 Disk Drive Programmer's Guide.

What This Function Does
It issues the recalibration command to the N64 Disk Drive. That is, it initializes the various settings of the internal registers and moves the head to LBA0. This function is usually not needed. To simply seek LBA0, it is faster to use the LeoSeek function.

Nothing needs to be set for the command block specified by the cmdBlock argument. When the processing for this function ends, an error code is returned to the location pointed to by the mq argument. An error could arise, so the programmer needs to check this error code. Following are some possible errors to be returned, their causes, and the actions that should be taken:
  • LEO_ERROR_QUEUE_FULL - There is no more space in the command queue. The queue size should be enlarged. See the LeoCreateLeoManager function for details.
  • LEO_ERROR_COMMAND_TERMINATED - The LeoClearQueue or LeoReset function was issued, so this function (LeoRezero) was not executed.
  • LEO_ERROR_DEVICE_COMMUNICATION_FAILURE - The main reason for this error is a bad physical connection. However, there is a possibility that the drive itself is not functioning.
  • LEO_ERROR_COMMAND_PHASE_ERROR - This error occurs when the N64 Disk Drive status is not good.
  • LEO_ERROR_POWERONRESET_DIVICERESET_OCCURED - This error appears when the drive is reset. The possible cause is the connector was reconnected after coming loose. As a result, subsequent N64 Disk Drive actions are unstable. Advise the users to have it reset.
  • LEO_ERROR_MEDIUM_NOT_PRESENT - The disk has not been inserted.
  • LEO_ERROR_MEDIUM_MAY_HAVE_CHANGED - A disk was reinserted after being removed. There is no certainty that the game should continue using the newly inserted disk. if this error occurs, call LeoReadDiskID to verify the identity of the newly inserted disk.
  • LEO_ERROR_INCOMPATIBLE_MEDIUM_INSTALLED - This error occurs when a disk of an unsupported type is inserted. This error is rarely encountered.
  • LEO_ERROR_LBA_OUT_OF_RANGE - The specified LBA is out of range. All LBAs fall between 0 and 4291.
  • LEO_ERROR_WRITE_PROTECTED (Write only) - The LBA that was the intended write target cannot be written to because it is in the unwritable area (the ROM area).
  • LEO_ERROR_DRIVE_NOT_READY - This error occurs when the disk is not operating or when it is not stable.
  • LEO_ERROR_NO_REFERENCE_POSITION_FOUND - This error occurs when the servo data cannot be read or when an abnormality is found.
  • LEO_ERROR_DIAGNOSTIC_FAILURE - This error occurs when an abnormality is found on the drive or when it cannot be traced.
  • LEO_ERROR_NO_SEEK_COMPLETE - This error occurs when seeking cannot be done due to a seek time out or trace time out.
  • LEO_ERROR_DATA_PHASE_ERROR - This error occurs when data transmission did not finish in the allotted time.
  • LEO_ERROR_DIAGNOSTIC_FAILURE - This error occurs when the data could not be read clearly because of a flaw on the disk.
  • LEO_ERROR_WRITE_FAULT (Write only) - This error occurs when an abnormality is detected while writing.
  • LEO_ERROR_TRACK_FOLLOWING_ERROR - This error occurs when the head slips off the track while reading.
For more information about the possible errors, their causes, and ways to deal with them, please see the "Error-Handling" 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. Usually no check is necessary.

Example
LEOCmd cmdBlock ;
u32 error ;
�..
LeoRezero (&cmdBlock, &diskQ) ;
osRecvMesg (&diskQ, (OSMesg *)&error,
   OS_MESG_BLOCK) ;
See Also
Leo
LeoCreateLeoManager
LeoReadWrite
LeoSeek
LeoSpdlMotor
LeoByteToLBA
LeoLBAToByte
LeoInquiry
LeoTestUnitReady
LeoClearQueue
LeoReadCapacity



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 January 1998