diff --git a/CHANGELOG b/CHANGELOG index c3a0a59ff37..253b0c7ca87 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,8 @@ Next: + - Add --load-seg option to BOOT in case any PC-98 game boot floppy expects + to be loaded somewhere other than the default. PC-98 game "Private School + Adventure" will crash if loaded to segment 0x1FC0 but runs fine if booted + with --load-seg 0x0FC0 instead. (joncampbell123) - Add dosbox.conf option to direct the EMS page frame segment, in a limited fashion, though only effective for PC-98 mode. PC-98 segment is still 0xD000 by default, but apparently there are games that require the EMS diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index d97e395dd41..4689710b332 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -1903,6 +1903,7 @@ class BOOT : public Program { /*! \brief Program entry point, when the command is run */ void Run(void) { + std::string tmp; std::string bios; std::string boothax_str; bool pc98_640x200 = true; @@ -1911,6 +1912,7 @@ class BOOT : public Program { bool swaponedrive = false; bool convertro = false; bool force = false; + int loadseg_user = -1; int convimg = -1; int quiet = 0; @@ -1954,6 +1956,10 @@ class BOOT : public Program { if (cmd->FindString("-bios",bios,true)) bios_boot = true; + cmd->FindString("-load-seg",tmp,true); + if (!tmp.empty()) + loadseg_user = strtoul(tmp.c_str(),NULL,0); + cmd->FindString("-boothax",boothax_str,true); if (boothax_str == "msdos") // WARNING: For MS-DOS only, including MS-DOS 7/8 included in Windows 95/98/ME. @@ -2342,7 +2348,10 @@ class BOOT : public Program { } /* NTS: Load address is 128KB - sector size */ - load_seg=IS_PC98_ARCH ? (0x2000 - (bootsize/16U)) : 0x07C0; + if (loadseg_user > 0) /* Some PC-98 games have floppy boot code that suggests the boot segment isn't always 0x1FC0 like PC-9821 hardware does? */ + load_seg=(unsigned int)loadseg_user; + else + load_seg=IS_PC98_ARCH ? (0x2000 - (bootsize/16U)) : 0x07C0; if (!has_read) { if (imageDiskList[drive - 65]->Read_Sector(0, 0, 1, (uint8_t *)&bootarea) != 0) {