Message commands for setting TMessage4dd ------------------------------------------------------------------ Command: LEOCMD_GETID Parameters param.hi : pointer to LEODiskID param.lo : media check flag Description: Confirms Disk insertion. If a Disk has not been inserted, the DDSTAT_DIALOGUE bit is set for dd_getStatus()->mode until a Disk is inserted. The application should display an appropriate message. When param.lo is 0, processing continues until insertion of a medium that matches the current Disk ID is confirmed. The current Disk ID is then returned. The initial current Disk ID is that of the Disk that was inserted at booting or of the Disk first inserted. The current ID can be changed using dd_saveID(). If param.lo is 1, the ID of the currently inserted Disk is returned regardless of whether the medium has been replaced. When a Disk is replaced, this flag is set to 0, and the ID of the new Disk is obtained. This ID is then checked and, if there are no problems with the ID, dd_saveID()makes it the current ID. If param.hi is not NULL, the Disk ID is contained in the address to which param.hi points. Command: LEOCMD_LBAREAD Parameters: param.hi : starting LBA for read param.lo : number of blocks to read param.rw : buffer address (should be aligned by 16) Return values param.rw : buffer address (aligned by 16) retVal : size of data read (bytes) Description: Loads the number of blocks indicated by param.lo into the buffer, beginning from the LBA indicated by param.hi. The value of param.rw may change if the buffer is not 16-byte aligned (automatically corrected internally by the function). If execution of the command fails, retVal is 0. If NULL is specified for the buffer address, the default internal buffer is used. param.rw is set to the address of the default buffer, the size of which is READWRITE_BYTESIZE. If a larger size is specified, LEO_ERROR_BUFFER_OVERFLOW is assigned to errno for the Disk thread, and an abnormal termination occurs. The buffer size is not checked when the buffer is specified. Command: LEOCMD_BYTEREAD Parameters param.hi: starting location of read (offset from start of Disk) param.lo: number of bytes to read param.rw: buffer address (16 byte aligned) Return values param.rw: buffer address (16 byte aligned) param.offs: offset to the location of the buffer into which the data are loaded retVal: size of the data actually read ( >= param.lo ) Description: Loads the number of bytes indicated by param.lo into the buffer specified by param.rw, beginning at the location specified by param.hi. This command differs from LEOCMD_LBAREAD only in that param.hi and param.lo are expressed in bytes. The required buffer size can be up to approximately 2 blocks larger than the size specifed in bytes. Note that the specified data are stored beginning at the location specified by param.rw + param.offs. Command: LEOCMD_LBAWRITE Parameters param.hi: starting LBA for write param.lo: number of blocks to write param.rw: buffer address (16 byte aligned) Return values param.rw: buffer address (16 byte aligned) retVal: size of data written (bytes) Description: Writes the number of blocks specified by param.lo from the buffer specified by param.rw to the LBA specifed by param.hi. The required buffer size is up to approximately 2 blocks larger than the specifed size. The buffer must be 16-byte aligned. Command: LEOCMD_BYTEWRITE Not yet implemented. Commands: LEOCMD_ACTIVE LEOCMD_STANDBY LEOCMD_SLEEP LEOCMD_BRAKE Parameters: none Description: Execute LeoSpdlMotor in various modes. Command: LEOCMD_EJECT Parameters: none Description: Ejects the Disk. Until ejection is confirmed, the DDSTAT_DIALOGUE bit is set for dd_getStatus()->mode. The application should display an appropriate message. Command: LEOCMD_GETRTC Return values: param (8 bytes) Description: The value of LEODiskTime is stored using an area that begins at ¶m and whose size is equal to size of (LEODiskTime) as the buffer. The value is obtained by casting ¶m to LEODiskTime *. Command: LEOCMD_SETRTC Parameters param (8 bytes): value of LEODiskTime Description: Sets the RTC to the specified value of LEODiskTime. Command: LEOCMD_SEEK Parameters: param.hi = destination LBA Description: Moves the read head. Command: LEOCMD_REZERO Parameters: none Description: Rezeroes the drive. Command: LEOCMD_TESTUNIT Parameters: none Return values: retval = LEOStatus value | 0x100 Description: Checks the status of the N64 Disk Drive. If command execution fails, retval is 0. Command: LEOCMD_SETMOTORTIME Parameters param.hi: time to shift from Active -> Standby param.lo: time to shift from Standby -> Sleep Description: Sets the length of time delay before going from Active Mode to Standby Mode and Standby Mode to Sleep Mode. Command: LEOCMD_INITIALIZE Description: This command is issued internally in dd_create() when that function is called. It should not be used from the application. Where retVal is not described, -1 is returned with successful execution and 0 with failed execution.