1@echo off
2
3if "%1" == "" goto help
4if "%AMCDDKBIN%" NEQ "" goto AMC
5if "%ODEMUSDKBIN%" NEQ "" goto GDEV
6
7echo Neither DDH nor GDEV are found. Do nothing and exit.
8goto end
9
10:help
11echo usage: setsmemsize 24
12echo usage: setsmemsize 48
13echo  Sets console simulated mem size. Either 24MB or 48MB is set as the console simulated memory size.
14goto end
15
16:AMC
17	echo DDH detected
18
19	getdvddriveletter > _drive.txt
20	set /p _amc_drive_=< _drive.txt
21
22	if "%1" == "24" (
23		goto AMCSET24
24	)
25
26	if "%1" == "48" (
27		goto AMCSET48
28	)
29
30	if "%1" == "47" (
31		goto AMCSET47
32	)
33
34	if "%1" == "0x1800000" (
35		goto AMCSET24
36	)
37
38	if "%1" == "0x3000000" (
39		goto AMCSET48
40	)
41
42	if "%1" == "0x2f00000" (
43		goto AMCSET47
44	)
45
46	if "%1" == "0" (
47		goto AMCSET0
48	)
49
50	if "%1" == "0x0" (
51		goto AMCSET0
52	)
53
54	echo usage: setsmemsize 24
55	echo usage: setsmemsize 48
56	echo  Sets console simulated mem size. Either 24MB or 48MB is set as the console simulated memory size.
57	goto end
58
59:AMCSET24
60	%DOLPHIN_X86_TOOLS%\tickleBI2 -d %_amc_drive_% 4 0x1800000
61	echo Successfully done. Set 24MB as the console simulated mem size.
62	goto AMCDONE
63
64:AMCSET48
65	%DOLPHIN_X86_TOOLS%\tickleBI2 -d %_amc_drive_% 4 0x3000000
66	echo Successfully done. Set 48MB as the console simulated mem size.
67	goto AMCDONE
68
69:AMCSET47
70	%DOLPHIN_X86_TOOLS%\tickleBI2 -d %_amc_drive_% 4 0x2f00000
71	echo Successfully done. Set 47MB as the console simulated mem size.
72	goto AMCDONE
73
74:AMCSET0
75	%DOLPHIN_X86_TOOLS%\tickleBI2 -d %_amc_drive_% 4 0x0
76	echo Successfully done. Physical memory size is considered as the console simulated mem size.
77	goto AMCDONE
78
79:AMCDONE
80	del _drive.txt /q
81
82
83rem Support both DDH and GDEV
84	if "%ODEMUSDKBIN%" NEQ "" goto GDEV
85
86	goto ENDWARNING
87
88:GDEV
89	echo GDEV detected
90
91	if "%1" == "24" (
92		goto GDEVSET24
93	)
94
95	if "%1" == "48" (
96		goto GDEVSET48
97	)
98
99	if "%1" == "47" (
100		goto GDEVSET47
101	)
102
103	if "%1" == "0x1800000" (
104		goto GDEVSET24
105	)
106
107	if "%1" == "0x3000000" (
108		goto GDEVSET48
109	)
110
111	if "%1" == "0x2f00000" (
112		goto GDEVSET47
113	)
114
115	if "%1" == "0" (
116		goto GDEVSET0
117	)
118
119	if "%1" == "0x0" (
120		goto GDEVSET0
121	)
122
123	echo usage: setsmemsize 24
124	echo usage: setsmemsize 48
125	echo  Sets console simulated mem size. Either 24MB or 48MB is set as the console simulated memory size.
126	goto end
127
128:GDEVSET24
129	%DOLPHIN_X86_TOOLS%\tickleBI2 -o %ODEMUSDKBIN%\OdemRun.bi2 4 0x1800000
130	echo Successfully done. Set 24MB as the console simulated mem size.
131	goto GDEVDONE
132
133:GDEVSET48
134	%DOLPHIN_X86_TOOLS%\tickleBI2 -o %ODEMUSDKBIN%\OdemRun.bi2 4 0x3000000
135	echo Successfully done. Set 48MB as the console simulated mem size.
136	goto GDEVDONE
137
138:GDEVSET47
139	%DOLPHIN_X86_TOOLS%\tickleBI2 -o %ODEMUSDKBIN%\OdemRun.bi2 4 0x2f00000
140	echo Successfully done. Set 47MB as the console simulated mem size.
141	goto GDEVDONE
142
143:GDEVSET0
144	%DOLPHIN_X86_TOOLS%\tickleBI2 -o %ODEMUSDKBIN%\OdemRun.bi2 4 0x0
145	echo Successfully done. Physical memory size is considered as the console simulated mem size.
146	goto GDEVDONE
147
148:GDEVDONE
149
150:ENDWARNING
151
152echo ******************************************************************************
153echo * If you make master data, you must execute loadrun/odrun before you do so!! *
154echo ******************************************************************************
155
156:end
157
158