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