comparison vm/decoder.h @ 0:427b7da5cbdb src

first split of dvdread; it's just a copy of dvdnav still to be cleaned
author nicodvb
date Sun, 01 Jun 2008 08:39:07 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:427b7da5cbdb
1 /*
2 * Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
3 *
4 * This file is part of libdvdnav, a DVD navigation library. It is modified
5 * from a file originally part of the Ogle DVD player.
6 *
7 * libdvdnav is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * libdvdnav is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 *
21 * $Id$
22 *
23 */
24
25 #ifndef DECODER_H_INCLUDED
26 #define DECODER_H_INCLUDED
27
28 /* link command types */
29 typedef enum {
30 LinkNoLink = 0,
31
32 LinkTopC = 1,
33 LinkNextC = 2,
34 LinkPrevC = 3,
35
36 LinkTopPG = 5,
37 LinkNextPG = 6,
38 LinkPrevPG = 7,
39
40 LinkTopPGC = 9,
41 LinkNextPGC = 10,
42 LinkPrevPGC = 11,
43 LinkGoUpPGC = 12,
44 LinkTailPGC = 13,
45
46 LinkRSM = 16,
47
48 LinkPGCN,
49 LinkPTTN,
50 LinkPGN,
51 LinkCN,
52
53 Exit,
54
55 JumpTT, /* 22 */
56 JumpVTS_TT,
57 JumpVTS_PTT,
58
59 JumpSS_FP,
60 JumpSS_VMGM_MENU,
61 JumpSS_VTSM,
62 JumpSS_VMGM_PGC,
63
64 CallSS_FP, /* 29 */
65 CallSS_VMGM_MENU,
66 CallSS_VTSM,
67 CallSS_VMGM_PGC,
68
69 PlayThis
70 } link_cmd_t;
71
72 /* a link's data set */
73 typedef struct {
74 link_cmd_t command;
75 uint16_t data1;
76 uint16_t data2;
77 uint16_t data3;
78 } link_t;
79
80 /* the VM registers */
81 typedef struct {
82 uint16_t SPRM[24];
83 uint16_t GPRM[16];
84 uint8_t GPRM_mode[16]; /* Need to have some thing to indicate normal/counter mode for every GPRM */
85 struct timeval GPRM_time[16]; /* For counter mode */
86 } registers_t;
87
88 /* a VM command data set */
89 typedef struct {
90 uint64_t instruction;
91 uint64_t examined;
92 registers_t *registers;
93 } command_t;
94
95 /* the big VM function, executing the given commands and writing
96 * the link where to continue, the return value indicates if a jump
97 * has been performed */
98 int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
99 registers_t *registers, link_t *return_values);
100
101 /* extracts some bits from the command */
102 uint32_t vm_getbits(command_t* command, int32_t start, int32_t count);
103
104 #ifdef TRACE
105 /* for debugging: prints a link in readable form */
106 void vm_print_link(link_t value);
107
108 /* for debugging: dumps VM registers */
109 void vm_print_registers( registers_t *registers );
110 #endif
111
112 #endif /* DECODER_H_INCLUDED */