annotate scn2k/scn2kdump.cc @ 62:3b1593186f12

fix pointers used to get strchr result
author Thibaut GIRKA <thib@sitedethib.com>
date Sat, 06 Feb 2010 17:03:47 +0100
parents 15a18fbe6f21
children 4416cfac86ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
223b71206888 Initial import
thib
parents:
diff changeset
1 /*
223b71206888 Initial import
thib
parents:
diff changeset
2 *
223b71206888 Initial import
thib
parents:
diff changeset
3 * Copyright (C) 2002- Kazunori Ueno(JAGARL) <jagarl@creator.club.ne.jp>
223b71206888 Initial import
thib
parents:
diff changeset
4 *
223b71206888 Initial import
thib
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
223b71206888 Initial import
thib
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
223b71206888 Initial import
thib
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
223b71206888 Initial import
thib
parents:
diff changeset
8 * (at your option) any later version.
223b71206888 Initial import
thib
parents:
diff changeset
9 *
223b71206888 Initial import
thib
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
223b71206888 Initial import
thib
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
223b71206888 Initial import
thib
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
223b71206888 Initial import
thib
parents:
diff changeset
13 * GNU General Public License for more details.
223b71206888 Initial import
thib
parents:
diff changeset
14 *
27
3a6aaeab7b4e * Fixed a typo in Jagarl's name
thib
parents: 0
diff changeset
15 * You should have received a copy of the GNU General Public License along
3a6aaeab7b4e * Fixed a typo in Jagarl's name
thib
parents: 0
diff changeset
16 * with this program; if not, write to the Free Software Foundation, Inc.,
3a6aaeab7b4e * Fixed a typo in Jagarl's name
thib
parents: 0
diff changeset
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0
223b71206888 Initial import
thib
parents:
diff changeset
18 *
223b71206888 Initial import
thib
parents:
diff changeset
19 */
223b71206888 Initial import
thib
parents:
diff changeset
20
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
21 #include <stdlib.h>
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
22 #include <stdarg.h>
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
23 #include <stdio.h>
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
24 #include <string.h>
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
25 #include <string>
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
26 #include <vector>
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
27 #include <map>
0
223b71206888 Initial import
thib
parents:
diff changeset
28
223b71206888 Initial import
thib
parents:
diff changeset
29 using namespace std;
223b71206888 Initial import
thib
parents:
diff changeset
30
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
31 #include "system/file.h"
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
32 #include "system/file_impl.h"
0
223b71206888 Initial import
thib
parents:
diff changeset
33
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
34 #include "scn2k.h"
0
223b71206888 Initial import
thib
parents:
diff changeset
35
223b71206888 Initial import
thib
parents:
diff changeset
36
223b71206888 Initial import
thib
parents:
diff changeset
37 #define SCN_DUMP
223b71206888 Initial import
thib
parents:
diff changeset
38
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
39 class CmdD : public Cmd
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
40 {
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
41 public:
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
42 CmdD(const Flags& flags, int system_version) : Cmd(flags, system_version) {}
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
43 //CmdD(const Flags& f) : flags(f) { argc = 0; errorflag = false; cmdstr[0] = 0;}
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
44 bool ClearError() { /*errorflag = false;*/}
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
45 static map<int, struct CmdDescrItem*> cmd_descr;
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
46 const char* CmdDescr(int cmd1, int cmd2, int cmd3, int cmd4);
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
47 };
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
48
0
223b71206888 Initial import
thib
parents:
diff changeset
49 int system_version = 0;
223b71206888 Initial import
thib
parents:
diff changeset
50 bool ruby_flag = false;
223b71206888 Initial import
thib
parents:
diff changeset
51 bool ret_flag = false;
223b71206888 Initial import
thib
parents:
diff changeset
52 bool text_flag = false;
223b71206888 Initial import
thib
parents:
diff changeset
53 bool selection_flag = false;
223b71206888 Initial import
thib
parents:
diff changeset
54
223b71206888 Initial import
thib
parents:
diff changeset
55
223b71206888 Initial import
thib
parents:
diff changeset
56 inline int eval(int v1, int op, int v2) {
223b71206888 Initial import
thib
parents:
diff changeset
57 switch(op) {
223b71206888 Initial import
thib
parents:
diff changeset
58 case 0: return v1+v2;
223b71206888 Initial import
thib
parents:
diff changeset
59 case 1: return v1-v2;
223b71206888 Initial import
thib
parents:
diff changeset
60 case 2: return v1*v2;
223b71206888 Initial import
thib
parents:
diff changeset
61 case 3: return v2!=0 ? v1/v2 : v1;
223b71206888 Initial import
thib
parents:
diff changeset
62 case 4: return v2!=0 ? v1%v2 : v1;
223b71206888 Initial import
thib
parents:
diff changeset
63 case 5: return v1&v2;
223b71206888 Initial import
thib
parents:
diff changeset
64 case 6: return v1|v2;
223b71206888 Initial import
thib
parents:
diff changeset
65 case 7: return v1^v2;
223b71206888 Initial import
thib
parents:
diff changeset
66 case 8: return v1<<v2;
223b71206888 Initial import
thib
parents:
diff changeset
67 case 9: return v1>>v2;
223b71206888 Initial import
thib
parents:
diff changeset
68 case 40: return v1 == v2;
223b71206888 Initial import
thib
parents:
diff changeset
69 case 41: return v1 != v2;
223b71206888 Initial import
thib
parents:
diff changeset
70 case 42: return v1 <= v2;
223b71206888 Initial import
thib
parents:
diff changeset
71 case 43: return v1 < v2;
223b71206888 Initial import
thib
parents:
diff changeset
72 case 44: return v1 >= v2;
223b71206888 Initial import
thib
parents:
diff changeset
73 case 45: return v1 > v2;
223b71206888 Initial import
thib
parents:
diff changeset
74 case 60: return v1 && v2;
223b71206888 Initial import
thib
parents:
diff changeset
75 case 61: return v1 || v2;
223b71206888 Initial import
thib
parents:
diff changeset
76 }
223b71206888 Initial import
thib
parents:
diff changeset
77 return v2;
223b71206888 Initial import
thib
parents:
diff changeset
78 }
223b71206888 Initial import
thib
parents:
diff changeset
79
223b71206888 Initial import
thib
parents:
diff changeset
80
223b71206888 Initial import
thib
parents:
diff changeset
81 void usage(void) {
223b71206888 Initial import
thib
parents:
diff changeset
82 fprintf(stderr,"usage : scn2kdump [inputfile] [outputfile]\n");
223b71206888 Initial import
thib
parents:
diff changeset
83 fprintf(stderr," inputfile: seen.txt(default)\n");
223b71206888 Initial import
thib
parents:
diff changeset
84 fprintf(stderr," outputfile: seen.txt_out(default)\n");
223b71206888 Initial import
thib
parents:
diff changeset
85 exit(-1);
223b71206888 Initial import
thib
parents:
diff changeset
86 }
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
87
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
88 extern int debug_flag;
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
89
0
223b71206888 Initial import
thib
parents:
diff changeset
90 int main(int argc, char** argv) {
223b71206888 Initial import
thib
parents:
diff changeset
91 /* determine file names */
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
92 debug_flag = true;
0
223b71206888 Initial import
thib
parents:
diff changeset
93 bool verbose = false;
223b71206888 Initial import
thib
parents:
diff changeset
94 char* inname = "seen.txt";
223b71206888 Initial import
thib
parents:
diff changeset
95 char* outname = 0;
223b71206888 Initial import
thib
parents:
diff changeset
96 if (argc > 2 && strcmp(argv[1],"-v") == 0) {
223b71206888 Initial import
thib
parents:
diff changeset
97 int i; for (i=1; i<argc; i++) argv[i] = argv[i+1];
223b71206888 Initial import
thib
parents:
diff changeset
98 argc--;
223b71206888 Initial import
thib
parents:
diff changeset
99 verbose = true;
223b71206888 Initial import
thib
parents:
diff changeset
100 }
223b71206888 Initial import
thib
parents:
diff changeset
101 switch(argc) {
223b71206888 Initial import
thib
parents:
diff changeset
102 case 1: break;
223b71206888 Initial import
thib
parents:
diff changeset
103 case 2: inname = argv[1]; break;
223b71206888 Initial import
thib
parents:
diff changeset
104 case 3: inname = argv[1]; outname = argv[2]; break;
223b71206888 Initial import
thib
parents:
diff changeset
105 default: usage();
223b71206888 Initial import
thib
parents:
diff changeset
106 }
223b71206888 Initial import
thib
parents:
diff changeset
107 /* open output file */
223b71206888 Initial import
thib
parents:
diff changeset
108 FILE* outstream = stdout;
223b71206888 Initial import
thib
parents:
diff changeset
109 /* create archive instance */
223b71206888 Initial import
thib
parents:
diff changeset
110 SCN2kFILE archive(inname);
223b71206888 Initial import
thib
parents:
diff changeset
111 archive.Init();
223b71206888 Initial import
thib
parents:
diff changeset
112 if (archive.Deal() == 0) {
223b71206888 Initial import
thib
parents:
diff changeset
113 fprintf(stderr,"Cannot open / Invalid archive file %s\n",inname);
223b71206888 Initial import
thib
parents:
diff changeset
114 usage();
223b71206888 Initial import
thib
parents:
diff changeset
115 }
223b71206888 Initial import
thib
parents:
diff changeset
116 /* dump files */
223b71206888 Initial import
thib
parents:
diff changeset
117 archive.InitList();
223b71206888 Initial import
thib
parents:
diff changeset
118 char* fname;
223b71206888 Initial import
thib
parents:
diff changeset
119 fprintf(stderr,"Dump start\n");
223b71206888 Initial import
thib
parents:
diff changeset
120 while( (fname = archive.ListItem()) != 0) {
52
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
121 ARCINFO* info = archive.Find(fname, "");
15a18fbe6f21 * Known bugs added to the README
thib
parents: 29
diff changeset
122 if (info == NULL) continue;
0
223b71206888 Initial import
thib
parents:
diff changeset
123 char* data = info->CopyRead();
223b71206888 Initial import
thib
parents:
diff changeset
124 char* d = data;
223b71206888 Initial import
thib
parents:
diff changeset
125 char* dend = d + info->Size();
223b71206888 Initial import
thib
parents:
diff changeset
126 /* version ³Îǧ */
223b71206888 Initial import
thib
parents:
diff changeset
127 if (read_little_endian_int(d) == 0x1cc) {
223b71206888 Initial import
thib
parents:
diff changeset
128 system_version = 0;
223b71206888 Initial import
thib
parents:
diff changeset
129 } else if (read_little_endian_int(d) == 0x1d0) {
223b71206888 Initial import
thib
parents:
diff changeset
130 system_version = 1;
223b71206888 Initial import
thib
parents:
diff changeset
131 } else {
223b71206888 Initial import
thib
parents:
diff changeset
132 continue;
223b71206888 Initial import
thib
parents:
diff changeset
133 }
223b71206888 Initial import
thib
parents:
diff changeset
134 if (read_little_endian_int(d+4) == 0x1adb2) ; // little busters!
223b71206888 Initial import
thib
parents:
diff changeset
135 else if (read_little_endian_int(d+4) != 0x2712) continue;
223b71206888 Initial import
thib
parents:
diff changeset
136 int header_size;
223b71206888 Initial import
thib
parents:
diff changeset
137 if (system_version == 0) {
223b71206888 Initial import
thib
parents:
diff changeset
138 header_size = 0x1cc + read_little_endian_int(d+0x20) * 4;
223b71206888 Initial import
thib
parents:
diff changeset
139 } else {
223b71206888 Initial import
thib
parents:
diff changeset
140 header_size = read_little_endian_int(d+0x20);
223b71206888 Initial import
thib
parents:
diff changeset
141 }
223b71206888 Initial import
thib
parents:
diff changeset
142 d += header_size;
223b71206888 Initial import
thib
parents:
diff changeset
143
223b71206888 Initial import
thib
parents:
diff changeset
144 const char* dcur = d;
223b71206888 Initial import
thib
parents:
diff changeset
145 const char* dstart = d;
223b71206888 Initial import
thib
parents:
diff changeset
146 fprintf(stderr,"Dumping %s\n",fname);
223b71206888 Initial import
thib
parents:
diff changeset
147 fprintf(stdout,"Dumping %s\n",fname);
223b71206888 Initial import
thib
parents:
diff changeset
148 { int i; for (i=0; i<100; i++) {
223b71206888 Initial import
thib
parents:
diff changeset
149 int n = read_little_endian_int(data + 0x34 + i*4);
223b71206888 Initial import
thib
parents:
diff changeset
150 if (n != 6) fprintf(stdout,"subroutine table %2d: %6d\n",i,n);
223b71206888 Initial import
thib
parents:
diff changeset
151 }}
223b71206888 Initial import
thib
parents:
diff changeset
152 Flags flags;
223b71206888 Initial import
thib
parents:
diff changeset
153 /* ºÇ½é¤«¤éºÇ¸å¤Þ¤Ç¥³¥Þ¥ó¥É¼èÆÀ -> ½ÐÎϤò·«¤êÊÖ¤¹ */
223b71206888 Initial import
thib
parents:
diff changeset
154 while(dcur<dend) {
223b71206888 Initial import
thib
parents:
diff changeset
155 const char* dprev = dcur;
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
156 CmdD cmd(flags, system_version); cmd.ClearError();
0
223b71206888 Initial import
thib
parents:
diff changeset
157
223b71206888 Initial import
thib
parents:
diff changeset
158 /* end? */
223b71206888 Initial import
thib
parents:
diff changeset
159 if (*dcur == -1) {
223b71206888 Initial import
thib
parents:
diff changeset
160 /* 0xff x 32byte + 0x00 : end sign */
223b71206888 Initial import
thib
parents:
diff changeset
161 int i; for (i=0; i<0x20; i++)
223b71206888 Initial import
thib
parents:
diff changeset
162 if (dcur[i] != -1) break;
223b71206888 Initial import
thib
parents:
diff changeset
163 if (i == 0x20 && dcur[i] == 0) break;
223b71206888 Initial import
thib
parents:
diff changeset
164 }
223b71206888 Initial import
thib
parents:
diff changeset
165 dprintf("%d : ",dcur-dstart);
223b71206888 Initial import
thib
parents:
diff changeset
166 cmd.GetCmd(flags, dcur);
223b71206888 Initial import
thib
parents:
diff changeset
167 if (cmd.IsError()) {
223b71206888 Initial import
thib
parents:
diff changeset
168 fprintf(outstream, "Error at %6d\n",dprev-dstart);
223b71206888 Initial import
thib
parents:
diff changeset
169 while(dcur < dend) {
223b71206888 Initial import
thib
parents:
diff changeset
170 if (*dcur == 0x29 && dcur[1] == 0x0a) {dcur++;break;}
223b71206888 Initial import
thib
parents:
diff changeset
171 if (*dcur == 0 && dcur[1] == 0x0a) {dcur++;break;}
223b71206888 Initial import
thib
parents:
diff changeset
172 if (*dcur == 0 && dcur[1] == 0x23) {dcur++;break;}
223b71206888 Initial import
thib
parents:
diff changeset
173 dcur++;
223b71206888 Initial import
thib
parents:
diff changeset
174 }
223b71206888 Initial import
thib
parents:
diff changeset
175 dprev -= 2*16;
223b71206888 Initial import
thib
parents:
diff changeset
176 int ilen = (dcur-dprev+15)/16;
223b71206888 Initial import
thib
parents:
diff changeset
177 int i; for (i=0; i<ilen; i++) {
223b71206888 Initial import
thib
parents:
diff changeset
178 fprintf(outstream, "%6d: ",dprev-dstart);
223b71206888 Initial import
thib
parents:
diff changeset
179 int j; for (j=0; j<16; j++) {
223b71206888 Initial import
thib
parents:
diff changeset
180 if (dprev >= dend) break;
223b71206888 Initial import
thib
parents:
diff changeset
181 if (dprev < data) continue;
223b71206888 Initial import
thib
parents:
diff changeset
182 fprintf(outstream, "%02x ",*(unsigned char*)(dprev));
223b71206888 Initial import
thib
parents:
diff changeset
183 dprev++;
223b71206888 Initial import
thib
parents:
diff changeset
184 }
223b71206888 Initial import
thib
parents:
diff changeset
185 fprintf(outstream, "\n");
223b71206888 Initial import
thib
parents:
diff changeset
186 }
223b71206888 Initial import
thib
parents:
diff changeset
187 }
223b71206888 Initial import
thib
parents:
diff changeset
188 }
223b71206888 Initial import
thib
parents:
diff changeset
189 delete info;
223b71206888 Initial import
thib
parents:
diff changeset
190 }
223b71206888 Initial import
thib
parents:
diff changeset
191 return 0;
223b71206888 Initial import
thib
parents:
diff changeset
192 }
223b71206888 Initial import
thib
parents:
diff changeset
193
223b71206888 Initial import
thib
parents:
diff changeset
194 /*
223b71206888 Initial import
thib
parents:
diff changeset
195 SetStr
223b71206888 Initial import
thib
parents:
diff changeset
196 0x23 - cmd 01-0a:0000:00[ 2]
223b71206888 Initial import
thib
parents:
diff changeset
197 args:V<18>[17],"PB47"
223b71206888 Initial import
thib
parents:
diff changeset
198 CatStr
223b71206888 Initial import
thib
parents:
diff changeset
199 0x23 - cmd 01-0a:0002:00[ 2]
223b71206888 Initial import
thib
parents:
diff changeset
200 args:V<18>[17],V<18>[20]
223b71206888 Initial import
thib
parents:
diff changeset
201
223b71206888 Initial import
thib
parents:
diff changeset
202 WaitClick
223b71206888 Initial import
thib
parents:
diff changeset
203 0x23 - cmd 00-03:0011:00[ 0]
223b71206888 Initial import
thib
parents:
diff changeset
204
223b71206888 Initial import
thib
parents:
diff changeset
205 ChangeFaceGraphics
223b71206888 Initial import
thib
parents:
diff changeset
206 0x23 - cmd 00-03:03e8:00[ 1]
223b71206888 Initial import
thib
parents:
diff changeset
207 args:V<18>[17]
223b71206888 Initial import
thib
parents:
diff changeset
208 DeleteFaceGraphics
223b71206888 Initial import
thib
parents:
diff changeset
209 0x23 - cmd 00-03:03e9:01[ 0]
223b71206888 Initial import
thib
parents:
diff changeset
210 KoePlay
223b71206888 Initial import
thib
parents:
diff changeset
211 0x23 - cmd 01-17:0000:01[ 2]
223b71206888 Initial import
thib
parents:
diff changeset
212 args:100000026,5
223b71206888 Initial import
thib
parents:
diff changeset
213 DrawGraphics(Á°·Ê²è¤¢¤ê¡Ë
223b71206888 Initial import
thib
parents:
diff changeset
214 0x23 - cmd 01-21:004b:00[ 1]
223b71206888 Initial import
thib
parents:
diff changeset
215 args:V<18>[1],10,kasane. #1 <args:V<18>[17],11>
223b71206888 Initial import
thib
parents:
diff changeset
216
223b71206888 Initial import
thib
parents:
diff changeset
217 DrawGraphics(ÇطʤΤß)
223b71206888 Initial import
thib
parents:
diff changeset
218 0x23 - cmd 01-21:0049:00[ 2]
223b71206888 Initial import
thib
parents:
diff changeset
219 args:V<18>[1],10
223b71206888 Initial import
thib
parents:
diff changeset
220
223b71206888 Initial import
thib
parents:
diff changeset
221 Ruby
223b71206888 Initial import
thib
parents:
diff changeset
222 0x23 - cmd 00-03:0078:01[ 0]
223b71206888 Initial import
thib
parents:
diff changeset
223 "Íýͳ"
223b71206888 Initial import
thib
parents:
diff changeset
224 0x23 - cmd 00-03:0078:00[ 1]
223b71206888 Initial import
thib
parents:
diff changeset
225 "¤ï¤±"
223b71206888 Initial import
thib
parents:
diff changeset
226 SetTitle
223b71206888 Initial import
thib
parents:
diff changeset
227 0x23 - cmd 01-04:0000:00[ 1]
223b71206888 Initial import
thib
parents:
diff changeset
228 args:"Long Long Time Ago..."
223b71206888 Initial import
thib
parents:
diff changeset
229 WaitTime
223b71206888 Initial import
thib
parents:
diff changeset
230 0x23 - cmd 01-14:0069:00[ 1]
223b71206888 Initial import
thib
parents:
diff changeset
231 args:3000
223b71206888 Initial import
thib
parents:
diff changeset
232 ChangeBGM ¿ôÃÍ°ú¿ô¤Ï¥Õ¥§¡¼¥É¥¢¥¦¥È¡¢¥¤¥ó¤Î»þ´Ö¤È¿ä¬
223b71206888 Initial import
thib
parents:
diff changeset
233 0x23 - cmd 01-14:0000:02[ 3]
223b71206888 Initial import
thib
parents:
diff changeset
234 args:"BGM18",700,700
223b71206888 Initial import
thib
parents:
diff changeset
235 */
223b71206888 Initial import
thib
parents:
diff changeset
236
223b71206888 Initial import
thib
parents:
diff changeset
237 struct CmdDescrItem {
223b71206888 Initial import
thib
parents:
diff changeset
238 CmdDescrItem* next;
223b71206888 Initial import
thib
parents:
diff changeset
239 int cmd4;
223b71206888 Initial import
thib
parents:
diff changeset
240 int cmd1;
223b71206888 Initial import
thib
parents:
diff changeset
241 int cmd2;
223b71206888 Initial import
thib
parents:
diff changeset
242 int cmd3;
223b71206888 Initial import
thib
parents:
diff changeset
243 const char* cmd_descr;
223b71206888 Initial import
thib
parents:
diff changeset
244 };
223b71206888 Initial import
thib
parents:
diff changeset
245 CmdDescrItem cmd_descr_orig[] = {
223b71206888 Initial import
thib
parents:
diff changeset
246 // scn2k_impl.cc; Scn2k::SysExec()
223b71206888 Initial import
thib
parents:
diff changeset
247 {0,0,0x00,0x01,0x0a, "local return"},
223b71206888 Initial import
thib
parents:
diff changeset
248 {0,0,0x00,0x01,0x0b, "global jump"},
223b71206888 Initial import
thib
parents:
diff changeset
249 {0,0,0x00,0x01,0x0c, "global call"},
223b71206888 Initial import
thib
parents:
diff changeset
250 {0,0,0x00,0x01,0x0d, "global return"},
223b71206888 Initial import
thib
parents:
diff changeset
251 {0,0,0x00,0x01,0x12, "global call"},
223b71206888 Initial import
thib
parents:
diff changeset
252 {0,0,0x00,0x01,0x13, "global return(?)"},
223b71206888 Initial import
thib
parents:
diff changeset
253 {0,0,0x00,0x04,0x0d, "Menu_return"},
223b71206888 Initial import
thib
parents:
diff changeset
254 {0,0,0x01,0x04,0x00, "SetWindowCaption"},
223b71206888 Initial import
thib
parents:
diff changeset
255 {0,0,0x01,0x04,0x82, "ClearMousePress"},
223b71206888 Initial import
thib
parents:
diff changeset
256 {0,0,0x01,0x04,0x83, "GetMouse(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
257 {0,0,0x01,0x04,0x85, "GetMouse"},
223b71206888 Initial import
thib
parents:
diff changeset
258 {0,0,0x01,0x04,0x4b0,"QuitGame"},
223b71206888 Initial import
thib
parents:
diff changeset
259 {0,0,0x01,0x04,0x58d,"PrevSaveNumber"},
223b71206888 Initial import
thib
parents:
diff changeset
260 {0,0,0x01,0x04,0x585,"SavedDate"},
223b71206888 Initial import
thib
parents:
diff changeset
261 {0,0,0x01,0x04,0xc23,"Save"},
223b71206888 Initial import
thib
parents:
diff changeset
262 {0,0,0x01,0x04,0xc25,"Load"},
223b71206888 Initial import
thib
parents:
diff changeset
263 {0,0,0x01,0x04,0x4b1,"GoMenu"},
223b71206888 Initial import
thib
parents:
diff changeset
264 {0,0,0x01,0x04,0x4b3,"GoMenu_Badend"},
223b71206888 Initial import
thib
parents:
diff changeset
265 {0,0,0x01,0x04,0xcc, "ShowMouseCursor"},
223b71206888 Initial import
thib
parents:
diff changeset
266 {0,0,0x01,0x04,0xcd, "HideMouseCursor"},
223b71206888 Initial import
thib
parents:
diff changeset
267 {0,0,0x01,0x04,0xcf, "SetCursorType"},
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
268 // scn2k_cmd.cc; CmdD::GetCmd()
0
223b71206888 Initial import
thib
parents:
diff changeset
269 {0,0,0x00,0x01,0, "local jump"},
223b71206888 Initial import
thib
parents:
diff changeset
270 {0,0,0x00,0x01,1, "local jump-if"},
223b71206888 Initial import
thib
parents:
diff changeset
271 {0,0,0x00,0x01,2, "local jump-unless"},
223b71206888 Initial import
thib
parents:
diff changeset
272 {0,0,0x00,0x01,3, "local jump-switch??"},
223b71206888 Initial import
thib
parents:
diff changeset
273 {0,0,0x00,0x01,4, "local switch"},
223b71206888 Initial import
thib
parents:
diff changeset
274 {0,0,0x00,0x01,5, "local call"},
223b71206888 Initial import
thib
parents:
diff changeset
275 {0,0,0x00,0x01,8, "local switch(simple form)"},
223b71206888 Initial import
thib
parents:
diff changeset
276 {0,0,0x01,0x0b,0, "set multiple variables"},
223b71206888 Initial import
thib
parents:
diff changeset
277 {0,0,0x01,0x0b,1, "set variables in a range"},
223b71206888 Initial import
thib
parents:
diff changeset
278 {0,0,0x01,0x0b,4, "clear variables in a range"},
223b71206888 Initial import
thib
parents:
diff changeset
279 {0,0,0x01,0x0b,0x64, "get summation of variables in a range"},
223b71206888 Initial import
thib
parents:
diff changeset
280 // scn2k_cmd.cc; Flags::Exec()
223b71206888 Initial import
thib
parents:
diff changeset
281 {0,0,0x01,0x0a,0, "SetStr"},
223b71206888 Initial import
thib
parents:
diff changeset
282 {0,0,0x01,0x0a,1, "ClearStr"},
223b71206888 Initial import
thib
parents:
diff changeset
283 {0,0,0x01,0x0a,2, "AppendStr"},
223b71206888 Initial import
thib
parents:
diff changeset
284 {0,0,0x01,0x0a,3, "StrLen"},
223b71206888 Initial import
thib
parents:
diff changeset
285 {0,0,0x01,0x0a,4, "StrCmp"},
223b71206888 Initial import
thib
parents:
diff changeset
286 {0,0,0x01,0x0a,5, "SubStrL"},
223b71206888 Initial import
thib
parents:
diff changeset
287 {0,0,0x01,0x0a,6, "SubStrR"},
223b71206888 Initial import
thib
parents:
diff changeset
288 {0,0,0x01,0x0a,7, "StrLenWideChar"},
223b71206888 Initial import
thib
parents:
diff changeset
289 {0,0,0x01,0x0a,8, "TrimStr"},
223b71206888 Initial import
thib
parents:
diff changeset
290 {0,0,0x01,0x0a,0x0f, "IntToStr"},
223b71206888 Initial import
thib
parents:
diff changeset
291 {0,0,0x01,0x0a,0x11, "IntToStr_Fill"},
223b71206888 Initial import
thib
parents:
diff changeset
292 {0,0,0x01,0x0a,0x64, "ShowStr"},
223b71206888 Initial import
thib
parents:
diff changeset
293 // scn2k_text.cc; TextImpl::Exec()
223b71206888 Initial import
thib
parents:
diff changeset
294 {0,0,0x01,0x21,0x49, "SetFaceGraphic"},
223b71206888 Initial import
thib
parents:
diff changeset
295 {0,0,0x01,0x21,0x4b, "SetFaceGraphic"},
223b71206888 Initial import
thib
parents:
diff changeset
296 {0,0,0x01,0x21,0x4c, "SetFaceGraphic"},
223b71206888 Initial import
thib
parents:
diff changeset
297 {0,0,0x00,0x03,0x97, "CloseTextWindow"},
223b71206888 Initial import
thib
parents:
diff changeset
298 {0,0,0x00,0x03,0x11, "WaitText"},
223b71206888 Initial import
thib
parents:
diff changeset
299 {0,0,0x00,0x03,0x03, "TextReturn"},
223b71206888 Initial import
thib
parents:
diff changeset
300 {0,0,0x00,0x03,0xc9, "TextReturn"},
223b71206888 Initial import
thib
parents:
diff changeset
301 {0,0,0x00,0x03,0x3e8,"SetFaceGraphic"},
223b71206888 Initial import
thib
parents:
diff changeset
302 {0,0,0x00,0x03,0x3e9,"SetFaceGraphic"},
223b71206888 Initial import
thib
parents:
diff changeset
303 {0,0,0x00,0x03,0x78, "TextRuby"},
223b71206888 Initial import
thib
parents:
diff changeset
304 {0,0,0x00,0x03,0x66, "SetTextWindowType"},
223b71206888 Initial import
thib
parents:
diff changeset
305 {0,0,0x00,0x03,0x67, "OpenTextWindow"},
223b71206888 Initial import
thib
parents:
diff changeset
306 {0,0,0x00,0x03,0x98, "ClearTextWindow"},
223b71206888 Initial import
thib
parents:
diff changeset
307 {0,0,0x00,0x03,0x68, "ShowText"},
223b71206888 Initial import
thib
parents:
diff changeset
308 {0,0,0x00,0x02,0x01, "Select"},
223b71206888 Initial import
thib
parents:
diff changeset
309 {0,0,0x00,0x02,0x03, "Select"},
223b71206888 Initial import
thib
parents:
diff changeset
310 {0,0,0x00,0x04,0x44c,"TextSkipStart"},
223b71206888 Initial import
thib
parents:
diff changeset
311 {0,0,0x00,0x04,0x3e8,"CloseTextWindow"},
223b71206888 Initial import
thib
parents:
diff changeset
312 {0,0,0x01,0x04,0x64, "WaitTime"},
223b71206888 Initial import
thib
parents:
diff changeset
313 {0,0,0x01,0x04,0x6f, "WaitTime"},
223b71206888 Initial import
thib
parents:
diff changeset
314 {0,0,0x01,0x04,0x79, "WaitTime"},
223b71206888 Initial import
thib
parents:
diff changeset
315 {0,0,0x01,0x04,0x65, "WaitTime w/ Cancel"},
223b71206888 Initial import
thib
parents:
diff changeset
316 {0,0,0x01,0x04,0x70, "WaitTime w/ Cancel"},
223b71206888 Initial import
thib
parents:
diff changeset
317 {0,0,0x01,0x04,0x1fe,"GetTimer"},
223b71206888 Initial import
thib
parents:
diff changeset
318 {0,0,0x01,0x04,0x201,"ResetTimer (unsupported; see rldev)"},
223b71206888 Initial import
thib
parents:
diff changeset
319 {0,0,0x01,0x04,0x202,"ResetTimerAll (unsupported; see rldev)"},
223b71206888 Initial import
thib
parents:
diff changeset
320 {0,0,0x01,0x04,0x72, "GetTimer"},
223b71206888 Initial import
thib
parents:
diff changeset
321 {0,0,0x01,0x04,0x7c, "GetTimer(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
322 {0,0,0x01,0x04,0x6e, "ClearTimer"},
223b71206888 Initial import
thib
parents:
diff changeset
323 {0,0,0x01,0x04,0x78, "ClearTimer(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
324 {0,0,0x01,0x04,0x26c,"ClearTimer(multi)"},
223b71206888 Initial import
thib
parents:
diff changeset
325 {0,0,0x01,0x04,0x270,"ClearTimer(multi)"},
223b71206888 Initial import
thib
parents:
diff changeset
326 {0,0,0x01,0x04,0x276,"GetTimer(multi)"},
223b71206888 Initial import
thib
parents:
diff changeset
327 {0,0,0x01,0x04,0x1f4,"SetTimer"},
223b71206888 Initial import
thib
parents:
diff changeset
328 {0,0,0x01,0x04,0x3e8,"rand(x,y)"},
223b71206888 Initial import
thib
parents:
diff changeset
329 {0,0,0x01,0x04,0x3ec,"min(x,y)"},
223b71206888 Initial import
thib
parents:
diff changeset
330 {0,0,0x01,0x04,0x3ef,"min(x,y)"},
223b71206888 Initial import
thib
parents:
diff changeset
331 {0,0,0x01,0x04,0x320,"range conversion(V,?,ResultMin,ValMin,ValMax,ResultMax,?)"},
223b71206888 Initial import
thib
parents:
diff changeset
332 {0,0,0x01,0x04,0x3f1,"in_range(x,y,a)"},
223b71206888 Initial import
thib
parents:
diff changeset
333 {0,0,0x01,0x04,0x16c,"SetCursorType?"},
223b71206888 Initial import
thib
parents:
diff changeset
334 {0,0,0x01,0x04,0xbc1,"LoadFromMenu"},
223b71206888 Initial import
thib
parents:
diff changeset
335 {0,0,0x01,0x04,0x8d4,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
336 {0,0,0x01,0x04,0x8d5,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
337 {0,0,0x01,0x04,0x8d6,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
338 {0,0,0x01,0x04,0x8d7,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
339 {0,0,0x01,0x04,0x8d8,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
340 {0,0,0x01,0x04,0x8db,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
341 {0,0,0x01,0x04,0x93f,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
342 {0,0,0x01,0x04,0xa39,"SetTextWindowColor"},
223b71206888 Initial import
thib
parents:
diff changeset
343 {0,0,0x01,0x04,0xa28,"Get #INIT_MESSAGE_SPEED (original) from gameexe.ini"},
223b71206888 Initial import
thib
parents:
diff changeset
344 {0,0,0x01,0x04,0xa29,"Get #INIT_MESSAGE_SPEED (original) from gameexe.ini"},
223b71206888 Initial import
thib
parents:
diff changeset
345 {0,0,0x01,0x04,0xa2c,"Get #MESSAGE_KEY_WAIT_USE (original) from gameexe.ini"},
223b71206888 Initial import
thib
parents:
diff changeset
346 {0,0,0x01,0x04,0xa2d,"Get #INIT_MESSAGE_SPEED (original) from gameexe.ini"},
223b71206888 Initial import
thib
parents:
diff changeset
347 {0,0,0x01,0x04,0xa2e,"Get #MESSAGE_KEY_WAIT_TIME (original) from gameexe.ini"},
223b71206888 Initial import
thib
parents:
diff changeset
348 {0,0,0x01,0x04,0x913,"Get #INIT_MESSAGE_SPEED"},
223b71206888 Initial import
thib
parents:
diff changeset
349 {0,0,0x01,0x04,0x914,"Get #INIT_MESSAGE_SPEED_MOD"},
223b71206888 Initial import
thib
parents:
diff changeset
350 {0,0,0x01,0x04,0x92e,"Get #MESSAGE_KEY_WAIT_USE"},
223b71206888 Initial import
thib
parents:
diff changeset
351 {0,0,0x01,0x04,0x92f,"Get #INIT_MESSAGE_SPEED_MOD"},
223b71206888 Initial import
thib
parents:
diff changeset
352 {0,0,0x01,0x04,0x930,"Get #MESSAGE_KEY_WAIT_TIME"},
223b71206888 Initial import
thib
parents:
diff changeset
353 {0,0,0x01,0x04,0x8af,"Set #INIT_MESSAGE_SPEED"},
223b71206888 Initial import
thib
parents:
diff changeset
354 {0,0,0x01,0x04,0x8b0,"Set #INIT_MESSAGE_SPEED_MOD"},
223b71206888 Initial import
thib
parents:
diff changeset
355 {0,0,0x01,0x04,0x8ca,"Set #MESSAGE_KEY_WAIT_USE"},
223b71206888 Initial import
thib
parents:
diff changeset
356 {0,0,0x01,0x04,0x8cb,"Set #INIT_MESSAGE_SPEED_MOD"},
223b71206888 Initial import
thib
parents:
diff changeset
357 {0,0,0x01,0x04,0x8cc,"Set #MESSAGE_KEY_WAIT_USE"},
223b71206888 Initial import
thib
parents:
diff changeset
358 {0,0,0x01,0x04,0x51f,"Set Name Text"},
223b71206888 Initial import
thib
parents:
diff changeset
359 {0,0,0x01,0x04,0x51e,"Get Name Text"},
223b71206888 Initial import
thib
parents:
diff changeset
360 {0,0,0x01,0x04,0x514,"Get Name Text"},
223b71206888 Initial import
thib
parents:
diff changeset
361 // scn2k_grp.cc; GrpImpl::Exec()
223b71206888 Initial import
thib
parents:
diff changeset
362 // music commands
223b71206888 Initial import
thib
parents:
diff changeset
363 {0,0,0x01,0x14,0, "PlayBGM"},
223b71206888 Initial import
thib
parents:
diff changeset
364 {0,0,0x01,0x14,2, "PlayBGM"},
223b71206888 Initial import
thib
parents:
diff changeset
365 {0,0,0x01,0x14,0x05, "StopBGM"},
223b71206888 Initial import
thib
parents:
diff changeset
366 {0,0,0x01,0x14,0x69, "FadeBGM"},
223b71206888 Initial import
thib
parents:
diff changeset
367 {0,0,0x01,0x15,0, "PlaySE"},
223b71206888 Initial import
thib
parents:
diff changeset
368 {0,0,0x01,0x15,2, "PlaySE"},
223b71206888 Initial import
thib
parents:
diff changeset
369 {0,0,0x01,0x17,0, "PlayKoe"},
223b71206888 Initial import
thib
parents:
diff changeset
370 {0,0,0x01,0x1a,1, "PlayMovie"},
223b71206888 Initial import
thib
parents:
diff changeset
371 {0,0,0x01,0x1a,0x14, "PlayMovie"},
223b71206888 Initial import
thib
parents:
diff changeset
372 // graphic commands
223b71206888 Initial import
thib
parents:
diff changeset
373 {0,0,0x01,0x1e,0, "GraphicStackClear"},
223b71206888 Initial import
thib
parents:
diff changeset
374 {0,0,0x01,0x1f,0, "GraphicStackClear"},
223b71206888 Initial import
thib
parents:
diff changeset
375 {0,0,0x01,0x21,0x46, "LoadSurface"},
223b71206888 Initial import
thib
parents:
diff changeset
376 {0,0,0x01,0x21,0x49, "LoadBackSurface"},
223b71206888 Initial import
thib
parents:
diff changeset
377 {0,0,0x01,0x21,0x4b, "LoadForeSurface"},
223b71206888 Initial import
thib
parents:
diff changeset
378 {0,0,0x01,0x21,0x4c, "LoadSurface"},
223b71206888 Initial import
thib
parents:
diff changeset
379 {0,0,0x01,0x21,0x64, "CopySurface"},
223b71206888 Initial import
thib
parents:
diff changeset
380 {0,0,0x01,0x21,0x4b1,"ClearSurface"},
223b71206888 Initial import
thib
parents:
diff changeset
381 {0,0,0x01,0x21,0x44c,"AlphaCopy"},
223b71206888 Initial import
thib
parents:
diff changeset
382 {0,0,0x01,0x21,0x640,"SaturateCopy"},
223b71206888 Initial import
thib
parents:
diff changeset
383 {0,0,0x01,0x21,0x196,"??? grp"},
223b71206888 Initial import
thib
parents:
diff changeset
384 {0,0,0x01,0x22,0xc30,"ScrollEffect (Princess Bride)"},
223b71206888 Initial import
thib
parents:
diff changeset
385 {0,0,0x01,0x22,0xc1c,"FallEffect (Princess Bride)"},
223b71206888 Initial import
thib
parents:
diff changeset
386 {0,0,0x01,0x22,0x835,"FallEffect (Princess Bride)"},
223b71206888 Initial import
thib
parents:
diff changeset
387 // grphic object commands
223b71206888 Initial import
thib
parents:
diff changeset
388 {0,0,0x01,0x04,0xd2, "??? grp"},
223b71206888 Initial import
thib
parents:
diff changeset
389 {0,0,0x01,0x04,0xd3, "??? grp"},
223b71206888 Initial import
thib
parents:
diff changeset
390 {0,0,0x01,0x04,0xd7, "??? grp"},
223b71206888 Initial import
thib
parents:
diff changeset
391 {0,0,0x01,0x04,0xd8, "??? grp"},
223b71206888 Initial import
thib
parents:
diff changeset
392 {0,0,0x01,0x04,0x5e0,"GetShownGrpFlag"},
223b71206888 Initial import
thib
parents:
diff changeset
393 {0,0,0x01,0x3d,0x0a, "ClearGrpObj"},
223b71206888 Initial import
thib
parents:
diff changeset
394 {0,0,0x01,0x3d,0x0b, "ClearGrpObj"},
223b71206888 Initial import
thib
parents:
diff changeset
395 {0,0,0x01,0x3e,0x0a, "ClearGrpObj"},
223b71206888 Initial import
thib
parents:
diff changeset
396 {0,0,0x01,0x3e,0x0a, "ClearGrpObj"},
223b71206888 Initial import
thib
parents:
diff changeset
397 {0,0,0x01,0x3c,0x01, "??? grp (CLANNAD)"},
223b71206888 Initial import
thib
parents:
diff changeset
398 {0,0,0x01,0x47,0x3e8,"SetGrpObj_Fname"},
223b71206888 Initial import
thib
parents:
diff changeset
399 {0,0,0x01,0x47,0x3eb,"SetGrpObj_GANname"},
223b71206888 Initial import
thib
parents:
diff changeset
400 {0,0,0x01,0x47,0x4b0,"SetGrpObj_Text"},
223b71206888 Initial import
thib
parents:
diff changeset
401 {0,0,0x01,0x48,0x3e8,"SetGrpObj_ForeGrp?"},
223b71206888 Initial import
thib
parents:
diff changeset
402 {0,0,0x01,0x49,0, "StopAnimation"},
223b71206888 Initial import
thib
parents:
diff changeset
403 {0,0,0x01,0x49,3, "QueryExecAnimation"},
223b71206888 Initial import
thib
parents:
diff changeset
404 {0,0,0x01,0x49,0x7d3,"SetGrpObj_GAN?"},
223b71206888 Initial import
thib
parents:
diff changeset
405 {0,0,0x01,0x49,0xbb9,"StartAnimation"},
223b71206888 Initial import
thib
parents:
diff changeset
406 {0,0,0x01,0x49,0xbbb,"StartAnimation"},
223b71206888 Initial import
thib
parents:
diff changeset
407 {0,0,0x01,0x49,0xbbd,"StartAnimation"},
223b71206888 Initial import
thib
parents:
diff changeset
408 {0,0,0x01,0x51,0x3e8,"SetGrpObj_xy"},
223b71206888 Initial import
thib
parents:
diff changeset
409 {0,0,0x01,0x51,0x3e9,"SetGrpObj_x"},
223b71206888 Initial import
thib
parents:
diff changeset
410 {0,0,0x01,0x51,0x3ea,"SetGrpObj_y"},
223b71206888 Initial import
thib
parents:
diff changeset
411 {0,0,0x01,0x51,0x3eb,"SetGrpObj_alpha"},
223b71206888 Initial import
thib
parents:
diff changeset
412 {0,0,0x01,0x51,0x3ec,"SetGrpObj_visible"},
223b71206888 Initial import
thib
parents:
diff changeset
413 {0,0,0x01,0x51,0x3ee,"SetGrpObj_xy?"},
223b71206888 Initial import
thib
parents:
diff changeset
414 {0,0,0x01,0x51,0x3fd,"SetGrpObj_centering?"},
223b71206888 Initial import
thib
parents:
diff changeset
415 {0,0,0x01,0x51,0x401,"SetGrpObj_textsize"},
223b71206888 Initial import
thib
parents:
diff changeset
416 {0,0,0x01,0x51,0x40a,"SetGrpObj_clipregion"},
223b71206888 Initial import
thib
parents:
diff changeset
417 {0,0,0x01,0x51,0x40f,"SetGrpObj_surfacenum"},
223b71206888 Initial import
thib
parents:
diff changeset
418 {0,0,0x01,0x51,0x416,"SetGrpObj_expand"},
223b71206888 Initial import
thib
parents:
diff changeset
419 {0,0,0x01,0x51,0x419,"SetGrpObj_rotate"},
223b71206888 Initial import
thib
parents:
diff changeset
420 {0,0,0x01,0x52,0x3e8,"SetGrpObj_xy(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
421 {0,0,0x01,0x52,0x3ea,"SetGrpObj_y(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
422 {0,0,0x01,0x52,0x3eb,"SetGrpObj_alpha(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
423 {0,0,0x01,0x52,0x3ec,"SetGrpObj_visible(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
424 {0,0,0x01,0x52,0x3ee,"SetGrpObj_xy?(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
425 {0,0,0x01,0x52,0x3fd,"SetGrpObj_centering?(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
426 {0,0,0x01,0x52,0x401,"SetGrpObj_textsize(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
427 {0,0,0x01,0x52,0x408,"SetGrpObj_order (not supported)"},
223b71206888 Initial import
thib
parents:
diff changeset
428 {0,0,0x01,0x52,0x40a,"SetGrpObj_clipregion(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
429 {0,0,0x01,0x52,0x40f,"SetGrpObj_surfacenum(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
430 {0,0,0x01,0x52,0x416,"SetGrpObj_expand(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
431 {0,0,0x01,0x52,0x419,"SetGrpObj_rotate(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
432 {0,0,0x01,0x54,0x3e8,"GetGrpObj_xy"},
223b71206888 Initial import
thib
parents:
diff changeset
433 {0,0,0x01,0x54,0x44c,"GetGrpObj_wh"},
223b71206888 Initial import
thib
parents:
diff changeset
434
223b71206888 Initial import
thib
parents:
diff changeset
435 {0,0,0x02,0x3d,0x0a, "ClearGrpObj(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
436 {0,0,0x02,0x3d,0x0b, "ClearGrpObj(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
437 {0,0,0x02,0x3e,0x0a, "ClearGrpObj(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
438 {0,0,0x02,0x3e,0x0a, "ClearGrpObj(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
439 {0,0,0x02,0x3c,0x01, "??? grp (CLANNAD)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
440 {0,0,0x02,0x47,0x3e8,"SetGrpObj_Fname(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
441 {0,0,0x02,0x47,0x3eb,"SetGrpObj_GANname(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
442 {0,0,0x02,0x47,0x4b0,"SetGrpObj_Text(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
443 {0,0,0x02,0x48,0x3e8,"SetGrpObj_ForeGrp?(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
444 {0,0,0x02,0x49,0, "StopAnimation(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
445 {0,0,0x02,0x49,3, "QueryExecAnimation(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
446 {0,0,0x02,0x49,0x7d3,"SetGrpObj_GAN?(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
447 {0,0,0x02,0x49,0xbb9,"StartAnimation(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
448 {0,0,0x02,0x49,0xbbb,"StartAnimation(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
449 {0,0,0x02,0x49,0xbbd,"StartAnimation(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
450 {0,0,0x02,0x51,0x3e8,"SetGrpObj_xy(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
451 {0,0,0x02,0x51,0x3ea,"SetGrpObj_y(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
452 {0,0,0x02,0x51,0x3eb,"SetGrpObj_alpha(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
453 {0,0,0x02,0x51,0x3ec,"SetGrpObj_visible(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
454 {0,0,0x02,0x51,0x3ee,"SetGrpObj_xy?(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
455 {0,0,0x02,0x51,0x3fd,"SetGrpObj_centering?(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
456 {0,0,0x02,0x51,0x401,"SetGrpObj_textsize(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
457 {0,0,0x02,0x51,0x40a,"SetGrpObj_clipregion(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
458 {0,0,0x02,0x51,0x40f,"SetGrpObj_surfacenum(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
459 {0,0,0x02,0x51,0x416,"SetGrpObj_expand(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
460 {0,0,0x02,0x51,0x419,"SetGrpObj_rotate(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
461 {0,0,0x02,0x52,0x3e8,"SetGrpObj_xy(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
462 {0,0,0x02,0x52,0x3ea,"SetGrpObj_y(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
463 {0,0,0x02,0x52,0x3eb,"SetGrpObj_alpha(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
464 {0,0,0x02,0x52,0x3ec,"SetGrpObj_visible(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
465 {0,0,0x02,0x52,0x3ee,"SetGrpObj_xy?(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
466 {0,0,0x02,0x52,0x3fd,"SetGrpObj_centering?(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
467 {0,0,0x02,0x52,0x401,"SetGrpObj_textsize(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
468 {0,0,0x02,0x52,0x40a,"SetGrpObj_clipregion(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
469 {0,0,0x02,0x52,0x40f,"SetGrpObj_surfacenum(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
470 {0,0,0x02,0x52,0x416,"SetGrpObj_expand(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
471 {0,0,0x02,0x52,0x419,"SetGrpObj_rotate(2)(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
472 {0,0,0x02,0x54,0x3e8,"GetGrpObj_xy(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
473 {0,0,0x02,0x54,0x44c,"GetGrpObj_wh(2)"},
223b71206888 Initial import
thib
parents:
diff changeset
474 {0,0,0,0,0,0}
223b71206888 Initial import
thib
parents:
diff changeset
475 };
29
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
476 map<int, CmdDescrItem*> CmdD::cmd_descr;
d229cce98f50 * no more (or, at least, less) duplicate code between scn2kdump and the rest
thib
parents: 27
diff changeset
477 const char* CmdD::CmdDescr(int cmd1, int cmd2, int cmd3, int cmd4) {
0
223b71206888 Initial import
thib
parents:
diff changeset
478 if (cmd_descr.empty()) {
223b71206888 Initial import
thib
parents:
diff changeset
479 int i;
223b71206888 Initial import
thib
parents:
diff changeset
480 for (i=0; cmd_descr_orig[i].cmd_descr != 0; i++) {
223b71206888 Initial import
thib
parents:
diff changeset
481 CmdDescrItem& cur = cmd_descr_orig[i];
223b71206888 Initial import
thib
parents:
diff changeset
482 int item_num = cur.cmd1*1000000+cur.cmd2*10000+cur.cmd3;
223b71206888 Initial import
thib
parents:
diff changeset
483 map<int,CmdDescrItem*>::iterator it = cmd_descr.find(item_num);
223b71206888 Initial import
thib
parents:
diff changeset
484 if (it == cmd_descr.end()) cmd_descr[item_num] = &cur;
223b71206888 Initial import
thib
parents:
diff changeset
485 else {
223b71206888 Initial import
thib
parents:
diff changeset
486 cur.next = it->second;
223b71206888 Initial import
thib
parents:
diff changeset
487 it->second = &cur;
223b71206888 Initial import
thib
parents:
diff changeset
488 }
223b71206888 Initial import
thib
parents:
diff changeset
489 }
223b71206888 Initial import
thib
parents:
diff changeset
490 }
223b71206888 Initial import
thib
parents:
diff changeset
491 int item_num = cmd1*1000000+cmd2*10000+cmd3;
223b71206888 Initial import
thib
parents:
diff changeset
492 map<int,CmdDescrItem*>::iterator it = cmd_descr.find(item_num);
223b71206888 Initial import
thib
parents:
diff changeset
493 if (it == cmd_descr.end()) return "No descr (unsupported)";
223b71206888 Initial import
thib
parents:
diff changeset
494 CmdDescrItem* cur = it->second;
223b71206888 Initial import
thib
parents:
diff changeset
495 do {
223b71206888 Initial import
thib
parents:
diff changeset
496 if (cur->cmd1 == cmd1 && cur->cmd2 == cmd2 && cur->cmd3 == cmd3) {
223b71206888 Initial import
thib
parents:
diff changeset
497 return cur->cmd_descr;
223b71206888 Initial import
thib
parents:
diff changeset
498 }
223b71206888 Initial import
thib
parents:
diff changeset
499 cur = cur->next;
223b71206888 Initial import
thib
parents:
diff changeset
500 } while(cur != 0);
223b71206888 Initial import
thib
parents:
diff changeset
501 return "No descr (unsupported)";
223b71206888 Initial import
thib
parents:
diff changeset
502 }