Changeset 689
- Timestamp:
- Mar 4, 2013, 4:52:19 PM (12 years ago)
- Location:
- Daodan
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/makefile
r688 r689 8 8 endif 9 9 10 GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct - pedantic -Wextra -Wno-unused-variable10 GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter 11 11 LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll 12 12 LOCALE = LC_MESSAGES=C … … 21 21 22 22 ALL: $(DEST) $(OBJS) 23 echo "Linking $<"23 @echo "Linking $<" 24 24 $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS) 25 25 … … 29 29 30 30 build/%.o: src/%.c 31 echo "Compiling $<"31 @echo "Compiling $<" 32 32 $(LOCALE) $(GCC) $(GCCFLAGS) -c -o $@ $< 33 echo33 @echo 34 34 35 35 build/%.o: src/%.rc 36 echo "Assembling resource $<"36 @echo "Assembling resource $<" 37 37 $(WINDRES) -i $< -o $@ 38 echo38 @echo 39 39 -
Daodan/src/BFW_Motoko_Draw.h
r326 r689 7 7 typedef struct 8 8 { 9 short Width;10 short Height;11 short Depth;12 short __unused;9 unsigned short Width; 10 unsigned short Height; 11 unsigned short Depth; 12 unsigned short __unused; 13 13 } M3tDisplayMode; 14 14 -
Daodan/src/Daodan.c
r681 r689 67 67 if (patch_fonttexturecache) 68 68 { 69 DDrPatch_Byte( OniExe + 0x00020ea7, 0x20);70 DDrPatch_Byte( OniExe + 0x00020f4a, 0x40);69 DDrPatch_Byte((char*)(OniExe + 0x00020ea7), 0x20); 70 DDrPatch_Byte((char*)(OniExe + 0x00020f4a), 0x40); 71 71 } 72 72 73 73 // Now supports textures up to 512x512 74 74 if (patch_largetextures) 75 DDrPatch_Byte ( OniExe + 0x00005251, 0x10);75 DDrPatch_Byte ((char*)(OniExe + 0x00005251), 0x10); 76 76 77 77 // Non-"_Final" levels are now valid 78 78 if (patch_levelplugins) 79 DDrPatch_Byte ( OniExe + 0x000206a8, 0x01);79 DDrPatch_Byte ((char*)(OniExe + 0x000206a8), 0x01); 80 80 81 81 // Pathfinding grid cache size x8 82 82 if (patch_pathfinding) 83 83 { 84 const char pathfinding[2] = {0x90 , 0xE9 };85 DDrPatch_Byte ( OniExe + 0x0010b03b, 0x20);86 DDrPatch_Byte ( OniExe + 0x0010b04c, 0x20);84 const unsigned char pathfinding[2] = {0x90 , 0xE9 }; 85 DDrPatch_Byte ((char*)(OniExe + 0x0010b03b), 0x20); 86 DDrPatch_Byte ((char*)(OniExe + 0x0010b04c), 0x20); 87 87 88 88 //other stuff 89 DDrPatch_Const( 0x440789, pathfinding);89 DDrPatch_Const((char*)(OniExe + 0x00040789), pathfinding); 90 90 } 91 91 … … 93 93 if (patch_projaware) 94 94 { 95 DDrPatch_Byte ( OniExe + 0x0009c07c, 0x6c);96 DDrPatch_Byte ( OniExe + 0x0009c080, 0x70);97 DDrPatch_Byte ( OniExe + 0x0009c084, 0x74);98 DDrPatch_Byte ( OniExe + 0x0009c110, 0x6c);95 DDrPatch_Byte ((char*)(OniExe + 0x0009c07c), 0x6c); 96 DDrPatch_Byte ((char*)(OniExe + 0x0009c080), 0x70); 97 DDrPatch_Byte ((char*)(OniExe + 0x0009c084), 0x74); 98 DDrPatch_Byte ((char*)(OniExe + 0x0009c110), 0x6c); 99 99 } 100 100 101 101 // Forced DirectInput (for Windows NT) 102 102 if (patch_directinput) 103 DDrPatch_Byte (OniExe + 0x00002e6d, 0xeb);103 DDrPatch_Byte((char*)(OniExe + 0x00002e6d), 0xeb); 104 104 105 105 if (patch_wpfadetime) 106 106 { 107 107 // Makes wp_fadetime actually have a function 108 const char fadetime_patch[] = { 0x66, 0x8B, 0x1D, 0xC4, 0x7D, 0x62, 0x00, 0x66, 0x89, 0x5E, 0x46, 0x5B, 0x5E, 0x83, 0xC4, 0x14, 0xC3 };109 DDrPatch_Const ( OniExe + 0x0011a889, fadetime_patch);110 DDrPatch_Byte ( OniExe + 0x0011a560, 0x31);108 const unsigned char fadetime_patch[] = { 0x66, 0x8B, 0x1D, 0xC4, 0x7D, 0x62, 0x00, 0x66, 0x89, 0x5E, 0x46, 0x5B, 0x5E, 0x83, 0xC4, 0x14, 0xC3 }; 109 DDrPatch_Const ((char*)(OniExe + 0x0011a889), fadetime_patch); 110 DDrPatch_Byte ((char*)(OniExe + 0x0011a560), 0x31); 111 111 112 112 // Sets the fadetime to 4800 by default 113 DDrPatch_Int16 (( OniExe + 0x0011ab0e), 0x12c0);113 DDrPatch_Int16 ((short*)(OniExe + 0x0011ab0e), 0x12c0); 114 114 } 115 115 … … 124 124 if (patch_kickguns) 125 125 { 126 const char kickgun_patch[] = { 0x00, 0x05, 0x00, 0x00, 0x00, 0xC7, 0x05, 0x1C, 0xC9, 0x5E, 0x00, 0x70, 0xB8, 0x43, 0x00, 0xC7, 0x05, 0x20, 0xC9, 0x5E, 0x00, 0x20, 0xBE, 0x43 };127 DDrPatch_Const ( OniExe + 0x000dc420, kickgun_patch);126 const unsigned char kickgun_patch[] = { 0x00, 0x05, 0x00, 0x00, 0x00, 0xC7, 0x05, 0x1C, 0xC9, 0x5E, 0x00, 0x70, 0xB8, 0x43, 0x00, 0xC7, 0x05, 0x20, 0xC9, 0x5E, 0x00, 0x20, 0xBE, 0x43 }; 127 DDrPatch_Const ((char*)(OniExe + 0x000dc420), kickgun_patch); 128 128 } 129 129 … … 131 131 if (patch_cooldowntimer) 132 132 { 133 const char cooldown_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };134 DDrPatch_Const ( OniExe + 0x0011a825, cooldown_patch);133 const unsigned char cooldown_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; 134 DDrPatch_Const ((char*)(OniExe + 0x0011a825), cooldown_patch); 135 135 } 136 136 137 137 if (patch_throwtest) 138 138 { 139 const char throwtest_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };140 DDrPatch_Const( OniExe + 0x000dc190, throwtest_patch);139 const unsigned char throwtest_patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; 140 DDrPatch_Const((char*)(OniExe + 0x000dc190), throwtest_patch); 141 141 } 142 142 … … 144 144 if (patch_alttab) 145 145 { 146 DDrPatch_Byte (( void*)UUrPlatform_Initialize, 0xC3);147 DDrPatch_Byte (( void*)UUrPlatform_Terminate, 0xC3);146 DDrPatch_Byte ((char*)UUrPlatform_Initialize, 0xC3); 147 DDrPatch_Byte ((char*)UUrPlatform_Terminate, 0xC3); 148 148 } 149 149 150 150 // Unlocks particle action disabling/enabling bits for all events. (Will be controlled by a command line switch when I figure out how to do that without Win32 hacks.) 151 151 if (patch_particledisablebit) 152 DDrPatch_Int16 ( OniExe + 0x001b184, 0x9090);152 DDrPatch_Int16 ((short*)(OniExe + 0x001b184), 0x9090); 153 153 154 154 // Multi-byte patch (multiple language support) 155 155 if (!patch_multibyte) 156 156 { 157 DDrPatch_Byte ( OniExe + 0x0002d8f8, 0xeb);158 DDrPatch_Byte ( OniExe + 0x0002d9ad, 0xeb);159 DDrPatch_Byte ( OniExe + 0x0002dbe2, 0xeb);160 DDrPatch_Byte ( OniExe + 0x0002dec3, 0xeb);161 DDrPatch_Byte ( OniExe + 0x0002e2ab, 0xeb);162 DDrPatch_Byte ( OniExe + 0x0002e2c4, 0xeb);163 DDrPatch_Byte ( OniExe + 0x0002e379, 0xeb);164 DDrPatch_Byte ( OniExe + 0x0002e48c, 0xeb);165 DDrPatch_Byte ( OniExe + 0x0002e4d0, 0xeb);166 DDrPatch_Byte ( OniExe + 0x0002e4f4, 0xeb);167 DDrPatch_Byte ( OniExe + 0x0002e646, 0xeb);168 DDrPatch_Byte ( OniExe + 0x0002e695, 0xeb);169 DDrPatch_Byte ( OniExe + 0x0002e944, 0xeb);170 DDrPatch_Byte ( OniExe + 0x0002e95d, 0xeb);171 DDrPatch_Byte ( OniExe + 0x0002e98e, 0xeb);172 DDrPatch_Byte ( OniExe + 0x0002e9dc, 0xeb);157 DDrPatch_Byte ((char*)(OniExe + 0x0002d8f8), 0xeb); 158 DDrPatch_Byte ((char*)(OniExe + 0x0002d9ad), 0xeb); 159 DDrPatch_Byte ((char*)(OniExe + 0x0002dbe2), 0xeb); 160 DDrPatch_Byte ((char*)(OniExe + 0x0002dec3), 0xeb); 161 DDrPatch_Byte ((char*)(OniExe + 0x0002e2ab), 0xeb); 162 DDrPatch_Byte ((char*)(OniExe + 0x0002e2c4), 0xeb); 163 DDrPatch_Byte ((char*)(OniExe + 0x0002e379), 0xeb); 164 DDrPatch_Byte ((char*)(OniExe + 0x0002e48c), 0xeb); 165 DDrPatch_Byte ((char*)(OniExe + 0x0002e4d0), 0xeb); 166 DDrPatch_Byte ((char*)(OniExe + 0x0002e4f4), 0xeb); 167 DDrPatch_Byte ((char*)(OniExe + 0x0002e646), 0xeb); 168 DDrPatch_Byte ((char*)(OniExe + 0x0002e695), 0xeb); 169 DDrPatch_Byte ((char*)(OniExe + 0x0002e944), 0xeb); 170 DDrPatch_Byte ((char*)(OniExe + 0x0002e95d), 0xeb); 171 DDrPatch_Byte ((char*)(OniExe + 0x0002e98e), 0xeb); 172 DDrPatch_Byte ((char*)(OniExe + 0x0002e9dc), 0xeb); 173 173 } 174 174 … … 176 176 if (patch_cheattable) 177 177 { 178 DDrPatch_Int32 ( 0x004f616b, (int)&DDr_CheatTable[0].name);179 DDrPatch_Int32 ( OniExe + 0x000f617a, (int)&DDr_CheatTable[0].message_on);178 DDrPatch_Int32 ((int*)(OniExe + 0x000f616b), (int)&DDr_CheatTable[0].name); 179 DDrPatch_Int32 ((int*)(OniExe + 0x000f617a), (int)&DDr_CheatTable[0].message_on); 180 180 } 181 181 … … 183 183 if (patch_argb8888) 184 184 { 185 DDrPatch_Byte ( OniExe + 0x00135af0, 0x07);186 DDrPatch_Byte ( OniExe + 0x00135af4, 0x0B);185 DDrPatch_Byte ((char*)(OniExe + 0x00135af0), 0x07); 186 DDrPatch_Byte ((char*)(OniExe + 0x00135af4), 0x0B); 187 187 } 188 188 … … 192 192 //Makes it always say "Recieved weapon_name." 193 193 //Needs check for loc_4DFC66 194 //DDrPatch_NOOP( OniExe + 0x000E4DF8,2);194 //DDrPatch_NOOP((char*)(OniExe + 0x000E4DF8),2); 195 195 196 196 //Adds Weapon name and ammo meter to pickup autoprompt 197 DDrPatch_NOOP( OniExe + 0x000FAC73, 9);198 DDrPatch_NOOP( OniExe + 0x000FAC80, 5);199 DDrPatch_MakeCall( OniExe + 0xFAC85,DDrWeapon2Message);197 DDrPatch_NOOP((char*)(OniExe + 0x000FAC73), 9); 198 DDrPatch_NOOP((char*)(OniExe + 0x000FAC80), 5); 199 DDrPatch_MakeCall((void*)(OniExe + 0xFAC85), (void*)DDrWeapon2Message); 200 200 201 201 //Moves location of colors 202 //DDrPatch_Int32( 0x0042E3D5, (int)&DDrDSayColors );203 //DDrPatch_Int32( 0x0042E3DA, (int)&DDrDSayColors );202 //DDrPatch_Int32((int*)(OniExe + 0x0002E3D5), (int)&DDrDSayColors ); 203 //DDrPatch_Int32((int*)(OniExe + 0x0002E3DA), (int)&DDrDSayColors ); 204 204 } 205 205 206 206 // Disable loading the vtuneapi.dll 207 207 //if (patch_killvtune) 208 //DDrPatch_Byte ( OniExe + 0x00026340, 0xC3);208 //DDrPatch_Byte ((char*)(OniExe + 0x00026340), 0xC3); 209 209 210 210 // Disable Oni's internal CLrGetCommandLine function (to eventually replace it with our own) 211 211 if (patch_getcmdline) 212 DDrPatch_NOOP ( OniExe + 0x000d3280, 51);212 DDrPatch_NOOP ((char*)(OniExe + 0x000d3280), 51); 213 213 214 214 // Disable Oni's command line parser so it doesn't interfere with ours 215 215 if (patch_disablecmdline) 216 DDrPatch_Int32 ( OniExe + 0x000d3570, 0xc3c03366);216 DDrPatch_Int32 ((int*)(OniExe + 0x000d3570), 0xc3c03366); 217 217 218 218 if (patch_bsl) … … 223 223 Character * Chr = 0; 224 224 int NoPath = (int)&(Chr[0].RegenHax) & 0x000000FF; 225 const char regen_patch[] =225 const unsigned char regen_patch[] = 226 226 {0x90, 0x90, 0x90, 0x90, 0x90, // mov al, _WPgRegenerationCheat -> NOOP 227 227 0x90, 0x90, // test al, al -> NOOP … … 232 232 0x74, 0x21 // jnz 0x21 -> jz 0x21 233 233 }; 234 DDrPatch_Const( 0x0051BB64, regen_patch);234 DDrPatch_Const((char*)(OniExe + 0x0011BB64), regen_patch); 235 235 } 236 236 … … 252 252 { 253 253 //Set distance above head to 4.0 254 DDrPatch_Int32( 0x0048C998, 0x005296C8);254 DDrPatch_Int32((int*)(OniExe + 0x0008C998), 0x005296C8); 255 255 //texture height 256 DDrPatch_Byte( 0x0048C9DF, 0x3F );256 DDrPatch_Byte((char*)(OniExe + 0x0008C9DF), 0x3F ); 257 257 //texture width 258 DDrPatch_NOOP( (char*)0x0048C9CA, 6 );258 DDrPatch_NOOP((char*)(OniExe + 0x0008C9CA), 6 ); 259 259 //Set the text color to whatever we like ;) 260 DDrPatch_NOOP( 0x0048C898, 6 );261 DDrPatch_Byte( 0x0048C898, 0x8B );262 DDrPatch_Byte( 0x0048C899, 0xCE );263 //FLATLINE? DDrPatch_MakeCall( 0x0048C8A3, FLrHook_DebugNameShadeHack);260 DDrPatch_NOOP((char*)(OniExe + 0x0008C898), 6 ); 261 DDrPatch_Byte((char*)(OniExe + 0x0008C898), 0x8B ); 262 DDrPatch_Byte((char*)(OniExe + 0x0008C899), 0xCE ); 263 //FLATLINE? DDrPatch_MakeCall((void*)(OniExe + 0x0008C8A3), FLrHook_DebugNameShadeHack); 264 264 265 265 //Make the background black for additive blending 266 //FLATLINE? DDrPatch_MakeCall( 0x0048C802, FLrHook_DebugNameTextureInit );266 //FLATLINE? DDrPatch_MakeCall((void*)(OniExe + 0x0008C802), FLrHook_DebugNameTextureInit ); 267 267 } 268 268 269 269 if(1) 270 270 { 271 //DDrPatch_NOOP( 0x004E1957, 6 );272 //DDrPatch_MakeCall( 0x004E17F6, FLrHook_Lasers );271 //DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 ); 272 //DDrPatch_MakeCall((void*)(OniExe + 0x000E17F6), FLrHook_Lasers ); 273 273 } 274 274 275 275 //Flatline related stuff 276 // DDrPatch_MakeCall( 0x004FBCEA, DDrText_Hook);277 278 //FLATLINE? DDrPatch_Int32( 0x004B24D2, FLrSpawnHack);279 280 //FLATLINE? DDrPatch_NOOP( 0x004C26CB, 6);281 282 //FLATLINE? DDrPatch_MakeCall( 0x004C26CB, FLrHook_DoorOpen);283 //FLATLINE? DDrPatch_MakeCall( 0x004EE3CF, FLrHook_ConsoleActivate);276 // DDrPatch_MakeCall((void*)(OniExe + 0x000FBCEA), DDrText_Hook); 277 278 //FLATLINE? DDrPatch_Int32((int*)(OniExe + 0x000B24D2), FLrSpawnHack); 279 280 //FLATLINE? DDrPatch_NOOP((char*)(OniExe + 0x000C26CB), 6); 281 282 //FLATLINE? DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen); 283 //FLATLINE? DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate); 284 284 return true; 285 285 } … … 402 402 { 403 403 char* str = _strdup(value); 404 DDrPatch_Int32( OniExe + 0x000fd730, (int)str);405 DDrPatch_Int32( OniExe + 0x000fd738, (int)str);404 DDrPatch_Int32((int*)(OniExe + 0x000fd730), (int)str); 405 DDrPatch_Int32((int*)(OniExe + 0x000fd738), (int)str); 406 406 } 407 407 else if (!_stricmp(name, "syndicatewarehouse")) 408 408 { 409 409 char* str = _strdup(value); 410 DDrPatch_Int32( OniExe + 0x000fd71a, (int)str);411 DDrPatch_Int32( OniExe + 0x0010ef75, (int)str);410 DDrPatch_Int32((int*)(OniExe + 0x000fd71a), (int)str); 411 DDrPatch_Int32((int*)(OniExe + 0x0010ef75), (int)str); 412 412 } 413 413 else if (!_stricmp(name, "damn")) 414 DDrPatch__strdup( OniExe + 0x0010fb6e, value);414 DDrPatch__strdup((int*)(OniExe + 0x0010fb6e), value); 415 415 else if (!_stricmp(name, "blam")) 416 DDrPatch__strdup( OniExe + 0x0010fb73, value);416 DDrPatch__strdup((int*)(OniExe + 0x0010fb73), value); 417 417 else if (!_stricmp(name, "shapeshifter_on")) 418 418 DDr_CheatTable[0].message_on = _strdup(value); … … 557 557 FILE* UUgError_WarningFile = *_UUgError_WarningFile; 558 558 559 if (filename && message && (strlen( filename)+strlen(message))<420) {559 if (filename && message && (strlen((const char*)filename)+strlen((const char*)message))<420) { 560 560 sprintf( 561 561 v6, 562 562 "Error %x reported from File: %s, Line: %d (message follows) \r\n%s", 563 563 errornum, 564 filename,564 (const char*)filename, 565 565 linenumber, 566 message);566 (const char*)message); 567 567 568 568 if ( UUgError_WarningFile … … 630 630 // Safe startup message printer 631 631 if (patch_safeprintf) 632 DDrPatch_MakeJump( UUrStartupMessage,DDrStartupMessage);632 DDrPatch_MakeJump((void*)UUrStartupMessage, (void*)DDrStartupMessage); 633 633 634 634 // Daodan device mode enumeration function 635 635 if (patch_daodandisplayenum) 636 DDrPatch_MakeJump( gl_enumerate_valid_display_modes,daodan_enumerate_valid_display_modes);636 DDrPatch_MakeJump((void*)gl_enumerate_valid_display_modes, (void*)daodan_enumerate_valid_display_modes); 637 637 638 638 // Performance patch 639 639 if (patch_usegettickcount) 640 640 { 641 DDrPatch_MakeJump( UUrMachineTime_High,DDrMachineTime_High);642 DDrPatch_MakeJump( UUrMachineTime_High_Frequency,DDrMachineTime_High_Frequency);643 DDrPatch_MakeJump( UUrMachineTime_Sixtieths,DDrMachineTime_Sixtieths);641 DDrPatch_MakeJump((void*)UUrMachineTime_High, (void*)DDrMachineTime_High); 642 DDrPatch_MakeJump((void*)UUrMachineTime_High_Frequency, (void*)DDrMachineTime_High_Frequency); 643 DDrPatch_MakeJump((void*)UUrMachineTime_Sixtieths, (void*)DDrMachineTime_Sixtieths); 644 644 } 645 645 646 646 // Cheats always enabled 647 647 if (patch_cheatsenabled) 648 DDrPatch_MakeJump( ONrPersist_GetWonGame,DDrPersist_GetWonGame);648 DDrPatch_MakeJump((void*)ONrPersist_GetWonGame, (void*)DDrPersist_GetWonGame); 649 649 650 650 // Windowed mode 651 651 if (patch_usedaodangl) 652 652 { 653 DDrPatch_NOOP((char*)0x004032B7, 6);654 DDrPatch_MakeCall((char*)0x004032B7,LIiP_SetCursorPosHook);655 656 DDrPatch_NOOP((char*)0x00403349, 6);657 DDrPatch_MakeCall((char*)0x00403349,LIiP_SetCursorPosHook);658 DDrPatch_MakeJump( ONrPlatform_Initialize,DDrPlatform_Initialize);659 DDrPatch_MakeJump( gl_platform_initialize,daodangl_platform_initialize);653 DDrPatch_NOOP((char*)(OniExe + 0x000032B7), 6); 654 DDrPatch_MakeCall((void*)(OniExe + 0x000032B7), (void*)LIiP_SetCursorPosHook); 655 656 DDrPatch_NOOP((char*)(OniExe + 0x00003349), 6); 657 DDrPatch_MakeCall((void*)(OniExe + 0x00003349), (void*)LIiP_SetCursorPosHook); 658 DDrPatch_MakeJump((void*)ONrPlatform_Initialize, (void*)DDrPlatform_Initialize); 659 DDrPatch_MakeJump((void*)gl_platform_initialize, (void*)daodangl_platform_initialize); 660 660 } 661 661 // Hacked windowed mode (for when daodangl isn't working properly) … … 664 664 665 665 if (patch_daodaninit) 666 DDrPatch_MakeCall( OniExe + 0x000d345a,DDrGame_Init);666 DDrPatch_MakeCall((void*)(OniExe + 0x000d345a), (void*)DDrGame_Init); 667 667 668 668 // Patches for existing BSL functions … … 672 672 if (patch_cheater) 673 673 { 674 DDrPatch_MakeCall( OniExe + 0x000f618f,DDrCheater);675 DDrPatch_Int16( OniExe + 0x000deb45, 0x5590);674 DDrPatch_MakeCall((void*)(OniExe + 0x000f618f), (void*)DDrCheater); 675 DDrPatch_Int16((short*)(OniExe + 0x000deb45), 0x5590); 676 676 #if 1 677 DDrPatch_MakeCall( OniExe + 0x000deb47,FallingFrames);677 DDrPatch_MakeCall((void*)(OniExe + 0x000deb47), (void*)FallingFrames); 678 678 #endif 679 DDrPatch_MakeJump( OniExe + 0x0010f021,DDrCheater_LevelLoad);680 } 681 682 //DDrPatch_MakeJump( 0x004378c0,DDrException);683 DDrPatch_MakeJump( 0x004245A0,DDrPrintWarning);679 DDrPatch_MakeJump((void*)(OniExe + 0x0010f021), (void*)DDrCheater_LevelLoad); 680 } 681 682 //DDrPatch_MakeJump((void*)(OniExe + 0x000378c0, (void*)DDrException); 683 DDrPatch_MakeJump((void*)(OniExe + 0x000245A0), (void*)DDrPrintWarning); 684 684 //init_daodan_gl(); 685 685 … … 718 718 719 719 if (*(uint32_t*)(OniExe + 0x0011acd0) == 0x09d36852) 720 DDrPatch_MakeCall( OniExe + 0x0010fb49,DDrMain);720 DDrPatch_MakeCall((void*)(OniExe + 0x0010fb49), (void*)DDrMain); 721 721 else 722 722 ExitProcess(0); -
Daodan/src/Daodan_BSL.c
r688 r689 367 367 return 0; 368 368 } 369 name = &ONgGameState->CharacterStorage[index].Name;369 name = (char*)(&ONgGameState->CharacterStorage[index].Name); 370 370 if (numargs == 2) { 371 371 strncpy(name, (char*)args[1].val.value_str32, 31); … … 620 620 char output[1024]; 621 621 char buffer[1024]; 622 int i;622 unsigned int i; 623 623 char* placeinoutput = output; 624 624 char* placeininput = args[0].val.value_str32; … … 884 884 if(!TSrTest){ 885 885 TMrInstance_GetDataPtr( 'TSFF', "Tahoma", &TSFFTahoma); 886 returnval = TSrContext_New( TSFFTahoma, 7, 1, 1, 0, &TSrTest);887 } 888 DDrPatch_MakeCall( 0x004FBCEA,DDrText_Hook);886 returnval = TSrContext_New( TSFFTahoma, 7, 1, 1, 0, &TSrTest); 887 } 888 DDrPatch_MakeCall((void*)0x004FBCEA, (void*)DDrText_Hook); 889 889 890 890 *dontuse2 = 1; … … 932 932 void SLrDaodan_Patch() 933 933 { 934 DDrPatch_Int32( OniExe + 0x000f3755, (int)cinematic_start_patch);935 } 934 DDrPatch_Int32((int*)(OniExe + 0x000f3755), (int)cinematic_start_patch); 935 } -
Daodan/src/Daodan_Cheater.c
r685 r689 15 15 }; 16 16 static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}}; 17 #define INFINITY (INFINITY_HACK.Value)17 #define DD_INFINITY (INFINITY_HACK.Value) 18 18 19 19 oniCheatCode DDr_CheatTable[] = { … … 50 50 { "testcheat", "Testing...", "", cheat_testcheat }, 51 51 { "tellmetheversion", "Daodan v."DAODAN_VERSION_STRING"", "", cheat_tellmetheversion }, 52 {0 }52 {0, 0, 0, 0} 53 53 }; 54 54 … … 150 150 return 0; 151 151 } 152 else if ( player->ONCC->JetpackTimer == 0xFFFF)152 else if ((unsigned short)player->ONCC->JetpackTimer == 0xFFFF) 153 153 { 154 154 player->ONCC->JumpAcceleration = kangaroo_jp; 155 155 player->ONCC->JetpackTimer = kangaroo_h; 156 player->ONCC->MaxFallingHeightWithoutDamage = INFINITY;157 player->ONCC->MaxFallingHeightWithDamage = INFINITY;156 player->ONCC->MaxFallingHeightWithoutDamage = DD_INFINITY; 157 player->ONCC->MaxFallingHeightWithDamage = DD_INFINITY; 158 158 return 1; 159 159 } … … 166 166 player->ONCC->JumpAcceleration = kangaroo_jp; 167 167 player->ONCC->JetpackTimer = kangaroo_h; 168 player->ONCC->MaxFallingHeightWithoutDamage = INFINITY;169 player->ONCC->MaxFallingHeightWithDamage = INFINITY;168 player->ONCC->MaxFallingHeightWithoutDamage = DD_INFINITY; 169 player->ONCC->MaxFallingHeightWithDamage = DD_INFINITY; 170 170 return 1; 171 171 } … … 177 177 { 178 178 inc_fallingframes = true; 179 if ( player->ONCC->JetpackTimer == 0xFFFF)179 if ((unsigned short)player->ONCC->JetpackTimer == 0xFFFF) 180 180 { 181 181 player->ONCC->JumpAcceleration = cheat_oldjet_accel; -
Daodan/src/Daodan_Console.c
r677 r689 49 49 {'e', 0, 0xFF505050}, //darkgrey 50 50 {'f', 0, 0xFFAAAAAA}, //grey 51 {0 } //POWER RANGERS GO!51 {0, 0, 0} //POWER RANGERS GO! 52 52 }; 53 53 -
Daodan/src/Daodan_Patch.c
r677 r689 10 10 if (VirtualProtect(from, 5, PAGE_EXECUTE_READWRITE, &oldp)) 11 11 { 12 *(( char*)from) = 0xe9; // jmp rel3212 *((unsigned char*)from) = 0xe9; // jmp rel32 13 13 from = (char*)from + 1; 14 14 *(int*)from = (unsigned int)to - (unsigned int)from - 4; … … 26 26 if (VirtualProtect(from, 5, PAGE_EXECUTE_READWRITE, &oldp)) 27 27 { 28 *(( char*)from) = 0xe8; // call rel3228 *((unsigned char*)from) = 0xe8; // call rel32 29 29 from = (char*)from + 1; 30 30 *(int*)from = (unsigned int)to - (unsigned int)from - 4; … … 36 36 } 37 37 38 bool DDrPatch_String(char* dest, const char* string, int length)38 bool DDrPatch_String(char* dest, const unsigned char* string, int length) 39 39 { 40 40 DWORD oldp; … … 50 50 } 51 51 52 bool DDrPatch_Byte(char* dest, char value)52 bool DDrPatch_Byte(char* dest, unsigned char value) 53 53 { 54 54 DWORD oldp; … … 64 64 } 65 65 66 bool DDrPatch_Int32(int* dest, int value)66 bool DDrPatch_Int32(int* dest, unsigned int value) 67 67 { 68 68 DWORD oldp; … … 78 78 } 79 79 80 bool DDrPatch_Int16(short* dest, short value)80 bool DDrPatch_Int16(short* dest, unsigned short value) 81 81 { 82 82 DWORD oldp; -
Daodan/src/Daodan_Patch.h
r677 r689 11 11 bool DDrPatch_MakeJump(void* from, void* to); 12 12 bool DDrPatch_MakeCall(void* from, void* to); 13 bool DDrPatch_String(char* dest, const char* string, int length);14 bool DDrPatch_Byte(char* dest, char value);15 bool DDrPatch_Int32(int* dest, int value);16 bool DDrPatch_Int16(short* dest, short value);13 bool DDrPatch_String(char* dest, const unsigned char* string, int length); 14 bool DDrPatch_Byte(char* dest, unsigned char value); 15 bool DDrPatch_Int32(int* dest, unsigned int value); 16 bool DDrPatch_Int16(short* dest, unsigned short value); 17 17 bool DDrPatch__strdup(int* dest, const char* value); 18 18 bool DDrPatch_NOOP(char* dest, unsigned int length); -
Daodan/src/Daodan_WindowHack.c
r677 r689 8 8 #include "oni_gl.h" 9 9 10 #define CS_DROPSHADOW 0x2000010 #define DD_CS_DROPSHADOW 0x20000 11 11 12 12 volatile HWND onihwnd, boxhwnd = NULL; … … 65 65 66 66 wc.cbSize = sizeof(WNDCLASSEX); 67 wc.style = (opt_border ? 0 : (opt_shadow ? CS_DROPSHADOW : 0));67 wc.style = (opt_border ? 0 : (opt_shadow ? DD_CS_DROPSHADOW : 0)); 68 68 wc.lpfnWndProc = DDrHack_WndProc; 69 69 wc.cbClsExtra = 0; … … 161 161 { 162 162 DDrPatch_NOOP((char*)0x0050F764, 6); 163 DDrPatch_MakeCall((char*)0x0050F764, ONrPI_CreateWindowExHook);163 DDrPatch_MakeCall((char*)0x0050F764, (void*)ONrPI_CreateWindowExHook); 164 164 165 165 DDrPatch_NOOP((char*)0x00407E9F, 6); 166 DDrPatch_MakeCall((char*)0x00407E9F, glpi_SetWindowPosHook);166 DDrPatch_MakeCall((char*)0x00407E9F, (void*)glpi_SetWindowPosHook); 167 167 168 168 DDrPatch_NOOP((char*)0x004032CC, 6); 169 DDrPatch_MakeCall((char*)0x004032CC, LIiP_GetCursorPosHook);169 DDrPatch_MakeCall((char*)0x004032CC, (void*)LIiP_GetCursorPosHook); 170 170 171 171 DDrPatch_NOOP((char*)0x00402CC2, 6); 172 DDrPatch_MakeCall((char*)0x00402CC2, LIiP_GetCursorPosHook);172 DDrPatch_MakeCall((char*)0x00402CC2, (void*)LIiP_GetCursorPosHook); 173 173 174 174 DDrPatch_NOOP((char*)0x004032B7, 6); 175 DDrPatch_MakeCall((char*)0x004032B7, LIiP_SetCursorPosHook);175 DDrPatch_MakeCall((char*)0x004032B7, (void*)LIiP_SetCursorPosHook); 176 176 177 177 DDrPatch_NOOP((char*)0x00403349, 6); 178 DDrPatch_MakeCall((char*)0x00403349, LIiP_SetCursorPosHook);178 DDrPatch_MakeCall((char*)0x00403349, (void*)LIiP_SetCursorPosHook); 179 179 } -
Daodan/src/daodan_gl.c
r677 r689 183 183 gl_eng->DisplayMode.Width = cur_devmode.dmPelsWidth; 184 184 gl_eng->DisplayMode.Height = cur_devmode.dmPelsHeight; 185 if (cur_devmode.dmBitsPerPel > depth)185 if (cur_devmode.dmBitsPerPel > (unsigned short)depth) 186 186 gl_eng->DisplayMode.Depth = cur_devmode.dmBitsPerPel; 187 187 } … … 189 189 { 190 190 update_cdmode(); 191 if (cur_devmode.dmBitsPerPel > depth)191 if (cur_devmode.dmBitsPerPel > (unsigned short)depth) 192 192 gl_eng->DisplayMode.Depth = cur_devmode.dmBitsPerPel; 193 193 } -
Daodan/src/daodan_gl.h
r677 r689 15 15 void daodan_set_gamma(float gamma); 16 16 int ONICALL daodangl_platform_initialize(); 17 daodan_init_msaa();18 17 #endif
Note:
See TracChangeset
for help on using the changeset viewer.