Mercurial > otakunoraifu
comparison scn2k/scn2k_cmd.cc @ 29:d229cce98f50
* no more (or, at least, less) duplicate code between scn2kdump and the rest
author | thib |
---|---|
date | Fri, 06 Mar 2009 20:02:26 +0000 |
parents | d1bb7b365816 |
children | 01aa5ddf7dc8 |
comparison
equal
deleted
inserted
replaced
28:f1f22bfc4496 | 29:d229cce98f50 |
---|---|
936 dprintf("args:"); | 936 dprintf("args:"); |
937 VarInfo var; | 937 VarInfo var; |
938 int i; for (i=0; i<100 ; i++) { | 938 int i; for (i=0; i<100 ; i++) { |
939 /* number, variable, string の種別なく値を得る */ | 939 /* number, variable, string の種別なく値を得る */ |
940 if (*d == 0x61) { // よくわからない(智代アフター) | 940 if (*d == 0x61) { // よくわからない(智代アフター) |
941 dprintf("*%d*",d[1]); | 941 dprintf("@%d",d[1]); |
942 d += 2; | 942 d += 2; |
943 if (*d == 0x28) { | 943 if (*d == 0x28) { |
944 dprintf("{"); | 944 dprintf("{"); |
945 GetArgs(d); // (A,B,C)節が含まれることがある | 945 GetArgs(d); // (A,B,C)節が含まれることがある |
946 dprintf("}"); | 946 dprintf("}"); |
1235 argc = read_little_endian_short(d+5); | 1235 argc = read_little_endian_short(d+5); |
1236 cmd4 = *(unsigned const char*)(d+7); | 1236 cmd4 = *(unsigned const char*)(d+7); |
1237 d += 8; | 1237 d += 8; |
1238 /* verbose */ | 1238 /* verbose */ |
1239 // dprintf(" 0x23 - cmd %02x-%02x:%04x:%02x[%2d] \n",cmd1,cmd2,cmd3,cmd4,argc); | 1239 // dprintf(" 0x23 - cmd %02x-%02x:%04x:%02x[%2d] \n",cmd1,cmd2,cmd3,cmd4,argc); |
1240 sprintf(cmdstr, "%02x-%02x:%04x:%02x",cmd1,cmd2,cmd3,cmd4); | 1240 sprintf(cmdstr, "%02x-%02x:%04x:%02x : %s",cmd1,cmd2,cmd3,cmd4, CmdDescr(cmd1,cmd2,cmd3,cmd4)); |
1241 /* 引数を得る */ | 1241 /* 引数を得る */ |
1242 /* 特殊引数のもの */ | 1242 /* 特殊引数のもの */ |
1243 int is_special = 0; | 1243 int is_special = 0; |
1244 if (cmd1 == 0) { | 1244 if (cmd1 == 0) { |
1245 if (cmd2 == 1) { | 1245 if (cmd2 == 1) { |
1293 } | 1293 } |
1294 } | 1294 } |
1295 retry: | 1295 retry: |
1296 /* 一般引数のもの */ | 1296 /* 一般引数のもの */ |
1297 if (!is_special) { | 1297 if (!is_special) { |
1298 dprintf(" 0x23 - cmd %02x-%02x:%04x:%02x[%2d] \n",cmd1,cmd2,cmd3,cmd4,argc); | 1298 dprintf(" 0x23 - cmd %02x-%02x:%04x:%02x[%2d] : %s\n",cmd1,cmd2,cmd3,cmd4,argc,CmdDescr(cmd1,cmd2,cmd3,cmd4)); |
1299 dprintf("\t"); | 1299 dprintf("\t"); |
1300 if (cmd1 == 1 && cmd2 == 0x22 && (cmd3 == 0xc1c || cmd3 == 0x835)) GetArgsSpecial(3, d); | 1300 if (cmd1 == 1 && cmd2 == 0x22 && (cmd3 == 0xc1c || cmd3 == 0x835)) GetArgsSpecial(3, d); |
1301 else if (cmd1 == 1 && cmd2 == 0x0b && cmd3 == 0x65) GetArgsSpecial(0, d); | 1301 else if (cmd1 == 1 && cmd2 == 0x0b && cmd3 == 0x65) GetArgsSpecial(0, d); |
1302 else if (cmd1 == 1 && cmd2 == 0x15 && cmd3 == 0x28) GetArgsSpecial(0, d); | 1302 else if (cmd1 == 1 && cmd2 == 0x15 && cmd3 == 0x28) GetArgsSpecial(0, d); |
1303 else if (cmd1 == 1 && cmd2 == 4 && (cmd3 == 0x26c || cmd3 == 0x26d || cmd3 == 0x270 || cmd3 == 0x276)) GetArgsSpecial(0, d); | 1303 else if (cmd1 == 1 && cmd2 == 4 && (cmd3 == 0x26c || cmd3 == 0x26d || cmd3 == 0x270 || cmd3 == 0x276)) GetArgsSpecial(0, d); |