diff --git a/src/sim65/config.c b/src/sim65/config.c new file mode 100644 index 000000000..b0727c001 --- /dev/null +++ b/src/sim65/config.c @@ -0,0 +1,84 @@ +/*****************************************************************************/ +/* */ +/* config.c */ +/* */ +/* Configuration file parsing for the sim65 6502 simulator */ +/* */ +/* */ +/* */ +/* (C) 1998-2002 Ullrich von Bassewitz */ +/* Wacholderweg 14 */ +/* D-70597 Stuttgart */ +/* EMail: uz@musoftware.de */ +/* */ +/* */ +/* This software is provided 'as-is', without any expressed or implied */ +/* warranty. In no event will the authors be held liable for any damages */ +/* arising from the use of this software. */ +/* */ +/* Permission is granted to anyone to use this software for any purpose, */ +/* including commercial applications, and to alter it and redistribute it */ +/* freely, subject to the following restrictions: */ +/* */ +/* 1. The origin of this software must not be misrepresented; you must not */ +/* claim that you wrote the original software. If you use this software */ +/* in a product, an acknowledgment in the product documentation would be */ +/* appreciated but is not required. */ +/* 2. Altered source versions must be plainly marked as such, and must not */ +/* be misrepresented as being the original software. */ +/* 3. This notice may not be removed or altered from any source */ +/* distribution. */ +/* */ +/*****************************************************************************/ + + + +#include +#include +#include +#include + +/* common */ +#include "check.h" +#include "bitops.h" +#include "print.h" +#include "xmalloc.h" + +/* ld65 */ +#include "error.h" +#include "global.h" +#include "scanner.h" +#include "config.h" + + + +/*****************************************************************************/ +/* Data */ +/*****************************************************************************/ + + + +static void ParseConfig (void) +/* Parse the config file */ +{ +} + + + +void CfgRead (void) +/* Read the configuration */ +{ + /* If we have a config name given, open the file, otherwise we will read + * from a buffer. + */ + CfgOpenInput (); + + /* Parse the file */ + ParseConfig (); + + /* Close the input file */ + CfgCloseInput (); +} + + + diff --git a/src/sim65/config.h b/src/sim65/config.h new file mode 100644 index 000000000..bf34deba8 --- /dev/null +++ b/src/sim65/config.h @@ -0,0 +1,59 @@ +/*****************************************************************************/ +/* */ +/* config.h */ +/* */ +/* Configuration file parsing for the sim65 6502 simulator */ +/* */ +/* */ +/* */ +/* (C) 1998-2002 Ullrich von Bassewitz */ +/* Wacholderweg 14 */ +/* D-70597 Stuttgart */ +/* EMail: uz@musoftware.de */ +/* */ +/* */ +/* This software is provided 'as-is', without any expressed or implied */ +/* warranty. In no event will the authors be held liable for any damages */ +/* arising from the use of this software. */ +/* */ +/* Permission is granted to anyone to use this software for any purpose, */ +/* including commercial applications, and to alter it and redistribute it */ +/* freely, subject to the following restrictions: */ +/* */ +/* 1. The origin of this software must not be misrepresented; you must not */ +/* claim that you wrote the original software. If you use this software */ +/* in a product, an acknowledgment in the product documentation would be */ +/* appreciated but is not required. */ +/* 2. Altered source versions must be plainly marked as such, and must not */ +/* be misrepresented as being the original software. */ +/* 3. This notice may not be removed or altered from any source */ +/* distribution. */ +/* */ +/*****************************************************************************/ + + + +#ifndef CONFIG_H +#define CONFIG_H + + + +/*****************************************************************************/ +/* Code */ +/*****************************************************************************/ + + + +void CfgRead (void); +/* Read the configuration */ + + + +/* End of config.h */ + +#endif + + + + + diff --git a/src/sim65/main.c b/src/sim65/main.c index 51c64faae..3c76ca88b 100644 --- a/src/sim65/main.c +++ b/src/sim65/main.c @@ -48,6 +48,7 @@ #include "chip.h" #include "chiplib.h" #include "chippath.h" +#include "config.h" #include "cpucore.h" #include "cputype.h" #include "error.h" @@ -154,7 +155,7 @@ static void OptVersion (const char* Opt attribute ((unused)), /* Print the assembler version */ { fprintf (stderr, - "sim65 V%u.%u.%u\n", + "sim65 V%u.%u.%u\n", VER_MAJOR, VER_MINOR, VER_PATCH); } @@ -244,7 +245,7 @@ int main (int argc, char* argv[]) } /* Read the config file */ -// CfgRead (); + CfgRead (); /* Initialize modules */ AddChipPath ("chips"); diff --git a/src/sim65/make/gcc.mak b/src/sim65/make/gcc.mak index c66585190..3cbd6c42e 100644 --- a/src/sim65/make/gcc.mak +++ b/src/sim65/make/gcc.mak @@ -13,6 +13,7 @@ LDFLAGS = OBJS = chip.o \ chiplib.o \ chippath.o \ + config.o \ cpucore.o \ cputype.o \ error.o \