feat(profile): add model related info

This commit is contained in:
phaneron 2024-11-01 03:54:09 -04:00
parent 156b0e0a0b
commit 2b598e6dd1
62 changed files with 25665 additions and 8034 deletions

View file

@ -0,0 +1,193 @@
#include <idc.idc>
static import_data_types() {
// Give types to data labels
apply_type(0x00408070, "void __stdcall func(float* minX, float* maxX, float* minY, float* maxY, float* minZ, float* maxZ)");
apply_type(0x00409670, "void __thiscall func(CGxDevice* this)");
apply_type(0x004804F0, "void __cdecl func(EvtContext* context, EVENTID id, void* handler, void* param, float priority)");
apply_type(0x004806A0, "int32_t __cdecl func(EvtContext* context, EVENTID id, void *data, size_t bytes)");
apply_type(0x00494EE0, "int32_t __thiscall func(CFrameStrata* this, int32_t a2)");
apply_type(0x00494F30, "void __thiscall func(CFrameStrata* this)");
apply_type(0x004B5510, "int32_t __stdcall func(uint32_t width, uint32_t height)");
apply_type(0x004B7220, "MipBits* __stdcall func(PIXEL_FORMAT format, uint32_t width, uint32_t height)");
apply_type(0x004B7300, "void func(MipBits* image)");
apply_type(0x004B78A0, "int32_t __usercall func@<eax>(char* ext@<eax>, char* filename, int32_t a3, MipBits** mipBits, uint32_t* width, uint32_t* height, PIXEL_FORMAT* texFormat, int32_t* isOpaque@<ecx>, uint32_t* alphaBits, PIXEL_FORMAT* dataFormat)");
apply_type(0x004B8070, "int32_t __usercall func@<eax>(char* ext@<eax>, char* filename@<ebx>, int32_t a3, MipBits** mipBits, uint32_t* width, uint32_t* height, uint32_t* isOpaque, uint32_t* alphaBits, PIXEL_FORMAT* dataFormat)");
apply_type(0x004B81D0, "MipBits* func(const char* filename, uint32_t* width, uint32_t* height, PIXEL_FORMAT* dataFormat, int32_t* isOpaque, CStatus* status, uint32_t* alphaBits, int32_t a8)");
apply_type(0x00532AF0, "CGxCaps* __thiscall func(CGxDevice* this)");
apply_type(0x006160B0, "int32_t __usercall func@<eax>(uint32_t** image@<eax>, MipBits* mipImages@<ecx>, uint32_t width@<edx>, uint32_t height)");
apply_type(0x00616800, "void __stdcall func(CURSORMODE mode)");
apply_type(0x00681F60, "void __stdcall func(float minX, float maxX, float minY, float maxY, float minZ, float maxZ)");
apply_type(0x00682CB0, "void __thiscall func(CGxDevice* this, int32_t (*windowProc)(void*, uint32_t, uintptr_t, intptr_t), CGxFormat* format)");
apply_type(0x00682CD0, "void __thiscall func(CGxDevice* this, CGxFormat* format)");
apply_type(0x00682CF0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00682D00, "void __thiscall func(CGxDevice* this, uint32_t baseMipLevel)");
apply_type(0x00682D20, "EGxApi __thiscall func(CGxDevice* this)");
apply_type(0x00682D40, "int32_t __thiscall func(CGxDevice* this)");
apply_type(0x00682D70, "CRect* __thiscall func(CGxDevice* this)");
apply_type(0x00682DC0, "int32_t __thiscall func(CGxDevice* this, int32_t a2)");
apply_type(0x00682E20, "int32_t __thiscall func(CGxDevice* this, int32_t a2)");
apply_type(0x00682E50, "void __thiscall func(CGxDevice* this)");
apply_type(0x00682F40, "uint32_t __stdcall func(EGxPrim primType, uint32_t indexCount)");
apply_type(0x00683080, "void __thiscall func(CGxDevice* this, uint32_t whichLight, int32_t enable)");
apply_type(0x006830B0, "int32_t __thiscall func(CGxDevice* this, uint32_t app, uint32_t hw, uint32_t appDisables, uint32_t hwDisables, uint32_t flagPos, int32_t* enable)");
apply_type(0x00683100, "int32_t __thiscall func(CGxDevice* this, EGxMasterEnables state)");
apply_type(0x00683130, "int32_t __thiscall func(CGxDevice* this, CGxBuf* buf, void *data, uint32_t size, uint32_t offset)");
apply_type(0x00683150, "uint8_t* __thiscall func(CGxDevice* this, CGxBuf* buf)");
apply_type(0x00683180, "int32_t __thiscall func(CGxDevice* this, CGxBuf* buf, uint32_t size)");
apply_type(0x006833A0, "void __thiscall func(CGxDevice* this)");
apply_type(0x006833E0, "void __thiscall func(CGxDevice* this, EGxShTarget target, uint32_t index, float* constants, uint32_t count)");
apply_type(0x00683560, "uint8_t* __thiscall func(CGxDevice* this, EGxShTarget target)");
apply_type(0x00683580, "void __thiscall func(CGxDevice* this, EGxShTarget target, uint32_t index, uint32_t count)");
apply_type(0x006835E0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00683610, "void __stdcall func(EGxTexCommand command, uint32_t width, uint32_t height, uint32_t face, uint32_t level, void* userArg, uint32_t* texelStrideInBytes, void** texels)");
apply_type(0x00683640, "void __thiscall func(CGxDevice* this, int32_t visible)");
apply_type(0x00683650, "uint32_t* __thiscall func(CGxDevice* this)");
apply_type(0x00683660, "void __thiscall func(CGxDevice* this, float depth)");
apply_type(0x006840F0, "int32_t __thiscall func(CGxDevice* this, CGxFormat* format)");
apply_type(0x00684170, "void __thiscall func(CGxDevice* this, float gamma)");
apply_type(0x00684190, "int32_t __thiscall func(CGxDevice* this, CGxGammaRamp* ramp)");
apply_type(0x00684360, "void __thiscall func(CGxDevice* this, CRect* rect)");
apply_type(0x006843B0, "void __thiscall func(CGxDevice* this)");
apply_type(0x006843E0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00684410, "void __thiscall func(CGxDevice* this)");
apply_type(0x00684440, "void __thiscall func(CGxDevice* this, uint32_t a2, C4Plane* plane)");
apply_type(0x006847D0, "void __thiscall func(CGxDevice* this, uint32_t a2, CGxLight* light, C3Vector* pos)");
apply_type(0x00684850, "void __thiscall func(CGxDevice* this, EGxPoolTarget target, uint32_t itemSize, uint32_t itemCount)");
apply_type(0x006848A0, "void __thiscall func(CGxDevice* this, CGxTex* texId, CiRect* updateRect, int32_t immediate)");
apply_type(0x00684900, "void __thiscall func(CGxDevice* this, CGxTex* texId)");
apply_type(0x00684970, "int32_t __thiscall func(CGxDevice* this, CGxShader** shaders, EGxShTarget target, char* a4, char* a5, int32_t permutations)");
apply_type(0x00684AD0, "void __thiscall func(CGxDevice* this, CGxFormat* format)");
apply_type(0x00684B50, "void __thiscall func(CGxDevice* this, uint32_t x, uint32_t y)");
apply_type(0x00684C20, "void __stdcall func(char* format, ...)");
apply_type(0x00684C40, "void __stdcall func(CGxCaps* caps)");
apply_type(0x00684D10, "void __stdcall func(CGxFormat* format)");
apply_type(0x006853B0, "void __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)");
apply_type(0x006853D0, "int32_t __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)");
apply_type(0x00685460, "void __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)");
apply_type(0x00685480, "int32_t __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)");
apply_type(0x00685510, "void __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)");
apply_type(0x00685530, "int32_t __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)");
apply_type(0x00685970, "void __thiscall func(CGxDevice* this, EGxRenderState which)");
apply_type(0x006859E0, "void __thiscall func(CGxDevice* this, EGxRenderState which)");
apply_type(0x00685A70, "void __thiscall func(CGxDevice* this)");
apply_type(0x00685B50, "void __thiscall func(CGxDevice* this, int32_t force)");
apply_type(0x00685C60, "void __thiscall func(CGxDevice* this, EGxTexTarget target, uint32_t width, uint32_t height, uint32_t depth, EGxTexFormat format, EGxTexFormat dataFormat, CGxTexFlags flags, void* userArg, void (*userFunc)(EGxTexCommand, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t*, void**), char* name, CGxTex** texId)");
apply_type(0x00685EB0, "void __thiscall func(CGxDevice* this, EGxMasterEnables state, int32_t enable)");
apply_type(0x00685F50, "void __thiscall func(CGxDevice* this, EGxRenderState which, void* value)");
apply_type(0x00685FB0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00687660, "CGxBuf* __thiscall func(CGxDevice* this, CGxPool* pool, uint32_t itemSize, uint32_t itemCount, uint32_t index)");
apply_type(0x006876D0, "CGxPool* __thiscall func(CGxDevice* this, EGxPoolTarget target, EGxPoolUsage usage, uint32_t size, EGxPoolHintBits hint, char* name)");
apply_type(0x00687A90, "void __thiscall func(CGxDevice* this)");
apply_type(0x00688340, "void __thiscall func(CGxDevice* this, CGxPool* pool)");
apply_type(0x00688690, "void __thiscall func(CGxDevice* this)");
apply_type(0x006890C0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00689690, "void __thiscall func(CGxDevice *this, uint8_t __flags)");
apply_type(0x006897C0, "void __thiscall func(CGxDevice* this, CGxShader**, EGxShTarget, char*, char*, int32_t)");
apply_type(0x00689EF0, "CGxDevice* __stdcall func()");
apply_type(0x0068BF20, "CGxDevice* __stdcall func()");
apply_type(0x0068C220, "CGxDevice* __stdcall func()");
apply_type(0x006A5A30, "void __thiscall func(CGxDeviceD3d* this)");
apply_type(0x006A5EF0, "void __thiscall func(CGxDevice* this, CGxTex* texId, uint32_t* width, uint32_t* height, uint32_t* baseMip, uint32_t* mipCount)");
apply_type(0x006AA3B0, "int32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AA3E0, "uint32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AA420, "void __thiscall func(CTgaFile* this, uint8_t* pAlphaData, uint8_t* pNoAlphaData, uint8_t* alpha)");
apply_type(0x006AA630, "int32_t __thiscall func(CTgaFile* this, uint8_t* pRLEData, uint8_t* pData)");
apply_type(0x006AA700, "void __thiscall func(CTgaFile* this, int32_t set)");
apply_type(0x006AA840, "TGA32Pixel* __thiscall func(CTgaFile* this)");
apply_type(0x006AA870, "int32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AAF40, "int32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AAFB0, "int32_t __thiscall func(CTgaFile* this, char* filename, int32_t a3)");
apply_type(0x006AB390, "int32_t __thiscall func(CTgaFile* this, void* pImg)");
apply_type(0x006AB4B0, "int32_t __thiscall func(CTgaFile* this, int32_t flags)");
apply_type(0x006AB620, "uint32_t __cdecl func(uint32_t level, uint32_t width, uint32_t height, uint32_t fourCC)");
apply_type(0x006AB700, "uint32_t __stdcall func(uint32_t width, uint32_t height)");
apply_type(0x006AB760, "MipBits* __stdcall func(uint32_t fourCC, uint32_t width, uint32_t height, char* filename, int32_t linenumber)");
apply_type(0x006AB810, "void __stdcall func(uint32_t fourCC, uint32_t width, uint32_t height, MipBits* bits)");
apply_type(0x006AB860, "void _stdcall func(C4Pixel* dest, uint32_t destWidth, uint32_t destHeight, C4Pixel* source, uint32_t sourceWidth, uint32_t sourceHeight)");
apply_type(0x006AE8B0, "void __thiscall func(CBLPFile* this)");
apply_type(0x006AE900, "int32_t __thiscall func(CBLPFile* this, void* fileBits)");
apply_type(0x006AE990, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t colorSize)");
apply_type(0x006AE9E0, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t colorSize)");
apply_type(0x006AEBA0, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AEE70, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AF140, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AF340, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AF6A0, "uint32_t __thiscall func(CBLPFile* this, uint32_t mipLevel)");
apply_type(0x006AF730, "int32_t __thiscall func(CBLPFile *this, PIXEL_FORMAT format, uint32_t mipLevel, uint32_t* size, uint32_t* stride)");
apply_type(0x006AF810, "int32_t __thiscall func(CBLPFile* this, PIXEL_FORMAT format, uint32_t mipLevel, uint8_t* data, void* tempBuffer)");
apply_type(0x006AFCE0, "int32_t __thiscall func(CBLPFile* this, char* fileName, PIXEL_FORMAT format, uint32_t mipLevel, unsigned char* data, uint32_t* stride)");
apply_type(0x006AFF10, "int32_t __thiscall func(CBLPFile* this, char* filename)");
apply_type(0x006AFFD0, "int32_t __thiscall func(CBLPFile* this, char* fileName, PIXEL_FORMAT format, MipBits** images, uint32_t mipLevel, int32_t a6)");
apply_type(0x006BF4C0, "void __stdcall GxuXformCreateOrtho(float minX, float maxX, float minY, float maxY, float minZ, float maxZ, C44Matrix* dst)");
apply_type(0x0076E540, "void* __stdcall func(uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)");
apply_type(0x0076E5A0, "int32_t __stdcall func(void* ptr, char* filename, int32_t linenumber, uint32_t flags)");
apply_type(0x0076E5E0, "void* __stdcall func(void* ptr, uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)");
apply_type(0x0076F070, "int32_t __stdcall func(char* dest, size_t maxchars, char* format, ...)");
apply_type(0x00774620, "SCritSect* __thiscall func(SCritSect* this)");
apply_type(0x00774630, "void __thiscall func(SCritSect *this)");
apply_type(0x00774640, "void __thiscall func(SCritSect *this)");
apply_type(0x00774650, "void __thiscall func(SCritSect *this)");
apply_type(0x00777420, "void __stdcall func(HSRGN handle, RECTF* rect, void* param, int32_t combinemode)");
apply_type(0x00777590, "void __stdcall func(HSRGN handle, RECTF* rect)");
apply_type(0x00819EA0, "void __stdcall func(int32_t function, FrameScript_Object* object, int32_t args, char* args_fmt, FrameScript_EventObject* eventObject)");
apply_type(0x0095F3A0, "void __thiscall func(CSimpleModel* this)");
apply_type(0x0095F420, "FrameScript_Object__ScriptIx* __thiscall func(CSimpleModel* this, char* name, FrameScript_Object__ScriptData* data)");
apply_type(0x0095F4D0, "void __stdcall func(CM2Model* model, void* arg)");
apply_type(0x0095F4F0, "void __thiscall func(CSimpleModel* this, HCAMERA camera)");
apply_type(0x0095F540, "void __thiscall func(CSimpleModel* this, uint32_t id)");
apply_type(0x0095F5C0, "void __thiscall func(CSimpleModel* this, CM2Light* light)");
apply_type(0x0095F5E0, "void __thiscall func(CSimpleModel* this, uint32_t sequence)");
apply_type(0x0095F610, "int32_t __thiscall func(CSimpleModel* this, uint32_t sequence, int32_t time)");
apply_type(0x0095F680, "void __thiscall func(CSimpleModel* this)");
apply_type(0x0095F7D0, "void __thiscall func(CSimpleModel* this, uint32_t __flags)");
apply_type(0x0095F800, "void __thiscall func(CSimpleModel* this, XMLNode* node, CStatus* status)");
apply_type(0x0095F990, "void __thiscall func(CSimpleModel* this, char* sourcefile)");
apply_type(0x0095F9F0, "void __thiscall func(CSimpleModel* this, uint32_t index)");
apply_type(0x0095FBA0, "void __thiscall func(CSimpleModel* this)");
apply_type(0x0095FC30, "void __stdcall func(void* arg)");
apply_type(0x00960070, "void __stdcall func(CM2Model* model, CM2Lighting* lighting, void* userArg)");
apply_type(0x009600E0, "void __thiscall func(CSimpleModel* this, CM2Model* model)");
apply_type(0x00960190, "void __thiscall func(CSimpleModel* this, CM2Model* model)");
apply_type(0x00960280, "void __thiscall func(CSimpleModel* this, float elapsedSec)");
apply_type(0x009603D0, "void __stdcall func(lua_State* L)");
apply_type(0x00960530, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009605D0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960620, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960660, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009606E0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960760, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009607E0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009608B0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960970, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960A10, "int32_t __stdcall func(lua_State* L, int32_t a2, CM2Light* light)");
apply_type(0x00960D20, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960DD0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00960FC0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961040, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961090, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009610E0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961120, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009611A0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961200, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009612D0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961350, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009613A0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961420, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00961470, "int32_t __stdcall func(lua_State* L)");
apply_type(0x009614B0, "int32_t __stdcall func(lua_State* L)");
apply_type(0x00A2DDC0, "CGxDevice__vtable");
apply_type(0x00AC1B9C, "TSExplicitList_CILayer");
apply_type(0x00AD2808, "char*[53]");
apply_type(0x00AD90B0, "uint8_t[16]");
apply_type(0x00AD90C0, "uint8_t[2]");
apply_type(0x00B417C8, "uint32_t");
apply_type(0x00B417D0, "int32_t");
apply_type(0x00B41850, "CDataRecycler");
apply_type(0x00B6A9DC, "MipBits*");
apply_type(0x00C25CD0, "int8_t");
apply_type(0x00C25DE8, "uint32_t[1024]");
apply_type(0x00C26DE8, "CURSORMODE");
apply_type(0x00C26DF0, "uint32_t[53][1024]");
apply_type(0x00C5DF88, "CGxDevice*");
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
#include <idc.idc>
#include "batch/import_symbols.idc"
#include "batch/import_data_types.idc"
#include "batch/import_functions.idc"
static main() {
// Import all
import_symbols();
import_data_types();
import_functions();
// Wait for auto-analysis to be finished
auto_wait();
}

View file

@ -1,142 +1,6 @@
#include <idc.idc>
#include "batch/import_data_types.idc"
static import_data_types() {
apply_type(0x00408070, "void __stdcall func(float* minX, float* maxX, float* minY, float* maxY, float* minZ, float* maxZ)");
apply_type(0x00409670, "void __thiscall func(CGxDevice* this)");
apply_type(0x004804F0, "void __cdecl func(EvtContext* context, EVENTID id, void* handler, void* param, float priority)");
apply_type(0x004806A0, "int32_t __cdecl func(EvtContext* context, EVENTID id, void *data, size_t bytes)");
apply_type(0x004B5510, "int32_t __stdcall func(uint32_t width, uint32_t height)");
apply_type(0x004B7220, "MipBits* __stdcall func(PIXEL_FORMAT format, uint32_t width, uint32_t height)");
apply_type(0x004B7300, "void func(MipBits* image)");
apply_type(0x004B78A0, "int32_t __usercall func@<eax>(char* ext@<eax>, char* filename, int32_t a3, MipBits** mipBits, uint32_t* width, uint32_t* height, PIXEL_FORMAT* texFormat, int32_t* isOpaque@<ecx>, uint32_t* alphaBits, PIXEL_FORMAT* dataFormat)");
apply_type(0x004B8070, "int32_t __usercall func@<eax>(char* ext@<eax>, char* filename@<ebx>, int32_t a3, MipBits** mipBits, uint32_t* width, uint32_t* height, uint32_t* isOpaque, uint32_t* alphaBits, PIXEL_FORMAT* dataFormat)");
apply_type(0x004B81D0, "MipBits* func(const char* filename, uint32_t* width, uint32_t* height, PIXEL_FORMAT* dataFormat, int32_t* isOpaque, CStatus* status, uint32_t* alphaBits, int32_t a8)");
apply_type(0x00532AF0, "CGxCaps* __thiscall func(CGxDevice* this)");
apply_type(0x006160B0, "int32_t __usercall func@<eax>(uint32_t** image@<eax>, MipBits* mipImages@<ecx>, uint32_t width@<edx>, uint32_t height)");
apply_type(0x00616800, "void __stdcall func(CURSORMODE mode)");
apply_type(0x00681F60, "void __stdcall func(float minX, float maxX, float minY, float maxY, float minZ, float maxZ)");
apply_type(0x00682CB0, "void __thiscall func(CGxDevice* this, int32_t (*windowProc)(void*, uint32_t, uintptr_t, intptr_t), CGxFormat* format)");
apply_type(0x00682D00, "void __thiscall func(CGxDevice* this, uint32_t baseMipLevel)");
apply_type(0x00682D20, "EGxApi __thiscall func(CGxDevice* this)");
apply_type(0x00682D40, "int32_t __thiscall func(CGxDevice* this)");
apply_type(0x00682D70, "CRect* __thiscall func(CGxDevice* this)");
apply_type(0x00682DC0, "int32_t __thiscall func(CGxDevice* this, int32_t a2)");
apply_type(0x00682E20, "int32_t __thiscall func(CGxDevice* this, int32_t a2)");
apply_type(0x00682E50, "void __thiscall func(CGxDevice* this)");
apply_type(0x00682F40, "uint32_t __stdcall func(EGxPrim primType, uint32_t indexCount)");
apply_type(0x00683080, "void __thiscall func(CGxDevice* this, uint32_t whichLight, int32_t enable)");
apply_type(0x006830B0, "int32_t __thiscall func(CGxDevice* this, uint32_t app, uint32_t hw, uint32_t appDisables, uint32_t hwDisables, uint32_t flagPos, int32_t* enable)");
apply_type(0x00683100, "int32_t __thiscall func(CGxDevice* this, EGxMasterEnables state)");
apply_type(0x00683130, "int32_t __thiscall func(CGxDevice* this, CGxBuf* buf, void *data, uint32_t size, uint32_t offset)");
apply_type(0x00683150, "uint8_t* __thiscall func(CGxDevice* this, CGxBuf* buf)");
apply_type(0x00683180, "int32_t __thiscall func(CGxDevice* this, CGxBuf* buf, uint32_t size)");
apply_type(0x006833A0, "void __thiscall func(CGxDevice* this)");
apply_type(0x006833E0, "void __thiscall func(CGxDevice* this, EGxShTarget target, uint32_t index, float* constants, uint32_t count)");
apply_type(0x00683560, "uint8_t* __thiscall func(CGxDevice* this, EGxShTarget target)");
apply_type(0x00683580, "void __thiscall func(CGxDevice* this, EGxShTarget target, uint32_t index, uint32_t count)");
apply_type(0x006835E0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00683610, "void __stdcall func(EGxTexCommand command, uint32_t width, uint32_t height, uint32_t face, uint32_t level, void* userArg, uint32_t* texelStrideInBytes, void** texels)");
apply_type(0x00683640, "void __thiscall func(CGxDevice* this, int32_t visible)");
apply_type(0x00683650, "uint32_t* __thiscall func(CGxDevice* this)");
apply_type(0x00683660, "void __thiscall func(CGxDevice* this, float depth)");
apply_type(0x006840F0, "int32_t __thiscall func(CGxDevice* this, CGxFormat* format)");
apply_type(0x00684190, "int32_t __thiscall func(CGxDevice* this, CGxGammaRamp* ramp)");
apply_type(0x00684360, "void __thiscall func(CGxDevice* this, CRect* rect)");
apply_type(0x006843B0, "void __thiscall func(CGxDevice* this)");
apply_type(0x006843E0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00684410, "void __thiscall func(CGxDevice* this)");
apply_type(0x00684440, "void __thiscall func(CGxDevice* this, uint32_t a2, C4Plane* plane)");
apply_type(0x006847D0, "void __thiscall func(CGxDevice* this, uint32_t a2, CGxLight* light, C3Vector* pos)");
apply_type(0x00684850, "void __thiscall func(CGxDevice* this, EGxPoolTarget target, uint32_t itemSize, uint32_t itemCount)");
apply_type(0x006848A0, "void __thiscall func(CGxDevice* this, CGxTex* texId, CiRect* updateRect, int32_t immediate)");
apply_type(0x00684900, "void __thiscall func(CGxDevice* this, CGxTex* texId)");
apply_type(0x00684970, "int32_t __thiscall func(CGxDevice* this, CGxShader** shaders, EGxShTarget target, char* a4, char* a5, int32_t permutations)");
apply_type(0x00684AD0, "void __thiscall func(CGxDevice* this, CGxFormat* format)");
apply_type(0x00684B50, "void __thiscall func(CGxDevice* this, uint32_t x, uint32_t y)");
apply_type(0x00684C20, "void __stdcall func(char* format, ...)");
apply_type(0x00684C40, "void __stdcall func(CGxCaps* caps)");
apply_type(0x00684D10, "void __stdcall func(CGxFormat* format)");
apply_type(0x006853B0, "void __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)");
apply_type(0x006853D0, "int32_t __thiscall func(CGxDevice* this, DEVICERESTOREDCALLBACK fn)");
apply_type(0x00685460, "void __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)");
apply_type(0x00685480, "int32_t __thiscall func(CGxDevice* this, TEXTURERECREATIONCALLBACK fn)");
apply_type(0x00685510, "void __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)");
apply_type(0x00685530, "int32_t __thiscall func(CGxDevice* this, DISPLAYCHANGECALLBACK fn)");
apply_type(0x00685970, "void __thiscall func(CGxDevice* this, EGxRenderState which)");
apply_type(0x006859E0, "void __thiscall func(CGxDevice* this, EGxRenderState which)");
apply_type(0x00685A70, "void __thiscall func(CGxDevice* this)");
apply_type(0x00685B50, "void __thiscall func(CGxDevice* this, int32_t force)");
apply_type(0x00685C60, "void __thiscall func(CGxDevice* this, EGxTexTarget target, uint32_t width, uint32_t height, uint32_t depth, EGxTexFormat format, EGxTexFormat dataFormat, CGxTexFlags flags, void* userArg, void (*userFunc)(EGxTexCommand, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t*, void**), char* name, CGxTex** texId)");
apply_type(0x00685EB0, "void __thiscall func(CGxDevice* this, EGxMasterEnables state, int32_t enable)");
apply_type(0x00685F50, "void __thiscall func(CGxDevice* this, EGxRenderState which, void* value)");
apply_type(0x00685FB0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00687660, "CGxBuf* __thiscall func(CGxDevice* this, CGxPool* pool, uint32_t itemSize, uint32_t itemCount, uint32_t index)");
apply_type(0x006876D0, "CGxPool* __thiscall func(CGxDevice* this, EGxPoolTarget target, EGxPoolUsage usage, uint32_t size, EGxPoolHintBits hint, char* name)");
apply_type(0x00687A90, "void __thiscall func(CGxDevice* this)");
apply_type(0x00688340, "void __thiscall func(CGxDevice* this, CGxPool* pool)");
apply_type(0x00688690, "void __thiscall func(CGxDevice* this)");
apply_type(0x006890C0, "void __thiscall func(CGxDevice* this)");
apply_type(0x00689690, "void __thiscall func(CGxDevice *this, uint8_t __flags)");
apply_type(0x006897C0, "void __thiscall func(CGxDevice* this, CGxShader**, EGxShTarget, char*, char*, int32_t)");
apply_type(0x00689EF0, "CGxDevice* __stdcall func()");
apply_type(0x0068BF20, "CGxDevice* __stdcall func()");
apply_type(0x0068C220, "CGxDevice* __stdcall func()");
apply_type(0x006A5A30, "void __thiscall func(CGxDeviceD3d* this)");
apply_type(0x006A5EF0, "void __thiscall func(CGxDevice* this, CGxTex* texId, uint32_t* width, uint32_t* height, uint32_t* baseMip, uint32_t* mipCount)");
apply_type(0x006AA3B0, "int32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AA3E0, "uint32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AA420, "void __thiscall func(CTgaFile* this, uint8_t* pAlphaData, uint8_t* pNoAlphaData, uint8_t* alpha)");
apply_type(0x006AA630, "int32_t __thiscall func(CTgaFile* this, uint8_t* pRLEData, uint8_t* pData)");
apply_type(0x006AA700, "void __thiscall func(CTgaFile* this, int32_t set)");
apply_type(0x006AA840, "TGA32Pixel* __thiscall func(CTgaFile* this)");
apply_type(0x006AA870, "int32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AAF40, "int32_t __thiscall func(CTgaFile* this)");
apply_type(0x006AAFB0, "int32_t __thiscall func(CTgaFile* this, char* filename, int32_t a3)");
apply_type(0x006AB390, "int32_t __thiscall func(CTgaFile* this, void* pImg)");
apply_type(0x006AB4B0, "int32_t __thiscall func(CTgaFile* this, int32_t flags)");
apply_type(0x006AB620, "uint32_t __cdecl func(uint32_t level, uint32_t width, uint32_t height, uint32_t fourCC)");
apply_type(0x006AB700, "uint32_t __stdcall func(uint32_t width, uint32_t height)");
apply_type(0x006AB760, "MipBits* __stdcall func(uint32_t fourCC, uint32_t width, uint32_t height, char* filename, int32_t linenumber)");
apply_type(0x006AB810, "void __stdcall func(uint32_t fourCC, uint32_t width, uint32_t height, MipBits* bits)");
apply_type(0x006AB860, "void _stdcall func(C4Pixel* dest, uint32_t destWidth, uint32_t destHeight, C4Pixel* source, uint32_t sourceWidth, uint32_t sourceHeight)");
apply_type(0x006AE8B0, "void __thiscall func(CBLPFile* this)");
apply_type(0x006AE900, "int32_t __thiscall func(CBLPFile* this, void* fileBits)");
apply_type(0x006AE990, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t colorSize)");
apply_type(0x006AE9E0, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t colorSize)");
apply_type(0x006AEBA0, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AEE70, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AF140, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AF340, "void __thiscall func(CBLPFile* this, uint8_t* data, void* tempbuffer, uint32_t width, uint32_t height)");
apply_type(0x006AF6A0, "uint32_t __thiscall func(CBLPFile* this, uint32_t mipLevel)");
apply_type(0x006AF730, "int32_t __thiscall func(CBLPFile *this, PIXEL_FORMAT format, uint32_t mipLevel, uint32_t* size, uint32_t* stride)");
apply_type(0x006AF810, "int32_t __thiscall func(CBLPFile* this, PIXEL_FORMAT format, uint32_t mipLevel, uint8_t* data, void* tempBuffer)");
apply_type(0x006AFCE0, "int32_t __thiscall func(CBLPFile* this, char* fileName, PIXEL_FORMAT format, uint32_t mipLevel, unsigned char* data, uint32_t* stride)");
apply_type(0x006AFF10, "int32_t __thiscall func(CBLPFile* this, char* filename)");
apply_type(0x006AFFD0, "int32_t __thiscall func(CBLPFile* this, char* fileName, PIXEL_FORMAT format, MipBits** images, uint32_t mipLevel, int32_t a6)");
apply_type(0x006BF4C0, "void __stdcall GxuXformCreateOrtho(float minX, float maxX, float minY, float maxY, float minZ, float maxZ, C44Matrix* dst)");
apply_type(0x0076E540, "void* __stdcall func(uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)");
apply_type(0x0076E5A0, "int32_t __stdcall func(void* ptr, char* filename, int32_t linenumber, uint32_t flags)");
apply_type(0x0076E5E0, "void* __stdcall func(void* ptr, uint32_t bytes, char* filename, int32_t linenumber, uint32_t flags)");
apply_type(0x0076F070, "int32_t __stdcall func(char* dest, size_t maxchars, char* format, ...)");
apply_type(0x00774620, "SCritSect* __thiscall func(SCritSect* this)");
apply_type(0x00774630, "void __thiscall func(SCritSect *this)");
apply_type(0x00774640, "void __thiscall func(SCritSect *this)");
apply_type(0x00774650, "void __thiscall func(SCritSect *this)");
apply_type(0x00777420, "void __stdcall func(HSRGN handle, RECTF* rect, void* param, int32_t combinemode)");
apply_type(0x00777590, "void __stdcall func(HSRGN handle, RECTF* rect)");
apply_type(0x00819EA0, "void __stdcall func(int32_t function, FrameScript_Object* object, int32_t args, char* args_fmt, FrameScript_EventObject* eventObject)");
apply_type(0x00A2DDC0, "CGxDevice__vtable");
apply_type(0x00AC1B9C, "TSExplicitList_CILayer");
apply_type(0x00AD2808, "char*[53]");
apply_type(0x00AD90B0, "uint8_t[16]");
apply_type(0x00AD90C0, "uint8_t[2]");
apply_type(0x00B417C8, "uint32_t");
apply_type(0x00B417D0, "int32_t");
apply_type(0x00B41850, "CDataRecycler");
apply_type(0x00B6A9DC, "MipBits*");
apply_type(0x00C25CD0, "int8_t");
apply_type(0x00C25DE8, "uint32_t[1024]");
apply_type(0x00C26DE8, "CURSORMODE");
apply_type(0x00C26DF0, "uint32_t[53][1024]");
apply_type(0x00C5DF88, "CGxDevice*");
static main() {
import_data_types();
auto_wait();
}

View file

@ -0,0 +1,5 @@
#include "batch/import_functions.idc"
static main() {
import_functions();
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,31 @@
#ifndef CAMERA_CAMERA_H
#define CAMERA_CAMERA_H
DECLARE_STRUCT(CAngle);
DECLARE_STRUCT(CCamera);
#include "common/datamanager.h"
typedef HDATAMGR HCAMERA;
// class CAngle : public TManaged<float>
struct CAngle {
TManaged_float b_base;
float m_cos;
float m_sin;
};
// class CCamera : public CDataMgr
struct CCamera {
TManaged_C3Vector m_position;
TManaged_C3Vector m_target;
TManaged_float m_distance;
TManaged_float m_zFar;
TManaged_float m_zNear;
CAngle m_aoa;
CAngle m_fov;
CAngle m_roll;
CAngle m_rotation;
};
#endif

View file

@ -0,0 +1,63 @@
#ifndef COMMON_DATA_MANAGER_H
#define COMMON_DATA_MANAGER_H
DECLARE_STRUCT(CBaseManaged);
DECLARE_STRUCT(CDataMgr);
DECLARE_ENUM(CBaseManaged__ManagedTypeIds);
DECLARE_ENUM(CBaseManaged__ManagedFlags);
#include "system/types.h"
#include "common/handle.h"
#include "storm/array.h"
#include "storm/list.h"
#include "tempest/vector.h"
typedef HOBJECT HDATAMGR;
STORM_TS_FIXED_ARRAY_POINTER_TO(CBaseManaged);
STORM_TS_LIST(CBaseManaged);
enum CBaseManaged__ManagedTypeIds {
// TODO
COORD = 3,
FLOAT = 6,
DATATYPEIDS = 7
};
enum CBaseManaged__ManagedFlags {
ALWAYSUPDATE = 0x1,
READONLY = 0x2,
REQUIRESUPDATE = 0x4,
UPDATED = 0x8,
};
struct CBaseManaged {
void* v_vtable;
TSLink_CBaseManaged m_link;
uint8_t m_dataTypeId;
uint8_t m_flags;
void (*m_updateFcn)(float, void*, void*);
void* m_updateData;
float m_updatePriority;
};
// class CDataMgr : public CHandleObject
struct CDataMgr {
CHandleObject b_base;
TSFixedArray_pointer_to_CBaseManaged m_managedArray;
TSExplicitList_CBaseManaged m_updateList;
};
// class TManaged<T> : public CBaseManaged
#define COMMON_T_MANAGED(T) \
typedef struct TManaged_##T TManaged_##T; \
struct TManaged_##T { \
CBaseManaged b_base; \
T m_data; \
};
// declare types
COMMON_T_MANAGED(float);
COMMON_T_MANAGED(C3Vector);
#endif

View file

@ -16,4 +16,6 @@ struct CHandleObject {
int32_t m_refcount;
};
DECLARE_HANDLE(HOBJECT);
#endif

View file

@ -1,6 +1,9 @@
#ifndef CURSOR_TYPES_H
#define CURSOR_TYPES_H
DECLARE_ENUM(CURSORITEMTYPE);
DECLARE_ENUM(CURSORMODE);
enum CURSORITEMTYPE {
CURSOR_EMPTY = 0,
CURSOR_ITEM = 1,

View file

@ -0,0 +1,16 @@
/*
** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions from Lua API
** See Copyright Notice in lua.h
*/
#ifndef lapi_h
#define lapi_h
#include "external/lua/lobject.h"
LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
#endif

View file

@ -0,0 +1,174 @@
/*
** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
#ifndef lauxlib_h
#define lauxlib_h
#include <stddef.h>
#include <stdio.h>
#include "external/lua/lua.h"
#if defined(LUA_COMPAT_GETN)
LUALIB_API int (luaL_getn) (lua_State *L, int t);
LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
#else
#define luaL_getn(L,i) ((int)lua_objlen(L, i))
#define luaL_setn(L,i,j) ((void)0) /* no op! */
#endif
#if defined(LUA_COMPAT_OPENLIB)
#define luaI_openlib luaL_openlib
#endif
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
typedef struct luaL_Reg {
const char *name;
lua_CFunction func;
} luaL_Reg;
LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
const luaL_Reg *l, int nup);
LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
const luaL_Reg *l);
LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
size_t *l);
LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
const char *def, size_t *l);
LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
lua_Integer def);
LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
const char *const lst[]);
LUALIB_API int (luaL_ref) (lua_State *L, int t);
LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
const char *name);
LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
LUALIB_API lua_State *(luaL_newstate) (void);
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
const char *r);
LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,
const char *fname, int szhint);
/*
** ===============================================================
** some useful macros
** ===============================================================
*/
#define luaL_argcheck(L, cond,numarg,extramsg) \
((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
#define luaL_dofile(L, fn) \
(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
#define luaL_dostring(L, s) \
(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
/*
** {======================================================
** Generic Buffer manipulation
** =======================================================
*/
typedef struct luaL_Buffer {
char *p; /* current position in buffer */
int lvl; /* number of strings in the stack (level) */
lua_State *L;
char buffer[LUAL_BUFFERSIZE];
} luaL_Buffer;
#define luaL_addchar(B,c) \
((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
(*(B)->p++ = (char)(c)))
/* compatibility only */
#define luaL_putchar(B,c) luaL_addchar(B,c)
#define luaL_addsize(B,n) ((B)->p += (n))
LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
/* }====================================================== */
/* compatibility with ref system */
/* pre-defined references */
#define LUA_NOREF (-2)
#define LUA_REFNIL (-1)
#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
(lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
#define luaL_reg luaL_Reg
#endif

View file

@ -0,0 +1,76 @@
/*
** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
#ifndef lcode_h
#define lcode_h
#include "external/lua/llex.h"
#include "external/lua/lobject.h"
#include "external/lua/lopcodes.h"
#include "external/lua/lparser.h"
/*
** Marks the end of a patch list. It is an invalid value both as an absolute
** address, and as a list link (would link an element to itself).
*/
#define NO_JUMP (-1)
/*
** grep "ORDER OPR" if you change these enums
*/
typedef enum BinOpr {
OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,
OPR_CONCAT,
OPR_NE, OPR_EQ,
OPR_LT, OPR_LE, OPR_GT, OPR_GE,
OPR_AND, OPR_OR,
OPR_NOBINOPR
} BinOpr;
typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;
#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info])
#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)
#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET)
LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);
LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);
LUAI_FUNC void luaK_fixline (FuncState *fs, int line);
LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);
LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);
LUAI_FUNC void luaK_checkstack (FuncState *fs, int n);
LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);
LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);
LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);
LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);
LUAI_FUNC int luaK_jump (FuncState *fs);
LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);
LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);
LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);
LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);
LUAI_FUNC int luaK_getlabel (FuncState *fs);
LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);
LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);
LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);
LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);
#endif

View file

@ -0,0 +1,33 @@
/*
** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions from Debug Interface module
** See Copyright Notice in lua.h
*/
#ifndef ldebug_h
#define ldebug_h
#include "external/lua/lstate.h"
#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
#define resethookcount(L) (L->hookcount = L->basehookcount)
LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
const char *opname);
LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
const TValue *p2);
LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
const TValue *p2);
LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
LUAI_FUNC void luaG_errormsg (lua_State *L);
LUAI_FUNC int luaG_checkcode (const Proto *pt);
LUAI_FUNC int luaG_checkopenop (Instruction i);
#endif

View file

@ -0,0 +1,57 @@
/*
** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
#ifndef ldo_h
#define ldo_h
#include "external/lua/lobject.h"
#include "external/lua/lstate.h"
#include "external/lua/lzio.h"
#define luaD_checkstack(L,n) \
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
luaD_growstack(L, n); \
else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
#define savestack(L,p) ((char *)(p) - (char *)L->stack)
#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
#define saveci(L,p) ((char *)(p) - (char *)L->base_ci)
#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n)))
/* results from luaD_precall */
#define PCRLUA 0 /* initiated a call to a Lua function */
#define PCRC 1 /* did a call to a C function */
#define PCRYIELD 2 /* C funtion yielded */
/* type of protected functions, to be ran by `runprotected' */
typedef void (*Pfunc) (lua_State *L, void *ud);
LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
ptrdiff_t oldtop, ptrdiff_t ef);
LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
#endif

View file

@ -0,0 +1,34 @@
/*
** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h
*/
#ifndef lfunc_h
#define lfunc_h
#include "external/lua/lobject.h"
#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
cast(int, sizeof(TValue)*((n)-1)))
#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
cast(int, sizeof(TValue *)*((n)-1)))
LUAI_FUNC Proto *luaF_newproto (lua_State *L);
LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
LUAI_FUNC void luaF_close (lua_State *L, StkId level);
LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
int pc);
#endif

View file

@ -0,0 +1,110 @@
/*
** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/
#ifndef lgc_h
#define lgc_h
#include "external/lua/lobject.h"
/*
** Possible states of the Garbage Collector
*/
#define GCSpause 0
#define GCSpropagate 1
#define GCSsweepstring 2
#define GCSsweep 3
#define GCSfinalize 4
/*
** some userful bit tricks
*/
#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
#define setbits(x,m) ((x) |= (m))
#define testbits(x,m) ((x) & (m))
#define bitmask(b) (1<<(b))
#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
#define l_setbit(x,b) setbits(x, bitmask(b))
#define resetbit(x,b) resetbits(x, bitmask(b))
#define testbit(x,b) testbits(x, bitmask(b))
#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2)))
#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2)))
#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2)))
/*
** Layout for bit use in `marked' field:
** bit 0 - object is white (type 0)
** bit 1 - object is white (type 1)
** bit 2 - object is black
** bit 3 - for userdata: has been finalized
** bit 3 - for tables: has weak keys
** bit 4 - for tables: has weak values
** bit 5 - object is fixed (should not be collected)
** bit 6 - object is "super" fixed (only the main thread)
*/
#define WHITE0BIT 0
#define WHITE1BIT 1
#define BLACKBIT 2
#define FINALIZEDBIT 3
#define KEYWEAKBIT 3
#define VALUEWEAKBIT 4
#define FIXEDBIT 5
#define SFIXEDBIT 6
#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
#define isblack(x) testbit((x)->gch.marked, BLACKBIT)
#define isgray(x) (!isblack(x) && !iswhite(x))
#define otherwhite(g) (g->currentwhite ^ WHITEBITS)
#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS)
#define changewhite(x) ((x)->gch.marked ^= WHITEBITS)
#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
#define luaC_checkGC(L) { \
condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
if (G(L)->totalbytes >= G(L)->GCthreshold) \
luaC_step(L); }
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \
luaC_barrierback(L,t); }
#define luaC_objbarrier(L,p,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
#define luaC_objbarriert(L,t,o) \
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
LUAI_FUNC void luaC_callGCTM (lua_State *L);
LUAI_FUNC void luaC_freeall (lua_State *L);
LUAI_FUNC void luaC_step (lua_State *L);
LUAI_FUNC void luaC_fullgc (lua_State *L);
LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
#endif

View file

@ -0,0 +1,81 @@
/*
** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
#ifndef llex_h
#define llex_h
#include "external/lua/lobject.h"
#include "external/lua/lzio.h"
#define FIRST_RESERVED 257
/* maximum length of a reserved word */
#define TOKEN_LEN (sizeof("function")/sizeof(char))
/*
* WARNING: if you change the order of this enumeration,
* grep "ORDER RESERVED"
*/
enum RESERVED {
/* terminal symbols denoted by reserved words */
TK_AND = FIRST_RESERVED, TK_BREAK,
TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
/* other terminal symbols */
TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER,
TK_NAME, TK_STRING, TK_EOS
};
/* number of reserved words */
#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1))
/* array with token `names' */
LUAI_DATA const char *const luaX_tokens [];
typedef union {
lua_Number r;
TString *ts;
} SemInfo; /* semantics information */
typedef struct Token {
int token;
SemInfo seminfo;
} Token;
typedef struct LexState {
int current; /* current character (charint) */
int linenumber; /* input line counter */
int lastline; /* line of last token `consumed' */
Token t; /* current token */
Token lookahead; /* look ahead token */
struct FuncState *fs; /* `FuncState' is private to the parser */
struct lua_State *L;
ZIO *z; /* input stream */
Mbuffer *buff; /* buffer for tokens */
TString *source; /* current source name */
char decpoint; /* locale decimal point */
} LexState;
LUAI_FUNC void luaX_init (lua_State *L);
LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
TString *source);
LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
LUAI_FUNC void luaX_next (LexState *ls);
LUAI_FUNC void luaX_lookahead (LexState *ls);
LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
#endif

View file

@ -0,0 +1,128 @@
/*
** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
#ifndef llimits_h
#define llimits_h
#include <limits.h>
#include <stddef.h>
#include "external/lua/lua.h"
typedef LUAI_UINT32 lu_int32;
typedef LUAI_UMEM lu_mem;
typedef LUAI_MEM l_mem;
/* chars used as small naturals (so that `char' is reserved for characters) */
typedef unsigned char lu_byte;
#define MAX_SIZET ((size_t)(~(size_t)0)-2)
#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2)
#define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */
/*
** conversion of pointer to integer
** this is for hashing only; there is no problem if the integer
** cannot hold the whole pointer value
*/
#define IntPoint(p) ((unsigned int)(lu_mem)(p))
/* type to ensure maximum alignment */
typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
/* result of a `usual argument conversion' over lua_Number */
typedef LUAI_UACNUMBER l_uacNumber;
/* internal assertions for in-house debugging */
#ifdef lua_assert
#define check_exp(c,e) (lua_assert(c), (e))
#define api_check(l,e) lua_assert(e)
#else
#define lua_assert(c) ((void)0)
#define check_exp(c,e) (e)
#define api_check luai_apicheck
#endif
#ifndef UNUSED
#define UNUSED(x) ((void)(x)) /* to avoid warnings */
#endif
#ifndef cast
#define cast(t, exp) ((t)(exp))
#endif
#define cast_byte(i) cast(lu_byte, (i))
#define cast_num(i) cast(lua_Number, (i))
#define cast_int(i) cast(int, (i))
/*
** type for virtual-machine instructions
** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
*/
typedef lu_int32 Instruction;
/* maximum stack for a Lua function */
#define MAXSTACK 250
/* minimum size for the string table (must be power of 2) */
#ifndef MINSTRTABSIZE
#define MINSTRTABSIZE 32
#endif
/* minimum size for string buffer */
#ifndef LUA_MINBUFFER
#define LUA_MINBUFFER 32
#endif
#ifndef lua_lock
#define lua_lock(L) ((void) 0)
#define lua_unlock(L) ((void) 0)
#endif
#ifndef luai_threadyield
#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);}
#endif
/*
** macro to control inclusion of some hard tests on stack reallocation
*/
#ifndef HARDSTACKTESTS
#define condhardstacktests(x) ((void)0)
#else
#define condhardstacktests(x) x
#endif
#endif

View file

@ -0,0 +1,49 @@
/*
** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
#ifndef lmem_h
#define lmem_h
#include <stddef.h>
#include "external/lua/llimits.h"
#include "external/lua/lua.h"
#define MEMERRMSG "not enough memory"
#define luaM_reallocv(L,b,on,n,e) \
((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
luaM_toobig(L))
#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t))
#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t))
#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
#define luaM_newvector(L,n,t) \
cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define luaM_growvector(L,v,nelems,size,t,limit,e) \
if ((nelems)+1 > (size)) \
((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))
#define luaM_reallocvector(L, v,oldn,n,t) \
((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
size_t size);
LUAI_FUNC void *luaM_toobig (lua_State *L);
LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
size_t size_elem, int limit,
const char *errormsg);
#endif

View file

@ -0,0 +1,387 @@
/*
** $Id: lobject.h,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
#ifndef lobject_h
#define lobject_h
#if defined(IDA) || defined(BINANA_GENERATOR)
#include "external/lua/shim.h"
#else
#include <stdarg.h>
#endif
#include "external/lua/llimits.h"
#include "external/lua/lua.h"
/* tags for values visible from Lua */
#define LAST_TAG LUA_TTHREAD
#define NUM_TAGS (LAST_TAG+1)
/*
** Extra tags for non-values
*/
#define LUA_TPROTO (LAST_TAG+1)
#define LUA_TUPVAL (LAST_TAG+2)
#define LUA_TDEADKEY (LAST_TAG+3)
/*
** Union of all collectable objects
*/
typedef union GCObject GCObject;
/*
** Common Header for all collectable objects (in macro form, to be
** included in other objects)
*/
#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked
/*
** Common header in struct form
*/
typedef struct GCheader {
CommonHeader;
} GCheader;
/*
** Union of all Lua values
*/
typedef union {
GCObject *gc;
void *p;
lua_Number n;
int b;
} Value;
/*
** Tagged Values
*/
#define TValuefields Value value; int tt
typedef struct lua_TValue {
TValuefields;
} TValue;
/* Macros to test type */
#define ttisnil(o) (ttype(o) == LUA_TNIL)
#define ttisnumber(o) (ttype(o) == LUA_TNUMBER)
#define ttisstring(o) (ttype(o) == LUA_TSTRING)
#define ttistable(o) (ttype(o) == LUA_TTABLE)
#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION)
#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN)
#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA)
#define ttisthread(o) (ttype(o) == LUA_TTHREAD)
#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA)
/* Macros to access values */
#define ttype(o) ((o)->tt)
#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc)
#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p)
#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n)
#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts)
#define tsvalue(o) (&rawtsvalue(o)->tsv)
#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u)
#define uvalue(o) (&rawuvalue(o)->uv)
#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl)
#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h)
#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b)
#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th)
#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
/*
** for internal debug only
*/
#define checkconsistency(obj) \
lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt))
#define checkliveness(g,obj) \
lua_assert(!iscollectable(obj) || \
((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc)))
/* Macros to set values */
#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)
#define setnvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; }
#define setpvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; }
#define setbvalue(obj,x) \
{ TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; }
#define setsvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \
checkliveness(G(L),i_o); }
#define setuvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \
checkliveness(G(L),i_o); }
#define setthvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \
checkliveness(G(L),i_o); }
#define setclvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \
checkliveness(G(L),i_o); }
#define sethvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \
checkliveness(G(L),i_o); }
#define setptvalue(L,obj,x) \
{ TValue *i_o=(obj); \
i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \
checkliveness(G(L),i_o); }
#define setobj(L,obj1,obj2) \
{ const TValue *o2=(obj2); TValue *o1=(obj1); \
o1->value = o2->value; o1->tt=o2->tt; \
checkliveness(G(L),o1); }
/*
** different types of sets, according to destination
*/
/* from stack to (same) stack */
#define setobjs2s setobj
/* to stack (not from same stack) */
#define setobj2s setobj
#define setsvalue2s setsvalue
#define sethvalue2s sethvalue
#define setptvalue2s setptvalue
/* from table to same table */
#define setobjt2t setobj
/* to table */
#define setobj2t setobj
/* to new object */
#define setobj2n setobj
#define setsvalue2n setsvalue
#define setttype(obj, tt) (ttype(obj) = (tt))
#define iscollectable(o) (ttype(o) >= LUA_TSTRING)
typedef TValue *StkId; /* index to stack elements */
/*
** String headers for string table
*/
typedef union TString {
L_Umaxalign dummy; /* ensures maximum alignment for strings */
struct {
CommonHeader;
lu_byte reserved;
unsigned int hash;
size_t len;
} tsv;
} TString;
#define getstr(ts) cast(const char *, (ts) + 1)
#define svalue(o) getstr(tsvalue(o))
typedef union Udata {
L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */
struct {
CommonHeader;
struct Table *metatable;
struct Table *env;
size_t len;
} uv;
} Udata;
/*
** Function Prototypes
*/
typedef struct Proto {
CommonHeader;
TValue *k; /* constants used by the function */
Instruction *code;
struct Proto **p; /* functions defined inside the function */
int *lineinfo; /* map from opcodes to source lines */
struct LocVar *locvars; /* information about local variables */
TString **upvalues; /* upvalue names */
TString *source;
int sizeupvalues;
int sizek; /* size of `k' */
int sizecode;
int sizelineinfo;
int sizep; /* size of `p' */
int sizelocvars;
int linedefined;
int lastlinedefined;
GCObject *gclist;
lu_byte nups; /* number of upvalues */
lu_byte numparams;
lu_byte is_vararg;
lu_byte maxstacksize;
} Proto;
/* masks for new-style vararg */
#define VARARG_HASARG 1
#define VARARG_ISVARARG 2
#define VARARG_NEEDSARG 4
typedef struct LocVar {
TString *varname;
int startpc; /* first point where variable is active */
int endpc; /* first point where variable is dead */
} LocVar;
/*
** Upvalues
*/
typedef struct UpVal {
CommonHeader;
TValue *v; /* points to stack or to its own value */
union {
TValue value; /* the value (when closed) */
struct { /* double linked list (when open) */
struct UpVal *prev;
struct UpVal *next;
} l;
} u;
} UpVal;
/*
** Closures
*/
#define ClosureHeader \
CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \
struct Table *env
typedef struct CClosure {
ClosureHeader;
lua_CFunction f;
TValue upvalue[1];
} CClosure;
typedef struct LClosure {
ClosureHeader;
struct Proto *p;
UpVal *upvals[1];
} LClosure;
typedef union Closure {
CClosure c;
LClosure l;
} Closure;
#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)
#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)
/*
** Tables
*/
typedef union TKey {
struct {
TValuefields;
struct Node *next; /* for chaining */
} nk;
TValue tvk;
} TKey;
typedef struct Node {
TValue i_val;
TKey i_key;
} Node;
typedef struct Table {
CommonHeader;
lu_byte flags; /* 1<<p means tagmethod(p) is not present */
lu_byte lsizenode; /* log2 of size of `node' array */
struct Table *metatable;
TValue *array; /* array part */
Node *node;
Node *lastfree; /* any free position is before this position */
GCObject *gclist;
int sizearray; /* size of `array' array */
} Table;
/*
** `module' operation for hashing (size is always a power of 2)
*/
#define lmod(s,size) \
(check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
#define twoto(x) (1<<(x))
#define sizenode(t) (twoto((t)->lsizenode))
#define luaO_nilobject (&luaO_nilobject_)
LUAI_DATA const TValue luaO_nilobject_;
#define ceillog2(x) (luaO_log2((x)-1) + 1)
LUAI_FUNC int luaO_log2 (unsigned int x);
LUAI_FUNC int luaO_int2fb (unsigned int x);
LUAI_FUNC int luaO_fb2int (int x);
LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);
LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);
LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,
va_list argp);
LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);
LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len);
#endif

View file

@ -0,0 +1,268 @@
/*
** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
#ifndef lopcodes_h
#define lopcodes_h
#include "external/lua/llimits.h"
/*===========================================================================
We assume that instructions are unsigned numbers.
All instructions have an opcode in the first 6 bits.
Instructions can have the following fields:
`A' : 8 bits
`B' : 9 bits
`C' : 9 bits
`Bx' : 18 bits (`B' and `C' together)
`sBx' : signed Bx
A signed argument is represented in excess K; that is, the number
value is the unsigned value minus K. K is exactly the maximum value
for that argument (so that -max is represented by 0, and +max is
represented by 2*max), which is half the maximum for the corresponding
unsigned argument.
===========================================================================*/
enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */
/*
** size and position of opcode arguments.
*/
#define SIZE_C 9
#define SIZE_B 9
#define SIZE_Bx (SIZE_C + SIZE_B)
#define SIZE_A 8
#define SIZE_OP 6
#define POS_OP 0
#define POS_A (POS_OP + SIZE_OP)
#define POS_C (POS_A + SIZE_A)
#define POS_B (POS_C + SIZE_C)
#define POS_Bx POS_C
/*
** limits for opcode arguments.
** we use (signed) int to manipulate most arguments,
** so they must fit in LUAI_BITSINT-1 bits (-1 for sign)
*/
#if SIZE_Bx < LUAI_BITSINT-1
#define MAXARG_Bx ((1<<SIZE_Bx)-1)
#define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */
#else
#define MAXARG_Bx MAX_INT
#define MAXARG_sBx MAX_INT
#endif
#define MAXARG_A ((1<<SIZE_A)-1)
#define MAXARG_B ((1<<SIZE_B)-1)
#define MAXARG_C ((1<<SIZE_C)-1)
/* creates a mask with `n' 1 bits at position `p' */
#define MASK1(n,p) ((~((~(Instruction)0)<<n))<<p)
/* creates a mask with `n' 0 bits at position `p' */
#define MASK0(n,p) (~MASK1(n,p))
/*
** the following macros help to manipulate instructions
*/
#define GET_OPCODE(i) (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
#define GETARG_A(i) (cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))
#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A))))
#define GETARG_B(i) (cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))
#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \
((cast(Instruction, b)<<POS_B)&MASK1(SIZE_B,POS_B))))
#define GETARG_C(i) (cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))
#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \
((cast(Instruction, b)<<POS_C)&MASK1(SIZE_C,POS_C))))
#define GETARG_Bx(i) (cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))
#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \
((cast(Instruction, b)<<POS_Bx)&MASK1(SIZE_Bx,POS_Bx))))
#define GETARG_sBx(i) (GETARG_Bx(i)-MAXARG_sBx)
#define SETARG_sBx(i,b) SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))
#define CREATE_ABC(o,a,b,c) ((cast(Instruction, o)<<POS_OP) \
| (cast(Instruction, a)<<POS_A) \
| (cast(Instruction, b)<<POS_B) \
| (cast(Instruction, c)<<POS_C))
#define CREATE_ABx(o,a,bc) ((cast(Instruction, o)<<POS_OP) \
| (cast(Instruction, a)<<POS_A) \
| (cast(Instruction, bc)<<POS_Bx))
/*
** Macros to operate RK indices
*/
/* this bit 1 means constant (0 means register) */
#define BITRK (1 << (SIZE_B - 1))
/* test whether value is a constant */
#define ISK(x) ((x) & BITRK)
/* gets the index of the constant */
#define INDEXK(r) ((int)(r) & ~BITRK)
#define MAXINDEXRK (BITRK - 1)
/* code a constant index as a RK value */
#define RKASK(x) ((x) | BITRK)
/*
** invalid register that fits in 8 bits
*/
#define NO_REG MAXARG_A
/*
** R(x) - register
** Kst(x) - constant (in constant table)
** RK(x) == if ISK(x) then Kst(INDEXK(x)) else R(x)
*/
/*
** grep "ORDER OP" if you change these enums
*/
typedef enum {
/*----------------------------------------------------------------------
name args description
------------------------------------------------------------------------*/
OP_MOVE,/* A B R(A) := R(B) */
OP_LOADK,/* A Bx R(A) := Kst(Bx) */
OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */
OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */
OP_GETUPVAL,/* A B R(A) := UpValue[B] */
OP_GETGLOBAL,/* A Bx R(A) := Gbl[Kst(Bx)] */
OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */
OP_SETGLOBAL,/* A Bx Gbl[Kst(Bx)] := R(A) */
OP_SETUPVAL,/* A B UpValue[B] := R(A) */
OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */
OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */
OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */
OP_ADD,/* A B C R(A) := RK(B) + RK(C) */
OP_SUB,/* A B C R(A) := RK(B) - RK(C) */
OP_MUL,/* A B C R(A) := RK(B) * RK(C) */
OP_DIV,/* A B C R(A) := RK(B) / RK(C) */
OP_MOD,/* A B C R(A) := RK(B) % RK(C) */
OP_POW,/* A B C R(A) := RK(B) ^ RK(C) */
OP_UNM,/* A B R(A) := -R(B) */
OP_NOT,/* A B R(A) := not R(B) */
OP_LEN,/* A B R(A) := length of R(B) */
OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */
OP_JMP,/* sBx pc+=sBx */
OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */
OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */
OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */
OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
OP_FORLOOP,/* A sBx R(A)+=R(A+2);
if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */
OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
} OpCode;
#define NUM_OPCODES (cast(int, OP_VARARG) + 1)
/*===========================================================================
Notes:
(*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1,
and can be 0: OP_CALL then sets `top' to last_result+1, so
next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'.
(*) In OP_VARARG, if (B == 0) then use actual number of varargs and
set top (like in OP_CALL with C == 0).
(*) In OP_RETURN, if (B == 0) then return up to `top'
(*) In OP_SETLIST, if (B == 0) then B = `top';
if (C == 0) then next `instruction' is real C
(*) For comparisons, A specifies what condition the test should accept
(true or false).
(*) All `skips' (pc++) assume that next instruction is a jump
===========================================================================*/
/*
** masks for instruction properties. The format is:
** bits 0-1: op mode
** bits 2-3: C arg mode
** bits 4-5: B arg mode
** bit 6: instruction set register A
** bit 7: operator is a test
*/
enum OpArgMask {
OpArgN, /* argument is not used */
OpArgU, /* argument is used */
OpArgR, /* argument is a register or a jump offset */
OpArgK /* argument is a constant or register/constant */
};
LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];
#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3))
#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
#define testAMode(m) (luaP_opmodes[m] & (1 << 6))
#define testTMode(m) (luaP_opmodes[m] & (1 << 7))
LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */
/* number of list items to accumulate before a SETLIST instruction */
#define LFIELDS_PER_FLUSH 50
#endif

View file

@ -0,0 +1,82 @@
/*
** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
#ifndef lparser_h
#define lparser_h
#include "external/lua/llimits.h"
#include "external/lua/lobject.h"
#include "external/lua/lzio.h"
/*
** Expression descriptor
*/
typedef enum {
VVOID, /* no value */
VNIL,
VTRUE,
VFALSE,
VK, /* info = index of constant in `k' */
VKNUM, /* nval = numerical value */
VLOCAL, /* info = local register */
VUPVAL, /* info = index of upvalue in `upvalues' */
VGLOBAL, /* info = index of table; aux = index of global name in `k' */
VINDEXED, /* info = table register; aux = index register (or `k') */
VJMP, /* info = instruction pc */
VRELOCABLE, /* info = instruction pc */
VNONRELOC, /* info = result register */
VCALL, /* info = instruction pc */
VVARARG /* info = instruction pc */
} expkind;
typedef struct expdesc {
expkind k;
union {
struct { int info, aux; } s;
lua_Number nval;
} u;
int t; /* patch list of `exit when true' */
int f; /* patch list of `exit when false' */
} expdesc;
typedef struct upvaldesc {
lu_byte k;
lu_byte info;
} upvaldesc;
struct BlockCnt; /* defined in lparser.c */
/* state needed to generate code for a given function */
typedef struct FuncState {
Proto *f; /* current function header */
Table *h; /* table to find (and reuse) elements in `k' */
struct FuncState *prev; /* enclosing function */
struct LexState *ls; /* lexical state */
struct lua_State *L; /* copy of the Lua state */
struct BlockCnt *bl; /* chain of current blocks */
int pc; /* next position to code (equivalent to `ncode') */
int lasttarget; /* `pc' of last `jump target' */
int jpc; /* list of pending jumps to `pc' */
int freereg; /* first free register */
int nk; /* number of elements in `k' */
int np; /* number of elements in `p' */
short nlocvars; /* number of elements in `locvars' */
lu_byte nactvar; /* number of active local variables */
upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */
unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */
} FuncState;
LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
const char *name);
#endif

View file

@ -0,0 +1,169 @@
/*
** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $
** Global State
** See Copyright Notice in lua.h
*/
#ifndef lstate_h
#define lstate_h
#include "external/lua/lua.h"
#include "external/lua/lobject.h"
#include "external/lua/ltm.h"
#include "external/lua/lzio.h"
struct lua_longjmp; /* defined in ldo.c */
/* table of globals */
#define gt(L) (&L->l_gt)
/* registry */
#define registry(L) (&G(L)->l_registry)
/* extra stack space to handle TM calls and some other extras */
#define EXTRA_STACK 5
#define BASIC_CI_SIZE 8
#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
typedef struct stringtable {
GCObject **hash;
lu_int32 nuse; /* number of elements */
int size;
} stringtable;
/*
** informations about a call
*/
typedef struct CallInfo {
StkId base; /* base for this function */
StkId func; /* function index in the stack */
StkId top; /* top for this function */
const Instruction *savedpc;
int nresults; /* expected number of results from this function */
int tailcalls; /* number of tail calls lost under this entry */
} CallInfo;
#define curr_func(L) (clvalue(L->ci->func))
#define ci_func(ci) (clvalue((ci)->func))
#define f_isLua(ci) (!ci_func(ci)->c.isC)
#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci))
/*
** `global state', shared by all threads of this state
*/
typedef struct global_State {
stringtable strt; /* hash table for strings */
lua_Alloc frealloc; /* function to reallocate memory */
void *ud; /* auxiliary data to `frealloc' */
lu_byte currentwhite;
lu_byte gcstate; /* state of garbage collector */
int sweepstrgc; /* position of sweep in `strt' */
GCObject *rootgc; /* list of all collectable objects */
GCObject **sweepgc; /* position of sweep in `rootgc' */
GCObject *gray; /* list of gray objects */
GCObject *grayagain; /* list of objects to be traversed atomically */
GCObject *weak; /* list of weak tables (to be cleared) */
GCObject *tmudata; /* last element of list of userdata to be GC */
Mbuffer buff; /* temporary buffer for string concatentation */
lu_mem GCthreshold;
lu_mem totalbytes; /* number of bytes currently allocated */
lu_mem estimate; /* an estimate of number of bytes actually in use */
lu_mem gcdept; /* how much GC is `behind schedule' */
int gcpause; /* size of pause between successive GCs */
int gcstepmul; /* GC `granularity' */
lua_CFunction panic; /* to be called in unprotected errors */
TValue l_registry;
struct lua_State *mainthread;
UpVal uvhead; /* head of double-linked list of all open upvalues */
struct Table *mt[NUM_TAGS]; /* metatables for basic types */
TString *tmname[TM_N]; /* array with tag-method names */
} global_State;
/*
** `per thread' state
*/
struct lua_State {
CommonHeader;
lu_byte status;
StkId top; /* first free slot in the stack */
StkId base; /* base of current function */
global_State *l_G;
CallInfo *ci; /* call info for current function */
const Instruction *savedpc; /* `savedpc' of current function */
StkId stack_last; /* last free slot in the stack */
StkId stack; /* stack base */
CallInfo *end_ci; /* points after end of ci array*/
CallInfo *base_ci; /* array of CallInfo's */
int stacksize;
int size_ci; /* size of array `base_ci' */
unsigned short nCcalls; /* number of nested C calls */
unsigned short baseCcalls; /* nested C calls when resuming coroutine */
lu_byte hookmask;
lu_byte allowhook;
int basehookcount;
int hookcount;
lua_Hook hook;
TValue l_gt; /* table of globals */
TValue env; /* temporary place for environments */
GCObject *openupval; /* list of open upvalues in this stack */
GCObject *gclist;
struct lua_longjmp *errorJmp; /* current error recover point */
ptrdiff_t errfunc; /* current error handling function (stack index) */
};
#define G(L) (L->l_G)
/*
** Union of all collectable objects
*/
union GCObject {
GCheader gch;
union TString ts;
union Udata u;
union Closure cl;
struct Table h;
struct Proto p;
struct UpVal uv;
struct lua_State th; /* thread */
};
/* macros to convert a GCObject into a specific value */
#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
#define gco2ts(o) (&rawgco2ts(o)->tsv)
#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
#define gco2u(o) (&rawgco2u(o)->uv)
#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
#define ngcotouv(o) \
check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
/* macro to convert any Lua object into a GCObject */
#define obj2gco(v) (cast(GCObject *, (v)))
LUAI_FUNC lua_State *luaE_newthread (lua_State *L);
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);
#endif

View file

@ -0,0 +1,31 @@
/*
** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
#ifndef lstring_h
#define lstring_h
#include "external/lua/lgc.h"
#include "external/lua/lobject.h"
#include "external/lua/lstate.h"
#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
#define sizeudata(u) (sizeof(union Udata)+(u)->len)
#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
#endif

View file

@ -0,0 +1,40 @@
/*
** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
#ifndef ltable_h
#define ltable_h
#include "lobject.h"
#define gnode(t,i) (&(t)->node[i])
#define gkey(n) (&(n)->i_key.nk)
#define gval(n) (&(n)->i_val)
#define gnext(n) ((n)->i_key.nk.next)
#define key2tval(n) (&(n)->i_key.tvk)
LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
LUAI_FUNC void luaH_free (lua_State *L, Table *t);
LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
LUAI_FUNC int luaH_getn (Table *t);
#if defined(LUA_DEBUG)
LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
LUAI_FUNC int luaH_isdummy (Node *n);
#endif
#endif

View file

@ -0,0 +1,54 @@
/*
** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
** Tag methods
** See Copyright Notice in lua.h
*/
#ifndef ltm_h
#define ltm_h
#include "external/lua/lobject.h"
/*
* WARNING: if you change the order of this enumeration,
* grep "ORDER TM"
*/
typedef enum {
TM_INDEX,
TM_NEWINDEX,
TM_GC,
TM_MODE,
TM_EQ, /* last tag method with `fast' access */
TM_ADD,
TM_SUB,
TM_MUL,
TM_DIV,
TM_MOD,
TM_POW,
TM_UNM,
TM_LEN,
TM_LT,
TM_LE,
TM_CONCAT,
TM_CALL,
TM_N /* number of elements in the enum */
} TMS;
#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
#define fasttm(l,et,e) gfasttm(G(l), et, e)
LUAI_DATA const char *const luaT_typenames[];
LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
TMS event);
LUAI_FUNC void luaT_init (lua_State *L);
#endif

View file

@ -0,0 +1,385 @@
/*
** $Id: lua.h,v 1.218.1.4 2008/01/03 15:41:15 roberto Exp $
** Lua - An Extensible Extension Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
*/
#ifndef lua_h
#define lua_h
#include "system/types.h"
#include "external/lua/luaconf.h"
#define LUA_VERSION "Lua 5.1"
#define LUA_RELEASE "Lua 5.1.3"
#define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
/* mark for precompiled code (`<esc>Lua') */
#define LUA_SIGNATURE "\033Lua"
/* option for multiple returns in `lua_pcall' and `lua_call' */
#define LUA_MULTRET (-1)
/*
** pseudo-indices
*/
#define LUA_REGISTRYINDEX (-10000)
#define LUA_ENVIRONINDEX (-10001)
#define LUA_GLOBALSINDEX (-10002)
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
/* thread status; 0 is OK */
#define LUA_YIELD 1
#define LUA_ERRRUN 2
#define LUA_ERRSYNTAX 3
#define LUA_ERRMEM 4
#define LUA_ERRERR 5
typedef struct lua_State lua_State;
typedef int (*lua_CFunction) (lua_State *L);
/*
** functions that read/write blocks when loading/dumping Lua chunks
*/
typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);
typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);
/*
** prototype for memory-allocation functions
*/
typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
/*
** basic types
*/
#define LUA_TNONE (-1)
#define LUA_TNIL 0
#define LUA_TBOOLEAN 1
#define LUA_TLIGHTUSERDATA 2
#define LUA_TNUMBER 3
#define LUA_TSTRING 4
#define LUA_TTABLE 5
#define LUA_TFUNCTION 6
#define LUA_TUSERDATA 7
#define LUA_TTHREAD 8
/* minimum Lua stack available to a C function */
#define LUA_MINSTACK 20
/*
** generic extra include file
*/
#if defined(LUA_USER_H)
#include LUA_USER_H
#endif
/* type of numbers in Lua */
typedef LUA_NUMBER lua_Number;
/* type for integer functions */
typedef LUA_INTEGER lua_Integer;
/*
** state manipulation
*/
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
LUA_API void (lua_close) (lua_State *L);
LUA_API lua_State *(lua_newthread) (lua_State *L);
LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);
/*
** basic stack manipulation
*/
LUA_API int (lua_gettop) (lua_State *L);
LUA_API void (lua_settop) (lua_State *L, int idx);
LUA_API void (lua_pushvalue) (lua_State *L, int idx);
LUA_API void (lua_remove) (lua_State *L, int idx);
LUA_API void (lua_insert) (lua_State *L, int idx);
LUA_API void (lua_replace) (lua_State *L, int idx);
LUA_API int (lua_checkstack) (lua_State *L, int sz);
LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n);
/*
** access functions (stack -> C)
*/
LUA_API int (lua_isnumber) (lua_State *L, int idx);
LUA_API int (lua_isstring) (lua_State *L, int idx);
LUA_API int (lua_iscfunction) (lua_State *L, int idx);
LUA_API int (lua_isuserdata) (lua_State *L, int idx);
LUA_API int (lua_type) (lua_State *L, int idx);
LUA_API const char *(lua_typename) (lua_State *L, int tp);
LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2);
LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2);
LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx);
LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx);
LUA_API int (lua_toboolean) (lua_State *L, int idx);
LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
LUA_API size_t (lua_objlen) (lua_State *L, int idx);
LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
LUA_API void *(lua_touserdata) (lua_State *L, int idx);
LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
LUA_API const void *(lua_topointer) (lua_State *L, int idx);
/*
** push functions (C -> stack)
*/
LUA_API void (lua_pushnil) (lua_State *L);
LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l);
LUA_API void (lua_pushstring) (lua_State *L, const char *s);
LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
va_list argp);
LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
LUA_API void (lua_pushboolean) (lua_State *L, int b);
LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
LUA_API int (lua_pushthread) (lua_State *L);
/*
** get functions (Lua -> stack)
*/
LUA_API void (lua_gettable) (lua_State *L, int idx);
LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k);
LUA_API void (lua_rawget) (lua_State *L, int idx);
LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n);
LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
LUA_API void (lua_getfenv) (lua_State *L, int idx);
/*
** set functions (stack -> Lua)
*/
LUA_API void (lua_settable) (lua_State *L, int idx);
LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
LUA_API void (lua_rawset) (lua_State *L, int idx);
LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
LUA_API int (lua_setfenv) (lua_State *L, int idx);
/*
** `load' and `call' functions (load and run Lua code)
*/
LUA_API void (lua_call) (lua_State *L, int nargs, int nresults);
LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
const char *chunkname);
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
/*
** coroutine functions
*/
LUA_API int (lua_yield) (lua_State *L, int nresults);
LUA_API int (lua_resume) (lua_State *L, int narg);
LUA_API int (lua_status) (lua_State *L);
/*
** garbage-collection function and options
*/
#define LUA_GCSTOP 0
#define LUA_GCRESTART 1
#define LUA_GCCOLLECT 2
#define LUA_GCCOUNT 3
#define LUA_GCCOUNTB 4
#define LUA_GCSTEP 5
#define LUA_GCSETPAUSE 6
#define LUA_GCSETSTEPMUL 7
LUA_API int (lua_gc) (lua_State *L, int what, int data);
/*
** miscellaneous functions
*/
LUA_API int (lua_error) (lua_State *L);
LUA_API int (lua_next) (lua_State *L, int idx);
LUA_API void (lua_concat) (lua_State *L, int n);
LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
/*
** ===============================================================
** some useful macros
** ===============================================================
*/
#define lua_pop(L,n) lua_settop(L, -(n)-1)
#define lua_newtable(L) lua_createtable(L, 0, 0)
#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
#define lua_strlen(L,i) lua_objlen(L, (i))
#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION)
#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE)
#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA)
#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL)
#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN)
#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD)
#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE)
#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0)
#define lua_pushliteral(L, s) \
lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s))
#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s))
#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
/*
** compatibility macros and functions
*/
#define lua_open() luaL_newstate()
#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)
#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0)
#define lua_Chunkreader lua_Reader
#define lua_Chunkwriter lua_Writer
/* hack */
LUA_API void lua_setlevel (lua_State *from, lua_State *to);
/*
** {======================================================================
** Debug API
** =======================================================================
*/
/*
** Event codes
*/
#define LUA_HOOKCALL 0
#define LUA_HOOKRET 1
#define LUA_HOOKLINE 2
#define LUA_HOOKCOUNT 3
#define LUA_HOOKTAILRET 4
/*
** Event masks
*/
#define LUA_MASKCALL (1 << LUA_HOOKCALL)
#define LUA_MASKRET (1 << LUA_HOOKRET)
#define LUA_MASKLINE (1 << LUA_HOOKLINE)
#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT)
typedef struct lua_Debug lua_Debug; /* activation record */
/* Functions to be called by the debuger in specific events */
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);
LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);
LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);
LUA_API lua_Hook lua_gethook (lua_State *L);
LUA_API int lua_gethookmask (lua_State *L);
LUA_API int lua_gethookcount (lua_State *L);
struct lua_Debug {
int event;
const char *name; /* (n) */
const char *namewhat; /* (n) `global', `local', `field', `method' */
const char *what; /* (S) `Lua', `C', `main', `tail' */
const char *source; /* (S) */
int currentline; /* (l) */
int nups; /* (u) number of upvalues */
int linedefined; /* (S) */
int lastlinedefined; /* (S) */
char short_src[LUA_IDSIZE]; /* (S) */
/* private part */
int i_ci; /* active function */
};
/* }====================================================================== */
/******************************************************************************
* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************/
#endif

View file

@ -0,0 +1,762 @@
/*
** $Id: luaconf.h,v 1.82.1.6 2008/01/18 17:07:48 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
#ifndef lconfig_h
#define lconfig_h
#include "system/limits.h"
#include "system/types.h"
/*
** ==================================================================
** Search for "@@" to find all configurable definitions.
** ===================================================================
*/
/*
@@ LUA_ANSI controls the use of non-ansi features.
** CHANGE it (define it) if you want Lua to avoid the use of any
** non-ansi feature or library.
*/
#if defined(__STRICT_ANSI__)
#define LUA_ANSI
#endif
#if !defined(LUA_ANSI) && defined(_WIN32)
#define LUA_WIN
#endif
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
#endif
#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_DL_DYLD /* does not need extra library */
#endif
/*
@@ LUA_USE_POSIX includes all functionallity listed as X/Open System
@* Interfaces Extension (XSI).
** CHANGE it (define it) if your system is XSI compatible.
*/
#if defined(LUA_USE_POSIX)
#define LUA_USE_MKSTEMP
#define LUA_USE_ISATTY
#define LUA_USE_POPEN
#define LUA_USE_ULONGJMP
#endif
/*
@@ LUA_PATH and LUA_CPATH are the names of the environment variables that
@* Lua check to set its paths.
@@ LUA_INIT is the name of the environment variable that Lua
@* checks for initialization code.
** CHANGE them if you want different names.
*/
#define LUA_PATH "LUA_PATH"
#define LUA_CPATH "LUA_CPATH"
#define LUA_INIT "LUA_INIT"
/*
@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for
@* Lua libraries.
@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for
@* C libraries.
** CHANGE them if your machine has a non-conventional directory
** hierarchy or if you want to install your libraries in
** non-conventional directories.
*/
#if defined(_WIN32)
/*
** In Windows, any exclamation mark ('!') in the path is replaced by the
** path of the directory of the executable file of the current process.
*/
#define LUA_LDIR "!\\lua\\"
#define LUA_CDIR "!\\"
#define LUA_PATH_DEFAULT \
".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua"
#define LUA_CPATH_DEFAULT \
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
#define LUA_ROOT "/usr/local/"
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
#define LUA_PATH_DEFAULT \
"./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
#define LUA_CPATH_DEFAULT \
"./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
#endif
/*
@@ LUA_DIRSEP is the directory separator (for submodules).
** CHANGE it if your machine does not use "/" as the directory separator
** and is not Windows. (On Windows Lua automatically uses "\".)
*/
#if defined(_WIN32)
#define LUA_DIRSEP "\\"
#else
#define LUA_DIRSEP "/"
#endif
/*
@@ LUA_PATHSEP is the character that separates templates in a path.
@@ LUA_PATH_MARK is the string that marks the substitution points in a
@* template.
@@ LUA_EXECDIR in a Windows path is replaced by the executable's
@* directory.
@@ LUA_IGMARK is a mark to ignore all before it when bulding the
@* luaopen_ function name.
** CHANGE them if for some reason your system cannot use those
** characters. (E.g., if one of those characters is a common character
** in file/directory names.) Probably you do not need to change them.
*/
#define LUA_PATHSEP ";"
#define LUA_PATH_MARK "?"
#define LUA_EXECDIR "!"
#define LUA_IGMARK "-"
/*
@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
#define LUA_INTEGER ptrdiff_t
/*
@@ LUA_API is a mark for all core API functions.
@@ LUALIB_API is a mark for all standard library functions.
** CHANGE them if you need to define those functions in some special way.
** For instance, if you want to create one Windows DLL with the core and
** the libraries, you may want to use the following definition (define
** LUA_BUILD_AS_DLL to get it).
*/
#if defined(LUA_BUILD_AS_DLL)
#if defined(LUA_CORE) || defined(LUA_LIB)
#define LUA_API __declspec(dllexport)
#else
#define LUA_API __declspec(dllimport)
#endif
#else
#define LUA_API extern
#endif
/* more often than not the libs go together with the core */
#define LUALIB_API LUA_API
/*
@@ LUAI_FUNC is a mark for all extern functions that are not to be
@* exported to outside modules.
@@ LUAI_DATA is a mark for all extern (const) variables that are not to
@* be exported to outside modules.
** CHANGE them if you need to mark them in some special way. Elf/gcc
** (versions 3.2 and later) mark them as "hidden" to optimize access
** when Lua is compiled as a shared library.
*/
#if defined(luaall_c)
#define LUAI_FUNC static
#define LUAI_DATA /* empty */
#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
defined(__ELF__)
#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
#define LUAI_DATA LUAI_FUNC
#else
#define LUAI_FUNC extern
#define LUAI_DATA extern
#endif
/*
@@ LUA_QL describes how error messages quote program elements.
** CHANGE it if you want a different appearance.
*/
#define LUA_QL(x) "'" x "'"
#define LUA_QS LUA_QL("%s")
/*
@@ LUA_IDSIZE gives the maximum size for the description of the source
@* of a function in debug information.
** CHANGE it if you want a different size.
*/
#define LUA_IDSIZE 60
/*
** {==================================================================
** Stand-alone configuration
** ===================================================================
*/
#if defined(lua_c) || defined(luaall_c)
/*
@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that
@* is, whether we're running lua interactively).
** CHANGE it if you have a better definition for non-POSIX/non-Windows
** systems.
*/
#if defined(LUA_USE_ISATTY)
#include <unistd.h>
#define lua_stdin_is_tty() isatty(0)
#elif defined(LUA_WIN)
#include <io.h>
#include <stdio.h>
#define lua_stdin_is_tty() _isatty(_fileno(stdin))
#else
#define lua_stdin_is_tty() 1 /* assume stdin is a tty */
#endif
/*
@@ LUA_PROMPT is the default prompt used by stand-alone Lua.
@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.
** CHANGE them if you want different prompts. (You can also change the
** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)
*/
#define LUA_PROMPT "> "
#define LUA_PROMPT2 ">> "
/*
@@ LUA_PROGNAME is the default name for the stand-alone Lua program.
** CHANGE it if your stand-alone interpreter has a different name and
** your system is not able to detect that name automatically.
*/
#define LUA_PROGNAME "lua"
/*
@@ LUA_MAXINPUT is the maximum length for an input line in the
@* stand-alone interpreter.
** CHANGE it if you need longer lines.
*/
#define LUA_MAXINPUT 512
/*
@@ lua_readline defines how to show a prompt and then read a line from
@* the standard input.
@@ lua_saveline defines how to "save" a read line in a "history".
@@ lua_freeline defines how to free a line read by lua_readline.
** CHANGE them if you want to improve this functionality (e.g., by using
** GNU readline and history facilities).
*/
#if defined(LUA_USE_READLINE)
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL)
#define lua_saveline(L,idx) \
if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
add_history(lua_tostring(L, idx)); /* add it to history */
#define lua_freeline(L,b) ((void)L, free(b))
#else
#define lua_readline(L,b,p) \
((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \
fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */
#define lua_saveline(L,idx) { (void)L; (void)idx; }
#define lua_freeline(L,b) { (void)L; (void)b; }
#endif
#endif
/* }================================================================== */
/*
@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles
@* as a percentage.
** CHANGE it if you want the GC to run faster or slower (higher values
** mean larger pauses which mean slower collection.) You can also change
** this value dynamically.
*/
#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */
/*
@@ LUAI_GCMUL defines the default speed of garbage collection relative to
@* memory allocation as a percentage.
** CHANGE it if you want to change the granularity of the garbage
** collection. (Higher values mean coarser collections. 0 represents
** infinity, where each step performs a full collection.) You can also
** change this value dynamically.
*/
#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */
/*
@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.
** CHANGE it (define it) if you want exact compatibility with the
** behavior of setn/getn in Lua 5.0.
*/
#undef LUA_COMPAT_GETN
/*
@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.
** CHANGE it to undefined as soon as you do not need a global 'loadlib'
** function (the function is still available as 'package.loadlib').
*/
#undef LUA_COMPAT_LOADLIB
/*
@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.
** CHANGE it to undefined as soon as your programs use only '...' to
** access vararg parameters (instead of the old 'arg' table).
*/
#define LUA_COMPAT_VARARG
/*
@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
** CHANGE it to undefined as soon as your programs use 'math.fmod' or
** the new '%' operator instead of 'math.mod'.
*/
#define LUA_COMPAT_MOD
/*
@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
@* facility.
** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
** off the advisory error when nesting [[...]].
*/
#define LUA_COMPAT_LSTR 1
/*
@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
** CHANGE it to undefined as soon as you rename 'string.gfind' to
** 'string.gmatch'.
*/
#define LUA_COMPAT_GFIND
/*
@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
@* behavior.
** CHANGE it to undefined as soon as you replace to 'luaL_register'
** your uses of 'luaL_openlib'
*/
#define LUA_COMPAT_OPENLIB
/*
@@ luai_apicheck is the assert macro used by the Lua-C API.
** CHANGE luai_apicheck if you want Lua to perform some checks in the
** parameters it gets from API calls. This may slow down the interpreter
** a bit, but may be quite useful when debugging C code that interfaces
** with Lua. A useful redefinition is to use assert.h.
*/
#if defined(LUA_USE_APICHECK)
#include <assert.h>
#define luai_apicheck(L,o) { (void)L; assert(o); }
#else
#define luai_apicheck(L,o) { (void)L; }
#endif
/*
@@ LUAI_BITSINT defines the number of bits in an int.
** CHANGE here if Lua cannot automatically detect the number of bits of
** your machine. Probably you do not need to change this.
*/
/* avoid overflows in comparison */
#if INT_MAX-20 < 32760
#define LUAI_BITSINT 16
#elif INT_MAX > 2147483640L
/* int has at least 32 bits */
#define LUAI_BITSINT 32
#else
#error "you must define LUA_BITSINT with number of bits in an integer"
#endif
/*
@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.
@@ LUAI_INT32 is an signed integer with at least 32 bits.
@@ LUAI_UMEM is an unsigned integer big enough to count the total
@* memory used by Lua.
@@ LUAI_MEM is a signed integer big enough to count the total memory
@* used by Lua.
** CHANGE here if for some weird reason the default definitions are not
** good enough for your machine. (The definitions in the 'else'
** part always works, but may waste space on machines with 64-bit
** longs.) Probably you do not need to change this.
*/
#if LUAI_BITSINT >= 32
#define LUAI_UINT32 unsigned int
#define LUAI_INT32 int
#define LUAI_MAXINT32 INT_MAX
#define LUAI_UMEM size_t
#define LUAI_MEM ptrdiff_t
#else
/* 16-bit ints */
#define LUAI_UINT32 unsigned long
#define LUAI_INT32 long
#define LUAI_MAXINT32 LONG_MAX
#define LUAI_UMEM unsigned long
#define LUAI_MEM long
#endif
/*
@@ LUAI_MAXCALLS limits the number of nested calls.
** CHANGE it if you need really deep recursive calls. This limit is
** arbitrary; its only purpose is to stop infinite recursion before
** exhausting memory.
*/
#define LUAI_MAXCALLS 20000
/*
@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function
@* can use.
** CHANGE it if you need lots of (Lua) stack space for your C
** functions. This limit is arbitrary; its only purpose is to stop C
** functions to consume unlimited stack space.
*/
#define LUAI_MCS_AUX ((int)(INT_MAX / (4*sizeof(LUA_NUMBER))))
#define LUAI_MAXCSTACK (LUAI_MCS_AUX > SHRT_MAX ? SHRT_MAX : LUAI_MCS_AUX)
/*
** {==================================================================
** CHANGE (to smaller values) the following definitions if your system
** has a small C stack. (Or you may want to change them to larger
** values if your system has a large C stack and these limits are
** too rigid for you.) Some of these constants control the size of
** stack-allocated arrays used by the compiler or the interpreter, while
** others limit the maximum number of recursive calls that the compiler
** or the interpreter can perform. Values too large may cause a C stack
** overflow for some forms of deep constructs.
** ===================================================================
*/
/*
@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and
@* syntactical nested non-terminals in a program.
*/
#define LUAI_MAXCCALLS 200
/*
@@ LUAI_MAXVARS is the maximum number of local variables per function
@* (must be smaller than 250).
*/
#define LUAI_MAXVARS 200
/*
@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function
@* (must be smaller than 250).
*/
#define LUAI_MAXUPVALUES 60
/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
*/
#define LUAL_BUFFERSIZE BUFSIZ
/* }================================================================== */
/*
** {==================================================================
@@ LUA_NUMBER is the type of numbers in Lua.
** CHANGE the following definitions only if you want to build Lua
** with a number type different from double. You may also need to
** change lua_number2int & lua_number2integer.
** ===================================================================
*/
#define LUA_NUMBER_DOUBLE
#define LUA_NUMBER double
/*
@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'
@* over a number.
*/
#define LUAI_UACNUMBER double
/*
@@ LUA_NUMBER_SCAN is the format for reading numbers.
@@ LUA_NUMBER_FMT is the format for writing numbers.
@@ lua_number2str converts a number to a string.
@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.
@@ lua_str2number converts a string to a number.
*/
#define LUA_NUMBER_SCAN "%lf"
#define LUA_NUMBER_FMT "%.14g"
#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */
#define lua_str2number(s,p) strtod((s), (p))
/*
@@ The luai_num* macros define the primitive operations over numbers.
*/
#if defined(LUA_CORE)
#include <math.h>
#define luai_numadd(a,b) ((a)+(b))
#define luai_numsub(a,b) ((a)-(b))
#define luai_nummul(a,b) ((a)*(b))
#define luai_numdiv(a,b) ((a)/(b))
#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b))
#define luai_numpow(a,b) (pow(a,b))
#define luai_numunm(a) (-(a))
#define luai_numeq(a,b) ((a)==(b))
#define luai_numlt(a,b) ((a)<(b))
#define luai_numle(a,b) ((a)<=(b))
#define luai_numisnan(a) (!luai_numeq((a), (a)))
#endif
/*
@@ lua_number2int is a macro to convert lua_Number to int.
@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.
** CHANGE them if you know a faster way to convert a lua_Number to
** int (with any rounding method and without throwing errors) in your
** system. In Pentium machines, a naive typecast from double to int
** in C is extremely slow, so any alternative is worth trying.
*/
/* On a Pentium, resort to a trick */
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
/* On a Microsoft compiler, use assembler */
#if defined(_MSC_VER)
#define lua_number2int(i,d) __asm fld d __asm fistp i
#define lua_number2integer(i,n) lua_number2int(i, n)
/* the next trick should work on any Pentium, but sometimes clashes
with a DirectX idiosyncrasy */
#else
union luai_Cast { double l_d; long l_l; };
#define lua_number2int(i,d) \
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
#define lua_number2integer(i,n) lua_number2int(i, n)
#endif
/* this option always works, but may be slow */
#else
#define lua_number2int(i,d) ((i)=(int)(d))
#define lua_number2integer(i,d) ((i)=(lua_Integer)(d))
#endif
/* }================================================================== */
/*
@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.
** CHANGE it if your system requires alignments larger than double. (For
** instance, if your system supports long doubles and they must be
** aligned in 16-byte boundaries, then you should add long double in the
** union.) Probably you do not need to change this.
*/
#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
/*
@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.
** CHANGE them if you prefer to use longjmp/setjmp even with C++
** or if want/don't to use _longjmp/_setjmp instead of regular
** longjmp/setjmp. By default, Lua handles errors with exceptions when
** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
** and with longjmp/setjmp otherwise.
*/
#if defined(__cplusplus)
/* C++ exceptions */
#define LUAI_THROW(L,c) throw(c)
#define LUAI_TRY(L,c,a) try { a } catch(...) \
{ if ((c)->status == 0) (c)->status = -1; }
#define luai_jmpbuf int /* dummy variable */
#elif defined(LUA_USE_ULONGJMP)
/* in Unix, try _longjmp/_setjmp (more efficient) */
#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
#define luai_jmpbuf jmp_buf
#else
/* default handling with long jumps */
#define LUAI_THROW(L,c) longjmp((c)->b, 1)
#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
#define luai_jmpbuf jmp_buf
#endif
/*
@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern
@* can do during pattern-matching.
** CHANGE it if you need more captures. This limit is arbitrary.
*/
#define LUA_MAXCAPTURES 32
/*
@@ lua_tmpnam is the function that the OS library uses to create a
@* temporary name.
@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.
** CHANGE them if you have an alternative to tmpnam (which is considered
** insecure) or if you want the original tmpnam anyway. By default, Lua
** uses tmpnam except when POSIX is available, where it uses mkstemp.
*/
#if defined(loslib_c) || defined(luaall_c)
#if defined(LUA_USE_MKSTEMP)
#include <unistd.h>
#define LUA_TMPNAMBUFSIZE 32
#define lua_tmpnam(b,e) { \
strcpy(b, "/tmp/lua_XXXXXX"); \
e = mkstemp(b); \
if (e != -1) close(e); \
e = (e == -1); }
#else
#define LUA_TMPNAMBUFSIZE L_tmpnam
#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); }
#endif
#endif
/*
@@ lua_popen spawns a new process connected to the current one through
@* the file streams.
** CHANGE it if you have a way to implement it in your system.
*/
#if defined(LUA_USE_POPEN)
#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
#elif defined(LUA_WIN)
#define lua_popen(L,c,m) ((void)L, _popen(c,m))
#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1))
#else
#define lua_popen(L,c,m) ((void)((void)c, m), \
luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
#define lua_pclose(L,file) ((void)((void)L, file), 0)
#endif
/*
@@ LUA_DL_* define which dynamic-library system Lua should use.
** CHANGE here if Lua has problems choosing the appropriate
** dynamic-library system for your platform (either Windows' DLL, Mac's
** dyld, or Unix's dlopen). If your system is some kind of Unix, there
** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for
** it. To use dlopen you also need to adapt the src/Makefile (probably
** adding -ldl to the linker options), so Lua does not select it
** automatically. (When you change the makefile to add -ldl, you must
** also add -DLUA_USE_DLOPEN.)
** If you do not want any kind of dynamic library, undefine all these
** options.
** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
*/
#if defined(LUA_USE_DLOPEN)
#define LUA_DL_DLOPEN
#endif
#if defined(LUA_WIN)
#define LUA_DL_DLL
#endif
/*
@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State
@* (the data goes just *before* the lua_State pointer).
** CHANGE (define) this if you really need that. This value must be
** a multiple of the maximum alignment required for your machine.
*/
#define LUAI_EXTRASPACE 0
/*
@@ luai_userstate* allow user-specific actions on threads.
** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
** extra when a thread is created/deleted/resumed/yielded.
*/
#define luai_userstateopen(L) ((void)L)
#define luai_userstateclose(L) ((void)L)
#define luai_userstatethread(L,L1) ((void)L)
#define luai_userstatefree(L) ((void)L)
#define luai_userstateresume(L,n) ((void)L)
#define luai_userstateyield(L,n) ((void)L)
/*
@@ LUA_INTFRMLEN is the length modifier for integer conversions
@* in 'string.format'.
@@ LUA_INTFRM_T is the integer type correspoding to the previous length
@* modifier.
** CHANGE them if your system supports long long or does not support long.
*/
#if defined(LUA_USELONGLONG)
#define LUA_INTFRMLEN "ll"
#define LUA_INTFRM_T long long
#else
#define LUA_INTFRMLEN "l"
#define LUA_INTFRM_T long
#endif
/* =================================================================== */
/*
** Local configuration. You can use this space to add your redefinitions
** without modifying the main part of the file.
*/
#endif

View file

@ -0,0 +1,56 @@
/*
** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
#ifndef lualib_h
#define lualib_h
#include "external/lua/lua.h"
/* Key to file-handle type */
#define LUA_FILEHANDLE "FILE*"
#define LUA_COLIBNAME "coroutine"
LUALIB_API int (luaopen_base) (lua_State *L);
#define LUA_TABLIBNAME "table"
LUALIB_API int (luaopen_table) (lua_State *L);
#define LUA_IOLIBNAME "io"
LUALIB_API int (luaopen_io) (lua_State *L);
#define LUA_OSLIBNAME "os"
LUALIB_API int (luaopen_os) (lua_State *L);
#define LUA_STRLIBNAME "string"
LUALIB_API int (luaopen_string) (lua_State *L);
#define LUA_MATHLIBNAME "math"
LUALIB_API int (luaopen_math) (lua_State *L);
#define LUA_DBLIBNAME "debug"
LUALIB_API int (luaopen_debug) (lua_State *L);
#define LUA_LOADLIBNAME "package"
LUALIB_API int (luaopen_package) (lua_State *L);
#define LUA_BITLIBNAME "bit"
LUALIB_API int luaopen_bit(lua_State *L);
/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);
#ifndef lua_assert
#define lua_assert(x) ((void)0)
#endif
#endif

View file

@ -0,0 +1,36 @@
/*
** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
#ifndef lundump_h
#define lundump_h
#include "external/lua/lobject.h"
#include "external/lua/lzio.h"
/* load one chunk; from lundump.c */
LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
/* make header; from lundump.c */
LUAI_FUNC void luaU_header (char* h);
/* dump one chunk; from ldump.c */
LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
#ifdef luac_c
/* print one chunk; from print.c */
LUAI_FUNC void luaU_print (const Proto* f, int full);
#endif
/* for header of binary files -- this is Lua 5.1 */
#define LUAC_VERSION 0x51
/* for header of binary files -- this is the official format */
#define LUAC_FORMAT 0
/* size of header of binary files */
#define LUAC_HEADERSIZE 12
#endif

View file

@ -0,0 +1,36 @@
/*
** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
#ifndef lvm_h
#define lvm_h
#include "external/lua/ldo.h"
#include "external/lua/lobject.h"
#include "external/lua/ltm.h"
#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \
(((o) = luaV_tonumber(o,n)) != NULL))
#define equalobj(L,o1,o2) \
(ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
StkId val);
LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
StkId val);
LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);
LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
#endif

View file

@ -0,0 +1,67 @@
/*
** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
** Buffered streams
** See Copyright Notice in lua.h
*/
#ifndef lzio_h
#define lzio_h
#include "external/lua/lua.h"
#include "external/lua/lmem.h"
#define EOZ (-1) /* end of stream */
typedef struct Zio ZIO;
#define char2int(c) cast(int, cast(unsigned char, (c)))
#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
typedef struct Mbuffer {
char *buffer;
size_t n;
size_t buffsize;
} Mbuffer;
#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
#define luaZ_buffer(buff) ((buff)->buffer)
#define luaZ_sizebuffer(buff) ((buff)->buffsize)
#define luaZ_bufflen(buff) ((buff)->n)
#define luaZ_resetbuffer(buff) ((buff)->n = 0)
#define luaZ_resizebuffer(L, buff, size) \
(luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
(buff)->buffsize = size)
#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
void *data);
LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
LUAI_FUNC int luaZ_lookahead (ZIO *z);
/* --------- Private Part ------------------ */
struct Zio {
size_t n; /* bytes still unread */
const char *p; /* current position in buffer */
lua_Reader reader;
void* data; /* additional data */
lua_State *L; /* Lua state (for reader) */
};
LUAI_FUNC int luaZ_fill (ZIO *z);
#endif

View file

@ -19,4 +19,14 @@ struct FrameScript_Object__ScriptIx {
int8_t* unk;
};
// struct FrameScript_Object::ScriptData
struct FrameScript_Object__ScriptData {
char* wrapper;
};
// struct FrameScript_Object::ScriptFunction {
struct FrameScript_Object__ScriptFunction {
int32_t luaRef;
};
#endif

View file

@ -74,13 +74,6 @@ enum EGxVertexBufferFormat {
GxVertexBufferFormats_Last = 14
};
struct ubyte4 {
union {
uint8_t b[4];
uint32_t u;
};
};
struct CGxVertexAttrib {
EGxVertexAttrib attrib;
uint32_t type;

View file

@ -82,7 +82,7 @@ struct CGxDevice__vtable {
void* v_fn_6_NotifyOnTextureRecreation;
// void NotifyOnDisplayChange();
void* v_fn_7_NotifyOnDisplayChange;
// public: virtual void * __thiscall CGxDevice::`scalar deleting destructor'(unsigned int)
// void `scalar deleting destructor'(unsigned int)
void* v_fn_8_scalar_deleting_destructor;
// int32_t DeviceCreate(const CGxFormat&);
void* v_fn_9_DeviceCreate;
@ -98,16 +98,24 @@ struct CGxDevice__vtable {
void* v_fn_14_DeviceSetBaseMipLevel;
// void DeviceSetGamma(CGxGammaRamp const&);
void* v_fn_15_DeviceSetGamma;
void* v_fn_16;
// void DeviceSetGamma(float);
void* v_fn_16_DeviceSetGamma;
// no base implementation
void* v_fn_17;
void* v_fn_18;
void* v_fn_19;
void* v_fn_20;
void* v_fn_21;
// void* DeviceWindow();
void* v_fn_17_DeviceWindow;
// void DeviceTakeScreenShot();
void* v_fn_18_DeviceTakeScreenShot;
// void DeviceReadScreenShot(uint32_t&, uint32_t&, const CImVector*&) */
void* v_fn_19_DeviceReadScreenShot;
// void DeviceReadPixels(CiRect&, TSGrowableArray<CImVector>&);
void* v_fn_20_DeviceReadPixels;
// void DeviceReadDepths(CiRect&, TSGrowableArray<float>&);
void* v_fn_21_DeviceReadDepths;
// void DeviceWM(EGxWM, int32_t, int32_t);
void* v_fn_22_DeviceWM;
// void DeviceSetRenderTarget(EGxBuffer, CGxTex*, uint32_t);
void* v_fn_23;
// void DeviceCopyTex(CGxTex*, uint32_t, CGxTex*, uint32_t);
void* v_fn_24;
void* v_fn_25;
void* v_fn_26;
@ -180,7 +188,7 @@ struct CGxDevice__vtable {
void* v_fn_69;
// void ShaderConstantsSet(EGxShTarget, uint32_t, const float*, uint32_t);
void* v_fn_70_ShaderConstantsSet;
void* v_fn_71;
void* v_fn_71_IShaderDestroy;
// void IShaderCreate(CGxShader*);
void* v_fn_72_IShaderCreate;
// void CursorSetVisible(int32_t);
@ -189,15 +197,22 @@ struct CGxDevice__vtable {
void* v_fn_74_CursorLock;
// void CursorUnlock(uint32_t, uint32_t);
void* v_fn_75_CursorUnlock;
void* v_fn_76;
void* v_fn_77;
void* v_fn_78;
void* v_fn_79;
// void StereoSetConvergence(float);
void* v_fn_76_StereoSetConvergence;
// double StereoGetConvergence();
void* v_fn_77_StereoGetConvergence;
// void StereoSetSeparation(float);
void* v_fn_78_StereoSetSeparation;
// double StereoGetSeparation();
void* v_fn_79_StereoGetSeparation;
// bool StereoEnabled();
void* v_fn_80_StereoEnabled;
void* v_fn_81;
void* v_fn_82;
void* v_fn_83;
// void DebugGroupBegin(const char*, char*);
void* v_fn_81_DebugGroupBegin;
// void DebugGroupEnd();
void* v_fn_82_DebugGroupEnd;
// void DebugEvent(const char*, char*);
void* v_fn_83_DebugEvent;
};
// this class is at least 14688 bytes in size
@ -220,11 +235,9 @@ struct CGxDevice {
uint32_t m_primMask;
CRect m_defWindowRect; // 0x164 (size: 0x10)
CRect m_curWindowRect; // 0x174 (size: 0x10)
// uint32_t m_unk184[12] {
TSGrowableArray_DEVICERESTOREDCALLBACK m_deviceRestoredCallbacks;
TSGrowableArray_DEVICERESTOREDCALLBACK m_deviceRestoredCallbacks; // 0x184
TSGrowableArray_TEXTURERECREATIONCALLBACK m_textureRecreationCallbacks;
TSGrowableArray_DISPLAYCHANGECALLBACK m_displayChangeCallbacks;
// };
EGxApi m_api; // 0x1b4
uint32_t m_cpuFeatures;
CGxFormat m_format;

View file

@ -2,6 +2,12 @@
#define GX_TEXTURE_H
#include "tempest/rect.h"
#include "common/handle.h"
#include "storm/array.h"
typedef HOBJECT HTEXTURE;
STORM_TS_GROWABLE_ARRAY(HTEXTURE);
typedef struct CGxTexFlags CGxTexFlags;
typedef struct CGxTex CGxTex;
@ -14,7 +20,7 @@ struct CGxTexFlags {
// unsigned __int32 m_generateMipMaps : 1;
// unsigned __int32 m_renderTarget : 1;
// unsigned __int32 m_maxAnisotropy : 5;
uint32_t m_flags;
uint32_t f_flags;
};
struct CGxTex {

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,455 @@
#ifndef M2_DATA_H
#define M2_DATA_H
#include "system/types.h"
#include "gx/buffer.h"
#include "tempest/vector.h"
#include "tempest/box.h"
#include "tempest/quaternion.h"
DECLARE_STRUCT(M2SequenceTimes);
DECLARE_STRUCT(M2TrackBase);
DECLARE_STRUCT(M2Attachment);
DECLARE_STRUCT(M2Batch);
DECLARE_STRUCT(M2Bounds);
DECLARE_STRUCT(M2Camera);
DECLARE_STRUCT(M2Color);
DECLARE_STRUCT(M2CompQuat);
DECLARE_STRUCT(M2CompBone__CompressData);
DECLARE_STRUCT(M2CompBone);
DECLARE_STRUCT(M2Event);
DECLARE_STRUCT(M2Light);
DECLARE_STRUCT(M2Loop);
DECLARE_STRUCT(M2Material);
DECLARE_STRUCT(M2Particle);
DECLARE_STRUCT(M2Ribbon);
DECLARE_STRUCT(M2Sequence);
DECLARE_STRUCT(M2SkinSection);
DECLARE_STRUCT(M2Texture);
DECLARE_STRUCT(M2TextureTransform);
DECLARE_STRUCT(M2TextureWeight);
DECLARE_STRUCT(M2Vertex);
DECLARE_STRUCT(M2Data);
DECLARE_STRUCT(M2SkinProfile);
// from whoa: src/model/M2Data.hpp
/*
M2Array has been modified from the implementation present in 12340. The
implementation present in 12340 looks like this:
template<class T>
struct M2Array {
uint32_t count;
union {
T* data;
uint32_t offset;
}
};
On a 32-bit system, sizeof(M2Array) == 8 bytes in memory: 4 bytes for the
count, and 4 bytes for the union. This lines up with M2Array in the .m2
files: each M2Array is 8 bytes.
In 12340 (and until 64-bit support was introduced), the M2Init functions
simply adjust the M2Array when loading:
m2Data->someM2Array.offset =
(uint32_t)m2Data + m2Data->someM2Array.offset;
This ensures T* data points to the appropriate (absolute) location in
memory.
Unfortunately, this approach fails on 64-bit systems. On a 64-bit system,
M2Array would occupy 12 bytes in memory: 4 bytes for the count, and 8 bytes
for the union. This would make the approach outlined above fail.
As a result, on 64-bit systems, a different approach is used: M2Arrays are
assumed (reasonably so) to only exist within the same structure that their
on-disk offsets reference. Thus, M2Init adjusts the M2Array when loading:
uintptr_t absoluteOffset =
(uintptr_t)m2Data + m2Data->someM2Array.offset;
uintptr_t relativeOffset =
absoluteOffset - (uintptr_t)&m2Data->someM2Array;
m2Data->someM2Array.offset =
(uint32_t)relativeOffset;
By storing the relative offset, access to the data is possible by adding
the relative offset to the address of the M2Array:
uintptr_t absoluteOffset =
(uintptr_t)m2Data->someM2Array + m2Data->someM2Array.offset;
T* data = (T*)absoluteOffset;
*/
#define M2_ARRAY(T) typedef struct M2Array_##T M2Array_##T; \
struct M2Array_##T { \
uint32_t count; \
union { \
T* data; \
uint32_t offset; \
} data_or_offset; \
};
// declare basic types here
M2_ARRAY(ubyte4);
M2_ARRAY(uint32_t);
M2_ARRAY(C2Vector); // required by M2PartTrack
#define M2_SEQUENCE_KEYS(T) \
M2_ARRAY(T); \
typedef struct M2SequenceKeys_##T M2SequenceKeys_##T; \
struct M2SequenceKeys_##T { \
M2Array_##T keys; \
};
struct M2SequenceTimes {
M2Array_uint32_t times;
};
M2_ARRAY(M2SequenceTimes);
struct M2TrackBase {
uint16_t trackType;
uint16_t loopIndex;
M2Array_M2SequenceTimes sequenceTimes;
};
// template<class T>
// class M2Track : public M2TrackBase
#define M2_TRACK(T) \
M2_SEQUENCE_KEYS(T); \
M2_ARRAY(M2SequenceKeys_##T); \
typedef struct M2Track_##T M2Track_##T; \
struct M2Track_##T { \
M2TrackBase b_base; \
M2Array_M2SequenceKeys_##T sequenceKeys; \
};
// declare basic types here
M2_TRACK(uint8_t);
M2_TRACK(uint16_t);
M2_TRACK(fixed16);
M2_TRACK(float);
M2_TRACK(C3Vector);
M2_TRACK(C4Quaternion);
struct M2Attachment {
uint32_t attachmentId;
uint16_t boneIndex;
C3Vector position;
M2Track_uint8_t visibilityTrack;
};
M2_ARRAY(M2Attachment);
struct M2Batch {
uint8_t flags;
int8_t priorityPlane;
uint16_t shader;
uint16_t skinSectionIndex;
uint16_t geosetIndex;
uint16_t colorIndex;
uint16_t materialIndex;
uint16_t materialLayer;
uint16_t textureCount;
uint16_t textureComboIndex;
uint16_t textureCoordComboIndex;
uint16_t textureWeightComboIndex;
uint16_t textureTransformComboIndex;
};
M2_ARRAY(M2Batch);
struct M2Bounds {
CAaBox extent;
float radius;
};
#define M2_SPLINE_KEY(T) \
typedef struct M2SplineKey_##T M2SplineKey_##T; \
struct M2SplineKey_##T { \
T value; \
T inTan; \
T outTan; \
};
// declare types here
M2_SPLINE_KEY(float);
M2_SPLINE_KEY(C3Vector);
M2_TRACK(M2SplineKey_float);
M2_TRACK(M2SplineKey_C3Vector);
struct M2Camera {
uint32_t cameraId;
float fieldOfView;
float farClip;
float nearClip;
M2Track_M2SplineKey_C3Vector positionTrack;
C3Vector positionPivot;
M2Track_M2SplineKey_C3Vector targetTrack;
C3Vector targetPivot;
M2Track_M2SplineKey_float rollTrack;
};
M2_ARRAY(M2Camera);
struct M2Color {
M2Track_C3Vector colorTrack;
M2Track_fixed16 alphaTrack;
};
M2_ARRAY(M2Color);
struct M2CompQuat {
uint32_t auCompQ[2];
};
M2_TRACK(M2CompQuat);
struct M2CompBone__CompressData {
uint16_t uDistToFurthDesc;
uint16_t uZRatioOfChain;
};
struct M2CompBone {
uint32_t boneId;
uint32_t flags;
uint16_t parentIndex;
uint16_t uDistToParent;
union {
M2CompBone__CompressData CompressData;
uint32_t boneNameCRC;
};
M2Track_C3Vector translationTrack;
M2Track_M2CompQuat rotationTrack;
M2Track_C3Vector scaleTrack;
C3Vector pivot;
};
M2_ARRAY(M2CompBone);
struct M2Event {
uint32_t eventId;
uint32_t data;
uint16_t boneIndex;
C3Vector position;
M2TrackBase eventTrack;
};
M2_ARRAY(M2Event);
struct M2Light {
uint16_t lightType;
uint16_t boneIndex;
C3Vector position;
M2Track_C3Vector ambientColorTrack;
M2Track_float ambientIntensityTrack;
M2Track_C3Vector diffuseColorTrack;
M2Track_float diffuseIntensityTrack;
M2Track_float attenuationStartTrack;
M2Track_float attenuationEndTrack;
M2Track_uint8_t visibilityTrack;
};
M2_ARRAY(M2Light);
struct M2Loop {
uint32_t length;
};
M2_ARRAY(M2Loop);
struct M2Material {
uint16_t flags;
uint16_t blendMode;
};
M2_ARRAY(M2Material);
#define M2_PART_TRACK(T) \
typedef struct M2PartTrack_##T M2PartTrack_##T; \
struct M2PartTrack_##T { \
M2Array_fixed16 times; \
M2Array_##T values; \
};
// declare types here
M2_PART_TRACK(fixed16);
M2_PART_TRACK(uint16_t);
M2_PART_TRACK(C2Vector);
M2_PART_TRACK(C3Vector);
struct M2Particle {
uint32_t particleId;
uint32_t flags;
C3Vector position;
uint16_t boneIndex;
uint16_t textureIndex;
M2Array_uint8_t geometryMdl;
M2Array_uint8_t recursionMdl;
uint8_t blendMode;
uint8_t emitterType;
uint16_t colorIndex;
uint16_t pad;
int16_t priorityPlane;
uint16_t rows;
uint16_t cols;
M2Track_float speedTrack;
M2Track_float variationTrack;
M2Track_float latitudeTrack;
M2Track_float longitudeTrack;
M2Track_float gravityTrack;
M2Track_float lifeTrack;
float lifeVariation;
M2Track_float emissionRateTrack;
float emissionRateVariation;
M2Track_float widthTrack;
M2Track_float lengthTrack;
M2Track_float zsourceTrack;
M2PartTrack_C3Vector colorTrack;
M2PartTrack_fixed16 alphaTrack;
M2PartTrack_C2Vector scaleTrack;
C2Vector scaleVariation;
M2PartTrack_uint16_t headCellTrack;
M2PartTrack_uint16_t tailCellTrack;
float tailLength;
float twinkleFPS;
float twinkleOnOff;
CRange twinkleScale;
float ivelScale;
float drag;
float initialSpin;
float initialSpinVariation;
float spin;
float spinVariation;
CAaBox tumble;
C3Vector windVector;
float windTime;
float followSpeed1;
float followScale1;
float followSpeed2;
float followScale2;
M2Array_C3Vector spline;
M2Track_uint8_t visibilityTrack;
};
M2_ARRAY(M2Particle);
struct M2Ribbon {
uint32_t ribbonId;
uint16_t boneIndex;
C3Vector position;
M2Track_uint16_t textureIndices;
M2Track_uint16_t materialIndices;
M2Track_C3Vector colorTrack;
M2Track_fixed16 alphaTrack;
M2Track_float heightAboveTrack;
M2Track_float heightBelowTrack;
float edgesPerSecond;
float edgeLifetime;
float gravity;
uint16_t textureRows;
uint16_t textureCols;
M2Track_uint16_t textureSlotTrack;
M2Track_uint8_t visibilityTrack;
int16_t priorityPlane;
uint16_t pad;
};
M2_ARRAY(M2Ribbon);
struct M2Sequence {
uint16_t id;
uint16_t variationIndex;
uint32_t duration;
float movespeed;
uint32_t flags;
uint32_t frequency;
CiRange replay;
uint32_t blendtime;
M2Bounds bounds;
uint16_t variationNext;
uint16_t aliasNext;
};
M2_ARRAY(M2Sequence);
struct M2SkinSection {
uint32_t skinSectionId;
uint16_t vertexStart;
uint16_t vertexCount;
uint16_t indexStart;
uint16_t indexCount;
uint16_t boneCount;
uint16_t boneComboIndex;
uint16_t boneInfluences;
uint16_t centerBoneIndex;
C3Vector centerPosition;
C3Vector sortCenterPosition;
float sortRadius;
};
M2_ARRAY(M2SkinSection);
struct M2Texture {
uint32_t textureId;
uint16_t flags;
M2Array_uint8_t filename;
};
M2_ARRAY(M2Texture);
struct M2TextureTransform {
M2Track_C3Vector translationTrack;
M2Track_M2CompQuat rotationTrack;
M2Track_C3Vector scaleTrack;
};
M2_ARRAY(M2TextureTransform);
struct M2TextureWeight {
M2Track_fixed16 weightTrack;
};
M2_ARRAY(M2TextureWeight);
struct M2Vertex {
C3Vector position;
ubyte4 weights;
ubyte4 indices;
C3Vector normal;
C2Vector texcoord[2];
};
M2_ARRAY(M2Vertex);
// .m2 files
struct M2Data {
uint32_t MD20;
uint32_t version;
M2Array_uint8_t name;
uint32_t flags;
M2Array_M2Loop loops;
M2Array_M2Sequence sequences;
M2Array_uint16_t sequenceIdxHashById;
M2Array_M2CompBone bones;
M2Array_uint16_t boneIndicesById;
M2Array_M2Vertex vertices;
uint32_t numSkinProfiles;
M2Array_M2Color colors;
M2Array_M2Texture textures;
M2Array_M2TextureWeight textureWeights;
M2Array_M2TextureTransform textureTransforms;
M2Array_uint16_t textureIndicesById;
M2Array_M2Material materials;
M2Array_uint16_t boneCombos;
M2Array_uint16_t textureCombos;
M2Array_uint16_t textureCoordCombos;
M2Array_uint16_t textureWeightCombos;
M2Array_uint16_t textureTransformCombos;
M2Bounds bounds;
M2Bounds collisionBounds;
M2Array_uint16_t collisionIndices;
M2Array_C3Vector collisionPositions;
M2Array_C3Vector collisionFaceNormals;
M2Array_M2Attachment attachments;
M2Array_uint16_t attachmentIndicesById;
M2Array_M2Event events;
M2Array_M2Light lights;
M2Array_M2Camera cameras;
M2Array_uint16_t cameraIndicesById;
M2Array_M2Ribbon ribbons;
M2Array_M2Particle particles;
M2Array_uint16_t textureCombinerCombos;
};
// .skin files
struct M2SkinProfile {
uint32_t magic;
M2Array_uint16_t vertices;
M2Array_uint16_t indices;
M2Array_ubyte4 bones;
M2Array_M2SkinSection skinSections;
M2Array_M2Batch batches;
uint32_t boneCountMax;
};
#endif

View file

@ -0,0 +1,28 @@
#ifndef M2_LIGHT_H
#define M2_LIGHT_H
DECLARE_STRUCT(CM2Light);
#include "m2/scene.h"
struct CM2Light {
CM2Scene* m_scene;
uint32_t dword4;
uint32_t m_type;
C3Vector m_pos;
float float10;
float float14;
float float18;
C3Vector m_dir;
C3Vector m_ambColor;
C3Vector m_dirColor;
C3Vector m_specColor;
float m_constantAttenuation;
float m_linearAttenuation;
float m_quadraticAttenuation;
uint32_t m_visible;
CM2Light** m_lightPrev;
CM2Light* m_lightNext;
};
#endif

View file

@ -0,0 +1,34 @@
#ifndef M2_LIGHTING_H
#define M2_LIGHTING_H
DECLARE_STRUCT(CM2Lighting);
#include "m2/scene.h"
#include "tempest/vector.h"
#include "tempest/sphere.h"
#include "tempest/plane.h"
struct CM2Lighting {
CM2Scene* m_scene;
CAaSphere sphere4;
uint32_t m_flags;
C3Vector vector18;
C3Vector vector24;
C3Vector vector30;
C3Vector vector3C;
C3Vector vector48;
C3Vector m_sunAmbient;
C3Vector m_sunDiffuse;
C3Vector m_sunSpecular;
C3Vector m_sunDir;
CM2Light* m_lights[4];
uint32_t m_lightCount;
float m_fogStart;
float m_fogEnd;
float m_fogScale;
float m_fogDensity;
C3Vector m_fogColor;
C4Plane m_liquidPlane;
};
#endif

View file

@ -0,0 +1,270 @@
#ifndef M2_MODEL_H
#define M2_MODEL_H
DECLARE_STRUCT(M2ModelAttachment);
DECLARE_STRUCT(M2ModelBoneSeq);
DECLARE_STRUCT(M2ModelBone);
DECLARE_STRUCT(M2ModelCamera);
DECLARE_STRUCT(M2ModelColor);
DECLARE_STRUCT(M2ModelLight);
DECLARE_STRUCT(M2ModelRibbon);
DECLARE_STRUCT(M2ModelTextureTransform);
DECLARE_STRUCT(M2ModelTextureWeight);
DECLARE_STRUCT(M2ModelOptGeo);
DECLARE_STRUCT(CM2ModelCall);
DECLARE_STRUCT(CM2Model);
#include "camera/camera.h"
#include "m2/data.h"
#include "m2/scene.h"
#include "m2/shared.h"
#include "m2/lighting.h"
#include "m2/ribbon.h"
#include "tempest/vector.h"
#include "tempest/quaternion.h"
#include "gx/texture.h"
// template<class T>
#define M2_MODEL_TRACK(T) \
typedef struct M2ModelTrack_##T M2ModelTrack_##T; \
struct M2ModelTrack_##T { \
uint32_t currentKey; \
M2Track_##T* sourceTrack; \
T currentValue; \
};
M2_MODEL_TRACK(uint8_t);
M2_MODEL_TRACK(float);
M2_MODEL_TRACK(C3Vector);
M2_MODEL_TRACK(C4Quaternion);
struct M2ModelAttachment {
int32_t unk;
};
struct M2ModelBoneSeq {
uint32_t uint0;
uint16_t uint4;
uint16_t uint6;
uint16_t uint8;
uint8_t uintA;
uint8_t uintB;
uint32_t uintC;
uint32_t uint10;
float float14;
float float18;
uint32_t uint1C;
uint32_t uint20;
};
struct M2ModelBone {
M2ModelTrack_C3Vector translationTrack;
M2ModelTrack_C4Quaternion rotationTrack;
M2ModelTrack_C3Vector scaleTrack;
M2ModelBoneSeq sequence;
M2ModelBoneSeq secondarySequence;
uint32_t flags;
uint32_t uint90;
uint16_t uint94;
uint32_t uint9C;
float floatA0;
float floatA4;
float floatA8;
};
struct M2ModelCamera {
M2ModelTrack_C3Vector positionTrack;
M2ModelTrack_C3Vector targetTrack;
M2ModelTrack_float rollTrack;
HCAMERA m_camera;
};
struct M2ModelColor {
M2ModelTrack_C3Vector colorTrack;
M2ModelTrack_float alphaTrack;
};
struct M2ModelLight {
M2ModelTrack_C3Vector ambientColorTrack;
M2ModelTrack_float ambientIntensityTrack;
M2ModelTrack_C3Vector diffuseColorTrack;
M2ModelTrack_float diffuseIntensityTrack;
M2ModelTrack_uint8_t visibilityTrack;
uint32_t uint64;
CM2Light light;
};
struct M2ModelRibbon {
uint32_t dword0;
uint32_t dword4;
uint32_t dword8;
uint32_t dwordC;
uint32_t dword10;
uint32_t dword14;
uint32_t dword18;
uint32_t dword1C;
uint32_t dword20;
uint32_t dword24;
uint32_t dword28;
uint32_t dword2C;
uint32_t dword30;
uint32_t dword34;
uint32_t dword38;
uint32_t dword3C;
uint32_t dword40;
uint32_t dword44;
uint32_t dword48;
uint32_t dword4C;
};
struct M2ModelTextureTransform {
int32_t unk;
};
struct M2ModelTextureWeight {
M2ModelTrack_float weightTrack;
};
struct M2ModelOptGeo {
M2Batch* batches;
uint32_t dword4;
M2SkinSection* skinSections;
uint32_t dwordC;
uint32_t dword10;
uint32_t dword14;
uint32_t dword18;
CShaderEffect** effects;
uint32_t dword20;
uint32_t dword24;
uint32_t dword28;
uint32_t dword2C;
uint32_t dword30;
uint32_t dword34;
uint32_t dword38;
uint32_t dword3C;
uint32_t dword40;
uint32_t dword44;
uint32_t dword48;
uint32_t dword4C;
};
struct CM2ModelCall {
uint32_t type;
CM2ModelCall* modelCallNext;
uint32_t time;
uint32_t args[8];
};
struct CM2Model {
uint32_t m_refCount;
uint32_t m_flags;
CM2Model** m_scenePrev;
CM2Model* m_sceneNext;
// uint32_t m_loaded : 1;
// uint32_t m_flag2 : 1;
// uint32_t m_flag4 : 1;
// uint32_t m_flag8 : 1;
// uint32_t m_flag10 : 1;
// uint32_t m_flag20 : 1;
// uint32_t m_flag40 : 1;
// uint32_t m_flag80 : 1;
// uint32_t m_flag100 : 1;
// uint32_t m_flag200 : 1;
// uint32_t m_flag400 : 1;
// uint32_t m_flag800 : 1;
// uint32_t m_flag1000 : 1;
// uint32_t m_flag2000 : 1;
// uint32_t m_flag4000 : 1;
// uint32_t m_flag8000 : 1;
// uint32_t m_flag10000 : 1;
// uint32_t m_flag20000 : 1;
// uint32_t m_flag40000 : 1;
// uint32_t m_flag80000 : 1;
// uint32_t m_flag100000 : 1;
// uint32_t m_flag200000 : 1;
// uint32_t m_flag400000 : 1;
uint32_t f_flags;
uint32_t dword14;
CM2Model** m_callbackPrev;
CM2Model* m_callbackNext;
void* m_loadedCallback;
void* m_loadedArg;
CM2Scene* m_scene;
CM2Shared* m_shared;
CM2Model* model30;
CM2ModelCall* m_modelCallList;
CM2ModelCall** m_modelCallTail;
uint32_t dword3C;
CM2Model** m_animatePrev;
CM2Model* m_animateNext;
CM2Model* m_attachParent;
void* m_attachments;
uint32_t dword50;
uint32_t dword54;
CM2Model* model58;
uint32_t dword5C;
CM2Model* model60;
uint32_t m_time;
CM2Model** m_drawPrev;
CM2Model* m_drawNext;
uint32_t* m_loops;
uint32_t uint74;
uint32_t dword78;
uint32_t dword7C;
uint32_t dword80;
uint32_t dword84;
float float88;
uint32_t uint8C;
uint32_t uint90;
M2ModelBone* m_bones;
C44Matrix* m_boneMatrices;
void* m_skinSections;
M2ModelColor* m_colors;
HTEXTURE* m_textures;
M2ModelTextureWeight* m_textureWeights;
void* m_textureTransforms;
C44Matrix* m_textureMatrices;
C44Matrix matrixB4;
C44Matrix matrixF4;
C44Matrix matrix134;
uint32_t dword174;
float m_alpha;
uint32_t dword17C;
uint32_t dword180;
uint32_t dword184;
uint32_t dword188;
uint32_t dword18C;
uint32_t dword190;
uint32_t dword194;
float float198;
float alpha19C;
C3Vector m_currentDiffuse;
C3Vector m_currentEmissive;
uint32_t dword1B8;
void* m_drawCallback;
uint32_t dword1C0;
uint32_t dword1C4;
uint32_t dword1C8;
uint32_t dword1CC;
M2ModelLight* m_lights;
CM2Lighting m_lighting;
CM2Lighting* m_currentLighting;
void* m_lightingCallback;
void* m_lightingArg;
M2ModelCamera* m_cameras;
M2ModelRibbon* m_ribbons;
CRibbonEmitter* m_ribbonEmitters;
void* m_particles;
uint32_t dword2C4;
uint32_t dword2C8;
uint32_t dword2CC;
M2ModelOptGeo* m_optGeo;
uint32_t dword2D4;
uint32_t dword2D8;
uint32_t dword2DC;
uint32_t dword2E0;
uint32_t dword2E4;
uint32_t dword2E8;
uint32_t dword2EC;
};
#endif

View file

@ -0,0 +1,115 @@
#ifndef M2_RIBBON_H
#define M2_RIBBON_H
#include "system/types.h"
#include "gx/types.h"
#include "gx/texture.h"
#include "storm/array.h"
#include "storm/array/uint32_t.h"
#include "tempest/vector.h"
DECLARE_STRUCT(CRibbonMat);
DECLARE_STRUCT(CRibbonEmitter);
struct CRibbonMat {
// int32 enableLighting : 1;
// int32 enableFog : 1;
// int32 enableDepthTest : 1;
// int32 enableDepthWrite : 1;
// int32 enableCulling : 1;
uint32_t f_flags;
EGxBlend alpha;
};
STORM_TS_GROWABLE_ARRAY(CRibbonMat);
struct CRibbonEmitter {
uint32_t m_refCount;
uint32_t dword4;
uint32_t dword8;
uint32_t dwordC;
uint32_t dword10;
uint32_t dword14;
uint32_t dword18;
uint32_t dword1C;
uint32_t dword20;
uint32_t dword24;
uint32_t dword28;
uint32_t dword2C;
uint32_t dword30;
uint32_t dword34;
uint32_t dword38;
uint32_t dword3C;
uint32_t dword40;
uint32_t dword44;
uint32_t dword48;
uint32_t dword4C;
uint32_t dword50;
uint32_t dword54;
float m_ooLifeSpan;
float m_tmpDU;
float m_tmpDV;
float m_ooTmpDU;
float m_ooTmpDV;
uint32_t dword6C;
uint32_t dword70;
uint32_t dword74;
uint32_t dword78;
uint32_t dword7C;
uint32_t dword80;
uint32_t dword84;
uint32_t dword88;
uint32_t dword8C;
uint32_t dword90;
uint32_t dword94;
uint32_t dword98;
uint32_t dword9C;
uint32_t dwordA0;
uint32_t dwordA4;
uint32_t dwordA8;
uint32_t dwordAC;
uint32_t dwordB0;
uint32_t dwordB4;
uint32_t dwordB8;
uint32_t dwordBC;
uint32_t dwordC0;
uint32_t dwordC4;
uint32_t dwordC8;
uint32_t dwordCC;
uint32_t dwordD0;
uint32_t dwordD4;
uint32_t dwordD8;
uint32_t dwordDC;
uint32_t dwordE0;
uint32_t dwordE4;
uint32_t dwordE8;
uint32_t dwordEC;
uint32_t dwordF0;
uint32_t dwordF4;
uint32_t dwordF8;
uint32_t dwordFC;
uint32_t dword100;
uint32_t dword104;
uint32_t dword108;
uint32_t dword10C;
float m_edgeLifeSpan;
TSGrowableArray_CRibbonMat m_materials;
TSGrowableArray_HTEXTURE m_textures;
TSGrowableArray_uint32_t m_replaces;
CImVector m_diffuseClr;
uint32_t dword148;
uint32_t dword14C;
uint32_t dword150;
uint32_t dword154;
uint32_t dword158;
uint32_t dword15C;
uint32_t dword160;
uint32_t dword164;
uint32_t dword168;
uint32_t dword16C;
uint32_t m_texSlot;
float m_above;
float m_below;
float m_gravity;
};
#endif

View file

@ -0,0 +1,51 @@
#ifndef M2_SCENE_H
#define M2_SCENE_H
DECLARE_STRUCT(CM2Scene);
#include "m2/cache.h"
#include "m2/types.h"
#include "m2/model.h"
#include "m2/light.h"
#include "storm/array/uint32_t.h"
#include "tempest/matrix.h"
struct CM2Scene {
uint32_t dword0;
CM2Cache* m_cache;
CM2Model* m_modelList;
uint32_t m_time;
uint32_t uint10;
uint32_t uint14;
uint32_t dword18;
uint32_t m_flags;
CM2Light* m_lightList;
uint32_t dword24;
CM2Model* m_animateList;
CM2Model* m_drawList;
uint32_t dword30;
TSGrowableArray_M2Element m_elements;
TSGrowableArray_uint32_t array44;
TSGrowableArray_uint32_t array54[3];
C44Matrix m_view;
C44Matrix m_viewInv;
uint32_t uint104;
uint32_t dword108;
uint32_t dword10C;
uint32_t dword110;
uint32_t dword114;
uint32_t dword118;
uint32_t dword11C;
uint32_t dword120;
uint32_t dword124;
uint32_t m_hitList;
uint32_t dword12C;
uint32_t dword130;
uint32_t dword134;
uint32_t dword138;
uint32_t dword13C;
uint32_t dword140;
uint32_t dword144;
};
#endif

View file

@ -0,0 +1,28 @@
#ifndef M2_SHADER_EFFECT
#define M2_SHADER_EFFECT
DECLARE_STRUCT(CShaderEffect);
DECLARE_STRUCT(CShaderEffect_LocalLights);
#include "storm/hash.h"
#include "gx/shader.h"
STORM_TS_HASH(CShaderEffect, HASHKEY_STRI);
struct CShaderEffect_LocalLights {
float float0[44];
};
// class CShaderEffect : public TSHashObject<CShaderEffect, HASHKEY_STRI>
struct CShaderEffect {
TSHashObject_CShaderEffect_HASHKEY_STRI b_base;
uint32_t dword18;
uint32_t dword1C;
uint32_t dword20;
uint32_t dword24;
uint32_t dword28;
CGxShader* vertexShaders[90];
CGxShader* pixelShaders[16];
};
#endif

View file

@ -0,0 +1,52 @@
#ifndef M2_SHARED_H
#define M2_SHARED_H
DECLARE_STRUCT(CM2Shared);
#include "tempest/box.h"
#include "async/object.h"
#include "m2/cache.h"
#include "m2/model.h"
#include "m2/shadereffect.h"
struct CM2Shared {
uint32_t m_refCount;
CM2Cache* m_cache;
uint32_t m_flags;
CAsyncObject* asyncObject;
CM2Model* m_callbackList;
CM2Model** m_callbackTail;
uint32_t dword18;
uint32_t dword1C;
uint32_t dword20;
uint32_t numLowPrioritySequences;
void* lowPrioritySequences;
uint32_t dword2C;
CM2Shared** m_freePrev;
CM2Shared* m_freeNext;
uint32_t dword38;
uint8_t m_filePath[260];
uint8_t* ext;
uint32_t dword144;
uint32_t dword148;
uint32_t dword14C;
M2Data* data;
CAaBox aaBox154;
uint32_t size;
M2SkinProfile* skinProfile;
HTEXTURE* textures;
CGxPool* m_indexPool;
CGxBuf* m_indexBuf;
CGxPool* m_vertexPool;
CGxBuf* m_vertexBuf;
CShaderEffect** m_batchShaders;
M2SkinSection* m_skinSections;
uint32_t uint190;
uint32_t uint194;
uint32_t dword198;
uint32_t dword19C;
uint32_t dword1A0;
uint32_t dword1A4;
};
#endif

View file

@ -0,0 +1,73 @@
#ifndef M2_TYPES_HPP
#define M2_TYPES_HPP
#include "m2/data.h"
#include "storm/array.h"
DECLARE_STRUCT(CM2Model);
DECLARE_STRUCT(CShaderEffect);
DECLARE_ENUM(M2BLEND);
DECLARE_ENUM(M2COMBINER);
DECLARE_ENUM(M2LIGHTTYPE);
DECLARE_ENUM(M2PASS);
DECLARE_STRUCT(M2Element);
enum M2BLEND {
M2BLEND_OPAQUE = 0x0,
M2BLEND_ALPHA_KEY = 0x1,
M2BLEND_ALPHA = 0x2,
M2BLEND_NO_ALPHA_ADD = 0x3,
M2BLEND_ADD = 0x4,
M2BLEND_MOD = 0x5,
M2BLEND_MOD_2X = 0x6,
M2BLEND_COUNT = 0x7,
};
enum M2COMBINER {
M2COMBINER_OPAQUE = 0x0,
M2COMBINER_MOD = 0x1,
M2COMBINER_DECAL = 0x2,
M2COMBINER_ADD = 0x3,
M2COMBINER_MOD2X = 0x4,
M2COMBINER_FADE = 0x5,
M2COMBINER_MOD2X_NA = 0x6,
M2COMBINER_ADD_NA = 0x7,
M2COMBINER_OP_MASK = 0x7,
M2COMBINER_ENVMAP = 0x8,
M2COMBINER_STAGE_SHIFT = 0x4,
};
enum M2LIGHTTYPE {
M2LIGHT_0 = 0,
M2LIGHT_1 = 1
};
enum M2PASS {
M2PASS_0 = 0,
M2PASS_1 = 1,
M2PASS_2 = 2,
M2PASS_COUNT = 3
};
struct M2Element {
int32_t type;
CM2Model* model;
uint32_t flags;
float alpha;
float float10;
float float14;
int32_t index;
int32_t priorityPlane;
M2Batch* batch;
M2SkinSection* skinSection;
CShaderEffect* effect;
uint32_t vertexPermute;
uint32_t pixelPermute;
uint32_t dword3C;
uint32_t dword40;
};
STORM_TS_GROWABLE_ARRAY(M2Element);
#endif

View file

@ -8,9 +8,13 @@
#include "external/d3d9/caps.h"
#include "external/d3d9/device.h"
#include "external/lua/lua.h"
#include "async/object.h"
#include "async/queue.h"
#include "camera/camera.h"
#include "common/array.h"
#include "common/handle.h"
#include "common/instance.h"
@ -42,10 +46,22 @@
#include "gx/state_bom.h"
#include "gx/string.h"
#include "gx/stringbatch.h"
#include "gx/texture.h"
#include "gx/types.h"
#include "gx/batch.h"
#include "gx/d3d9.h"
#include "m2/cache.h"
#include "m2/data.h"
#include "m2/light.h"
#include "m2/lighting.h"
#include "m2/model.h"
#include "m2/ribbon.h"
#include "m2/scene.h"
#include "m2/shadereffect.h"
#include "m2/shared.h"
#include "m2/types.h"
#include "screen/layer.h"
#include "storm/array.h"
@ -69,6 +85,7 @@
#include "texture/tga.h"
#include "ui/backdropgenerator.h"
#include "ui/framestrata.h"
#include "ui/layoutframe.h"
#include "ui/renderbatch.h"
#include "ui/scriptobject.h"

View file

@ -2,9 +2,7 @@
#define SYSTEM_DETECT_H
#if !defined(IDA) && !defined(GHIDRA) && !defined(BINANA_GENERATOR)
#error "Preprocessor mode not detected! You must define either IDA or GHIDRA or BINANA_GENERATOR"
#endif
#if defined(IDA)

View file

@ -0,0 +1,6 @@
#ifndef SYSTEM_LIMITS_H
#define SYSTEM_LIMITS_H
#define INT_MAX 2147483647
#endif

View file

@ -37,4 +37,41 @@ typedef char bool;
#endif
// stddef
#if defined(GHIDRA)
#include <stddef.h>
#else
typedef uint32_t size_t;
#endif
// stdarg
#if defined(GHIDRA)
#include <stdarg.h>
#else
typedef char* va_list;
#endif
// other types
typedef struct fixed16 fixed16;
struct fixed16 {
int16_t n;
};
struct ubyte4 {
union {
uint8_t b[4];
uint32_t u;
};
};
#endif

View file

@ -0,0 +1,30 @@
#ifndef UI_FRAME_STRATA_H
#define UI_FRAME_STRATA_H
DECLARE_STRUCT(CFrameStrataNode);
DECLARE_STRUCT(CFrameStrata);
#include "storm/array.h"
#include "storm/list.h"
#include "ui/simpleframe.h"
// class CFrameStrataNode
struct CFrameStrataNode {
TSExplicitList_CSimpleFrame pendingFrames;
TSExplicitList_CSimpleFrame frames;
CSimpleFrame* pendingFrame;
CRenderBatch batches[5];
int32_t batchDirty;
TSExplicitList_CRenderBatch renderList;
};
STORM_TS_FIXED_ARRAY_POINTER_TO(CFrameStrataNode);
struct CFrameStrata {
int32_t batchDirty;
int32_t levelsDirty;
uint32_t topLevel;
TSFixedArray_pointer_to_CFrameStrataNode levels;
};
#endif

View file

@ -78,6 +78,7 @@ struct CSimpleFrame {
uint32_t m_destroyedLink[2];
uint32_t m_strataLink[2];
};
STORM_TS_LIST(CSimpleFrame);
// struct SIMPLEFRAMENODE : TSLinkedNode<SIMPLEFRAMENODE>
struct SIMPLEFRAMENODE {

View file

@ -0,0 +1,34 @@
#ifndef UI_SIMPLE_MODEL_H
#define UI_SIMPLE_MODEL_H
#include "tempest/box.h"
#include "tempest/vector.h"
#include "framescript/object.h"
#include "m2/scene.h"
#include "m2/model.h"
#include "ui/simpleframe.h"
DECLARE_STRUCT(CSimpleModel);
// class CSimpleModel : CSimpleFrame
struct CSimpleModel {
CSimpleFrame b_base;
CM2Scene* m_scene;
CM2Model* m_model;
CCamera* m_camera;
uint32_t m_pendingCameraIndex;
uint32_t m_pendingCameraId;
CM2Light m_light;
C3Vector m_position;
float m_facing;
float m_scale;
uint32_t m_flags;
CImVector m_fogColor;
float m_fogNear;
float m_fogFar;
CAaBox m_bounds;
FrameScript_Object__ScriptIx m_onUpdateModel;
FrameScript_Object__ScriptIx m_onAnimFinished;
};
#endif

View file

@ -18,6 +18,7 @@ EventKillTimer 0047D620 f end=0047D683
EventQueuePost 0047D310 f end=0047D3AF
IEvtInputProcess 00480410 f end=004804A8
IEvtInputGetMousePosition 004800A0 f end=004800EF
IEvtInputInitialize 0047FBA0 f end=0047FBA5
IEvtInputSetConfirmCloseCallback 0047FC20 f end=0047FC36
IEvtInputSetMouseMode 0047FBB0 f end=0047FC17
IEvtInputDestroy 0047FB80 f end=0047FB92

View file

@ -0,0 +1,2 @@
CFrameStrata__BuildBatches 00494EE0 f end=00494F2E type="int32_t __thiscall func(CFrameStrata* this, int32_t a2)"
CFrameStrata__RenderBatch 00494F30 f end=00494F89 type="void __thiscall func(CFrameStrata* this)"

View file

@ -1,6 +1,8 @@
CGxDevice__RsPush 00409670 f end=004096CC type="void __thiscall func(CGxDevice* this)"
CGxDevice__Caps 00532AF0 f end=00532AF7 type="CGxCaps* __thiscall func(CGxDevice* this)" ; public: class CGxCaps const & __thiscall CGxDevice::Caps(void)const
CGxDevice__DeviceCreate_WindowProc_CGxFormat 00682CB0 f end=00682CCB type="void __thiscall func(CGxDevice* this, int32_t (*windowProc)(void*, uint32_t, uintptr_t, intptr_t), CGxFormat* format)"
CGxDevice__DeviceCreate_CGxFormat 00682CD0 f end=00682CF0 type="void __thiscall func(CGxDevice* this, CGxFormat* format)"
CGxDevice__DeviceDestroy 00682CF0 f end=00682CFB type="void __thiscall func(CGxDevice* this)"
CGxDevice__DeviceSetBaseMipLevel 00682D00 f end=00682D10 type="void __thiscall func(CGxDevice* this, uint32_t baseMipLevel)"
CGxDevice__DeviceApi 00682D20 f end=00682D27 type="EGxApi __thiscall func(CGxDevice* this)"
CGxDevice__IDevIsWindowed 00682D40 f end=00682D48 type="int32_t __thiscall func(CGxDevice* this)"
@ -25,7 +27,8 @@ CGxDevice__CursorSetVisible 00683640 f end=00683650 type="void __thiscall func(C
CGxDevice__CursorLock 00683650 f end=00683657 type="uint32_t* __thiscall func(CGxDevice* this)"
CGxDevice__CursorSetDepth 00683660 f end=00683670 type="void __thiscall func(CGxDevice* this, float depth)"
CGxDevice__DeviceSetFormat 006840F0 f end=0068416C type="int32_t __thiscall func(CGxDevice* this, CGxFormat* format)"
CGxDevice__DeviceSetGamma 00684190 f end=006841AF type="int32_t __thiscall func(CGxDevice* this, CGxGammaRamp* ramp)"
CGxDevice__DeviceSetGamma_CGxGammaRamp 00684190 f end=006841AF type="int32_t __thiscall func(CGxDevice* this, CGxGammaRamp* ramp)"
CGxDevice__DeviceSetGamma_float 00684170 f end=00684189 type="void __thiscall func(CGxDevice* this, float gamma)"
CGxDevice__DeviceSetDefWindow 00684360 f end=006843B0 type="void __thiscall func(CGxDevice* this, CRect* rect)"
CGxDevice__NotifyOnDeviceRestored 006843B0 f end=006843D9 type="void __thiscall func(CGxDevice* this)"
CGxDevice__NotifyOnTextureRecreation 006843E0 f end=00684409 type="void __thiscall func(CGxDevice* this)"

View file

@ -107,6 +107,7 @@ IEvtSchedulerInitialize 0047F2F0 f end=0047F5BA
IEvtSchedulerCreateContext 0047F5C0 f end=0047F6B9
PostMouseModeChanged 0047FAC0 f end=0047FB22
IEvtInputDestroy 0047FB80 f end=0047FB92
IEvtInputInitialize 0047FBA0 f end=0047FBA5
IEvtInputSetMouseMode 0047FBB0 f end=0047FC17
IEvtInputSetConfirmCloseCallback 0047FC20 f end=0047FC36
ConvertPosition 0047FC90 f end=0047FDD4
@ -130,6 +131,8 @@ GxBufUnlock 004829F0 f end=00482A13
GxBufStream 00482A20 f end=00482A3C
GxDraw 00482A40 f end=00482A5D
GxCapsWindowSizeInScreenCoords 00493BF0 f end=00493C09
CFrameStrata__BuildBatches 00494EE0 f end=00494F2E type="int32_t __thiscall func(CFrameStrata* this, int32_t a2)"
CFrameStrata__RenderBatch 00494F30 f end=00494F89 type="void __thiscall func(CFrameStrata* this)"
CSimpleTop__OnLayerRender 00495410 f end=0049546A
ScrnLayerSetRect 004A8500 f end=004A8522
OnPaint 004A8720 f end=004A8B58
@ -2093,6 +2096,8 @@ GxPrimVertexPtr_FFP 00682400 f end=00682781 ; this is one of the functions named
GxPrimLockVertexPtrs 006828C0 f end=006828FE
GxScenePresent 00682A00 f end=00682A33
CGxDevice__DeviceCreate_WindowProc_CGxFormat 00682CB0 f end=00682CCB type="void __thiscall func(CGxDevice* this, int32_t (*windowProc)(void*, uint32_t, uintptr_t, intptr_t), CGxFormat* format)"
CGxDevice__DeviceCreate_CGxFormat 00682CD0 f end=00682CF0 type="void __thiscall func(CGxDevice* this, CGxFormat* format)"
CGxDevice__DeviceDestroy 00682CF0 f end=00682CFB type="void __thiscall func(CGxDevice* this)"
CGxDevice__DeviceSetBaseMipLevel 00682D00 f end=00682D10 type="void __thiscall func(CGxDevice* this, uint32_t baseMipLevel)"
CGxDevice__DeviceApi 00682D20 f end=00682D27 type="EGxApi __thiscall func(CGxDevice* this)"
CGxDevice__IDevIsWindowed 00682D40 f end=00682D48 type="int32_t __thiscall func(CGxDevice* this)"
@ -2117,7 +2122,8 @@ CGxDevice__CursorSetVisible 00683640 f end=00683650 type="void __thiscall func(C
CGxDevice__CursorLock 00683650 f end=00683657 type="uint32_t* __thiscall func(CGxDevice* this)"
CGxDevice__CursorSetDepth 00683660 f end=00683670 type="void __thiscall func(CGxDevice* this, float depth)"
CGxDevice__DeviceSetFormat 006840F0 f end=0068416C type="int32_t __thiscall func(CGxDevice* this, CGxFormat* format)"
CGxDevice__DeviceSetGamma 00684190 f end=006841AF type="int32_t __thiscall func(CGxDevice* this, CGxGammaRamp* ramp)"
CGxDevice__DeviceSetGamma_float 00684170 f end=00684189 type="void __thiscall func(CGxDevice* this, float gamma)"
CGxDevice__DeviceSetGamma_CGxGammaRamp 00684190 f end=006841AF type="int32_t __thiscall func(CGxDevice* this, CGxGammaRamp* ramp)"
CGxDevice__DeviceSetDefWindow 00684360 f end=006843B0 type="void __thiscall func(CGxDevice* this, CRect* rect)"
CGxDevice__NotifyOnDeviceRestored 006843B0 f end=006843D9 type="void __thiscall func(CGxDevice* this)"
CGxDevice__NotifyOnTextureRecreation 006843E0 f end=00684409 type="void __thiscall func(CGxDevice* this)"
@ -2497,6 +2503,51 @@ CDataRecycler__GetData 0095CF40 f end=0095CFAE
CDataRecycler__PutData 0095CFB0 f end=0095D077
CDataAllocator__GetData 0095D110 f ; CDataAllocator::GetData(int, char const*, int)
CDataAllocator__PutData 0095D1B0 f ; CDataAllocator::PutData(void*, char const*, int)
CSimpleModel__destructor 0095F3A0 f end=0095F40A type="void __thiscall func(CSimpleModel* this)"
CSimpleModel__GetScriptByName 0095F420 f end=0095F480 type="FrameScript_Object__ScriptIx* __thiscall func(CSimpleModel* this, char* name, FrameScript_Object__ScriptData* data)"
CSimpleModel__ModelLoaded 0095F4D0 f end=0095F4E6 type="void __stdcall func(CM2Model* model, void* arg)"
CSimpleModel__SetCamera 0095F4F0 f end=0095F537 type="void __thiscall func(CSimpleModel* this, HCAMERA camera)"
CSimpleModel__SetCameraByID 0095F540 f end=0095F5BD type="void __thiscall func(CSimpleModel* this, uint32_t id)"
CSimpleModel__SetLight 0095F5C0 f end=0095F5DB type="void __thiscall func(CSimpleModel* this, CM2Light* light)"
CSimpleModel__SetSequence 0095F5E0 f end=0095f60A type="void __thiscall func(CSimpleModel* this, uint32_t sequence)"
CSimpleModel__SetSequenceTime 0095F610 f end=0095F641 type="int32_t __thiscall func(CSimpleModel* this, uint32_t sequence, int32_t time)"
CSimpleModel__CSimpleModel 0095F680 f end=0095F7C5 type="void __thiscall func(CSimpleModel* this)"
CSimpleModel__scalar_deleting_destructor 0095F7D0 f end=0095F7FB type="void __thiscall func(CSimpleModel* this, uint32_t __flags)"
CSimpleModel__LoadXML 0095F800 f end=0095F989 type="void __thiscall func(CSimpleModel* this, XMLNode* node, CStatus* status)"
CSimpleModel__SetModel 0095F990 f end=0095F9E8 type="void __thiscall func(CSimpleModel* this, char* sourcefile)"
CSimpleModel__SetCameraByIndex 0095F9F0 f end=0095FA94 type="void __thiscall func(CSimpleModel* this, uint32_t index)"
CSimpleModel__UpdateModel 0095FBA0 f end=0095FC21 type="void __thiscall func(CSimpleModel* this)"
CSimpleModel__RenderModel 0095FC30 f end=00960070 type="void __stdcall func(void* arg)"
CSimpleModel__LightingCallback 00960070 f end=009600D3 type="void __stdcall func(CM2Model* model, CM2Lighting* lighting, void* userArg)"
CSimpleModel__SetModel 009600E0 f end=0096018C type="void __thiscall func(CSimpleModel* this, CM2Model* model)"
CSimpleModel__OnModelLoaded 00960190 f end=00960237 type="void __thiscall func(CSimpleModel* this, CM2Model* model)"
CSimpleModel__OnLayerUpdate 00960280 f end=0096031D type="void __thiscall func(CSimpleModel* this, float elapsedSec)"
CSimpleModel__RegisterScriptMethods 009603D0 f end=009603F0 type="void __stdcall func(lua_State* L)"
CSimpleModel_SetModel 00960530 f end=009605CD type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetModel 009605D0 f end=0096061D type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_ClearModel 00960620 f end=0096065E type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetPosition 00960660 f end=009606DB type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFacing 009606E0 f end=00960758 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetScale 00960760 f end=009607D8 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetSequence 009607E0 f end=009608AF type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetSequenceTime 009608B0 f end=0096096C type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetCamera 00960970 f end=00960A0C type="int32_t __stdcall func(lua_State* L)"
CSimpleModel__CSimpleModel_SetLightHelper 00960A10 f end=00960D19 type="int32_t __stdcall func(lua_State* L, int32_t a2, CM2Light* light)"
CSimpleModel_SetLight 00960D20 f end=00960DC6 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetLight 00960DD0 f end=00960FB5 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetPosition 00960FC0 f end=0096103E type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFacing 00961040 f end=00961083 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetScale 00961090 f end=009610D3 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_AdvanceTime 009610E0 f end=00961117 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_ReplaceIconTexture 00961120 f end=0096119E type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFogColor 009611A0 f end=00961200 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFogColor 00961200 f end=009612C6 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFogNear 009612D0 f end=00961348 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFogNear 00961350 f end=00961393 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFogFar 009613A0 f end=00961418 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFogFar 00961420 f end=00961463 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_ClearFog 00961470 f end=009614A7 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetGlow 009614B0 f end=00961534 type="int32_t __stdcall func(lua_State* L)"
Script_PlaySound 009858B0 f end=0098594B
Script_PlayMusic 00985950 f end=009859AA
Script_PlaySoundFile 009859B0 f end=00985A0A

View file

@ -0,0 +1,45 @@
CSimpleModel__destructor 0095F3A0 f end=0095F40A type="void __thiscall func(CSimpleModel* this)"
CSimpleModel__GetScriptByName 0095F420 f end=0095F480 type="FrameScript_Object__ScriptIx* __thiscall func(CSimpleModel* this, char* name, FrameScript_Object__ScriptData* data)"
CSimpleModel__ModelLoaded 0095F4D0 f end=0095F4E6 type="void __stdcall func(CM2Model* model, void* arg)"
CSimpleModel__SetCamera 0095F4F0 f end=0095F537 type="void __thiscall func(CSimpleModel* this, HCAMERA camera)"
CSimpleModel__SetCameraByID 0095F540 f end=0095F5BD type="void __thiscall func(CSimpleModel* this, uint32_t id)"
CSimpleModel__SetLight 0095F5C0 f end=0095F5DB type="void __thiscall func(CSimpleModel* this, CM2Light* light)"
CSimpleModel__SetSequence 0095F5E0 f end=0095f60A type="void __thiscall func(CSimpleModel* this, uint32_t sequence)"
CSimpleModel__SetSequenceTime 0095F610 f end=0095F641 type="int32_t __thiscall func(CSimpleModel* this, uint32_t sequence, int32_t time)"
CSimpleModel__CSimpleModel 0095F680 f end=0095F7C5 type="void __thiscall func(CSimpleModel* this)"
CSimpleModel__scalar_deleting_destructor 0095F7D0 f end=0095F7FB type="void __thiscall func(CSimpleModel* this, uint32_t __flags)"
CSimpleModel__LoadXML 0095F800 f end=0095F989 type="void __thiscall func(CSimpleModel* this, XMLNode* node, CStatus* status)"
CSimpleModel__SetModel 0095F990 f end=0095F9E8 type="void __thiscall func(CSimpleModel* this, char* sourcefile)"
CSimpleModel__SetCameraByIndex 0095F9F0 f end=0095FA94 type="void __thiscall func(CSimpleModel* this, uint32_t index)"
CSimpleModel__UpdateModel 0095FBA0 f end=0095FC21 type="void __thiscall func(CSimpleModel* this)"
CSimpleModel__RenderModel 0095FC30 f end=00960070 type="void __stdcall func(void* arg)"
CSimpleModel__LightingCallback 00960070 f end=009600D3 type="void __stdcall func(CM2Model* model, CM2Lighting* lighting, void* userArg)"
CSimpleModel__SetModel 009600E0 f end=0096018C type="void __thiscall func(CSimpleModel* this, CM2Model* model)"
CSimpleModel__OnModelLoaded 00960190 f end=00960237 type="void __thiscall func(CSimpleModel* this, CM2Model* model)"
CSimpleModel__OnLayerUpdate 00960280 f end=0096031D type="void __thiscall func(CSimpleModel* this, float elapsedSec)"
CSimpleModel__RegisterScriptMethods 009603D0 f end=009603F0 type="void __stdcall func(lua_State* L)"
CSimpleModel_SetModel 00960530 f end=009605CD type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetModel 009605D0 f end=0096061D type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_ClearModel 00960620 f end=0096065E type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetPosition 00960660 f end=009606DB type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFacing 009606E0 f end=00960758 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetScale 00960760 f end=009607D8 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetSequence 009607E0 f end=009608AF type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetSequenceTime 009608B0 f end=0096096C type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetCamera 00960970 f end=00960A0C type="int32_t __stdcall func(lua_State* L)"
CSimpleModel__CSimpleModel_SetLightHelper 00960A10 f end=00960D19 type="int32_t __stdcall func(lua_State* L, int32_t a2, CM2Light* light)"
CSimpleModel_SetLight 00960D20 f end=00960DC6 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetLight 00960DD0 f end=00960FB5 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetPosition 00960FC0 f end=0096103E type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFacing 00961040 f end=00961083 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetScale 00961090 f end=009610D3 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_AdvanceTime 009610E0 f end=00961117 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_ReplaceIconTexture 00961120 f end=0096119E type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFogColor 009611A0 f end=00961200 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFogColor 00961200 f end=009612C6 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFogNear 009612D0 f end=00961348 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFogNear 00961350 f end=00961393 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetFogFar 009613A0 f end=00961418 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_GetFogFar 00961420 f end=00961463 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_ClearFog 00961470 f end=009614A7 type="int32_t __stdcall func(lua_State* L)"
CSimpleModel_SetGlow 009614B0 f end=00961534 type="int32_t __stdcall func(lua_State* L)"

View file

@ -872,6 +872,14 @@
"icount": "0x0",
"parent": "0x7fb80"
},
{
"manual": true,
"start": "0x7fba0",
"end": "0x7fba4",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x7fba0"
},
{
"manual": true,
"start": "0x7fbb0",
@ -1056,6 +1064,22 @@
"icount": "0x0",
"parent": "0x93bf0"
},
{
"manual": true,
"start": "0x94ee0",
"end": "0x94f2d",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x94ee0"
},
{
"manual": true,
"start": "0x94f30",
"end": "0x94f88",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x94f30"
},
{
"manual": true,
"start": "0x95410",
@ -16760,6 +16784,22 @@
"icount": "0x0",
"parent": "0x282cb0"
},
{
"manual": true,
"start": "0x282cd0",
"end": "0x282cef",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x282cd0"
},
{
"manual": true,
"start": "0x282cf0",
"end": "0x282cfa",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x282cf0"
},
{
"manual": true,
"start": "0x282d00",
@ -16952,6 +16992,14 @@
"icount": "0x0",
"parent": "0x2840f0"
},
{
"manual": true,
"start": "0x284170",
"end": "0x284188",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x284170"
},
{
"manual": true,
"start": "0x284190",
@ -19984,6 +20032,366 @@
"icount": "0x0",
"parent": "0x55d1b0"
},
{
"manual": true,
"start": "0x55f3a0",
"end": "0x55f409",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f3a0"
},
{
"manual": true,
"start": "0x55f420",
"end": "0x55f47f",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f420"
},
{
"manual": true,
"start": "0x55f4d0",
"end": "0x55f4e5",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f4d0"
},
{
"manual": true,
"start": "0x55f4f0",
"end": "0x55f536",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f4f0"
},
{
"manual": true,
"start": "0x55f540",
"end": "0x55f5bc",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f540"
},
{
"manual": true,
"start": "0x55f5c0",
"end": "0x55f5da",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f5c0"
},
{
"manual": true,
"start": "0x55f5e0",
"end": "0x55f609",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f5e0"
},
{
"manual": true,
"start": "0x55f610",
"end": "0x55f640",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f610"
},
{
"manual": true,
"start": "0x55f680",
"end": "0x55f7c4",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f680"
},
{
"manual": true,
"start": "0x55f7d0",
"end": "0x55f7fa",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f7d0"
},
{
"manual": true,
"start": "0x55f800",
"end": "0x55f988",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f800"
},
{
"manual": true,
"start": "0x55f990",
"end": "0x55f9e7",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f990"
},
{
"manual": true,
"start": "0x55f9f0",
"end": "0x55fa93",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55f9f0"
},
{
"manual": true,
"start": "0x55fba0",
"end": "0x55fc20",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55fba0"
},
{
"manual": true,
"start": "0x55fc30",
"end": "0x56006f",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x55fc30"
},
{
"manual": true,
"start": "0x560070",
"end": "0x5600d2",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560070"
},
{
"manual": true,
"start": "0x5600e0",
"end": "0x56018b",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5600e0"
},
{
"manual": true,
"start": "0x560190",
"end": "0x560236",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560190"
},
{
"manual": true,
"start": "0x560280",
"end": "0x56031c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560280"
},
{
"manual": true,
"start": "0x5603d0",
"end": "0x5603ef",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5603d0"
},
{
"manual": true,
"start": "0x560530",
"end": "0x5605cc",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560530"
},
{
"manual": true,
"start": "0x5605d0",
"end": "0x56061c",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5605d0"
},
{
"manual": true,
"start": "0x560620",
"end": "0x56065d",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560620"
},
{
"manual": true,
"start": "0x560660",
"end": "0x5606da",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560660"
},
{
"manual": true,
"start": "0x5606e0",
"end": "0x560757",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5606e0"
},
{
"manual": true,
"start": "0x560760",
"end": "0x5607d7",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560760"
},
{
"manual": true,
"start": "0x5607e0",
"end": "0x5608ae",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5607e0"
},
{
"manual": true,
"start": "0x5608b0",
"end": "0x56096b",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5608b0"
},
{
"manual": true,
"start": "0x560970",
"end": "0x560a0b",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560970"
},
{
"manual": true,
"start": "0x560a10",
"end": "0x560d18",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560a10"
},
{
"manual": true,
"start": "0x560d20",
"end": "0x560dc5",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560d20"
},
{
"manual": true,
"start": "0x560dd0",
"end": "0x560fb4",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560dd0"
},
{
"manual": true,
"start": "0x560fc0",
"end": "0x56103d",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x560fc0"
},
{
"manual": true,
"start": "0x561040",
"end": "0x561082",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561040"
},
{
"manual": true,
"start": "0x561090",
"end": "0x5610d2",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561090"
},
{
"manual": true,
"start": "0x5610e0",
"end": "0x561116",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5610e0"
},
{
"manual": true,
"start": "0x561120",
"end": "0x56119d",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561120"
},
{
"manual": true,
"start": "0x5611a0",
"end": "0x5611ff",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5611a0"
},
{
"manual": true,
"start": "0x561200",
"end": "0x5612c5",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561200"
},
{
"manual": true,
"start": "0x5612d0",
"end": "0x561347",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5612d0"
},
{
"manual": true,
"start": "0x561350",
"end": "0x561392",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561350"
},
{
"manual": true,
"start": "0x5613a0",
"end": "0x561417",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5613a0"
},
{
"manual": true,
"start": "0x561420",
"end": "0x561462",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561420"
},
{
"manual": true,
"start": "0x561470",
"end": "0x5614a6",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x561470"
},
{
"manual": true,
"start": "0x5614b0",
"end": "0x561533",
"module": "wow.exe",
"icount": "0x0",
"parent": "0x5614b0"
},
{
"manual": true,
"start": "0x5858b0",
@ -21984,6 +22392,12 @@
"text": "IEvtInputDestroy",
"address": "0x7fb80"
},
{
"manual": true,
"module": "wow.exe",
"text": "IEvtInputInitialize",
"address": "0x7fba0"
},
{
"manual": true,
"module": "wow.exe",
@ -22122,6 +22536,18 @@
"text": "GxCapsWindowSizeInScreenCoords",
"address": "0x93bf0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CFrameStrata__BuildBatches",
"address": "0x94ee0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CFrameStrata__RenderBatch",
"address": "0x94f30"
},
{
"manual": true,
"module": "wow.exe",
@ -33900,6 +34326,18 @@
"text": "CGxDevice__DeviceCreate_WindowProc_CGxFormat",
"address": "0x282cb0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGxDevice__DeviceCreate_CGxFormat",
"address": "0x282cd0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGxDevice__DeviceDestroy",
"address": "0x282cf0"
},
{
"manual": true,
"module": "wow.exe",
@ -34047,7 +34485,13 @@
{
"manual": true,
"module": "wow.exe",
"text": "CGxDevice__DeviceSetGamma",
"text": "CGxDevice__DeviceSetGamma_float",
"address": "0x284170"
},
{
"manual": true,
"module": "wow.exe",
"text": "CGxDevice__DeviceSetGamma_CGxGammaRamp",
"address": "0x284190"
},
{
@ -36324,6 +36768,276 @@
"text": "CDataAllocator__PutData",
"address": "0x55d1b0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__destructor",
"address": "0x55f3a0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__GetScriptByName",
"address": "0x55f420"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__ModelLoaded",
"address": "0x55f4d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetCamera",
"address": "0x55f4f0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetCameraByID",
"address": "0x55f540"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetLight",
"address": "0x55f5c0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetSequence",
"address": "0x55f5e0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetSequenceTime",
"address": "0x55f610"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__CSimpleModel",
"address": "0x55f680"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__scalar_deleting_destructor",
"address": "0x55f7d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__LoadXML",
"address": "0x55f800"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetModel",
"address": "0x55f990"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetCameraByIndex",
"address": "0x55f9f0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__UpdateModel",
"address": "0x55fba0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__RenderModel",
"address": "0x55fc30"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__LightingCallback",
"address": "0x560070"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__SetModel",
"address": "0x5600e0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__OnModelLoaded",
"address": "0x560190"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__OnLayerUpdate",
"address": "0x560280"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__RegisterScriptMethods",
"address": "0x5603d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetModel",
"address": "0x560530"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetModel",
"address": "0x5605d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_ClearModel",
"address": "0x560620"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetPosition",
"address": "0x560660"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetFacing",
"address": "0x5606e0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetScale",
"address": "0x560760"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetSequence",
"address": "0x5607e0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetSequenceTime",
"address": "0x5608b0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetCamera",
"address": "0x560970"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel__CSimpleModel_SetLightHelper",
"address": "0x560a10"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetLight",
"address": "0x560d20"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetLight",
"address": "0x560dd0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetPosition",
"address": "0x560fc0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetFacing",
"address": "0x561040"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetScale",
"address": "0x561090"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_AdvanceTime",
"address": "0x5610e0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_ReplaceIconTexture",
"address": "0x561120"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetFogColor",
"address": "0x5611a0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetFogColor",
"address": "0x561200"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetFogNear",
"address": "0x5612d0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetFogNear",
"address": "0x561350"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetFogFar",
"address": "0x5613a0"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_GetFogFar",
"address": "0x561420"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_ClearFog",
"address": "0x561470"
},
{
"manual": true,
"module": "wow.exe",
"text": "CSimpleModel_SetGlow",
"address": "0x5614b0"
},
{
"manual": true,
"module": "wow.exe",

File diff suppressed because it is too large Load diff