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