Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

main.h

Go to the documentation of this file.
00001 /*
00002  *  main.h - Main program
00003  *
00004  *  Frodo (C) 1994-1997 Christian Bauer
00005  */
00006 
00007 #ifndef _MAIN_H
00008 #define _MAIN_H
00009 
00010 #include "sysdeps.h"
00011 
00012 class Frodo;
00013 class C64;
00014 
00015 #ifdef __SYMBIAN32__
00016 #include <e32std.h>
00017 
00018 class CE32FrodoDocument;
00019 
00020 #endif // __SYMBIAN32__
00021 
00022 
00023 // Global variables
00024 //extern char AppDirPath[1024]; // Path of application directory
00025 #define AppDirPath "\\temp"     // Path of application directory
00026 
00027 
00028 
00029 /*
00030  *  BeOS specific stuff
00031  */
00032 
00033 #ifdef __BEOS__
00034 #include <AppKit.h>
00035 #include <StorageKit.h>
00036 
00037 // Global variables
00038 extern bool FromShell;                  // true: Started from shell, SAM can be used
00039 extern BEntry AppDirectory;             // Application directory
00040 
00041 
00042 // Message codes
00043 const uint32 MSG_STARTUP = 'strt';                      // Start emulation
00044 const uint32 MSG_PREFS = 'pref';                        // Show preferences editor
00045 const uint32 MSG_PREFS_DONE = 'pdon';           // Preferences editor closed
00046 const uint32 MSG_RESET = 'rset';                        // Reset C64
00047 const uint32 MSG_NMI = 'nmi ';                          // Raise NMI
00048 const uint32 MSG_SAM = 'sam ';                          // Invoke SAM
00049 const uint32 MSG_NEXTDISK = 'ndsk';             // Insert next disk in drive 8
00050 const uint32 MSG_TOGGLE_1541 = '1541';          // Toggle processor-level 1541 emulation
00051 const uint32 MSG_OPEN_SNAPSHOT = 'opss';        // Open snapshot file
00052 const uint32 MSG_SAVE_SNAPSHOT = 'svss';        // Save snapshot file
00053 const uint32 MSG_OPEN_SNAPSHOT_RETURNED = 'opsr';       // Open snapshot file panel returned
00054 const uint32 MSG_SAVE_SNAPSHOT_RETURNED = 'svsr';       // Save snapshot file panel returned
00055 
00056 
00057 // Application signature
00058 const char APP_SIGNATURE[] = "application/x-vnd.cebix-Frodo";
00059 
00060 
00061 // Application class
00062 class Frodo : public BApplication {
00063 public:
00064         Frodo();
00065         virtual void ArgvReceived(int32 argc, char **argv);
00066         virtual void RefsReceived(BMessage *message);
00067         virtual void ReadyToRun(void);
00068         virtual void MessageReceived(BMessage *msg);
00069         virtual bool QuitRequested(void);
00070         virtual void AboutRequested(void);
00071 
00072         C64 *TheC64;
00073 
00074 private:
00075         bool load_rom_files(void);
00076 
00077         char prefs_path[1024];  // Pathname of current preferences file
00078         bool prefs_showing;             // true: Preferences editor is on screen
00079 
00080         BMessenger this_messenger;
00081         BFilePanel *open_panel;
00082         BFilePanel *save_panel;
00083 };
00084 
00085 #endif
00086 
00087 
00088 /*
00089  *  AmigaOS specific stuff
00090  */
00091 
00092 #ifdef AMIGA
00093 
00094 class Frodo {
00095 public:
00096         Frodo();
00097         void ArgvReceived(int argc, char **argv);
00098         void ReadyToRun(void);
00099         void RunPrefsEditor(void);
00100 
00101         C64 *TheC64;
00102 
00103 private:
00104         bool load_rom_files(void);
00105 
00106         char prefs_path[256];   // Pathname of current preferences file
00107 };
00108 
00109 // Global variables
00110 extern Frodo *be_app;   // Pointer to Frodo object
00111 
00112 #endif
00113 
00114 
00115 /*
00116  *  X specific stuff
00117  */
00118 
00119 #ifdef __unix
00120 
00121 class Prefs;
00122 
00123 class Frodo {
00124 public:
00125         Frodo();
00126         void ArgvReceived(int argc, char **argv);
00127         void ReadyToRun(void);
00128         static Prefs *reload_prefs(void);
00129 
00130         C64 *TheC64;
00131 
00132 private:
00133         bool load_rom_files(void);
00134 
00135         static char prefs_path[256];    // Pathname of current preferences file
00136 };
00137 
00138 #endif
00139 
00140 
00141 /*
00142  *  Mac specific stuff
00143  */
00144 
00145 #ifdef __mac__
00146 
00147 class Frodo {
00148 public:
00149         Frodo();
00150 
00151         void Run(void);
00152         C64 *TheC64;
00153 
00154 private:
00155         bool load_rom_files(void);
00156 };
00157 
00158 #endif
00159 
00160 
00161 /*
00162  *  WIN32 specific stuff
00163  */
00164 
00165 #ifdef WIN32
00166 
00167 class Frodo {
00168 public:
00169         Frodo();
00170         ~Frodo();
00171         void ArgvReceived(int argc, char **argv);
00172         void ReadyToRun();
00173         void RunPrefsEditor();
00174 
00175         C64 *TheC64;
00176         char prefs_path[256];   // Pathname of current preferences file
00177 
00178 private:
00179         bool load_rom_files();
00180 };
00181 
00182 // Global variables
00183 extern Frodo *TheApp;   // Pointer to Frodo object
00184 extern HINSTANCE hInstance;
00185 extern int nCmdShow;
00186 extern HWND hwnd;
00187 
00188 // Command line options.
00189 extern BOOL full_screen;
00190 
00191 #if defined(DEBUG)
00192 
00193 inline void Debug(const char *format, ...)
00194 {
00195         va_list args;
00196         va_start(args, format);
00197         char tmp[256];
00198         vsprintf(tmp, format, args);
00199         va_end(args);
00200         OutputDebugString(tmp);
00201 }
00202 
00203 #else
00204 
00205 inline void Debug(const char *format, ...)
00206 {
00207 }
00208 
00209 #endif
00210 
00211 #define DebugResult(message, val) \
00212         Debug("%s: 0x%x (%d)\n", message, val, HRESULT_CODE(val))
00213 
00214 #endif
00215 
00216 
00217 /*
00218  *  RiscOS specific stuff
00219  */
00220 
00221 #ifdef __riscos__
00222 
00223 class Frodo
00224 {
00225   public:
00226   Frodo(void);
00227   ~Frodo(void);
00228   void ReadyToRun(void);
00229 
00230   C64 *TheC64;
00231 
00232   private:
00233   bool load_rom_files(void);
00234 };
00235 
00236 #endif
00237 
00238 
00239 /*
00240  *  PSX specific stuff
00241  */
00242 
00243 #ifdef __PSXOS__
00244 
00245 class Frodo {
00246 public:
00247         Frodo();
00248         void ReadyToRun(void);
00249 
00250         C64 *TheC64;
00251 
00252 private:
00253         bool load_rom_files(void);
00254 
00255         char prefs_path[256];   // Pathname of current preferences file
00256 };
00257 
00258 // Global variables
00259 extern Frodo *be_app;   // Pointer to Frodo object
00260 
00261 #endif
00262 
00263 
00264 /*
00265  *  Epoc32 specific stuff
00266  */
00267 
00268 #ifdef __SYMBIAN32__
00269 
00270 #include <e32base.h>
00271 
00272 class Prefs;
00273 
00274 #ifdef __ER6__
00275 const TInt KFrodoPriority = CActive::EPriorityLow; // Give more often time to audio client
00276 #else
00277 const TInt KFrodoPriority = CActive::EPriorityStandard;
00278 #endif
00279 
00280 
00281 class Frodo : public CIdle
00282         {
00283 public:
00284         enum { EPriority = KFrodoPriority };
00285 public:
00286         static Frodo* NewL(CE32FrodoDocument* aDocPtr);
00287         Frodo(CE32FrodoDocument* aDocPtr);
00288         ~Frodo();
00289         void StartC64();
00290         void ArgvReceived(int argc, char **argv);
00291         int ReadyToRun(void);
00292         static Prefs *reload_prefs(void);
00293         C64 *TheC64;
00294 private:
00295         bool load_rom_files(void);
00296 
00297 public:
00298         CE32FrodoDocument* iDocPtr;
00299         };
00300 
00301 #endif // __SYMBIAN32__
00302 
00303 #endif // _MAIN_H

Generated on Tue Feb 8 04:07:57 2005 for E32frodo by doxygen 1.3.3