Example #1
0
void S9xDeinitUpdate(int width, int height)
{
   if (height == 448 || height == 478)
   {
      if (GFX.Pitch == 2048)
         pack_frame(GFX.Screen, width, height);
      GFX.Pitch = 1024;
   }
   else
   {
      if (GFX.Pitch == 1024)
         stretch_frame(GFX.Screen, width, height);
      GFX.Pitch = 2048;
   }

   s9x_video_cb(GFX.Screen, width, height);
}
Example #2
0
int anim_save_frame()
{
	ubyte *temp;
	int i, size;
	key_frame *keyp = NULL;

	Assert(anim_fp);
	cur_frame_num++;
	Assert(cur_frame_num <= Anim.total_frames);

	for (i=0; i<Anim.num_keys; i++)
		if (Anim.keys[i].frame_num == cur_frame_num) {
			keyp = &Anim.keys[i];
			break;
		}

	if (keyp) {
		fprintf(stdout, "*");
		fflush(stdout);
		keyp->offset = anim_offset;
		size = pack_key_frame(cur_frame, anim_buffer, Anim.width * Anim.height, ANIM_BUFFER_MAX, Key_frame_compression);

	} else {
		fprintf(stdout, ".");
		fflush(stdout);
		size = pack_frame(cur_frame, last_frame, anim_buffer, Anim.width * Anim.height, ANIM_BUFFER_MAX, Regular_frame_compression);
	}

	if (size < 0)
		return -1;

	if ((int) fwrite(anim_buffer, 1, size, anim_fp) != size)
		return -1;

	anim_offset += size;
	temp = cur_frame;
	cur_frame = last_frame;
	last_frame = temp;
	return 0;
}
Example #3
0
void S9xDeinitUpdate(int width, int height)
{
	if (use_overscan)
	{
		if (height == 224)
		{
			memmove(GFX.Screen + (GFX.Pitch / 2) * 7, GFX.Screen, GFX.Pitch * height);
			memset(GFX.Screen, 0x00, GFX.Pitch * 7);
			memset(GFX.Screen + (GFX.Pitch / 2) * (7 + 224), 0, GFX.Pitch * 8);
			height = 239;
		}
		else if (height == 448)
		{
			memmove(GFX.Screen + (GFX.Pitch / 2) * 15, GFX.Screen, GFX.Pitch * height);
			memset(GFX.Screen, 0x00, GFX.Pitch * 15);
			memset(GFX.Screen + (GFX.Pitch / 2) * (15 + 224), 0x00, GFX.Pitch * 17);
			height = 478;
		}
	}
	else /* libsnes classic behavior */
	{
		if (height == 448 || height == 478)
		{
			if (GFX.Pitch == 2048)
				pack_frame(GFX.Screen, width, height);
			GFX.Pitch = 1024;
		}
		else
		{
			if (GFX.Pitch == 1024)
				stretch_frame(GFX.Screen, width, height);
			GFX.Pitch = 2048;
		}
	}

	s9x_video_cb(GFX.Screen, width, height);
}