Ticket #9088: descumm.diff
File descumm.diff, 19.8 KB (added by , 15 years ago) |
---|
-
descumm.cpp
93 93 #define ANOFIRSTPAREN (1<<29) 94 94 #define ASTARTCOMMA (1<<28) 95 95 #define AVARSTORE (1<<27) 96 #define ANOENDSEMICOLON (1<<26) 96 97 97 98 98 99 … … 662 663 char tmp[256]; 663 664 strcpy(tmp, buforg); 664 665 emit_if(buforg, tmp); 665 } else if (!(args & ANOLASTPAREN)) { 666 buf = strecpy(buf, ")"); 666 } else { 667 if (!(args & ANOLASTPAREN)) { 668 buf = strecpy(buf, ")"); 669 } 670 if (!(args & ANOENDSEMICOLON) && buf[(strlen(buf) - 1)] != ';') { 671 buf = strecpy(buf, ";"); 672 } 667 673 } 668 674 669 675 return strchr(buf, 0); … … 710 716 buf += sprintf(buf, "Color(%d, %s)", get_byte(), arg); 711 717 break; 712 718 case 3: 713 buf = do_tok(buf, "Name", A1ASCII );719 buf = do_tok(buf, "Name", A1ASCII | ANOENDSEMICOLON); 714 720 break; 715 721 case 4: 716 722 buf += sprintf(buf, "Costume(%s)", arg); … … 730 736 731 737 char first = 1; 732 738 733 buf = do_tok(buf, "ActorOps", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN );739 buf = do_tok(buf, "ActorOps", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN | ANOENDSEMICOLON); 734 740 735 741 buf = strecpy(buf, ",["); 736 742 … … 748 754 749 755 switch (opcode & 0x1F) { 750 756 case 0x00: 751 buf = do_tok(buf, "Unknown", ((opcode & 0x80) ? A1V : A1B) );757 buf = do_tok(buf, "Unknown", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 752 758 break; 753 759 case 0x01: 754 buf = do_tok(buf, "Costume", ((opcode & 0x80) ? A1V : A1B) );760 buf = do_tok(buf, "Costume", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 755 761 break; 756 762 case 0x02: 757 buf = do_tok(buf, "WalkSpeed", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) );763 buf = do_tok(buf, "WalkSpeed", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 758 764 break; 759 765 case 0x03: 760 buf = do_tok(buf, "Sound", ((opcode & 0x80) ? A1V : A1B) );766 buf = do_tok(buf, "Sound", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 761 767 break; 762 768 case 0x04: 763 buf = do_tok(buf, "WalkAnimNr", ((opcode & 0x80) ? A1V : A1B) );769 buf = do_tok(buf, "WalkAnimNr", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 764 770 break; 765 771 case 0x05: 766 772 buf = 767 do_tok(buf, "TalkAnimNr", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) );773 do_tok(buf, "TalkAnimNr", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 768 774 break; 769 775 case 0x06: 770 buf = do_tok(buf, "StandAnimNr", ((opcode & 0x80) ? A1V : A1B) );776 buf = do_tok(buf, "StandAnimNr", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 771 777 break; 772 778 case 0x07: 773 779 buf = 774 780 do_tok(buf, "Nothing", 775 781 ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | 776 ((opcode & 0x20) ? A3V : A3B) );782 ((opcode & 0x20) ? A3V : A3B) | ANOENDSEMICOLON); 777 783 break; 778 784 case 0x08: 779 buf = do_tok(buf, "Init", 0);785 buf = do_tok(buf, "Init", ANOENDSEMICOLON); 780 786 break; 781 787 case 0x09: 782 buf = do_tok(buf, "Elevation", ((opcode & 0x80) ? A1V : A1W) );788 buf = do_tok(buf, "Elevation", ((opcode & 0x80) ? A1V : A1W) | ANOENDSEMICOLON); 783 789 break; 784 790 case 0x0A: 785 buf = do_tok(buf, "DefaultAnims", 0);791 buf = do_tok(buf, "DefaultAnims", ANOENDSEMICOLON); 786 792 break; 787 793 case 0x0B: 788 buf = do_tok(buf, "Palette", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) );794 buf = do_tok(buf, "Palette", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 789 795 break; 790 796 case 0x0C: 791 buf = do_tok(buf, "TalkColor", ((opcode & 0x80) ? A1V : A1B) );797 buf = do_tok(buf, "TalkColor", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 792 798 break; 793 799 case 0x0D: 794 buf = do_tok(buf, "Name", A1ASCII );800 buf = do_tok(buf, "Name", A1ASCII | ANOENDSEMICOLON); 795 801 break; 796 802 case 0x0E: 797 buf = do_tok(buf, "InitAnimNr", ((opcode & 0x80) ? A1V : A1B) );803 buf = do_tok(buf, "InitAnimNr", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 798 804 break; 799 805 // case 0x0F: buf=do_tok(buf, "PaletteList", A1LIST); break; 800 806 case 0x10: 801 buf = do_tok(buf, "Width", ((opcode & 0x80) ? A1V : A1B) );807 buf = do_tok(buf, "Width", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 802 808 break; 803 809 case 0x11: 804 810 if (g_options.scriptVersion == 5) 805 buf = do_tok(buf, "Scale", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) );811 buf = do_tok(buf, "Scale", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 806 812 else 807 buf = do_tok(buf, "Scale", ((opcode & 0x80) ? A1V : A1B) );813 buf = do_tok(buf, "Scale", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 808 814 break; 809 815 case 0x12: 810 buf = do_tok(buf, "NeverZClip", 0);816 buf = do_tok(buf, "NeverZClip", ANOENDSEMICOLON); 811 817 break; 812 818 case 0x13: 813 buf = do_tok(buf, "SetZClip", ((opcode & 0x80) ? A1V : A1B) );819 buf = do_tok(buf, "SetZClip", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 814 820 break; 815 821 case 0x14: 816 buf = do_tok(buf, "IgnoreBoxes", 0);822 buf = do_tok(buf, "IgnoreBoxes", ANOENDSEMICOLON); 817 823 break; 818 824 case 0x15: 819 buf = do_tok(buf, "FollowBoxes", 0);825 buf = do_tok(buf, "FollowBoxes", ANOENDSEMICOLON); 820 826 break; 821 827 case 0x16: 822 buf = do_tok(buf, "AnimSpeed", ((opcode & 0x80) ? A1V : A1B) );828 buf = do_tok(buf, "AnimSpeed", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 823 829 break; 824 830 case 0x17: 825 buf=do_tok(buf, "ShadowMode", ((opcode & 0x80) ? A1V : A1B) );831 buf=do_tok(buf, "ShadowMode", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 826 832 break; 827 833 default: 828 834 buf += sprintf(buf, "Unknown%.2X()", opcode); … … 1075 1081 buf = strecpy(buf, ",IG"); 1076 1082 } while (1); 1077 1083 1078 strcpy(buf, ") ");1084 strcpy(buf, ");"); 1079 1085 } 1080 1086 1081 1087 void do_room_ops(char *buf) { … … 1085 1091 1086 1092 switch (opcode & 0x1F) { 1087 1093 case 0x01: 1088 do_tok(buf, "RoomScroll", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) );1094 do_tok(buf, "RoomScroll", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOENDSEMICOLON); 1089 1095 break; 1090 1096 case 0x02: 1091 do_tok(buf, "RoomColor", 0);1097 do_tok(buf, "RoomColor", ANOENDSEMICOLON); 1092 1098 break; 1093 1099 case 0x03: 1094 do_tok(buf, "SetScreen", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) );1100 do_tok(buf, "SetScreen", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOENDSEMICOLON); 1095 1101 break; 1096 1102 case 0x04: 1097 1103 buf = 1098 1104 do_tok(buf, "SetPalColor", 1099 1105 ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | 1100 ((opcode & 0x20) ? A3V : A3W) | ANOLASTPAREN );1106 ((opcode & 0x20) ? A3V : A3W) | ANOLASTPAREN | ANOENDSEMICOLON); 1101 1107 opcode = get_byte(); 1102 buf = do_tok(buf, NULL, ASTARTCOMMA | ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1B));1108 buf = do_tok(buf, NULL, ASTARTCOMMA | ANOFIRSTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1B)); 1103 1109 break; 1104 1110 case 0x05: 1105 do_tok(buf, "ShakeOn", 0);1111 do_tok(buf, "ShakeOn", ANOENDSEMICOLON); 1106 1112 break; 1107 1113 case 0x06: 1108 do_tok(buf, "ShakeOff", 0);1114 do_tok(buf, "ShakeOff", ANOENDSEMICOLON); 1109 1115 break; 1110 1116 case 0x07: 1111 do_tok(buf, "Unused", 0);1117 do_tok(buf, "Unused", ANOENDSEMICOLON); 1112 1118 break; 1113 1119 case 0x08: 1114 1120 buf = 1115 1121 do_tok(buf, "RoomIntensity", 1116 1122 ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | 1117 ((opcode & 0x20) ? A3V : A3B) );1123 ((opcode & 0x20) ? A3V : A3B) | ANOENDSEMICOLON); 1118 1124 break; 1119 1125 case 0x09: 1120 buf = do_tok(buf, "saveLoad", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) );1126 buf = do_tok(buf, "saveLoad", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 1121 1127 break; 1122 1128 case 0x0A: 1123 buf = do_tok(buf, "screenEffect", ((opcode & 0x80) ? A1V : A1W) );1129 buf = do_tok(buf, "screenEffect", ((opcode & 0x80) ? A1V : A1W) | ANOENDSEMICOLON); 1124 1130 break; 1125 1131 case 0x0B: 1126 1132 buf = 1127 1133 do_tok(buf, "setRGBRoomIntensity", 1128 ANOLASTPAREN | ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ?1134 ANOLASTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? 1129 1135 A2V : A2W) | 1130 1136 ((opcode & 0x20) ? A3V : A3W)); 1131 1137 opcode = get_byte(); 1132 1138 buf = 1133 1139 do_tok(buf, NULL, 1134 ASTARTCOMMA | ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1B) |1140 ASTARTCOMMA | ANOFIRSTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1B) | 1135 1141 ((opcode & 0x40) ? A2V : A2B)); 1136 1142 break; 1137 1143 1138 1144 case 0x0C: 1139 1145 buf = 1140 1146 do_tok(buf, "setRoomShadow", 1141 ANOLASTPAREN | ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ?1147 ANOLASTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? 1142 1148 A2V : A2W) | 1143 1149 ((opcode & 0x20) ? A3V : A3W)); 1144 1150 opcode = get_byte(); 1145 1151 buf = 1146 1152 do_tok(buf, NULL, 1147 ASTARTCOMMA | ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1B) |1153 ASTARTCOMMA | ANOFIRSTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1B) | 1148 1154 ((opcode & 0x40) ? A2V : A2B)); 1149 1155 break; 1150 1156 1151 1157 case 0x0D: 1152 do_tok(buf, "saveString", ((opcode & 0x80) ? A1V : A1B) | A2ASCII );1158 do_tok(buf, "saveString", ((opcode & 0x80) ? A1V : A1B) | A2ASCII | ANOENDSEMICOLON); 1153 1159 break; 1154 1160 case 0x0E: 1155 do_tok(buf, "loadString", ((opcode & 0x80) ? A1V : A1B) | A2ASCII );1161 do_tok(buf, "loadString", ((opcode & 0x80) ? A1V : A1B) | A2ASCII | ANOENDSEMICOLON); 1156 1162 break; 1157 1163 1158 1164 case 0x0F: 1159 buf = do_tok(buf, "palManipulate", ANOLASTPAREN | ((opcode & 0x80) ? A1V : A1B));1165 buf = do_tok(buf, "palManipulate", ANOLASTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1B)); 1160 1166 opcode = get_byte(); 1161 1167 buf = 1162 1168 do_tok(buf, NULL, 1163 ASTARTCOMMA | ANOFIRSTPAREN | ANOLASTPAREN | ((opcode & 0x80) ?1169 ASTARTCOMMA | ANOFIRSTPAREN | ANOLASTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? 1164 1170 A1V : A1B) | 1165 1171 ((opcode & 0x40) ? A2V : A2B)); 1166 1172 opcode = get_byte(); … … 1168 1174 break; 1169 1175 1170 1176 case 0x10: 1171 do_tok(buf, "colorCycleDelay", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) );1177 do_tok(buf, "colorCycleDelay", ((opcode & 0x80) ? A1V : A1B) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 1172 1178 break; 1173 1179 1174 1180 default: 1175 1181 strcpy(buf, "Unknown??"); 1176 1182 } 1177 1183 1178 strcat(buf, ") ");1184 strcat(buf, ");"); 1179 1185 } 1180 1186 1181 1187 void do_room_ops_old(char *buf, byte opcode) { … … 1305 1311 void do_verbops_v2(char *buf, byte opcode) { 1306 1312 int subop = get_byte(); 1307 1313 1308 buf = do_tok(buf, "VerbOps", ANOLASTPAREN );1314 buf = do_tok(buf, "VerbOps", ANOLASTPAREN | ANOENDSEMICOLON); 1309 1315 switch (subop) { 1310 1316 case 0: 1311 buf = do_tok(buf, "Delete", (opcode & 0x80) ? A1V : A1B );1317 buf = do_tok(buf, "Delete", (opcode & 0x80) ? A1V : A1B | ANOENDSEMICOLON); 1312 1318 break; 1313 1319 case 0xFF: 1314 buf = do_tok(buf, "State", A1B | A2B );1320 buf = do_tok(buf, "State", A1B | A2B | ANOENDSEMICOLON); 1315 1321 break; 1316 1322 default: 1317 1323 buf += sprintf(buf, "New-%d", subop); 1318 buf = do_tok(buf, "", A1B | A2B | ((opcode & 0x80) ? A3V : A3B) | A4B | A5ASCII );1324 buf = do_tok(buf, "", A1B | A2B | ((opcode & 0x80) ? A3V : A3B) | A4B | A5ASCII | ANOENDSEMICOLON); 1319 1325 } 1320 strecpy(buf, ") ");1326 strecpy(buf, ");"); 1321 1327 } 1322 1328 1323 1329 void do_verbops(char *buf, byte opcode) { 1324 1330 char first = 1; 1325 1331 1326 buf = do_tok(buf, "VerbOps", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN );1332 buf = do_tok(buf, "VerbOps", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN | ANOENDSEMICOLON); 1327 1333 buf = strecpy(buf, ",["); 1328 1334 1329 1335 do { … … 1335 1341 first = 0; 1336 1342 switch (opcode & 0x1F) { 1337 1343 case 0x1: 1338 buf = do_tok(buf, "Image", (opcode & 0x80) ? A1V : A1W );1344 buf = do_tok(buf, "Image", (opcode & 0x80) ? A1V : A1W | ANOENDSEMICOLON); 1339 1345 break; 1340 1346 case 0x2: 1341 buf = do_tok(buf, "Text", A1ASCII );1347 buf = do_tok(buf, "Text", A1ASCII | ANOENDSEMICOLON); 1342 1348 break; 1343 1349 case 0x3: 1344 buf = do_tok(buf, "Color", (opcode & 0x80) ? A1V : A1B );1350 buf = do_tok(buf, "Color", (opcode & 0x80) ? A1V : A1B | ANOENDSEMICOLON); 1345 1351 break; 1346 1352 case 0x4: 1347 buf = do_tok(buf, "HiColor", (opcode & 0x80) ? A1V : A1B );1353 buf = do_tok(buf, "HiColor", (opcode & 0x80) ? A1V : A1B | ANOENDSEMICOLON); 1348 1354 break; 1349 1355 case 0x5: 1350 buf = do_tok(buf, "SetXY", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) );1356 buf = do_tok(buf, "SetXY", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOENDSEMICOLON); 1351 1357 break; 1352 1358 case 0x6: 1353 buf = do_tok(buf, "On", 0);1359 buf = do_tok(buf, "On", ANOENDSEMICOLON); 1354 1360 break; 1355 1361 case 0x7: 1356 buf = do_tok(buf, "Off", 0);1362 buf = do_tok(buf, "Off", ANOENDSEMICOLON); 1357 1363 break; 1358 1364 case 0x8: 1359 buf = do_tok(buf, "Delete", 0);1365 buf = do_tok(buf, "Delete", ANOENDSEMICOLON); 1360 1366 break; 1361 1367 case 0x9: 1362 buf = do_tok(buf, "New", 0);1368 buf = do_tok(buf, "New", ANOENDSEMICOLON); 1363 1369 break; 1364 1370 case 0x10: 1365 buf = do_tok(buf, "DimColor", (opcode & 0x80) ? A1V : A1B );1371 buf = do_tok(buf, "DimColor", (opcode & 0x80) ? A1V : A1B | ANOENDSEMICOLON); 1366 1372 break; 1367 1373 case 0x11: 1368 buf = do_tok(buf, "Dim", 0);1374 buf = do_tok(buf, "Dim", ANOENDSEMICOLON); 1369 1375 break; 1370 1376 case 0x12: 1371 buf = do_tok(buf, "Key", (opcode & 0x80) ? A1V : A1B );1377 buf = do_tok(buf, "Key", (opcode & 0x80) ? A1V : A1B | ANOENDSEMICOLON); 1372 1378 break; 1373 1379 case 0x13: 1374 buf = do_tok(buf, "Center", 0);1380 buf = do_tok(buf, "Center", ANOENDSEMICOLON); 1375 1381 break; 1376 1382 case 0x14: 1377 buf = do_tok(buf, "SetToString", (opcode & 0x80) ? A1V : A1W );1383 buf = do_tok(buf, "SetToString", (opcode & 0x80) ? A1V : A1W | ANOENDSEMICOLON); 1378 1384 break; 1379 1385 case 0x16: 1380 1386 buf = 1381 do_tok(buf, "SetToObject", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2B) );1387 do_tok(buf, "SetToObject", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2B) | ANOENDSEMICOLON); 1382 1388 break; 1383 1389 case 0x17: 1384 buf = do_tok(buf, "BackColor", (opcode & 0x80) ? A1V : A1B );1390 buf = do_tok(buf, "BackColor", (opcode & 0x80) ? A1V : A1B | ANOENDSEMICOLON); 1385 1391 break; 1386 1392 default: 1387 1393 buf += sprintf(buf, "Invalid%.2X()", opcode); 1388 1394 } 1389 1395 1390 1396 } while (1); 1391 strecpy(buf, "]) ");1397 strecpy(buf, "]);"); 1392 1398 } 1393 1399 1394 1400 void do_print_ego(char *buf, byte opcode) { … … 1397 1403 if (opcode == 0xD8) { 1398 1404 buf = strecpy(buf, "printEgo(["); 1399 1405 } else { 1400 buf = do_tok(buf, "print", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN );1406 buf = do_tok(buf, "print", ((opcode & 0x80) ? A1V : A1B) | ANOLASTPAREN | ANOENDSEMICOLON); 1401 1407 buf = strecpy(buf, ",["); 1402 1408 } 1403 1409 … … 1412 1418 1413 1419 switch (opcode & 0x1f) { 1414 1420 case 0x0: 1415 buf = do_tok(buf, "Pos", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) );1421 buf = do_tok(buf, "Pos", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOENDSEMICOLON); 1416 1422 break; 1417 1423 case 0x1: 1418 buf = do_tok(buf, "Color", ((opcode & 0x80) ? A1V : A1B) );1424 buf = do_tok(buf, "Color", ((opcode & 0x80) ? A1V : A1B) | ANOENDSEMICOLON); 1419 1425 break; 1420 1426 case 0x2: 1421 buf = do_tok(buf, "Clipped", ((opcode & 0x80) ? A1V : A1W) );1427 buf = do_tok(buf, "Clipped", ((opcode & 0x80) ? A1V : A1W) | ANOENDSEMICOLON); 1422 1428 break; 1423 1429 case 0x3: 1424 buf = do_tok(buf, "RestoreBG", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) );1430 buf = do_tok(buf, "RestoreBG", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOENDSEMICOLON); 1425 1431 break; 1426 1432 case 0x4: 1427 buf = do_tok(buf, "Center", 0);1433 buf = do_tok(buf, "Center", ANOENDSEMICOLON); 1428 1434 break; 1429 1435 case 0x6: 1430 1436 if (g_options.GF_UNBLOCKED) 1431 buf = do_tok(buf, "Height", ((opcode & 0x80) ? A1V: A1W) );1437 buf = do_tok(buf, "Height", ((opcode & 0x80) ? A1V: A1W) | ANOENDSEMICOLON); 1432 1438 else 1433 buf = do_tok(buf, "Left", 0);1439 buf = do_tok(buf, "Left", ANOENDSEMICOLON); 1434 1440 break; 1435 1441 case 0x7: 1436 buf = do_tok(buf, "Overhead", 0);1442 buf = do_tok(buf, "Overhead", ANOENDSEMICOLON); 1437 1443 break; 1438 1444 case 0x8: 1439 buf = do_tok(buf, "PlayCDTrack", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) );1445 buf = do_tok(buf, "PlayCDTrack", ((opcode & 0x80) ? A1V : A1W) | ((opcode & 0x40) ? A2V : A2W) | ANOENDSEMICOLON); 1440 1446 break; 1441 1447 case 0xF:{ 1442 1448 buf = strecpy(buf, "Text("); … … 1778 1784 do_tok(buf, "createBoxMatrix", 0); 1779 1785 break; 1780 1786 default: 1781 sprintf(buf, "SetBoxUnknown%.2X ", opcode);1787 sprintf(buf, "SetBoxUnknown%.2X;", opcode); 1782 1788 } 1783 1789 } 1784 1790 … … 1853 1859 if (opcode & 0x80) { 1854 1860 char tmp[256]; 1855 1861 get_var(tmp); 1856 buf += sprintf(buf, "cursorCommand(Hi(%s), Lo(%s)) ", tmp, tmp);1862 buf += sprintf(buf, "cursorCommand(Hi(%s), Lo(%s));", tmp, tmp); 1857 1863 } else { 1858 1864 int val = get_word(); 1859 buf += sprintf(buf, "cursorCommand(%d, %d) ", (val >> 8) & 0xFF, val & 0xFF);1865 buf += sprintf(buf, "cursorCommand(%d, %d);", (val >> 8) & 0xFF, val & 0xFF); 1860 1866 } 1861 1867 1862 1868 break; 1863 1869 case 0x40: 1864 sprintf(buf, "cutscene ");1870 sprintf(buf, "cutscene();"); 1865 1871 break; 1866 1872 case 0xC0: 1867 sprintf(buf, "endCutscene ");1873 sprintf(buf, "endCutscene();"); 1868 1874 break; 1869 1875 1870 1876 case 0x46: … … 1879 1885 d |= get_byte() << 8; 1880 1886 d |= get_byte() << 16; 1881 1887 d = 0xFFFFFF - d; 1882 sprintf(buf, "delay(%d) ", d);1888 sprintf(buf, "delay(%d);", d); 1883 1889 break; 1884 1890 } 1885 1891 … … 1936 1942 case 0xEB: 1937 1943 case 0xEE: 1938 1944 //dummy 1939 sprintf(buf, "dummy(%.2X) ", opcode);1945 sprintf(buf, "dummy(%.2X);", opcode); 1940 1946 1941 1947 break; 1942 1948 … … 2139 2145 buf = get_var_or_byte(buf, (opcode & 0x80)); 2140 2146 buf += sprintf(buf, ",\""); 2141 2147 do_decodeparsestring_v2(buf, opcode); 2142 strcat(buf, "\") ");2148 strcat(buf, "\");"); 2143 2149 break; 2144 2150 case 0xD8: 2145 2151 //printEgo 2146 2152 buf += sprintf(buf, "printEgo(\""); 2147 2153 do_decodeparsestring_v2(buf, opcode); 2148 strcat(buf, "\") ");2154 strcat(buf, "\");"); 2149 2155 break; 2150 2156 2151 2157 case 0xCC: … … 2554 2560 d |= get_byte() << 8; 2555 2561 d |= get_byte() << 16; 2556 2562 d = 0xFFFFFF - d; 2557 sprintf(buf, "delay(%d) ", d);2563 sprintf(buf, "delay(%d);", d); 2558 2564 break; 2559 2565 } 2560 2566 … … 2571 2577 buf = get_var_or_byte(buf, (opcode & 0x80)); 2572 2578 buf += sprintf(buf, ",\""); 2573 2579 do_decodeparsestring_v2(buf, opcode); 2574 strcat(buf, "\") ");2580 strcat(buf, "\");"); 2575 2581 break; 2576 2582 case 0x75: 2577 2583 //printEgo 2578 2584 buf += sprintf(buf, "printEgo(\""); 2579 2585 do_decodeparsestring_v2(buf, opcode); 2580 strcat(buf, "\") ");2586 strcat(buf, "\");"); 2581 2587 break; 2582 2588 case 0x2E: 2583 2589 case 0xAE: … … 2586 2592 buf = get_var_or_byte(buf, (opcode & 0x80)); 2587 2593 buf += sprintf(buf, ",\""); 2588 2594 do_decodeparsestring_v2(buf, opcode); 2589 strcat(buf, "\") ");2595 strcat(buf, "\");"); 2590 2596 break; 2591 2597 case 0x0D: 2592 2598 //printEgo_c64 2593 2599 buf += sprintf(buf, "printEgo_c64(\""); 2594 2600 do_decodeparsestring_v2(buf, opcode); 2595 strcat(buf, "\") ");2601 strcat(buf, "\");"); 2596 2602 break; 2597 2603 2598 2604 case 0x2D: … … 2607 2613 case 0x6E: 2608 2614 case 0xEE: 2609 2615 //dummy 2610 sprintf(buf, "dummy%.2X() ", opcode);2616 sprintf(buf, "dummy%.2X();", opcode); 2611 2617 break; 2612 2618 2613 2619 case 0x86: … … 2963 2969 case 0x85: 2964 2970 case 0xC5: 2965 2971 if (g_options.scriptVersion == 5) { 2966 buf = do_tok(buf, "drawObject", ((opcode & 0x80) ? A1V : A1W) | ANOLASTPAREN );2972 buf = do_tok(buf, "drawObject", ((opcode & 0x80) ? A1V : A1W) | ANOLASTPAREN | ANOENDSEMICOLON); 2967 2973 opcode = get_byte(); 2968 2974 switch (opcode & 0x1F) { 2969 2975 case 1: 2970 2976 do_tok(buf, ", setXY(", 2971 ANOLASTPAREN | ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1W) |2977 ANOLASTPAREN | ANOFIRSTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1W) | 2972 2978 ((opcode & 0x40) ? A2V : A2W)); 2973 2979 break; 2974 2980 case 2: 2975 do_tok(buf, ", setImage(", ANOLASTPAREN | ANOFIRSTPAREN | ((opcode & 0x80) ? A1V : A1W));2981 do_tok(buf, ", setImage(", ANOLASTPAREN | ANOFIRSTPAREN | ANOENDSEMICOLON | ((opcode & 0x80) ? A1V : A1W)); 2976 2982 break; 2977 2983 } 2978 2984 strcat(buf, "));"); … … 3364 3370 d = get_byte(); 3365 3371 d |= get_byte() << 8; 3366 3372 d |= get_byte() << 16; 3367 sprintf(buf, "delay(%d) ", d);3373 sprintf(buf, "delay(%d);", d); 3368 3374 break; 3369 3375 } 3370 3376 … … 3384 3390 int d; 3385 3391 d = get_byte(); 3386 3392 if (d != 0) 3387 sprintf(buf, "beginOverride ");3393 sprintf(buf, "beginOverride();"); 3388 3394 else 3389 sprintf(buf, "endOverride ");3395 sprintf(buf, "endOverride();"); 3390 3396 break; 3391 3397 } 3392 3398 … … 3604 3610 3605 3611 case 0xA7: 3606 3612 if (g_options.scriptVersion == 5) { 3607 sprintf(buf, "dummy(%.2X) ", opcode);3613 sprintf(buf, "dummy(%.2X);", opcode); 3608 3614 } else { 3609 3615 int d = get_byte(); 3610 3616 buf += sprintf(buf, "saveLoadVars("); … … 3642 3648 return; 3643 3649 } 3644 3650 } 3645 buf += sprintf(buf, ") ");3651 buf += sprintf(buf, ");"); 3646 3652 } 3647 3653 break; 3648 3654