annotate vm.c @ 75:06cda03dc1e5 src

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