source: Daodan/src/Oni_Symbols.h@ 988

Last change on this file since 988 was 987, checked in by alloc, 11 years ago

Daodan: Made symbols const

File size: 14.1 KB
RevLine 
[876]1#ifndef ONI_SYMBOLS_H
[677]2#define ONI_SYMBOLS_H
[692]3#include "stdint.h"
[677]4#include <stdio.h>
5#include "Oni.h"
[692]6#include "Oni_GL.h"
[677]7#include "Oni_Character.h"
8#include "BFW_ScriptLang.h"
[688]9
[984]10#include "patches/objt.h"
[677]11
[690]12//Define variables of Oni: #define VARNAME (*((TYPE*)ADDRESS))
[677]13
[690]14// AIs are deaf (ger: "taub")
15#define ai2_deaf (*((onibool*)0x005ec0c1))
[677]16
[690]17// Option "debug" ... but what does it do?
18#define AKgDebug_DebugMaps (*((char*)0x002b2204))
[677]19
[690]20// Option "debugfiles" ... but what does it do?
21#define BFgDebugFileEnable (*((bool*)0x0055c8d0))
[677]22
[983]23// Command line instance
24#define COgCommandLine (*((void**)0x00571b74))
[986]25#define COgConsoleLines (*((void**)0x005cb468))
[983]26
[690]27// Default console text color
28#define COgDefaultTextShade (*((uint32_t*)0x00533f70))
[677]29
[690]30// Default console text shadow color
31#define COgDefaultTextShadow (*((uint32_t*)0x00533f74))
[677]32
[690]33// Console text fade timeout
34#define COgFadeTimeValue (*((uint32_t*)0x00533f68))
[677]35
[705]36// Game termination flag (ONiRunGame loops on it).
37#define ONgTerminateGame (*((UUtBool*)0x00630ffd))
[876]38
[705]39// Window manager is running (drawing and updating windows).
40#define WMgActive (*((UUtBool*)0x005e99a0))
[876]41
[705]42// Set by WinMain, used by UUrPlatform_Initialize and ONrPlatform_Initialize,
43// which copies it into ONgPlatformData.
44#define ONgInstance (*((HINSTANCE*)0x0061f9e4))
[876]45
[705]46// Keeps initial gamma ramp value (before any change).
47#define GLgInitialGammaRamp (((M3tWin32GammaRamp*)0x0055fdfc))
[677]48
[705]49// Nonzero when gamma ramp was successfully read into GLgInitialGammaRamp.
50#define GLgGammaRampValid (*((int*)0x005603fc))
[677]51
[692]52// OpenGL: list of pointers to opengl32.dll functions (and a few functions from GL extensions)
[690]53#define gl_api (*((gl_api_t**)0x00560604))
54
[692]55// OpenGL render engine descriptor (resolutions, flags, context methods)
[705]56#define gl (*((gl_engine_t**)0x00560600))
[690]57
[705]58// Initial display mode (saved by gl_library_is_loaded).
59#define GLgInitialMode (*((DEVMODE*)0x0055fd60))
60
61// False to prevent Oni from changing display settings (however Bink
62// player does not respect this setting).
[690]63#define M3gResolutionSwitch (*((char*)0x00531634))
64
65// Startup.txt file handle
66#define ONgFileStartup (*((FILE**)0x005711b8))
67
68// Current GameState
69#define ONgGameState (*((GameState**)0x005ece7c))
70
71// Current ONtPlatformData
[705]72#define ONgPlatformData (*((ONtPlatformData*)0x00631008))
[690]73
74// Load non levelX_final-files yes/no
75#define opt_ignore_private_data (*((char*)0x006370f0))
76
77// Play sound yes/no
78#define opt_sound (*((char*)0x006370fc))
79
80// Option "findsounds" ... but what does it do?
81#define SSgSearchOnDisk (*((bool*)0x005eb758))
82
[882]83// OBJgTriggerVolume_Visible - bsl var to show trigger volumes
84#define OBJgTriggerVolume_Visible (*((bool*)0x005ec6c4))
[690]85
[893]86//#define OBJgFlag_DrawFlags (*((void*)0x005ec624))
87//#define OBJgFlag_ViewPrefix (*((void*)0x005ec650))
88//#define OBJgFlag_DrawNameDistance (*((void*)0x005ec634))
[882]89
[690]90// Method signature for script (BSL) functions
[688]91typedef uint16_t ( ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
[690]92
93// Used by function definition below: OBJrObjectType_EnumerateObjects
[688]94typedef char ( ONICALL *OBJtEnumCallback_Object)(void *inObject, int inUserData);
[677]95
96
[690]97
[987]98#define DefFunc( type, name, callingconvention, args, address) typedef type ( callingconvention * _##name ) args; static const _##name name = (_##name)address
[690]99
100// Orig timing functions, replaced by DDrMachineTime_* if option "usegettickcount" is enabled
[688]101DefFunc(int64_t, UUrMachineTime_High, ONICALL, (), 0x04026480);
102DefFunc(double, UUrMachineTime_High_Frequency, ONICALL, (), 0x040264b0);
103DefFunc(int64_t, UUrMachineTime_Sixtieths, ONICALL, (), 0x040263e0);
[690]104
105// Code to initialize platform stuff (like disabling system key combination Alt+Tab)
[688]106DefFunc(void, UUrPlatform_Initialize, ONICALL, (), 0x04026010);
107DefFunc(void, UUrPlatform_Terminate, ONICALL, (), 0x04026310);
[677]108
[690]109// Oni's file access methods
[688]110DefFunc(FILE*, oni_fopen, __cdecl, (const char*, const char*), 0x0051ea9f);
111DefFunc(int, oni_fprintf, __cdecl, (FILE*, const char*, ...), 0x0051ebbf);
112DefFunc(int, oni_fflush, __cdecl, (FILE*), 0x0051eab2);
[677]113
[690]114// Oni's main method?
[688]115DefFunc(void, ONiMain, __cdecl, (int ArgCount, char *ArgList[]), 0x004d3280);
[690]116
117// Initialization code, used to hook in windowed modes
[688]118DefFunc(short, ONrPlatform_Initialize, ONICALL, (ONtPlatformData *PlatformData), 0x0050f670);
119DefFunc(LRESULT, ONrPlatform_WindowProc, CALLBACK, (HWND Window, UINT Message, WPARAM WParam, LPARAM LParam), 0x0050f7a0);
[690]120
121// Retrieves a list of resolutions, replaced by "daodan_enumerate_valid_display_modes"
[688]122DefFunc(unsigned int, gl_enumerate_valid_display_modes, ONICALL, (M3tDisplayMode modes[16]), 0x004083a0);
123DefFunc(int, gl_platform_set_pixel_format, ONICALL, (HDC hdc), 0x00407b50);
[691]124
[705]125// Original graphics initialization/cleanup functions patched to use
126// DD_GLrPlatform_Initialize/DD_GLrPlatform_Dispoose instead if daodangl is used.
127DefFunc(UUtBool, gl_platform_initialize, ONICALL, (void), 0x00407da0);
128DefFunc(void, gl_platform_dispose, ONICALL, (void), 0x408210);
[677]129
[692]130// Retrieve gamma value from settings
[688]131DefFunc(float, ONrPersist_GetGamma, ONICALL, (), 0x0050f450);
[692]132
133// Retrieve if the game was completed
[688]134DefFunc(uint8_t, ONrPersist_GetWonGame, ONICALL, (), 0x0050f660);
[677]135
[692]136// Print a message to the startup.txt log
[688]137DefFunc(void, UUrStartupMessage, __cdecl, (const char* fmt, ...), 0x00424860);
[692]138
139// Probably to spawn a new character
[688]140DefFunc(int16_t, ONrGameState_NewCharacter, ONICALL, (void* CHAR, void* AISA, void* flag, uint32_t* list_location), 0x004dac50);
[692]141
142// Remove character
143DefFunc(void, ONrGameState_DeleteCharacter, ONICALL, (Character *inCharacter), 0x004DC480);
144
145DefFunc(void, ONrGameState_Timer_Start, ONICALL, (char* function, int time), 0x004FD370);
[987]146DefFunc(void, ONrGameState_HandleUtilityInput, ONICALL, (const void* inInput), 0x004f6200);
147DefFunc(uint8_t, ONrDebugKey_WentDown, ONICALL, (uint32_t inKey), 0x005050d0);
[692]148
149// Get active (player?) character
[688]150DefFunc(ActiveCharacter*, ONrGetActiveCharacter, ONICALL, (void* CharacterPtr), 0x004f1180);
[692]151
152DefFunc(uint32_t, ONrCharacter_GetHealthShade, ONICALL, (uint32_t health, uint32_t maxhealth), 0x004EF450);
[688]153DefFunc(void, ONrCharacter_NewAnimationHook, ONICALL, (Character *ioCharacter, ActiveCharacter *ioActiveCharacter), 0x004E97A0);
154DefFunc(void, ONrCharacter_SetAnimationExternal, ONICALL, (Character *ioCharacter, short state, void* animation, int interpolation), 0x004EB340);
[692]155DefFunc(void, ONrCharacter_SetHitPoints, ONICALL, (Character *ioCharacter, uint32_t inHitPoints), 0x004EB220);
156DefFunc(void, ONrCharacter_SetCharacterClass, ONICALL, (Character* Char, ONCC* Class), 0x004D7C30);
157DefFunc(void, ONrCorpse_Create, ONICALL, (Character* Character), 0x004EF340);
[677]158
[692]159
160// Print message to console
[987]161DefFunc(void, COrTextArea_Print, ONICALL, (void* area, uint32_t priority, uint32_t textshade, uint32_t textshadowshade, const char* text, uint32_t unk_alwaws_0, uint32_t fadetime), 0x00431340);
[983]162DefFunc(int16_t, COrTextArea_Resize, ONICALL, (void* inTextArea, UUtRect* inBounds, int16_t inNumTextEntries), 0x00431460);
[692]163
164// Original cheat function
[688]165DefFunc(uint8_t, ONrCheater, ONICALL, (uint32_t cheat), 0x004f5c30);
[692]166
[984]167DefFunc(int16_t, ONrMechanics_Register, ONICALL, (uint32_t inObjectType, uint32_t inObjectTypeIndex, char* inGroupName,
168 uint32_t inSizeInMemory, OBJtMethods* inObjectMethods, uint32_t inFlags, void* inMechanicsMethods), 0x00507450);
169DefFunc(int16_t, OBJrTriggerVolume_IntersectsCharacter, ONICALL, (const OBJtObject* inObject, uint32_t inMask, const void* inCharacter), 0x004cc680);
170
171
[692]172// ?
[688]173DefFunc(int, AUrMessageBox, __cdecl, (int Buttons, char *Message, ...), 0x004378c0);
174DefFunc(char*, SSrMessage_Find, ONICALL, (char* message_key), 0x0047F550);
175DefFunc(void, ONiGameState_FindAutoPromptMessage, ONICALL, (char* Note, void* ptr), 0x004FDBE0);
[677]176
[692]177// Register a BSL function with a return type
[688]178DefFunc(uint16_t, SLrScript_Command_Register_ReturnType, ONICALL, (char* name, char* desc, char* argfmt, sl_type type, sl_func callback), 0x00477b20);
[692]179
180// Register a BSL function without a return value
[688]181DefFunc(uint16_t, SLrScript_Command_Register_Void, ONICALL, (char* name, char* desc, char* argfmt, sl_func callback), 0x00477b40);
[692]182
183// Register a global BSL variable
[882]184DefFunc(uint16_t, SLrGlobalVariable_Register_Bool, ONICALL, (char* name, char* desc, UUtBool* data), 0x00477f50);
[688]185DefFunc(uint16_t, SLrGlobalVariable_Register_Int32, ONICALL, (char* name, char* desc, int32_t* data), 0x00477e30);
186DefFunc(uint16_t, SLrGlobalVariable_Register_Float, ONICALL, (char* name, char* desc, float* data), 0x00477ec0);
187DefFunc(uint16_t, SLrGlobalVariable_Register_String, ONICALL, (char* name, char* desc, char* data), 0x00477fe0);
[677]188
[692]189// Print message to console ?
[688]190DefFunc(int, COrMessage_Print, ONICALL, (char* Message, char* Key, void* noidea), 0x004304B0);
[879]191DefFunc(UUtBool, COrCommand_Execute, ONICALL, (char* command), 0x004317D0);
[692]192
[688]193DefFunc(void, COrConsole_StatusLine_Display, ONICALL, (), 0x00431E70);
[692]194
195// Get pointer to specified data instance
[688]196DefFunc(int16_t, TMrInstance_GetDataPtr, ONICALL, (int tag, char* name, void* pointer), 0x004232E0);
[692]197
198// Get name of data instance pointed to
[688]199DefFunc(char*, TMrInstance_GetInstanceName, ONICALL, (void* InstancePointer), 0x00423D90);
[677]200
[692]201DefFunc(short, TMrInstance_GetDataPtr_ByNumber, ONICALL, (int tag, int number, void** out), 0x00423680);
202DefFunc(uint32_t, TMrInstance_GetTagCount, ONICALL, (int tag), 0x004236F0);
203
204// Draw text on the screen
[987]205DefFunc(int16_t, TSrContext_DrawText, ONICALL, (void* TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect), 0x0042DF00);
[688]206DefFunc(int16_t, TSrContext_New, ONICALL, (void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext), 0x0042EA30);
[983]207DefFunc(int16_t, TSrContext_SetFontSize, ONICALL, (void* ioTextContext, uint16_t inSize), 0x0042ED50);
208DefFunc(int16_t, TSrContext_SetShade, ONICALL, (void* ioTextContext, uint32_t inShade), 0x0042EE50);
[677]209
[688]210DefFunc(uint16_t, TRrAnimation_GetDuration, ONICALL, (void* Animation), 0x00428740);
211DefFunc(uint16_t, TRrAnimation_GetTo, ONICALL, (void* Animation), 0x00428730);
212DefFunc(uint16_t, TRrAnimation_GetFrom, ONICALL, (void* Animation), 0x00428720);
[677]213
[688]214DefFunc(uint16_t, iSetCharacterClass, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004D99D0);
215DefFunc(uint16_t, AI2iScript_Spawn, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004B4780);
[879]216DefFunc(void, AI2rSmite, ONICALL, (Character *inCharacter, UUtBool inSpareCharacter), 0x0048BDA0);
[688]217//NOT USED: DefFunc(void*, OBJrObjectType_GetObject_ByNumber, ONICALL, (int inObjectType, int inIndex), );
218//NOT USED: DefFunc(int, OBJiObjectGroup_GetNumObjects, ONICALL, (void *inObjectGroup), );
[677]219
[688]220DefFunc(int, OBJrObjectType_EnumerateObjects, ONICALL, (int inObjectType, OBJtEnumCallback_Object inEnumCallback, int inUserData), 0x004D0080);
[893]221//DefFunc(void, OBJrTriggerVolume_IntersectsCharacter, ONICALL, (), 0x004cc680);
[677]222
[688]223DefFunc(void, OBJrDoor_Open, ONICALL, (DoorObject *inObject, Character *inCharacter), 0x004C26C0);
224DefFunc(void, OBJrDoor_ForceOpen, ONICALL, (short id), 0x004C1EE0);
225DefFunc(short, OBJrConsole_OnActivate, ONICALL, (void *inObject, Character *inCharacter), 0x004C0880);
226DefFunc(void*, OBJrConsole_GetByID, ONICALL, (short ID), 0x004C0950);
[677]227
228
[688]229DefFunc(void, ONiDrawWeaponSight, ONICALL, (Character* Char), 0x004E1900);
230DefFunc(void, AI2rDisplayDebuggingInfo, ONICALL, (Character* Char), 0x0048C5F0);
[893]231DefFunc(uint32_t, M3rTextureMap_New, ONICALL, (short width, short height, int type, int allocated, int flags, char* name, void** output), 0x0041EB00);
[894]232DefFunc(void, M3rDraw_BigBitmap, ONICALL, (M3tTextureMap_Big* inBigBitmap, const M3tPointScreen *inDestPoint, UUtUns16 inWidth, UUtUns16 inHeight, UUtUns32 inShade, UUtUns16 inAlpha), 0x0041f6e0);
233DefFunc(void, M3rDraw_Bitmap, ONICALL, (void* inBitmap, const M3tPointScreen* inDestPoint, UUtUns16 inWidth, UUtUns16 inHeight, UUtUns32 inShade, UUtUns16 inAlpha), 0x0041f4a0);
[984]234
235DefFunc(void, M3rGeom_Line_Light, ONICALL, (const M3tPoint3D *point1, const M3tPoint3D *point2, uint32_t shade), 0x0041f440);
[893]236/*
237DefFunc(void, M3rGeom_Line_Light, ONICALL, (), 0x0041f440);
238DefFunc(void, M3rMatrixStack_Push, ONICALL, (), 0x0041baa0);
239DefFunc(void, M3rMatrixStack_Get, ONICALL, (), 0x0041bb20);
240DefFunc(void, M3rMatrixStack_Pop, ONICALL, (), 0x0041bb30);
241DefFunc(void, M3rMatrixStack_Identity, ONICALL, (), 0x0041bba0);
242DefFunc(void, M3rMatrixStack_Rotate, ONICALL, (), 0x0041bbe0);
243DefFunc(void, M3rMatrixStack_UniformScale, ONICALL, (), 0x0041bc20);
244DefFunc(void, M3rMatrixStack_Translate, ONICALL, (), 0x0041bc40);
245DefFunc(void, M3rMatrixStack_Multiply, ONICALL, (), 0x0041bc70);
246DefFunc(void, M3rGeom_State_Commit, ONICALL, (), 0x0041e870);
[693]247
[893]248DefFunc(void, MUrPoint_Distance, ONICALL, (), 0x00433270);
249*/
250
[693]251// Make a dialog element (in)visible and change its position
[705]252DefFunc(void, WMrWindow_SetVisible, ONICALL, (WMtWindow* window, int visibility), 0x00475a10);
253DefFunc(void, WMrWindow_SetLocation, ONICALL, (WMtWindow* window, int x, int y), 0x004756d0);
[693]254
[705]255// Plays movie using Bink blitting method (ie., non-OpenGL blitting).
256DefFunc(void, ONrMovie_Play, ONICALL, (const char* movie, int unknown), 0x004d5580);
257
258// Sets minimum and maximum values for a slider control.
259DefFunc(void, WMrSlider_SetRange, ONICALL, (WMtWindow* window, int min_value, int max_value), 0x00472650);
260
261// Enables or disables window.
262DefFunc(void, WMrWindow_SetEnabled, ONICALL, (WMtWindow* window, UUtBool enabled), 0x00475580);
263
264// Sets gamma to specified factor (0.0 .. 1.0).
265DefFunc(void, M3rSetGamma, ONICALL, (float factor), 0x00407a60);
266
267// Resets gl_api pointers, unloads OPENGL32.DLL.
268DefFunc(void, gl_unload_library, ONICALL, (void), 0x0040ac40);
269
270// Notifies platform-specific local input implementation about internal (ie.,
271// real) input mode change.
272DefFunc(void, LIrPlatform_Mode_Set, ONICALL, (unsigned int active_mode), 0x00402cf0);
273
274// Terminates platform-specific local-input.
275DefFunc(void, LIrPlatform_Terminate, ONICALL, (void), 0x00403620);
276
[688]277#undef DefFunc
[677]278
279#endif
Note: See TracBrowser for help on using the repository browser.