X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ffile.cpp;h=acf90d6f64bff6b61e106258b288b959d9822039;hb=19cb30261693d5c56c79d87030cfe8e1dc9ca033;hp=22f3c8fee3d709645ffe7942fb71a2a74d296e12;hpb=07e61d8dcf16099a862baee79b4ec1e06d76b3d4;p=virtualjaguar diff --git a/src/file.cpp b/src/file.cpp index 22f3c8f..acf90d6 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -2,10 +2,10 @@ // FILE.CPP // // File support -// by James L. Hammons +// by James Hammons // (C) 2010 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // Who When What // --- ---------- ------------------------------------------------------------- @@ -126,9 +126,11 @@ bool JaguarLoadFile(char * path) EepromInit(); jaguarRunAddress = 0x802000; // For non-BIOS runs, this is true int fileType = ParseFileType(buffer[0], buffer[1], jaguarROMSize); + jaguarCartInserted = false; if (fileType == JST_ROM) { + jaguarCartInserted = true; memcpy(jagMemSpace + 0x800000, buffer, jaguarROMSize); delete[] buffer; return true; @@ -215,7 +217,7 @@ bool AlpineLoadFile(char * path) // 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: // This kludge works! Yeah! - SET32(jaguarMainRAM, 0x10, 0x00001000); + SET32(jaguarMainRAM, 0x10, 0x00001000); // Set Exception #4 (Illegal Instruction) SET16(jaguarMainRAM, 0x1000, 0x60FE); // Here: bra Here return true; @@ -305,7 +307,8 @@ uint32 GetFileFromZIP(const char * zipFile, FileType type, uint8 * &buffer) if ((type == FT_SOFTWARE) && (CheckExtension(ze->name, ".j64") || CheckExtension(ze->name, ".rom") || CheckExtension(ze->name, ".abs") - || CheckExtension(ze->name, ".cof") || CheckExtension(ze->name, ".jag"))) + || CheckExtension(ze->name, ".cof") || CheckExtension(ze->name, ".coff") + || CheckExtension(ze->name, ".jag"))) { found = true; WriteLog("FILE: Found software file '%s'.\n", ze->name); @@ -369,7 +372,8 @@ uint32 ParseFileType(uint8 header1, uint8 header2, uint32 size) // If the file size is divisible by 1M, we probably have an regular ROM. // We can also check our CRC32 against the internal ROM database to be sure. - if ((size % 1048576) == 0) + // (We also check for the Memory Track cartridge size here as well...) + if ((size % 1048576) == 0 || size == 131072) return JST_ROM; // If the file size + 8192 bytes is divisible by 1M, we probably have an