diff -r --ignore-file-name-case -i linuxdoom-1.10/am_map.c PDOOM/AM_MAP.C 90,93c90,93 < #define AM_PANDOWNKEY KEY_DOWNARROW < #define AM_PANUPKEY KEY_UPARROW < #define AM_PANRIGHTKEY KEY_RIGHTARROW < #define AM_PANLEFTKEY KEY_LEFTARROW --- > #define AM_PANDOWNKEY KEYD_DOWNARROW > #define AM_PANUPKEY KEYD_UPARROW > #define AM_PANRIGHTKEY KEYD_RIGHTARROW > #define AM_PANLEFTKEY KEYD_LEFTARROW 96,97c96,97 < #define AM_STARTKEY KEY_TAB < #define AM_ENDKEY KEY_TAB --- > #define AM_STARTKEY KEYD_TAB > #define AM_ENDKEY KEYD_TAB Only in PDOOM: CHANGELO Only in linuxdoom-1.10: ChangeLog Only in linuxdoom-1.10: CVS diff -r --ignore-file-name-case -i linuxdoom-1.10/d_main.c PDOOM/D_MAIN.C 613,614c613,616 < I_Error("Please set $HOME to your home directory"); < sprintf(basedefault, "%s/.doomrc", home); --- > sprintf(basedefault,"default.chi"); > else > sprintf(basedefault, "%s\\default.chi", home); > 1048,1049c1050,1051 < < // Iff additonal PWAD files are used, print modified banner --- > #ifndef PHILL > // If additonal PWAD files are used, print modified banner 1062c1064 < --- > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/d_net.c PDOOM/D_NET.C 106,108c106,108 < #ifdef NORMALUNIX < return 0; // byte order problems < #endif --- > //#ifdef NORMALUNIX > // return 0; // byte order problems > //#endif 216c216 < if (debugfile) --- > if (debugfile) 467c467 < if (ev->type == ev_keydown && ev->data1 == KEY_ESCAPE) --- > if (ev->type == ev_keydown && ev->data1 == KEYD_ESCAPE) 495,496c495,496 < if (netbuffer->player != VERSION) < I_Error ("Different DOOM versions cannot play a net game!"); --- > // if (netbuffer->player != VERSION) > // I_Error ("Different DOOM versions cannot play a net game!"); diff -r --ignore-file-name-case -i linuxdoom-1.10/d_player.h PDOOM/D_PLAYER.H 75,76c75 < CF_NOMOMENTUM = 4 < --- > CF_NOMOMENTUM = 4, 98c97 < fixed_t bob; --- > fixed_t bob; diff -r --ignore-file-name-case -i linuxdoom-1.10/d_ticcmd.h PDOOM/D_TICCMD.H 42c42,47 < byte chatchar; --- > #ifdef FLIGHT > char updnmove; // Movement up/down if in flight ! > boolean stopfly; // If true, stop flying, let gravity take over but > // don't reset flight ticcount, so we can fly again ! > #endif > byte chatchar; Only in PDOOM: DATA diff -r --ignore-file-name-case -i linuxdoom-1.10/doomdef.h PDOOM/DOOMDEF.H 75c75 < #define RANGECHECK --- > //#define RANGECHECK 84c84 < #define SNDSERV 1 --- > //#define SNDSERV 1 221a222,227 > #ifdef FLIGHT > pw_flight, > #endif > #ifdef QUAD > pw_quad, > #endif 238,239c244,251 < IRONTICS = (60*TICRATE) < --- > IRONTICS = (60*TICRATE), > #ifdef FLIGHT > FLIGHTTICS = (60*TICRATE), > #endif > #ifdef QUAD > QUADTICS = (30*TICRATE), > #endif > NULLTICS = 0 242,243c254,257 < < --- > #ifdef QUAD > // Quad damage multiplier (i.e. 4 !) > #define QUAD_MULT 4 > #endif 250,281c264,301 < #define KEY_RIGHTARROW 0xae < #define KEY_LEFTARROW 0xac < #define KEY_UPARROW 0xad < #define KEY_DOWNARROW 0xaf < #define KEY_ESCAPE 27 < #define KEY_ENTER 13 < #define KEY_TAB 9 < #define KEY_F1 (0x80+0x3b) < #define KEY_F2 (0x80+0x3c) < #define KEY_F3 (0x80+0x3d) < #define KEY_F4 (0x80+0x3e) < #define KEY_F5 (0x80+0x3f) < #define KEY_F6 (0x80+0x40) < #define KEY_F7 (0x80+0x41) < #define KEY_F8 (0x80+0x42) < #define KEY_F9 (0x80+0x43) < #define KEY_F10 (0x80+0x44) < #define KEY_F11 (0x80+0x57) < #define KEY_F12 (0x80+0x58) < < #define KEY_BACKSPACE 127 < #define KEY_PAUSE 0xff < < #define KEY_EQUALS 0x3d < #define KEY_MINUS 0x2d < < #define KEY_RSHIFT (0x80+0x36) < #define KEY_RCTRL (0x80+0x1d) < #define KEY_RALT (0x80+0x38) < < #define KEY_LALT KEY_RALT < --- > #define KEYD_RIGHTARROW 0xae > #define KEYD_LEFTARROW 0xac > #define KEYD_UPARROW 0xad > #define KEYD_DOWNARROW 0xaf > #define KEYD_ESCAPE 27 > #define KEYD_ENTER 13 > #define KEYD_TAB 9 > #define KEYD_F1 (0x80+0x3b) > #define KEYD_F2 (0x80+0x3c) > #define KEYD_F3 (0x80+0x3d) > #define KEYD_F4 (0x80+0x3e) > #define KEYD_F5 (0x80+0x3f) > #define KEYD_F6 (0x80+0x40) > #define KEYD_F7 (0x80+0x41) > #define KEYD_F8 (0x80+0x42) > #define KEYD_F9 (0x80+0x43) > #define KEYD_F10 (0x80+0x44) > #define KEYD_F11 (0x80+0x57) > #define KEYD_F12 (0x80+0x58) > > #define KEYD_BACKSPACE 127 > #define KEYD_PAUSE 0xff > > #define KEYD_EQUALS 0x3d > #define KEYD_MINUS 0x2d > > #define KEYD_RSHIFT (0x80+0x36) > #define KEYD_RCTRL (0x80+0x1d) > #define KEYD_RALT (0x80+0x38) > > #define KEYD_LALT KEYD_RALT > > #define KEYD_INS (0x80+0x52) > #define KEYD_DEL (0x80+0x53) > #define KEYD_HOME (0x80+0x47) > #define KEYD_END (0x80+0x4F) > #define KEYD_PGUP (0x80+0x49) > #define KEYD_PGDN (0x80+0x51) diff -r --ignore-file-name-case -i linuxdoom-1.10/doomtype.h PDOOM/DOOMTYPE.H 41c41 < #ifdef LINUX --- > //#ifdef LINUX 43c43 < #else --- > //#else 45c45 < #define MAXSHORT ((short)0x7fff) --- > //#define MAXSHORT ((short)0x7fff) 48,49c48,49 < #define MAXINT ((int)0x7fffffff) < #define MAXLONG ((long)0x7fffffff) --- > //#define MAXINT ((int)0x7fffffff) > //#define MAXLONG ((long)0x7fffffff) 51c51 < #define MINSHORT ((short)0x8000) --- > //#define MINSHORT ((short)0x8000) 54,56c54,56 < #define MININT ((int)0x80000000) < #define MINLONG ((long)0x80000000) < #endif --- > //#define MININT ((int)0x80000000) > //#define MINLONG ((long)0x80000000) > //#endif Only in PDOOM: DOS diff -r --ignore-file-name-case -i linuxdoom-1.10/g_game.c PDOOM/G_GAME.C 159c159,165 < --- > > #ifdef FLIGHT > int key_flyup; > int key_flystop; > int key_flydown; > #endif > 178a185,188 > #ifdef FLIGHT > fixed_t updownmove[2] = {0x50,0x70}; > #endif > 326a337,356 > #ifdef FLIGHT > if (gamekeydown[key_flyup]) > { > cmd->updnmove += updownmove[speed]; > cmd->stopfly=false; > } > else > if (gamekeydown[key_flydown]) > { > cmd->updnmove -= updownmove[speed]; > cmd->stopfly=false; > } > else > cmd->updnmove=0; > if (gamekeydown[key_flystop]) > { > cmd->stopfly=true; > } > #endif > 508c538 < && ev->data1 == KEY_F12 && (singledemo || !deathmatch) ) --- > && ev->data1 == KEYD_F12 && (singledemo || !deathmatch) ) 561c591 < if (ev->data1 == KEY_PAUSE) --- > if (ev->data1 == KEYD_PAUSE) diff -r --ignore-file-name-case -i linuxdoom-1.10/hu_lib.c PDOOM/HU_LIB.C 326c326 < if (ch == KEY_BACKSPACE) --- > if (ch == KEYD_BACKSPACE) 329c329 < if (ch != KEY_ENTER) --- > if (ch != KEYD_ENTER) diff -r --ignore-file-name-case -i linuxdoom-1.10/hu_lib.h PDOOM/HU_LIB.H 34c34 < #define HU_CHARERASE KEY_BACKSPACE --- > #define HU_CHARERASE KEYD_BACKSPACE diff -r --ignore-file-name-case -i linuxdoom-1.10/hu_stuff.c PDOOM/HU_STUFF.C 552c552 < if (rc && c == KEY_ENTER) --- > if (rc && c == KEYD_ENTER) 643c643 < if (ev->data1 == KEY_RSHIFT) --- > if (ev->data1 == KEYD_RSHIFT) 648c648 < else if (ev->data1 == KEY_RALT || ev->data1 == KEY_LALT) --- > else if (ev->data1 == KEYD_RALT || ev->data1 == KEYD_LALT) 715c715 < HU_queueChatChar(KEY_ENTER); // DEBUG!!! --- > HU_queueChatChar(KEYD_ENTER); // DEBUG!!! 720c720 < HU_queueChatChar(KEY_ENTER); --- > HU_queueChatChar(KEYD_ENTER); 743c743 < if (c == KEY_ENTER) --- > if (c == KEYD_ENTER) 752c752 < else if (c == KEY_ESCAPE) --- > else if (c == KEYD_ESCAPE) diff -r --ignore-file-name-case -i linuxdoom-1.10/hu_stuff.h PDOOM/HU_STUFF.H 38c38 < #define HU_MSGREFRESH KEY_ENTER --- > #define HU_MSGREFRESH KEYD_ENTER diff -r --ignore-file-name-case -i linuxdoom-1.10/i_main.c PDOOM/I_MAIN.C 38a39,45 > #ifdef PHILLDEBUG > int i; > for(i=0;i printf("in doom argv[%d]=%s\n",i,argv[i]); > printf("Press enter to continue !\n"); > getche(); > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/i_net.c PDOOM/I_NET.C 1c1 < // Emacs style mode select -*- C++ -*- --- > // Emacs style mode select -*- C++ -*- 30d29 < #include 32d30 < #include 35,36c33,35 < #include < #include --- > #include > #include > #include 50,67d48 < < < < < // For some odd reason... < #define ntohl(x) \ < ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ < (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ < (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ < (((unsigned long int)(x) & 0xff000000U) >> 24))) < < #define ntohs(x) \ < ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ < (((unsigned short int)(x) & 0xff00) >> 8))) \ < < #define htonl(x) ntohl(x) < #define htons(x) ntohs(x) < 76,82d56 < int DOOMPORT = (IPPORT_USERRESERVED +0x1d ); < < int sendsocket; < int insocket; < < struct sockaddr_in sendaddress[MAXNETNODES]; < 88,124d61 < // UDPsocket < // < int UDPsocket (void) < { < int s; < < // allocate a socket < s = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP); < if (s<0) < I_Error ("can't create socket: %s",strerror(errno)); < < return s; < } < < // < // BindToLocalPort < // < void < BindToLocalPort < ( int s, < int port ) < { < int v; < struct sockaddr_in address; < < memset (&address, 0, sizeof(address)); < address.sin_family = AF_INET; < address.sin_addr.s_addr = INADDR_ANY; < address.sin_port = port; < < v = bind (s, (void *)&address, sizeof(address)); < if (v == -1) < I_Error ("BindToPort: bind: %s", strerror(errno)); < } < < < // 129,130c66 < int c; < doomdata_t sw; --- > __dpmi_regs r; 132,154c68 < // byte swap < sw.checksum = htonl(netbuffer->checksum); < sw.player = netbuffer->player; < sw.retransmitfrom = netbuffer->retransmitfrom; < sw.starttic = netbuffer->starttic; < sw.numtics = netbuffer->numtics; < for (c=0 ; c< netbuffer->numtics ; c++) < { < sw.cmds[c].forwardmove = netbuffer->cmds[c].forwardmove; < sw.cmds[c].sidemove = netbuffer->cmds[c].sidemove; < sw.cmds[c].angleturn = htons(netbuffer->cmds[c].angleturn); < sw.cmds[c].consistancy = htons(netbuffer->cmds[c].consistancy); < sw.cmds[c].chatchar = netbuffer->cmds[c].chatchar; < sw.cmds[c].buttons = netbuffer->cmds[c].buttons; < } < < //printf ("sending %i\n",gametic); < c = sendto (sendsocket , &sw, doomcom->datalength < ,0,(void *)&sendaddress[doomcom->remotenode] < ,sizeof(sendaddress[doomcom->remotenode])); < < // if (c == -1) < // I_Error ("SendPacket error: %s",strerror(errno)); --- > __dpmi_int(doomcom->intnum,&r); 163,167c77 < int i; < int c; < struct sockaddr_in fromaddress; < int fromlen; < doomdata_t sw; --- > __dpmi_regs r; 169,185c79 < fromlen = sizeof(fromaddress); < c = recvfrom (insocket, &sw, sizeof(sw), 0 < , (struct sockaddr *)&fromaddress, &fromlen ); < if (c == -1 ) < { < if (errno != EWOULDBLOCK) < I_Error ("GetPacket: %s",strerror(errno)); < doomcom->remotenode = -1; // no packet < return; < } < < { < static int first=1; < if (first) < printf("len=%d:p=[0x%x 0x%x] \n", c, *(int*)&sw, *((int*)&sw+1)); < first = 0; < } --- > __dpmi_int(doomcom->intnum,&r); 187,237d80 < // find remote node number < for (i=0 ; inumnodes ; i++) < if ( fromaddress.sin_addr.s_addr == sendaddress[i].sin_addr.s_addr ) < break; < < if (i == doomcom->numnodes) < { < // packet is not from one of the players (new game broadcast) < doomcom->remotenode = -1; // no packet < return; < } < < doomcom->remotenode = i; // good packet from a game player < doomcom->datalength = c; < < // byte swap < netbuffer->checksum = ntohl(sw.checksum); < netbuffer->player = sw.player; < netbuffer->retransmitfrom = sw.retransmitfrom; < netbuffer->starttic = sw.starttic; < netbuffer->numtics = sw.numtics; < < for (c=0 ; c< netbuffer->numtics ; c++) < { < netbuffer->cmds[c].forwardmove = sw.cmds[c].forwardmove; < netbuffer->cmds[c].sidemove = sw.cmds[c].sidemove; < netbuffer->cmds[c].angleturn = ntohs(sw.cmds[c].angleturn); < netbuffer->cmds[c].consistancy = ntohs(sw.cmds[c].consistancy); < netbuffer->cmds[c].chatchar = sw.cmds[c].chatchar; < netbuffer->cmds[c].buttons = sw.cmds[c].buttons; < } < } < < < < int GetLocalAddress (void) < { < char hostname[1024]; < struct hostent* hostentry; // host information entry < int v; < < // get local address < v = gethostname (hostname, sizeof(hostname)); < if (v == -1) < I_Error ("GetLocalAddress : gethostname: errno %d",errno); < < hostentry = gethostbyname (hostname); < if (!hostentry) < I_Error ("GetLocalAddress : gethostbyname: couldn't get local host"); < < return *(int *)hostentry->h_addr_list[0]; 240d82 < 246,249c88 < boolean trueval = true; < int i; < int p; < struct hostent* hostentry; // host information entry --- > int i,j; 251,253d89 < doomcom = malloc (sizeof (*doomcom) ); < memset (doomcom, 0, sizeof(*doomcom) ); < 255,278c91 < i = M_CheckParm ("-dup"); < if (i && i< myargc-1) < { < doomcom->ticdup = myargv[i+1][0]-'0'; < if (doomcom->ticdup < 1) < doomcom->ticdup = 1; < if (doomcom->ticdup > 9) < doomcom->ticdup = 9; < } < else < doomcom-> ticdup = 1; < < if (M_CheckParm ("-extratic")) < doomcom-> extratics = 1; < else < doomcom-> extratics = 0; < < p = M_CheckParm ("-port"); < if (p && p 283,291c96,109 < { < // single player game < netgame = false; < doomcom->id = DOOMCOM_ID; < doomcom->numplayers = doomcom->numnodes = 1; < doomcom->deathmatch = false; < doomcom->consoleplayer = 0; < return; < } --- > { > // single player game > doomcom = malloc (sizeof (*doomcom) ); > memset (doomcom, 0, sizeof(*doomcom) ); > > netgame = false; > doomcom->id = DOOMCOM_ID; > doomcom->numplayers = doomcom->numnodes = 1; > doomcom->deathmatch = false; > doomcom->consoleplayer = 0; > doomcom->extratics=0; > doomcom->ticdup=1; > return; > } 293,295c111 < netsend = PacketSend; < netget = PacketGet; < netgame = true; --- > doomcom=(doomcom_t *)(__djgpp_conventional_base+atoi(myargv[i+1])); 297,298c113,117 < // parse player number and host list < doomcom->consoleplayer = myargv[i+1][0]-'1'; --- > doomcom->ticdup=1; > if (M_CheckParm ("-extratic")) > doomcom-> extratics = 1; > else > doomcom-> extratics = 0; 300,329c119,129 < doomcom->numnodes = 1; // this node for sure < < i++; < while (++i < myargc && myargv[i][0] != '-') < { < sendaddress[doomcom->numnodes].sin_family = AF_INET; < sendaddress[doomcom->numnodes].sin_port = htons(DOOMPORT); < if (myargv[i][0] == '.') < { < sendaddress[doomcom->numnodes].sin_addr.s_addr < = inet_addr (myargv[i]+1); < } < else < { < hostentry = gethostbyname (myargv[i]); < if (!hostentry) < I_Error ("gethostbyname: couldn't find %s", myargv[i]); < sendaddress[doomcom->numnodes].sin_addr.s_addr < = *(int *)hostentry->h_addr_list[0]; < } < doomcom->numnodes++; < } < < doomcom->id = DOOMCOM_ID; < doomcom->numplayers = doomcom->numnodes; < < // build message to receive < insocket = UDPsocket (); < BindToLocalPort (insocket,htons(DOOMPORT)); < ioctl (insocket, FIONBIO, &trueval); --- > j = M_CheckParm ("-dup"); > if (j && j< myargc-1) > { > doomcom->ticdup = myargv[j+1][0]-'0'; > if (doomcom->ticdup < 1) > doomcom->ticdup = 1; > if (doomcom->ticdup > 9) > doomcom->ticdup = 9; > } > else > doomcom-> ticdup = 1; 331c131,133 < sendsocket = UDPsocket (); --- > netsend = PacketSend; > netget = PacketGet; > netgame = true; diff -r --ignore-file-name-case -i linuxdoom-1.10/i_sound.c PDOOM/I_SOUND.C 36,38d35 < #ifndef LINUX < #include < #endif 44,49c41,42 < // Linux voxware output. < #include < < // Timer stuff. Experimental. < #include < #include --- > //im using allegro sound code > #include 61,67d53 < // UNIX hack, to be removed. < #ifdef SNDSERV < // Separate sound server process. < FILE* sndserver=0; < char* sndserver_filename = "./sndserver "; < #elif SNDINTR < 73,84d58 < // Get the interrupt. Set duration in millisecs. < int I_SoundSetTimer( int duration_of_tick ); < void I_SoundDelTimer( void ); < #else < // None? < #endif < < < // A quick hack to establish a protocol between < // synchronous mix buffer updates and asynchronous < // audio writes. Probably redundant with gametic. < static int flag = 0; 153a128,132 > //this function converts raw 11khz, 8-bit data to a SAMPLE* that allegro uses > //it is need cuz allegro only loads samples from wavs and vocs > SAMPLE *raw2SAMPLE(unsigned char *rawdata, int len) > { > SAMPLE *spl; 154a134,142 > spl=malloc(sizeof(SAMPLE)); > spl->bits = 8; > spl->freq = 11025; > spl->len = len; > spl->priority = 255; > spl->loop_start = 0; > spl->loop_end = len; > spl->param = -1; > spl->data=(void *)rawdata; 156,178c144,145 < // < // Safe ioctl, convenience. < // < void < myioctl < ( int fd, < int command, < int* arg ) < { < int rc; < extern int errno; < < rc = ioctl(fd, command, arg); < if (rc < 0) < { < fprintf(stderr, "ioctl(dsp,%d,arg) failed\n", command); < fprintf(stderr, "errno=%d\n", errno); < exit(-1); < } < } < < < --- > return spl; > } 183a151 > // This now returns a SAMPLE*, not a void* 185c153 < void* --- > SAMPLE* 248a217 > 250c219 < return (void *) (paddedsfx + 8); --- > return raw2SAMPLE(paddedsfx + 8,*len); 270a240,241 > > 291,306c262,277 < { < // Loop all channels, check. < for (i=0 ; i { > // Loop all channels, check. > for (i=0 ; i { > // Active, and using the same SFX? > if ( (channels[i]) > && (channelids[i] == sfxid) ) > { > // Reset. > channels[i] = 0; > // We are sure that iff, > // there will only be one. > break; > } > } > } 310,316c281,287 < { < if (channelstart[i] < oldest) < { < oldestnum = i; < oldest = channelstart[i]; < } < } --- > { > if (channelstart[i] < oldest) > { > oldestnum = i; > oldest = channelstart[i]; > } > } 323c294 < slot = oldestnum; --- > slot = oldestnum; 325c296 < slot = i; --- > slot = i; 336c307 < handlenums = 100; --- > handlenums = 100; 358c329 < volume - ((volume*seperation*seperation) >> 16); ///(256*256); --- > volume - ((volume*seperation*seperation) >> 16); ///(256*256); 361c332 < volume - ((volume*seperation*seperation) >> 16); --- > volume - ((volume*seperation*seperation) >> 16); 365c336 < I_Error("rightvol out of bounds"); --- > I_Error("rightvol out of bounds"); 368c339 < I_Error("leftvol out of bounds"); --- > I_Error("leftvol out of bounds"); 378a350,354 > //this is where the sound actually gets played. i kept the previous code > //because i dont want to risk breaking anything > //max num in vol seems to be 8, i mul by 28 and not 31 just to be safe > play_sample(S_sfx[sfxid].data,volume*16,-seperation,1000,0); > 381,383d356 < } < < 384a358 > } 482,490d455 < #ifdef SNDSERV < if (sndserver) < { < fprintf(sndserver, "p%2.2x%2.2x%2.2x%2.2x\n", id, pitch, vol, sep); < fflush(sndserver); < } < // warning: control reaches end of non-void function. < return id; < #else 500d464 < #endif 537c501 < // This function currently supports only 16bit. --- > // allegro does this now 541,653d504 < #ifdef SNDINTR < // Debug. Count buffer misses with interrupt. < static int misses = 0; < #endif < < < // Mix current sound data. < // Data, from raw sound, for right and left. < register unsigned int sample; < register int dl; < register int dr; < < // Pointers in global mixbuffer, left, right, end. < signed short* leftout; < signed short* rightout; < signed short* leftend; < // Step in mixbuffer, left and right, thus two. < int step; < < // Mixing channel index. < int chan; < < // Left and right channel < // are in global mixbuffer, alternating. < leftout = mixbuffer; < rightout = mixbuffer+1; < step = 2; < < // Determine end, for left channel only < // (right channel is implicit). < leftend = mixbuffer + SAMPLECOUNT*step; < < // Mix sounds into the mixing buffer. < // Loop over step*SAMPLECOUNT, < // that is 512 values for two channels. < while (leftout != leftend) < { < // Reset left/right value. < dl = 0; < dr = 0; < < // Love thy L2 chache - made this a loop. < // Now more channels could be set at compile time < // as well. Thus loop those channels. < for ( chan = 0; chan < NUM_CHANNELS; chan++ ) < { < // Check channel, if active. < if (channels[ chan ]) < { < // Get the raw data from the channel. < sample = *channels[ chan ]; < // Add left and right part < // for this channel (sound) < // to the current data. < // Adjust volume accordingly. < dl += channelleftvol_lookup[ chan ][sample]; < dr += channelrightvol_lookup[ chan ][sample]; < // Increment index ??? < channelstepremainder[ chan ] += channelstep[ chan ]; < // MSB is next sample??? < channels[ chan ] += channelstepremainder[ chan ] >> 16; < // Limit to LSB??? < channelstepremainder[ chan ] &= 65536-1; < < // Check whether we are done. < if (channels[ chan ] >= channelsend[ chan ]) < channels[ chan ] = 0; < } < } < < // Clamp to range. Left hardware channel. < // Has been char instead of short. < // if (dl > 127) *leftout = 127; < // else if (dl < -128) *leftout = -128; < // else *leftout = dl; < < if (dl > 0x7fff) < *leftout = 0x7fff; < else if (dl < -0x8000) < *leftout = -0x8000; < else < *leftout = dl; < < // Same for right hardware channel. < if (dr > 0x7fff) < *rightout = 0x7fff; < else if (dr < -0x8000) < *rightout = -0x8000; < else < *rightout = dr; < < // Increment current pointers in mixbuffer. < leftout += step; < rightout += step; < } < < #ifdef SNDINTR < // Debug check. < if ( flag ) < { < misses += flag; < flag = 0; < } < < if ( misses > 10 ) < { < fprintf( stderr, "I_SoundUpdate: missed 10 buffer writes\n"); < misses = 0; < } < < // Increment flag for update. < flag++; < #endif 664a516 > 668,669c520 < // Write it to DSP device. < write(audio_fd, mixbuffer, SAMPLECOUNT*BUFMUL); --- > //this should no longer be necessary cuz allegro is doing all the sound mixing now 695,702d545 < #ifdef SNDSERV < if (sndserver) < { < // Send a "quit" command. < fprintf(sndserver, "q\n"); < fflush(sndserver); < } < #else 720,726d562 < #ifdef SNDINTR < I_SoundDelTimer(); < #endif < < // Cleaning up -releasing the DSP device. < close ( audio_fd ); < #endif 727a564 > remove_sound(); 733,736d569 < < < < 739,759c572 < { < #ifdef SNDSERV < char buffer[256]; < < if (getenv("DOOMWADDIR")) < sprintf(buffer, "%s/%s", < getenv("DOOMWADDIR"), < sndserver_filename); < else < sprintf(buffer, "%s", sndserver_filename); < < // start sound process < if ( !access(buffer, X_OK) ) < { < strcat(buffer, " -quiet"); < sndserver = popen(buffer, "w"); < } < else < fprintf(stderr, "Could not start sound server [%s]\n", buffer); < #else < --- > { 761,766c574 < < #ifdef SNDINTR < fprintf( stderr, "I_SoundSetTimer: %d microsecs\n", SOUND_INTERVAL ); < I_SoundSetTimer( SOUND_INTERVAL ); < #endif < --- > 769,789c577,578 < < audio_fd = open("/dev/dsp", O_WRONLY); < if (audio_fd<0) < fprintf(stderr, "Could not open /dev/dsp\n"); < < < i = 11 | (2<<16); < myioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &i); < myioctl(audio_fd, SNDCTL_DSP_RESET, 0); < < i=SAMPLERATE; < < myioctl(audio_fd, SNDCTL_DSP_SPEED, &i); < < i=1; < myioctl(audio_fd, SNDCTL_DSP_STEREO, &i); < < myioctl(audio_fd, SNDCTL_DSP_GETFMTS, &i); < < if (i&=AFMT_S16_LE) < myioctl(audio_fd, SNDCTL_DSP_SETFMT, &i); --- > if (install_sound(DIGI_AUTODETECT,MIDI_NONE,NULL)==-1) > fprintf(stderr,"ALLEGRO SOUND INIT ERROR!!!!\n"); 791,793c580 < fprintf(stderr, "Could not play signed 16 data\n"); < < fprintf(stderr, " configured audio device\n" ); --- > fprintf(stderr, " configured audio device\n" ); 823,824d609 < < #endif 893,985d677 < // < // Experimental stuff. < // A Linux timer interrupt, for asynchronous < // sound output. < // I ripped this out of the Timer class in < // our Difference Engine, including a few < // SUN remains... < // < #ifdef sun < typedef sigset_t tSigSet; < #else < typedef int tSigSet; < #endif < < < // We might use SIGVTALRM and ITIMER_VIRTUAL, if the process < // time independend timer happens to get lost due to heavy load. < // SIGALRM and ITIMER_REAL doesn't really work well. < // There are issues with profiling as well. < static int /*__itimer_which*/ itimer = ITIMER_REAL; < < static int sig = SIGALRM; < < // Interrupt handler. < void I_HandleSoundTimer( int ignore ) < { < // Debug. < //fprintf( stderr, "%c", '+' ); fflush( stderr ); < < // Feed sound device if necesary. < if ( flag ) < { < // See I_SubmitSound(). < // Write it to DSP device. < write(audio_fd, mixbuffer, SAMPLECOUNT*BUFMUL); < < // Reset flag counter. < flag = 0; < } < else < return; < < // UNUSED, but required. < ignore = 0; < return; < } < < // Get the interrupt. Set duration in millisecs. < int I_SoundSetTimer( int duration_of_tick ) < { < // Needed for gametick clockwork. < struct itimerval value; < struct itimerval ovalue; < struct sigaction act; < struct sigaction oact; < < int res; < < // This sets to SA_ONESHOT and SA_NOMASK, thus we can not use it. < // signal( _sig, handle_SIG_TICK ); < < // Now we have to change this attribute for repeated calls. < act.sa_handler = I_HandleSoundTimer; < #ifndef sun < //ac t.sa_mask = _sig; < #endif < act.sa_flags = SA_RESTART; < < sigaction( sig, &act, &oact ); < < value.it_interval.tv_sec = 0; < value.it_interval.tv_usec = duration_of_tick; < value.it_value.tv_sec = 0; < value.it_value.tv_usec = duration_of_tick; < < // Error is -1. < res = setitimer( itimer, &value, &ovalue ); < < // Debug. < if ( res == -1 ) < fprintf( stderr, "I_SoundSetTimer: interrupt n.a.\n"); < < return res; < } < < < // Remove the interrupt. Set duration to zero. < void I_SoundDelTimer() < { < // Debug. < if ( I_SoundSetTimer( 0 ) == -1) < fprintf( stderr, "I_SoundDelTimer: failed to remove interrupt. Doh!\n"); < } diff -r --ignore-file-name-case -i linuxdoom-1.10/i_system.c PDOOM/I_SYSTEM.C 33a34,37 > #include > #include > #include > #include 127a132 > /* 136a142,145 > */ > while ((inportb(0x3da)&8)!=8); > while ((inportb(0x3da)&8)==8); > 153a163 > diff -r --ignore-file-name-case -i linuxdoom-1.10/i_video.c PDOOM/I_VIDEO.C 29,42d28 < #include < #include < < #include < #include < #include < < #include < // Had to dig up XShm.c for this one. < // It is in the libXext, but not in the XFree86 headers. < #ifdef LINUX < int XShmGetEventBase( Display* dpy ); // problems with g++? < #endif < 46d31 < #include 49d33 < #include 51a36,42 > > #include > #include > #include > #include > #include > 60c51,61 < #define POINTER_WARP_COUNTDOWN 1 --- > //dosstuff -newly added > byte* dascreen; > _go32_dpmi_seginfo oldkeyinfo,newkeyinfo; > volatile char keydown[128]; > volatile char extendedkeydown[128]; > volatile char nextkeyextended; > void initkeyhandler(); > void killkeyhandler(); > void keyhandler(); > char oldkeystate[128]; > char oldextendedkeystate[128]; 62,90c63,65 < Display* X_display=0; < Window X_mainWindow; < Colormap X_cmap; < Visual* X_visual; < GC X_gc; < XEvent X_event; < int X_screen; < XVisualInfo X_visualinfo; < XImage* image; < int X_width; < int X_height; < < // MIT SHared Memory extension. < boolean doShm; < < XShmSegmentInfo X_shminfo; < int X_shmeventtype; < < // Fake mouse handling. < // This cannot work properly w/o DGA. < // Needs an invisible mouse cursor at least. < boolean grabMouse; < int doPointerWarp = POINTER_WARP_COUNTDOWN; < < // Blocky mode, < // replace each 320x200 pixel with multiply*multiply pixels. < // According to Dave Taylor, it still is a bonehead thing < // to use .... < static int multiply=1; --- > void initkeyhandler() > { > int i; 91a67,71 > for (i=0;i<128;i++) keydown[i]=0; > for (i=0;i<128;i++) extendedkeydown[i]=0; > for (i=0;i<128;i++) oldkeystate[i]=0; > for (i=0;i<128;i++) oldextendedkeystate[i]=0; > nextkeyextended=0; 93,95c73,88 < // < // Translates the key currently in X_event < // --- > asm("cli"); > _go32_dpmi_get_protected_mode_interrupt_vector(9, &oldkeyinfo); > newkeyinfo.pm_offset=(int)keyhandler; > newkeyinfo.pm_selector=_go32_my_cs(); > _go32_dpmi_allocate_iret_wrapper(&newkeyinfo); > _go32_dpmi_set_protected_mode_interrupt_vector(9, &newkeyinfo); > asm("sti"); > } > > void killkeyhandler() > { > asm("cli"); > _go32_dpmi_set_protected_mode_interrupt_vector(9, &oldkeyinfo); > _go32_dpmi_free_iret_wrapper(&newkeyinfo); > asm("sti"); > } 97c90 < int xlatekey(void) --- > void keyhandler() 98a92 > unsigned char keyhandlercurrkey; 100c94,95 < int rc; --- > asm("cli"); > keyhandlercurrkey=inportb(0x60); 102,158c97,111 < switch(rc = XKeycodeToKeysym(X_display, X_event.xkey.keycode, 0)) < { < case XK_Left: rc = KEY_LEFTARROW; break; < case XK_Right: rc = KEY_RIGHTARROW; break; < case XK_Down: rc = KEY_DOWNARROW; break; < case XK_Up: rc = KEY_UPARROW; break; < case XK_Escape: rc = KEY_ESCAPE; break; < case XK_Return: rc = KEY_ENTER; break; < case XK_Tab: rc = KEY_TAB; break; < case XK_F1: rc = KEY_F1; break; < case XK_F2: rc = KEY_F2; break; < case XK_F3: rc = KEY_F3; break; < case XK_F4: rc = KEY_F4; break; < case XK_F5: rc = KEY_F5; break; < case XK_F6: rc = KEY_F6; break; < case XK_F7: rc = KEY_F7; break; < case XK_F8: rc = KEY_F8; break; < case XK_F9: rc = KEY_F9; break; < case XK_F10: rc = KEY_F10; break; < case XK_F11: rc = KEY_F11; break; < case XK_F12: rc = KEY_F12; break; < < case XK_BackSpace: < case XK_Delete: rc = KEY_BACKSPACE; break; < < case XK_Pause: rc = KEY_PAUSE; break; < < case XK_KP_Equal: < case XK_equal: rc = KEY_EQUALS; break; < < case XK_KP_Subtract: < case XK_minus: rc = KEY_MINUS; break; < < case XK_Shift_L: < case XK_Shift_R: < rc = KEY_RSHIFT; < break; < < case XK_Control_L: < case XK_Control_R: < rc = KEY_RCTRL; < break; < < case XK_Alt_L: < case XK_Meta_L: < case XK_Alt_R: < case XK_Meta_R: < rc = KEY_RALT; < break; < < default: < if (rc >= XK_space && rc <= XK_asciitilde) < rc = rc - XK_space + ' '; < if (rc >= 'A' && rc <= 'Z') < rc = rc - 'A' + 'a'; < break; < } --- > if (nextkeyextended) > { > if ((keyhandlercurrkey&0x80)==0) > extendedkeydown[keyhandlercurrkey&0x7f]=1; > else > extendedkeydown[keyhandlercurrkey&0x7f]=0; > nextkeyextended=0; > } > else > { > if ((keyhandlercurrkey&0x80)==0) > keydown[keyhandlercurrkey&0x7f]=1; > else > keydown[keyhandlercurrkey&0x7f]=0; > } 160c113,158 < return rc; --- > if (keyhandlercurrkey==0xe0) > nextkeyextended=1; > > if ((keydown[0x1d])&&(keyhandlercurrkey==0x2e)) > { > asm ("movb $0x79, %%al > call ___djgpp_hw_exception" > : : :"%eax","%ebx","%ecx","%edx","%esi","%edi","memory"); > } > > //reset keyoard > {char b; b=inportb(0x61); outportb(0x61,b|80); outportb(0x61,b); outportb(0x20,0x20);} > asm("sti"); > } > #ifdef PHILL > /* This version of ASCIINames, does *NOT* return numeric codes for */ > /* The keypad arrow keys !, which allows them to be used as direction keys ! */ > byte ASCIINames[] = // Unshifted ASCII for scan codes > //left-shift must be turned to right shift, cuz doom doesnt recognize left-shit > { > // 0 1 2 3 4 5 6 7 8 9 A B C D E F > 0 ,27 ,'1','2','3','4','5','6','7','8','9','0','-','=',8 ,9 , // 0 > 'q','w','e','r','t','y','u','i','o','p','[',']',13 ,0 ,'a','s', // 1 > 'd','f','g','h','j','k','l',';',39 ,'`',KEYD_RSHIFT,92 ,'z','x','c','v', // 2 > 'b','n','m',',','.','/',0 ,'*',0 ,' ',0 ,0 ,0 ,0 ,0 ,0 , // 3 > 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,'-',0 ,0 ,0 ,'+',0 , // 4 > 0 ,0 ,0 ,127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 > 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 > 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 > }; > #else > byte ASCIINames[] = // Unshifted ASCII for scan codes > //left-shift must be turned to right shift, cuz doom doesnt recognize left-shit > { > // 0 1 2 3 4 5 6 7 8 9 A B C D E F > 0 ,27 ,'1','2','3','4','5','6','7','8','9','0','-','=',8 ,9 , // 0 > 'q','w','e','r','t','y','u','i','o','p','[',']',13 ,0 ,'a','s', // 1 > 'd','f','g','h','j','k','l',';',39 ,'`',KEYD_RSHIFT,92 ,'z','x','c','v', // 2 > 'b','n','m',',','.','/',0 ,'*',0 ,' ',0 ,0 ,0 ,0 ,0 ,0 , // 3 > 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 > '2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 > 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 6 > 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7 > }; > #endif > //end of newly added stuff 162d159 < } 166,172c163,168 < // Detach from X server < if (!XShmDetach(X_display, &X_shminfo)) < I_Error("XShmDetach() failed in I_ShutdownGraphics()"); < < // Release shared memory. < shmdt(X_shminfo.shmaddr); < shmctl(X_shminfo.shmid, IPC_RMID, 0); --- > __dpmi_regs r; > > > killkeyhandler(); > r.x.ax=0x3; > __dpmi_int(0x10,&r); 174,175d169 < // Paranoia. < image->data = NULL; 189,197d182 < static int lastmousex = 0; < static int lastmousey = 0; < boolean mousemoved = false; < boolean shmFinished; < < void I_GetEvent(void) < { < < event_t event; 199,201c184,196 < // put event-grabbing stuff in here < XNextEvent(X_display, &X_event); < switch (X_event.type) --- > void I_GetEvent() > { > __dpmi_regs r; > event_t event; > char tempkey[128]; > char tempextendedkey[128]; > int i; > int xmickeys,ymickeys,buttons; > static int lastbuttons=0; > > //key presses > asm("cli"); > for (i=0;i<128;i++) 203,276c198,199 < case KeyPress: < event.type = ev_keydown; < event.data1 = xlatekey(); < D_PostEvent(&event); < // fprintf(stderr, "k"); < break; < case KeyRelease: < event.type = ev_keyup; < event.data1 = xlatekey(); < D_PostEvent(&event); < // fprintf(stderr, "ku"); < break; < case ButtonPress: < event.type = ev_mouse; < event.data1 = < (X_event.xbutton.state & Button1Mask) < | (X_event.xbutton.state & Button2Mask ? 2 : 0) < | (X_event.xbutton.state & Button3Mask ? 4 : 0) < | (X_event.xbutton.button == Button1) < | (X_event.xbutton.button == Button2 ? 2 : 0) < | (X_event.xbutton.button == Button3 ? 4 : 0); < event.data2 = event.data3 = 0; < D_PostEvent(&event); < // fprintf(stderr, "b"); < break; < case ButtonRelease: < event.type = ev_mouse; < event.data1 = < (X_event.xbutton.state & Button1Mask) < | (X_event.xbutton.state & Button2Mask ? 2 : 0) < | (X_event.xbutton.state & Button3Mask ? 4 : 0); < // suggest parentheses around arithmetic in operand of | < event.data1 = < event.data1 < ^ (X_event.xbutton.button == Button1 ? 1 : 0) < ^ (X_event.xbutton.button == Button2 ? 2 : 0) < ^ (X_event.xbutton.button == Button3 ? 4 : 0); < event.data2 = event.data3 = 0; < D_PostEvent(&event); < // fprintf(stderr, "bu"); < break; < case MotionNotify: < event.type = ev_mouse; < event.data1 = < (X_event.xmotion.state & Button1Mask) < | (X_event.xmotion.state & Button2Mask ? 2 : 0) < | (X_event.xmotion.state & Button3Mask ? 4 : 0); < event.data2 = (X_event.xmotion.x - lastmousex) << 2; < event.data3 = (lastmousey - X_event.xmotion.y) << 2; < < if (event.data2 || event.data3) < { < lastmousex = X_event.xmotion.x; < lastmousey = X_event.xmotion.y; < if (X_event.xmotion.x != X_width/2 && < X_event.xmotion.y != X_height/2) < { < D_PostEvent(&event); < // fprintf(stderr, "m"); < mousemoved = false; < } else < { < mousemoved = true; < } < } < break; < < case Expose: < case ConfigureNotify: < break; < < default: < if (doShm && X_event.type == X_shmeventtype) shmFinished = true; < break; --- > tempkey[i]=keydown[i]; > tempextendedkey[i]=extendedkeydown[i]; 277a201,278 > asm("sti"); > for (i=0;i<128;i++) > { > if ((tempkey[i]==1)&&(oldkeystate[i]==0)) > { > event.type=ev_keydown; > if (ASCIINames[i]!=0) > event.data1=ASCIINames[i]; > else > #ifdef PHILL /* This bit allows numeric pad arrow keys to be used (keypress down )*/ > switch(i) > { > case 0x48: event.data1=KEYD_UPARROW; break; > case 0x4d: event.data1=KEYD_RIGHTARROW; break; > case 0x50: event.data1=KEYD_DOWNARROW; break; > case 0x4b: event.data1=KEYD_LEFTARROW; break; > default : event.data1=i+0x80; > } > #else > event.data1=i+0x80; > #endif > D_PostEvent(&event); > } > if ((tempkey[i]==0)&&(oldkeystate[i]==1)) > { > event.type=ev_keyup; > if (ASCIINames[i]!=0) > event.data1=ASCIINames[i]; > else > #ifdef PHILL /* This bit allows numeric pad arrow keys to be used (keypress down )*/ > switch(i) > { > case 0x48: event.data1=KEYD_UPARROW; break; > case 0x4d: event.data1=KEYD_RIGHTARROW; break; > case 0x50: event.data1=KEYD_DOWNARROW; break; > case 0x4b: event.data1=KEYD_LEFTARROW; break; > default : event.data1=i+0x80; > } > #else > event.data1=i+0x80; > #endif > D_PostEvent(&event); > } > if ((tempextendedkey[i]==1)&&(oldextendedkeystate[i]==0)) > { > event.type=ev_keydown; > switch (i) > { > case 0x48: event.data1=KEYD_UPARROW; D_PostEvent(&event); break; > case 0x4d: event.data1=KEYD_RIGHTARROW; D_PostEvent(&event); break; > case 0x50: event.data1=KEYD_DOWNARROW; D_PostEvent(&event); break; > case 0x4b: event.data1=KEYD_LEFTARROW; D_PostEvent(&event); break; > #ifdef FLIGHT > case 0x52: event.data1=KEYD_INS; D_PostEvent(&event); break; > case 0x47: event.data1=KEYD_HOME; D_PostEvent(&event); break; > case 0x49: event.data1=KEYD_PGUP; D_PostEvent(&event); break; > #endif > } > } > if ((tempextendedkey[i]==0)&&(oldextendedkeystate[i]==1)) > { > event.type=ev_keyup; > switch (i) > { > case 0x48: event.data1=KEYD_UPARROW; D_PostEvent(&event); break; > case 0x4d: event.data1=KEYD_RIGHTARROW; D_PostEvent(&event); break; > case 0x50: event.data1=KEYD_DOWNARROW; D_PostEvent(&event); break; > case 0x4b: event.data1=KEYD_LEFTARROW; D_PostEvent(&event); break; > #ifdef FLIGHT > case 0x52: event.data1=KEYD_INS; D_PostEvent(&event); break; > case 0x47: event.data1=KEYD_HOME; D_PostEvent(&event); break; > case 0x49: event.data1=KEYD_PGUP; D_PostEvent(&event); break; > #endif > } > } > } > memcpy(oldkeystate,tempkey,128); > memcpy(oldextendedkeystate,tempextendedkey,128); 279c280,298 < } --- > //mouse movement > > r.x.ax=0x0b; > __dpmi_int(0x33,&r); > xmickeys=(signed short)r.x.cx; > ymickeys=(signed short)r.x.dx; > r.x.ax=0x03; > __dpmi_int(0x33,&r); > buttons=r.x.bx; > > event.type=ev_mouse; > event.data1=buttons; //??? > event.data2=xmickeys; > event.data3=-ymickeys; > if ((xmickeys!=0)||(ymickeys!=0)||(buttons!=lastbuttons)) > D_PostEvent(&event); > lastbuttons=buttons; > > } 281,304d299 < Cursor < createnullcursor < ( Display* display, < Window root ) < { < Pixmap cursormask; < XGCValues xgc; < GC gc; < XColor dummycolour; < Cursor cursor; < < cursormask = XCreatePixmap(display, root, 1, 1, 1/*depth*/); < xgc.function = GXclear; < gc = XCreateGC(display, cursormask, GCFunction, &xgc); < XFillRectangle(display, cursormask, gc, 0, 0, 1, 1); < dummycolour.pixel = 0; < dummycolour.red = 0; < dummycolour.flags = 04; < cursor = XCreatePixmapCursor(display, cursormask, cursormask, < &dummycolour,&dummycolour, 0,0); < XFreePixmap(display,cursormask); < XFreeGC(display,gc); < return cursor; < } 309,334c304,307 < void I_StartTic (void) < { < < if (!X_display) < return; < < while (XPending(X_display)) < I_GetEvent(); < < // Warp the pointer back to the middle of the window < // or it will wander off - that is, the game will < // loose input focus within X11. < if (grabMouse) < { < if (!--doPointerWarp) < { < XWarpPointer( X_display, < None, < X_mainWindow, < 0, 0, < 0, 0, < X_width/2, X_height/2); < < doPointerWarp = POINTER_WARP_COUNTDOWN; < } < } --- > void I_StartTic() > { > I_GetEvent(); > //i dont think i have to do anything else here 336c309 < mousemoved = false; --- > } 338d310 < } 349,354c321,322 < // < // I_FinishUpdate < // < void I_FinishUpdate (void) < { < --- > void I_FinishUpdate(void) > { 376,522c344,346 < // scales the screen size before blitting it < if (multiply == 2) < { < unsigned int *olineptrs[2]; < unsigned int *ilineptr; < int x, y, i; < unsigned int twoopixels; < unsigned int twomoreopixels; < unsigned int fouripixels; < < ilineptr = (unsigned int *) (screens[0]); < for (i=0 ; i<2 ; i++) < olineptrs[i] = (unsigned int *) &image->data[i*X_width]; < < y = SCREENHEIGHT; < while (y--) < { < x = SCREENWIDTH; < do < { < fouripixels = *ilineptr++; < twoopixels = (fouripixels & 0xff000000) < | ((fouripixels>>8) & 0xffff00) < | ((fouripixels>>16) & 0xff); < twomoreopixels = ((fouripixels<<16) & 0xff000000) < | ((fouripixels<<8) & 0xffff00) < | (fouripixels & 0xff); < #ifdef __BIG_ENDIAN__ < *olineptrs[0]++ = twoopixels; < *olineptrs[1]++ = twoopixels; < *olineptrs[0]++ = twomoreopixels; < *olineptrs[1]++ = twomoreopixels; < #else < *olineptrs[0]++ = twomoreopixels; < *olineptrs[1]++ = twomoreopixels; < *olineptrs[0]++ = twoopixels; < *olineptrs[1]++ = twoopixels; < #endif < } while (x-=4); < olineptrs[0] += X_width/4; < olineptrs[1] += X_width/4; < } < < } < else if (multiply == 3) < { < unsigned int *olineptrs[3]; < unsigned int *ilineptr; < int x, y, i; < unsigned int fouropixels[3]; < unsigned int fouripixels; < < ilineptr = (unsigned int *) (screens[0]); < for (i=0 ; i<3 ; i++) < olineptrs[i] = (unsigned int *) &image->data[i*X_width]; < < y = SCREENHEIGHT; < while (y--) < { < x = SCREENWIDTH; < do < { < fouripixels = *ilineptr++; < fouropixels[0] = (fouripixels & 0xff000000) < | ((fouripixels>>8) & 0xff0000) < | ((fouripixels>>16) & 0xffff); < fouropixels[1] = ((fouripixels<<8) & 0xff000000) < | (fouripixels & 0xffff00) < | ((fouripixels>>8) & 0xff); < fouropixels[2] = ((fouripixels<<16) & 0xffff0000) < | ((fouripixels<<8) & 0xff00) < | (fouripixels & 0xff); < #ifdef __BIG_ENDIAN__ < *olineptrs[0]++ = fouropixels[0]; < *olineptrs[1]++ = fouropixels[0]; < *olineptrs[2]++ = fouropixels[0]; < *olineptrs[0]++ = fouropixels[1]; < *olineptrs[1]++ = fouropixels[1]; < *olineptrs[2]++ = fouropixels[1]; < *olineptrs[0]++ = fouropixels[2]; < *olineptrs[1]++ = fouropixels[2]; < *olineptrs[2]++ = fouropixels[2]; < #else < *olineptrs[0]++ = fouropixels[2]; < *olineptrs[1]++ = fouropixels[2]; < *olineptrs[2]++ = fouropixels[2]; < *olineptrs[0]++ = fouropixels[1]; < *olineptrs[1]++ = fouropixels[1]; < *olineptrs[2]++ = fouropixels[1]; < *olineptrs[0]++ = fouropixels[0]; < *olineptrs[1]++ = fouropixels[0]; < *olineptrs[2]++ = fouropixels[0]; < #endif < } while (x-=4); < olineptrs[0] += 2*X_width/4; < olineptrs[1] += 2*X_width/4; < olineptrs[2] += 2*X_width/4; < } < < } < else if (multiply == 4) < { < // Broken. Gotta fix this some day. < void Expand4(unsigned *, double *); < Expand4 ((unsigned *)(screens[0]), (double *) (image->data)); < } < < if (doShm) < { < < if (!XShmPutImage( X_display, < X_mainWindow, < X_gc, < image, < 0, 0, < 0, 0, < X_width, X_height, < True )) < I_Error("XShmPutImage() failed\n"); < < // wait for it to finish and processes all input events < shmFinished = false; < do < { < I_GetEvent(); < } while (!shmFinished); < < } < else < { < < // draw the image < XPutImage( X_display, < X_mainWindow, < X_gc, < image, < 0, 0, < 0, 0, < X_width, X_height ); < < // sync up with server < XSync(X_display, False); < < } < < } < --- > //blast it to the screen > memcpy(dascreen,screens[0],SCREENWIDTH*SCREENHEIGHT); > } 533,581d356 < // < // Palette stuff. < // < static XColor colors[256]; < < void UploadNewPalette(Colormap cmap, byte *palette) < { < < register int i; < register int c; < static boolean firstcall = true; < < #ifdef __cplusplus < if (X_visualinfo.c_class == PseudoColor && X_visualinfo.depth == 8) < #else < if (X_visualinfo.class == PseudoColor && X_visualinfo.depth == 8) < #endif < { < // initialize the colormap < if (firstcall) < { < firstcall = false; < for (i=0 ; i<256 ; i++) < { < colors[i].pixel = i; < colors[i].flags = DoRed|DoGreen|DoBlue; < } < } < < // set the X colormap entries < for (i=0 ; i<256 ; i++) < { < c = gammatable[usegamma][*palette++]; < colors[i].red = (c<<8) + c; < c = gammatable[usegamma][*palette++]; < colors[i].green = (c<<8) + c; < c = gammatable[usegamma][*palette++]; < colors[i].blue = (c<<8) + c; < } < < // store the colors to the current colormap < XStoreColors(X_display, cmap, colors, 256); < < } < } < < // < // I_SetPalette < // 583,607d357 < { < UploadNewPalette(X_cmap, palette); < } < < < // < // This function is probably redundant, < // if XShmDetach works properly. < // ddt never detached the XShm memory, < // thus there might have been stale < // handles accumulating. < // < void grabsharedmemory(int size) < { < < int key = ('d'<<24) | ('o'<<16) | ('o'<<8) | 'm'; < struct shmid_ds shminfo; < int minsize = 320*200; < int id; < int rc; < // UNUSED int done=0; < int pollution=5; < < // try to use what was here before < do 609,735c359 < id = shmget((key_t) key, minsize, 0777); // just get the id < if (id != -1) < { < rc=shmctl(id, IPC_STAT, &shminfo); // get stats on it < if (!rc) < { < if (shminfo.shm_nattch) < { < fprintf(stderr, "User %d appears to be running " < "DOOM. Is that wise?\n", shminfo.shm_cpid); < key++; < } < else < { < if (getuid() == shminfo.shm_perm.cuid) < { < rc = shmctl(id, IPC_RMID, 0); < if (!rc) < fprintf(stderr, < "Was able to kill my old shared memory\n"); < else < I_Error("Was NOT able to kill my old shared memory"); < < id = shmget((key_t)key, size, IPC_CREAT|0777); < if (id==-1) < I_Error("Could not get shared memory"); < < rc=shmctl(id, IPC_STAT, &shminfo); < < break; < < } < if (size >= shminfo.shm_segsz) < { < fprintf(stderr, < "will use %d's stale shared memory\n", < shminfo.shm_cpid); < break; < } < else < { < fprintf(stderr, < "warning: can't use stale " < "shared memory belonging to id %d, " < "key=0x%x\n", < shminfo.shm_cpid, key); < key++; < } < } < } < else < { < I_Error("could not get stats on key=%d", key); < } < } < else < { < id = shmget((key_t)key, size, IPC_CREAT|0777); < if (id==-1) < { < extern int errno; < fprintf(stderr, "errno=%d\n", errno); < I_Error("Could not get any shared memory"); < } < break; < } < } while (--pollution); < < if (!pollution) < { < I_Error("Sorry, system too polluted with stale " < "shared memory segments.\n"); < } < < X_shminfo.shmid = id; < < // attach to the shared memory segment < image->data = X_shminfo.shmaddr = shmat(id, 0, 0); < < fprintf(stderr, "shared memory id=%d, addr=0x%x\n", id, < (int) (image->data)); < } < < void I_InitGraphics(void) < { < < char* displayname; < char* d; < int n; < int pnum; < int x=0; < int y=0; < < // warning: char format, different type arg < char xsign=' '; < char ysign=' '; < < int oktodraw; < unsigned long attribmask; < XSetWindowAttributes attribs; < XGCValues xgcvalues; < int valuemask; < static int firsttime=1; < < if (!firsttime) < return; < firsttime = 0; < < signal(SIGINT, (void (*)(int)) I_Quit); < < if (M_CheckParm("-2")) < multiply = 2; < < if (M_CheckParm("-3")) < multiply = 3; < < if (M_CheckParm("-4")) < multiply = 4; < < X_width = SCREENWIDTH * multiply; < X_height = SCREENHEIGHT * multiply; < < // check for command-line display name < if ( (pnum=M_CheckParm("-disp")) ) // suggest parentheses around assignment < displayname = myargv[pnum+1]; < else < displayname = 0; --- > int c,i; 737,836c361,362 < // check if the user wants to grab the mouse (quite unnice) < grabMouse = !!M_CheckParm("-grabmouse"); < < // check for command-line geometry < if ( (pnum=M_CheckParm("-geom")) ) // suggest parentheses around assignment < { < // warning: char format, different type arg 3,5 < n = sscanf(myargv[pnum+1], "%c%d%c%d", &xsign, &x, &ysign, &y); < < if (n==2) < x = y = 0; < else if (n==6) < { < if (xsign == '-') < x = -x; < if (ysign == '-') < y = -y; < } < else < I_Error("bad -geom parameter"); < } < < // open the display < X_display = XOpenDisplay(displayname); < if (!X_display) < { < if (displayname) < I_Error("Could not open display [%s]", displayname); < else < I_Error("Could not open display (DISPLAY=[%s])", getenv("DISPLAY")); < } < < // use the default visual < X_screen = DefaultScreen(X_display); < if (!XMatchVisualInfo(X_display, X_screen, 8, PseudoColor, &X_visualinfo)) < I_Error("xdoom currently only supports 256-color PseudoColor screens"); < X_visual = X_visualinfo.visual; < < // check for the MITSHM extension < doShm = XShmQueryExtension(X_display); < < // even if it's available, make sure it's a local connection < if (doShm) < { < if (!displayname) displayname = (char *) getenv("DISPLAY"); < if (displayname) < { < d = displayname; < while (*d && (*d != ':')) d++; < if (*d) *d = 0; < if (!(!strcasecmp(displayname, "unix") || !*displayname)) doShm = false; < } < } < < fprintf(stderr, "Using MITSHM extension\n"); < < // create the colormap < X_cmap = XCreateColormap(X_display, RootWindow(X_display, < X_screen), X_visual, AllocAll); < < // setup attributes for main window < attribmask = CWEventMask | CWColormap | CWBorderPixel; < attribs.event_mask = < KeyPressMask < | KeyReleaseMask < // | PointerMotionMask | ButtonPressMask | ButtonReleaseMask < | ExposureMask; < < attribs.colormap = X_cmap; < attribs.border_pixel = 0; < < // create the main window < X_mainWindow = XCreateWindow( X_display, < RootWindow(X_display, X_screen), < x, y, < X_width, X_height, < 0, // borderwidth < 8, // depth < InputOutput, < X_visual, < attribmask, < &attribs ); < < XDefineCursor(X_display, X_mainWindow, < createnullcursor( X_display, X_mainWindow ) ); < < // create the GC < valuemask = GCGraphicsExposures; < xgcvalues.graphics_exposures = False; < X_gc = XCreateGC( X_display, < X_mainWindow, < valuemask, < &xgcvalues ); < < // map the window < XMapWindow(X_display, X_mainWindow); < < // wait until it is OK to draw < oktodraw = 0; < while (!oktodraw) --- > outportb(0x3c8,0); > for (i=0;i<256;i++) 838,843c364,369 < XNextEvent(X_display, &X_event); < if (X_event.type == Expose < && !X_event.xexpose.count) < { < oktodraw = 1; < } --- > c=gammatable[usegamma][*palette++]; > outportb(0x3c9,c>>2); > c=gammatable[usegamma][*palette++]; > outportb(0x3c9,c>>2); > c=gammatable[usegamma][*palette++]; > outportb(0x3c9,c>>2); 844a371 > } 846,908d372 < // grabs the pointer so it is restricted to this window < if (grabMouse) < XGrabPointer(X_display, X_mainWindow, True, < ButtonPressMask|ButtonReleaseMask|PointerMotionMask, < GrabModeAsync, GrabModeAsync, < X_mainWindow, None, CurrentTime); < < if (doShm) < { < < X_shmeventtype = XShmGetEventBase(X_display) + ShmCompletion; < < // create the image < image = XShmCreateImage( X_display, < X_visual, < 8, < ZPixmap, < 0, < &X_shminfo, < X_width, < X_height ); < < grabsharedmemory(image->bytes_per_line * image->height); < < < // UNUSED < // create the shared memory segment < // X_shminfo.shmid = shmget (IPC_PRIVATE, < // image->bytes_per_line * image->height, IPC_CREAT | 0777); < // if (X_shminfo.shmid < 0) < // { < // perror(""); < // I_Error("shmget() failed in InitGraphics()"); < // } < // fprintf(stderr, "shared memory id=%d\n", X_shminfo.shmid); < // attach to the shared memory segment < // image->data = X_shminfo.shmaddr = shmat(X_shminfo.shmid, 0, 0); < < < if (!image->data) < { < perror(""); < I_Error("shmat() failed in InitGraphics()"); < } < < // get the X server to attach to it < if (!XShmAttach(X_display, &X_shminfo)) < I_Error("XShmAttach() failed in InitGraphics()"); < < } < else < { < image = XCreateImage( X_display, < X_visual, < 8, < ZPixmap, < 0, < (char*)malloc(X_width * X_height), < X_width, X_height, < 8, < X_width ); < < } 910,913c374,377 < if (multiply == 1) < screens[0] = (unsigned char *) (image->data); < else < screens[0] = (unsigned char *) malloc (SCREENWIDTH * SCREENHEIGHT); --- > void I_InitGraphics(void) > { > static int firsttime=1; > __dpmi_regs r; 915c379 < } --- > __djgpp_nearptr_enable(); 916a381,401 > if (!firsttime) > return; > firsttime=0; > > //enter graphics mode > r.x.ax=0x13; > __dpmi_int(0x10,&r); > dascreen=(byte *)(__djgpp_conventional_base+0xa0000); > screens[0]=(byte *)malloc(SCREENWIDTH*SCREENHEIGHT); > > //init the mouse > r.x.ax=0; > __dpmi_int(0x33,&r); > r.x.ax=2; > __dpmi_int(0x33,&r); //hide cursor > r.x.ax=0x0b; > __dpmi_int(0x33,&r); //reset micket count > > //init keyboard > initkeyhandler(); > } 918d402 < unsigned exptable[256]; 920,954d403 < void InitExpand (void) < { < int i; < < for (i=0 ; i<256 ; i++) < exptable[i] = i | (i<<8) | (i<<16) | (i<<24); < } < < double exptable2[256*256]; < < void InitExpand2 (void) < { < int i; < int j; < // UNUSED unsigned iexp, jexp; < double* exp; < union < { < double d; < unsigned u[2]; < } pixel; < < printf ("building exptable2...\n"); < exp = exptable2; < for (i=0 ; i<256 ; i++) < { < pixel.u[0] = i | (i<<8) | (i<<16) | (i<<24); < for (j=0 ; j<256 ; j++) < { < pixel.u[1] = j | (j<<8) | (j<<16) | (j<<24); < *exp++ = pixel.d; < } < } < printf ("done.\n"); < } 958,1049d406 < void < Expand4 < ( unsigned* lineptr, < double* xline ) < { < double dpixel; < unsigned x; < unsigned y; < unsigned fourpixels; < unsigned step; < double* exp; < < exp = exptable2; < if (!inited) < { < inited = 1; < InitExpand2 (); < } < < < step = 3*SCREENWIDTH/2; < < y = SCREENHEIGHT-1; < do < { < x = SCREENWIDTH; < < do < { < fourpixels = lineptr[0]; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) ); < xline[0] = dpixel; < xline[160] = dpixel; < xline[320] = dpixel; < xline[480] = dpixel; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) ); < xline[1] = dpixel; < xline[161] = dpixel; < xline[321] = dpixel; < xline[481] = dpixel; < < fourpixels = lineptr[1]; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) ); < xline[2] = dpixel; < xline[162] = dpixel; < xline[322] = dpixel; < xline[482] = dpixel; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) ); < xline[3] = dpixel; < xline[163] = dpixel; < xline[323] = dpixel; < xline[483] = dpixel; < < fourpixels = lineptr[2]; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) ); < xline[4] = dpixel; < xline[164] = dpixel; < xline[324] = dpixel; < xline[484] = dpixel; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) ); < xline[5] = dpixel; < xline[165] = dpixel; < xline[325] = dpixel; < xline[485] = dpixel; < < fourpixels = lineptr[3]; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff0000)>>13) ); < xline[6] = dpixel; < xline[166] = dpixel; < xline[326] = dpixel; < xline[486] = dpixel; < < dpixel = *(double *)( (int)exp + ( (fourpixels&0xffff)<<3 ) ); < xline[7] = dpixel; < xline[167] = dpixel; < xline[327] = dpixel; < xline[487] = dpixel; < < lineptr+=4; < xline+=8; < } while (x-=16); < xline += step; < } while (y--); < } < Only in linuxdoom-1.10: linux diff -r --ignore-file-name-case -i linuxdoom-1.10/m_cheat.c PDOOM/M_CHEAT.C 67a68,70 > #ifdef NEWCHEAT > else if (*cht->p == 0x20) // end of sequence character > #else 68a72 > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/m_cheat.h PDOOM/M_CHEAT.H 29c29,31 < --- > #ifdef NEWCHEAT > #define SCRAMBLE(a) a > #else 32a35 > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/m_menu.c PDOOM/M_MENU.C 1366c1366 < ch = KEY_UPARROW; --- > ch = KEYD_UPARROW; 1371c1371 < ch = KEY_DOWNARROW; --- > ch = KEYD_DOWNARROW; 1377c1377 < ch = KEY_LEFTARROW; --- > ch = KEYD_LEFTARROW; 1382c1382 < ch = KEY_RIGHTARROW; --- > ch = KEYD_RIGHTARROW; 1388c1388 < ch = KEY_ENTER; --- > ch = KEYD_ENTER; 1393c1393 < ch = KEY_BACKSPACE; --- > ch = KEYD_BACKSPACE; 1404c1404 < ch = KEY_DOWNARROW; --- > ch = KEYD_DOWNARROW; 1410c1410 < ch = KEY_UPARROW; --- > ch = KEYD_UPARROW; 1418c1418 < ch = KEY_LEFTARROW; --- > ch = KEYD_LEFTARROW; 1424c1424 < ch = KEY_RIGHTARROW; --- > ch = KEYD_RIGHTARROW; 1431c1431 < ch = KEY_ENTER; --- > ch = KEYD_ENTER; 1437c1437 < ch = KEY_BACKSPACE; --- > ch = KEYD_BACKSPACE; 1457c1457 < case KEY_BACKSPACE: --- > case KEYD_BACKSPACE: 1465c1465 < case KEY_ESCAPE: --- > case KEYD_ESCAPE: 1470c1470 < case KEY_ENTER: --- > case KEYD_ENTER: 1498c1498 < !(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE)) --- > !(ch == ' ' || ch == 'n' || ch == 'y' || ch == KEYD_ESCAPE)) 1511c1511 < if (devparm && ch == KEY_F1) --- > if (devparm && ch == KEYD_F1) 1522c1522 < case KEY_MINUS: // Screen size down --- > case KEYD_MINUS: // Screen size down 1529c1529 < case KEY_EQUALS: // Screen size up --- > case KEYD_EQUALS: // Screen size up 1536c1536 < case KEY_F1: // Help key --- > case KEYD_F1: // Help key 1548c1548 < case KEY_F2: // Save --- > case KEYD_F2: // Save 1554c1554 < case KEY_F3: // Load --- > case KEYD_F3: // Load 1560c1560 < case KEY_F4: // Sound Volume --- > case KEYD_F4: // Sound Volume 1567c1567 < case KEY_F5: // Detail toggle --- > case KEYD_F5: // Detail toggle 1572c1572 < case KEY_F6: // Quicksave --- > case KEYD_F6: // Quicksave 1577c1577 < case KEY_F7: // End game --- > case KEYD_F7: // End game 1582c1582 < case KEY_F8: // Toggle messages --- > case KEYD_F8: // Toggle messages 1587c1587 < case KEY_F9: // Quickload --- > case KEYD_F9: // Quickload 1592c1592 < case KEY_F10: // Quit DOOM --- > case KEYD_F10: // Quit DOOM 1597c1597 < case KEY_F11: // gamma toggle --- > case KEYD_F11: // gamma toggle 1611c1611 < if (ch == KEY_ESCAPE) --- > if (ch == KEYD_ESCAPE) 1624c1624 < case KEY_DOWNARROW: --- > case KEYD_DOWNARROW: 1634c1634 < case KEY_UPARROW: --- > case KEYD_UPARROW: 1644c1644 < case KEY_LEFTARROW: --- > case KEYD_LEFTARROW: 1653c1653 < case KEY_RIGHTARROW: --- > case KEYD_RIGHTARROW: 1662c1662 < case KEY_ENTER: --- > case KEYD_ENTER: 1680c1680 < case KEY_ESCAPE: --- > case KEYD_ESCAPE: 1686c1686 < case KEY_BACKSPACE: --- > case KEYD_BACKSPACE: diff -r --ignore-file-name-case -i linuxdoom-1.10/m_misc.c PDOOM/M_MISC.C 184a185,190 > #ifdef FLIGHT > extern int key_flyup; > extern int key_flystop; > extern int key_flydown; > #endif > 243,246c249,252 < {"key_right",&key_right, KEY_RIGHTARROW}, < {"key_left",&key_left, KEY_LEFTARROW}, < {"key_up",&key_up, KEY_UPARROW}, < {"key_down",&key_down, KEY_DOWNARROW}, --- > {"key_right",&key_right, KEYD_RIGHTARROW}, > {"key_left",&key_left, KEYD_LEFTARROW}, > {"key_up",&key_up, KEYD_UPARROW}, > {"key_down",&key_down, KEYD_DOWNARROW}, 250c256 < {"key_fire",&key_fire, KEY_RCTRL}, --- > {"key_fire",&key_fire, KEYD_RCTRL}, 252,253c258,265 < {"key_strafe",&key_strafe, KEY_RALT}, < {"key_speed",&key_speed, KEY_RSHIFT}, --- > {"key_strafe",&key_strafe, KEYD_RALT}, > {"key_speed",&key_speed, KEYD_RSHIFT}, > > #ifdef FLIGHT > {"key_flyup",&key_flyup, KEYD_INS}, > {"key_flydown",&key_flydown, KEYD_PGUP}, > {"key_flystop",&key_flystop, KEYD_HOME}, > #endif 279c291 < {"screenblocks",&screenblocks, 9}, --- > {"screenblocks",&screenblocks, 10}, 286c298 < {"usegamma",&usegamma, 0}, --- > {"usegamma",&usegamma, 3}, diff -r --ignore-file-name-case -i linuxdoom-1.10/Makefile PDOOM/MAKEFILE 9,11c9,14 < CFLAGS=-g -Wall -DNORMALUNIX -DLINUX # -DUSEASM < LDFLAGS=-L/usr/X11R6/lib < LIBS=-lXext -lX11 -lnsl -lm --- > #CFLAGS=-g -Wall -DNORMALUNIX -DLINUX # -DUSEASM > CFLAGS=-O3 -ffast-math -fomit-frame-pointer -m486 -Wall -DNORMALUNIX -s -DPHILL -DNEWCHEAT -DFLIGHT -DQUAD #-DFIELD -DPHILLDEBUG > #LDFLAGS=-L/usr/X11R6/lib > #LIBS=-lXext -lX11 -lnsl -lm > LDFLAGS=-s > LIBS=-lemu -lalleg 14c17 < O=linux --- > O=dos 78c81,82 < $(O)/sounds.o --- > $(O)/sounds.o \ > $(O)/util.o 80c84 < all: $(O)/linuxxdoom --- > all: $(O)/dosdoom 84c88 < rm -f linux/* --- > rm -f dos/* 86c90 < $(O)/linuxxdoom: $(OBJS) $(O)/i_main.o --- > $(O)/dosdoom: $(OBJS) $(O)/i_main.o 88c92 < -o $(O)/linuxxdoom $(LIBS) --- > -o $(O)/dosdoom $(LIBS) 95c99 < ############################################################# \ No newline at end of file --- > ############################################################# Only in PDOOM: NEWCHEAT.H diff -r --ignore-file-name-case -i linuxdoom-1.10/p_enemy.c PDOOM/P_ENEMY.C 187c187,197 < --- > > #ifdef FLIGHT > // If actor is completely above target (such as on a ledge) then > // attack in real life should be impossible, doom shoud be the same > // and it always bugged me that it wasn't ! Well it is now ! > // also returns false if target completely above actor. > if (((actor->target->z > (actor->z+actor->height))) || > ((actor->z+actor->height) < actor->target->z)) > return false; > #endif > diff -r --ignore-file-name-case -i linuxdoom-1.10/p_inter.c PDOOM/P_INTER.C 325c325,342 < --- > > #ifdef FLIGHT > if (power == pw_flight) > { > player->mo->flags |= (MF_FLOAT | MF_NOGRAVITY); > player->powers[power] = FLIGHTTICS; > player->cmd.stopfly=false; > return true; > } > #endif > > #ifdef QUAD > if (power == pw_quad) > { > player->powers[power]=QUADTICS; > } > #endif > 801c818,822 < --- > > #ifdef QUAD > if ((source) && (source->player) && (source->player->powers[pw_quad])) > damage *=QUAD_MULT; // do quad dammage > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/p_map.c PDOOM/P_MAP.C 1c1 < // Emacs style mode select -*- C++ -*- --- > // Emacs style mode select -*- C++ -*- 272a273,282 > > #ifdef FLIGHT > if (tmthing->player) > { > if (tmthing->z > thing->z + thing->height) > return true; // overhead > if (tmthing->z+tmthing->height < thing->z) > return true; // underneath > } > #endif 472a483,494 > #ifdef FLIGHT > if (!(thing->player) || > (thing->player && !(thing->flags & MF_NOGRAVITY))) > { > if ( !(thing->flags&MF_TELEPORT) > &&tmceilingz - thing->z < thing->height) > return false; // mobj must lower itself to fit > if ( !(thing->flags&MF_TELEPORT) > && (tmfloorz - thing->z > 24*FRACUNIT)) > return false; // too big a step up > } > #else 477c499 < if ( !(thing->flags&MF_TELEPORT) --- > if ( !(thing->flags&MF_TELEPORT) 480c502 < --- > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/p_mobj.c PDOOM/P_MOBJ.C 171c171,178 < P_SlideMove (mo); --- > #ifdef XFLIGHT > if (mo->player->cheats & CF_FLYING) > { > > } > else > #endif > P_SlideMove (mo); 203c210,213 < --- > #ifdef FLIGHT > if ((mo->z > mo->floorz) && (player==NULL)) > return; // no friction when airborne UNLESS we are a player ! > #else 206c216 < --- > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/p_telept.c PDOOM/P_TELEPT.C 63a64 > #ifndef PHILL 66c67,68 < return 0; --- > return 0; > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/p_user.c PDOOM/P_USER.C 51c51 < boolean onground; --- > boolean onground; 157a158,161 > #ifdef FLIGHT > onground = ((player->mo->z <= player->mo->floorz) | > (player->powers[pw_flight]>0)); > #else 159c163,176 < --- > #endif > > #ifdef FLIGHT > if ((cmd->updnmove) && (player->powers[pw_flight]>0)) > { > player->mo->z += cmd->updnmove * 2048; > player->mo->flags |= (MF_FLOAT | MF_NOGRAVITY); > } > if (cmd->stopfly) > { > player->mo->flags &= ~(MF_FLOAT | MF_NOGRAVITY); > } > #endif > 354c371,381 < --- > > #ifdef FLIGHT > if (player->powers[pw_flight]) > player->powers[pw_flight]--; > #endif > > #ifdef QUAD > if (player->powers[pw_quad]) > player->powers[pw_quad]--; > #endif > 361d387 < Only in PDOOM: PLAY.BAT diff -r --ignore-file-name-case -i linuxdoom-1.10/r_data.c PDOOM/R_DATA.C 657c657 < printf ("\nInitTextures"); --- > // printf ("\nInitTextures"); 659c659 < printf ("\nInitFlats"); --- > // printf ("\nInitFlats"); 661c661 < printf ("\nInitSprites"); --- > // printf ("\nInitSprites"); 663c663 < printf ("\nInitColormaps"); --- > // printf ("\nInitColormaps"); diff -r --ignore-file-name-case -i linuxdoom-1.10/r_main.c PDOOM/R_MAIN.C 46d45 < 48,49c47,51 < #define FIELDOFVIEW 2048 < --- > #ifdef FIELD > #define FIELDOFVIEW 1024 > #else > #define FIELDOFVIEW 2048 > #endif Only in PDOOM: README.BOO Only in linuxdoom-1.10: README.book Only in PDOOM: README.DOS Only in PDOOM: README.NOW Only in PDOOM: README.SOU Only in linuxdoom-1.10: README.sound diff -r --ignore-file-name-case -i linuxdoom-1.10/sounds.h PDOOM/SOUNDS.H 25a26 > #include //because sfxinfo_struct now has a SAMPLE* 53c54 < void* data; --- > SAMPLE* data; diff -r --ignore-file-name-case -i linuxdoom-1.10/st_stuff.c PDOOM/ST_STUFF.C 1c1 < // Emacs style mode select -*- C++ -*- --- > // Emacs style mode select -*- C++ -*- 63a64,66 > //Debug Utils ! 30/12/97, PHS > #include "util.h" > 83c86 < #define ST_TOGGLECHAT KEY_ENTER --- > #define ST_TOGGLECHAT KEYD_ENTER 396c399,401 < --- > #ifdef NEWCHEAT > #include "newcheat.h" > #else 464c469 < --- > #endif 488a494,503 > #ifdef NEWCHEAT > cheatseq_t cheat_kill_all = { cheat_kill_all_seq, 0 }; > #ifdef QUAD > cheatseq_t cheat_quad = { cheat_quad_seq, 0 }; > #endif > #ifdef FLIGHT > cheatseq_t cheat_fly = { cheat_fly_seq, 0 }; > cheatseq_t cheat_nofly = { cheat_nofly_seq, 0 }; > #endif > #endif 681c696,697 < --- > > plyr->message="clev"; 722c738,787 < } --- > } > > #ifdef NEWCHEAT > if (cht_CheckCheat(&cheat_kill_all, ev->data1)) > { > thinker_t *th; > mobj_t *mob; > int killed; // no of monsters massacred > static char outbuff[80]; > > killed=0; // zero kill count > for (th = thinkercap.next ; th != &thinkercap; th=th->next) > { > mob=(mobj_t *)th; > if ((th->function.acp1 == (actionf_p1)P_MobjThinker) && // if it is active > (mob->type != MT_PLAYER) && // and is not a player > ((mob->flags & MF_COUNTKILL)==MF_COUNTKILL)) // and conts towards killcount > { > P_DamageMobj((mobj_t *)th,plyr->mo,plyr->mo,10000); // damage it ! > killed++; // increment killcount > } > } > sprintf(outbuff,"%d Actors Massacred !",killed); > plyr->message = outbuff; > return false; > } > #endif > #ifdef QUAD > if (cht_CheckCheat(&cheat_quad, ev->data1)) > { > P_GivePower(plyr,pw_quad); > plyr->message = "Ok, Quad dammage QuakeHead !"; > return false; > } > #endif > #ifdef FLIGHT > if (cht_CheckCheat(&cheat_fly, ev->data1)) > { > P_GivePower(plyr,pw_flight); > plyr->message = "Now we're floating !"; > return false; > } > if (cht_CheckCheat(&cheat_nofly, ev->data1)) > { > plyr->mo->flags &= ~(MF_NOGRAVITY | MF_FLOAT); > plyr->powers[pw_flight]=0; > plyr->message = "Falling from the sky !"; > return false; > } > #endif 727,728d791 < < 985a1049,1055 > #ifdef FLIGHT > // if not in flight, turn on gravity, turn off float & flag not flying ! > if (!plyr->powers[pw_flight]) > { > plyr->mo->flags &= ~(MF_NOGRAVITY | MF_FLOAT); > } > #endif diff -r --ignore-file-name-case -i linuxdoom-1.10/tables.h PDOOM/TABLES.H 44c44 < #define PI 3.141592657 --- > //#define PI 3.141592657 Only in PDOOM: UTIL.C Only in PDOOM: UTIL.H diff -r --ignore-file-name-case -i linuxdoom-1.10/w_wad.c PDOOM/W_WAD.C 37,38c37,38 < #include < #define O_BINARY 0 --- > //#include > //#define O_BINARY 0 69c69 < void strupr (char* s) --- > /*void strupr (char* s) 72c72 < } --- > }*/