コード例 #1
0
ファイル: Synchronizer.cpp プロジェクト: Drakeo/ssr
void Synchronizer::FlushBuffers(SharedData* lock) {
	if(!lock->m_segment_video_started || !lock->m_segment_audio_started)
		return;

	int64_t segment_start_time, segment_stop_time;
	GetSegmentStartStop(lock, &segment_start_time, &segment_stop_time);

	// flush video
	if(m_output_format->m_video_enabled)
		FlushVideoBuffer(lock, segment_start_time, segment_stop_time);

	// flush audio
	if(m_output_format->m_audio_enabled)
		FlushAudioBuffer(lock, segment_start_time, segment_stop_time);

}
コード例 #2
0
ファイル: coco3.cpp プロジェクト: vcc6809/VCC
float RenderFrame (SystemState *RFState)
{
	static unsigned short FrameCounter=0;

//********************************Start of frame Render*****************************************************
	SetBlinkState(BlinkPhase);
	irq_fs(0);				//FS low to High transition start of display Boink needs this

	for (RFState->LineCounter=0;RFState->LineCounter<13;RFState->LineCounter++)		//Vertical Blanking 13 H lines 
		CPUCycle();

	for (RFState->LineCounter=0;RFState->LineCounter<4;RFState->LineCounter++)		//4 non-Rendered top Boarder lines
		CPUCycle();

	if (!(FrameCounter % RFState->FrameSkip))
		if (LockScreen(RFState))
			return(0);

	for (RFState->LineCounter=0;RFState->LineCounter<(TopBoarder-4);RFState->LineCounter++) 		
	{
		if (!(FrameCounter % RFState->FrameSkip))
			DrawTopBoarder[RFState->BitDepth](RFState);
		CPUCycle();
	}

	for (RFState->LineCounter=0;RFState->LineCounter<LinesperScreen;RFState->LineCounter++)		//Active Display area		
	{
		CPUCycle();
		if (!(FrameCounter % RFState->FrameSkip))
			UpdateScreen[RFState->BitDepth] (RFState);
	} 
	irq_fs(1);  //End of active display FS goes High to Low
	if (VertInteruptEnabled)
		GimeAssertVertInterupt();	
	for (RFState->LineCounter=0;RFState->LineCounter < (BottomBoarder) ;RFState->LineCounter++)	// Bottom boarder 
	{
//		if ( (RFState->LineCounter==1) & (VertInteruptEnabled) )	//Vert Interupt occurs 1 line into 
//			GimeAssertVertInterupt();								// Bottom Boarder MPATDEMO
		CPUCycle();
		if (!(FrameCounter % RFState->FrameSkip))
			DrawBottomBoarder[RFState->BitDepth](RFState);
	}

	if (!(FrameCounter % RFState->FrameSkip))
	{
		UnlockScreen(RFState);
		SetBoarderChange(0);
	}

	for (RFState->LineCounter=0;RFState->LineCounter<6;RFState->LineCounter++)		//Vertical Retrace 6 H lines
		CPUCycle();

	switch (SoundOutputMode)
	{
	case 0:
		FlushAudioBuffer(AudioBuffer,AudioIndex<<2);
		break;
	case 1:
		FlushCassetteBuffer(CassBuffer,AudioIndex);
		break;
	case 2:
		LoadCassetteBuffer(CassBuffer);

		break;
	}
	AudioIndex=0;


/*
	//Debug Code
	Frames++;
	if (Frames==60)
	{
		Frames=0;
		sprintf(Msga,"Total Cycles = %i Scan lines = %i LPS= %i\n",TotalCycles,Scans,LinesperScreen+TopBoarder+BottomBoarder+19);
		WriteLog(Msga,0);
		TotalCycles=0;
		Scans=0;
	}
*/
	return(CalculateFPS());
}