m_cheat.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Emacs style mode select -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // DESCRIPTION:
  18. // Cheat code checking.
  19. //
  20. //-----------------------------------------------------------------------------
  21. #ifndef __M_CHEAT__
  22. #define __M_CHEAT__
  23. //
  24. // CHEAT SEQUENCE PACKAGE
  25. //
  26. #define SCRAMBLE(a) \
  27. ((((a)&1)<<7) + (((a)&2)<<5) + ((a)&4) + (((a)&8)<<1) \
  28. + (((a)&16)>>1) + ((a)&32) + (((a)&64)>>5) + (((a)&128)>>7))
  29. typedef struct
  30. {
  31. unsigned char* sequence;
  32. unsigned char* p;
  33. } cheatseq_t;
  34. int
  35. cht_CheckCheat
  36. ( cheatseq_t* cht,
  37. char key );
  38. void
  39. cht_GetParam
  40. ( cheatseq_t* cht,
  41. char* buffer );
  42. #endif
  43. //-----------------------------------------------------------------------------
  44. //
  45. // $Log:$
  46. //
  47. //-----------------------------------------------------------------------------