This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathACNL_REditor File Dumper.gm9
248 lines (194 loc) · 6.56 KB
/
ACNL_REditor File Dumper.gm9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Dump Files for ACNL REditor
# author: Slattz
# credit: All authors of GM9Megascript, which was referenced a ton when writing this
set ERRORMSG "An Error Has Occured."
set PREVIEW_MODE "ACNL REditor File Dumper v1.0\nby Slattz"
set OUTDIR "0:/ACNL_REditor"
set GAMEPATH ""
if not find $[OUTDIR] NULL
if not mkdir $[OUTDIR]
echo "Error: Couldn't create Base Folder ($[OUTDIR]).\nExiting."
goto GameSelect_Exit
end
end
# Main Menu #
@Start
set PREVIEW_MODE "ACNL REditor File Dumper v1.0\nby Slattz\n \nNote:\nACNL REditor only works with the latest update\nof ACNL games (v1.5)."
set OUTDIR "0:/ACNL_REditor"
set GAMEPATH ""
labelsel -o -s "Choose which game to dump files from." GameSelect_*
goto Start
@GameSelect_Orig_EUR
set TIDLOW 00086400
set GAME "Orig_EUR"
goto Common
@GameSelect_Orig_USA
set TIDLOW 00086300
set GAME "Orig_USA"
goto Common
@GameSelect_Orig_JPN
set TIDLOW 00086200
set GAME "Orig_JPN"
goto Common
#@GameSelect_Orig_KOR
#set TIDLOW 00086500
#set GAME "Orig_KOR"
#goto Common
@GameSelect_PreInstalled_WA_EUR
set TIDLOW 00198f00
set GAME "PreInstalled_WA_EUR"
goto Common
@GameSelect_PreInstalled_WA_USA
set TIDLOW 00198e00
set GAME "PreInstalled_WA_USA"
goto Common
@GameSelect_PreInstalled_WA_JPN
set TIDLOW 00198d00
set GAME "PreInstalled_WA_JPN"
goto Common
#@GameSelect_PreInstalled_WA_KOR
#set TIDLOW 00199000
#set GAME "PreInstalled_WA_KOR"
#goto Common
@Common
set PREVIEW_MODE "ACNL REditor Files Dumper\nby Slattz\n\n> Dumping Files From $[GAME]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
set ROMDIR "$[OUTDIR]/$[GAME]/rom"
set ROMFS "$[ROMDIR]/romfs"
set EXEFS "$[ROMDIR]/exefs"
mkdir $[ROMDIR]
mkdir $[EXEFS]
mkdir $[ROMFS]
mkdir $[ROMFS]/Item/Param
if chk $[GAME] "Orig_EUR"
goto DumpOrigFiles
elif chk $[GAME] "Orig_USA"
goto DumpOrigFiles
elif chk $[GAME] "Orig_JPN"
goto DumpOrigFiles
#elif chk $[GAME] "Orig_KOR"
# goto DumpOrigFiles
elif chk $[GAME] "PreInstalled_WA_EUR"
goto DumpWAFiles
elif chk $[GAME] "PreInstalled_WA_USA"
goto DumpUSA_WAFiles
elif chk $[GAME] "PreInstalled_WA_JPN"
goto DumpWAFiles
#elif chk $[GAME] "PreInstalled_WA_KOR"
# goto DumpWAFiles
else
echo "GAME was not set to a recognised value: $[GAME]"
goto Start
end
#All Orig games have to have the update
@DumpOrigFiles
set PREVIEW_MODE "ACNL REditor Orig Files Dumper\nby Slattz\n\n> Dumping Files From $[GAME]"
if not find A:/title/0004000e/$[TIDLOW]/content/0000000?.app UPDATE
echo "Couldn't find $[GAME]'s update.\nIt is likely not installed.\nTID: 0004000e$[TIDLOW]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
goto Start
end
imgmount $[UPDATE]
set ERRORMSG "Dumping code.bin failed."
cp -w -n G:/exefs/.code $[EXEFS]/code.bin
set ERRORMSG "Orig: Dumping Item.bin failed."
cp -w -n G:/romfs/Item/Param/Item.bin $[ROMFS]/Item/Param/Item.bin
imgumount
echo "Orig: All files dumped to:\n$[ROMDIR]/"
goto GameSelect_Exit
#Specific to Preinstalled-WA USA
@DumpUSA_WAFiles
set PREVIEW_MODE "ACNL REditor USA WA Files Dumper\nby Slattz\n\n> Dumping Files From $[GAME]"
if not find C:/00040000$[TIDLOW]_*.3ds CARTPATH
goto DumpUSA_WAFiles_Installed_On_SD
end
labelsel -o -s "Choose which game type to dump files from." DumpUSA_WAFiles_*
goto GameSelect_Exit
#Specific to Preinstalled-WA USA; If user has cart
@DumpUSA_WAFiles_Cartridge
if not find C:/00040000$[TIDLOW]_*.3ds CARTPATH
echo "Couldn't find $[GAME] Cart.\nMake sure you have the ACNL $[GAME] cart inserted!\nTID: 00040000$[TIDLOW]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
goto Start
end
imgmount $[CARTPATH]
set ERRORMSG "Dumping code.bin failed."
cp -w -n G:/content0.game/exefs/.code $[EXEFS]/code.bin
set ERRORMSG "WA USA Cart: Dumping Item.bin failed."
cp -w -n G:/content0.game/romfs/Item/Param/Item.bin $[ROMFS]/Item/Param/Item.bin
imgumount
echo "WA USA Cart: Files dumped succesfully to:\n$[ROMDIR]/"
goto GameSelect_Exit
#Specific to Preinstalled-WA USA; If user has SD
@DumpUSA_WAFiles_Installed_On_SD
if not find A:/title/00040000/$[TIDLOW]/content/00000000.app BASE
echo "Couldn't find $[GAME] BaseGame.\nIt's weird you have the update but not the game.\nIf you have a cartridge, please instert it and try again.\nTID: 00040000$[TIDLOW]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
goto Start
end
imgmount $[BASE]
set ERRORMSG "Dumping code.bin failed."
cp -w -n G:/exefs/.code $[EXEFS]/code.bin
set ERRORMSG "WA USA SD: Dumping Item.bin failed."
cp -w -n G:/romfs/Item/Param/Item.bin $[ROMFS]/Item/Param/Item.bin
imgumount
echo "WA USA SD: Files dumped succesfully to:\n$[ROMDIR]/"
goto GameSelect_Exit
#Specific to Preinstalled-WA non-USA, as we have to get files from the update and base game.
@DumpWAFiles
set PREVIEW_MODE "ACNL REditor WA Files Dumper\nby Slattz\n\n> Dumping Files From $[GAME]"
if not find A:/title/0004000e/$[TIDLOW]/content/0000000?.app UPDATE
echo "Couldn't find $[GAME]'s update.\nIt is likely not installed.\nTID: 0004000e$[TIDLOW]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
goto Start
end
imgmount $[UPDATE]
set ERRORMSG "Dumping code.bin failed."
cp -w -n G:/exefs/.code $[EXEFS]/code.bin
imgumount
if not find C:/00040000$[TIDLOW]_*.3ds CARTPATH
goto DumpWAFiles_Installed_On_SD
end
labelsel -o -s "Choose which game type to dump files from." DumpWAFiles_*
goto GameSelect_Exit
#Specific to Preinstalled-WA; If user has cart
@DumpWAFiles_Cartridge
if not find C:/00040000$[TIDLOW]_*.3ds CARTPATH
echo "Couldn't find $[GAME] BaseGame.\nMake sure you have the ACNL $[GAME] cart inserted!\nTID: 00040000$[TIDLOW]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
goto Start
end
imgmount $[CARTPATH]
set ERRORMSG "WA Cart: Dumping Item.bin failed."
cp -w -n G:/content0.game/romfs/Item/Param/Item.bin $[ROMFS]/Item/Param/Item.bin
imgumount
echo "WA Cart: Files dumped succesfully to:\n$[ROMDIR]/"
goto GameSelect_Exit
#Specific to Preinstalled-WA; If user has SD
@DumpWAFiles_Installed_On_SD
if not find A:/title/00040000/$[TIDLOW]/content/00000000.app BASE
echo "Couldn't find $[GAME] BaseGame.\nIt's weird you have the update but not the game.\nIf you have a cartridge, please insert it and try again.\nTID: 00040000$[TIDLOW]"
if find $[OUTDIR]/$[GAME] NULL
rm -o -s $[OUTDIR]/$[GAME]
end
goto Start
end
imgmount $[BASE]
set ERRORMSG "WA SD: Dumping Item.bin failed."
cp -w -n G:/romfs/Item/Param/Item.bin $[ROMFS]/Item/Param/Item.bin
imgumount
echo "WA SD: Files dumped succesfully to:\n$[ROMDIR]/"
goto GameSelect_Exit
@GameSelect_Exit