Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

437 lines
14 KiB

  1. //***************************************************************************
  2. //
  3. // FileName:
  4. // $Workfile: ZIVACHIP.H $
  5. //
  6. // Author:
  7. // TOSHIBA [PCS](PSY) Seiichi Nakamura
  8. // Copyright (c) 1997 TOSHIBA CORPORATION
  9. //
  10. // Description:
  11. //
  12. //***************************************************************************
  13. // $Header: /DVD Drivers/ZiVA.VxD/ZIVACHIP.H 18 98/06/01 6:38p Yagi $
  14. // $Modtime: 98/05/29 9:11a $
  15. // $Nokeywords:$
  16. //***************************************************************************
  17. //***************************************************************************
  18. //
  19. //***************************************************************************
  20. #ifndef _ZIVACHIP_H_
  21. #define _ZIVACHIP_H_
  22. #define ZIVA_INT_ERR (0x00000001L)
  23. #define ZIVA_INT_PICV (0x00000002L)
  24. #define ZIVA_INT_GOPV (0x00000004L)
  25. #define ZIVA_INT_SEQV (0x00000008L)
  26. #define ZIVA_INT_ENDV (0x00000010L)
  27. #define ZIVA_INT_PICD (0x00000020L)
  28. #define ZIVA_INT_VSYNC (0x00000040L)
  29. #define ZIVA_INT_AOR (0x00000080L)
  30. #define ZIVA_INT_EPTM (0x00000080L)
  31. #define ZIVA_INT_UND (0x00000100L)
  32. #define ZIVA_INT_ENDC (0x00000200L)
  33. #define ZIVA_INT_RDYS (0x00000400L)
  34. #define ZIVA_INT_SCN (0x00000800L)
  35. #define ZIVA_INT_USR (0x00001000L)
  36. #define ZIVA_INT_ENDP (0x00002000L)
  37. #define ZIVA_INT_ENDD (0x00004000L)
  38. #define ZIVA_INT_AEE (0x00008000L)
  39. #define ZIVA_INT_BUFF (0x00010000L)
  40. #define ZIVA_INT_SEQE (0x00020000L)
  41. #define ZIVA_INT_NV (0x00040000L)
  42. #define ZIVA_INT_HLI (0x00080000L)
  43. #define ZIVA_INT_RDYD (0x00100000L)
  44. #define ZIVA_INT_RESERV1 (0x00200000L)
  45. #define ZIVA_INT_AUD (0x00400000L)
  46. #define ZIVA_INT_INIT (0x00800000L)
  47. // by oka
  48. #define PBT_INT_END_VOB (0x00000001L)
  49. #define PBT_INT_NV_PCK (0x00000002L)
  50. typedef enum
  51. {
  52. ZIVARESULT_NOERROR = 0,
  53. ZIVARESULT_TIMEOUT
  54. } ZIVARESULT;
  55. typedef enum
  56. {
  57. RESET_AUTHENTICATION = 0,
  58. GET_CHALLENGE_DATA = 1,
  59. SEND_RESPONSE_DATA = 2,
  60. SEND_CHALLENGE_DATA = 3,
  61. GET_RESPONSE_DATA = 4,
  62. SEND_DISK_KEY = 5,
  63. SEND_TITLE_KEY = 6,
  64. SET_DECRYPTION_MODE = 7,
  65. SET_PASS_THROUGH_MODE = 8
  66. } COPY_PROTECT_COMMAND_TYPE;
  67. typedef enum
  68. {
  69. SET_NEW_COMMAND = 0,
  70. COMMAND_COMPLETE = 1,
  71. COMMAND_ERROR = 2,
  72. READY_DKEY = 3
  73. } COPY_PROTECT_COMMAND;
  74. typedef enum
  75. {
  76. ZIVA_STATE_INITIALIZATION = 0x01,
  77. ZIVA_STATE_IDLE = 0x02,
  78. ZIVA_STATE_PLAY = 0x04,
  79. ZIVA_STATE_PAUSE = 0x08,
  80. ZIVA_STATE_SCAN = 0x10,
  81. ZIVA_STATE_FREEZE = 0x20,
  82. ZIVA_STATE_SLOWMOTION = 0x40
  83. } ZIVA_PROC_STATE;
  84. class CIOIF;
  85. //---------------------------------------------------------------------------
  86. // CZiVA for CL6105
  87. //---------------------------------------------------------------------------
  88. class CZiVA {
  89. public:
  90. //------------------------
  91. // Private class for ZiVA
  92. //------------------------
  93. class CZiVAMemory
  94. {
  95. private:
  96. DWORD Address;
  97. CZiVA *m_ziva;
  98. public:
  99. CZiVAMemory();
  100. void Init( CZiVA *pziva , DWORD addr );
  101. DWORD Get( DWORD *pData );
  102. DWORD Set( DWORD Data );
  103. DWORD GetAndSet( DWORD Mask, DWORD SetData );
  104. CZiVAMemory& operator=(const DWORD &Data )
  105. {
  106. Set( Data );
  107. return *this;
  108. };
  109. operator DWORD()
  110. {
  111. DWORD Data;
  112. Get( &Data );
  113. return Data;
  114. };
  115. CZiVAMemory& operator&=(const DWORD &Data );
  116. CZiVAMemory& operator|=(const DWORD &Data );
  117. };
  118. friend class CZiVAMemory;
  119. private: // datas
  120. CIOIF *m_pioif;
  121. static BYTE UXData[];
  122. BYTE * gpbRead; // Read pointer to the UCode buffer
  123. IKernelService *m_pKernelObj; // Kernel service object
  124. private: // commands
  125. ZIVARESULT ZiVACommand( DWORD CommandID, DWORD d1 = 0, DWORD d2 = 0, DWORD d3 = 0, DWORD d4 = 0, DWORD d5 = 0, DWORD d6 = 0 );
  126. ZIVARESULT ZiVACommandNoWait( DWORD CommandID, DWORD d1 = 0, DWORD d2 = 0, DWORD d3 = 0, DWORD d4 = 0, DWORD d5 = 0, DWORD d6 = 0 );
  127. DWORD ZiVAWriteReg(DWORD Addr, DWORD Data );
  128. DWORD ZiVAReadReg(DWORD Addr, DWORD *Data );
  129. DWORD ZiVAWriteIMEM(DWORD Addr, DWORD Data );
  130. DWORD ZiVAReadIMEM(DWORD Addr, DWORD *Data );
  131. // for microcode down load....
  132. DWORD load_GetDWORD();
  133. DWORD load_GetDWORDSwap();
  134. DWORD load_GetDWORDSwapBackward();
  135. public: // datas
  136. CZiVAMemory Host_Control;
  137. CZiVAMemory ROM_INFO;
  138. CZiVAMemory DRAM_INFO;
  139. CZiVAMemory UCODE_MEMORY;
  140. CZiVAMemory VIDEO_MODE;
  141. CZiVAMemory DISPLAY_ASPECT_RATIO;
  142. CZiVAMemory ASPECT_RATIO_MODE;
  143. CZiVAMemory PAN_SCAN_SOURCE;
  144. CZiVAMemory PAN_SCAN_HORIZONTAL_OFFSET;
  145. CZiVAMemory TOP_BORDER;
  146. CZiVAMemory BORDER_COLOR;
  147. CZiVAMemory BACKGROUND_COLOR;
  148. CZiVAMemory OSD_EVEN_FIELD;
  149. CZiVAMemory OSD_ODD_FIELD;
  150. CZiVAMemory IC_TYPE;
  151. CZiVAMemory ERR_CONCEALMENT_LEVEL;
  152. CZiVAMemory ERR_HORIZONTAL_SIZE;
  153. CZiVAMemory ERR_VERTICAL_SIZE;
  154. CZiVAMemory ERR_ASPECT_RATIO_INFORMATION;
  155. CZiVAMemory ERR_FRAME_RATE_CODE;
  156. CZiVAMemory FORCE_CODED_ASPECT_RATIO;
  157. CZiVAMemory AUDIO_CONFIG;
  158. CZiVAMemory AUDIO_DAC_MODE;
  159. CZiVAMemory AUDIO_CLOCK_SELECTION;
  160. CZiVAMemory IEC_958_DELAY;
  161. CZiVAMemory AUDIO_ATTENUATION;
  162. CZiVAMemory IEC_958_CHANNEL_STATUS_BITS;
  163. CZiVAMemory AC3_OUTPUT_MODE;
  164. CZiVAMemory AC3_OPERATIONAL_MODE;
  165. CZiVAMemory AC3_LOW_BOOST;
  166. CZiVAMemory AC3_HIGH_CUT;
  167. CZiVAMemory AC3_PCM_SCALE_FACTOR;
  168. CZiVAMemory AC3_LFE_OUTPUT_ENABLE;
  169. CZiVAMemory AC3_VOICE_SELECT;
  170. CZiVAMemory AC3_L_LEVEL;
  171. CZiVAMemory AC3_C_LEVEL;
  172. CZiVAMemory AC3_R_LEVEL;
  173. CZiVAMemory AC3_SL_LEVEL;
  174. CZiVAMemory AC3_SR_LEVEL;
  175. CZiVAMemory AC3_CENTER_DELAY;
  176. CZiVAMemory AC3_SURROUND_DELAY;
  177. CZiVAMemory BITSTREAM_TYPE;
  178. CZiVAMemory BITSTREAM_SOURCE;
  179. CZiVAMemory SD_MODE;
  180. CZiVAMemory CD_MODE;
  181. CZiVAMemory AV_SYNC_MODE;
  182. CZiVAMemory VIDEO_PTS_SKIP_INTERVAL;
  183. CZiVAMemory VIDEO_PTS_REPEAT_INTERVAL;
  184. CZiVAMemory AUTOPAUSE_ENABLE;
  185. CZiVAMemory VIDEO_ENV_CHANGE;
  186. CZiVAMemory MEMCOPY_XFER_BLOCKSIZE;
  187. CZiVAMemory INT_MASK;
  188. CZiVAMemory AUTO_FLUSH_INTERVAL;
  189. CZiVAMemory RDY_S_THRESHOLD_LOW;
  190. CZiVAMemory MEMORY_MAP;
  191. CZiVAMemory PCI_BUFFER_START;
  192. CZiVAMemory PCI_BUFFER_END;
  193. CZiVAMemory DSI_BUFFER_START;
  194. CZiVAMemory DSI_BUFFER_END;
  195. CZiVAMemory OSD_BUFFER_START;
  196. CZiVAMemory OSD_BUFFER_END;
  197. CZiVAMemory OSD_BUFFER_IDLE_START;
  198. CZiVAMemory USER_DATA_BUFFER_START;
  199. CZiVAMemory USER_DATA_BUFFER_END;
  200. CZiVAMemory USER_DATA_READ;
  201. CZiVAMemory USER_DATA_WRITE;
  202. CZiVAMemory DUMP_DATA_BUFFER_START;
  203. CZiVAMemory DUMP_DATA_BUFFER_END;
  204. CZiVAMemory SUB_PICTURE_PALETTE_START;
  205. CZiVAMemory SUB_PICTURE_PALETTE_END;
  206. CZiVAMemory PROC_STATE;
  207. CZiVAMemory MRC_ID;
  208. CZiVAMemory MRC_STATUS;
  209. CZiVAMemory INT_STATUS;
  210. CZiVAMemory HLI_INT_SRC;
  211. CZiVAMemory BUFF_INT_SRC;
  212. CZiVAMemory UND_INT_SRC;
  213. CZiVAMemory PBT_INT_SRC;
  214. CZiVAMemory AOR_INT_SRC;
  215. CZiVAMemory AEE_INT_SRC;
  216. CZiVAMemory ERR_INT_SRC;
  217. CZiVAMemory VIDEO_EMPTINESS;
  218. CZiVAMemory AUDIO_EMPTINESS;
  219. CZiVAMemory CURR_PIC_DISPLAYED;
  220. CZiVAMemory NEXT_PIC_DISPLAYED;
  221. CZiVAMemory VIDEO_FIELD;
  222. CZiVAMemory OSD_VALID;
  223. CZiVAMemory NUM_DECODED;
  224. CZiVAMemory NUM_SKIPPED;
  225. CZiVAMemory NUM_REPEATED;
  226. CZiVAMemory MRC_PIC_PTS;
  227. CZiVAMemory MRC_PIC_STC;
  228. CZiVAMemory N_AUD_DECODED;
  229. CZiVAMemory NEXT_SECTOR_ADDR;
  230. CZiVAMemory N_SYS_ERRORS;
  231. CZiVAMemory N_VID_ERRORS;
  232. CZiVAMemory N_AUD_ERRORS;
  233. CZiVAMemory DATE_TIME;
  234. CZiVAMemory VERSION;
  235. CZiVAMemory EXTENDED_VERSION;
  236. CZiVAMemory PIC1_BUFFER_START;
  237. CZiVAMemory PIC1_PTS;
  238. CZiVAMemory PIC1_PAN_SCAN;
  239. CZiVAMemory PIC1_USER_DATA;
  240. CZiVAMemory PIC1_TREF_PTYP_FLGS;
  241. CZiVAMemory PIC2_BUFFER_START;
  242. CZiVAMemory PIC2_PTS;
  243. CZiVAMemory PIC2_PAN_SCAN;
  244. CZiVAMemory PIC2_USER_DATA;
  245. CZiVAMemory PIC2_TREF_PTYP_FLGS;
  246. CZiVAMemory PIC3_BUFFER_START;
  247. CZiVAMemory PIC3_PTS;
  248. CZiVAMemory PIC3_PAN_SCAN;
  249. CZiVAMemory PIC3_USER_DATA;
  250. CZiVAMemory PIC3_TREF_PTYP_FLGS;
  251. CZiVAMemory STREAM_ID;
  252. CZiVAMemory PACKET_LEN;
  253. CZiVAMemory PES_HEADER;
  254. CZiVAMemory SUBPIC_EMPTINESS;
  255. CZiVAMemory H_SIZE;
  256. CZiVAMemory V_SIZE;
  257. CZiVAMemory APSECT_RATIO;
  258. CZiVAMemory FRAME_RATE;
  259. CZiVAMemory BIT_RATE;
  260. CZiVAMemory VBV_SIZE;
  261. CZiVAMemory SEQ_FLAGS;
  262. CZiVAMemory DISP_SIZE_H_V;
  263. CZiVAMemory TIME_CODE;
  264. CZiVAMemory GOP_FLAGS;
  265. CZiVAMemory TEMP_REF;
  266. CZiVAMemory PIC_TYPE;
  267. CZiVAMemory VBV_DELAY;
  268. CZiVAMemory PIC_HEADER;
  269. CZiVAMemory AUDIO_TYPE;
  270. CZiVAMemory MPEG_AUDIO_HEADER1;
  271. CZiVAMemory AC3_FRAME_NUMBER;
  272. CZiVAMemory LPCM_AUDIO_EMPHASIS_FLAG;
  273. CZiVAMemory MPEG_AUDIO_HEADER2;
  274. CZiVAMemory LPCM_AUDIO_MUTE_FLAG;
  275. CZiVAMemory AC3_BSI_IS_BEING_READ;
  276. CZiVAMemory LPCM_AUDIO_FRAME_NUMBER;
  277. CZiVAMemory AC3_BSI_VALID;
  278. CZiVAMemory LPCM_AUDIO_QUANTIZATION_WORD_LENGTH;
  279. CZiVAMemory AC3_BSI_FRAME;
  280. CZiVAMemory LPCM_AUDIO_SAMPLING_FREQUENCY;
  281. CZiVAMemory AC3_FSCOD_FRMSIZECOD;
  282. CZiVAMemory LPCM_AUDIO_NUMBER_OF_AUDIO_CHANNELS;
  283. CZiVAMemory AC3_BSID_BSMOD;
  284. CZiVAMemory LPCM_AUDIO_DYNAMIC_RANGE_CONTROL;
  285. CZiVAMemory AC3_ACMOD_CMIXLEV;
  286. CZiVAMemory AC3_SURMIXLEV_DSURMOD;
  287. CZiVAMemory AC3_LFEON_DIALNORM;
  288. CZiVAMemory AC3_COMPR_LANGCOD;
  289. CZiVAMemory AC3_MIXLEV_ROOMTYP;
  290. CZiVAMemory AC3_DIALNORM2_COMPR2;
  291. CZiVAMemory AC3_LANGCOD2_MIXLEV2;
  292. CZiVAMemory AC3_ROOMTYP2_COPYRIGHTB;
  293. CZiVAMemory AC3_ORIGBS_TIMECOD1;
  294. CZiVAMemory AC3_TIMECOD2;
  295. CZiVAMemory SE_STATUS;
  296. CZiVAMemory NEW_AUDIO_MODE;
  297. CZiVAMemory NEW_SUBPICTURE_PALETTE;
  298. CZiVAMemory NEW_AUDIO_CONFIG;
  299. CZiVAMemory VSYNC_HEARTBEAT;
  300. CZiVAMemory ML_HEARTBEAT;
  301. CZiVAMemory SUBPICTURE_ENABLE;
  302. CZiVAMemory HIGHLIGHT_ENABLE;
  303. CZiVAMemory CURRENT_BUTTON;
  304. CZiVAMemory AU_CLK_INOUT; //Toshiba special
  305. CZiVAMemory IDLE_DELAY;
  306. CZiVAMemory ERR_MPEG_VERSION; // 98.04.02 H.Yagi
  307. CZiVAMemory VERTICAL_DISPLAYMODE; // 98.04.02 H.Yagi
  308. CZiVAMemory AC3_ENGINE_VERSION; // 98.04.02 H.Yagi
  309. CZiVAMemory ROM_END_POINTER; // 98.04.02 H.Yagi
  310. CZiVAMemory CURRENT_VOB_CELL_ID; // 98.04.02 H.Yagi
  311. CZiVAMemory PREV_VOBU_VIDEO_RLBN; // 98.04.02 H.Yagi
  312. CZiVAMemory HOST_OPTIONS; // 98.05.29 H.Yagi
  313. // Authentication
  314. CZiVAMemory KEY_ADDRESS; // Yagi
  315. CZiVAMemory KEY_LENGTH; // Yagi
  316. CZiVAMemory KEY_COMMAND; // Yagi
  317. CZiVAMemory KEY_STATUS; // Yagi
  318. CZiVAMemory DRIVE_CHALLENGE_0; // Yagi
  319. CZiVAMemory DRIVE_CHALLENGE_1; // Yagi
  320. CZiVAMemory DRIVE_CHALLENGE_2; // Yagi
  321. CZiVAMemory DRIVE_CHALLENGE_3; // Yagi
  322. CZiVAMemory DRIVE_CHALLENGE_4; // Yagi
  323. CZiVAMemory DRIVE_CHALLENGE_5; // Yagi
  324. CZiVAMemory DRIVE_CHALLENGE_6; // Yagi
  325. CZiVAMemory DRIVE_CHALLENGE_7; // Yagi
  326. CZiVAMemory DRIVE_CHALLENGE_8; // Yagi
  327. CZiVAMemory DRIVE_CHALLENGE_9; // Yagi
  328. CZiVAMemory DECODER_CHALLENGE_0; // Yagi
  329. CZiVAMemory DECODER_CHALLENGE_1; // Yagi
  330. CZiVAMemory DECODER_CHALLENGE_2; // Yagi
  331. CZiVAMemory DECODER_CHALLENGE_3; // Yagi
  332. CZiVAMemory DECODER_CHALLENGE_4; // Yagi
  333. CZiVAMemory DECODER_CHALLENGE_5; // Yagi
  334. CZiVAMemory DECODER_CHALLENGE_6; // Yagi
  335. CZiVAMemory DECODER_CHALLENGE_7; // Yagi
  336. CZiVAMemory DECODER_CHALLENGE_8; // Yagi
  337. CZiVAMemory DECODER_CHALLENGE_9; // Yagi
  338. CZiVAMemory DRIVE_RESULT_0; // Yagi
  339. CZiVAMemory DRIVE_RESULT_1; // Yagi
  340. CZiVAMemory DRIVE_RESULT_2; // Yagi
  341. CZiVAMemory DRIVE_RESULT_3; // Yagi
  342. CZiVAMemory DRIVE_RESULT_4; // Yagi
  343. CZiVAMemory DECODER_RESULT_0; // Yagi
  344. CZiVAMemory DECODER_RESULT_1; // Yagi
  345. CZiVAMemory DECODER_RESULT_2; // Yagi
  346. CZiVAMemory DECODER_RESULT_3; // Yagi
  347. CZiVAMemory DECODER_RESULT_4; // Yagi
  348. CZiVAMemory TITLE_KEY_0; // Yagi
  349. CZiVAMemory TITLE_KEY_1; // Yagi
  350. CZiVAMemory TITLE_KEY_2; // Yagi
  351. CZiVAMemory TITLE_KEY_3; // Yagi
  352. CZiVAMemory TITLE_KEY_4; // Yagi
  353. public:
  354. CZiVA( void );
  355. public: // commands
  356. void Init( IKernelService *pKernelObj, CIOIF *pioif );
  357. void CppInit( DWORD KeyAddr );
  358. // Type 0: NTSC, Type 1: NTSC
  359. BOOL WriteMicrocode( DWORD Type );
  360. DWORD ZiVAWriteMemory(DWORD Addr, DWORD Data );
  361. DWORD ZiVAReadMemory(DWORD Addr, DWORD *Data );
  362. ZIVARESULT Abort( DWORD Flush );
  363. ZIVARESULT Digest( DWORD x, DWORD y, DWORD decimation, DWORD threshold, DWORD start );
  364. ZIVARESULT DumpData_VCD( DWORD start, DWORD length, DWORD address );
  365. ZIVARESULT DumpData_DVD( DWORD numberOfBytes );
  366. ZIVARESULT Fade( DWORD level, DWORD fadetime );
  367. ZIVARESULT Freeze( DWORD displayMode );
  368. // by oka
  369. ZIVARESULT HighLight( DWORD button, DWORD action );
  370. ZIVARESULT HighLight2( DWORD Contrast, DWORD Color, DWORD YGeom, DWORD XGeom );
  371. // ZIVARESULT NewAudioMode( void );
  372. ZIVARESULT NewPlayMode( void );
  373. ZIVARESULT Pause( DWORD displaymode );
  374. ZIVARESULT Play( DWORD playmode, DWORD fadetime, DWORD start, DWORD stop );
  375. ZIVARESULT MemCopy( DWORD romAddr, DWORD dramAddr, DWORD Length );
  376. ZIVARESULT Reset( void );
  377. ZIVARESULT Resume( void );
  378. ZIVARESULT Scan( DWORD skip, DWORD scanmode, DWORD displaymode );
  379. ZIVARESULT ScreenLoad( DWORD address, DWORD length, DWORD displaymode );
  380. ZIVARESULT SelectStream( DWORD streamtype, DWORD streamnumber );
  381. ZIVARESULT SetFill( DWORD x, DWORD y, DWORD length, DWORD height, DWORD color );
  382. ZIVARESULT SetStreams( DWORD videoID, DWORD audioID );
  383. ZIVARESULT SingleStep( DWORD displaymode );
  384. ZIVARESULT SlowMotion( DWORD N, DWORD displaymode );
  385. // by oka
  386. ZIVARESULT Magnify( DWORD x, DWORD y, DWORD factor );
  387. // ZIVARESULT SwitchOSDBuffer( DWORD evenfield, DWORD oddfield );
  388. ZIVARESULT TransferKey( DWORD KeyType, DWORD Authenticate );
  389. };
  390. #endif // _ZIVACHIP_H_
  391. //***************************************************************************
  392. // End of
  393. //***************************************************************************