From: Robert Pengelly Date: Thu, 22 Oct 2026 04:39:36 +0000 (+0100) Subject: Fix MZ executable load segment calculation X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=bbc46919fd2dcad91a3a6b0d1699718afcca3dd3;p=dosemu.git Fix MZ executable load segment calculation --- diff --git a/main.c b/main.c index dc1b629..56c9a49 100644 --- a/main.c +++ b/main.c @@ -496,7 +496,7 @@ int main (int argc, char **argv) { cpu_reset (&cpu, mem, MEM_SIZE); dos_path = dos_register_initial_program (path); - if (load_mz_file (path, &cpu, EXE_LOAD_SEG << 4, (uint16_t) ((CONVENTIONAL_MEM_SIZE - ((uint32_t) (EXE_LOAD_SEG << 4) << 4)) / 16))) { + if (load_mz_file (path, &cpu, EXE_LOAD_SEG, (uint16_t) ((CONVENTIONAL_MEM_SIZE - ((uint32_t) EXE_LOAD_SEG << 4)) / 16))) { init_psp (dos_path, &cpu, cmd_tail, EXE_LOAD_SEG); } else if (load_com_file (path, &cpu, mem, CONVENTIONAL_MEM_SIZE, EXE_LOAD_SEG, &loaded)) { init_psp (dos_path, &cpu, cmd_tail, EXE_LOAD_SEG);