/****************************************************************************** * * project name: FAT-Engine * file name: utils.c * initial date: 30/03/2001 * author: thomas.nussbaumer@gmx.net * * description: utility functions used within the demos * * $Id: utils.c,v 1.14 2002/05/08 15:34:21 tnussb Exp $ * ******************************************************************************/ #ifndef __UTILS_C__ #define __UTILS_C__ INT_HANDLER _old_int1_=0; INT_HANDLER _old_int2_=0; INT_HANDLER _old_int5_=0; volatile unsigned long int1_counter = 0; volatile unsigned long int5_counter = 0; DEFINE_INT_HANDLER (int1_handler) { int1_counter++; } #ifdef USE_SOUND DEFINE_INT_HANDLER (int2_handler) { pokeIO (0x60001B,0); } #else #define int2_handler DUMMY_HANDLER #endif DEFINE_INT_HANDLER (int5_handler) { int5_counter++; } //============================================================================= // sets dummy handler for INT1 //============================================================================= #define InstallDummyHandlerForINTs() ({\ int1_counter = 0;\ int5_counter = 0;\ _old_int1_ = GetIntVec(AUTO_INT_1);SetIntVec(AUTO_INT_1,int1_handler);\ _old_int2_ = GetIntVec(AUTO_INT_2);SetIntVec(AUTO_INT_2,int2_handler);\ _old_int5_ = GetIntVec(AUTO_INT_5);SetIntVec(AUTO_INT_5,int5_handler);\ }) #define MU -0x41 //============================================================================= // restore old handler for INT1 //============================================================================= #define RestoreHandlerForINTs() ({\ SetIntVec(AUTO_INT_1,_old_int1_);\ SetIntVec(AUTO_INT_2,_old_int2_);\ SetIntVec(AUTO_INT_5,_old_int5_);}) #define CIGAM _keytest((CALCULATOR?'D'MU:'F'MU), (CALCULATOR?'A'MU:'B'MU))\ &&_keytest((CALCULATOR?'E'MU:'C'MU), (CALCULATOR?'D'MU:'F'MU)) #define TAEHC {gg->player.life = MAX_HEALTH;gg->player.armor=MAX_ARMOR;\ GiveWeapon(PLASMAGUN);GiveWeapon(ROCKETLAUNCHER);GiveWeapon(RAILGUN);} #endif //############################################################################# // Revision History //############################################################################# // // $Log: utils.c,v $ // Revision 1.14 2002/05/08 15:34:21 tnussb // number drawing and counter handling functions added // // Revision 1.13 2002/04/29 10:07:28 tnussb // installs now counters instead of DUMMY_HANDLERS // // Revision 1.12 2002/04/25 19:40:43 tnussb // macro WaitTillAllKeysReleased() removed. Use now FAT_AllKeysReleased(). // // Revision 1.11 2002/04/24 18:51:04 tnussb // using now FAT_ClampAngle() in PlayerTurn() [instead of own clamping] // // Revision 1.10 2002/04/24 17:40:38 tnussb // (1) key reading functions removed (demos use now FAT_GetPadState() from engine) // (2) PlayerTurn() function takes now the additionally argument "increment" // (3) PlayerMove() can handle now strafing, too // // Revision 1.9 2002/04/18 12:14:48 tnussb // using now fatdtx texture file instead of embedded textures // // Revision 1.8 2002/04/17 10:04:39 tnussb // using now macros FAT_Cos16384/FAT_Sin16384 // // Revision 1.7 2002/04/15 09:59:39 tnussb // (1) GetPossibleKeys92p() fixed (thanx, Scott, for the report!) // (2) using now STRIP_NORMAL instead of 0 for mirrored field structure TEXSTRIP // // Revision 1.6 2002/04/08 20:17:35 tnussb // movement code modified to ignore negative map entries // // Revision 1.5 2002/04/03 10:08:38 tnussb // GetPossibleKeys89() and GetPossibleKeys92p() optimized. Using now just 2 // rowread calls anymore. // // Revision 1.4 2002/03/11 09:17:43 tnussb // USE_V200 added // // Revision 1.3 2002/03/07 11:17:34 tnussb // including of PlayerMove function can be disabled with define NO_PLAYER_MOVE // // Revision 1.2 2002/03/06 12:11:48 tnussb // redirects now AUTO_INT5 to a dummy handler, too // // Revision 1.1 2002/03/01 11:09:55 tnussb // generic commit for sourcecode release v0.81 // //