@@ -1647,6 +1647,26 @@ static const struct _timing {
16471647 0x017B ,
16481648 0x7A ,0x019C
16491649 },
1650+ {
1651+ 0x06 ,0x0120 ,
1652+ 0x001E ,0x001F ,0x0001 ,0x0000 ,
1653+ 0x0D ,0x0C ,0x0B ,0x0A ,
1654+ 0x026B ,0x026A ,0x0269 ,0x026C ,
1655+ 0x0271 ,0x01AD ,
1656+ 0x40 ,0x47 ,0x69 ,0xA2 ,
1657+ 0x0175 ,
1658+ 0x7A ,0x019C
1659+ },
1660+ {
1661+ 0x06 ,0x0120 ,
1662+ 0x001E ,0x001E ,0x0002 ,0x0002 ,
1663+ 0x0D ,0x0B ,0x0D ,0x0B ,
1664+ 0x026B ,0x026D ,0x026B ,0x026D ,
1665+ 0x0272 ,0x01AD ,
1666+ 0x40 ,0x47 ,0x69 ,0xA2 ,
1667+ 0x0175 ,
1668+ 0x7A ,0x019C
1669+ },
16501670 {
16511671 0x0A ,0x0240 ,
16521672 0x0044 ,0x0044 ,0x0000 ,0x0000 ,
@@ -1785,11 +1805,9 @@ static const struct _timing* __gettiming(u32 vimode)
17851805 return & video_timing [1 ];
17861806 break ;
17871807 case VI_TVMODE_PAL_INT :
1788- case VI_TVMODE_DEBUG_PAL_INT :
17891808 return & video_timing [2 ];
17901809 break ;
17911810 case VI_TVMODE_PAL_DS :
1792- case VI_TVMODE_DEBUG_PAL_DS :
17931811 return & video_timing [3 ];
17941812 break ;
17951813 case VI_TVMODE_MPAL_INT :
@@ -1806,9 +1824,16 @@ static const struct _timing* __gettiming(u32 vimode)
18061824 case VI_TVMODE_NTSC_3D :
18071825 return & video_timing [7 ];
18081826 break ;
1809- case VI_TVMODE_PAL_PROG :
1827+ case VI_TVMODE_DEBUG_PAL_INT :
18101828 return & video_timing [8 ];
18111829 break ;
1830+ case VI_TVMODE_DEBUG_PAL_DS :
1831+ return & video_timing [9 ];
1832+ break ;
1833+ case VI_TVMODE_PAL_PROG :
1834+ case VI_TVMODE_DEBUG_PAL_PROG :
1835+ return & video_timing [10 ];
1836+ break ;
18121837 default :
18131838 break ;
18141839 }
@@ -2577,7 +2602,7 @@ void* VIDEO_GetCurrentFramebuffer(void)
25772602
25782603void VIDEO_Init (void )
25792604{
2580- u32 level ,vimode = 0 ;
2605+ u32 level ,vimode ;
25812606 u32 * tvInBootrom = (u32 * )0x800000cc ;
25822607
25832608 if (video_initialized ) return ;
@@ -2617,10 +2642,14 @@ void VIDEO_Init(void)
26172642
26182643 HorVer .nonInter = VIDEO_GetScanMode ();
26192644 HorVer .tv = _SHIFTR (_viReg [1 ],8 ,2 );
2620- if (HorVer .tv == VI_NTSC && (* tvInBootrom == VI_PAL || * tvInBootrom == VI_EURGB60 )) HorVer .tv = VI_EURGB60 ;
2645+ if (HorVer .tv == VI_NTSC ) {
2646+ if (* tvInBootrom == VI_PAL ) HorVer .tv = VI_EURGB60 ;
2647+ else if (* tvInBootrom == VI_DEBUG_PAL ) HorVer .tv = VI_DEBUG_PAL ;
2648+ else if (* tvInBootrom == VI_EURGB60 ) HorVer .tv = VI_EURGB60 ;
2649+ }
26212650
2622- vimode = HorVer .nonInter ;
2623- if ( HorVer . tv != VI_DEBUG ) vimode |= (HorVer .tv << 2 );
2651+ if ( HorVer . tv == VI_DEBUG ) vimode = VI_TVMODE ( VI_NTSC , HorVer .nonInter ) ;
2652+ else vimode = VI_TVMODE (HorVer .tv , HorVer . nonInter );
26242653 currTiming = __gettiming (vimode );
26252654 currTvMode = HorVer .tv ;
26262655
@@ -2959,7 +2988,7 @@ u32 VIDEO_GetCurrentTvMode(void)
29592988
29602989 _CPU_ISR_Disable (level );
29612990 if (currTvMode == VI_PAL ) tv = VI_PAL ;
2962- else if (currTvMode == VI_DEBUG_PAL ) tv = VI_PAL ;
2991+ else if (currTvMode == VI_DEBUG_PAL ) tv = VI_DEBUG_PAL ;
29632992 else if (currTvMode == VI_EURGB60 ) tv = VI_EURGB60 ;
29642993 else if (currTvMode == VI_MPAL ) tv = VI_MPAL ;
29652994 else tv = VI_NTSC ;
@@ -3004,6 +3033,7 @@ f32 VIDEO_GetAspectRatio(void)
30043033 if (height < 480 ) ratio *= 480.0f / (f32 )height ;
30053034 break ;
30063035 case VI_PAL :
3036+ case VI_DEBUG_PAL :
30073037 if (width < 704 ) ratio *= (f32 )width / 704.0f ;
30083038 if (height < 576 ) ratio *= 576.0f / (f32 )height ;
30093039 break ;
0 commit comments