mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 10:48:18 +08:00
DOS_ResizeMemory() compact free blocks but only those from the segment that is being resized on, as MS-DOS is documented to do
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
Next version
|
Next version
|
||||||
|
- INT 21h AH=4Ah resize memory: Compact free blocks only at or after the
|
||||||
|
segment being resized, as MS-DOS is documented to do (joncampbell123).
|
||||||
- INT 21h AH=4Ah resize memory: Fix bug where, if asked to resize a previously
|
- INT 21h AH=4Ah resize memory: Fix bug where, if asked to resize a previously
|
||||||
freed memory block and the block is not the last block in the MCB chain,
|
freed memory block and the block is not the last block in the MCB chain,
|
||||||
and the next block in the MCB chain is also free, the MCB management code
|
and the next block in the MCB chain is also free, the MCB management code
|
||||||
|
@@ -386,12 +386,10 @@ bool DOS_ResizeMemory(uint16_t segment,uint16_t * blocks) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MS-DOS is documented to combine free blocks at or after this block. Also to avoid combining free blocks in a way
|
||||||
|
* that might invalidate the mcb() block we just constructed. */
|
||||||
uint16_t total=mcb.GetSize();
|
uint16_t total=mcb.GetSize();
|
||||||
|
|
||||||
if (*blocks > total)
|
|
||||||
DOS_CompressMemory(segment-1);
|
DOS_CompressMemory(segment-1);
|
||||||
else
|
|
||||||
DOS_CompressMemory();
|
|
||||||
|
|
||||||
/* DOS_CompressMemory() may change the MCB block size if this is a free block when it combines consecutive free blocks.
|
/* DOS_CompressMemory() may change the MCB block size if this is a free block when it combines consecutive free blocks.
|
||||||
* If you don't think this could be a free block, understand that there are DOS applications and games out there
|
* If you don't think this could be a free block, understand that there are DOS applications and games out there
|
||||||
|
Reference in New Issue
Block a user