Skip to content

Commit

Permalink
improve xms memory allocation; update makefile.dos
Browse files Browse the repository at this point in the history
  • Loading branch information
crazii committed Jan 24, 2024
1 parent 437cc0e commit c99f848
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions makefile.dos
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
TARGET := output/sbemu.exe
CC := gcc
CXX := gxx

ifeq ($(DEBUG),)
override DEBUG = 0
endif

DEBUG ?= 0

VERSION ?= LOCAL_DOS
Expand Down
3 changes: 2 additions & 1 deletion mpxplay/au_cards/au_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ int pds_xms_free(unsigned short handle)
int pds_dpmi_xms_allocmem(xmsmem_t * mem,unsigned int size)
{
unsigned long addr;
size = (size+1023)/1024*1024;
size = (size+0xFFF)&~0xFFF; //align to 4K
if( (mem->xms=pds_xms_alloc(size/1024, &addr)) )
{
unsigned long base = 0;
Expand All @@ -302,6 +302,7 @@ int pds_dpmi_xms_allocmem(xmsmem_t * mem,unsigned int size)
{
if(info.address < base)
{
printf("DPMI remap base address\n");
__dpmi_free_physical_address_mapping(&info);
info.address = base + limit + 1;
if(__dpmi_allocate_linear_memory(&info, 0) != 0)//TODO: handle error
Expand Down

0 comments on commit c99f848

Please sign in to comment.