2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on the
13 #include "osregistry.h"
19 static int Joy_ff_enabled = 0;
20 static int Joy_ff_acquired = 0;
21 static SDL_Haptic *haptic = NULL;
22 static int joy_ff_handling_scaler = 0;
23 static int Joy_ff_directional_hit_effect_enabled = 1;
24 static int Joy_rumble = 0;
25 static int Joy_ff_afterburning = 0;
33 static haptic_effect_t pHitEffect1;
34 static haptic_effect_t pHitEffect2;
35 static haptic_effect_t pAfterburn1;
36 static haptic_effect_t pAfterburn2;
37 static haptic_effect_t pShootEffect;
38 static haptic_effect_t pSecShootEffect;
39 static haptic_effect_t pSpring;
40 static haptic_effect_t pDock;
42 static void joy_ff_create_effects();
43 static int joy_ff_effect_playing(haptic_effect_t *eff);
44 static void joy_ff_start_effect(haptic_effect_t *eff, const char *name);
46 extern SDL_Joystick *sdljoy;
53 ff_enabled = os_config_read_uint("Controls", "EnableJoystickFF", 0);
55 if ( !ff_enabled || !SDL_JoystickIsHaptic(sdljoy) ) {
59 if (SDL_InitSubSystem(SDL_INIT_HAPTIC) < 0) {
60 mprintf((" ERROR: Unable to initialize haptic subsystem\n"));
64 haptic = SDL_HapticOpenFromJoystick(sdljoy);
67 mprintf((" ERROR: Unable to open haptic joystick\n"));
68 SDL_QuitSubSystem(SDL_INIT_HAPTIC);
72 if ( SDL_HapticRumbleSupported(haptic) ) {
73 SDL_HapticRumbleInit(haptic);
77 mprintf((" Rumble : %s\n", Joy_rumble ? "Yes" : "No"));
78 mprintf((" Axes : %d\n", SDL_HapticNumAxes(haptic)));
79 mprintf((" Max effects : %d\n", SDL_HapticNumEffects(haptic)));
80 mprintf((" Running effects : %d\n", SDL_HapticNumEffectsPlaying(haptic)));
82 joy_ff_create_effects();
87 Joy_ff_directional_hit_effect_enabled = os_config_read_uint("Controls", "EnableHitEffect", 1);
92 void joy_ff_shutdown()
94 if ( !Joy_ff_enabled ) {
100 SDL_HapticClose(haptic);
103 SDL_QuitSubSystem(SDL_INIT_HAPTIC);
109 static void joy_ff_create_effects()
111 // clear all SDL errors
114 unsigned int supported = 0;
116 supported = SDL_HapticQuery(haptic);
118 if ( !(supported & SDL_HAPTIC_CONSTANT) ) {
119 mprintf((" Constant Force : not supported\n"));
122 if ( !(supported & SDL_HAPTIC_SINE) ) {
123 mprintf((" Sine Wave : not supported\n"));
126 if ( !(supported & SDL_HAPTIC_SAWTOOTHDOWN) ) {
127 mprintf((" Sawtooth Down : not supported\n"));
130 if ( !(supported & SDL_HAPTIC_SPRING) ) {
131 mprintf((" Spring : not supported\n"));
134 if ( !(supported & SDL_HAPTIC_SQUARE) ) {
135 mprintf((" Square : not supported\n"));
138 if ( !(supported & SDL_HAPTIC_TRIANGLE) ) {
139 mprintf((" Triangle : not supported\n"));
143 if (supported & SDL_HAPTIC_CONSTANT) {
145 memset(&pHitEffect1, 0, sizeof(haptic_effect_t));
147 pHitEffect1.eff.type = SDL_HAPTIC_CONSTANT;
148 pHitEffect1.eff.constant.direction.type = SDL_HAPTIC_POLAR;
149 pHitEffect1.eff.constant.direction.dir[0] = 0;
150 pHitEffect1.eff.constant.length = 300;
151 pHitEffect1.eff.constant.level = 0x7FFF;
152 pHitEffect1.eff.constant.attack_length = 0;
153 pHitEffect1.eff.constant.attack_level = 0x7FFF;
154 pHitEffect1.eff.constant.fade_length = 120;
155 pHitEffect1.eff.constant.fade_level = 1;
157 pHitEffect1.id = SDL_HapticNewEffect(haptic, &pHitEffect1.eff);
159 if (pHitEffect1.id < 0) {
160 mprintf((" Hit effect 1 failed to load:\n %s\n", SDL_GetError()));
162 pHitEffect1.loaded = 1;
166 if (supported & SDL_HAPTIC_SINE) {
168 memset(&pHitEffect2, 0, sizeof(haptic_effect_t));
170 pHitEffect2.eff.type = SDL_HAPTIC_SINE;
171 pHitEffect2.eff.periodic.direction.type = SDL_HAPTIC_POLAR;
172 pHitEffect2.eff.periodic.direction.dir[0] = 9000;
173 pHitEffect2.eff.periodic.length = 300;
174 pHitEffect2.eff.periodic.period = 100;
175 pHitEffect2.eff.periodic.magnitude = 0x7FFF;
176 pHitEffect2.eff.periodic.attack_length = 100;
177 pHitEffect2.eff.periodic.fade_length = 100;
179 pHitEffect2.id = SDL_HapticNewEffect(haptic, &pHitEffect2.eff);
181 if (pHitEffect2.id < 0) {
182 mprintf((" Hit effect 2 failed to load:\n %s\n", SDL_GetError()));
184 pHitEffect2.loaded = 1;
188 if (supported & SDL_HAPTIC_SAWTOOTHDOWN) {
190 memset(&pShootEffect, 0, sizeof(haptic_effect_t));
192 pShootEffect.eff.type = SDL_HAPTIC_SAWTOOTHDOWN;
193 pShootEffect.eff.periodic.direction.type = SDL_HAPTIC_POLAR;
194 pShootEffect.eff.periodic.direction.dir[0] = 0;
195 pShootEffect.eff.periodic.length = 160;
196 pShootEffect.eff.periodic.period = 20;
197 pShootEffect.eff.periodic.magnitude = 0x7FFF;
198 pShootEffect.eff.periodic.fade_length = 120;
200 pShootEffect.id = SDL_HapticNewEffect(haptic, &pShootEffect.eff);
202 if (pShootEffect.id < 0) {
203 mprintf((" Fire primary effect failed to load:\n %s\n", SDL_GetError()));
205 pShootEffect.loaded = 1;
209 if (supported & SDL_HAPTIC_CONSTANT) {
211 memset(&pSecShootEffect, 0, sizeof(haptic_effect_t));
213 pSecShootEffect.eff.type = SDL_HAPTIC_CONSTANT;
214 pSecShootEffect.eff.constant.direction.type = SDL_HAPTIC_POLAR;
215 pSecShootEffect.eff.constant.direction.dir[0] = 0;
216 pSecShootEffect.eff.constant.length = 200;
217 pSecShootEffect.eff.constant.level = 0x7FFF;
218 pSecShootEffect.eff.constant.attack_length = 50;
219 pSecShootEffect.eff.constant.attack_level = 0x7FFF;
220 pSecShootEffect.eff.constant.fade_length = 100;
221 pSecShootEffect.eff.constant.fade_level = 1;
223 pSecShootEffect.id = SDL_HapticNewEffect(haptic, &pSecShootEffect.eff);
225 if (pSecShootEffect.id < 0) {
226 mprintf((" Fire secondary effect failed to load:\n %s\n", SDL_GetError()));
228 pSecShootEffect.loaded = 1;
232 if (supported & SDL_HAPTIC_SPRING) {
234 memset(&pSpring, 0, sizeof(haptic_effect_t));
236 pSpring.eff.type = SDL_HAPTIC_SPRING;
237 pSpring.eff.condition.length = SDL_HAPTIC_INFINITY;
239 for (int i = 0; i < SDL_HapticNumAxes(haptic); i++) {
240 pSpring.eff.condition.right_sat[i] = 0x7FFF;
241 pSpring.eff.condition.left_sat[i] = 0x7FFF;
242 pSpring.eff.condition.right_coeff[i] = 0x147;
243 pSpring.eff.condition.left_coeff[i] = 0x147;
246 pSpring.id = SDL_HapticNewEffect(haptic, &pSpring.eff);
248 if (pSpring.id < 0) {
249 mprintf((" Spring effect failed to load:\n %s\n", SDL_GetError()));
255 if (supported & SDL_HAPTIC_SINE) {
257 memset(&pAfterburn1, 0, sizeof(haptic_effect_t));
259 pAfterburn1.eff.type = SDL_HAPTIC_SINE;
260 pAfterburn1.eff.periodic.direction.type = SDL_HAPTIC_POLAR;
261 pAfterburn1.eff.periodic.direction.dir[0] = 0;
262 pAfterburn1.eff.periodic.length = SDL_HAPTIC_INFINITY;
263 pAfterburn1.eff.periodic.period = 20;
264 pAfterburn1.eff.periodic.magnitude = 0x3332;
266 pAfterburn1.id = SDL_HapticNewEffect(haptic, &pAfterburn1.eff);
268 if (pAfterburn1.id < 0) {
269 mprintf((" Afterburn effect 1 failed to load:\n %s\n", SDL_GetError()));
271 pAfterburn1.loaded = 1;
275 memset(&pAfterburn2, 0, sizeof(haptic_effect_t));
277 pAfterburn2.eff.type = SDL_HAPTIC_SINE;
278 pAfterburn2.eff.periodic.direction.type = SDL_HAPTIC_POLAR;
279 pAfterburn2.eff.periodic.direction.dir[0] = 9000;
280 pAfterburn2.eff.periodic.length = 125;
281 pAfterburn2.eff.periodic.period = 100;
282 pAfterburn2.eff.periodic.magnitude = 0x1999;
284 pAfterburn2.id = SDL_HapticNewEffect(haptic, &pAfterburn2.eff);
286 if (pAfterburn2.id < 0) {
287 mprintf((" Afterburn effect 2 failed to load:\n %s\n", SDL_GetError()));
289 pAfterburn2.loaded = 1;
294 // if (supported & SDL_HAPTIC_SQUARE) {
295 if (supported & SDL_HAPTIC_TRIANGLE) {
297 memset(&pDock, 0, sizeof(haptic_effect_t));
299 // pDock.eff.type = SDL_HAPTIC_SQUARE;
300 pDock.eff.type = SDL_HAPTIC_TRIANGLE;
301 pDock.eff.periodic.direction.type = SDL_HAPTIC_POLAR;
302 pDock.eff.periodic.direction.dir[0] = 9000;
303 pDock.eff.periodic.length = 125;
304 pDock.eff.periodic.period = 100;
305 pDock.eff.periodic.magnitude = 0x3332;
307 pDock.id = SDL_HapticNewEffect(haptic, &pDock.eff);
310 mprintf((" Dock effect failed to load:\n %s\n", SDL_GetError()));
317 static bool joy_ff_can_play()
319 return (Joy_ff_enabled && Joy_ff_acquired);
322 static void joy_ff_update_effect(haptic_effect_t *eff, const char *name)
324 if ( !eff->loaded ) {
328 if ( SDL_HapticUpdateEffect(haptic, eff->id, &eff->eff) < 0 ) {
329 mprintf(("HapticERROR: Unable to update %s:\n %s\n", name, SDL_GetError()));
333 static void joy_ff_start_effect(haptic_effect_t *eff, const char *name)
335 if ( !eff->loaded ) {
339 // nprintf(("Joystick", "FF: Starting effect %s\n", name));
341 if ( SDL_HapticRunEffect(haptic, eff->id, 1) ) {
342 mprintf(("HapticERROR: Unable to run %s:\n %s\n", name, SDL_GetError()));
346 void joy_ff_stop_effects()
348 if ( !Joy_ff_enabled ) {
352 SDL_HapticStopAll(haptic);
355 void joy_ff_mission_init(vector v)
359 joy_ff_handling_scaler = (int) ((vm_vec_mag(&v) + 1.3f) * 5.0f);
361 Joy_ff_afterburning = 0;
363 joy_ff_adjust_handling(0);
365 if ( !joy_ff_effect_playing(&pSpring) ) {
366 joy_ff_start_effect(&pSpring, "Spring");
369 // reset afterburn effects to default values
371 pAfterburn1.eff.periodic.length = SDL_HAPTIC_INFINITY;
372 pAfterburn1.eff.periodic.period = 20;
373 pAfterburn1.eff.periodic.magnitude = 0x3332;
374 pAfterburn1.eff.periodic.attack_length = 0;
376 joy_ff_update_effect(&pAfterburn1, "pAfterburn1 (init)");
378 pAfterburn2.eff.periodic.length = SDL_HAPTIC_INFINITY;
379 pAfterburn2.eff.periodic.period = 100;
380 pAfterburn2.eff.periodic.magnitude = 0x1999;
381 pAfterburn2.eff.periodic.attack_length = 0;
383 joy_ff_update_effect(&pAfterburn2, "pAfterburn2 (init)");
385 // reset primary shoot effect to default values
387 pShootEffect.eff.periodic.direction.dir[0] = 0;
388 pShootEffect.eff.periodic.length = 160;
389 pShootEffect.eff.periodic.fade_length = 120;
391 joy_ff_update_effect(&pShootEffect, "pShootEffect (init)");
394 void joy_reacquire_ff()
396 if ( !Joy_ff_enabled ) {
400 if (Joy_ff_acquired) {
404 joy_ff_start_effect(&pSpring, "Spring");
409 void joy_unacquire_ff()
411 if ( !Joy_ff_enabled ) {
415 if ( !Joy_ff_acquired ) {
419 joy_ff_stop_effects();
424 void joy_ff_play_vector_effect(vector *v, float scaler)
429 if ( !joy_ff_can_play() ) {
433 // nprintf(("Joystick", "FF: vec = { %f, %f, %f } s = %f\n", v->xyz.x, v->xyz.y, v->xyz.z, scaler));
434 vm_vec_copy_scale(&vf, v, scaler);
438 if (vf.xyz.y + vf.xyz.z < 0.0f) {
439 y = -vm_vec_mag(&vf);
444 joy_ff_play_dir_effect(-x, -y);
447 void joy_ff_play_dir_effect(float x, float y)
452 if ( !joy_ff_can_play() ) {
456 // allow for at least one of the effects to work
457 if ( !pHitEffect1.loaded && !pHitEffect2.loaded ) {
461 if (joy_ff_effect_playing(&pHitEffect1) || joy_ff_effect_playing(&pHitEffect2)) {
462 nprintf(("Joystick", "FF: HitEffect already playing. Skipping\n"));
466 if (Joy_ff_directional_hit_effect_enabled) {
469 } else if (x < -8000.0f) {
475 } else if (y < -8000.0f) {
479 imag = (int) fl_sqrt(x * x + y * y);
484 degs = (float)atan2(x, y);
485 idegs = (int) (degs * 18000.0f / PI) + 90;
490 while (idegs >= 36000) {
494 if (pHitEffect1.loaded) {
495 pHitEffect1.eff.constant.direction.dir[0] = idegs;
496 pHitEffect1.eff.constant.level = (Sint16)(32767.0f * (imag / 10000.0f));
498 joy_ff_update_effect(&pHitEffect1, "pHitEffect1");
505 if (pHitEffect2.loaded) {
506 pHitEffect2.eff.periodic.direction.dir[0] = idegs;
507 pHitEffect2.eff.periodic.magnitude = (Sint16)(32767.0f * (imag / 10000.0f));
509 joy_ff_update_effect(&pHitEffect2, "pHitEffect2");
513 joy_ff_start_effect(&pHitEffect1, "HitEffect1");
514 joy_ff_start_effect(&pHitEffect2, "HitEffect2");
517 void joy_ff_play_primary_shoot(int gain)
519 if ( !joy_ff_can_play() ) {
523 if ( !pShootEffect.loaded && !Joy_rumble ) {
529 if (pShootEffect.loaded) {
530 SDL_HapticStopEffect(haptic, pShootEffect.id);
532 static int primary_ff_level = 10000;
534 if (gain != primary_ff_level) {
535 pShootEffect.eff.periodic.magnitude = (Sint16)(32767.0f * (gain / 10000.0f));
537 joy_ff_update_effect(&pShootEffect, "pShootEffect");
539 primary_ff_level = gain;
542 joy_ff_start_effect(&pShootEffect, "ShootEffect");
543 } else if (Joy_rumble) {
544 static int rumble_timeout = 1;
546 if ( timestamp_elapsed(rumble_timeout) ) {
547 SDL_HapticRumblePlay(haptic, gain / 10000.0f, 100);
549 rumble_timeout = timestamp(100);
554 void joy_ff_play_secondary_shoot(int gain)
556 if ( !joy_ff_can_play() ) {
560 if ( !pSecShootEffect.loaded && !Joy_rumble ) {
564 gain = gain * 100 + 2500;
568 if (pSecShootEffect.loaded) {
569 SDL_HapticStopEffect(haptic, pSecShootEffect.id);
571 static int secondary_ff_level = 10000;
573 if (gain != secondary_ff_level) {
574 pSecShootEffect.eff.constant.level = (Sint16)(32767.0f * (gain / 10000.0f));
575 pSecShootEffect.eff.constant.length = (150000 + gain * 25) / 1000;
577 joy_ff_update_effect(&pSecShootEffect, "pSecShootEffect");
579 secondary_ff_level = gain;
580 nprintf(("Joystick", "FF: Secondary force = 0x%04x\n", pSecShootEffect.eff.constant.level));
583 joy_ff_start_effect(&pSecShootEffect, "SecShootEffect");
584 } else if (Joy_rumble) {
585 static int rumble_timeout = 1;
587 if ( timestamp_elapsed(rumble_timeout) ) {
588 int duration = (150000 + gain * 25) / 1000;
590 SDL_HapticRumblePlay(haptic, gain / 10000.0f, duration);
592 rumble_timeout = timestamp(duration);
597 void joy_ff_adjust_handling(int speed)
602 if ( !joy_ff_can_play() ) {
606 if ( !pSpring.loaded ) {
610 static int last_speed = -1000;
612 if (speed == last_speed) {
618 v = speed * joy_ff_handling_scaler * 2 / 3;
619 // v += joy_ff_handling_scaler * joy_ff_handling_scaler * 6 / 7 + 250;
620 v += joy_ff_handling_scaler * 45 - 500;
624 coeff = (short)(32767.0f * (v / 10000.0f));
626 for (int i = 0; i < SDL_HapticNumAxes(haptic); i++) {
627 pSpring.eff.condition.right_coeff[i] = coeff;
628 pSpring.eff.condition.left_coeff[i] = coeff;
631 // nprintf(("Joystick", "FF: New handling force = 0x%04x\n", coeff));
633 joy_ff_update_effect(&pSpring, "pSpring");
636 static int joy_ff_effect_playing(haptic_effect_t *eff)
638 if ( !eff->loaded ) {
641 return (SDL_HapticGetEffectStatus(haptic, eff->id) > 0);
647 if ( !joy_ff_can_play() ) {
651 if ( !pDock.loaded ) {
655 SDL_HapticStopEffect(haptic, pDock.id);
657 pDock.eff.periodic.magnitude = 0x3332;
659 joy_ff_update_effect(&pDock, "pDock");
661 joy_ff_start_effect(&pDock, "Dock");
664 void joy_ff_play_reload_effect()
666 if ( !joy_ff_can_play() ) {
670 if ( !pDock.loaded ) {
674 SDL_HapticStopEffect(haptic, pDock.id);
676 pDock.eff.periodic.magnitude = 0x1999;
678 joy_ff_update_effect(&pDock, "pDock (reload)");
680 joy_ff_start_effect(&pDock, "Dock (Reload)");
683 void joy_ff_afterburn_on()
685 if ( !joy_ff_can_play() ) {
689 if (Joy_ff_afterburning) {
693 if ( !(pAfterburn1.loaded && pAfterburn2.loaded) ) {
697 SDL_HapticStopEffect(haptic, pAfterburn1.id);
699 pAfterburn1.eff.periodic.length = SDL_HAPTIC_INFINITY;
700 pAfterburn1.eff.periodic.magnitude = 0x3332;
702 joy_ff_update_effect(&pAfterburn1, "pAfterburn1");
704 SDL_HapticStopEffect(haptic, pAfterburn2.id);
706 pAfterburn2.eff.periodic.length = SDL_HAPTIC_INFINITY;
707 pAfterburn2.eff.periodic.magnitude = 0x1999;
709 joy_ff_update_effect(&pAfterburn2, "pAfterburn2");
711 joy_ff_start_effect(&pAfterburn1, "Afterburn1");
712 joy_ff_start_effect(&pAfterburn2, "Afterburn2");
714 // nprintf(("Joystick", "FF: Afterburn started\n"));
716 Joy_ff_afterburning = 1;
719 void joy_ff_afterburn_off()
721 if ( !joy_ff_can_play() ) {
725 if ( !Joy_ff_afterburning ) {
729 if (pAfterburn1.loaded) {
730 SDL_HapticStopEffect(haptic, pAfterburn1.id);
733 if (pAfterburn2.loaded) {
734 SDL_HapticStopEffect(haptic, pAfterburn2.id);
737 Joy_ff_afterburning = 0;
739 // nprintf(("Joystick", "FF: Afterburn stopped\n"));
742 void joy_ff_explode()
744 if ( !joy_ff_can_play() ) {
748 if (pAfterburn1.loaded) {
749 SDL_HapticStopEffect(haptic, pAfterburn1.id);
752 if (pAfterburn2.loaded) {
753 SDL_HapticStopEffect(haptic, pAfterburn2.id);
756 if (pShootEffect.loaded) {
757 SDL_HapticStopEffect(haptic, pShootEffect.id);
759 pShootEffect.eff.periodic.direction.dir[0] = 9000;
760 pShootEffect.eff.periodic.length = 500;
761 pShootEffect.eff.periodic.magnitude = 0x7FFF;
762 pShootEffect.eff.periodic.fade_length = 500;
764 joy_ff_update_effect(&pShootEffect, "pShootEffect (explode)");
766 joy_ff_start_effect(&pShootEffect, "ShootEffect (Explode)");
767 } else if (Joy_rumble) {
768 static int rumble_timeout = 1;
770 if ( timestamp_elapsed(rumble_timeout) ) {
771 SDL_HapticRumblePlay(haptic, 1.0f, 500);
773 rumble_timeout = timestamp(500);
777 Joy_ff_afterburning = 0;
780 void joy_ff_fly_by(int mag)
784 if ( !joy_ff_can_play() ) {
788 if (Joy_ff_afterburning) {
792 if ( !(pAfterburn1.loaded && pAfterburn2.loaded) ) {
796 gain = mag * 120 + 4000;
800 SDL_HapticStopEffect(haptic, pAfterburn1.id);
802 pAfterburn1.eff.periodic.length = (6000 * mag + 400000) / 1000;
803 pAfterburn1.eff.periodic.magnitude = (Sint16)(26212.0f * (gain / 10000.0f));
805 joy_ff_update_effect(&pAfterburn1, "pAfterburn1 (flyby)");
807 SDL_HapticStopEffect(haptic, pAfterburn2.id);
809 pAfterburn2.eff.periodic.length = (6000 * mag + 400000) / 1000;
810 pAfterburn2.eff.periodic.magnitude = (Sint16)(13106.0f * (gain / 10000.0f));
812 joy_ff_update_effect(&pAfterburn2, "pAfterburn2 (flyby)");
814 joy_ff_start_effect(&pAfterburn1, "Afterburn1 (Fly by)");
815 joy_ff_start_effect(&pAfterburn2, "Afterburn2 (Fly by)");
818 void joy_ff_deathroll()
820 if ( !joy_ff_can_play() ) {
824 if (pAfterburn1.loaded && pAfterburn2.loaded) {
825 SDL_HapticStopEffect(haptic, pAfterburn1.id);
827 pAfterburn1.eff.periodic.length = SDL_HAPTIC_INFINITY;
828 pAfterburn1.eff.periodic.period = 200;
829 pAfterburn1.eff.periodic.magnitude = 0x7FFF;
830 pAfterburn1.eff.periodic.attack_length = 200;
832 joy_ff_update_effect(&pAfterburn1, "pAfterburn1 (deathroll)");
834 SDL_HapticStopEffect(haptic, pAfterburn2.id);
836 pAfterburn2.eff.periodic.length = SDL_HAPTIC_INFINITY;
837 pAfterburn2.eff.periodic.period = 200;
838 pAfterburn2.eff.periodic.magnitude = 0x7FFF;
839 pAfterburn2.eff.periodic.attack_length = 200;
841 joy_ff_update_effect(&pAfterburn2, "pAfterburn2 (deathroll)");
843 joy_ff_start_effect(&pAfterburn1, "Afterburn1 (Death Roll)");
844 joy_ff_start_effect(&pAfterburn2, "Afterburn2 (Death Roll)");
846 Joy_ff_afterburning = 1;