Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 300 → Rev 299

/programs/games/doom/trunk/kolibc/include/kolibri.h
File deleted
/programs/games/doom/trunk/kolibc/include/mf.h
File deleted
/programs/games/doom/trunk/kolibc/include/kolibc.h
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/mem/malloc.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/rewind.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fprintf.c
File deleted
/programs/games/doom/trunk/kolibc/src/file/fgetc.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fclose.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fseek.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/feof.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fwrite.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fscanf.c
File deleted
/programs/games/doom/trunk/kolibc/src/file/fputc.c
File deleted
/programs/games/doom/trunk/kolibc/src/file/fread.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fsetpos.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/ftell.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/file/fopen.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/doprnt.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/strncmp.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/string/doscan.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/strlen.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/strrchr.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/is.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/memchr.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/atoi.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/toupper.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/strupr.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/strncpy.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/string/istable.c
File deleted
/programs/games/doom/trunk/kolibc/src/string/strcpy.c
File deleted
\ No newline at end of file
/programs/games/doom/trunk/kolibc/src/string/sprintf.c
File deleted
/programs/games/doom/trunk/d_main.c
633,8 → 633,8
 
char *home;
char *doomwaddir;
// doomwaddir = getenv("DOOMWADDIR");
// if (!doomwaddir)
doomwaddir = getenv("DOOMWADDIR");
if (!doomwaddir)
doomwaddir = ".";
 
// Commercial.
666,8 → 666,8
doom2fwad = malloc(strlen(doomwaddir)+1+10+1);
sprintf(doom2fwad, "%s/doom2f.wad", doomwaddir);
 
// home = getenv("HOME");
// if (!home)
home = getenv("HOME");
if (!home)
home = ".";
sprintf(basedefault, "%s/doomrc.txt", home);
 
861,7 → 861,7
 
// I_BeginSplash();
 
// setbuf (stdout, NULL);
setbuf (stdout, NULL);
modifiedgame = false;
nomonsters = M_CheckParm ("-nomonsters");
1102,15 → 1102,15
// Iff additonal PWAD files are used, print modified banner
if (modifiedgame)
{
printf (
"===========================================================================\n"
"ATTENTION: This version of DOOM has been modified. If you would like to\n"
"get a copy of the original game, call 1-800-IDGAMES or see the readme file.\n"
" You will not receive technical support for modified games.\n"
" press enter to continue\n"
"===========================================================================\n"
);
// getchar ();
// __libclog_printf (
// "===========================================================================\n"
// "ATTENTION: This version of DOOM has been modified. If you would like to\n"
// "get a copy of the original game, call 1-800-IDGAMES or see the readme file.\n"
// " You will not receive technical support for modified games.\n"
// " press enter to continue\n"
// "===========================================================================\n"
// );
getchar ();
}
 
1119,21 → 1119,21
{
case shareware:
case indetermined:
printf (
"===========================================================================\n"
" Shareware!\n"
"===========================================================================\n"
);
// __libclog_printf (
// "===========================================================================\n"
// " Shareware!\n"
// "===========================================================================\n"
// );
break;
case registered:
case retail:
case commercial:
printf (
"===========================================================================\n"
" Commercial product - do not distribute!\n"
" Please report software piracy to the SPA: 1-800-388-PIR8\n"
"===========================================================================\n"
);
// __libclog_printf (
// "===========================================================================\n"
// " Commercial product - do not distribute!\n"
// " Please report software piracy to the SPA: 1-800-388-PIR8\n"
// "===========================================================================\n"
// );
break;
default:
1141,30 → 1141,30
break;
}
 
printf ("M_Init: Init miscellaneous info.\n");
// __libclog_printf ("M_Init: Init miscellaneous info.\n");
M_Init ();
 
printf ("R_Init: Init DOOM refresh daemon - ");
// __libclog_printf ("R_Init: Init DOOM refresh daemon - ");
R_Init ();
 
printf ("\nP_Init: Init Playloop state.\n");
// __libclog_printf ("\nP_Init: Init Playloop state.\n");
P_Init ();
 
printf ("I_Init: Setting up machine state.\n");
// __libclog_printf ("I_Init: Setting up machine state.\n");
I_Init ();
 
printf ("D_CheckNetGame: Checking network game status.\n");
// __libclog_printf ("D_CheckNetGame: Checking network game status.\n");
D_CheckNetGame ();
 
printf ("S_Init: Setting up sound.\n");
// __libclog_printf ("S_Init: Setting up sound.\n");
S_Init (snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ );
 
printf ("HU_Init: Setting up heads up display.\n");
// __libclog_printf ("HU_Init: Setting up heads up display.\n");
HU_Init ();
 
// I_EndSplash();
 
printf ("ST_Init: Init status bar.\n");
// __libclog_printf ("ST_Init: Init status bar.\n");
ST_Init ();
 
// check for a driver that wants intermission stats
/programs/games/doom/trunk/d_net.c
139,7 → 139,10
//
// HSendPacket
//
void HSendPacket (int node,int flags )
void
HSendPacket
(int node,
int flags )
{
netbuffer->checksum = NetbufferChecksum () | flags;
 
169,14 → 172,14
else
realretrans = -1;
 
printf ("send (%i + %i, R %i) [%i] ",
fprintf (debugfile,"send (%i + %i, R %i) [%i] ",
ExpandTics(netbuffer->starttic),
netbuffer->numtics, realretrans, doomcom->datalength);
for (i=0 ; i<doomcom->datalength ; i++)
printf ("%i ",((byte *)netbuffer)[i]);
fprintf (debugfile,"%i ",((byte *)netbuffer)[i]);
 
printf ("\n");
fprintf (debugfile,"\n");
}
 
I_NetCmd ();
211,7 → 214,7
if (doomcom->datalength != NetbufferSize ())
{
if (debugfile)
printf ("bad packet length %i\n",doomcom->datalength);
fprintf (debugfile,"bad packet length %i\n",doomcom->datalength);
return false;
}
218,7 → 221,7
if (NetbufferChecksum () != (netbuffer->checksum&NCMD_CHECKSUM) )
{
if (debugfile)
printf ("bad packet checksum\n");
fprintf (debugfile,"bad packet checksum\n");
return false;
}
 
228,7 → 231,7
int i;
if (netbuffer->checksum & NCMD_SETUP)
printf ("setup packet\n");
fprintf (debugfile,"setup packet\n");
else
{
if (netbuffer->checksum & NCMD_RETRANSMIT)
236,14 → 239,14
else
realretrans = -1;
printf ("get %i = (%i + %i, R %i)[%i] ",
fprintf (debugfile,"get %i = (%i + %i, R %i)[%i] ",
doomcom->remotenode,
ExpandTics(netbuffer->starttic),
netbuffer->numtics, realretrans, doomcom->datalength);
 
for (i=0 ; i<doomcom->datalength ; i++)
printf ("%i ",((byte *)netbuffer)[i]);
printf ("\n");
fprintf (debugfile,"%i ",((byte *)netbuffer)[i]);
fprintf (debugfile,"\n");
}
}
return true;
303,7 → 306,7
{
resendto[netnode] = ExpandTics(netbuffer->retransmitfrom);
if (debugfile)
printf ("retransmit from %i\n", resendto[netnode]);
fprintf (debugfile,"retransmit from %i\n", resendto[netnode]);
resendcount[netnode] = RESENDCOUNT;
}
else
316,7 → 319,8
if (realend < nettics[netnode])
{
if (debugfile)
printf ("out of order packet (%i + %i)\n" ,
fprintf (debugfile,
"out of order packet (%i + %i)\n" ,
realstart,netbuffer->numtics);
continue;
}
326,7 → 330,8
{
// stop processing until the other system resends the missed tics
if (debugfile)
printf ("missed tics from %i (%i - %i)\n",
fprintf (debugfile,
"missed tics from %i (%i - %i)\n",
netnode, realstart, nettics[netnode]);
remoteresend[netnode] = true;
continue;
/programs/games/doom/trunk/i_sound.c
552,7 → 552,7
int i;
// FIXME (below).
printf( "I_ShutdownSound: NOT finishing pending sounds\n");
printf( stderr, "I_ShutdownSound: NOT finishing pending sounds\n");
while ( !done )
{
568,7 → 568,7
void I_InitSound()
{ int i;
 
printf("I_InitSound: ");
printf( stderr, "I_InitSound: ");
for (i=1 ; i<NUMSFX ; i++)
{
586,7 → 586,7
}
}
 
printf( " pre-cached all sound data\n");
printf( stderr, " pre-cached all sound data\n");
// Now initialize mixbuffer with zero.
for ( i = 0; i< MIXBUFFERSIZE; i++ )
593,7 → 593,7
mixbuffer[i] = 0;
// Finished initialization.
printf("I_InitSound: sound module ready\n");
printf(stderr, "I_InitSound: sound module ready\n");
}
 
/programs/games/doom/trunk/i_system.c
39,7 → 39,6
 
 
#include "i_system.h"
#include "kolibri.h"
 
int mb_used = 6;
 
82,7 → 81,7
byte* I_ZoneBase (int* size)
{
*size = mb_used*1024*1024;
return (byte *) UserAlloc(*size);
return (byte *) _aligned_malloc(*size, 128);;
}
 
 
170,8 → 169,8
// Message first.
va_start (argptr,error);
printf ("Error: ");
printf (argptr);
printf ("\n");
printf (error,argptr);
printf (stderr, "\n");
va_end (argptr);
 
// Shutdown. Here might be other errors.
180,6 → 179,6
 
D_QuitNetGame ();
I_ShutdownGraphics();
// getch();
getch();
exit(-1);
}
/programs/games/doom/trunk/i_video.c
493,30 → 493,30
UpdateWindow(win);
 
GetClientRect(win, &rect);
printf("I_InitGraphics: Client area: %ux%u\n",
fprintf(stderr, "I_InitGraphics: Client area: %ux%u\n",
rect.right-rect.left, rect.bottom-rect.top);
 
if ( (rect.right-rect.left) != X_width )
{
printf("I_InitGraphics: Fixing width\n");
fprintf(stderr, "I_InitGraphics: Fixing width\n");
width += X_width - (rect.right-rect.left);
MoveWindow(win, 0, 0, width, height, TRUE);
}
if ( (rect.bottom-rect.top) != X_height )
{
printf("I_InitGraphics: Fixing height\n");
fprintf(stderr, "I_InitGraphics: Fixing height\n");
height += X_height - (rect.bottom-rect.top);
MoveWindow(win, 0, 0, width, height, TRUE);
}
 
GetClientRect(win, &rect);
printf("I_InitGraphics: Client area: %ux%u\n",
fprintf(stderr, "I_InitGraphics: Client area: %ux%u\n",
rect.right-rect.left, rect.bottom-rect.top);
dibDC = GetDC(win);
BPP=1;
bits = 8; //GetDeviceCaps(dibDC, BITSPIXEL);
printf("I_InitGraphics: %i bpp screen\n", bits);
fprintf(stderr, "I_InitGraphics: %i bpp screen\n", bits);
 
if ( BPP == 1 )
bminfo = malloc(sizeof(BITMAPINFOHEADER) + 4*256);
606,7 → 606,7
ClipCursor(NULL);
ShowCursor(TRUE);
}
printf("WM_DESTROY\n");
fprintf(stderr, "WM_DESTROY\n");
PostQuitMessage(0);
closed = 1;
break;
613,13 → 613,13
 
case WM_MOVE:
GetWindowRect(win, &rect);
printf("%u,%u - %u, %u\n",
fprintf(stderr, "%u,%u - %u, %u\n",
rect.left,rect.top,rect.right,rect.bottom);
ClipCursor(&rect);
break;
 
case WM_ACTIVATE:
printf("WM_ACTIVATE %u\n", (unsigned) LOWORD(wparam));
fprintf(stderr, "WM_ACTIVATE %u\n", (unsigned) LOWORD(wparam));
if ( LOWORD(wparam) )
{
if ( !windowActive )
628,7 → 628,7
{
ClipCursor(NULL); /* helps with Win95? */
GetWindowRect(win, &rect);
printf("%u,%u - %u, %u\n",
fprintf(stderr, "%u,%u - %u, %u\n",
rect.left,rect.top,rect.right,rect.bottom);
ClipCursor(&rect);
ShowCursor(FALSE);
/programs/games/doom/trunk/m_menu.c
1733,42 → 1733,40
static short y;
short i;
short max;
char *p;
int len;
char string[40];
int start;
 
inhelpscreens = false;
 
// Horiz. & Vertically center string and print it.
if (messageToPrint)
{
start = 0;
y = 100 - M_StringHeight(messageString)/2;
p = messageString;
len = strlen(p);
while(*p)
while(*(messageString+start))
{
for (i = 0;len;i++,len--)
for (i = 0;i < strlen(messageString+start);i++)
if (*(messageString+start+i) == '\n')
{
if (*(p+i) == '\n')
{ memset(string,0,40);
strncpy(string,p,i);
p+= i+1;
len-= 1;
memset(string,0,40);
strncpy(string,messageString+start,40);
start += i+1;
break;
};
};
}
if (len == 0)
{ strncpy(string,p,i);
p+=i;
};
if (i == strlen(messageString+start))
{
strcpy(string,messageString+start);
start += i;
}
x = 160 - M_StringWidth(string)/2;
M_WriteText(x,y,string);
y += SHORT(hu_font[0]->height);
};
}
return;
};
}
 
if (!menuactive)
return;
/programs/games/doom/trunk/m_misc.c
294,9 → 294,9
&& defaults[i].defaultvalue < 0xfff)
{
v = *defaults[i].location;
printf ("%s\t\t%i\n",defaults[i].name,v);
fprintf (f,"%s\t\t%i\n",defaults[i].name,v);
} else {
printf ("%s\t\t\"%s\"\n",defaults[i].name,
fprintf (f,"%s\t\t\"%s\"\n",defaults[i].name,
* (char **) (defaults[i].location));
}
}
335,7 → 335,7
}
else
defaultfile = basedefault;
/**********
// read the file in, overriding any set defaults
f = fopen (defaultfile, "r");
if (f)
373,7 → 373,6
fclose (f);
}
**********/
}
 
 
/programs/games/doom/trunk/v_video.c
38,8 → 38,8
#include "m_bbox.h"
 
#include "v_video.h"
#include "kolibri.h"
 
 
// Each screen is [SCREENWIDTH*SCREENHEIGHT];
byte* screens[5];
225,9 → 225,9
|| y+SHORT(patch->height)>SCREENHEIGHT
|| (unsigned)scrn>4)
{
printf("Patch at %d,%d exceeds LFB\n", x,y );
fprintf( stderr, "Patch at %d,%d exceeds LFB\n", x,y );
// No I_Error abort - what is up with TNT.WAD?
printf("V_DrawPatch: bad patch (ignored)\n");
fprintf( stderr, "V_DrawPatch: bad patch (ignored)\n");
return;
}
#endif
292,7 → 292,7
|| y+SHORT(patch->height)>SCREENHEIGHT
|| (unsigned)scrn>4)
{
printf("Patch origin %d,%d exceeds LFB\n", x,y );
fprintf( stderr, "Patch origin %d,%d exceeds LFB\n", x,y );
I_Error ("Bad V_DrawPatch in V_DrawPatchFlipped");
}
#endif
483,11 → 483,11
{
int i;
byte* base;
size_t size;
// stick these in low dos memory on PCs
size = SCREENWIDTH*SCREENHEIGHT*4;
base = (byte*)UserAlloc(size);
 
base = _aligned_malloc(SCREENWIDTH*SCREENHEIGHT*4, 128);I_AllocLow (SCREENWIDTH*SCREENHEIGHT*4);
 
for (i=0 ; i<4 ; i++)
screens[i] = base + i*SCREENWIDTH*SCREENHEIGHT;
}
/programs/games/doom/trunk/w_wad.c
515,7 → 515,6
return W_CacheLumpNum (W_GetNumForName(name), tag);
}
 
#if 0
 
//
// W_Profile
568,14 → 567,14
for ( ; j<8 ; j++)
name[j] = ' ';
 
printf ("%s ",name);
fprintf (f,"%s ",name);
 
for (j=0 ; j<profilecount ; j++)
fprintf (f," %c",info[i][j]);
 
printf ("\n");
fprintf (f,"\n");
}
fclose (f);
}
 
#endif
 
/programs/games/doom/trunk/wi_stuff.c
494,7 → 494,7
else
{
// DEBUG
printf("Could not place patch on level %d", n+1);
// __libclog_printf("Could not place patch on level %d", n+1);
}
}