comparison decoder.h @ 114:b6834e6359cf src

big libdvdnav cleanup, quoting the ChangeLog: * some bugfixes * code cleanup * build process polishing * more sensible event order in get_next_block to ensure useful event delivery * VOBU level resume * fixed: seeking in a multiangle feature briefly showed the wrong angle
author mroi
date Thu, 20 Feb 2003 15:32:21 +0000
parents e106f51eb8f5
children 5897ff629f7c
comparison
equal deleted inserted replaced
113:ec2df154be56 114:b6834e6359cf
28 #include <inttypes.h> 28 #include <inttypes.h>
29 #include <sys/time.h> 29 #include <sys/time.h>
30 30
31 #include <dvdread/ifo_types.h> /* vm_cmd_t */ 31 #include <dvdread/ifo_types.h> /* vm_cmd_t */
32 32
33 /* Uncomment for tracing */ 33 /* link command types */
34 #define TRACE
35
36 typedef enum { 34 typedef enum {
37 LinkNoLink = 0, 35 LinkNoLink = 0,
38 36
39 LinkTopC = 1, 37 LinkTopC = 1,
40 LinkNextC = 2, 38 LinkNextC = 2,
74 CallSS_VMGM_PGC, 72 CallSS_VMGM_PGC,
75 73
76 PlayThis 74 PlayThis
77 } link_cmd_t; 75 } link_cmd_t;
78 76
77 /* a link's data set */
79 typedef struct { 78 typedef struct {
80 link_cmd_t command; 79 link_cmd_t command;
81 uint16_t data1; 80 uint16_t data1;
82 uint16_t data2; 81 uint16_t data2;
83 uint16_t data3; 82 uint16_t data3;
84 } link_t; 83 } link_t;
85 84
85 /* the VM registers */
86 typedef struct { 86 typedef struct {
87 uint16_t SPRM[24]; 87 uint16_t SPRM[24];
88 uint16_t GPRM[16]; 88 uint16_t GPRM[16];
89 uint8_t GPRM_mode[16]; /* Need to have some thing to indicate normal/counter mode for every GPRM */ 89 uint8_t GPRM_mode[16]; /* Need to have some thing to indicate normal/counter mode for every GPRM */
90 struct timeval GPRM_time[16]; /* For counter mode */ 90 struct timeval GPRM_time[16]; /* For counter mode */
91 } registers_t; 91 } registers_t;
92 92
93 typedef struct 93 /* a VM command data set */
94 { 94 typedef struct {
95 uint64_t instruction; 95 uint64_t instruction;
96 uint64_t examined; 96 uint64_t examined;
97 registers_t *registers; 97 registers_t *registers;
98 } command_t; 98 } command_t;
99 99
100 /* the big VM function, executing the given commands and writing
101 * the link where to continue, the return value indicates if a jump
102 * has been performed */
100 int vmEval_CMD(vm_cmd_t commands[], int num_commands, 103 int vmEval_CMD(vm_cmd_t commands[], int num_commands,
101 registers_t *registers, link_t *return_values); 104 registers_t *registers, link_t *return_values);
102 105
103 void vmPrint_LINK(link_t value); 106 /* extracts some bits from the command */
104 void vmPrint_registers( registers_t *registers );
105 uint32_t vm_getbits(command_t* command, int start, int count); 107 uint32_t vm_getbits(command_t* command, int start, int count);
106 108
109 #ifdef TRACE
110 /* for debugging: prints a link in readable form */
111 void vmPrint_LINK(link_t value);
112
113 /* for debugging: dumps VM registers */
114 void vmPrint_registers( registers_t *registers );
115 #endif
116
107 #endif /* DECODER_H_INCLUDED */ 117 #endif /* DECODER_H_INCLUDED */