Skip to content

Commit

Permalink
better always run.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraakate committed Oct 29, 2015
1 parent b0b8f45 commit 4da9d52
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 143 deletions.
4 changes: 4 additions & 0 deletions DOOMDEF.H
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,10 @@ void V_DrawFuzzPatch(int x, int y, patch_t *patch);
void V_DrawShadowedPatch(int x, int y, patch_t *patch);
void V_DrawRawScreen(byte *raw);

/* D_Main.c stuff */
void hgotoxy(int x,int y);
void hprintf(char *string, unsigned char a);

#include "sounds.h"

#endif // __DOOMDEF__
34 changes: 13 additions & 21 deletions G_GAME.C
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ extern externdata_t *i_ExternData;
#endif

extern boolean ultimatemsg; // FS: Was goofing

extern int alwaysrun;

/*
====================
Expand Down Expand Up @@ -223,16 +223,8 @@ void G_BuildTiccmd (ticcmd_t *cmd)

//printf ("cons: %i\n",cmd->consistancy);

strafe = gamekeydown[key_strafe] || mousebuttons[mousebstrafe]
|| joybuttons[joybstrafe];
speed = gamekeydown[key_speed] || joybuttons[joybspeed]
|| joybuttons[joybspeed];

if (!M_CheckParm("-debug"))
{
if (gamekeydown[key_speed] || joybuttons[joybspeed]) // FS: could cheat with ultrafast movement, from DOSDOOM.
speed = !speed;
}
strafe = gamekeydown[key_strafe] || mousebuttons[mousebstrafe] || joybuttons[joybstrafe];
speed = alwaysrun || gamekeydown[key_speed] || joybuttons[joybspeed] || joybuttons[joybspeed];

#ifdef __WATCOMC__
if(useexterndriver)
Expand Down Expand Up @@ -584,31 +576,31 @@ void G_BuildTiccmd (ticcmd_t *cmd)
dclicks = 0; // clear double clicks if hit use button
}

if(use_wpnbinds) // FS: Custom weapon keys
if(use_wpnbinds) /* FS: Custom weapon keys */
{
if(gamekeydown[wpn_crossbow])
{
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 2<<BT_WEAPONSHIFT;
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 2<<BT_WEAPONSHIFT;
}
if(gamekeydown[wpn_dragon])
{
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 3<<BT_WEAPONSHIFT;
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 3<<BT_WEAPONSHIFT;
}
if(gamekeydown[wpn_hellstaff])
{
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 4<<BT_WEAPONSHIFT;
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 4<<BT_WEAPONSHIFT;
}
if(gamekeydown[wpn_phoenix])
{
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 5<<BT_WEAPONSHIFT;
cmd->buttons |= BT_CHANGE;
cmd->buttons |= 5<<BT_WEAPONSHIFT;
}
}

if(use_artbinds)
if(use_artbinds) /* FS: Custom artifact keys */
{
if(gamekeydown[art_torch])
{
Expand Down
115 changes: 54 additions & 61 deletions I_CYBER.C
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

#include <dos.h>
#include <stdlib.h>
#include <string.h>

#include "doomdef.h"

/*
====================================================
Expand All @@ -27,16 +29,6 @@ normal speed to help aiming.
====================================================
*/

typedef struct
{
char forwardmove; // *2048 for move
char sidemove; // *2048 for move
short angleturn; // <<16 for angle delta
short consistancy; // checks for net game
unsigned char chatchar;
unsigned char buttons;
} ticcmd_t;

#define BT_ATTACK 1
#define BT_USE 2
#define BT_CHANGE 4 // if true, the next 3 bits hold weapon num
Expand Down Expand Up @@ -111,57 +103,58 @@ extern int mousepresent;
//===========================================================
void I_StartupCyberMan(void)
{
StaticDeviceData *pbuf;
int success = 0;

isCyberPresent = 0;

cyberstat = (SWIFT_3DStatus *)I_AllocLow (DOSMEMSIZE);
segment = (int)cyberstat>>4;

pbuf = (StaticDeviceData *)cyberstat;
memset(pbuf, 0, sizeof (StaticDeviceData));

// Use DPMI call 300h to issue mouse interrupt
memset(&RMI, 0, sizeof(RMI));
RMI.EAX = 0x53C1; // SWIFT: Get Static Device Data
RMI.ES = segment;
RMI.EDX = 0;
memset(&sregs, 0, sizeof (sregs));
regs.w.ax = 0x0300; // DPMI: simulate interrupt
regs.w.bx = MOUSE_INT;
regs.w.cx = 0;
regs.x.edi = FP_OFF(&RMI);
sregs.es = FP_SEG(&RMI);
int386x( DPMI_INT, &regs, &regs, &sregs );

if ((short)RMI.EAX != 1)
{
// SWIFT functions not present
tprintf("CyberMan: Wrong mouse driver - no SWIFT support (AX=%04x).\n",
(unsigned)(short)RMI.EAX);
}
else
if (pbuf->deviceType != DEVTYPE_CYBERMAN)
{
// no SWIFT device, or not CyberMan
if (pbuf->deviceType == 0)
{
tprintf("CyberMan: no SWIFT device connected.\n");
}
else
{
tprintf("CyberMan: SWIFT device is not a CyberMan! (type=%d)\n",
pbuf->deviceType);
}
}
else
{
tprintf("CyberMan: CyberMan %d.%02d connected.\n",
pbuf->majorVersion, pbuf->minorVersion);
isCyberPresent = 1;
mousepresent = 0;
}
StaticDeviceData *pbuf;
int success = 0;
char cyberMsg[256];

isCyberPresent = 0;

cyberstat = (SWIFT_3DStatus *)I_AllocLow (DOSMEMSIZE);
segment = (int)cyberstat>>4;

pbuf = (StaticDeviceData *)cyberstat;
memset(pbuf, 0, sizeof (StaticDeviceData));

// Use DPMI call 300h to issue mouse interrupt
memset(&RMI, 0, sizeof(RMI));
RMI.EAX = 0x53C1; // SWIFT: Get Static Device Data
RMI.ES = segment;
RMI.EDX = 0;
memset(&sregs, 0, sizeof (sregs));
regs.w.ax = 0x0300; // DPMI: simulate interrupt
regs.w.bx = MOUSE_INT;
regs.w.cx = 0;
regs.x.edi = FP_OFF(&RMI);
sregs.es = FP_SEG(&RMI);
int386x( DPMI_INT, &regs, &regs, &sregs );

if ((short)RMI.EAX != 1)
{
// SWIFT functions not present
sprintf(cyberMsg, "CyberMan: Wrong mouse driver - no SWIFT support (AX=%04x).\n", (unsigned)(short)RMI.EAX);
tprintf(cyberMsg, 1);
}
else if (pbuf->deviceType != DEVTYPE_CYBERMAN)
{
// no SWIFT device, or not CyberMan
if (pbuf->deviceType == 0)
{
sprintf(cyberMsg, "CyberMan: no SWIFT device connected.\n");
tprintf(cyberMsg, 1);
}
else
{
sprintf(cyberMsg, "CyberMan: SWIFT device is not a CyberMan! (type=%d)\n", pbuf->deviceType);
tprintf(cyberMsg,1 );
}
}
else
{
sprintf(cyberMsg, "CyberMan: CyberMan %d.%02d connected.\n", pbuf->majorVersion, pbuf->minorVersion);
tprintf(cyberMsg, 1);
isCyberPresent = 1;
mousepresent = 0;
}
}


Expand Down
1 change: 0 additions & 1 deletion I_IBM.C
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,6 @@ void I_StartTic (void)
int k;
event_t ev;


I_ReadMouse ();

//
Expand Down
3 changes: 2 additions & 1 deletion I_SOUND.C
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

// I_SOUND.C

#include <stdio.h>
#include <stdlib.h>

#include "doomdef.h"
#include "dmx.h"
#include "sounds.h"
Expand Down
16 changes: 14 additions & 2 deletions MN_MENU.C
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ boolean MN_Responder(event_t *event)
extern boolean automapactive;
static boolean shiftdown;
extern boolean usePalFlash; // FS: Use Palette Flashing
extern int alwaysrun;
extern void D_StartTitle(void);
extern void G_CheckDemoStatus(void);
char *textBuffer;
Expand Down Expand Up @@ -1397,7 +1398,7 @@ boolean MN_Responder(event_t *event)
return true;
case KEY_F11: // F11 - gamma mode correction
usegamma++;
if(usegamma > 4)
if((usegamma > 4) || (usegamma < 0))
{
usegamma = 0;
}
Expand All @@ -1421,7 +1422,18 @@ boolean MN_Responder(event_t *event)
P_SetMessage(&players[consoleplayer],"GAMMA CORRECTION LEVEL 4", false);
break;
}

return true;
case KEY_F12: /* FS: Always run toggle */
if(alwaysrun)
{
P_SetMessage(&players[consoleplayer], "ALWAYS RUN OFF", false);
alwaysrun = 0;
}
else
{
P_SetMessage(&players[consoleplayer], "ALWAYS RUN ON", false);
alwaysrun = 1;
}
return true;
#endif
}
Expand Down
7 changes: 5 additions & 2 deletions M_MISC.C
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ int useIntGus; // FS: Internal HT_GUS1M.WAD
int faststart; // FS: Always faststart if you want
int novert; // FS: No vertical mouse movement
int noprecache; // FS: No graphics precaching
int alwaysrun; /* FS: Always run */
extern int drawTime; // FS: Draw time clock

extern int use_wpnbinds; // FS: Custom weapon keys
Expand Down Expand Up @@ -538,9 +539,11 @@ default_t extendeddefaults[] =
{ "wpn_phoenix", &wpn_phoenix, 16, 1 }, // FS: Q

// FS: Use custom artifact binds
{ "use_artbinds", &use_artbinds, 0},
{ "use_artbinds", &use_artbinds, 0 },
{ "art_torch", &art_torch, 33, 1 }, // FS: F
{ "art_flask", &art_flask, 34, 1 } // FS: G
{ "art_flask", &art_flask, 34, 1 }, // FS: G

{ "alwaysrun", &alwaysrun, 1 }
};

int numdefaults;
Expand Down
18 changes: 4 additions & 14 deletions P_USER.C
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,10 @@ void P_MovePlayer(player_t *player)
}
else
{ // Normal speed
if(demoplayback) // FS: Was desyncing demos
{
if(cmd->forwardmove && (onground||player->mo->flags2&MF2_FLY))
P_Thrust(player, player->mo->angle, cmd->forwardmove*(2048));
if(cmd->sidemove && (onground||player->mo->flags2&MF2_FLY))
P_Thrust(player, player->mo->angle-ANG90, cmd->sidemove*(2048));
}
else
{
if(cmd->forwardmove && (onground||player->mo->flags2&MF2_FLY))
P_Thrust(player, player->mo->angle, cmd->forwardmove*(2048*2)); // FS: Was 2048
if(cmd->sidemove && (onground||player->mo->flags2&MF2_FLY))
P_Thrust(player, player->mo->angle-ANG90, cmd->sidemove*(2048*2)); // FS: Was 2048
}
if(cmd->forwardmove && (onground||player->mo->flags2&MF2_FLY))
P_Thrust(player, player->mo->angle, cmd->forwardmove*2048);
if(cmd->sidemove && (onground||player->mo->flags2&MF2_FLY))
P_Thrust(player, player->mo->angle-ANG90, cmd->sidemove*2048);
}

if(cmd->forwardmove || cmd->sidemove)
Expand Down
42 changes: 1 addition & 41 deletions Utils/idsetup/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ int detailLevel = 1;
int screenblocks = 10;
int usegamma = 0;

#if 0
int usePalFlash = 1; // FS
int headBob = 1; // FS
int drawTime = 0; // FS
int grmode = 1; // FS

// FS: Custom weapon keys
int use_wpnbinds = 0;
int wpn_shotgun;
int wpn_crossbow;
int wpn_chaingun;
int wpn_dragon;
int wpn_rocket;
int wpn_phoenix;
int wpn_plasma;
int wpn_hellstaff;
#endif

int comport = 1;

char chatmacros[10][40];
Expand Down Expand Up @@ -80,29 +62,6 @@ default_t defaults[] =
{"key_jump", &curk.jump, SC_SPACE }, // FS: 0x35
#endif

#if 0
{"usePalFlash",&usePalFlash, 1}, // FS
{"headBob",&headBob, 1}, // FS
{"drawTime",&drawTime, 0}, // FS

// FS: Use custom weapon binds
{ "use_wpnbinds", &use_wpnbinds, 0},
#if defined(DOOM) || defined(DOOM2)
{ "wpn_shotgun", &wpn_shotgun, 44 }, // FS: Z
{ "wpn_chaingun", &wpn_chaingun, 45 }, // FS: X
{ "wpn_rocket", &wpn_rocket, 16 }, // FS: Q
{ "wpn_plasma", &wpn_plasma, 46 }, // FS: C
{ "disk_flash_icon", &grmode, 1 }, // FS: Disk Flashing Icon
#endif // DOOM || DOOM2

#ifdef HERETIC
{ "wpn_crossbow", &wpn_crossbow, 44 }, // FS: Z
{ "wpn_dragon", &wpn_dragon, 45 }, // FS: X
{ "wpn_phoenix", &wpn_phoenix, 16 }, // FS: Q
{ "wpn_hellstaff", &wpn_hellstaff, 46 }, // FS: C
#endif // HERETIC
#endif // 0

{"use_mouse",&usemouse, 1 },
{"mouseb_fire",&curk.mouse[ID_FIRE],ID_FIRE },
{"mouseb_strafe",&curk.mouse[ID_STRAFE],ID_STRAFE },
Expand Down Expand Up @@ -248,6 +207,7 @@ int M_LoadDefaults (void)
if ( !strncmp(defaults[i].name,"chatmacro",9) )
{
char *chatnum = strchr(defaults[i].name, 'o');
/* FS: FIXME: What the fuck was this? :( */
int z = chatnum[1]-48; // FS: Because I don't know how to atoi this properly.

strcpy((char *)defaults[i].location,defaultchatmacro[z]);
Expand Down

0 comments on commit 4da9d52

Please sign in to comment.