2
#include "Util/ByteArray.h"
3
#include "Core/SymbolTable.h"
5
#include "Commands/CAssemblerCommand.h"
7
enum class PsxRelocationType { WordLiteral, UpperImmediate, LowerImmediate, FunctionCall };
8
enum class PsxRelocationRefType { SymblId, SegmentOffset };
12
PsxRelocationType type;
13
PsxRelocationRefType refType;
26
std::vector<PsxRelocation> relocations;
30
enum class PsxSymbolType { Internal, InternalID, External, BSS, Function };
43
struct PsxRelocatorFile
46
std::vector<PsxSegment> segments;
47
std::vector<PsxSymbol> symbols;
53
bool init(const std::wstring& inputName);
54
bool relocate(int& memoryAddress);
55
bool hasDataChanged() { return dataChanged; };
56
const ByteArray& getData() const { return outputData; };
57
void writeSymbols(SymbolData& symData) const;
59
size_t loadString(ByteArray& data, size_t pos, std::wstring& dest);
60
bool parseObject(ByteArray data, PsxRelocatorFile& dest);
61
bool relocateFile(PsxRelocatorFile& file, int& relocationAddress);
64
std::vector<PsxRelocatorFile> files;
65
MipsElfRelocator* reloc;
69
class DirectivePsxObjImport: public CAssemblerCommand
72
DirectivePsxObjImport(const std::wstring& fileName);
73
~DirectivePsxObjImport() { };
74
virtual bool Validate();
75
virtual void Encode() const;
76
virtual void writeTempData(TempData& tempData) const { };
77
virtual void writeSymData(SymbolData& symData) const;
b'\\ No newline at end of file'