Skip to content

Commit

Permalink
IMGMOUNT --load-seg
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Mar 5, 2024
1 parent b74d718 commit 260ba14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/dos/dos_programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 260ba14

Please sign in to comment.