xps file format  -  datel xport v2 ps2 save files
-------------------------------------------------

this information was figured out by looking at various .xps files 
and finding patterns and similarities.
for this reason some or all of this information may be incorrect.
if this is the case please let me know so i can update it.
email me at: loser@loser-console.org


- the basic layout of an xps file is as follows:
	xps header
	game dir descriptor
	file descriptor for file 1
	file 1
	file descriptor for file 2
	file 2
	... etc
	4 bytes checksum on the end!
	


offset	size	description
---------------------------------------------

xps header
----------
  0		   4		0x0000000D  version?
  4		  17		SharkPortSave
 21		   4		length of filename		(L1 = this value)
 25		  L1		filename
25+L1	   4		length of date field	(L2 = this value)
29+L1	  L2		date field
29+L1+L2   4		0
33+L1+L2   4		size all the files and their descriptors
					(equals size of rest of file - 4 bytes checksum on end)


file descriptor
------------------------------------------
  0		   2		size of this descriptor (usually 250)
  2		  64		file title
 66		   4		length of file (or number of files in dir if descriptor is for main dir)
 70		   4		start sector
 74		   4		end sector
 78		   4		attributes
 82		   8		creation date
 90		   8		modification date
 98		   4		0x00000000
102		  12		padding (or a 4byte number followed by another date)
114		  64		file title (ascii)
178		  64		file title (s-jis)
242		   8		0


date format
------------
0		1		Reserved (0)
1		1		Second
2		1		Minute
3		1		Hour
4		1		Day
5		1		Month
6		2		Year


file attribute flags
---------------------
Read permission			0x0001
Write permission		0x0002
Execution permission	0x0004
Copy protected			0x0008
File??					0x0010
Subdirectory			0x0020
?????					0x0040
File preserved			0x0080
?????					0x0100
?????					0x0200
this is used often??	0x0400
PDA application			0x0800		(first generation (PSX) PDA file)
PS1 Data				0x1000
?????					0x2000
?????					0x4000
PS2 Data??				0x8000


