V-Gears 0
Free Final Fantasy VII engine.
WorldDisassembler Class Reference

#include <WorldDisassembler.h>

Inheritance diagram for WorldDisassembler:
Collaboration diagram for WorldDisassembler:

Public Member Functions

 WorldDisassembler (WorldEngine *engine, InstVec &insts, int script_number)
 CConstructor. More...
 
 ~WorldDisassembler ()
 Destructor. More...
 
void DoDisassemble () override
 Disassembles the instructions. More...
 
- Public Member Functions inherited from Disassembler
 Disassembler (InstVec &insts)
 Constructor for Disassembler. More...
 
virtual ~Disassembler ()=default
 Destructor. More...
 
virtual void Open (const char *filename)
 Open a file for disassembly. More...
 
void Disassemble ()
 Request disassembled instructions. More...
 
void DumpDisassembly (std::ostream &output)
 Outputs the disassembled code. More...
 

Private Member Functions

template<typename T >
void ParseOpcode (int opcode, std::string name, T instruction, int stack_change, const char *argument_format)
 Parses an opcode. More...
 

Private Attributes

int script_number_ = 0
 The script number. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Disassembler
virtual void DoDisassemble ()=0
 Performs disassembly. More...
 
virtual void DoDumpDisassembly (std::ostream &output)
 Outputs the disassembled code. More...
 
void ReadParams (InstPtr inst, const char *types)
 Read parameters and associate them with an instruction. More...
 
void ReadParams (InstPtr inst, const char *types, const std::vector< std::string > &params)
 Read parameters but it doesn't associate them with an instruction. More...
 
virtual ValuePtr ReadParameter (InstPtr inst, std::string type)
 Reads data for a single parameter. More...
 
- Protected Attributes inherited from Disassembler
std::unique_ptr< BinaryReaderstream_
 Used to perform file I/O. More...
 
InstVecinsts_
 List of disassembled instructions. More...
 
uint32 address_base_
 Base address where the script starts. More...
 
uint32 address_
 The current address. More...
 

Constructor & Destructor Documentation

◆ WorldDisassembler()

WorldDisassembler::WorldDisassembler ( WorldEngine engine,
InstVec insts,
int  script_number 
)

CConstructor.

Parameters
[in]engineThe engine to use to disassemble.
[in]instsThe list of instructions.
[in]script_numberThe script number to process.

◆ ~WorldDisassembler()

WorldDisassembler::~WorldDisassembler ( )

Destructor.

Member Function Documentation

◆ DoDisassemble()

void WorldDisassembler::DoDisassemble ( )
overridevirtual

Disassembles the instructions.

Implements Disassembler.

◆ ParseOpcode()

template<typename T >
void WorldDisassembler::ParseOpcode ( int  opcode,
std::string  name,
instruction,
int  stack_change,
const char *  argument_format 
)
inlineprivate

Parses an opcode.

Adds properties to an instruction, and adds the instruction to the list.

Parameters
[in]opcodeThe opcode code.
[in]namethe opcode name.
[in]instructionA newly created instruction of the type the opcode belongs to.
[in]stack_changeIndicates how much the instruction changes the stack pointer by.
[in]argument_formatThe opcode argument format.

Member Data Documentation

◆ script_number_

int WorldDisassembler::script_number_ = 0
private

The script number.


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