Permalink
Browse files

UMB: Use the actual EMS page frame, don't assume 0xE000.

  • Loading branch information...
joncampbell123 committed Dec 24, 2017
1 parent 03202eb commit e0c7bcb39d112b8b9b83e15d774f7dae9a091f03
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/dos/dos_memory.cpp
@@ -407,16 +407,17 @@ bool DOS_FreeMemory(Bit16u segment) {
return true;
}
Bitu GetEMSPageFrameSegment(void);
void DOS_BuildUMBChain(bool umb_active,bool ems_active) {
unsigned int seg_limit = MEM_TotalPages()*256;
/* UMBs are only possible if the machine has 1MB+64KB of RAM */
if (umb_active && (machine!=MCH_TANDY) && seg_limit >= (0x10000+0x1000-1)) {
if (umb_active && (machine!=MCH_TANDY) && seg_limit >= (0x10000+0x1000-1) && first_umb_seg < GetEMSPageFrameSegment()) {
if (ems_active) {
/* we can use UMBs up to the EMS page frame */
/* FIXME: when we make the EMS page frame configurable this will need to be updated */
first_umb_size = 0xE000 - first_umb_seg;
first_umb_size = GetEMSPageFrameSegment() - first_umb_seg;
}
else if (machine == MCH_PCJR) {
/* we can use UMBs up to where PCjr wants cartridge ROM */

0 comments on commit e0c7bcb

Please sign in to comment.