![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
A walkmesh instruction. More...
#include <FieldWalkmeshInstruction.h>
Public Member Functions | |
virtual void | ProcessInst (Function &func, ValueStack &stack, Engine *engine, CodeGenerator *code_gen) override |
Processes the instruction. More... | |
![]() | |
virtual bool | IsKernelCall () const |
Checks if the instruction is a call to a kernel function. More... | |
![]() | |
virtual std::ostream & | Print (std::ostream &output) const |
Print the instruction to a stream. More... | |
virtual bool | IsJump () const |
Checks if the instruction is a jump of some sort. More... | |
virtual bool | IsCondJump () const |
Checks if the instruction is a conditional jump. More... | |
virtual bool | IsUncondJump () const |
Checks if the instruction is an unconditional jump. More... | |
virtual bool | IsStackOp () const |
Checks if the instruction is a stack operation. More... | |
virtual bool | IsFuncCall () const |
Checks if the instruction is a call to a script function. More... | |
virtual bool | IsReturn () const |
Checks if the instruction is a return statement. More... | |
virtual bool | IsKernelCall () const |
Checks if the instruction is a call to a kernel function. More... | |
virtual bool | IsLoad () const |
Checks if the instruction is a load operation. More... | |
virtual bool | IsStore () const |
Checks if the instruction is a store operation. More... | |
virtual uint32 | GetDestAddress () const |
Returns the destination address of a jump instruction. More... | |
virtual void | ProcessInst (Function &function, ValueStack &stack, Engine *engine, CodeGenerator *code_gen)=0 |
Process an instruction for code generation. More... | |
uint32 | GetOpcode () const |
Retrieves the instruction opcode. More... | |
void | SetOpcode (uint32 opcode) |
Sets the instruction opcode. More... | |
uint32 | GetAddress () const |
Retrieves the instruction address. More... | |
void | SetAddress (uint32 address) |
Sets the instruction address. More... | |
std::string | GetName () const |
Retrieves the instruction name (the opcode name). More... | |
void | SetName (std::string name) |
int16 | GetStackChange () const |
Checks how much the instruction changes the stack pointer. More... | |
void | SetStackChange (int16 stack_change) |
Defines how much the instruction changes the stack pointer. More... | |
std::vector< ValuePtr > | GetParams () const |
Retrieves the list of instruction parameters. More... | |
ValuePtr | GetParam (uint32 index) const |
Retrieves a instruction parameter. More... | |
void | SetParams (std::vector< ValuePtr > params) |
Sets the instructions parameters. More... | |
void | AddParam (ValuePtr value) |
Adds a parameter to the instructions. More... | |
std::string | GetCodeGenData () const |
Retrieves metadata for code generation. More... | |
void | SetCodeGenData (std::string code_gen_data) |
Sets metadata for code generation. More... | |
bool | LabelRequired () const |
Checks if the instruction requires a label. More... | |
void | SetLabelRequired (bool required) |
Indicates if the instruction needs a label. More... | |
Private Member Functions | |
void | ProcessUC (CodeGenerator *code_gen) |
void | ProcessLINE (CodeGenerator *code_gen, const std::string &entity) |
Processes a LINE opcode. More... | |
void | ProcessLINON (CodeGenerator *code_gen) |
Processes a LINON opcode. More... | |
Additional Inherited Members | |
![]() | |
static int | INST_TYPE_BINARY_OP |
Binary operation (e.g. More... | |
static int | INST_TYPE_BOOL_NEGATE |
Boolean negation. More... | |
static int | INST_TYPE_CALL |
Regular function call. More... | |
static int | INST_TYPE_COND_JUMP |
Conditional jump. More... | |
static int | INST_TYPE_DUP |
Instruction duplicates the most recent stack entry. More... | |
static int | INST_TYPE_JUMP |
Unconditional jump. More... | |
static int | INST_TYPE_KERNEL_CALL |
Kernel functions. More... | |
static int | INST_TYPE_LOAD |
Load value from memory. More... | |
static int | INST_TYPE_RETURN |
Return from regular function call. More... | |
static int | INST_TYPE_STACK |
Stack allocation or deallocation (altering stack pointer). More... | |
static int | INST_TYPE_STORE |
Store value in memory. More... | |
static int | INST_TYPE_UNARY_OP_PRE |
Unary operation (e.g. More... | |
static int | INST_TYPE_UNARY_OP_POST |
Unary operation with operator placed after the operator. More... | |
![]() | |
RefCounted () | |
virtual | ~RefCounted () |
![]() | |
uint32 | opcode_ |
The instruction opcode. More... | |
uint32 | address_ |
The instruction address. More... | |
std::string | name_ |
The instruction name (opcode name). More... | |
int16 | stack_change_ |
How much this instruction changes the stack pointer by. More... | |
std::vector< ValuePtr > | params_ |
Array of parameters used for the instruction. More... | |
std::string | code_gen_data_ |
String containing metadata for code generation. More... | |
bool | label_required_ = false |
Indicates if a label is required. More... | |
A walkmesh instruction.
|
overridevirtual |
Processes the instruction.
[in] | func | Function to process. |
[out] | stack | Function stack. |
[in] | engine | Engine. Unused. |
[in,out] | code_gen | Code generator to append lines. |
Implements Instruction.
|
private |
Processes a LINE opcode.
Opcode: 0xD0 Short name: LINE Long name: Line definition
Memory layout (7 bytes) |0xD0|XA|YA|ZA|XB|YB|ZB|
Arguments:
Defines a line on the walkmesh that, when crossed by a playable character, causes one of the entity's scripts to be executed. These are similar to the triggers in Section 8. All the lines in the current field can be turned on or off by using the LINON opcode.
There are generally 6 scripts (other than the init and main) if the entity is a LINE.
[in,out] | code_gen | Code generator to append lines. |
[in] | entity | The entity name. |
|
private |
Processes a LINON opcode.
Opcode: 0xD1 Short name: LINON Long name: Line Switch
Memory layout (2 bytes): |0xD1|S|
const UByte S: Switch on/off (1/0, respectively).
Turns on or off the LINE that was registered by this entity in the current field. If set to off, the line will not be triggered by the character walking through them.
[in,out] | code_gen | Code generator to append lines. |
|
private |