home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
programs
/
emulaton
/
at2600
/
!v2600
/
c
/
options
< prev
next >
Wrap
Text File
|
1998-06-05
|
1KB
|
67 lines
/*****************************************************************************
This file is part of x2600, the Atari 2600 Emulator
===================================================
Copyright 1996 Alex Hornby. For contributions see the file CREDITS.
***Modified Wed 8th April, 1998 by Ian Molton
This software is distributed under the terms of the GNU General Public
License. This is free software with ABSOLUTELY NO WARRANTY.
See the file COPYING for details.
$Id: options.c,v 1.7 1996/11/24 16:55:40 ahornby Exp $
******************************************************************************/
/* Command Line Option Parser */
#include "config.h"
#include "string.h"
#include <stdio.h>
#include <stdlib.h>
#include "getopt.h"
/* Options common to all ports of x2600 */
struct BaseOptions {
int tvtype;
int lcon;
int rcon;
int bank;
char filename[256];
int mousey;
} base_opts={0,0,0,0,"",0};
int parse_options(int argc, char **argv){
int c;
while (1){
c = getopt(argc, argv, "hvf:npl:r:b:m:sSwjtyMV:");
if (c == -1)
break;
switch (c){
case 'b':
base_opts.bank=atoi(optarg);
break;
case 'l':
base_opts.tvtype=atoi(optarg);
break;
default:
break;
}
}
if (optind < argc){
while (optind < argc){
if(argv[optind]!=NULL)
strcpy(base_opts.filename, argv[optind]);
optind++;
}
}
return 0;
}