mirror of
https://github.com/libretro/RetroArch.git
synced 2024-10-07 14:23:29 +00:00
Add --max-frames option
This commit is contained in:
parent
90d6aec985
commit
9b9fa94c27
@ -683,6 +683,8 @@ struct global
|
||||
} frame_cache;
|
||||
|
||||
unsigned frame_count;
|
||||
unsigned max_frames;
|
||||
|
||||
char title_buf[64];
|
||||
|
||||
struct
|
||||
|
10
retroarch.c
10
retroarch.c
@ -671,7 +671,8 @@ static void print_help(void)
|
||||
puts("\t--bps: Specifies path for BPS patch that will be applied to content.");
|
||||
puts("\t--ips: Specifies path for IPS patch that will be applied to content.");
|
||||
puts("\t--no-patch: Disables all forms of content patching.");
|
||||
puts("\t-D/--detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms.\n");
|
||||
puts("\t-D/--detach: Detach " RETRO_FRONTEND " from the running console. Not relevant for all platforms.");
|
||||
puts("\t--max-frames: Runs for the specified number of frames, then exits.\n");
|
||||
}
|
||||
|
||||
static void set_basename(const char *path)
|
||||
@ -853,6 +854,7 @@ static void parse_input(int argc, char *argv[])
|
||||
{ "detach", 0, NULL, 'D' },
|
||||
{ "features", 0, &val, 'f' },
|
||||
{ "subsystem", 1, NULL, 'Z' },
|
||||
{ "max-frames", 1, NULL, 'm' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
@ -1050,6 +1052,10 @@ static void parse_input(int argc, char *argv[])
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
g_extern.max_frames = strtoul(optarg, NULL, 10);
|
||||
break;
|
||||
|
||||
case 0:
|
||||
switch (val)
|
||||
{
|
||||
@ -3265,6 +3271,8 @@ bool rarch_main_iterate(void)
|
||||
if (
|
||||
g_extern.system.shutdown ||
|
||||
check_quit_key_func(input) ||
|
||||
(g_extern.max_frames &&
|
||||
g_extern.frame_count >= g_extern.max_frames) ||
|
||||
!driver.video->alive(driver.video_data))
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user