ref: fc4cce01b309c727b4dc2d1d1ea72f095e48cf57
parent: 96c70e5e518e872c6a00084a6ce502e9d22d11e3
parent: fb269372da684591c4dde27d9284cfe4243a56e1
author: unknown <fabien@fabien-PC.(none)>
date: Thu Dec 13 18:19:53 EST 2012
Fixed build. Both platforms are now good.
--- a/Engine/src/cache1d.c
+++ b/Engine/src/cache1d.c
@@ -89,8 +89,8 @@
if ((unsigned)newbytes > (unsigned)cachesize)
{
- printf("Cachesize: %ld\n",cachesize);
- printf("*Newhandle: 0x%x, Newbytes: %ld, *Newlock: %d\n",(unsigned int)newhandle,newbytes,*newlockptr);
+ printf("Cachesize: %d\n",cachesize);
+ printf("*Newhandle: 0x%x, Newbytes: %d, *Newlock: %d\n",(unsigned int)newhandle,newbytes,*newlockptr);
reportandexit("BUFFER TOO BIG TO FIT IN CACHE!\n");
}
@@ -210,15 +210,15 @@
j = 0;
for(i=0;i<cacnum;i++)
{
- printf("%ld- ",i);
- printf("ptr: 0x%lx, ",*cac[i].hand);
- printf("leng: %ld, ",cac[i].leng);
+ printf("%d- ",i);
+ printf("ptr: 0x%x, ",*cac[i].hand);
+ printf("leng: %d, ",cac[i].leng);
printf("lock: %d\n",*cac[i].lock);
j += cac[i].leng;
}
- printf("Cachesize = %ld\n",cachesize);
- printf("Cacnum = %ld\n",cacnum);
- printf("Cache length sum = %ld\n",j);
+ printf("Cachesize = %d\n",cachesize);
+ printf("Cacnum = %d\n",cacnum);
+ printf("Cache length sum = %d\n",j);
printf("ERROR: %s",errormessage);
Error(EXIT_FAILURE, "");
}
@@ -265,7 +265,7 @@
-int32_t initgroupfile(const uint8_t *filename)
+int32_t initgroupfile(const char *filename)
{
uint8_t buf[16];
int32_t i, j, k;
@@ -833,7 +833,7 @@
return((int32_t )shortptr[0]); /* uncompleng */
}
-
+int SafeFileExists ( const char * _filename );
int32_t TCkopen4load(const char *filename, int readfromGRP)
{
char fullfilename[512];
@@ -854,7 +854,7 @@
if(g_CV_DebugFileAccess != 0)
{
- printf("FILE ACCESS: [read] File: (%s) Result: %ld, clock: %ld\n", fullfilename, result, totalclock);
+ printf("FILE ACCESS: [read] File: (%s) Result: %d, clock: %d\n", fullfilename, result, totalclock);
}
return result;
--- a/Engine/src/cache1d.h
+++ b/Engine/src/cache1d.h
@@ -25,7 +25,7 @@
void suckcache (int32_t *suckptr);
void agecache(void);
void reportandexit(char *errormessage);
-int32_t initgroupfile(const uint8_t *filename);
+int32_t initgroupfile(const char *filename);
void uninitgroupfile(void);
unsigned short crc16(uint8_t *data_p, unsigned short length);
unsigned int crc32_update(uint8_t *buf, unsigned int length, unsigned int crc_to_update);
--- a/Engine/src/enet/include/enet.h
+++ b/Engine/src/enet/include/enet.h
@@ -394,7 +394,7 @@
@retval 0 on success
@retval < 0 on failure
*/
-extern int enet_address_get_host (const ENetAddress *address, uint8_t *hostName, size_t nameLength );
+extern int enet_address_get_host (const ENetAddress *address, char *hostName, size_t nameLength );
/** @} */
--- a/Engine/src/enet/unix.c
+++ b/Engine/src/enet/unix.c
@@ -94,7 +94,7 @@
}
int
-enet_address_get_host (const ENetAddress * address, uint8_t * name, size_t nameLength)
+enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength)
{
struct in_addr in;
struct hostent * hostEntry = NULL;
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -69,7 +69,7 @@
static uint8_t globalpolytype;
static short *dotp1[MAXYDIM], *dotp2[MAXYDIM];
-static uint8_t tempbuf[MAXWALLS];
+static char tempbuf[MAXWALLS];
int32_t ebpbak, espbak;
int32_t slopalookup[16384];
@@ -2675,7 +2675,7 @@
}
-int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
+int saveboard(char *filename, int32_t *daposx, int32_t *daposy,
int32_t *daposz, short *daang, short *dacursectnum)
{
int fil;
@@ -2973,10 +2973,8 @@
{
int32_t i;
-#ifdef SUPERBUILD
- int32_t j;
-#endif
+
initengine_called = 1;
if (dommxoverlay)
@@ -2991,16 +2989,6 @@
parallaxtype = 2; parallaxyoffs = 0L; parallaxyscale = 65536;
showinvisibility = 0;
-#ifdef SUPERBUILD
- for(i=1;i<1024;i++) lowrecip[i] = ((1<<24)-1)/i;
- for(i=0;i<MAXVOXELS;i++)
- for(j=0;j<MAXVOXMIPS;j++)
- {
- voxoff[i][j] = 0L;
- voxlock[i][j] = 200;
- }
-#endif
-
paletteloaded = 0;
searchit = 0; searchstat = -1;
@@ -3236,7 +3224,11 @@
{
if (((a&1023) == 0) && (ysiz <= 256)) /* vlineasm4 has 256 high limit! */
{
- if (dastat&64) setupvlineasm(24L); else setupmvlineasm(24L);
+ if (dastat&64)
+ setupvlineasm(24L);
+ else
+ setupmvlineasm(24L);
+
by <<= 8; yv <<= 8; yv2 <<= 8;
palookupoffse[0] = palookupoffse[1] = palookupoffse[2] = palookupoffse[3] = palookupoffs;
@@ -3403,13 +3395,28 @@
/* x,y1 */
bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1;
- if (dastat&64) { if (qlinemode) rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,0L ,by<<16,ylookup[y1]+x+frameplace);
- else rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
- } else rmhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
+ if (dastat&64)
+ {
+ if (qlinemode)
+ rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,0L ,by<<16,ylookup[y1]+x+frameplace);
+ else
+ rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
+ }
+ else
+ rmhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
}
- if (x == x2-1) { bx += xv2; by += yv2; break; }
+ if (x == x2-1)
+ {
+ bx += xv2;
+ by += yv2;
+ break;
+ }
+
y1 = uplc[x+1];
- if (((dastat&8) == 0) && (startumost[x+1] > y1)) y1 = startumost[x+1];
+
+ if (((dastat&8) == 0) && (startumost[x+1] > y1))
+ y1 = startumost[x+1];
+
y2 = y1;
}
bx += xv2; by += yv2;
@@ -3431,9 +3438,9 @@
if ((dastat&1) == 0)
{
if (dastat&64)
- setupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
+ setupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
else
- msetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
+ msetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
}
else
{
@@ -3440,6 +3447,7 @@
tsetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
if (dastat&32) settransreverse(); else settransnormal();
}
+
for(x=x1;x<x2;x++)
{
bx += xv2; by += yv2;
@@ -3454,10 +3462,23 @@
switch(y1-oy)
{
- case -1: bx -= xv; by -= yv; oy = y1; break;
- case 0: break;
- case 1: bx += xv; by += yv; oy = y1; break;
- default: bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1; break;
+ case -1:
+ bx -= xv;
+ by -= yv;
+ oy = y1;
+ break;
+ case 0:
+ break;
+ case 1:
+ bx += xv;
+ by += yv;
+ oy = y1;
+ break;
+ default:
+ bx += xv*(y1-oy);
+ by += yv*(y1-oy);
+ oy = y1;
+ break;
}
p = ylookup[y1]+x+frameplace;
@@ -3465,14 +3486,14 @@
if ((dastat&1) == 0)
{
if (dastat&64)
- spritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
+ spritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
else
- mspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
+ mspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
}
else
{
- tspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
- transarea += (y2-y1);
+ tspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
+ transarea += (y2-y1);
}
faketimerhandler();
}
@@ -3490,23 +3511,7 @@
{
int32_t i;
permfifotype *per;
- /* int32_t j,k; */
-#if 0
- uint8_t snotbuf[32];
- j = 0; k = 0;
- for(i=0;i<4096;i++)
- if (waloff[i] != 0)
- {
- sprintf(snotbuf,"%ld-%ld",i,tilesizx[i]*tilesizy[i]);
- printext256((j>>5)*40+32,(j&31)*6,walock[i]>>3,-1,snotbuf,1);
- k += tilesizx[i]*tilesizy[i];
- j++;
- }
- sprintf(snotbuf,"Total: %ld",k);
- printext256((j>>5)*40+32,(j&31)*6,31,-1,snotbuf,1);
-#endif
-
if (qsetmode == 200)
{
for(i=permtail;i!=permhead;i=((i+1)&(MAXPERMS-1)))
@@ -3618,6 +3623,7 @@
int loadpics(char *filename, char * gamedir)
+
{
int32_t offscount, localtilestart, localtileend, dasiz;
short fil, i, j, k;
@@ -6947,7 +6953,8 @@
permhead = permtail = 0;
}
-
+// Render a sprite on screen. This is used by the Engine but also the Game module
+// when drawing the HUD or the Weapon held by the player !!!
void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum,
int8_t dashade, uint8_t dapalnum, uint8_t dastat,
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2)
@@ -7158,7 +7165,7 @@
VBE_setPalette(0, 256, (uint8_t *) tempbuf);
}
-
+//This is only used by drawmapview.
static void fillpolygon(int32_t npoints)
{
int32_t z, zz, x1, y1, x2, y2, miny, maxy, y, xinc, cnt;
@@ -7802,7 +7809,8 @@
/* DRAWROOMS TO TILE BACKUP&SET CODE */
tilesizx[tilenume] = xsiz; tilesizy[tilenume] = ysiz;
bakxsiz[setviewcnt] = xsiz; bakysiz[setviewcnt] = ysiz;
- bakvidoption[setviewcnt] = vidoption; vidoption = 2;
+ bakvidoption[setviewcnt] = vidoption;
+ vidoption = 2;
bakframeplace[setviewcnt] = frameplace; frameplace = waloff[tilenume];
bakwindowx1[setviewcnt] = windowx1; bakwindowy1[setviewcnt] = windowy1;
bakwindowx2[setviewcnt] = windowx2; bakwindowy2[setviewcnt] = windowy2;
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -67,8 +67,9 @@
uint8_t name[82], uint8_t fontsize);
void initengine(void);
void uninitengine(void);
+
int loadpics(char *filename, char * gamedir);
-int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
+int saveboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
short *daang, short *dacursectnum);
void plotpixel(int32_t x, int32_t y, uint8_t col);
uint8_t getpixel(int32_t x, int32_t y);
--- a/Engine/src/engine_protos.h
+++ b/Engine/src/engine_protos.h
@@ -30,7 +30,7 @@
extern void suckcache(int32_t *suckptr);
extern void agecache(void);
extern void reportandexit(char *errormessage);
-extern int32_t initgroupfile(const uint8_t *filename);
+extern int32_t initgroupfile(const char *filename);
extern void uninitgroupfile(void);
extern int32_t kopen4load(const char *filename,int readfromGRP);
extern int32_t kread(int32_t handle, void *buffer, int32_t leng);
@@ -85,24 +85,7 @@
extern void restore256_palette(void);
extern uint32_t getticks(void);
-/* mmulti.c */
-// converted to function pointers
-/*
-void (*callcommit)(void);
-void (*initcrc)(void);
-int32_t (*getcrc)(uint8_t *buffer, short bufleng);
-void (*initmultiplayers)(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
-void (*sendpacket)(int32_t other, uint8_t *bufptr, int32_t messleng);
-void (*setpackettimeout)(int32_t datimeoutcount, int32_t daresendagaincount);
-void (*uninitmultiplayers)(void);
-void (*sendlogon)(void);
-void (*sendlogoff)(void);
-int (*getoutputcirclesize)(void);
-void (*setsocket)(short newsocket);
-short (*getpacket)(short *other, uint8_t *bufptr);
-void (*flushpackets)(void);
-void (*genericmultifunction)(int32_t other, uint8_t *bufptr, int32_t messleng, int32_t command);
-*/
+
void callcommit(void);
void initcrc(void);
int32_t getcrc(uint8_t *buffer, short bufleng);
@@ -124,7 +107,7 @@
extern int wallfront(int32_t l1, int32_t l2);
extern void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, short daang, int32_t dahoriz, short dacursectnum);
extern int loadboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
-extern int saveboard(uint8_t *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);
--- a/Engine/src/mmulti_stable.cpp
+++ b/Engine/src/mmulti_stable.cpp
@@ -487,7 +487,7 @@
for(i = 0; i < gcom->numplayers-1; ++i)
{
ENetPeer *peer;
- uint8_t szHostName[64];
+ char szHostName[64];
address.host = allowed_addresses[i].host; //ip;
@@ -710,7 +710,7 @@
address.host = pEvent->peer->address.host; //ip;
address.port = pEvent->peer->address.port; //m_nPort;
- uint8_t szHostName[64];
+ char szHostName[64];
enet_address_get_host(&address, szHostName, 64);
printf("Connection Established with: (%s)\n", szHostName);
--- a/Engine/src/pragmas.c
+++ b/Engine/src/pragmas.c
@@ -11,7 +11,7 @@
void clearbuf(void *d, int32_t c, int32_t a)
{
- int32_t *p = (long*)d;
+ int32_t *p = (int32_t*)d;
while ((c--) > 0) *(p++) = a;
}
@@ -29,7 +29,7 @@
void copybuf(void *s, void *d, int32_t c)
{
- int32_t *p = (long*)s, *q = (long*)d;
+ int32_t *p = (int32_t*)s, *q = (int32_t*)d;
while ((c--) > 0) *(q++) = *(p++);
}
@@ -45,13 +45,13 @@
while((c--) > 0) *(q++) = *(p--);
}
-void qinterpolatedown16(long* bufptr, int32_t num, int32_t val, int32_t add)
+void qinterpolatedown16(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
{ // gee, I wonder who could have provided this...
int32_t i, *lptr = bufptr;
for(i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
}
-void qinterpolatedown16short(long* bufptr, int32_t num, int32_t val, int32_t add)
+void qinterpolatedown16short(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
{ // ...maybe the same person who provided this too?
int32_t i; short *sptr = (short *)bufptr;
for(i=0;i<num;i++) { sptr[i] = (short)(val>>16); val += add; }
--- a/Engine/src/pragmas.h
+++ b/Engine/src/pragmas.h
@@ -157,8 +157,8 @@
void clearbufbyte(void *D, int32_t c, int32_t a);
void copybufbyte(void *S, void *D, int32_t c);
-void qinterpolatedown16 (long* bufptr, int32_t num, int32_t val, int32_t add);
-void qinterpolatedown16short (long* bufptr, int32_t num, int32_t val, int32_t add);
+void qinterpolatedown16 (int32_t* bufptr, int32_t num, int32_t val, int32_t add);
+void qinterpolatedown16short (int32_t* bufptr, int32_t num, int32_t val, int32_t add);
#endif /* !defined _INCLUDE_PRAGMAS_H_ */
--- a/Engine/src/sdl_driver.c
+++ b/Engine/src/sdl_driver.c
@@ -355,8 +355,8 @@
void set_sdl_renderer(void);
-static __inline void __out_sdldebug(const uint8_t *subsystem,
- const uint8_t *fmt, va_list ap)
+static __inline void __out_sdldebug(const char *subsystem,
+ const char *fmt, va_list ap)
{
fprintf(_sdl_debug_file, "%s: ", subsystem);
vfprintf(_sdl_debug_file, fmt, ap);
@@ -365,7 +365,7 @@
} /* __out_sdldebug */
-static void sdldebug(const uint8_t *fmt, ...)
+static void sdldebug(const char *fmt, ...)
{
va_list ap;
@@ -393,9 +393,9 @@
#endif
-static void __append_sdl_surface_flag(SDL_Surface *_surface, uint8_t *str,
+static void __append_sdl_surface_flag(SDL_Surface *_surface, char *str,
size_t strsize, Uint32 flag,
- const uint8_t *flagstr)
+ const char *flagstr)
{
if (_surface->flags & flag)
{
@@ -413,7 +413,7 @@
static void output_surface_info(SDL_Surface *_surface)
{
const SDL_VideoInfo *info;
- uint8_t f[256];
+ char f[256];
if (!_sdl_debug_file)
return;
@@ -471,7 +471,7 @@
static void output_driver_info(void)
{
- uint8_t buffer[256];
+ char buffer[256];
if (!_sdl_debug_file)
return;
@@ -889,7 +889,7 @@
static SDL_Joystick *joystick = NULL;
void _joystick_init(void)
{
- const uint8_t *envr = getenv(BUILD_SDLJOYSTICK);
+ const char *envr = getenv(BUILD_SDLJOYSTICK);
int favored = 0;
int numsticks;
int i;
@@ -923,7 +923,7 @@
for (i = 0; i < numsticks; i++)
{
- const uint8_t *stickname = SDL_JoystickName(i);
+ const char *stickname = SDL_JoystickName(i);
if ((envr != NULL) && (strcmp(envr, stickname) == 0))
favored = i;
@@ -1010,7 +1010,7 @@
static __inline void init_debugging(void)
{
- const uint8_t *envr = getenv(BUILD_SDLDEBUG);
+ const char *envr = getenv(BUILD_SDLDEBUG);
debug_hall_of_mirrors = (getenv(BUILD_HALLOFMIRRORS) != NULL);
@@ -1067,7 +1067,7 @@
void set_sdl_renderer(void)
{
- const uint8_t *envr = getenv(BUILD_RENDERER);
+ const char *envr = getenv(BUILD_RENDERER);
#ifdef USE_OPENGL
int need_opengl_lib = 0;
--- a/Game/src/_functio.h
+++ b/Game/src/_functio.h
@@ -37,7 +37,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-uint8_t * gamefunctions[] =
+char * gamefunctions[] =
{
"Move_Forward",
"Move_Backward",
@@ -102,9 +102,9 @@
// if not found and use default keys.
struct {
- uint8_t * entryKey;
- uint8_t * keyname1;
- uint8_t * keyname2;
+ char * entryKey;
+ char * keyname1;
+ char * keyname2;
} keydefaults[] = {
{ "Move_Forward", "Up", "Kpad8" },
{ "Move_Backward", "Down", "Kpad2" },
--- a/Game/src/_rts.h
+++ b/Game/src/_rts.h
@@ -33,7 +33,7 @@
typedef struct
{
- uint8_t name[8];
+ char name[8];
int32 handle,position,size;
} lumpinfo_t;
@@ -48,7 +48,7 @@
{
int32 filepos;
int32 size;
- uint8_t name[8];
+ char name[8];
} filelump_t;
#endif
--- a/Game/src/animlib.c
+++ b/Game/src/animlib.c
@@ -55,7 +55,7 @@
//
//****************************************************************************
-void CheckAnimStarted ( uint8_t * funcname )
+void CheckAnimStarted ( char * funcname )
{
if (!Anim_Started)
Error(EXIT_FAILURE, "ANIMLIB_%s: Anim has not been initialized\n",funcname);
--- a/Game/src/audiolib/dsl.c
+++ b/Game/src/audiolib/dsl.c
@@ -133,7 +133,6 @@
int MixMode, void ( *CallBackFunc )( void ) )
{
Uint16 format;
- Uint8 *tmp;
int channels;
int chunksize;
int blah;
--- a/Game/src/audiolib/fx_man.c
+++ b/Game/src/audiolib/fx_man.c
@@ -34,6 +34,7 @@
#include "multivoc.h"
+
#include "dsl.h"
#include "ll_man.h"
@@ -81,42 +82,9 @@
"(c) Copyright 1995 James R. Dose. All Rights Reserved.\n";
break;
-#ifdef PLAT_DOS
- case FX_BlasterError :
- ErrorString = BLASTER_ErrorString( BLASTER_Error );
- break;
-#endif
case FX_SoundCardError :
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- ErrorString = BLASTER_ErrorString( BLASTER_Error );
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- ErrorString = PAS_ErrorString( PAS_Error );
- break;
-
- case SoundScape :
- ErrorString = SOUNDSCAPE_ErrorString( SOUNDSCAPE_Error );
- break;
-
- case UltraSound :
- ErrorString = GUSWAVE_ErrorString( GUSWAVE_Error );
- break;
-
- case SoundSource :
- case TandySoundSource :
- ErrorString = SS_ErrorString( SS_Error );
- break;
- }
-#else
ErrorString = DSL_ErrorString( DSL_Error );
-#endif
break;
case FX_InvalidCard :
@@ -167,88 +135,7 @@
status = FX_Ok;
FX_SetErrorCode( FX_Ok );
-#ifdef PLAT_DOS
- switch( SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- DeviceStatus = BLASTER_Init();
- if ( DeviceStatus != BLASTER_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
- device->MaxVoices = 32;
- BLASTER_GetCardInfo( &device->MaxSampleBits, &device->MaxChannels );
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- DeviceStatus = PAS_Init();
- if ( DeviceStatus != PAS_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
-
- device->MaxVoices = 32;
- PAS_GetCardInfo( &device->MaxSampleBits, &device->MaxChannels );
- break;
-
- case GenMidi :
- case SoundCanvas :
- case WaveBlaster :
- device->MaxVoices = 0;
- device->MaxSampleBits = 0;
- device->MaxChannels = 0;
- break;
-
- case SoundScape :
- device->MaxVoices = 32;
- DeviceStatus = SOUNDSCAPE_GetCardInfo( &device->MaxSampleBits,
- &device->MaxChannels );
- if ( DeviceStatus != SOUNDSCAPE_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- }
- break;
-
- case UltraSound :
- if ( GUSWAVE_Init( 8 ) != GUSWAVE_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
-
- device->MaxVoices = 8;
- device->MaxSampleBits = 0;
- device->MaxChannels = 0;
- break;
-
- case SoundSource :
- case TandySoundSource :
- DeviceStatus = SS_Init( SoundCard );
- if ( DeviceStatus != SS_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
- SS_Shutdown();
- device->MaxVoices = 32;
- device->MaxSampleBits = 8;
- device->MaxChannels = 1;
- break;
- default :
- FX_SetErrorCode( FX_InvalidCard );
- status = FX_Error;
- }
-#else
DeviceStatus = DSL_Init();
if ( DeviceStatus != DSL_Ok )
{
@@ -261,8 +148,8 @@
device->MaxSampleBits = 0;
device->MaxChannels = 0;
}
-#endif
+
return( status );
}
@@ -279,28 +166,7 @@
)
{
-#ifdef PLAT_DOS
- int status;
- BLASTER_CONFIG Blaster;
- FX_SetErrorCode( FX_Ok );
-
- status = BLASTER_GetEnv( &Blaster );
- if ( status != BLASTER_Ok )
- {
- FX_SetErrorCode( FX_BlasterError );
- return( FX_Error );
- }
-
- blaster->Type = Blaster.Type;
- blaster->Address = Blaster.Address;
- blaster->Interrupt = Blaster.Interrupt;
- blaster->Dma8 = Blaster.Dma8;
- blaster->Dma16 = Blaster.Dma16;
- blaster->Midi = Blaster.Midi;
- blaster->Emu = Blaster.Emu;
-#endif
-
return( FX_Ok );
}
@@ -320,35 +186,8 @@
)
{
-#ifdef PLAT_DOS
- int DeviceStatus;
- BLASTER_CONFIG Blaster;
- FX_SetErrorCode( FX_Ok );
- FX_SoundDevice = SoundBlaster;
-
- Blaster.Type = blaster.Type;
- Blaster.Address = blaster.Address;
- Blaster.Interrupt = blaster.Interrupt;
- Blaster.Dma8 = blaster.Dma8;
- Blaster.Dma16 = blaster.Dma16;
- Blaster.Midi = blaster.Midi;
- Blaster.Emu = blaster.Emu;
-
- BLASTER_SetCardSettings( Blaster );
-
- DeviceStatus = BLASTER_Init();
- if ( DeviceStatus != BLASTER_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- return( FX_Error );
- }
-
- *MaxVoices = 8;
- BLASTER_GetCardInfo( MaxSampleBits, MaxChannels );
-#endif
-
return( FX_Ok );
}
@@ -525,59 +364,11 @@
Sets the volume of the current sound device.
---------------------------------------------------------------------*/
-void FX_SetVolume
- (
- int volume
- )
-
+void FX_SetVolume(int volume)
{
- int status;
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- if ( BLASTER_CardHasMixer() )
- {
- BLASTER_SetVoiceVolume( volume );
- }
- else
- {
- MV_SetVolume( volume );
- }
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- status = PAS_SetPCMVolume( volume );
- if ( status != PAS_Ok )
- {
- MV_SetVolume( volume );
- }
- break;
-
- case GenMidi :
- case SoundCanvas :
- case WaveBlaster :
- break;
-
- case SoundScape :
- MV_SetVolume( volume );
- break;
-
- case UltraSound :
- GUSWAVE_SetVolume( volume );
- break;
-
- case SoundSource :
- case TandySoundSource :
- MV_SetVolume( volume );
- break;
- }
-#else
MV_SetVolume( volume );
-#endif
+
}
@@ -587,64 +378,14 @@
Returns the volume of the current sound device.
---------------------------------------------------------------------*/
-int FX_GetVolume
- (
- void
- )
-
+int FX_GetVolume(void)
{
int volume;
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- if ( BLASTER_CardHasMixer() )
- {
- volume = BLASTER_GetVoiceVolume();
- }
- else
- {
- volume = MV_GetVolume();
- }
- break;
- case ProAudioSpectrum :
- case SoundMan16 :
- volume = PAS_GetPCMVolume();
- if ( volume == PAS_Error )
- {
- volume = MV_GetVolume();
- }
- break;
-
- case GenMidi :
- case SoundCanvas :
- case WaveBlaster :
- volume = 255;
- break;
-
- case SoundScape :
- volume = MV_GetVolume();
- break;
-
- case UltraSound :
- volume = GUSWAVE_GetVolume();
- break;
-
- case SoundSource :
- case TandySoundSource :
- volume = MV_GetVolume();
- break;
-
- default :
- volume = 0;
- }
-#else
volume = MV_GetVolume();
-#endif
+
return( volume );
}
@@ -655,10 +396,7 @@
Set the orientation of the left and right channels.
---------------------------------------------------------------------*/
-void FX_SetReverseStereo
- (
- int setting
- )
+void FX_SetReverseStereo(int setting)
{
MV_SetReverseStereo( setting );
@@ -671,10 +409,7 @@
Returns the orientation of the left and right channels.
---------------------------------------------------------------------*/
-int FX_GetReverseStereo
- (
- void
- )
+int FX_GetReverseStereo(void)
{
return MV_GetReverseStereo();
--- a/Game/src/config.c
+++ b/Game/src/config.c
@@ -81,7 +81,7 @@
int32 mouseSensitivity_X;
int32 mouseSensitivity_Y;
-static uint8_t setupfilename[512];//={SETUPFILENAME};
+static char setupfilename[512];//={SETUPFILENAME};
static int32 scripthandle;
static int32 setupread=0;
/*
@@ -149,7 +149,7 @@
===================
*/
-int32 CONFIG_FunctionNameToNum( uint8_t * func )
+int32 CONFIG_FunctionNameToNum( char * func )
{
int32 i;
@@ -192,7 +192,7 @@
*/
-int32 CONFIG_AnalogNameToNum( uint8_t * func )
+int32 CONFIG_AnalogNameToNum( char * func )
{
if (!stricmp(func,"analog_turning"))
@@ -295,8 +295,8 @@
int32 i;
int32 numkeyentries;
int32 function;
- uint8_t keyname1[80];
- uint8_t keyname2[80];
+ char keyname1[80];
+ char keyname2[80];
kb_scancode key1,key2;
// set default keys in case duke3d.cfg was not found
@@ -356,18 +356,18 @@
void CONFIG_SetupMouse( int32 scripthandle )
{
int32 i;
- uint8_t str[80];
- uint8_t temp[80];
+ char str[80];
+ char temp[80];
int32 function, scale;
for (i=0;i<MAXMOUSEBUTTONS;i++)
{
- sprintf(str,"MouseButton%ld",i);
+ sprintf(str,"MouseButton%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
CONTROL_MapButton( function, i, false );
- sprintf(str,"MouseButtonClicked%ld",i);
+ sprintf(str,"MouseButtonClicked%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -376,7 +376,7 @@
// map over the axes
for (i=0;i<MAXMOUSEAXES;i++)
{
- sprintf(str,"MouseAnalogAxes%ld",i);
+ sprintf(str,"MouseAnalogAxes%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_AnalogNameToNum(temp);
@@ -385,17 +385,17 @@
//TODO Fix the Analog mouse axis issue. Just make a new function for registering them.
//CONTROL_MapAnalogAxis(i,function);
}
- sprintf(str,"MouseDigitalAxes%ld_0",i);
+ sprintf(str,"MouseDigitalAxes%d_0",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
CONTROL_MapDigitalAxis( i, function, 0 );
- sprintf(str,"MouseDigitalAxes%ld_1",i);
+ sprintf(str,"MouseDigitalAxes%d_1",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
CONTROL_MapDigitalAxis( i, function, 1 );
- sprintf(str,"MouseAnalogScale%ld",i);
+ sprintf(str,"MouseAnalogScale%d",i);
SCRIPT_GetNumber(scripthandle, "Controls", str,&scale);
//TODO: Fix the Analog mouse scale issue. Just make a new function for registering them.
//CONTROL_SetAnalogAxisScale( i, scale );
@@ -424,20 +424,20 @@
void CONFIG_SetupGamePad( int32 scripthandle )
{
int32 i;
- uint8_t str[80];
- uint8_t temp[80];
+ char str[80];
+ char temp[80];
int32 function;
for (i=0;i<MAXJOYBUTTONS;i++)
{
- sprintf(str,"JoystickButton%ld",i);
+ sprintf(str,"JoystickButton%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapButton( function, i, false );
- sprintf(str,"JoystickButtonClicked%ld",i);
+ sprintf(str,"JoystickButtonClicked%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -447,13 +447,13 @@
// map over the axes
for (i=0;i<MAXGAMEPADAXES;i++)
{
- sprintf(str,"GamePadDigitalAxes%ld_0",i);
+ sprintf(str,"GamePadDigitalAxes%d_0",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapDigitalAxis( i, function, 0 );
- sprintf(str,"GamePadDigitalAxes%ld_1",i);
+ sprintf(str,"GamePadDigitalAxes%d_1",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -475,20 +475,20 @@
void CONFIG_SetupJoystick( int32 scripthandle )
{
int32 i, j;
- uint8_t str[80];
- uint8_t temp[80];
+ char str[80];
+ char temp[80];
int32 function, deadzone;
float scale;
for (i=0;i<MAXJOYBUTTONS;i++)
{
- sprintf(str,"JoystickButton%ld",i);
+ sprintf(str,"JoystickButton%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapJoyButton( function, i, false );
- sprintf(str,"JoystickButtonClicked%ld",i);
+ sprintf(str,"JoystickButtonClicked%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -498,7 +498,7 @@
// map over the axes
for (i=0;i<MAXJOYAXES;i++)
{
- sprintf(str,"JoystickAnalogAxes%ld",i);
+ sprintf(str,"JoystickAnalogAxes%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_AnalogNameToNum(temp);
@@ -506,23 +506,23 @@
//{
CONTROL_MapAnalogAxis(i,function);
//}
- sprintf(str,"JoystickDigitalAxes%ld_0",i);
+ sprintf(str,"JoystickDigitalAxes%d_0",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapDigitalAxis( i, function, 0 );
- sprintf(str,"JoystickDigitalAxes%ld_1",i);
+ sprintf(str,"JoystickDigitalAxes%d_1",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapDigitalAxis( i, function, 1 );
- sprintf(str,"JoystickAnalogScale%ld",i);
+ sprintf(str,"JoystickAnalogScale%d",i);
SCRIPT_GetFloat(scripthandle, "Controls", str,&scale);
CONTROL_SetAnalogAxisScale( i, scale );
deadzone = 0;
- sprintf(str,"JoystickAnalogDeadzone%ld",i);
+ sprintf(str,"JoystickAnalogDeadzone%d",i);
SCRIPT_GetNumber(scripthandle, "Controls", str, &deadzone);
CONTROL_SetAnalogAxisDeadzone( i, deadzone);
}
@@ -532,7 +532,7 @@
{
for(j=0; j < 8; j++) // 8? because hats can have 8 different values
{
- sprintf(str,"JoystickHat%ld_%ld",i, j);
+ sprintf(str,"JoystickHat%d_%d",i, j);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -556,7 +556,7 @@
short i;
uint8_t fn[] = "game_.sav";
FILE *fil;
- uint8_t fullpathsavefilename[16];
+ char fullpathsavefilename[16];
for (i=0;i<10;i++)
@@ -605,7 +605,7 @@
void CONFIG_ReadSetup( void )
{
int32 dummy;
- uint8_t commmacro[] = COMMMACRO;
+ char commmacro[] = COMMMACRO;
FILE* setup_file_hdl;
printf("CONFIG_ReadSetup...\n");
@@ -629,13 +629,8 @@
SCRIPT_GetString( scripthandle, "Comm Setup",commmacro,ud.ridecule[dummy]);
}
-// /* DDOI - Check version */
-// if (!SCRIPT_GetNumber( scripthandle, "Misc", "UseOldVersion", &dukever13))
-// dukever13 = 0; // assume 1.5
-//#ifdef VOLUMEONE
-// dukever13 = 1;
-//#endif
+
SCRIPT_GetString( scripthandle, "Comm Setup","PlayerName",&myname[0]);
dummy = CheckParm("NAME");
@@ -811,7 +806,7 @@
void CONFIG_WriteSetup( void )
{
int32 dummy, i;
- uint8_t commmacro[] = COMMMACRO;
+ char commmacro[] = COMMMACRO;
if (!setupread) return;
@@ -864,7 +859,7 @@
for (i=0;i<MAXMOUSEAXES*2;i++)
{
- sprintf((uint8_t *)tempbuf, "MouseDigitalAxes%ld_%d", i>>1, i&1);
+ sprintf((uint8_t *)tempbuf, "MouseDigitalAxes%d_%d", i>>1, i&1);
SCRIPT_PutString(scripthandle, "Controls", (uint8_t *)tempbuf,
(MouseDigitalAxeMapping[i>>1][i&1]!=-1)?CONFIG_FunctionNumToName(MouseDigitalAxeMapping[i>>1][i&1]):"");
}
@@ -881,7 +876,7 @@
for(dummy=0;dummy<10;dummy++)
{
- sprintf(buf,"WeaponChoice%ld",dummy);
+ sprintf(buf,"WeaponChoice%d",dummy);
SCRIPT_PutNumber( scripthandle, "Misc",buf,ud.mywchoice[dummy],false,false);
}
--- a/Game/src/console.c
+++ b/Game/src/console.c
@@ -16,19 +16,19 @@
typedef struct console_element
{
- uint8_t text[MAX_CONSOLE_STRING_LENGTH];
+ char text[MAX_CONSOLE_STRING_LENGTH];
void* prev;
void* next;
}CONSOLEELEMENT;
// Private member functions
-void CONSOLE_InsertUsedCommand(const uint8_t * szUsedCommand);
+void CONSOLE_InsertUsedCommand(const char * szUsedCommand);
void CONSOLE_ClearUsedCommandList();
void CONSOLE_RecalculateDirtyBuffer();
// console argument tracker
int argc;
-uint8_t argv[MAX_CVAR_ARGS][MAX_CONSOLE_STRING_LENGTH];
+char argv[MAX_CVAR_ARGS][MAX_CONSOLE_STRING_LENGTH];
// Console entries, prepending linked list
CONSOLEELEMENT *console_buffer = NULL;
// Current viewed setion of the console
@@ -39,7 +39,7 @@
CONSOLEELEMENT *console_used_command_list_current = NULL;
// dirty buffer
-uint8_t dirty_buffer[MAX_CONSOLE_STRING_LENGTH];
+char dirty_buffer[MAX_CONSOLE_STRING_LENGTH];
// dirty buffer control vars
int console_cursor_pos = 0; //without spaces
@@ -92,7 +92,7 @@
void CONSOLE_ParseStartupScript()
{
// FIX_00017: heavy autoexec.cfg not needed anymore.
- uint8_t *sStartupScript = "startup.cfg";
+ char *sStartupScript = "startup.cfg";
FILE* fp = fopen(sStartupScript, "r");
@@ -99,7 +99,7 @@
// If the file exists
if(NULL != fp)
{
- uint8_t line[128];
+ char line[128];
memset(line, 0, 128);
while(fgets(line ,128-1, fp) != NULL)
@@ -114,7 +114,7 @@
void CONSOLE_HandleInput()
{
- uint8_t * lastKey;
+ char * lastKey;
int tmp;
if(g_CV_classic)
@@ -441,10 +441,10 @@
}
}
-void CONSOLE_ParseCommand(uint8_t * command)
+void CONSOLE_ParseCommand(char * command)
{
- uint8_t *cvar;
- uint8_t *token;
+ char *cvar;
+ char *token;
int i, numCvars;
argc = 0;
@@ -486,7 +486,7 @@
}
-void CONSOLE_InsertUsedCommand(const uint8_t * szUsedCommand)
+void CONSOLE_InsertUsedCommand(const char * szUsedCommand)
{
//create a new element in the list, and add it to the front
CONSOLEELEMENT *pElement = (CONSOLEELEMENT*)malloc(sizeof(CONSOLEELEMENT));
@@ -558,11 +558,11 @@
}
-void CONSOLE_Printf(const uint8_t *newmsg, ...)
+void CONSOLE_Printf(const char *newmsg, ...)
{
CONSOLEELEMENT *pElement;
va_list argptr;
- uint8_t msg[512];//[MAX_CONSOLE_STRING_LENGTH];
+ char msg[512];//[MAX_CONSOLE_STRING_LENGTH];
va_start (argptr,newmsg);
vsprintf (msg, newmsg, argptr);
va_end (argptr);
@@ -608,7 +608,7 @@
}
// Get the current list of args for this keyword
-uint8_t * CONSOLE_GetArgv(unsigned int var)
+char * CONSOLE_GetArgv(unsigned int var)
{
return argv[var];
}
--- a/Game/src/console.h
+++ b/Game/src/console.h
@@ -9,10 +9,10 @@
void CONSOLE_ParseStartupScript();
void CONSOLE_HandleInput();
void CONSOLE_Render();
-void CONSOLE_ParseCommand(uint8_t * command);
-void CONSOLE_Printf(const uint8_t *newmsg, ...);
+void CONSOLE_ParseCommand(char * command);
+void CONSOLE_Printf(const char *newmsg, ...);
int CONSOLE_GetArgc();
-uint8_t * CONSOLE_GetArgv(unsigned int var);
+char * CONSOLE_GetArgv(unsigned int var);
int CONSOLE_IsActive();
void CONSOLE_SetActive(int i);
--- a/Game/src/control.c
+++ b/Game/src/control.c
@@ -84,14 +84,7 @@
static float JoyAnalogScale[MAXJOYAXES];
static int32 JoyAnalogDeadzone[MAXJOYAXES];
-//Extern functions from SDLDriver.c:
-int _joystick_hat(int hat);
-void _joystick_deinit(void);
-void _joystick_init(void);
-int _joystick_button(int button);
-int _joystick_axis(int axis);
-int _joystick_update(void);
-//End of SDLDriver declaration
+
int ACTION(int i)
{
--- a/Game/src/cvar_defs.c
+++ b/Game/src/cvar_defs.c
@@ -15,6 +15,8 @@
//We need to access debug soundinfo
#include "sounddebugdefs.h"
+#include "joystick.h"
+
// Bind our Cvars at startup. You can still add bindings after this call, but
// it is recommanded that you bind your default CVars here.
void CVARDEFS_Init()
@@ -65,34 +67,33 @@
if(g_CV_DebugJoystick)
{
int i;
- uint8_t buf[128];
- minitext(2, 2, "Debug Joystick", 17,10+16);
+ char buf[128];
+ minitext(2, 2, "Debug Joystick", 17,10+16);
- for(i = 0; i < MAXJOYAXES; i++)
- {
- sprintf(buf, "Joystick Axis%d: Raw: %d Used:%d", i,
- _joystick_axis(i), CONTROL_GetFilteredAxisValue(i));
- minitext(2, (i*8)+12, buf, 23,10+16);
- }
+ for(i = 0; i < MAXJOYAXES; i++)
+ {
+ sprintf(buf, "Joystick Axis%d: Raw: %d Used:%d", i,_joystick_axis(i), CONTROL_GetFilteredAxisValue(i));
+ minitext(2, (i*8)+12, buf, 23,10+16);
+ }
- for(i = 0; i < MAXJOYBUTTONS; i++)
- {
- sprintf(buf, "Button%d: %d", i, _joystick_button(i));
- if(i < (MAXJOYBUTTONS/2))
- {
- minitext(2, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
- }
- else
- {
- minitext(55, ((i-16)*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
- }
- }
+ for(i = 0; i < MAXJOYBUTTONS; i++)
+ {
+ sprintf(buf, "Button%d: %d", i, _joystick_button(i));
+ if(i < (MAXJOYBUTTONS/2))
+ {
+ minitext(2, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
+ }
+ else
+ {
+ minitext(55, ((i-16)*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
+ }
+ }
- for(i = 0; i < MAXJOYHATS; i++)
- {
- sprintf(buf, "Hat%d: %d", i, _joystick_hat(i));
- minitext(110, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
- }
+ for(i = 0; i < MAXJOYHATS; i++)
+ {
+ sprintf(buf, "Hat%d: %d", i, _joystick_hat(i));
+ minitext(110, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
+ }
}
@@ -99,16 +100,16 @@
if(g_CV_DebugSound)
{
- uint8_t buf[128];
+ char buf[128];
minitext(2, 2, "Debug Sound", 17,10+16);
- sprintf(buf, "Active sounds: %lu", sounddebugActiveSounds);
+ sprintf(buf, "Active sounds: %u", sounddebugActiveSounds);
minitext(2, 10, buf, 23,10+16);
- sprintf(buf, "Allocate Calls: %lu", sounddebugAllocateSoundCalls);
+ sprintf(buf, "Allocate Calls: %u", sounddebugAllocateSoundCalls);
minitext(2, 18, buf, 23,10+16);
- sprintf(buf, "Deallocate Calls: %ld", sounddebugDeallocateSoundCalls);
+ sprintf(buf, "Deallocate Calls: %d", sounddebugDeallocateSoundCalls);
minitext(2, 26, buf, 23,10+16);
}
--- a/Game/src/cvars.c
+++ b/Game/src/cvars.c
@@ -9,7 +9,7 @@
cvar_binding cvar_binding_list[MAX_CVARS];
int num_cvar_bindings = 0;
-void CVAR_RegisterCvar(const uint8_t * varname, const uint8_t * varhelp, void* variable, function_t function)
+void CVAR_RegisterCvar(const char * varname, const char * varhelp, void* variable, function_t function)
{
if(NULL == function)
{
--- a/Game/src/cvars.h
+++ b/Game/src/cvars.h
@@ -14,14 +14,14 @@
typedef struct t_cvar_binding
{
- uint8_t name[64];
- uint8_t help[64];
+ char name[64];
+ char help[64];
void* variable;
function_t function;
} cvar_binding;
-void CVAR_RegisterCvar(const uint8_t * varname, const uint8_t * varhelp, void* variable, function_t function);
+void CVAR_RegisterCvar(const char * varname, const char * varhelp, void* variable, function_t function);
int CVAR_GetNumCvarBindings();
cvar_binding* CVAR_GetCvarBinding(unsigned int nBinding);
void CVAR_Render();
--- a/Game/src/duke3d.h
+++ b/Game/src/duke3d.h
@@ -355,7 +355,7 @@
typedef struct
{
- uint8_t *ptr;
+ char *ptr;
uint8_t lock;
int length, num;
} SAMPLE;
@@ -373,16 +373,16 @@
extern uint8_t MusicPtr[72000];
extern int32_t msx[2048],msy[2048];
extern short cyclers[MAXCYCLERS][6],numcyclers;
-extern uint8_t myname[2048];
+extern char myname[2048];
struct user_defs
{
uint8_t god,warp_on,cashman,eog,showallmap;
uint8_t show_help,scrollmode,clipping;
- uint8_t user_name[MAXPLAYERS][32];
- uint8_t ridecule[10][40];
- uint8_t savegame[10][22];
- uint8_t pwlockout[128],rtsname[128];
+ char user_name[MAXPLAYERS][32];
+ char ridecule[10][40];
+ char savegame[10][22];
+ char pwlockout[128],rtsname[128];
uint8_t overhead_on,last_overhead;
short pause_on,from_bonus;
@@ -529,9 +529,9 @@
extern short int global_random;
extern int32_t scaredfallz;
-extern uint8_t buf[80]; //My own generic input buffer
+extern char buf[80]; //My own generic input buffer
-extern uint8_t fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
+extern char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
extern uint8_t scantoasc[128],ready2send;
extern uint8_t scantoascwithshift[128];
@@ -542,10 +542,11 @@
extern SOUNDOWNER SoundOwner[NUM_SOUNDS][4];
extern uint8_t playerreadyflag[MAXPLAYERS],playerquitflag[MAXPLAYERS];
-extern uint8_t sounds[NUM_SOUNDS][14];
+extern char sounds[NUM_SOUNDS][14];
extern int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
-extern uint8_t *label,*textptr,error,warning,killit_flag;
+extern char *label,*textptr,error,warning;
+extern uint8_t killit_flag;
extern int32_t *actorscrptr[MAXTILES],*parsing_actor;
extern uint8_t actortype[MAXTILES];
extern uint8_t *music_pointer;
@@ -552,8 +553,9 @@
extern uint8_t ipath[80],opath[80];
-extern uint8_t music_fn[4][11][13],music_select;
-extern uint8_t env_music_fn[4][13];
+extern char music_fn[4][11][13];
+extern uint8_t music_select;
+extern char env_music_fn[4][13];
extern short camsprite;
// extern uint8_t gotz;
@@ -610,11 +612,11 @@
extern short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS];
extern uint8_t soundpr[NUM_SOUNDS],soundm[NUM_SOUNDS];
extern int32_t soundsiz[NUM_SOUNDS];
-extern uint8_t level_names[44][33];
+extern char level_names[44][33];
extern int32_t partime[44],designertime[44];
-extern uint8_t volume_names[4][33];
-extern uint8_t skill_names[5][33];
-extern uint8_t level_file_names[44][128];
+extern char volume_names[4][33];
+extern char skill_names[5][33];
+extern char level_file_names[44][128];
extern int32 SoundToggle,MusicToggle;
extern short last_threehundred,lastsavedpos;
@@ -622,7 +624,7 @@
extern short buttonstat;
extern int32_t cachecount;
-extern uint8_t boardfilename[128],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
+extern char boardfilename[128],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
extern uint8_t betaname[80];
extern uint8_t cachedebug,earthquaketime;
extern uint8_t networkmode;
--- a/Game/src/dukeunix.h
+++ b/Game/src/dukeunix.h
@@ -41,10 +41,10 @@
struct find_t
{
DIR *dir;
- uint8_t pattern[MAX_PATH];
- uint8_t name[MAX_PATH];
+ char pattern[MAX_PATH];
+ char name[MAX_PATH];
};
-int _dos_findfirst(uint8_t *filename, int x, struct find_t *f);
+int _dos_findfirst(char *filename, int x, struct find_t *f);
int _dos_findnext(struct find_t *f);
struct dosdate_t
@@ -65,7 +65,7 @@
#define max(x, y) ((x) > (y) ? (x) : (y))
#endif
-#define FP_OFF(x) ((int32_t) (x))
+
#ifndef strcmpi
#define strcmpi(x, y) strcasecmp(x, y)
--- a/Game/src/dummy_audiolib.c
+++ b/Game/src/dummy_audiolib.c
@@ -8,7 +8,8 @@
#include "audiolib/fx_man.h"
#include <inttypes.h>
-
+#include <stdio.h>
+#include "engine_protos.h"
/*
uint8_t *FX_ErrorString( int ErrorNumber ){
static uint8_t nope = '\0';
@@ -190,9 +191,22 @@
{
}
-void PlayMusic(short dummy)
+void PlayMusic(char* filename)
{
-
+ char magicNumber[5];
+ printf("Play music '%s'.\n",filename);
+ int32_t fd = kopen4load(filename,1);
+ if (fd > 0)
+ printf("Found the music size='%d'!\n",kfilelength(fd));
+
+ kread(fd, magicNumber, 4);
+ magicNumber[4] = 0;
+
+ //If midi this should be 'MThd' !
+ printf("Magic number='%s'!\n",magicNumber);
+
+
+ kclose(fd);
}
--- a/Game/src/funct.h
+++ b/Game/src/funct.h
@@ -45,7 +45,7 @@
//#line "sounds.c" 200
extern void intomenusounds(void );
//#line "sounds.c" 227
-extern void playmusic(uint8_t *fn);
+extern void playmusic(char *fn);
//#line "sounds.c" 251
extern uint8_t loadsound(unsigned short num);
//#line "sounds.c" 277
@@ -123,9 +123,9 @@
//#line "sector.c" 2766
extern void checksectors(short snum);
//#line "rts.c" 36
-extern void RTS_AddFile(uint8_t *filename);
+extern void RTS_AddFile(char *filename);
//#line "rts.c" 93
-extern void RTS_Init(uint8_t *filename);
+extern void RTS_Init(char *filename);
//#line "rts.c" 126
extern int32 RTS_NumSounds(void );
//#line "rts.c" 141
@@ -228,7 +228,7 @@
//#line "menues.c" 18
extern void cmenu(short cm);
//#line "menues.c" 38
-extern void savetemp(uint8_t *fn,int32_t daptr,int32_t dasiz);
+extern void savetemp(char *fn,int32_t daptr,int32_t dasiz);
//#line "menues.c" 49
extern void getangplayers(short snum);
//#line "menues.c" 67
@@ -243,9 +243,9 @@
extern int probe(int x,int y,int i,int n);
extern int probeXduke(int x,int y,int i,int n, int32_t spriteSize);
//#line "menues.c" 521
-extern int menutext(int x,int y,short s,short p,uint8_t *t);
+extern int menutext(int x,int y,short s,short p,char *t);
//#line "menues.c" 630
-extern int menutextc(int x,int y,short s,short p,uint8_t *t);
+extern int menutextc(int x,int y,short s,short p,char *t);
//#line "menues.c" 727
extern void bar(int x,int y,short *p,short dainc,uint8_t damodify,short s,short pa);
//#line "menues.c" 806
@@ -262,7 +262,7 @@
//#line "menues.c" 2436
extern void drawoverheadmap(int32_t cposx,int32_t cposy,int32_t czoom,short cang);
//#line "menues.c" 2685
-extern void playanm(uint8_t *fn,uint8_t );
+extern void playanm(char *fn,uint8_t );
//#line "gamedef.c" 122
extern short getincangle(short a,short na);
//#line "gamedef.c" 140
@@ -286,7 +286,7 @@
//#line "gamedef.c" 1227
extern void passone(int readfromGRP);
//#line "gamedef.c" 1239
-extern void loadefs(uint8_t *fn,uint8_t *mptr, int readfromGRP);
+extern void loadefs(char *fn,uint8_t *mptr, int readfromGRP);
//#line "gamedef.c" 1342
extern uint8_t dodge(spritetype *s);
//#line "gamedef.c" 1374
@@ -312,11 +312,11 @@
//#line "game.c" 81
extern void uninittimer(void );
//#line "game.c" 89
-extern int gametext(int x,int y,uint8_t *t,uint8_t s,short dabits);
+extern int gametext(int x,int y,char *t,uint8_t s,short dabits);
//#line "game.c" 136
-extern int gametextpart(int x,int y,uint8_t *t,uint8_t s,short p);
+extern int gametextpart(int x,int y,char *t,uint8_t s,short p);
//#line "game.c" 192
-extern int minitext(int x,int y,uint8_t *t,uint8_t p,uint8_t sb);
+extern int minitext(int x,int y,char *t,uint8_t p,uint8_t sb);
//#line "game.c" 231
extern void gamenumber(int32_t x,int32_t y,int32_t n,uint8_t s);
//#line "game.c" 248
@@ -375,7 +375,7 @@
//#line "game.c" 1691
extern void binscreen(void );
//#line "game.c" 1705
-extern void gameexit(uint8_t *t);
+extern void gameexit(char *t);
//#line "game.c" 1752
extern short strget(short x,short y,uint8_t *t,short dalen,short c);
//#line "game.c" 1819
@@ -475,11 +475,11 @@
//#line "config.c" 57
extern void CONFIG_GetSetupFilename(void );
//#line "config.c" 170
-extern int32 CONFIG_FunctionNameToNum(uint8_t *func);
+extern int32 CONFIG_FunctionNameToNum(char *func);
//#line "config.c" 192
extern uint8_t *CONFIG_FunctionNumToName(int32 func);
//#line "config.c" 211
-extern int32 CONFIG_AnalogNameToNum(uint8_t *func);
+extern int32 CONFIG_AnalogNameToNum(char *func);
//#line "config.c" 240
extern void CONFIG_SetDefaults(void );
//#line "config.c" 264
--- a/Game/src/function.h
+++ b/Game/src/function.h
@@ -40,7 +40,7 @@
#define NUMGAMEFUNCTIONS 55 //dont forget to check NUMKEYENTRIES
-extern uint8_t * gamefunctions[];
+extern char * gamefunctions[];
enum
{
--- a/Game/src/game.c
+++ b/Game/src/game.c
@@ -89,9 +89,10 @@
// For addfaz's stun server. use /stun to activate
unsigned short g_bStun = 0;
-uint8_t confilename[128] = {"GAME.CON"},boardfilename[128] = {0};
-uint8_t waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768];
-uint8_t firstdemofile[80] = { '\0' };
+char confilename[128] = {"GAME.CON"};
+char boardfilename[128] = {0};
+char waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768];
+char firstdemofile[80] = { '\0' };
#define patchstatusbar(x1,y1,x2,y2) \
{ \
@@ -149,10 +150,11 @@
}
#endif
-int gametext(int x,int y,uint8_t *t,uint8_t s,short dabits)
+int gametext(int x,int y,char *t,uint8_t s,short dabits)
{
short ac,newx;
- uint8_t centre, *oldt;
+ char* oldt;
+ uint8_t centre;
centre = ( x == (320>>1) );
newx = 0;
@@ -197,10 +199,11 @@
return (x);
}
-int gametextpal(int x,int y,uint8_t *t,uint8_t s,uint8_t p)
+int gametextpal(int x,int y,char *t,uint8_t s,uint8_t p)
{
short ac,newx;
- uint8_t centre, *oldt;
+ uint8_t centre;
+ char* oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -244,10 +247,11 @@
return (x);
}
-int gametextpart(int x,int y,uint8_t *t,uint8_t s,short p)
+int gametextpart(int x,int y,char *t,uint8_t s,short p)
{
short ac,newx, cnt;
- uint8_t centre, *oldt;
+ uint8_t centre;
+ char * oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -300,11 +304,11 @@
return (x);
}
-int minitext(int x,int y,uint8_t *str,uint8_t p,uint8_t sb)
+int minitext(int x,int y,char *str,uint8_t p,uint8_t sb)
{
short ac;
- uint8_t buf[128];
- uint8_t *t;
+ char buf[128];
+ char *t;
strncpy (buf, str, 128);
buf[127] = 0;
@@ -324,11 +328,11 @@
return (x);
}
-int minitextshade(int x,int y,uint8_t *str,uint8_t s,uint8_t p,uint8_t sb)
+int minitextshade(int x,int y,char *str,uint8_t s,uint8_t p,uint8_t sb)
{
short ac;
- uint8_t buf[128];
- uint8_t *t;
+ char buf[128];
+ char *t;
strncpy (buf, str, 128);
buf[127] = 0;
@@ -350,7 +354,7 @@
void gamenumber(int32_t x,int32_t y,int32_t n,uint8_t s)
{
- uint8_t b[10];
+ char b[10];
//
@@ -358,12 +362,12 @@
// is NON-STANDARD and equivalent to STANDARD
// (void) sprintf(buffer, "%ld", l);
//ltoa(n,b,10);
- sprintf(b,"%ld",n);
+ sprintf(b,"%d",n);
gametext(x,y,b,s,2+8+16);
}
-uint8_t recbuf[80];
+char recbuf[80];
void allowtimetocorrecterrorswhenquitting(void)
{
int32_t i, j, oldtotalclock;
@@ -392,7 +396,7 @@
uint8_t user_quote[MAXUSERQUOTES][128];
// uint8_t typebuflen,typebuf[41];
-static void adduserquote(uint8_t *daquote)
+static void adduserquote(char *daquote)
{
int32_t i;
@@ -424,7 +428,7 @@
uint8_t *grpVersion2char(uint8_t grp_to_identify)
{
- uint8_t *id;
+ char *id;
switch(grp_to_identify)
{
@@ -1421,8 +1425,8 @@
void invennum(int32_t x,int32_t y,uint8_t num1,uint8_t ha,uint8_t sbits)
{
- uint8_t dabuf[80] = {0};
- sprintf(dabuf,"%ld",num1);
+ char dabuf[80] = {0};
+ sprintf(dabuf,"%c",num1);
if(num1 > 99)
{
rotatesprite((x-4)<<16,y<<16,65536L,0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
@@ -2152,7 +2156,7 @@
void tics(short offx, short offy, short color)
{
int32_t i;
- uint8_t fps[512], mapname[512];
+ char fps[512], mapname[512];
int32_t currentFps;
static int32_t fpsAvg = 0, savedFps = 0;
static boolean toggle = true;
@@ -2200,7 +2204,7 @@
else
savedFps = fpsAvg;
- sprintf(fps," %ld", savedFps);
+ sprintf(fps," %d", savedFps);
strcat(tempbuf, fps);
minitext(offx,offy,tempbuf,color,2+8+16+128);
@@ -2373,7 +2377,7 @@
}
-void gameexit(uint8_t *msg)
+void gameexit(char *msg)
{
short i;
uint8_t t[256];
@@ -7677,7 +7681,7 @@
void compilecons(void)
{
- uint8_t userconfilename[512];
+ char userconfilename[512];
mymembuf = (uint8_t *)&hittype[0];
labelcode = (int32_t *)§or[0];
@@ -8031,7 +8035,7 @@
void copyprotect(void)
{
FILE *fp;
- uint8_t idfile[256];
+ char idfile[256];
return;
@@ -8437,13 +8441,7 @@
puts("Loading palette/lookups.");
-// CTW - MODIFICATION
-/* if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight) < 0 )
- {
- printf("\nVESA driver for ( %i * %i ) not found/supported!\n",xdim,ydim);
- vidoption = 2;
- setgamemode(vidoption,320,200);
- }*/
+
if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight) < 0 )
{
printf("\nVESA driver for ( %i * %i ) not found/supported!\n",xdim,ydim);
@@ -8452,15 +8450,11 @@
ScreenHeight = 200;
setgamemode(ScreenMode,ScreenWidth,ScreenHeight);
}
-// CTW END - MODIFICATION
+
printf("genspriteremaps()\n");
genspriteremaps();
-//if (VOLUMEONE)
-// { if(numplayers > 4 || ud.multimode > 4)
-// gameexit(" The full version of Duke Nukem 3D supports 5 or more players.");
-// }
setbrightness(ud.brightness>>2,&ps[myconnectindex].palette[0]);
@@ -8708,7 +8702,7 @@
uint8_t *fname = d;
uint8_t ver;
short i,j;
- uint8_t firstdemofile_[512];
+
int32 dummy;
int32_t groupefil_crc32_from_demo[MAXGROUPFILES];
--- a/Game/src/gamedef.c
+++ b/Game/src/gamedef.c
@@ -30,7 +30,8 @@
extern short otherp;
static short total_lines,line_number;
-static uint8_t checking_ifelse,parsing_state,*last_used_text;
+static uint8_t checking_ifelse,parsing_state;
+char *last_used_text;
static short num_squigilly_brackets;
static int32_t last_used_size;
@@ -42,13 +43,13 @@
#define NUMKEYWORDS 112
//From global.c
-void FixFilePath(uint8_t *filename);
+void FixFilePath(char *filename);
//From actors.c
void lotsofmail(spritetype *s, short n);
void lotsofpaper(spritetype *s, short n);
-uint8_t *keyw[NUMKEYWORDS] =
+char *keyw[NUMKEYWORDS] =
{
"definelevelname", // 0
"actor", // 1 [#]
@@ -331,7 +332,7 @@
tempbuf[i] = 0;
for(i=0;i<NUMKEYWORDS;i++)
- if( strcmp( (const uint8_t *)tempbuf,keyw[i]) == 0 )
+ if( strcmp( (const char *)tempbuf,keyw[i]) == 0 )
return i;
return -1;
@@ -418,7 +419,7 @@
for(i=0;i<labelcnt;i++)
{
- if( strcmp((const uint8_t *)tempbuf,label+(i<<6)) == 0 )
+ if( strcmp((const char *)tempbuf,label+(i<<6)) == 0 )
{
*scriptptr = labelcode[i];
scriptptr++;
@@ -445,7 +446,9 @@
uint8_t parsecommand(int readfromGRP)
{
int32_t i, j, k, *tempscrptr;
- uint8_t done, *origtptr, temp_ifelse_check, tw;
+ uint8_t done, temp_ifelse_check;
+ int32_t tw;
+ char *origtptr;
short temp_line_number;
int fp;
@@ -467,7 +470,7 @@
if(*textptr == 0x0a) line_number++;
if( *textptr == 0 )
{
- printf(" * ERROR!(L%ld) Found '/*' with no '*/'.\n",j);
+ printf(" * ERROR!(L%d) Found '/*' with no '*/'.\n",j);
error++;
return 0;
}
@@ -698,7 +701,7 @@
return 0;
case 55: // include other con files.
{
- uint8_t includedconfile[512];
+ char includedconfile[512];
scriptptr--;
while( isaltok(*textptr) == 0 )
{
@@ -715,20 +718,8 @@
tempbuf[j] = '\0';
// fix path for unix. (doesn't really matter...)
- FixFilePath((uint8_t *)tempbuf);
-/*
- // Are we loading a TC?
- if(game_dir[0] != '\0')
- {
- // Yes
- sprintf(includedconfile, "%s\\%s", game_dir, tempbuf);
- }
- else
- {
- // No
- sprintf(includedconfile, "%s", tempbuf);
- }
-*/
+ FixFilePath((char *)tempbuf);
+
sprintf(includedconfile, "%s", tempbuf);
fp = TCkopen4load(includedconfile,readfromGRP);
@@ -1504,7 +1495,7 @@
}
-uint8_t *defaultcons[3] =
+char *defaultcons[3] =
{
"GAME.CON",
"USER.CON",
@@ -1548,7 +1539,7 @@
}
}
-void loadefs(uint8_t *filenam, uint8_t *mptr, int readfromGRP)
+void loadefs(char *filenam, uint8_t *mptr, int readfromGRP)
{
int32_t fs,fp;
uint8_t kbdKey;
--- a/Game/src/global.c
+++ b/Game/src/global.c
@@ -89,11 +89,11 @@
int32_t msx[2048],msy[2048];
short cyclers[MAXCYCLERS][6],numcyclers;
-uint8_t fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
+char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
uint8_t tempbuf[2048], packbuf[576];
-uint8_t buf[80];
+char buf[80];
short camsprite;
short mirrorwall[64], mirrorsector[64], mirrorcnt;
@@ -102,10 +102,11 @@
uint8_t betaname[80];
-uint8_t level_names[44][33],level_file_names[44][128];
+char level_names[44][33];
+char level_file_names[44][128];
int32_t partime[44],designertime[44];
-uint8_t volume_names[4][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY", "" }; // Names are not in 1.3 con files. MUST be in code.
-uint8_t skill_names[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD", "" };
+char volume_names[4][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY", "" }; // Names are not in 1.3 con files. MUST be in code.
+char skill_names[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD", "" };
volatile int32_t checksume;
int32_t soundsiz[NUM_SOUNDS];
@@ -112,7 +113,7 @@
short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS];
uint8_t soundm[NUM_SOUNDS],soundpr[NUM_SOUNDS];
-uint8_t sounds[NUM_SOUNDS][14];
+char sounds[NUM_SOUNDS][14];
short title_zoom;
@@ -155,7 +156,8 @@
int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
int32_t *actorscrptr[MAXTILES],*parsing_actor;
-uint8_t *label,*textptr,error,warning,killit_flag;
+char *label,*textptr,error,warning ;
+uint8_t killit_flag;
uint8_t *music_pointer;
uint8_t actortype[MAXTILES];
@@ -162,8 +164,9 @@
uint8_t display_mirror,typebuflen,typebuf[41];
-uint8_t music_fn[4][11][13],music_select;
-uint8_t env_music_fn[4][13];
+char music_fn[4][11][13];
+uint8_t music_select;
+char env_music_fn[4][13];
uint8_t rtsplaying;
@@ -200,7 +203,7 @@
int32_t myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
short myangbak[MOVEFIFOSIZ];
-uint8_t myname[2048] = {"XDUKE"};
+char myname[2048] = {"XDUKE"};
uint8_t camerashitable,freezerhurtowner=0,lasermode;
// CTW - MODIFICATION
// uint8_t networkmode = 255, movesperpacket = 1,gamequit = 0,playonten = 0,everyothertime;
@@ -221,7 +224,7 @@
// portability stuff. --ryan.
// A good portion of this was ripped from GPL'd Rise of the Triad. --ryan.
-void FixFilePath(uint8_t *filename)
+void FixFilePath(char *filename)
{
#if PLATFORM_UNIX
uint8_t *ptr;
@@ -334,9 +337,9 @@
}
#elif defined(PLATFORM_UNIX) || defined(PLATFORM_MACOSX)
-int _dos_findfirst(uint8_t *filename, int x, struct find_t *f)
+int _dos_findfirst(char *filename, int x, struct find_t *f)
{
- uint8_t *ptr;
+ char *ptr;
if (strlen(filename) >= sizeof (f->pattern))
return(1);
@@ -361,7 +364,7 @@
}
-static int check_pattern_nocase(const uint8_t *x, const uint8_t *y)
+static int check_pattern_nocase(const char *x, const char *y)
{
if ((x == NULL) || (y == NULL))
return(0); /* not a match. */
@@ -522,7 +525,7 @@
// usage: write2disk(__LINE__, __FILE__, "c:\temp\my_dbug_file.txt", uint8_t * msg);
int i, k=0;
- uint8_t filename[2048];
+ char filename[2048];
FILE *pFile;
for(i=0; cfilename[i]; i++)
@@ -542,7 +545,8 @@
int32 SafeOpenAppend (const char *_filename, int32 filetype)
{
int handle;
- uint8_t filename[MAX_PATH];
+ char filename[MAX_PATH];
+
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -596,10 +600,13 @@
return handle;
}
+
+
+
int32 SafeOpenRead (const char *_filename, int32 filetype)
{
int handle;
- uint8_t filename[MAX_PATH];
+ char filename[MAX_PATH];
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -642,7 +649,7 @@
}
}
-void SafeWriteString (int handle, uint8_t * buffer)
+void SafeWriteString (int handle, char * buffer)
{
unsigned iocount;
@@ -903,7 +910,7 @@
}
#endif
-uint8_t ApogeePath[256];
+char ApogeePath[256];
int setup_homedir (void)
{
@@ -927,7 +934,7 @@
}
-uint8_t CheckParm (uint8_t *check)
+uint8_t CheckParm (char *check)
{
int i;
for (i = 1; i < _argc; i++)
--- a/Game/src/joystick.h
+++ b/Game/src/joystick.h
@@ -4,8 +4,13 @@
extern "C" {
#endif
-void JOYSTICK_UpdateHats( void );
-
+ void JOYSTICK_UpdateHats( void );
+ void _joystick_deinit(void);
+ int _joystick_update(void);
+ int _joystick_axis(int axis);
+ int _joystick_hat(int hat);
+ int _joystick_button(int button);
+
#ifdef __cplusplus
};
--- a/Game/src/keyboard.c
+++ b/Game/src/keyboard.c
@@ -252,7 +252,7 @@
{ NULL, 0 }
};
-uint8_t *KB_ScanCodeToString( kb_scancode scancode )
+char *KB_ScanCodeToString( kb_scancode scancode )
{
int i;
for(i = 0; keyname2scancode[i].name != NULL; i++)
@@ -264,9 +264,9 @@
return NULL;
}
-kb_scancode KB_StringToScanCode( uint8_t * string )
+kb_scancode KB_StringToScanCode( char * string )
{
- uint8_t * name = NULL;
+ char * name = NULL;
int32 i=0;
name = keyname2scancode[i].name;
for(;name;++i, name=keyname2scancode[i].name)
--- a/Game/src/keyboard.h
+++ b/Game/src/keyboard.h
@@ -210,8 +210,8 @@
void KB_Addch( uint8_t ch ); // Adds key to end of queue
void KB_FlushKeyboardQueue( void ); // Empties the keyboard queue of all waiting characters.
void KB_ClearKeysDown( void ); // Clears all keys down flags.
-uint8_t * KB_ScanCodeToString( kb_scancode scancode ); // convert scancode into a string
-kb_scancode KB_StringToScanCode( uint8_t * string ); // convert a string into a scancode
+char * KB_ScanCodeToString( kb_scancode scancode ); // convert scancode into a string
+kb_scancode KB_StringToScanCode( char * string ); // convert a string into a scancode
void KB_TurnKeypadOn( void ); // turn the keypad on
void KB_TurnKeypadOff( void ); // turn the keypad off
boolean KB_KeypadActive( void ); // check whether keypad is active
--- a/Game/src/menues.c
+++ b/Game/src/menues.c
@@ -38,7 +38,8 @@
short probey=0,lastprobey=0,last_menu,globalskillsound=-1;
short sh,onbar,buttonstat,deletespot;
short last_zero,last_fifty,last_threehundred = 0;
-static uint8_t fileselect = 1, menunamecnt, menuname[256][17];
+static uint8_t fileselect = 1, menunamecnt;
+static char menuname[256][17];
// File tree info
//
@@ -146,7 +147,7 @@
}
-void savetemp(uint8_t *fn,int32_t daptr,int32_t dasiz)
+void savetemp(char *fn,int32_t daptr,int32_t dasiz)
{
int fp;
@@ -178,7 +179,7 @@
int loadpheader(uint8_t spot,int32 *vn,int32 *ln,int32 *psk,int32 *nump)
{
- uint8_t fn[] = "game0.sav";
+ char fn[] = "game0.sav";
int32_t fil;
int32_t bv;
@@ -542,12 +543,12 @@
int saveplayer(int8_t spot)
{
int32_t i, j;
- uint8_t fn[] = "game0.sav";
- uint8_t mpfn[] = "gameA_00.sav";
- uint8_t *fnptr,scriptptrs[MAXSCRIPTSIZE];
+ char fn[] = "game0.sav";
+ char mpfn[] = "gameA_00.sav";
+ char *fnptr,scriptptrs[MAXSCRIPTSIZE];
FILE *fil;
int32_t bv = BYTEVERSION;
- uint8_t fullpathsavefilename[16];
+ char fullpathsavefilename[16];
if(spot < 0)
{
@@ -903,7 +904,7 @@
}
}
-int menutext(int x,int y,short s,short p,uint8_t *t)
+int menutext(int x,int y,short s,short p,char *t)
{
short i, ac, centre;
@@ -1018,7 +1019,7 @@
return (x);
}
-int menutextc(int x,int y,short s,short p,uint8_t *t)
+int menutextc(int x,int y,short s,short p,char *t)
{
short i, ac, centre;
@@ -4121,20 +4122,20 @@
menutext(c,57-9,SHX(-2),PHX(-2),"GAME TYPE");
if (VOLUMEONE)
-{ sprintf(tempbuf,"EPISODE %ld",ud.m_volume_number+1);
+{ sprintf(tempbuf,"EPISODE %d",ud.m_volume_number+1);
menutext(c,57+16-9,SHX(-3),1,tempbuf);
}
else
{
- sprintf(tempbuf,"EPISODE %ld",ud.m_volume_number+1);
+ sprintf(tempbuf,"EPISODE %d",ud.m_volume_number+1);
menutext(c,57+16-9,SHX(-3),PHX(-3),tempbuf);
}
#ifndef ONELEVELDEMO
- sprintf(tempbuf,"LEVEL %ld",ud.m_level_number+1);
+ sprintf(tempbuf,"LEVEL %d",ud.m_level_number+1);
menutext(c,57+16+16-9,SHX(-4),PHX(-4),tempbuf);
#else
- sprintf(tempbuf,"LEVEL %ld",ud.m_level_number+1);
+ sprintf(tempbuf,"LEVEL %d",ud.m_level_number+1);
menutext(c,57+16+16-9,SHX(-4),1,tempbuf);
#endif
menutext(c,57+16+16+16-9,SHX(-5),PHX(-5),"MONSTERS");
@@ -4160,7 +4161,7 @@
menutext(c,57+16+16+16+16+16+16+16-9,SHX(-8),PHX(-8),"START GAME");
- break;
+ break;
}
if( (ps[myconnectindex].gm&MODE_MENU) != MODE_MENU)
@@ -4623,7 +4624,7 @@
int32_t lastanimhack=0;
-void playanm(uint8_t *fn,uint8_t t)
+void playanm(char *fn,uint8_t t)
{
uint8_t *animbuf, *palptr;
int32_t i, j, k, length=0, numframes=0;
--- a/Game/src/player.c
+++ b/Game/src/player.c
@@ -1301,6 +1301,8 @@
int8_t gs;
struct player_struct *p;
short *kb;
+
+
p = &ps[snum];
kb = &p->kickback_pic;
@@ -2619,12 +2621,12 @@
{
if(snum == screenpeek)
{
- sprintf(&fta_quotes[115][0],"KILLED BY PLAYER %ld",1+p->frag_ps);
+ sprintf(&fta_quotes[115][0],"KILLED BY PLAYER %d",1+p->frag_ps);
FTA(115,p,1);
}
else if(screenpeek == p->frag_ps)
{
- sprintf(&fta_quotes[116][0],"KILLED PLAYER %ld",1+snum);
+ sprintf(&fta_quotes[116][0],"KILLED PLAYER %d",1+snum);
FTA(116,&ps[p->frag_ps],1);
}
}
--- a/Game/src/premap.c
+++ b/Game/src/premap.c
@@ -552,7 +552,6 @@
void resetinventory(short snum)
{
struct player_struct *p;
- short i;
p = &ps[snum];
@@ -1073,7 +1072,7 @@
#define BOT_MAX_NAME 20
int bot_used[BOT_MAX_NAME] = { false };
- uint8_t *bot_names[] = { "* ELASTI",
+ char *bot_names[] = { "* ELASTI",
"* ^ZookeM^",
"* DOOM",
"* DRO",
@@ -1282,7 +1281,7 @@
{
int32_t j,fp;
int8_t look_pos;
- uint8_t *lookfn = "lookup.dat";
+ char *lookfn = "lookup.dat";
uint8_t numl;
fp = TCkopen4load(lookfn,0);
@@ -1444,8 +1443,8 @@
{
short i;
int32_t l;
- uint8_t levname[256];
- uint8_t fulllevelfilename[512];
+ char levname[256];
+ char fulllevelfilename[512];
KB_ClearKeyDown(sc_Pause); // avoid entering in pause mode.
--- a/Game/src/rts.c
+++ b/Game/src/rts.c
@@ -57,7 +57,7 @@
====================
*/
-void RTS_AddFile (uint8_t *filename)
+void RTS_AddFile (char *filename)
{
wadinfo_t header;
lumpinfo_t *lump_p;
@@ -114,7 +114,7 @@
====================
*/
-void RTS_Init (uint8_t *filename)
+void RTS_Init (char *filename)
{
int32 length;
//
--- a/Game/src/rts.h
+++ b/Game/src/rts.h
@@ -43,7 +43,7 @@
====================
*/
-void RTS_Init (uint8_t *filename);
+void RTS_Init (char *filename);
/*
====================
=
--- a/Game/src/scriplib.c
+++ b/Game/src/scriplib.c
@@ -50,10 +50,10 @@
typedef struct scriptnode_s {
struct scriptnode_s *child;
struct scriptnode_s *sibling;
- uint8_t *key;
+ char *key;
scriptflag_t type;
union {
- uint8_t *string[2];
+ char *string[2];
int number;
float floatnumber;
} data;
@@ -188,11 +188,11 @@
}
}
-static uint8_t *SCRIPT_copystring (uint8_t * s)
+static char *SCRIPT_copystring (char * s)
{
- uint8_t *ret;
+ char *ret;
- ret = (uint8_t *) malloc (strlen (s)+1);
+ ret = (char *) malloc (strlen (s)+1);
if (ret != NULL)
{
strcpy (ret, s);
@@ -200,7 +200,7 @@
return ret;
}
-static int SCRIPT_getnexttoken (uint8_t *buffer, uint8_t * token, int start)
+static int SCRIPT_getnexttoken (char *buffer, char * token, int start)
{
int iterator = start;
@@ -225,9 +225,9 @@
}
/* Fills in a scriptnode with the interpreted contents of a line */
-static void SCRIPT_parseline (uint8_t *curline, scriptnode_t *node)
+static void SCRIPT_parseline (char *curline, scriptnode_t *node)
{
- uint8_t token[128];
+ char token[128];
int i;
/* Needs to handle 5 cases: */
@@ -279,7 +279,7 @@
node->type = SCRIPTFLAG_DECIMAL;
node->data.number = -1;
}else if (token[0] == '"') {
- uint8_t workbuf[128];
+ char workbuf[128];
int r;
/* Found one of possibly two strings */
@@ -317,7 +317,7 @@
}
}
-static scriptnode_t *SCRIPT_findinchildren (scriptnode_t *parent, uint8_t *s)
+static scriptnode_t *SCRIPT_findinchildren (scriptnode_t *parent, char *s)
{
scriptnode_t *cur = parent;
@@ -374,7 +374,7 @@
==============
*/
-int32 SCRIPT_Parse ( uint8_t *data, int32 length, uint8_t * name )
+int32 SCRIPT_Parse ( uint8_t *data, int32 length, char * name )
{
STUBBED("Parse");
@@ -390,10 +390,10 @@
==============
*/
-int32 SCRIPT_Load ( uint8_t * filename )
+int32 SCRIPT_Load ( char * filename )
{
FILE *fp;
- uint8_t curline[128];
+ char curline[128];
scriptnode_t *headnode = NULL;
scriptnode_t *cur_subsection = NULL;
@@ -481,7 +481,7 @@
=
==============
*/
-void SCRIPT_Save (int32 scripthandle, uint8_t * filename)
+void SCRIPT_Save (int32 scripthandle, char* filename)
{
FILE *fp;
scriptnode_t *head;
@@ -538,7 +538,7 @@
==============
*/
-int32 SCRIPT_NumberEntries( int32 scripthandle, uint8_t * sectionname )
+int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname )
{
scriptnode_t *node = NULL;
int32 entries = 0;
@@ -566,7 +566,7 @@
=
==============
*/
-uint8_t * SCRIPT_Entry( int32 scripthandle, uint8_t * sectionname, int32 which )
+char * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which )
{
scriptnode_t *node = NULL;
int32 entrynum = 0;
@@ -599,7 +599,7 @@
=
==============
*/
-uint8_t * SCRIPT_GetRaw(int32 scripthandle, uint8_t * sectionname, uint8_t * entryname)
+char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname)
{
STUBBED("GetRaw");
@@ -616,9 +616,9 @@
void SCRIPT_GetString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest
+ char * sectionname,
+ char * entryname,
+ char * dest
)
{
scriptnode_t *cur;
@@ -650,10 +650,10 @@
void SCRIPT_GetDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest1,
- uint8_t * dest2
+ char * sectionname,
+ char * entryname,
+ char * dest1,
+ char * dest2
)
{
scriptnode_t *cur;
@@ -686,8 +686,8 @@
boolean SCRIPT_GetNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 * number
)
{
@@ -741,8 +741,8 @@
boolean SCRIPT_GetFloat
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
float * floatnumber
)
{
@@ -778,8 +778,8 @@
void SCRIPT_GetDouble
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
double * number
)
{
@@ -870,9 +870,9 @@
void SCRIPT_PutString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string
+ char * sectionname,
+ char * entryname,
+ char * string
)
{
scriptnode_t *head;
@@ -922,10 +922,10 @@
void SCRIPT_PutDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string1,
- uint8_t * string2
+ char * sectionname,
+ char * entryname,
+ char * string1,
+ char * string2
)
{
scriptnode_t *head;
@@ -977,8 +977,8 @@
void SCRIPT_PutNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 number,
boolean hexadecimal,
boolean defaultvalue
--- a/Game/src/scriplib.h
+++ b/Game/src/scriplib.h
@@ -59,7 +59,7 @@
==============
*/
-int32 SCRIPT_Parse ( uint8_t *data, int32 length, uint8_t * name );
+int32 SCRIPT_Parse ( uint8_t *data, int32 length, char * name );
/*
@@ -70,7 +70,7 @@
==============
*/
-int32 SCRIPT_Load ( uint8_t * filename );
+int32 SCRIPT_Load ( char * filename );
/*
==============
@@ -79,7 +79,7 @@
=
==============
*/
-void SCRIPT_Save (int32 scripthandle, uint8_t * filename);
+void SCRIPT_Save (int32 scripthandle, char * filename);
/*
@@ -110,7 +110,7 @@
==============
*/
-int32 SCRIPT_NumberEntries( int32 scripthandle, uint8_t * sectionname );
+int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname );
/*
==============
@@ -120,7 +120,7 @@
==============
*/
-uint8_t * SCRIPT_Entry( int32 scripthandle, uint8_t * sectionname, int32 which );
+char * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which );
/*
@@ -130,7 +130,7 @@
=
==============
*/
-uint8_t * SCRIPT_GetRaw(int32 scripthandle, uint8_t * sectionname, uint8_t * entryname);
+char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname);
/*
==============
@@ -142,9 +142,9 @@
void SCRIPT_GetString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest
+ char * sectionname,
+ char * entryname,
+ char * dest
);
/*
@@ -157,10 +157,10 @@
void SCRIPT_GetDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest1,
- uint8_t * dest2
+ char * sectionname,
+ char * entryname,
+ char * dest1,
+ char * dest2
);
/*
@@ -173,8 +173,8 @@
boolean SCRIPT_GetNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 * number
);
@@ -204,8 +204,8 @@
boolean SCRIPT_GetFloat
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
float * floatnumber
);
@@ -221,8 +221,8 @@
void SCRIPT_GetDouble
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
double * number
);
@@ -295,9 +295,9 @@
void SCRIPT_PutString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string
+ char * sectionname,
+ char * entryname,
+ char * string
);
/*
@@ -310,10 +310,10 @@
void SCRIPT_PutDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string1,
- uint8_t * string2
+ char * sectionname,
+ char * entryname,
+ char * string1,
+ char * string2
);
/*
@@ -326,8 +326,8 @@
void SCRIPT_PutNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 number,
boolean hexadecimal,
boolean defaultvalue
--- a/Game/src/sounds.c
+++ b/Game/src/sounds.c
@@ -252,7 +252,7 @@
menunum %= 17;
}
-void playmusic(uint8_t *fn)
+void playmusic(char *fn)
{
if(MusicToggle == 0) return;
if(MusicDevice == NumSoundCards) return;
@@ -259,7 +259,6 @@
// the SDL_mixer version does more or less this same thing. --ryan.
PlayMusic(fn);
-
}
uint8_t loadsound(unsigned short num)
--- a/Game/src/util_lib.h
+++ b/Game/src/util_lib.h
@@ -52,7 +52,7 @@
void RegisterShutdownFunction( void (* shutdown) (void) );
void Error (int errorType, char *error, ...);
-uint8_t CheckParm (uint8_t *check);
+uint8_t CheckParm (char *check);
void *SafeMalloc (int32 size);
int32 SafeMallocSize (void * ptr);