Commit Graph

74 Commits

Author SHA1 Message Date
Jonathan Campbell
cbe963bc81 If a DOS program shrinks it's own PSP segment down, corrupts the MCB block following it, and them does anything that causes allocation, follow apparent MS-DOS behavior by writing a new free MCB block following the PSP segment instead of crashing the emulation with an MCB chain corruption error. 2025-10-06 00:23:19 -07:00
Jonathan Campbell
d7a4a3131c retab 2025-10-05 23:04:44 -07:00
Allofich
7a36a678d4 Make applicable changes from SVN
From r4485, r4487, r4488 and r4490
2025-08-24 01:24:46 +09:00
Jonathan Campbell
cf7ed0d9dd Allow dos mem limit to direct DOS kernel allocation, the same as memsizekb, so you can have 640KB of RAM but cram DOS into the first 4KB for example 2025-03-13 23:28:04 -07:00
Jonathan Campbell
78b7bb5a01 Put the default INT 3 vector routine well within IHSEG where it cannot cause any more trouble 2024-08-01 18:20:34 -07:00
Jonathan Campbell
1544a71ddb IRET for INT 3 was accidentally placed in the same memory location as the fake SFT, move the IRET 2024-06-02 18:50:53 -07:00
Jonathan Campbell
641c69600a INT 21h: Add option whether to assign MCB ownership or return an error if a DOS program attempts to resize a freed memory block. Fix DOS resize to assign ownership even if the MCB is already the size requested to resize to. 2024-04-16 12:39:17 -07:00
Wengier
365439d544 more 2022-08-20 18:30:29 -04:00
Jonathan Campbell
20e02a33a0 Add dosbox.conf option to enable clearing TF on INT 01h 2022-06-30 16:06:35 -07:00
Jonathan Campbell
40ca58e08e DOS kernel: Modify INT 01 handler to clear trap flag before return so that errant programs that accidentally set the TF (trap flag) without their own interrupt handler for it can work flawlessly. Needed for 1996 demo Dyslexia by Threesome when Sound Blaster is selected. See comments for details 2022-06-30 15:55:33 -07:00
Allofich
a86a5d9300 Fix infinite loop with 32-bit program and 8086 2021-11-28 22:32:13 +09:00
Cimarron Mittelsteadt
38f7b86b25 Fix to avoid windows compile conflict with std::max and internal macro 2021-07-22 08:07:10 -07:00
Cimarron Mittelsteadt
c3f5637e0e Fix with how DOS_Execute allocates memory to comply with the memory allocation strategy for UMB...now, it will allocate and execute in UMB if there is enough memory for the minimum allocation of the executable 2021-07-21 19:13:20 -07:00
Allofich
c2b17e40ed Localize #include "logging.h" from dosbox.h 2021-06-09 11:11:03 +09:00
Allofich
5bc397e6dd Remove redundant casts, parentheses, and break 2021-05-15 00:11:12 +09:00
Jonathan Campbell
54f5f10494 PCjr: If memsize is 128KB or less, subtract 16KB from total memory at BIOS level, omit reserved graphics memory MCB block at the DOS level. Otherwise, report total memory and insert reserved MCB block as if PCjr with a sidecar that adds memory, which is also DOSBox SVN default and its only behavior 2021-03-24 14:23:03 -07:00
Jonathan Campbell
a1685c7120 PCjr: Remove minimum 256KB check, allow setting as low as 64KB, although the DOS kernel still requires 128KB minimum. Fix DOS kernel not to create MCB block past video RAM at top of 128KB if memsize is 128KB. This change makes it possible to run Mickeys Space Adventure in PCjr mode if you set memsize=0 and memsizekb=128. Note the game will corrupt itself if memsize=144 to memsize=256 and will not display anything if memsize=640 which is equivalent to DOSBox SVN PCjr emulation 2021-03-23 20:05:59 -07:00
Jonathan Campbell
07bb0e6b9b Tandy mode: Instead of fixing the 128KB region at 8000:0000, select the 128KB region according to the amount of conventional memory. Remove 384KB minimum E_Exit check, allow down to 64KB but warn if below 256KB. 2021-03-23 19:46:50 -07:00
Jonathan Campbell
88a99c1226 Update Tandy emulation vs memsizekb setting, add FIXME reminders, etc 2021-03-22 23:22:52 -07:00
Allofich
9294d450ec SVN r4412
Update copyright.
2021-03-06 21:18:08 +09:00
Emmanuel Gil Peyrot
a431d81213 Replace Bit16u with uint16_t 2020-09-28 17:14:35 +02:00
Emmanuel Gil Peyrot
35f38f3ebe Replace Bit8u with uint8_t 2020-09-28 17:14:35 +02:00
Wengier
b447cce3a0 more 2020-08-25 22:13:06 -04:00
rderooy
6c0d02201d Update (c) year and FSF address 2020-06-25 09:25:24 +02:00
Wengier
4ebfc59c0d save state etc 2020-06-03 21:46:48 -04:00
Allofich
46e6fc20b1 Type-conversion warning fixes 2019-06-29 22:51:44 +09:00
Allofich
57d8f8e59a SVN r4218
Use a more compatible offset for DOS redirected interrupt vector. Works
around a null pointer bug in the notes dropdown list of Jack the Ripper.
2019-06-11 21:53:29 +09:00
Allofich
d84a812743 SVN r4183 (second half)
Update year
2019-06-03 23:01:41 +09:00
Allofich
05619dd023 SVN r4183 (first half)
Update address of FSF
2019-06-03 22:54:46 +09:00
Allofich
fb067a7331 SVN r4164
Remove 128k PCjr faking from r2417 that was effectively disabled by
r3420.
2019-06-02 18:17:25 +09:00
Allofich
3ee77b9f49 SVN r4063
Remove some unnecessary things from prior commits
2019-05-21 23:25:01 +09:00
Allofich
bab71f6f33 SVN r4046
Point DOS redirected interrupts at a plain IRET as in real DOS. Prevents
erroneous detection of an active debugger, which for example fixes sound
in Microleague Football 2.

(Note: The fix for Microleague Football 2 was already handled in
DOSBox-X through an on-by-default option, but this commit adds the
missing parts of this SVN commit)
2019-05-19 17:22:12 +09:00
Allofich
575ba6749d SVN r3895 (partial)
Coalesce free memory blocks before resizing a block in case it grows; coalesce after resizing only if the block shrinks.
2019-04-30 15:38:09 +09:00
Jonathan Campbell
f459a42639 fix freetype vcxproj 2019-04-02 20:48:10 -07:00
Jonathan Campbell
2f5ca954c4 more 2019-03-31 01:21:40 -07:00
Jonathan Campbell
3810ea5086 compiler warning fixes 2018-12-23 20:18:32 -08:00
Jonathan Campbell
066e80f599 DOS: XMS setup initializes the proper size for UMB region, do not re-initialize again. This fixes problems in PC-98 mode where booting a guest OS unmaps the UMB region AND the PC-98 SOUND ROM BIOS (overlap) 2018-11-18 07:22:57 -08:00
Jonathan Campbell
297d120f86 change default again, comment on what needs to be done for the dummy MCB to work 2018-06-21 07:29:21 -07:00
Jonathan Campbell
d80ee65e3a remove loadfix padding and dummy environ block options 2018-06-21 07:22:14 -07:00
Jonathan Campbell
74489724f9 Wtype convert 2018-06-01 11:44:29 -07:00
James Ye
98f3783f75 Fix potential format string vulnerabilities
This allows compiling with `-Werror=format-security', which is required
for packaging in many GNU/Linux distributions.
See https://en.wikipedia.org/wiki/Uncontrolled_format_string for more
information.
2018-03-21 10:19:46 +11:00
Jonathan Campbell
fe92051abc DOS: A corrupt MCB chain should trigger the debugger and a restart of the DOS kernel, rather than aborting the emulator, if the debugger is available 2018-03-15 09:35:33 -07:00
Jonathan Campbell
e0c7bcb39d UMB: Use the actual EMS page frame, don't assume 0xE000. 2017-12-24 13:05:09 -08:00
Jonathan Campbell
324261df1f DOS unsetup memory 2017-04-01 13:24:59 -07:00
Jonathan Campbell
94c2345b27 convert some LOG_MSG()s to LOG(..,..) for logging cleanup. demote some
log entries to debug level.
2015-12-28 16:24:35 -08:00
Jonathan Campbell
ee467a1151 bugfix: new option (default true) that points INT 1 and INT 3 directly
at the IRETF instruction to appease paranoid DOS games and demos. If INT
1 or 3 point to anything other than IRET some games/demos think they are
being debugged and will bail out. Bugfix for "Digital Dreams" demo.
2015-04-03 13:25:38 -07:00
Jonathan Campbell
ad5f9e456f bugfix: if you can't allocate the EMS system handle, then don't enable
VCPI, the handle memory location is invalid. This fixes memory
corruption within realmode segment 0x1E8-0x507 when memsize=1.
2015-03-23 06:41:37 -07:00
Jonathan Campbell
cbc0b743dc fix UMB mapping for EMS and PCjr cases. don't assume 64KB. 2015-02-15 23:15:12 -08:00
Jonathan Campbell
1ea24c81ee allow user to remove some "padding" and "fake" MCBs from the base of
conventional memory.
2015-02-15 21:29:27 -08:00
Jonathan Campbell
da3104d10d prepare MCB setup for some work 2015-02-15 21:07:13 -08:00