hostio.h 2.11 KB

#define	VERSION		"1.00"

#define	STACKSIZE	0x2000

#if defined(_LANGUAGE_C)

#include <ultra64.h>
#include <leosp.h>

typedef struct
{
  u32		cmdFlags;		/* flags of the command line */
  s32		offset;			/* start LBA */
  s32		filesize;		/* in bytes */
  s32		type;
  void		*address;
  LEODiskID	diskID;
} ctrlblk;

typedef struct
{
  LEODiskID	diskID;
  u8		diskmanID[200];
} idInfo;

typedef struct
{
  u32   country;
  u8    formatType;		/* 0x00 old, 0x10 new */
  u8    type;
  u16   IPLSize;
  u8	defectData1[20];
  void	*loadAddr;
  u8    defectData[160];
} sysInfo;

#define	SECPERBLOCK	85


#define JAPAN                   0xe848d316
#define USA                     0x2263ee56

#define	SECSIZE_PROD	232
#define	SECSIZE_DEV	192

/*
 * Definition of the ctrlblk packet
 */
#define	DO_FORMAT		0x0001	/* Force to format the disk */
#define	ID_SPECIFIED		0x0002  /* disk ID number is specified */
#define	SEND_ME_INFO		0x0004	/* send disk info to the host */
#define	SPECD_ID_FILE		0x0010	/* ID area is specified by file */
#define	SYS_UNFORMATTED		0x0100	/* system area is unformatted */
#define	ID_UNFORMATTED		0x0200	/* id area is unformatted */
#define	DRIVE_PROD		0x0400  /* drive type is prod */
#define	END_COMMAND		0x8000  /* end of leowrite */

#define	DO_FORMAT_MASK		0x0061

#define	Min(a, b)	(((a) < (b)) ? (a) : (b))
#define	Max(a, b)	(((a) > (b)) ? (a) : (b))

#define	BUFSIZE		1024*1024
#define	NUM_LBAS	4292
#define	MAX_HOSTNAME_LEN	8
#define	MAX_TIME_LEN		8

#define	TYPE_DONT_CHANGE	-1

#define	CLOSE_FILE	1
#define	CLOSE_GAME	2
#define	KILL_CHILD	4
#define	END_ALL		(CLOSE_FILE | CLOSE_GAME | KILL_CHILD)

#define	LBAOFF	24
#define	CMDB_LEO_NOCHKSYS	0x40

#define	SAVE_COUNTRY(x)								\
{										\
   *(u8*)OS_PHYSICAL_TO_K1(0x00000010) = (((u32)(x) & 0xff000000) >> 24); 	\
   *(u8*)OS_PHYSICAL_TO_K1(0x00000090) = (((u32)(x) & 0x00ff0000) >> 16);	\
   *(u8*)OS_PHYSICAL_TO_K1(0x00000110) = (((u32)(x) & 0x0000ff00) >>  8);	\
   *(u8*)OS_PHYSICAL_TO_K1(0x00000190) = ( (u32)(x) & 0x000000ff       );	\
}


/*
 * prototypes
 */
extern s32 myLeoReadDiskID(LEOCmd *cmdBlock, LEODiskID *vaddr, OSMesgQueue *mq);


#endif	/* _LANGUAGE_C */