Skip to content
LuigiBlood edited this page Feb 4, 2025 · 37 revisions

* Commands (ASIC_CMD) *

If the command ends with 0001, a disk is needed. It's actually ignored by the 64DD, but it's there in libleo.

Notice also that when each command are finished, MECHA_INT is issued.

<< : Send data to register.
>> : Returned data.

Basic Drive Operations

  • No operation
    This command does nothing.
    ASIC_CMD << 0x00000000

  • Seek (Read)
    This command makes the drive seek for a specific track for the specified head for future reads.
    ASIC_DATA << 0xHTTT0000 (Replace TTT with Track number; H with Head number [0-1])
    ASIC_CMD << 0x00010001

  • Seek (Write)
    This command makes the drive seek for a specific track for the specified head for future writes.
    ASIC_DATA << 0xHTTT0000 (Replace TTT with Track number; H with Head number [0-1])
    ASIC_CMD << 0x00020001

  • Recalibration / Rezero (?)
    This command seems to put every thing to zero?
    ASIC_CMD << 0x00030001

  • Sleep
    This command puts the drive to sleep mode (stopped motor and retracted head).
    ASIC_DATA << 0x00000000
    ASIC_CMD << 0x00040000

  • Brake
    This command puts the drive motor on brake (if supported, see Feature Inquiry)
    ASIC_DATA << 0x00010000
    ASIC_CMD << 0x00040000

  • Start
    This command puts the drive to active mode (spinning motor and active head).
    ASIC_CMD << 0x00050001

  • Set Standby Delay
    This command sets the delay from active mode (active head) to standby mode (retracted head).
    ASIC_DATA << 0xEESS0000 (Replace SS with seconds)
    ASIC_CMD << 0x00060000
    If bit0 of EE is 1 then disable Standby Delay.

  • Set Sleep Delay
    This command sets the delay from standby mode (active motor) to sleep mode (motor stops spinning).
    ASIC_DATA << 0xEESS0000 (Replace SS with seconds)
    ASIC_CMD << 0x00070000
    If bit0 of EE is 1 then disable Sleep Delay.

  • Clear Disk Change flag
    This command clears the Disk Change flag in ASIC_STATUS.
    ASIC_CMD << 0x00080000

  • Clear Reset & Disk Change flag
    This command clears the Reset & Disk Change flags in ASIC_STATUS.
    ASIC_CMD << 0x00090000

  • Read ASIC version
    This command can return the ASIC version and another thing.
    ASIC_DATA << 0x00000000
    ASIC_CMD << 0x000A0000
    ASIC_DATA >> 0x01140000 (Value returned on my retail 64DD, value at H8 ROM 0x004C)
    If ASIC_DATA is 0x7XXXXXXX then the drive is a writer drive.
    If ASIC_DATA is 0x1XXXXXXX then the drive is a development drive?
    If ASIC_DATA is 0x0XXXXXXX then the drive is a retail drive?
    Other behavior:
    ASIC_DATA << 0x00010000
    ASIC_CMD << 0x000A0000
    ASIC_DATA >> 0x53000000 (Value returned on my retail 64DD, value at H8 ROM 0x006E)

  • Set Disk Type
    This command tells the drive firmware what disk type it is used currently. This effectively makes the firmware handle which disk zones should be write protected (and therefore is possible to trick the firmware).
    ASIC_DATA << 0x00TT0000 (TT = Disk Type)
    ASIC_CMD << 0x000B0001

  • Request Status
    This command returns an extended error status.
    ASIC_CMD << 0x000C0000
    ASIC_DATA >> 0xSSSS0000 (SSSS = Status)
    Bitmask & Sense Code (libleo):

    • 00010000 Self-Diagnostic Error (DIAGNOSTIC_FAILURE - Error 02)
    • 00020000 Not Good Servo Information Read (NO_REFERENCE_POSITION_FOUND - Error 24)
    • 00040000 Not Good Index Gap (DRIVE_NOT_READY - Error 01)
    • 00080000 Timeout (NO_SEEK_COMPLETE - Error 21)
    • 00100000 Undefined Command (DEVICE_COMMUNICATION_FAILURE - Error 41)
    • 00200000 Invalid Argument / Data (INCOMPATIBLE_MEDIUM - Error 11)
    • Every other bit does DEVICE_COMMUNICATION_FAILURE sense code.
  • Standby
    This command puts the drive to standby mode (spinning motor and retracted head).
    ASIC_CMD << 0x000D0000

  • Index Lock Retry
    This command is used when the drive couldn't physically lock the track to try again.
    ASIC_CMD << 0x000E0001

Real Time Clock

Since there are only 2 digits for the year, libleo assumes the year goes from 1996 to 2095.

  • Set RTC Year/Month Time
    This command sets the Year and Month in the real time clock. If setting a bad BCD value, the value is zeroed out.
    ASIC_DATA << 0xYYMM0000 (YY = Year, MM = Month, BCD)
    ASIC_CMD << 0x000F0000

  • Set RTC Day/Hour Time
    This command sets the Day and Hour in the real time clock. If setting a bad BCD value, the value is zeroed out.
    ASIC_DATA << 0xDDHH0000 (DD = Day, HH = Hour, BCD)
    ASIC_CMD << 0x00100000

  • Set RTC Minute/Second Time
    This command sets the Minutes and Seconds in the real time clock. If setting a bad BCD value, the value is zeroed out.
    THIS MUST BE CALLED LAST to initiate write to the RTC chip.
    ASIC_DATA << 0xMMSS0000 (MM = Minute, SS = Second, BCD)
    ASIC_CMD << 0x00110000

  • Get RTC Year/Month Time
    This command returns the Year and Month from the real time clock.
    ASIC_CMD << 0x00120000
    ASIC_DATA >> 0xYYMM0000 (YY = Year, MM = Month, BCD)

  • Get RTC Day/Hour Time
    This command returns the Day and Hour from the real time clock.
    ASIC_CMD << 0x00130000
    ASIC_DATA >> 0xDDHH0000 (DD = Day, HH = Hour, BCD)

  • Get RTC Minute/Second Time
    This command returns the Minutes and Seconds from the real time clock.
    THIS MUST BE CALLED FIRST to initiate reading info from RTC chip.
    ASIC_CMD << 0x00140000
    ASIC_DATA >> 0xMMSS0000 (MM = Minute, SS = Second, BCD) If bit15 is 1 then there's an error (libleo sense error 05: REAL_TIME_CLOCK_FAILURE).

Other

  • Set LED Timer
    This command sets the way the ACCESS LED blinks.
    ASIC_DATA << 0xIIOO0000 (II = LED-ON Time, OO = LED-OFF Time)
    ASIC_CMD << 0x00150000

  • Read Program Version
    This command returns the drive program version.
    ASIC_CMD << 0x001B0000
    ASIC_DATA >> 0xXXXX0000
    Bitmask of 0xXXXX0000:

    0x00010000 (LEO_MOTOR_BREAK support feature)  
    0x00020000 (unknown feature)
    
  • Read Calibration Data
    This command reads from the 1K EEPROM which seems to contain calibration data.
    ASIC_DATA << 0xOO00000 (OO = Offset)
    ASIC_CMD << 0x001C0000
    ASIC_DATA >> 0xOODD0000 (OO = Offset, DD = Data)

  • Write Calibration Data
    This command writes to the 1K EEPROM which seems to contain calibration data.
    ASIC_DATA << 0xOODD0000 (OO = Offset, DD = Data)
    ASIC_CMD << 0x001D0000
    ASIC_DATA >> 0x00000000

Writer

  • Write Offset Seek
    This command is used for the Writer Drive.
    ASIC_DATA << 0xHTTT0000 (Replace TTT with Track number; H with Head number [0-1])
    ASIC_CMD << 0x00180001

  • Check Offset
    This command is used for the Writer Drive.
    ASIC_DATA << 0x00000000
    ASIC_CMD << 0x00190001

Hidden Commands

Thanks to the dump of the H8 ROM by @ChrisPVille.
To access these hidden commands, one must send LEO! via Command 0x50:
ASIC_DATA << 0x4C450000
ASIC_CMD << 0x00500000
ASIC_DATA << 0x4F210000
ASIC_CMD << 0x00500000

Access Memory

  • Set Memory Address
    You can access anywhere from memory, you set the address here.
    ASIC_DATA << 0xXXXX0000
    ASIC_CMD << 0x00300000

  • Read Byte from Memory Address
    This command is for reading from the memory address set with the command 0x30.
    ASIC_CMD << 0x00310000
    ASIC_DATA >> 0x00XX0000

  • Write Byte to Memory Address
    This command is for write to the memory address set with the command 0x30.
    ASIC_DATA << 0x00XX0000
    ASIC_CMD << 0x00320000

Clone this wiki locally