Nestopia Core API: Nes::Api::Cartridge

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::Cartridge

    Base
       |
       +--Nes::Api::Cartridge

class Nes::Api::Cartridge
extends Base

Cartridge interface.

Inner Classes, Typedefs, and Enums
`typedef` | `Nes::Api::Cartridge::ChooseProfileCallback` Cartridge profile chooser callback prototype.
`class` | `Nes::Api::Cartridge::Database` Database interface
`struct` | `Nes::Api::Cartridge::NesHeader` iNES header format context.
`struct` | `Nes::Api::Cartridge::Profile` Cartridge profile context.

Field Summary
`static Nes::Api::Cartridge::ChooseProfileCaller` | `chooseProfileCallback` Cartridge profile chooser callback manager.

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

Method Summary
`Nes::Api::Cartridge::Database` | `GetDatabase()` Returns the database interface.
`const Nes::Api::Cartridge::Profile*` | `GetProfile() const` Returns the current cartridge profile.
`static Result` | `ReadInes( std::istream& stream, Machine::FavoredSystem system, Nes::Api::Cartridge::Profile& profile )` Creates a profile of an iNES file.
`static Result` | `ReadRomset( std::istream& stream, Machine::FavoredSystem system, bool askProfile, Nes::Api::Cartridge::Profile& profile )` Creates a profile of an XML ROM set file.
`static Result` | `ReadUnif( std::istream& stream, Machine::FavoredSystem system, Nes::Api::Cartridge::Profile& profile )` Creates a profile of a UNIF file.

Field Detail

### chooseProfileCallback

    public static Nes::Api::Cartridge::ChooseProfileCaller chooseProfileCallback;

  Cartridge profile chooser callback manager. Static object used for adding the user defined callback.

Constructor Detail

### Cartridge

    public Cartridge( T& instance );

  Interface constructor.

Parameters:
  `instance` - emulator instance

Method Detail

### GetDatabase

    public Nes::Api::Cartridge::Database GetDatabase() throw();

  Returns the database interface.

Returns:
  database interface

### GetProfile

    public const Nes::Api::Cartridge::Profile* GetProfile() const throw();

  Returns the current cartridge profile.

Returns:
  pointer to current profile, NULL if no cartridge has been loaded into the system

### ReadInes

    public static Result ReadInes( std::istream& stream, Machine::FavoredSystem system, Nes::Api::Cartridge::Profile& profile ) throw();

  Creates a profile of an iNES file.

Parameters:
  `stream` - input stream to iNES file
  `system` - preferred system in case of multiple profiles
  `profile` - object to be filled
Returns:
  result code

### ReadRomset

    public static Result ReadRomset( std::istream& stream, Machine::FavoredSystem system, bool askProfile, Nes::Api::Cartridge::Profile& profile ) throw();

  Creates a profile of an XML ROM set file.

Parameters:
  `stream` - input stream to XML file
  `system` - preferred system in case of multiple profiles
  `askProfile` - allow callback triggering for choosing between multiple profiles
  `profile` - object to be filled
Returns:
  result code

### ReadUnif

    public static Result ReadUnif( std::istream& stream, Machine::FavoredSystem system, Nes::Api::Cartridge::Profile& profile ) throw();

  Creates a profile of a UNIF file.

Parameters:
  `stream` - input stream to UNIF file
  `system` - preferred system in case of multiple profiles
  `profile` - object to be filled
Returns:
  result code

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