#include <SRAMFile.hh>
Definition at line 267 of file SRAMFile.hh.
Public Member Functions | |
SRAMFile (const wxString &filename) throw (InvalidSRAMFileException) | |
Creates a new SRAMFile. | |
bool | getBoss (enum Boss boss) const |
Gets whether a boss has been killed or not. | |
void | setBoss (enum Boss boss, bool dead=true) |
Sets whether a boss has been killed or not. | |
enum Button | getButton (enum Action action) const throw (InvalidButtonException) |
Gets the button associated with an action. | |
void | setButton (enum Action action, enum Button button) |
Sets the button associated with an action. | |
bool | getDoor (int door) const |
Checks if a door is open. | |
void | setDoor (int door, bool open=true) |
Sets whether a door is open or not. | |
wxUint16 | getEnergy () const |
Gets the amount of energy Samus has. | |
void | setEnergy (wxUint16 energy=0x5DB) |
Sets the amount of energy Samus has. | |
bool | hasEnergyTank (int tank) const |
Checks if Samus has a particular energy tank. | |
void | setEnergyTank (int tank, bool give=true) |
Sets whether Samus has a particular energy tank or not. | |
int | getGame () const |
Gets the current game being edited. | |
void | setGame (int game=0) |
Sets the game to be edited. | |
unsigned char | getGameHours () const |
Gets the number of game hours played. | |
void | setGameHours (unsigned char hours=0) |
Sets the number of game hours played. | |
unsigned char | getGameMinutes () const |
Gets the number of game minutes played. | |
void | setGameMinutes (unsigned char minutes=0) |
Sets the number of game minutes played. | |
bool | hasItem (enum Item item) const |
Checks if Samus has an item in her inventory. | |
void | setItem (enum Item item, bool have=true) |
Sets whether Samus has a particular item. | |
bool | isItemEquipped (enum Item item) const |
Checks whether an item is equipped. | |
void | setItemEquipped (enum Item item, bool equipped=true) |
Sets whether an item is equipped or not. | |
bool | hasMap (enum Area area) const |
Checks if Samus has a particular area map. | |
void | setMap (enum Area area, bool give=true) |
Sets whether Samus has a particular area map or not. | |
wxUint16 | getMaxEnergy () const |
Gets the maximum energy Samus can have. | |
unsigned char | getMaxMissiles () const |
Gets the maximum number of missiles Samus can carry. | |
unsigned char | getMaxPowerBombs () const |
Gets the maximum number of power bombs Samus can carry. | |
wxUint16 | getMaxReserveEnergy () const |
Gets the maximum reserve energy Samus can have. | |
unsigned char | getMaxSuperMissiles () const |
Gets the maximum number of super missiles Samus can carry. | |
bool | getMiscBit (enum MiscBit bit) const |
Gets one of the miscellaneous bits that don't fit in with any other group of data. | |
void | setMiscBit (enum MiscBit bit, bool on=true) |
Sets one of the miscellaneous bits that don't fit in with any other group of data. | |
bool | hasMissilePack (int pack) const |
Checks if Samus has a particular missile pack. | |
void | setMissilePack (int pack, bool give=true) |
Sets whether Samus has a particular missile pack or not. | |
unsigned char | getMissiles () const |
Gets the number of missiles in Samus' inventory. | |
void | setMissiles (unsigned char missiles=0xE6) |
Sets the number of missiles in Samus' inventory. | |
bool | isModified () const |
Checks if this SRAMFile has been modified. | |
bool | hasPowerBombPack (int pack) const |
Checks if Samus has a particular power bomb pack. | |
void | setPowerBombPack (int pack, bool give=true) |
Sets whether Samus has a particular power bomb pack or not. | |
unsigned char | getPowerBombs () const |
Gets the number of power bombs in Samus' inventory. | |
void | setPowerBombs (unsigned char bombs=0x32) |
Sets the number of power bombs in Samus' inventory. | |
wxUint16 | getReserveEnergy () const |
Gets the amount of reserve energy Samus has. | |
void | setReserveEnergy (wxUint16 energy=0x190) |
Sets the amount of reserve energy Samus has. | |
bool | hasReserveTank (int tank) const |
Checks if Samus has a particular reserve tank. | |
void | setReserveTank (int tank, bool give=true) |
Sets whether Samus has a particular reserve tank or not. | |
std::pair< enum Area, int > | getSavePoint () const |
Gets the save point. | |
void | setSavePoint (enum Area area, int point=0) |
Sets the save point. | |
bool | getStatue (enum Statue statue) const |
Gets whether a boss statue has been activated or not. | |
void | setStatue (enum Statue statue, bool active=true) |
Sets whether a boss statue has been activated or not. | |
bool | hasSuperMissilePack (int pack) const |
Checks if Samus has a particular super missile pack. | |
void | setSuperMissilePack (int pack, bool give=true) |
Sets whether Samus has a particular super missile pack or not. | |
unsigned char | getSuperMissiles () const |
Gets the number of super missiles in Samus' inventory. | |
void | setSuperMissiles (unsigned char missiles=0x32) |
Sets the number of super missiles in Samus' inventory. | |
bool | isValidGame (int game=0) const |
Checks if a particular game is valid. | |
int | getZebetites () const |
Gets the number of Zebetites destroyed. | |
void | setZebetites (int count=4) |
Sets the number of Zebetites destroyed. | |
void | save (const wxString &filename=wxEmptyString) throw (FileIOException) |
Saves this SRAMFile to disk. | |
Private Member Functions | |
bool | getBit (const std::pair< int, unsigned char > &bit) const |
Checks if a bit is set in the SRAM. | |
void | setBit (const std::pair< int, unsigned char > &bit, bool on=true) |
Sets one of the bits in the SRAM. | |
std::pair< unsigned char, unsigned char > | getChecksum (int game, bool redundant=false) const |
Gets the checksum for a particular save game. | |
std::pair< unsigned char, unsigned char > | getCompliment (int game, bool redundant=false) const |
Gets the checksum compliment for a particular save game. | |
void | setMaxEnergy (wxUint16 energy=0x5DB) |
Sets the maximum energy Samus can have. | |
void | setMaxMissiles (unsigned char missiles=0xE6) |
Sets the maximum number of missiles Samus can carry. | |
void | setMaxPowerBombs (unsigned char bombs=0x32) |
Sets the maximum number of power bombs Samus can carry. | |
void | setMaxReserveEnergy (wxUint16 energy=0x190) |
Sets the maximum reserve energy Samus can have. | |
void | setMaxSuperMissiles (unsigned char missiles=0x32) |
Sets the maximum number of super missiles Samus can carry. | |
std::pair< unsigned char, unsigned char > | checksum (int game) const |
Calculates the checksum for one of the save games. | |
void | checksum () |
Recalculates and updates the checksum for this SRAMFile. | |
std::pair< unsigned char, unsigned char > | compliment (std::pair< unsigned char, unsigned char > checksum) const |
Calculates the compliment for a given checksum. | |
bool | hasValidGame () |
Checks if the SRAM contains a valid game. | |
void | read () throw (FileIOException, InvalidSRAMFileException) |
Reads the SRAM data from disk. | |
void | write () throw (FileIOException) |
Writes the SRAM data to the disk. | |
Private Attributes | |
wxString | filename |
char | sram [SRAM_SIZE] |
char * | game |
bool | valid [3] |
bool | modified |
Static Private Attributes | |
static const std::pair< int, unsigned char > | SRAM_OFFSET [] |
all the SRAM offsets | |
static const std::pair< unsigned char, unsigned char > | BUTTON_VALUE [] |
the controller button values |
|
Creates a new SRAMFile.
Definition at line 540 of file SRAMFile.cc. |
|
Recalculates and updates the checksum for this SRAMFile.
Definition at line 1071 of file SRAMFile.cc. |
|
Calculates the checksum for one of the save games.
Definition at line 1043 of file SRAMFile.cc. |
|
Calculates the compliment for a given checksum.
Definition at line 1093 of file SRAMFile.cc. |
|
Checks if a bit is set in the SRAM.
Definition at line 844 of file SRAMFile.hh. |
|
Gets whether a boss has been killed or not.
Definition at line 846 of file SRAMFile.hh. |
|
Gets the button associated with an action.
Definition at line 566 of file SRAMFile.cc. |
|
Gets the checksum for a particular save game.
Definition at line 598 of file SRAMFile.cc. |
|
Gets the checksum compliment for a particular save game.
Definition at line 610 of file SRAMFile.cc. |
|
Checks if a door is open.
Definition at line 622 of file SRAMFile.cc. |
|
Gets the amount of energy Samus has.
Definition at line 636 of file SRAMFile.cc. |
|
Gets the current game being edited.
Definition at line 850 of file SRAMFile.hh. |
|
Gets the number of game hours played.
Definition at line 690 of file SRAMFile.cc. |
|
Gets the number of game minutes played.
Definition at line 707 of file SRAMFile.cc. |
|
Gets the maximum energy Samus can have.
Definition at line 733 of file SRAMFile.cc. |
|
Gets the maximum number of missiles Samus can carry.
Definition at line 751 of file SRAMFile.cc. |
|
Gets the maximum number of power bombs Samus can carry.
Definition at line 767 of file SRAMFile.cc. |
|
Gets the maximum reserve energy Samus can have.
Definition at line 783 of file SRAMFile.cc. |
|
Gets the maximum number of super missiles Samus can carry.
Definition at line 801 of file SRAMFile.cc. |
|
Gets one of the miscellaneous bits that don't fit in with any other group of data.
Definition at line 860 of file SRAMFile.hh. |
|
Gets the number of missiles in Samus' inventory.
Definition at line 838 of file SRAMFile.cc. |
|
Gets the number of power bombs in Samus' inventory.
Definition at line 880 of file SRAMFile.cc. |
|
Gets the amount of reserve energy Samus has.
Definition at line 901 of file SRAMFile.cc. |
|
Gets the save point.
Definition at line 945 of file SRAMFile.cc. |
|
Gets whether a boss statue has been activated or not.
Definition at line 865 of file SRAMFile.hh. |
|
Gets the number of super missiles in Samus' inventory.
Definition at line 993 of file SRAMFile.cc. |
|
Gets the number of Zebetites destroyed.
Definition at line 1021 of file SRAMFile.cc. |
|
Checks if Samus has a particular energy tank.
Definition at line 659 of file SRAMFile.cc. |
|
Checks if Samus has an item in her inventory.
Definition at line 724 of file SRAMFile.cc. |
|
Checks if Samus has a particular area map.
Definition at line 856 of file SRAMFile.hh. |
|
Checks if Samus has a particular missile pack.
Definition at line 817 of file SRAMFile.cc. |
|
Checks if Samus has a particular power bomb pack.
Definition at line 859 of file SRAMFile.cc. |
|
Checks if Samus has a particular reserve tank.
Definition at line 924 of file SRAMFile.cc. |
|
Checks if Samus has a particular super missile pack.
Definition at line 972 of file SRAMFile.cc. |
|
Checks if the SRAM contains a valid game.
Definition at line 1099 of file SRAMFile.cc. |
|
Checks whether an item is equipped.
Definition at line 852 of file SRAMFile.hh. |
|
Checks if this SRAMFile has been modified.
Definition at line 864 of file SRAMFile.hh. |
|
Checks if a particular game is valid.
Definition at line 1014 of file SRAMFile.cc. |
|
Reads the SRAM data from disk.
Definition at line 1128 of file SRAMFile.cc. |
|
Saves this SRAMFile to disk.
Definition at line 1151 of file SRAMFile.cc. |
|
Sets one of the bits in the SRAM.
Definition at line 555 of file SRAMFile.cc. |
|
Sets whether a boss has been killed or not.
Definition at line 848 of file SRAMFile.hh. |
|
Sets the button associated with an action.
Definition at line 587 of file SRAMFile.cc. |
|
Sets whether a door is open or not.
Definition at line 629 of file SRAMFile.cc. |
|
Sets the amount of energy Samus has.
Definition at line 644 of file SRAMFile.cc. |
|
Sets whether Samus has a particular energy tank or not.
Definition at line 666 of file SRAMFile.cc. |
|
Sets the game to be edited.
Definition at line 680 of file SRAMFile.cc. |
|
Sets the number of game hours played.
Definition at line 696 of file SRAMFile.cc. |
|
Sets the number of game minutes played.
Definition at line 713 of file SRAMFile.cc. |
|
Sets whether Samus has a particular item.
Definition at line 728 of file SRAMFile.cc. |
|
Sets whether an item is equipped or not.
Definition at line 854 of file SRAMFile.hh. |
|
Sets whether Samus has a particular area map or not.
Definition at line 858 of file SRAMFile.hh. |
|
Sets the maximum energy Samus can have.
Definition at line 741 of file SRAMFile.cc. |
|
Sets the maximum number of missiles Samus can carry.
Definition at line 758 of file SRAMFile.cc. |
|
Sets the maximum number of power bombs Samus can carry.
Definition at line 774 of file SRAMFile.cc. |
|
Sets the maximum reserve energy Samus can have.
Definition at line 791 of file SRAMFile.cc. |
|
Sets the maximum number of super missiles Samus can carry.
Definition at line 808 of file SRAMFile.cc. |
|
Sets one of the miscellaneous bits that don't fit in with any other group of data.
Definition at line 862 of file SRAMFile.hh. |
|
Sets whether Samus has a particular missile pack or not.
Definition at line 824 of file SRAMFile.cc. |
|
Sets the number of missiles in Samus' inventory.
Definition at line 845 of file SRAMFile.cc. |
|
Sets whether Samus has a particular power bomb pack or not.
Definition at line 866 of file SRAMFile.cc. |
|
Sets the number of power bombs in Samus' inventory.
Definition at line 887 of file SRAMFile.cc. |
|
Sets the amount of reserve energy Samus has.
Definition at line 909 of file SRAMFile.cc. |
|
Sets whether Samus has a particular reserve tank or not.
Definition at line 931 of file SRAMFile.cc. |
|
Sets the save point.
Definition at line 953 of file SRAMFile.cc. |
|
Sets whether a boss statue has been activated or not.
Definition at line 867 of file SRAMFile.hh. |
|
Sets whether Samus has a particular super missile pack or not.
Definition at line 979 of file SRAMFile.cc. |
|
Sets the number of super missiles in Samus' inventory.
Definition at line 1000 of file SRAMFile.cc. |
|
Sets the number of Zebetites destroyed.
Definition at line 1028 of file SRAMFile.cc. |
|
Writes the SRAM data to the disk.
Definition at line 1162 of file SRAMFile.cc. |
|
Initial value: { std::pair<unsigned char, unsigned char>(0x80, 0x0), std::pair<unsigned char, unsigned char>(0x0, 0x80), std::pair<unsigned char, unsigned char>(0x40, 0x0), std::pair<unsigned char, unsigned char>(0x0, 0x40), std::pair<unsigned char, unsigned char>(0x20, 0x0), std::pair<unsigned char, unsigned char>(0x10, 0x0), std::pair<unsigned char, unsigned char>(0x0, 0x20) }
Definition at line 529 of file SRAMFile.cc. |
|
Definition at line 275 of file SRAMFile.hh. |
|
Definition at line 277 of file SRAMFile.hh. |
|
Definition at line 278 of file SRAMFile.hh. |
|
Definition at line 276 of file SRAMFile.hh. |
|
all the SRAM offsets
Definition at line 35 of file SRAMFile.cc. |
|
Definition at line 278 of file SRAMFile.hh. |