コード例 #1
0
ファイル: run.cpp プロジェクト: CaptainCPS/FBAlphaRL
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw, int bPause)
{
	static int bPrevPause = 0;
	static int bPrevDraw = 0;

	if (bPrevDraw && !bPause) {
		VidPaint(0);							// paint the screen (no need to validate)
	}

	if (!bDrvOkay) {
		return 1;
	}

	if (bPause) 
	{
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) 
		{
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
	} 
	else 
	{
		nFramesEmulated++;
		nCurrentFrame++;
		GetInput(true);					// Update inputs
	}
	if (bDraw) {
		nFramesRendered++;
		if (VidFrame()) {					// Do one frame
			AudBlankSound();
		}
	} 
	else {								// frame skipping
		pBurnDraw = NULL;					// Make sure no image is drawn
		BurnDrvFrame();
	}
	bPrevPause = bPause;
	bPrevDraw = bDraw;

	return 0;
}
コード例 #2
0
ファイル: run.cpp プロジェクト: tmaul/finalburnalpha_2001
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw,int bPause)
{
	static int bOldStretch=0;

	nCurrentFrame++;

	if (bDraw)
	{
		if (bOldStretch && bDtoStretch==0)
			// image may have shrunk
		{
			InvalidateRect(hScrnWnd,NULL,1);    // blank scrn window
			UpdateWindow(hScrnWnd);
		}
	}
	bOldStretch=bDtoStretch;

	GetInput(); // Get input on all frames

	InputTick(); // Tick one frame of input (for sliders etc)

	if (!bPause)
	{
		if (bDraw)
		{
			VidFrame();  // Do one frame
			VidPaint(0); // paint the screen (no need to validate)
		}
		else
		{
			// frame skipping
			pBurnDraw=NULL; // Make sure no image is drawn
			if (bDrvOkay)
			{
				BurnDrvFrame();
			}
		}
	}
	return 0;
}
コード例 #3
0
ファイル: run.cpp プロジェクト: carstene1ns/fbagx
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw, int bPause)
{
	static int bPrevPause = 0;
	static int bPrevDraw = 0;

	extern bool bDoPostInitialize;

	// Exit Jukebox properly
	
	if(bDoPostInitialize == true && bJukeboxInUse == true) {
		DrvExit();
		bJukeboxDisplayed	= false;
		bJukeboxInUse		= false;
		bDoPostInitialize = false;
		POST_INITIALISE_MESSAGE;
	}

	if (bPrevDraw && !bPause) {
		VidPaint(0);							// paint the screen (no need to validate)
	}

	if (!bDrvOkay) {
		return 1;
	}

	if (bPause && bJukeboxInUse == true) {
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) {
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
		return 0;
	}
	
	if (!bPause && bJukeboxInUse == true) {
		//if (!bJukeboxDisplayed) JukeboxDialogCreate();
		int TracklistDialog();

		if (bJukeboxDisplayed == false) TracklistDialog();
		nFramesEmulated++;
		nCurrentFrame++;
		BurnJukeboxFrame();
		return 0;		
	}

	if (bPause) {
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) {
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
	} else {

		nFramesEmulated++;
		nCurrentFrame++;

		if (kNetGame) {
			GetInput(true);						// Update inputs
			if (KailleraGetInput()) {			// Synchronize input with Kaillera
				return 0;
			}
		} else {
			if (nReplayStatus == 2) {
				GetInput(false);				// Update burner inputs, but not game inputs
				if (ReplayInput()) {			// Read input from file
					bAltPause = 1;
					bRunPause = 1;
					MenuEnableItems();
					InputSetCooperativeLevel(false, false);
				}
			} else {
				GetInput(true);					// Update inputs
			}
		}

		if (nReplayStatus == 1) {
			RecordInput();						// Write input to file
		}

		if (bDraw) {
			nFramesRendered++;

			if (VidFrame()) {					// Do one frame
				AudBlankSound();
			}
		} else {								// frame skipping
			pBurnDraw = NULL;					// Make sure no image is drawn
			BurnDrvFrame();
		}

		if (bShowFPS) {
			if (nDoFPS < nFramesRendered) {
				DisplayFPS();
				nDoFPS = nFramesRendered + 30;
			}
		}
	}

	bPrevPause = bPause;
	bPrevDraw = bDraw;

	return 0;
}
コード例 #4
0
static INT_PTR CALLBACK SShotDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	(void)lParam; (void)wParam; (void)hDlg;

	if (Msg == WM_INITDIALOG) {
		hSFactdlg = hDlg;
		SFactdInit();
		SetFocus(hDlg); // Enable Esc=close
		return 0;
	}
	if (Msg == WM_CLOSE) {
		DestroyWindow(hSFactdlg);
		dialogDelete(IDD_CAPTURE);
		return 0;
	}
	if (Msg == WM_DESTROY) {
		SFactdExit();
		return 0;
	}

	if (Msg == WM_COMMAND) {
		int Id = LOWORD(wParam); int Notify = HIWORD(wParam);

		if (Id==IDOK && Notify==BN_CLICKED) {
			SendMessage(hDlg,WM_CLOSE,0,0);
			return 0;
		} // cancel=close
		if (Id==IDC_CAPTURE && Notify==BN_CLICKED) {
			if (bDrvOkay) {
				MakeScreenShot();
				SFactdUpdate();
			}
		}
		if (Id==IDC_CAPTURE_PREV && Notify==BN_CLICKED) {
			if (bDrvOkay) {
				MakeScreenShot(false);
				SFactdUpdate();
			}
		}
		if (Id==IDC_CHECK1 && Notify==BN_CLICKED) {
			ToggleLayer(1);
			SFactdUpdate();
		}
		if (Id==IDC_CHECK2 && Notify==BN_CLICKED) {
			ToggleLayer(2);
			SFactdUpdate();
		}
		if (Id==IDC_CHECK3 && Notify==BN_CLICKED) {
			ToggleLayer(4);
			SFactdUpdate();
		}
		if (Id==IDC_CHECK4 && Notify==BN_CLICKED) {
			ToggleLayer(8);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE1 && Notify==BN_CLICKED) {
			ToggleSprite(0x01);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE2 && Notify==BN_CLICKED) {
			ToggleSprite(0x02);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE3 && Notify==BN_CLICKED) {
			ToggleSprite(0x04);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE4 && Notify==BN_CLICKED) {
			ToggleSprite(0x08);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE5 && Notify==BN_CLICKED) {
			ToggleSprite(0x10);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE6 && Notify==BN_CLICKED) {
			ToggleSprite(0x20);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE7 && Notify==BN_CLICKED) {
			ToggleSprite(0x40);
			SFactdUpdate();
		}
		if (Id==IDC_SPRITE8 && Notify==BN_CLICKED) {
			ToggleSprite(0x80);
			SFactdUpdate();
		}

		if (Id==IDC_ADVANCE && Notify==BN_CLICKED) {
			VidFrame();
			VidPaint(0);
		}
		if (bRunPause) {
			AudWriteSlience();
		}
	}
	return 0;
}
コード例 #5
0
// With or without sound, run one frame.
// If bDraw is true, it's the last frame before we are up to date, and so we should draw the screen
static int RunFrame(int bDraw, int bPause)
{
	static int bPrevPause = 0;
	static int bPrevDraw = 0;

	if (bPrevDraw && !bPause) {
		VidPaint(0);							// paint the screen (no need to validate)
	}

	if (!bDrvOkay) {
		return 1;
	}

	if (bPause) {
		GetInput(false);						// Update burner inputs, but not game inputs
		if (bPause != bPrevPause) {
			VidPaint(2);                        // Redraw the screen (to ensure mode indicators are updated)
		}
	} else {

		nFramesEmulated++;
		nCurrentFrame++;

		if (kNetGame) {
			GetInput(true);						// Update inputs
			if (KailleraGetInput()) {			// Synchronize input with Kaillera
				return 0;
			}
		} else {
			if (nReplayStatus == 2) {
				GetInput(false);				// Update burner inputs, but not game inputs
				if (ReplayInput()) {			// Read input from file
					bAltPause = 1;
					bRunPause = 1;
					MenuEnableItems();
					InputSetCooperativeLevel(false, false);
				}
			} else {
				GetInput(true);					// Update inputs
			}
		}

		if (nReplayStatus == 1) {
			RecordInput();						// Write input to file
		}

		if (bDraw) {
			nFramesRendered++;

			if (VidFrame()) {					// Do one frame
				AudBlankSound();
			}
		} else {								// frame skipping
			pBurnDraw = NULL;					// Make sure no image is drawn
			BurnDrvFrame();
		}

		if (bShowFPS) {
			if (nDoFPS < nFramesRendered) {
				DisplayFPS();
				nDoFPS = nFramesRendered + 30;
			}
		}
	}

	bPrevPause = bPause;
	bPrevDraw = bDraw;

	return 0;
}
コード例 #6
0
ファイル: sfactd.cpp プロジェクト: ernestd/fbarr
static INT_PTR CALLBACK DialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam)
{
  (void)lParam; (void)wParam; (void)hDlg;

  if (Msg==WM_INITDIALOG)
  {
	  hSFactdlg=hDlg;
	  SFactdInit();
	  SFactdUpdate();
	  WndInMid(hDlg, hScrnWnd);
      SetFocus(hDlg); // Enable Esc=close
	  return 0;
  }
  if (Msg==WM_CLOSE)
  {
	  //DestroyWindow(hSFactdlg);
	  EndDialog(hDlg, 0);
	  return 0;
  }
  if (Msg==WM_DESTROY) { SFactdExit(); return 0; }

  if (Msg==WM_COMMAND)
  {
    int Id=LOWORD(wParam); int Notify=HIWORD(wParam);
    if (Id==IDOK && Notify==BN_CLICKED) { SendMessage(hDlg,WM_CLOSE,0,0); return 0; }  // cancel=close
    if (Id==IDCAPTURE && Notify==BN_CLICKED)
		{
		if (bDrvOkay)
			{
			MakeScreenShot();
			SFactdUpdate();
			}
		}
    if (Id==IDC_CHECK1 && Notify==BN_CLICKED)
		{
		ToggleLayer(1);
		SFactdUpdate();
		}
    if (Id==IDC_CHECK2 && Notify==BN_CLICKED)
		{
		ToggleLayer(2);
		SFactdUpdate();
		}
    if (Id==IDC_CHECK3 && Notify==BN_CLICKED)
		{
		ToggleLayer(4);
		SFactdUpdate();
		}
    if (Id==IDC_CHECK4 && Notify==BN_CLICKED)
		{
		ToggleLayer(8);
		SFactdUpdate();
		}
    if (Id==IDC_SPRITE1 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x01);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE2 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x02);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE3 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x04);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE4 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x08);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE5 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x10);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE6 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x20);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE7 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x40);
		SFactdUpdate();
	}
    if (Id==IDC_SPRITE8 && Notify==BN_CLICKED)
		{
		ToggleSprite(0x80);
		SFactdUpdate();
	}

	if (Id==IDC_ADVANCE && Notify==BN_CLICKED)
		{
		VidFrame();
		VidPaint(0);
		}
		if (bRunPause) {
			memset(nAudNextSound, 0, nAudSegLen << 2);		// Write silence into the buffer
		}
  }
  return 0;
}