Changeset 455 for Daodan/src
- Timestamp:
- Aug 10, 2009, 1:46:16 PM (15 years ago)
- Location:
- Daodan/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan.c
r452 r455 436 436 437 437 if (patch_cheater) 438 { 438 439 DDrPatch_MakeCall(OniExe + 0x000f618f, DDrCheater); 440 DDrPatch_Int16(OniExe + 0x000deb45, 0x5590); 441 DDrPatch_MakeCall(OniExe + 0x000deb47, FallingFrames); 442 DDrPatch_MakeJump(OniExe + 0x0010f021, DDrCheater_LevelLoad); 443 } 439 444 440 445 init_daodan_gl(); -
Daodan/src/Daodan_Cheater.c
r454 r455 1 1 #include <string.h> 2 #include <stdbool.h> 2 3 3 4 #include "Oni.h" … … 71 72 #define ONCC_bodysize_max (0x00000C8C) /* float */ 72 73 74 #define kangaroo_h (60) 75 #define kangaroo_jp (0.06) 76 #define marypoppins_jp (0.14) 77 73 78 uint16_t cheat_oldshield = 0; 74 79 int32_t cheat_oldhealth = 0; 75 80 int32_t cheat_oldmaxhealth = 0; 81 float cheat_oldjet_accel = 0.03f; 82 uint16_t cheat_oldjet_timer = 20; 83 float cheat_oldheight1 = 45; 84 float cheat_oldheight2 = 135; 85 bool inc_fallingframes = true; 76 86 77 87 uint8_t ONICALL DDrCheater(uint32_t cheat) … … 107 117 cheat_oldshield = *(unsigned short*)(player + CHR_shield); 108 118 *(unsigned short*)(player + CHR_shield) = 100; 119 return 1; 120 } 121 } 122 case cheat_kangaroo: 123 { 124 char* player = *((char**)(ONgGameState + GSA_player)); 125 char* oncc = *(char**)(player + CHR_oncc); 126 if (!inc_fallingframes) 127 inc_fallingframes = true; 128 if (*(unsigned int*)(oncc + ONCC_jet_timer) == kangaroo_h) 129 { 130 *(float*)(oncc + ONCC_jet_accel) = cheat_oldjet_accel; 131 *(unsigned short*)(oncc + ONCC_jet_timer) = cheat_oldjet_timer; 132 *(float*)(oncc + ONCC_height1) = cheat_oldheight1; 133 *(float*)(oncc + ONCC_height2) = cheat_oldheight2; 134 return 0; 135 } 136 else if (*(unsigned int*)(oncc + ONCC_jet_timer) == 0xFFFF) 137 { 138 *(float*)(oncc + ONCC_jet_accel) = kangaroo_jp; 139 *(unsigned short*)(oncc + ONCC_jet_timer) = kangaroo_h; 140 *(float*)(oncc + ONCC_height1) = 0x7f800000; 141 *(float*)(oncc + ONCC_height2) = 0x7f800000; 142 return 1; 143 } 144 else 145 { 146 cheat_oldjet_accel = *(float*)(oncc + ONCC_jet_accel); 147 cheat_oldjet_timer = *(unsigned short*)(oncc + ONCC_jet_timer); 148 cheat_oldheight1 = *(float*)(oncc + ONCC_height1); 149 cheat_oldheight2 = *(float*)(oncc + ONCC_height2); 150 *(float*)(oncc + ONCC_jet_accel) = kangaroo_jp; 151 *(unsigned short*)(oncc + ONCC_jet_timer) = kangaroo_h; 152 *(float*)(oncc + ONCC_height1) = 0x7f800000; 153 *(float*)(oncc + ONCC_height2) = 0x7f800000; 154 return 1; 155 } 156 } 157 case cheat_marypoppins: 158 { 159 char* player = *((char**)(ONgGameState + GSA_player)); 160 char* oncc = *(char**)(player + CHR_oncc); 161 if (!inc_fallingframes) 162 { 163 inc_fallingframes = true; 164 if (*(unsigned int*)(oncc + ONCC_jet_timer) == 0xFFFF) 165 { 166 *(float*)(oncc + ONCC_jet_accel) = cheat_oldjet_accel; 167 *(unsigned short*)(oncc + ONCC_jet_timer) = cheat_oldjet_timer; 168 *(float*)(oncc + ONCC_height1) = cheat_oldheight1; 169 *(float*)(oncc + ONCC_height2) = cheat_oldheight2; 170 } 171 return 0; 172 } 173 else if (*(unsigned int*)(oncc + ONCC_jet_timer) == kangaroo_h) 174 { 175 *(float*)(oncc + ONCC_jet_accel) = marypoppins_jp; 176 *(unsigned short*)(oncc + ONCC_jet_timer) = 0xFFFF; 177 *(float*)(oncc + ONCC_height1) = 0x7f800000; 178 *(float*)(oncc + ONCC_height2) = 0x7f800000; 179 inc_fallingframes = false; 180 return 1; 181 } 182 else 183 { 184 cheat_oldjet_accel = *(float*)(oncc + ONCC_jet_accel); 185 cheat_oldjet_timer = *(unsigned short*)(oncc + ONCC_jet_timer); 186 cheat_oldheight1 = *(float*)(oncc + ONCC_height1); 187 cheat_oldheight2 = *(float*)(oncc + ONCC_height2); 188 *(float*)(oncc + ONCC_jet_accel) = marypoppins_jp; 189 *(unsigned short*)(oncc + ONCC_jet_timer) = 0xFFFF; 190 *(float*)(oncc + ONCC_height1) = 0x7f800000; 191 *(float*)(oncc + ONCC_height2) = 0x7f800000; 192 inc_fallingframes = false; 109 193 return 1; 110 194 } … … 157 241 } 158 242 } 243 244 void ONICALL DDrCheater_LevelLoad() 245 { 246 inc_fallingframes = true; 247 } 248 249 __stdcall void FallingFrames(void* Ebp) 250 { 251 if (inc_fallingframes) 252 *((unsigned int*)(Ebp + 0xf6)) = *((unsigned int*)(Ebp + 0xf6)) + 1; 253 } -
Daodan/src/Daodan_Cheater.h
r453 r455 47 47 48 48 uint8_t ONICALL DDrCheater(uint32_t cheat); 49 void __stdcall FallingFrames(void* Ebp); 50 void ONICALL DDrCheater_LevelLoad(); 49 51 50 52 #endif
Note:
See TracChangeset
for help on using the changeset viewer.