If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Attack Plarail

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Attack Plarail

Developer: Namco
Publisher: Namco
Platform: Arcade (Namco System 12)
Released in JP: December 1998[1]


SourceIcon.png This game has uncompiled source code.
DevTextIcon.png This game has hidden development-related text.


Uncompiled Source Code

The code for the entire test mode as well as header definitions and prototypes appears to be left over in the ROM. However, it appears to have gone through the preprocessor, so all the comments have been stripped.

# 1 "C:/USR/TAKE/GGPLA4/t_mode.h" 1

# 1 "c:/psx/include\\sys/types.h" 1 3

typedef	unsigned char	u_char;

typedef	unsigned short	u_short;

typedef	unsigned int	u_int;

typedef	unsigned long	u_long;

typedef	unsigned short	ushort;		 

# 53 "c:/psx/include\\sys/types.h" 3

typedef	struct	_physadr { int r[1]; } *physadr;
typedef	struct	label_t	{
	int	val[12];
} label_t;

typedef	struct	_quad { long val[2]; } quad;
typedef	long	daddr_t;
typedef	char *	caddr_t;
typedef	long *	qaddr_t;	 
typedef	u_long	ino_t;
typedef	long	swblk_t;

typedef	unsigned int size_t;

typedef	long	time_t;
typedef	short	dev_t;
typedef	long	off_t;
typedef	u_short	uid_t;
typedef	u_short	gid_t;

# 6 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "c:/psx/include\\libetc.h" 1 3

extern int PadIdentifier;

int CheckCallback(void) ;
void PadInit(int mode);
int ResetCallback(void) ;
int RestartCallback(void) ;
int StopCallback(void) ;
int VSync(int mode);
int VSyncCallback(void (*f)()) ;
long GetVideoMode (void);
long SetVideoMode (long mode);
u_long PadRead(int id);
void PadStop(void);

# 7 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "c:/psx/include\\libgte.h" 1 3

# 135 "c:/psx/include\\libgte.h" 3

typedef struct  {
	short	m[3][3];	 
        long    t[3];		 
} MATRIX;

typedef struct {		 
	long	vx, vy;
	long	vz, pad;
} VECTOR;
	
typedef struct {		 	
	short	vx, vy;
	short	vz, pad;
} SVECTOR;
	       
typedef struct {		 	
	u_char	r, g, b, cd;
} CVECTOR;
	       
typedef struct {		 
	short vx, vy;
} DVECTOR;

typedef struct {		
	SVECTOR v;		 
	VECTOR sxyz;		 
	DVECTOR sxy;		 
	CVECTOR rgb;		 
	short txuv,pad;		 
	long chx,chy;		 
} EVECTOR;

typedef struct {
	SVECTOR v;
	u_char uv[2]; u_short pad;	   
	CVECTOR c;
	DVECTOR sxy;		
	u_long  sz;		 		
} RVECTOR;			 

typedef struct {
	RVECTOR r01,r12,r20;
	RVECTOR	*r0,*r1,*r2;
	u_long *rtn;
} CRVECTOR3;			 

typedef struct {
	u_long 	ndiv;		 
	u_long 	pih,piv;	 
	u_short clut,tpage;
	CVECTOR	rgbc;
	u_long	*ot;
	RVECTOR r0,r1,r2;
	CRVECTOR3 cr[5];	
} DIVPOLYGON3;			 

typedef struct {
	RVECTOR r01,r02,r31,r32,rc;
	RVECTOR	*r0,*r1,*r2,*r3;
	u_long *rtn;
} CRVECTOR4;			 

typedef struct {
	u_long 	ndiv;		 
	u_long 	pih,piv;	 
	u_short clut,tpage;
	CVECTOR	rgbc;
	u_long	*ot;
	RVECTOR r0,r1,r2,r3;
	CRVECTOR4 cr[5];	
} DIVPOLYGON4;			 

typedef struct {
        short   xy[3];
        short   uv[2];
        short   rgb[3];
} SPOL;
                                         
typedef struct {
        short   sxy[4][2];               
        short   sz[4][2];                
        short   uv[4][2];                
        short   rgb[4][3];               
        short   code;                    
} POL4;

typedef struct {
        short   sxy[3][2];
        short   sz[3][2];                
        short   uv[3][2];
        short   rgb[3][3];
        short   code;                    
} POL3;

typedef struct {
        SVECTOR         *v;                      
        SVECTOR         *n;                      
        SVECTOR         *u;                      
        CVECTOR         *c;                      
        u_long          len;                     
} TMESH;

typedef struct {
        SVECTOR         *v;                      
        SVECTOR         *n;                      
        SVECTOR         *u;                      
        CVECTOR         *c;                      
        u_long          lenv;                    
        u_long          lenh;                    
} QMESH;

extern void InitGeom();

extern void EigenMatrix(MATRIX *m, MATRIX *t);
extern int  IsIdMatrix(MATRIX *m);
extern MATRIX *MulMatrix0(MATRIX *m0,MATRIX *m1,MATRIX *m2);
extern MATRIX *MulRotMatrix0(MATRIX *m0,MATRIX *m1);
extern MATRIX *MulMatrix(MATRIX *m0,MATRIX *m1);
extern MATRIX *MulMatrix2(MATRIX *m0,MATRIX *m1);
extern MATRIX *MulRotMatrix(MATRIX *m0);
extern MATRIX *SetMulMatrix(MATRIX *m0,MATRIX *m1);
extern MATRIX *SetMulRotMatrix(MATRIX *m0);
extern VECTOR *ApplyMatrix(MATRIX *m,SVECTOR *v0,VECTOR *v1);
extern VECTOR *ApplyRotMatrix(SVECTOR *v0,VECTOR *v1);
extern VECTOR *ApplyRotMatrixLV(VECTOR *v0,VECTOR *v1);
extern VECTOR *ApplyMatrixLV(MATRIX *m,VECTOR *v0,VECTOR *v1);
extern SVECTOR *ApplyMatrixSV(MATRIX *m,SVECTOR *v0,SVECTOR *v1);
extern VECTOR *ApplyTransposeMatrixLV(MATRIX *m,VECTOR *v0,VECTOR *v1);
extern MATRIX *RotMatrix(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixXZY(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixYXZ(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixYZX(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixZXY(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixZYX(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrix_gte(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixYXZ_gte(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixZYX_gte(SVECTOR *r,MATRIX *m);
extern MATRIX *RotMatrixX(long r,MATRIX *m);
extern MATRIX *RotMatrixY(long r,MATRIX *m);
extern MATRIX *RotMatrixZ(long r,MATRIX *m);
extern MATRIX *RotMatrixC(SVECTOR *r,MATRIX *m);
extern MATRIX *TransMatrix(MATRIX *m,VECTOR *v);
extern MATRIX *ScaleMatrix(MATRIX *m,VECTOR *v);
extern MATRIX *ScaleMatrixL(MATRIX *m,VECTOR *v);
extern MATRIX *TransposeMatrix(MATRIX *m0,MATRIX *m1);
extern MATRIX *CompMatrix(MATRIX *m0,MATRIX *m1,MATRIX *m2);
extern MATRIX *CompMatrixLV(MATRIX *m0,MATRIX *m1,MATRIX *m2);

extern void MatrixNormal(MATRIX *m, MATRIX *n); 
extern void MatrixNormal_0(MATRIX *m, MATRIX *n);
extern void MatrixNormal_1(MATRIX *m, MATRIX *n);
extern void MatrixNormal_2(MATRIX *m, MATRIX *n);

extern void SetRotMatrix(MATRIX *m); 
extern void SetLightMatrix(MATRIX *m);
extern void SetColorMatrix(MATRIX *m);
extern void SetTransMatrix(MATRIX *m);
extern void PushMatrix();
extern void PopMatrix();
extern void ReadRotMatrix(MATRIX *m);
extern void ReadLightMatrix(MATRIX *m);
extern void ReadColorMatrix(MATRIX *m);
extern void SetRGBcd(CVECTOR *v);
extern void SetBackColor(long rbk,long gbk,long bbk);
extern void SetFarColor(long rfc,long gfc,long bfc);
extern void SetGeomOffset(long ofx,long ofy);
extern void SetGeomScreen(long h);
extern void ReadSZfifo3(long *sz0,long *sz1,long *sz2);
extern void ReadSZfifo4(long *szx,long *sz0,long *sz1,long *sz2);
extern void ReadSXSYfifo(long *sxy0,long *sxy1,long *sxy2);
extern void ReadRGBfifo(CVECTOR *v0,CVECTOR *v1,CVECTOR *v2);
extern void ReadGeomOffset(long *ofx,long *ofy);
extern long ReadGeomScreen();

extern void TransRot_32(VECTOR *v0, VECTOR *v1, long *flag);
extern long TransRotPers(SVECTOR *v0, long *sxy, long *p, long *flag);
extern long TransRotPers3(SVECTOR *v0, SVECTOR *v1, SVECTOR *v2, long *sxy0, 
		long *sxy1, long *sxy2, long *p, long *flag);

extern void pers_map(int abuf, SVECTOR **vertex, int tex[4][2], u_short *dtext);
extern void PhongLine(int istart_x, int iend_x, int p, int q, u_short **pixx,
		int fs, int ft, int i4, int det);

extern long RotTransPers(SVECTOR *v0,long *sxy,long *p,long *flag);
extern long RotTransPers3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			long *sxy0,long *sxy1,long *sxy2,long *p,long *flag);
extern void RotTrans(SVECTOR *v0,VECTOR *v1,long *flag);
extern void RotTransSV(SVECTOR *v0,SVECTOR *v1,long *flag);
extern void LocalLight(SVECTOR *v0,VECTOR *v1);
extern void LightColor(VECTOR *v0,VECTOR *v1);
extern void DpqColorLight(VECTOR *v0,CVECTOR *v1,long p,CVECTOR *v2);
extern void DpqColor(CVECTOR *v0,long p,CVECTOR *v1);
extern void DpqColor3(CVECTOR *v0,CVECTOR *v1,CVECTOR *v2,
			long p,CVECTOR *v3,CVECTOR *v4,CVECTOR *v5);
extern void Intpl(VECTOR *v0,long p,CVECTOR *v1);
extern VECTOR *Square12(VECTOR *v0,VECTOR *v1);
extern VECTOR *Square0(VECTOR *v0,VECTOR *v1);
extern VECTOR *SquareSL12(SVECTOR *v0,VECTOR *v1);
extern VECTOR *SquareSL0(SVECTOR *v0,VECTOR *v1);
extern SVECTOR *SquareSS12(SVECTOR *v0,SVECTOR *v1);
extern SVECTOR *SquareSS0(SVECTOR *v0,SVECTOR *v1);
extern void NormalColor(SVECTOR *v0,CVECTOR *v1);
extern void NormalColor3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			CVECTOR *v3,CVECTOR *v4,CVECTOR *v5);
extern void NormalColorDpq(SVECTOR *v0,CVECTOR *v1,long p,CVECTOR *v2);
extern void NormalColorDpq3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,CVECTOR *v3,
			long p,CVECTOR *v4,CVECTOR *v5,CVECTOR *v6);
extern void NormalColorCol(SVECTOR *v0,CVECTOR *v1,CVECTOR *v2);
extern void NormalColorCol3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,CVECTOR *v3,
			CVECTOR *v4,CVECTOR *v5,CVECTOR *v6);
extern void ColorDpq(VECTOR *v0,CVECTOR *v1,long p,CVECTOR *v2);
extern void ColorCol(VECTOR *v0,CVECTOR *v1,CVECTOR *v2);
extern long NormalClip(long sxy0,long sxy1,long sxy2);
extern long AverageZ3(long sz0,long sz1,long sz2);
extern long AverageZ4(long sz0,long sz1,long sz2,long sz3);
extern void OuterProduct12(VECTOR *v0,VECTOR *v1,VECTOR *v2);
extern void OuterProduct0(VECTOR *v0,VECTOR *v1,VECTOR *v2);
extern long Lzc(long data);

extern long RotTransPers4(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
			long *sxy0,long *sxy1,long *sxy2,long *sxy3,
			long *p,long *flag);
extern void RotTransPersN(SVECTOR *v0,DVECTOR *v1,u_short *sz,u_short *p,
			u_short *flag,long n);
extern void RotTransPers3N(SVECTOR *v0,DVECTOR *v1,u_short *sz,u_short *flag,
			long n);
extern void RotMeshH(short *Yheight,DVECTOR *Vo,u_short *sz,u_short *flag,
			short Xoffset,short Zoffset,short m,short n,
			DVECTOR *base);
extern long RotAverage3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			long *sxy0,long *sxy1,long *sxy2,long *p,long *flag);
extern long RotAverage4(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
			long *sxy0,long *sxy1,long *sxy2,long *sxy3,
			long *p,long *flag);
extern long RotNclip3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			long *sxy0,long *sxy1,long *sxy2,long *p,long *otz,
			long *flag);
extern long RotNclip4(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
			long *sxy0,long *sxy1,long *sxy2,long *sxy3,
			long *p,long *otz,long *flag);
extern long RotAverageNclip3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			long *sxy0,long *sxy1,long *sxy2,
			long *p,long *otz,long *flag);
extern long RotAverageNclip4(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
			long *sxy0,long *sxy1,long *sxy2,long *sxy3,
			long *p,long *otz,long *flag);
extern long RotColorDpq(SVECTOR *v0,SVECTOR *v1,CVECTOR *v2,
			long *sxy,CVECTOR *v3,long *flag);
extern long RotColorDpq3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			SVECTOR *v3,SVECTOR *v4,SVECTOR *v5,CVECTOR *v6,
			long *sxy0,long *sxy1,long *sxy2,
			CVECTOR *v7,CVECTOR *v8,CVECTOR *v9,long *flag);
extern long RotAverageNclipColorDpq3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			SVECTOR *v3,SVECTOR *v4,SVECTOR *v5,CVECTOR *v6,
			long *sxy0,long *sxy1,long *sxy2,
			CVECTOR *v7,CVECTOR *v8,CVECTOR *v9,
			long *otz,long *flag);	 		   	      
extern long RotAverageNclipColorCol3(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			SVECTOR *v3,SVECTOR *v4,SVECTOR *v5,CVECTOR *v6,
			long *sxy0,long *sxy1,long *sxy2,
			CVECTOR *v7,CVECTOR *v8,CVECTOR *v9,
			long *otz,long *flag);	 		   	      
extern long RotColorMatDpq(SVECTOR *v0,SVECTOR *v1,CVECTOR *v2,long *sxy,
			CVECTOR *v3,long matc,long flag);
extern void ColorMatDpq(SVECTOR *v0,CVECTOR *v1,long p,CVECTOR *v2,long matc);
extern void ColorMatCol(SVECTOR *v0,CVECTOR *v1,CVECTOR *v2,long matc);
extern void LoadAverage12(VECTOR *v0,VECTOR *v1,long p0,long p1,VECTOR *v2);
extern void LoadAverageShort12(SVECTOR *v0,SVECTOR *v1,long p0,long p1,
			SVECTOR *v2);
extern void LoadAverage0(VECTOR *v0,VECTOR *v1,long p0,long p1,VECTOR *v2);
extern void LoadAverageShort0(SVECTOR *v0,SVECTOR *v1,long p0,long p1,
			SVECTOR *v2);
extern void LoadAverageByte(u_char *v0,u_char *v1,long p0,long p1,u_char *v2);
extern void LoadAverageCol(u_char *v0,u_char *v1,long p0,long p1,u_char *v2);
extern long VectorNormal(VECTOR *v0, VECTOR *v1);
extern long VectorNormalS(VECTOR *v0, SVECTOR *v1);
extern long VectorNormalSS(SVECTOR *v0, SVECTOR *v1);
extern long SquareRoot0(long a);
extern long SquareRoot12(long a);
extern void InvSquareRoot(long a, long *b, long *c);
extern void gteMIMefunc(SVECTOR *otp, SVECTOR *dfp, long n, long p);
extern void SetFogFar(long a,long h);
extern void SetFogNear(long a,long h);
extern void SetFogNearFar(long a,long b,long h);
extern void SubPol4(POL4 *p, SPOL *sp, int ndiv);
extern void SubPol3(POL3 *p, SPOL *sp, int ndiv);

extern int rcos(int a);
extern int rsin(int a);
extern int ccos(int a);
extern int csin(int a);
extern int cln(int a);
extern int csqrt(int a);
extern int catan(int a);
extern long ratan2(long y, long x);

extern void RotPMD_F3(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_G3(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_FT3(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_GT3(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_F4(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_G4(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_FT4(long *pa,u_long *ot,int otlen,int id,int backc);
extern void RotPMD_GT4(long *pa,u_long *ot,int otlen,int id,int backc);

extern void RotPMD_SV_F3(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_G3(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_FT3(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_GT3(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_F4(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_G4(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_FT4(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);
extern void RotPMD_SV_GT4(long *pa,long *va,u_long *ot,int otlen,int id,
			int backc);

extern void InitClip(EVECTOR *evbfad,long hw,long vw,long h,long near,long far);
extern long Clip3F(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,EVECTOR **evmx);
extern long Clip3FP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,EVECTOR **evmx);
extern long Clip4F(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
			EVECTOR **evmx);
extern long Clip4FP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
			EVECTOR **evmx);
extern long Clip3FT(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
		short *uv0,short *uv1,short *uv2,EVECTOR **evmx);
extern long Clip3FTP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
		short *uv0,short *uv1,short *uv2,EVECTOR **evmx);
extern long Clip4FT(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
		short *uv0,short *uv1,short *uv2,short *uv3,EVECTOR **evmx);
extern long Clip4FTP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
		short *uv0,short *uv1,short *uv2,short *uv3,EVECTOR **evmx);
extern long Clip3G(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,EVECTOR **evmx);
extern long Clip3GP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,EVECTOR **evmx);
extern long Clip4G(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,CVECTOR *rgb3,
		EVECTOR **evmx);
extern long Clip4GP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,CVECTOR *rgb3,
		EVECTOR **evmx);
extern long Clip3GT(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
		short *uv0,short *uv1,short *uv2,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,
		EVECTOR **evmx);
extern long Clip3GTP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
		short *uv0,short *uv1,short *uv2,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,
		EVECTOR **evmx);
extern long Clip4GT(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
		short *uv0,short *uv1,short *uv2,short *uv3,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,CVECTOR *rgb3,
		EVECTOR **evmx);
extern long Clip4GTP(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3,
		short *uv0,short *uv1,short *uv2,short *uv3,
		CVECTOR *rgb0,CVECTOR *rgb1,CVECTOR *rgb2,CVECTOR *rgb3,
		EVECTOR **evmx);

extern void RotTransPers_nom(SVECTOR *v0);
extern void RotTransPers3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2);
extern void RotTransPers4_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,SVECTOR *v3);
extern void RotTrans_nom(SVECTOR *v0);
extern void RotAverage3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2);
extern void RotNclip3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2);
extern void RotAverageNclip3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2);
extern void RotAverageNclipColorDpq3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			SVECTOR *v3,SVECTOR *v4,SVECTOR *v5,CVECTOR *v6);
extern void RotAverageNclipColorCol3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			SVECTOR *v3,SVECTOR *v4,SVECTOR *v5,CVECTOR *v6);
extern void RotColorDpq_nom(SVECTOR *v0,SVECTOR *v1,CVECTOR *v2);
extern long RotColorDpq3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			SVECTOR *v3,SVECTOR *v4,SVECTOR *v5,CVECTOR *v6);
extern void NormalColor_nom(SVECTOR *v0);
extern void NormalColor3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2);
extern void NormalColorDpq_nom(SVECTOR *v0,CVECTOR *v1,long p);
extern void NormalColorDpq3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			CVECTOR *v3,long p);
extern void NormalColorCol_nom(SVECTOR *v0,CVECTOR *v1);
extern void NormalColorCol3_nom(SVECTOR *v0,SVECTOR *v1,SVECTOR *v2,
			CVECTOR *v3);

extern void RotSMD_F3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_G3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_FT3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_GT3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_F4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_G4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_FT4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_GT4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		

extern void RotSMD_SV_F3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_G3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_FT3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_GT3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_F4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_G4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_FT4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotSMD_SV_GT4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		

extern void RotRMD_F3(long *pa,u_long *ot,int otlen,int id,		
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_G3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_FT3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_GT3(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_F4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_G4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_FT4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_GT4(long *pa,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		

extern void RotRMD_SV_F3(long *pa,long *va,u_long *ot,int otlen,int id,	
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_G3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_FT3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_GT3(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_F4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_G4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_FT4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		
extern void RotRMD_SV_GT4(long *pa,long *va,u_long *ot,int otlen,int id,
			int sclip, int hclip, int vclip, int nclipmode);		

extern long p2otz(long p, long projection);
extern long otz2p(long otz, long projection);

# 8 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "c:/psx/include\\libgpu.h" 1 3

extern	int (*GPU_printf)();	 

# 306 "c:/psx/include\\libgpu.h" 3

typedef struct {
	short x, y;		 
	short w, h;		 
} RECT;

typedef struct {
	int x, y;		 
	int w, h;		 
} RECT32;

typedef struct {
	u_long	tag;
	u_long	code[15];
} DR_ENV;				 
	       
typedef struct {
	RECT	clip;		 
	short	ofs[2];		 
	RECT	tw;		 
	u_short tpage;		 	
	u_char	dtd;		 
	u_char	dfe;		 
	u_char	isbg;		 
	u_char	r0, g0, b0;	 
	DR_ENV	dr_env;		 
} DRAWENV;
	       
typedef struct {
	RECT	disp;		 
	RECT	screen;		 
	u_char	isinter;	 
	u_char	isrgb24;	 
	u_char	pad0, pad1;	 
} DISPENV;

typedef struct {
	unsigned	addr: 24;
	unsigned 	len:   8;
	u_char		r0, g0, b0, code;
} P_TAG;
	
typedef struct {
	u_char	r0, g0, b0, code;
} P_CODE;
	
typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	short	x1,	y1;
	short	x2,	y2;
} POLY_F3;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	short	x1,	y1;
	short	x2,	y2;
	short	x3,	y3;
} POLY_F4;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
	short	x1,	y1;
	u_char	u1, v1;	u_short	tpage;
	short	x2,	y2;
	u_char	u2, v2;	u_short	pad1;
} POLY_FT3;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
	short	x1,	y1;
	u_char	u1, v1;	u_short	tpage;
	short	x2,	y2;
	u_char	u2, v2;	u_short	pad1;
	short	x3,	y3;
	u_char	u3, v3;	u_short	pad2;
} POLY_FT4;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	r1, g1, b1, pad1;
	short	x1,	y1;
	u_char	r2, g2, b2, pad2;
	short	x2,	y2;
} POLY_G3;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	r1, g1, b1, pad1;
	short	x1,	y1;
	u_char	r2, g2, b2, pad2;
	short	x2,	y2;
	u_char	r3, g3, b3, pad3;
	short	x3,	y3;
} POLY_G4;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
	u_char	r1, g1, b1, p1;
	short	x1,	y1;
	u_char	u1, v1;	u_short	tpage;
	u_char	r2, g2, b2, p2;
	short	x2,	y2;
	u_char	u2, v2;	u_short	pad2;
} POLY_GT3;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
	u_char	r1, g1, b1, p1;
	short	x1,	y1;
	u_char	u1, v1;	u_short	tpage;
	u_char	r2, g2, b2, p2;
	short	x2,	y2;
	u_char	u2, v2;	u_short	pad2;
	u_char	r3, g3, b3, p3;
	short	x3,	y3;
	u_char	u3, v3;	u_short	pad3;
} POLY_GT4;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	short	x1,	y1;
} LINE_F2;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	r1, g1, b1, p1;
	short	x1,	y1;
} LINE_G2;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	short	x1,	y1;
	short	x2,	y2;
	u_long	pad;
} LINE_F3;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	r1, g1, b1, p1;
	short	x1,	y1;
	u_char	r2, g2, b2, p2;
	short	x2,	y2;
	u_long	pad;
} LINE_G3;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	short	x1,	y1;
	short	x2,	y2;
	short	x3,	y3;
	u_long	pad;
} LINE_F4;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	r1, g1, b1, p1;
	short	x1,	y1;
	u_char	r2, g2, b2, p2;
	short	x2,	y2;
	u_char	r3, g3, b3, p3;
	short	x3,	y3;
	u_long	pad;
} LINE_G4;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
	short	w,	h;
} SPRT;					 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
} SPRT_16;				 
	       
typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	u_char	u0, v0;	u_short	clut;
} SPRT_8;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
	short	w,	h;
} TILE;					 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
} TILE_16;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
} TILE_8;				 

typedef struct {
	u_long	tag;
	u_char	r0, g0, b0, code;
	short	x0, 	y0;
} TILE_1;				 

typedef struct {
	u_long	tag;
	u_long	code[2];
} DR_MODE;				 

typedef struct {
	u_long	tag;
	u_long	code[2];
} DR_TWIN;				 
	       
typedef struct {
	u_long	tag;
	u_long	code[2];
} DR_AREA;				 
	       
typedef struct {
	u_long	tag;
	u_long	code[2];
} DR_OFFSET;				 
	       
typedef struct {			 
	u_long	tag;
	u_long	code[5];
} DR_MOVE;

typedef struct {			 
	u_long	tag;
	u_long	code[3];
	u_long	p[13];
} DR_LOAD;

typedef	struct {
	u_long	tag;
	u_long	code[1];
} DR_TPAGE;				 

typedef struct {
        u_long  tag;
        u_long  code[2];
} DR_STP;                                

typedef struct {
	u_long	id;	
	u_char	r0, g0, b0, p0;		 
	u_char	r1, g1, b1, p1;		 
	u_char	r2, g2, b2, p2;		 
	u_char	r3, g3, b3, p3;		 
	u_short	tpage, clut;		 
	u_char	u0, v0, u1, v1;		 
	u_char	u2, v2, u3, v3;
	
	 
	SVECTOR	x0, x1, x2, x3;		 
	SVECTOR	n0, n1, n2, n3;		 
	
	 
	SVECTOR	*v_ofs;			 
	SVECTOR	*n_ofs;			 
	
	u_short	vert0, vert1; 		 
	u_short	vert2, vert3;		
	u_short	norm0, norm1; 		 
	u_short	norm2, norm3;
	
} TMD_PRIM;

typedef struct {
	u_long  mode;		 
	RECT	*crect;		 
	u_long	*caddr;		 
	RECT	*prect;		 
	u_long	*paddr;		 
} TIM_IMAGE;

# 700 "c:/psx/include\\libgpu.h" 3

extern int FntPrint();

extern int KanjiFntPrint();
	
extern DISPENV *GetDispEnv(DISPENV *env);
extern DISPENV *PutDispEnv(DISPENV *env);
extern DISPENV *SetDefDispEnv(DISPENV *env, int x, int y, int w, int h);
extern DRAWENV *GetDrawEnv(DRAWENV *env);
extern DRAWENV *PutDrawEnv(DRAWENV *env);
extern DRAWENV *SetDefDrawEnv(DRAWENV *env, int x, int y, int w, int h);
extern TIM_IMAGE *ReadTIM(TIM_IMAGE *timimg);
extern TMD_PRIM *ReadTMD(TMD_PRIM *tmdprim);
extern int CheckPrim(char *s, u_long *p);
extern int ClearImage(RECT *rect, u_char r, u_char g, u_char b);
extern int ClearImage2(RECT *rect, u_char r, u_char g, u_char b);
extern int DrawSync(int mode);
extern int FntOpen(int x, int y, int w, int h, int isbg, int n);
extern int GetGraphDebug(void) ;
extern int GetTimSize(u_char *sjis);
extern int IsEndPrim(void *p) ;
extern int KanjiFntOpen(int x, int y, int w, int h, int dx, int dy, int cx, int cy, int isbg, int n);
extern void KanjiFntClose(void);
extern int Krom2Tim(u_char *sjis, u_long *taddr, int dx, int dy, int cdx, int cdy, u_int fg, u_int bg);
extern int LoadImage(RECT *rect, u_long *p);
extern int MargePrim(void *p0, void *p1);
extern int MoveImage(RECT *rect, int x, int y);
extern int OpenTIM(u_long *addr);
extern int OpenTMD(u_long *tmd, int obj_no);
extern int ResetGraph(int mode);
extern int SetGraphDebug(int level);
extern int StoreImage(RECT *rect, u_long *p);
extern u_long *ClearOTag(u_long *ot, int n);
extern u_long *ClearOTagR(u_long *ot, int n);
extern u_long *FntFlush(int id);
extern u_long *KanjiFntFlush(int id);
extern u_long DrawSyncCallback(void (*func)());
extern u_short GetClut(int x, int y) ;
extern u_short GetTPage(int tp, int abr, int x, int y) ;
extern u_short LoadClut(u_long *clut, int x, int y);
extern u_short LoadClut2(u_long *clut, int x, int y);
extern u_short LoadTPage(u_long *pix, int tp, int abr, int x, int y, int w, int h);
extern void *NextPrim(void *p) ;
extern void AddPrim(void *ot, void *p) ;
extern void AddPrims(void *ot, void *p0, void *p1) ;
extern void CatPrim(void *p0, void *p1) ;
extern void DrawOTag(u_long *p);
extern void DrawOTagIO(u_long *p);
extern void DrawOTagEnv(u_long *p, DRAWENV *env);
extern void DrawPrim(void *p);
extern void DumpClut(u_short clut) ;
extern void DumpDispEnv(DISPENV *env);
extern void DumpDrawEnv(DRAWENV *env);
extern void DumpOTag(u_long *p);
extern void DumpTPage(u_short tpage) ;
extern void FntLoad(int tx, int ty);
extern void SetDispMask(int mask);
extern void SetDrawArea(DR_AREA *p, RECT *r);
extern void SetDrawEnv(DR_ENV *dr_env, DRAWENV *env);
extern void SetDrawLoad(DR_LOAD *p, RECT *rect);
extern void SetDrawMode(DR_MODE *p, int dfe, int dtd, int tpage, RECT *tw);
extern void SetDrawTPage(DR_TPAGE *p, int dfe, int dtd, int tpage);
extern void SetDrawMove(DR_MOVE *p, RECT *rect, int x, int y) ;
extern void SetDrawOffset(DR_OFFSET *p, u_short *ofs);
extern void SetDrawStp(DR_STP *p, int pbw);
extern void SetDumpFnt(int id);
extern void SetLineF2(LINE_F2 *p) ;
extern void SetLineF3(LINE_F3 *p) ;
extern void SetLineF4(LINE_F4 *p) ;
extern void SetLineG2(LINE_G2 *p) ;
extern void SetLineG3(LINE_G3 *p) ;
extern void SetLineG4(LINE_G4 *p) ;
extern void SetPolyF3(POLY_F3 *p) ;
extern void SetPolyF4(POLY_F4 *p) ;
extern void SetPolyFT3(POLY_FT3 *p) ;
extern void SetPolyFT4(POLY_FT4 *p) ;
extern void SetPolyG3(POLY_G3 *p) ;
extern void SetPolyG4(POLY_G4 *p) ;
extern void SetPolyGT3(POLY_GT3 *p) ;
extern void SetPolyGT4(POLY_GT4 *p) ;
extern void SetSemiTrans(void *p, int abe) ;
extern void SetShadeTex(void *p, int tge) ;
extern void SetSprt(SPRT *p) ;
extern void SetSprt16(SPRT_16 *p) ;
extern void SetSprt8(SPRT_8 *p) ;
extern void SetTexWindow(DR_TWIN *p, RECT *tw);
extern void SetTile(TILE *p) ;
extern void SetTile1(TILE_1 *p) ;
extern void SetTile16(TILE_16 *p) ;
extern void SetTile8(TILE_8 *p) ;
extern void TermPrim(void *p) ;
extern u_long *BreakDraw(void);
extern void ContinueDraw(u_long *insaddr, u_long *contaddr);
extern int IsIdleGPU(int max_count);
extern int GetODE(void);
extern int LoadImage2(RECT *rect, u_long *p);
extern int StoreImage2(RECT *rect, u_long *p);
extern int MoveImage2(RECT *rect, int x, int y);
extern int DrawOTag2(u_long *p);
extern void GetDrawMode(DR_MODE *p);
extern void GetTexWindow(DR_TWIN *p);
extern void GetDrawArea(DR_AREA *p);
extern void GetDrawOffset(DR_OFFSET *p);

# 9 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "c:/psx/include\\libgs.h" 1 3

typedef unsigned char PACKET;

typedef struct {
	VECTOR  scale;
	SVECTOR rotate;
	VECTOR  trans;
}       GsCOORD2PARAM;

typedef struct _GsCOORDINATE2 {
	unsigned long flg;
	MATRIX  coord;
	MATRIX  workm;
	GsCOORD2PARAM *param;
	struct _GsCOORDINATE2 *super;
	struct _GsCOORDINATE2 *sub;
}       GsCOORDINATE2;

typedef struct {
	MATRIX  view;
	GsCOORDINATE2 *super;
}       GsVIEW2;

typedef struct {
	long    vpx, vpy, vpz;
	long    vrx, vry, vrz;
	long    rz;
	GsCOORDINATE2 *super;
}       GsRVIEW2;

typedef struct {
	int     vx, vy, vz;
	unsigned char r, g, b;
}       GsF_LIGHT;


typedef struct {
	unsigned p:24;
	unsigned char num:8;
}       GsOT_TAG;


typedef struct {
	unsigned long length;
	GsOT_TAG *org;
	unsigned long offset;
	unsigned long point;
	GsOT_TAG *tag;
}       GsOT;

typedef struct {
	unsigned long attribute; 
	GsCOORDINATE2 *coord2;	 
	unsigned long *tmd;
	unsigned long id;
}       GsDOBJ2;

typedef struct {
	unsigned long attribute; 
	GsCOORDINATE2 *coord2;	 
	unsigned long *pmd;	 
	unsigned long *base;	 
	unsigned long *sv;	 
	unsigned long id;
}       GsDOBJ3;

typedef struct {
	unsigned long attribute; 
	GsCOORDINATE2 *coord2;	 
	unsigned long *tmd;
	unsigned long id;
}       GsDOBJ4;

typedef struct {
	unsigned long attribute;
	GsCOORDINATE2 *coord2;
	unsigned long *tmd;
	unsigned long *packet;
	unsigned long id;
}       GsDOBJ5;

typedef struct {
	unsigned long attribute;
	short   x, y;
	unsigned short w, h;
	unsigned short tpage;
	unsigned char u, v;
	short   cx, cy;
	unsigned char r, g, b;
	short   mx, my;
	short   scalex, scaley;
	long    rotate;
}       GsSPRITE;

typedef struct {
	unsigned char u, v;
	unsigned short cba;
	unsigned short flag;
	unsigned short tpage;
}       GsCELL;

typedef struct {
	unsigned char cellw, cellh;
	unsigned short ncellw, ncellh;
	GsCELL *base;
	unsigned short *index;
}       GsMAP;

typedef struct {
	unsigned long attribute;
	short   x, y;
	short   w, h;
	short   scrollx, scrolly;
	unsigned char r, g, b;
	GsMAP  *map;
	short   mx, my;
	short   scalex, scaley;
	long    rotate;
}       GsBG;

typedef struct {
	unsigned long attribute;
	short   x0, y0;
	short   x1, y1;
	unsigned char r, g, b;
}       GsLINE;

typedef struct {
	unsigned long attribute;
	short   x0, y0;
	short   x1, y1;
	unsigned char r0, g0, b0;
	unsigned char r1, g1, b1;
}       GsGLINE;

typedef struct {
	unsigned long attribute;
	short   x, y;
	unsigned short w, h;
	unsigned char r, g, b;
}       GsBOXF;

typedef struct {
	short   dqa;
	long    dqb;
	unsigned char rfc, gfc, bfc;
}       GsFOGPARAM;


typedef struct {
	unsigned long pmode;
	short   px, py;
	unsigned short pw, ph;
	unsigned long *pixel;
	short   cx, cy;
	unsigned short cw, ch;
	unsigned long *clut;
}       GsIMAGE;

typedef struct {
	short   offx, offy;
}       _GsPOSITION;

typedef struct {
	GsDOBJ2 *top;
	int     nobj;
	int     maxobj;
}       GsOBJTABLE2;

typedef struct {
	PACKET
	* (*f3[2][3]) ();
	PACKET
	* (*nf3[2]) ();
	PACKET
	* (*g3[2][3]) ();
	PACKET
	* (*ng3[2]) ();
	PACKET
	* (*tf3[2][3]) ();
	PACKET
	* (*ntf3[2]) ();
	PACKET
	* (*tg3[2][3]) ();
	PACKET
	* (*ntg3[2]) ();
	PACKET
	* (*f4[2][3]) ();
	PACKET
	* (*nf4[2]) ();
	PACKET
	* (*g4[2][3]) ();
	PACKET
	* (*ng4[2]) ();
	PACKET
	* (*tf4[2][3]) ();
	PACKET
	* (*ntf4[2]) ();
	PACKET
	* (*tg4[2][3]) ();
	PACKET
	* (*ntg4[2]) ();
	PACKET
	* (*f3g[3])();
	PACKET
	* (*g3g[3])();
	PACKET
	* (*f4g[3])();
	PACKET
	* (*g4g[3])();
}       _GsFCALL;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_short n0, v0;
	u_short v1, v2;
}       TMD_P_F3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_short n0, v0;
	u_short n1, v1;
	u_short n2, v2;
}       TMD_P_G3;

typedef struct {
	u_char	out, in, dummy, cd;
	u_char	r0, g0, b0, code;
	u_char	r1, g1, b1, dummy1;
	u_char	r2, g2, b2, dummy2;
	u_short n0, v0;
	u_short v1, v2;
}       TMD_P_F3G;

typedef struct {
	u_char	out, in, dummy, cd;
	u_char	r0, g0, b0, code;
	u_char	r1, g1, b1, dummy1;
	u_char	r2, g2, b2, dummy2;
	u_short n0, v0;
	u_short n1, v1;
	u_short n2, v2;
}       TMD_P_G3G;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_short v0, v1;
	u_short v2, p;
}       TMD_P_NF3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_char  r1, g1, b1, p1;
	u_char  r2, g2, b2, p2;
	u_short v0, v1;
	u_short v2, p;
}       TMD_P_NG3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_short n0, v0;
	u_short v1, v2;
	u_short v3, p;
}       TMD_P_F4;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_short n0, v0;
	u_short n1, v1;
	u_short n2, v2;
	u_short n3, v3;
}       TMD_P_G4;

typedef struct {
	u_char	out, in, dummy, cd;
	u_char	r0, g0, b0, code;
	u_char	r1, g1, b1, dummy1;
	u_char	r2, g2, b2, dummy2;
	u_char	r3, g3, b3, dummy3;
	u_short n0, v0;
	u_short v1, v2;
	u_short v3, dummy4;
}       TMD_P_F4G;

typedef struct {
	u_char	out, in, dummy, cd;
	u_char	r0, g0, b0, code;
	u_char	r1, g1, b1, dummy1;
	u_char	r2, g2, b2, dummy2;
	u_char	r3, g3, b3, dummy3;
	u_short n0, v0;
	u_short n1, v1;
	u_short n2, v2;
	u_short n3, v3;
}       TMD_P_G4G;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_short v0, v1;
	u_short v2, v3;
}       TMD_P_NF4;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  r0, g0, b0, code;
	u_char  r1, g1, b1, p1;
	u_char  r2, g2, b2, p2;
	u_char  r3, g3, b3, p3;
	u_short v0, v1;
	u_short v2, v3;
}       TMD_P_NG4;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p;
	u_short n0, v0;
	u_short v1, v2;
}       TMD_P_TF3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p;
	u_short n0, v0;
	u_short n1, v1;
	u_short n2, v2;
}       TMD_P_TG3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p0;
	u_char  r0, g0, b0, p1;
	u_short v0, v1;
	u_short v2, p2;
}       TMD_P_TNF3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p0;
	u_char  r0, g0, b0, p1;
	u_char  r1, g1, b1, p2;
	u_char  r2, g2, b2, p3;
	u_short v0, v1;
	u_short v2, p4;
}       TMD_P_TNG3;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p0;
	u_char  tu3, tv3;
	u_short p1;
	u_short n0, v0;
	u_short v1, v2;
	u_short v3, p2;
}       TMD_P_TF4;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p0;
	u_char  tu3, tv3;
	u_short p1;
	u_short n0, v0;
	u_short n1, v1;
	u_short n2, v2;
	u_short n3, v3;
}       TMD_P_TG4;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p0;
	u_char  tu3, tv3;
	u_short p1;
	u_char  r0, g0, b0, p2;
	u_short v0, v1;
	u_short v2, v3;
}       TMD_P_TNF4;

typedef struct {
	u_char  out, in, dummy, cd;
	u_char  tu0, tv0;
	u_short clut;
	u_char  tu1, tv1;
	u_short tpage;
	u_char  tu2, tv2;
	u_short p0;
	u_char  tu3, tv3;
	u_short p1;
	u_char  r0, g0, b0, p2;
	u_char  r1, g1, b1, p3;
	u_char  r2, g2, b2, p4;
	u_char  r3, g3, b3, p5;
	u_short v0, v1;
	u_short v2, v3;
}       TMD_P_TNG4;

struct TMD_STRUCT {
	u_long *vertop;          
	u_long  vern;            
	u_long *nortop;          
	u_long  norn;            
	u_long *primtop;         
	u_long  primn;           
	u_long  scale;           
};

typedef struct {
	short   vx, vy, vz;
	u_char  tu, tv;
}       VERT;

typedef struct {
	short   vx, vy, vz;
	u_char  tu, tv;
	CVECTOR col;
}       VERTC;


typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg0;		 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_FT4 si;		 
}       GsADIV_FT4;

typedef struct {
	VERT    vt[4];
}       GsADIV_P_FT4;

typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg0;		 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_GT4 si;		 
}       GsADIV_GT4;

typedef struct {
	VERTC   vt[4];
}       GsADIV_P_GT4;

typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg0;		 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_G4 si;		 
}       GsADIV_G4;

typedef struct {
	VERTC   vt[4];
}       GsADIV_P_G4;

typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg0;		 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_F4 si;		 
}       GsADIV_F4;

typedef struct {
	VERT    vt[4];
}       GsADIV_P_F4;


typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_FT3 si;		 
}       GsADIV_FT3;

typedef struct {
	VERT    vt[3];
}       GsADIV_P_FT3;

typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_GT3 si;		 
}       GsADIV_GT3;

typedef struct {
	VERTC   vt[3];
}       GsADIV_P_GT3;

typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_G3 si;		 
}       GsADIV_G3;

typedef struct {
	VERTC   vt[3];
}       GsADIV_P_G3;

typedef struct {
	u_long  limit;		 
	long    hwd, vwd;	 
	int     shift;		 
	u_long *org;		 
	u_long *pk;		 
	long    otz;		 
	long    adivz;		 
	short   adivw, adivh;	 
	long    flg;		 
	short   minx, miny, maxx, maxy;	 
	short   hwd0, vwd0;	 
	u_long *tag;		 
	POLY_F3 si;		 
}       GsADIV_F3;

typedef struct {
	VERT    vt[3];
}       GsADIV_P_F3;

	void    GsInitGraph(unsigned short x, unsigned short y, unsigned short intmode,
		              unsigned short dith, unsigned short varmmode);
	void    GsInit3D(void);
	void    GsMapModelingData(unsigned long *p);

	void    GsSetProjection(long h);
	int     GsSetFlatLight(int id, GsF_LIGHT * lt);
	void    GsSetLightMode(int mode);
	void    GsSetFogParam(GsFOGPARAM * fogparm);
	void    GsSetAmbient(long r, long g, long b);
	void    GsDrawOt(GsOT * ot);
	void    GsSetWorkBase(PACKET * outpacketp);

	void    GsSortObject3(GsDOBJ3 * objp, GsOT * ot, int shift);
	void    GsSortObject4(GsDOBJ2 * objp, GsOT * ot, int shift, u_long * scratch);
	void    GsSortObject5(GsDOBJ5 * objp, GsOT * ot, int shift, u_long * scratch);
	void    GsSortObject5J(GsDOBJ5 * objp, GsOT * ot, int shift, u_long * scratch);

	void    GsSortSprite(GsSPRITE * sp, GsOT * ot, unsigned short pri);
	void    GsSortSpriteB(GsSPRITE * sp, GsOT * ot, unsigned short pri,
				unsigned short flip);
	void    GsSortFastSprite(GsSPRITE * sp, GsOT * ot, unsigned short pri);
	void    GsSortFastSpriteB(GsSPRITE * sp, GsOT * ot, unsigned short pri,
				unsigned short flip);
	void    GsSortFlipSprite(GsSPRITE * sp, GsOT * ot, unsigned short pri);
	void    GsSortBg(GsBG * bg, GsOT * ot, unsigned short pri);
	void    GsSortFastBg(GsBG * bg, GsOT * ot, unsigned short pri);
	void    GsInitFixBg16(GsBG * bg, u_long * work);
	void    GsSortFixBg16(GsBG * bg, u_long * work, GsOT * otp, unsigned short pri);
	void    GsInitFixBg32(GsBG * bg, u_long * work);
	void    GsSortFixBg32(GsBG * bg, u_long * work, GsOT * otp, unsigned short pri);
	void    GsSortLine(GsLINE * lp, GsOT * ot, unsigned short pri);
	void    GsSortGLine(GsGLINE * lp, GsOT * ot, unsigned short pri);
	void    GsSortBoxFill(GsBOXF * bp, GsOT * ot, unsigned short pri);
	void    GsSortPoly(void *pp, GsOT * ot, unsigned short pri);

	void    GsClearOt(unsigned short offset, unsigned short point, GsOT * otp);
	GsOT   *GsSortOt(GsOT * ot_src, GsOT * ot_dest);
	GsOT   *GsCutOt(GsOT * ot_src, GsOT * ot_dest);
	void    GsDefDispBuff(unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1);
	void    GsSortClear(unsigned char, unsigned char, unsigned char, GsOT *);
	void    GsGetTimInfo(unsigned long *im, GsIMAGE * tim);
	void    GsSwapDispBuff(void);
	int     GsGetActiveBuff(void);
	void    GsSetDrawBuffClip(void);
	void    GsSetDrawBuffOffset(void);
	void    GsSetClip(RECT * clip);
	DRAWENV *GsSetClip2(RECT * clip);
	void    GsSetOffset(long x, long y);
	void    GsSetOrign(long x, long y);

	void    GsInitCoordinate2(GsCOORDINATE2 * super, GsCOORDINATE2 * base);
	void    GsMulCoord0(MATRIX * m1, MATRIX * m2, MATRIX * m3);
	void    GsMulCoord2(MATRIX * m1, MATRIX * m2);
	void    GsMulCoord3(MATRIX * m1, MATRIX * m2);
	void    GsGetLw(GsCOORDINATE2 * m, MATRIX * out);
	void    GsGetLs(GsCOORDINATE2 * m, MATRIX * out);
	void    GsGetLws(GsCOORDINATE2 * m, MATRIX * outw, MATRIX * outs);

	u_long  GsLinkObject3(unsigned long pmd_base, GsDOBJ3 * objp);
	void    GsLinkObject4(unsigned long tmd_base, GsDOBJ2 * objp, int n);
	void    GsLinkObject5(unsigned long tmd_base, GsDOBJ5 * objp, int n);

	void    GsSetLightMatrix(MATRIX * mp);
	void    GsSetLightMatrix2(MATRIX * mp);
	int     GsSetRefView2(GsRVIEW2 * pv);
	int     GsSetRefView2L(GsRVIEW2 * pv);
	int     GsSetView2(GsVIEW2 * pv);
	void    GsSetLsMatrix(MATRIX * mp);
	void    GsSetClip2D(RECT * rectp);
	void    GsInitVcount();
	long    GsGetVcount();
	void    GsClearVcount();
	void	GsDefDispBuff2(u_short x0, u_short y0, u_short x1, u_short y1);
	void	GsDrawOtIO(GsOT *ot);
	PACKET *GsGetWorkBase();
	void	GsInitGraph2( u_short x, u_short y, u_short intmode, u_short dith, u_short vrammode);
	void	GsSortObject4J(GsDOBJ2 *objp, GsOT *otp, int shift, u_long *scratch);
	void    GsClearDispArea(unsigned char r, unsigned char g, unsigned char b);

	u_long *GsPresetObject(GsDOBJ5 * objp, u_long * base_addr);
	void    GsScaleScreen(SVECTOR * scale);

	PACKET *GsA4divF3L(TMD_P_F3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divF3LFG(TMD_P_F3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divF3NL(TMD_P_F3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divNF3(TMD_P_NF3 * op, VERT * vp, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divF4L(TMD_P_F4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divF4LFG(TMD_P_F4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divF4NL(TMD_P_F4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divNF4(TMD_P_NF4 * op, VERT * vp, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divG3L(TMD_P_G3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divG3LFG(TMD_P_G3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divG3NL(TMD_P_G3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divNG3(TMD_P_NG3 * op, VERT * vp, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divG4L(TMD_P_G4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divG4LFG(TMD_P_G4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divG4NL(TMD_P_G4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divNG4(TMD_P_NG4 * op, VERT * vp, PACKET * pk, int n,
			           int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF3L(TMD_P_TF3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF3LFG(TMD_P_TF3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF3NL(TMD_P_TF3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTNF3(TMD_P_TNF3 * op, VERT * vp, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF4L(TMD_P_TF4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF4LFG(TMD_P_TF4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF4NL(TMD_P_TF4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTNF4(TMD_P_TNF4 * op, VERT * vp, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF4LM(TMD_P_TF4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF4LFGM(TMD_P_TF4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTF4NLM(TMD_P_TF4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTNF4M(TMD_P_TNF4 * op, VERT * vp, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG3L(TMD_P_TG3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG3LFG(TMD_P_TG3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG3NL(TMD_P_TG3 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTNG3(TMD_P_TNG3 * op, VERT * vp, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG4L(TMD_P_TG4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG4LFG(TMD_P_TG4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG4NL(TMD_P_TG4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTNG4(TMD_P_TNG4 * op, VERT * vp, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG4LM(TMD_P_TG4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG4LFGM(TMD_P_TG4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTG4NLM(TMD_P_TG4 * op, VERT * vp, VERT * np, PACKET * pk, int n,
			             int shift, GsOT * ot, u_long * scratch);
	PACKET *GsA4divTNG4M(TMD_P_TNG4 * op, VERT * vp, PACKET * pk, int n,
			            int shift, GsOT * ot, u_long * scratch);
	PACKET *GsTMDfastF3GL(TMD_P_F3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF3GLFG(TMD_P_F3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF3GNL(TMD_P_F3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG3GL(TMD_P_G3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG3GLFG(TMD_P_G3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG3GNL(TMD_P_G3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsPrstF3GL(TMD_P_F3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsPrstF3GLFG(TMD_P_F3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsPrstF3GNL(TMD_P_F3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsPrstG3GL(TMD_P_G3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsPrstG3GLFG(TMD_P_G3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsPrstG3GNL(TMD_P_G3G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG3M(TMD_P_G3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG3MFG(TMD_P_G3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTG3M(TMD_P_TG3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTG3MFG(TMD_P_TG3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF4GL(TMD_P_F4G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF4GLFG(TMD_P_F4G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF4GNL(TMD_P_F4G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG4GL(TMD_P_G4G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG4GLFG(TMD_P_G4G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG4GNL(TMD_P_G4G *op, VERT *vp, VERT *np, PACKET *pk,
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG4M(TMD_P_G4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastG4MFG(TMD_P_G4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTG4M(TMD_P_TG4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTG4MFG(TMD_P_TG4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF3M(TMD_P_F3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF3MFG(TMD_P_F3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTF3M(TMD_P_TF3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTF3MFG(TMD_P_TF3 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF4M(TMD_P_F4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastF4MFG(TMD_P_F4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTF4M(TMD_P_TF4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);
	PACKET *GsTMDfastTF4MFG(TMD_P_TF4 *op, VERT *vp, VERT *np, PACKET *pk, 
						int n, int shift, GsOT *ot, u_long *scratch);

extern RECT CLIP2;		 
extern short PSDBASEX[2], PSDBASEY[2];	 
extern short PSDIDX;		 
extern u_long PSDCNT;		 
extern _GsPOSITION POSITION;	 
extern DRAWENV GsDRAWENV;	 
extern DISPENV GsDISPENV;	 
extern MATRIX GsLSMATRIX;	 
extern MATRIX GsWSMATRIX;	 
extern MATRIX GsWSMATRIX_ORG;	 
extern long HWD0, VWD0;		 
extern MATRIX GsLIGHTWSMATRIX;	 
extern MATRIX GsIDMATRIX;	 
extern MATRIX GsIDMATRIX2;	 
extern PACKET *GsOUT_PACKET_P;	 
extern long GsADIVZ;		 
extern short GsADIVW, GsADIVH;	 
extern int GsLIGHT_MODE;	 
extern u_long GsMATE_C, GsLMODE, GsLIGNR, GsLIOFF, GsZOVER, GsBACKC, GsNDIV;
extern u_long GsTRATE, GsTON, GsDISPON;

# 1133 "c:/psx/include\\libgs.h" 3

# 1244 "c:/psx/include\\libgs.h" 3

# 1355 "c:/psx/include\\libgs.h" 3

# 1466 "c:/psx/include\\libgs.h" 3

# 10 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "C:/USR/TAKE/GGPLA4/my_defs.h" 1

# 1 "c:/psx/include\\libsn.h" 1 3

int	PCinit (void);

int	PCopen (char *name, int flags, int perms);

int	PCcreat (char *name, int perms);

int	PClseek (int fd, int offset, int mode);

int	PCread (int fd, char *buff, int len);

int	PCwrite (int fd, char *buff, int len);

int	PCclose (int fd);

# 3 "C:/USR/TAKE/GGPLA4/my_defs.h" 2

# 104 "C:/USR/TAKE/GGPLA4/my_defs.h"

typedef struct {
	u_char	name[3];
	u_char	type;
	long	score;
} RANK_ST;

typedef struct {
	short	px;
	short	py;
	short	pz;
	short	ry;
	short	rz;
	short	dmy;
} C_DATA;

typedef struct {
	long	num;
	GsDOBJ2	*obj;
	GsCOORDINATE2	*coord;
	GsCOORD2PARAM	*param;
} OBJ_MODEL;

typedef struct {
	short	course;
	short	block;
	short	type;
	short	sp_fg;
	short	clr_fg;
	short	stat_fg;
	short	mv_cnt;
	short	mv_max;
	short	mv_idx;
	short	blk_offset_start;
	short	blk_offset_end;
	short	blk_offset;
	short	limit;
	short	bonus;
	short	score;
	short	dmy;
} E_DATA;

# 11 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "C:/USR/TAKE/GGPLA4/globals.h" 1

extern DVECTOR	BgScroll;

extern long	BIdx;
extern long	OIdx;

extern long	MVCowCount;
extern long	MVFukiCount;
extern long	NextCourseFlag;
extern long	LoopOutFlag;
extern long	CourseIdx;
extern long	gFGDispFlag;
extern E_DATA	EDataTable[];
extern long	EDataMax;
extern short	*EObjFlag;
extern RANK_ST	RankBeg[5 ];
extern RANK_ST	RankPro[5 ];

extern void texture_init(u_long *, GsIMAGE *);
extern short get_rot_y(long);
extern short get_rot_z(long);
extern void make_rot_table(void);
extern void make_lp_rot_table(void);
extern void make_bl_rot_table(void);
extern void make_br_rot_table(void);

# 12 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

# 1 "C:/USR/TAKE/GGPLA4/pad_ctl.h" 1

extern u_long padd[2];
extern u_long padc[2];
extern u_long pads[2];
extern short	CurrentKnotch;

extern void my_pad_init(void);
extern void my_pad_read(void);

# 13 "C:/USR/TAKE/GGPLA4/t_mode.h" 2

typedef struct {
	short	id[3];
	short	g_cost;
	short	c_cost;
	short	free_fg;
	short	dif_fg;
	short	snd_fg;
	short	pow_time[4];
	short	play_time[4];
	short	play_cnt[4];
	short	ad_val0[2];
	short	ad_val1[2];
	short	ad_val2[2];
	short	ad_val3[2];
	short	ad_val4[2];
	short	ad_val5[2];
	short	ad_val6[2];
	short	name0[3];
	short	type0;
	short	score0[4];
	short	name1[3];
	short	type1;
	short	score1[4];
	short	name2[3];
	short	type2;
	short	score2[4];
	short	name3[3];
	short	type3;
	short	score3[4];
	short	name4[3];
	short	type4;
	short	score4[4];
	short	name5[3];
	short	type5;
	short	score5[4];
	short	name6[3];
	short	type6;
	short	score6[4];
	short	name7[3];
	short	type7;
	short	score7[4];
	short	name8[3];
	short	type8;
	short	score8[4];
	short	name9[3];
	short	type9;
	short	score9[4];
} AP_SAVE;

extern AP_SAVE	gAPSave;
extern short	gDefGameCost;
extern short	gGameCost;
extern short	gDefContCost;
extern short	gContCost;
extern short	gDefFreePlayFlag;
extern short	gFreePlayFlag;
extern short	gDefGameDifficulty;
extern short	gGameDifficulty;
extern short	gDefSoundAttractFlag;
extern short	gSoundAttractFlag;
extern long		gPlayStart;
extern long		gPlayTime;
extern long		gPlayCount;
extern long		gPowerOnTime;
extern short	gControllerInitFlag;

extern void test_coin_option(void);
extern void test_game_option(void);
extern void test_io_test(void);
extern void test_sound_test(void);
extern void mon_test_grad(void);
extern void mon_test_cross(void);
extern void test_monitor_test(void);
extern void reset_ads_data(void);
extern void test_ads_data(void);
extern void others_test_controller(void);
extern void others_test_data_ranking(void);
extern void others_test_data_defaults(void);
extern void others_test_data_clear(void);
extern void test_others(void);
extern void test_mode(void);

# 4 "C:/USR/TAKE/GGPLA4/t_mode.c" 2

extern long load_eeprom(void);
extern void save_option_eep(void);
extern void save_time_eep(void);
extern void save_controller_eep(void);
extern void save_score_eep(void);
extern void save_eeprom(void);
extern void init_rank_struct(void);
extern void init_save_struct(void);
extern void set_save_struct(void);
extern void disp_JVS_mon(void);
extern short snd_se_busy(short);
extern void snd_se(short, short);
extern void get_analog_value(void);
extern void set_analog_value(void);
extern u_short get_knotch(u_short);
extern void print_lever_value(void);
extern long chk_service_sw(void);
extern long chk_coin_sw(void);
extern long chk_test_sw(void);

extern long	V_Count;

AP_SAVE	gAPSave;

u_short	gLastCoinCount;
u_short	gLastServiceCount;

char	*TModeBoolStr[2 ] = {
	"OFF",
	"ON",
};

char	*MenuTitleStr = "MENU";
char	*MenuStrTable[8 ] = {
	"COIN OPTIONS",
	"GAME OPTIONS",
	"I/O TEST",
	"SOUND TEST",
	"MONITOR TEST",
	"ADS DATA",
	"OTHERS",
	"EXIT",
};
char	*MenuUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

char	*COptTitleStr1 = "COIN OPTIONS";
char	*COptTitleStr2 = "[DEFAULT IN GREEN]";
char	*COptStrTable[4 ] = {
	"GAME COST",
	"CONTINUE COST",
	"FREE PLAY",
	"EXIT",
};
char	*COptUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";
char	*COptCoinStr1 = "COIN  1CREDIT";
char	*COptCoinStr2 = "COINS 1CREDIT";

short	gDefGameCost = 1;
short	gGameCost = 1;
short	gDefContCost = 1;
short	gContCost = 1;
short	gDefFreePlayFlag = 0;
short	gFreePlayFlag = 0;

char	*GOptTitleStr1 = "GAME OPTIONS";
char	*GOptTitleStr2 = "[DEFAULT IN GREEN]";
char	*GOptStrTable[3 ] = {
	"GAME DIFFICULTY ",
	"SOUND IN ATTRACT",
	"EXIT",
};
char	*GOptUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";
char	*GOptDifStr[3 ] = {
	"A",
	"B",
	"C",
};

short	gDefGameDifficulty = 1;
short	gGameDifficulty = 1;
short	gDefSoundAttractFlag = 1;
short	gSoundAttractFlag = 1;

char	*IOTestTitleStr1 = "I/O TEST";
char	*IOTestTitleStr2 = "SWITCH_TEST";
char	*IOTestStrTable[7 ] = {
	"LEVER     :",
	"LEFT SW   :",
	"RIGHT SW  :",
	"OK SW     :",
	"SERVICE SW:",
	"COIN SW   :",
	"TEST SW   :",
};
char	*IOTestUsageStr = "TO EXIT:PUSH RIGHT & LEFT & OK";

char	*SoundTestTitleStr = "SOUND TEST";
char	*SoundTestStrTable[2 ] = {
	"SONG    ",
	"EXIT",
};
char	*SoundTestUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

char	*MonTestTitleStr = "MONITOR TEST";
char	*MonTestStrTable[3 ] = {
	"GRADATION PATTERN",
	"CROSSHATCH PATTERN",
	"EXIT",
};
char	*MonTestUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

char	*ADSTestTitleStr = "ADS DATA";
char	*ADSTestStrTable[6 ] = {
	"POWER ON TIME    ",
	"TOTAL PLAY TIME  ",
	"AVE. PLAY TIME   ",
	"PLAY/ON RATIO    ",
	"RESET DATA",
	"EXIT",
};
char	*ADSTestUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

long	gPlayStart;
long	gPlayTime;
long	gPlayCount;
long	gPowerOnTime;

char	*OthersTestTitleStr = "OTHERS";
char	*OthersTestStrTable[3 ] = {
	"CONTROLLER TEST",
	"DATA CLEAR",
	"EXIT",
};
char	*OthersTestUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

char	*OthersTestDataTitleStr = "DATA CLEAR";
char	*OthersTestDataStrTable[3 ] = {
	"RANKING CLEAR",
	"SET DEFAULTS ALL OPTION",
	"EXIT",
};
char	*OthersTestDataUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

char	*ContTestTitleStr1 = "CONTROLLER TEST";
char	*ContTestTitleStr2 = "CONTROLLER INITIALIZE";
char	*ContTestUsageStr1 = "PUSH OK:SET";
char	*ContTestUsageStr2 = "TO EXIT:PUSH RIGHT & LEFT & OK";
u_short	gLeverValue[7 ];
short	gControllerInitFlag;

char	*InitRankTitleStr = "RANKING CLEAR";
char	*InitRankStrTable[3 ] = {
	"INITIALIZE ?",
	"   YES",
	"    NO",
};
char	*InitRankUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

char	*InitDefaultsTitleStr = "SET DEFAULTS ALL OPTION";
char	*InitDefaultsStrTable[3 ] = {
	"INITIALIZE ?",
	"   YES",
	"    NO",
};
char	*InitDefaultsUsageStr = "LEFT RIGHT :CHOOSE  OK :ENTER";

void test_coin_option(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;
	short	mode;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 0;
	mode = 0 ;

	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();

		if(break_fg) {
			if(mode == 0 ) {
				set_save_struct();
				save_option_eep();
				break;
			}
		}
		if((padd[0] & (1<< 4) )>0) {
			if(mode == 0 ) {
				switch(select) {
				case 0 :
				case 1 :
				case 2 :
					mode = 1 ;
					break;
				case 3 :
					break_fg = 1;
					break;
				default:
					break;
				}
				if(break_fg) {
					continue;
				}
			} else if(mode == 1 ) {
				mode = 0 ;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			if(mode == 0 ) {
				select--;
				if(select < 0) {
					select = 4  - 1;
				}
			} else if(mode == 1 ) {
				switch(select) {
				case 0 :
					gGameCost--;
					if(gGameCost < 1) {
						gGameCost = 1;
					}
					break;
				case 1 :
					gContCost--;
					if(gContCost < 0) {
						gContCost = 0;
					}
					break;
				case 2 :
					if(gFreePlayFlag == 1) {
						gFreePlayFlag = 0;
					}
					break;
				default:
					break;
				}
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			if(mode == 0 ) {
				select++;
				if(select >= 4 ) {
					select = 0;
				}
			} else if(mode == 1 ) {
				switch(select) {
				case 0 :
					gGameCost++;
					if(gGameCost > 9) {
						gGameCost = 9;
					}
					break;
				case 1 :
					gContCost++;
					if(gContCost > 9) {
						gContCost = 9;
					}
					break;
				case 2 :
					if(gFreePlayFlag == 0) {
						gFreePlayFlag = 1;
					}
					break;
				default:
					break;
				}
			}
		}

		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", COptTitleStr1);
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", COptTitleStr2);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 4 ; i++) {
			if(mode == 0 ) {
				if(select == i) {
					FntPrint("~c800") ;
				} else {
					FntPrint("~c888") ;
				}
			} else if(mode == 1 ) {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", COptStrTable[i]);

			switch(i) {
			case 0 :
				{	long	i;	for(i = 0; i < ( 1 ); i++) {	FntPrint("\n");	}} ;
				if(mode == 0 ) {
					if(gGameCost == gDefGameCost) {
						FntPrint("~c080") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(mode == 1 ) {
					if(select == i) {
						if(V_Count/10%2) {
							FntPrint("~c800") ;
						} else {
							if(gGameCost == gDefGameCost) {
								FntPrint("~c080") ;
							} else {
								FntPrint("~c888") ;
							}
						}
					} else {
						if(gGameCost == gDefGameCost) {
							FntPrint("~c080") ;
						} else {
							FntPrint("~c888") ;
						}
					}
				}
				{	long	i;	for(i = 0; i < ( 13 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%d", gGameCost);
				if(gGameCost == 1) {
					FntPrint("%s", COptCoinStr1);
				} else {
					FntPrint("%s", COptCoinStr2);
				}
				break;
			case 1 :
				{	long	i;	for(i = 0; i < ( 1 ); i++) {	FntPrint("\n");	}} ;
				if(mode == 0 ) {
					if(gContCost == gDefContCost) {
						FntPrint("~c080") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(mode == 1 ) {
					if(select == i) {
						if(V_Count/10%2) {
							FntPrint("~c800") ;
						} else {
							if(gContCost == gDefContCost) {
								FntPrint("~c080") ;
							} else {
								FntPrint("~c888") ;
							}
						}
					} else {
						if(gContCost == gDefContCost) {
							FntPrint("~c080") ;
						} else {
							FntPrint("~c888") ;
						}
					}
				}
				{	long	i;	for(i = 0; i < ( 13 ); i++) {	FntPrint(" ");	}} ;
				if(gContCost > 0) {
					FntPrint("%d", gContCost);
					if(gContCost == 1) {
						FntPrint("%s", COptCoinStr1);
					} else {
						FntPrint("%s", COptCoinStr2);
					}
				} else {
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			case 2 :
				if(mode == 0 ) {
					if(gFreePlayFlag == gDefFreePlayFlag) {
						FntPrint("~c080") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(mode == 1 ) {
					if(select == i) {
						if(V_Count/10%2) {
							FntPrint("~c800") ;
						} else {
							if(gFreePlayFlag == gDefFreePlayFlag) {
								FntPrint("~c080") ;
							} else {
								FntPrint("~c888") ;
							}
						}
					} else {
						if(gFreePlayFlag == gDefFreePlayFlag) {
							FntPrint("~c080") ;
						} else {
							FntPrint("~c888") ;
						}
					}
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", TModeBoolStr[gFreePlayFlag]);
				break;
			default:
				break;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", COptUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void test_game_option(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;
	short	mode;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 0;
	mode = 0 ;

	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();

		if(break_fg) {
			if(mode == 0 ) {
				set_save_struct();
				save_option_eep();
				break;
			}
		}
		if((padd[0] & (1<< 4) )>0) {
			if(mode == 0 ) {
				switch(select) {
				case 0 :
				case 1 :
					mode = 1 ;
					break;
				case 2 :
					break_fg = 1;
					break;
				default:
					break;
				}
				if(break_fg) {
					continue;
				}
			} else if(mode == 1 ) {
				mode = 0 ;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			if(mode == 0 ) {
				select--;
				if(select < 0) {
					select = 3  - 1;
				}
			} else if(mode == 1 ) {
				switch(select) {
				case 0 :
					gGameDifficulty--;
					if(gGameDifficulty < 0) {
						gGameDifficulty = 0;
					}
					break;
				case 1 :
					if(gSoundAttractFlag == 1) {
						gSoundAttractFlag = 0;
					}
					break;
				default:
					break;
				}
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			if(mode == 0 ) {
				select++;
				if(select >= 3 ) {
					select = 0;
				}
			} else if(mode == 1 ) {
				switch(select) {
				case 0 :
					gGameDifficulty++;
					if(gGameDifficulty > 2) {
						gGameDifficulty = 2;
					}
					break;
				case 1 :
					if(gSoundAttractFlag == 0) {
						gSoundAttractFlag = 1;
					}
					break;
				default:
					break;
				}
			}
		}

		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", GOptTitleStr1);
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", GOptTitleStr2);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 3 ; i++) {
			if(mode == 0 ) {
				if(select == i) {
					FntPrint("~c800") ;
				} else {
					FntPrint("~c888") ;
				}
			} else if(mode == 1 ) {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", GOptStrTable[i]);

			switch(i) {
			case 0 :
				if(mode == 0 ) {
					if(gGameDifficulty == gDefGameDifficulty) {
						FntPrint("~c080") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(mode == 1 ) {
					if(select == i) {
						if(V_Count/10%2) {
							FntPrint("~c800") ;
						} else {
							if(gGameDifficulty == gDefGameDifficulty) {
								FntPrint("~c080") ;
							} else {
								FntPrint("~c888") ;
							}
						}
					} else {
						if(gGameDifficulty == gDefGameDifficulty) {
							FntPrint("~c080") ;
						} else {
							FntPrint("~c888") ;
						}
					}
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", GOptDifStr[gGameDifficulty]);
				break;
			case 1 :
				if(mode == 0 ) {
					if(gSoundAttractFlag == gDefSoundAttractFlag) {
						FntPrint("~c080") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(mode == 1 ) {
					if(select == i) {
						if(V_Count/10%2) {
							FntPrint("~c800") ;
						} else {
							if(gSoundAttractFlag == gDefSoundAttractFlag) {
								FntPrint("~c080") ;
							} else {
								FntPrint("~c888") ;
							}
						}
					} else {
						if(gSoundAttractFlag == gDefSoundAttractFlag) {
							FntPrint("~c080") ;
						} else {
							FntPrint("~c888") ;
						}
					}
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", TModeBoolStr[gSoundAttractFlag]);
				break;
			default:
				break;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", GOptUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void test_io_test(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	extern u_short get_game_credit();

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;

	gLastCoinCount = get_game_credit(0);
	gLastServiceCount = get_game_credit(1);
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();

		if(break_fg) {
			break;
		}
		if((padc[0] & (1<< 7) )>0 && (padc[0] & (1<< 5) )>0 && (padc[0] & (1<< 4) )>0) {
			break_fg = 1;
			continue;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", IOTestTitleStr1);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", IOTestTitleStr2);
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 7 ; i++) {
			switch(i) {
			case 0 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				print_lever_value();
				break;
			case 1 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				if((padc[0] & (1<< 7) )>0) {
					FntPrint("~c800") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[1]);
				} else {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			case 2 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				if((padc[0] & (1<< 5) )>0) {
					FntPrint("~c800") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[1]);
				} else {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			case 3 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				if((padc[0] & (1<< 4) )>0) {
					FntPrint("~c800") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[1]);
				} else {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			case 4 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				if(chk_service_sw()) {
					FntPrint("~c800") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[1]);
				} else {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			case 5 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				if(chk_coin_sw()) {
					FntPrint("~c800") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[1]);
				} else {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			case 6 :
				FntPrint("~c888") ;
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", IOTestStrTable[i]);
				if(chk_test_sw()) {
					FntPrint("~c800") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[1]);
				} else {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("%s", TModeBoolStr[0]);
				}
				break;
			default:
				break;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", IOTestUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void test_sound_test(void)
{
	RECT	rect[2];
	long	id;
	long	i;
 
	long	t_count;
	short	break_fg;
	short	cont_fg;
	short	select;
	short	mode;
	short	songID, songID0, songID1, songID2;
	short	s0_sel, s1_sel, s2_sel;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

 
	break_fg = 0;
	cont_fg = 0;
	select = 0 ;
	mode = 0 ;
	songID0 = songID1 = songID2 = 0;
	s0_sel = s1_sel = s2_sel = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if(mode == 0 ) {
			if((padd[0] & (1<< 4) )>0) {
				switch(select) {
				case 0 :
					mode = 1 ;
					break;
				case 1 :
					break_fg = 1;
					break;
				default:
					break;
				}
				if(break_fg) {
					continue;
				}
			}
			if((padd[0] & (1<< 7) )>0) {
				select--;
				if(select < 0) {
					select = 2  - 1;
				}
			}
			if((padd[0] & (1<< 5) )>0) {
				select++;
				if(select >= 2 ) {
					select = 0;
				}
			}
			FntPrint("~c888") ;
			{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", SoundTestTitleStr);
			{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
			for(i = 0; i < 2 ; i++) {
				if(select == i) {
					FntPrint("~c800") ;
				} else {
					FntPrint("~c888") ;
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", SoundTestStrTable[i]);
				FntPrint("~c888") ;
				if(i == 0 ) {
					FntPrint("%1d%1d%1d", songID2, songID1, songID0);
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
			}
		} else {
			if((padd[0] & (1<< 4) )>0) {
				switch(mode) {
				case 1 :
					if(s0_sel) {
						songID = songID2*100+songID1*10+songID0;

						if(songID < 36 ) {
 
							snd_se(0,songID);
							cont_fg = 1;
							t_count = 0;
 
							while(snd_se_busy(0)) {
								asm("break 1024")  ;

								id=GsGetActiveBuff();
								ClearImage(&rect[id],0,0,0);
								FntPrint("~c888") ;
								{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
								FntPrint("%s", SoundTestTitleStr);
								{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
								for(i = 0; i < 2 ; i++) {
									if(i == 0) {
										if(mode == 4 ) {
											FntPrint("~c800") ;
										} else {
											FntPrint("~c080") ;
										}
									} else {
										FntPrint("~c888") ;
									}
									{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
									FntPrint("%s", SoundTestStrTable[i]);
									if(i == 0) {
										if(s2_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 3 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID2);
										if(s1_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 2 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID1);
										if(s0_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 1 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID0);
										if(songID == 1) {
											FntPrint("~c888") ;
											if(t_count < 100) {
												FntPrint("  LEFT");
											} else if(t_count < 200) {
												FntPrint("  RIGHT");
											} else {
												FntPrint("  CENTER");
											}
										}
									}
									{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
								}
								FntPrint("~c888") ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
								FntPrint("%s", SoundTestUsageStr);
								t_count++;
								FntFlush(-1);
								VSync(2);
								GsSwapDispBuff();
							}
 
						}

						songID0 = songID1 = songID2 = 0;
						s0_sel = s1_sel = s2_sel = 0;
					} else {
						s0_sel = 1;
					}
					break;
				case 2 :
					if(s1_sel) {
						songID = songID2*100+songID1*10+songID0;

						if(songID < 36 ) {
 
							snd_se(0,songID);
							cont_fg = 1;
							t_count = 0;
							while(snd_se_busy(0)) {
								asm("break 1024")  ;

								id=GsGetActiveBuff();
								ClearImage(&rect[id],0,0,0);
								FntPrint("~c888") ;
								{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
								FntPrint("%s", SoundTestTitleStr);
								{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
								for(i = 0; i < 2 ; i++) {
									if(i == 0) {
										if(mode == 4 ) {
											FntPrint("~c800") ;
										} else {
											FntPrint("~c080") ;
										}
									} else {
										FntPrint("~c888") ;
									}
									{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
									FntPrint("%s", SoundTestStrTable[i]);
									if(i == 0) {
										if(s2_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 3 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID2);
										if(s1_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 2 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID1);
										if(s0_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 1 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID0);
										if(songID == 1) {
											FntPrint("~c888") ;
											if(t_count < 100) {
												FntPrint("  LEFT");
											} else if(t_count < 200) {
												FntPrint("  RIGHT");
											} else {
												FntPrint("  CENTER");
											}
										}
									}
									{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
								}
								FntPrint("~c888") ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
								FntPrint("%s", SoundTestUsageStr);
								t_count++;
								FntFlush(-1);
								VSync(2);
								GsSwapDispBuff();
							}

						}

						songID0 = songID1 = songID2 = 0;
						s0_sel = s1_sel = s2_sel = 0;
					} else {
						s1_sel = 1;
					}
					break;
				case 3 :
					if(s2_sel) {
						songID = songID2*100+songID1*10+songID0;

						if(songID < 36 ) {

							snd_se(0,songID);
							cont_fg = 1;
							t_count = 0;
							while(snd_se_busy(0)) {
								asm("break 1024")  ;

								id=GsGetActiveBuff();
								ClearImage(&rect[id],0,0,0);
								FntPrint("~c888") ;
								{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
								FntPrint("%s", SoundTestTitleStr);
								{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
								for(i = 0; i < 2 ; i++) {
									if(i == 0) {
										if(mode == 4 ) {
											FntPrint("~c800") ;
										} else {
											FntPrint("~c080") ;
										}
									} else {
										FntPrint("~c888") ;
									}
									{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
									FntPrint("%s", SoundTestStrTable[i]);
									if(i == 0) {
										if(s2_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 3 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID2);
										if(s1_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 2 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID1);
										if(s0_sel) {
											FntPrint("~c080") ;
										} else {
											if(mode == 1 ) {
												FntPrint("~c800") ;
											} else {
												FntPrint("~c888") ;
											}
										}
										FntPrint("%1d", songID0);
										if(songID == 1) {
											FntPrint("~c888") ;
											if(t_count < 100) {
												FntPrint("  LEFT");
											} else if(t_count < 200) {
												FntPrint("  RIGHT");
											} else {
												FntPrint("  CENTER");
											}
										}
									}
									{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
								}
								FntPrint("~c888") ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
								{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
								FntPrint("%s", SoundTestUsageStr);
								t_count++;
								FntFlush(-1);
								VSync(2);
								GsSwapDispBuff();
							}

						}

						songID0 = songID1 = songID2 = 0;
						s0_sel = s1_sel = s2_sel = 0;
					} else {
						s2_sel = 1;
					}
					break;
				case 4 :
					select = 0 ;
					mode = 0 ;
					break;
				}
			}
			if(cont_fg) {
				cont_fg = 0;
				continue;
			}
			if((padd[0] & (1<< 7) )>0) {
				switch(mode) {
				case 1 :
					mode = 2 ;
					break;
				case 2 :
					mode = 3 ;
					break;
				case 3 :
					if(s0_sel || s1_sel || s2_sel) {
						mode = 1 ;
					} else {
						mode = 4 ;
					}
					break;
				case 4 :
					mode = 1 ;
					break;
				}
			}
			if((padd[0] & (1<< 5) )>0) {
				switch(mode) {
				case 1 :
					songID0++;
					if(songID0 >= 10) {
						songID0 = 0;
					}
					break;
				case 2 :
					songID1++;
					if(songID1 >= 10) {
						songID1 = 0;
					}
					break;
				case 3 :
					songID2++;
					if(songID2 >= 10) {
						songID2 = 0;
					}
					break;
				case 4 :
					break;
				}
			}
			FntPrint("~c888") ;
			{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", SoundTestTitleStr);
			{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
			for(i = 0; i < 2 ; i++) {
				if(i == 0) {
					if(mode == 4 ) {
						FntPrint("~c800") ;
					} else {
						FntPrint("~c080") ;
					}
				} else {
					FntPrint("~c888") ;
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
				FntPrint("%s", SoundTestStrTable[i]);
				if(i == 0) {
					if(s2_sel) {
						FntPrint("~c080") ;
					} else {
						if(mode == 3 ) {
							FntPrint("~c800") ;
						} else {
							FntPrint("~c888") ;
						}
					}
					FntPrint("%1d", songID2);
					if(s1_sel) {
						FntPrint("~c080") ;
					} else {
						if(mode == 2 ) {
							FntPrint("~c800") ;
						} else {
							FntPrint("~c888") ;
						}
					}
					FntPrint("%1d", songID1);
					if(s0_sel) {
						FntPrint("~c080") ;
					} else {
						if(mode == 1 ) {
							FntPrint("~c800") ;
						} else {
							FntPrint("~c888") ;
						}
					}
					FntPrint("%1d", songID0);
				}
				{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", SoundTestUsageStr);
 
 
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void mon_test_grad(void)
{
	RECT	rect[2];
	RECT	l_rect;
	long	id;
	long	i, j;
	short	r, g, b;
	short	break_fg;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  20 ),( &rect[0] )->h = (  60 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  20 ),( &rect[1] )->h = (  60 ) ;

	r = g = b = 255;
	break_fg = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			break_fg = 1;
			continue;
		}

		( &l_rect )->x = (  rect[id].x ),( &l_rect )->y = (  rect[id].y ),( &l_rect )->w = (  rect[id].w ),( &l_rect )->h = (  rect[id].h ) ;

		for(i = 0; i < 4; i++) {
			if(i == 0) {
				r = 255;
				g = 0;
				b = 0;
			} else if(i == 1) {
				r = 0;
				g = 255;
				b = 0;
			} else if(i == 2) {
				r = 0;
				g = 0;
				b = 255;
			} else if(i == 3) {
				r = 255;
				g = 255;
				b = 255;
			}
			for(j = 0; j < 16; j++) {
				ClearImage(&l_rect,r,g,b);
				DrawSync(0);
				if(i == 0) {
					r -= 16;
					if(r < 0) {
						r = 0;
					}
				} else if(i == 1) {
					g -= 16;
					if(g < 0) {
						g = 0;
					}
				} else if(i == 2) {
					b -= 16;
					if(b < 0) {
						b = 0;
					}
				} else {
					r -= 16;
					if(r < 0) {
						r = 0;
					}
					g -= 16;
					if(g < 0) {
						g = 0;
					}
					b -= 16;
					if(b < 0) {
						b = 0;
					}
				}
				l_rect.x += l_rect.w;
			}
			l_rect.y += l_rect.h;
			l_rect.x = rect[id].x;
		}
		VSync(2);
		GsSwapDispBuff();
	}
}

void mon_test_cross(void)
{
	RECT	rect[2];
	RECT	l_rect;
	long	id;
	long	i;
	short	break_fg;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			break_fg = 1;
			continue;
		}

		( &l_rect )->x = (  rect[id].x ),( &l_rect )->y = (  rect[id].y ),( &l_rect )->w = (  rect[id].w ),( &l_rect )->h = (  rect[id].h ) ;

		l_rect.w = 1;
		for(i = 0; i < 320; i += 16, l_rect.x += 16) {
			ClearImage(&l_rect,255,255,255);
			DrawSync(0);
		}
		l_rect.x--;
		ClearImage(&l_rect,255,255,255);
		DrawSync(0);

		( &l_rect )->x = (  rect[id].x ),( &l_rect )->y = (  rect[id].y ),( &l_rect )->w = (  rect[id].w ),( &l_rect )->h = (  rect[id].h ) ;

		l_rect.h = 1;
		for(i = 0; i < 240; i += 16, l_rect.y += 16) {
			ClearImage(&l_rect,255,255,255);
			DrawSync(0);
		}
		l_rect.y--;
		ClearImage(&l_rect,255,255,255);
		DrawSync(0);

		VSync(2);
		GsSwapDispBuff();
	}
}

void test_monitor_test(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 0 :
				mon_test_grad();
				break;
			case 1 :
				mon_test_cross();
				break;
			case 2 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select--;
			if(select < 0) {
				select = 3  - 1;
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			select++;
			if(select >= 3 ) {
				select = 0;
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", MonTestTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 3 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", MonTestStrTable[i]);
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", MonTestUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void reset_ads_data(void)
{
	gPowerOnTime = 0;
	gPlayTime = 0;
	gPlayCount = 0;
	V_Count = 0;
}

void test_ads_data(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	long	tmp0, tmp1, tmp2;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 5 ;
	while(1) {
		asm("break 1024")  ;
		gPowerOnTime = V_Count/60;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 4 :
				reset_ads_data();
				set_save_struct();
				save_time_eep();
				break;
			case 5 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select--;
			if(select < 4 ) {
				select = 6  - 1;
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			select++;
			if(select >= 6 ) {
				select = 4 ;
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", ADSTestTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 6 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", ADSTestStrTable[i]);
			FntPrint("~c888") ;
			{	long	i;	for(i = 0; i < ( 6 ); i++) {	FntPrint(" ");	}} ;
			switch(i) {
			case 0 :
				tmp0 = (gPowerOnTime)/3600;
				tmp1 = (gPowerOnTime)/60%60;
				tmp2 = (gPowerOnTime)%60;
				FntPrint("%4d\"%2d\'%2d", tmp0, tmp1, tmp2);
				break;
			case 1 :
				tmp0 = (gPlayTime)/3600;
				tmp1 = (gPlayTime)/60%60;
				tmp2 = (gPlayTime)%60;
				FntPrint("%4d\"%2d\'%2d", tmp0, tmp1, tmp2);
				break;
			case 2 :
				if((gPlayCount) == 0) {
					tmp0 = 0;
					tmp1 = 0;
					tmp2 = 0;
				} else {
					tmp0 = (gPlayTime)/(gPlayCount)/3600;
					tmp1 = (gPlayTime)/(gPlayCount)/60%60;
					tmp2 = (gPlayTime)/(gPlayCount)%60;
				}
				FntPrint("%4d\"%2d\'%2d", tmp0, tmp1, tmp2);
				break;
			case 3 :
				if((gPowerOnTime) == 0) {
					tmp0 = 0;
				} else {
					tmp0 = (gPlayTime)*100/(gPowerOnTime);
				}
				FntPrint("     %2d%%", tmp0);
				break;
			case 4 :
			case 5 :
				break;
			default:
				break;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", ADSTestUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void others_test_controller(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	long	cnt;

	long	tmpl;



	short	break_fg;
	short	select;
	short	mode;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	cnt = 0;
	break_fg = 0;
	select = 3 ;
	mode = 0 ;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padc[0] & (1<< 7) )>0 && (padc[0] & (1<< 5) )>0 && (padc[0] & (1<< 4) )>0) {
			break_fg = 1;
			continue;
		}
		if(mode == 0 ) {
			if((padd[0] & (1<< 4) )>0) {
				get_analog_value();
				tmpl = 0;
				for(i = 0; i < 10; i++) {
					asm("break 1024")  ;
					my_pad_read();
					tmpl += (long)padc[1];
					VSync(0);
				}
				gLeverValue[select] = (u_short)(tmpl/10);
 
				mode = 1 ;
				select = 0 ;
				cnt = 0;
			}
		} else {
			if((padd[0] & (1<< 4) )>0) {
				tmpl = 0;
				for(i = 0; i < 10; i++) {
					asm("break 1024")  ;
					my_pad_read();
					tmpl += (long)padc[1];
					VSync(0);
				}
				gLeverValue[select] = (u_short)(tmpl/10);
 
				if(select == 0 ) {
					select = 6 ;
				} else if(select == 6 ) {
					set_analog_value();
					set_save_struct();
					save_controller_eep();
					mode = 0 ;
				}
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		if(gControllerInitFlag) {
			FntPrint("~c800") ;
			FntPrint("%s", ContTestTitleStr2);
		} else {
			FntPrint("%s", ContTestTitleStr1);
		}
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		if(mode == 0 ) {
			for(i = 7 -1; i >= 0; i--) {
				if(i == 3 ) {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("N ");
				} else {
					{	long	i;	for(i = 0; i < ( 5 ); i++) {	FntPrint(" ");	}} ;
				}
				if(i == get_knotch(padc[1])) {
					FntPrint("~c080") ;
				} else {
					FntPrint("~c888") ;
				}
				if(i == 3 ) {
					FntPrint("----");
				} else {
					FntPrint("--");
				}
				FntPrint("~c888") ;
				if(i == 6 ) {
					FntPrint(" B");
				} else if(i == 3 ) {
					FntPrint(" SET");
				} else if(i == 0 ) {
					FntPrint(" P");
				}
				{	long	i;	for(i = 0; i < ( 1 ); i++) {	FntPrint("\n");	}} ;
			}
		} else {
			for(i = 7 -1; i >= 0; i--) {
				if(i == 3 ) {
					FntPrint("~c888") ;
					{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
					FntPrint("N ");
				} else {
					{	long	i;	for(i = 0; i < ( 5 ); i++) {	FntPrint(" ");	}} ;
				}
				if(select == 0 ) {
					if(i <= 3  && i > select) {
						FntPrint("~c800") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(select > 0  && select < 3 ) {
					if(i <= 3  && i > select) {
						FntPrint("~c800") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(select < 6  && select > 3 ) {
					if(i < select && i >= 0 ) {
						FntPrint("~c800") ;
					} else {
						FntPrint("~c888") ;
					}
				} else if(select == 6 ) {
					if(i < select && i >= 0 ) {
						FntPrint("~c800") ;
					} else {
						FntPrint("~c888") ;
					}
				}
				if(i == select) {
					if(((cnt / 10) % 2) == 0) {
						FntPrint("~c800") ;
					} else {
						FntPrint("~c888") ;
					}
				}
				if(i == 3 ) {
					FntPrint("----");
				} else {
					FntPrint("--");
				}
				FntPrint("~c888") ;
				if(i == 6 ) {
					FntPrint(" B");
				} else if(i == 3 ) {
					FntPrint(" SET");
				} else if(i == 0 ) {
					FntPrint(" P");
				}
				{	long	i;	for(i = 0; i < ( 1 ); i++) {	FntPrint("\n");	}} ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}

		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", ContTestUsageStr1);
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", ContTestUsageStr2);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
		cnt++;
	}
}

void others_test_data_ranking(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 1 ;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 1 :
				init_rank_struct();
				set_save_struct();
				save_score_eep();
				load_eeprom();
				break_fg = 1;
				break;
			case 2 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select = 1 ;
		}
		if((padd[0] & (1<< 5) )>0) {
			select = 2 ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", InitRankTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 3 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", InitRankStrTable[i]);
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", InitRankUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void init_option_defaults(void)
{
	gGameCost = gDefGameCost;
	gContCost = gDefContCost;
	gFreePlayFlag = gDefFreePlayFlag;
	gGameDifficulty = gDefGameDifficulty;
	gSoundAttractFlag = gDefSoundAttractFlag;
}

void others_test_data_defaults(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 1 ;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 1 :
				init_option_defaults();
				set_save_struct();
				save_option_eep();
				load_eeprom();
				break_fg = 1;
				break;
			case 2 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select = 1 ;
		}
		if((padd[0] & (1<< 5) )>0) {
			select = 2 ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", InitDefaultsTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 3 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", InitDefaultsStrTable[i]);
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", InitDefaultsUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void others_test_data_clear(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 0 :
				others_test_data_ranking();
				break;
			case 1 :
				others_test_data_defaults();
				break;
			case 2 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select--;
			if(select < 0) {
				select = 3  - 1;
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			select++;
			if(select >= 3 ) {
				select = 0;
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", OthersTestDataTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 3 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", OthersTestDataStrTable[i]);
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", OthersTestDataUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void test_others(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 0 :
				others_test_controller();
				break;
			case 1 :
				others_test_data_clear();
				break;
			case 2 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select--;
			if(select < 0) {
				select = 3  - 1;
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			select++;
			if(select >= 3 ) {
				select = 0;
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", OthersTestTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 3 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", OthersTestStrTable[i]);
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", OthersTestUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

void test_mode(void)
{
	RECT	rect[2];
	long	id;
	long	i;
	short	break_fg;
	short	select;

	( &rect[0] )->x = (    0 ),( &rect[0] )->y = (    0 ),( &rect[0] )->w = (  320 ),( &rect[0] )->h = (  240 ) ;
	( &rect[1] )->x = (    0 ),( &rect[1] )->y = (  240 ),( &rect[1] )->w = (  320 ),( &rect[1] )->h = (  240 ) ;

	break_fg = 0;
	select = 0;
	while(1) {
		asm("break 1024")  ;
		id=GsGetActiveBuff();
		ClearImage(&rect[id],0,0,0);
		my_pad_read();
		if(break_fg) {
			set_save_struct();
			save_eeprom();
			break;
		}
		if((padd[0] & (1<< 4) )>0) {
			switch(select) {
			case 0 :
				test_coin_option();
				break;
			case 1 :
				test_game_option();
				break;
			case 2 :
				test_io_test();
				break;
			case 3 :
				test_sound_test();
				break;
			case 4 :
				test_monitor_test();
				break;
			case 5 :
				test_ads_data();
				break;
			case 6 :
				test_others();
				break;
			case 7 :
				break_fg = 1;
				break;
			default:
				break;
			}
			if(break_fg) {
				continue;
			}
		}
		if((padd[0] & (1<< 7) )>0) {
			select--;
			if(select < 0) {
				select = 8  - 1;
			}
		}
		if((padd[0] & (1<< 5) )>0) {
			select++;
			if(select >= 8 ) {
				select = 0;
			}
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 3 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", MenuTitleStr);
		{	long	i;	for(i = 0; i < ( 4 ); i++) {	FntPrint("\n");	}} ;
		for(i = 0; i < 8 ; i++) {
			if(select == i) {
				FntPrint("~c800") ;
			} else {
				FntPrint("~c888") ;
			}
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
			FntPrint("%s", MenuStrTable[i]);
			{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		}
		FntPrint("~c888") ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint("\n");	}} ;
		{	long	i;	for(i = 0; i < ( 2 ); i++) {	FntPrint(" ");	}} ;
		FntPrint("%s", MenuUsageStr);
		FntFlush(-1);
		VSync(2);
		GsSwapDispBuff();
	}
}

Linker Mapfile

A mapfile from the linker has also been left over.

    Start     Stop   Length      Obj Group            Section name
 80010000 80013FFB 00003FFC 80010000 text             .rdata
 80013FFC 80068227 0005422C 80013FFC text             .text
 80068228 80071723 000094FC 80068228 text             .data
 80071724 80071A2F 0000030C 80071724 text             .sdata
 80071A30 80071D4F 00000320 80071A30 bss              .sbss
 80071D50 803800CF 0030E380 80071D50 bss              .bss

Program entry point : 00000000


  Address  Names alphabetically
 80071B00  ADB01
 80071B04  ADB12
 80071B10  ADB23
 80071B12  ADB34
 80071B18  ADB45
 80071B20  ADB56
 80071AC8  ADS0
 80071ACA  ADS1
 80071ACC  ADS2
 80071ACE  ADS3
 80071AD0  ADS4
 80071AD2  ADS5
 80071AD4  ADS6
 80069374  ADSTestStrTable
 80071968  ADSTestTitleStr
 8007196C  ADSTestUsageStr
 80071B42  ADlim_max
 80071B40  ADlim_min
 80071B84  ADmax
 80071B82  ADmin
 80071B80  ADval
 800E79D8  ALLot
 8005BB08  AddPrim
 80060138  ApplyMatrixLV
 800E7948  BGot
 80071B3C  BIdx
 80071CD0  BLBlockMax
 80071CAC  BLDataBuf
 80107A50  BLGeomMdlData
 80071BF4  BLObjDataBuf
 80071C04  BLObjDataMax
 80071C1C  BLObjFileNum
 80071BF0  BLObjMdlData
 80071C34  BLObjPosOffsetY
 80107A40  BLRailMdlData
 80107B70  BLRoot
 80071CBC  BLTotalBaseMax
 80071C84  BLTransTable
 80071CD4  BRBlockMax
 80071CB0  BRDataBuf
 80107A70  BRGeomMdlData
 80071C00  BRObjDataBuf
 80071C10  BRObjDataMax
 80071C20  BRObjFileNum
 80071BFC  BRObjMdlData
 80071C38  BRObjPosOffsetY
 80107A60  BRRailMdlData
 80107BC0  BRRoot
 80071CC0  BRTotalBaseMax
 80071C88  BRTransTable
 80071C90  BankIdx
 80071B4C  Base
 80108E48  BgBox
 80108370  BgImage
 80071D00  BgPos
 80071CF8  BgRevFlag
 80071AE4  BgScroll
 80108C98  BgSp
 80071CA4  BlockMax
 80068234  BreakParmTable
 80071C98  CDataBuf
 8037FDE0  CLIP2
 80071910  COptCoinStr1
 80071914  COptCoinStr2
 80069324  COptStrTable
 80071904  COptTitleStr1
 80071908  COptTitleStr2
 8007190C  COptUsageStr
 80107C60  CRoot
 80071C7C  CTransTable
 80067638  ChangeClearPAD
 80067628  ChangeClearRCnt
 80066C3C  CheckCallback
 80058F98  ClearImage
 80059028  ClearImage2
 80059238  ClearOTag
 80059300  ClearOTagR
 80071D78  ClearedCourseFlag
 80071DD8  ClearedCourseTable
 80071A80  ClutLoadFlag
 8005BDD8  CompMatrix
 80071B68  ContCount
 80071980  ContTestTitleStr1
 80071984  ContTestTitleStr2
 80071988  ContTestUsageStr1
 8007198C  ContTestUsageStr2
 80071A38  CountSpriteFlag
 80071A70  CourseCount
 80071B7C  CourseCountMax
 80071B64  CourseIdx
 80071C50  CurrentKnotch
 80066B48  DMACallback
 8037FDF0  DSTACK
 800691B4  DataName
 800677C0  DecDCTBufSize
 8006769C  DecDCTGetEnv
 80067728  DecDCTPutEnv
 80067668  DecDCTReset
 800677CC  DecDCTin
 800678E0  DecDCTinCallback
 80067868  DecDCTinSync
 80067848  DecDCTout
 80067904  DecDCToutCallback
 800678A4  DecDCToutSync
 80067D28  DecDCTvlc2
 80068078  DecDCTvlcBuild
 80067CF8  DecDCTvlcSize2
 80071BD4  DispBlockMax
 80071BD0  DispBlockMin
 80071AB0  DispClearFlag
 80071BC0  DmaWaitFlag
 80071B74  DownCount
 80071A5C  DownOffsetX
 80071A60  DownOffsetY
 80071A64  DownOffsetZ
 80071B60  DownSpeed
 80059408  DrawOTag
 8005B958  DrawOTag2
 80059538  DrawOTagEnv
 800593AC  DrawPrim
 80058E14  DrawSync
 80058D1C  DrawSyncCallback
 80071CCC  EDBlockMax
 80071CA8  EDDataBuf
 80107A30  EDGeomMdlData
 80071BE8  EDObjDataBuf
 80071BF8  EDObjDataMax
 80071C14  EDObjFileNum
 80071BEC  EDObjMdlData
 80071C30  EDObjPosOffsetY
 80107A20  EDRailMdlData
 80107B20  EDRoot
 80071CB4  EDTotalBaseMax
 80071C80  EDTransTable
 80071AA8  EDataMax
 80072450  EDataTable
 80071AA0  EObjFlag
 800675C8  EnterCriticalSection
 8004D7F4  ErrorsMessage
 80107CF0  EventImageL
 80107D10  EventImageR
 80108420  EventSpL
 80108448  EventSpR
 8006913C  EventTexName
 800675D8  ExitCriticalSection
 80071A6C  ExtendPower
 80071B50  ExtraGameClearCount
 80071AAC  ExtraGameClearFlag
 80071B38  ExtraGameClearSpeed
 80071AC0  ExtraGameClearTime
 80071A44  ExtraGameEndFlag
 80071ABC  ExtraGameFlag
 80071B1C  ExtraGameOverCount
 80071A8C  ExtraGameOverFlag
 80071ADC  ExtraGameOverSpeed
 80071A90  ExtraGameOverTime
 80071A84  ExtraGameWaitFlag
 80071B5C  ExtraResetFlag
 80071A7C  FGCount
 80107D30  FGImage
 80108C50  FGSp
 80068FB8  FGTextureName
 80067608  FlushCache
 80058110  FntFlush
 80057DB8  FntLoad
 80057E58  FntOpen
 8005842C  FntPrint
 800693F4  Font
 80071D44  FrameMax
 80069FD4  GEnv
 80069340  GOptDifStr
 80069334  GOptStrTable
 80071924  GOptTitleStr1
 80071928  GOptTitleStr2
 8007192C  GOptUsageStr
 80067618  GPU_cw
 80069FD0  GPU_printf
 80071CF0  G_Count
 80071B48  GameClearCount
 80071AA4  GameClearFlag
 80071B34  GameClearSpeed
 80071A40  GameEndFlag
 80071AC4  GameMode
 80071AFC  GameOverCount
 80071A78  GameOverFlag
 80071AD8  GameOverSpeed
 80071A74  GameWaitFlag
 80071BC8  GeomDivMode
 80107A10  GeomMdlData
 80069250  GeomName
 8005BAE8  GetClut
 80059B3C  GetDispEnv
 80059610  GetDrawEnv
 80058D0C  GetGraphDebug
 80066C4C  GetIntrMask
 80059B70  GetODE
 8005BAA8  GetTPage
 8006757C  GetVideoMode
 80065F78  GsA4divNF3
 80064158  GsA4divNF4
 80064BE8  GsA4divNG3
 80063588  GsA4divNG4
 800655A8  GsA4divTNF3
 800629B8  GsA4divTNF4
 8006F5FA  GsADIVH
 8006F5F8  GsADIVW
 8006F5F4  GsADIVZ
 8037FF58  GsBACKC
 8037FE78  GsCLIP3far
 8037FE80  GsCLIP3near
 80060E98  GsClearOt
 8037FDC8  GsDISPENV
 8037FF78  GsDISPON
 8037FD68  GsDRAWENV
 80060638  GsDefDispBuff
 80060E68  GsDrawOt
 8037FF88  GsFCALL4
 8005F9F8  GsGetActiveBuff
 80061CC8  GsGetLs
 80061A08  GsGetLw
 80061198  GsGetTimInfo
 8037FEF8  GsIDMATRIX
 8037FF38  GsIDMATRIX2
 800606D8  GsInit3D
 8005FCD8  GsInitCoord2param
 8005FC68  GsInitCoordinate2
 8005F4A8  GsInitGraph
 8005F638  GsInitGraph2
 8037FE88  GsLIGHTWSMATRIX
 8037FE7C  GsLIGHT_MODE
 8037FF64  GsLIGNR
 8037FF5C  GsLIOFF
 8037FF60  GsLMODE
 80061F98  GsLinkObject4
 8037FF74  GsMATE_C
 80060758  GsMapModelingData
 8005FDF4  GsMulCoord0
 8005FE84  GsMulCoord2
 8005FF04  GsMulCoord3
 8037FF80  GsNDIV
 8037FDDC  GsORGOFSX
 8037FDDE  GsORGOFSY
 8037FF70  GsOUT_PACKET_P
 80060E18  GsSetAmbient
 8005FB38  GsSetDrawBuffClip
 8005FA08  GsSetDrawBuffOffset
 800607F8  GsSetFlatLight
 8005FD30  GsSetLightMatrix
 8005FDC4  GsSetLightMatrix2
 80060D98  GsSetLightMode
 8005FD04  GsSetLsMatrix
 800607C8  GsSetProjection
 80061368  GsSetRefView2
 80061358  GsSetWorkBase
 8005ED38  GsSortBoxFill
 8005F8C0  GsSortClear
 80062128  GsSortObject4J
 80060EF8  GsSortOt
 8005EEB8  GsSortSpriteB
 8005FBB8  GsSwapDispBuff
 8005CA94  GsTMDfastF3L
 8005CBDC  GsTMDfastF3LFG
 8005C954  GsTMDfastF3NL
 8005CFFC  GsTMDfastF4L
 8005D174  GsTMDfastF4LFG
 8005CE90  GsTMDfastF4NL
 8005D580  GsTMDfastG3L
 8005D710  GsTMDfastG3LFG
 8005D440  GsTMDfastG3NL
 8005DB9C  GsTMDfastG4L
 8005DD7C  GsTMDfastG4LFG
 8005DA28  GsTMDfastG4NL
 8005C818  GsTMDfastNF3
 8005CD28  GsTMDfastNF4
 8005D2F8  GsTMDfastNG3
 8005D8A8  GsTMDfastNG4
 8005E238  GsTMDfastTF3L
 8005E3A8  GsTMDfastTF3LFG
 8005E0D4  GsTMDfastTF3NL
 8005E854  GsTMDfastTF4L
 8005EA00  GsTMDfastTF4LFG
 8005E6B8  GsTMDfastTF4NL
 8005DF68  GsTMDfastTNF3
 8005E518  GsTMDfastTNF4
 8037FF7C  GsTON
 8037FF68  GsTRATE
 8037FF18  GsWSMATRIX
 8037FED8  GsWSMATRIX_ORG
 8037FF6C  GsZOVER
 80061288  Gssub_make_matrix
 8037FE70  HWD0
 8006F614  Hcount
 800675B8  HookEntryInt
 8006934C  IOTestStrTable
 80071944  IOTestTitleStr1
 80071948  IOTestTitleStr2
 8007194C  IOTestUsageStr
 8004D7A4  Init2D
 80040A78  InitBG
 800693B0  InitDefaultsStrTable
 800719A8  InitDefaultsTitleStr
 800719AC  InitDefaultsUsageStr
 8004C6B4  InitFG
 80042148  InitGCount
 80061010  InitGeom
 800675F8  InitHeap
 80067640  InitPAD
 800693A4  InitRankStrTable
 80071990  InitRankTitleStr
 800719A4  InitRankUsageStr
 8004216C  InitSP
 8004CCF0  InitStaff
 8004210C  InitVCount
 80066B18  InterruptCallback
 8002680C  IoInit
 800725A0  LEDArea
 80071C9C  LEDDatBuf
 8007187C  LEDDataFileName
 80071CA0  LEDHdrBuf
 80071878  LEDHeaderFileName
 80071CD8  LPBlockMax
 80071CB8  LPDataBuf
 80107A90  LPGeomMdlData
 80071C08  LPObjDataBuf
 80071C18  LPObjDataMax
 80071C24  LPObjFileNum
 80071C0C  LPObjMdlData
 80071C3C  LPObjPosOffsetY
 80107A80  LPRailMdlData
 80107C10  LPRoot
 80071CC4  LPTotalBaseMax
 80071C8C  LPTransTable
 80071AB4  LandFlag
 80071A54  LastBlkRotZ
 80071B24  LastCourseIdx
 80071B88  LastMilSec
 80071A98  LastPos
 80071AF0  LastRotY
 80071AF8  LastRotZ
 80107AA0  LastView
 800588E0  LoadClut
 80058944  LoadClut2
 80071AB8  LoadFlag
 800590C0  LoadImage
 8005B63C  LoadImage2
 800587F8  LoadTPage
 80071B78  LoopCount
 80071A58  LoopOutFlag
 80071B30  LoopStartTime
 80071E10  LpClutBuf
 8004DED0  MEMalloc
 8004DFD8  MEMfree
 8004E034  MEMfree2
 8004E0D8  MEMgetFreeSize
 8004E120  MEMgetHeapPointer
 8004E09C  MEMgetUseSize
 8004DEAC  MEMinit
 8004E168  MEMsetUseSize
 80071B8C  MVCowCount
 80071A50  MVFukiCount
 80068228  MaxSpeedTable
 80069304  MenuStrTable
 800718EC  MenuTitleStr
 80071900  MenuUsageStr
 80069368  MonTestStrTable
 80071960  MonTestTitleStr
 80071964  MonTestUsageStr
 80059180  MoveImage
 8005B814  MoveImage2
 80071B02  MovieIdx
 80071A9C  MovieTimeOut
 800603E8  MulMatrix
 80060028  MulMatrix0
 800604F8  MulMatrix2
 80071B2C  NextCourseIdx
 80071B08  NextCourseIdxTable
 80071B28  NextReadyCourseIdx
 800268F8  Nop
 80072130  NtClutBuf
 80071B44  OIdx
 80071C40  ObjDataBuf
 80071C48  ObjDataMax
 800691E8  ObjDataName
 80071BD8  ObjDivMode
 80069284  ObjFPCName
 80071C4C  ObjFileNum
 80071C44  ObjMdlData
 80071BE0  ObjMoveCMax
 80071C28  ObjMoveCount
 80071BE4  ObjMoveFlag
 80071C2C  ObjPosOffsetY
 80068240  ObjPosYOffsetTable
 80071A68  Offset
 80069398  OthersTestDataStrTable
 80071978  OthersTestDataTitleStr
 8007197C  OthersTestDataUsageStr
 8006938C  OthersTestStrTable
 80071970  OthersTestTitleStr
 80071974  OthersTestUsageStr
 80067660  PAD_dr
 80067658  PAD_init
 8004DD54  PCgetBytesFromFpack
 8004DBE4  PCgetOffsetFromFpack
 8004DA60  PCgetPointerFromFpack
 8004D854  PCsetDeviceMode
 8037FD60  POSITION
 8037FD58  PSDBASEX
 8037FD5C  PSDBASEY
 8037FDE8  PSDCNT
 8037FDEE  PSDGPU
 8037FDEC  PSDIDX
 8037FD50  PSDOFSX
 8037FD54  PSDOFSY
 803800C8  PadIdentifier
 80066838  PadInit
 80066884  PadRead
 800668AC  PadStop
 80057988  PioCallback
 80057964  PioDataCallback
 80057A50  PioGetConfig
 80057C40  PioGetImask
 80057C58  PioGetIreg
 800579AC  PioPutConfig
 80057C1C  PioPutImask
 80057AF4  PioReadBurst
 80057B48  PioReadSlice
 80057C94  PioReadUserBit
 80057BF8  PioSetImask
 80057B1C  PioWriteBurst
 80057B6C  PioWriteSlice
 80057C70  PioWriteUserBit
 80071A88  PlayDemoFlag
 8006033C  PopMatrix
 80071B14  Pos
 80071A3C  Power
 80060298  PushMatrix
 80059644  PutDispEnv
 80059478  PutDrawEnv
 80071BCC  RailDivMode
 80107A00  RailMdlData
 8006921C  RailName
 80071D50  RankBeg
 80071AE8  RankPlay
 80071DB0  RankPro
 800692EC  RankingTitle1
 800692F8  RankingTitle2
 8005F418  ReadGeomScreen
 800413D0  ResetBG
 80066AE8  ResetCallback
 800675A8  ResetEntryInt
 80071B54  ResetFlag
 80058A98  ResetGraph
 80066C0C  RestartCallback
 80067598  ReturnFromException
 8005C0A8  RotMatrix
 8005C338  RotMatrixX
 8005C4D8  RotMatrixY
 8005C678  RotMatrixZ
 8005F428  RotTransPers4
 80107D50  SPImage
 8006905C  SPTextureName
 800E7970  SPot
 8006A934  SQRT
 8005BF68  ScaleMatrix
 800415FC  ScrollBG
 80060E48  SetBackColor
 80060D68  SetColorMatrix
 80058A5C  SetDefDispEnv
 800589A8  SetDefDrawEnv
 80058D7C  SetDispMask
 80059BD8  SetDrawArea
 80059D3C  SetDrawEnv
 80059CE8  SetDrawMode
 80059C58  SetDrawOffset
 80059CC0  SetDrawStp
 80057D78  SetDumpFnt
 80061098  SetFarColor
 8005FB18  SetGeomOffset
 800607E8  SetGeomScreen
 80058C0C  SetGraphDebug
 80058C68  SetGraphQueue
 80066C64  SetIntrMask
 80060608  SetLightMatrix
 80059C98  SetPriority
 8005F3C8  SetRotMatrix
 8005BB68  SetSemiTrans
 8005BB98  SetSprt8
 80059BA0  SetTexWindow
 8005BBB8  SetTile
 8005F3F8  SetTransMatrix
 80067568  SetVideoMode
 80041E38  SortBG
 8004B488  SortContinueCounter
 8004C990  SortFG
 8004CB88  SortFadeFG
 8004C258  SortFontSP
 8004B100  SortNameEntryCountSP
 80049334  SortPowerNumSP
 8004B5B0  SortRankingSP
 800474B8  SortSP
 80049AA0  SortScoreNumSP
 80048F90  SortSpeedNumSP
 8004D3A4  SortStaff
 8004A19C  SortTimeNumSP
 800327BC  SortWorld
 80071954  SoundTestStrTable
 80071950  SoundTestTitleStr
 8007195C  SoundTestUsageStr
 80071B90  Speed
 80071A4C  SpeedH
 80108470  SpriteSp
 8005BD48  SquareRoot0
 80071CE0  SrcDataBuf
 80107CB0  StaffImage0
 80107CD0  StaffImage1
 80108390  StaffSp0
 801083D8  StaffSp1
 80067648  StartPAD
 80071A48  StartPower
 80071AE0  StatFlag
 80066BDC  StopCallback
 80067650  StopPAD
 80059120  StoreImage
 8005B728  StoreImage2
 80071CEC  Sx_max
 80071CE8  Sx_min
 80071CEE  Sy_max
 80071CEA  Sy_min
 800718D4  TModeBoolStr
 8005BB48  TermPrim
 800692B8  TexFPCName
 80071A94  TmpRotY
 80071A96  TmpRotZ
 80071B70  TmpScroll
 80071AF4  TmpSpeed
 80071B58  TotalBase
 80071C94  TotalBaseMax
 80071A30  TrTimCount
 80071B6C  TrainType
 8005BF38  TransMatrix
 80061908  TransposeMatrix
 800668D8  VSync
 80066B78  VSyncCallback
 80066BAC  VSyncCallbacks
 8037FE74  VWD0
 80071CF4  V_Count
 80070744  Vcount
 80107AB0  ViewWorld
 800420B0  VsyncCallBack
 800E7920  Wot
 800E7A00  ZSortTable
 800E7998  ZSortTable_all
 800E78E0  ZSortTable_bg
 800E7900  ZSortTable_sp
 800675E8  _96_remove
 8037FEA8  _LC
 80057CBC  __SN_ENTRY_POINT
 80071724  __SN_GP_BASE
 80071D50  __bss_obj
 803800BC  __bss_objend
 80071D50  __bss_org
 803800BC  __bss_orgend
 0030E36C  __bss_size
 80010000  __ctors_obj
 80010000  __ctors_objend
 80010000  __ctors_org
 80010000  __ctors_orgend
 00000000  __ctors_size
 80068228  __data_obj
 80071722  __data_objend
 80068228  __data_org
 80071722  __data_orgend
 000094FA  __data_size
 80010000  __dtors_obj
 80010000  __dtors_objend
 80010000  __dtors_org
 80010000  __dtors_orgend
 00000000  __dtors_size
 80057CB4  __main
 80010000  __rdata_obj
 80013FF9  __rdata_objend
 80010000  __rdata_org
 80013FF9  __rdata_orgend
 00003FF9  __rdata_size
 80071A30  __sbss_obj
 80071D34  __sbss_objend
 80071A30  __sbss_org
 80071D34  __sbss_orgend
 00000304  __sbss_size
 80071724  __sdata_obj
 80071A29  __sdata_objend
 80071724  __sdata_org
 80071A29  __sdata_orgend
 00000305  __sdata_size
 80013FFC  __text_obj
 80068228  __text_objend
 80013FFC  __text_org
 80068228  __text_orgend
 0005422C  __text_size
 80071A30  _bss_obj
 803800D0  _bss_objend
 80071A30  _bss_org
 803800D0  _bss_orgend
 0030E6A0  _bss_size
 8005EE18  _make_packet
 800610B8  _patch_gte
 8006A0FC  _qin
 8006A100  _qout
 8037E530  _que
 800693F0  _ramsize
 800693EC  _stacksize
 8004D990  _strupr
 80010000  _text_obj
 80071A30  _text_objend
 80010000  _text_org
 80071A30  _text_orgend
 00061A30  _text_size
 80071C78  bytes
 8002D7A0  cb_func
 80025DC0  change_loop_clut
 80038198  chg_rail_color
 80026A1C  chk_coin_sw
 8001D8F0  chk_hit
 8002696C  chk_service_sw
 80026924  chk_test_mode
 80026ACC  chk_test_sw
 8003D494  copy_data
 80021900  course_select
 80026CA0  dec_cont_cost
 80026B1C  dec_game_cost
 80027E20  disp_JVS_mon
 80022A20  disp_aenamco
 80027748  disp_first_power_on
 80022834  disp_namco
 80022C0C  disp_notice
 800238E8  disp_staff
 8002D5C8  dma_copy
 8002D52C  dma_fs_init
 8002D8A4  draw_obj
 80032808  draw_obj_ex
 80068168  exit
 80026098  extra_game
 8002D410  fpc_hdr_init
 80379EB8  gAPSave
 80071CC8  gBaseHeap
 80071C70  gCamDist
 80071C74  gCamOffset
 8007191E  gContCost
 80071D26  gControllerInitFlag
 8007191C  gDefContCost
 80071920  gDefFreePlayFlag
 80071918  gDefGameCost
 8007193A  gDefGameDifficulty
 8007193E  gDefSoundAttractFlag
 8007175C  gDumpADCount
 8007175A  gDumpADFlag
 80071CFC  gFGBtnStat
 80071A34  gFGDispFlag
 80071922  gFreePlayFlag
 8007191A  gGameCost
 8007193C  gGameDifficulty
 80071BBA  gGraphStopFlag
 80071D24  gLastCoinCount
 80071D1C  gLastServiceCount
 80379EA8  gLeverValue
 80071D10  gPlayCount
 80071D14  gPlayStart
 80071D20  gPlayTime
 80071D18  gPowerOnTime
 80071940  gSoundAttractFlag
 80071BB8  gTestModeFlag
 8001EDF8  game_end_title
 8001E8E0  get_analog_value
 8001C80C  get_ave_rot_y
 8001D000  get_ave_rot_z
 80026D8C  get_cont_credit
 80026C08  get_game_credit
 8001E504  get_knotch
 80021F40  get_next_course
 8001C6C8  get_rot_y
 8001CE4C  get_rot_z
 8002C4F8  get_save_struct
 80060FB8  gte_init
 80061948  gte_rotate_z_matrix
 80071D38  imgbuf
 8001E6B8  init_ADval
 8001A9A0  init_data
 8001AD54  init_edata
 8001A904  init_lp_data
 80055074  init_option_defaults
 8002D164  init_rank_struct
 8002B018  init_save_struct
 8001A784  init_sys
 80026480  init_sys12
 8002D3D8  init_system_globals
 8001C388  init_val
 8001F244  is_continue
 8002D7C4  jt_init4
 8001AAB8  light_init
 800409C0  load_LED_dat
 80040908  load_LED_hdr
 80040068  load_bs
 8003D634  load_cdata
 8003EA2C  load_count_sprite
 8003DB0C  load_course_sprite
 80029604  load_eeprom
 8003D8F8  load_event_texture
 8003FDFC  load_fg
 80039EC0  load_lp_cdata
 8003AE80  load_lp_model
 8003D0C4  load_lp_odata
 8003A8F4  load_lp_texture
 8003EEAC  load_model
 8003F76C  load_odata
 8003EB50  load_rank_sprite
 8003D390  load_src_data
 8003FEF8  load_staff
 8003EC6C  load_texture
 8003E208  load_train_texture
 80013FFC  main
 80071D30  mdec_frame
 800681D8  memcpy
 800681E8  memset
 80035A7C  model_init
 80052BD8  mon_test_cross
 800527A0  mon_test_grad
 800150DC  move_obj
 80023E60  move_obj_ex
 800398F4  my_pad_init
 80039948  my_pad_read
 8002217C  my_random
 8001DF64  my_set_idx
 80026E24  my_sw_read
 80022DF8  name_entry
 800148E4  obj_interactive
 80023B84  obj_interactive_ex
 80068274  op_bs_name
 80053F14  others_test_controller
 80055548  others_test_data_clear
 800550D0  others_test_data_defaults
 80054BFC  others_test_data_ranking
 800564B4  out_callback
 800725E0  out_packet
 80071C58  padc
 80071C60  padd
 80071C68  pads
 8005673C  play_bs
 80022214  play_demo
 800270FC  print_ad_value
 8001EC4C  print_lever_value
 8005FF84  print_matrix
 80027148  print_se_stat
 8005FFF4  print_vector
 80068218  printf
 80072570  pslt
 80068180  puts
 800681F8  rand
 8005EBB8  ratan2
 8006EAB4  ratan_tbl
 8005BCA8  rcos
 8006AAB4  rcossin_tbl
 8003D460  reload_src_data
 80053478  reset_ads_data
 8005BBD8  rsin
 8006A124  rsin_tbl
 8002A484  save_controller_eep
 8002AFC8  save_eeprom
 8002A194  save_id_eep
 8002A248  save_option_eep
 8002A734  save_score_eep
 8002A324  save_time_eep
 80035DDC  setBLObjPos
 80036050  setBLPos
 8003637C  setBRObjPos
 800365F0  setBRPos
 800376C4  setCoursePos
 80036FF0  setEDObjPos
 80037264  setEDPos
 8003691C  setLPObjPos
 80036B90  setLPPos
 80034EEC  setMVCowPos
 80035544  setMVFukiPos
 80033D6C  setMVObjPos
 80033AF8  setObjPos
 8001E954  set_analog_value
 80021D54  set_bl
 80021E00  set_br
 80021EAC  set_end
 80021CA4  set_loop
 8002BA70  set_save_struct
 80068198  setjmp
 8005BC14  sin_1
 800271C4  snd_reg_set
 8002771C  snd_reset
 800272D4  snd_se
 800275E4  snd_se_all_mute
 8002721C  snd_se_busy
 800274D8  snd_se_fadeout
 800273CC  snd_se_mute
 80068208  srand
 80068CE8  st1_bs_name
 80068D60  st2_bs_name
 80068DD8  st3_bs_name
 80068E50  st4_bs_name
 80068EC8  st5_bs_name
 80068F40  st6_bs_name
 800672C8  startIntrDMA
 800671A8  startIntrVSync
 80029470  startLED
 800681A8  strcmp
 800681B8  strcpy
 800681C8  strlen
 80057D5C  stup0
 80057CE0  stup1
 80057CBC  stup2
 800685E0  t1_bs_name
 8006870C  t2_bs_name
 80068838  t3_bs_name
 80068964  t4_bs_name
 80068A90  t5_bs_name
 80068BBC  t6_bs_name
 800534AC  test_ads_data
 8004E1B8  test_coin_option
 8004EFEC  test_game_option
 8004FAA0  test_io_test
 80055F58  test_mode
 80052F70  test_monitor_test
 80055A50  test_others
 800508C4  test_sound_test
 8001AC14  texture_init
 8001FC44  title_main
 800210EC  train_select
 800284D4  transLED
 80107B00  view
 80039A00  view_init
 80071D3C  vlcbuf0
 80071D40  vlcbuf1



  Address  Names in address order
 00000000  __dtors_size
 00000000  __ctors_size
 00000304  __sbss_size
 00000305  __sdata_size
 00003FF9  __rdata_size
 000094FA  __data_size
 0005422C  __text_size
 00061A30  _text_size
 0030E36C  __bss_size
 0030E6A0  _bss_size
 80010000  _text_org
 80010000  _text_obj
 80010000  __rdata_org
 80010000  __rdata_obj
 80010000  __dtors_orgend
 80010000  __dtors_org
 80010000  __dtors_objend
 80010000  __dtors_obj
 80010000  __ctors_orgend
 80010000  __ctors_org
 80010000  __ctors_objend
 80010000  __ctors_obj
 80013FF9  __rdata_orgend
 80013FF9  __rdata_objend
 80013FFC  main
 80013FFC  __text_org
 80013FFC  __text_obj
 800148E4  obj_interactive
 800150DC  move_obj
 8001A784  init_sys
 8001A904  init_lp_data
 8001A9A0  init_data
 8001AAB8  light_init
 8001AC14  texture_init
 8001AD54  init_edata
 8001C388  init_val
 8001C6C8  get_rot_y
 8001C80C  get_ave_rot_y
 8001CE4C  get_rot_z
 8001D000  get_ave_rot_z
 8001D8F0  chk_hit
 8001DF64  my_set_idx
 8001E504  get_knotch
 8001E6B8  init_ADval
 8001E8E0  get_analog_value
 8001E954  set_analog_value
 8001EC4C  print_lever_value
 8001EDF8  game_end_title
 8001F244  is_continue
 8001FC44  title_main
 800210EC  train_select
 80021900  course_select
 80021CA4  set_loop
 80021D54  set_bl
 80021E00  set_br
 80021EAC  set_end
 80021F40  get_next_course
 8002217C  my_random
 80022214  play_demo
 80022834  disp_namco
 80022A20  disp_aenamco
 80022C0C  disp_notice
 80022DF8  name_entry
 800238E8  disp_staff
 80023B84  obj_interactive_ex
 80023E60  move_obj_ex
 80025DC0  change_loop_clut
 80026098  extra_game
 80026480  init_sys12
 8002680C  IoInit
 800268F8  Nop
 80026924  chk_test_mode
 8002696C  chk_service_sw
 80026A1C  chk_coin_sw
 80026ACC  chk_test_sw
 80026B1C  dec_game_cost
 80026C08  get_game_credit
 80026CA0  dec_cont_cost
 80026D8C  get_cont_credit
 80026E24  my_sw_read
 800270FC  print_ad_value
 80027148  print_se_stat
 800271C4  snd_reg_set
 8002721C  snd_se_busy
 800272D4  snd_se
 800273CC  snd_se_mute
 800274D8  snd_se_fadeout
 800275E4  snd_se_all_mute
 8002771C  snd_reset
 80027748  disp_first_power_on
 80027E20  disp_JVS_mon
 800284D4  transLED
 80029470  startLED
 80029604  load_eeprom
 8002A194  save_id_eep
 8002A248  save_option_eep
 8002A324  save_time_eep
 8002A484  save_controller_eep
 8002A734  save_score_eep
 8002AFC8  save_eeprom
 8002B018  init_save_struct
 8002BA70  set_save_struct
 8002C4F8  get_save_struct
 8002D164  init_rank_struct
 8002D3D8  init_system_globals
 8002D410  fpc_hdr_init
 8002D52C  dma_fs_init
 8002D5C8  dma_copy
 8002D7A0  cb_func
 8002D7C4  jt_init4
 8002D8A4  draw_obj
 800327BC  SortWorld
 80032808  draw_obj_ex
 80033AF8  setObjPos
 80033D6C  setMVObjPos
 80034EEC  setMVCowPos
 80035544  setMVFukiPos
 80035A7C  model_init
 80035DDC  setBLObjPos
 80036050  setBLPos
 8003637C  setBRObjPos
 800365F0  setBRPos
 8003691C  setLPObjPos
 80036B90  setLPPos
 80036FF0  setEDObjPos
 80037264  setEDPos
 800376C4  setCoursePos
 80038198  chg_rail_color
 800398F4  my_pad_init
 80039948  my_pad_read
 80039A00  view_init
 80039EC0  load_lp_cdata
 8003A8F4  load_lp_texture
 8003AE80  load_lp_model
 8003D0C4  load_lp_odata
 8003D390  load_src_data
 8003D460  reload_src_data
 8003D494  copy_data
 8003D634  load_cdata
 8003D8F8  load_event_texture
 8003DB0C  load_course_sprite
 8003E208  load_train_texture
 8003EA2C  load_count_sprite
 8003EB50  load_rank_sprite
 8003EC6C  load_texture
 8003EEAC  load_model
 8003F76C  load_odata
 8003FDFC  load_fg
 8003FEF8  load_staff
 80040068  load_bs
 80040908  load_LED_hdr
 800409C0  load_LED_dat
 80040A78  InitBG
 800413D0  ResetBG
 800415FC  ScrollBG
 80041E38  SortBG
 800420B0  VsyncCallBack
 8004210C  InitVCount
 80042148  InitGCount
 8004216C  InitSP
 800474B8  SortSP
 80048F90  SortSpeedNumSP
 80049334  SortPowerNumSP
 80049AA0  SortScoreNumSP
 8004A19C  SortTimeNumSP
 8004B100  SortNameEntryCountSP
 8004B488  SortContinueCounter
 8004B5B0  SortRankingSP
 8004C258  SortFontSP
 8004C6B4  InitFG
 8004C990  SortFG
 8004CB88  SortFadeFG
 8004CCF0  InitStaff
 8004D3A4  SortStaff
 8004D7A4  Init2D
 8004D7F4  ErrorsMessage
 8004D854  PCsetDeviceMode
 8004D990  _strupr
 8004DA60  PCgetPointerFromFpack
 8004DBE4  PCgetOffsetFromFpack
 8004DD54  PCgetBytesFromFpack
 8004DEAC  MEMinit
 8004DED0  MEMalloc
 8004DFD8  MEMfree
 8004E034  MEMfree2
 8004E09C  MEMgetUseSize
 8004E0D8  MEMgetFreeSize
 8004E120  MEMgetHeapPointer
 8004E168  MEMsetUseSize
 8004E1B8  test_coin_option
 8004EFEC  test_game_option
 8004FAA0  test_io_test
 800508C4  test_sound_test
 800527A0  mon_test_grad
 80052BD8  mon_test_cross
 80052F70  test_monitor_test
 80053478  reset_ads_data
 800534AC  test_ads_data
 80053F14  others_test_controller
 80054BFC  others_test_data_ranking
 80055074  init_option_defaults
 800550D0  others_test_data_defaults
 80055548  others_test_data_clear
 80055A50  test_others
 80055F58  test_mode
 800564B4  out_callback
 8005673C  play_bs
 80057964  PioDataCallback
 80057988  PioCallback
 800579AC  PioPutConfig
 80057A50  PioGetConfig
 80057AF4  PioReadBurst
 80057B1C  PioWriteBurst
 80057B48  PioReadSlice
 80057B6C  PioWriteSlice
 80057BF8  PioSetImask
 80057C1C  PioPutImask
 80057C40  PioGetImask
 80057C58  PioGetIreg
 80057C70  PioWriteUserBit
 80057C94  PioReadUserBit
 80057CB4  __main
 80057CBC  stup2
 80057CBC  __SN_ENTRY_POINT
 80057CE0  stup1
 80057D5C  stup0
 80057D78  SetDumpFnt
 80057DB8  FntLoad
 80057E58  FntOpen
 80058110  FntFlush
 8005842C  FntPrint
 800587F8  LoadTPage
 800588E0  LoadClut
 80058944  LoadClut2
 800589A8  SetDefDrawEnv
 80058A5C  SetDefDispEnv
 80058A98  ResetGraph
 80058C0C  SetGraphDebug
 80058C68  SetGraphQueue
 80058D0C  GetGraphDebug
 80058D1C  DrawSyncCallback
 80058D7C  SetDispMask
 80058E14  DrawSync
 80058F98  ClearImage
 80059028  ClearImage2
 800590C0  LoadImage
 80059120  StoreImage
 80059180  MoveImage
 80059238  ClearOTag
 80059300  ClearOTagR
 800593AC  DrawPrim
 80059408  DrawOTag
 80059478  PutDrawEnv
 80059538  DrawOTagEnv
 80059610  GetDrawEnv
 80059644  PutDispEnv
 80059B3C  GetDispEnv
 80059B70  GetODE
 80059BA0  SetTexWindow
 80059BD8  SetDrawArea
 80059C58  SetDrawOffset
 80059C98  SetPriority
 80059CC0  SetDrawStp
 80059CE8  SetDrawMode
 80059D3C  SetDrawEnv
 8005B63C  LoadImage2
 8005B728  StoreImage2
 8005B814  MoveImage2
 8005B958  DrawOTag2
 8005BAA8  GetTPage
 8005BAE8  GetClut
 8005BB08  AddPrim
 8005BB48  TermPrim
 8005BB68  SetSemiTrans
 8005BB98  SetSprt8
 8005BBB8  SetTile
 8005BBD8  rsin
 8005BC14  sin_1
 8005BCA8  rcos
 8005BD48  SquareRoot0
 8005BDD8  CompMatrix
 8005BF38  TransMatrix
 8005BF68  ScaleMatrix
 8005C0A8  RotMatrix
 8005C338  RotMatrixX
 8005C4D8  RotMatrixY
 8005C678  RotMatrixZ
 8005C818  GsTMDfastNF3
 8005C954  GsTMDfastF3NL
 8005CA94  GsTMDfastF3L
 8005CBDC  GsTMDfastF3LFG
 8005CD28  GsTMDfastNF4
 8005CE90  GsTMDfastF4NL
 8005CFFC  GsTMDfastF4L
 8005D174  GsTMDfastF4LFG
 8005D2F8  GsTMDfastNG3
 8005D440  GsTMDfastG3NL
 8005D580  GsTMDfastG3L
 8005D710  GsTMDfastG3LFG
 8005D8A8  GsTMDfastNG4
 8005DA28  GsTMDfastG4NL
 8005DB9C  GsTMDfastG4L
 8005DD7C  GsTMDfastG4LFG
 8005DF68  GsTMDfastTNF3
 8005E0D4  GsTMDfastTF3NL
 8005E238  GsTMDfastTF3L
 8005E3A8  GsTMDfastTF3LFG
 8005E518  GsTMDfastTNF4
 8005E6B8  GsTMDfastTF4NL
 8005E854  GsTMDfastTF4L
 8005EA00  GsTMDfastTF4LFG
 8005EBB8  ratan2
 8005ED38  GsSortBoxFill
 8005EE18  _make_packet
 8005EEB8  GsSortSpriteB
 8005F3C8  SetRotMatrix
 8005F3F8  SetTransMatrix
 8005F418  ReadGeomScreen
 8005F428  RotTransPers4
 8005F4A8  GsInitGraph
 8005F638  GsInitGraph2
 8005F8C0  GsSortClear
 8005F9F8  GsGetActiveBuff
 8005FA08  GsSetDrawBuffOffset
 8005FB18  SetGeomOffset
 8005FB38  GsSetDrawBuffClip
 8005FBB8  GsSwapDispBuff
 8005FC68  GsInitCoordinate2
 8005FCD8  GsInitCoord2param
 8005FD04  GsSetLsMatrix
 8005FD30  GsSetLightMatrix
 8005FDC4  GsSetLightMatrix2
 8005FDF4  GsMulCoord0
 8005FE84  GsMulCoord2
 8005FF04  GsMulCoord3
 8005FF84  print_matrix
 8005FFF4  print_vector
 80060028  MulMatrix0
 80060138  ApplyMatrixLV
 80060298  PushMatrix
 8006033C  PopMatrix
 800603E8  MulMatrix
 800604F8  MulMatrix2
 80060608  SetLightMatrix
 80060638  GsDefDispBuff
 800606D8  GsInit3D
 80060758  GsMapModelingData
 800607C8  GsSetProjection
 800607E8  SetGeomScreen
 800607F8  GsSetFlatLight
 80060D68  SetColorMatrix
 80060D98  GsSetLightMode
 80060E18  GsSetAmbient
 80060E48  SetBackColor
 80060E68  GsDrawOt
 80060E98  GsClearOt
 80060EF8  GsSortOt
 80060FB8  gte_init
 80061010  InitGeom
 80061098  SetFarColor
 800610B8  _patch_gte
 80061198  GsGetTimInfo
 80061288  Gssub_make_matrix
 80061358  GsSetWorkBase
 80061368  GsSetRefView2
 80061908  TransposeMatrix
 80061948  gte_rotate_z_matrix
 80061A08  GsGetLw
 80061CC8  GsGetLs
 80061F98  GsLinkObject4
 80062128  GsSortObject4J
 800629B8  GsA4divTNF4
 80063588  GsA4divNG4
 80064158  GsA4divNF4
 80064BE8  GsA4divNG3
 800655A8  GsA4divTNF3
 80065F78  GsA4divNF3
 80066838  PadInit
 80066884  PadRead
 800668AC  PadStop
 800668D8  VSync
 80066AE8  ResetCallback
 80066B18  InterruptCallback
 80066B48  DMACallback
 80066B78  VSyncCallback
 80066BAC  VSyncCallbacks
 80066BDC  StopCallback
 80066C0C  RestartCallback
 80066C3C  CheckCallback
 80066C4C  GetIntrMask
 80066C64  SetIntrMask
 800671A8  startIntrVSync
 800672C8  startIntrDMA
 80067568  SetVideoMode
 8006757C  GetVideoMode
 80067598  ReturnFromException
 800675A8  ResetEntryInt
 800675B8  HookEntryInt
 800675C8  EnterCriticalSection
 800675D8  ExitCriticalSection
 800675E8  _96_remove
 800675F8  InitHeap
 80067608  FlushCache
 80067618  GPU_cw
 80067628  ChangeClearRCnt
 80067638  ChangeClearPAD
 80067640  InitPAD
 80067648  StartPAD
 80067650  StopPAD
 80067658  PAD_init
 80067660  PAD_dr
 80067668  DecDCTReset
 8006769C  DecDCTGetEnv
 80067728  DecDCTPutEnv
 800677C0  DecDCTBufSize
 800677CC  DecDCTin
 80067848  DecDCTout
 80067868  DecDCTinSync
 800678A4  DecDCToutSync
 800678E0  DecDCTinCallback
 80067904  DecDCToutCallback
 80067CF8  DecDCTvlcSize2
 80067D28  DecDCTvlc2
 80068078  DecDCTvlcBuild
 80068168  exit
 80068180  puts
 80068198  setjmp
 800681A8  strcmp
 800681B8  strcpy
 800681C8  strlen
 800681D8  memcpy
 800681E8  memset
 800681F8  rand
 80068208  srand
 80068218  printf
 80068228  __text_orgend
 80068228  __text_objend
 80068228  __data_org
 80068228  __data_obj
 80068228  MaxSpeedTable
 80068234  BreakParmTable
 80068240  ObjPosYOffsetTable
 80068274  op_bs_name
 800685E0  t1_bs_name
 8006870C  t2_bs_name
 80068838  t3_bs_name
 80068964  t4_bs_name
 80068A90  t5_bs_name
 80068BBC  t6_bs_name
 80068CE8  st1_bs_name
 80068D60  st2_bs_name
 80068DD8  st3_bs_name
 80068E50  st4_bs_name
 80068EC8  st5_bs_name
 80068F40  st6_bs_name
 80068FB8  FGTextureName
 8006905C  SPTextureName
 8006913C  EventTexName
 800691B4  DataName
 800691E8  ObjDataName
 8006921C  RailName
 80069250  GeomName
 80069284  ObjFPCName
 800692B8  TexFPCName
 800692EC  RankingTitle1
 800692F8  RankingTitle2
 80069304  MenuStrTable
 80069324  COptStrTable
 80069334  GOptStrTable
 80069340  GOptDifStr
 8006934C  IOTestStrTable
 80069368  MonTestStrTable
 80069374  ADSTestStrTable
 8006938C  OthersTestStrTable
 80069398  OthersTestDataStrTable
 800693A4  InitRankStrTable
 800693B0  InitDefaultsStrTable
 800693EC  _stacksize
 800693F0  _ramsize
 800693F4  Font
 80069FD0  GPU_printf
 80069FD4  GEnv
 8006A0FC  _qin
 8006A100  _qout
 8006A124  rsin_tbl
 8006A934  SQRT
 8006AAB4  rcossin_tbl
 8006EAB4  ratan_tbl
 8006F5F4  GsADIVZ
 8006F5F8  GsADIVW
 8006F5FA  GsADIVH
 8006F614  Hcount
 80070744  Vcount
 80071722  __data_orgend
 80071722  __data_objend
 80071724  __sdata_org
 80071724  __sdata_obj
 80071724  __SN_GP_BASE
 8007175A  gDumpADFlag
 8007175C  gDumpADCount
 80071878  LEDHeaderFileName
 8007187C  LEDDataFileName
 800718D4  TModeBoolStr
 800718EC  MenuTitleStr
 80071900  MenuUsageStr
 80071904  COptTitleStr1
 80071908  COptTitleStr2
 8007190C  COptUsageStr
 80071910  COptCoinStr1
 80071914  COptCoinStr2
 80071918  gDefGameCost
 8007191A  gGameCost
 8007191C  gDefContCost
 8007191E  gContCost
 80071920  gDefFreePlayFlag
 80071922  gFreePlayFlag
 80071924  GOptTitleStr1
 80071928  GOptTitleStr2
 8007192C  GOptUsageStr
 8007193A  gDefGameDifficulty
 8007193C  gGameDifficulty
 8007193E  gDefSoundAttractFlag
 80071940  gSoundAttractFlag
 80071944  IOTestTitleStr1
 80071948  IOTestTitleStr2
 8007194C  IOTestUsageStr
 80071950  SoundTestTitleStr
 80071954  SoundTestStrTable
 8007195C  SoundTestUsageStr
 80071960  MonTestTitleStr
 80071964  MonTestUsageStr
 80071968  ADSTestTitleStr
 8007196C  ADSTestUsageStr
 80071970  OthersTestTitleStr
 80071974  OthersTestUsageStr
 80071978  OthersTestDataTitleStr
 8007197C  OthersTestDataUsageStr
 80071980  ContTestTitleStr1
 80071984  ContTestTitleStr2
 80071988  ContTestUsageStr1
 8007198C  ContTestUsageStr2
 80071990  InitRankTitleStr
 800719A4  InitRankUsageStr
 800719A8  InitDefaultsTitleStr
 800719AC  InitDefaultsUsageStr
 80071A29  __sdata_orgend
 80071A29  __sdata_objend
 80071A30  _text_orgend
 80071A30  _text_objend
 80071A30  _bss_org
 80071A30  _bss_obj
 80071A30  __sbss_org
 80071A30  __sbss_obj
 80071A30  TrTimCount
 80071A34  gFGDispFlag
 80071A38  CountSpriteFlag
 80071A3C  Power
 80071A40  GameEndFlag
 80071A44  ExtraGameEndFlag
 80071A48  StartPower
 80071A4C  SpeedH
 80071A50  MVFukiCount
 80071A54  LastBlkRotZ
 80071A58  LoopOutFlag
 80071A5C  DownOffsetX
 80071A60  DownOffsetY
 80071A64  DownOffsetZ
 80071A68  Offset
 80071A6C  ExtendPower
 80071A70  CourseCount
 80071A74  GameWaitFlag
 80071A78  GameOverFlag
 80071A7C  FGCount
 80071A80  ClutLoadFlag
 80071A84  ExtraGameWaitFlag
 80071A88  PlayDemoFlag
 80071A8C  ExtraGameOverFlag
 80071A90  ExtraGameOverTime
 80071A94  TmpRotY
 80071A96  TmpRotZ
 80071A98  LastPos
 80071A9C  MovieTimeOut
 80071AA0  EObjFlag
 80071AA4  GameClearFlag
 80071AA8  EDataMax
 80071AAC  ExtraGameClearFlag
 80071AB0  DispClearFlag
 80071AB4  LandFlag
 80071AB8  LoadFlag
 80071ABC  ExtraGameFlag
 80071AC0  ExtraGameClearTime
 80071AC4  GameMode
 80071AC8  ADS0
 80071ACA  ADS1
 80071ACC  ADS2
 80071ACE  ADS3
 80071AD0  ADS4
 80071AD2  ADS5
 80071AD4  ADS6
 80071AD8  GameOverSpeed
 80071ADC  ExtraGameOverSpeed
 80071AE0  StatFlag
 80071AE4  BgScroll
 80071AE8  RankPlay
 80071AF0  LastRotY
 80071AF4  TmpSpeed
 80071AF8  LastRotZ
 80071AFC  GameOverCount
 80071B00  ADB01
 80071B02  MovieIdx
 80071B04  ADB12
 80071B08  NextCourseIdxTable
 80071B10  ADB23
 80071B12  ADB34
 80071B14  Pos
 80071B18  ADB45
 80071B1C  ExtraGameOverCount
 80071B20  ADB56
 80071B24  LastCourseIdx
 80071B28  NextReadyCourseIdx
 80071B2C  NextCourseIdx
 80071B30  LoopStartTime
 80071B34  GameClearSpeed
 80071B38  ExtraGameClearSpeed
 80071B3C  BIdx
 80071B40  ADlim_min
 80071B42  ADlim_max
 80071B44  OIdx
 80071B48  GameClearCount
 80071B4C  Base
 80071B50  ExtraGameClearCount
 80071B54  ResetFlag
 80071B58  TotalBase
 80071B5C  ExtraResetFlag
 80071B60  DownSpeed
 80071B64  CourseIdx
 80071B68  ContCount
 80071B6C  TrainType
 80071B70  TmpScroll
 80071B74  DownCount
 80071B78  LoopCount
 80071B7C  CourseCountMax
 80071B80  ADval
 80071B82  ADmin
 80071B84  ADmax
 80071B88  LastMilSec
 80071B8C  MVCowCount
 80071B90  Speed
 80071BB8  gTestModeFlag
 80071BBA  gGraphStopFlag
 80071BC0  DmaWaitFlag
 80071BC8  GeomDivMode
 80071BCC  RailDivMode
 80071BD0  DispBlockMin
 80071BD4  DispBlockMax
 80071BD8  ObjDivMode
 80071BE0  ObjMoveCMax
 80071BE4  ObjMoveFlag
 80071BE8  EDObjDataBuf
 80071BEC  EDObjMdlData
 80071BF0  BLObjMdlData
 80071BF4  BLObjDataBuf
 80071BF8  EDObjDataMax
 80071BFC  BRObjMdlData
 80071C00  BRObjDataBuf
 80071C04  BLObjDataMax
 80071C08  LPObjDataBuf
 80071C0C  LPObjMdlData
 80071C10  BRObjDataMax
 80071C14  EDObjFileNum
 80071C18  LPObjDataMax
 80071C1C  BLObjFileNum
 80071C20  BRObjFileNum
 80071C24  LPObjFileNum
 80071C28  ObjMoveCount
 80071C2C  ObjPosOffsetY
 80071C30  EDObjPosOffsetY
 80071C34  BLObjPosOffsetY
 80071C38  BRObjPosOffsetY
 80071C3C  LPObjPosOffsetY
 80071C40  ObjDataBuf
 80071C44  ObjMdlData
 80071C48  ObjDataMax
 80071C4C  ObjFileNum
 80071C50  CurrentKnotch
 80071C58  padc
 80071C60  padd
 80071C68  pads
 80071C70  gCamDist
 80071C74  gCamOffset
 80071C78  bytes
 80071C7C  CTransTable
 80071C80  EDTransTable
 80071C84  BLTransTable
 80071C88  BRTransTable
 80071C8C  LPTransTable
 80071C90  BankIdx
 80071C94  TotalBaseMax
 80071C98  CDataBuf
 80071C9C  LEDDatBuf
 80071CA0  LEDHdrBuf
 80071CA4  BlockMax
 80071CA8  EDDataBuf
 80071CAC  BLDataBuf
 80071CB0  BRDataBuf
 80071CB4  EDTotalBaseMax
 80071CB8  LPDataBuf
 80071CBC  BLTotalBaseMax
 80071CC0  BRTotalBaseMax
 80071CC4  LPTotalBaseMax
 80071CC8  gBaseHeap
 80071CCC  EDBlockMax
 80071CD0  BLBlockMax
 80071CD4  BRBlockMax
 80071CD8  LPBlockMax
 80071CE0  SrcDataBuf
 80071CE8  Sx_min
 80071CEA  Sy_min
 80071CEC  Sx_max
 80071CEE  Sy_max
 80071CF0  G_Count
 80071CF4  V_Count
 80071CF8  BgRevFlag
 80071CFC  gFGBtnStat
 80071D00  BgPos
 80071D10  gPlayCount
 80071D14  gPlayStart
 80071D18  gPowerOnTime
 80071D1C  gLastServiceCount
 80071D20  gPlayTime
 80071D24  gLastCoinCount
 80071D26  gControllerInitFlag
 80071D30  mdec_frame
 80071D34  __sbss_orgend
 80071D34  __sbss_objend
 80071D38  imgbuf
 80071D3C  vlcbuf0
 80071D40  vlcbuf1
 80071D44  FrameMax
 80071D50  __bss_org
 80071D50  __bss_obj
 80071D50  RankBeg
 80071D78  ClearedCourseFlag
 80071DB0  RankPro
 80071DD8  ClearedCourseTable
 80071E10  LpClutBuf
 80072130  NtClutBuf
 80072450  EDataTable
 80072570  pslt
 800725A0  LEDArea
 800725E0  out_packet
 800E78E0  ZSortTable_bg
 800E7900  ZSortTable_sp
 800E7920  Wot
 800E7948  BGot
 800E7970  SPot
 800E7998  ZSortTable_all
 800E79D8  ALLot
 800E7A00  ZSortTable
 80107A00  RailMdlData
 80107A10  GeomMdlData
 80107A20  EDRailMdlData
 80107A30  EDGeomMdlData
 80107A40  BLRailMdlData
 80107A50  BLGeomMdlData
 80107A60  BRRailMdlData
 80107A70  BRGeomMdlData
 80107A80  LPRailMdlData
 80107A90  LPGeomMdlData
 80107AA0  LastView
 80107AB0  ViewWorld
 80107B00  view
 80107B20  EDRoot
 80107B70  BLRoot
 80107BC0  BRRoot
 80107C10  LPRoot
 80107C60  CRoot
 80107CB0  StaffImage0
 80107CD0  StaffImage1
 80107CF0  EventImageL
 80107D10  EventImageR
 80107D30  FGImage
 80107D50  SPImage
 80108370  BgImage
 80108390  StaffSp0
 801083D8  StaffSp1
 80108420  EventSpL
 80108448  EventSpR
 80108470  SpriteSp
 80108C50  FGSp
 80108C98  BgSp
 80108E48  BgBox
 80379EA8  gLeverValue
 80379EB8  gAPSave
 8037E530  _que
 8037FD50  PSDOFSX
 8037FD54  PSDOFSY
 8037FD58  PSDBASEX
 8037FD5C  PSDBASEY
 8037FD60  POSITION
 8037FD68  GsDRAWENV
 8037FDC8  GsDISPENV
 8037FDDC  GsORGOFSX
 8037FDDE  GsORGOFSY
 8037FDE0  CLIP2
 8037FDE8  PSDCNT
 8037FDEC  PSDIDX
 8037FDEE  PSDGPU
 8037FDF0  DSTACK
 8037FE70  HWD0
 8037FE74  VWD0
 8037FE78  GsCLIP3far
 8037FE7C  GsLIGHT_MODE
 8037FE80  GsCLIP3near
 8037FE88  GsLIGHTWSMATRIX
 8037FEA8  _LC
 8037FED8  GsWSMATRIX_ORG
 8037FEF8  GsIDMATRIX
 8037FF18  GsWSMATRIX
 8037FF38  GsIDMATRIX2
 8037FF58  GsBACKC
 8037FF5C  GsLIOFF
 8037FF60  GsLMODE
 8037FF64  GsLIGNR
 8037FF68  GsTRATE
 8037FF6C  GsZOVER
 8037FF70  GsOUT_PACKET_P
 8037FF74  GsMATE_C
 8037FF78  GsDISPON
 8037FF7C  GsTON
 8037FF80  GsNDIV
 8037FF88  GsFCALL4
 803800BC  __bss_orgend
 803800BC  __bss_objend
 803800C8  PadIdentifier
 803800D0  _bss_orgend
 803800D0  _bss_objend

References