Exemple #1
0
static int CTRL(FCEUFILE *fp) {
	int t;
	uint32 i;
	if(uchead.info == 1) {
		if ((t = FCEU_fgetc(fp)) == EOF)
			return(0);
		/* The information stored in this byte isn't very helpful, but it's
		better than nothing...maybe.
		*/

		if (t & 1)
			FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_GAMEPAD;
		else
			FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_NONE;
		if (t & 2)
			FCEUGameInfo->input[1] = SI_ZAPPER;
	} else {
		FCEU_printf(" Incorrect Control Chunk Size (%d). Data is:", uchead.info);
		for(i = 0; i < uchead.info; i++) {
			t = FCEU_fgetc(fp);
			FCEU_printf(" %02x", t);
		}
		FCEU_printf("\n");
		FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_GAMEPAD;
	}
	return(1);
}
Exemple #2
0
static int DINF(FCEUFILE *fp)
{
	char name[100], method[100];
	uint8 d, m;
	uint16 y;
	int t;

	if(FCEU_fread(name,1,100,fp)!=100)
		return(0);
	if((t=FCEU_fgetc(fp))==EOF) return(0);
	d=t;
	if((t=FCEU_fgetc(fp))==EOF) return(0);
	m=t;
	if((t=FCEU_fgetc(fp))==EOF) return(0);
	y=t;
	if((t=FCEU_fgetc(fp))==EOF) return(0);
	y|=t<<8;
	if(FCEU_fread(method,1,100,fp)!=100)
		return(0);
	name[99]=method[99]=0;
	FCEU_printf(" Dumped by: %s\n",name);
	FCEU_printf(" Dumped with: %s\n",method);
	{
		char *months[12]={"January","February","March","April","May","June","July",
			"August","September","October","November","December"};
		FCEU_printf(" Dumped on: %s %d, %d\n",months[(m-1)%12],d,y);
	}
	return(1);
}
Exemple #3
0
static int EnableBattery(FCEUFILE *fp) {
	FCEU_printf(" Battery-backed.\n");
	if (FCEU_fgetc(fp) == EOF)
		return(0);
	UNIFCart.battery = 1;
	return(1);
}
Exemple #4
0
static int DoMirroring(FCEUFILE *fp)
{
	uint8 t;
	t=FCEU_fgetc(fp);
	mirrortodo=t;

	{
		static char *stuffo[6]={"Horizontal","Vertical","$2000","$2400","\"Four-screen\"","Controlled by Mapper Hardware"};
		if(t<6)
			FCEU_printf(" Name/Attribute Table Mirroring: %s\n",stuffo[t]);
	}
	return(1);
}
Exemple #5
0
static int TVCI(FCEUFILE *fp) {
	int t;
	if ((t = FCEU_fgetc(fp)) == EOF)
		return(0);
	if (t <= 2) {
		char *stuffo[3] = { "NTSC", "PAL", "NTSC and PAL" };
		if (t == 0)
			FCEUGameInfo->vidsys = GIV_NTSC;
		else if (t == 1)
			FCEUGameInfo->vidsys = GIV_PAL;
		FCEU_printf(" TV Standard Compatibility: %s\n", stuffo[t]);
	}
	return(1);
}
Exemple #6
0
static int DoMirroring(FCEUFILE *fp) {
	int t;
	uint32 i;
	if(uchead.info == 1) {
		if ((t = FCEU_fgetc(fp)) == EOF)
			return(0);
		mirrortodo = t;
		{
			static char *stuffo[6] = { "Horizontal", "Vertical", "$2000", "$2400", "\"Four-screen\"", "Controlled by Mapper Hardware" };
			if (t < 6)
				FCEU_printf(" Name/Attribute Table Mirroring: %s\n", stuffo[t]);
		}
	} else {
		FCEU_printf(" Incorrect Mirroring Chunk Size (%d). Data is:", uchead.info);
		for(i = 0; i < uchead.info; i++) {
			if ((t = FCEU_fgetc(fp)) == EOF)
				return(0);
			FCEU_printf(" %02x", t);
		}
		FCEU_printf("\n Default Name/Attribute Table Mirroring: Horizontal\n", uchead.info);
		mirrortodo = 0;
	}
	return(1);
}
Exemple #7
0
static int CTRL(FCEUFILE *fp)
{
	int t;

	if((t=FCEU_fgetc(fp))==EOF)
		return(0);
	/* The information stored in this byte isn't very helpful, but it's
	better than nothing...maybe.
	*/

	if(t&1) GameInfo->input[0]=GameInfo->input[1]=SI_GAMEPAD;
	else GameInfo->input[0]=GameInfo->input[1]=SI_NONE;

	if(t&2) GameInfo->input[1]=SI_ZAPPER;
	//else if(t&0x10) GameInfo->input[1]=SI_POWERPAD;

	return(1);
}
Exemple #8
0
static int NAME(FCEUFILE *fp) {
	char namebuf[100];
	int index;
	int t;

	FCEU_printf(" Name: ");
	index = 0;

	while ((t = FCEU_fgetc(fp)) > 0)
		if (index < 99)
			namebuf[index++] = t;

	namebuf[index] = 0;
	FCEU_printf("%s\n", namebuf);

	if (!FCEUGameInfo->name) {
		FCEUGameInfo->name = malloc(strlen(namebuf) + 1);
		strcpy(FCEUGameInfo->name, namebuf);
	}
	return(1);
}
Exemple #9
0
static int NAME(FCEUFILE *fp) {
    char namebuf[100];
    int index;
    int t;

    FCEU_printf(" Name: ");
    index = 0;

    while ((t = FCEU_fgetc(fp)) > 0)
        if (index < 99)
            namebuf[index++] = t;

    namebuf[index] = 0;
    FCEU_printf("%s\n", namebuf);

    if (!GameInfo->name) {
        GameInfo->name = (uint8*)malloc(strlen(namebuf) + 1); //mbg merge 7/17/06 added cast
        strcpy((char*)GameInfo->name, namebuf); //mbg merge 7/17/06 added cast
    }
    return(1);
}
Exemple #10
0
static int TVCI(int fp)
{
 int t;
 if( (t=FCEU_fgetc(fp)) ==EOF)
  return(0);
 if(t<=2)
 {
  char *stuffo[3]={"NTSC","PAL","NTSC and PAL"};
  if(t==0)
  {
   FCEUGameInfo.vidsys=GIV_NTSC;
   FCEUI_SetVidSystem(0);
  }
  else if(t==1)
  {
   FCEUGameInfo.vidsys=GIV_PAL;
   FCEUI_SetVidSystem(1);
  }
  FCEU_printf(" TV Standard Compatibility: %s\n",stuffo[t]);
 }
 return(1);
}