Skip to content

Commit

Permalink
Commit joncampbell123#3678 broke commit joncampbell123#3347, revertin…
Browse files Browse the repository at this point in the history
…g breaking changes to get joncampbell123#3347 working again (MEM_BlockWrite MUSTN'T be called on ext device, otherwise it overwrites buffer which causes malfunction)
  • Loading branch information
leecher1337 committed Oct 9, 2022
1 parent 9701de0 commit 8ecbb48
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dos/dos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1980,15 +1980,17 @@ static Bitu DOS_21Handler(void) {
else if(Files[handle]->GetInformation() & EXT_DEVICE_BIT) {
fRead = !(((DOS_ExtDevice*)Files[handle])->CallDeviceFunction(4, 26, SegValue(ds), reg_dx, toread) & 0x8000);
#if defined(USE_TTF)
fRead &= ttf.inUse && reg_bx == WPvga512CHMhandle;
if(fRead && ttf.inUse && reg_bx == WPvga512CHMhandle)
MEM_BlockRead(SegPhys(ds) + reg_dx, dos_copybuf, toread);
#endif
}
else {
fRead = DOS_ReadFile(reg_bx, dos_copybuf, &toread);
else
{
if(fRead = DOS_ReadFile(reg_bx, dos_copybuf, &toread))
MEM_BlockWrite(SegPhys(ds) + reg_dx, dos_copybuf, toread);
}

if (fRead) {
MEM_BlockWrite(SegPhys(ds) + reg_dx, dos_copybuf, toread);
reg_ax=toread;
#if defined(USE_TTF)
if (ttf.inUse && reg_bx == WPvga512CHMhandle) {
Expand Down

0 comments on commit 8ecbb48

Please sign in to comment.