Overview | Project | Class | Tree | Deprecated | Index
| Nestopia Core API
FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## api
Class Nes::Api::Cheats

    Base
       |
       +--Nes::Api::Cheats

class Nes::Api::Cheats
extends Base

Cheats interface.

Inner Classes, Typedefs, and Enums
`struct` | `Nes::Api::Cheats::Code` Cheat code.
`typedef` | `Nes::Api::Cheats::RAM_SIZE` CPU RAM pointer reference.

Constructor Summary
`Cheats( T& instance )` Interface constructor.

Method Summary
`Result` | `ClearCodes()` Removes all existing codes.
`Result` | `DeleteCode( ulong index )` Removes an existing code.
`static Result NST_CALL` | `GameGenieDecode( const char* string, Nes::Api::Cheats::Code& code )` Decodes a Game Genie code.
`static Result NST_CALL` | `GameGenieEncode( const Nes::Api::Cheats::Code& code, char(& string )[ 9] )` Encodes into a Game Genie code.
`Result` | `GetCode( ulong index, ushort* address, uchar* value, uchar* compare, bool* useCompare ) const` Returns attributes of an existing code.
`Result` | `GetCode( ulong index, Nes::Api::Cheats::Code& code ) const` Returns an existing code.
`Ram` | `GetRam() const` Returns read-only content of CPU RAM.
`ulong` | `NumCodes() const` Returns current number of codes.
`static Result NST_CALL` | `ProActionRockyDecode( const char* string, Nes::Api::Cheats::Code& code )` Decodes a Pro-Action Rocky code.
`static Result NST_CALL` | `ProActionRockyEncode( const Nes::Api::Cheats::Code& code, char(& string )[ 9] )` Encodes into a Pro-Action Rocky code.
`Result` | `SetCode( const Nes::Api::Cheats::Code& code )` Adds a new code.

Constructor Detail

### Cheats

    public Cheats( T& instance );

  Interface constructor.

Parameters:
  `instance` - emulator instance

Method Detail

### ClearCodes

    public Result ClearCodes() throw();

  Removes all existing codes.

Returns:
  result code

### DeleteCode

    public Result DeleteCode( ulong index ) throw();

  Removes an existing code.

Parameters:
  `index` - code index
Returns:
  result code

### GameGenieDecode

    public static Result NST_CALL GameGenieDecode( const char* string, Nes::Api::Cheats::Code& code ) throw();

  Decodes a Game Genie code.

Parameters:
  `string` - Game Genie encoded string
  `code` - object to be filled
Returns:
  result code

### GameGenieEncode

    public static Result NST_CALL GameGenieEncode( const Nes::Api::Cheats::Code& code, char(& string )[ 9] ) throw();

  Encodes into a Game Genie code.

Parameters:
  `code` - code to be encoded
  `string` - Game Genie code string to be filled
Returns:
  result code

### GetCode

    public Result GetCode( ulong index, ushort* address, uchar* value, uchar* compare, bool* useCompare ) const throw();

  Returns attributes of an existing code.

Parameters:
  `index` - code index
  `address` - address to be filled or NULL if not needed
  `value` - value to be filled or NULL if not needed
  `compare` - compare-value to be filled or NULL if not needed
  `useCompare` - compare-value enable to be filled or NULL if not needed
Returns:
  result code

### GetCode

    public Result GetCode( ulong index, Nes::Api::Cheats::Code& code ) const throw();

  Returns an existing code.

Parameters:
  `index` - code index
  `code` - object to be filled
Returns:
  result code

### GetRam

    public Ram GetRam() const throw();

  Returns read-only content of CPU RAM.

Returns:
  CPU RAM

### NumCodes

    public ulong NumCodes() const throw();

  Returns current number of codes.

Returns:
  number

### ProActionRockyDecode

    public static Result NST_CALL ProActionRockyDecode( const char* string, Nes::Api::Cheats::Code& code ) throw();

  Decodes a Pro-Action Rocky code.

Parameters:
  `string` - Pro-Action Rocky encoded string
  `code` - object to be filled
Returns:
  result

### ProActionRockyEncode

    public static Result NST_CALL ProActionRockyEncode( const Nes::Api::Cheats::Code& code, char(& string )[ 9] ) throw();

  Encodes into a Pro-Action Rocky code.

Parameters:
  `code` - code to be encoded
  `string` - Pro-Action Rocky code string to be filled
Returns:
  result code

### SetCode

    public Result SetCode( const Nes::Api::Cheats::Code& code ) throw();

  Adds a new code.

Parameters:
  `code` - code, any existing code using the same address will be replaced
Returns:
  result code

Overview | Project | Class | Tree | Deprecated | Index
| Nestopia Core API
FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD