[677] | 1 | #ifndef ONI_SYMBOLS_H
|
---|
| 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 |
|
---|
[677] | 10 |
|
---|
[690] | 11 | //Define variables of Oni: #define VARNAME (*((TYPE*)ADDRESS))
|
---|
[677] | 12 |
|
---|
[690] | 13 | // AIs are deaf (ger: "taub")
|
---|
| 14 | #define ai2_deaf (*((onibool*)0x005ec0c1))
|
---|
[677] | 15 |
|
---|
[690] | 16 | // Option "debug" ... but what does it do?
|
---|
| 17 | #define AKgDebug_DebugMaps (*((char*)0x002b2204))
|
---|
[677] | 18 |
|
---|
[690] | 19 | // Option "debugfiles" ... but what does it do?
|
---|
| 20 | #define BFgDebugFileEnable (*((bool*)0x0055c8d0))
|
---|
[677] | 21 |
|
---|
[690] | 22 | // Parameter 1 to COrTextArea_Print. Context pointer?
|
---|
| 23 | #define COgConsoleLines (*((uint32_t*)0x005cb468))
|
---|
[677] | 24 |
|
---|
[690] | 25 | // Default console text color
|
---|
| 26 | #define COgDefaultTextShade (*((uint32_t*)0x00533f70))
|
---|
[677] | 27 |
|
---|
[690] | 28 | // Default console text shadow color
|
---|
| 29 | #define COgDefaultTextShadow (*((uint32_t*)0x00533f74))
|
---|
[677] | 30 |
|
---|
[690] | 31 | // Console text fade timeout
|
---|
| 32 | #define COgFadeTimeValue (*((uint32_t*)0x00533f68))
|
---|
[677] | 33 |
|
---|
[690] | 34 | // Some kind of graphics context?
|
---|
| 35 | #define g_Instance (*((HINSTANCE*)0x0061F9E4))
|
---|
[677] | 36 |
|
---|
[690] | 37 | // OpenGL Gamma related
|
---|
| 38 | #define gl_gamma_ramp (*((WORD**)0x0055fdfc))
|
---|
[677] | 39 |
|
---|
[690] | 40 | // OpenGL Gamma related
|
---|
| 41 | #define gl_gamma_ramp_valid (*((int*)0x005603fc))
|
---|
[677] | 42 |
|
---|
[692] | 43 | // OpenGL: list of pointers to opengl32.dll functions (and a few functions from GL extensions)
|
---|
[690] | 44 | #define gl_api (*((gl_api_t**)0x00560604))
|
---|
| 45 |
|
---|
[692] | 46 | // OpenGL render engine descriptor (resolutions, flags, context methods)
|
---|
[690] | 47 | #define gl_eng (*((gl_engine_t**)0x00560600))
|
---|
| 48 |
|
---|
| 49 | // Value of -switch/-noswitch?
|
---|
| 50 | #define M3gResolutionSwitch (*((char*)0x00531634))
|
---|
| 51 |
|
---|
| 52 | // Startup.txt file handle
|
---|
| 53 | #define ONgFileStartup (*((FILE**)0x005711b8))
|
---|
| 54 |
|
---|
| 55 | // Current GameState
|
---|
| 56 | #define ONgGameState (*((GameState**)0x005ece7c))
|
---|
| 57 |
|
---|
| 58 | // Current ONtPlatformData
|
---|
| 59 | #define ONgPlatformData (*((ONtPlatformData*)0x0053100c))
|
---|
| 60 |
|
---|
| 61 | // Load non levelX_final-files yes/no
|
---|
| 62 | #define opt_ignore_private_data (*((char*)0x006370f0))
|
---|
| 63 |
|
---|
| 64 | // Play sound yes/no
|
---|
| 65 | #define opt_sound (*((char*)0x006370fc))
|
---|
| 66 |
|
---|
| 67 | // Option "findsounds" ... but what does it do?
|
---|
| 68 | #define SSgSearchOnDisk (*((bool*)0x005eb758))
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | // Method signature for script (BSL) functions
|
---|
[688] | 72 | typedef uint16_t ( ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
|
---|
[690] | 73 |
|
---|
| 74 | // Used by function definition below: OBJrObjectType_EnumerateObjects
|
---|
[688] | 75 | typedef char ( ONICALL *OBJtEnumCallback_Object)(void *inObject, int inUserData);
|
---|
[677] | 76 |
|
---|
| 77 |
|
---|
[690] | 78 |
|
---|
[688] | 79 | #define DefFunc( type, name, callingconvention, args, address) typedef type ( callingconvention * _##name ) args; static _##name name = (_##name)address
|
---|
[690] | 80 |
|
---|
| 81 | // Orig timing functions, replaced by DDrMachineTime_* if option "usegettickcount" is enabled
|
---|
[688] | 82 | DefFunc(int64_t, UUrMachineTime_High, ONICALL, (), 0x04026480);
|
---|
| 83 | DefFunc(double, UUrMachineTime_High_Frequency, ONICALL, (), 0x040264b0);
|
---|
| 84 | DefFunc(int64_t, UUrMachineTime_Sixtieths, ONICALL, (), 0x040263e0);
|
---|
[690] | 85 |
|
---|
| 86 | // Code to initialize platform stuff (like disabling system key combination Alt+Tab)
|
---|
[688] | 87 | DefFunc(void, UUrPlatform_Initialize, ONICALL, (), 0x04026010);
|
---|
| 88 | DefFunc(void, UUrPlatform_Terminate, ONICALL, (), 0x04026310);
|
---|
[677] | 89 |
|
---|
[690] | 90 | // Oni's file access methods
|
---|
[688] | 91 | DefFunc(FILE*, oni_fopen, __cdecl, (const char*, const char*), 0x0051ea9f);
|
---|
| 92 | DefFunc(int, oni_fprintf, __cdecl, (FILE*, const char*, ...), 0x0051ebbf);
|
---|
| 93 | DefFunc(int, oni_fflush, __cdecl, (FILE*), 0x0051eab2);
|
---|
[677] | 94 |
|
---|
[690] | 95 | // Oni's main method?
|
---|
[688] | 96 | DefFunc(void, ONiMain, __cdecl, (int ArgCount, char *ArgList[]), 0x004d3280);
|
---|
[690] | 97 |
|
---|
| 98 | // Initialization code, used to hook in windowed modes
|
---|
[688] | 99 | DefFunc(short, ONrPlatform_Initialize, ONICALL, (ONtPlatformData *PlatformData), 0x0050f670);
|
---|
| 100 | DefFunc(LRESULT, ONrPlatform_WindowProc, CALLBACK, (HWND Window, UINT Message, WPARAM WParam, LPARAM LParam), 0x0050f7a0);
|
---|
[690] | 101 |
|
---|
| 102 | // Retrieves a list of resolutions, replaced by "daodan_enumerate_valid_display_modes"
|
---|
[688] | 103 | DefFunc(unsigned int, gl_enumerate_valid_display_modes, ONICALL, (M3tDisplayMode modes[16]), 0x004083a0);
|
---|
| 104 | DefFunc(int, gl_platform_set_pixel_format, ONICALL, (HDC hdc), 0x00407b50);
|
---|
[691] | 105 |
|
---|
| 106 | // Original graphics initialization method patched to use "daodangl_platform_initialize" instead if daodangl is used
|
---|
[688] | 107 | DefFunc(int, gl_platform_initialize, ONICALL, (), 0x00407da0);
|
---|
[677] | 108 |
|
---|
[692] | 109 | // Retrieve gamma value from settings
|
---|
[688] | 110 | DefFunc(float, ONrPersist_GetGamma, ONICALL, (), 0x0050f450);
|
---|
[692] | 111 |
|
---|
| 112 | // Retrieve if the game was completed
|
---|
[688] | 113 | DefFunc(uint8_t, ONrPersist_GetWonGame, ONICALL, (), 0x0050f660);
|
---|
[677] | 114 |
|
---|
[692] | 115 | // Print a message to the startup.txt log
|
---|
[688] | 116 | DefFunc(void, UUrStartupMessage, __cdecl, (const char* fmt, ...), 0x00424860);
|
---|
[692] | 117 |
|
---|
| 118 | // Probably to spawn a new character
|
---|
[688] | 119 | DefFunc(int16_t, ONrGameState_NewCharacter, ONICALL, (void* CHAR, void* AISA, void* flag, uint32_t* list_location), 0x004dac50);
|
---|
[692] | 120 |
|
---|
| 121 | // Remove character
|
---|
| 122 | DefFunc(void, ONrGameState_DeleteCharacter, ONICALL, (Character *inCharacter), 0x004DC480);
|
---|
| 123 |
|
---|
| 124 | DefFunc(void, ONrGameState_Timer_Start, ONICALL, (char* function, int time), 0x004FD370);
|
---|
| 125 |
|
---|
| 126 | // Get active (player?) character
|
---|
[688] | 127 | DefFunc(ActiveCharacter*, ONrGetActiveCharacter, ONICALL, (void* CharacterPtr), 0x004f1180);
|
---|
[692] | 128 |
|
---|
| 129 | DefFunc(uint32_t, ONrCharacter_GetHealthShade, ONICALL, (uint32_t health, uint32_t maxhealth), 0x004EF450);
|
---|
[688] | 130 | DefFunc(void, ONrCharacter_NewAnimationHook, ONICALL, (Character *ioCharacter, ActiveCharacter *ioActiveCharacter), 0x004E97A0);
|
---|
| 131 | DefFunc(void, ONrCharacter_SetAnimationExternal, ONICALL, (Character *ioCharacter, short state, void* animation, int interpolation), 0x004EB340);
|
---|
[692] | 132 | DefFunc(void, ONrCharacter_SetHitPoints, ONICALL, (Character *ioCharacter, uint32_t inHitPoints), 0x004EB220);
|
---|
| 133 | DefFunc(void, ONrCharacter_SetCharacterClass, ONICALL, (Character* Char, ONCC* Class), 0x004D7C30);
|
---|
| 134 | DefFunc(void, ONrCorpse_Create, ONICALL, (Character* Character), 0x004EF340);
|
---|
[677] | 135 |
|
---|
[692] | 136 |
|
---|
| 137 | // Print message to console
|
---|
[688] | 138 | DefFunc(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);
|
---|
[692] | 139 |
|
---|
| 140 | // Original cheat function
|
---|
[688] | 141 | DefFunc(uint8_t, ONrCheater, ONICALL, (uint32_t cheat), 0x004f5c30);
|
---|
[692] | 142 |
|
---|
| 143 | // ?
|
---|
[688] | 144 | DefFunc(int, AUrMessageBox, __cdecl, (int Buttons, char *Message, ...), 0x004378c0);
|
---|
| 145 | DefFunc(char*, SSrMessage_Find, ONICALL, (char* message_key), 0x0047F550);
|
---|
| 146 | DefFunc(void, ONiGameState_FindAutoPromptMessage, ONICALL, (char* Note, void* ptr), 0x004FDBE0);
|
---|
[677] | 147 |
|
---|
[692] | 148 | // Register a BSL function with a return type
|
---|
[688] | 149 | DefFunc(uint16_t, SLrScript_Command_Register_ReturnType, ONICALL, (char* name, char* desc, char* argfmt, sl_type type, sl_func callback), 0x00477b20);
|
---|
[692] | 150 |
|
---|
| 151 | // Register a BSL function without a return value
|
---|
[688] | 152 | DefFunc(uint16_t, SLrScript_Command_Register_Void, ONICALL, (char* name, char* desc, char* argfmt, sl_func callback), 0x00477b40);
|
---|
[692] | 153 |
|
---|
| 154 | // Register a global BSL variable
|
---|
[688] | 155 | DefFunc(uint16_t, SLrGlobalVariable_Register_Int32, ONICALL, (char* name, char* desc, int32_t* data), 0x00477e30);
|
---|
| 156 | DefFunc(uint16_t, SLrGlobalVariable_Register_Float, ONICALL, (char* name, char* desc, float* data), 0x00477ec0);
|
---|
| 157 | DefFunc(uint16_t, SLrGlobalVariable_Register_String, ONICALL, (char* name, char* desc, char* data), 0x00477fe0);
|
---|
[677] | 158 |
|
---|
[692] | 159 | // Print message to console ?
|
---|
[688] | 160 | DefFunc(int, COrMessage_Print, ONICALL, (char* Message, char* Key, void* noidea), 0x004304B0);
|
---|
[692] | 161 |
|
---|
[688] | 162 | DefFunc(void, COrConsole_StatusLine_Display, ONICALL, (), 0x00431E70);
|
---|
[692] | 163 |
|
---|
| 164 | // Get pointer to specified data instance
|
---|
[688] | 165 | DefFunc(int16_t, TMrInstance_GetDataPtr, ONICALL, (int tag, char* name, void* pointer), 0x004232E0);
|
---|
[692] | 166 |
|
---|
| 167 | // Get name of data instance pointed to
|
---|
[688] | 168 | DefFunc(char*, TMrInstance_GetInstanceName, ONICALL, (void* InstancePointer), 0x00423D90);
|
---|
[677] | 169 |
|
---|
[692] | 170 | DefFunc(short, TMrInstance_GetDataPtr_ByNumber, ONICALL, (int tag, int number, void** out), 0x00423680);
|
---|
| 171 | DefFunc(uint32_t, TMrInstance_GetTagCount, ONICALL, (int tag), 0x004236F0);
|
---|
| 172 |
|
---|
| 173 | // Draw text on the screen
|
---|
[688] | 174 | DefFunc(int16_t, TSrContext_DrawText, ONICALL, (uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect), 0x0042DF00);
|
---|
| 175 | DefFunc(int16_t, TSrContext_New, ONICALL, (void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext), 0x0042EA30);
|
---|
[677] | 176 |
|
---|
[688] | 177 | DefFunc(int16_t, TSrContext_SetShade, ONICALL, (void *ioTextContext, uint32_t inShade), 0x0042EE50);
|
---|
[692] | 178 |
|
---|
[688] | 179 | DefFunc(uint16_t, TRrAnimation_GetDuration, ONICALL, (void* Animation), 0x00428740);
|
---|
| 180 | DefFunc(uint16_t, TRrAnimation_GetTo, ONICALL, (void* Animation), 0x00428730);
|
---|
| 181 | DefFunc(uint16_t, TRrAnimation_GetFrom, ONICALL, (void* Animation), 0x00428720);
|
---|
[677] | 182 |
|
---|
[688] | 183 | DefFunc(uint16_t, iSetCharacterClass, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004D99D0);
|
---|
| 184 | DefFunc(uint16_t, AI2iScript_Spawn, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004B4780);
|
---|
| 185 | //NOT USED: DefFunc(void*, OBJrObjectType_GetObject_ByNumber, ONICALL, (int inObjectType, int inIndex), );
|
---|
| 186 | //NOT USED: DefFunc(int, OBJiObjectGroup_GetNumObjects, ONICALL, (void *inObjectGroup), );
|
---|
[677] | 187 |
|
---|
[688] | 188 | DefFunc(int, OBJrObjectType_EnumerateObjects, ONICALL, (int inObjectType, OBJtEnumCallback_Object inEnumCallback, int inUserData), 0x004D0080);
|
---|
[677] | 189 |
|
---|
[688] | 190 | DefFunc(void, OBJrDoor_Open, ONICALL, (DoorObject *inObject, Character *inCharacter), 0x004C26C0);
|
---|
| 191 | DefFunc(void, OBJrDoor_ForceOpen, ONICALL, (short id), 0x004C1EE0);
|
---|
| 192 | DefFunc(short, OBJrConsole_OnActivate, ONICALL, (void *inObject, Character *inCharacter), 0x004C0880);
|
---|
| 193 | DefFunc(void*, OBJrConsole_GetByID, ONICALL, (short ID), 0x004C0950);
|
---|
[677] | 194 |
|
---|
| 195 |
|
---|
[688] | 196 | DefFunc(void, ONiDrawWeaponSight, ONICALL, (Character* Char), 0x004E1900);
|
---|
| 197 | DefFunc(void, AI2rDisplayDebuggingInfo, ONICALL, (Character* Char), 0x0048C5F0);
|
---|
| 198 | DefFunc(uint32_t, M3rTextureMap_New, ONICALL, (short width, short height, int type, int allocated, int flags, char* name, void** output), 0x041EB00);
|
---|
[693] | 199 |
|
---|
| 200 | // Make a dialog element (in)visible and change its position
|
---|
| 201 | DefFunc(void, WMrWindow_SetVisible, ONICALL, (int window, int visibility), 0x00475a10);
|
---|
| 202 | DefFunc(void, WMrWindow_SetLocation, ONICALL, (int window, int x, int y), 0x004756d0);
|
---|
| 203 |
|
---|
[688] | 204 | #undef DefFunc
|
---|
[677] | 205 |
|
---|
| 206 | #endif
|
---|