⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 record3.s

📁 关于DVD的MPEG2用的DSP代码,在DSP的实现MPEG的压缩,解压算法.
💻 S
📖 第 1 页 / 共 5 页
字号:
                tsti    r0,0xaaaa
                bne    play_over

                dlw    r0,playing_flag
                nop
                andi   r0,0xffff
                tsti    r0,0xaaaa
                beq    now_playing                      // 

//--------------------------------------------------------------------------
//**************************************************************************
//--------------------------------------------------------------------------
//              mupi   r0,REC_SEG
//              dsw    r0,play_fifo_start_address
//              mupi   r0,REC_SEG+2
//              dsw    r0,play_fifo_end_address
//              mupi   r0,REC_SEG
//              dsw    r0,play_fifo_current_address             // use for cycle   
//--------------------------------------------------------------------------
//**************************************************************************
//--------------------------------------------------------------------------

                li       r0,buffer_first_page_head
                dsw     r0,play_fifo_start_address               // all for three page 
                dsw     r0,play_fifo_current_address             // use for cycle   
                dlw     r0,record_fifo_current_address
                nop
                dsw    r0,play_fifo_end_address                 // all for three page

//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//              mupi   r0,REC_SEG
//              ori    r0,12*8
//              dsw    r0,play_fifo_end_address
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//              movi   r0,0xaaaa                                // for uncompressed date             
//              dsw    r0,playing_flag                          // set the recording flag
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
                
                movi   r0,544
                dsh    r0,y0                                    // initial the vary

                movi   r0,0
                dsh    r0,se
                                
                la     r1,(sl)
                loop   33,initial_vary_pl
                dswr   r0,r1                                    // all 35 variable need to clear
                addi   r1,4
                
initial_vary_pl:                 

//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

                movi   r0,0              
                dsw    r0,frame_count                          // for frame counter also
                                                               // use as flag  *******
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
                movi   r0,0                                    
                dsw    r0,system_time_buffer                   // set the need sync flag

//----------------------------------------------------------------------------
//----------------------------------------------------------------------------


now_playing:

//--------------------------------------------------------------------------------------                
// ****************** next for check address **************************************
//--------------------------------------------------------------------------------------

//                movi   DcacheBase,MEM_SEG
                dlw    r0,app_status
                nop
//                movi   DcacheBase,APP_DATA_SEG
                tsti   r0,(APP_RR_ENABLE|APP_RR_MODE_REREAD|APP_RR_PLAY_RUN) //0x46                                  // do now in re-read status
                beq    now_in_reread_play                    


//---------------------------------------------------------------------------------------
//*****************************************************************************          
//---------------------------------------------------------------------------------------

//                rlwi   r3,(0x750>>2)
                  rlwi   r3,STC
//--------------------------------------------------------------------------------------
//************ next for test sync debug use ****************************************
//--------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------
//************ end of test sync debu use ******************************************
//--------------------------------------------------------------------------------------

                
                dlw   r0,system_time_buffer
                nop
                #if SVCD
	                tsti   r0,0x5555
                beq   now_in_resing_play                        // if not equal 0 don't need sync 
				#else
	              j      now_in_resing_play
				#endif	              
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
//------------------------ do sync ------------------------------------------------------
//---------------------------------------------------------------------------------------

                dlw    r0,system_time
                nop
                tst    r3,r0                 
                bgt    real_play_check_next1                       // wait for pointer               
                j      real_play_end                               //

real_play_check_next1:

//              addi   r0,0x1500                                   // here ?????????????????
                addi   r0,0x3000                                   // here ?????????????????
                tst    r3,r0
                blt    real_play_check_next2
                j      real_play_end

real_play_check_next2:
                 
                movi   r0,0x5555                                  // else clear it
                dsw    r0,system_time_buffer
                
//-------------------------------------------------------------------------
//*************************************************************************
//-------------------------------------------------------------------------

now_in_resing_play:

now_in_reread_play:
               
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
              
                dlw    r0,play_fifo_current_address
                dlw    r1,play_fifo_end_address
                nop
                tst    r0,r1
                bgte   play_over

//---------------------------------------------------------------------------
//*********** next for check address ****************************************
//---------------------------------------------------------------------------
#if !LINEAR_BUFFER
                
                li     r2,buffer_second_page_head
                tst    r1,r2
                blte   playing_next  
                
                li     r2,buffer_first_page_tail
                tst    r0,r2
                bne    p_check_address_next1
                
                li     r1,buffer_second_page_head
                dsw    r1,play_fifo_current_address
                j      playing_next
                
p_check_address_next1:                
                
                li     r2,buffer_third_page_head
                tst    r1,r2
                blte   playing_next  
                
                li     r2,buffer_second_page_tail
                tst    r0,r2
                bne    p_check_address_end
                
                li     r1,buffer_third_page_head
                dsw    r1,play_fifo_current_address
                                
p_check_address_end:                
#endif
                
                j      playing_next 

//--------------------------------------------------------------------------
//********** end of check address ******************************************
//--------------------------------------------------------------------------

play_over:      

//--------------------------------------------------------------------------
//              movb   r0,%LB_APP_flag
//              andi   r0,0xe6                                // stop
//              movb   %LB_APP_flag,r0
//--------------------------------------------------------------------------

                movi   r0,0x0
                dsw    r0,play_on_off_flag
                dsw    r0,playing_flag

//--------------------------------------------------------------------------

                j      real_play_end
                
playing_next:                

                nop
                jsr    r6,adpcm_play
                nop

//-------------------------------------------------------------------------

real_play_end:  
                nop
                j      r9
                nop

//-------------------------------------------------------------------------
// ****************** end of real play sub programm *********************** 
//-------------------------------------------------------------------------

//#########################################################################
//-------------------------------------------------------------------------
//----------- next for adpcm play sub programm ----------------------------
//-------------------------------------------------------------------------
//#########################################################################

adpcm_play:

#if 1


//--------------------------------------------------------------------------
//***************** here the local buffer don't need to protect ************
//--------------------------------------------------------------------------

                dlw     r0,play_fifo_current_address
                nop
                mov     r1,r0

//--------------------------------------------------------------------------
#ifdef          F11025
                
                addi    r0,24                             // 11.025k 
#else
                addi    r0,12                             // 5.5k   
#endif
//--------------------------------------------------------------------------

                dsw     r0,play_fifo_current_address      // data pointer update  
                
                mov     r0,r1
                shr     r0,16
                andi    r0,0xffff                         // pick the segment
                andi    r1,0xffff
                               
                mov     StartAddrHigh,r0                  // move to data segment
                la      r0,(local_micro_44)     
                shr     r0,2                           
                shr     r1,2

#ifdef          F11025
                
                movi    DMASize,5                         // 11.025k
#else                                      
                movi    DMASize,2                         // 5.5k    load in 12 bytes data
#endif

                mov     LocalAddr,r0 
                dmarr   r1          
                WaitDma

//              dlw     r1,frame_count
//              nop
//              nop
//              mov     r0,r1                             // frame count increase 1
//              addi    r1,1
//              dsw     r1,frame_count

                dlw     r0,frame_count                     // framecount increase 1 
                nop
                addi    r1,r0,1
                dsw     r1,frame_count
                
//----------------------------------------------------------------------------
//   next for debug use
//----------------------------------------------------------------------------
                
               
//-----------------------------------------------------------------------------                
// ******************* end of debug zone **************************************                
//-----------------------------------------------------------------------------                

                movi    StartAddrHigh,APP_DATA_SEG                  // move to data segment
                
                la      r1,(play_debug_pcm)
                la      r0,(local_micro_44)     
                shr     r0,2
                shr     r1,2
                                      
                mov     LocalAddr,r0                                // transfer the data out for byte operation 
                dmawr   r1                                    
                WaitDma
                                                                    // main memmory for byte manipution 


//----------------------------------------------------------------------------
//****************************************************************************
//----------------------------------------------------------------------------

 		       movi	AGRAdr0, compressed_data_address        //  
		       movi	AGRSiz0, 0xffff                         // 
  		       movi	r5, play_debug_pcm                      //  

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// !!!!!!!!!!!!!!!!!!!!!! next for play decoder !!!!!!!!!!!!!!!!!!!!!!!!!!!!

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -