diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b57a5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +scriptedamigaemulator.js +scriptedamigaemulator.js.map +*.adf +db/index.htm +db/aros-amiga-m68k-ext.bin +db/aros-amiga-m68k-rom.bin +db/demos/index.htm +db/demos_aga/index.htm +db/games/index.htm +db/tools/index.htm \ No newline at end of file diff --git a/index.js b/index.js index 0fc4e27..3b4aca7 100644 --- a/index.js +++ b/index.js @@ -489,8 +489,10 @@ function saee2text(err) { case SAEE_NotRunning: return "The emulator is not running."; case SAEE_NoTimer: return "No timing-functions avail. Please upgrade your browser."; case SAEE_NoMemory: return "Out of memory."; - case SAEE_Internal: return "Internal emulator error."; + case SAEE_Assert: return "Assertiation failed."; + case SAEE_Internal: return "Internal emulator error."; case SAEE_Config_Invalid: return "Invalid configuration."; + case SAEE_Config_Compressed: return "A ZIP file was detected. Compressed files are not yet supported."; case SAEE_CPU_Internal: return "Internal CPU-error."; case SAEE_CPU_Requires68020: return "The selected kickstart-rom does require a 68020 and 32bit address-space"; case SAEE_CPU_Requires680EC20: return "The selected kickstart-rom does require a 68020."; diff --git a/sae/amiga.js b/sae/amiga.js index 972fbdb..eaee448 100644 --- a/sae/amiga.js +++ b/sae/amiga.js @@ -68,6 +68,7 @@ const SAEE_Assert = 5; const SAEE_Internal = 6; const SAEE_Config_Invalid = 10; +const SAEE_Config_Compressed = 11; const SAEE_CPU_Internal = 20; const SAEE_CPU_Requires68020 = 21; diff --git a/sae/utils.js b/sae/utils.js index f45322d..8c689ec 100644 --- a/sae/utils.js +++ b/sae/utils.js @@ -493,6 +493,14 @@ function SAEF_ZFile_fopen_file(file) { l.datasize = file.size; l.allocsize = file.size; //OWN + var magic = ((l.data[0] << 24) | (l.data[1] << 16) | (l.data[2] << 8) | (l.data[3])) >>> 0; + + SAEF_log("SAEF_ZFile_fopen_file() opening '%s', %d/%d bytes, crc32 0x%08x, magic %08x", + l.name, l.size, l.data.length, file.crc32 !== false ? file.crc32 : 0, magic); + + if (magic == 0x04034B50 || magic == 0x504B0304) + SAEF_fatal(SAEE_Config_Compressed, "A ZIP file was detected. Compressed files are not yet supported."); + //if (l.data[0] == 68 && l.data[1] == 77 && l.data[2] == 83 && l.data[3] == 33) { /* DMS! */ if (SAEF_CompareArray(l.data, SAEF_String2Array("DMS!"), 4) == 0) { var dms = new SAEO_DMS();