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