diff --git a/makefile b/makefile index 3a46fb3e..aaa72ac2 100644 --- a/makefile +++ b/makefile @@ -8,13 +8,13 @@ VERSION ?= $(shell git describe --tags) INCLUDES := -I./mpxplay -I./sbemu DEFINES := -D__DOS__ -DSBEMU -DDEBUG=$(DEBUG) -DMAIN_SBEMU_VER=\"$(VERSION)\" #CFLAGS := -fcommon -march=i386 -Os -flto -Wno-attributes $(INCLUDES) $(DEFINES) -AU_BASE_CFLAGS := -fcommon -march=i386 -Os -flto -Wno-attributes $(INCLUDES) $(DEFINES) -AU_CFLAGS := -fcommon -march=i386 -O2 -flto -Wno-attributes $(INCLUDES) $(DEFINES) -SC_CFLAGS := -fcommon -march=i386 -O2 -flto -Wno-attributes $(INCLUDES) $(DEFINES) -MPXPLAY_CFLAGS := -fcommon -march=i386 -O2 -flto -Wno-attributes $(INCLUDES) $(DEFINES) -SBEMU_CFLAGS := -fcommon -march=i386 -O2 -flto -Wno-attributes $(INCLUDES) $(DEFINES) -CFLAGS := -fcommon -march=i386 -O2 -flto -Wno-attributes $(INCLUDES) $(DEFINES) -LDFLAGS := -lstdc++ -lm +AU_BASE_CFLAGS := -fcommon -march=i386 -Os -flto $(INCLUDES) $(DEFINES) +AU_CFLAGS := -fcommon -march=i386 -O2 -flto $(INCLUDES) $(DEFINES) +SC_CFLAGS := -fcommon -march=i386 -O2 -flto $(INCLUDES) $(DEFINES) +MPXPLAY_CFLAGS := -fcommon -march=i386 -O2 -flto $(INCLUDES) $(DEFINES) +SBEMU_CFLAGS := -fcommon -march=i386 -O2 -flto $(INCLUDES) $(DEFINES) +CFLAGS := -fcommon -march=i386 -O2 -flto $(INCLUDES) $(DEFINES) +LDFLAGS := -lstdc++ -lm -Wno-attributes ifeq ($(DEBUG),0) LDFLAGS += -s diff --git a/mpxplay/au_cards/au_base.c b/mpxplay/au_cards/au_base.c index 9b9c82ca..8f8cfe5a 100644 --- a/mpxplay/au_cards/au_base.c +++ b/mpxplay/au_cards/au_base.c @@ -35,7 +35,8 @@ extern unsigned long __djgpp_selector_limit; //dummy symbol to keep original code unmodified #ifdef __DOS__ #include -void (__far *oldint08_handler)(); +//void (__far *oldint08_handler)(); +#define oldint08_handler 0 volatile unsigned long int08counter; unsigned long mpxplay_signal_events; #endif @@ -156,7 +157,7 @@ static __dpmi_meminfo physicalmaps[PHYSICAL_MAP_COUNT]; unsigned long pds_dpmi_map_physical_memory(unsigned long phys_addr,unsigned long memsize) { - memsize = (memsize+1023)/1024*1024; + memsize = (memsize+0xFFF)&~0xFFF; __dpmi_meminfo info = {0, memsize, phys_addr}; int i = 0; for(; i < PHYSICAL_MAP_COUNT; ++i) @@ -182,7 +183,7 @@ unsigned long pds_dpmi_map_physical_memory(unsigned long phys_addr,unsigned long } __dpmi_meminfo remap = info; remap.address = 0; - remap.size = (memsize+4095)/4096; + remap.size = memsize/4096; if(__dpmi_map_device_in_memory_block(&remap, phys_addr) != 0) { __dpmi_free_memory(info.handle); @@ -237,6 +238,7 @@ static int pds_xms_init(void) pds_xms_regs.x.cs = pds_xms_regs.x.es; pds_xms_regs.x.ip = pds_xms_regs.x.bx; pds_xms_regs.x.ss = pds_xms_regs.x.sp = 0; + pds_xms_regs.x.ax = pds_xms_regs.x.dx = 0; return 1; } @@ -264,6 +266,7 @@ unsigned short pds_xms_alloc(unsigned short sizeKB, unsigned long* addr) { r = pds_xms_regs; r.h.ah = 0x0A; //free XMS + r.x.dx = handle; __dpmi_simulate_real_mode_procedure_retf(&r); return 0; } @@ -429,17 +432,20 @@ static int pds_strchknull(char *strp1,char *strp2) register const unsigned char *s2 = (const unsigned char *) strp2; if(!s1 || !s1[0]) + { if(s2 && s2[0]) return -1; else return 0; + } if(!s2 || !s2[0]) + { if(s1 && s1[0]) return 1; else return 0; - + } return 2; } @@ -452,14 +458,14 @@ int pds_strcmp(char *strp1,char *strp2) if(retcode!=2) return retcode; - do{ + do{ c1 = (unsigned char) *s1++; c2 = (unsigned char) *s2++; if(!c1) break; - }while (c1 == c2); + }while (c1 == c2); - return c1 - c2; + return c1 - c2; } int pds_stricmp(char *strp1,char *strp2) @@ -582,10 +588,12 @@ int pds_strncmp(char *strp1,char *strp2,unsigned int counter) c1=*strp1; c2=*strp2; if(c1!=c2) + { if(c1