1
0
Fork 0

Call int 0xe when resetting a disk. Fixes a keydisk workaround algorithm. (thanks ripsaw)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3751
This commit is contained in:
Peter Veenstra 2011-09-01 12:19:52 +00:00
parent 81085e036e
commit 6dfe1d9dcf
3 changed files with 16 additions and 3 deletions

View file

@ -30,7 +30,7 @@ extern CallBack_Handler CallBack_Handlers[];
enum { CB_RETN,CB_RETF,CB_RETF8,CB_IRET,CB_IRETD,CB_IRET_STI,CB_IRET_EOI_PIC1,
CB_IRQ0,CB_IRQ1,CB_IRQ9,CB_IRQ12,CB_IRQ12_RET,CB_IRQ6_PCJR,CB_MOUSE,
CB_INT29,CB_INT16,CB_HOOKABLE,CB_TDE_IRET,CB_IPXESR,CB_IPXESR_RET,
CB_INT21 };
CB_INT21,CB_INT13 };
#define CB_MAX 128
#define CB_SIZE 32

View file

@ -433,7 +433,18 @@ Bitu CALLBACK_SetupExtra(Bitu callback, Bitu type, PhysPt physAddress, bool use_
phys_writeb(physAddress+0x09,(Bit8u)0x59); // pop cx
phys_writeb(physAddress+0x0A,(Bit8u)0xCF); //An IRET Instruction
return (use_cb?15:11);
case CB_INT13:
phys_writeb(physAddress+0x00,(Bit8u)0xFB); //STI
if (use_cb) {
phys_writeb(physAddress+0x01,(Bit8u)0xFE); //GRP 4
phys_writeb(physAddress+0x02,(Bit8u)0x38); //Extra Callback instruction
phys_writew(physAddress+0x03,(Bit16u)callback); //The immediate word
physAddress+=4;
}
phys_writeb(physAddress+0x01,(Bit8u)0xCF); //An IRET Instruction
phys_writew(physAddress+0x02,(Bit16u)0x0ECD); // int 0e
phys_writeb(physAddress+0x04,(Bit8u)0xCF); //An IRET Instruction
return (use_cb?9:5);
default:
E_Exit("CALLBACK:Setup:Illegal type %d",type);
}

View file

@ -333,12 +333,14 @@ static Bitu INT13_DiskHandler(void) {
if ((machine==MCH_CGA) || (machine==MCH_PCJR)) {
/* those bioses call floppy drive reset for invalid drive values */
if (((imageDiskList[0]) && (imageDiskList[0]->active)) || ((imageDiskList[1]) && (imageDiskList[1]->active))) {
if (reg_dl<0x80) reg_ip++;
last_status = 0x00;
CALLBACK_SCF(false);
}
}
return CBRET_NONE;
}
if (reg_dl<0x80) reg_ip++;
last_status = 0x00;
CALLBACK_SCF(false);
}
@ -500,7 +502,7 @@ static Bitu INT13_DiskHandler(void) {
void BIOS_SetupDisks(void) {
/* TODO Start the time correctly */
call_int13=CALLBACK_Allocate();
CALLBACK_Setup(call_int13,&INT13_DiskHandler,CB_IRET,"Int 13 Bios disk");
CALLBACK_Setup(call_int13,&INT13_DiskHandler,CB_INT13,"Int 13 Bios disk");
RealSetVec(0x13,CALLBACK_RealPointer(call_int13));
int i;
for(i=0;i<4;i++) {