annotate dvdread/nav_read.c @ 25199:1a466dcdff1e

Create correct extradata for vorbis audio when used as avi sub-demuxer
author reimar
date Sat, 01 Dec 2007 14:09:48 +0000
parents fc9f44db5fcd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
2 /*
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
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
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
8 * (at your option) any later version.
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
9 *
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
13 * GNU General Public License for more details.
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
14 *
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
18 */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
19
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
20 #include "config.h"
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
21
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
22 #include <stdio.h>
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
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
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
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
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
29
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
30 #include "bswap.h"
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
31 #include "nav_types.h"
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
32 #include "nav_read.h"
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
33 #include "dvdread_internal.h"
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
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
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
105 void navRead_PCI(pci_t *pci, unsigned char *buffer) {
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
106 int i, j;
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
107 getbits_state_t state;
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
108 if (!getbits_init(&state, buffer)) abort(); /* Passed NULL pointers */
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
109
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
110 /* pci pci_gi */
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
111 pci->pci_gi.nv_pck_lbn = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
112 pci->pci_gi.vobu_cat = getbits(&state, 16 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
113 pci->pci_gi.zero1 = getbits(&state, 16 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
114 pci->pci_gi.vobu_uop_ctl.zero = getbits(&state, 7 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
115 pci->pci_gi.vobu_uop_ctl.video_pres_mode_change = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
116
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
117 pci->pci_gi.vobu_uop_ctl.karaoke_audio_pres_mode_change = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
118 pci->pci_gi.vobu_uop_ctl.angle_change = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
119 pci->pci_gi.vobu_uop_ctl.subpic_stream_change = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
120 pci->pci_gi.vobu_uop_ctl.audio_stream_change = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
121 pci->pci_gi.vobu_uop_ctl.pause_on = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
122 pci->pci_gi.vobu_uop_ctl.still_off = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
123 pci->pci_gi.vobu_uop_ctl.button_select_or_activate = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
124 pci->pci_gi.vobu_uop_ctl.resume = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
125
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
126 pci->pci_gi.vobu_uop_ctl.chapter_menu_call = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
127 pci->pci_gi.vobu_uop_ctl.angle_menu_call = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
128 pci->pci_gi.vobu_uop_ctl.audio_menu_call = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
129 pci->pci_gi.vobu_uop_ctl.subpic_menu_call = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
130 pci->pci_gi.vobu_uop_ctl.root_menu_call = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
131 pci->pci_gi.vobu_uop_ctl.title_menu_call = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
132 pci->pci_gi.vobu_uop_ctl.backward_scan = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
133 pci->pci_gi.vobu_uop_ctl.forward_scan = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
134
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
135 pci->pci_gi.vobu_uop_ctl.next_pg_search = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
136 pci->pci_gi.vobu_uop_ctl.prev_or_top_pg_search = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
137 pci->pci_gi.vobu_uop_ctl.time_or_chapter_search = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
138 pci->pci_gi.vobu_uop_ctl.go_up = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
139 pci->pci_gi.vobu_uop_ctl.stop = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
140 pci->pci_gi.vobu_uop_ctl.title_play = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
141 pci->pci_gi.vobu_uop_ctl.chapter_search_or_play = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
142 pci->pci_gi.vobu_uop_ctl.title_or_time_play = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
143 pci->pci_gi.vobu_s_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
144 pci->pci_gi.vobu_e_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
145 pci->pci_gi.vobu_se_e_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
146 pci->pci_gi.e_eltm.hour = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
147 pci->pci_gi.e_eltm.minute = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
148 pci->pci_gi.e_eltm.second = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
149 pci->pci_gi.e_eltm.frame_u = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
150 for(i = 0; i < 32; i++)
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
151 pci->pci_gi.vobu_isrc[i] = getbits(&state, 8 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
152
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
153 /* pci nsml_agli */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
154 for(i = 0; i < 9; i++)
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
155 pci->nsml_agli.nsml_agl_dsta[i] = getbits(&state, 32 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
156
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
157 /* pci hli hli_gi */
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
158 pci->hli.hl_gi.hli_ss = getbits(&state, 16 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
159 pci->hli.hl_gi.hli_s_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
160 pci->hli.hl_gi.hli_e_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
161 pci->hli.hl_gi.btn_se_e_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
162 pci->hli.hl_gi.zero1 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
163 pci->hli.hl_gi.btngr_ns = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
164 pci->hli.hl_gi.zero2 = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
165 pci->hli.hl_gi.btngr1_dsp_ty = getbits(&state, 3 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
166 pci->hli.hl_gi.zero3 = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
167 pci->hli.hl_gi.btngr2_dsp_ty = getbits(&state, 3 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
168 pci->hli.hl_gi.zero4 = getbits(&state, 1 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
169 pci->hli.hl_gi.btngr3_dsp_ty = getbits(&state, 3 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
170 pci->hli.hl_gi.btn_ofn = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
171 pci->hli.hl_gi.btn_ns = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
172 pci->hli.hl_gi.nsl_btn_ns = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
173 pci->hli.hl_gi.zero5 = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
174 pci->hli.hl_gi.fosl_btnn = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
175 pci->hli.hl_gi.foac_btnn = getbits(&state, 8 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
176
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
177 /* pci hli btn_colit */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
178 for(i = 0; i < 3; i++)
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
179 for(j = 0; j < 2; j++)
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
180 pci->hli.btn_colit.btn_coli[i][j] = getbits(&state, 32 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
181
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
182 /* pci hli btni */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
183 for(i = 0; i < 36; i++) {
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
184 pci->hli.btnit[i].btn_coln = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
185 pci->hli.btnit[i].x_start = getbits(&state, 10 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
186 pci->hli.btnit[i].zero1 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
187 pci->hli.btnit[i].x_end = getbits(&state, 10 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
188
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
189 pci->hli.btnit[i].auto_action_mode = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
190 pci->hli.btnit[i].y_start = getbits(&state, 10 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
191 pci->hli.btnit[i].zero2 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
192 pci->hli.btnit[i].y_end = getbits(&state, 10 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
193
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
194 pci->hli.btnit[i].zero3 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
195 pci->hli.btnit[i].up = getbits(&state, 6 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
196 pci->hli.btnit[i].zero4 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
197 pci->hli.btnit[i].down = getbits(&state, 6 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
198 pci->hli.btnit[i].zero5 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
199 pci->hli.btnit[i].left = getbits(&state, 6 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
200 pci->hli.btnit[i].zero6 = getbits(&state, 2 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
201 pci->hli.btnit[i].right = getbits(&state, 6 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
202 /* pci vm_cmd */
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
203 for(j = 0; j < 8; j++)
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
204 pci->hli.btnit[i].cmd.bytes[j] = getbits(&state, 8 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
205 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
206
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
207
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
208 #ifndef NDEBUG
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
209 /* Asserts */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
210
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
211 /* pci pci gi */
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
212 CHECK_VALUE(pci->pci_gi.zero1 == 0);
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
213
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
214 /* pci hli hli_gi */
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
215 CHECK_VALUE(pci->hli.hl_gi.zero1 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
216 CHECK_VALUE(pci->hli.hl_gi.zero2 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
217 CHECK_VALUE(pci->hli.hl_gi.zero3 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
218 CHECK_VALUE(pci->hli.hl_gi.zero4 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
219 CHECK_VALUE(pci->hli.hl_gi.zero5 == 0);
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
220
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
221 /* Are there buttons defined here? */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
222 if((pci->hli.hl_gi.hli_ss & 0x03) != 0) {
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
223 CHECK_VALUE(pci->hli.hl_gi.btn_ns != 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
224 CHECK_VALUE(pci->hli.hl_gi.btngr_ns != 0);
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
225 } else {
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
226 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
227 || (pci->hli.hl_gi.btn_ns == 0 && pci->hli.hl_gi.btngr_ns == 0));
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
228 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
229
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
230 /* pci hli btnit */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
231 for(i = 0; i < pci->hli.hl_gi.btngr_ns; i++) {
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
232 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
233 int n = (36 / pci->hli.hl_gi.btngr_ns) * i + j;
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
234 CHECK_VALUE(pci->hli.btnit[n].zero1 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
235 CHECK_VALUE(pci->hli.btnit[n].zero2 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
236 CHECK_VALUE(pci->hli.btnit[n].zero3 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
237 CHECK_VALUE(pci->hli.btnit[n].zero4 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
238 CHECK_VALUE(pci->hli.btnit[n].zero5 == 0);
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
239 CHECK_VALUE(pci->hli.btnit[n].zero6 == 0);
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
240
24050
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
241 if (j < pci->hli.hl_gi.btn_ns) {
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
242 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
243 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
244 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
245 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
246 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
247 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
248 //vmcmd_verify(pci->hli.btnit[n].cmd);
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
249 } else {
24050
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
250 int k;
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
251 CHECK_VALUE(pci->hli.btnit[n].btn_coln == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
252 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
253 CHECK_VALUE(pci->hli.btnit[n].x_start == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
254 CHECK_VALUE(pci->hli.btnit[n].y_start == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
255 CHECK_VALUE(pci->hli.btnit[n].x_end == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
256 CHECK_VALUE(pci->hli.btnit[n].y_end == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
257 CHECK_VALUE(pci->hli.btnit[n].up == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
258 CHECK_VALUE(pci->hli.btnit[n].down == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
259 CHECK_VALUE(pci->hli.btnit[n].left == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
260 CHECK_VALUE(pci->hli.btnit[n].right == 0);
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
261 for (k = 0; k < 8; k++)
1542693b2a30 Sync libdvdread with version 0.9.5 (cosmetic changes).
diego
parents: 24047
diff changeset
262 CHECK_VALUE(pci->hli.btnit[n].cmd.bytes[k] == 0); //CHECK_ZERO?
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
263 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
264 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
265 }
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
266 #endif /* !NDEBUG */
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
267 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
268
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
269 void navRead_DSI(dsi_t *dsi, unsigned char *buffer) {
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
270 int i;
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
271 getbits_state_t state;
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
272 if (!getbits_init(&state, buffer)) abort(); /* Passed NULL pointers */
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
273
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
274 /* dsi dsi gi */
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
275 dsi->dsi_gi.nv_pck_scr = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
276 dsi->dsi_gi.nv_pck_lbn = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
277 dsi->dsi_gi.vobu_ea = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
278 dsi->dsi_gi.vobu_1stref_ea = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
279 dsi->dsi_gi.vobu_2ndref_ea = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
280 dsi->dsi_gi.vobu_3rdref_ea = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
281 dsi->dsi_gi.vobu_vob_idn = getbits(&state, 16 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
282 dsi->dsi_gi.zero1 = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
283 dsi->dsi_gi.vobu_c_idn = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
284 dsi->dsi_gi.c_eltm.hour = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
285 dsi->dsi_gi.c_eltm.minute = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
286 dsi->dsi_gi.c_eltm.second = getbits(&state, 8 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
287 dsi->dsi_gi.c_eltm.frame_u = getbits(&state, 8 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
288
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
289 /* dsi sml pbi */
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
290 dsi->sml_pbi.category = getbits(&state, 16 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
291 dsi->sml_pbi.ilvu_ea = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
292 dsi->sml_pbi.ilvu_sa = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
293 dsi->sml_pbi.size = getbits(&state, 16 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
294 dsi->sml_pbi.vob_v_s_s_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
295 dsi->sml_pbi.vob_v_e_e_ptm = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
296 for(i = 0; i < 8; i++) {
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
297 dsi->sml_pbi.vob_a[i].stp_ptm1 = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
298 dsi->sml_pbi.vob_a[i].stp_ptm2 = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
299 dsi->sml_pbi.vob_a[i].gap_len1 = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
300 dsi->sml_pbi.vob_a[i].gap_len2 = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
301 }
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
302
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
303 /* dsi sml agli */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
304 for(i = 0; i < 9; i++) {
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
305 dsi->sml_agli.data[ i ].address = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
306 dsi->sml_agli.data[ i ].size = getbits(&state, 16 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
307 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
308
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
309 /* dsi vobu sri */
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
310 dsi->vobu_sri.next_video = getbits(&state, 32 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
311 for(i = 0; i < 19; i++)
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
312 dsi->vobu_sri.fwda[i] = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
313 dsi->vobu_sri.next_vobu = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
314 dsi->vobu_sri.prev_vobu = getbits(&state, 32 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
315 for(i = 0; i < 19; i++)
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
316 dsi->vobu_sri.bwda[i] = getbits(&state, 32 );
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
317 dsi->vobu_sri.prev_video = getbits(&state, 32 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
318
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
319 /* dsi synci */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
320 for(i = 0; i < 8; i++)
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
321 dsi->synci.a_synca[i] = getbits(&state, 16 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
322 for(i = 0; i < 32; i++)
24088
fc9f44db5fcd reimplemented nav_read_PCI() and nav_read_DSI() using getbits() rather than relying on bitfields layout in memory
nicodvb
parents: 24081
diff changeset
323 dsi->synci.sp_synca[i] = getbits(&state, 32 );
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
324
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
325
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
326 /* Asserts */
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
327
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
328 /* dsi dsi gi */
15874
483e955893b8 update libdvdread to v0.9.4
aurel
parents: 14938
diff changeset
329 CHECK_VALUE(dsi->dsi_gi.zero1 == 0);
7029
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
330 }
9db58ffbd73c importing libdvdread 0.9.3 files
arpi
parents:
diff changeset
331