/* Hey EMACS -*- linux-c -*- */ /* $Id$ */ /* TiEmu - an TI emulator * * Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin * Copyright (c) 2001-2003, Romain Lievin * Copyright (c) 2003, Julien Blache * Copyright (c) 2004, Romain Liévin * Copyright (c) 2005, Romain Liévin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "struct.h" #include "version.h" #include "ti68k_def.h" #include "ti68k_int.h" #include "tie_error.h" /* Display the program version */ int tiemu_version(void) { fprintf(stdout, "TiEmu II - Version %s\n", TIEMU_VERSION); fprintf(stdout, " (C) Romain Lievin & Thomas Corvazier 2000-2001\n"); fprintf(stdout, " (C) Romain Lievin 2001-2003\n"); fprintf(stdout, " (C) Julien Blache 2003\n"); fprintf(stdout, " (C) Romain Lievin 2004-2005\n"); fprintf(stdout, " (C) Romain Lievin & Kevin Kofler 2005\n"); fprintf(stdout, "THIS PROGRAM COMES WITH ABSOLUTELY NO WARRANTY\n"); fprintf(stdout, "PLEASE READ THE DOCUMENTATION FOR DETAILS\n"); return 0; } /* Display a short help */ int help(void) { fprintf(stdout, "\n"); tiemu_version(); fprintf(stdout, "usage: tiemu [-options] [image]\n"); fprintf(stdout, "\n"); fprintf(stdout, "-h, --help display this information page and exit\n"); fprintf(stdout, "-v, --version display the version information and exit\n"); fprintf(stdout, "--import import ROM or TIB into repository without loading\n"); fprintf(stdout, "-rom= ROM dump to convert and load\n"); fprintf(stdout, "-tib= TIB or upgrade to convert and load\n"); fprintf(stdout, "-sav= state image to load\n"); fprintf(stdout, "\n"); fprintf(stdout, "filename a filename which contains a TiEmu image\n"); fprintf(stdout, "\n"); exit(0); return 0; } static int strexact(char *p1, char *p2) { return (strstr(p1,p2) && strstr(p2,p1)); } /* Scan the command line, extract arguments and init variables */ int scan_cmdline(int argc, char **argv) { int cnt; char *p; char *q; char msg[80]; gchar *dstname; int import = 0; for(cnt=1; cnt