View Single Post
Old 29 December 2012, 10:00   #19
WCoder
Registered User
 
Join Date: Jul 2012
Location: France
Posts: 12
Frame rate Synchonisation question...

Code:
Hi, I have an other question...
   
  I don't understand the synchronization between graph & audio and generally the mechanism used to fixes frame rate....
   
  I replace audio renderer by a ring\circular buffer with a read and write cursor...
   
  I want to use the sound playing buffer like a clock to regulate frame rate... 
  I want to use the amount of available data to regulate 64K opcode execution.
                                                                                      
  Slowdow execution  ---------<====>++++++  Speedup execution
   
  If amount of data symbolize by ‘v’ is on ‘=’ I don’t do anything, if it’s on ‘-‘ I need to reduce CPU speed if it’s on ‘+’ I need to speed up execution….
   
  I already remove “docorrection“ that seems to speed up or slow down the sound not my goal (maybe an error ?)….
   
  I already reduce WinUAE source code to 4.35 Mo with 95 files (fix option to 32 bits graph with 16 bits audio), restrict to CPU A500 (keep AGA for the moment (superfrog seems to need it (not sure)), remove platform specific code like ASM, DirectX, WinUAE, DDK... except: Timer\event\wait and the strange thread used on trap, I don't understand this part too ... for the moment ^_^...
   
  I made test with Turrican 2, ProjectX and Superfrog, and except that sound oscillate between good & noisy, graph speed is ok…
   
  If I understand WinUAE read start time using figure_processor_speed and store it on syncbase…
   
  During execution, it read current time with read_processor_time and call sleep_millis2 : two version on who really sleep an other that sleep but add sleep time to a cumulative var ???? 
   
  All this mechanism seems to be done using this var :
  syncbase,  curr_time, vsyncwaittime, vsynctimebase, vsyncmaxtime, m68k_speed, m68k_speed_throttle, cpu_clock_multiplier, cycles_mult, cpucycleunit
   
  and this function:
  framewait, read_processor_time, figure_processor_speed, sleep_millis2
   
  Can you help me to understand this code design it's high coding level and i haven't all card to understand it ?
   
  Thanks,
   
  WCoder
   
  Ps: Sorry for my bad English level ^_o
WCoder is offline  
 
Page generated in 0.04141 seconds with 11 queries