ref: 61d6c987e9f4c792d403175f955a6878f772b1c8
parent: 75027eef32d44f1dca82f61aae4e981b59735340
author: unknown <fabien@fabien-PC.(none)>
date: Sat Dec 15 11:52:23 EST 2012
Removed more MMX specific code. Cleaned a.c.
--- a/Engine/src/a.c
+++ b/Engine/src/a.c
@@ -17,14 +17,6 @@
extern int32_t asm3;
extern int32_t asm4;
-
-/* #pragma aux mmxoverlay modify [eax ebx ecx edx] */
-int32_t mmxoverlay(void)
-{
- return 0;
-} /* mmxoverlay */
-
-/* #pragma aux sethlinesizes parm [eax][ebx][ecx] */
static uint8_t machxbits_al;
static uint8_t machxbits_bl;
static int32_t machxbits_ecx;
@@ -33,7 +25,7 @@
machxbits_al = i1;
machxbits_bl = i2;
machxbits_ecx = i3;
-} /* sethlinesizes */
+}
static uint8_t* pal_eax;
void setuphlineasm4(int32_t i1, int32_t i2) { }
@@ -255,7 +247,7 @@
return i4;
} /* tvlineasm1 */
-/* #pragma aux setuptvlineasm2 parm [eax][ebx][ecx] */
+
static uint8_t tran2shr;
static uint32_t tran2pal_ebx;
static uint32_t tran2pal_ecx;
@@ -685,6 +677,8 @@
}
+
+
static int32_t slopemach_ebx;
static int32_t slopemach_ecx;
static int32_t slopemach_edx;
@@ -711,6 +705,8 @@
#define low32(a) ((a&0xffffffff))
#define high32(a) ((int)(((__int64)a&(__int64)0xffffffff00000000)>>32))
+
+
/* #pragma aux slopevlin parm [eax][ebx][ecx][edx][esi][edi] */
//FCS: Render RENDER_SLOPPED_CEILING_AND_FLOOR
void slopevlin(int32_t i1, uint32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6)
@@ -773,17 +769,10 @@
ebx = asm4;
ebx -= 8; // BITSOFPRECISIONPOW
} while ((int32_t)ebx > 0);
-} /* slopevlin */
+}
-void settransnormal(void)
-{
- transrev = 0;
-}
-
-void settransreverse(void)
-{
- transrev = 1;
-}
-
+void settrans(int32_t type){
+ transrev = type;
+}
\ No newline at end of file
--- a/Engine/src/a.h
+++ b/Engine/src/a.h
@@ -18,7 +18,7 @@
extern "C" {
#endif
-int32_t mmxoverlay(void);
+
int32_t sethlinesizes(int32_t,int32_t,int32_t);
int32_t setpalookupaddress(uint8_t *);
int32_t setuphlineasm4(int32_t,int32_t);
@@ -56,8 +56,9 @@
int32_t tsethlineshift(int32_t,int32_t);
int32_t setupslopevlin(int32_t,int32_t,int32_t);
int32_t slopevlin(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
-int32_t settransnormal(void);
-int32_t settransreverse(void);
+#define TRANS_NORMAL 0
+#define TRANS_REVERSE 1
+int32_t settrans(int32_t type);
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -820,11 +820,11 @@
msethlineshift(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4);
break;
case 256:
- settransnormal();
+ settrans(TRANS_NORMAL);
tsethlineshift(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4);
break;
case 384:
- settransreverse();
+ settrans(TRANS_REVERSE);
tsethlineshift(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4);
break;
}
@@ -1022,11 +1022,11 @@
msethlineshift(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4);
break;
case 256:
- settransnormal();
+ settrans(TRANS_NORMAL);
tsethlineshift(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4);
break;
case 384:
- settransreverse();
+ settrans(TRANS_REVERSE);
tsethlineshift(picsiz[globalpicnum]&15,picsiz[globalpicnum]>>4);
break;
}
@@ -3320,25 +3320,13 @@
Error(EXIT_SUCCESS, "");
}
return(_setgamemode(davidoption, daxdim, daydim));
-} /* setgamemode */
+}
-static int dommxoverlay = 1;
+
static int initengine_called = 0;
-void setmmxoverlay(int isenabled)
-{
- if (!initengine_called)
- dommxoverlay = (isenabled) ? 1 : 0;
-} /* setmmxoverlay */
-
-int getmmxoverlay(void)
-{
- return(dommxoverlay);
-} /* getmmxoverlay */
-
-
void initengine(void)
{
int32_t i;
@@ -3347,9 +3335,6 @@
initengine_called = 1;
- if (dommxoverlay)
- mmxoverlay();
-
loadtables();
xyaspect = -1;
@@ -3881,8 +3866,11 @@
else
{
tsetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
- if (dastat&32) settransreverse();
- else settransnormal();
+
+ if (dastat&32)
+ settrans(TRANS_REVERSE);
+ else
+ settrans(TRANS_NORMAL);
}
for(x=x1; x<x2; x++)
@@ -4534,8 +4522,10 @@
{
if (globalorientation&128)
{
- if (globalorientation&512) settransreverse();
- else settransnormal();
+ if (globalorientation&512)
+ settrans(TRANS_REVERSE);
+ else
+ settrans(TRANS_NORMAL);
}
transmaskwallscan(xb1[z],xb2[z]);
}
@@ -4653,8 +4643,11 @@
globalshade = tspr->shade;
if (cstat&2)
{
- if (cstat&512) settransreverse();
- else settransnormal();
+
+ if (cstat&512)
+ settrans(TRANS_REVERSE);
+ else
+ settrans(TRANS_NORMAL);
}
xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)tspr->xoffset);
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -53,8 +53,8 @@
int changespritesect(short spritenum, short newsectnum);
int changespritestat(short spritenum, short newstatnum);
void loadtile(short tilenume);
-void setmmxoverlay(int isenabled);
-int getmmxoverlay(void);
+
+
void nextpage(void);
void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
short daang, int32_t dahoriz, short dacursectnum);
--- a/Engine/src/engine_protos.h
+++ b/Engine/src/engine_protos.h
@@ -109,8 +109,8 @@
extern int loadboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
extern int saveboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
extern int setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
-extern void setmmxoverlay(int isenabled);
-extern int getmmxoverlay(void);
+
+
extern void initengine(void);
extern void uninitengine(void);
extern void nextpage(void);
--- a/Game/src/game.c
+++ b/Game/src/game.c
@@ -8320,7 +8320,7 @@
_platform_init(argc, argv, "Duke Nukem 3D", "Duke3D");
#endif
- setmmxoverlay(getenv("BUILD_NOPENTIUM") == NULL);
+
todd[0] = 'T';
sixteen[0] = 'D';