IDE: Add option to enable/disable INT 13h "fake io" hack.

This commit is contained in:
Jonathan Campbell 2013-10-26 09:19:31 -07:00
parent e8fa35dbdc
commit 852248e22b
2 changed files with 17 additions and 5 deletions

View File

@ -1135,21 +1135,28 @@ void DOSBOX_Init(void) {
// secprop->AddInitFunction(&CREDITS_Init);
/* IDE emulation options and setup */
/* FIXME: Why is DOSBox assigning our IDE primary help strings and defaults to ALL IDE sections?!? */
secprop=control->AddSection_prop("ide, primary",&IDE_Primary_Init,false);//done
Pbool = secprop->Add_bool("enable",Property::Changeable::OnlyAtStart,true);
Pbool->Set_help("Enable IDE interface");
Pbool = secprop->Add_bool("int13fakeio",Property::Changeable::WhenIdle,false);
Pbool->Set_help("If set, force IDE state change on certain INT 13h commands.\n"
"IDE registers will be changed as if BIOS had carried out the action.\n"
"If you are running Windows 3.11 or Windows 3.11 Windows for Workgroups\n"
"you must enable this option (and use -reservecyl 1) if you want 32-bit\n"
"disk access to work correctly in DOSBox.");
secprop=control->AddSection_prop("ide, secondary",&IDE_Secondary_Init,false);//done
Pbool = secprop->Add_bool("enable",Property::Changeable::OnlyAtStart,true);
Pbool->Set_help("Enable IDE interface");
Pbool = secprop->Add_bool("int13fakeio",Property::Changeable::WhenIdle,false);
secprop=control->AddSection_prop("ide, tertiary",&IDE_Tertiary_Init,false);//done
Pbool = secprop->Add_bool("enable",Property::Changeable::OnlyAtStart,true);
Pbool->Set_help("Enable IDE interface");
Pbool = secprop->Add_bool("enable",Property::Changeable::OnlyAtStart,false);
Pbool = secprop->Add_bool("int13fakeio",Property::Changeable::WhenIdle,false);
secprop=control->AddSection_prop("ide, quaternary",&IDE_Quaternary_Init,false);//done
Pbool = secprop->Add_bool("enable",Property::Changeable::OnlyAtStart,true);
Pbool->Set_help("Enable IDE interface");
Pbool = secprop->Add_bool("enable",Property::Changeable::OnlyAtStart,false);
Pbool = secprop->Add_bool("int13fakeio",Property::Changeable::WhenIdle,false);
//TODO ?
secline=control->AddSection_line("autoexec",&AUTOEXEC_Init);

View File

@ -262,6 +262,7 @@ public:
class IDEController:public Module_base{
public:
int IRQ;
bool int13fakeio;
unsigned short alt_io;
unsigned short base_io;
unsigned char interface_index;
@ -1195,6 +1196,7 @@ void IDE_EmuINT13DiskReadByBIOS(unsigned char disk,unsigned int cyl,unsigned int
for (idx=0;idx < MAX_IDE_CONTROLLERS;idx++) {
ide = GetIDEController(idx);
if (ide == NULL) continue;
if (!ide->int13fakeio) continue;
/* TODO: Print a warning message if the IDE controller is busy (debug/warning message) */
@ -1243,6 +1245,7 @@ void IDE_ResetDiskByBIOS(unsigned char disk) {
for (idx=0;idx < MAX_IDE_CONTROLLERS;idx++) {
ide = GetIDEController(idx);
if (ide == NULL) continue;
if (!ide->int13fakeio) continue;
/* TODO: Print a warning message if the IDE controller is busy (debug/warning message) */
@ -1803,6 +1806,8 @@ void IDEDevice::select(uint8_t ndh,bool switched_to) {
IDEController::IDEController(Section* configuration,unsigned char index):Module_base(configuration){
Section_prop * section=static_cast<Section_prop *>(configuration);
int13fakeio = section->Get_bool("int13fakeio");
status = 0x00;
host_reset = false;
irq_pending = false;