aboutsummaryrefslogblamecommitdiff
path: root/src/apu.rs
blob: d27fca7beb65812de4219d04b73aaae48a46cbd8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                     




                                         




                                                                   

























































                                                                     
                    





                    


              
                                                

                                    
                 





                          


         
                                            












                                                 
             



                          
         

































                        













































                                                                               
                            




                                               
                                             







                                        
                                 








                                           
                            
                                                   









                                                                         









                                           


















                                               



                             

     



                                                              
 
                     





                                                



                                            


     

















                        



























                                                                                    
































                                                   
                     




                             
                     

                                                


                                                              




                                                

 


                      
                           










                                                


                                                                
                                      







                                                                                



                                                    
         
                                                      

                                       





                                           


                                                                    
                                                                       




                                                                 

                                                                          















                                                              



                                         




                                                     


                               

     
                              



                                     
                                   

     













                                     



                                              
                                                                
                         
                                                 
                          
                                            


                                            
                                            





                                                  

                     
                                                                
                         
                                                 
                              
                                            

                                            
                                            
                 



                      
 
#![allow(dead_code)]
use mos6502;

pub trait Speaker {
    fn queue(&mut self, sample: u16);
}

const CPU_SAMPLE_FREQ: u32 = 240;
pub const AUDIO_SAMPLE_FREQ: u32 = 44100;

const TRI_SEQ_TABLE: [u8; 32] = [
    15, 14, 13,