PatchApplier600.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. #pragma once
  2. #include <vector>
  3. #include "PatchApplier.h"
  4. #include "framework.h"
  5. class PatchApplier600 : public PatchApplier {
  6. virtual void ApplyPatches() {
  7. const struct { void* Address; std::vector<uint8_t> Data; } patches_600[] =
  8. {
  9. // Always return true for the SelCredit enter SelPv check
  10. { (void*)0x000000014037A560, { 0xB0, 0x01, 0xC3, 0x90, 0x90, 0x90 } },
  11. // Just completely ignore all SYSTEM_STARTUP errors
  12. { (void*)0x00000001403DC590, { 0xC3 } },
  13. // Always exit TASK_MODE_APP_ERROR on the first frame
  14. { (void*)0x00000001403DE8B7, { 0x90, 0x90 } },
  15. { (void*)0x00000001403DE8D3, { 0x89, 0xD1, 0x90 } },
  16. // Ignore the EngineClear variable to clear the framebuffer at all resolutions
  17. { (void*)0x00000001404E7470, { 0x90, 0x90 } },
  18. { (void*)0x00000001404E7505, { 0x90, 0x90 } },
  19. // Write ram files to the current directory instead of Y : / SBZV / ram
  20. { (void*)0x0000000140648AE9, { 0xE9, 0xD8, 0x00 } },
  21. // Change mdata path from "C:/Mount/Option" to "mdata/"
  22. { (void*)0x0000000140A51058, { 0x6D, 0x64, 0x61, 0x74, 0x61, 0x2F, 0x00 } },
  23. { (void*)0x0000000140648A8E, { 0x06 } },
  24. // Skip parts of the network check state
  25. { (void*)0x000000014064D391, { 0xE9, 0x22, 0x03, 0x00 } },
  26. // Set the initial DHCP WAIT timer value to 0
  27. { (void*)0x000000014064E0C7, { 0x00, 0x00 } },
  28. // Ignore SYSTEM_STARTUP Location Server checks
  29. { (void*)0x000000014064EE82, { 0x90, 0x90 } },
  30. // Toon Shader Fix by lybxlpsv
  31. { (void*)0x00000001404E813F, { 0x90 } },
  32. { (void*)0x00000001404E8140, { 0x90 } },
  33. // Toon Shader Outline Fix by lybxlpsv
  34. { (void*)0x000000014061C6B2, { 0x01 } },
  35. // Skip unnecessary checks
  36. { (void*)0x0000000140207FB0, { 0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3 } },
  37. { (void*)0x000000014064A400, { 0xB8, 0x01, 0x00, 0x00, 0x00, 0xC3 } },
  38. // Disables call to glutFitWindowSizeToDesktop, prevents window automatic resize
  39. { (void*)0x000000014018CE06, { 0x90, 0x90, 0x90, 0x90, 0x90 } },
  40. // Allow modifier mode selection (by Team Shimapan)
  41. { (void*)0x00000001405A7C03, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 } },
  42. { (void*)0x00000001405A6B45, { 0x90, 0x90 } },
  43. // allow modifier modes to work without use_card
  44. { (void*)0x00000001405A7B9A,{ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 } },
  45. { (void*)0x000000014012F2CA,{ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 } },
  46. // enable module selector without use_card
  47. // { (void*)0x00000001405C513B,{ 0x01 } }, // no
  48. // Force Hide IDs
  49. { (void*)0x000000014096D840, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
  50. { (void*)0x000000014096D850, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
  51. // fix TouchReaction
  52. // get some more space by optimizing this code for size
  53. /*{ (void*)0x000000014067D1F2,{ 0x7E } }, // MOVQ XMM0,qword ptr [0x168 + RSP] (change to MOVQ)
  54. { (void*)(0x000000014067D1F2 + 0x7),{ 0x66, 0x0F, 0xD6, 0x44, 0x24, 0x6C } }, // MOVQ qword ptr [RSP + 0x6c],XMM0
  55. { (void*)(0x000000014067D1F2 + 0xD),{ 0xC7, 0x44, 0x24, 0x74, 0x00, 0x00, 0x00, 0x00 } }, // MOV dword ptr [RSP + 0x74],0x0
  56. { (void*)(0x000000014067D1F2 + 0x15),{ 0xEB, 0x0E } }, // JMP 0x1406a2007 (to rest of function as usual) // unsure
  57. // add new code
  58. { (void*)(0x000000014067D1F2 + 0x17),{ 0x66, 0x48, 0x0F, 0x6E, 0xC2 } }, // MOVQ XMM0,RDX (load touch pos)
  59. { (void*)(0x000000014067D1F2 + 0x1C),{ 0xEB, 0x5D } }, // JMP 0x1406a205d // unsure
  60. { (void*)(0x000000014067D1F2 + 0x7B),{ 0x0F, 0x2A, 0x0D, 0xB8, 0x6A, 0x31, 0x00 } }, // CVTPI2PS XMM1,qword ptr [0x1409b8b1c] (load 1280x720) // unsuew
  61. { (void*)(0x000000014067D1F2 + 0x82),{ 0x0F, 0x12, 0x51, 0x1C } }, // MOVLPS XMM2,qword ptr [RCX + 0x1c] (load actual res)
  62. { (void*)(0x000000014067D1F2 + 0x86),{ 0xE9, 0x14, 0xFF, 0xFF, 0xFF } }, // JMP 0x1406a1f81 // unsure
  63. { (void*)(0x000000014067D1F2 - 0x61),{ 0x0F, 0x59, 0xC1 } }, // MULPS XMM0,XMM1
  64. { (void*)(0x000000014067D1F2 - 0x61),{ 0x0F, 0x5E, 0xC2 } }, // DIVPS XMM0,XMM2
  65. { (void*)(0x000000014067D1F2 - 0x5B),{ 0x66, 0x0F, 0xD6, 0x44, 0x24, 0x10 } }, // MOVQ qword ptr [RSP+0x10],XMM0
  66. { (void*)(0x000000014067D1F2 - 0x55),{ 0xEB, 0x06 } }, // JMP 0x1406a1f95 (back to original function) // unsure
  67. // jmp to new code
  68. { (void*)(0x000000014067D1F2 - 0x52),{ 0xEB, 0x67 } },*/ // JMP 0x1406a1ff9 // unsure
  69. };
  70. for (size_t i = 0; i < _countof(patches_600); i++)
  71. InjectCode(patches_600[i].Address, patches_600[i].Data);
  72. // The old stereo patch...
  73. // Use 2 channels instead of 4
  74. if (nStereo)
  75. {
  76. InjectCode((void*)0x0000000140A4A588, { 0x02 });
  77. printf("[Patches] Stereo patch enabled\n");
  78. }
  79. // Disable AA
  80. if (!nTAA)
  81. {
  82. // set TAA var (shouldn't be needed but whatever)
  83. //*(byte*)0x00000001411AB67C = 0; // no
  84. // make constructor/init not set TAA
  85. {DWORD oldProtect, bck;
  86. VirtualProtect((BYTE*)0x000000014049258D, 3, PAGE_EXECUTE_READWRITE, &oldProtect);
  87. *((byte*)0x000000014049258D + 0) = 0x90;
  88. *((byte*)0x000000014049258D + 1) = 0x90;
  89. *((byte*)0x000000014049258D + 2) = 0x90;
  90. VirtualProtect((BYTE*)0x000000014049258D, 3, oldProtect, &bck); }
  91. // not sure, but it's somewhere in TaskPvGame init
  92. // just make it set TAA to 0 instead of 1 to avoid possible issues
  93. {DWORD oldProtect, bck;
  94. VirtualProtect((BYTE*)0x00000001400FF48D, 1, PAGE_EXECUTE_READWRITE, &oldProtect);
  95. *((byte*)0x00000001400FF48D + 0) = 0x00;
  96. VirtualProtect((BYTE*)0x00000001400FF48D, 1, oldProtect, &bck); }
  97. // prevent re-enabling after taking photos
  98. {DWORD oldProtect, bck;
  99. VirtualProtect((BYTE*)0x0000000140476EC8, 1, PAGE_EXECUTE_READWRITE, &oldProtect);
  100. *((byte*)0x0000000140476EC8 + 0) = 0x00;
  101. VirtualProtect((BYTE*)0x0000000140476EC8, 1, oldProtect, &bck); }
  102. printf("[Patches] TAA disabled\n");
  103. }
  104. if (!nMLAA)
  105. {
  106. // set MLAA var (shouldn't be needed but whatever)
  107. //*(byte*)0x00000001411AB680 = 0; // no
  108. // make constructor/init not set MLAA
  109. {DWORD oldProtect, bck;
  110. VirtualProtect((BYTE*)0x000000014049258A, 3, PAGE_EXECUTE_READWRITE, &oldProtect);
  111. *((byte*)0x000000014049258A + 0) = 0x90;
  112. *((byte*)0x000000014049258A + 1) = 0x90;
  113. *((byte*)0x000000014049258A + 2) = 0x90;
  114. VirtualProtect((BYTE*)0x000000014049258A, 3, oldProtect, &bck); }
  115. printf("[Patches] MLAA disabled\n");
  116. }
  117. // Replace the hardcoded videos with MP4s, if they exist
  118. if (nMP4Movies)
  119. {
  120. patchMovieExt("adv_cfm_cm", (void*)0x0000000140989ED5);
  121. patchMovieExt("adv_sega_cm", (void*)0x0000000140989EF6);
  122. patchMovieExt("diva_adv02", (void*)0x00000001409C537D);
  123. patchMovieExt("diva_adv", (void*)0x00000001409C53AB);
  124. }
  125. // Hide "FREE PLAY"
  126. if (nHideFreeplay)
  127. {
  128. InjectCode((void*)0x0000000140388A5B, { 0x06, 0xB6 });
  129. printf("[Patches] Hide FREE PLAY/CREDIT(S) enabled\n");
  130. }
  131. // Enable "FREE PLAY" mode
  132. if (nFreeplay || nHideFreeplay)
  133. {
  134. InjectCode((void*)0x00000001403A1B1A, { 0x75 });
  135. printf("[Patches] Show FREE PLAY instead of CREDIT(S)\n");
  136. if (nPDLoaderText && !nHideFreeplay)
  137. {
  138. InjectCode((void*)0x00000001409BC188, { 0x50, 0x44, 0x20, 0x4C, 0x6F, 0x61, 0x64, 0x65, 0x72, 0x20, 0x00 });
  139. printf("[Patches] Show PD Loader text\n");
  140. }
  141. }
  142. // Use GLUT_CURSOR_RIGHT_ARROW instead of GLUT_CURSOR_NONE
  143. if (nCursor)
  144. {
  145. /*InjectCode((void*)0x000000014018B44A, { 0x00 });
  146. InjectCode((void*)0x00000001402E7FE5, { 0xeb }); // Disable debug cursor // unsure
  147. printf("[Patches] Cursor enabled\n");*/
  148. }
  149. // Override status icon states to be invalid (hides them)
  150. if (nStatusIcons > 0)
  151. {
  152. std::vector<uint8_t> cardIcon = { 0xFD, 0x0A };
  153. std::vector<uint8_t> networkIcon = { 0x9E, 0x1E };
  154. if (nStatusIcons == 2) // 2 for error icons
  155. {
  156. cardIcon = { 0xFA, 0x0A };
  157. networkIcon = { 0x9F, 0x1E };
  158. printf("[Patches] Status icons set to error state\n");
  159. }
  160. else if (nStatusIcons == 3) // 3 for OK icons
  161. {
  162. cardIcon = { 0xFC, 0x0A };
  163. networkIcon = { 0xA0, 0x1E };
  164. printf("[Patches] Status icons set to OK state\n");
  165. }
  166. else if (nStatusIcons == 4) // 4 for partial OK icons
  167. {
  168. cardIcon = { 0xFB, 0x0A };
  169. networkIcon = { 0xA1, 0x1E };
  170. printf("[Patches] Status icons set to partial OK state\n");
  171. }
  172. else // 1 or invalid for hidden
  173. {
  174. cardIcon = { 0xFD, 0x0A };
  175. networkIcon = { 0x9E, 0x1E };
  176. printf("[Patches] Status icons hidden\n");
  177. }
  178. // card icon
  179. InjectCode((void*)0x00000001403A0C9E, cardIcon); // error state
  180. InjectCode((void*)0x00000001403A0CA3, cardIcon); // OK state
  181. // network icon
  182. InjectCode((void*)0x00000001403A107B, networkIcon); // error state
  183. InjectCode((void*)0x00000001403A1085, networkIcon); // OK state
  184. InjectCode((void*)0x00000001403A109B, networkIcon); // partial state
  185. InjectCode((void*)0x00000001403A10D5, { 0x48, 0xE9 }); // never show the error code for partial connection
  186. // I was going to use this with a string, but the assignment wasn't behaving well and making separate prints was easier than figuring it out
  187. // printf("[Patches] Status icons %s\n", iconType);
  188. }
  189. // Removes PV watermark
  190. if (nHidePVWatermark)
  191. {
  192. InjectCode((void*)0x00000001409D9798, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
  193. printf("[Patches] PV watermark hidden\n");
  194. }
  195. // Disable the PV screen photo UI
  196. if (nNoPVUi)
  197. {
  198. InjectCode((void*)0x0000000140476DB1, { 0xEB, 0x6F }); // skip button panel image (JMP 0x14048FB02) // unsure
  199. // patch minimum PV UI state to 1 instead of 0
  200. // hook check for lyrics enabled (UI state < 2) to change UI state 0 into 1
  201. // dump new code in the skipped button panel condition
  202. InjectCode((void*)0x0000000140476DB3, { 0xC7, 0x83, 0x58, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }); // MOV dword ptr [0x158 + RBX],0x1
  203. InjectCode((void*)0x0000000140476DBD, { 0xC6, 0x80, 0x3A, 0xD1, 0x02, 0x00, 0x01 }); // MOV byte ptr [0x2d13a + RAX],0x1
  204. InjectCode((void*)0x0000000140476DC4, { 0xE9, 0x8B, 0xFB, 0xFF, 0xFF }); // JMP 0x14048F634 // unsure
  205. InjectCode((void*)0x000000014047694D, { 0xE9, 0x61, 0x04, 0x00, 0x00 }); // JMP 0x14048FA93 // unsure
  206. printf("[Patches] PV UI disabled\n");
  207. }
  208. // Don't show volume control
  209. if (nHideVolCtrl)
  210. {
  211. // skip SE button
  212. InjectCode((void*)0x000000014096CD28, { 0xC0, 0xD3 });
  213. // skip volume sliders button
  214. InjectCode((void*)0x0000000140A4A3D8, { 0xE0, 0x50 });
  215. printf("[Patches] Volume control hidden\n");
  216. }
  217. // Skip loading (and therefore displaying) song lyrics
  218. if (nNoLyrics)
  219. {
  220. InjectCode((void*)0x00000001404CE362, { 0x00, 0x00 });
  221. InjectCode((void*)0x00000001404CE29E, { 0x48, 0xE9 }); // ensure first iteration doesn't run // unsure
  222. printf("[Patches] Lyrics disabled\n");
  223. }
  224. // Skip loading (and therefore displaying) song movies
  225. if (nNoMovies)
  226. {
  227. InjectCode((void*)0x00000001404D1C6B, { 0x48, 0xE9 }); // unsure
  228. InjectCode((void*)0x00000001404D1B61, { 0x48, 0xE9 }); // unsure
  229. printf("[Patches] Movies disabled\n");
  230. }
  231. // Disable error banner
  232. if (nNoError)
  233. {
  234. // Disable Errors Banner
  235. InjectCode((void*)0x00000001403A0DCB, { 0x90, 0x90 });
  236. printf("[Patches] Errors Banner disabled\n");
  237. }
  238. // Disable timer
  239. if (nNoTimer)
  240. {
  241. // Freeze mode selection timer
  242. InjectCode((void*)0x00000001405456DE, { 0x90, 0x90, 0x90 });
  243. // Freeze PV selection timer
  244. InjectCode((void*)0x000000014059B21F, { 0x90, 0x90, 0x90, 0x90 });
  245. }
  246. // Disable timer sprite
  247. if (nNoTimerSprite)
  248. {
  249. InjectCode((void*)0x00000001409883A8, { 0x00 }); // time_loop
  250. InjectCode((void*)0x0000000140A01E20, { 0x00 }); // time_in
  251. InjectCode((void*)0x0000000140A01E28, { 0x00 }); // time_out
  252. }
  253. // Enhanced Stage Manager
  254. if (nEStageManager > 0)
  255. {
  256. // Replace the function that provides the number of stages and compact some of it
  257. InjectCode((void*)0x0000000140371E50, { 0x48, 0x8B, 0x88, 0x40, 0x01, 0x00, 0x00, 0x48, 0x89, 0x4C, 0x24, 0x20, 0x48, 0x8B, 0xD0, 0x48, 0x8B, 0x88, 0x48, 0x01, 0x00, 0x00, 0x48, 0x89, 0x4C, 0x24, 0x28, 0x8B, 0x88, 0x50, 0x01, 0x00, 0x00, 0x89, 0x4C, 0x24, 0x30, 0x8B, 0x88, 0x54, 0x01, 0x00, 0x00, 0x8B, 0x80, 0x58, 0x01, 0x00, 0x00, 0x89, 0x44, 0x24, 0x38, 0x8B, 0x82, 0x5C, 0x01, 0x00, 0x00, 0x89, 0x4C, 0x24, 0x34, 0x89, 0x44, 0x24, 0x3C, 0x48, 0x8B, 0x82, 0x60, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x40, 0x48, 0x8B, 0x82, 0x68, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x48, 0x48, 0x8B, 0x82, 0x70, 0x01, 0x00, 0x00, 0x48, 0x89, 0x44, 0x24, 0x50, 0x8B, 0x82, 0x78, 0x01, 0x00, 0x00, 0x89, 0x44, 0x24, 0x58, 0x84, 0xC0, 0x74, 0x2A, 0x48, 0x8B, 0x44, 0x24, 0x38, 0x48, 0xC1, 0xE8, 0x20, 0x85, 0xC0, 0x75, 0x1D, 0xE8, 0xD9, 0xD9, 0xE5, 0xFF, 0x48, 0x85, 0xC0, 0x74, 0x13, 0x48, 0x8D, 0x48, 0x10, 0xE8, 0xFB, 0xD3, 0xE5, 0xFF, 0xB9, 0x03, 0x00, 0x00, 0x00, 0x85, 0xC0, 0x0F, 0x45, 0xD9, 0x8B, 0x1D, 0x1B, 0x0C, 0x00, 0x00, 0x83, 0x3D, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x74, 0x06, 0x8B, 0x1D, 0x10, 0x0C, 0x00, 0x00, 0x8B, 0xC3, 0x48, 0x83, 0xC4, 0x60, 0x5B, 0xC3, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC }); // unsure
  258. // Jump to another section by addding some code to replace the values (Jump 1)
  259. InjectCode((void*)(0x0000000140371E50 + 0x104), { 0xE9, 0x87, 0x0B, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC }); // unsure
  260. // Jump to another section by addding some code to replace the values (Replace 1/2) while some reserving space for values
  261. InjectCode((void*)(0x0000000140371E50 + 0xC50), { 0xFF, 0x05, 0x76, 0x00, 0x00, 0x00, 0x8B, 0x0D, 0x70, 0x00, 0x00, 0x00, 0xBA, 0x02, 0x00, 0x00, 0x00, 0x83, 0x3D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x74, 0x02, 0xFF, 0xC2, 0x39, 0xD1, 0x0F, 0x4D, 0xCA, 0x89, 0x48, 0x08, 0xB9, 0x0E, 0x00, 0x00, 0x00, 0xE8, 0x92, 0x98, 0xE0, 0xFF, 0xB0, 0x01, 0x48, 0x83, 0xC4, 0x28, 0xC3, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x44, 0x89, 0x61, 0x08, 0x44, 0x88, 0x61, 0x0C, 0x4C, 0x89, 0x61, 0x10, 0x44, 0x89, 0x25, 0x29, 0x00, 0x00, 0x00, 0xE9, 0x68, 0xF4, 0xFF, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); // unsure
  262. // Use the value from our own address instead of the original one
  263. InjectCode((void*)0x00000001403DDABF, { 0x48, 0x8D, 0x05, 0x4A, 0x18, 0xDA, 0x00, 0x8B, 0x1D, 0x00, 0x56 }); // unsure
  264. // Jump to another section by addding some code to replace the values (Jump 2)
  265. InjectCode((void*)(0x00000001403F65AF + 0x89), { 0xE9, 0x03, 0x55, 0xF9, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC }); // unsure
  266. DWORD StageCountProtect;
  267. VirtualProtect((int32_t*)0x140372B10, 0x10, PAGE_EXECUTE_READWRITE, &StageCountProtect); // unsure
  268. int* ESM = (int*)0x0000000140372B10; // unsure
  269. if (nEStageManagerEncore)
  270. ESM[1] = nEStageManager;
  271. else
  272. ESM[0] = nEStageManager;
  273. ESM[2] = nEStageManagerEncore;
  274. printf("[Patches] Enhanced Stage Manager enabled\n");
  275. }
  276. // OpenGL Patches
  277. if (nOGLPatchA)
  278. {
  279. // (call cs:glGetError) -> (xor eax, eax); (nop); (nop); (nop); (nop);
  280. InjectCode((void*)0x000000014067842D, { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 });
  281. }
  282. if (nOGLPatchB)
  283. {
  284. // (js loc_14069BC32) -> (nop)...
  285. InjectCode((void*)0x0000000140676D04, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 });
  286. }
  287. // Unlock PSEUDO modules (which will all default to Miku, unless we also patch them to match the first performer)
  288. if (nUnlockPseudo)
  289. {
  290. InjectCode((void*)0x00000001409E71C0, { 0x00 });
  291. InjectCode((void*)0x00000001409E71D0, { 0x00 });
  292. InjectCode((void*)0x00000001409E71E0, { 0x00 });
  293. InjectCode((void*)0x00000001409E71F0, { 0x00 });
  294. InjectCode((void*)0x00000001409E7200, { 0x00 });
  295. }
  296. // Enable card button by somewhatlurker (pretty much just eye candy for now)
  297. if (nCard)
  298. {
  299. InjectCode((void*)0x00000001405449EB, { 0x90, 0x90 });
  300. }
  301. // The original slider update needs to run for hardware sliders to work -- only patch it when using emulation
  302. if (!nHardwareSlider)
  303. {
  304. // Don't update the touch slider state so we can write our own
  305. InjectCode((void*)0x00000001405F0C5B, { 0x90, 0x90, 0x90, 0x8B, 0x42, 0xE0, 0x90, 0x90, 0x90 });
  306. }
  307. }
  308. };