Mercurial > libdvdnav.hg
annotate vm.c @ 75:06cda03dc1e5 src
fix playback of the following dvds
- Bram Stoker's Dracula RC2
- The Cell RC2, German FSK16
author | mroi |
---|---|
date | Wed, 21 Aug 2002 15:25:50 +0000 |
parents | 5674fbd44f26 |
children | 0e2abe7083de |
rev | line source |
---|---|
0 | 1 /* |
2 * Copyright (C) 2000, 2001 Håkan Hjort | |
3 * Copyright (C) 2001 Rich Wareham <richwareham@users.sourceforge.net> | |
4 * | |
5 * This file is part of libdvdnav, a DVD navigation library. It is modified | |
6 * from a file originally part of the Ogle DVD player. | |
7 * | |
8 * libdvdnav is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * libdvdnav is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
21 * | |
22 * $Id$ | |
23 * | |
24 */ | |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 #include "config.h" | |
28 #endif | |
29 | |
30 #include <stdio.h> | |
31 #include <string.h> | |
32 #include <stdlib.h> | |
33 #include <unistd.h> | |
34 #include <inttypes.h> | |
35 #include <assert.h> | |
36 | |
37 #include <dvdread/ifo_types.h> | |
38 #include <dvdread/ifo_read.h> | |
39 | |
40 #include "decoder.h" | |
41 #include "vmcmd.h" | |
42 #include "vm.h" | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
43 #include "dvdnav_internal.h" |
0 | 44 |
75 | 45 /* |
46 #define STRICT | |
47 */ | |
48 | |
0 | 49 /* Local prototypes */ |
50 | |
6 | 51 static void saveRSMinfo(vm_t *vm,int cellN, int blockN); |
52 static link_t play_PGC(vm_t *vm); | |
38 | 53 static link_t play_PGC_PG(vm_t *vm, int pgN); |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
54 static link_t play_PGC_post(vm_t *vm); |
6 | 55 static link_t play_PG(vm_t *vm); |
56 static link_t play_Cell(vm_t *vm); | |
57 static link_t play_Cell_post(vm_t *vm); | |
58 static link_t process_command(vm_t *vm,link_t link_values); | |
0 | 59 |
6 | 60 static void ifoOpenNewVTSI(vm_t *vm,dvd_reader_t *dvd, int vtsN); |
61 static pgcit_t* get_PGCIT(vm_t *vm); | |
0 | 62 |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
63 /* get_XYZ returns a value. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
64 * ser_XYZ sets state using passed parameters. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
65 * returns success/failure. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
66 */ |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
67 |
0 | 68 /* Can only be called when in VTS_DOMAIN */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
69 static int set_FP_PGC(vm_t *vm); /* FP */ |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
70 static int set_TT(vm_t *vm,int tt); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
71 static int set_VTS_TT(vm_t *vm,int vtsN, int vts_ttn); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
72 static int set_VTS_PTT(vm_t *vm,int vtsN, int vts_ttn, int part); |
0 | 73 |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
74 static int set_MENU(vm_t *vm,int menu); /* VTSM & VMGM */ |
0 | 75 |
76 /* Called in any domain */ | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
77 static int get_TT(vm_t *vm, int vtsN, int vts_ttn); |
6 | 78 static int get_ID(vm_t *vm,int id); |
79 static int get_PGCN(vm_t *vm); | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
80 static int set_PGN(vm_t *vm); /* Set PGN based on (vm->state).CellN */ |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
81 static int set_PGC(vm_t *vm,int pgcN); |
0 | 82 |
83 /* Initialisation */ | |
84 | |
85 vm_t* vm_new_vm() { | |
86 vm_t *vm = (vm_t*)calloc(sizeof(vm_t), sizeof(char)); | |
87 | |
88 return vm; | |
89 } | |
90 | |
6 | 91 static void vm_print_current_domain_state(vm_t *vm) { |
92 switch((vm->state).domain) { | |
0 | 93 case VTS_DOMAIN: |
94 fprintf(stderr, "Video Title Domain: -\n"); | |
95 break; | |
96 | |
97 case VTSM_DOMAIN: | |
98 fprintf(stderr, "Video Title Menu Domain: -\n"); | |
99 break; | |
100 | |
101 case VMGM_DOMAIN: | |
102 fprintf(stderr, "Video Manager Menu Domain: -\n"); | |
103 break; | |
104 | |
105 case FP_DOMAIN: | |
106 fprintf(stderr, "First Play Domain: -\n"); | |
107 break; | |
108 | |
109 default: | |
110 fprintf(stderr, "Unknown Domain: -\n"); | |
111 break; | |
112 } | |
113 fprintf(stderr, "VTS:%d PG:%u CELL:%u BLOCK:%u VTS_TTN:%u TTN:%u TT_PGCN:%u\n", | |
6 | 114 (vm->state).vtsN, |
115 (vm->state).pgN, | |
116 (vm->state).cellN, | |
117 (vm->state).blockN, | |
118 (vm->state).VTS_TTN_REG, | |
119 (vm->state).TTN_REG, | |
120 (vm->state).TT_PGCN_REG); | |
0 | 121 } |
122 | |
6 | 123 void vm_stop(vm_t *vm) { |
124 if(!vm) | |
0 | 125 return; |
126 | |
6 | 127 if(vm->vmgi) { |
128 ifoClose(vm->vmgi); | |
129 vm->vmgi=NULL; | |
0 | 130 } |
131 | |
6 | 132 if(vm->vtsi) { |
133 ifoClose(vm->vtsi); | |
134 vm->vmgi=NULL; | |
0 | 135 } |
136 | |
6 | 137 if(vm->dvd) { |
138 DVDClose(vm->dvd); | |
139 vm->dvd=NULL; | |
0 | 140 } |
141 } | |
142 | |
6 | 143 void vm_free_vm(vm_t *vm) { |
144 if(vm) { | |
145 vm_stop(vm); | |
146 free(vm); | |
0 | 147 } |
148 } | |
149 | |
150 /* IFO Access */ | |
151 | |
6 | 152 ifo_handle_t *vm_get_vmgi(vm_t *vm) { |
153 if(!vm) | |
0 | 154 return NULL; |
155 | |
6 | 156 return vm->vmgi; |
0 | 157 } |
158 | |
6 | 159 ifo_handle_t *vm_get_vtsi(vm_t *vm) { |
160 if(!vm) | |
0 | 161 return NULL; |
162 | |
6 | 163 return vm->vtsi; |
0 | 164 } |
165 | |
166 /* Reader Access */ | |
167 | |
6 | 168 dvd_reader_t *vm_get_dvd_reader(vm_t *vm) { |
169 if(!vm) | |
0 | 170 return NULL; |
171 | |
6 | 172 return vm->dvd; |
0 | 173 } |
174 | |
17 | 175 int vm_reset(vm_t *vm, char *dvdroot) /* , register_t regs) */ { |
0 | 176 /* Setup State */ |
6 | 177 memset((vm->state).registers.SPRM, 0, sizeof(uint16_t)*24); |
178 memset((vm->state).registers.GPRM, 0, sizeof((vm->state).registers.GPRM)); | |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
179 memset((vm->state).registers.GPRM_mode, 0, sizeof((vm->state).registers.GPRM_mode)); |
19
7e8628911b4f
Implement General Register Counters or GPRM counters.
jcdutton
parents:
18
diff
changeset
|
180 memset((vm->state).registers.GPRM_mode, 0, sizeof((vm->state).registers.GPRM_mode)); |
7e8628911b4f
Implement General Register Counters or GPRM counters.
jcdutton
parents:
18
diff
changeset
|
181 memset((vm->state).registers.GPRM_time, 0, sizeof((vm->state).registers.GPRM_time)); |
6 | 182 (vm->state).registers.SPRM[0] = ('e'<<8)|'n'; /* Player Menu Languange code */ |
183 (vm->state).AST_REG = 15; /* 15 why? */ | |
184 (vm->state).SPST_REG = 62; /* 62 why? */ | |
185 (vm->state).AGL_REG = 1; | |
186 (vm->state).TTN_REG = 1; | |
187 (vm->state).VTS_TTN_REG = 1; | |
188 /* (vm->state).TT_PGCN_REG = 0 */ | |
189 (vm->state).PTTN_REG = 1; | |
190 (vm->state).HL_BTNN_REG = 1 << 10; | |
0 | 191 |
6 | 192 (vm->state).PTL_REG = 15; /* Parental Level */ |
193 (vm->state).registers.SPRM[12] = ('U'<<8)|'S'; /* Parental Management Country Code */ | |
194 (vm->state).registers.SPRM[16] = ('e'<<8)|'n'; /* Initial Language Code for Audio */ | |
195 (vm->state).registers.SPRM[18] = ('e'<<8)|'n'; /* Initial Language Code for Spu */ | |
0 | 196 /* Player Regional Code Mask. |
197 * bit0 = Region 1 | |
198 * bit1 = Region 2 | |
199 */ | |
6 | 200 (vm->state).registers.SPRM[20] = 0x1; /* Player Regional Code Mask. Region free! */ |
201 (vm->state).registers.SPRM[14] = 0x100; /* Try Pan&Scan */ | |
0 | 202 |
6 | 203 (vm->state).pgN = 0; |
204 (vm->state).cellN = 0; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
205 (vm->state).cell_restart = 0; |
0 | 206 |
6 | 207 (vm->state).domain = FP_DOMAIN; |
208 (vm->state).rsm_vtsN = 0; | |
209 (vm->state).rsm_cellN = 0; | |
210 (vm->state).rsm_blockN = 0; | |
0 | 211 |
6 | 212 (vm->state).vtsN = -1; |
0 | 213 |
6 | 214 if (vm->dvd && dvdroot) { |
42 | 215 /* a new dvd device has been requested */ |
6 | 216 vm_stop(vm); |
0 | 217 } |
6 | 218 if (!vm->dvd) { |
219 vm->dvd = DVDOpen(dvdroot); | |
220 if(!vm->dvd) { | |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
221 fprintf(stderr, "vm: faild to open/read the DVD\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
222 return -1; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
223 } |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
224 |
6 | 225 vm->vmgi = ifoOpenVMGI(vm->dvd); |
226 if(!vm->vmgi) { | |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
227 fprintf(stderr, "vm: faild to read VIDEO_TS.IFO\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
228 return -1; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
229 } |
6 | 230 if(!ifoRead_FP_PGC(vm->vmgi)) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
231 fprintf(stderr, "vm: ifoRead_FP_PGC failed\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
232 return -1; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
233 } |
6 | 234 if(!ifoRead_TT_SRPT(vm->vmgi)) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
235 fprintf(stderr, "vm: ifoRead_TT_SRPT failed\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
236 return -1; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
237 } |
6 | 238 if(!ifoRead_PGCI_UT(vm->vmgi)) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
239 fprintf(stderr, "vm: ifoRead_PGCI_UT failed\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
240 return -1; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
241 } |
6 | 242 if(!ifoRead_PTL_MAIT(vm->vmgi)) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
243 fprintf(stderr, "vm: ifoRead_PTL_MAIT failed\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
244 ; /* return -1; Not really used for now.. */ |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
245 } |
6 | 246 if(!ifoRead_VTS_ATRT(vm->vmgi)) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
247 fprintf(stderr, "vm: ifoRead_VTS_ATRT failed\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
248 ; /* return -1; Not really used for now.. */ |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
249 } |
6 | 250 if(!ifoRead_VOBU_ADMAP(vm->vmgi)) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
251 fprintf(stderr, "vm: ifoRead_VOBU_ADMAP vgmi failed\n"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
252 ; /* return -1; Not really used for now.. */ |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
253 } |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
254 /* ifoRead_TXTDT_MGI(vmgi); Not implemented yet */ |
0 | 255 } |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
256 else fprintf(stderr, "vm: reset\n"); |
18 | 257 if (vm->vmgi) { |
258 fprintf(stderr, "DVD disk reports itself with Region mask 0x%08x. Maybe region %u.\n", | |
259 vm->vmgi->vmgi_mat->vmg_category, | |
260 (((vm->vmgi->vmgi_mat->vmg_category >> 16) ^ 0xff) & 0xff) ); | |
261 } | |
0 | 262 return 0; |
263 } | |
264 | |
265 /* FIXME TODO XXX $$$ Handle error condition too... */ | |
6 | 266 int vm_start(vm_t *vm) |
0 | 267 { |
268 link_t link_values; | |
269 | |
9 | 270 /* Set pgc to FP(First Play) pgc */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
271 set_FP_PGC(vm); |
6 | 272 link_values = play_PGC(vm); |
273 link_values = process_command(vm,link_values); | |
0 | 274 assert(link_values.command == PlayThis); |
6 | 275 (vm->state).blockN = link_values.data1; |
31 | 276 #ifdef TRACE |
24 | 277 fprintf(stderr, "vm_start: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 278 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
279 assert( (vm->state).blockN == 0 ); |
24 | 280 |
0 | 281 |
282 return 0; /* ?? */ | |
283 } | |
284 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
285 int vm_position_get(vm_t *vm, vm_position_t *position) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
286 position->button = (vm->state).HL_BTNN_REG >> 10; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
287 position->spu_channel = (vm->state).SPST_REG; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
288 position->audio_channel = (vm->state).AST_REG; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
289 position->angle_channel = (vm->state).AGL_REG; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
290 position->hop_channel = vm->hop_channel; /* Increases by one on each hop */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
291 position->vts = (vm->state).vtsN; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
292 position->domain = (vm->state).domain; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
293 position->cell = (vm->state).cellN; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
294 position->cell_restart = (vm->state).cell_restart; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
295 position->still = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].still_time; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
296 position->vobu_start = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
297 position->vobu_next = (vm->state).blockN; |
42 | 298 /* position->vobu_next = 0; Just for now */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
299 return 1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
300 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
301 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
302 int vm_position_print(vm_t *vm, vm_position_t *position) { |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
303 fprintf(stderr, "But=%x Spu=%x Aud=%x Ang=%x Hop=%x vts=%x dom=%x cell=%x cell_restart=%x still=%x start=%x next=%x\n", |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
304 position->button, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
305 position->spu_channel, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
306 position->audio_channel, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
307 position->angle_channel, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
308 position->hop_channel, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
309 position->vts, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
310 position->domain, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
311 position->cell, |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
312 position->cell_restart, |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
313 position->still, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
314 position->vobu_start, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
315 position->vobu_next); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
316 return 1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
317 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
318 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
319 |
6 | 320 int vm_start_title(vm_t *vm, int tt) { |
0 | 321 link_t link_values; |
322 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
323 set_TT(vm, tt); |
6 | 324 link_values = play_PGC(vm); |
325 link_values = process_command(vm, link_values); | |
0 | 326 assert(link_values.command == PlayThis); |
6 | 327 (vm->state).blockN = link_values.data1; |
31 | 328 #ifdef TRACE |
24 | 329 fprintf(stderr, "vm_start_title: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 330 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
331 assert( (vm->state).blockN == 0 ); |
0 | 332 |
333 return 0; /* ?? */ | |
334 } | |
335 | |
6 | 336 int vm_jump_prog(vm_t *vm, int pr) { |
0 | 337 link_t link_values; |
338 | |
339 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
340 set_PGC(vm, get_PGCN(vm)); |
52 | 341 (vm->state).pgN = pr; /* ?? set_PGC() clobbers pgN */ |
6 | 342 link_values = play_PG(vm); |
343 link_values = process_command(vm, link_values); | |
0 | 344 assert(link_values.command == PlayThis); |
6 | 345 (vm->state).blockN = link_values.data1; |
31 | 346 #ifdef TRACE |
24 | 347 fprintf(stderr, "vm_jump_prog: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 348 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
349 assert( (vm->state).blockN == 0 ); |
0 | 350 |
351 return 0; /* ?? */ | |
352 } | |
353 | |
6 | 354 int vm_eval_cmd(vm_t *vm, vm_cmd_t *cmd) |
0 | 355 { |
356 link_t link_values; | |
357 | |
6 | 358 if(vmEval_CMD(cmd, 1, &(vm->state).registers, &link_values)) { |
359 link_values = process_command(vm, link_values); | |
0 | 360 assert(link_values.command == PlayThis); |
6 | 361 (vm->state).blockN = link_values.data1; |
31 | 362 #ifdef TRACE |
24 | 363 fprintf(stderr, "vm_eval_cmd: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 364 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
365 assert( (vm->state).blockN == 0 ); |
0 | 366 return 1; /* Something changed, Jump */ |
367 } else { | |
368 return 0; /* It updated some state thats all... */ | |
369 } | |
370 } | |
371 | |
6 | 372 int vm_get_next_cell(vm_t *vm) |
0 | 373 { |
374 link_t link_values; | |
6 | 375 link_values = play_Cell_post(vm); |
376 link_values = process_command(vm,link_values); | |
0 | 377 assert(link_values.command == PlayThis); |
6 | 378 (vm->state).blockN = link_values.data1; |
31 | 379 #ifdef TRACE |
24 | 380 fprintf(stderr, "vm_get_next_cell: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 381 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
382 assert( (vm->state).blockN == 0 ); |
0 | 383 |
384 return 0; /* ?? */ | |
385 } | |
386 | |
6 | 387 int vm_top_pg(vm_t *vm) |
0 | 388 { |
389 link_t link_values; | |
6 | 390 link_values = play_PG(vm); |
391 link_values = process_command(vm,link_values); | |
0 | 392 assert(link_values.command == PlayThis); |
6 | 393 (vm->state).blockN = link_values.data1; |
31 | 394 #ifdef TRACE |
24 | 395 fprintf(stderr, "vm_top_pg: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 396 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
397 assert( (vm->state).blockN == 0 ); |
0 | 398 |
399 return 1; /* Jump */ | |
400 } | |
401 | |
6 | 402 int vm_go_up(vm_t *vm) |
0 | 403 { |
404 link_t link_values; | |
405 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
406 if(set_PGC(vm, (vm->state).pgc->goup_pgc_nr)) |
0 | 407 assert(0); |
408 | |
6 | 409 link_values = play_PGC(vm); |
410 link_values = process_command(vm,link_values); | |
0 | 411 assert(link_values.command == PlayThis); |
6 | 412 (vm->state).blockN = link_values.data1; |
31 | 413 #ifdef TRACE |
24 | 414 fprintf(stderr, "vm_go_up: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 415 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
416 assert( (vm->state).blockN == 0 ); |
0 | 417 |
418 return 1; /* Jump */ | |
419 } | |
420 | |
6 | 421 int vm_next_pg(vm_t *vm) |
0 | 422 { |
423 /* Do we need to get a updated pgN value first? */ | |
6 | 424 (vm->state).pgN += 1; |
425 return vm_top_pg(vm); | |
0 | 426 } |
427 | |
6 | 428 int vm_prev_pg(vm_t *vm) |
0 | 429 { |
430 /* Do we need to get a updated pgN value first? */ | |
6 | 431 (vm->state).pgN -= 1; |
432 if((vm->state).pgN == 0) { | |
0 | 433 /* Check for previous PGCN ? */ |
6 | 434 (vm->state).pgN = 1; |
0 | 435 /* return 0; */ |
436 } | |
6 | 437 return vm_top_pg(vm); |
0 | 438 } |
439 | |
440 | |
441 static domain_t menuid2domain(DVDMenuID_t menuid) | |
442 { | |
443 domain_t result = VTSM_DOMAIN; /* Really shouldn't have to.. */ | |
444 | |
445 switch(menuid) { | |
446 case DVD_MENU_Title: | |
447 result = VMGM_DOMAIN; | |
448 break; | |
449 case DVD_MENU_Root: | |
450 case DVD_MENU_Subpicture: | |
451 case DVD_MENU_Audio: | |
452 case DVD_MENU_Angle: | |
453 case DVD_MENU_Part: | |
454 result = VTSM_DOMAIN; | |
455 break; | |
456 } | |
457 | |
458 return result; | |
459 } | |
460 | |
6 | 461 int vm_menu_call(vm_t *vm, DVDMenuID_t menuid, int block) |
0 | 462 { |
463 domain_t old_domain; | |
464 link_t link_values; | |
465 | |
466 /* Should check if we are allowed/can acces this menu */ | |
467 | |
468 | |
469 /* FIXME XXX $$$ How much state needs to be restored | |
470 * when we fail to find a menu? */ | |
471 | |
6 | 472 old_domain = (vm->state).domain; |
0 | 473 |
6 | 474 switch((vm->state).domain) { |
0 | 475 case VTS_DOMAIN: |
6 | 476 saveRSMinfo(vm, 0, block); |
0 | 477 /* FALL THROUGH */ |
478 case VTSM_DOMAIN: | |
479 case VMGM_DOMAIN: | |
6 | 480 (vm->state).domain = menuid2domain(menuid); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
481 if(get_PGCIT(vm) != NULL && set_MENU(vm, menuid) != -1) { |
6 | 482 link_values = play_PGC(vm); |
483 link_values = process_command(vm, link_values); | |
0 | 484 assert(link_values.command == PlayThis); |
6 | 485 (vm->state).blockN = link_values.data1; |
31 | 486 #ifdef TRACE |
24 | 487 fprintf(stderr, "vm_menu_call: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 488 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
489 assert( (vm->state).blockN == 0 ); |
0 | 490 return 1; /* Jump */ |
491 } else { | |
6 | 492 (vm->state).domain = old_domain; |
0 | 493 } |
494 break; | |
495 case FP_DOMAIN: /* FIXME XXX $$$ What should we do here? */ | |
496 break; | |
497 } | |
498 | |
499 return 0; | |
500 } | |
501 | |
502 | |
6 | 503 int vm_resume(vm_t *vm) |
0 | 504 { |
505 int i; | |
506 link_t link_values; | |
507 | |
508 /* Check and see if there is any rsm info!! */ | |
6 | 509 if((vm->state).rsm_vtsN == 0) { |
0 | 510 return 0; |
511 } | |
512 | |
6 | 513 (vm->state).domain = VTS_DOMAIN; |
514 ifoOpenNewVTSI(vm, vm->dvd, (vm->state).rsm_vtsN); | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
515 set_PGC(vm, (vm->state).rsm_pgcN); |
0 | 516 |
517 /* These should never be set in SystemSpace and/or MenuSpace */ | |
6 | 518 /* (vm->state).TTN_REG = (vm->state).rsm_tt; */ |
519 /* (vm->state).TT_PGCN_REG = (vm->state).rsm_pgcN; */ | |
520 /* (vm->state).HL_BTNN_REG = (vm->state).rsm_btnn; */ | |
0 | 521 for(i = 0; i < 5; i++) { |
6 | 522 (vm->state).registers.SPRM[4 + i] = (vm->state).rsm_regs[i]; |
0 | 523 } |
524 | |
6 | 525 if((vm->state).rsm_cellN == 0) { |
526 assert((vm->state).cellN); /* Checking if this ever happens */ | |
527 (vm->state).pgN = 1; | |
528 link_values = play_PG(vm); | |
529 link_values = process_command(vm, link_values); | |
0 | 530 assert(link_values.command == PlayThis); |
6 | 531 (vm->state).blockN = link_values.data1; |
31 | 532 #ifdef TRACE |
24 | 533 fprintf(stderr, "vm_resume1: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 534 #endif |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
535 assert( (vm->state).blockN == 0 ); |
0 | 536 } else { |
6 | 537 (vm->state).cellN = (vm->state).rsm_cellN; |
538 (vm->state).blockN = (vm->state).rsm_blockN; | |
31 | 539 #ifdef TRACE |
24 | 540 fprintf(stderr, "vm_resume2: blockN set to 0x%x\n", (vm->state).blockN); |
31 | 541 #endif |
6 | 542 /* (vm->state).pgN = ?? does this gets the righ value in play_Cell, no! */ |
543 if(set_PGN(vm)) { | |
0 | 544 /* Were at or past the end of the PGC, should not happen for a RSM */ |
545 assert(0); | |
6 | 546 play_PGC_post(vm); |
0 | 547 } |
548 } | |
549 | |
550 return 1; /* Jump */ | |
551 } | |
552 | |
553 /** | |
554 * Return the substream id for 'logical' audio stream audioN. | |
555 * 0 <= audioN < 8 | |
556 */ | |
6 | 557 int vm_get_audio_stream(vm_t *vm, int audioN) |
0 | 558 { |
559 int streamN = -1; | |
31 | 560 #ifdef TRACE |
561 fprintf(stderr,"dvdnav:vm.c:get_audio_stream audioN=%d\n",audioN); | |
562 #endif | |
6 | 563 if((vm->state).domain == VTSM_DOMAIN |
564 || (vm->state).domain == VMGM_DOMAIN | |
565 || (vm->state).domain == FP_DOMAIN) { | |
0 | 566 audioN = 0; |
567 } | |
568 | |
569 if(audioN < 8) { | |
570 /* Is there any contol info for this logical stream */ | |
6 | 571 if((vm->state).pgc->audio_control[audioN] & (1<<15)) { |
572 streamN = ((vm->state).pgc->audio_control[audioN] >> 8) & 0x07; | |
0 | 573 } |
574 } | |
575 | |
6 | 576 if((vm->state).domain == VTSM_DOMAIN |
577 || (vm->state).domain == VMGM_DOMAIN | |
578 || (vm->state).domain == FP_DOMAIN) { | |
0 | 579 if(streamN == -1) |
580 streamN = 0; | |
581 } | |
582 | |
583 /* Should also check in vtsi/vmgi status that what kind of stream | |
584 * it is (ac3/lpcm/dts/sdds...) to find the right (sub)stream id */ | |
585 return streamN; | |
586 } | |
587 | |
588 /** | |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
589 * Return the substream id for 'logical' subpicture stream subpN and given mode. |
0 | 590 * 0 <= subpN < 32 |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
591 * mode == 0 - widescreen |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
592 * mode == 1 - letterbox |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
593 * mode == 2 - pan&scan |
0 | 594 */ |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
595 int vm_get_subp_stream(vm_t *vm, int subpN, int mode) |
0 | 596 { |
597 int streamN = -1; | |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
598 int source_aspect = vm_get_video_aspect(vm); |
0 | 599 |
6 | 600 if((vm->state).domain == VTSM_DOMAIN |
601 || (vm->state).domain == VMGM_DOMAIN | |
602 || (vm->state).domain == FP_DOMAIN) { | |
0 | 603 subpN = 0; |
604 } | |
605 | |
606 if(subpN < 32) { /* a valid logical stream */ | |
607 /* Is this logical stream present */ | |
6 | 608 if((vm->state).pgc->subp_control[subpN] & (1<<31)) { |
0 | 609 if(source_aspect == 0) /* 4:3 */ |
6 | 610 streamN = ((vm->state).pgc->subp_control[subpN] >> 24) & 0x1f; |
0 | 611 if(source_aspect == 3) /* 16:9 */ |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
612 switch (mode) { |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
613 case 0: |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
614 streamN = ((vm->state).pgc->subp_control[subpN] >> 16) & 0x1f; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
615 break; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
616 case 1: |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
617 streamN = ((vm->state).pgc->subp_control[subpN] >> 8) & 0x1f; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
618 break; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
619 case 2: |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
620 streamN = (vm->state).pgc->subp_control[subpN] & 0x1f; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
621 } |
0 | 622 } |
623 } | |
624 | |
625 /* Paranoia.. if no stream select 0 anyway */ | |
626 /* I am not paranoid */ | |
6 | 627 /* if((vm->state).domain == VTSM_DOMAIN |
628 || (vm->state).domain == VMGM_DOMAIN | |
629 || (vm->state).domain == FP_DOMAIN) { | |
0 | 630 if(streamN == -1) |
631 streamN = 0; | |
632 } | |
633 */ | |
634 /* Should also check in vtsi/vmgi status that what kind of stream it is. */ | |
635 return streamN; | |
636 } | |
637 | |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
638 int vm_get_subp_active_stream(vm_t *vm, int mode) |
0 | 639 { |
640 int subpN; | |
641 int streamN; | |
6 | 642 subpN = (vm->state).SPST_REG & ~0x40; |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
643 streamN = vm_get_subp_stream(vm, subpN, mode); |
0 | 644 |
645 /* If no such stream, then select the first one that exists. */ | |
646 if(streamN == -1) { | |
647 for(subpN = 0; subpN < 32; subpN++) { | |
6 | 648 if((vm->state).pgc->subp_control[subpN] & (1<<31)) { |
0 | 649 |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
650 streamN = vm_get_subp_stream(vm, subpN, mode); |
0 | 651 break; |
652 } | |
653 } | |
654 } | |
655 | |
656 /* We should instead send the on/off status to the spudecoder / mixer */ | |
657 /* If we are in the title domain see if the spu mixing is on */ | |
6 | 658 if((vm->state).domain == VTS_DOMAIN && !((vm->state).SPST_REG & 0x40)) { |
0 | 659 /* Bit 7 set means hide, and only let Forced display show */ |
660 return (streamN | 0x80); | |
661 } else { | |
662 return streamN; | |
663 } | |
664 } | |
665 | |
6 | 666 int vm_get_audio_active_stream(vm_t *vm) |
0 | 667 { |
668 int audioN; | |
669 int streamN; | |
6 | 670 audioN = (vm->state).AST_REG ; |
671 streamN = vm_get_audio_stream(vm, audioN); | |
0 | 672 |
673 /* If no such stream, then select the first one that exists. */ | |
674 if(streamN == -1) { | |
675 for(audioN = 0; audioN < 8; audioN++) { | |
6 | 676 if((vm->state).pgc->audio_control[audioN] & (1<<15)) { |
677 streamN = vm_get_audio_stream(vm, audioN); | |
0 | 678 break; |
679 } | |
680 } | |
681 } | |
682 | |
683 return streamN; | |
684 } | |
685 | |
686 | |
6 | 687 void vm_get_angle_info(vm_t *vm, int *num_avail, int *current) |
0 | 688 { |
689 *num_avail = 1; | |
690 *current = 1; | |
691 | |
6 | 692 if((vm->state).domain == VTS_DOMAIN) { |
0 | 693 /* TTN_REG does not allways point to the correct title.. */ |
694 title_info_t *title; | |
6 | 695 if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts) |
0 | 696 return; |
6 | 697 title = &vm->vmgi->tt_srpt->title[(vm->state).TTN_REG - 1]; |
698 if(title->title_set_nr != (vm->state).vtsN || | |
699 title->vts_ttn != (vm->state).VTS_TTN_REG) | |
0 | 700 return; |
701 *num_avail = title->nr_of_angles; | |
6 | 702 *current = (vm->state).AGL_REG; |
0 | 703 if(*current > *num_avail) /* Is this really a good idea? */ |
704 *current = *num_avail; | |
705 } | |
706 } | |
707 | |
708 | |
6 | 709 void vm_get_audio_info(vm_t *vm, int *num_avail, int *current) |
0 | 710 { |
6 | 711 if((vm->state).domain == VTS_DOMAIN) { |
712 *num_avail = vm->vtsi->vtsi_mat->nr_of_vts_audio_streams; | |
713 *current = (vm->state).AST_REG; | |
714 } else if((vm->state).domain == VTSM_DOMAIN) { | |
715 *num_avail = vm->vtsi->vtsi_mat->nr_of_vtsm_audio_streams; /* 1 */ | |
0 | 716 *current = 1; |
6 | 717 } else if((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN) { |
718 *num_avail = vm->vmgi->vmgi_mat->nr_of_vmgm_audio_streams; /* 1 */ | |
0 | 719 *current = 1; |
720 } | |
721 } | |
722 | |
6 | 723 void vm_get_subp_info(vm_t *vm, int *num_avail, int *current) |
0 | 724 { |
6 | 725 if((vm->state).domain == VTS_DOMAIN) { |
726 *num_avail = vm->vtsi->vtsi_mat->nr_of_vts_subp_streams; | |
727 *current = (vm->state).SPST_REG; | |
728 } else if((vm->state).domain == VTSM_DOMAIN) { | |
729 *num_avail = vm->vtsi->vtsi_mat->nr_of_vtsm_subp_streams; /* 1 */ | |
0 | 730 *current = 0x41; |
6 | 731 } else if((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN) { |
732 *num_avail = vm->vmgi->vmgi_mat->nr_of_vmgm_subp_streams; /* 1 */ | |
0 | 733 *current = 0x41; |
734 } | |
735 } | |
736 | |
6 | 737 subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN) |
0 | 738 { |
739 subp_attr_t attr; | |
740 | |
6 | 741 if((vm->state).domain == VTS_DOMAIN) { |
742 attr = vm->vtsi->vtsi_mat->vts_subp_attr[streamN]; | |
743 } else if((vm->state).domain == VTSM_DOMAIN) { | |
744 attr = vm->vtsi->vtsi_mat->vtsm_subp_attr; | |
745 } else if((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN) { | |
746 attr = vm->vmgi->vmgi_mat->vmgm_subp_attr; | |
0 | 747 } |
748 return attr; | |
749 } | |
750 | |
6 | 751 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN) |
0 | 752 { |
753 audio_attr_t attr; | |
754 | |
6 | 755 if((vm->state).domain == VTS_DOMAIN) { |
756 attr = vm->vtsi->vtsi_mat->vts_audio_attr[streamN]; | |
757 } else if((vm->state).domain == VTSM_DOMAIN) { | |
758 attr = vm->vtsi->vtsi_mat->vtsm_audio_attr; | |
759 } else if((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN) { | |
760 attr = vm->vmgi->vmgi_mat->vmgm_audio_attr; | |
0 | 761 } |
762 return attr; | |
763 } | |
764 | |
6 | 765 video_attr_t vm_get_video_attr(vm_t *vm) |
0 | 766 { |
767 video_attr_t attr; | |
768 | |
6 | 769 if((vm->state).domain == VTS_DOMAIN) { |
770 attr = vm->vtsi->vtsi_mat->vts_video_attr; | |
771 } else if((vm->state).domain == VTSM_DOMAIN) { | |
772 attr = vm->vtsi->vtsi_mat->vtsm_video_attr; | |
773 } else if((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN) { | |
774 attr = vm->vmgi->vmgi_mat->vmgm_video_attr; | |
0 | 775 } |
776 return attr; | |
777 } | |
778 | |
6 | 779 void vm_get_video_res(vm_t *vm, int *width, int *height) |
0 | 780 { |
781 video_attr_t attr; | |
782 | |
6 | 783 attr = vm_get_video_attr(vm); |
0 | 784 |
785 if(attr.video_format != 0) | |
786 *height = 576; | |
787 else | |
788 *height = 480; | |
789 switch(attr.picture_size) { | |
790 case 0: | |
791 *width = 720; | |
792 break; | |
793 case 1: | |
794 *width = 704; | |
795 break; | |
796 case 2: | |
797 *width = 352; | |
798 break; | |
799 case 3: | |
800 *width = 352; | |
801 *height /= 2; | |
802 break; | |
803 } | |
804 } | |
805 | |
806 /* Must be called before domain is changed (get_PGCN()) */ | |
6 | 807 static void saveRSMinfo(vm_t *vm, int cellN, int blockN) |
0 | 808 { |
809 int i; | |
810 | |
811 if(cellN != 0) { | |
6 | 812 (vm->state).rsm_cellN = cellN; |
813 (vm->state).rsm_blockN = 0; | |
0 | 814 } else { |
6 | 815 (vm->state).rsm_cellN = (vm->state).cellN; |
816 (vm->state).rsm_blockN = blockN; | |
0 | 817 } |
6 | 818 (vm->state).rsm_vtsN = (vm->state).vtsN; |
819 (vm->state).rsm_pgcN = get_PGCN(vm); | |
0 | 820 |
42 | 821 /* assert((vm->state).rsm_pgcN == (vm->state).TT_PGCN_REG); for VTS_DOMAIN */ |
0 | 822 |
823 for(i = 0; i < 5; i++) { | |
6 | 824 (vm->state).rsm_regs[i] = (vm->state).registers.SPRM[4 + i]; |
0 | 825 } |
826 } | |
827 | |
828 | |
829 | |
6 | 830 /* Figure out the correct pgN from the cell and update (vm->state). */ |
831 static int set_PGN(vm_t *vm) { | |
0 | 832 int new_pgN = 0; |
833 | |
6 | 834 while(new_pgN < (vm->state).pgc->nr_of_programs |
835 && (vm->state).cellN >= (vm->state).pgc->program_map[new_pgN]) | |
0 | 836 new_pgN++; |
837 | |
6 | 838 if(new_pgN == (vm->state).pgc->nr_of_programs) /* We are at the last program */ |
839 if((vm->state).cellN > (vm->state).pgc->nr_of_cells) | |
0 | 840 return 1; /* We are past the last cell */ |
841 | |
6 | 842 (vm->state).pgN = new_pgN; |
0 | 843 |
6 | 844 if((vm->state).domain == VTS_DOMAIN) { |
0 | 845 playback_type_t *pb_ty; |
6 | 846 if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts) |
0 | 847 return 0; /* ?? */ |
6 | 848 pb_ty = &vm->vmgi->tt_srpt->title[(vm->state).TTN_REG - 1].pb_ty; |
0 | 849 if(pb_ty->multi_or_random_pgc_title == /* One_Sequential_PGC_Title */ 0) { |
850 #if 0 /* TTN_REG can't be trusted to have a correct value here... */ | |
851 vts_ptt_srpt_t *ptt_srpt = vtsi->vts_ptt_srpt; | |
6 | 852 assert((vm->state).VTS_TTN_REG <= ptt_srpt->nr_of_srpts); |
853 assert(get_PGCN() == ptt_srpt->title[(vm->state).VTS_TTN_REG - 1].ptt[0].pgcn); | |
854 assert(1 == ptt_srpt->title[(vm->state).VTS_TTN_REG - 1].ptt[0].pgn); | |
0 | 855 #endif |
6 | 856 (vm->state).PTTN_REG = (vm->state).pgN; |
0 | 857 } |
858 } | |
859 | |
860 return 0; | |
861 } | |
862 | |
6 | 863 static link_t play_PGC(vm_t *vm) |
0 | 864 { |
865 link_t link_values; | |
866 | |
31 | 867 #ifdef TRACE |
0 | 868 fprintf(stderr, "vm: play_PGC:"); |
31 | 869 if((vm->state).domain != FP_DOMAIN) { |
6 | 870 fprintf(stderr, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); |
31 | 871 } else { |
0 | 872 fprintf(stderr, " first_play_pgc\n"); |
31 | 873 } |
874 #endif | |
0 | 875 |
876 /* This must be set before the pre-commands are executed because they */ | |
877 /* might contain a CallSS that will save resume state */ | |
38 | 878 |
879 /* FIXME: This may be only a temporary fix for something... */ | |
6 | 880 (vm->state).pgN = 1; |
881 (vm->state).cellN = 0; | |
0 | 882 |
883 /* eval -> updates the state and returns either | |
884 - some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN) | |
885 - just play video i.e first PG | |
886 (This is what happens if you fall of the end of the pre_cmds) | |
887 - or a error (are there more cases?) */ | |
6 | 888 if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_pre) { |
889 if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds, | |
890 (vm->state).pgc->command_tbl->nr_of_pre, | |
891 &(vm->state).registers, &link_values)) { | |
0 | 892 /* link_values contains the 'jump' return value */ |
893 return link_values; | |
894 } else { | |
31 | 895 #ifdef TRACE |
0 | 896 fprintf(stderr, "PGC pre commands didn't do a Jump, Link or Call\n"); |
31 | 897 #endif |
0 | 898 } |
899 } | |
6 | 900 return play_PG(vm); |
0 | 901 } |
902 | |
38 | 903 static link_t play_PGC_PG(vm_t *vm, int pgN) |
904 { | |
905 link_t link_values; | |
906 | |
907 #ifdef TRACE | |
908 fprintf(stderr, "vm: play_PGC:"); | |
909 if((vm->state).domain != FP_DOMAIN) { | |
910 fprintf(stderr, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); | |
911 } else { | |
912 fprintf(stderr, " first_play_pgc\n"); | |
913 } | |
914 #endif | |
915 | |
916 /* This must be set before the pre-commands are executed because they */ | |
917 /* might contain a CallSS that will save resume state */ | |
918 | |
919 /* FIXME: This may be only a temporary fix for something... */ | |
920 (vm->state).pgN = pgN; | |
921 (vm->state).cellN = 0; | |
922 | |
923 /* eval -> updates the state and returns either | |
924 - some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN) | |
925 - just play video i.e first PG | |
926 (This is what happens if you fall of the end of the pre_cmds) | |
927 - or a error (are there more cases?) */ | |
928 if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_pre) { | |
929 if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds, | |
930 (vm->state).pgc->command_tbl->nr_of_pre, | |
931 &(vm->state).registers, &link_values)) { | |
932 /* link_values contains the 'jump' return value */ | |
933 return link_values; | |
934 } else { | |
935 #ifdef TRACE | |
936 fprintf(stderr, "PGC pre commands didn't do a Jump, Link or Call\n"); | |
937 #endif | |
938 } | |
939 } | |
940 return play_PG(vm); | |
941 } | |
0 | 942 |
6 | 943 static link_t play_PG(vm_t *vm) |
0 | 944 { |
31 | 945 #ifdef TRACE |
6 | 946 fprintf(stderr, "play_PG: (vm->state).pgN (%i)\n", (vm->state).pgN); |
31 | 947 #endif |
0 | 948 |
6 | 949 assert((vm->state).pgN > 0); |
950 if((vm->state).pgN > (vm->state).pgc->nr_of_programs) { | |
31 | 951 #ifdef TRACE |
6 | 952 fprintf(stderr, "(vm->state).pgN (%i) == pgc->nr_of_programs + 1 (%i)\n", |
953 (vm->state).pgN, (vm->state).pgc->nr_of_programs + 1); | |
31 | 954 #endif |
42 | 955 /*assert((vm->state).pgN == (vm->state).pgc->nr_of_programs + 1);*/ |
6 | 956 return play_PGC_post(vm); |
0 | 957 } |
958 | |
6 | 959 (vm->state).cellN = (vm->state).pgc->program_map[(vm->state).pgN - 1]; |
0 | 960 |
6 | 961 return play_Cell(vm); |
0 | 962 } |
963 | |
964 | |
6 | 965 static link_t play_Cell(vm_t *vm) |
0 | 966 { |
31 | 967 #ifdef TRACE |
6 | 968 fprintf(stderr, "play_Cell: (vm->state).cellN (%i)\n", (vm->state).cellN); |
31 | 969 #endif |
0 | 970 |
6 | 971 assert((vm->state).cellN > 0); |
972 if((vm->state).cellN > (vm->state).pgc->nr_of_cells) { | |
31 | 973 #ifdef TRACE |
6 | 974 fprintf(stderr, "(vm->state).cellN (%i) == pgc->nr_of_cells + 1 (%i)\n", |
975 (vm->state).cellN, (vm->state).pgc->nr_of_cells + 1); | |
31 | 976 #endif |
6 | 977 assert((vm->state).cellN == (vm->state).pgc->nr_of_cells + 1); |
978 return play_PGC_post(vm); | |
0 | 979 } |
980 | |
981 | |
982 /* Multi angle/Interleaved */ | |
6 | 983 switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) { |
0 | 984 case 0: /* Normal */ |
6 | 985 assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 0); |
0 | 986 break; |
987 case 1: /* The first cell in the block */ | |
6 | 988 switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type) { |
0 | 989 case 0: /* Not part of a block */ |
990 assert(0); | |
991 case 1: /* Angle block */ | |
992 /* Loop and check each cell instead? So we don't get outsid the block. */ | |
6 | 993 (vm->state).cellN += (vm->state).AGL_REG - 1; |
75 | 994 #ifdef STRICT |
6 | 995 assert((vm->state).cellN <= (vm->state).pgc->nr_of_cells); |
996 assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode != 0); | |
997 assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 1); | |
75 | 998 #endif |
999 if (!((vm->state).cellN <= (vm->state).pgc->nr_of_cells) || | |
1000 !((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode != 0) || | |
1001 !((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 1)) { | |
1002 fprintf(stderr, "libdvdnav: Invalid angle block\n"); | |
1003 (vm->state).cellN -= (vm->state).AGL_REG - 1; | |
1004 } | |
0 | 1005 break; |
1006 case 2: /* ?? */ | |
1007 case 3: /* ?? */ | |
1008 default: | |
1009 fprintf(stderr, "Invalid? Cell block_mode (%d), block_type (%d)\n", | |
6 | 1010 (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode, |
1011 (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type); | |
0 | 1012 } |
1013 break; | |
1014 case 2: /* Cell in the block */ | |
1015 case 3: /* Last cell in the block */ | |
1016 /* These might perhaps happen for RSM or LinkC commands? */ | |
1017 default: | |
1018 fprintf(stderr, "Cell is in block but did not enter at first cell!\n"); | |
1019 } | |
1020 | |
6 | 1021 /* Updates (vm->state).pgN and PTTN_REG */ |
1022 if(set_PGN(vm)) { | |
0 | 1023 /* Should not happen */ |
1024 link_t tmp = {LinkTailPGC, /* No Button */ 0, 0, 0}; | |
1025 assert(0); | |
1026 return tmp; | |
1027 } | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1028 (vm->state).cell_restart++; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1029 fprintf(stderr, "libdvdnav: Cell should restart here\n"); |
0 | 1030 { |
1031 link_t tmp = {PlayThis, /* Block in Cell */ 0, 0, 0}; | |
1032 return tmp; | |
1033 } | |
1034 | |
1035 } | |
1036 | |
6 | 1037 static link_t play_Cell_post(vm_t *vm) |
0 | 1038 { |
1039 cell_playback_t *cell; | |
1040 | |
31 | 1041 #ifdef TRACE |
6 | 1042 fprintf(stderr, "play_Cell_post: (vm->state).cellN (%i)\n", (vm->state).cellN); |
31 | 1043 #endif |
0 | 1044 |
6 | 1045 cell = &(vm->state).pgc->cell_playback[(vm->state).cellN - 1]; |
0 | 1046 |
1047 /* Still time is already taken care of before we get called. */ | |
1048 | |
1049 /* Deal with a Cell command, if any */ | |
1050 if(cell->cell_cmd_nr != 0) { | |
1051 link_t link_values; | |
1052 | |
75 | 1053 #ifdef STRICT |
6 | 1054 assert((vm->state).pgc->command_tbl != NULL); |
1055 assert((vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr); | |
75 | 1056 #endif |
1057 if ((vm->state).pgc->command_tbl != NULL && | |
1058 (vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr) { | |
31 | 1059 #ifdef TRACE |
75 | 1060 fprintf(stderr, "Cell command pressent, executing\n"); |
31 | 1061 #endif |
75 | 1062 if(vmEval_CMD(&(vm->state).pgc->command_tbl->cell_cmds[cell->cell_cmd_nr - 1], 1, |
1063 &(vm->state).registers, &link_values)) { | |
1064 return link_values; | |
1065 } else { | |
1066 fprintf(stderr, "Cell command didn't do a Jump, Link or Call\n"); | |
1067 /* Error ?? goto tail? goto next PG? or what? just continue? */ | |
1068 } | |
0 | 1069 } else { |
75 | 1070 fprintf(stderr, "libdvdnav: Invalid Cell command\n"); |
0 | 1071 } |
1072 } | |
1073 | |
1074 | |
1075 /* Where to continue after playing the cell... */ | |
1076 /* Multi angle/Interleaved */ | |
6 | 1077 switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) { |
0 | 1078 case 0: /* Normal */ |
6 | 1079 assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 0); |
1080 (vm->state).cellN++; | |
0 | 1081 break; |
1082 case 1: /* The first cell in the block */ | |
1083 case 2: /* A cell in the block */ | |
1084 case 3: /* The last cell in the block */ | |
1085 default: | |
6 | 1086 switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type) { |
0 | 1087 case 0: /* Not part of a block */ |
1088 assert(0); | |
1089 case 1: /* Angle block */ | |
1090 /* Skip the 'other' angles */ | |
6 | 1091 (vm->state).cellN++; |
1092 while((vm->state).cellN <= (vm->state).pgc->nr_of_cells | |
1093 && (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode >= 2) { | |
1094 (vm->state).cellN++; | |
0 | 1095 } |
1096 break; | |
1097 case 2: /* ?? */ | |
1098 case 3: /* ?? */ | |
1099 default: | |
1100 fprintf(stderr, "Invalid? Cell block_mode (%d), block_type (%d)\n", | |
6 | 1101 (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode, |
1102 (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type); | |
0 | 1103 } |
1104 break; | |
1105 } | |
1106 | |
1107 | |
1108 /* Figure out the correct pgN for the new cell */ | |
6 | 1109 if(set_PGN(vm)) { |
31 | 1110 #ifdef TRACE |
0 | 1111 fprintf(stderr, "last cell in this PGC\n"); |
31 | 1112 #endif |
6 | 1113 return play_PGC_post(vm); |
0 | 1114 } |
1115 | |
6 | 1116 return play_Cell(vm); |
0 | 1117 } |
1118 | |
1119 | |
6 | 1120 static link_t play_PGC_post(vm_t *vm) |
0 | 1121 { |
1122 link_t link_values; | |
1123 | |
31 | 1124 #ifdef TRACE |
0 | 1125 fprintf(stderr, "play_PGC_post:\n"); |
31 | 1126 #endif |
0 | 1127 |
6 | 1128 assert((vm->state).pgc->still_time == 0); /* FIXME $$$ */ |
0 | 1129 |
1130 /* eval -> updates the state and returns either | |
1131 - some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN) | |
1132 - or a error (are there more cases?) | |
1133 - if you got to the end of the post_cmds, then what ?? */ | |
6 | 1134 if((vm->state).pgc->command_tbl && |
1135 vmEval_CMD((vm->state).pgc->command_tbl->post_cmds, | |
1136 (vm->state).pgc->command_tbl->nr_of_post, | |
1137 &(vm->state).registers, &link_values)) { | |
0 | 1138 return link_values; |
1139 } | |
1140 | |
1141 /* Or perhaps handle it here? */ | |
1142 { | |
1143 link_t link_next_pgc = {LinkNextPGC, 0, 0, 0}; | |
1144 fprintf(stderr, "** Fell of the end of the pgc, continuing in NextPGC\n"); | |
6 | 1145 assert((vm->state).pgc->next_pgc_nr != 0); |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1146 /* Should end up in the STOP_DOMAIN if next_pgc is 0. */ |
0 | 1147 return link_next_pgc; |
1148 } | |
1149 } | |
1150 | |
1151 | |
6 | 1152 static link_t process_command(vm_t *vm, link_t link_values) |
0 | 1153 { |
1154 /* FIXME $$$ Move this to a separate function? */ | |
6 | 1155 vm->badness_counter++; |
1156 if (vm->badness_counter > 1) fprintf(stderr, "**** process_command re-entered %d*****\n",vm->badness_counter); | |
0 | 1157 while(link_values.command != PlayThis) { |
1158 | |
31 | 1159 #ifdef TRACE |
0 | 1160 vmPrint_LINK(link_values); |
1161 | |
1162 fprintf(stderr, "Link values %i %i %i %i\n", link_values.command, | |
1163 link_values.data1, link_values.data2, link_values.data3); | |
1164 | |
1165 fprintf(stderr, "Before:"); | |
6 | 1166 vm_print_current_domain_state(vm); |
31 | 1167 #endif |
0 | 1168 |
1169 switch(link_values.command) { | |
1170 case LinkNoLink: | |
1171 /* No Link */ | |
9 | 1172 /* BUTTON number:data1 */ |
0 | 1173 if(link_values.data1 != 0) |
6 | 1174 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1175 fprintf(stderr, "libdvdnav: FIXME: in trouble...LinkNoLink - CRASHING!!!\n"); |
6 | 1176 assert(0); |
0 | 1177 |
1178 case LinkTopC: | |
52 | 1179 /* Restart playing from the beginning of the current Cell. */ |
9 | 1180 /* BUTTON number:data1 */ |
52 | 1181 fprintf(stderr, "libdvdnav: FIXME: LinkTopC. Replay current Cell\n"); |
0 | 1182 if(link_values.data1 != 0) |
6 | 1183 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
1184 link_values = play_Cell(vm); | |
0 | 1185 break; |
1186 case LinkNextC: | |
1187 /* Link to Next Cell */ | |
9 | 1188 /* BUTTON number:data1 */ |
0 | 1189 if(link_values.data1 != 0) |
6 | 1190 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1191 (vm->state).cellN += 1; /* if cellN becomes > nr_of_cells? it is handled in play_Cell() */ |
6 | 1192 link_values = play_Cell(vm); |
0 | 1193 break; |
1194 case LinkPrevC: | |
1195 /* Link to Previous Cell */ | |
9 | 1196 /* BUTTON number:data1 */ |
0 | 1197 if(link_values.data1 != 0) |
6 | 1198 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1199 (vm->state).cellN -= 1; /* If cellN becomes < 1? it is handled in play_Cell() */ |
6 | 1200 link_values = play_Cell(vm); |
0 | 1201 break; |
1202 | |
1203 case LinkTopPG: | |
1204 /* Link to Top Program */ | |
9 | 1205 /* BUTTON number:data1 */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1206 fprintf(stderr, "libdvdnav: FIXME: LinkTopPG. This should start the current PG again.\n"); |
0 | 1207 if(link_values.data1 != 0) |
6 | 1208 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
0 | 1209 /* Does pgN always contain the current value? */ |
6 | 1210 link_values = play_PG(vm); |
0 | 1211 break; |
1212 case LinkNextPG: | |
1213 /* Link to Next Program */ | |
9 | 1214 /* BUTTON number:data1 */ |
0 | 1215 if(link_values.data1 != 0) |
6 | 1216 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
0 | 1217 /* Does pgN always contain the current value? */ |
6 | 1218 (vm->state).pgN += 1; /* FIXME: What if pgN becomes > pgc.nr_of_programs? */ |
1219 link_values = play_PG(vm); | |
0 | 1220 break; |
1221 case LinkPrevPG: | |
1222 /* Link to Previous Program */ | |
9 | 1223 /* BUTTON number:data1 */ |
0 | 1224 if(link_values.data1 != 0) |
6 | 1225 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
0 | 1226 /* Does pgN always contain the current value? */ |
9 | 1227 assert((vm->state).pgN > 1); |
6 | 1228 (vm->state).pgN -= 1; /* FIXME: What if pgN becomes < 1? */ |
1229 link_values = play_PG(vm); | |
0 | 1230 break; |
1231 | |
1232 case LinkTopPGC: | |
52 | 1233 /* Restart playing from beginning of current Program Chain */ |
9 | 1234 /* BUTTON number:data1 */ |
52 | 1235 fprintf(stderr, "libdvdnav: FIXME: LinkTopPGC. Restart from beginning of current Program Chain\n"); |
0 | 1236 if(link_values.data1 != 0) |
6 | 1237 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
1238 link_values = play_PGC(vm); | |
0 | 1239 break; |
1240 case LinkNextPGC: | |
1241 /* Link to Next Program Chain */ | |
9 | 1242 /* BUTTON number:data1 */ |
0 | 1243 if(link_values.data1 != 0) |
6 | 1244 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
1245 assert((vm->state).pgc->next_pgc_nr != 0); | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1246 if(set_PGC(vm, (vm->state).pgc->next_pgc_nr)) |
0 | 1247 assert(0); |
6 | 1248 link_values = play_PGC(vm); |
0 | 1249 break; |
1250 case LinkPrevPGC: | |
1251 /* Link to Previous Program Chain */ | |
9 | 1252 /* BUTTON number:data1 */ |
0 | 1253 if(link_values.data1 != 0) |
6 | 1254 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
1255 assert((vm->state).pgc->prev_pgc_nr != 0); | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1256 if(set_PGC(vm, (vm->state).pgc->prev_pgc_nr)) |
0 | 1257 assert(0); |
6 | 1258 link_values = play_PGC(vm); |
0 | 1259 break; |
1260 case LinkGoUpPGC: | |
1261 /* Link to GoUp??? Program Chain */ | |
9 | 1262 /* BUTTON number:data1 */ |
0 | 1263 if(link_values.data1 != 0) |
6 | 1264 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
1265 assert((vm->state).pgc->goup_pgc_nr != 0); | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1266 if(set_PGC(vm, (vm->state).pgc->goup_pgc_nr)) |
0 | 1267 assert(0); |
6 | 1268 link_values = play_PGC(vm); |
0 | 1269 break; |
1270 case LinkTailPGC: | |
1271 /* Link to Tail??? Program Chain */ | |
9 | 1272 /* BUTTON number:data1 */ |
37
832ca4921e04
Fixed (what appears to be) an error in JumpVTS_PTT implementation, it didn't call play_PGC after jumping.
richwareham
parents:
31
diff
changeset
|
1273 /* fprintf(stderr, "libdvdnav: FIXME: LinkTailPGC. What is LinkTailPGC?\n"); */ |
0 | 1274 if(link_values.data1 != 0) |
6 | 1275 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
1276 link_values = play_PGC_post(vm); | |
37
832ca4921e04
Fixed (what appears to be) an error in JumpVTS_PTT implementation, it didn't call play_PGC after jumping.
richwareham
parents:
31
diff
changeset
|
1277 break; |
0 | 1278 |
1279 case LinkRSM: | |
1280 { | |
1281 /* Link to Resume */ | |
1282 int i; | |
1283 /* Check and see if there is any rsm info!! */ | |
6 | 1284 (vm->state).domain = VTS_DOMAIN; |
1285 ifoOpenNewVTSI(vm, vm->dvd, (vm->state).rsm_vtsN); | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1286 set_PGC(vm, (vm->state).rsm_pgcN); |
0 | 1287 |
1288 /* These should never be set in SystemSpace and/or MenuSpace */ | |
6 | 1289 /* (vm->state).TTN_REG = rsm_tt; ?? */ |
1290 /* (vm->state).TT_PGCN_REG = (vm->state).rsm_pgcN; ?? */ | |
0 | 1291 for(i = 0; i < 5; i++) { |
6 | 1292 (vm->state).registers.SPRM[4 + i] = (vm->state).rsm_regs[i]; |
0 | 1293 } |
1294 | |
1295 if(link_values.data1 != 0) | |
6 | 1296 (vm->state).HL_BTNN_REG = link_values.data1 << 10; |
0 | 1297 |
6 | 1298 if((vm->state).rsm_cellN == 0) { |
1299 assert((vm->state).cellN); /* Checking if this ever happens */ | |
0 | 1300 /* assert( time/block/vobu is 0 ); */ |
6 | 1301 (vm->state).pgN = 1; |
1302 link_values = play_PG(vm); | |
0 | 1303 } else { |
1304 /* assert( time/block/vobu is _not_ 0 ); */ | |
1305 /* play_Cell_at_time */ | |
6 | 1306 /* (vm->state).pgN = ?? this gets the righ value in play_Cell */ |
1307 (vm->state).cellN = (vm->state).rsm_cellN; | |
0 | 1308 link_values.command = PlayThis; |
6 | 1309 link_values.data1 = (vm->state).rsm_blockN; |
1310 if(set_PGN(vm)) { | |
0 | 1311 /* Were at the end of the PGC, should not happen for a RSM */ |
1312 assert(0); | |
1313 link_values.command = LinkTailPGC; | |
1314 link_values.data1 = 0; /* No button */ | |
1315 } | |
1316 } | |
1317 } | |
1318 break; | |
1319 case LinkPGCN: | |
1320 /* Link to Program Chain Number:data1 */ | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1321 if(set_PGC(vm, link_values.data1)) |
0 | 1322 assert(0); |
6 | 1323 link_values = play_PGC(vm); |
0 | 1324 break; |
1325 case LinkPTTN: | |
1326 /* Link to Part of this Title Number:data1 */ | |
9 | 1327 /* BUTTON number:data2 */ |
6 | 1328 assert((vm->state).domain == VTS_DOMAIN); |
0 | 1329 if(link_values.data2 != 0) |
6 | 1330 (vm->state).HL_BTNN_REG = link_values.data2 << 10; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1331 if(set_VTS_PTT(vm, (vm->state).vtsN, (vm->state).VTS_TTN_REG, link_values.data1) == -1) |
0 | 1332 assert(0); |
6 | 1333 link_values = play_PG(vm); |
0 | 1334 break; |
1335 case LinkPGN: | |
1336 /* Link to Program Number:data1 */ | |
9 | 1337 /* BUTTON number:data2 */ |
0 | 1338 if(link_values.data2 != 0) |
6 | 1339 (vm->state).HL_BTNN_REG = link_values.data2 << 10; |
0 | 1340 /* Update any other state, PTTN perhaps? */ |
6 | 1341 (vm->state).pgN = link_values.data1; |
1342 link_values = play_PG(vm); | |
0 | 1343 break; |
1344 case LinkCN: | |
1345 /* Link to Cell Number:data1 */ | |
9 | 1346 /* BUTTON number:data2 */ |
0 | 1347 if(link_values.data2 != 0) |
6 | 1348 (vm->state).HL_BTNN_REG = link_values.data2 << 10; |
0 | 1349 /* Update any other state, pgN, PTTN perhaps? */ |
6 | 1350 (vm->state).cellN = link_values.data1; |
1351 link_values = play_Cell(vm); | |
0 | 1352 break; |
1353 | |
1354 case Exit: | |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1355 fprintf(stderr, "libdvdnav: FIXME:in trouble...Link Exit - CRASHING!!!\n"); |
6 | 1356 assert(0); /* What should we do here?? */ |
0 | 1357 |
1358 case JumpTT: | |
1359 /* Jump to VTS Title Domain */ | |
1360 /* Only allowed from the First Play domain(PGC) */ | |
1361 /* or the Video Manager domain (VMG) */ | |
6 | 1362 assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1363 if(set_TT(vm,link_values.data1) == -1) |
0 | 1364 assert(0); |
6 | 1365 link_values = play_PGC(vm); |
0 | 1366 break; |
1367 case JumpVTS_TT: | |
1368 /* Jump to Title:data1 in same VTS Title Domain */ | |
1369 /* Only allowed from the VTS Menu Domain(VTSM) */ | |
1370 /* or the Video Title Set Domain(VTS) */ | |
6 | 1371 assert((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VTS_DOMAIN); /* ?? */ |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1372 fprintf(stderr, "libdvdnav: FIXME: Should be able to use get_VTS_PTT here.\n"); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1373 if(set_VTS_TT(vm,(vm->state).vtsN, link_values.data1) == -1) |
0 | 1374 assert(0); |
6 | 1375 link_values = play_PGC(vm); |
0 | 1376 break; |
1377 case JumpVTS_PTT: | |
1378 /* Jump to Part:data2 of Title:data1 in same VTS Title Domain */ | |
1379 /* Only allowed from the VTS Menu Domain(VTSM) */ | |
1380 /* or the Video Title Set Domain(VTS) */ | |
6 | 1381 assert((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VTS_DOMAIN); /* ?? */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1382 if(set_VTS_PTT(vm,(vm->state).vtsN, link_values.data1, link_values.data2) == -1) |
0 | 1383 assert(0); |
38 | 1384 link_values = play_PGC_PG(vm, link_values.data2); |
0 | 1385 break; |
1386 | |
1387 case JumpSS_FP: | |
1388 /* Jump to First Play Domain */ | |
1389 /* Only allowed from the VTS Menu Domain(VTSM) */ | |
1390 /* or the Video Manager domain (VMG) */ | |
6 | 1391 assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == VTSM_DOMAIN); /* ?? */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1392 set_FP_PGC(vm); |
6 | 1393 link_values = play_PGC(vm); |
0 | 1394 break; |
1395 case JumpSS_VMGM_MENU: | |
1396 /* Jump to Video Manger domain - Title Menu:data1 or any PGC in VMG */ | |
1397 /* Allowed from anywhere except the VTS Title domain */ | |
6 | 1398 assert((vm->state).domain == VMGM_DOMAIN || |
1399 (vm->state).domain == VTSM_DOMAIN || | |
1400 (vm->state).domain == FP_DOMAIN); /* ?? */ | |
1401 (vm->state).domain = VMGM_DOMAIN; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1402 if(set_MENU(vm,link_values.data1) == -1) |
0 | 1403 assert(0); |
6 | 1404 link_values = play_PGC(vm); |
0 | 1405 break; |
1406 case JumpSS_VTSM: | |
1407 /* Jump to a menu in Video Title domain, */ | |
1408 /* or to a Menu is the current VTS */ | |
1409 /* FIXME: This goes badly wrong for some DVDs. */ | |
1410 /* FIXME: Keep in touch with ogle people regarding what to do here */ | |
9 | 1411 /* ifoOpenNewVTSI:data1 */ |
1412 /* VTS_TTN_REG:data2 */ | |
1413 /* get_MENU:data3 */ | |
31 | 1414 #ifdef TRACE |
0 | 1415 fprintf(stderr, "dvdnav: BUG TRACKING *******************************************************************\n"); |
1416 fprintf(stderr, " data1=%u data2=%u data3=%u\n", | |
1417 link_values.data1, | |
1418 link_values.data2, | |
1419 link_values.data3); | |
1420 fprintf(stderr, "dvdnav: *******************************************************************\n"); | |
31 | 1421 #endif |
0 | 1422 |
1423 if(link_values.data1 !=0) { | |
6 | 1424 assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ |
1425 (vm->state).domain = VTSM_DOMAIN; | |
1426 ifoOpenNewVTSI(vm, vm->dvd, link_values.data1); /* Also sets (vm->state).vtsN */ | |
0 | 1427 } else { |
1428 /* This happens on 'The Fifth Element' region 2. */ | |
6 | 1429 assert((vm->state).domain == VTSM_DOMAIN); |
0 | 1430 } |
1431 /* I don't know what title is supposed to be used for. */ | |
1432 /* Alien or Aliens has this != 1, I think. */ | |
1433 /* assert(link_values.data2 == 1); */ | |
6 | 1434 (vm->state).VTS_TTN_REG = link_values.data2; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1435 if(set_MENU(vm, link_values.data3) == -1) |
0 | 1436 assert(0); |
6 | 1437 link_values = play_PGC(vm); |
0 | 1438 break; |
1439 case JumpSS_VMGM_PGC: | |
9 | 1440 /* get_PGC:data1 */ |
6 | 1441 assert((vm->state).domain == VMGM_DOMAIN || |
1442 (vm->state).domain == VTSM_DOMAIN || | |
1443 (vm->state).domain == FP_DOMAIN); /* ?? */ | |
1444 (vm->state).domain = VMGM_DOMAIN; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1445 if(set_PGC(vm,link_values.data1) == -1) |
0 | 1446 assert(0); |
6 | 1447 link_values = play_PGC(vm); |
0 | 1448 break; |
1449 | |
1450 case CallSS_FP: | |
9 | 1451 /* saveRSMinfo:data1 */ |
6 | 1452 assert((vm->state).domain == VTS_DOMAIN); /* ?? */ |
0 | 1453 /* Must be called before domain is changed */ |
6 | 1454 saveRSMinfo(vm, link_values.data1, /* We dont have block info */ 0); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1455 set_FP_PGC(vm); |
6 | 1456 link_values = play_PGC(vm); |
0 | 1457 break; |
1458 case CallSS_VMGM_MENU: | |
9 | 1459 /* get_MENU:data1 */ |
1460 /* saveRSMinfo:data2 */ | |
6 | 1461 assert((vm->state).domain == VTS_DOMAIN); /* ?? */ |
0 | 1462 /* Must be called before domain is changed */ |
6 | 1463 saveRSMinfo(vm,link_values.data2, /* We dont have block info */ 0); |
1464 (vm->state).domain = VMGM_DOMAIN; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1465 if(set_MENU(vm,link_values.data1) == -1) |
0 | 1466 assert(0); |
6 | 1467 link_values = play_PGC(vm); |
0 | 1468 break; |
1469 case CallSS_VTSM: | |
9 | 1470 /* get_MENU:data1 */ |
1471 /* saveRSMinfo:data2 */ | |
6 | 1472 assert((vm->state).domain == VTS_DOMAIN); /* ?? */ |
0 | 1473 /* Must be called before domain is changed */ |
6 | 1474 saveRSMinfo(vm,link_values.data2, /* We dont have block info */ 0); |
1475 (vm->state).domain = VTSM_DOMAIN; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1476 if(set_MENU(vm,link_values.data1) == -1) |
0 | 1477 assert(0); |
6 | 1478 link_values = play_PGC(vm); |
0 | 1479 break; |
1480 case CallSS_VMGM_PGC: | |
9 | 1481 /* get_PGC:data1 */ |
1482 /* saveRSMinfo:data2 */ | |
6 | 1483 assert((vm->state).domain == VTS_DOMAIN); /* ?? */ |
0 | 1484 /* Must be called before domain is changed */ |
6 | 1485 saveRSMinfo(vm,link_values.data2, /* We dont have block info */ 0); |
1486 (vm->state).domain = VMGM_DOMAIN; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1487 if(set_PGC(vm,link_values.data1) == -1) |
0 | 1488 assert(0); |
6 | 1489 link_values = play_PGC(vm); |
0 | 1490 break; |
1491 case PlayThis: | |
1492 /* Should never happen. */ | |
9 | 1493 assert(0); |
0 | 1494 break; |
1495 } | |
31 | 1496 |
1497 #ifdef TRACE | |
0 | 1498 fprintf(stderr, "After:"); |
6 | 1499 vm_print_current_domain_state(vm); |
31 | 1500 #endif |
0 | 1501 |
1502 } | |
6 | 1503 vm->badness_counter--; |
0 | 1504 return link_values; |
1505 } | |
1506 | |
14 | 1507 /* Searches the TT tables, to find the current TT. |
1508 * returns the current TT. | |
1509 * returns 0 if not found. | |
1510 */ | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1511 static int get_TT(vm_t *vm, int vtsN, int vts_ttn) { |
14 | 1512 int i; |
1513 int tt=0; | |
1514 for(i = 1; i <= vm->vmgi->tt_srpt->nr_of_srpts; i++) { | |
1515 if( vm->vmgi->tt_srpt->title[i - 1].title_set_nr == vtsN && | |
1516 vm->vmgi->tt_srpt->title[i - 1].vts_ttn == vts_ttn) { | |
1517 tt=i; | |
1518 break; | |
1519 } | |
1520 } | |
1521 return tt; | |
1522 } | |
1523 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1524 static int set_TT(vm_t *vm, int tt) |
0 | 1525 { |
6 | 1526 assert(tt <= vm->vmgi->tt_srpt->nr_of_srpts); |
0 | 1527 |
6 | 1528 (vm->state).TTN_REG = tt; |
0 | 1529 |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1530 return set_VTS_TT(vm, vm->vmgi->tt_srpt->title[tt - 1].title_set_nr, |
6 | 1531 vm->vmgi->tt_srpt->title[tt - 1].vts_ttn); |
0 | 1532 } |
1533 | |
1534 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1535 static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn) |
0 | 1536 { |
14 | 1537 fprintf(stderr, "get_VTS_TT called, testing!!! vtsN=%d, vts_ttn=%d\n", vtsN, vts_ttn); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1538 return set_VTS_PTT(vm, vtsN, vts_ttn, 1); |
42 | 1539 /* pgcN = get_ID(vm, vts_ttn); This might return -1 */ |
1540 /* | |
1541 assert(pgcN != -1); | |
0 | 1542 |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1543 (vm->state).TTN_REG = get_TT(*vm, vtsN, vts_ttn); |
42 | 1544 (vm->state).VTS_TTN_REG = vts_ttn; |
1545 (vm->state).vtsN = | |
1546 */ | |
0 | 1547 /* Any other registers? */ |
1548 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1549 /* return set_PGC(vm, pgcN); */ |
0 | 1550 } |
1551 | |
1552 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1553 static int set_VTS_PTT(vm_t *vm, int vtsN, int /* is this really */ vts_ttn, int part) |
0 | 1554 { |
52 | 1555 int pgcN, pgN, res; |
0 | 1556 |
6 | 1557 (vm->state).domain = VTS_DOMAIN; |
1558 if(vtsN != (vm->state).vtsN) | |
1559 ifoOpenNewVTSI(vm, vm->dvd, vtsN); /* Also sets (vm->state).vtsN */ | |
0 | 1560 |
6 | 1561 assert(vts_ttn <= vm->vtsi->vts_ptt_srpt->nr_of_srpts); |
1562 assert(part <= vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].nr_of_ptts); | |
0 | 1563 |
6 | 1564 pgcN = vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].ptt[part - 1].pgcn; |
1565 pgN = vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].ptt[part - 1].pgn; | |
14 | 1566 |
1567 (vm->state).TT_PGCN_REG = pgcN; | |
1568 (vm->state).PTTN_REG = pgN; | |
1569 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1570 (vm->state).TTN_REG = get_TT(vm, vtsN, vts_ttn); |
14 | 1571 assert( (vm->state.TTN_REG) != 0 ); |
6 | 1572 (vm->state).VTS_TTN_REG = vts_ttn; |
14 | 1573 (vm->state).vtsN = vtsN; /* Not sure about this one. We can get to it easily from TTN_REG */ |
0 | 1574 /* Any other registers? */ |
1575 | |
52 | 1576 res = set_PGC(vm, pgcN); // This clobber's state.pgN (sets it to 1), but we don't want clobbering here. |
1577 (vm->state).pgN = pgN; /* Part?? */ | |
1578 return res; | |
0 | 1579 } |
1580 | |
1581 | |
1582 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1583 static int set_FP_PGC(vm_t *vm) |
0 | 1584 { |
6 | 1585 (vm->state).domain = FP_DOMAIN; |
0 | 1586 |
6 | 1587 (vm->state).pgc = vm->vmgi->first_play_pgc; |
0 | 1588 |
1589 return 0; | |
1590 } | |
1591 | |
1592 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1593 static int set_MENU(vm_t *vm, int menu) |
0 | 1594 { |
6 | 1595 assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == VTSM_DOMAIN); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1596 return set_PGC(vm, get_ID(vm, menu)); |
0 | 1597 } |
1598 | |
52 | 1599 /* Search for entry_id match of the PGC Category in the current VTS PGCIT table. |
1600 * Return pgcN based on entry_id match. | |
1601 */ | |
6 | 1602 static int get_ID(vm_t *vm, int id) |
0 | 1603 { |
1604 int pgcN, i; | |
1605 pgcit_t *pgcit; | |
1606 | |
1607 /* Relies on state to get the correct pgcit. */ | |
6 | 1608 pgcit = get_PGCIT(vm); |
0 | 1609 assert(pgcit != NULL); |
54 | 1610 fprintf(stderr, "** Searching for menu (0x%x) entry PGC\n", id); |
0 | 1611 |
1612 /* Get menu/title */ | |
1613 for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { | |
1614 if((pgcit->pgci_srp[i].entry_id & 0x7f) == id) { | |
1615 assert((pgcit->pgci_srp[i].entry_id & 0x80) == 0x80); | |
1616 pgcN = i + 1; | |
1617 return pgcN; | |
1618 } | |
1619 } | |
1620 fprintf(stderr, "** No such id/menu (%d) entry PGC\n", id); | |
54 | 1621 for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { |
1622 fprintf(stderr, "Available menus: 0x%x\n", | |
1623 pgcit->pgci_srp[i].entry_id); | |
1624 } | |
1625 assert(0); /* Use assert for now, until the error is handled. */ | |
0 | 1626 return -1; /* error */ |
1627 } | |
1628 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1629 /* Set the vm->state to pgcN. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1630 * Returns success/failure. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1631 */ |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1632 static int set_PGC(vm_t *vm, int pgcN) |
0 | 1633 { |
1634 /* FIXME: Keep this up to date with the ogle people */ | |
1635 pgcit_t *pgcit; | |
1636 | |
6 | 1637 pgcit = get_PGCIT(vm); |
0 | 1638 |
1639 assert(pgcit != NULL); /* ?? Make this return -1 instead */ | |
1640 if(pgcN < 1 || pgcN > pgcit->nr_of_pgci_srp) { | |
52 | 1641 fprintf(stderr, "** No such pgcN = %d\n", pgcN); |
1642 assert(0); | |
1643 return -1; /* error */ | |
0 | 1644 } |
1645 | |
6 | 1646 /* (vm->state).pgcN = pgcN; */ |
1647 (vm->state).pgc = pgcit->pgci_srp[pgcN - 1].pgc; | |
52 | 1648 (vm->state).pgN = 1; |
1649 | |
6 | 1650 if((vm->state).domain == VTS_DOMAIN) |
1651 (vm->state).TT_PGCN_REG = pgcN; | |
0 | 1652 |
1653 return 0; | |
1654 } | |
1655 | |
6 | 1656 static int get_PGCN(vm_t *vm) |
0 | 1657 { |
1658 pgcit_t *pgcit; | |
1659 int pgcN = 1; | |
1660 | |
6 | 1661 pgcit = get_PGCIT(vm); |
0 | 1662 |
1663 assert(pgcit != NULL); | |
1664 | |
1665 while(pgcN <= pgcit->nr_of_pgci_srp) { | |
6 | 1666 if(pgcit->pgci_srp[pgcN - 1].pgc == (vm->state).pgc) |
0 | 1667 return pgcN; |
1668 pgcN++; | |
1669 } | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1670 fprintf(stderr, "libdvdnav: get_PGCN failed. Trying to find pgcN in domain %d \n", |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1671 (vm->state).domain); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1672 assert(0); |
0 | 1673 return -1; /* error */ |
1674 } | |
1675 | |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1676 int vm_get_video_aspect(vm_t *vm) |
0 | 1677 { |
1678 int aspect = 0; | |
1679 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1680 switch ((vm->state).domain) { |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1681 case VTS_DOMAIN: |
6 | 1682 aspect = vm->vtsi->vtsi_mat->vts_video_attr.display_aspect_ratio; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1683 break; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1684 case VTSM_DOMAIN: |
6 | 1685 aspect = vm->vtsi->vtsi_mat->vtsm_video_attr.display_aspect_ratio; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1686 break; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1687 case VMGM_DOMAIN: |
6 | 1688 aspect = vm->vmgi->vmgi_mat->vmgm_video_attr.display_aspect_ratio; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1689 break; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1690 default: |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1691 fprintf(stderr, "libdvdnav: vm_get_video_aspect failed. Unknown domain %d\n", |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1692 (vm->state).domain); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1693 assert(0); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1694 break; |
0 | 1695 } |
31 | 1696 #ifdef TRACE |
0 | 1697 fprintf(stderr, "dvdnav:get_video_aspect:aspect=%d\n",aspect); |
31 | 1698 #endif |
0 | 1699 assert(aspect == 0 || aspect == 3); |
6 | 1700 (vm->state).registers.SPRM[14] &= ~(0x3 << 10); |
1701 (vm->state).registers.SPRM[14] |= aspect << 10; | |
0 | 1702 |
1703 return aspect; | |
1704 } | |
1705 | |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1706 int vm_get_video_scale_permission(vm_t *vm) |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1707 { |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1708 int permission = 0; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1709 |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1710 if((vm->state).domain == VTS_DOMAIN) { |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1711 permission = vm->vtsi->vtsi_mat->vts_video_attr.permitted_df; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1712 } else if((vm->state).domain == VTSM_DOMAIN) { |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1713 permission = vm->vtsi->vtsi_mat->vtsm_video_attr.permitted_df; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1714 } else if((vm->state).domain == VMGM_DOMAIN) { |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1715 permission = vm->vmgi->vmgi_mat->vmgm_video_attr.permitted_df; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1716 } |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1717 #ifdef TRACE |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1718 fprintf(stderr, "dvdnav:get_video_scale_permission:permission=%d\n",permission); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1719 #endif |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1720 |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1721 return permission; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1722 } |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1723 |
6 | 1724 static void ifoOpenNewVTSI(vm_t *vm, dvd_reader_t *dvd, int vtsN) |
0 | 1725 { |
6 | 1726 if((vm->state).vtsN == vtsN) { |
0 | 1727 return; /* We alread have it */ |
1728 } | |
1729 | |
6 | 1730 if(vm->vtsi != NULL) |
1731 ifoClose(vm->vtsi); | |
0 | 1732 |
6 | 1733 vm->vtsi = ifoOpenVTSI(dvd, vtsN); |
1734 if(vm->vtsi == NULL) { | |
1735 fprintf(stderr, "ifoOpenVTSI failed - CRASHING!!!\n"); | |
1736 assert(0); | |
0 | 1737 } |
6 | 1738 if(!ifoRead_VTS_PTT_SRPT(vm->vtsi)) { |
1739 fprintf(stderr, "ifoRead_VTS_PTT_SRPT failed - CRASHING!!!\n"); | |
1740 assert(0); | |
0 | 1741 } |
6 | 1742 if(!ifoRead_PGCIT(vm->vtsi)) { |
1743 fprintf(stderr, "ifoRead_PGCIT failed - CRASHING!!!\n"); | |
1744 assert(0); | |
0 | 1745 } |
6 | 1746 if(!ifoRead_PGCI_UT(vm->vtsi)) { |
1747 fprintf(stderr, "ifoRead_PGCI_UT failed - CRASHING!!!\n"); | |
1748 assert(0); | |
0 | 1749 } |
6 | 1750 if(!ifoRead_VOBU_ADMAP(vm->vtsi)) { |
1751 fprintf(stderr, "ifoRead_VOBU_ADMAP vtsi failed - CRASHING\n"); | |
1752 assert(0); | |
0 | 1753 } |
6 | 1754 if(!ifoRead_TITLE_VOBU_ADMAP(vm->vtsi)) { |
1755 fprintf(stderr, "ifoRead_TITLE_VOBU_ADMAP vtsi failed - CRASHING\n"); | |
1756 assert(0); | |
0 | 1757 } |
6 | 1758 (vm->state).vtsN = vtsN; |
0 | 1759 } |
1760 | |
6 | 1761 static pgcit_t* get_MENU_PGCIT(vm_t *vm, ifo_handle_t *h, uint16_t lang) |
0 | 1762 { |
1763 int i; | |
1764 | |
1765 if(h == NULL || h->pgci_ut == NULL) { | |
1766 fprintf(stderr, "*** pgci_ut handle is NULL ***\n"); | |
1767 return NULL; /* error? */ | |
1768 } | |
1769 | |
1770 i = 0; | |
1771 while(i < h->pgci_ut->nr_of_lus | |
1772 && h->pgci_ut->lu[i].lang_code != lang) | |
1773 i++; | |
1774 if(i == h->pgci_ut->nr_of_lus) { | |
1775 fprintf(stderr, "Language '%c%c' not found, using '%c%c' instead\n", | |
1776 (char)(lang >> 8), (char)(lang & 0xff), | |
1777 (char)(h->pgci_ut->lu[0].lang_code >> 8), | |
1778 (char)(h->pgci_ut->lu[0].lang_code & 0xff)); | |
53 | 1779 fprintf(stderr, "Menu Languages available: "); |
1780 for(i=0;i< h->pgci_ut->nr_of_lus;i++) { | |
1781 fprintf(stderr, "%c%c ", | |
1782 (char)(h->pgci_ut->lu[0].lang_code >> 8), | |
1783 (char)(h->pgci_ut->lu[0].lang_code & 0xff)); | |
1784 } | |
1785 fprintf(stderr, "\n"); | |
1786 | |
0 | 1787 i = 0; /* error? */ |
1788 } | |
1789 | |
1790 return h->pgci_ut->lu[i].pgcit; | |
1791 } | |
1792 | |
1793 /* Uses state to decide what to return */ | |
6 | 1794 static pgcit_t* get_PGCIT(vm_t *vm) { |
0 | 1795 pgcit_t *pgcit; |
1796 | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1797 switch ((vm->state).domain) { |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1798 case VTS_DOMAIN: |
6 | 1799 pgcit = vm->vtsi->vts_pgcit; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1800 break; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1801 case VTSM_DOMAIN: |
6 | 1802 pgcit = get_MENU_PGCIT(vm, vm->vtsi, (vm->state).registers.SPRM[0]); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1803 break; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1804 case VMGM_DOMAIN: |
6 | 1805 pgcit = get_MENU_PGCIT(vm, vm->vmgi, (vm->state).registers.SPRM[0]); |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1806 break; |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1807 default: |
0 | 1808 pgcit = NULL; /* Should never hapen */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1809 fprintf(stderr, "libdvdnav: get_PGCIT: Unknown domain:%d\n", |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1810 (vm->state).domain); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1811 assert(0); |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1812 break; |
0 | 1813 } |
1814 | |
1815 return pgcit; | |
1816 } | |
1817 | |
1818 /* | |
1819 * $Log$ | |
75 | 1820 * Revision 1.25 2002/08/21 15:25:50 mroi |
1821 * fix playback of the following dvds | |
1822 * - Bram Stoker's Dracula RC2 | |
1823 * - The Cell RC2, German FSK16 | |
1824 * | |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1825 * Revision 1.24 2002/07/05 14:18:55 mroi |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1826 * report all spu types (widescreen, letterbox and pan&scan), not widescreen |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1827 * only and report the stream's scale permissions to detect pan&scan material |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1828 * |
54 | 1829 * Revision 1.23 2002/07/05 01:42:30 jcdutton |
1830 * Add more debug info for Menu language selection. | |
1831 * Only do vm_start when we have to. | |
1832 * | |
53 | 1833 * Revision 1.22 2002/07/04 00:38:51 jcdutton |
1834 * Add some menu language printf's. | |
1835 * | |
52 | 1836 * Revision 1.21 2002/07/03 02:41:31 jcdutton |
1837 * Fix another long standing bug. | |
1838 * Now changing PGC will force a start at the first PG of the PGC. | |
1839 * | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1840 * Revision 1.20 2002/07/02 22:57:10 jcdutton |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1841 * Rename some of the functions in vm.c to help readability. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1842 * Hopefully fix __FUNCTION__ problem. Use __func_ as recommended in C99. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1843 * Fix bug where libdvdnav would not immeadiately replay the same cell due to menu buttons. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
42
diff
changeset
|
1844 * |
42 | 1845 * Revision 1.19 2002/06/04 13:35:16 richwareham |
1846 * Removed more C++ style comments | |
1847 * | |
38 | 1848 * Revision 1.18 2002/05/30 19:25:08 richwareham |
1849 * Another small fix | |
1850 * | |
37
832ca4921e04
Fixed (what appears to be) an error in JumpVTS_PTT implementation, it didn't call play_PGC after jumping.
richwareham
parents:
31
diff
changeset
|
1851 * Revision 1.17 2002/05/30 15:56:41 richwareham |
832ca4921e04
Fixed (what appears to be) an error in JumpVTS_PTT implementation, it didn't call play_PGC after jumping.
richwareham
parents:
31
diff
changeset
|
1852 * Fixed (what appears to be) an error in JumpVTS_PTT implementation, it didn't call play_PGC after jumping. |
832ca4921e04
Fixed (what appears to be) an error in JumpVTS_PTT implementation, it didn't call play_PGC after jumping.
richwareham
parents:
31
diff
changeset
|
1853 * |
31 | 1854 * Revision 1.16 2002/04/24 21:15:25 jcdutton |
1855 * Quiet please!!! | |
1856 * | |
27
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
1857 * Revision 1.15 2002/04/23 13:18:31 jcdutton |
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
1858 * Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0. |
fcfbaf8dbfb4
Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0.
jcdutton
parents:
25
diff
changeset
|
1859 * |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1860 * Revision 1.14 2002/04/23 12:34:39 f1rmb |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1861 * Why rewrite vm function, use it instead (this remark is for me, of course ;-) ). |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1862 * Comment unused var, shut compiler warnings. |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1863 * |
24 | 1864 * Revision 1.13 2002/04/23 02:12:27 jcdutton |
1865 * Re-implemented seeking. | |
1866 * | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
1867 * Revision 1.12 2002/04/22 22:00:48 jcdutton |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
1868 * Start of rewrite of libdvdnav. Still need to re-implement seeking. |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
19
diff
changeset
|
1869 * |
19
7e8628911b4f
Implement General Register Counters or GPRM counters.
jcdutton
parents:
18
diff
changeset
|
1870 * Revision 1.11 2002/04/12 20:06:41 jcdutton |
7e8628911b4f
Implement General Register Counters or GPRM counters.
jcdutton
parents:
18
diff
changeset
|
1871 * Implement General Register Counters or GPRM counters. |
7e8628911b4f
Implement General Register Counters or GPRM counters.
jcdutton
parents:
18
diff
changeset
|
1872 * Navigation timers are not supported yet. SPRM[9] and SPRM[10]. |
7e8628911b4f
Implement General Register Counters or GPRM counters.
jcdutton
parents:
18
diff
changeset
|
1873 * |
18 | 1874 * Revision 1.10 2002/04/12 12:43:36 jcdutton |
1875 * Display DVD disk region setting. | |
1876 * Display possible RCE region protection message. | |
1877 * | |
17 | 1878 * Revision 1.9 2002/04/10 16:45:57 jcdutton |
1879 * Actually fix the const this time! | |
1880 * | |
16 | 1881 * Revision 1.8 2002/04/10 16:40:52 jcdutton |
1882 * Fix a const problem. | |
1883 * | |
14 | 1884 * Revision 1.7 2002/04/10 13:09:40 jcdutton |
1885 * Some improvements to decoder.c | |
1886 * Registers should be updated correctly now, but still needs checking. | |
1887 * | |
10
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1888 * Revision 1.6 2002/04/09 15:19:07 jcdutton |
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1889 * Added some debug info, to hopefully help in tracking bugs in libdvdnav. |
6f0fb88d1463
Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents:
9
diff
changeset
|
1890 * |
9 | 1891 * Revision 1.5 2002/04/07 19:35:54 jcdutton |
1892 * Added some comments into the code. | |
1893 * | |
6 | 1894 * Revision 1.4 2002/04/06 18:31:50 jcdutton |
1895 * Some cleaning up. | |
1896 * changed exit(1) to assert(0) so they actually get seen by the user so that it helps developers more. | |
1897 * | |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
1898 * Revision 1.3 2002/04/02 18:22:27 richwareham |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
1899 * Added reset patch from Kees Cook <kees@outflux.net> |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
1900 * |
3
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1901 * Revision 1.2 2002/04/01 18:56:28 richwareham |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1902 * Added initial example programs directory and make sure all debug/error output goes to stderr. |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1903 * |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1904 * Revision 1.1.1.1 2002/03/12 19:45:55 richwareham |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1905 * Initial import |
0 | 1906 * |
1907 * Revision 1.18 2002/01/22 16:56:49 jcdutton | |
1908 * Fix clut after seeking. | |
6 | 1909 * Add a few virtual machine debug messages, to help diagnose problems with "Deep Purple - Total Abandon" DVD as I don't have the DVD itvm. |
0 | 1910 * Fix a few debug messages, so they do not say FIXME. |
1911 * Move the FIXME debug messages to comments in the code. | |
1912 * | |
1913 * Revision 1.17 2002/01/21 01:16:30 jcdutton | |
1914 * Added some debug messages, to hopefully get info from users. | |
1915 * | |
1916 * Revision 1.16 2002/01/20 21:40:46 jcdutton | |
1917 * Start to fix some assert failures. | |
1918 * | |
1919 * Revision 1.15 2002/01/19 20:24:38 jcdutton | |
1920 * Just some FIXME notes added. | |
1921 * | |
1922 * Revision 1.14 2002/01/13 22:17:57 jcdutton | |
1923 * Change logging. | |
1924 * | |
1925 * | |
1926 */ |