annotate vm.c @ 15:74aee0b81da0 src

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