mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
Add config option "dos/dos idle api"
This commit is contained in:
@@ -723,19 +723,23 @@ bool device_CON::Read(uint8_t * data,uint16_t * size) {
|
||||
|
||||
const uint8_t int16_poll_function=(IS_EGAVGA_ARCH)?0x11:0x1;
|
||||
const uint8_t int16_read_function=(IS_EGAVGA_ARCH)?0x10:0x0;
|
||||
// Poll the keyboard until there is a key-press ready to read. If there
|
||||
// is no input (ZF=0) then call INT 28h to release the rest of our
|
||||
// timeslice to host system.
|
||||
while (true) {
|
||||
reg_ah=int16_poll_function;
|
||||
if (IS_PC98_ARCH)
|
||||
INT16_Handler_Wrap();
|
||||
else
|
||||
CALLBACK_RunRealInt(0x16);
|
||||
if (GETFLAG(ZF) == 0) {
|
||||
break;
|
||||
} else {
|
||||
CALLBACK_RunRealInt(0x28);
|
||||
|
||||
static const bool idle_enabled = ((Section_prop*)control->GetSection("dos"))->Get_bool("dos idle api");
|
||||
if (idle_enabled) {
|
||||
// Poll the keyboard until there is a key-press ready to read. If there
|
||||
// is no input (ZF=0) then call INT 28h to release the rest of our
|
||||
// timeslice to host system.
|
||||
while (true) {
|
||||
reg_ah=int16_poll_function;
|
||||
if (IS_PC98_ARCH)
|
||||
INT16_Handler_Wrap();
|
||||
else
|
||||
CALLBACK_RunRealInt(0x16);
|
||||
if (GETFLAG(ZF) == 0) {
|
||||
break;
|
||||
} else {
|
||||
CALLBACK_RunRealInt(0x28);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4262,7 +4262,11 @@ public:
|
||||
callback[4].Install(DOS_27Handler,CB_IRET,"DOS Int 27");
|
||||
callback[4].Set_RealVec(0x27);
|
||||
|
||||
callback[5].Install(NULL,CB_INT28,"DOS idle");
|
||||
if (section->Get_bool("dos idle api")) {
|
||||
callback[5].Install(NULL,CB_INT28,"DOS idle");
|
||||
} else {
|
||||
callback[5].Install(NULL,CB_IRET,"DOS idle");
|
||||
}
|
||||
callback[5].Set_RealVec(0x28);
|
||||
|
||||
if (IS_PC98_ARCH) {
|
||||
|
@@ -397,10 +397,15 @@ static bool DOS_MultiplexFunctions(void) {
|
||||
return false;
|
||||
}
|
||||
case 0x1680: /* RELEASE CURRENT VIRTUAL MACHINE TIME-SLICE */
|
||||
CPU_STI();
|
||||
CPU_HLT(reg_eip);
|
||||
reg_al = 0;
|
||||
{
|
||||
static const bool idle_enabled = ((Section_prop*)control->GetSection("dos"))->Get_bool("dos idle api");
|
||||
if (idle_enabled) {
|
||||
CPU_STI();
|
||||
CPU_HLT(reg_eip);
|
||||
reg_al = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case 0x1689: /* Kernel IDLE CALL */
|
||||
case 0x168f: /* Close awareness crap */
|
||||
/* Removing warning */
|
||||
|
@@ -4503,6 +4503,10 @@ void DOSBOX_SetupConfigSections(void) {
|
||||
Pbool->Set_help("If set, DOS APIs for communications with the Windows clipboard will be enabled for shared clipboard communications.");
|
||||
Pbool->SetBasic(true);
|
||||
|
||||
Pbool = secprop->Add_bool("dos idle api",Property::Changeable::OnlyAtStart,true);
|
||||
Pbool->Set_help("If set, DOSBox-X can lower the host system's CPU load when a supported guest program is idle.");
|
||||
Pbool->SetBasic(true);
|
||||
|
||||
secprop=control->AddSection_prop("ipx",&Null_Init,true);
|
||||
Pbool = secprop->Add_bool("ipx",Property::Changeable::WhenIdle, false);
|
||||
Pbool->Set_help("Enable ipx over UDP/IP emulation.");
|
||||
|
Reference in New Issue
Block a user