int main(int argc, char *argv[]) { if (argc < 2) { printf("usage: retrolaunch <ROM>\n"); return -1; } char game_name[MAX_TOKEN_LEN]; char *path = argv[1]; struct RunInfo info; int rv; LOG_INFO("Analyzing '%s'", path); if ((rv = detect_game(path, game_name, MAX_TOKEN_LEN)) < 0) { LOG_WARN("Could not detect game: %s", strerror(-rv)); return -rv; } LOG_INFO("Game is `%s`", game_name); if ((rv = get_run_info(&info, game_name)) < 0) { LOG_WARN("Could not detect run info: %s", strerror(-rv)); return -1; } LOG_INFO("Launching '%s'", path); rv = run_retroarch(path, &info); LOG_WARN("Could not launch retroarch: %s", strerror(-rv)); return -rv; }
int main(int argc, char* argv[]) { if (argc < 2) { return -1; } char game_name[MAX_TOKEN_LEN]; char* path = argv[1]; struct RunInfo info; int rv; int fd = -1; LOG_INFO("Analyzing '%s'", path); if ((rv = detect_game(path, game_name, MAX_TOKEN_LEN)) < 0) { LOG_WARN("Could not detect game: %s", strerror(-rv)); return -rv; } LOG_INFO("Game is `%s`", game_name); if ((rv = get_run_info(&info, game_name)) < 0) { LOG_WARN("Could not find sutable core: %s", strerror(-rv)); return -1; } LOG_DEBUG("Usinge libretro core '%s'", info.core); LOG_INFO("Launching '%s'", path); rv = run_retroarch(path, &info); LOG_WARN("Could not launch retroarch: %s", strerror(-rv)); return -rv; }