smse::SRAMFile Class Reference

#include <SRAMFile.hh>

List of all members.


Detailed Description

Class to encapsulate a Super Metroid SRAM File.

Definition at line 249 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 getMetroidRoom (enum MetroidRoom room) const
 Checks if one of the Metroid rooms in Tourian has been cleared.
void setMetroidRoom (enum MetroidRoom room, bool clear=true)
 Sets whether one of the Metroid rooms in Tourian is clear or not;.
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 clear (int game)
 Clears a game.
void copy (int src, int dest)
 Copies one game over another.
void save (const wxString &filename=wxEmptyString) throw (FileIOException)
 Saves this SRAMFile to disk.

Static Public Attributes

static const unsigned int SRAM_SIZE = 0x2000
 size of the SRAM file
static const unsigned int GAMES = 3
 number of save games in the SRAM data
static const unsigned int GAME_SIZE = 0x65C
 size of each individual save game
static const int GAME_OFFSET = 0x10
 offset to the beginning of the game data
static const int CHECKSUM_OFFSET = 0
 offset of the checksums
static const int CHECKSUM_OFFSET2 = 0x1FF0
 offset of the redundant checksums
static const int COMPLIMENT_OFFSET = 0x8
 offset of the checksum compliments
static const int COMPLIMENT_OFFSET2 = 0x1FF8
 offset of the redundant checksum compliments

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


Constructor & Destructor Documentation

SRAMFile::SRAMFile ( const wxString &  filename  )  throw (InvalidSRAMFileException)

Creates a new SRAMFile.

Parameters:
filename The SRAM file to open.
Exceptions:
InvalidSRAMFileException if the given file is not a valid SRAM file.

Definition at line 548 of file SRAMFile.cc.


Member Function Documentation

bool smse::SRAMFile::getBit ( const std::pair< int, unsigned char > &  bit  )  const [inline, private]

Checks if a bit is set in the SRAM.

Parameters:
bit The bit to check.
Returns:
true if the bit is set; false otherwise.

Definition at line 883 of file SRAMFile.hh.

void SRAMFile::setBit ( const std::pair< int, unsigned char > &  bit,
bool  on = true 
) [private]

Sets one of the bits in the SRAM.

Parameters:
bit The bit to set.
on true to set the bit; false otherwise.

Definition at line 563 of file SRAMFile.cc.

std::pair< unsigned char, unsigned char > SRAMFile::getChecksum ( int  game,
bool  redundant = false 
) const [private]

Gets the checksum for a particular save game.

Parameters:
game The game whose checksum to get.
redundant true for the redundant checksum; false otherwise.
Returns:
The checksum.

Definition at line 606 of file SRAMFile.cc.

std::pair< unsigned char, unsigned char > SRAMFile::getCompliment ( int  game,
bool  redundant = false 
) const [private]

Gets the checksum compliment for a particular save game.

Parameters:
game The game whose checksum compliment to get.
redundant true for the redundant compliment; false otherwise.
Returns:
The checksum compliment.

Definition at line 622 of file SRAMFile.cc.

void SRAMFile::setMaxEnergy ( wxUint16  energy = 0x5DB  )  [private]

Sets the maximum energy Samus can have.

Parameters:
energy The max energy.

Definition at line 757 of file SRAMFile.cc.

void SRAMFile::setMaxMissiles ( unsigned char  missiles = 0xE6  )  [private]

Sets the maximum number of missiles Samus can carry.

Parameters:
missiles The max missiles.

Definition at line 774 of file SRAMFile.cc.

void SRAMFile::setMaxPowerBombs ( unsigned char  bombs = 0x32  )  [private]

Sets the maximum number of power bombs Samus can carry.

Parameters:
bombs The max power bombs.

Definition at line 790 of file SRAMFile.cc.

void SRAMFile::setMaxReserveEnergy ( wxUint16  energy = 0x190  )  [private]

Sets the maximum reserve energy Samus can have.

Parameters:
energy The max reserve energy.

Definition at line 807 of file SRAMFile.cc.

void SRAMFile::setMaxSuperMissiles ( unsigned char  missiles = 0x32  )  [private]

Sets the maximum number of super missiles Samus can carry.

Parameters:
missiles The max super missiles.

Definition at line 824 of file SRAMFile.cc.

std::pair< unsigned char, unsigned char > SRAMFile::checksum ( int  game  )  const [private]

Calculates the checksum for one of the save games.

Parameters:
game The game to checksum (0-2).

Definition at line 1059 of file SRAMFile.cc.

void SRAMFile::checksum (  )  [private]

Recalculates and updates the checksum for this SRAMFile.

Definition at line 1087 of file SRAMFile.cc.

std::pair< unsigned char, unsigned char > SRAMFile::compliment ( std::pair< unsigned char, unsigned char >  checksum  )  const [private]

Calculates the compliment for a given checksum.

Parameters:
checksum The checksum to compliment.
Returns:
The checksum compliment.

Definition at line 1148 of file SRAMFile.cc.

bool SRAMFile::hasValidGame (  )  [private]

Checks if the SRAM contains a valid game.

Returns:
true if the SRAM has a valid game; false otherwise.

Definition at line 1154 of file SRAMFile.cc.

void SRAMFile::read (  )  throw (FileIOException, InvalidSRAMFileException) [private]

Reads the SRAM data from disk.

Exceptions:
FileIOException if the file cannot be read.
InvalidSRAMFileException is the file is not a valid SRAM file.

Definition at line 1183 of file SRAMFile.cc.

void SRAMFile::write (  )  throw (FileIOException) [private]

Writes the SRAM data to the disk.

Exceptions:
FileIOException if the file cannot be written.

Definition at line 1217 of file SRAMFile.cc.

bool smse::SRAMFile::getBoss ( enum Boss  boss  )  const [inline]

Gets whether a boss has been killed or not.

Parameters:
boss The boss to check.
Returns:
true if the boss is dead; false otherwise.

Definition at line 886 of file SRAMFile.hh.

void smse::SRAMFile::setBoss ( enum Boss  boss,
bool  dead = true 
) [inline]

Sets whether a boss has been killed or not.

Parameters:
boss The boss.
dead true to kill the boss; false otherwise.

Definition at line 889 of file SRAMFile.hh.

enum Button SRAMFile::getButton ( enum Action  action  )  const throw (InvalidButtonException)

Gets the button associated with an action.

Parameters:
action The action the button is associated with.
Returns:
The button.
Exceptions:
InvalidButtonException if the action has no valid button associated with it.

Definition at line 574 of file SRAMFile.cc.

void SRAMFile::setButton ( enum Action  action,
enum Button  button 
)

Sets the button associated with an action.

Parameters:
action The action the button is to be associated with.
button The button to associate with the action.

Definition at line 595 of file SRAMFile.cc.

bool SRAMFile::getDoor ( int  door  )  const

Checks if a door is open.

Parameters:
door The door to check.
Returns:
true if the door is open; false otherwise.

Definition at line 638 of file SRAMFile.cc.

void SRAMFile::setDoor ( int  door,
bool  open = true 
)

Sets whether a door is open or not.

Parameters:
door The door.
open true to open the door; false otherwise.

Definition at line 645 of file SRAMFile.cc.

wxUint16 SRAMFile::getEnergy (  )  const

Gets the amount of energy Samus has.

Returns:
Samus' energy.

Definition at line 652 of file SRAMFile.cc.

void SRAMFile::setEnergy ( wxUint16  energy = 0x5DB  ) 

Sets the amount of energy Samus has.

Parameters:
energy Samus' energy.

Definition at line 660 of file SRAMFile.cc.

bool SRAMFile::hasEnergyTank ( int  tank  )  const

Checks if Samus has a particular energy tank.

Parameters:
tank The tank to check for.
Returns:
true if Samus has the energy tank; false otherwise.

Definition at line 675 of file SRAMFile.cc.

void SRAMFile::setEnergyTank ( int  tank,
bool  give = true 
)

Sets whether Samus has a particular energy tank or not.

Parameters:
tank The tank to set.
give true to give the energy tank; false otherwise.

Definition at line 682 of file SRAMFile.cc.

int smse::SRAMFile::getGame (  )  const [inline]

Gets the current game being edited.

Returns:
The current game (0-2).

Definition at line 892 of file SRAMFile.hh.

void SRAMFile::setGame ( int  game = 0  ) 

Sets the game to be edited.

Parameters:
game The game number (0-2).

Definition at line 696 of file SRAMFile.cc.

unsigned char SRAMFile::getGameHours (  )  const

Gets the number of game hours played.

Returns:
The game hours.

Definition at line 706 of file SRAMFile.cc.

void SRAMFile::setGameHours ( unsigned char  hours = 0  ) 

Sets the number of game hours played.

Parameters:
hours The game hours.

Definition at line 712 of file SRAMFile.cc.

unsigned char SRAMFile::getGameMinutes (  )  const

Gets the number of game minutes played.

Returns:
The game minutes.

Definition at line 723 of file SRAMFile.cc.

void SRAMFile::setGameMinutes ( unsigned char  minutes = 0  ) 

Sets the number of game minutes played.

Parameters:
minutes The game minutes.

Definition at line 729 of file SRAMFile.cc.

bool SRAMFile::hasItem ( enum Item  item  )  const

Checks if Samus has an item in her inventory.

Parameters:
item The item to check for.
Returns:
true if Samus has the item; false otherwise.

Definition at line 740 of file SRAMFile.cc.

void SRAMFile::setItem ( enum Item  item,
bool  have = true 
)

Sets whether Samus has a particular item.

Parameters:
item The item to set.
have true for Samus to have the item; false otherwise.

Definition at line 744 of file SRAMFile.cc.

bool smse::SRAMFile::isItemEquipped ( enum Item  item  )  const [inline]

Checks whether an item is equipped.

Parameters:
item The item to check for.
Returns:
true if the item is equipped; false otherwise.

Definition at line 895 of file SRAMFile.hh.

void smse::SRAMFile::setItemEquipped ( enum Item  item,
bool  equipped = true 
) [inline]

Sets whether an item is equipped or not.

Parameters:
item The item to (un)equip.
equipped true to equip the item; false otherwise.

Definition at line 898 of file SRAMFile.hh.

bool smse::SRAMFile::hasMap ( enum Area  area  )  const [inline]

Checks if Samus has a particular area map.

Parameters:
area The area whose map to check for.
Returns:
true if Samus has the map; false otherwise.

Definition at line 901 of file SRAMFile.hh.

void smse::SRAMFile::setMap ( enum Area  area,
bool  give = true 
) [inline]

Sets whether Samus has a particular area map or not.

Parameters:
area The area for the map.
give true to give the map; false otherwise.

Definition at line 904 of file SRAMFile.hh.

wxUint16 SRAMFile::getMaxEnergy (  )  const

Gets the maximum energy Samus can have.

Returns:
The max energy.

Definition at line 749 of file SRAMFile.cc.

unsigned char SRAMFile::getMaxMissiles (  )  const

Gets the maximum number of missiles Samus can carry.

Returns:
The max missiles.

Definition at line 767 of file SRAMFile.cc.

unsigned char SRAMFile::getMaxPowerBombs (  )  const

Gets the maximum number of power bombs Samus can carry.

Returns:
The max power bombs.

Definition at line 783 of file SRAMFile.cc.

wxUint16 SRAMFile::getMaxReserveEnergy (  )  const

Gets the maximum reserve energy Samus can have.

Returns:
The max reserve energy.

Definition at line 799 of file SRAMFile.cc.

unsigned char SRAMFile::getMaxSuperMissiles (  )  const

Gets the maximum number of super missiles Samus can carry.

Returns:
The max super missiles.

Definition at line 817 of file SRAMFile.cc.

bool smse::SRAMFile::getMetroidRoom ( enum MetroidRoom  room  )  const [inline]

Checks if one of the Metroid rooms in Tourian has been cleared.

Parameters:
room The room to check.
Returns:
true if the room has been cleared; false otherwise.

Definition at line 907 of file SRAMFile.hh.

void smse::SRAMFile::setMetroidRoom ( enum MetroidRoom  room,
bool  clear = true 
) [inline]

Sets whether one of the Metroid rooms in Tourian is clear or not;.

Parameters:
room The room.
clear true to clear the room; false otherwise.

Definition at line 910 of file SRAMFile.hh.

bool smse::SRAMFile::getMiscBit ( enum MiscBit  bit  )  const [inline]

Gets one of the miscellaneous bits that don't fit in with any other group of data.

Parameters:
bit The bit to get.
Returns:
true if the bit is active; false otherwise.

Definition at line 913 of file SRAMFile.hh.

void smse::SRAMFile::setMiscBit ( enum MiscBit  bit,
bool  on = true 
) [inline]

Sets one of the miscellaneous bits that don't fit in with any other group of data.

Parameters:
bit The bit to set.
on true to set the bit; false otherwise.

Definition at line 916 of file SRAMFile.hh.

bool SRAMFile::hasMissilePack ( int  pack  )  const

Checks if Samus has a particular missile pack.

Parameters:
pack The missile pack to check.
Returns:
true if Samus has the missile pack; false otherwise.

Definition at line 833 of file SRAMFile.cc.

void SRAMFile::setMissilePack ( int  pack,
bool  give = true 
)

Sets whether Samus has a particular missile pack or not.

Parameters:
pack The missile pack.
give true to give the missile pack; false otherwise.

Definition at line 840 of file SRAMFile.cc.

unsigned char SRAMFile::getMissiles (  )  const

Gets the number of missiles in Samus' inventory.

Returns:
The number of missiles.

Definition at line 854 of file SRAMFile.cc.

void SRAMFile::setMissiles ( unsigned char  missiles = 0xE6  ) 

Sets the number of missiles in Samus' inventory.

Parameters:
missiles The number of missiles.

Definition at line 861 of file SRAMFile.cc.

bool smse::SRAMFile::isModified (  )  const [inline]

Checks if this SRAMFile has been modified.

Returns:
true if the SRAMFile has been modified; false otherwise.

Definition at line 919 of file SRAMFile.hh.

bool SRAMFile::hasPowerBombPack ( int  pack  )  const

Checks if Samus has a particular power bomb pack.

Parameters:
pack The power bomb pack to check.
Returns:
true if Samus has the power bomb pack; false otherwise.

Definition at line 875 of file SRAMFile.cc.

void SRAMFile::setPowerBombPack ( int  pack,
bool  give = true 
)

Sets whether Samus has a particular power bomb pack or not.

Parameters:
pack The power bomb pack.
give true to give the power bomb pack; false otherwise.

Definition at line 882 of file SRAMFile.cc.

unsigned char SRAMFile::getPowerBombs (  )  const

Gets the number of power bombs in Samus' inventory.

Returns:
The number of power bombs.

Definition at line 896 of file SRAMFile.cc.

void SRAMFile::setPowerBombs ( unsigned char  bombs = 0x32  ) 

Sets the number of power bombs in Samus' inventory.

Parameters:
bombs The number of power bombs.

Definition at line 903 of file SRAMFile.cc.

wxUint16 SRAMFile::getReserveEnergy (  )  const

Gets the amount of reserve energy Samus has.

Returns:
Samus' reserve energy.

Definition at line 917 of file SRAMFile.cc.

void SRAMFile::setReserveEnergy ( wxUint16  energy = 0x190  ) 

Sets the amount of reserve energy Samus has.

Parameters:
energy Samus' reserve energy.

Definition at line 925 of file SRAMFile.cc.

bool SRAMFile::hasReserveTank ( int  tank  )  const

Checks if Samus has a particular reserve tank.

Parameters:
tank The reserve tank to check.
Returns:
true if Samus has the reserve tank; false otherwise.

Definition at line 940 of file SRAMFile.cc.

void SRAMFile::setReserveTank ( int  tank,
bool  give = true 
)

Sets whether Samus has a particular reserve tank or not.

Parameters:
tank The reserve tank.
give true to give the reserve tank; false otherwise.

Definition at line 947 of file SRAMFile.cc.

std::pair< enum Area, int > SRAMFile::getSavePoint (  )  const

Gets the save point.

Returns:
The save point as a std::pair consisting of the area and the specific save point within the area.

Definition at line 961 of file SRAMFile.cc.

void SRAMFile::setSavePoint ( enum Area  area,
int  point = 0 
)

Sets the save point.

Parameters:
area The area of the save point.
point The specific save point within the area.

Definition at line 969 of file SRAMFile.cc.

bool smse::SRAMFile::getStatue ( enum Statue  statue  )  const [inline]

Gets whether a boss statue has been activated or not.

Parameters:
statue The statue to check.
Returns:
true if the statue has been activated; false otherwise.

Definition at line 921 of file SRAMFile.hh.

void smse::SRAMFile::setStatue ( enum Statue  statue,
bool  active = true 
) [inline]

Sets whether a boss statue has been activated or not.

Parameters:
statue The statue.
active true to activate the statue; false otherwise.

Definition at line 924 of file SRAMFile.hh.

bool SRAMFile::hasSuperMissilePack ( int  pack  )  const

Checks if Samus has a particular super missile pack.

Parameters:
pack The super missile pack to check.
Returns:
true if Samus has the super missile pack; false otherwise.

Definition at line 988 of file SRAMFile.cc.

void SRAMFile::setSuperMissilePack ( int  pack,
bool  give = true 
)

Sets whether Samus has a particular super missile pack or not.

Parameters:
pack The super missile pack.
give true to give the super missile pack; false otherwise.

Definition at line 995 of file SRAMFile.cc.

unsigned char SRAMFile::getSuperMissiles (  )  const

Gets the number of super missiles in Samus' inventory.

Returns:
The number of super missiles.

Definition at line 1009 of file SRAMFile.cc.

void SRAMFile::setSuperMissiles ( unsigned char  missiles = 0x32  ) 

Sets the number of super missiles in Samus' inventory.

Parameters:
missiles The number of super missiles.

Definition at line 1016 of file SRAMFile.cc.

bool SRAMFile::isValidGame ( int  game = 0  )  const

Checks if a particular game is valid.

Parameters:
game The game to check.
Returns:
true if the game is valid; false otherwise.

Definition at line 1030 of file SRAMFile.cc.

int SRAMFile::getZebetites (  )  const

Gets the number of Zebetites destroyed.

Returns:
The number of destroyed Zebetites.

Definition at line 1037 of file SRAMFile.cc.

void SRAMFile::setZebetites ( int  count = 4  ) 

Sets the number of Zebetites destroyed.

Parameters:
count The number of destroyed Zebetites.

Definition at line 1044 of file SRAMFile.cc.

void SRAMFile::clear ( int  game  ) 

Clears a game.

Parameters:
game The game to clear (0-2).

Definition at line 1108 of file SRAMFile.cc.

void SRAMFile::copy ( int  src,
int  dest 
)

Copies one game over another.

Parameters:
src The source game (0-2).
dest The destination game (0-2).

Definition at line 1127 of file SRAMFile.cc.

void SRAMFile::save ( const wxString &  filename = wxEmptyString  )  throw (FileIOException)

Saves this SRAMFile to disk.

Parameters:
filename The filename to save as or wxEmptyString to overwrite the original file.
Exceptions:
FileIOException if the SRAMFile cannot be saved.

Definition at line 1206 of file SRAMFile.cc.


Member Data Documentation

const unsigned int smse::SRAMFile::SRAM_SIZE = 0x2000 [static]

size of the SRAM file

Definition at line 252 of file SRAMFile.hh.

const unsigned int smse::SRAMFile::GAMES = 3 [static]

number of save games in the SRAM data

Definition at line 255 of file SRAMFile.hh.

const unsigned int smse::SRAMFile::GAME_SIZE = 0x65C [static]

size of each individual save game

Definition at line 258 of file SRAMFile.hh.

const int smse::SRAMFile::GAME_OFFSET = 0x10 [static]

offset to the beginning of the game data

Definition at line 261 of file SRAMFile.hh.

const int smse::SRAMFile::CHECKSUM_OFFSET = 0 [static]

offset of the checksums

Definition at line 264 of file SRAMFile.hh.

const int smse::SRAMFile::CHECKSUM_OFFSET2 = 0x1FF0 [static]

offset of the redundant checksums

Definition at line 267 of file SRAMFile.hh.

const int smse::SRAMFile::COMPLIMENT_OFFSET = 0x8 [static]

offset of the checksum compliments

Definition at line 270 of file SRAMFile.hh.

const int smse::SRAMFile::COMPLIMENT_OFFSET2 = 0x1FF8 [static]

offset of the redundant checksum compliments

Definition at line 273 of file SRAMFile.hh.

const std::pair< int, unsigned char > SRAMFile::SRAM_OFFSET [static, private]

all the SRAM offsets

Definition at line 277 of file SRAMFile.hh.

const std::pair< unsigned char, unsigned char > SRAMFile::BUTTON_VALUE [static, private]

the controller button values

Definition at line 280 of file SRAMFile.hh.

wxString smse::SRAMFile::filename [private]

Definition at line 282 of file SRAMFile.hh.

char smse::SRAMFile::sram[SRAM_SIZE] [private]

Definition at line 283 of file SRAMFile.hh.

char* smse::SRAMFile::game [private]

Definition at line 284 of file SRAMFile.hh.

bool smse::SRAMFile::valid[3] [private]

Definition at line 285 of file SRAMFile.hh.

bool smse::SRAMFile::modified [private]

Definition at line 285 of file SRAMFile.hh.


Generated on Thu Feb 22 21:33:33 2007 for Super Metroid SRAM Editor by  doxygen 1.5.1-p1