Skip to content

Commit

Permalink
I appreciate the SFT work but it currently causes Windows 3.1 to cras…
Browse files Browse the repository at this point in the history
…h on exit to DOS, so it is temporarily disabled until that issue is resolved
  • Loading branch information
joncampbell123 committed May 31, 2024
1 parent 5408a4e commit 6adcf63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dos/dos_classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ void DOS_InfoBlock::SetLocation(uint16_t segment) {
sSave(sDIB,nulString[6],(uint8_t)0x20);
sSave(sDIB,nulString[7],(uint8_t)0x20);

#if 0
#if 1 // FIXME: The new code imported from DOSBox Staging is causing Windows 3.1 to crash on exit, so this old code remains active until that can be fixed
/* Create a fake SFT, so programs think there are 100 file handles */
uint16_t sftOffset=offsetof(sDIB,firstFileTable)+0xa2;
sSave(sDIB,firstFileTable,RealMake(segment,sftOffset));
real_writed(segment,sftOffset+0x00,RealMake(segment+0x26,0)); //Next File Table
real_writew(segment,sftOffset+0x04,DOS_FILES/2); //File Table supports DOS_FILES/2 files
real_writed(segment+0x26,0x00,0xffffffff); //Last File Table
real_writew(segment+0x26,0x04,DOS_FILES-DOS_FILES/2); //File Table supports DOS_FILES/2 files
#endif
#else
/* Imported from dosbox-staging/dosbox-staging#3680 */
constexpr int FakeHandles = 100;
Expand Down Expand Up @@ -162,6 +162,7 @@ void DOS_InfoBlock::SetLocation(uint16_t segment) {
real_writed(second_sft_segment, NextTableOffset, EndPointer);
real_writew(second_sft_segment, NumberOfFilesOffset, FakeHandles);
#endif
}

void DOS_InfoBlock::SetFirstMCB(uint16_t _firstmcb) {
Expand Down

0 comments on commit 6adcf63

Please sign in to comment.