Mercurial > libdvdnav.hg
annotate vm/vmcmd.c @ 285:52877d182e96 src
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
author | nicodvb |
---|---|
date | Fri, 20 Apr 2007 23:24:59 +0000 |
parents | 130c10495b66 |
children | 54b6a000f6da |
rev | line source |
---|---|
225 | 1 /* |
2 * Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort | |
243
e75c52894630
* assert(0) does not always and the program (see NDEBUG)
mroi
parents:
225
diff
changeset
|
3 * 2002-2004 the dvdnav project |
225 | 4 * |
5 * This file is part of libdvdnav, a DVD navigation library. It is modified | |
6 * from a file originally part of the Ogle DVD player. | |
7 * | |
8 * libdvdnav is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * libdvdnav is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
21 * | |
22 * $Id$ | |
23 * | |
24 */ | |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 #include "config.h" | |
28 #endif | |
29 | |
30 #include <stdio.h> | |
31 #include <ctype.h> | |
32 #include <inttypes.h> | |
33 | |
285
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
34 #include "dvd_types.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
35 #include "nav_types.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
36 #include "ifo_types.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
37 #include "decoder.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
38 #include "remap.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
39 #include "vm.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
40 #include "vmcmd.h" |
52877d182e96
moved all header inclusions from .h to .c files; my word, I've never seen such a horrible entanglement as in this mess
nicodvb
parents:
279
diff
changeset
|
41 #include "dvdnav.h" |
225 | 42 #include "dvdnav_internal.h" |
43 | |
44 /* freebsd compatibility */ | |
45 #ifndef PRIu8 | |
46 #define PRIu8 "d" | |
47 #endif | |
48 | |
49 /* freebsd compatibility */ | |
50 #ifndef PRIu16 | |
51 #define PRIu16 "d" | |
52 #endif | |
53 | |
54 static const char *cmp_op_table[] = { | |
55 NULL, "&", "==", "!=", ">=", ">", "<=", "<" | |
56 }; | |
57 static const char *set_op_table[] = { | |
58 NULL, "=", "<->", "+=", "-=", "*=", "/=", "%=", "rnd", "&=", "|=", "^=" | |
59 }; | |
60 | |
61 static const char *link_table[] = { | |
62 "LinkNoLink", "LinkTopC", "LinkNextC", "LinkPrevC", | |
63 NULL, "LinkTopPG", "LinkNextPG", "LinkPrevPG", | |
64 NULL, "LinkTopPGC", "LinkNextPGC", "LinkPrevPGC", | |
65 "LinkGoUpPGC", "LinkTailPGC", NULL, NULL, | |
66 "RSM" | |
67 }; | |
68 | |
69 static const char *system_reg_table[] = { | |
70 "Menu Description Language Code", | |
71 "Audio Stream Number", | |
72 "Sub-picture Stream Number", | |
73 "Angle Number", | |
74 "Title Track Number", | |
75 "VTS Title Track Number", | |
76 "VTS PGC Number", | |
77 "PTT Number for One_Sequential_PGC_Title", | |
78 "Highlighted Button Number", | |
79 "Navigation Timer", | |
80 "Title PGC Number for Navigation Timer", | |
81 "Audio Mixing Mode for Karaoke", | |
82 "Country Code for Parental Management", | |
83 "Parental Level", | |
84 "Player Configurations for Video", | |
85 "Player Configurations for Audio", | |
86 "Initial Language Code for Audio", | |
87 "Initial Language Code Extension for Audio", | |
88 "Initial Language Code for Sub-picture", | |
89 "Initial Language Code Extension for Sub-picture", | |
90 "Player Regional Code", | |
91 "Reserved 21", | |
92 "Reserved 22", | |
93 "Reserved 23" | |
94 }; | |
95 | |
96 static const char *system_reg_abbr_table[] = { | |
97 NULL, | |
98 "ASTN", | |
99 "SPSTN", | |
100 "AGLN", | |
101 "TTN", | |
102 "VTS_TTN", | |
103 "TT_PGCN", | |
104 "PTTN", | |
105 "HL_BTNN", | |
106 "NVTMR", | |
107 "NV_PGCN", | |
108 NULL, | |
109 "CC_PLT", | |
110 "PLT", | |
111 NULL, | |
112 NULL, | |
113 NULL, | |
114 NULL, | |
115 NULL, | |
116 NULL, | |
117 NULL, | |
118 NULL, | |
119 NULL, | |
120 NULL, | |
121 }; | |
122 | |
123 static void print_system_reg(uint16_t reg) { | |
124 if(reg < sizeof(system_reg_abbr_table) / sizeof(char *)) | |
125 fprintf(MSG_OUT, "%s (SRPM:%d)", system_reg_table[reg], reg); | |
126 else | |
127 fprintf(MSG_OUT, " WARNING: Unknown system register ( reg=%d ) ", reg); | |
128 } | |
129 | |
130 static void print_g_reg(uint8_t reg) { | |
131 if(reg < 16) | |
132 fprintf(MSG_OUT, "g[%" PRIu8 "]", reg); | |
133 else | |
134 fprintf(MSG_OUT, " WARNING: Unknown general register "); | |
135 } | |
136 | |
137 static void print_reg(uint8_t reg) { | |
138 if(reg & 0x80) | |
139 print_system_reg(reg & 0x7f); | |
140 else | |
141 print_g_reg(reg & 0x7f); | |
142 } | |
143 | |
144 static void print_cmp_op(uint8_t op) { | |
145 if(op < sizeof(cmp_op_table) / sizeof(char *) && cmp_op_table[op] != NULL) | |
146 fprintf(MSG_OUT, " %s ", cmp_op_table[op]); | |
147 else | |
148 fprintf(MSG_OUT, " WARNING: Unknown compare op "); | |
149 } | |
150 | |
151 static void print_set_op(uint8_t op) { | |
152 if(op < sizeof(set_op_table) / sizeof(char *) && set_op_table[op] != NULL) | |
153 fprintf(MSG_OUT, " %s ", set_op_table[op]); | |
154 else | |
155 fprintf(MSG_OUT, " WARNING: Unknown set op "); | |
156 } | |
157 | |
158 static void print_reg_or_data(command_t* command, int immediate, int start) { | |
159 if(immediate) { | |
160 uint32_t i = vm_getbits(command, start, 16); | |
161 | |
162 fprintf(MSG_OUT, "0x%x", i); | |
163 if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) | |
164 fprintf(MSG_OUT, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff)); | |
165 } else { | |
166 print_reg(vm_getbits(command, start - 8, 8)); | |
167 } | |
168 } | |
169 | |
170 static void print_reg_or_data_2(command_t* command, int immediate, int start) { | |
171 if(immediate) | |
172 fprintf(MSG_OUT, "0x%x", vm_getbits(command, start - 1, 7)); | |
173 else | |
174 fprintf(MSG_OUT, "g[%" PRIu8 "]", vm_getbits(command, start - 4, 4)); | |
175 } | |
176 | |
177 static void print_reg_or_data_3(command_t* command, int immediate, int start) { | |
178 if(immediate) { | |
179 uint32_t i = vm_getbits(command, start, 16); | |
180 | |
181 fprintf(MSG_OUT, "0x%x", i); | |
182 if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) | |
183 fprintf(MSG_OUT, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff)); | |
184 } else { | |
185 print_reg(vm_getbits(command, start, 8)); | |
186 } | |
187 } | |
188 | |
189 | |
190 static void print_if_version_1(command_t* command) { | |
191 uint8_t op = vm_getbits(command, 54, 3); | |
192 | |
193 if(op) { | |
194 fprintf(MSG_OUT, "if ("); | |
195 print_g_reg(vm_getbits(command,39,8)); | |
196 print_cmp_op(op); | |
197 print_reg_or_data(command, vm_getbits(command, 55,1), 31); | |
198 fprintf(MSG_OUT, ") "); | |
199 } | |
200 } | |
201 | |
202 static void print_if_version_2(command_t* command) { | |
203 uint8_t op = vm_getbits(command, 54, 3); | |
204 | |
205 if(op) { | |
206 fprintf(MSG_OUT, "if ("); | |
207 print_reg(vm_getbits(command, 15, 8)); | |
208 print_cmp_op(op); | |
209 print_reg(vm_getbits(command, 7, 8)); | |
210 fprintf(MSG_OUT, ") "); | |
211 } | |
212 } | |
213 | |
214 static void print_if_version_3(command_t* command) { | |
215 uint8_t op = vm_getbits(command, 54, 3); | |
216 | |
217 if(op) { | |
218 fprintf(MSG_OUT, "if ("); | |
219 print_g_reg(vm_getbits(command, 43, 4)); | |
220 print_cmp_op(op); | |
221 print_reg_or_data(command, vm_getbits(command, 55, 1), 15); | |
222 fprintf(MSG_OUT, ") "); | |
223 } | |
224 } | |
225 | |
226 static void print_if_version_4(command_t* command) { | |
227 uint8_t op = vm_getbits(command, 54, 3); | |
228 | |
229 if(op) { | |
230 fprintf(MSG_OUT, "if ("); | |
231 print_g_reg(vm_getbits(command, 51, 4)); | |
232 print_cmp_op(op); | |
233 print_reg_or_data(command, vm_getbits(command, 55, 1), 31); | |
234 fprintf(MSG_OUT, ") "); | |
235 } | |
236 } | |
237 | |
238 static void print_if_version_5(command_t* command) { | |
239 uint8_t op = vm_getbits(command, 54, 3); | |
240 int set_immediate = vm_getbits(command, 60, 1); | |
241 | |
242 if(op) { | |
243 if (set_immediate) { | |
244 fprintf(MSG_OUT, "if ("); | |
245 print_g_reg(vm_getbits(command, 31, 8)); | |
246 print_cmp_op(op); | |
247 print_reg(vm_getbits(command, 23, 8)); | |
248 fprintf(MSG_OUT, ") "); | |
249 } else { | |
250 fprintf(MSG_OUT, "if ("); | |
251 print_g_reg(vm_getbits(command, 39, 8)); | |
252 print_cmp_op(op); | |
253 print_reg_or_data(command, vm_getbits(command, 55, 1), 31); | |
254 fprintf(MSG_OUT, ") "); | |
255 } | |
256 } | |
257 } | |
258 | |
259 static void print_special_instruction(command_t* command) { | |
260 uint8_t op = vm_getbits(command, 51, 4); | |
261 | |
262 switch(op) { | |
263 case 0: /* NOP */ | |
264 fprintf(MSG_OUT, "Nop"); | |
265 break; | |
266 case 1: /* Goto line */ | |
267 fprintf(MSG_OUT, "Goto %" PRIu8, vm_getbits(command, 7, 8)); | |
268 break; | |
269 case 2: /* Break */ | |
270 fprintf(MSG_OUT, "Break"); | |
271 break; | |
272 case 3: /* Parental level */ | |
273 fprintf(MSG_OUT, "SetTmpPML %" PRIu8 ", Goto %" PRIu8, | |
274 vm_getbits(command, 11, 4), vm_getbits(command, 7, 8)); | |
275 break; | |
276 default: | |
277 fprintf(MSG_OUT, "WARNING: Unknown special instruction (%i)", | |
278 vm_getbits(command, 51, 4)); | |
279 } | |
280 } | |
281 | |
282 static void print_linksub_instruction(command_t* command) { | |
283 uint32_t linkop = vm_getbits(command, 7, 8); | |
284 uint32_t button = vm_getbits(command, 15, 6); | |
285 | |
286 if(linkop < sizeof(link_table)/sizeof(char *) && link_table[linkop] != NULL) | |
287 fprintf(MSG_OUT, "%s (button %" PRIu8 ")", link_table[linkop], button); | |
288 else | |
289 fprintf(MSG_OUT, "WARNING: Unknown linksub instruction (%i)", linkop); | |
290 } | |
291 | |
292 static void print_link_instruction(command_t* command, int optional) { | |
293 uint8_t op = vm_getbits(command, 51, 4); | |
294 | |
295 if(optional && op) | |
296 fprintf(MSG_OUT, ", "); | |
297 | |
298 switch(op) { | |
299 case 0: | |
300 if(!optional) | |
301 fprintf(MSG_OUT, "WARNING: NOP (link)!"); | |
302 break; | |
303 case 1: | |
304 print_linksub_instruction(command); | |
305 break; | |
306 case 4: | |
307 fprintf(MSG_OUT, "LinkPGCN %" PRIu16, vm_getbits(command, 14, 15)); | |
308 break; | |
309 case 5: | |
310 fprintf(MSG_OUT, "LinkPTT %" PRIu16 " (button %" PRIu8 ")", | |
311 vm_getbits(command, 9, 10), vm_getbits(command, 15, 6)); | |
312 break; | |
313 case 6: | |
314 fprintf(MSG_OUT, "LinkPGN %" PRIu8 " (button %" PRIu8 ")", | |
315 vm_getbits(command, 6, 7), vm_getbits(command, 15, 6)); | |
316 break; | |
317 case 7: | |
318 fprintf(MSG_OUT, "LinkCN %" PRIu8 " (button %" PRIu8 ")", | |
319 vm_getbits(command, 7, 8), vm_getbits(command, 15, 6)); | |
320 break; | |
321 default: | |
322 fprintf(MSG_OUT, "WARNING: Unknown link instruction"); | |
323 } | |
324 } | |
325 | |
326 static void print_jump_instruction(command_t* command) { | |
327 switch(vm_getbits(command, 51, 4)) { | |
328 case 1: | |
329 fprintf(MSG_OUT, "Exit"); | |
330 break; | |
331 case 2: | |
332 fprintf(MSG_OUT, "JumpTT %" PRIu8, vm_getbits(command, 22, 7)); | |
333 break; | |
334 case 3: | |
335 fprintf(MSG_OUT, "JumpVTS_TT %" PRIu8, vm_getbits(command, 22, 7)); | |
336 break; | |
337 case 5: | |
338 fprintf(MSG_OUT, "JumpVTS_PTT %" PRIu8 ":%" PRIu16, | |
339 vm_getbits(command, 22, 7), vm_getbits(command, 41, 10)); | |
340 break; | |
341 case 6: | |
342 switch(vm_getbits(command, 23, 2)) { | |
343 case 0: | |
344 fprintf(MSG_OUT, "JumpSS FP"); | |
345 break; | |
346 case 1: | |
347 fprintf(MSG_OUT, "JumpSS VMGM (menu %" PRIu8 ")", vm_getbits(command, 19, 4)); | |
348 break; | |
349 case 2: | |
350 fprintf(MSG_OUT, "JumpSS VTSM (vts %" PRIu8 ", title %" PRIu8 | |
351 ", menu %" PRIu8 ")", vm_getbits(command, 30, 7), vm_getbits(command, 38, 7), vm_getbits(command, 19, 4)); | |
352 break; | |
353 case 3: | |
354 fprintf(MSG_OUT, "JumpSS VMGM (pgc %" PRIu8 ")", vm_getbits(command, 46, 15)); | |
355 break; | |
356 } | |
357 break; | |
358 case 8: | |
359 switch(vm_getbits(command, 23, 2)) { | |
360 case 0: | |
361 fprintf(MSG_OUT, "CallSS FP (rsm_cell %" PRIu8 ")", | |
362 vm_getbits(command, 31, 8)); | |
363 break; | |
364 case 1: | |
365 fprintf(MSG_OUT, "CallSS VMGM (menu %" PRIu8 | |
366 ", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8)); | |
367 break; | |
368 case 2: | |
369 fprintf(MSG_OUT, "CallSS VTSM (menu %" PRIu8 | |
370 ", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8)); | |
371 break; | |
372 case 3: | |
373 fprintf(MSG_OUT, "CallSS VMGM (pgc %" PRIu8 ", rsm_cell %" PRIu8 ")", | |
374 vm_getbits(command, 46, 15), vm_getbits(command, 31, 8)); | |
375 break; | |
376 } | |
377 break; | |
378 default: | |
379 fprintf(MSG_OUT, "WARNING: Unknown Jump/Call instruction"); | |
380 } | |
381 } | |
382 | |
383 static void print_system_set(command_t* command) { | |
384 int i; | |
385 /* FIXME: What about SPRM11 ? Karaoke */ | |
386 /* Surely there must be some system set command for that ? */ | |
387 | |
388 switch(vm_getbits(command, 59, 4)) { | |
389 case 1: /* Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle) */ | |
390 for(i = 1; i <= 3; i++) { | |
391 if(vm_getbits(command, 47 - (i*8), 1)) { | |
392 print_system_reg(i); | |
393 fprintf(MSG_OUT, " = "); | |
394 print_reg_or_data_2(command, vm_getbits(command, 60, 1), 47 - (i*8) ); | |
395 fprintf(MSG_OUT, " "); | |
396 } | |
397 } | |
398 break; | |
399 case 2: /* Set system reg 9 & 10 (Navigation timer, Title PGC number) */ | |
400 print_system_reg(9); | |
401 fprintf(MSG_OUT, " = "); | |
402 print_reg_or_data(command, vm_getbits(command, 60, 1), 47); | |
403 fprintf(MSG_OUT, " "); | |
404 print_system_reg(10); | |
405 fprintf(MSG_OUT, " = %" PRIu16, vm_getbits(command, 30, 15)); /* ?? */ | |
406 break; | |
407 case 3: /* Mode: Counter / Register + Set */ | |
408 fprintf(MSG_OUT, "SetMode "); | |
409 if(vm_getbits(command, 23, 1)) | |
410 fprintf(MSG_OUT, "Counter "); | |
411 else | |
412 fprintf(MSG_OUT, "Register "); | |
413 print_g_reg(vm_getbits(command, 19, 4)); | |
414 print_set_op(0x1); /* '=' */ | |
415 print_reg_or_data(command, vm_getbits(command, 60, 1), 47); | |
416 break; | |
417 case 6: /* Set system reg 8 (Highlighted button) */ | |
418 print_system_reg(8); | |
419 if(vm_getbits(command, 60, 1)) /* immediate */ | |
420 fprintf(MSG_OUT, " = 0x%x (button no %d)", vm_getbits(command, 31, 16), vm_getbits(command, 31, 6)); | |
421 else | |
422 fprintf(MSG_OUT, " = g[%" PRIu8 "]", vm_getbits(command, 19, 4)); | |
423 break; | |
424 default: | |
425 fprintf(MSG_OUT, "WARNING: Unknown system set instruction (%i)", | |
426 vm_getbits(command, 59, 4)); | |
427 } | |
428 } | |
429 | |
430 static void print_set_version_1(command_t* command) { | |
431 uint8_t set_op = vm_getbits(command, 59, 4); | |
432 | |
433 if(set_op) { | |
434 print_g_reg(vm_getbits(command, 35, 4)); | |
435 print_set_op(set_op); | |
436 print_reg_or_data(command, vm_getbits(command, 60, 1), 31); | |
437 } else { | |
438 fprintf(MSG_OUT, "NOP"); | |
439 } | |
440 } | |
441 | |
442 static void print_set_version_2(command_t* command) { | |
443 uint8_t set_op = vm_getbits(command, 59, 4); | |
444 | |
445 if(set_op) { | |
446 print_g_reg(vm_getbits(command, 51, 4)); | |
447 print_set_op(set_op); | |
448 print_reg_or_data(command, vm_getbits(command, 60, 1), 47); | |
449 } else { | |
450 fprintf(MSG_OUT, "NOP"); | |
451 } | |
452 } | |
453 | |
454 static void print_set_version_3(command_t* command) { | |
455 uint8_t set_op = vm_getbits(command, 59, 4); | |
456 | |
457 if(set_op) { | |
458 print_g_reg(vm_getbits(command, 51, 4)); | |
459 print_set_op(set_op); | |
460 print_reg_or_data_3(command, vm_getbits(command, 60, 1), 47); | |
461 } else { | |
462 fprintf(MSG_OUT, "NOP"); | |
463 } | |
464 } | |
465 | |
466 | |
467 void vm_print_mnemonic(vm_cmd_t *vm_command) { | |
468 command_t command; | |
469 command.instruction =( (uint64_t) vm_command->bytes[0] << 56 ) | | |
470 ( (uint64_t) vm_command->bytes[1] << 48 ) | | |
471 ( (uint64_t) vm_command->bytes[2] << 40 ) | | |
472 ( (uint64_t) vm_command->bytes[3] << 32 ) | | |
473 ( (uint64_t) vm_command->bytes[4] << 24 ) | | |
474 ( (uint64_t) vm_command->bytes[5] << 16 ) | | |
475 ( (uint64_t) vm_command->bytes[6] << 8 ) | | |
476 (uint64_t) vm_command->bytes[7] ; | |
477 command.examined = 0; | |
478 | |
479 switch(vm_getbits(&command,63,3)) { /* three first bits */ | |
480 case 0: /* Special instructions */ | |
481 print_if_version_1(&command); | |
482 print_special_instruction(&command); | |
483 break; | |
484 case 1: /* Jump/Call or Link instructions */ | |
485 if(vm_getbits(&command,60,1)) { | |
486 print_if_version_2(&command); | |
487 print_jump_instruction(&command); | |
488 } else { | |
489 print_if_version_1(&command); | |
490 print_link_instruction(&command, 0); /* must be pressent */ | |
491 } | |
492 break; | |
493 case 2: /* Set System Parameters instructions */ | |
494 print_if_version_2(&command); | |
495 print_system_set(&command); | |
496 print_link_instruction(&command, 1); /* either 'if' or 'link' */ | |
497 break; | |
498 case 3: /* Set General Parameters instructions */ | |
499 print_if_version_3(&command); | |
500 print_set_version_1(&command); | |
501 print_link_instruction(&command, 1); /* either 'if' or 'link' */ | |
502 break; | |
503 case 4: /* Set, Compare -> LinkSub instructions */ | |
504 print_set_version_2(&command); | |
505 fprintf(MSG_OUT, ", "); | |
506 print_if_version_4(&command); | |
507 print_linksub_instruction(&command); | |
508 break; | |
509 case 5: /* Compare -> (Set and LinkSub) instructions */ | |
510 print_if_version_5(&command); | |
511 fprintf(MSG_OUT, "{ "); | |
512 print_set_version_3(&command); | |
513 fprintf(MSG_OUT, ", "); | |
514 print_linksub_instruction(&command); | |
515 fprintf(MSG_OUT, " }"); | |
516 break; | |
517 case 6: /* Compare -> Set, always LinkSub instructions */ | |
518 print_if_version_5(&command); | |
519 fprintf(MSG_OUT, "{ "); | |
520 print_set_version_3(&command); | |
521 fprintf(MSG_OUT, " } "); | |
522 print_linksub_instruction(&command); | |
523 break; | |
524 default: | |
525 fprintf(MSG_OUT, "WARNING: Unknown instruction type (%i)", vm_getbits(&command, 63, 3)); | |
526 } | |
527 /* Check if there still are bits set that were not examined */ | |
528 | |
529 if(command.instruction & ~ command.examined) { | |
530 fprintf(MSG_OUT, " libdvdnav: vmcmd.c: [WARNING, unknown bits:"); | |
279
130c10495b66
replaced 08llx with PRIx64; patch by Diego Petteno'
nicodvb
parents:
243
diff
changeset
|
531 fprintf(MSG_OUT, " %08"PRIx64, (command.instruction & ~ command.examined) ); |
225 | 532 fprintf(MSG_OUT, "]"); |
533 } | |
534 } | |
535 | |
536 void vm_print_cmd(int row, vm_cmd_t *vm_command) { | |
537 int i; | |
538 | |
539 fprintf(MSG_OUT, "(%03d) ", row + 1); | |
540 for(i = 0; i < 8; i++) | |
541 fprintf(MSG_OUT, "%02x ", vm_command->bytes[i]); | |
542 fprintf(MSG_OUT, "| "); | |
543 | |
544 vm_print_mnemonic(vm_command); | |
545 fprintf(MSG_OUT, "\n"); | |
546 } | |
547 |