shithub: pse

ref: cbdeb8387a30444a50f0f8561e0249cd0dc9b3cb
dir: /gen3.h/

View raw version
enum{
	/* Sections */
	STrainer,
	SInvent,
	SState,
	SMisc,
	SRiv,
	SPCA,
	SPCB,
	SPCC,
	SPCD,
	SPCE,
	SPCF,
	SPCG,
	SPCH,
	SPCI,

	/* Game Type */
	GRS,
	GFRLG,
	GEM,
};

long getsection(Section*,uchar*);
long gettrainer(Trainer*,uchar*);
long getinvent(Invent*,uchar*);
long getpokedat(Pokedat*,uchar*);
long getpc(PC*,uchar*);

typedef struct Gen3 Gen3;
struct Gen3{
	int type;
	Section bank1[14];
	Section bank2[14];
	Section *active;
	Trainer tr;
	Invent inv;
	PC pc;

	uchar pcbuf[3968*8 + 2000];
};

typedef struct Gen3iv Gen3iv;
struct Gen3iv {
	uchar hp;
	uchar atk;
	uchar def;
	uchar spe;
	uchar spatk;
	uchar spdef;
	uchar egg;
	uchar ability;
};

void gen3pkstr(uchar *d, uchar *s, int n);
void getgen3(int fd, Gen3 *save);
void decryptpokemon(Pokedat *dst, Pokemon *src);
void getgen3iv(Gen3iv *dst, u32int src);
int getgen3dex(u16int species);