emu.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:3k
源码类别:

DVD

开发平台:

C/C++

  1. /*
  2. ** FILE
  3. ** emu.c
  4. **
  5. ** DESCRIPTION
  6. */
  7. #include "config.h"
  8. #include "global.h"
  9. #include "regmap.h"
  10. #include "pu8560.h"
  11. #include "emu.h"
  12. #ifndef DVDRELEASE
  13. //
  14. // emulation system clock ratio (with respect to ck27)
  15. //
  16. #define EMU_CFG7_DIV_1 0
  17. #define EMU_CFG7_DIV_1_5 1
  18. #define EMU_CFG7_DIV_2 2
  19. #define EMU_CFG7_DIV_2_5 3
  20. #define EMU_CFG7_DIV_3 4
  21. #define EMU_CFG7_DIV_3_5 5
  22. #define EMU_CFG7_DIV_4 6
  23. #define EMU_CFG7_DIV_4_5 7
  24. #define EMU_CFG7_DIV_5 8
  25. #define EMU_CFG7_DIV_5_5 9
  26. #define EMU_CFG7_DIV_6 10
  27. #define EMU_CFG7_DIV_6_5 11
  28. #define EMU_CFG7_DIV_7 12
  29. #define EMU_CFG7_DIV_7_5 13
  30. #define EMU_CFG7_DIV_8 14
  31. #define EMU_CFG7_DIV_8_5 15
  32. #define EMU_CFG7_CLK_27_0 EMU_CFG7_DIV_1
  33. #define EMU_CFG7_CLK_40_5 EMU_CFG7_DIV_1_5
  34. #define EMU_CFG7_CLK_54_0 EMU_CFG7_DIV_2
  35. #define EMU_CFG7_CLK_67_5 EMU_CFG7_DIV_2_5
  36. #define EMU_CFG7_CLK_81_0 EMU_CFG7_DIV_3
  37. #define EMU_CFG7_CLK_94_5 EMU_CFG7_DIV_3_5
  38. #define EMU_CFG7_CLK_108_0 EMU_CFG7_DIV_4
  39. #define EMU_CFG7_CLK_121_5 EMU_CFG7_DIV_4_5
  40. #define EMU_CFG7_CLK_135_0 EMU_CFG7_DIV_5
  41. #define EMU_CFG7_CLK_148_5 EMU_CFG7_DIV_5_5
  42. #define EMU_CFG7_CLK_162_0 EMU_CFG7_DIV_6
  43. #define EMU_CFG7_CLK_175_5 EMU_CFG7_DIV_6_5
  44. #define EMU_CFG7_CLK_189_0 EMU_CFG7_DIV_7
  45. #define EMU_CFG7_CLK_202_5 EMU_CFG7_DIV_7_5
  46. #define EMU_CFG7_CLK_216_0 EMU_CFG7_DIV_8
  47. #define EMU_CFG7_CLK_229_5 EMU_CFG7_DIV_8_5
  48. void
  49. setup_emu(void)
  50. {
  51. //  regs0->emu_cfg[7] = EMU_CFG7_CLK_94_5;
  52. // regs0->emu_cfg[7] = EMU_CFG7_CLK_108_0;
  53. #ifdef DTH_CFG_ENABLE
  54. regs0->emu_cfg[7] = EMU_CFG7_CLK_121_5;
  55. #else
  56.     regs0->emu_cfg[7] = EMU_CFG7_CLK_108_0;
  57. #endif
  58. regs0->emu_cfg[9] = 0x1; // reset slowmotion
  59. }
  60. void
  61. setup_slowmotion(int fmt, int nint)
  62. {
  63. #ifdef USE_711
  64. if (nint)
  65. {
  66. regs0->emu_cfg[0] = 0x0;
  67. if(regs0->emu_cfg[1]&0x100)
  68.    regs0->emu_cfg[1] = 0x3301;
  69. else
  70.    regs0->emu_cfg[1] = 0x3201;
  71.    
  72. regs0->emu_cfg[8] = 0x20;
  73. }
  74. else
  75. {
  76. regs0->emu_cfg[0] = 0x41;
  77. if(regs0->emu_cfg[1]&0x100)
  78.    regs0->emu_cfg[1] = 0x110;
  79. else
  80.       regs0->emu_cfg[1] = 0x010;
  81.       
  82. regs0->emu_cfg[8] = 0x00;
  83. }
  84. #else
  85. if (nint)
  86. {
  87. regs0->emu_cfg[0] = 0x0;
  88. if(regs0->emu_cfg[1]&0x100)
  89.    regs0->emu_cfg[1] = 0x3301;
  90. else
  91.    regs0->emu_cfg[1] = 0x3201;
  92.    
  93. if (fmt)
  94. {
  95. // 576p
  96. // regs0->emu_cfg[8] = 0x2c; //real time replay
  97. regs0->emu_cfg[8] = 0x24; // slow motion replay
  98. }
  99. else
  100. {
  101. // 480p
  102. // regs0->emu_cfg[8] = 0x28; // real time replay
  103. regs0->emu_cfg[8] = 0x20; // slow motion replay
  104. }
  105. }
  106. else
  107. {
  108. regs0->emu_cfg[0] = 0x1;
  109. if(regs0->emu_cfg[1]&0x100)
  110.    regs0->emu_cfg[1] = 0x0310;
  111. else
  112.    regs0->emu_cfg[1] = 0x0210;
  113.    
  114. if (fmt)
  115. {
  116. //regs0->emu_cfg[8] = 0x02c;       // real time replay
  117. regs0->emu_cfg[8] = 0x024;       // slow motion play
  118. }
  119. else
  120. {
  121. //regs0->emu_cfg[8]     = 0x028;       // real time replay
  122. regs0->emu_cfg[8]     = 0x020;       // slow motion replay
  123. }
  124. }
  125. #endif    
  126. }
  127. #else
  128. void setup_slowmotion(int fmt, int nint) 
  129. {   //wanghaoying 2003-8-12 19:11 modified
  130.     if(fmt)
  131.     {
  132.     }
  133.     if(nint)
  134.     {
  135.     }
  136. }
  137. void setup_emu(void) {}
  138. #endif