]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/file.cpp
Added Memory Track support. One small step towards full CD-ROM support.
[virtualjaguar] / src / file.cpp
index 06c6822378f2daf982bfe544cdf30983389e2c3d..4262297a4094148f7db3d7857570f871c3dc9b2e 100644 (file)
@@ -8,9 +8,10 @@
 // JLH = James Hammons <jlhamm@acm.org>
 //
 // Who  When        What
-// ---  ----------  -------------------------------------------------------------
+// ---  ----------  ------------------------------------------------------------
 // JLH  01/16/2010  Created this log ;-)
-// JLH  02/28/2010  Added functions to look inside .ZIP files and handle contents
+// JLH  02/28/2010  Added functions to look inside .ZIP files and handle
+//                  contents
 // JLH  06/01/2012  Added function to check ZIP file CRCs against file DB
 //
 
@@ -47,7 +48,7 @@ uint32_t JaguarLoadROM(uint8_t * &rom, char * path)
 #warning "!!! FIX !!! Should have sanity checking for ROM size to prevent buffer overflow!"
        uint32_t romSize = 0;
 
-       WriteLog("JaguarLoadROM: Attempting to load file '%s'...", path);
+       WriteLog("FILE: JaguarLoadROM attempting to load file '%s'...", path);
        char * ext = strrchr(path, '.');
 
        // No filename extension == YUO FAIL IT (it is loading the file).
@@ -59,8 +60,8 @@ uint32_t JaguarLoadROM(uint8_t * &rom, char * path)
                return 0;
        }
 
-       WriteLog("Succeeded in finding extension (%s)!\n", ext);
-       WriteLog("VJ: Loading \"%s\"...", path);
+       WriteLog("\nFILE: Succeeded in finding extension (%s)!\n", ext);
+       WriteLog("FILE: Loading \"%s\"...", path);
 
        if (strcasecmp(ext, ".zip") == 0)
        {
@@ -107,8 +108,9 @@ uint32_t JaguarLoadROM(uint8_t * &rom, char * path)
 
 //
 // Jaguar file loading
-// We do a more intelligent file analysis here instead of relying on (possible false)
-// file extensions which people don't seem to give two shits about anyway. :-(
+// We do a more intelligent file analysis here instead of relying on (possible
+// false) file extensions which people don't seem to give two shits about
+// anyway. :-(
 //
 bool JaguarLoadFile(char * path)
 {
@@ -251,14 +253,16 @@ SET16(jaguarMainRAM, 0x1000, 0x60FE);             // Here: bra Here
        }
 
        // We can assume we have JST_NONE at this point. :-P
+       WriteLog("FILE: Failed to load headerless file.\n");
        return false;
 }
 
 
 //
 // "Alpine" file loading
-// Since the developers were coming after us with torches and pitchforks, we decided to
-// allow this kind of thing. ;-) But ONLY FOR THE DEVS, DAMMIT! >:-U O_O
+// Since the developers were coming after us with torches and pitchforks, we
+// decided to allow this kind of thing. ;-) But ONLY FOR THE DEVS, DAMMIT! >:-U
+// O_O
 //
 bool AlpineLoadFile(char * path)
 {
@@ -273,7 +277,7 @@ bool AlpineLoadFile(char * path)
        }
 
        jaguarMainROMCRC32 = crc32_calcCheckSum(buffer, jaguarROMSize);
-       WriteLog("CRC: %08X\n", (unsigned int)jaguarMainROMCRC32);
+       WriteLog("FILE: CRC is %08X\n", (unsigned int)jaguarMainROMCRC32);
        EepromInit();
 
        jaguarRunAddress = 0x802000;
@@ -285,7 +289,8 @@ bool AlpineLoadFile(char * path)
        delete[] buffer;
 
 // Maybe instead of this, we could try requiring the STUBULATOR ROM? Just a thought...
-       // Try setting the vector to say, $1000 and putting an instruction there that loops forever:
+       // Try setting the vector to say, $1000 and putting an instruction there
+       // that loops forever:
        // This kludge works! Yeah!
        SET32(jaguarMainRAM, 0x10, 0x00001000);         // Set Exception #4 (Illegal Instruction)
        SET16(jaguarMainRAM, 0x1000, 0x60FE);           // Here: bra Here