1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
6 // Copyright (C) 1993-1996 by id Software, Inc.
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.
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
18 // Revision 1.1 2000/02/29 18:21:04 stegerg
19 // Doom port based on ADoomPPC. Read README.AROS!
23 // Cheat sequence checking.
25 //-----------------------------------------------------------------------------
34 // CHEAT SEQUENCE PACKAGE
37 static int firsttime
= 1;
38 static unsigned char cheat_xlate_table
[256];
42 // Called in st_stuff module, which handles the input.
43 // Returns a 1 if the cheat was successful, 0 if failed.
56 for (i
=0;i
<256;i
++) cheat_xlate_table
[i
] = SCRAMBLE(i
);
60 cht
->p
= cht
->sequence
; // initialize if first time
65 (cheat_xlate_table
[(unsigned char)key
] == *cht
->p
) cht
->p
++;
67 cht
->p
= cht
->sequence
;
71 else if (*cht
->p
== 0xff) // end of sequence character
73 cht
->p
= cht
->sequence
;
97 while (c
&& *p
!=0xff );