Changeset 690 for Daodan/src
- Timestamp:
- Mar 6, 2013, 7:33:15 PM (12 years ago)
- Location:
- Daodan/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/BFW_Utility.h
r677 r690 25 25 //int __cdecl AUrMessageBox(int Buttons, char *Message, ...); 26 26 27 extern uint32_t COgConsoleLines;28 extern uint32_t COgFadeTimeValue;29 extern uint32_t COgDefaultTextShade;30 extern uint32_t COgDefaultTextShadow;31 32 extern FILE* ONgFileStartup;33 34 27 #endif -
Daodan/src/Daodan.c
r689 r690 55 55 bool opt_usedaodanbsl = true; 56 56 bool opt_border = true; 57 bool opt_shadow = false;58 57 bool opt_topmost = false; 59 58 … … 144 143 if (patch_alttab) 145 144 { 145 // 0xC3 = ret, so makes those functions just have a "ret" instruction at their start 146 146 DDrPatch_Byte ((char*)UUrPlatform_Initialize, 0xC3); 147 147 DDrPatch_Byte ((char*)UUrPlatform_Terminate, 0xC3); … … 313 313 else if (!_stricmp(name, "border")) 314 314 opt_border = !_stricmp(inifile_cleanstr(value), "true"); 315 else if (!_stricmp(name, "shadow"))316 opt_shadow = !_stricmp(inifile_cleanstr(value), "true");317 315 else if (!_stricmp(name, "topmost")) 318 316 opt_topmost = !_stricmp(inifile_cleanstr(value), "true"); … … 589 587 DDrStartupMessage("daodan attached!"); 590 588 589 // Tell Oni to not load non levelX_final-files by default: 591 590 opt_ignore_private_data = false; 591 592 // Enable sound by default: 592 593 opt_sound = true; 593 594 -
Daodan/src/Daodan.h
r677 r690 12 12 13 13 extern bool opt_border; 14 extern bool opt_shadow;15 14 extern bool opt_topmost; 16 15 -
Daodan/src/Daodan_Cheater.c
r689 r690 104 104 case cheat_bigbadboss: 105 105 { 106 GameState* GameState = ONgGameState;107 108 106 Character* player = ONgGameState->PlayerCharacter; 109 107 //char* player = *((char**)(ONgGameState + GSA_player)); -
Daodan/src/Daodan_WindowHack.c
r689 r690 7 7 #include "BFW_Motoko_Draw.h" 8 8 #include "oni_gl.h" 9 10 #define DD_CS_DROPSHADOW 0x2000011 9 12 10 volatile HWND onihwnd, boxhwnd = NULL; … … 65 63 66 64 wc.cbSize = sizeof(WNDCLASSEX); 67 wc.style = (opt_border ? 0 : (opt_shadow ? DD_CS_DROPSHADOW : 0));65 wc.style = 0; 68 66 wc.lpfnWndProc = DDrHack_WndProc; 69 67 wc.cbClsExtra = 0; -
Daodan/src/Oni.h
r677 r690 15 15 HWND Window; 16 16 } ONtPlatformData; 17 /*18 void __cdecl ONiMain(int ArgCount, char *ArgList[]);19 short ONICALL ONrPlatform_Initialize(ONtPlatformData *PlatformData);20 LRESULT CALLBACK ONrPlatform_WindowProc(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam);21 */22 //uint8_t ONICALL ONrCheater(uint32_t cheat);23 17 24 //char* ONICALL SSrMessage_Find(char* message_key); //Returns a prompt message from a message key25 //void ONICALL ONiGameState_FindAutoPromptMessage(char* Note, void* ptr);26 18 27 //28 19 void ONICALL TMrInstance_GetDataPtr_List( 29 20 char Tag[4], //as in 'ONWC' -
Daodan/src/Oni_Symbols.h
r688 r690 8 8 #include "BFW_ScriptLang.h" 9 9 10 #define DefVar(type, name, address) static type* _##name = (type*)address11 DefVar( onibool, ai2_deaf, 0x005ec0c1 );12 10 13 DefVar( HINSTANCE, g_Instance, 0x0061F9E4 ); 11 //Define variables of Oni: #define VARNAME (*((TYPE*)ADDRESS)) 14 12 15 DefVar( gl_api_t*, gl_api, 0x00560604 ); 16 DefVar( gl_engine_t*, gl_eng, 0x00560600 ); 17 DefVar( WORD*, gl_gamma_ramp, 0x0055fdfc ); 18 DefVar( int, gl_gamma_ramp_valid, 0x005603fc ); 13 // AIs are deaf (ger: "taub") 14 #define ai2_deaf (*((onibool*)0x005ec0c1)) 19 15 20 DefVar( char, opt_ignore_private_data,0x006370f0 ); 21 DefVar( char, opt_sound, 0x006370fc ); 16 // Option "debug" ... but what does it do? 17 #define AKgDebug_DebugMaps (*((char*)0x002b2204)) 22 18 23 DefVar( char, AKgDebug_DebugMaps, 0x002b2204 ); 19 // Option "debugfiles" ... but what does it do? 20 #define BFgDebugFileEnable (*((bool*)0x0055c8d0)) 24 21 25 DefVar( bool, BFgDebugFileEnable, 0x0055c8d0 ); 22 // Parameter 1 to COrTextArea_Print. Context pointer? 23 #define COgConsoleLines (*((uint32_t*)0x005cb468)) 26 24 27 DefVar( uint32_t, COgConsoleLines, 0x005cb468 ); 28 DefVar( uint32_t, COgDefaultTextShade, 0x00533f70 ); 29 DefVar( uint32_t, COgDefaultTextShadow, 0x00533f74 ); 30 DefVar( uint32_t, COgFadeTimeValue, 0x00533f68 ); 25 // Default console text color 26 #define COgDefaultTextShade (*((uint32_t*)0x00533f70)) 31 27 32 DefVar( FILE*, ONgFileStartup, 0x005711b8 ); 33 DefVar( GameState*, ONgGameState, 0x005ece7c ); 34 DefVar( ONtPlatformData,ONgPlatformData, 0x0053100c ); 28 // Default console text shadow color 29 #define COgDefaultTextShadow (*((uint32_t*)0x00533f74)) 35 30 36 DefVar( char, M3gResolutionSwitch, 0x00531634 ); 31 // Console text fade timeout 32 #define COgFadeTimeValue (*((uint32_t*)0x00533f68)) 37 33 38 DefVar( 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. 34 // Some kind of graphics context? 35 #define g_Instance (*((HINSTANCE*)0x0061F9E4)) 43 36 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) 37 // OpenGL Gamma related 38 #define gl_gamma_ramp (*((WORD**)0x0055fdfc)) 39 40 // OpenGL Gamma related 41 #define gl_gamma_ramp_valid (*((int*)0x005603fc)) 42 43 // OpenGL whatev? 44 #define gl_api (*((gl_api_t**)0x00560604)) 45 46 // OpenGL whatev? 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)) 64 69 65 70 71 // Method signature for script (BSL) functions 66 72 typedef uint16_t ( ONICALL *sl_func)(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret); 73 74 // Used by function definition below: OBJrObjectType_EnumerateObjects 67 75 typedef char ( ONICALL *OBJtEnumCallback_Object)(void *inObject, int inUserData); 68 76 69 77 70 #undef DefFunc 78 71 79 #define DefFunc( type, name, callingconvention, args, address) typedef type ( callingconvention * _##name ) args; static _##name name = (_##name)address 80 81 // Orig timing functions, replaced by DDrMachineTime_* if option "usegettickcount" is enabled 72 82 DefFunc(int64_t, UUrMachineTime_High, ONICALL, (), 0x04026480); 73 83 DefFunc(double, UUrMachineTime_High_Frequency, ONICALL, (), 0x040264b0); 74 84 DefFunc(int64_t, UUrMachineTime_Sixtieths, ONICALL, (), 0x040263e0); 85 86 // Code to initialize platform stuff (like disabling system key combination Alt+Tab) 75 87 DefFunc(void, UUrPlatform_Initialize, ONICALL, (), 0x04026010); 76 88 DefFunc(void, UUrPlatform_Terminate, ONICALL, (), 0x04026310); 77 89 90 // Oni's file access methods 78 91 DefFunc(FILE*, oni_fopen, __cdecl, (const char*, const char*), 0x0051ea9f); 79 92 DefFunc(int, oni_fprintf, __cdecl, (FILE*, const char*, ...), 0x0051ebbf); 80 93 DefFunc(int, oni_fflush, __cdecl, (FILE*), 0x0051eab2); 81 94 95 // Oni's main method? 82 96 DefFunc(void, ONiMain, __cdecl, (int ArgCount, char *ArgList[]), 0x004d3280); 97 98 // Initialization code, used to hook in windowed modes 83 99 DefFunc(short, ONrPlatform_Initialize, ONICALL, (ONtPlatformData *PlatformData), 0x0050f670); 84 100 DefFunc(LRESULT, ONrPlatform_WindowProc, CALLBACK, (HWND Window, UINT Message, WPARAM WParam, LPARAM LParam), 0x0050f7a0); 101 102 // Retrieves a list of resolutions, replaced by "daodan_enumerate_valid_display_modes" 85 103 DefFunc(unsigned int, gl_enumerate_valid_display_modes, ONICALL, (M3tDisplayMode modes[16]), 0x004083a0); 86 104 DefFunc(int, gl_platform_set_pixel_format, ONICALL, (HDC hdc), 0x00407b50); -
Daodan/src/daodan_gl.c
r689 r690 235 235 DDrStartupMessage("Using standard Windows gamma adjustment"); 236 236 237 if (GetDeviceGammaRamp(gl_eng->HDC, gl_gamma_ramp))237 //WINE CRASH! if (GetDeviceGammaRamp(gl_eng->HDC, gl_gamma_ramp)) 238 238 gl_gamma_ramp_valid = 1; 239 239 }
Note:
See TracChangeset
for help on using the changeset viewer.