diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 9679080f4..d79cd9f49 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -71,8 +71,9 @@ ifeq (4,$(GCC_MAJOR)) endif OURCFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ - -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -DNOCOPYPROTECT \ - -I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(SRC)/jaudiolib -D_FORTIFY_SOURCE=2 \ + -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -DNOCOPYPROTECT \ + -I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(SRC)/jaudiolib -D_FORTIFY_SOURCE=2 \ + -fjump-tables -fno-stack-protector # -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse OURCXXFLAGS=-fno-exceptions -fno-rtti LIBS=-lm diff --git a/polymer/eduke32/Makefile.msvc b/polymer/eduke32/Makefile.msvc index 3d905665e..c71668f2e 100644 --- a/polymer/eduke32/Makefile.msvc +++ b/polymer/eduke32/Makefile.msvc @@ -18,8 +18,8 @@ flags_cl= /Od /Zi flags_link=/DEBUG !else # release options -flags_cl=/Ox -flags_link=/RELEASE +flags_cl=/Ox /GL /arch:SSE +flags_link=/RELEASE /LTCG !endif @@ -35,7 +35,7 @@ LINK=link /nologo /opt:ref MT=mt CFLAGS= /MT /J /nologo $(flags_cl) \ /I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \ - /DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" -W2 $(ENGINEOPTS) \ + /DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" /W2 $(ENGINEOPTS) \ /I$(DXROOT)\include" /DRENDERTYPEWIN=1 LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib wsock32.lib comctl32.lib \ /NODEFAULTLIB:glu32.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib diff --git a/polymer/eduke32/Makefile.watcom b/polymer/eduke32/Makefile.watcom deleted file mode 100644 index d0b5e1321..000000000 --- a/polymer/eduke32/Makefile.watcom +++ /dev/null @@ -1,150 +0,0 @@ -# EDuke32 Makefile for Watcom Make - -SRC=source -OBJ=obj -EROOT=..\build -EINC=$(EROOT)\include -EOBJ=eobj -INC=$(SRC) -o=obj - -ENGINELIB=engine.lib -EDITORLIB=build.lib - -!ifdef __LOADDLL__ -! loaddll wcc386 wccd386 -!endif - -DXROOT=c:\sdks\msc\dx7 - -ENGINEOPTS=-dSUPERBUILD -dPOLYMOST -dUSE_OPENGL - -CC=wcc386 -CXX=wpp386 -CFLAGS= -zq -5r -s -orb -fp5 -d2 -db & - -i=$(INC) -i=$(EINC) -i=$(SRC)\jmact -i=$(SRC)\jaudiolib -i=$(DXROOT)\include & - -dRENDERTYPEWIN=1 -dNOCOPYPROTECT $(ENGINEOPTS) -LIBS=wsock32.lib dxguid.lib winmm.lib #opengl32.lib -WASMFLAGS=-d1 -EXESUFFIX=.exe - -JMACTOBJ=$(OBJ)\util_lib.$o & - $(OBJ)\file_lib.$o & - $(OBJ)\control.$o & - $(OBJ)\keyboard.$o & - $(OBJ)\mouse.$o & - $(OBJ)\mathutil.$o & - $(OBJ)\scriplib.$o - -JAUDIOLIB_FX_STUB=$(OBJ)\jaudiolib_fxstub.$o -JAUDIOLIB_MUSIC_STUB=$(OBJ)\jaudiolib_musicstub.$o -JAUDIOLIB_FX=$(OBJ)\mv_mix.$o & - $(OBJ)\mv_mix16.$o & - $(OBJ)\mvreverb.$o & - $(OBJ)\pitch.$o & - $(OBJ)\multivoc.$o & - $(OBJ)\openal.$o & - $(OBJ)\ll_man.$o & - $(OBJ)\fx_man.$o & - $(OBJ)\dsoundout.$o -JAUDIOLIB_MUSIC=$(OBJ)\midi.$o & - $(OBJ)\mpu401.$o & - $(OBJ)\music.$o -#JAUDIOLIBOBJ=$(JAUDIOLIB_MUSIC) $(JAUDIOLIB_FX) $(OBJ)\sounds.$o -#JAUDIOLIBOBJ=$(JAUDIOLIB_MUSIC_STUB) $(JAUDIOLIB_FX_STUB) $(OBJ)\sounds.$o - -GAMEOBJS=$(OBJ)\game.$o & - $(OBJ)\actors.$o & - $(OBJ)\anim.$o & - $(OBJ)\gamedef.$o & - $(OBJ)\gameexec.$o & - $(OBJ)\gamestructures.$o & - $(OBJ)\gamevars.$o & - $(OBJ)\global.$o & - $(OBJ)\menus.$o & - $(OBJ)\namesdyn.$o & - $(OBJ)\player.$o & - $(OBJ)\premap.$o & - $(OBJ)\savegame.$o & - $(OBJ)\sector.$o & - $(OBJ)\rts.$o & - $(OBJ)\config.$o & - $(OBJ)\animlib.$o & - $(OBJ)\testcd.$o & - $(OBJ)\osdfuncs.$o & - $(OBJ)\osdcmds.$o & - $(OBJ)\winbits.$o & - $(OBJ)\startwin.game.$o & - $(JMACTOBJ) & - $(JAUDIOLIBOBJ) - -EDITOROBJS=$(OBJ)\astub.$o - -# RULES -.EXTENSIONS: .wasm .res .rc - -.wasm: $(SRC)\ -.wasm: $(SRC)\jaudiolib -.c: $(SRC)\ -.cpp: $(SRC)\ -.c: $(SRC)\jmact -.c: $(SRC)\jaudiolib -.c: $(SRC)\util -.rc: $(SRC)\misc - -.wasm.$o: - wasm $(WASMFLAGS) -fo=$(OBJ)\.$o $[@ - -.c.$o: - $(CC) $(CFLAGS) -fo=$(OBJ)\.$o $[@ -.cpp.$o: - $(CXX) $(CFLAGS) -fo=$(OBJ)\.$o $[@ - -.rc.res: - wrc -i=$(EINC) -i=$(SRC) -fo=$^*.res -r $[@ - - -# TARGETS -all: eduke32$(EXESUFFIX) build$(EXESUFFIX) .SYMBOLIC - %null - -eduke32$(EXESUFFIX): $(GAMEOBJS) $(OBJ)\gameres.res $(EOBJ)\$(ENGINELIB) - wlink NAME $@ & - SYSTEM WIN95 & - DEBUG ALL & - FILE { $(GAMEOBJS) $(ENGINEOBJS) } & - RESOURCE $(OBJ)\gameres.res & - LIBPATH $(DXROOT)\lib & - LIBPATH $(EOBJ) & - LIBRARY { $(ENGINELIB) $(LIBS) } - -mapster32$(EXESUFFIX): $(EDITOROBJS) $(OBJ)\buildres.res $(EOBJ)\$(ENGINELIB) $(EOBJ)\$(EDITORLIB) - wlink NAME $@ & - SYSTEM WIN95 & - DEBUG ALL & - FILE { $(EDITOROBJS) } & - RESOURCE $(OBJ)\buildres.res & - LIBPATH $(DXROOT)\lib & - LIBPATH $(EOBJ) & - LIBRARY { $(LIBS) $(ENGINELIB) $(EDITORLIB) } - -!include Makefile.deps - -cwd=$+ $(%cwd) $- -enginelib editorlib: .SYMBOLIC - -mkdir $(EOBJ) - %write $(EOBJ)\overrides.mak OBJ=$(cwd)\$(EOBJ) - %write $(EOBJ)\overrides.mak CFLAGS=$(ENGINEOPTS) - cd $(EROOT) - wmake -f Makefile.watcom OVERRIDES=$(cwd)\$(EOBJ)\overrides.mak $@ - cd $(cwd) - -$(EOBJ)\$(EDITORLIB): editorlib .SYMBOLIC -$(EOBJ)\$(ENGINELIB): enginelib .SYMBOLIC - -# PHONIES -clean: .SYMBOLIC - -del /q $(OBJ)\* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) - -veryclean: clean .SYMBOLIC - -del /q $(EOBJ)\* diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index 92120ba94..0b4d87515 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -102,6 +102,7 @@ endif OURCFLAGS=$(debug) -W -Wall -Wimplicit -Wno-char-subscripts \ -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS \ -DKSFORBUILD -I$(INC) -D_FORTIFY_SOURCE=2 \ + -fjump-tables -fno-stack-protector # -march=pentium3 -mtune=generic -mmmx -m3dnow -msse -mfpmath=sse OURCXXFLAGS=-fno-exceptions -fno-rtti LIBS= diff --git a/polymer/eduke32/build/Makefile.msvc b/polymer/eduke32/build/Makefile.msvc index b67a81290..e1ae5692f 100644 --- a/polymer/eduke32/build/Makefile.msvc +++ b/polymer/eduke32/build/Makefile.msvc @@ -34,10 +34,12 @@ TARGETOPTS=/DNOASM # debugging options flags_cl=/Od /Zi flags_link=/DEBUG +flags_lib= !else # release options -flags_cl=/Ox -flags_link=/RELEASE +flags_cl=/Ox /GL /arch:SSE +flags_link=/RELEASE /LTCG +flags_lib=/LTCG !endif CC=cl @@ -119,11 +121,11 @@ utils: $(UTILS) ; enginelib: $(OBJ)\$(ENGINELIB) ; $(OBJ)\$(ENGINELIB): $(ENGINEOBJS) - lib /out:$@ /nologo $** + lib $(flags_lib) /out:$@ /nologo $** editorlib: $(OBJ)\$(EDITORLIB) ; $(OBJ)\$(EDITORLIB): $(EDITOROBJS) - lib /out:$@ /nologo $** + lib $(flags_lib) /out:$@ /nologo $** # the tools kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o diff --git a/polymer/eduke32/build/Makefile.watcom b/polymer/eduke32/build/Makefile.watcom deleted file mode 100644 index 75b04c02b..000000000 --- a/polymer/eduke32/build/Makefile.watcom +++ /dev/null @@ -1,129 +0,0 @@ -# Build Makefile for Watcom Make - -!ifdef OVERRIDES -!include $(OVERRIDES) -!endif - -SRC=src -!ifndef OBJ -OBJ=obj.watcom -!endif -INC=include -!ifndef CFLAGS -CFLAGS=-dSUPERBUILD -dPOLYMOST -dUSE_OPENGL -dKSFORBUILD -!endif - -o=obj -res=res -asm=wasm - -ENGINELIB=engine.lib -EDITORLIB=build.lib - -DXROOT=c:\sdks\directx\dx7 - -!ifdef __LOADDLL__ -! loaddll wcc386 wccd386 -! loaddll wpp386 wppd386 -!endif - -# -d these to enable certain features of the port's compile process -# NOASM When defined, uses C code instead assembly code -TARGETOPTS=#-dNOASM - -CC=wcc386 -CXX=wpp386 -AS=wasm -RC=wrc -CFLAGS+= -zq -5r -s -orb -fp5 $(TARGETOPTS) -d2 -dRENDERTYPEWIN=1 & - -i=$(INC) -i=$(SRC) -i=$(DXROOT)\include -i=..\jfaud\inc -LIBS=dxguid.lib wsock32.lib ..\jfaud\jfaud.lib winmm.lib #opengl32.lib -ASFLAGS=# -d1 -EXESUFFIX=.exe - -ENGINEOBJS=$(OBJ)\a.$o & - $(OBJ)\baselayer.$o & - $(OBJ)\cache1d.$o & - $(OBJ)\compat.$o & - $(OBJ)\crc32.$o & - $(OBJ)\defs.$o & - $(OBJ)\engine.$o & - $(OBJ)\glbuild.$o & - $(OBJ)\kplib.$o & - $(OBJ)\lzf_c.$o & - $(OBJ)\lzf_d.$o & - $(OBJ)\lzwnew.$o & - $(OBJ)\md4.$o & - $(OBJ)\mmulti.$o & - $(OBJ)\osd.$o & - $(OBJ)\pragmas.$o & - $(OBJ)\scriptfile.$o & - $(OBJ)\winlayer.$o - -EDITOROBJS=$(OBJ)\build.$o & - $(OBJ)\config.$o & - $(OBJ)\startwin.editor.$o - -# RULES -.EXTENSIONS: .wasm .res .rc - -.wasm: $(SRC) -.c: $(SRC) -.cpp: $(SRC) -.c: $(SRC)\util -.rc: $(SRC)\misc - -.wasm.$o: - $(AS) $(ASFLAGS) -fo=$(OBJ)\.$o $[@ - -.c.$o: - $(CC) $(CFLAGS) -fo=$(OBJ)\.$o $[@ - -.rc.$(res): - $(RC) -i=$(SRC) -i=$(INC) -fo=$^*.$(res) -r $[@ - -# TARGETS -UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX) - -all: .SYMBOLIC - %null - -utils: $(UTILS) .SYMBOLIC - %null - -enginelib: $(OBJ)\$(ENGINELIB) .SYMBOLIC - %null - -$(OBJ)\$(ENGINELIB): $(ENGINEOBJS) - %create $(OBJ)\$(ENGINELIB).tmp - for %i in ($(ENGINEOBJS)) do %append $(OBJ)\$(ENGINELIB).tmp +%i - wlib -b -n $^* @$(OBJ)\$(ENGINELIB).tmp - erase $(OBJ)\$(ENGINELIB).tmp - -editorlib: $(OBJ)\$(EDITORLIB) .SYMBOLIC - %null - -$(OBJ)\$(EDITORLIB): $(EDITOROBJS) - %create $(OBJ)\$(EDITORLIB).tmp - for %i in ($(EDITOROBJS)) do %append $(OBJ)\$(EDITORLIB).tmp +%i - wlib -b -n $^* @$(OBJ)\$(EDITORLIB).tmp - erase $(OBJ)\$(EDITORLIB).tmp - -kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o - wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< } -kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o - wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< } -transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o - wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< } -wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o - wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< } -wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o - wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< } - -# DEPENDENCIES -!include Makefile.deps - -# PHONIES -clean: .SYMBOLIC - -erase /q $(OBJ)\* $(UTILS) *.err - diff --git a/polymer/eduke32/build/include/a.h b/polymer/eduke32/build/include/a.h index 0d362b4c1..df67486ff 100644 --- a/polymer/eduke32/build/include/a.h +++ b/polymer/eduke32/build/include/a.h @@ -8,94 +8,7 @@ #include "compat.h" -#if defined(__WATCOMC__) && !defined(NOASM) - -extern int32_t mmxoverlay(); -#pragma aux mmxoverlay modify [eax ebx ecx edx]; -extern int32_t sethlinesizes(int32_t,int32_t,int32_t); -#pragma aux sethlinesizes parm [eax][ebx][ecx]; -extern int32_t setpalookupaddress(char *); -#pragma aux setpalookupaddress parm [eax]; -extern int32_t setuphlineasm4(int32_t,int32_t); -#pragma aux setuphlineasm4 parm [eax][ebx]; -extern int32_t hlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux hlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setuprhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux setuprhlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t rhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux rhlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setuprmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux setuprmhlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t rmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux rmhlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setupqrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux setupqrhlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t qrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux qrhlineasm4 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setvlinebpl(int32_t); -#pragma aux setvlinebpl parm [eax]; -extern int32_t fixtransluscence(int32_t); -#pragma aux fixtransluscence parm [eax]; -extern int32_t prevlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux prevlineasm1 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t vlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux vlineasm1 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setuptvlineasm(int32_t); -#pragma aux setuptvlineasm parm [eax]; -extern int32_t tvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tvlineasm1 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setuptvlineasm2(int32_t,int32_t,int32_t); -#pragma aux setuptvlineasm2 parm [eax][ebx][ecx]; -extern int32_t tvlineasm2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tvlineasm2 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t mvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux mvlineasm1 parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t setupvlineasm(int32_t); -#pragma aux setupvlineasm parm [eax]; -extern int32_t vlineasm4(int32_t,int32_t); -#pragma aux vlineasm4 parm [ecx][edi] modify [eax ebx ecx edx esi edi]; -extern int32_t setupmvlineasm(int32_t); -#pragma aux setupmvlineasm parm [eax]; -extern int32_t mvlineasm4(int32_t,int32_t); -#pragma aux mvlineasm4 parm [ecx][edi] modify [eax ebx ecx edx esi edi]; -extern void setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux setupspritevline parm [eax][ebx][ecx][edx][esi][edi]; -extern void spritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux spritevline parm [eax][ebx][ecx][edx][esi][edi]; -extern void msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux msetupspritevline parm [eax][ebx][ecx][edx][esi][edi]; -extern void mspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux mspritevline parm [eax][ebx][ecx][edx][esi][edi]; -extern void tsetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tsetupspritevline parm [eax][ebx][ecx][edx][esi][edi]; -extern void tspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tspritevline parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t mhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux mhline parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t mhlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux mhlineskipmodify parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t msethlineshift(int32_t,int32_t); -#pragma aux msethlineshift parm [eax][ebx]; -extern int32_t thline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux thline parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t thlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux thlineskipmodify parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t tsethlineshift(int32_t,int32_t); -#pragma aux tsethlineshift parm [eax][ebx]; -extern int32_t setupslopevlin(int32_t,int32_t,int32_t); -#pragma aux setupslopevlin parm [eax][ebx][ecx] modify [edx]; -extern int32_t slopevlin(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux slopevlin parm [eax][ebx][ecx][edx][esi][edi]; -extern int32_t settransnormal(); -#pragma aux settransnormal parm; -extern int32_t settransreverse(); -#pragma aux settransreverse parm; -extern int32_t setupdrawslab(int32_t,int32_t); -#pragma aux setupdrawslab parm [eax][ebx]; -extern int32_t drawslab(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux drawslab parm [eax][ebx][ecx][edx][esi][edi]; - -#elif defined(__GNUC__) && defined(__i386__) && !defined(NOASM) // __WATCOMC__ +#if defined(__GNUC__) && defined(__i386__) && !defined(NOASM) #if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SYLLABLE__) #define __cdecl diff --git a/polymer/eduke32/build/include/baselayer.h b/polymer/eduke32/build/include/baselayer.h index 5731601ac..40f329665 100644 --- a/polymer/eduke32/build/include/baselayer.h +++ b/polymer/eduke32/build/include/baselayer.h @@ -63,6 +63,7 @@ struct glinfo { char sm4; char dumped; }; + extern struct glinfo glinfo; extern void setvsync(int32_t sync); #endif diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 24355203d..61a188e28 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -67,19 +67,7 @@ extern "C" { # define EXTERN extern #endif -#ifdef __GNUC__ -#define BPACK __attribute__ ((packed)) -#else -#define BPACK -#endif - -#ifdef _MSC_VER -#pragma pack(1) -#endif - -#ifdef __WATCOMC__ -#pragma pack(push,1); -#endif +#pragma pack(push,1) //ceilingstat/floorstat: // bit 0: 1 = parallaxing, 0 = not "P" @@ -97,7 +85,7 @@ extern "C" { // bits 9-15: reserved //40 bytes -typedef struct BPACK +typedef struct { int16_t wallptr, wallnum; int32_t ceilingz, floorz; @@ -126,7 +114,7 @@ typedef struct BPACK // bits 10-15: reserved //32 bytes -typedef struct BPACK +typedef struct { int32_t x, y; int16_t point2, nextwall, nextsector, cstat; @@ -154,7 +142,7 @@ typedef struct BPACK // bit 15: 1 = Invisible sprite, 0 = not invisible //44 bytes -typedef struct BPACK +typedef struct { int32_t x, y, z; int16_t cstat, picnum; @@ -167,7 +155,7 @@ typedef struct BPACK int16_t lotag, hitag, extra; } spritetype; -typedef struct BPACK { +typedef struct { uint32_t mdanimtims; int16_t mdanimcur; int16_t angoff; @@ -180,7 +168,7 @@ typedef struct BPACK { spritetype *tspr; } spriteext_t; -typedef struct BPACK { +typedef struct { float smoothduration; int16_t mdcurframe, mdoldframe; int16_t mdsmooth; @@ -418,10 +406,12 @@ OTHER VARIABLES: you call the loadboard function. ***************************************************************************/ -typedef struct BPACK { +typedef struct { int32_t x, y, z; } vec3_t; +#pragma pack(pop) + typedef struct { vec3_t pos; int16_t hitsprite, hitwall, hitsect; @@ -702,16 +692,6 @@ void hash_add(hashtable_t *t, const char *s, int32_t key); # include "polymer.h" #endif -#ifdef _MSC_VER -#pragma pack() -#endif - -#ifdef __WATCOMC__ -#pragma pack(pop) -#endif - -#undef BPACK - #ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index 613c40047..cbbb30961 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -53,21 +53,7 @@ // library will need to wrap these functions with suitable emulations. #define __compat_h_macrodef__ -#if defined(__WATCOMC__) && ((__WATCOMC__ -0) < 1230) -# define SCREWED_UP_CPP -#endif - #ifdef __cplusplus -# ifdef SCREWED_UP_CPP -// Old OpenWatcoms need some help -# include "watcomhax/cstdarg" -# ifdef __compat_h_macrodef__ -# include "watcomhax/cstdio" -# include "watcomhax/cstring" -# include "watcomhax/cstdlib" -# include "watcomhax/ctime" -# endif -# else # include # ifdef __compat_h_macrodef__ # include @@ -75,7 +61,6 @@ # include # include # endif -# endif #else # include #endif @@ -103,12 +88,7 @@ # include #endif -#if defined(__WATCOMC__) -# define inline __inline -# define int64 __int64 -# define uint64 unsigned __int64 -# define longlong(x) x##i64 -#elif defined(_MSC_VER) +#if defined(_MSC_VER) # define inline __inline # define int64 __int64 # define uint64 unsigned __int64 @@ -215,8 +195,6 @@ extern "C" { // inline asm using bswap/xchg # elif defined(__GNUC__) // inline asm using bswap/xchg -# elif defined(__WATCOMC__) - // inline asm using bswap/xchg # endif #elif defined B_ENDIAN_C_INLINE static inline uint16_t B_SWAP16(uint16_t s) { return (s>>8)|(s<<8); } @@ -224,6 +202,62 @@ static inline uint32_t B_SWAP32(uint32_t l) { return ((l>>8)&0xff00)|((l&0xff0 static inline uint64 B_SWAP64(uint64 l) { return (l>>56)|((l>>40)&0xff00)|((l>>24)&0xff0000)|((l>>8)&0xff000000)|((l&255)<<56)|((l&0xff00)<<40)|((l&0xff0000)<<24)|((l&0xff000000)<<8); } #endif +#if defined(USE_MSC_PRAGMAS) +static inline void ftol(float f, int32_t *a) +{ + _asm + { + mov eax, a + fld f + fistp dword ptr [eax] + } +} + +static inline void dtol(double d, int32_t *a) +{ + _asm + { + mov eax, a + fld d + fistp dword ptr [eax] + } +} +#elif defined(USE_GCC_PRAGMAS) + +static inline void ftol(float f, int32_t *a) +{ + __asm__ __volatile__( +#if 0 //(__GNUC__ >= 3) + "flds %1; fistpl %0;" +#else + "flds %1; fistpl (%0);" +#endif + : "=r"(a) : "m"(f) : "memory","cc"); +} + +static inline void dtol(double d, int32_t *a) +{ + __asm__ __volatile__( +#if 0 //(__GNUC__ >= 3) + "fldl %1; fistpl %0;" +#else + "fldl %1; fistpl (%0);" +#endif + : "=r"(a) : "m"(d) : "memory","cc"); +} + +#else +static inline void ftol(float f, int32_t *a) +{ + *a = (int32_t)f; +} + +static inline void dtol(double d, int32_t *a) +{ + *a = (int32_t)d; +} +#endif + #if B_LITTLE_ENDIAN == 1 # define B_LITTLE64(x) (x) # define B_BIG64(x) B_SWAP64(x) @@ -374,18 +408,27 @@ int32_t Bclosedir(BDIR *dir); # define Bfread fread # define Bfwrite fwrite # define Bfprintf fprintf -# define Bstrdup strdup +# if defined(_MSC_VER) +# define Bstrdup _strdup +# else +# define Bstrdup strdup +# endif # define Bstrcpy strcpy # define Bstrncpy strncpy # define Bstrcmp strcmp # define Bstrncmp strncmp -# if defined(__WATCOMC__) || defined(_MSC_VER) || defined(__QNX__) +# if defined(_MSC_VER) +# define Bstrcasecmp _stricmp +# define Bstrncasecmp _strnicmp +# else +# if defined(__QNX__) # define Bstrcasecmp stricmp # define Bstrncasecmp strnicmp # else # define Bstrcasecmp strcasecmp # define Bstrncasecmp strncasecmp # endif +# endif # if defined(_WIN32) # define Bstrlwr strlwr # define Bstrupr strupr diff --git a/polymer/eduke32/build/include/mdsprite.h b/polymer/eduke32/build/include/mdsprite.h index 629e79c02..82e5d8e15 100644 --- a/polymer/eduke32/build/include/mdsprite.h +++ b/polymer/eduke32/build/include/mdsprite.h @@ -241,5 +241,4 @@ void voxfree(voxmodel_t *m); voxmodel_t *voxload(const char *filnam); int32_t voxdraw(voxmodel_t *m, spritetype *tspr); - #endif // !_mdsprite_h_ diff --git a/polymer/eduke32/build/include/nedmalloc.h b/polymer/eduke32/build/include/nedmalloc.h index 1d0aba78a..6396cee5f 100644 --- a/polymer/eduke32/build/include/nedmalloc.h +++ b/polymer/eduke32/build/include/nedmalloc.h @@ -138,7 +138,7 @@ Useful for when you have nedmalloc in a DLL you're about to unload. If you call ANY nedmalloc functions after calling this you will get a fatal exception! */ -EXTSPEC void neddestroysyspool() THROWSPEC; +EXTSPEC void neddestroysyspool(void) THROWSPEC; /* These are the pool functions */ struct nedpool_t; diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index fac7eb92d..331acea69 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -130,8 +130,8 @@ static inline void fogcalc(const int32_t shade, const int32_t vis, const int32_t float f = ((shade*shade)*0.125f); if (shade < 0) f = -f; - if (vis > 239) f = gvisibility*((vis-240+f)/(klabs(vis-256))); - else f = gvisibility*(vis+16+f); + if (vis > 239) f = (float)(gvisibility*((vis-240+f)/(klabs(vis-256)))); + else f = (float)(gvisibility*(vis+16+f)); fogresult = clamp(f, 0.01f, 10.f); diff --git a/polymer/eduke32/build/include/pragmas.h b/polymer/eduke32/build/include/pragmas.h index ad46f9526..9a07aef1e 100644 --- a/polymer/eduke32/build/include/pragmas.h +++ b/polymer/eduke32/build/include/pragmas.h @@ -1068,1857 +1068,7 @@ void copybufreverse(void *S, void *D, int32_t c); //}}} -#elif defined(__WATCOMC__) && !defined(NOASM) // __GNUC__ && __i386__ - -// -// Watcom C inline assembler -// - -//{{{ -int32_t sqr(int32_t); -#pragma aux sqr =\ - "imul eax, eax",\ - parm nomemory [eax]\ - modify exact [eax]\ - value [eax] - -int32_t scale(int32_t,int32_t,int32_t); -#pragma aux scale =\ - "imul edx",\ - "idiv ecx",\ - parm nomemory [eax][edx][ecx]\ - modify exact [eax edx] - -int32_t mulscale(int32_t,int32_t,int32_t); -#pragma aux mulscale =\ - "imul edx",\ - "shrd eax, edx, cl",\ - parm nomemory [eax][edx][ecx]\ - modify exact [eax edx] - -int32_t mulscale1(int32_t,int32_t); -#pragma aux mulscale1 =\ - "imul edx",\ - "shrd eax, edx, 1",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale2(int32_t,int32_t); -#pragma aux mulscale2 =\ - "imul edx",\ - "shrd eax, edx, 2",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale3(int32_t,int32_t); -#pragma aux mulscale3 =\ - "imul edx",\ - "shrd eax, edx, 3",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale4(int32_t,int32_t); -#pragma aux mulscale4 =\ - "imul edx",\ - "shrd eax, edx, 4",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale5(int32_t,int32_t); -#pragma aux mulscale5 =\ - "imul edx",\ - "shrd eax, edx, 5",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale6(int32_t,int32_t); -#pragma aux mulscale6 =\ - "imul edx",\ - "shrd eax, edx, 6",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale7(int32_t,int32_t); -#pragma aux mulscale7 =\ - "imul edx",\ - "shrd eax, edx, 7",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale8(int32_t,int32_t); -#pragma aux mulscale8 =\ - "imul edx",\ - "shrd eax, edx, 8",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale9(int32_t,int32_t); -#pragma aux mulscale9 =\ - "imul edx",\ - "shrd eax, edx, 9",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale10(int32_t,int32_t); -#pragma aux mulscale10 =\ - "imul edx",\ - "shrd eax, edx, 10",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale11(int32_t,int32_t); -#pragma aux mulscale11 =\ - "imul edx",\ - "shrd eax, edx, 11",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale12(int32_t,int32_t); -#pragma aux mulscale12 =\ - "imul edx",\ - "shrd eax, edx, 12",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale13(int32_t,int32_t); -#pragma aux mulscale13 =\ - "imul edx",\ - "shrd eax, edx, 13",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale14(int32_t,int32_t); -#pragma aux mulscale14 =\ - "imul edx",\ - "shrd eax, edx, 14",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale15(int32_t,int32_t); -#pragma aux mulscale15 =\ - "imul edx",\ - "shrd eax, edx, 15",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale16(int32_t,int32_t); -#pragma aux mulscale16 =\ - "imul edx",\ - "shrd eax, edx, 16",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale17(int32_t,int32_t); -#pragma aux mulscale17 =\ - "imul edx",\ - "shrd eax, edx, 17",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale18(int32_t,int32_t); -#pragma aux mulscale18 =\ - "imul edx",\ - "shrd eax, edx, 18",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale19(int32_t,int32_t); -#pragma aux mulscale19 =\ - "imul edx",\ - "shrd eax, edx, 19",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale20(int32_t,int32_t); -#pragma aux mulscale20 =\ - "imul edx",\ - "shrd eax, edx, 20",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale21(int32_t,int32_t); -#pragma aux mulscale21 =\ - "imul edx",\ - "shrd eax, edx, 21",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale22(int32_t,int32_t); -#pragma aux mulscale22 =\ - "imul edx",\ - "shrd eax, edx, 22",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale23(int32_t,int32_t); -#pragma aux mulscale23 =\ - "imul edx",\ - "shrd eax, edx, 23",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale24(int32_t,int32_t); -#pragma aux mulscale24 =\ - "imul edx",\ - "shrd eax, edx, 24",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale25(int32_t,int32_t); -#pragma aux mulscale25 =\ - "imul edx",\ - "shrd eax, edx, 25",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale26(int32_t,int32_t); -#pragma aux mulscale26 =\ - "imul edx",\ - "shrd eax, edx, 26",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale27(int32_t,int32_t); -#pragma aux mulscale27 =\ - "imul edx",\ - "shrd eax, edx, 27",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale28(int32_t,int32_t); -#pragma aux mulscale28 =\ - "imul edx",\ - "shrd eax, edx, 28",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale29(int32_t,int32_t); -#pragma aux mulscale29 =\ - "imul edx",\ - "shrd eax, edx, 29",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale30(int32_t,int32_t); -#pragma aux mulscale30 =\ - "imul edx",\ - "shrd eax, edx, 30",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale31(int32_t,int32_t); -#pragma aux mulscale31 =\ - "imul edx",\ - "shrd eax, edx, 31",\ - parm nomemory [eax][edx]\ - modify exact [eax edx] - -int32_t mulscale32(int32_t,int32_t); -#pragma aux mulscale32 =\ - "imul edx",\ - parm nomemory [eax][edx]\ - modify exact [eax edx]\ - value [edx] - -int32_t dmulscale(int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, cl",\ - parm nomemory [eax][edx][esi][edi][ecx]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale1(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale1 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 1",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale2(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale2 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 2",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale3(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale3 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 3",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale4(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale4 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 4",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale5(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale5 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 5",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale6(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale6 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 6",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale7(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale7 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 7",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale8(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale8 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 8",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale9(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale9 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 9",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale10(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale10 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 10",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale11(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale11 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 11",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale12(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale12 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 12",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale13(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale13 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 13",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale14(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale14 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 14",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale15(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale15 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 15",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale16(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale16 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 16",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale17(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale17 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 17",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale18(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale18 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 18",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale19(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale19 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 19",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale20(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale20 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 20",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale21(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale21 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 21",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale22(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale22 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 22",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale23(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale23 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 23",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale24(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale24 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 24",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale25(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale25 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 25",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale26(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale26 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 26",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale27(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale27 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 27",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale28(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale28 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 28",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale29(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale29 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 29",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale30(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale30 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 30",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale31(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale31 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - "shrd eax, edx, 31",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi] - -int32_t dmulscale32(int32_t,int32_t,int32_t,int32_t); -#pragma aux dmulscale32 =\ - "imul edx",\ - "mov ebx, eax",\ - "mov eax, esi",\ - "mov esi, edx",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, esi",\ - parm nomemory [eax][edx][esi][edi]\ - modify exact [eax ebx edx esi]\ - value [edx] - -int32_t tmulscale1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale1 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 1",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale2 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 2",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale3(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale3 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 3",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale4 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 4",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale5(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale5 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 5",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale6(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale6 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 6",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale7(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale7 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 7",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale8(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale8 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 8",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale9(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale9 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 9",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale10(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale10 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 10",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale11(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale11 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 11",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale12(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale12 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 12",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale13(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale13 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 13",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale14(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale14 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 14",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale15(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale15 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 15",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale16(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale16 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 16",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale17(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale17 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 17",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale18(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale18 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 18",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale19(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale19 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 19",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale20(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale20 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 20",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale21(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale21 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 21",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale22(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale22 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 22",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale23(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale23 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 23",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale24(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale24 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 24",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale25(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale25 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 25",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale26(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale26 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 26",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale27(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale27 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 27",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale28(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale28 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 28",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale29(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale29 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 29",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale30(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale30 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 30",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale31(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale31 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - "shrd eax, edx, 31",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx] - -int32_t tmulscale32(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t); -#pragma aux tmulscale32 =\ - "imul edx",\ - "xchg eax, ebx",\ - "xchg edx, ecx",\ - "imul edx",\ - "add ebx, eax",\ - "adc ecx, edx",\ - "mov eax, esi",\ - "imul edi",\ - "add eax, ebx",\ - "adc edx, ecx",\ - parm nomemory [eax][edx][ebx][ecx][esi][edi]\ - modify exact [eax ebx ecx edx]\ - value [edx] - -int32_t boundmulscale(int32_t,int32_t,int32_t); -#pragma aux boundmulscale =\ - "imul ebx",\ - "mov ebx, edx",\ - "shrd eax, edx, cl",\ - "sar edx, cl",\ - "xor edx, eax",\ - "js checkit",\ - "xor edx, eax",\ - "jz skipboundit",\ - "cmp edx, 0xffffffff",\ - "je skipboundit",\ - "checkit:",\ - "mov eax, ebx",\ - "sar eax, 31",\ - "xor eax, 0x7fffffff",\ - "skipboundit:",\ - parm nomemory [eax][ebx][ecx]\ - modify exact [eax ebx edx] - -int32_t divscale(int32_t,int32_t,int32_t); -#pragma aux divscale =\ - "mov edx, eax",\ - "shl eax, cl",\ - "neg cl",\ - "sar edx, cl",\ - "idiv ebx",\ - parm nomemory [eax][ebx][ecx]\ - modify exact [eax ecx edx] - -int32_t divscale1(int32_t,int32_t); -#pragma aux divscale1 =\ - "add eax, eax",\ - "sbb edx, edx",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale2(int32_t,int32_t); -#pragma aux divscale2 =\ - "mov edx, eax",\ - "sar edx, 30",\ - "lea eax, [eax*4]",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale3(int32_t,int32_t); -#pragma aux divscale3 =\ - "mov edx, eax",\ - "sar edx, 29",\ - "lea eax, [eax*8]",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale4(int32_t,int32_t); -#pragma aux divscale4 =\ - "mov edx, eax",\ - "sar edx, 28",\ - "shl eax, 4",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale5(int32_t,int32_t); -#pragma aux divscale5 =\ - "mov edx, eax",\ - "sar edx, 27",\ - "shl eax, 5",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale6(int32_t,int32_t); -#pragma aux divscale6 =\ - "mov edx, eax",\ - "sar edx, 26",\ - "shl eax, 6",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale7(int32_t,int32_t); -#pragma aux divscale7 =\ - "mov edx, eax",\ - "sar edx, 25",\ - "shl eax, 7",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale8(int32_t,int32_t); -#pragma aux divscale8 =\ - "mov edx, eax",\ - "sar edx, 24",\ - "shl eax, 8",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale9(int32_t,int32_t); -#pragma aux divscale9 =\ - "mov edx, eax",\ - "sar edx, 23",\ - "shl eax, 9",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale10(int32_t,int32_t); -#pragma aux divscale10 =\ - "mov edx, eax",\ - "sar edx, 22",\ - "shl eax, 10",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale11(int32_t,int32_t); -#pragma aux divscale11 =\ - "mov edx, eax",\ - "sar edx, 21",\ - "shl eax, 11",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale12(int32_t,int32_t); -#pragma aux divscale12 =\ - "mov edx, eax",\ - "sar edx, 20",\ - "shl eax, 12",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale13(int32_t,int32_t); -#pragma aux divscale13 =\ - "mov edx, eax",\ - "sar edx, 19",\ - "shl eax, 13",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale14(int32_t,int32_t); -#pragma aux divscale14 =\ - "mov edx, eax",\ - "sar edx, 18",\ - "shl eax, 14",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale15(int32_t,int32_t); -#pragma aux divscale15 =\ - "mov edx, eax",\ - "sar edx, 17",\ - "shl eax, 15",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale16(int32_t,int32_t); -#pragma aux divscale16 =\ - "mov edx, eax",\ - "sar edx, 16",\ - "shl eax, 16",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale17(int32_t,int32_t); -#pragma aux divscale17 =\ - "mov edx, eax",\ - "sar edx, 15",\ - "shl eax, 17",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale18(int32_t,int32_t); -#pragma aux divscale18 =\ - "mov edx, eax",\ - "sar edx, 14",\ - "shl eax, 18",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale19(int32_t,int32_t); -#pragma aux divscale19 =\ - "mov edx, eax",\ - "sar edx, 13",\ - "shl eax, 19",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale20(int32_t,int32_t); -#pragma aux divscale20 =\ - "mov edx, eax",\ - "sar edx, 12",\ - "shl eax, 20",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale21(int32_t,int32_t); -#pragma aux divscale21 =\ - "mov edx, eax",\ - "sar edx, 11",\ - "shl eax, 21",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale22(int32_t,int32_t); -#pragma aux divscale22 =\ - "mov edx, eax",\ - "sar edx, 10",\ - "shl eax, 22",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale23(int32_t,int32_t); -#pragma aux divscale23 =\ - "mov edx, eax",\ - "sar edx, 9",\ - "shl eax, 23",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale24(int32_t,int32_t); -#pragma aux divscale24 =\ - "mov edx, eax",\ - "sar edx, 8",\ - "shl eax, 24",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale25(int32_t,int32_t); -#pragma aux divscale25 =\ - "mov edx, eax",\ - "sar edx, 7",\ - "shl eax, 25",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale26(int32_t,int32_t); -#pragma aux divscale26 =\ - "mov edx, eax",\ - "sar edx, 6",\ - "shl eax, 26",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale27(int32_t,int32_t); -#pragma aux divscale27 =\ - "mov edx, eax",\ - "sar edx, 5",\ - "shl eax, 27",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale28(int32_t,int32_t); -#pragma aux divscale28 =\ - "mov edx, eax",\ - "sar edx, 4",\ - "shl eax, 28",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale29(int32_t,int32_t); -#pragma aux divscale29 =\ - "mov edx, eax",\ - "sar edx, 3",\ - "shl eax, 29",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale30(int32_t,int32_t); -#pragma aux divscale30 =\ - "mov edx, eax",\ - "sar edx, 2",\ - "shl eax, 30",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale31(int32_t,int32_t); -#pragma aux divscale31 =\ - "mov edx, eax",\ - "sar edx, 1",\ - "shl eax, 31",\ - "idiv ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax edx] - -int32_t divscale32(int32_t,int32_t); -#pragma aux divscale32 =\ - "xor eax, eax",\ - "idiv ebx",\ - parm nomemory [edx][ebx]\ - modify exact [eax edx] - -int32_t readpixel(void*); -#pragma aux readpixel =\ - "mov al, byte ptr [edi]",\ - parm nomemory [edi]\ - modify exact [eax] - -int32_t drawpixel(void*,int32_t); -#pragma aux drawpixel =\ - "mov byte ptr [edi], al",\ - parm [edi][eax]\ - modify exact - -int32_t drawpixels(void*,int32_t); -#pragma aux drawpixels =\ - "mov word ptr [edi], ax",\ - parm [edi][eax]\ - modify exact - -int32_t drawpixelses(void*,int32_t); -#pragma aux drawpixelses =\ - "mov dword ptr [edi], eax",\ - parm [edi][eax]\ - modify exact - -int32_t clearbuf(void*,int32_t,int32_t); -#pragma aux clearbuf =\ - "rep stosd",\ - parm [edi][ecx][eax]\ - modify exact [edi ecx] - -int32_t clearbufbyte(void*,int32_t,int32_t); -#pragma aux clearbufbyte =\ - "cmp ecx, 4",\ - "jae longcopy",\ - "test cl, 1",\ - "jz preskip",\ - "stosb",\ - "preskip: shr ecx, 1",\ - "rep stosw",\ - "jmp endit",\ - "longcopy: test edi, 1",\ - "jz skip1",\ - "stosb",\ - "dec ecx",\ - "skip1: test edi, 2",\ - "jz skip2",\ - "stosw",\ - "sub ecx, 2",\ - "skip2: mov ebx, ecx",\ - "shr ecx, 2",\ - "rep stosd",\ - "test bl, 2",\ - "jz skip3",\ - "stosw",\ - "skip3: test bl, 1",\ - "jz endit",\ - "stosb",\ - "endit:",\ - parm [edi][ecx][eax]\ - modify [ebx] - -int32_t copybuf(void*,void*,int32_t); -#pragma aux copybuf =\ - "rep movsd",\ - parm [esi][edi][ecx]\ - modify exact [ecx esi edi] - -int32_t copybufbyte(void*,void*,int32_t); -#pragma aux copybufbyte =\ - "cmp ecx, 4",\ - "jae longcopy",\ - "test cl, 1",\ - "jz preskip",\ - "movsb",\ - "preskip: shr ecx, 1",\ - "rep movsw",\ - "jmp endit",\ - "longcopy: test edi, 1",\ - "jz skip1",\ - "movsb",\ - "dec ecx",\ - "skip1: test edi, 2",\ - "jz skip2",\ - "movsw",\ - "sub ecx, 2",\ - "skip2: mov ebx, ecx",\ - "shr ecx, 2",\ - "rep movsd",\ - "test bl, 2",\ - "jz skip3",\ - "movsw",\ - "skip3: test bl, 1",\ - "jz endit",\ - "movsb",\ - "endit:",\ - parm [esi][edi][ecx]\ - modify [ebx] - -int32_t copybufreverse(void*,void*,int32_t); -#pragma aux copybufreverse =\ - "shr ecx, 1",\ - "jnc skipit1",\ - "mov al, byte ptr [esi]",\ - "dec esi",\ - "mov byte ptr [edi], al",\ - "inc edi",\ - "skipit1: shr ecx, 1",\ - "jnc skipit2",\ - "mov ax, word ptr [esi-1]",\ - "sub esi, 2",\ - "ror ax, 8",\ - "mov word ptr [edi], ax",\ - "add edi, 2",\ - "skipit2: test ecx, ecx",\ - "jz endloop",\ - "begloop: mov eax, dword ptr [esi-3]",\ - "sub esi, 4",\ - "bswap eax",\ - "mov dword ptr [edi], eax",\ - "add edi, 4",\ - "dec ecx",\ - "jnz begloop",\ - "endloop:",\ - parm [esi][edi][ecx] - -int32_t qinterpolatedown16(int32_t,int32_t,int32_t,int32_t); -#pragma aux qinterpolatedown16 =\ - "mov ebx, ecx",\ - "shr ecx, 1",\ - "jz skipbegcalc",\ - "begqcalc: lea edi, [edx+esi]",\ - "sar edx, 16",\ - "mov dword ptr [eax], edx",\ - "lea edx, [edi+esi]",\ - "sar edi, 16",\ - "mov dword ptr [eax+4], edi",\ - "add eax, 8",\ - "dec ecx",\ - "jnz begqcalc",\ - "test ebx, 1",\ - "jz skipbegqcalc2",\ - "skipbegcalc: sar edx, 16",\ - "mov dword ptr [eax], edx",\ - "skipbegqcalc2:",\ - parm [eax][ecx][edx][esi]\ - modify exact [eax ebx ecx edx edi] - -int32_t qinterpolatedown16short(int32_t,int32_t,int32_t,int32_t); -#pragma aux qinterpolatedown16short =\ - "test ecx, ecx",\ - "jz endit",\ - "test al, 2",\ - "jz skipalignit",\ - "mov ebx, edx",\ - "sar ebx, 16",\ - "mov word ptr [eax], bx",\ - "add edx, esi",\ - "add eax, 2",\ - "dec ecx",\ - "jz endit",\ - "skipalignit: sub ecx, 2",\ - "jc finishit",\ - "begqcalc: mov ebx, edx",\ - "add edx, esi",\ - "sar ebx, 16",\ - "mov edi, edx",\ - "and edi, 0ffff0000h",\ - "add edx, esi",\ - "add ebx, edi",\ - "mov dword ptr [eax], ebx",\ - "add eax, 4",\ - "sub ecx, 2",\ - "jnc begqcalc",\ - "test cl, 1",\ - "jz endit",\ - "finishit: mov ebx, edx",\ - "sar ebx, 16",\ - "mov word ptr [eax], bx",\ - "endit:",\ - parm [eax][ecx][edx][esi]\ - modify exact [eax ebx ecx edx edi] - -int32_t mul3(int32_t); -#pragma aux mul3 =\ - "lea eax, [eax+eax*2]",\ - parm nomemory [eax] - -int32_t mul5(int32_t); -#pragma aux mul5 =\ - "lea eax, [eax+eax*4]",\ - parm nomemory [eax] - -int32_t mul9(int32_t); -#pragma aux mul9 =\ - "lea eax, [eax+eax*8]",\ - parm nomemory [eax] - - //returns eax/ebx, dmval = eax%edx; -int32_t divmod(int32_t,int32_t); -#pragma aux divmod =\ - "xor edx, edx",\ - "div ebx",\ - "mov dmval, edx",\ - parm [eax][ebx]\ - modify exact [eax edx]\ - value [eax] - - //returns eax%ebx, dmval = eax/edx; -int32_t moddiv(int32_t,int32_t); -#pragma aux moddiv =\ - "xor edx, edx",\ - "div ebx",\ - "mov dmval, eax",\ - parm [eax][ebx]\ - modify exact [eax edx]\ - value [edx] - -int32_t klabs(int32_t); -#pragma aux klabs =\ - "test eax, eax",\ - "jns skipnegate",\ - "neg eax",\ - "skipnegate:",\ - parm nomemory [eax] - -int32_t ksgn(int32_t); -#pragma aux ksgn =\ - "add ebx, ebx",\ - "sbb eax, eax",\ - "cmp eax, ebx",\ - "adc al, 0",\ - parm nomemory [ebx]\ - modify exact [eax ebx] - - //eax = (unsigned min)umin(eax,ebx) -int32_t umin(int32_t,int32_t); -#pragma aux umin =\ - "sub eax, ebx",\ - "sbb ecx, ecx",\ - "and eax, ecx",\ - "add eax, ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax ecx] - - //eax = (unsigned max)umax(eax,ebx) -int32_t umax(int32_t,int32_t); -#pragma aux umax =\ - "sub eax, ebx",\ - "sbb ecx, ecx",\ - "xor ecx, 0xffffffff",\ - "and eax, ecx",\ - "add eax, ebx",\ - parm nomemory [eax][ebx]\ - modify exact [eax ecx] - -int32_t kmin(int32_t,int32_t); -#pragma aux kmin =\ - "cmp eax, ebx",\ - "jl skipit",\ - "mov eax, ebx",\ - "skipit:",\ - parm nomemory [eax][ebx]\ - modify exact [eax] - -int32_t kmax(int32_t,int32_t); -#pragma aux kmax =\ - "cmp eax, ebx",\ - "jg skipit",\ - "mov eax, ebx",\ - "skipit:",\ - parm nomemory [eax][ebx]\ - modify exact [eax] - -int32_t swapchar(void*,void*); -#pragma aux swapchar =\ - "mov cl, [eax]",\ - "mov ch, [ebx]",\ - "mov [ebx], cl",\ - "mov [eax], ch",\ - parm [eax][ebx]\ - modify exact [ecx] - -int32_t swapshort(void*,void*); -#pragma aux swapshort =\ - "mov cx, [eax]",\ - "mov dx, [ebx]",\ - "mov [ebx], cx",\ - "mov [eax], dx",\ - parm [eax][ebx]\ - modify exact [ecx edx] - -int32_t swaplong(void*,void*); -#pragma aux swaplong =\ - "mov ecx, [eax]",\ - "mov edx, [ebx]",\ - "mov [ebx], ecx",\ - "mov [eax], edx",\ - parm [eax][ebx]\ - modify exact [ecx edx] - -int32_t swapbuf4(void*,void*,int32_t); -#pragma aux swapbuf4 =\ - "begswap:",\ - "mov esi, [eax]",\ - "mov edi, [ebx]",\ - "mov [ebx], esi",\ - "mov [eax], edi",\ - "add eax, 4",\ - "add ebx, 4",\ - "dec ecx",\ - "jnz short begswap",\ - parm [eax][ebx][ecx]\ - modify exact [eax ebx ecx esi edi] - -int32_t swap64bit(void*,void*); -#pragma aux swap64bit =\ - "mov ecx, [eax]",\ - "mov edx, [ebx]",\ - "mov [ebx], ecx",\ - "mov ecx, [eax+4]",\ - "mov [eax], edx",\ - "mov edx, [ebx+4]",\ - "mov [ebx+4], ecx",\ - "mov [eax+4], edx",\ - parm [eax][ebx]\ - modify exact [ecx edx] - - //swapchar2(ptr1,ptr2,xsiz); is the same as: - //swapchar(ptr1,ptr2); swapchar(ptr1+1,ptr2+xsiz); -int32_t swapchar2(void*,void*,int32_t); -#pragma aux swapchar2 =\ - "add esi, ebx",\ - "mov cx, [eax]",\ - "mov dl, [ebx]",\ - "mov [ebx], cl",\ - "mov dh, [esi]",\ - "mov [esi], ch",\ - "mov [eax], dx",\ - parm [eax][ebx][esi]\ - modify exact [ecx edx esi] -//}}} - -#elif defined(_MSC_VER) && !defined(NOASM) // __WATCOMC__ +#elif defined(_MSC_VER) && !defined(NOASM) // __GNUC__ // // Microsoft C inline assembler diff --git a/polymer/eduke32/build/include/watcomhax/cerrno b/polymer/eduke32/build/include/watcomhax/cerrno deleted file mode 100644 index edcc29d2c..000000000 --- a/polymer/eduke32/build/include/watcomhax/cerrno +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/polymer/eduke32/build/include/watcomhax/cmath b/polymer/eduke32/build/include/watcomhax/cmath deleted file mode 100644 index 2911680c7..000000000 --- a/polymer/eduke32/build/include/watcomhax/cmath +++ /dev/null @@ -1,2 +0,0 @@ -#include -#define M_PI 3.14159265358979323846 diff --git a/polymer/eduke32/build/include/watcomhax/cstdarg b/polymer/eduke32/build/include/watcomhax/cstdarg deleted file mode 100644 index 8942a2e77..000000000 --- a/polymer/eduke32/build/include/watcomhax/cstdarg +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/polymer/eduke32/build/include/watcomhax/cstdio b/polymer/eduke32/build/include/watcomhax/cstdio deleted file mode 100644 index bfcdbf0e9..000000000 --- a/polymer/eduke32/build/include/watcomhax/cstdio +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/polymer/eduke32/build/include/watcomhax/cstdlib b/polymer/eduke32/build/include/watcomhax/cstdlib deleted file mode 100644 index 9ada8e59c..000000000 --- a/polymer/eduke32/build/include/watcomhax/cstdlib +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/polymer/eduke32/build/include/watcomhax/cstring b/polymer/eduke32/build/include/watcomhax/cstring deleted file mode 100644 index 8e69c1fc0..000000000 --- a/polymer/eduke32/build/include/watcomhax/cstring +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/polymer/eduke32/build/include/watcomhax/ctime b/polymer/eduke32/build/include/watcomhax/ctime deleted file mode 100644 index 23b073712..000000000 --- a/polymer/eduke32/build/include/watcomhax/ctime +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/polymer/eduke32/build/obj.watcom/keep.me b/polymer/eduke32/build/obj.watcom/keep.me deleted file mode 100644 index e69de29bb..000000000 diff --git a/polymer/eduke32/build/src/compat.c b/polymer/eduke32/build/src/compat.c index ce5fb77f9..43f65793e 100644 --- a/polymer/eduke32/build/src/compat.c +++ b/polymer/eduke32/build/src/compat.c @@ -34,9 +34,7 @@ #endif #endif -#if defined(__WATCOMC__) -# include -#elif defined(_MSC_VER) +#if defined(_MSC_VER) # include #else # include diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 6ac884ef2..1bca8880f 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -125,97 +125,7 @@ extern char textfont[2048], smalltextfont[2048]; static char kensmessage[128]; char *engineerrstr = "No error"; - -#if defined(__WATCOMC__) && !defined(NOASM) - -// -// Watcom Inline Assembly Routines -// - -#pragma aux nsqrtasm =\ - "test eax, 0xff000000",\ - "mov ebx, eax",\ - "jnz short over24",\ - "shr ebx, 12",\ - "mov cx, word ptr shlookup[ebx*2]",\ - "jmp short under24",\ - "over24: shr ebx, 24",\ - "mov cx, word ptr shlookup[ebx*2+8192]",\ - "under24: shr eax, cl",\ - "mov cl, ch",\ - "mov ax, word ptr sqrtable[eax*2]",\ - "shr eax, cl",\ - parm nomemory [eax]\ - modify exact [eax ebx ecx] -uint32_t nsqrtasm(uint32_t); - -#pragma aux msqrtasm =\ - "mov eax, 0x40000000",\ - "mov ebx, 0x20000000",\ - "begit: cmp ecx, eax",\ - "jl skip",\ - "sub ecx, eax",\ - "lea eax, [eax+ebx*4]",\ - "skip: sub eax, ebx",\ - "shr eax, 1",\ - "shr ebx, 2",\ - "jnz begit",\ - "cmp ecx, eax",\ - "sbb eax, -1",\ - "shr eax, 1",\ - parm nomemory [ecx]\ - modify exact [eax ebx ecx] -int32_t msqrtasm(uint32_t); - -//0x007ff000 is (11<<13), 0x3f800000 is (127<<23) -#pragma aux krecipasm =\ - "mov fpuasm, eax",\ - "fild dword ptr fpuasm",\ - "add eax, eax",\ - "fstp dword ptr fpuasm",\ - "sbb ebx, ebx",\ - "mov eax, fpuasm",\ - "mov ecx, eax",\ - "and eax, 0x007ff000",\ - "shr eax, 10",\ - "sub ecx, 0x3f800000",\ - "shr ecx, 23",\ - "mov eax, dword ptr reciptable[eax]",\ - "sar eax, cl",\ - "xor eax, ebx",\ - parm [eax]\ - modify exact [eax ebx ecx] -int32_t krecipasm(int32_t); - -#pragma aux getclipmask =\ - "sar eax, 31",\ - "add ebx, ebx",\ - "adc eax, eax",\ - "add ecx, ecx",\ - "adc eax, eax",\ - "add edx, edx",\ - "adc eax, eax",\ - "mov ebx, eax",\ - "shl ebx, 4",\ - "or al, 0xf0",\ - "xor eax, ebx",\ - parm [eax][ebx][ecx][edx]\ - modify exact [eax ebx ecx edx] -int32_t getclipmask(int32_t,int32_t,int32_t,int32_t); - -#pragma aux getkensmessagecrc =\ - "xor eax, eax",\ - "mov ecx, 32",\ - "beg: mov edx, dword ptr [ebx+ecx*4-4]",\ - "ror edx, cl",\ - "adc eax, edx",\ - "bswap eax",\ - "loop short beg",\ - parm [ebx]\ - modify exact [eax ebx ecx edx] -int32_t getkensmessagecrc(int32_t); - -#elif defined(_MSC_VER) && !defined(NOASM) // __WATCOMC__ +#if defined(_MSC_VER) && !defined(NOASM) // // Microsoft C Inline Assembly Routines @@ -6848,20 +6758,8 @@ int32_t loadboard(char *filename, char fromwhere, int32_t *daposx, int32_t *dapo // // loadboardv5/6 // -#ifdef __GNUC__ -#define BPACK __attribute__ ((packed)) -#else -#define BPACK -#endif - -#ifdef _MSC_VER -#pragma pack(1) -#endif - -#ifdef __WATCOMC__ -#pragma pack(push,1); -#endif -struct BPACK sectortypev5 +#pragma pack(push,1) +struct sectortypev5 { uint16_t wallptr, wallnum; int16_t ceilingpicnum, floorpicnum; @@ -6876,7 +6774,7 @@ struct BPACK sectortypev5 int16_t lotag, hitag; int16_t extra; }; -struct BPACK walltypev5 +struct walltypev5 { int32_t x, y; int16_t point2; @@ -6889,7 +6787,7 @@ struct BPACK walltypev5 int16_t lotag, hitag; int16_t extra; }; -struct BPACK spritetypev5 +struct spritetypev5 { int32_t x, y, z; char cstat; @@ -6900,7 +6798,7 @@ struct BPACK spritetypev5 int16_t lotag, hitag; int16_t extra; }; -struct BPACK sectortypev6 +struct sectortypev6 { uint16_t wallptr, wallnum; int16_t ceilingpicnum, floorpicnum; @@ -6914,7 +6812,7 @@ struct BPACK sectortypev6 char visibility; int16_t lotag, hitag, extra; }; -struct BPACK walltypev6 +struct walltypev6 { int32_t x, y; int16_t point2, nextsector, nextwall; @@ -6925,7 +6823,7 @@ struct BPACK walltypev6 char xrepeat, yrepeat, xpanning, ypanning; int16_t lotag, hitag, extra; }; -struct BPACK spritetypev6 +struct spritetypev6 { int32_t x, y, z; int16_t cstat; @@ -6937,15 +6835,7 @@ struct BPACK spritetypev6 int16_t sectnum, statnum; int16_t lotag, hitag, extra; }; -#ifdef _MSC_VER -#pragma pack() -#endif - -#ifdef __WATCOMC__ #pragma pack(pop) -#endif - -#undef BPACK static int16_t sectorofwallv5(int16_t theline) { diff --git a/polymer/eduke32/build/src/engine_priv.h b/polymer/eduke32/build/src/engine_priv.h index d86c28cec..fe44ac913 100644 --- a/polymer/eduke32/build/src/engine_priv.h +++ b/polymer/eduke32/build/src/engine_priv.h @@ -60,24 +60,7 @@ int32_t animateoffs(int16_t tilenum, int16_t fakevar); extern int32_t indrawroomsandmasks; -#if defined(__WATCOMC__) && !defined(NOASM) - -#pragma aux setgotpic =\ -"mov ebx, eax",\ -"cmp byte ptr walock[eax], 200",\ -"jae skipit",\ -"mov byte ptr walock[eax], 199",\ -"skipit: shr eax, 3",\ -"and ebx, 7",\ -"mov dl, byte ptr gotpic[eax]",\ -"mov bl, byte ptr pow2char[ebx]",\ -"or dl, bl",\ -"mov byte ptr gotpic[eax], dl",\ -parm [eax]\ -modify exact [eax ebx ecx edx] -void setgotpic(int32_t); - -#elif defined(_MSC_VER) && !defined(NOASM) // __WATCOMC__ +#if defined(_MSC_VER) && !defined(NOASM) static inline void setgotpic(int32_t a) { diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index 10699d512..dd709fcc2 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -190,59 +190,7 @@ static int32_t gotcmov = -2, abstab10[1024] ASMNAME("abstab10"); static int32_t qhufval0[1< 1.0) - bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy); + bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); @@ -906,7 +906,7 @@ void updateanimation(md2model_t *m, spritetype *tspr) } if (spritesmooth[tspr->owner].mdsmooth) - fps = (1.0f / (float)(tile2model[Ptile2tile(tspr->picnum,lpal)].smoothduration)) * 66; + ftol((1.0f / (float)(tile2model[Ptile2tile(tspr->picnum,lpal)].smoothduration)) * 66.f, &fps); else fps = anim->fpssc; @@ -1160,9 +1160,9 @@ static md2model_t *md2load(int32_t fil, const char *filnam) } else { - s->xyzn[(k*s->numverts) + (i*3) + j].x = ((f->verts[m->tris[i].v[j]].v[0] * f->mul.x) + f->add.x) * 64; - s->xyzn[(k*s->numverts) + (i*3) + j].y = ((f->verts[m->tris[i].v[j]].v[1] * f->mul.y) + f->add.y) * 64; - s->xyzn[(k*s->numverts) + (i*3) + j].z = ((f->verts[m->tris[i].v[j]].v[2] * f->mul.z) + f->add.z) * 64; + s->xyzn[(k*s->numverts) + (i*3) + j].x = (int16_t)(((f->verts[m->tris[i].v[j]].v[0] * f->mul.x) + f->add.x) * 64.f); + s->xyzn[(k*s->numverts) + (i*3) + j].y = (int16_t)(((f->verts[m->tris[i].v[j]].v[1] * f->mul.y) + f->add.y) * 64.f); + s->xyzn[(k*s->numverts) + (i*3) + j].z = (int16_t)(((f->verts[m->tris[i].v[j]].v[2] * f->mul.z) + f->add.z) * 64.f); } k++; @@ -1260,7 +1260,7 @@ static md3model_t *md3load(int32_t fil) md3surf_t *s; m = (md3model_t *)nedpcalloc(model_data_pool, 1,sizeof(md3model_t)); if (!m) return(0); - m->mdnum = 3; m->texid = 0; m->scale = .01; + m->mdnum = 3; m->texid = 0; m->scale = .01f; m->muladdframes = NULL; @@ -1607,7 +1607,7 @@ static int32_t md3draw(md3model_t *m, spritetype *tspr) // Parkar: Moved up to be able to use k0 for the y-flipping code - k0 = tspr->z; + k0 = (float)tspr->z; if ((globalorientation&128) && !((globalorientation&48)==32)) k0 += (float)((tilesizy[tspr->picnum]*tspr->yrepeat)<<1); // Parkar: Changed to use the same method as centeroriented sprites @@ -1625,7 +1625,7 @@ static int32_t md3draw(md3model_t *m, spritetype *tspr) m0.z *= f; m1.z *= f; a0.z *= f; // floor aligned - k1 = tspr->y; + k1 = (float)tspr->y; if ((globalorientation&48)==32) { m0.z = -m0.z; m1.z = -m1.z; a0.z = -a0.z; @@ -1695,15 +1695,15 @@ static int32_t md3draw(md3model_t *m, spritetype *tspr) pc[2] *= (float)hictinting[globalpal].b / 255.0; if (hictinting[MAXPALOOKUPS-1].r != 255 || hictinting[MAXPALOOKUPS-1].g != 255 || hictinting[MAXPALOOKUPS-1].b != 255) { - pc[0] *= (float)hictinting[MAXPALOOKUPS-1].r / 255.0; - pc[1] *= (float)hictinting[MAXPALOOKUPS-1].g / 255.0; - pc[2] *= (float)hictinting[MAXPALOOKUPS-1].b / 255.0; + pc[0] *= (float)hictinting[MAXPALOOKUPS-1].r / 255.0f; + pc[1] *= (float)hictinting[MAXPALOOKUPS-1].g / 255.0f; + pc[2] *= (float)hictinting[MAXPALOOKUPS-1].b / 255.0f; } } else globalnoeffect=1; } - if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66; else pc[3] = 0.33; } + if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66f; else pc[3] = 0.33f; } else pc[3] = 1.0; if (m->usesalpha) //Sprites with alpha in texture { @@ -1732,15 +1732,15 @@ static int32_t md3draw(md3model_t *m, spritetype *tspr) if (spriteext[tspr->owner].pitch || spriteext[tspr->owner].roll || m->head.flags == 1337) { if (spriteext[tspr->owner].xoff) - a0.x = (int32_t)(spriteext[tspr->owner].xoff / (2560 * (m0.x+m1.x))); + a0.x = (float)(spriteext[tspr->owner].xoff / (2560 * (m0.x+m1.x))); else a0.x = 0; if (spriteext[tspr->owner].yoff) - a0.y = (int32_t)(spriteext[tspr->owner].yoff / (2560 * (m0.x+m1.x))); + a0.y = (float)(spriteext[tspr->owner].yoff / (2560 * (m0.x+m1.x))); else a0.y = 0; if ((spriteext[tspr->owner].zoff) && !(tspr->cstat&1024)) - a0.z = (int32_t)(spriteext[tspr->owner].zoff / (655360 * (m0.z+m1.z))); + a0.z = (float)(spriteext[tspr->owner].zoff / (655360 * (m0.z+m1.z))); else a0.z = 0; k0 = (float)sintable[(spriteext[tspr->owner].pitch+512)&2047] / 16384.0; @@ -2820,7 +2820,7 @@ int32_t voxdraw(voxmodel_t *m, spritetype *tspr) f = ((float)tspr->yrepeat)/64.0*m->bscale; m0.z *= f; a0.z *= f; - k0 = tspr->z; + k0 = (float)tspr->z; if (globalorientation&128) k0 += (float)((tilesizy[tspr->picnum]*tspr->yrepeat)<<1); f = (65536.0*512.0)/((float)xdimen*viewingrange); @@ -2870,7 +2870,7 @@ int32_t voxdraw(voxmodel_t *m, spritetype *tspr) pc[0] *= (float)hictinting[globalpal].r / 255.0; pc[1] *= (float)hictinting[globalpal].g / 255.0; pc[2] *= (float)hictinting[globalpal].b / 255.0; - if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66; else pc[3] = 0.33; } + if (tspr->cstat&2) { if (!(tspr->cstat&512)) pc[3] = 0.66f; else pc[3] = 0.33f; } else pc[3] = 1.0; if (tspr->cstat&2/* && (!peelcompiling)*/) bglEnable(GL_BLEND); //else bglDisable(GL_BLEND); //------------ diff --git a/polymer/eduke32/build/src/nedmalloc.c b/polymer/eduke32/build/src/nedmalloc.c index 7722d5909..008f13f02 100644 --- a/polymer/eduke32/build/src/nedmalloc.c +++ b/polymer/eduke32/build/src/nedmalloc.c @@ -679,7 +679,7 @@ void neddestroypool(nedpool *p) THROWSPEC if (TLSFREE(p->mycache)) abort(); nedpfree(0, p); } -void neddestroysyspool() THROWSPEC +void neddestroysyspool(void) THROWSPEC { nedpool *p=&syspool; int n; diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 9f149b32b..29cd49d63 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -13,7 +13,7 @@ int32_t pr_shadows = 1; int32_t pr_shadowcount = 5; int32_t pr_shadowdetail = 4; int32_t pr_shadowfiltering = 1; -int32_t pr_maxlightpasses = 5; +int32_t pr_maxlightpasses = 10; int32_t pr_maxlightpriority = PR_MAXLIGHTPRIORITY; int32_t pr_fov = 426; // appears to be the classic setting. int32_t pr_billboardingmode = 1; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 29076815c..30f85ef51 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -104,7 +104,7 @@ static double dxb1[MAXWALLSB], dxb2[MAXWALLSB]; #define LINTERPSIZ 4 //log2 of interpolation size. 4:pretty fast&acceptable quality, 0:best quality/slow! #define DEPTHDEBUG 0 //1:render distance instead of texture, for debugging only!, 0:default -float shadescale = 1.050; +float shadescale = 1.050f; double gyxscale, gxyaspect, gviewxrange, ghalfx, grhalfxdown10, grhalfxdown10x, ghoriz; double gcosang, gsinang, gcosang2, gsinang2; @@ -195,71 +195,6 @@ static char ptempbuf[MAXWALLSB<<1]; int32_t r_parallaxskyclamping = 1; int32_t r_parallaxskypanning = 0; -#if defined(USE_MSC_PRAGMAS) -static inline void ftol(float f, int32_t *a) -{ - _asm - { - mov eax, a - fld f - fistp dword ptr [eax] - } -} - -static inline void dtol(double d, int32_t *a) -{ - _asm - { - mov eax, a - fld d - fistp dword ptr [eax] - } -} -#elif defined(USE_WATCOM_PRAGMAS) - -#pragma aux ftol =\ - "fistp dword ptr [eax]",\ - parm [eax 8087] -#pragma aux dtol =\ - "fistp dword ptr [eax]",\ - parm [eax 8087] - -#elif defined(USE_GCC_PRAGMAS) - -static inline void ftol(float f, int32_t *a) -{ - __asm__ __volatile__( -#if 0 //(__GNUC__ >= 3) - "flds %1; fistpl %0;" -#else -"flds %1; fistpl (%0);" -#endif - : "=r"(a) : "m"(f) : "memory","cc"); -} - -static inline void dtol(double d, int32_t *a) -{ - __asm__ __volatile__( -#if 0 //(__GNUC__ >= 3) - "fldl %1; fistpl %0;" -#else -"fldl %1; fistpl (%0);" -#endif - : "=r"(a) : "m"(d) : "memory","cc"); -} - -#else -static inline void ftol(float f, int32_t *a) -{ - *a = (int32_t)f; -} - -static inline void dtol(double d, int32_t *a) -{ - *a = (int32_t)d; -} -#endif - static inline int32_t imod(int32_t a, int32_t b) { if (a >= 0) return(a%b); @@ -954,10 +889,10 @@ void resizeglcheck() ratio += 4.f*(-gshang-0.7f); } - glox1 = windowx1; gloy1 = windowy1; - glox2 = windowx2; gloy2 = windowy2; + glox1 = (float)windowx1; gloy1 = (float)windowy1; + glox2 = (float)windowx2; gloy2 = (float)windowy2; - fovcorrect = glprojectionhacks?(glwidescreen?0:(((windowx2-windowx1+1) * ratio) - (windowx2-windowx1+1))):0; + fovcorrect = (int32_t)(glprojectionhacks?(glwidescreen?0:(((windowx2-windowx1+1) * ratio) - (windowx2-windowx1+1))):0); bglViewport(windowx1 - (fovcorrect / 2), yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect, windowy2-windowy1+1); @@ -2104,13 +2039,13 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) { default: case 0: - pc[3] = 1.0; break; + pc[3] = 1.0f; break; case 1: - pc[3] = 1.0; break; + pc[3] = 1.0f; break; case 2: - pc[3] = 0.66; break; + pc[3] = 0.66f; break; case 3: - pc[3] = 0.33; break; + pc[3] = 0.33f; break; } // tinting happens only to hightile textures, and only if the texture we're // rendering isn't for the same palette as what we asked for @@ -2784,7 +2719,7 @@ void domost(float x0, float y0, float x1, float y1) if (x0 < x1) { dir = 1; //clip dmost (floor) - y0 -= .01; y1 -= .01; + y0 -= .01f; y1 -= .01f; } else { @@ -3866,7 +3801,7 @@ static void polymost_drawalls(int32_t bunch) i = (1<<(picsiz[globalpicnum]>>4)); if (i < tilesizy[globalpicnum]) i <<= 1; ypan = wal->ypanning; - yoffs=(i-tilesizy[globalpicnum])*(255./i); + ftol((i-tilesizy[globalpicnum])*(255.f/i),&yoffs); if (wal->cstat&4) { if (ypan>256-yoffs) @@ -3923,7 +3858,7 @@ static void polymost_drawalls(int32_t bunch) i = (1<<(picsiz[globalpicnum]>>4)); if (i < tilesizy[globalpicnum]) i <<= 1; ypan = nwal->ypanning; - yoffs=(i-tilesizy[globalpicnum])*(255./i); + ftol((i-tilesizy[globalpicnum])*(255.f/i),&yoffs); if (!(nwal->cstat&4)) { if (ypan>256-yoffs) @@ -3978,7 +3913,7 @@ static void polymost_drawalls(int32_t bunch) i = (1<<(picsiz[globalpicnum]>>4)); if (i < tilesizy[globalpicnum]) i <<= 1; ypan = wal->ypanning; - yoffs=(i-tilesizy[globalpicnum])*(255./i); + ftol((i-tilesizy[globalpicnum])*(255.f/i),&yoffs); if (!(wal->cstat&4)) { if (ypan>256-yoffs) @@ -4970,10 +4905,10 @@ void polymost_drawsprite(int32_t snum) i = (tspr->ang&2047); c = sintable[(i+512)&2047]/65536.0; s = sintable[i]/65536.0; - x0 = ((tsizx>>1)-xoff)*tspr->xrepeat; - y0 = ((tsizy>>1)-yoff)*tspr->yrepeat; - x1 = ((tsizx>>1)+xoff)*tspr->xrepeat; - y1 = ((tsizy>>1)+yoff)*tspr->yrepeat; + x0 = (float)((tsizx>>1)-xoff)*tspr->xrepeat; + y0 = (float)((tsizy>>1)-yoff)*tspr->yrepeat; + x1 = (float)((tsizx>>1)+xoff)*tspr->xrepeat; + y1 = (float)((tsizy>>1)+yoff)*tspr->yrepeat; //Project 3D to 2D for (j=0; j<4; j++) @@ -5188,7 +5123,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 m[2][2] = 1.0; m[2][3] = (float)ydimen*(ratioratio >= 1.6?1.2:1); m[3][2] =-1.0; } - else { m[0][0] = m[2][3] = 1.0; m[1][1] = ((float)xdim)/((float)ydim); m[2][2] = 1.0001; m[3][2] = 1-m[2][2]; } + else { m[0][0] = m[2][3] = 1.0f; m[1][1] = ((float)xdim)/((float)ydim); m[2][2] = 1.0001f; m[3][2] = 1-m[2][2]; } bglLoadMatrixf(&m[0][0]); bglMatrixMode(GL_MODELVIEW); bglLoadIdentity(); @@ -5255,7 +5190,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16 bglViewport(0,0,xdim,ydim); glox1 = -1; //Force fullscreen (glox1=-1 forces it to restore) bglMatrixMode(GL_PROJECTION); memset(m,0,sizeof(m)); - m[0][0] = m[2][3] = 1.0; m[1][1] = ((float)xdim)/((float)ydim); m[2][2] = 1.0001; m[3][2] = 1-m[2][2]; + m[0][0] = m[2][3] = 1.0f; m[1][1] = ((float)xdim)/((float)ydim); m[2][2] = 1.0001f; m[3][2] = 1-m[2][2]; bglPushMatrix(); bglLoadMatrixf(&m[0][0]); bglMatrixMode(GL_MODELVIEW); bglLoadIdentity(); @@ -5599,11 +5534,11 @@ void polymost_fillpolygon(int32_t npoints) { case 0: case 1: - a = 1.0; bglDisable(GL_BLEND); break; + a = 1.0f; bglDisable(GL_BLEND); break; case 2: - a = 0.66; bglEnable(GL_BLEND); break; + a = 0.66f; bglEnable(GL_BLEND); break; case 3: - a = 0.33; bglEnable(GL_BLEND); break; + a = 0.33f; bglEnable(GL_BLEND); break; } bglColor4f(f,f,f,a); diff --git a/polymer/eduke32/build/src/pragmas.c b/polymer/eduke32/build/src/pragmas.c index 82f2cab0e..d54c81e88 100644 --- a/polymer/eduke32/build/src/pragmas.c +++ b/polymer/eduke32/build/src/pragmas.c @@ -163,13 +163,7 @@ void copybufreverse(void *S, void *D, int32_t c) ); } -#elif defined(__WATCOMC__) && !defined(NOASM) // __GNUC__ && __i386__ - -// -// Watcom C Inline Assembler version -// - -#elif defined(_MSC_VER) && !defined(NOASM) // __WATCOMC__ +#elif defined(_MSC_VER) && !defined(NOASM) // __GNUC__ && __i386__ // // Microsoft C Inline Assembler version diff --git a/polymer/eduke32/eduke32.vcproj b/polymer/eduke32/eduke32.vcproj index 3fd6623b6..ac76104db 100644 --- a/polymer/eduke32/eduke32.vcproj +++ b/polymer/eduke32/eduke32.vcproj @@ -252,10 +252,6 @@ RelativePath=".\build\src\dynamicgtk.c" > - - diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 5cd7bd5ad..a76575fb0 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -66,7 +66,11 @@ int32_t spnoclip=1; // Sound in Mapster32 static char defaultgamecon[BMAX_PATH] = "game.con"; static char *gamecon = defaultgamecon; + +#pragma pack(push,1) sound_t g_sounds[MAXSOUNDS]; +#pragma pack(pop) + static int16_t g_definedsndnum[MAXSOUNDS]; // maps parse order index to g_sounds index static int16_t g_sndnum[MAXSOUNDS]; // maps current order index to g_sounds index int32_t g_numsounds = 0; @@ -95,7 +99,7 @@ static int32_t mouseaction=0, mouseax=0, mouseay=0; static int32_t repeatcountx, repeatcounty; static int32_t infobox=3; // bit0: current window, bit1: mouse pointer, the variable should be renamed -extern char mskip; +extern int32_t mskip; extern int16_t capturecount; extern int32_t editorgridextent; // in engine.c extern char game_executable[BMAX_PATH]; @@ -10163,7 +10167,7 @@ void ExtAnalyzeSprites(void) gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = hictinting[PL].b; } gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = (256-(SS+128))<<1; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius * 0.75; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = (int16_t)(gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius * 0.75f); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 22c1b6240..4cf944cff 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -708,7 +708,7 @@ int32_t CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Detail",&ud.detail); { - extern int32_t g_frameDelay; + extern uint32_t g_frameDelay; SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "MaxFPS",&r_maxfps); r_maxfps = max(0,min(1000,r_maxfps)); diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 11caa478d..f3a658b3b 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -258,6 +258,8 @@ enum DukeWeapon_t { #define deletesprite A_DeleteSprite void A_DeleteSprite(int32_t s); +#pragma pack(push,1) + typedef struct { uint32_t bits; int16_t fvel, svel; @@ -535,7 +537,7 @@ typedef struct { int16_t ang, oldang, angdir, angdif; } spriteinterpolate; -spriteinterpolate sprpos[MAXSPRITES]; +// spriteinterpolate sprpos[MAXSPRITES]; typedef struct { int32_t bposx,bposy,bposz; @@ -1102,6 +1104,8 @@ enum DukePacket_t PACKET_QUIT = 255 // should match mmulti I think }; +#pragma pack(pop) + #ifdef __cplusplus } #endif diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 4d2d0e826..8adcff42f 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -63,7 +63,7 @@ int32_t g_scriptSanityChecks = 1; #define TIMERUPDATESIZ 32 int32_t g_cameraDistance = 0, g_cameraClock = 0; -static int32_t qe,cp; +static int32_t qe; static int32_t g_commandSetup = 0; int32_t g_noSetup = 0; static int32_t g_noAutoLoad = 0; @@ -1082,12 +1082,6 @@ void faketimerhandler(void) Net_GetPackets(); -// if (getoutputcirclesize() >= 16) return; - -// for (i=connecthead;i>=0;i=connectpoint2[i]) -// if (i != myconnectindex) -// if (g_player[i].movefifoend < g_player[myconnectindex].movefifoend-200) return; - if (g_player[myconnectindex].movefifoend - movefifoplc >= 100) return; @@ -1099,6 +1093,7 @@ void faketimerhandler(void) avghorz += loc.horz; avgbits |= loc.bits; avgextbits |= loc.extbits; + if (g_player[myconnectindex].movefifoend&(g_movesPerPacket-1)) { copybufbyte(&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex], @@ -1106,6 +1101,7 @@ void faketimerhandler(void) g_player[myconnectindex].movefifoend++; return; } + nsyn = &inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex]; nsyn[0].fvel = avgfvel/g_movesPerPacket; nsyn[0].svel = avgsvel/g_movesPerPacket; @@ -1139,6 +1135,7 @@ void faketimerhandler(void) g_player[i].myminlag = min(g_player[i].myminlag,k); mymaxlag = max(mymaxlag,k); } + #if 0 if (((g_player[myconnectindex].movefifoend - 1) & (TIMERUPDATESIZ - 1)) == 0) { @@ -1165,44 +1162,6 @@ void faketimerhandler(void) j = 1; //Fix timers and buffer/jitter value -#if 0 - if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0) - { - if (myconnectindex == connecthead) - { - for (i = connectpoint2[connecthead]; i >= 0; i = connectpoint2[i]) - packbuf[j++] = min(max(g_player[i].myminlag, -128), 127); - } - else - { - i = g_player[connecthead].myminlag - otherminlag; - if (klabs(i) > 2) - { - ////DSPRINTF(ds,"lag correction: %d,%d,%d",i,Player[connecthead].myminlag,otherminlag); - //MONO_PRINT(ds); - - if (klabs(i) > 8) - { - if (i < 0) - i++; - i >>= 1; - } - else - { - if (i < 0) - i = -1; - if (i > 0) - i = 1; - } - totalclock -= TICSPERFRAME * i; - otherminlag += i; - } - } - - TRAVERSE_CONNECT(i) - g_player[i].myminlag = 0x7fffffff; - } -#else if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0) { if (myconnectindex != connecthead) @@ -1215,15 +1174,16 @@ void faketimerhandler(void) totalclock -= TICSPERFRAME*i; g_player[connecthead].myminlag -= i; otherminlag += i; } - - if (myconnectindex == connecthead) + else + { for (i=connectpoint2[connecthead]; i>=0; i=connectpoint2[i]) packbuf[j++] = min(max(g_player[i].myminlag,-128),127); + } - for (i=connecthead; i>=0; i=connectpoint2[i]) + TRAVERSE_CONNECT(i) g_player[i].myminlag = 0x7fffffff; } -#endif + osyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-2)&(MOVEFIFOSIZ-1)][myconnectindex]; nsyn = (input_t *)&inputfifo[(g_player[myconnectindex].movefifoend-1)&(MOVEFIFOSIZ-1)][myconnectindex]; @@ -1257,8 +1217,8 @@ void faketimerhandler(void) packbuf[j++] = (uint8_t)nsyn[0].horz; packbuf[k] |= 128; } -// k++; packbuf[++k] = 0; + if (nsyn[0].extbits != osyn[0].extbits) packbuf[j++] = nsyn[0].extbits, packbuf[k] |= 1; /* if ((nsyn[0].extbits^osyn[0].extbits)&0x000000ff) packbuf[j++] = (nsyn[0].extbits&255), packbuf[k] |= 1; if ((nsyn[0].extbits^osyn[0].extbits)&0x0000ff00) packbuf[j++] = ((nsyn[0].extbits>>8)&255), packbuf[k] |= 2; @@ -1284,30 +1244,16 @@ void faketimerhandler(void) //Fix timers and buffer/jitter value if (((g_player[myconnectindex].movefifoend-1)&(TIMERUPDATESIZ-1)) == 0) { - i = g_player[connecthead].myminlag - otherminlag; - if (klabs(i) > 2) - { - if (klabs(i) > 8) - { - if (i < 0) - i++; - i >>= 1; - } - else - { - if (i < 0) - i = -1; - if (i > 0) - i = 1; - } - totalclock -= TICSPERFRAME * i; - otherminlag += i; - } + i = g_player[connecthead].myminlag-otherminlag; + if (klabs(i) > 8) i >>= 1; + else if (klabs(i) > 2) i = ksgn(i); + else i = 0; + + totalclock -= TICSPERFRAME*i; + g_player[connecthead].myminlag -= i; otherminlag += i; TRAVERSE_CONNECT(i) - { g_player[i].myminlag = 0x7fffffff; - } } packbuf[0] = PACKET_SLAVE_TO_MASTER; @@ -1396,8 +1342,10 @@ void faketimerhandler(void) } k = j; + TRAVERSE_CONNECT(i) - j += g_player[i].playerquitflag + g_player[i].playerquitflag; + j += g_player[i].playerquitflag + g_player[i].playerquitflag; + TRAVERSE_CONNECT(i) { if (g_player[i].playerquitflag == 0) continue; @@ -2847,7 +2795,7 @@ void G_GameExit(const char *t) if (frecfilep) fclose(frecfilep); } // JBF: fixes crash on demo playback - if (!qe && !cp) + if (!qe) { if (playerswhenstarted > 1 && g_player[myconnectindex].ps->gm&MODE_GAME && GTFLAGS(GAMETYPE_SCORESHEET) && *t == ' ') { @@ -4227,30 +4175,6 @@ void G_SE40(int32_t smoothratio) k = nextspritesect[k]; } } - /* - else // viewing from bottom - { - int32_t k = headspritesect[sprite[sp->yvel].sectnum]; - - while (k != -1) - { - if (sprite[k].picnum != SECTOREFFECTOR && (sprite[k].z >= sprite[sp->yvel].z)) - { - Bmemcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)&sprite[k],sizeof(spritetype)); - - tsprite[spritesortcnt].x -= (sprite[sp->yvel].x-sp->x); - tsprite[spritesortcnt].y -= (sprite[sp->yvel].y-sp->y); - tsprite[spritesortcnt].z = tsprite[spritesortcnt].z - sprite[sp->yvel].z + ActorExtra[ror_sprite].ceilingz; - tsprite[spritesortcnt].sectnum = sp->sectnum; - tsprite[spritesortcnt].owner = k; - - //OSD_Printf("duped sprite of pic %d at %d %d %d\n",tsprite[spritesortcnt].picnum,tsprite[spritesortcnt].x,tsprite[spritesortcnt].y,tsprite[spritesortcnt].z); - spritesortcnt++; - } - k = nextspritesect[k]; - } - } - */ G_DoSpriteAnimations(ud.camerax,ud.cameray,ud.cameraang,smoothratio); drawmasks(); @@ -4540,7 +4464,7 @@ void G_DrawRooms(int32_t snum,int32_t smoothratio) tsprite[spritesortcnt].sectnum = sprite[sp->yvel].sectnum; tsprite[spritesortcnt].owner = k; - OSD_Printf("duped sprite of pic %d at %d %d %d\n",tsprite[spritesortcnt].picnum,tsprite[spritesortcnt].x,tsprite[spritesortcnt].y,tsprite[spritesortcnt].z); + //OSD_Printf("duped sprite of pic %d at %d %d %d\n",tsprite[spritesortcnt].picnum,tsprite[spritesortcnt].x,tsprite[spritesortcnt].y,tsprite[spritesortcnt].z); spritesortcnt++; } k = nextspritesect[k]; @@ -4721,7 +4645,7 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3 ActorExtra[i].flags = 0; - sprpos[i].ang = sprpos[i].oldang = sprite[i].ang; + // sprpos[i].ang = sprpos[i].oldang = sprite[i].ang; if (actorscrptr[s_pn]) { @@ -4808,7 +4732,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) ActorExtra[i].flags = 0; - sprpos[i].ang = sprpos[i].oldang = sprite[i].ang; +// sprpos[i].ang = sprpos[i].oldang = sprite[i].ang; if (PN != SPEAKER && PN != LETTER && PN != DUCK && PN != TARGET && PN != TRIPBOMB && PN != VIEWSCREEN && PN != VIEWSCREEN2 && (CS&48)) if (!(PN >= CRACK1 && PN <= CRACK4)) @@ -6689,9 +6613,8 @@ void G_DoSpriteAnimations(int32_t x,int32_t y,int32_t a,int32_t smoothratio) ror_sprite = -1; - for (j=spritesortcnt-1; j>=0; j--) //Between drawrooms() and drawmasks() + for (j=spritesortcnt-1; j>=0; j--) { - //is the perfect time to animate sprites t = &tsprite[j]; i = t->owner; s = &sprite[i]; @@ -6816,7 +6739,7 @@ void G_DoSpriteAnimations(int32_t x,int32_t y,int32_t a,int32_t smoothratio) //is the perfect time to animate sprites t = &tsprite[j]; i = t->owner; - s = &sprite[i]; + s = (i < 0 ? &tsprite[j] : &sprite[i]); switch (DynamicTileMap[s->picnum]) { @@ -7016,22 +6939,18 @@ void G_DoSpriteAnimations(int32_t x,int32_t y,int32_t a,int32_t smoothratio) t->picnum = GROWSPARK+((totalclock>>4)&3); break; case RPG__STATIC: - #if defined(POLYMOST) && defined(USE_OPENGL) if (getrendermode() >= 3 && usemodels && md_tilehasmodel(t->picnum,t->pal) >= 0 && !(spriteext[i].flags & SPREXT_NOTMD)) { int32_t v = getangle(t->xvel, t->zvel>>4); - if (v > 1023) - v -= 2048; - spriteext[i].pitch = v; + spriteext[i].pitch = (v > 1023 ? v-2048 : v); t->cstat &= ~4; break; } #endif - k = getangle(s->x-x,s->y-y); - k = (((s->ang+3072+128-k)&2047)/170); + k = (((s->ang+3072+128-getangle(s->x-x,s->y-y))&2047)/170); if (k > 6) { k = 12-k; @@ -7050,10 +6969,7 @@ void G_DoSpriteAnimations(int32_t x,int32_t y,int32_t a,int32_t smoothratio) break; } #endif - k = getangle(s->x-x,s->y-y); - if (T1 < 4) - k = (((s->ang+3072+128-k)&2047)/170); - else k = (((s->ang+3072+128-k)&2047)/170); + k = (((s->ang+3072+128-getangle(s->x-x,s->y-y))&2047)/170); if (k>6) { @@ -7751,7 +7667,7 @@ int8_t cheatbuf[MAXCHEATLEN],cheatbuflen; static void G_DoCheats(void) { - int16_t ch, i, j, k=0, weapon; + int32_t ch, i, j, k=0, weapon; static int32_t z=0; char consolecheat = 0; // JBF 20030914 @@ -7789,7 +7705,7 @@ static void G_DoCheats(void) return; } - cheatbuf[cheatbuflen++] = ch; + cheatbuf[cheatbuflen++] = (int8_t)ch; cheatbuf[cheatbuflen] = 0; // KB_ClearKeysDown(); @@ -9489,7 +9405,7 @@ static void G_AddPath(const char *buffer) { struct strllist *s; s = (struct strllist *)Bcalloc(1,sizeof(struct strllist)); - s->str = strdup(buffer); + s->str = Bstrdup(buffer); if (CommandPaths) { @@ -10237,6 +10153,7 @@ static void G_DisplayLogo(void) clearview(0L); } +/* static void loadtmb(void) { char tmb[8000]; @@ -10249,6 +10166,7 @@ static void loadtmb(void) MUSIC_RegisterTimbreBank(tmb); kclose(fil); } +*/ extern void C_FreeHashes(); @@ -10825,30 +10743,6 @@ void G_UpdatePlayerFromMenu(void) } } -#if 0 -char testcd(char *fn, int32_t testsiz); - -// JBF: various hacks here -static void copyprotect(void) -{ - // FILE *fp; - // char idfile[256]; - - cp = 0; - -#ifdef NOCOPYPROTECT - return; -#endif - if (VOLUMEONE) return; - - if (testcd(IDFILENAME, IDFSIZE)) - { - cp = 1; - return; - } -} -#endif - void G_BackToMenu(void) { boardfilename[0] = 0; @@ -11350,11 +11244,6 @@ CLEAN_DIRECTORY: kclose(i); } -#if 0 - copyprotect(); - if (cp) return; -#endif - if (netparamcount > 0) _buildargc = (argc -= netparamcount+1); // crop off the net parameters // gotta set the proper title after we compile the CONs if this is the full version @@ -11362,20 +11251,11 @@ CLEAN_DIRECTORY: Bsprintf(tempbuf,"%s - " APPNAME,duke3dgrpstring); wm_setapptitle(tempbuf); - -// initprintf("\n"); - if (g_scriptDebug) initprintf("CON debugging activated (level %d).\n",g_scriptDebug); RegisterShutdownFunction(G_Shutdown); - if (VOLUMEONE) - { - initprintf("Distribution of shareware Duke Nukem 3D is restricted in certain ways.\n"); - initprintf("Please read LICENSE.DOC for more details.\n"); - } - G_Startup(); // a bunch of stuff including compiling cons if (numplayers > 1) @@ -11406,19 +11286,11 @@ CLEAN_DIRECTORY: initprintf("Definitions file '%s' loaded.\n",duke3ddef); loaddefinitions_game(duke3ddef, FALSE); } - // initprintf("numplayers=%i\n",numplayers); - - Net_SendVersion(); - Net_SendPlayerName(); - -#if 0 - if (cp == 1 && numplayers < 2) - G_GameExit("Please put the Duke Nukem 3D Atomic Edition CD in the CD-ROM drive."); -#endif if (numplayers > 1) { - mmulti_sendlogon(); + Net_SendVersion(); + Net_SendPlayerName(); Net_SendPlayerOptions(); Net_SendWeaponChoice(); Net_SendUserMapName(); @@ -11479,7 +11351,7 @@ CLEAN_DIRECTORY: initprintf("Initializing OSD...\n"); - Bsprintf(tempbuf,HEAD2 " %s",s_buildDate); + Bsprintf(tempbuf, HEAD2 " %s", s_buildDate); OSD_SetVersionString(tempbuf, 10,0); registerosdcommands(); @@ -11488,6 +11360,7 @@ CLEAN_DIRECTORY: uninitengine(); exit(1); } + G_SetupGameButtons(); CONFIG_SetupMouse(); CONFIG_SetupJoystick(); @@ -11554,11 +11427,9 @@ CLEAN_DIRECTORY: setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0); - initprintf("Initializing music...\n"); S_MusicStartup(); - initprintf("Initializing sound...\n"); S_SoundStartup(); - loadtmb(); +// loadtmb(); if (ud.warp_on > 1 && ud.multimode < 2) { @@ -11574,8 +11445,6 @@ CLEAN_DIRECTORY: ud.warp_on = 0; } - // if(KB_KeyPressed( sc_Escape ) ) G_GameExit(" "); - FX_StopAllSounds(); S_ClearSoundLocks(); @@ -11642,16 +11511,13 @@ MAIN_LOOP_RESTART: ud.warp_on = 0; KB_KeyDown[sc_Pause] = 0; // JBF: I hate the pause key - while (!(g_player[myconnectindex].ps->gm&MODE_END)) //The whole loop!!!!!!!!!!!!!!!!!! + do //main loop { - if (handleevents()) + if (handleevents() && quitevent) { // JBF - if (quitevent) - { - KB_KeyDown[sc_Escape] = 1; - quitevent = 0; - } + KB_KeyDown[sc_Escape] = 1; + quitevent = 0; } AudioUpdate(); @@ -11661,11 +11527,11 @@ MAIN_LOOP_RESTART: OSD_DispatchQueued(); - if (ud.recstat == 2 || ud.multimode > 1 || (ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU)) - if (g_player[myconnectindex].ps->gm&MODE_GAME) - if (G_MoveLoop()) continue; + if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || ud.multimode > 1) && + (g_player[myconnectindex].ps->gm&MODE_GAME) && G_MoveLoop()) + continue; - if (g_player[myconnectindex].ps->gm&MODE_EOL || g_player[myconnectindex].ps->gm&MODE_RESTART) + if (g_player[myconnectindex].ps->gm & (MODE_EOL|MODE_RESTART)) { P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); P_UpdateScreenPal(g_player[myconnectindex].ps); @@ -11691,9 +11557,7 @@ MAIN_LOOP_RESTART: if (ud.multimode < 2) { if (!VOLUMEALL) - { G_DoOrderScreen(); - } g_player[myconnectindex].ps->gm = MODE_MENU; ChangeToMenu(0); probey = 0; @@ -11761,7 +11625,6 @@ MAIN_LOOP_RESTART: if (debug_on) G_ShowCacheLocks(); -// checksync(); Net_DisplaySyncMsg(); if (VOLUMEONE) @@ -11780,6 +11643,7 @@ MAIN_LOOP_RESTART: while (!(g_player[myconnectindex].ps->gm&MODE_MENU) && ready2send && totalclock >= ototalclock+TICSPERFRAME) faketimerhandler(); } + while (!(g_player[myconnectindex].ps->gm&MODE_END)); G_GameExit(" "); } diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 12cef28a4..3d8fe79b7 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5925,6 +5925,7 @@ static void C_AddDefaultDefinitions(void) C_AddDefinition("PROJ_YREPEAT",PROJ_YREPEAT,LABEL_DEFINE); } +#pragma pack(push,1) static void C_InitProjectiles(void) { int32_t i; @@ -5949,6 +5950,7 @@ static void C_InitProjectiles(void) Bmemcpy(&DefaultProjectileData[0], &ProjectileData[0], sizeof(ProjectileData)); } +#pragma pack(pop) extern int32_t g_numObituaries; extern int32_t g_numSelfObituaries; diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index cfd2ba6c8..144951a97 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "duke3d.h" -const char *s_buildDate = "20090701"; +const char *s_buildDate = "20090708"; char *MusicPtr = NULL; int32_t g_musicSize; @@ -56,7 +56,12 @@ int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount; int32_t g_currentMenu; + +#pragma pack(push,1) + map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" music +sound_t g_sounds[ MAXSOUNDS ]; +#pragma pack(pop) char EpisodeNames[MAXVOLUMES][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY" }; char SkillNames[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD" }; @@ -80,8 +85,6 @@ char g_numVolumes = 3; int32_t g_timerTicsPerSecond=TICRATE; //fx_device device; -sound_t g_sounds[ MAXSOUNDS ]; - char g_numPlayerSprites,g_loadFromGroupOnly=0,g_earthquakeTime; int32_t playerswhenstarted; diff --git a/polymer/eduke32/source/jaudiolib/_multivc.h b/polymer/eduke32/source/jaudiolib/_multivc.h index 38e51cbfa..37f886d44 100644 --- a/polymer/eduke32/source/jaudiolib/_multivc.h +++ b/polymer/eduke32/source/jaudiolib/_multivc.h @@ -228,25 +228,7 @@ static void MV_CalcPanTable(void); static void ClearBuffer_DW(void *ptr, int32_t data, int32_t length); -#if defined(__WATCOMC__) - -#pragma aux MV_Mix8BitMono parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix8BitStereo parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix16BitMono parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix16BitStereo parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix16BitMono16 parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix8BitMono16 parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix8BitStereo16 parm [eax] [edx] [ebx] [ecx] -#pragma aux MV_Mix16BitStereo16 parm [eax] [edx] [ebx] [ecx] - -#pragma aux MV_16BitReverb parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi] -#pragma aux MV_8BitReverb parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi] -#pragma aux MV_16BitReverbFast parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi] -#pragma aux MV_8BitReverbFast parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi] - -#define CDEC - -#elif defined(_MSC_VER) +#if defined(_MSC_VER) #define CDEC _cdecl diff --git a/polymer/eduke32/source/jaudiolib/dsoundout.c b/polymer/eduke32/source/jaudiolib/dsoundout.c index 33f8bab0f..eab894c16 100644 --- a/polymer/eduke32/source/jaudiolib/dsoundout.c +++ b/polymer/eduke32/source/jaudiolib/dsoundout.c @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "compat.h" #include "winlayer.h" -#if defined(__WATCOMC__) || defined(_MSC_VER) +#if defined(_MSC_VER) #include #endif diff --git a/polymer/eduke32/source/jaudiolib/platform.h b/polymer/eduke32/source/jaudiolib/platform.h index bd30f42d8..b4e475dca 100644 --- a/polymer/eduke32/source/jaudiolib/platform.h +++ b/polymer/eduke32/source/jaudiolib/platform.h @@ -5,10 +5,6 @@ #define __EXPORT__ #endif -#if (defined __WATCOMC__) -#define snprintf _snprintf -#endif - static __inline uint16_t _swap16(uint16_t D) { #if PLATFORM_MACOSX diff --git a/polymer/eduke32/source/jaudiolib/sdlmusic.c b/polymer/eduke32/source/jaudiolib/sdlmusic.c index fb3fba86b..367e820dc 100644 --- a/polymer/eduke32/source/jaudiolib/sdlmusic.c +++ b/polymer/eduke32/source/jaudiolib/sdlmusic.c @@ -37,7 +37,7 @@ Adapted to work with JonoF's port by James Bentler (bentler@cs.umn.edu) #include "duke3d.h" #include "cache1d.h" -#if (!defined __WATCOMC__) +#ifndef _MSC_VER #define cdecl #endif diff --git a/polymer/eduke32/source/jaudiolib/sdlout.c b/polymer/eduke32/source/jaudiolib/sdlout.c index 0f86da8ec..66b2284ef 100644 --- a/polymer/eduke32/source/jaudiolib/sdlout.c +++ b/polymer/eduke32/source/jaudiolib/sdlout.c @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "sdlayer.h" -#if defined(__WATCOMC__) || defined(_MSC_VER) +#if defined(_MSC_VER) #include #endif diff --git a/polymer/eduke32/source/jmact/animlib.h b/polymer/eduke32/source/jmact/animlib.h index 9ec530d83..12945b589 100644 --- a/polymer/eduke32/source/jmact/animlib.h +++ b/polymer/eduke32/source/jmact/animlib.h @@ -37,23 +37,11 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com) extern "C" { #endif -#ifdef __GNUC__ -# ifndef PACKED -# define PACKED __attribute__ ((packed)) -# endif -#else -# define PACKED -# ifdef _MSC_VER -# pragma pack(1) -# endif -# ifdef __WATCOMC__ -# pragma pack(push,1); -# endif -#endif +# pragma pack(push,1) // structure declarations for deluxe animate large page files */ -typedef struct PACKED +typedef struct { uint32_t id; // 4 character ID == "LPF " */ uint16_t maxLps; // max # largePages allowed. 256 FOR NOW. */ @@ -89,7 +77,7 @@ typedef struct PACKED } lpfileheader; // this is the format of a large page structure -typedef struct PACKED +typedef struct { uint16_t baseRecord; // Number of first record in this large page. uint16_t nRecords; // Number of records in lp. @@ -98,13 +86,7 @@ typedef struct PACKED uint16_t nBytes; // Total number of bytes of contents, excluding header. } lp_descriptor; -#undef PACKED -#ifdef _MSC_VER -# pragma pack() -#endif -#ifdef __WATCOMC__ -# pragma pack(pop); -#endif +#pragma pack(pop) typedef struct { diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 7fa5bf963..7438abc00 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -69,15 +69,15 @@ void CONTROL_GetMouseDelta(void) { static int32_t lastx = 0, lasty = 0; - CONTROL_MouseAxes[0].analog = (((x + lastx) / 2.0f) * 4.0f * CONTROL_MouseSensitivity); - CONTROL_MouseAxes[1].analog = (((y + lasty) / 2.0f) * 4.0f * CONTROL_MouseSensitivity) * 2.0f; + CONTROL_MouseAxes[0].analog = (int32_t)(((x + lastx) / 2.0f) * 4.0f * CONTROL_MouseSensitivity); + CONTROL_MouseAxes[1].analog = (int32_t)((((y + lasty) / 2.0f) * 4.0f * CONTROL_MouseSensitivity) * 2.0f); lastx = x; lasty = y; return; } - CONTROL_MouseAxes[0].analog = (x * 4.0f * CONTROL_MouseSensitivity); - CONTROL_MouseAxes[1].analog = (y * 4.0f * CONTROL_MouseSensitivity) * 2.0f; + CONTROL_MouseAxes[0].analog = (int32_t)(x * 4.0f * CONTROL_MouseSensitivity); + CONTROL_MouseAxes[1].analog = (int32_t)((y * 4.0f * CONTROL_MouseSensitivity) * 2.0f); } int32_t CONTROL_StartMouse(void) diff --git a/polymer/eduke32/source/jmact/scriplib.c b/polymer/eduke32/source/jmact/scriplib.c index d5f471dc4..343b2b135 100644 --- a/polymer/eduke32/source/jmact/scriplib.c +++ b/polymer/eduke32/source/jmact/scriplib.c @@ -43,11 +43,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#ifdef __WATCOMC__ -#include -#endif - - static script_t *scriptfiles[MAXSCRIPTFILES]; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 37ea7c15d..6f008bcb0 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -4627,9 +4627,7 @@ cheat_for_port_credits: S_SoundShutdown(); S_MusicShutdown(); - initprintf("Initializing music...\n"); S_MusicStartup(); - initprintf("Initializing sound...\n"); S_SoundStartup(); FX_StopAllSounds(); diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index ad26d0946..b8f8572b2 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -38,7 +38,7 @@ float r_ambientlight = 1.0, r_ambientlightrecip = 1.0; extern int32_t althud_numbertile, althud_numberpal, althud_shadows, althud_flashing, hud_glowingquotes; extern int32_t hud_showmapname; extern int32_t r_maxfps; -extern int32_t g_frameDelay; +extern uint32_t g_frameDelay; static inline int32_t osdcmd_quit(const osdfuncparm_t *parm) { @@ -416,9 +416,7 @@ static int32_t osdcmd_restartsound(const osdfuncparm_t *parm) S_SoundShutdown(); S_MusicShutdown(); - initprintf("Initializing music...\n"); S_MusicStartup(); - initprintf("Initializing sound...\n"); S_SoundStartup(); FX_StopAllSounds(); diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 6d2b5975f..018dc26d3 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -4456,12 +4456,12 @@ void P_ProcessInput(int32_t snum) { if (p->on_ground == 1) { - /* - if (p->dummyplayersprite == -1) - p->dummyplayersprite = - A_Spawn(pi,PLAYERONWATER); - sprite[p->dummyplayersprite].pal = sprite[p->i].pal; - */ + if (p->dummyplayersprite == -1) + p->dummyplayersprite = + A_Spawn(pi,PLAYERONWATER); + sprite[p->dummyplayersprite].pal = sprite[p->i].pal; + sprite[p->dummyplayersprite].cstat |= 32768; + p->footprintcount = 6; if (sector[p->cursectnum].floorpicnum == FLOORSLIME) p->footprintpal = 8; @@ -5184,8 +5184,25 @@ SHOOTINCODE: } if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_GLOWS) + { p->random_club_frame += 64; // Glowing + if (p->kickback_pic == 0) + { + spritetype *s = &sprite[p->i]; + int32_t x = ((sintable[(s->ang+512)&2047])>>7), y = ((sintable[(s->ang)&2047])>>7); + int32_t r = 1024+(sintable[p->random_club_frame&2047]>>3); + + s->x += x; + s->y += y; + G_AddGameLight(0, p->i, PHEIGHT, max(r, 0), aplWeaponFlashColor[p->curr_weapon][snum],PR_LIGHT_PRIO_HIGH_GAME); + ActorExtra[p->i].lightcount = 2; + s->x -= x; + s->y -= y; + } + + } + // this is a hack for WEAPON_FIREEVERYOTHER if (ActorExtra[p->i].temp_data[7]) { diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index ef18270db..863caa55f 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -57,6 +57,8 @@ void S_SoundStartup(void) // if they chose None lets return if (ud.config.FXDevice < 0) return; + initprintf("Initializing sound...\n"); + RETRY: status = FX_Init(ud.config.FXDevice, ud.config.NumVoices, ud.config.NumChannels, ud.config.NumBits, ud.config.MixRate); if (status == FX_Ok) @@ -130,6 +132,8 @@ void S_MusicStartup(void) if (ud.config.MusicDevice < 0) return; + initprintf("Initializing music...\n"); + status = MUSIC_Init(ud.config.MusicDevice, 0); if (status == MUSIC_Ok) diff --git a/polymer/eduke32/source/sounds_mapster32.c b/polymer/eduke32/source/sounds_mapster32.c index 745eddfd1..2473e34b8 100644 --- a/polymer/eduke32/source/sounds_mapster32.c +++ b/polymer/eduke32/source/sounds_mapster32.c @@ -52,7 +52,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MUSICANDSFX 5 static char SM32_havesound = 0; + +#pragma pack(push,1) extern sound_t g_sounds[MAXSOUNDS]; +#pragma pack(pop) + char SoundToggle = 1; int32_t NumVoices = 32; diff --git a/polymer/eduke32/source/sounds_mapster32.h b/polymer/eduke32/source/sounds_mapster32.h index 3fe18365c..d213f538d 100644 --- a/polymer/eduke32/source/sounds_mapster32.h +++ b/polymer/eduke32/source/sounds_mapster32.h @@ -3,6 +3,8 @@ #include "build.h" +#pragma pack(push,1) + /// vvv sound structs from duke3d.h typedef struct { int32_t voice; @@ -32,6 +34,8 @@ int32_t A_CheckSoundPlaying(int32_t i, int32_t num); int32_t S_CheckSoundPlaying(int32_t i, int32_t num); void S_ClearSoundLocks(void); +#pragma pack(pop) + #define MAXSOUNDS 2560 #endif diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index bbbca0481..22455b0cf 100644 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -136,6 +136,7 @@ static void PopulateForm(int32_t pgs) if (pgs & POPULATE_CONFIG) { +/* struct audioenumdev *d; char *n; @@ -164,16 +165,13 @@ static void PopulateForm(int32_t pgs) d = d->next; } } +*/ Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED)); Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCAUTOLOAD), (!(settings.flags & 4) ? BST_CHECKED : BST_UNCHECKED)); - /* - Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCINPUTMOUSE), (settings.usemouse ? BST_CHECKED : BST_UNCHECKED)); - Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCINPUTJOY), (settings.usejoy ? BST_CHECKED : BST_UNCHECKED)); - */ { - char *s[] = { "Keyboard only", "Keyboard and mouse", "Keyboard and joystick", "All supported devices" }; + static const char *s[] = { "Keyboard only", "Keyboard and mouse", "Keyboard and joystick", "All supported devices" }; hwnd = GetDlgItem(pages[TAB_CONFIG], IDCINPUT); @@ -198,7 +196,7 @@ static void PopulateForm(int32_t pgs) { struct grpfile *fg; int32_t i, j; - char buf[128+BMAX_PATH]; + char buf[1024]; hwnd = GetDlgItem(pages[TAB_CONFIG], IDCDATA);