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