Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

ffse::SaveSlot Class Reference

#include <SaveSlot.hh>

List of all members.


Detailed Description

Class to encapsulate SRAM data and provide I/O within its framework.

Definition at line 115 of file SaveSlot.hh.

Public Member Functions

 SaveSlot (const char *nvram)
 Constructor for a SaveSlot.
 ~SaveSlot ()
 Destructor for a SaveSlot.
bool isValid ()
 Checks if this SaveSlot is valid.
bool isModified ()
 Checks if this SaveSlot has been modified;.
unsigned char checksum ()
 Generates a checksum for the current game data.
wxInt32 getGold ()
 Gets the current amount of gold help by the party.
void setGold (wxInt32 value)
 Sets the current amount of gold help by the party.
int getItem (int item)
 Gets the current amount of a particular item.
void setItem (int item, unsigned char value=1)
 Sets the current amount of a particular item.
wxString getName (int member)
 Gets the name for a particular party member.
void setName (int member, wxString &value)
 Sets the name for a particular party member.
int getClass (int member)
 Gets the class of a particular party member.
void setClass (int member, unsigned char value)
 Sets the class of a particular party member.
int getCondition (int member)
 Gets the condition of a party member.
void setCondition (int member, unsigned char value)
 Sets the condition of a party member.
wxInt32 getExperience (int member)
 Gets the experience of a party member.
wxInt16 getCurrentHP (int member)
 Gets the current HP of a party member.
void setCurrentHP (int member, wxInt16 value)
 Sets the current HP of a party member.
wxInt16 getMaxHP (int member)
 Gets the max HP of a party member.
void setMaxHP (int member, wxInt16 value)
 Sets the max HP of a party member.
void setExperience (int member, wxInt32 value)
 Sets the experience of a party member.
int getStrength (int member)
 Gets the strength of a party member.
void setStrength (int member, unsigned char value)
 Sets the strength of a party member.
int getAgility (int member)
 Gets the agility of a party member.
void setAgility (int member, unsigned char value)
 Sets the agility of a party member.
int getIntelligence (int member)
 Gets the intelligence of a party member.
void setIntelligence (int member, unsigned char value)
 Sets the intelligence of a party member.
int getVitality (int member)
 Gets the vitality of a party member.
void setVitality (int member, unsigned char value)
 Sets the vitality of a party member.
int getLuck (int member)
 Gets the luck of a party member.
void setLuck (int member, unsigned char value)
 Sets the luck of a party member.
int getDamage (int member)
 Gets the damage of a party member.
void setDamage (int member, unsigned char value)
 Sets the damage of a party member.
int getHitPercent (int member)
 Gets the hit percent of a party member.
void setHitPercent (int member, unsigned char value)
 Sets the hit percent of a party member.
int getWeapon (int member, int slot)
 Gets the weapon of a party member at a given slot.
void setWeapon (int member, int slot, unsigned char value)
 Sets the weapon of a party member at a given slot.
int getArmor (int member, int slot)
 Gets the armor of a party member at a given slot.
void setArmor (int member, int slot, unsigned char value)
 Sets the armor of a party member at a given slot.
int getCurrentMagic (int member, int level)
 Gets the current magic of a party member at a given level.
void setCurrentMagic (int member, int level, unsigned char value)
 Sets the current magic of a party member at a given level.
int getMaxMagic (int member, int level)
 Gets the max magic of a party member at a given level.
void setMaxMagic (int member, int level, unsigned char value)
 Sets the max magic of a party member at a given level.
int getMagic (int member, int level, int slot)
 Gets the magic of a party member at a given level.
void setMagic (int member, int level, int slot, unsigned char value)
 Sets the magic of a party member at a given level.

Private Member Functions

unsigned char adc (unsigned char current, unsigned char value)
 Performs an add with carry operation.
void setCarry (bool set=true)
 Sets or clears the carry flag used by adc.
void setModified (bool modified=true)
 Sets whether this SaveSlot has been modified or not.

Static Private Member Functions

unsigned char toNES (char letter)
 Translates a character from ASCII to the Final Fantasy alphabet.
char fromNES (unsigned char letter)
 Translates a character from the Final Fantasy alphabet to ASCII.

Private Attributes

unsigned char * nvram
int carry
bool valid
bool modified

Friends

class MainFrame


Constructor & Destructor Documentation

SaveSlot::SaveSlot const char *  nvram  ) 
 

Constructor for a SaveSlot.

Parameters:
nvram The SRAM game data, which must be 0x400 bytes long.

Definition at line 38 of file SaveSlot.cc.

SaveSlot::~SaveSlot  ) 
 

Destructor for a SaveSlot.

Definition at line 50 of file SaveSlot.cc.


Member Function Documentation

unsigned char SaveSlot::adc unsigned char  current,
unsigned char  value
[private]
 

Performs an add with carry operation.

Parameters:
current The current value.
value The value to add.
Returns:
The combined value plus the carry value, if applicable.

Definition at line 341 of file SaveSlot.cc.

unsigned char SaveSlot::checksum  ) 
 

Generates a checksum for the current game data.

Returns:
The generated checksum.

Definition at line 56 of file SaveSlot.cc.

char SaveSlot::fromNES unsigned char  letter  )  [static, private]
 

Translates a character from the Final Fantasy alphabet to ASCII.

Parameters:
letter The letter to translate.
Returns:
The translated letter.

Definition at line 392 of file SaveSlot.cc.

int SaveSlot::getAgility int  member  ) 
 

Gets the agility of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The agility.

Definition at line 226 of file SaveSlot.cc.

int SaveSlot::getArmor int  member,
int  slot
 

Gets the armor of a party member at a given slot.

Parameters:
member The party member. Valid values are 0-3.
slot The slot. Valid values are 0-3.
Returns:
The armor.

Definition at line 296 of file SaveSlot.cc.

int SaveSlot::getClass int  member  ) 
 

Gets the class of a particular party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The class.

Definition at line 140 of file SaveSlot.cc.

int SaveSlot::getCondition int  member  ) 
 

Gets the condition of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The condition.

Definition at line 150 of file SaveSlot.cc.

wxInt16 SaveSlot::getCurrentHP int  member  ) 
 

Gets the current HP of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The current HP.

Definition at line 160 of file SaveSlot.cc.

int SaveSlot::getCurrentMagic int  member,
int  level
 

Gets the current magic of a party member at a given level.

Parameters:
member The party member. Valid values are 0-3.
level The magic level. Valid values are 0-7.
Returns:
The current magic.

Definition at line 306 of file SaveSlot.cc.

int SaveSlot::getDamage int  member  ) 
 

Gets the damage of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The damage.

Definition at line 266 of file SaveSlot.cc.

wxInt32 SaveSlot::getExperience int  member  ) 
 

Gets the experience of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The experience.

Definition at line 188 of file SaveSlot.cc.

wxInt32 SaveSlot::getGold  ) 
 

Gets the current amount of gold help by the party.

Returns:
The current gold.

Definition at line 75 of file SaveSlot.cc.

int SaveSlot::getHitPercent int  member  ) 
 

Gets the hit percent of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The hit percent.

Definition at line 276 of file SaveSlot.cc.

int SaveSlot::getIntelligence int  member  ) 
 

Gets the intelligence of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The intelligence.

Definition at line 236 of file SaveSlot.cc.

int SaveSlot::getItem int  item  ) 
 

Gets the current amount of a particular item.

Parameters:
item The item whose amount to retrieve. Valid values are any of the Items enumeration.
Returns:
The current amount of the item.

Definition at line 101 of file SaveSlot.cc.

int SaveSlot::getLuck int  member  ) 
 

Gets the luck of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The luck.

Definition at line 256 of file SaveSlot.cc.

int SaveSlot::getMagic int  member,
int  level,
int  slot
 

Gets the magic of a party member at a given level.

Parameters:
member The party member. Valid values are 0-3.
level The magic level. Valid values are 0-7.
slot The slot. Valid values are 0-2.
Returns:
The magic.

Definition at line 326 of file SaveSlot.cc.

wxInt16 SaveSlot::getMaxHP int  member  ) 
 

Gets the max HP of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The max HP.

Definition at line 175 of file SaveSlot.cc.

int SaveSlot::getMaxMagic int  member,
int  level
 

Gets the max magic of a party member at a given level.

Parameters:
member The party member. Valid values are 0-3.
level The magic level. Valid values are 0-7.
Returns:
The max magic.

Definition at line 316 of file SaveSlot.cc.

wxString SaveSlot::getName int  member  ) 
 

Gets the name for a particular party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The name.

Definition at line 111 of file SaveSlot.cc.

int SaveSlot::getStrength int  member  ) 
 

Gets the strength of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The strength.

Definition at line 216 of file SaveSlot.cc.

int SaveSlot::getVitality int  member  ) 
 

Gets the vitality of a party member.

Parameters:
member The party member. Valid values are 0-3.
Returns:
The vitality.

Definition at line 246 of file SaveSlot.cc.

int SaveSlot::getWeapon int  member,
int  slot
 

Gets the weapon of a party member at a given slot.

Parameters:
member The party member. Valid values are 0-3.
slot The slot. Valid values are 0-3.
Returns:
The weapon.

Definition at line 286 of file SaveSlot.cc.

bool ffse::SaveSlot::isModified  )  [inline]
 

Checks if this SaveSlot has been modified;.

Returns:
true if modified; false otherwise.

Definition at line 141 of file SaveSlot.hh.

bool ffse::SaveSlot::isValid  )  [inline]
 

Checks if this SaveSlot is valid.

Returns:
true if valid; false otherwise.

Definition at line 134 of file SaveSlot.hh.

void SaveSlot::setAgility int  member,
unsigned char  value
 

Sets the agility of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 230 of file SaveSlot.cc.

void SaveSlot::setArmor int  member,
int  slot,
unsigned char  value
 

Sets the armor of a party member at a given slot.

Parameters:
member The party member. Valid values are 0-3.
slot The slot. Valid values are 0-3.
value The new value.

Definition at line 300 of file SaveSlot.cc.

void ffse::SaveSlot::setCarry bool  set = true  )  [inline, private]
 

Sets or clears the carry flag used by adc.

Parameters:
set Whether to set the carry flag or not.

Definition at line 519 of file SaveSlot.hh.

void SaveSlot::setClass int  member,
unsigned char  value
 

Sets the class of a particular party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 144 of file SaveSlot.cc.

void SaveSlot::setCondition int  member,
unsigned char  value
 

Sets the condition of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 154 of file SaveSlot.cc.

void SaveSlot::setCurrentHP int  member,
wxInt16  value
 

Sets the current HP of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 167 of file SaveSlot.cc.

void SaveSlot::setCurrentMagic int  member,
int  level,
unsigned char  value
 

Sets the current magic of a party member at a given level.

Parameters:
member The party member. Valid values are 0-3.
level The magic level. Valid values are 0-7.
value The new value.

Definition at line 310 of file SaveSlot.cc.

void SaveSlot::setDamage int  member,
unsigned char  value
 

Sets the damage of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 270 of file SaveSlot.cc.

void SaveSlot::setExperience int  member,
wxInt32  value
 

Sets the experience of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 204 of file SaveSlot.cc.

void SaveSlot::setGold wxInt32  value  ) 
 

Sets the current amount of gold help by the party.

Parameters:
value The new value.

Definition at line 91 of file SaveSlot.cc.

void SaveSlot::setHitPercent int  member,
unsigned char  value
 

Sets the hit percent of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 280 of file SaveSlot.cc.

void SaveSlot::setIntelligence int  member,
unsigned char  value
 

Sets the intelligence of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 240 of file SaveSlot.cc.

void SaveSlot::setItem int  item,
unsigned char  value = 1
 

Sets the current amount of a particular item.

Parameters:
item The item whose amount to set. Valid values are any of the Items enumeration.
value The new amount.

Definition at line 105 of file SaveSlot.cc.

void SaveSlot::setLuck int  member,
unsigned char  value
 

Sets the luck of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 260 of file SaveSlot.cc.

void SaveSlot::setMagic int  member,
int  level,
int  slot,
unsigned char  value
 

Sets the magic of a party member at a given level.

Parameters:
member The party member. Valid values are 0-3.
level The magic level. Valid values are 0-7.
slot The slot. Valid values are 0-2.
value The new value.

Definition at line 333 of file SaveSlot.cc.

void SaveSlot::setMaxHP int  member,
wxInt16  value
 

Sets the max HP of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 181 of file SaveSlot.cc.

void SaveSlot::setMaxMagic int  member,
int  level,
unsigned char  value
 

Sets the max magic of a party member at a given level.

Parameters:
member The party member. Valid values are 0-3.
level The magic level. Valid values are 0-7.
value The new value.

Definition at line 320 of file SaveSlot.cc.

void SaveSlot::setModified bool  modified = true  )  [private]
 

Sets whether this SaveSlot has been modified or not.

Parameters:
modified true if modified; false otherwise.

Definition at line 358 of file SaveSlot.cc.

void SaveSlot::setName int  member,
wxString &  value
 

Sets the name for a particular party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 122 of file SaveSlot.cc.

void SaveSlot::setStrength int  member,
unsigned char  value
 

Sets the strength of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 220 of file SaveSlot.cc.

void SaveSlot::setVitality int  member,
unsigned char  value
 

Sets the vitality of a party member.

Parameters:
member The party member. Valid values are 0-3.
value The new value.

Definition at line 250 of file SaveSlot.cc.

void SaveSlot::setWeapon int  member,
int  slot,
unsigned char  value
 

Sets the weapon of a party member at a given slot.

Parameters:
member The party member. Valid values are 0-3.
slot The slot. Valid values are 0-3.
value The new value.

Definition at line 290 of file SaveSlot.cc.

unsigned char SaveSlot::toNES char  letter  )  [static, private]
 

Translates a character from ASCII to the Final Fantasy alphabet.

Parameters:
letter The letter to translate.
Returns:
The translated letter.

Definition at line 366 of file SaveSlot.cc.


Friends And Related Function Documentation

friend class MainFrame [friend]
 

Definition at line 501 of file SaveSlot.hh.


Member Data Documentation

int ffse::SaveSlot::carry [private]
 

Definition at line 547 of file SaveSlot.hh.

bool ffse::SaveSlot::modified [private]
 

Definition at line 548 of file SaveSlot.hh.

unsigned char* ffse::SaveSlot::nvram [private]
 

Definition at line 546 of file SaveSlot.hh.

bool ffse::SaveSlot::valid [private]
 

Definition at line 548 of file SaveSlot.hh.


Generated on Wed Dec 8 03:21:45 2004 for Final Fantasy SRAM Editor by  doxygen 1.3.9.1