--- Frodo4/Src/main.h 2003/07/01 17:51:17 1.3 +++ Frodo4/Src/main.h 2007/01/28 16:08:37 1.9 @@ -1,7 +1,7 @@ /* * main.h - Main program * - * Frodo (C) 1994-1997,2002-2003 Christian Bauer + * Frodo (C) 1994-1997,2002-2005 Christian Bauer * * 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 @@ -71,10 +71,9 @@ public: virtual bool QuitRequested(void); virtual void AboutRequested(void); - C64 *TheC64; - private: - bool load_rom_files(void); + void load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin); + void load_rom_files(); char prefs_path[1024]; // Pathname of current preferences file bool prefs_showing; // true: Preferences editor is on screen @@ -100,10 +99,9 @@ public: void ReadyToRun(void); void RunPrefsEditor(void); - C64 *TheC64; - private: - bool load_rom_files(void); + void load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin); + void load_rom_files(); char prefs_path[256]; // Pathname of current preferences file }; @@ -128,11 +126,10 @@ public: void ArgvReceived(int argc, char **argv); void ReadyToRun(void); static Prefs *reload_prefs(void); - - C64 *TheC64; - + static char* get_prefs_path() { return prefs_path; }; private: - bool load_rom_files(void); + void load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin); + void load_rom_files(); static char prefs_path[256]; // Pathname of current preferences file }; @@ -151,10 +148,10 @@ public: Frodo(); void Run(void); - C64 *TheC64; private: - bool load_rom_files(void); + void load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin); + void load_rom_files(); }; #endif @@ -174,11 +171,11 @@ public: void ReadyToRun(); void RunPrefsEditor(); - C64 *TheC64; char prefs_path[256]; // Pathname of current preferences file private: - bool load_rom_files(); + void load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin); + void load_rom_files(); }; // Global variables @@ -190,29 +187,6 @@ extern HWND hwnd; // Command line options. extern BOOL full_screen; -#if defined(DEBUG) - -inline void Debug(const char *format, ...) -{ - va_list args; - va_start(args, format); - char tmp[256]; - vsprintf(tmp, format, args); - va_end(args); - OutputDebugString(tmp); -} - -#else - -inline void Debug(const char *format, ...) -{ -} - -#endif - -#define DebugResult(message, val) \ - Debug("%s: 0x%x (%d)\n", message, val, HRESULT_CODE(val)) - #endif @@ -224,18 +198,27 @@ inline void Debug(const char *format, .. class Frodo { - public: - Frodo(void); - ~Frodo(void); - void ReadyToRun(void); - - C64 *TheC64; +public: + Frodo(); + ~Frodo(); + void ReadyToRun(void); - private: - bool load_rom_files(void); +private: + void load_rom(const char *which, const char *path, uint8 *where, size_t size, const uint8 *builtin); + void load_rom_files(); }; #endif +// Global C64 object +extern C64 *TheC64; + + +/* + * Functions + */ + +// Determine whether path name refers to a directory +extern bool IsDirectory(const char *path); #endif