diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index d8e2a3af..3dc25faf 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -720,13 +720,19 @@ Bit8u DOS_FCBWrite(Bit16u seg,Bit16u offset,Bit16u recno) } Bit8u DOS_FCBRandomRead(Bit16u seg,Bit16u offset,Bit16u numRec,bool restore) { +/* if restore is true :random read else random blok read. + * random read updates old block and old record to reflect the random data + * before the read!!!!!!!!! and the random data is not updated! (user must do this) + * Random block read updates these fields to reflect the state after the read! + */ DOS_FCB fcb(seg,offset); Bit32u random;Bit16u old_block;Bit8u old_rec;Bit8u error; + /* Set the correct record from the random data */ fcb.GetRandom(random); - if (restore) fcb.GetRecord(old_block,old_rec); fcb.SetRecord((Bit16u)(random / 128),(Bit8u)(random & 127)); + if (restore) fcb.GetRecord(old_block,old_rec);//store this for after the read. // Read records for (int i=0; i