In preperation for the config file work suggested by Rob, I've checked in some work towards storing the running config of the emulator in a single place.
ArcemConfig.c and ArcemConfig.h It currently stores the memory size (tested and working) and processor variant (that hopefully I'll check the actual backend of in soon). And I'll add the MFM (st506) HD sizes, extnrom and hostfs locations over the next couple of days. Also I'll look into tidying the current ReadConfig.c and ReadConfig.h files and possibly absorb the functions into ArcemConfig if need be. There's a commandline parser for setting the options, but this work doesn't enforce that as the only method of setting options. Michael Dales suggested an alternate GUI method of setting options on Mac OS X, this method would set the values in the hArcemConfig struct in a similar way to the commandline parser. Note that any config system employed needs to go off before we enter the dagstandalone() function (that's the function called directly from main() and WinMain()) as dagstandalone() immediatley sets up the memory size. The commandline parser doesn't work on the windows build (but does on X, Mac OS X and RISC OS) as I couldn't figure out the normal way of converting the the windows Unicode commandline into ascii/utf8 argc/argv. Here's the bit of text from the top of ArcemConfig.h that describes how to use it. ------------------------------------------------------------------- FUTURE VERSIONS will absorb the code from ReadConfig.c The Structure hArcemConfig can be filled in by means other than the Command Line parser as needed on a platform by platform basis. Using a configuration value in the rest of the emulator code ------------------------------------------------------------ Use the global variable 'hArcemConfig'. Its properties are defined in the struct ArcemConfig_s below. Use enumeration values or #defines for all properties that support that. Adding a config value to the emulator ------------------------------------- 1) Add a value of the correct type to ArcemConfig. If possible use an enumeration or #defines for its values. 2) Make sure the value is initialised to its default value in ArcemConfig_SetupDefaults() 3) Add a way of setting it to alternate values in ArcemConfig_ParseCommandLine() 4) If ways of setting the config other than Command Line are implimented add code for parsing and setting values there too. ------------------------------------------------------------------- Peter -- Peter Howkins [EMAIL PROTECTED] ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ arcem-devel mailing list arcem-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/arcem-devel