Pokebot
Pokemon FireRed bot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Public Types | Public Member Functions | List of all members
VM Class Reference

#include <VM.hh>

Collaboration diagram for VM:
Collaboration graph

Classes

struct  ChoicePts
 

Public Types

typedef void(VM::* Executer )(Script::Instruction *)
 

Public Member Functions

 VM ()
 
 ~VM ()
 
void exec (Script &script)
 
std::vector< ChoicePts > * execCountNewVisits (Script &script)
 
bool getFlag (uint16_t flag) const
 
uint16_t getVar (uint16_t var) const
 
uint32_t getBank (uint8_t bank) const
 
void setFlag (uint16_t flag, bool val)
 
void setVar (uint16_t var, uint16_t val)
 
void setBank (uint8_t bank, uint32_t val)
 

Member Typedef Documentation

typedef void(VM::* VM::Executer)(Script::Instruction *)

Constructor & Destructor Documentation

VM::VM ( )
VM::~VM ( )

Member Function Documentation

void VM::exec ( Script script)

Executes a script

Parameters
scriptThe script to execute
std::vector< VM::ChoicePts > * VM::execCountNewVisits ( Script script)

Counts how many key points would be visited if the script was executed

The function simulates the execution of a script, and counts how many key points the script flow would visit. Key points represents the differents branches that the script can take. There is a key point for the success and one for the failure of the if1 (0x06) and the if2 (0x07) commands.

Parameters
scriptThe script to execute
Returns
The number of visited key points
uint32_t VM::getBank ( uint8_t  bank) const
inline
bool VM::getFlag ( uint16_t  flag) const
inline
uint16_t VM::getVar ( uint16_t  var) const
inline
void VM::setBank ( uint8_t  bank,
uint32_t  val 
)
inline
void VM::setFlag ( uint16_t  flag,
bool  val 
)
inline
void VM::setVar ( uint16_t  var,
uint16_t  val 
)
inline

The documentation for this class was generated from the following files: