N64ddCommands

From EurAsiaWiki

Jump to: navigation, search

Spoondiddly @ http://www.dextrose-forum.com/_forum/showthread.php?t=11695



  This document is based off what little I could glean from the 64DD BIOS,
existing code and annotations in expansion-pak enabled cartridges,
 and some basic eye-and-ear sort of work.  With any luck, it may prove useful.

  64DD file system is internally called LEO.  All commands start with a common 8 byte header.
LBA ROM mirrors LBA RAM, and each is divided into 7 segments.  LBA appears to range from 0 to 0x10C4.


command header format:
CM00CN00 STCD0000	message follows
CM	command #
CN	control bitflags
ST	status
CD	condition codes

control bitflags:
80	enable post queue
01	start command, set when determining writable filesize and when translating to LBA
02	standby mode

drive state:
01	no disk
02	head retracted
04	spindle stopped

status:
00	no error
02	check condition
08	busy

error conditions:
00	no error
01	drive not ready
02	diagnostic failure
03	command error
04	data error
05	clock failure
0B	disk unreadable
15	seek error
16	write error
17	read error
18	lookup error
19	track or spindle failure
1F	invalid opcode
20	LBA out-of-range
21	write-protection encountered
22	command terminated
23	queue full
24	bad timer value
29	device not found
2A	no disk present
2B	drive reset
2D	disk not booted
2E	disk not swapped
2F	disk swapped
30	IPL: clock not set correctly
31	disk ejected illegally
32	IPL: reset - diagnostic failure
33	IPL: reset - ejected illegally


These are names found internally in debug messages, so they may have come from source
LEOCmdClearQue		01 clear queue command
	0x0	8	header

LEOCmdInquiry		02 version inquiry command
	0x0	8	header
	0x8	1	device type
	0x9	1	version
	0xA	1	device number
	0xB	1	BIOS version
	0xC	4	RESERVED

LEOCmdTestUnitReady	03 test if unit ready command
	0x0	8	header
	0x8	1	test
	0x9	3	RESERVED

LEOCmdRezero		04 reinitialize command
	0x0	8	header

LEOCmdRead		05 read command
	0x0	8	header
	0x8	4	LBA
	0xC	4	transfer blocks
	0x10	4	p->buffer
	0x14	4	# raw bytes

LEOCmdWrite		06 write command
	0x0	8	header
	0x8	4	LBA
	0xC	4	transfer blocks
	0x10	4	p->buffer
	0x14	4	# raw bytes

LEOCmdSeek		07 seek command
	0x0	8	header
	0x8	4	LBA

LEOCmdStartStop		08 start/stop drive command
	0x0	8	header

LEOCmdReadCapacity	09 read disk capacity
	0x0	8	header
	0x8	4	LBA start
	0xC	4	LBA end
	0x10	4	capacity in bytes

LEOCmdTranslate		0A translate LBA command
	0x0	8	header
	0x8	4	LBA start
	0xC	4	in
	0x10	4	out

LEOCmdModeSelect	0B mode select command
	0x0	8	header
	0x8	1	page
	0x9	1	RESERVED
	0xA	1	standby time
	0xB	1	sleep time
	0xC	1	LED on time
	0xD	1	LED off time
	0xE	2	RESERVED

LEOCmdReadDiskId	0C pull disk ID command
	0x0	8	header
	0x8	4	p->target

LEOCmdReadTimer		0D read timer command
	0x0	8	header
	0x8	2	RESERVED
	0xA	1	year
	0xB	1	month
	0xC	1	day
	0xD	1	hour
	0xE	1	minute
	0xF	1	second

LEOCmdWriteTimer		0E write timer command
	0x0	8	header
	0x8	2	RESERVED
	0xA	1	year
	0xB	1	month
	0xC	1	day
	0xD	1	hour
	0xE	1	minute
	0xF	1	second

+_+

Miscellaneous:

Disk version info:
0x0	4	game ID, typically D--R or E--R, meaning 'disk' or 'expansion', 2 letter name, region
0x4	1	version
0x5	1	disk number
0x6	2	usage
0x8	8	serial line number
0x10	1	RESERVED
0x11	2	year
0x13	1	month
0x14	1	day
0x15	1	hour
0x16	1	minute
0x17	1	second
0x18	2	company code
0x1A	6	RESERVED

drive state:
0	drive active
1	drive standby
2	drive sleep

Personal tools