6 * Eric Chahi's style target
7 * i.e. native Another World script syntax
10 void aw_printlabel(int i
) {
12 fprintf(fp
, "%u\t", adr
);
17 fprintf(fp
, "L%i\t", i
);
20 void aw_printopcode(uint16_t op
, uint16_t x
, uint16_t y
, uint16_t z
, uint16_t w
, int label
) {
22 char c1
[16], c2
[16], c3
[16];
25 fprintf(fp
, "spr1\t%u\t%u\t%u\n", w
, x
, y
);
26 } else if(op
& 0x40) {
31 snprintf(c1
, 16, "%i", (int16_t)x
);
34 snprintf(c1
, 16, "v%u", x
);
37 snprintf(c1
, 16, "%u", x
);
40 snprintf(c1
, 16, "%u", x
+256);
46 snprintf(c2
, 16, "%i", (int16_t)y
);
49 snprintf(c2
, 16, "v%u", y
);
53 snprintf(c2
, 16, "%u", y
);
59 snprintf(c3
, 16, "64");
62 snprintf(c3
, 16, "v%u", z
);
65 snprintf(c3
, 16, "%u", z
);
69 snprintf(c3
, 16, "64");
73 /* Maybe graphics segmet is changed using file name */
74 fprintf(fp
, "spr%c\t%u\t%s\t%s\t%s\n", seg
, w
, c1
, c2
, c3
);
78 fprintf(fp
, "seti\tv%u\t%i\n", x
, (int16_t)y
);
81 fprintf(fp
, "set\tv%u\tv%u\n", x
, y
);
84 fprintf(fp
, "add\tv%u\tv%u\n", x
, y
);
87 fprintf(fp
, "addi\tv%u\t%u\n", x
, y
);
90 fprintf(fp
, "jsr\tL%u\n", label
);
93 fprintf(fp
, "return\n");
96 fprintf(fp
, "break\n");
99 fprintf(fp
, "jmp\tL%u\n", label
);
102 fprintf(fp
, "setvec\t%u\tL%u\n", x
, label
);
105 fprintf(fp
, "dbra\tv%u\tL%u\n", x
, label
);
109 snprintf(c1
, 16, "v%u", y
);
111 snprintf(c1
, 16, "%i", (int16_t)y
);
113 snprintf(c1
, 16, "%u", y
);
138 fprintf(fp
, "si\tv%u\t%s\t%s\tL%u\n", x
, s
, c1
, label
);
141 fprintf(fp
, "fade\t%u\n", x
);
144 fprintf(fp
, "vec\t%u\t%u\t%u\n", x
, y
, z
);
147 fprintf(fp
, "setws\t%u\n", x
);
150 fprintf(fp
, "clr\t%u\t%u\n", x
, y
);
153 fprintf(fp
, "copy\t%u\t%u\n", x
, y
);
156 fprintf(fp
, "show\t%u\n", x
);
159 fprintf(fp
, "bigend\n");
162 fprintf(fp
, "text\t%u\t%u\t%u\t%u\n", z
, x
, y
, w
);
165 fprintf(fp
, "sub\tv%u\tv%u\n", x
, y
);
168 fprintf(fp
, "andi\tv%u\t%u\n", x
, y
);
171 fprintf(fp
, "ori\tv%u\t%u\n", x
, y
);
174 fprintf(fp
, "lsl\tv%u\t%u\n", x
, y
);
177 fprintf(fp
, "lsr\tv%u\t%u\n", x
, y
);
180 fprintf(fp
, "play\t%u\t%u\t%u\t%u\n", z
, x
, y
, w
);
183 fprintf(fp
, "load\t%u\n", x
);
186 fprintf(fp
, "song\t%u\t%u\t%u\n", x
, y
, z
);
189 fprintf(fp
, "unk_%x\n", op
);