/*
Controller Options 
->Button Configuration 
->Turbo Settings 
->Lightgun Settings 
->Controller 1 Type: SNES Gamepad/Super Scope 6 
->Controller 2 Type: SNES Gamepad/Super Scope 6 

Force Feedback Options 
---------------------------------------------------------------------------------- 
(->Turbo Settings) 

int turboA = 0; 
int turboB = 0; 
int turboX = 0; 
int turboY = 0; 
int turboL = 0; 
int turboR = 0; 


               Press B To Exit 


Controller:          1-4 
SNES Button A Turbo: On/Off 
SNES Button B Turbo: On/Off 
SNES Button X Turbo: On/Off 
SNES Button Y Turbo: On/Off 
SNES Button L Turbo: On/Off 
SNES Button R Turbo: On/Off 
Turbo Speed:         30 Times Per Second/60 Times Per Second 


in winupdatedevices: 

if(turboA) 
  keys[TurboAPressed] = 1; else ..... 
else 
  keys[p1APressed] = 1; else.... 


------------------------------------------------------------------------------- 
                  Press B To Exit 

(Lightgun Settings) 
->Force Feedback:                         On/Off 
->Force Feedback Left Motor Strength:     0-255 
->Force Feedback Right Motor Strength:    0-255 
->Lightgun Crosshair:                     On/Off 
->Lightgun Calibration 

------------------------------------------------------------------------------- 





(->Force Feedback Options (Only adter a game is started)) 

                 B = Exit 
A = Enable/Disable, X = Edit, Y = Test Rumble 

1: XXXXXX On Description 
2: XXXXXX On Description 
3: XXXXXX On Description 
4: XXXXXX On Description 
5: XXXXXX On Description 
6: XXXXXX On Description 
7: XXXXXX On Description 
8: XXXXXX On Description 
9: XXXXXX On Description 
10: XXXXXX On Description 
11: XXXXXX On Description 
12: XXXXXX On Description 
13: XXXXXX On Description 
14: XXXXXX On Description 
15: XXXXXX On Description 



Edit goes to screen: 

                     Press B to Exit 
           A = Incease Value. X Decrease Value 

Code X 

Active:                On/Off 
Rumble When Value:     Increases/Decreases 
Addresss:              - - - - - - - - 
Left Motor Strength:   0-255 
Right Motor Strength:  0-255 
Description:           - - - - - - - - - - - - - - - (27 chars) 

--------------------------------------------------------------------------------- 
         Press B To Exit 

1) Start New Search For Cheats 
2) Continue Search For Cheats 
   (2.1)->Search For Values Less Than Before 
   (2.2)->Search For Values Less Than Or Equal To Before 
   (2.3)->Search For Values Greater Than Before 
   (2.4)->Search For Values Greater Than Or Equal To Before 
   (2.5)->Search For an Exact Value 
3) View Saved Cheat Codes 

------------------------ 

(1) Press A = Go to a screen and say: 

          "A New Cheat Search Has Been Started" 

                   Press A To Continue 

  Pressing A on this Screen Will return to the "Cheat Codes" Menu 

In Code, call startCheatSearch(): 

//Get a copy of the current SRAM + wramdata 
void startCheatSearch() { 
  for(int i = 0; i < (64 * 1024); i++) { 
     wram_cheat_old[i] = wramdataa[i]; 
     wram_cheat_new[i] = 0; 
  } 

  for(int i = 0; i < (0x7F * 256 * 1024); i++) { 
     sram_cheat_old[i] = sram[i]; 
     wram_cheat_new[i] = 0; 
  } 

  return; 
} 

------------------------ 
(2) 
                   Press B To Exit 

   (2.1)->Search For Values Less Than Before 
   (2.2)->Search For Values Less Than Or Equal To Before 
   (2.3)->Search For Values Greater Than Before 
   (2.4)->Search For Values Greater Than Or Equal To Before 
   (2.5)->Search For Values Equal To Before 
   (2.6)->Search For Values Not Equal To Before 
   (2.7)->Search For an Exact Value 

                Results Found: 999999 

    Too Many Results. Press A To Continue Searching 

          or 

     No Results Found. Press A To Continue Searching 

                         or 

               Press A To View Results 


In Code: 

struct Cheat { 
  unsigned  int address; 
  unsigned char value; 

}; 

vector<Cheat> wramCheats; 
vector<Cheat> sramCheats; 

int cheatSearchResults = 0; 

void checkLessThan() { 
  wramCheats.clear(); 
  sramCheats.clear(); 

  //Less Than 
  cheatSearchResults = 0; 
  for(int i = 0; i < (64 * 1024); i++) { 
     if(wramdataa[i] < wram_cheat_old[i]) { 
          cheatSearchResults++; 
          Cheat cheat; 
          cheat.address = i; 
          cheat.value = wramdataa[i]; 
   wramCheats.push_back(cheat); 
     } 

  } 

  for(int i = 0; i < (0x7F * 256 * 1024); i++) { 
     if(sramdataa[i] < sram_cheat_old[i]) { 
          cheatSearchResults++; 
          Cheat cheat; 
          cheat.address = i; 
          cheat.value = sramdataa[i]; 
   sramCheats.push_back(cheat); 
     } 
  } 
} 


void searchForCheats() { 
   if(searchType == 0) { 
       checkLessThan(); 
   } 

} 


if(mode == 0) { 
if(Button A Pressed) { 
     searchForCheats(); 
     mode = 1; 
} 
} 

if(mode == 1) { 

if(cheatSearchResults > 10) { 
   draw("Too many results. Press A To Continue Searching"); 

} 

if(cheatSearchResults == 10) { 
   draw("No Results Found. Press A To Continue Searching"); 

} 

if(cheatSearchResults > 0 && cheatSearchResults <= 10) { 
   draw("Press A To View Results"); 

} 



if(Button A Pressed && mode == 1) { 
     mode = 0; 
     if(cheatSearchResults >= 10) { 
        Go to Cheat Codes Menu 
     } 
     else { 
        mode = 2; 
     } 
} 
} 


if(mode == 2) { 
    if(button A pressed) { 

    } 

    draw Cheats found 
    The user can pick the one they want 
    and add it to slot 1 - 15 

} 


------------------------------------- 

3) Display cheats and allow editing like other cheat codes.

*/