|
resonance 1.0.1
|
Controller reader that matches button sequences against a table of cheats. More...
#include <inputcheatdetector.h>


Classes | |
| struct | CheatSequence |
| One cheat, as InputCheatDetector::RegisterCheats() at 0x001dabc8 builds it. More... | |
Public Member Functions | |
| InputCheatDetector (std::vector< CheatSequence > *pCheats) | |
| Attach the detector to a table of cheats. | |
| virtual void | OnControllerReading (int nType, int nSlot, int nButton, float flValue) |
| Match one controller reading against the table. | |
| virtual void | UnusedHook ()=0 |
| A hook that does nothing. | |
| Public Member Functions inherited from RawController | |
| virtual | ~RawController () |
Controller reader that matches button sequences against a table of cheats.
Its RTTI descriptor is at 0x008f2a40. It has RawController as its one public base at offset 0. Both allocations (GrooveWorld's constructor at 0x0018c00c and MetaGameWorld's at 0x003d313c) fix the object at 8 bytes. The inherited vptr at +0x00 is followed by one member. Its vtable at 0x007e6778 has four entries and a zero terminator at index 4: the type function at 0x001dea88, the destructor at 0x001deb00, the RawController override at 0x001dc658, and slot 3, filled with the pure-virtual stub at 0x005381a8. The class is abstract, and InputCheatDetectorGS and InputCheatDetectorMet complete it.
The destructor at 0x001deb00 stores RawController's table and releases the object, which is the implicitly declared destructor, so this class owes no definition.
The four per-controller input histories, the registered flag, and the 0.75-second timeout are file-local to the detector's translation unit.
|
explicit |
Attach the detector to a table of cheats.
The body builds the shared tables through RegisterCheats() on first use, flagged by the word at 0x00691db0, and then empties the four input histories at 0x00691db8, each 0x18 bytes with a vector at +0x08. MetaGameWorld passes g_metCheatSequences, and GrooveWorld passes g_gameCheatSequences. The static initialiser at 0x001de3e8 zeroes both, and the push-back routines at 0x001deb90 and 0x001deb30 append 0x14-byte records to them.
| pCheats | The table to match against. |
|
virtual |
Match one controller reading against the table.
Slot 2.
Only a joystick press counts (type 'joy ', a button number below 100, and a value of at least 0.1). The press joins the slot's history, which restarts when more than 0.75 seconds passed since the previous press. Every cheat whose sequence the history now includes clears the history and runs script template 0xce with the cheat's name and the zero-based slot.
| nType | The reading's device type, a four-character code. |
| nSlot | The controller's slot, from 1. |
| nButton | The button number. |
| flValue | The reading's value. |
Implements RawController.
|
pure virtual |
A hook that does nothing.
Slot 3, pure in this class.
Both overrides, InputCheatDetectorGS's at 0x001940d8 and InputCheatDetectorMet's at 0x003d4788, are empty, and the image has no call through the slot. The verb, the parameter list, and the return type are unrecovered.
Implemented in InputCheatDetectorGS, and InputCheatDetectorMet.