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

C64.cpp

Go to the documentation of this file.
00001 /*
00002  *  C64.cpp - Put the pieces together
00003  *
00004  *  Frodo (C) 1994-1997 Christian Bauer
00005  */
00006 
00007 #include "sysdeps.h"
00008 
00009 #include "C64.h"
00010 #include "CPUC64.h"
00011 #include "CPU1541.h"
00012 #include "VIC.h"
00013 #include "SID.h"
00014 #include "CIA.h"
00015 #include "REU.h"
00016 #include "IEC.h"
00017 #include "1541job.h"
00018 #include "Display.h"
00019 #include "Prefs.h"
00020 
00021 #include "main.h"
00022 
00023 #ifdef __SYMBIAN32__
00024 #include "e32frodo.h"
00025 #include "joypad.h"
00026 #endif // __SYMBIAN32__
00027 
00028 #if defined(__unix) && !defined(__svgalib__)
00029 #include "CmdPipe.h"
00030 #endif
00031 
00032 /*
00033 #ifdef FRODO_SC
00034 const bool IsFrodoSC = true;    //AEH 991130 - added const
00035 #else
00036 const bool IsFrodoSC = false;   //AEH 991130 - added const
00037 #endif
00038 */
00039 
00040 
00041 void MakePath(char* aPathBuf, char* aFileName)
00045         {
00046 #ifdef __SYMBIAN32__
00047 
00048         TBuf8<KMaxFileName> driveAndPath;
00049     driveAndPath.Copy(((CE32FrodoApplication*)CEikonEnv::Static()->EikAppUi()->Application())->GetDriveAndPath());
00050         TPtrC8 fileName((TText8*)aFileName);
00051         driveAndPath.Append(fileName);
00052         driveAndPath.ZeroTerminate();
00053         Mem::Copy(aPathBuf,driveAndPath.Ptr(),driveAndPath.Length()+1);
00054 
00055 #ifdef __WINS__
00056         aPathBuf[0] = 'C';      // executes from Z, use C instead
00057 #endif
00058 
00059 #endif // __SYMBIAN32__
00060         }
00061 
00062 
00063 C64::C64(Frodo* aFrodoPtr)
00067         :iFrodoPtr(aFrodoPtr)
00068                            ,ThePrefs(*(new Prefs))
00069                            ,ThePrefsOnDisk(*(new Prefs))
00070         {
00071         __CHECK_NULL(aFrodoPtr);
00072 
00073         int i,j;
00074         uint8 *p;
00075 
00076 #ifdef __SYMBIAN32__
00077         iJoyPadObserver = new (ELeave) CJoyPadObserver;
00078 #endif
00079 
00080         // create prefs here
00081 
00082         // Load preferences (after C64 have been created!)
00083 
00084         bool loaded = false;
00085 
00086         iIsAudioPending = EFalse;
00087 
00088 #ifdef __SYMBIAN32__
00089 
00090 #define prefs_path "frodo.fpr"
00091         char fileName[128];
00092         MakePath(fileName,prefs_path);
00093 
00094         loaded = ThePrefs.Load(fileName);
00095 
00096 #endif // __SYMBIAN32__
00097 
00098         ThePrefsOnDisk = ThePrefs;
00099 
00100         // if we don't find prefs, then change them so they are saved.
00101         if(!loaded)
00102                 ThePrefsOnDisk.LimitSpeed = !ThePrefsOnDisk.LimitSpeed;
00103 
00104         // The thread is not yet running
00105         thread_running = false;
00106         quit_thyself = false;
00107         have_a_break = false;
00108 
00109         // System-dependent things
00110         c64_ctor1();
00111 
00112         // Open display
00113         TheDisplay = new C64Display(this);
00114 
00115         // Allocate RAM/ROM memory
00116         RAM = new uint8[0x10000];
00117         Basic = new uint8[0x2000];
00118         Kernal = new uint8[0x2000];
00119         Char = new uint8[0x1000];
00120         Color = new uint8[0x0400];
00121         RAM1541 = new uint8[0x0800];
00122         ROM1541 = new uint8[0x4000];
00123 
00124         // Create the chips
00125         TheCPU = new MOS6510(this, RAM, Basic, Kernal, Char, Color);
00126 
00127         TheJob1541 = new Job1541(RAM1541, this);
00128         TheCPU1541 = new MOS6502_1541(this, TheJob1541, TheDisplay, RAM1541, ROM1541);
00129 
00130         TheVIC = TheCPU->TheVIC = new MOS6569(this, TheDisplay, TheCPU, RAM, Char, Color);
00131         TheSID = TheCPU->TheSID = new MOS6581(this);
00132         TheCIA1 = TheCPU->TheCIA1 = new MOS6526_1(TheCPU, TheVIC);
00133         TheCIA2 = TheCPU->TheCIA2 = TheCPU1541->TheCIA2 = new MOS6526_2(TheCPU, TheVIC, TheCPU1541);
00134         TheIEC = TheCPU->TheIEC = new IEC(TheDisplay);
00135         TheREU = TheCPU->TheREU = new REU(TheCPU);
00136 
00137         // Initialize RAM with powerup pattern
00138         for (i=0, p=RAM; i<512; i++) {
00139                 for (j=0; j<64; j++)
00140                         *p++ = 0;
00141                 for (j=0; j<64; j++)
00142                         *p++ = 0xff;
00143         }
00144 
00145         // Initialize color RAM with random values
00146         for (i=0, p=Color; i<1024; i++)
00147                 *p++ = rand() & 0x0f;
00148 
00149         // Clear 1541 RAM
00150         memset(RAM1541, 0, 0x800);
00151 
00152 #ifndef __SYMBIAN32__
00153         // Open joystick drivers if required
00154         open_close_joysticks(false, false, ThePrefs.Joystick1On, ThePrefs.Joystick2On);
00155 #endif
00156 
00157         joykey = 0xff;
00158 
00159 #ifdef FRODO_SC
00160         CycleCounter = 0;
00161 #endif
00162 
00163         // System-dependent things
00164         c64_ctor2();
00165 
00166         CTOR(C64);
00167 
00168 }
00169 
00170 
00171 C64::~C64()
00175         {
00176 
00177 #ifndef __SYMBIAN32__
00178         open_close_joysticks(ThePrefs.Joystick1On, ThePrefs.Joystick2On, false, false);
00179 #else
00180         delete iJoyPadObserver;
00181 #endif
00182 
00183         delete TheJob1541;
00184         delete TheREU;
00185         delete TheIEC;
00186         delete TheCIA2;
00187         delete TheCIA1;
00188         delete TheSID;
00189         delete TheVIC;
00190         delete TheCPU1541;
00191         delete TheCPU;
00192         delete TheDisplay;
00193 
00194         delete[] RAM;
00195         delete[] Basic;
00196         delete[] Kernal;
00197         delete[] Char;
00198         delete[] Color;
00199         delete[] RAM1541;
00200         delete[] ROM1541;
00201 
00203 #ifdef __SYMBIAN32__
00204         // save prefs if changed
00205         if(ThePrefs.operator != (ThePrefsOnDisk) )
00206                 {
00207                 char fileName[128];
00208                 MakePath(fileName,prefs_path);
00209 
00210                 const bool ret = ThePrefs.Save(fileName);
00211                 if(ret)
00212                         {
00213                         ELOG2(_L8("New prefs saved to '%s'\n"), fileName);
00214                         }
00215                 else
00216                         {
00217                         ELOG1(_L8("Warning: could not save prefs disk\n"));
00218                         }
00219 
00220                 }
00221 #endif
00222 
00223         delete &ThePrefs;
00224         delete &ThePrefsOnDisk;
00225 
00226         c64_dtor();
00227 
00228         DTOR(C64);
00229 }
00230 
00231 
00232 void C64::Reset(void)
00233 /*
00234  *  Reset C64
00235  */
00236 {
00237         TheCPU->AsyncReset();
00238         TheCPU1541->AsyncReset();
00239         TheSID->Reset();
00240         TheCIA1->Reset();
00241         TheCIA2->Reset();
00242         TheIEC->Reset();
00243 
00244 #ifdef __SYMBIAN32__
00245         TheDisplay->ResetKeyboardState();
00246 #endif
00247 
00248         ELOG1(_L8("C64 reset\n"));
00249         }
00250 
00251 
00252 
00253 void C64::NMI(void)
00257 {
00258         TheCPU->AsyncNMI();
00259 }
00260 
00261 
00262 void C64::NewPrefs(Prefs *prefs)
00268 {
00269         ELOG1(_L8("C64::NewPrefs\n"));
00270  
00271 #ifndef __SYMBIAN32__
00272         open_close_joysticks(ThePrefs.Joystick1On, ThePrefs.Joystick2On, prefs->Joystick1On, prefs->Joystick2On);
00273 #endif
00274 
00275         PatchKernal(prefs->FastReset, prefs->Emul1541Proc);
00276 
00277         TheDisplay->NewPrefs(prefs);
00278 
00279 #ifdef __riscos__
00280         // Changed order of calls. If 1541 mode hasn't changed the order is insignificant.
00281         if (prefs->Emul1541Proc) {
00282                 // New prefs have 1541 enabled ==> if old prefs had disabled free drives FIRST
00283                 TheIEC->NewPrefs(prefs);
00284                 TheJob1541->NewPrefs(prefs);
00285         } else {
00286                 // New prefs has 1541 disabled ==> if old prefs had enabled free job FIRST
00287                 TheJob1541->NewPrefs(prefs);
00288                 TheIEC->NewPrefs(prefs);
00289         }
00290 #else
00291         TheIEC->NewPrefs(prefs);
00292         TheJob1541->NewPrefs(prefs);
00293 #endif
00294 
00295         TheREU->NewPrefs(prefs);
00296         TheSID->NewPrefs(prefs);
00297 
00298         // Reset 1541 processor if turned on
00299         if (!ThePrefs.Emul1541Proc && prefs->Emul1541Proc)
00300                 TheCPU1541->AsyncReset();
00301 }
00302 
00303 
00304 void C64::PatchKernal(bool fast_reset, bool emul_1541_proc)
00308         {
00309         if (fast_reset) {
00310                 Kernal[0x1d84] = 0xa0;
00311                 Kernal[0x1d85] = 0x00;
00312         } else {
00313                 Kernal[0x1d84] = orig_kernal_1d84;
00314                 Kernal[0x1d85] = orig_kernal_1d85;
00315         }
00316 
00317         if (emul_1541_proc) {
00318                 Kernal[0x0d40] = 0x78;
00319                 Kernal[0x0d41] = 0x20;
00320                 Kernal[0x0d23] = 0x78;
00321                 Kernal[0x0d24] = 0x20;
00322                 Kernal[0x0d36] = 0x78;
00323                 Kernal[0x0d37] = 0x20;
00324                 Kernal[0x0e13] = 0x78;
00325                 Kernal[0x0e14] = 0xa9;
00326                 Kernal[0x0def] = 0x78;
00327                 Kernal[0x0df0] = 0x20;
00328                 Kernal[0x0dbe] = 0xad;
00329                 Kernal[0x0dbf] = 0x00;
00330                 Kernal[0x0dcc] = 0x78;
00331                 Kernal[0x0dcd] = 0x20;
00332                 Kernal[0x0e03] = 0x20;
00333                 Kernal[0x0e04] = 0xbe;
00334         } else {
00335                 Kernal[0x0d40] = 0xf2;  // IECOut
00336                 Kernal[0x0d41] = 0x00;
00337                 Kernal[0x0d23] = 0xf2;  // IECOutATN
00338                 Kernal[0x0d24] = 0x01;
00339                 Kernal[0x0d36] = 0xf2;  // IECOutSec
00340                 Kernal[0x0d37] = 0x02;
00341                 Kernal[0x0e13] = 0xf2;  // IECIn
00342                 Kernal[0x0e14] = 0x03;
00343                 Kernal[0x0def] = 0xf2;  // IECSetATN
00344                 Kernal[0x0df0] = 0x04;
00345                 Kernal[0x0dbe] = 0xf2;  // IECRelATN
00346                 Kernal[0x0dbf] = 0x05;
00347                 Kernal[0x0dcc] = 0xf2;  // IECTurnaround
00348                 Kernal[0x0dcd] = 0x06;
00349                 Kernal[0x0e03] = 0xf2;  // IECRelease
00350                 Kernal[0x0e04] = 0x07;
00351         }
00352 
00353         // 1541
00354         ROM1541[0x2ae4] = 0xea;         // Don't check ROM checksum
00355         ROM1541[0x2ae5] = 0xea;
00356         ROM1541[0x2ae8] = 0xea;
00357         ROM1541[0x2ae9] = 0xea;
00358         ROM1541[0x2c9b] = 0xf2;         // DOS idle loop
00359         ROM1541[0x2c9c] = 0x00;
00360         ROM1541[0x3594] = 0x20;         // Write sector
00361         ROM1541[0x3595] = 0xf2;
00362         ROM1541[0x3596] = 0xf5;
00363         ROM1541[0x3597] = 0xf2;
00364         ROM1541[0x3598] = 0x01;
00365         ROM1541[0x3b0c] = 0xf2;         // Format track
00366         ROM1541[0x3b0d] = 0x02;
00367 }
00368 
00369 
00370 void C64::SaveRAM(char *filename)
00374 {
00375         FILE *f;
00376 
00377         if ((f = fopen(filename, "wb")) == NULL)
00378                 ShowRequester("RAM save failed.", "OK", NULL);
00379         else
00380                 {
00381                 fwrite((void*)RAM, 1, 0x10000, f);
00382                 fwrite((void*)Color, 1, 0x400, f);
00383                 if (ThePrefs.Emul1541Proc)
00384                         fwrite((void*)RAM1541, 1, 0x800, f);
00385                 fclose(f);
00386         }
00387 }
00388 
00389 
00390 int C64::SaveCPUState(FILE *f)
00398         {
00399         MOS6510State state;
00400         TheCPU->GetState(&state);
00401 
00402         if (!state.instruction_complete)
00403                 return -1;
00404 
00405         int i = fwrite(RAM, 0x10000, 1, f);
00406         i += fwrite(Color, 0x400, 1, f);
00407         i += fwrite((void*)&state, sizeof(state), 1, f);
00408 
00409         return i == 3;
00410         }
00411 
00412 
00413 bool C64::LoadCPUState(FILE *f)
00414 /*
00415  *  Load CPU state from snapshot
00416  */
00417         {
00418         MOS6510State state;
00419 
00420         int i = fread(RAM, 0x10000, 1, f);
00421         i += fread(Color, 0x400, 1, f);
00422         i += fread((void*)&state, sizeof(state), 1, f);
00423 
00424         if (i == 3) {
00425                 TheCPU->SetState(&state);
00426                 return true;
00427         } else
00428                 return false;
00429         }
00430 
00431 
00432 int C64::Save1541State(FILE *f)
00433 /*
00434  *  Save 1541 state to snapshot
00435  *
00436  *  0: Error
00437  *  1: OK
00438  *  -1: Instruction not completed
00439  */
00440         {
00441         MOS6502State state;
00442         TheCPU1541->GetState(&state);
00443 
00444         if (!state.idle && !state.instruction_complete)
00445                 return -1;
00446 
00447         int i = fwrite(RAM1541, 0x800, 1, f);
00448         i += fwrite((void*)&state, sizeof(state), 1, f);
00449 
00450         return i == 2;
00451         }
00452 
00453 
00454 bool C64::Load1541State(FILE *f)
00458         {
00459         MOS6502State state;
00460 
00461         int i = fread(RAM1541, 0x800, 1, f);
00462         i += fread((void*)&state, sizeof(state), 1, f);
00463 
00464         if (i == 2) {
00465                 TheCPU1541->SetState(&state);
00466                 return true;
00467         } else
00468                 return false;
00469         }
00470 
00471 
00472 bool C64::SaveVICState(FILE *f)
00476         {
00477         MOS6569State state;
00478         TheVIC->GetState(&state);
00479         return fwrite((void*)&state, sizeof(state), 1, f) == 1;
00480         }
00481 
00482 
00483 bool C64::LoadVICState(FILE *f)
00487         {
00488         MOS6569State state;
00489 
00490         if (fread((void*)&state, sizeof(state), 1, f) == 1) {
00491                 TheVIC->SetState(&state);
00492                 return true;
00493         } else
00494                 return false;
00495         }
00496 
00497 
00498 bool C64::SaveSIDState(FILE *f)
00502         {
00503         MOS6581State state;
00504         TheSID->GetState(&state);
00505         return fwrite((void*)&state, sizeof(state), 1, f) == 1;
00506         }
00507 
00508 
00509 
00510 bool C64::LoadSIDState(FILE *f)
00514         {
00515         MOS6581State state;
00516 
00517         if (fread((void*)&state, sizeof(state), 1, f) == 1) {
00518                 TheSID->SetState(&state);
00519                 return true;
00520         } else
00521                 return false;
00522         }
00523 
00524 
00525 bool C64::SaveCIAState(FILE *f)
00529         {
00530         MOS6526State state;
00531         TheCIA1->GetState(&state);
00532 
00533         if (fwrite((void*)&state, sizeof(state), 1, f) == 1) {
00534                 TheCIA2->GetState(&state);
00535                 return fwrite((void*)&state, sizeof(state), 1, f) == 1;
00536         } else
00537                 return false;
00538         }
00539 
00540 
00541 bool C64::LoadCIAState(FILE *f)
00545         {
00546         MOS6526State state;
00547 
00548         if (fread((void*)&state, sizeof(state), 1, f) == 1) {
00549                 TheCIA1->SetState(&state);
00550                 if (fread((void*)&state, sizeof(state), 1, f) == 1) {
00551                         TheCIA2->SetState(&state);
00552                         return true;
00553                 } else
00554                         return false;
00555         } else
00556                 return false;
00557         }
00558 
00559 
00560 bool C64::Save1541JobState(FILE *f)
00564         {
00565         Job1541State state;
00566         TheJob1541->GetState(&state);
00567         return fwrite((void*)&state, sizeof(state), 1, f) == 1;
00568         }
00569 
00570 
00571 bool C64::Load1541JobState(FILE *f)
00575         {
00576         Job1541State state;
00577 
00578         if (fread((void*)&state, sizeof(state), 1, f) == 1) {
00579                 TheJob1541->SetState(&state);
00580                 return true;
00581         } else
00582                 return false;
00583         }
00584 
00585 
00586 #define SNAPSHOT_HEADER "FrodoSnapshot"
00587 #define SNAPSHOT_1541 1
00588 
00589 #define ADVANCE_CYCLES  \
00590         TheVIC->EmulateCycle(); \
00591         TheCIA1->EmulateCycle(); \
00592         TheCIA2->EmulateCycle(); \
00593         TheCPU->EmulateCycle(); \
00594         if (ThePrefs.Emul1541Proc) { \
00595                 TheCPU1541->CountVIATimers(1); \
00596                 if (!TheCPU1541->Idle) \
00597                         TheCPU1541->EmulateCycle(); \
00598         }
00599 
00600 
00601 void C64::SaveSnapshot(char *filename)
00611         {
00612         FILE *f;
00613         uint8 flags;
00614 #ifdef FRODO_SC // AEH 991113
00615         uint8 delay;
00616         int stat;
00617 #endif
00618 
00619         if ((f = fopen(filename, "wb")) == NULL) {
00620                 ShowRequester("Unable to open snapshot file", "OK", NULL);
00621                 return;
00622         }
00623 
00624         fprintf(f, "%s%c", SNAPSHOT_HEADER, 10);
00625         fputc(0, f);    // Version number 0
00626         flags = 0;
00627         if (ThePrefs.Emul1541Proc)
00628                 flags |= SNAPSHOT_1541;
00629         fputc(flags, f);
00630         SaveVICState(f);
00631         SaveSIDState(f);
00632         SaveCIAState(f);
00633 
00634 #ifdef FRODO_SC
00635         delay = 0;
00636         do {
00637                 if ((stat = SaveCPUState(f)) == -1) {   // -1 -> Instruction not finished yet
00638                         ADVANCE_CYCLES; // Advance everything by one cycle
00639                         delay++;
00640                 }
00641         } while (stat == -1);
00642         fputc(delay, f);        // Number of cycles the saved CPUC64 lags behind the previous chips
00643 #else
00644         SaveCPUState(f);
00645         fputc(0, f);            // No delay
00646 #endif
00647 
00648         if (ThePrefs.Emul1541Proc) {
00649                 fwrite(ThePrefs.DrivePath[0], 256, 1, f);
00650 #ifdef FRODO_SC
00651                 delay = 0;
00652                 do {
00653                         if ((stat = Save1541State(f)) == -1) {
00654                                 ADVANCE_CYCLES;
00655                                 delay++;
00656                         }
00657                 } while (stat == -1);
00658                 fputc(delay, f);
00659 #else
00660                 Save1541State(f);
00661                 fputc(0, f);    // No delay
00662 #endif
00663                 Save1541JobState(f);
00664         }
00665         fclose(f);
00666 
00667 #ifdef __riscos__
00668         TheWIMP->SnapshotSaved(true);
00669 #endif
00670         }
00671 
00672 
00673 
00674 bool C64::LoadSnapshot(char *filename)
00678         {
00679         FILE *f;
00680 
00681         if ((f = fopen(filename, "rb")) != NULL) {
00682                 char Header[] = SNAPSHOT_HEADER;
00683                 char *b = Header, c = 0;
00684                 uint8 delay;
00685 #ifdef FRODO_SC
00686                 uint8 i;        // AEH 991113
00687 #endif
00688                 // For some reason memcmp()/strcmp() and so forth utterly fail here.
00689                 while (*b > 32) {
00690                         if ((c = fgetc(f)) != *b++) {
00691                                 b = NULL;
00692                                 break;
00693                         }
00694                 }
00695                 if (b != NULL) {
00696                         uint8 flags;
00697                         bool error = false;
00698 #ifndef FRODO_SC
00699                         long vicptr;    // File offset of VIC data
00700 #endif
00701 
00702                         while (c != 10)
00703                                 c = fgetc(f);   // Shouldn't be necessary
00704                         if (fgetc(f) != 0) {
00705                                 ShowRequester("Unknown snapshot format", "OK", NULL);
00706                                 fclose(f);
00707                                 return false;
00708                         }
00709                         flags = fgetc(f);
00710 #ifndef FRODO_SC
00711                         vicptr = ftell(f);
00712 #endif
00713 
00714                         error |= !LoadVICState(f);
00715                         error |= !LoadSIDState(f);
00716                         error |= !LoadCIAState(f);
00717                         error |= !LoadCPUState(f);
00718 
00719                         delay = fgetc(f);       // Number of cycles the 6510 is ahead of the previous chips
00720 #ifdef FRODO_SC
00721                         // Make the other chips "catch up" with the 6510
00722                         for (i=0; i<delay; i++) {
00723                                 TheVIC->EmulateCycle();
00724                                 TheCIA1->EmulateCycle();
00725                                 TheCIA2->EmulateCycle();
00726                         }
00727 #endif
00728                         if ((flags & SNAPSHOT_1541) != 0) {
00729                                 Prefs *prefs = new Prefs(ThePrefs);     //AEH 991202
00730         
00731                                 // First switch on emulation
00732                                 error |= (fread(prefs->DrivePath[0], 256, 1, f) != 1);
00733                                 prefs->Emul1541Proc = true;
00734                                 NewPrefs(prefs);
00735                                 ThePrefs = *prefs;      //AEH 991202
00736                                 delete prefs;
00737         
00738                                 // Then read the context
00739                                 error |= !Load1541State(f);
00740         
00741                                 delay = fgetc(f);       // Number of cycles the 6502 is ahead of the previous chips
00742 #ifdef FRODO_SC
00743                                 // Make the other chips "catch up" with the 6502
00744                                 for (i=0; i<delay; i++) {
00745                                         TheVIC->EmulateCycle();
00746                                         TheCIA1->EmulateCycle();
00747                                         TheCIA2->EmulateCycle();
00748                                         TheCPU->EmulateCycle();
00749                                 }
00750 #endif
00751                                 Load1541JobState(f);
00752 #ifdef __riscos__
00753                                 TheWIMP->ThePrefsToWindow();
00754 #endif
00755                         } else if (ThePrefs.Emul1541Proc) {     // No emulation in snapshot, but currently active?
00756                                 Prefs *prefs = new Prefs(ThePrefs);     //AEH 991202
00757                                 prefs->Emul1541Proc = false;
00758                                 NewPrefs(prefs);
00759                                 ThePrefs = *prefs;      //AEH 991202
00760                                 delete prefs;
00761 #ifdef __riscos__
00762                                 TheWIMP->ThePrefsToWindow();
00763 #endif
00764                         }
00765 
00766 #ifndef FRODO_SC
00767                         fseek(f, vicptr, SEEK_SET);
00768                         LoadVICState(f);        // Load VIC data twice in SL (is REALLY necessary sometimes!)
00769 #endif
00770                         fclose(f);
00771         
00772                         if (error) {
00773                                 ShowRequester("Error reading snapshot file", "OK", NULL);
00774                                 Reset();
00775                                 return false;
00776                         } else
00777                                 return true;
00778                 } else {
00779                         fclose(f);
00780                         ShowRequester("Not a Frodo snapshot file", "OK", NULL);
00781                         return false;
00782                 }
00783         } else {
00784                 ShowRequester("Can't open snapshot file", "OK", NULL);
00785                 return false;
00786         }
00787 }
00788 
00789 
00790 #ifdef __BEOS__
00791 #include "C64_Be.i"
00792 #endif
00793 
00794 #ifdef AMIGA
00795 #include "C64_Amiga.i"
00796 #endif
00797 
00798 #ifdef __unix
00799 #include "C64_x.i"
00800 #endif
00801 
00802 #ifdef __mac__
00803 #include "C64_mac.i"
00804 #endif
00805 
00806 #ifdef WIN32
00807 #include "C64_WIN32.i"
00808 #endif
00809 
00810 #ifdef __riscos__
00811 #include "C64_Acorn.i"
00812 #endif
00813 
00814 #ifdef __SYMBIAN32__
00815 #include "c64_epoc32.i"
00816 #endif
00817 

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