drag&drop.bat 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. @ECHO off
  2. MODE 80,40
  3. CLS
  4. echo.
  5. echo ----- SMG2 Mod ISO Builder (v0.4)
  6. echo ----- By Humming Owl
  7. echo.
  8. :: ===============================
  9. :: Get to the path the BAT file is
  10. :: ===============================
  11. cd %~dp0
  12. :: ================
  13. :: mods data storage
  14. :: ================
  15. call .\tools\mods_data.bat
  16. :: =============================
  17. :: actions before starting patch
  18. :: =============================
  19. if exist ".\savefiles" (rmdir /s /q ".\savefiles")
  20. if exist ".\temp" (rmdir /s /q ".\temp")
  21. if not exist ".\mods" (mkdir ".\mods")
  22. for /d %%a in (".\mods\*") do rd "%%a" /q /s
  23. if exist ".\*.tmp" (del /S *.tmp >nul)
  24. :: ===================================================
  25. :: Key command to work with variables inside variables
  26. :: ===================================================
  27. SETLOCAL EnableDelayedExpansion
  28. :: =====
  29. :: Tools
  30. :: =====
  31. set WGET=tools\wget.exe
  32. set EXTRACT=tools\7z.exe
  33. set PATCH=tools\patch.exe
  34. set WIT=tools\wit.exe
  35. :: ==========
  36. :: check_file
  37. :: ==========
  38. if not "%~x1" == ".iso" (
  39. if not "%~x1" == ".wbfs" (
  40. echo.
  41. echo File dropped IS NOT ISO/WBFS.
  42. echo Verify file and try again.
  43. echo.
  44. echo Press any key to exit.
  45. echo.
  46. pause >nul
  47. exit
  48. )
  49. )
  50. %WIT% verify --test --quiet "%~f1"
  51. if %ERRORLEVEL% NEQ 0 (
  52. echo.
  53. echo File dropped is ISO/WBFS, but not a valid one.
  54. echo Verify file and try again.
  55. echo.
  56. echo Press any key to exit.
  57. echo.
  58. pause >nul
  59. exit
  60. )
  61. echo.
  62. echo File dropped IS a valid ISO/WBFS.
  63. FOR /F "tokens=*" %%g IN ('%WIT% ID6 "%~f1"') do (set og_gameid=%%g)
  64. if not "%og_gameid%" == "SB4E01" (
  65. if not "%og_gameid%" == "SB4P01" (
  66. if not "%og_gameid%" == "SB4J01" (
  67. if not "%og_gameid%" == "SB4K01" (
  68. if not "%og_gameid%" == "SB4W01" (
  69. echo But is not an original SMG2 file.
  70. echo Verify the file and try again.
  71. echo.
  72. echo Press any key to exit.
  73. echo.
  74. pause >nul
  75. exit
  76. )
  77. )
  78. )
  79. )
  80. )
  81. :: ============
  82. :: region check
  83. :: ============
  84. if "%og_gameid%" == "SB4E01" (set reg=e)
  85. if "%og_gameid%" == "SB4P01" (set reg=p)
  86. if "%og_gameid%" == "SB4J01" (set reg=j)
  87. if "%og_gameid%" == "SB4K01" (set reg=k)
  88. if "%og_gameid%" == "SB4W01" (set reg=w)
  89. :: ============
  90. echo And its an original SMG2 file.
  91. echo Ready to go.
  92. echo.
  93. echo Press any key if you are ready.
  94. echo.
  95. pause
  96. CLS
  97. :: ==================
  98. :: SMG2 Rom Hack List
  99. :: ==================
  100. echo.
  101. echo --- SMG2 Hacks list:
  102. echo.
  103. echo 1. Kaizo Mario Galaxy 2
  104. echo 2. Super Mario Galaxy 2: Cosmic Clones Challenge
  105. echo 3. Super Mario Galaxy 2: The New Green Stars
  106. echo 4. Super Mario Galaxy 2: The Kaizo Green Stars
  107. echo 5. Spinless Mario Galaxy 2
  108. echo 6. Super Mario Gravity (DEMO)
  109. echo 7. Super Mayro Galaxy
  110. echo 8. Super Mayro Galaxy Twoad
  111. echo 9. Super Mario Galaxy 2.5 (DEMO)
  112. echo 10. Outer Mario Galaxy
  113. echo 11. Super Mario Galaxy Deluxe
  114. echo 12. Super Mario Spectral (SMG2: BlueXD Edition new Demo - E/P/J/K/W)
  115. echo 13. Super Mario Galaxy 2: Daredevil Challenge
  116. echo 14. Neo Mario Galaxy (2020 Build - E/P/J)
  117. echo 15. Super Mario Galaxy 64: Holiday Special (E/P/J)
  118. echo 16. Super Mario Galaxy 2: Fog Edition
  119. echo 17. Super Mario Galaxy 2: The Green Star Festival
  120. echo 18. Super Mario Galaxy 2: Underwater Edition
  121. echo 19. Super Mario Galaxy 2: Master Mode
  122. echo 20. Super Mario Galaxy 2: The Lost Levels (v1.0)
  123. echo 21. Super Mario Starshine (DEMO - E/P/J)
  124. echo 22. Super Mario Galaxy 2: Cosmos Collapse (v1.03R - E/P/J/K/W)
  125. echo 23. Super Mario Galaxy 63 (v1.02 - 30 Star Demo - E/P)
  126. echo 24. Spring Mario Galaxy 2 (v1.0 - E/P/J)
  127. echo 25. Super Mario Galaxy 2: The Spacial Journey (v1.3 - E/P/J)
  128. echo 26. Super Mario Galaxy 2: The Green Star Festival 2 (v1.1 - E/P/J/K/W)
  129. echo 27. Neo Mario Galaxy: The New Green Stars (v1.0 - E/P/J)
  130. echo 28. Super Mario Galaxy 2: Collectors Anxiety (v1.42 - E/P/J - DEMO)
  131. echo 29. Super Mario 3D Galaxy (E/P/J)
  132. echo.
  133. set /P apply_mod=Select Mod number to apply to ISO/WBFS image:
  134. if %apply_mod%==1 (set mod=KMG2)
  135. if %apply_mod%==2 (set mod=SMG2CCC)
  136. if %apply_mod%==3 (set mod=SMG2TNGS)
  137. if %apply_mod%==4 (set mod=SMG2TKGS)
  138. if %apply_mod%==5 (set mod=SpinMG2)
  139. if %apply_mod%==6 (set mod=SMGRAV)
  140. if %apply_mod%==7 (set mod=SMAYG1)
  141. if %apply_mod%==8 (set mod=SMAYGT)
  142. if %apply_mod%==9 (set mod=SMG25D)
  143. if %apply_mod%==10 (set mod=OUTMG2)
  144. if %apply_mod%==11 (set mod=SMG2DX)
  145. if %apply_mod%==12 (set mod=SMG2BXDE)
  146. if %apply_mod%==13 (set mod=SMG2DC)
  147. if %apply_mod%==14 (set mod=NMG)
  148. if %apply_mod%==15 (set mod=SMG64HS)
  149. if %apply_mod%==16 (set mod=SMG2FE)
  150. if %apply_mod%==17 (set mod=SMG2TGSF)
  151. if %apply_mod%==18 (set mod=SMG2UE)
  152. if %apply_mod%==19 (set mod=SMG2MM)
  153. if %apply_mod%==20 (set mod=SMG2TLL)
  154. if %apply_mod%==21 (set mod=SMSS)
  155. if %apply_mod%==22 (set mod=SMG2CC)
  156. if %apply_mod%==23 (set mod=SMG63)
  157. if %apply_mod%==24 (set mod=SPRINGMG2)
  158. if %apply_mod%==25 (set mod=SMG2TSJ)
  159. if %apply_mod%==26 (set mod=SMG2TGSF2)
  160. if %apply_mod%==27 (set mod=NMGTNGS)
  161. if %apply_mod%==28 (set mod=SMG2CA)
  162. if %apply_mod%==29 (set mod=SMG3D)
  163. ::=====================
  164. :: Common build process
  165. ::=====================
  166. CLS
  167. echo.
  168. echo ----- !%mod%[0]! Mod ISO Builder
  169. echo ----- !%mod%[1]! !%mod%[2]!
  170. echo.
  171. set /P question1=Download Hack files (approx. size !%mod%[4]!)? (y/n):
  172. echo.
  173. if %question1%==y GOTO :down_hack
  174. if %question1%==n GOTO :question2
  175. :question2
  176. set /P question2=Already downloaded compressed hack file in the "mods" folder? (y/n):
  177. echo.
  178. if %question2%==y GOTO :confirm_file
  179. if %question2%==n GOTO :exit_1
  180. :exit_1
  181. echo Download Rom Hack files and try again.
  182. echo Terminating program...
  183. echo Press any key to close program.
  184. echo.
  185. pause >nul
  186. exit
  187. :down_hack
  188. echo Downloading Rom Hack files...
  189. echo.
  190. %WGET% -q --show-progress -t inf "https://archive.org/download/SMG_1-2_Rom_Hacks/!%mod%[3]!" -P mods >nul
  191. echo.
  192. :confirm_file
  193. if exist ".\mods\!%mod%[3]!" GOTO :extract_file
  194. echo Rom Hack file not found.
  195. echo Press any key to close program.
  196. echo.
  197. pause > nul
  198. exit
  199. :extract_file
  200. echo Rom Hack file found.
  201. echo Extracting file contents...
  202. :: =========================================================
  203. :: Win11 issue with double backslash extract path workaround
  204. :: =========================================================
  205. set "extractpath=.\mods\!%mod%[5]!"
  206. set "fixextractpath=%extractpath:\\=\%"
  207. :: =========================================================
  208. %EXTRACT% x ".\mods\!%mod%[3]!" -o"%fixextractpath%" >nul
  209. echo.
  210. :build_iso
  211. echo Building modded disc image...
  212. echo This will take a while.
  213. echo.
  214. echo Extracting image contents...
  215. %WIT% EXTRACT "%~f1" ".\temp" >nul
  216. :: =======================================
  217. :: Redirector to other mods unique options
  218. :: =======================================
  219. if %mod%==SMG2TSJ GOTO :SMG2TSJ_custom
  220. if %mod%==SMG2TGSF2 GOTO :SMG2TGSF2_custom
  221. :: ====================================
  222. echo Copying and replacing mod files...
  223. if exist ".\temp\DATA\" (xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\*" ".\temp\DATA\files\" /E /Y >nul)
  224. if not exist ".\temp\DATA\" (xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\*" ".\temp\files\" /E /Y >nul)
  225. :: ==================================
  226. :: Redirector to mod's unique options
  227. :: ==================================
  228. if %mod%==KMG2 GOTO :KMG2_custom
  229. if %mod%==SMG2TNGS GOTO :SMG2TNGS_custom
  230. if %mod%==SMG2TKGS GOTO :SMG2TKGS_custom
  231. if %mod%==NEOMG2 GOTO :NEOMG2_custom
  232. if %mod%==SMG2BE GOTO :SMG2BE_custom
  233. if %mod%==NMG GOTO :NMG_custom
  234. if %mod%==SMG64HS GOTO :SMG64HS_custom
  235. if %mod%==SMG2BXDE GOTO :SMG2BXDE_custom
  236. if %mod%==SMG2MM GOTO :SMG2MM_custom
  237. if %mod%==SMG2TLL GOTO :SMG2TLL_custom
  238. if %mod%==SMSS GOTO :SMSS_custom
  239. if %mod%==SMG2CC GOTO :SMG2CC_custom
  240. if %mod%==SMG63 GOTO :SMG63_custom
  241. if %mod%==NMGTNGS GOTO :NMGTNGS_custom
  242. if %mod%==SMG2CA GOTO :SMG2CA_custom
  243. if %mod%==SMG3D GOTO :SMG3D_custom
  244. :: ==================================
  245. :final_steps
  246. echo Assembling game image...
  247. %WIT% COPY ".\temp" ".\!%mod%[0]!.wbfs" >nul
  248. echo Removing temp folders...
  249. rmdir /s /q ".\temp"
  250. rmdir /s /q ".\mods\!%mod%[6]!"
  251. echo Editing game IDs...
  252. %WIT% EDIT --id "!%mod%[8]!" ".\!%mod%[0]!.wbfs" >nul
  253. %WIT% EDIT --tt-id "!%mod%[9]!" ".\!%mod%[0]!.wbfs" >nul
  254. %WIT% EDIT --name "!%mod%[1]!" ".\!%mod%[0]!.wbfs" >nul
  255. if exist ".\!%mod%[0]!.wbfs" GOTO :print-info
  256. if not exist ".\!%mod%[0]!.wbfs" GOTO :print-error
  257. :print-error
  258. echo.
  259. echo Error while modding the image.
  260. echo Please try again.
  261. echo Press any key to continue.
  262. echo.
  263. pause >nul
  264. exit
  265. :print-info
  266. echo.
  267. echo Disc image modded correctly.
  268. echo.
  269. echo Game ID: !%mod%[8]!
  270. echo TMD ID: !%mod%[9]!
  271. echo Game name: !%mod%[1]!
  272. echo.
  273. echo If you want to contribute (New Hack/Improve Tool)
  274. echo go to my GitHub repository and open an Issue.
  275. echo Have fun^!
  276. echo.
  277. echo Press any key to exit.
  278. echo.
  279. pause >nul
  280. exit
  281. :: ===============================
  282. :: Unique options/commands per mod
  283. :: ===============================
  284. :: ====
  285. :: KMG2
  286. :: ====
  287. :KMG2_custom
  288. echo.
  289. echo Detected Region: %reg%
  290. set /P luigi=Play with Luigi? (y/n):
  291. echo Applying hex patches...
  292. if %luigi%==y (set luigipatch=_Luigi.patch)
  293. if %luigi%==n (set luigipatch=.patch)
  294. if %reg%==e (set KMG2[8]=KG2E01)
  295. if %reg%==p (set KMG2[8]=KG2P01)
  296. if %reg%==j (set KMG2[8]=KG2J01)
  297. if %reg%==k (set KMG2[8]=KG2K01)
  298. if %reg%==w (set KMG2[8]=KG2W01)
  299. if exist ".\temp\DATA" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\%KMG2[8]%%luigipatch%" >nul)
  300. if not exist ".\temp\DATA" (%PATCH% ".\temp\sys\main.dol" < ".\patches\%KMG2[8]%%luigipatch%" >nul)
  301. echo.
  302. GOTO :final_steps
  303. :: ========
  304. :: SMG2TNGS
  305. :: ========
  306. :SMG2TNGS_custom
  307. echo.
  308. echo Detected Region: %reg%
  309. echo.
  310. echo Applying hex patches...
  311. if %reg%==e (set SMG2TNGS[8]=NGSE01)
  312. if %reg%==p (set SMG2TNGS[8]=NGSP01)
  313. if %reg%==j (set SMG2TNGS[8]=NGSJ01)
  314. if %reg%==k (set SMG2TNGS[8]=NGSK01)
  315. if %reg%==w (set SMG2TNGS[8]=NGSW01)
  316. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  317. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  318. echo.
  319. echo This hack works with a 120 star savefile and a txt file.
  320. echo The savefiles need to be applied manually.
  321. echo In the "instructions" folder read the "savefiles.txt"
  322. echo file to know how to apply the savefiles to the game.
  323. echo.
  324. echo Copying savefiles to "safefiles" folder...
  325. echo.
  326. xcopy ".\mods\SMG2 The New Green Stars\SMG2 The New Green Stars\SaveGame\SB4E01\*" ".\savefiles\" /E /Y >nul
  327. GOTO :final_steps
  328. :: ========
  329. :: SMG2TKGS
  330. :: ========
  331. :SMG2TKGS_custom
  332. echo.
  333. echo This hack works with a 120 stars savefile.
  334. echo The savefiles need to be applied manually.
  335. echo In the "instructions" folder read the "savefiles.txt"
  336. echo file to know how to apply them.
  337. echo.
  338. echo Copying savefiles to "safefiles" folder...
  339. echo.
  340. xcopy ".\mods\TKGS 1.1.0\SMG2 The Kaizo Green Stars\SaveGame\SB4E01\*" ".\savefiles\" /E /Y >nul
  341. GOTO :final_steps
  342. :: ===
  343. :: NMG
  344. :: ===
  345. :NMG_custom
  346. echo.
  347. echo Detected Region: %reg%
  348. set /P dd=Play in Daredevil mode? (y/n):
  349. echo Applying hex patches...
  350. if %dd%==y (set ddpatch=Daredevil.patch)
  351. if %dd%==n (set ddpatch=noDaredevil.patch)
  352. if %reg%==e (set NMG[8]=NMGE01)
  353. if %reg%==p (set NMG[8]=NMGP01)
  354. if %reg%==j (set NMG[8]=NMGJ01)
  355. if exist ".\temp\DATA" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\%NMG[8]%_%ddpatch%" >nul)
  356. if not exist ".\temp\DATA" (%PATCH% ".\temp\sys\main.dol" < ".\patches\%NMG[8]%_%ddpatch%" >nul)
  357. echo.
  358. GOTO :final_steps
  359. :: =======
  360. :: SMG64HS
  361. :: =======
  362. :SMG64HS_custom
  363. echo.
  364. echo Detected Region: %reg%
  365. echo Applying hex patches...
  366. if %reg%==e (set SMG64HS[8]=M64E01)
  367. if %reg%==p (set SMG64HS[8]=M64P01)
  368. if %reg%==j (set SMG64HS[8]=M64J01)
  369. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  370. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  371. echo.
  372. GOTO :final_steps
  373. :: ========
  374. :: SMG2BXDE
  375. :: ========
  376. :SMG2BXDE_custom
  377. echo.
  378. echo Detected Region: %reg%
  379. echo Applying hex patches...
  380. if %reg%==e (set SMG2BXDE[8]=BXDE01)
  381. if %reg%==p (set SMG2BXDE[8]=BXDP01)
  382. if %reg%==j (set SMG2BXDE[8]=BXDJ01)
  383. if %reg%==k (set SMG2BXDE[8]=BXDK01)
  384. if %reg%==w (set SMG2BXDE[8]=BXDW01)
  385. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  386. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  387. :: if exist ".\temp\DATA" (
  388. :: xcopy ".\mods\!%mod%[6]!\Regions\NTSC (USA)\*" ".\temp\DATA\files\" /E /Y >nul
  389. :: xcopy ".\mods\!%mod%[6]!\Regions\PAL (Europe)\*" ".\temp\DATA\files\" /E /Y >nul)
  390. :: if not exist ".\temp\DATA" (
  391. :: xcopy ".\mods\!%mod%[6]!\Regions\NTSC (USA)\*" ".\temp\files\" /E /Y >nul
  392. :: xcopy ".\mods\!%mod%[6]!\Regions\PAL (Europe)\*" ".\temp\files\" /E /Y >nul)
  393. echo.
  394. GOTO :final_steps
  395. :: ======
  396. :: SMG2MM
  397. :: ======
  398. :SMG2MM_custom
  399. echo.
  400. echo Detected Region: %reg%
  401. echo Applying hex patches...
  402. if %reg%==e (set SMG2MM[8]=SB4MME)
  403. if %reg%==p (set SMG2MM[8]=SB4MMP)
  404. if %reg%==j (set SMG2MM[8]=SB4MMJ)
  405. if %reg%==k (set SMG2MM[8]=SB4MMK)
  406. if %reg%==w (set SMG2MM[8]=SB4MMW)
  407. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  408. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  409. echo.
  410. GOTO :final_steps
  411. :: =======
  412. :: SMG2TLL
  413. :: =======
  414. :: SMG2TLL_custom (old)
  415. :: echo.
  416. :: echo Detected Region: %reg%
  417. :: set /P tlldd=Play in Daredevil mode? (y/n):
  418. :: set /P bluestar=Play with Blue Launch stars? (y/n):
  419. :: echo Applying hex patches...
  420. :: if %tlldd%==y (set ddpatch=Daredevil.patch)
  421. :: if %tlldd%==n (set ddpatch=noDaredevil.patch)
  422. :: if %tllreg%==e (set SMG2TLL[8]=TLLE01)
  423. :: if %tllreg%==p (set SMG2TLL[8]=TLLP01)
  424. :: if %tllreg%==j (set SMG2TLL[8]=TLLJ01)
  425. :: if %bluestar%==y (
  426. :: if exist ".\temp\DATA" (
  427. :: xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SystemData\SuperSpinDriver.arc" ".\temp\DATA\files\ObjectData\" /E /Y >nul
  428. :: xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SystemData\SpinDriver.arc" ".\temp\DATA\files\ObjectData\" /E /Y >nul
  429. :: xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SystemData\YellowChip.arc" ".\temp\DATA\files\ObjectData\" /E /Y >nul)
  430. :: if not exist ".\temp\DATA" (
  431. :: xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SystemData\SuperSpinDriver.arc" ".\temp\files\SystemData\" /E /Y >nul
  432. :: xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SystemData\SpinDriver.arc" ".\temp\files\ObjectData\" /E /Y >nul
  433. :: xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SystemData\YellowChip.arc" ".\temp\files\ObjectData\" /E /Y >nul)
  434. :: )
  435. :: if exist ".\temp\DATA" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\%SMG2TLL[8]%_%ddpatch%" >nul)
  436. :: if not exist ".\temp\DATA" (%PATCH% ".\temp\sys\main.dol" < ".\patches\%SMG2TLL[8]%_%ddpatch%" >nul)
  437. :: GOTO :final_steps
  438. :SMG2TLL_custom
  439. echo.
  440. echo Detected Region: %reg%
  441. echo Applying hex patches...
  442. if %reg%==e (set SMG2TLL[8]=TLLE01)
  443. if %reg%==p (set SMG2TLL[8]=TLLP01)
  444. if %reg%==j (set SMG2TLL[8]=TLLJ01)
  445. if %reg%==k (set SMG2TLL[8]=TLLK01)
  446. if %reg%==w (set SMG2TLL[8]=TLLW01)
  447. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  448. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  449. echo.
  450. GOTO :final_steps
  451. :: ====
  452. :: SMSS
  453. :: ====
  454. :SMSS_custom
  455. echo.
  456. echo Detected Region: %reg%
  457. echo Applying hex patches...
  458. if %reg%==e (set SMSS[8]=MSSE01)
  459. if %reg%==p (set SMSS[8]=MSSP01)
  460. if %reg%==j (set SMSS[8]=MSSJ01)
  461. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  462. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  463. echo.
  464. GOTO :final_steps
  465. :: ======
  466. :: SMG2CC
  467. :: ======
  468. :SMG2CC_custom
  469. echo.
  470. echo Detected Region: %reg%
  471. echo Applying hex patches...
  472. if %reg%==e (set SMG2CC[8]=MCCE01)
  473. if %reg%==p (set SMG2CC[8]=MCCP01)
  474. if %reg%==j (set SMG2CC[8]=MCCJ01)
  475. if %reg%==k (set SMG2CC[8]=MCCK01)
  476. if %reg%==w (set SMG2CC[8]=MCCW01)
  477. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  478. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  479. echo.
  480. GOTO :final_steps
  481. :: =====
  482. :: SMG63
  483. :: =====
  484. :SMG63_custom
  485. echo.
  486. echo Detected Region: %reg%
  487. echo Applying hex patches...
  488. if %reg%==e (set SMG63[8]=MG63E1)
  489. if %reg%==p (set SMG63[8]=MG63P1)
  490. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  491. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  492. echo.
  493. GOTO :final_steps
  494. :: =======
  495. :: SMG2TSJ
  496. :: =======
  497. :SMG2TSJ_custom
  498. echo.
  499. echo 1. Green Plains
  500. echo 2. Pull Path
  501. echo 3. Rocky Gardens
  502. echo 4. Nostalgic Valley
  503. echo.
  504. set /P galaxy=Choose a galaxy (1, 2, 3 or 4):
  505. echo.
  506. echo Replacing pertinent files...
  507. if %galaxy%==1 (
  508. if exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\GreenPlains\*" ".\temp\DATA\files\" /E /Y >nul )
  509. if not exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\GreenPlains\*" ".\temp\files\" /E /Y >nul )
  510. )
  511. if %galaxy%==2 (
  512. if exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\PullPath\*" ".\temp\DATA\files\" /E /Y >nul )
  513. if not exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\PullPath\*" ".\temp\files\" /E /Y >nul )
  514. )
  515. if %galaxy%==3 (
  516. if exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\RockyGardens\*" ".\temp\DATA\files\" /E /Y >nul )
  517. if not exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\RockyGardens\*" ".\temp\files\" /E /Y >nul )
  518. )
  519. if %galaxy%==4 (
  520. if exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\NostalgicValley\*" ".\temp\DATA\files\" /E /Y >nul )
  521. if not exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\NostalgicValley\*" ".\temp\files\" /E /Y >nul )
  522. )
  523. echo.
  524. echo This hack works with a savefile.
  525. echo The savefiles need to be applied manually.
  526. echo In the "instructions" folder read the "savefiles.txt"
  527. echo file to know how to apply them.
  528. echo.
  529. echo Copying savefiles to "safefiles" folder...
  530. echo.
  531. if %galaxy%==1 ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\GreenPlains\SaveGame\*" ".\savefiles\" /E /Y >nul )
  532. if %galaxy%==2 ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\PullPath\SaveGame\*" ".\savefiles\" /E /Y >nul )
  533. if %galaxy%==3 ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\RockyGardens\SaveGame\*" ".\savefiles\" /E /Y >nul )
  534. if %galaxy%==4 ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\NostalgicValley\SaveGame\*" ".\savefiles\" /E /Y >nul )
  535. echo.
  536. GOTO :final_steps
  537. :: =========
  538. :: SMG2TGSF2
  539. :: =========
  540. :SMG2TGSF2_custom
  541. echo.
  542. echo 1. Green Star Festival 2
  543. echo 2. Red Star DLC
  544. echo.
  545. set /P dlc=Choose a gamemode (1 or 2):
  546. echo.
  547. echo Replacing pertinent files...
  548. if %dlc%==1 GOTO :GSF2gamemode1
  549. if %dlc%==2 GOTO :GSF2gamemode2
  550. :GSF2gamemode1
  551. if exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\tgsf2\*" ".\temp\DATA\files\" /E /Y >nul )
  552. if not exist ".\temp\DATA" ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\tgsf2\*" ".\temp\files\" /E /Y >nul )
  553. echo.
  554. GOTO :GSF2pre_final
  555. :GSF2gamemode2
  556. if exist ".\temp\DATA" (xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\RedStarsDLC\*" ".\temp\DATA\files\" /E /Y >nul)
  557. if not exist ".\temp\DATA" (xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\RedStarsDLC\*" ".\temp\files\" /E /Y >nul)
  558. echo.
  559. echo Detected Region: %reg%
  560. echo.
  561. echo Applying hex patches...
  562. if %reg%==e (set SMG2TGSF2[8]=SGF2E1)
  563. if %reg%==p (set SMG2TGSF2[8]=SGF2P1)
  564. if %reg%==j (set SMG2TGSF2[8]=SGF2J1)
  565. if %reg%==k (set SMG2TGSF2[8]=SGF2K1)
  566. if %reg%==w (set SMG2TGSF2[8]=SGF2W1)
  567. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  568. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  569. echo.
  570. :GSF2pre_final
  571. echo.
  572. echo This hack works with a savefile.
  573. echo The savefiles need to be applied manually.
  574. echo In the "instructions" folder read the "savefiles.txt"
  575. echo file to know how to apply them.
  576. echo.
  577. echo Copying savefiles to "safefiles" folder...
  578. echo.
  579. if %dlc%==1 ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\tgsf2\SaveGame\*" ".\savefiles\" /E /Y >nul )
  580. if %dlc%==2 ( xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\RedStarsDLC\SaveGame\*" ".\savefiles\" /E /Y >nul )
  581. echo.
  582. GOTO :final_steps
  583. :: =======
  584. :: NMGTNGS
  585. :: =======
  586. :NMGTNGS_custom
  587. echo.
  588. set /P dd=Play in Daredevil mode? (y/n):
  589. echo Detected Region: %reg%
  590. echo Applying hex patches...
  591. if %dd%==y (set ddpatch=Daredevil.patch)
  592. if %dd%==n (set ddpatch=noDaredevil.patch)
  593. if %reg%==e (set NMGTNGS[8]=NMGGSE)
  594. if %reg%==p (set NMGTNGS[8]=NMGGSP)
  595. if %reg%==j (set NMGTNGS[8]=NMGGSJ)
  596. if exist ".\temp\DATA" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\%NMGTNGS[8]%_%ddpatch%" >nul)
  597. if not exist ".\temp\DATA" (%PATCH% ".\temp\sys\main.dol" < ".\patches\%NMGTNGS[8]%_%ddpatch%" >nul)
  598. echo.
  599. echo.
  600. echo This hack works with a savefile.
  601. echo The savefiles need to be applied manually.
  602. echo In the "instructions" folder read the "savefiles.txt"
  603. echo file to know how to apply them.
  604. echo.
  605. echo Copying savefiles to "safefiles" folder...
  606. echo.
  607. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\SaveGame\*" ".\savefiles\" /E /Y >nul
  608. echo.
  609. GOTO :final_steps
  610. :: ======
  611. :: SMG2CA
  612. :: ======
  613. :SMG2CA_custom
  614. echo.
  615. echo Detected Region: %reg%
  616. echo Applying hex patches...
  617. if %reg%==e (set SMG2CA[8]=MGCAE1)
  618. if %reg%==p (set SMG2CA[8]=MGCAP1)
  619. if %reg%==j (set SMG2CA[8]=MGCAJ1)
  620. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  621. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  622. echo.
  623. GOTO :final_steps
  624. :: =====
  625. :: SMG3D
  626. :: =====
  627. :SMG3D_custom
  628. echo.
  629. echo Detected Region: %reg%
  630. echo Applying hex patches...
  631. if %reg%==e (set SMG3D[8]=MG3DE1)
  632. if %reg%==p (set SMG3D[8]=MG3DP1)
  633. if %reg%==j (set SMG3D[8]=MG3DJ1)
  634. if exist ".\temp\DATA\" (%PATCH% ".\temp\DATA\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  635. if not exist ".\temp\DATA\" (%PATCH% ".\temp\sys\main.dol" < ".\patches\!%mod%[8]!.patch" >nul)
  636. :: Replace all language folders with EuEnglish folder contents
  637. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\EuDutch\" /E /Y >nul
  638. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\EuFrench\" /E /Y >nul
  639. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\EuGerman\" /E /Y >nul
  640. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\EuItalian\" /E /Y >nul
  641. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\EuSpanish\" /E /Y >nul
  642. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\UsEnglish\" /E /Y >nul
  643. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\UsFrench\" /E /Y >nul
  644. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\UsSpanish\" /E /Y >nul
  645. xcopy ".\mods\!%mod%[6]!\!%mod%[7]!\LocalizeData\EuEnglish\*" ".\temp\DATA\files\LocalizeData\JpJapanese\" /E /Y >nul
  646. echo.
  647. GOTO :final_steps