void MainWnd::OnSize(UINT nType, int cx, int cy) 
{
  CWnd::OnSize(nType, cx, cy);
  
  if(!theApp.changingVideoSize) {
    if(this) {
      if(!IsIconic()) {
        if(theApp.iconic) {
          if(emulating) {
            soundResume();
            theApp.paused = false;
          }
        }
        if(theApp.videoOption <= VIDEO_4X) {
          theApp.surfaceSizeX = cx;
          theApp.surfaceSizeY = cy;
          theApp.adjustDestRect();
          if(theApp.display)
            theApp.display->resize(theApp.dest.right-theApp.dest.left, theApp.dest.bottom-theApp.dest.top);
        }
      } else {
        if(emulating) {
          if(!theApp.paused) {
            theApp.paused = true;
            soundPause();
          }
        }
        theApp.iconic = true;                  
      }
    }
  }
}
Beispiel #2
0
void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
  CWnd::OnActivate(nState, pWndOther, bMinimized);

  bool a = (nState == WA_ACTIVE) || (nState == WA_CLICKACTIVE);

  if(a && theApp.input) {
    theApp.active = a;
    theApp.input->activate();
    if(!theApp.paused && emulating) {
      soundResume();
    }
  } else {
    theApp.wasPaused = true;
    if(theApp.pauseWhenInactive) {
      if(emulating) {
        soundPause();
      }
      theApp.active = a;
    }

    memset(theApp.delta,255,sizeof(theApp.delta));
  }

  if(theApp.paused && emulating)
  {
    theApp.painting = true;
    systemDrawScreen();
    theApp.painting = false;
    theApp.renderedFrames--;
  }
}
void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) 
{
  CWnd::OnActivate(nState, pWndOther, bMinimized);
  
  bool a = (nState == WA_ACTIVE) || (nState == WA_CLICKACTIVE);

  if(a && theApp.input) {
    theApp.active = a;
    theApp.input->activate();
    if(!theApp.paused) {
      if(emulating) {
        theApp.disablePowerManagement();
        soundResume();
      }
    }
  } else {
    theApp.wasPaused = true;
    if(theApp.pauseWhenInactive) {
      if(emulating) {
        theApp.enablePowerManagement();
        soundPause();
      }
      theApp.active = a;
    }

    memset(theApp.delta,255,sizeof(theApp.delta));        
  }

  if(theApp.paused && emulating)
    systemDrawScreen();
}
Beispiel #4
0
static void gba_init(void)
{
	//default values
	cpuSaveType = 0;
	flashSize = 0x10000;
	enableRtc = false;
	mirroringEnable = false;

	LoadImagePreferences();

	utilUpdateSystemColorMaps();

	if(flashSize == 0x10000 || flashSize == 0x20000)
		flashSetSize(flashSize);

	if(rtcEnable)
		rtcEnable(enableRtc);
	doMirroring(mirroringEnable);

	soundInit();
	soundSetSampleRate(32000);

	CPUInit(0, false);
	CPUReset();

	soundReset();
	soundResume();

	uint8_t *state_buf = new uint8_t[2000000];
	serialize_size = CPUWriteState_libgba(state_buf, 2000000);
	delete[] state_buf;
}
void Window::vOnMenuExit()
{
    if (emulating && !m_bPaused) {
        vStartEmu();
        soundResume();
    }
}
bool Window::on_focus_in_event(GdkEventFocus* _pstEvent)
{
    if (emulating && !m_bPaused) {
        vStartEmu();
        soundResume();
    }
    return false;
}
Beispiel #7
0
//this function will be called by the timer.
void timerCallBack()
{
	if(play)
		soundPause(channel);
	else
		soundResume(channel);

	play = !play;
}
void Window::vOnFilePauseToggled(Gtk::CheckMenuItem* _poCMI)
{
    m_bPaused = _poCMI->get_active();
    if (emulating) {
        if (m_bPaused) {
            vStopEmu();
            soundPause();
        } else {
            vStartEmu();
            soundResume();
        }
    }
}
Beispiel #9
0
void MainWnd::OnSize(UINT nType, int cx, int cy)
{
  CWnd::OnSize(nType, cx, cy);

  bool redraw = ( ( cx < theApp.surfaceSizeX ) || ( cy < theApp.surfaceSizeY ) );

  if(!theApp.changingVideoSize) {
    if(this) {
      if(!IsIconic()) {
        if(theApp.iconic) {
          if(emulating) {
            soundResume();
            theApp.paused = false;
          }
        }
        if(theApp.videoOption <= VIDEO_6X) {
          theApp.surfaceSizeX = cx;
          theApp.surfaceSizeY = cy;
          theApp.adjustDestRect();
          if(theApp.display)
            theApp.display->resize(theApp.dest.right-theApp.dest.left, theApp.dest.bottom-theApp.dest.top);
		  if( redraw && emulating ) {
			  theApp.painting = true;
			  systemDrawScreen();
			  theApp.painting = false;
			  theApp.renderedFrames--;
		  }
        }
      } else {
        if(emulating) {
          if(!theApp.paused) {
            theApp.paused = true;
            soundPause();
          }
        }
        theApp.iconic = true;
      }
    }
  }
}
Beispiel #10
0
void SciMusic::soundToggle(MusicEntry *pSnd, bool pause) {
	if (pause)
		soundPause(pSnd);
	else
		soundResume(pSnd);
}