00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <stdio.h>
00027 #include <inttypes.h>
00028
00029 #include "dvdread/nav_types.h"
00030 #include "dvdread/nav_print.h"
00031 #include "dvdread/ifo_print.h"
00032
00033 static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
00034 int i;
00035
00036 printf("pci_gi:\n");
00037 printf("nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn);
00038 printf("vobu_cat 0x%04x\n", pci_gi->vobu_cat);
00039 printf("vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl);
00040 printf("vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm);
00041 printf("vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm);
00042 printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm);
00043 printf("e_eltm ");
00044 dvdread_print_time(&pci_gi->e_eltm);
00045 printf("\n");
00046
00047 printf("vobu_isrc \"");
00048 for(i = 0; i < 32; i++) {
00049 char c = pci_gi->vobu_isrc[i];
00050 if((c >= ' ') && (c <= '~'))
00051 printf("%c", c);
00052 else
00053 printf(".");
00054 }
00055 printf("\"\n");
00056 }
00057
00058 static void navPrint_NSML_AGLI(nsml_agli_t *nsml_agli) {
00059 int i, j = 0;
00060
00061 for(i = 0; i < 9; i++)
00062 j |= nsml_agli->nsml_agl_dsta[i];
00063 if(j == 0)
00064 return;
00065
00066 printf("nsml_agli:\n");
00067 for(i = 0; i < 9; i++)
00068 if(nsml_agli->nsml_agl_dsta[i])
00069 printf("nsml_agl_c%d_dsta 0x%08x\n", i + 1,
00070 nsml_agli->nsml_agl_dsta[i]);
00071 }
00072
00073 static void navPrint_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) {
00074
00075 if((hl_gi->hli_ss & 0x03) == 0)
00076 return;
00077
00078 printf("hl_gi:\n");
00079 printf("hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03);
00080 printf("hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm);
00081 printf("hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm);
00082 printf("btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm);
00083
00084 *btngr_ns = hl_gi->btngr_ns;
00085 printf("btngr_ns %d\n", hl_gi->btngr_ns);
00086 printf("btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty);
00087 printf("btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty);
00088 printf("btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty);
00089
00090 printf("btn_ofn %d\n", hl_gi->btn_ofn);
00091 *btn_ns = hl_gi->btn_ns;
00092 printf("btn_ns %d\n", hl_gi->btn_ns);
00093 printf("nsl_btn_ns %d\n", hl_gi->nsl_btn_ns);
00094 printf("fosl_btnn %d\n", hl_gi->fosl_btnn);
00095 printf("foac_btnn %d\n", hl_gi->foac_btnn);
00096 }
00097
00098 static void navPrint_BTN_COLIT(btn_colit_t *btn_colit) {
00099 int i, j;
00100
00101 j = 0;
00102 for(i = 0; i < 6; i++)
00103 j |= btn_colit->btn_coli[i/2][i&1];
00104 if(j == 0)
00105 return;
00106
00107 printf("btn_colit:\n");
00108 for(i = 0; i < 3; i++)
00109 for(j = 0; j < 2; j++)
00110 printf("btn_cqoli %d %s_coli: %08x\n",
00111 i, (j == 0) ? "sl" : "ac",
00112 btn_colit->btn_coli[i][j]);
00113 }
00114
00115 static void navPrint_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) {
00116 int i, j;
00117
00118 printf("btnit:\n");
00119 printf("btngr_ns: %i\n", btngr_ns);
00120 printf("btn_ns: %i\n", btn_ns);
00121
00122 if(btngr_ns == 0)
00123 return;
00124
00125 for(i = 0; i < btngr_ns; i++) {
00126 for(j = 0; j < (36 / btngr_ns); j++) {
00127 if(j < btn_ns) {
00128 btni_t *btni = &btni_table[(36 / btngr_ns) * i + j];
00129
00130 printf("group %d btni %d: ", i+1, j+1);
00131 printf("btn_coln %d, auto_action_mode %d\n",
00132 btni->btn_coln, btni->auto_action_mode);
00133 printf("coords (%d, %d) .. (%d, %d)\n",
00134 btni->x_start, btni->y_start, btni->x_end, btni->y_end);
00135
00136 printf("up %d, ", btni->up);
00137 printf("down %d, ", btni->down);
00138 printf("left %d, ", btni->left);
00139 printf("right %d\n", btni->right);
00140
00141
00142 printf("\n");
00143 }
00144 }
00145 }
00146 }
00147
00148 static void navPrint_HLI(hli_t *hli) {
00149 int btngr_ns = 0, btn_ns = 0;
00150
00151 printf("hli:\n");
00152 navPrint_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns);
00153 navPrint_BTN_COLIT(&hli->btn_colit);
00154 navPrint_BTNIT(hli->btnit, btngr_ns, btn_ns);
00155 }
00156
00157 void navPrint_PCI(pci_t *pci) {
00158 printf("pci packet:\n");
00159 navPrint_PCI_GI(&pci->pci_gi);
00160 navPrint_NSML_AGLI(&pci->nsml_agli);
00161 navPrint_HLI(&pci->hli);
00162 }
00163
00164 static void navPrint_DSI_GI(dsi_gi_t *dsi_gi) {
00165 printf("dsi_gi:\n");
00166 printf("nv_pck_scr 0x%08x\n", dsi_gi->nv_pck_scr);
00167 printf("nv_pck_lbn 0x%08x\n", dsi_gi->nv_pck_lbn );
00168 printf("vobu_ea 0x%08x\n", dsi_gi->vobu_ea);
00169 printf("vobu_1stref_ea 0x%08x\n", dsi_gi->vobu_1stref_ea);
00170 printf("vobu_2ndref_ea 0x%08x\n", dsi_gi->vobu_2ndref_ea);
00171 printf("vobu_3rdref_ea 0x%08x\n", dsi_gi->vobu_3rdref_ea);
00172 printf("vobu_vob_idn 0x%04x\n", dsi_gi->vobu_vob_idn);
00173 printf("vobu_c_idn 0x%02x\n", dsi_gi->vobu_c_idn);
00174 printf("c_eltm ");
00175 dvdread_print_time(&dsi_gi->c_eltm);
00176 printf("\n");
00177 }
00178
00179 static void navPrint_SML_PBI(sml_pbi_t *sml_pbi) {
00180 printf("sml_pbi:\n");
00181 printf("category 0x%04x\n", sml_pbi->category);
00182 if(sml_pbi->category & 0x8000)
00183 printf("VOBU is in preunit\n");
00184 if(sml_pbi->category & 0x4000)
00185 printf("VOBU is in ILVU\n");
00186 if(sml_pbi->category & 0x2000)
00187 printf("VOBU at the beginning of ILVU\n");
00188 if(sml_pbi->category & 0x1000)
00189 printf("VOBU at end of PREU of ILVU\n");
00190
00191 printf("ilvu_ea 0x%08x\n", sml_pbi->ilvu_ea);
00192 printf("nxt_ilvu_sa 0x%08x\n", sml_pbi->ilvu_sa);
00193 printf("nxt_ilvu_size 0x%04x\n", sml_pbi->size);
00194
00195 printf("vob_v_s_s_ptm 0x%08x\n", sml_pbi->vob_v_s_s_ptm);
00196 printf("vob_v_e_e_ptm 0x%08x\n", sml_pbi->vob_v_e_e_ptm);
00197
00198
00199 }
00200
00201 static void navPrint_SML_AGLI(sml_agli_t *sml_agli) {
00202 int i;
00203 printf("sml_agli:\n");
00204 for(i = 0; i < 9; i++) {
00205 printf("agl_c%d address: 0x%08x size 0x%04x\n", i,
00206 sml_agli->data[i].address, sml_agli->data[i].size);
00207 }
00208 }
00209
00210 static void navPrint_VOBU_SRI(vobu_sri_t *vobu_sri) {
00211 int i;
00212 int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11,
00213 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
00214 printf("vobu_sri:\n");
00215 printf("Next VOBU with Video %08x\n", vobu_sri->next_video);
00216 for(i = 0; i < 19; i++) {
00217 printf("%3.1f %08x ", stime[i]/2.0, vobu_sri->fwda[i]);
00218 }
00219 printf("\n");
00220 printf("Next VOBU %08x\n", vobu_sri->next_vobu);
00221 printf("--\n");
00222 printf("Prev VOBU %08x\n", vobu_sri->prev_vobu);
00223 for(i = 0; i < 19; i++) {
00224 printf("%3.1f %08x ", stime[18 - i]/2.0, vobu_sri->bwda[i]);
00225 }
00226 printf("\n");
00227 printf("Prev VOBU with Video %08x\n", vobu_sri->prev_video);
00228 }
00229
00230 static void navPrint_SYNCI(synci_t *synci) {
00231 int i;
00232
00233 printf("synci:\n");
00234
00235 for(i = 0; i < 8; i++)
00236 printf("%04x ", synci->a_synca[i]);
00237 for(i = 0; i < 32; i++)
00238 printf("%08x ", synci->sp_synca[i]);
00239 }
00240
00241 void navPrint_DSI(dsi_t *dsi) {
00242 printf("dsi packet:\n");
00243 navPrint_DSI_GI(&dsi->dsi_gi);
00244 navPrint_SML_PBI(&dsi->sml_pbi);
00245 navPrint_SML_AGLI(&dsi->sml_agli);
00246 navPrint_VOBU_SRI(&dsi->vobu_sri);
00247 navPrint_SYNCI(&dsi->synci);
00248 }