|
DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
|
#include <runscript.hpp>
Public Member Functions | |
| int | IsEnd () |
| CRunScript () | |
| void | check_stack () |
| void | push (RS_STACKDATA value) |
| void | push_int (int value) |
| void | push_str (char *string) |
| void | push_ptr (RS_STACKDATA *pointer) |
| void | push_float (float value) |
| RS_STACKDATA | pop () |
| vmcode_t * | call_func (funcdata *callee, vmcode_t *return_pc) |
| vmcode_t * | ret_func () |
| void | ext (RS_STACKDATA *args, int argc) |
| void | load (RS_PROG_HEADER *prog, RS_STACKDATA *stack, int stack_num, RS_CALLDATA *call, int call_num) |
| void | reload (RS_PROG_HEADER *prog) |
| void | ext_func (int(**table)(RS_STACKDATA *, int), int count) |
| void | resume () |
| int | run (int no) |
| int | check_program (int no) |
| void | skip () |
| void | exe (vmcode_t *entry) |
Public Attributes | |
| int | ext_func_num |
| int(** | ext_func_table )(RS_STACKDATA *, int) |
| int | stack_num |
| RS_STACKDATA * | stack |
| RS_STACKDATA * | sp |
| RS_STACKDATA * | stack_end |
| int | call_num |
| RS_CALLDATA * | call |
| RS_CALLDATA * | call_sp |
| RS_CALLDATA * | call_end |
| RS_STACKDATA * | frame |
| funcdata * | func |
| vmcode_t * | pc |
| int | end |
| int | skip_wait |
| RS_PROG_HEADER * | prog |
| char * | code |
| int | result |
Runs one compiled script on a stack machine, suspending at its waits.
Definition at line 144 of file runscript.hpp.
| CRunScript::CRunScript | ( | ) |
Makes an interpreter with no program, stack or external functions.
Definition at line 59 of file runscript.cpp.
|
inline |
Nonzero once the script has run to its end.
Definition at line 168 of file runscript.hpp.
| void CRunScript::check_stack | ( | ) |
Stops the game when the operand stack is full.
Definition at line 71 of file runscript.cpp.
| void CRunScript::push | ( | RS_STACKDATA | value | ) |
Pushes one value onto the operand stack.
Definition at line 77 of file runscript.cpp.
| void CRunScript::push_int | ( | int | value | ) |
Pushes an integer onto the operand stack.
Definition at line 82 of file runscript.cpp.
| void CRunScript::push_str | ( | char * | string | ) |
Pushes a string onto the operand stack.
Definition at line 88 of file runscript.cpp.
| void CRunScript::push_ptr | ( | RS_STACKDATA * | pointer | ) |
Pushes a reference to a stack slot onto the operand stack.
Definition at line 94 of file runscript.cpp.
| void CRunScript::push_float | ( | float | value | ) |
Pushes a float onto the operand stack.
Definition at line 100 of file runscript.cpp.
| RS_STACKDATA CRunScript::pop | ( | ) |
Pops the top value off the operand stack.
Definition at line 106 of file runscript.cpp.
Enters a script function, and gives back its first instruction.
Definition at line 112 of file runscript.cpp.
| vmcode_t * CRunScript::ret_func | ( | ) |
Leaves the current script function, and gives back the caller's instruction.
Definition at line 131 of file runscript.cpp.
| void CRunScript::ext | ( | RS_STACKDATA * | args, |
| int | argc | ||
| ) |
Calls the external function the first argument names.
Definition at line 138 of file runscript.cpp.
| void CRunScript::load | ( | RS_PROG_HEADER * | prog, |
| RS_STACKDATA * | stack, | ||
| int | stack_num, | ||
| RS_CALLDATA * | call, | ||
| int | call_num | ||
| ) |
Gives the interpreter a program and the stacks to run it on.
Definition at line 148 of file runscript.cpp.
| void CRunScript::reload | ( | RS_PROG_HEADER * | prog | ) |
Swaps in another program, keeping the stacks.
Definition at line 159 of file runscript.cpp.
| void CRunScript::ext_func | ( | int(**)(RS_STACKDATA *, int) | table, |
| int | count | ||
| ) |
Registers the table of external functions scripts can call.
Definition at line 164 of file runscript.cpp.
| void CRunScript::resume | ( | ) |
Continues a suspended script where it stopped.
Definition at line 169 of file runscript.cpp.
| int CRunScript::run | ( | int | no | ) |
Starts a numbered program, or the main function for a negative number.
Definition at line 175 of file runscript.cpp.
| int CRunScript::check_program | ( | int | no | ) |
Reports whether the program has a numbered entry.
Definition at line 219 of file runscript.cpp.
| void CRunScript::skip | ( | ) |
Resumes the script, running through its waits.
Definition at line 236 of file runscript.cpp.
| void CRunScript::exe | ( | vmcode_t * | entry | ) |
Runs instructions from one until the script ends or waits.
Definition at line 245 of file runscript.cpp.
| int CRunScript::ext_func_num |
Gives the number of registered external functions.
Definition at line 146 of file runscript.hpp.
| int(** CRunScript::ext_func_table) (RS_STACKDATA *, int) |
Points to the external function table.
Definition at line 147 of file runscript.hpp.
| int CRunScript::stack_num |
Gives the operand stack capacity.
Definition at line 148 of file runscript.hpp.
| RS_STACKDATA* CRunScript::stack |
Points to the operand stack storage.
Definition at line 149 of file runscript.hpp.
| RS_STACKDATA* CRunScript::sp |
Points to the next operand stack slot.
Definition at line 150 of file runscript.hpp.
| RS_STACKDATA* CRunScript::stack_end |
Points one past the operand stack storage.
Definition at line 151 of file runscript.hpp.
| int CRunScript::call_num |
Gives the call stack capacity.
Definition at line 152 of file runscript.hpp.
| RS_CALLDATA* CRunScript::call |
Points to the call stack storage.
Definition at line 153 of file runscript.hpp.
| RS_CALLDATA* CRunScript::call_sp |
Points to the next call stack entry.
Definition at line 154 of file runscript.hpp.
| RS_CALLDATA* CRunScript::call_end |
Points one past the call stack storage.
Definition at line 155 of file runscript.hpp.
| RS_STACKDATA* CRunScript::frame |
Points to the active operand frame.
Definition at line 156 of file runscript.hpp.
| funcdata* CRunScript::func |
Describes the active script function.
Definition at line 157 of file runscript.hpp.
| vmcode_t* CRunScript::pc |
Points to the next instruction.
Definition at line 158 of file runscript.hpp.
| int CRunScript::end |
Records whether execution has completed.
Definition at line 159 of file runscript.hpp.
| int CRunScript::skip_wait |
Records whether wait operations should be skipped.
Definition at line 160 of file runscript.hpp.
| RS_PROG_HEADER* CRunScript::prog |
Points to the loaded program header.
Definition at line 161 of file runscript.hpp.
| char* CRunScript::code |
Points to the loaded bytecode section.
Definition at line 162 of file runscript.hpp.
| int CRunScript::result |
Stores the script's return value.
Definition at line 163 of file runscript.hpp.