DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CScriptInterpreter Class Reference

#include <scriptinterpreter.hpp>

Inheritance diagram for CScriptInterpreter:
input_str

Public Member Functions

int GetNextTAG ()
 
void SetTAG (TAG_PARAM *tags, int count)
 
void SetFunction (SPI_FUNC_PARAM *functions, int count)
 
void SetScript (char *script, int script_size)
 
 CScriptInterpreter ()
 
int ControlCode ()
 
int CallFunction (int *result)
 
int GetArg (int *argument_types)
 
int SearchCommand (int *tag_index)
 
- Public Member Functions inherited from input_str
 input_str (int unused)
 
int get (int *value)
 

Public Attributes

int current_tag
 
int argument_data_used
 
int tag_count
 
u8 function_argument_data [0x400]
 
TAG_PARAM * tag_table
 
SPI_FUNC_PARAM * function_table
 
int function_count
 
void * arguments [24]
 
char argument_text [0x40C]
 
- Public Attributes inherited from input_str
char * data
 
int size
 
int pos
 

Detailed Description

Parses tagged text scripts and dispatches their embedded commands.

Definition at line 47 of file scriptinterpreter.hpp.

Constructor & Destructor Documentation

◆ CScriptInterpreter()

CScriptInterpreter::CScriptInterpreter ( )

Constructs an interpreter with no script, tags or commands.

Mangled name:
__ct__18CScriptInterpreterFv
Address:
0x15F2B0
Size:
0x38

Definition at line 60 of file scriptinterpreter.cpp.

Member Function Documentation

◆ GetNextTAG()

int CScriptInterpreter::GetNextTAG ( )

Reads the next tag out of the script and gives its number.

Mangled name:
GetNextTAG__18CScriptInterpreterFv
Address:
0x15F100
Size:
0x144

Definition at line 7 of file scriptinterpreter.cpp.

◆ SetTAG()

void CScriptInterpreter::SetTAG ( TAG_PARAM *  tags,
int  count 
)

Gives the interpreter the table of tags it recognises.

Mangled name:
SetTAG__18CScriptInterpreterFP9TAG_PARAMi
Address:
0x15F250
Size:
0x10

Definition at line 41 of file scriptinterpreter.cpp.

◆ SetFunction()

void CScriptInterpreter::SetFunction ( SPI_FUNC_PARAM *  functions,
int  count 
)

Gives the interpreter the table of commands it may call.

Mangled name:
SetFunction__18CScriptInterpreterFP14SPI_FUNC_PARAMi
Address:
0x15F260
Size:
0x10

Definition at line 46 of file scriptinterpreter.cpp.

◆ SetScript()

void CScriptInterpreter::SetScript ( char *  script,
int  script_size 
)

Points the interpreter at the script text it is to read.

Mangled name:
SetScript__18CScriptInterpreterFPci
Address:
0x15F270
Size:
0x38

Definition at line 51 of file scriptinterpreter.cpp.

◆ ControlCode()

int CScriptInterpreter::ControlCode ( )

Reads one control code out of the script.

Mangled name:
ControlCode__18CScriptInterpreterFv
Address:
0x15F2F0
Size:
0x178

Definition at line 71 of file scriptinterpreter.cpp.

◆ CallFunction()

int CScriptInterpreter::CallFunction ( int *  result)

Calls the command the script names, having gathered its arguments.

Mangled name:
CallFunction__18CScriptInterpreterFPi
Address:
0x15F470
Size:
0x320

Definition at line 112 of file scriptinterpreter.cpp.

◆ GetArg()

int CScriptInterpreter::GetArg ( int *  argument_types)

Reads one command argument out of the script.

Mangled name:
GetArg__18CScriptInterpreterFPi
Address:
0x15F790
Size:
0x3F0

Definition at line 204 of file scriptinterpreter.cpp.

◆ SearchCommand()

int CScriptInterpreter::SearchCommand ( int *  tag_index)

Finds the command table entry the script's next word names.

Mangled name:
SearchCommand__18CScriptInterpreterFPi
Address:
0x15FB80
Size:
0x1A4

Definition at line 304 of file scriptinterpreter.cpp.

Member Data Documentation

◆ current_tag

int CScriptInterpreter::current_tag

Index of the tag most recently read, or -1.

Definition at line 49 of file scriptinterpreter.hpp.

◆ argument_data_used

int CScriptInterpreter::argument_data_used

Offset of command-call values in the work buffer.

Definition at line 50 of file scriptinterpreter.hpp.

◆ tag_count

int CScriptInterpreter::tag_count

Number of entries in the tag table.

Definition at line 51 of file scriptinterpreter.hpp.

◆ function_argument_data

u8 CScriptInterpreter::function_argument_data[0x400]

Storage used to marshal command-call arguments.

Definition at line 52 of file scriptinterpreter.hpp.

◆ tag_table

TAG_PARAM* CScriptInterpreter::tag_table

Tags recognised by the interpreter.

Definition at line 53 of file scriptinterpreter.hpp.

◆ function_table

SPI_FUNC_PARAM* CScriptInterpreter::function_table

Commands callable from control codes.

Definition at line 54 of file scriptinterpreter.hpp.

◆ function_count

int CScriptInterpreter::function_count

Number of entries in the command table.

Definition at line 55 of file scriptinterpreter.hpp.

◆ arguments

void* CScriptInterpreter::arguments[24]

Arguments decoded for the current command.

Definition at line 56 of file scriptinterpreter.hpp.

◆ argument_text

char CScriptInterpreter::argument_text[0x40C]

Inline storage for decoded string arguments.

Definition at line 57 of file scriptinterpreter.hpp.