Skip to content

Commit

Permalink
XMS: Add dosbox.conf option to control the number of XMS handles
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Aug 15, 2018
1 parent a9ce8a6 commit 88e7d00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dosbox.cpp
Expand Up @@ -2378,6 +2378,9 @@ void DOSBOX_SetupConfigSections(void) {
Pbool = secprop->Add_bool("xms",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable XMS support.");

Pint = secprop->Add_int("xms handles",Property::Changeable::WhenIdle,0);
Pint->Set_help("Number of XMS handles available for the DOS environment, or 0 to use a reasonable default");

Pbool = secprop->Add_bool("hma",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Report through XMS that HMA exists (not necessarily available)");

Expand Down
10 changes: 10 additions & 0 deletions src/ints/xms.cpp
Expand Up @@ -632,6 +632,16 @@ class XMS: public Module_base {

if (!section->Get_bool("xms")) return;

XMS_HANDLES = section->Get_int("xms handles");
if (XMS_HANDLES == 0)
XMS_HANDLES = XMS_HANDLES_DEFAULT;
else if (XMS_HANDLES < XMS_HANDLES_MIN)
XMS_HANDLES = XMS_HANDLES_MIN;
else if (XMS_HANDLES > XMS_HANDLES_MAX)
XMS_HANDLES = XMS_HANDLES_MAX;

LOG_MSG("XMS: %u handles allocated for use by the DOS environment",XMS_HANDLES);

/* NTS: Disable XMS emulation if CPU type is less than a 286, because extended memory did not
* exist until the CPU had enough address lines to read past the 1MB mark.
*
Expand Down

0 comments on commit 88e7d00

Please sign in to comment.