Ignore:
Timestamp:
Mar 4, 2013, 3:21:23 PM (12 years ago)
Author:
alloc
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Daodan/src/Oni_Symbols.h

    r677 r688  
    77#include "Oni_Character.h"
    88#include "BFW_ScriptLang.h"
     9
    910#define DefVar(type, name, address) static type* _##name = (type*)address
    10 //variables
    11 
    12 //DO THIS INSTEAD!
    1311DefVar( onibool,                ai2_deaf,                               0x005ec0c1 );
    1412
     
    6664
    6765
    68 #undef $
     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);
    6968
    70 //functions
    71 //__fastcall isn't neccessary if you specify the correct calling convention.
    72 typedef int64_t         ( *_UUrMachineTime_High)();
    73 typedef double          ( *_UUrMachineTime_High_Frequency)();
    74 typedef int64_t         ( *_UUrMachineTime_Sixtieths)();
    75 typedef void            ( *_UUrPlatform_Initialize)();
    76 typedef void            ( *_UUrPlatform_Terminate)();
    7769
    78 typedef FILE*           ( __cdecl *_oni_fopen)(const char*, const char*);
    79 typedef int                     ( __cdecl *_oni_fprintf)(FILE*, const char*, ...);
    80 typedef int                     ( __cdecl *_oni_fflush)(FILE*);
     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);
    8177
    82 typedef void            ( __cdecl *_ONiMain)(int ArgCount, char *ArgList[]);
    83 typedef short           ( *_ONrPlatform_Initialize)(ONtPlatformData *PlatformData);
    84 typedef LRESULT         ( CALLBACK *_ONrPlatform_WindowProc)(HWND Window, UINT Message,
    85                                                                                                                   WPARAM WParam, LPARAM LParam);
    86 typedef unsigned int ( *_gl_enumerate_valid_display_modes)(M3tDisplayMode modes[16]);
    87 typedef int                     ( *_gl_platform_set_pixel_format)(HDC hdc);
    88 typedef int                     ( *_gl_platform_initialize)();
     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);
    8981
    90 typedef float           ( *_ONrPersist_GetGamma)();
    91 typedef uint8_t         ( *_ONrPersist_GetWonGame)();
     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);
    9288
    93 typedef void            ( __cdecl *_UUrStartupMessage)(const char* fmt, ...);
    94 typedef int16_t         ( *_ONrGameState_NewCharacter)(void* CHAR, void* AISA,
    95                                                                                                    void* flag, uint32_t* list_location);
    96 typedef ActiveCharacter*        ( *_ONrGetActiveCharacter)(void* CharacterPtr);
    97 typedef void ( *_ONrCharacter_NewAnimationHook)(Character *ioCharacter, ActiveCharacter *ioActiveCharacter);
    98 typedef void ( *_ONrCharacter_SetAnimationExternal)(Character *ioCharacter, short state, void* animation, int interpolation);
     89DefFunc(float, ONrPersist_GetGamma, ONICALL, (), 0x0050f450);
     90DefFunc(uint8_t, ONrPersist_GetWonGame, ONICALL, (), 0x0050f660);
    9991
    100 typedef void            ( *_COrTextArea_Print)(uint32_t area, uint32_t priority,
    101                                                                                    uint32_t textshade, uint32_t textshadowshade,
    102                                                                                    const char* text, uint32_t unk_alwaws_0, uint32_t fadetime);
    103 typedef uint8_t ONICALL ( *_ONrCheater)(uint32_t cheat);
    104 typedef int                     ( __cdecl *_AUrMessageBox)(int Buttons, char *Message, ...);
    105 typedef char*    ONICALL        ( *_SSrMessage_Find)(char* message_key); //Returns a prompt message from a message key
    106 //typedef void          ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
     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);
    10797
    108 typedef uint16_t (ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
    109 typedef uint16_t (ONICALL *_SLrScript_Command_Register_ReturnType)(char* name, char* desc, char* argfmt, sl_type type, sl_func callback);
    110 typedef uint16_t (ONICALL *_SLrScript_Command_Register_Void)(char* name, char* desc, char* argfmt, sl_func callback);
    111 typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Int32)(char* name, char* desc, int32_t* data);
    112 typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_Float)(char* name, char* desc, float* data);
    113 typedef uint16_t (ONICALL *_SLrGlobalVariable_Register_String)(char* name, char* desc, char* data);
     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);
    114103
    115 typedef int ( *_COrMessage_Print)(char* Message, char* Key, void* noidea);
    116 //typedef void ( *_COrConsole_StatusLine_Display)();
    117 typedef int16_t ( *_TMrInstance_GetDataPtr)(int tag, char* name, void* pointer);
    118 typedef char*   ( *_TMrInstance_GetInstanceName)(void* InstancePointer);
     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);
    119109
    120 typedef int16_t ( *_TSrContext_DrawText)(uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect);
    121 //int16_t TSrContext_New        ( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*);
    122 typedef int16_t ( *_TSrContext_New)( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext);
     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);
    123114
    124 typedef int16_t ( *_TSrContext_SetShade)(
    125         void            *ioTextContext,
    126         uint32_t        inShade);
    127 typedef void (* _ONrGameState_Timer_Start)( char* function, int time );
    128 typedef uint16_t ( *_TRrAnimation_GetDuration)(void* Animation);
    129 typedef uint16_t ( *_TRrAnimation_GetTo)(void* Animation);
    130 typedef uint16_t ( *_TRrAnimation_GetFrom)(void* Animation);
     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);
    131117
    132 typedef void
    133 ( *_ONrCharacter_SetHitPoints)(
    134         Character               *ioCharacter,
    135         uint32_t                        inHitPoints);
    136 typedef void ( *_ONrCorpse_Create)(Character* Character);
    137 //yes im cheating so badly.
    138 typedef uint16_t ( *_iSetCharacterClass)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
    139 typedef uint16_t ( *_AI2iScript_Spawn)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret);
    140 typedef void * ( *_OBJrObjectType_GetObject_ByNumber)(int inObjectType, int inIndex);
    141 typedef int ( *_OBJiObjectGroup_GetNumObjects)(void *inObjectGroup);
     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);
    142123
    143 typedef void ( *_ONrGameState_DeleteCharacter)(Character *inCharacter);
     124DefFunc(void, ONrCharacter_SetHitPoints, ONICALL, (Character *ioCharacter, uint32_t inHitPoints), 0x004EB220);
     125DefFunc(void, ONrCorpse_Create, ONICALL, (Character* Character), 0x004EF340);
    144126
    145 typedef char (*OBJtEnumCallback_Object)(
    146         void                            *inObject,
    147         int                             inUserData);
     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), );
    148131
    149 typedef int ( *_OBJrObjectType_EnumerateObjects)(
    150         int                                                             inObjectType,
    151         OBJtEnumCallback_Object                 inEnumCallback,
    152         int                                             inUserData);
     132DefFunc(void, ONrGameState_DeleteCharacter, ONICALL, (Character *inCharacter), 0x004DC480);
    153133
    154 typedef void ( *_OBJrDoor_Open)( DoorObject *inObject, Character *inCharacter );
    155 typedef void ( *_OBJrDoor_ForceOpen)(short id);
    156 typedef short ( *_OBJrConsole_OnActivate)( void *inObject, Character *inCharacter );
    157 //typedef void* ( *_OBJrConsole_GetByID)( short ID );
    158 #define ExtFunc(name) extern _##name name
    159 ExtFunc(SLrScript_Command_Register_ReturnType);
    160 ExtFunc(SLrScript_Command_Register_Void);
    161 ExtFunc(SLrGlobalVariable_Register_Int32);
    162 ExtFunc(SLrGlobalVariable_Register_Float);
    163 ExtFunc(SLrGlobalVariable_Register_String);
    164 //ExtFunc(COrConsole_StatusLine_Display);
    165 ExtFunc(OBJrObjectType_EnumerateObjects);
    166 //ExtFunc(OBJiObjectGroup_GetNumObjects);
    167 //ExtFunc(OBJrConsole_GetByID);
    168 ExtFunc(AI2iScript_Spawn);
     134DefFunc(int, OBJrObjectType_EnumerateObjects, ONICALL, (int inObjectType, OBJtEnumCallback_Object inEnumCallback, int inUserData), 0x004D0080);
    169135
    170 ExtFunc(TRrAnimation_GetDuration);
    171 ExtFunc(TRrAnimation_GetFrom);
    172 ExtFunc(TRrAnimation_GetTo);
    173 ExtFunc(ONrGameState_Timer_Start);
    174 extern _UUrMachineTime_High UUrMachineTime_High;
    175 extern _UUrMachineTime_High_Frequency UUrMachineTime_High_Frequency;
    176 extern _UUrMachineTime_Sixtieths UUrMachineTime_Sixtieths;
    177 extern _UUrPlatform_Initialize UUrPlatform_Initialize;
    178 extern _UUrPlatform_Terminate UUrPlatform_Terminate;
     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);
    179140
    180 extern _oni_fopen oni_fopen;
    181 extern _oni_fprintf oni_fprintf;
    182 extern _oni_fflush oni_fflush;
    183141
    184 extern _ONiMain ONiMain;
    185 extern _ONrPlatform_Initialize ONrPlatform_Initialize;
    186 extern _ONrPlatform_WindowProc ONrPlatform_WindowProc;
     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
    187150
    188 ExtFunc(COrMessage_Print);
    189 
    190 ExtFunc(TMrInstance_GetDataPtr);
    191 ExtFunc(TMrInstance_GetInstanceName);
    192 
    193 ExtFunc(gl_enumerate_valid_display_modes);
    194 ExtFunc(gl_platform_set_pixel_format);
    195 ExtFunc(gl_platform_initialize);
    196 ExtFunc(ONrPersist_GetGamma);
    197 ExtFunc(ONrPersist_GetWonGame);
    198 ExtFunc(UUrStartupMessage);
    199 
    200 ExtFunc(ONrCharacter_SetAnimationExternal);
    201 
    202 ExtFunc(ONrCharacter_NewAnimationHook);
    203 ExtFunc(ONrCharacter_SetHitPoints);
    204 ExtFunc(ONrGameState_NewCharacter);
    205 ExtFunc(ONrGameState_DeleteCharacter);
    206 ExtFunc(ONrGetActiveCharacter);
    207 ExtFunc(ONrCorpse_Create);
    208 ExtFunc(iSetCharacterClass);
    209 
    210 ExtFunc(COrTextArea_Print);
    211 
    212 ExtFunc(ONrCheater);
    213 ExtFunc(AUrMessageBox);
    214 
    215 ExtFunc(SSrMessage_Find);
    216 //ExtFunc(ONiGameState_FindAutoPromptMessage);
    217 
    218 ExtFunc(TSrContext_DrawText);
    219 ExtFunc(TSrContext_New);
    220 ExtFunc(TSrContext_SetShade);
    221 ExtFunc(OBJrDoor_Open);
    222 ExtFunc(OBJrDoor_ForceOpen);
    223 
    224 ExtFunc(OBJrConsole_OnActivate);
    225 //static const void* ( *OBJrConsole_GetByID)( short ID ) = (const void*(*)(short))0x004C0950;
    226 #undef DefFunc
    227 #define DefFunc( type, name, args, address) static const type ONICALL ( * name ) args = (const type (*) args )address;
    228 DefFunc( void*, OBJrConsole_GetByID, (short ID), 0x004C0950);
    229 DefFunc( void, COrConsole_StatusLine_Display, (), 0x00431E70 );
    230 //typedef void          ( *_ONiGameState_FindAutoPromptMessage)(char* Note, void* ptr);
    231 DefFunc( void, ONiGameState_FindAutoPromptMessage, (char* Note, void* ptr), 0x004FDBE0 );
    232 DefFunc( void, ONrCharacter_SetCharacterClass, (Character* Char, ONCC* Class), 0x004D7C30 );
    233 DefFunc( short, TMrInstance_GetDataPtr_ByNumber, (int tag, int number, void** out), 0x00423680 );
    234 DefFunc( uint32_t, TMrInstance_GetTagCount, (int tag), 0x004236F0);
    235 //DefFunc( uint32_t, stdcall M3rTextureMap_New, (int tag), 0x041EB00);
    236 //(short width, short height, int type, int allocated, int flags, char* name, void** output)
    237 DefFunc( uint32_t, ONrCharacter_GetHealthShade, (uint32_t health, uint32_t maxhealth), 0x004EF450);
    238 //DefFunc( short, TSrContext_SetShade, (void* context, int shade ), 0x0042EE50);
    239 DefFunc( void, ONiDrawWeaponSight, (Character* Char), 0x004E1900 );
    240 DefFunc( void, AI2rDisplayDebuggingInfo, (Character* Char), 0x0048C5F0 );
    241  static const  uint32_t ( * M3rTextureMap_New)(short width, short height, int type, int allocated, int flags, char* name, void** output)
    242          = (const uint32_t(*)(short width, short height, int type, int allocated, int flags, char* name, void** output))0x041EB00;
    243151#endif
Note: See TracChangeset for help on using the changeset viewer.