Mercurial > mplayer.hg
annotate dvdread/nav_read.c @ 24081:b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
author | nicodvb |
---|---|
date | Sun, 19 Aug 2007 20:53:43 +0000 |
parents | 1542693b2a30 |
children | fc9f44db5fcd |
rev | line source |
---|---|
24050
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
1 /* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ |
7029 | 2 /* |
15874 | 3 * Copyright (C) 2000, 2001, 2002, 2003 Håkan Hjort <d95hjort@dtek.chalmers.se> |
14938
25df9508f9a8
Mark modified files as such to comply more closely with GPL ¡ø2a.
diego
parents:
8257
diff
changeset
|
4 * |
7029 | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation; either version 2 of the License, or | |
8 * (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 */ | |
19 | |
15874 | 20 #include "config.h" |
21 | |
7029 | 22 #include <stdio.h> |
23 #include <string.h> | |
24047
de28f9e8cb00
Sync libdvdread with version 0.9.5 (functional changes).
diego
parents:
20981
diff
changeset
|
24 #if defined(HAVE_INTTYPES_H) |
7029 | 25 #include <inttypes.h> |
24047
de28f9e8cb00
Sync libdvdread with version 0.9.5 (functional changes).
diego
parents:
20981
diff
changeset
|
26 #elif defined(HAVE_STDINT_H) |
de28f9e8cb00
Sync libdvdread with version 0.9.5 (functional changes).
diego
parents:
20981
diff
changeset
|
27 #include <stdint.h> |
de28f9e8cb00
Sync libdvdread with version 0.9.5 (functional changes).
diego
parents:
20981
diff
changeset
|
28 #endif |
7029 | 29 |
30 #include "bswap.h" | |
31 #include "nav_types.h" | |
32 #include "nav_read.h" | |
15874 | 33 #include "dvdread_internal.h" |
7029 | 34 |
24081
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
35 typedef struct { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
36 uint8_t *start; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
37 uint32_t byte_position; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
38 uint32_t bit_position; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
39 uint8_t byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
40 } getbits_state_t; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
41 |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
42 static int getbits_init(getbits_state_t *state, uint8_t *start) { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
43 if ((state == NULL) || (start == NULL)) return 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
44 state->start = start; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
45 state->bit_position = 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
46 state->byte_position = 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
47 state->byte = start[0]; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
48 return 1; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
49 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
50 |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
51 /* Non-optimized getbits. */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
52 /* This can easily be optimized for particular platforms. */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
53 static uint32_t getbits(getbits_state_t *state, uint32_t number_of_bits) { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
54 uint32_t result=0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
55 uint8_t byte=0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
56 if (number_of_bits > 32) { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
57 printf("Number of bits > 32 in getbits\n"); |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
58 abort(); |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
59 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
60 |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
61 if ((state->bit_position) > 0) { /* Last getbits left us in the middle of a byte. */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
62 if (number_of_bits > (8-state->bit_position)) { /* this getbits will span 2 or more bytes. */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
63 byte = state->byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
64 byte = byte >> (state->bit_position); |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
65 result = byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
66 number_of_bits -= (8-state->bit_position); |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
67 state->bit_position = 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
68 state->byte_position++; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
69 state->byte = state->start[state->byte_position]; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
70 } else { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
71 byte=state->byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
72 state->byte = state->byte << number_of_bits; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
73 byte = byte >> (8 - number_of_bits); |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
74 result = byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
75 state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 8 */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
76 if (state->bit_position == 8) { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
77 state->bit_position = 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
78 state->byte_position++; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
79 state->byte = state->start[state->byte_position]; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
80 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
81 number_of_bits = 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
82 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
83 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
84 if ((state->bit_position) == 0) { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
85 while (number_of_bits > 7) { |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
86 result = (result << 8) + state->byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
87 state->byte_position++; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
88 state->byte = state->start[state->byte_position]; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
89 number_of_bits -= 8; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
90 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
91 if (number_of_bits > 0) { /* number_of_bits < 8 */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
92 byte = state->byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
93 state->byte = state->byte << number_of_bits; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
94 state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 7 */ |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
95 byte = byte >> (8 - number_of_bits); |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
96 result = (result << number_of_bits) + byte; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
97 number_of_bits = 0; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
98 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
99 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
100 |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
101 return result; |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
102 } |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
103 |
b3bc18ea5878
added from dvdnav's dvdread getbits() code to be used in forthcoming patch to read correctly NAV data
nicodvb
parents:
24050
diff
changeset
|
104 |
7029 | 105 void navRead_PCI(pci_t *pci, unsigned char *buffer) { |
15874 | 106 int i, j; |
7029 | 107 |
15874 | 108 CHECK_VALUE(sizeof(pci_t) == PCI_BYTES - 1); // -1 for substream id |
7029 | 109 |
110 memcpy(pci, buffer, sizeof(pci_t)); | |
111 | |
112 /* Endian conversions */ | |
113 | |
114 /* pci pci_gi */ | |
115 B2N_32(pci->pci_gi.nv_pck_lbn); | |
116 B2N_16(pci->pci_gi.vobu_cat); | |
117 B2N_32(pci->pci_gi.vobu_s_ptm); | |
118 B2N_32(pci->pci_gi.vobu_e_ptm); | |
119 B2N_32(pci->pci_gi.vobu_se_e_ptm); | |
120 | |
121 /* pci nsml_agli */ | |
122 for(i = 0; i < 9; i++) | |
123 B2N_32(pci->nsml_agli.nsml_agl_dsta[i]); | |
124 | |
125 /* pci hli hli_gi */ | |
126 B2N_16(pci->hli.hl_gi.hli_ss); | |
127 B2N_32(pci->hli.hl_gi.hli_s_ptm); | |
128 B2N_32(pci->hli.hl_gi.hli_e_ptm); | |
129 B2N_32(pci->hli.hl_gi.btn_se_e_ptm); | |
130 | |
131 /* pci hli btn_colit */ | |
132 for(i = 0; i < 3; i++) | |
133 for(j = 0; j < 2; j++) | |
134 B2N_32(pci->hli.btn_colit.btn_coli[i][j]); | |
135 | |
15874 | 136 /* NOTE: I've had to change the structure from the disk layout to get |
137 * the packing to work with Sun's Forte C compiler. */ | |
138 | |
7029 | 139 /* pci hli btni */ |
140 for(i = 0; i < 36; i++) { | |
15874 | 141 char tmp[sizeof(pci->hli.btnit[i])], swap; |
142 memcpy(tmp, &(pci->hli.btnit[i]), sizeof(pci->hli.btnit[i])); | |
143 /* Byte 4 to 7 are 'rotated' was: ABCD EFGH IJ is: ABCG DEFH IJ */ | |
144 swap = tmp[6]; | |
145 tmp[6] = tmp[5]; | |
146 tmp[5] = tmp[4]; | |
147 tmp[4] = tmp[3]; | |
148 tmp[3] = swap; | |
149 | |
150 /* Then there are the two B2N_24(..) calls */ | |
151 #ifndef WORDS_BIGENDIAN | |
152 swap = tmp[0]; | |
153 tmp[0] = tmp[2]; | |
154 tmp[2] = swap; | |
155 | |
156 swap = tmp[4]; | |
157 tmp[4] = tmp[6]; | |
158 tmp[6] = swap; | |
159 #endif | |
160 memcpy(&(pci->hli.btnit[i]), tmp, sizeof(pci->hli.btnit[i])); | |
7029 | 161 } |
162 | |
163 | |
15874 | 164 #ifndef NDEBUG |
7029 | 165 /* Asserts */ |
166 | |
167 /* pci pci gi */ | |
15874 | 168 CHECK_VALUE(pci->pci_gi.zero1 == 0); |
7029 | 169 |
170 /* pci hli hli_gi */ | |
15874 | 171 CHECK_VALUE(pci->hli.hl_gi.zero1 == 0); |
172 CHECK_VALUE(pci->hli.hl_gi.zero2 == 0); | |
173 CHECK_VALUE(pci->hli.hl_gi.zero3 == 0); | |
174 CHECK_VALUE(pci->hli.hl_gi.zero4 == 0); | |
175 CHECK_VALUE(pci->hli.hl_gi.zero5 == 0); | |
7029 | 176 |
177 /* Are there buttons defined here? */ | |
178 if((pci->hli.hl_gi.hli_ss & 0x03) != 0) { | |
15874 | 179 CHECK_VALUE(pci->hli.hl_gi.btn_ns != 0); |
180 CHECK_VALUE(pci->hli.hl_gi.btngr_ns != 0); | |
7029 | 181 } else { |
15874 | 182 CHECK_VALUE((pci->hli.hl_gi.btn_ns != 0 && pci->hli.hl_gi.btngr_ns != 0) |
24050
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
183 || (pci->hli.hl_gi.btn_ns == 0 && pci->hli.hl_gi.btngr_ns == 0)); |
7029 | 184 } |
185 | |
186 /* pci hli btnit */ | |
187 for(i = 0; i < pci->hli.hl_gi.btngr_ns; i++) { | |
188 for(j = 0; j < (36 / pci->hli.hl_gi.btngr_ns); j++) { | |
8257
635df9d22d38
100l patch by (Dominik Mierzejewski <dominik at rangers dot eu dot org>)
michael
parents:
8254
diff
changeset
|
189 int n = (36 / pci->hli.hl_gi.btngr_ns) * i + j; |
15874 | 190 CHECK_VALUE(pci->hli.btnit[n].zero1 == 0); |
191 CHECK_VALUE(pci->hli.btnit[n].zero2 == 0); | |
192 CHECK_VALUE(pci->hli.btnit[n].zero3 == 0); | |
193 CHECK_VALUE(pci->hli.btnit[n].zero4 == 0); | |
194 CHECK_VALUE(pci->hli.btnit[n].zero5 == 0); | |
195 CHECK_VALUE(pci->hli.btnit[n].zero6 == 0); | |
7029 | 196 |
24050
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
197 if (j < pci->hli.hl_gi.btn_ns) { |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
198 CHECK_VALUE(pci->hli.btnit[n].x_start <= pci->hli.btnit[n].x_end); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
199 CHECK_VALUE(pci->hli.btnit[n].y_start <= pci->hli.btnit[n].y_end); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
200 CHECK_VALUE(pci->hli.btnit[n].up <= pci->hli.hl_gi.btn_ns); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
201 CHECK_VALUE(pci->hli.btnit[n].down <= pci->hli.hl_gi.btn_ns); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
202 CHECK_VALUE(pci->hli.btnit[n].left <= pci->hli.hl_gi.btn_ns); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
203 CHECK_VALUE(pci->hli.btnit[n].right <= pci->hli.hl_gi.btn_ns); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
204 //vmcmd_verify(pci->hli.btnit[n].cmd); |
7029 | 205 } else { |
24050
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
206 int k; |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
207 CHECK_VALUE(pci->hli.btnit[n].btn_coln == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
208 CHECK_VALUE(pci->hli.btnit[n].auto_action_mode == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
209 CHECK_VALUE(pci->hli.btnit[n].x_start == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
210 CHECK_VALUE(pci->hli.btnit[n].y_start == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
211 CHECK_VALUE(pci->hli.btnit[n].x_end == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
212 CHECK_VALUE(pci->hli.btnit[n].y_end == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
213 CHECK_VALUE(pci->hli.btnit[n].up == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
214 CHECK_VALUE(pci->hli.btnit[n].down == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
215 CHECK_VALUE(pci->hli.btnit[n].left == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
216 CHECK_VALUE(pci->hli.btnit[n].right == 0); |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
217 for (k = 0; k < 8; k++) |
1542693b2a30
Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents:
24047
diff
changeset
|
218 CHECK_VALUE(pci->hli.btnit[n].cmd.bytes[k] == 0); //CHECK_ZERO? |
7029 | 219 } |
220 } | |
221 } | |
15874 | 222 #endif /* !NDEBUG */ |
7029 | 223 } |
224 | |
225 void navRead_DSI(dsi_t *dsi, unsigned char *buffer) { | |
226 int i; | |
227 | |
15874 | 228 CHECK_VALUE(sizeof(dsi_t) == DSI_BYTES - 1); // -1 for substream id |
7029 | 229 |
230 memcpy(dsi, buffer, sizeof(dsi_t)); | |
231 | |
232 /* Endian conversions */ | |
233 | |
234 /* dsi dsi gi */ | |
235 B2N_32(dsi->dsi_gi.nv_pck_scr); | |
236 B2N_32(dsi->dsi_gi.nv_pck_lbn); | |
237 B2N_32(dsi->dsi_gi.vobu_ea); | |
238 B2N_32(dsi->dsi_gi.vobu_1stref_ea); | |
239 B2N_32(dsi->dsi_gi.vobu_2ndref_ea); | |
240 B2N_32(dsi->dsi_gi.vobu_3rdref_ea); | |
241 B2N_16(dsi->dsi_gi.vobu_vob_idn); | |
242 | |
243 /* dsi sml pbi */ | |
244 B2N_16(dsi->sml_pbi.category); | |
245 B2N_32(dsi->sml_pbi.ilvu_ea); | |
246 B2N_32(dsi->sml_pbi.ilvu_sa); | |
247 B2N_16(dsi->sml_pbi.size); | |
248 B2N_32(dsi->sml_pbi.vob_v_s_s_ptm); | |
249 B2N_32(dsi->sml_pbi.vob_v_e_e_ptm); | |
250 | |
251 /* dsi sml agli */ | |
252 for(i = 0; i < 9; i++) { | |
253 B2N_32(dsi->sml_agli.data[ i ].address); | |
254 B2N_16(dsi->sml_agli.data[ i ].size); | |
255 } | |
256 | |
257 /* dsi vobu sri */ | |
258 B2N_32(dsi->vobu_sri.next_video); | |
259 for(i = 0; i < 19; i++) | |
260 B2N_32(dsi->vobu_sri.fwda[i]); | |
261 B2N_32(dsi->vobu_sri.next_vobu); | |
262 B2N_32(dsi->vobu_sri.prev_vobu); | |
263 for(i = 0; i < 19; i++) | |
264 B2N_32(dsi->vobu_sri.bwda[i]); | |
265 B2N_32(dsi->vobu_sri.prev_video); | |
266 | |
267 /* dsi synci */ | |
268 for(i = 0; i < 8; i++) | |
269 B2N_16(dsi->synci.a_synca[i]); | |
270 for(i = 0; i < 32; i++) | |
271 B2N_32(dsi->synci.sp_synca[i]); | |
272 | |
273 | |
274 /* Asserts */ | |
275 | |
276 /* dsi dsi gi */ | |
15874 | 277 CHECK_VALUE(dsi->dsi_gi.zero1 == 0); |
7029 | 278 } |
279 |