Skip to content

Commit

Permalink
Enforce memory mask so 640x350 graphics mode does not cause DOSBox-X …
Browse files Browse the repository at this point in the history
…to crash when video memory size is less than 256KB
  • Loading branch information
joncampbell123 committed Jun 14, 2024
1 parent cfb5fa9 commit 7e25d5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Next:
- Fix memory buffer overrun with machine=ega that can occur with
640x350 mode and less than 256KB of video RAM. (joncampbell123).
- The DOSBox clipboard API (via INT 2Fh) is now disabled by default, because
some programs use it's presence to detect whether they are running under
Windows. This fixes a program where Norton Desktop 1.0 does not use it's
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/vga_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5897,7 +5897,7 @@ static void VGA_VerticalTimer(Bitu /*val*/) {
* switch the CRTC to other non-BYTE modes:
*
* - "Unreal" by Future Crew, "Vectorballs", CRTC WORD mode */
vga.draw.linear_mask = 0x3ffffu;
vga.draw.linear_mask = 0x3ffffu & vga.mem.memmask; /* NTS: We allow EGA with less than 256KB! */
vga.draw.address *= (Bitu)1u << (Bitu)vga.config.addr_shift; /* NTS: Remember the bizarre 4 x 4 mode most SVGA chipsets do */
break;
case M_VGA:
Expand Down

0 comments on commit 7e25d5a

Please sign in to comment.