Skip to content

Commit 8ecbb48

Browse files
committed
Commit joncampbell123#3678 broke commit joncampbell123#3347, reverting breaking changes to get joncampbell123#3347 working again (MEM_BlockWrite MUSTN'T be called on ext device, otherwise it overwrites buffer which causes malfunction)
1 parent 9701de0 commit 8ecbb48

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/dos/dos.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,15 +1980,17 @@ static Bitu DOS_21Handler(void) {
19801980
else if(Files[handle]->GetInformation() & EXT_DEVICE_BIT) {
19811981
fRead = !(((DOS_ExtDevice*)Files[handle])->CallDeviceFunction(4, 26, SegValue(ds), reg_dx, toread) & 0x8000);
19821982
#if defined(USE_TTF)
1983-
fRead &= ttf.inUse && reg_bx == WPvga512CHMhandle;
1983+
if(fRead && ttf.inUse && reg_bx == WPvga512CHMhandle)
1984+
MEM_BlockRead(SegPhys(ds) + reg_dx, dos_copybuf, toread);
19841985
#endif
19851986
}
1986-
else {
1987-
fRead = DOS_ReadFile(reg_bx, dos_copybuf, &toread);
1987+
else
1988+
{
1989+
if(fRead = DOS_ReadFile(reg_bx, dos_copybuf, &toread))
1990+
MEM_BlockWrite(SegPhys(ds) + reg_dx, dos_copybuf, toread);
19881991
}
19891992

19901993
if (fRead) {
1991-
MEM_BlockWrite(SegPhys(ds) + reg_dx, dos_copybuf, toread);
19921994
reg_ax=toread;
19931995
#if defined(USE_TTF)
19941996
if (ttf.inUse && reg_bx == WPvga512CHMhandle) {

0 commit comments

Comments
 (0)