source: Daodan/src/Oni_Symbols.h@ 688

Last change on this file since 688 was 688, checked in by alloc, 12 years ago

Daodan: Changed makefile (more warnings, messages always in english, C99), cleaned up symbol Oni definitions

File size: 8.7 KB
Line 
1#ifndef ONI_SYMBOLS_H
2#define ONI_SYMBOLS_H
3#include "bool.h"
4#include <stdio.h>
5#include "Oni.h"
6#include "oni_gl.h"
7#include "Oni_Character.h"
8#include "BFW_ScriptLang.h"
9
10#define DefVar(type, name, address) static type* _##name = (type*)address
11DefVar( onibool, ai2_deaf, 0x005ec0c1 );
12
13DefVar( HINSTANCE, g_Instance, 0x0061F9E4 );
14
15DefVar( gl_api_t*, gl_api, 0x00560604 );
16DefVar( gl_engine_t*, gl_eng, 0x00560600 );
17DefVar( WORD*, gl_gamma_ramp, 0x0055fdfc );
18DefVar( int, gl_gamma_ramp_valid, 0x005603fc );
19
20DefVar( char, opt_ignore_private_data,0x006370f0 );
21DefVar( char, opt_sound, 0x006370fc );
22
23DefVar( char, AKgDebug_DebugMaps, 0x002b2204 );
24
25DefVar( bool, BFgDebugFileEnable, 0x0055c8d0 );
26
27DefVar( uint32_t, COgConsoleLines, 0x005cb468 );
28DefVar( uint32_t, COgDefaultTextShade, 0x00533f70 );
29DefVar( uint32_t, COgDefaultTextShadow, 0x00533f74 );
30DefVar( uint32_t, COgFadeTimeValue, 0x00533f68 );
31
32DefVar( FILE*, ONgFileStartup, 0x005711b8 );
33DefVar( GameState*, ONgGameState, 0x005ece7c );
34DefVar( ONtPlatformData,ONgPlatformData, 0x0053100c );
35
36DefVar( char, M3gResolutionSwitch, 0x00531634 );
37
38DefVar( bool, SSgSearchOnDisk, 0x005eb758 );
39#undef DefVar
40//Yes, I'm aware that there are a few ways this could go wrong
41//but in the interests of neatness and not having to go through and rename all the variables
42//and use annoying dereferencing, this will do.
43
44//...too bad there is no way to nest #defines...
45#define AKgDebug_DebugMaps (*_AKgDebug_DebugMaps)
46#define ai2_deaf (*_ai2_deaf)
47#define g_Instance (*_g_Instance)
48#define M3gResolutionSwitch (*_M3gResolutionSwitch)
49#define ONgGameState (*_ONgGameState)
50#define ONgPlatformData (*_ONgPlatformData)
51#define opt_ignore_private_data (*_opt_ignore_private_data)
52#define opt_sound (*_opt_sound)
53#define BFgDebugFileEnable (*_BFgDebugFileEnable)
54#define SSgSearchOnDisk (*_SSgSearchOnDisk)
55#define gl_gamma_ramp (*_gl_gamma_ramp)
56#define gl_gamma_ramp_valid (*_gl_gamma_ramp_valid)
57#define gl_api (*_gl_api)
58#define gl_eng (*_gl_eng)
59#define COgConsoleLines (*_COgConsoleLines)
60#define COgFadeTimeValue (*_COgFadeTimeValue)
61#define COgDefaultTextShade (*_COgDefaultTextShade)
62#define COgDefaultTextShadow (*_COgDefaultTextShadow)
63#define ONgFileStartup (*_ONgFileStartup)
64
65
66typedef uint16_t ( ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
67typedef char ( ONICALL *OBJtEnumCallback_Object)(void *inObject, int inUserData);
68
69
70#undef DefFunc
71#define DefFunc( type, name, callingconvention, args, address) typedef type ( callingconvention * _##name ) args; static _##name name = (_##name)address
72DefFunc(int64_t, UUrMachineTime_High, ONICALL, (), 0x04026480);
73DefFunc(double, UUrMachineTime_High_Frequency, ONICALL, (), 0x040264b0);
74DefFunc(int64_t, UUrMachineTime_Sixtieths, ONICALL, (), 0x040263e0);
75DefFunc(void, UUrPlatform_Initialize, ONICALL, (), 0x04026010);
76DefFunc(void, UUrPlatform_Terminate, ONICALL, (), 0x04026310);
77
78DefFunc(FILE*, oni_fopen, __cdecl, (const char*, const char*), 0x0051ea9f);
79DefFunc(int, oni_fprintf, __cdecl, (FILE*, const char*, ...), 0x0051ebbf);
80DefFunc(int, oni_fflush, __cdecl, (FILE*), 0x0051eab2);
81
82DefFunc(void, ONiMain, __cdecl, (int ArgCount, char *ArgList[]), 0x004d3280);
83DefFunc(short, ONrPlatform_Initialize, ONICALL, (ONtPlatformData *PlatformData), 0x0050f670);
84DefFunc(LRESULT, ONrPlatform_WindowProc, CALLBACK, (HWND Window, UINT Message, WPARAM WParam, LPARAM LParam), 0x0050f7a0);
85DefFunc(unsigned int, gl_enumerate_valid_display_modes, ONICALL, (M3tDisplayMode modes[16]), 0x004083a0);
86DefFunc(int, gl_platform_set_pixel_format, ONICALL, (HDC hdc), 0x00407b50);
87DefFunc(int, gl_platform_initialize, ONICALL, (), 0x00407da0);
88
89DefFunc(float, ONrPersist_GetGamma, ONICALL, (), 0x0050f450);
90DefFunc(uint8_t, ONrPersist_GetWonGame, ONICALL, (), 0x0050f660);
91
92DefFunc(void, UUrStartupMessage, __cdecl, (const char* fmt, ...), 0x00424860);
93DefFunc(int16_t, ONrGameState_NewCharacter, ONICALL, (void* CHAR, void* AISA, void* flag, uint32_t* list_location), 0x004dac50);
94DefFunc(ActiveCharacter*, ONrGetActiveCharacter, ONICALL, (void* CharacterPtr), 0x004f1180);
95DefFunc(void, ONrCharacter_NewAnimationHook, ONICALL, (Character *ioCharacter, ActiveCharacter *ioActiveCharacter), 0x004E97A0);
96DefFunc(void, ONrCharacter_SetAnimationExternal, ONICALL, (Character *ioCharacter, short state, void* animation, int interpolation), 0x004EB340);
97
98DefFunc(void, COrTextArea_Print, ONICALL, (uint32_t area, uint32_t priority, uint32_t textshade, uint32_t textshadowshade, const char* text, uint32_t unk_alwaws_0, uint32_t fadetime), 0x00431340);
99DefFunc(uint8_t, ONrCheater, ONICALL, (uint32_t cheat), 0x004f5c30);
100DefFunc(int, AUrMessageBox, __cdecl, (int Buttons, char *Message, ...), 0x004378c0);
101DefFunc(char*, SSrMessage_Find, ONICALL, (char* message_key), 0x0047F550);
102DefFunc(void, ONiGameState_FindAutoPromptMessage, ONICALL, (char* Note, void* ptr), 0x004FDBE0);
103
104DefFunc(uint16_t, SLrScript_Command_Register_ReturnType, ONICALL, (char* name, char* desc, char* argfmt, sl_type type, sl_func callback), 0x00477b20);
105DefFunc(uint16_t, SLrScript_Command_Register_Void, ONICALL, (char* name, char* desc, char* argfmt, sl_func callback), 0x00477b40);
106DefFunc(uint16_t, SLrGlobalVariable_Register_Int32, ONICALL, (char* name, char* desc, int32_t* data), 0x00477e30);
107DefFunc(uint16_t, SLrGlobalVariable_Register_Float, ONICALL, (char* name, char* desc, float* data), 0x00477ec0);
108DefFunc(uint16_t, SLrGlobalVariable_Register_String, ONICALL, (char* name, char* desc, char* data), 0x00477fe0);
109
110DefFunc(int, COrMessage_Print, ONICALL, (char* Message, char* Key, void* noidea), 0x004304B0);
111DefFunc(void, COrConsole_StatusLine_Display, ONICALL, (), 0x00431E70);
112DefFunc(int16_t, TMrInstance_GetDataPtr, ONICALL, (int tag, char* name, void* pointer), 0x004232E0);
113DefFunc(char*, TMrInstance_GetInstanceName, ONICALL, (void* InstancePointer), 0x00423D90);
114
115DefFunc(int16_t, TSrContext_DrawText, ONICALL, (uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect), 0x0042DF00);
116DefFunc(int16_t, TSrContext_New, ONICALL, (void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext), 0x0042EA30);
117
118DefFunc(int16_t, TSrContext_SetShade, ONICALL, (void *ioTextContext, uint32_t inShade), 0x0042EE50);
119DefFunc(void, ONrGameState_Timer_Start, ONICALL, (char* function, int time), 0x004FD370);
120DefFunc(uint16_t, TRrAnimation_GetDuration, ONICALL, (void* Animation), 0x00428740);
121DefFunc(uint16_t, TRrAnimation_GetTo, ONICALL, (void* Animation), 0x00428730);
122DefFunc(uint16_t, TRrAnimation_GetFrom, ONICALL, (void* Animation), 0x00428720);
123
124DefFunc(void, ONrCharacter_SetHitPoints, ONICALL, (Character *ioCharacter, uint32_t inHitPoints), 0x004EB220);
125DefFunc(void, ONrCorpse_Create, ONICALL, (Character* Character), 0x004EF340);
126
127DefFunc(uint16_t, iSetCharacterClass, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004D99D0);
128DefFunc(uint16_t, AI2iScript_Spawn, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004B4780);
129//NOT USED: DefFunc(void*, OBJrObjectType_GetObject_ByNumber, ONICALL, (int inObjectType, int inIndex), );
130//NOT USED: DefFunc(int, OBJiObjectGroup_GetNumObjects, ONICALL, (void *inObjectGroup), );
131
132DefFunc(void, ONrGameState_DeleteCharacter, ONICALL, (Character *inCharacter), 0x004DC480);
133
134DefFunc(int, OBJrObjectType_EnumerateObjects, ONICALL, (int inObjectType, OBJtEnumCallback_Object inEnumCallback, int inUserData), 0x004D0080);
135
136DefFunc(void, OBJrDoor_Open, ONICALL, (DoorObject *inObject, Character *inCharacter), 0x004C26C0);
137DefFunc(void, OBJrDoor_ForceOpen, ONICALL, (short id), 0x004C1EE0);
138DefFunc(short, OBJrConsole_OnActivate, ONICALL, (void *inObject, Character *inCharacter), 0x004C0880);
139DefFunc(void*, OBJrConsole_GetByID, ONICALL, (short ID), 0x004C0950);
140
141
142DefFunc(void, ONrCharacter_SetCharacterClass, ONICALL, (Character* Char, ONCC* Class), 0x004D7C30);
143DefFunc(short, TMrInstance_GetDataPtr_ByNumber, ONICALL, (int tag, int number, void** out), 0x00423680);
144DefFunc(uint32_t, TMrInstance_GetTagCount, ONICALL, (int tag), 0x004236F0);
145DefFunc(uint32_t, ONrCharacter_GetHealthShade, ONICALL, (uint32_t health, uint32_t maxhealth), 0x004EF450);
146DefFunc(void, ONiDrawWeaponSight, ONICALL, (Character* Char), 0x004E1900);
147DefFunc(void, AI2rDisplayDebuggingInfo, ONICALL, (Character* Char), 0x0048C5F0);
148DefFunc(uint32_t, M3rTextureMap_New, ONICALL, (short width, short height, int type, int allocated, int flags, char* name, void** output), 0x041EB00);
149#undef DefFunc
150
151#endif
Note: See TracBrowser for help on using the repository browser.