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