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