Difference between revisions of "IPC (phatd-51d) protocol"

From PhatHack Wiki
Jump to navigation Jump to search
 
Line 31: Line 31:
 
expect: arg1=0x64, arg3=num_disks
 
expect: arg1=0x64, arg3=num_disks
 
req num tracks:
 
req num tracks:
set: op_code=0x2, arg3=num_tracks
+
set: op_code=0x2, arg3=disk_num
 
expect: arg4=num_tracks
 
expect: arg4=num_tracks
   

Revision as of 23:27, 2 January 2006

NOTE: Preliminary info, will update as I get more

51d -> phatd

special initial packet:
long op_code = 0x20;
long arg1 = 0;
long arg2 = PID + 1000;

followed by 

packet structure (0x218 bytes)
long op_code; (0x0 offset)
long arg1; (0x4 offset) usually 0x64 from phatd so far (signature for a reply?)
long arg2; (0x8 offset) 
long arg3; (0xC offset)
long arg4; (0x10 offset)
long arg5; (0x14 offset)
long arg6; (0x18 offset)



PHATLIB OP CODES (51d info):
'play':
	set: op_code=0x9:, arg2=disk_num, arg3=track_num, arg4=track_offset
	expect: arg1=0x64

0x1f or 0x34: query play mode
req num disks:
	set: op_code=0x1
	expect: arg1=0x64, arg3=num_disks
req num tracks:
	set: op_code=0x2, arg3=disk_num
	expect: arg4=num_tracks

req name of disk:
	set: op_code=0x3, arg3=disk_num
	expect: arg1=0x64, char arg6[]="Disk Name\0"

req phat_filename:
	set: op_code=0x4, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="File Name\0"

req phat_desc:
	set: op_code=0x5, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Track Name\0"

req phat_artist:
	set: op_code=0x6, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Artist Name\0"

req phat_songname:
	set: op_code=0x7, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Artist Name\0"

req phat_status: (multiple ways of calling, not sure about info)
	set: op_code=0x8, arg4=0x0
	expect: op_code=0x8, arg1=0x64, arg2=something+2, arg3=disk?, arg4=track?

req phat_genre:
	set: op_code=0xe, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Current Genre\0"

req phat_comment:
	set: op_code=0xf, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Comment\0"

req phat_playlist:
	set: op_code=0x36, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Playlist\0"

req phat_album:
	set: op_code=0x37, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, char arg6[]="Album\0"

req phat_duration:
	set: op_code=0x37, arg3=disk_num, arg4=track_num
	expect: arg1=0x64, arg5=duration

req phat_tid: (track ID? - unused by my 51d)
	set: op_code=0x64, arg3=disk_num ,arg4=track_num
	expect: arg1=0x64, arg5=phat_tid

req phat_nexttrack:
	set: op_code=0x30, arg3=disk_num ,arg4=track_num
	expect: op_code=0x30, arg1=0x64