예제 #1
0
void Snapshot_Startup()
{
	static bool bDone = false;

	if(!g_bSaveStateOnExit || bDone)
		return;

	Snapshot_LoadState();

	bDone = true;
}
예제 #2
0
void FrameQuickState(int num, int mod)
{
	// quick load or save state with number num,
	// if Shift is pressed, state is being saved,
	// otherwise - being loaded
	char fpath[MAX_PATH];
	snprintf(fpath, MAX_PATH, "%s/SaveState%d.aws", g_sSaveStateDir, num); // prepare file name
	Snapshot_SetFilename(fpath);	// set it as a working name
	if(mod & KMOD_SHIFT)	Snapshot_SaveState();
	else		Snapshot_LoadState();
}
예제 #3
0
//===========================================================================
void ProcessButtonClick (int button, int mod) {
// button - number of button pressed (starting with 0, which means F1
// mod - what modifiers been set (like CTRL, ALT etc.)
	SDL_Event qe;	// for Quitting and Reset

	SoundCore_SetFade(FADE_OUT); // sound/music off?

  switch (button) {

    case BTN_HELP:	// will get some help on the screen?
	    FrameShowHelpScreen(screen->w, screen->h);

//         TCHAR filename[MAX_PATH];
//         _tcscpy(filename,g_sProgramDir);
//         _tcscat(filename,TEXT("APPLEWIN.CHM"));
//         HtmlHelp(g_hFrameWindow,filename,HH_DISPLAY_TOC,0);
//         helpquit = 1;
      break;

    case BTN_RUN:	// F2 - Run that thing! Or Shift+2 ReloadConfig and run it anyway!
	if(mod & KMOD_SHIFT) {
		  restart = 1;	// keep up flag of restarting
		  qe.type = SDL_QUIT;
		  SDL_PushEvent(&qe);// push quit event
	}
	else {
      if (g_nAppMode == MODE_LOGO)
        DiskBoot();
      else if (g_nAppMode == MODE_RUNNING)
        ResetMachineState();
      if ((g_nAppMode == MODE_DEBUG) || (g_nAppMode == MODE_STEPPING))
        DebugEnd();
      g_nAppMode = MODE_RUNNING;
      DrawStatusArea(/*(HDC)0,*/DRAW_TITLE);
      VideoRedrawScreen();
      g_bResetTiming = true;
	}
      break;

    case BTN_DRIVE1:
    case BTN_DRIVE2:
	    if (mod & KMOD_SHIFT) {
		if(mod & KMOD_ALT)
			HD_FTP_Select(button - BTN_DRIVE1);// select HDV image through FTP
		else HD_Select(button - BTN_DRIVE1);	// select HDV image from local disk
	    }
      	    else {
		if(mod & KMOD_ALT) Disk_FTP_SelectImage(button - BTN_DRIVE1);//select through FTP
		else DiskSelect(button - BTN_DRIVE1); // select image file for appropriate disk drive(#1 or #2)
	    }
/*      if (!fullscreen)
        DrawButton((HDC)0,button);*/
      break;

    case BTN_DRIVESWAP:	// F5 - swap disk drives
      DiskDriveSwap();
      break;

    case BTN_FULLSCR:	// F6 - Fullscreen on/off
      if (fullscreen) { fullscreen = 0;
        SetNormalMode(); }
      else { fullscreen = 1;
        SetFullScreenMode();}
      break;

    case BTN_DEBUG:	// F7 - debug mode - not implemented yet? Please, see README about it. --bb
/*		if (g_nAppMode == MODE_LOGO)
		{
			ResetMachineState();
		}

		if (g_nAppMode == MODE_STEPPING)
		{
			DebuggerInputConsoleChar( DEBUG_EXIT_KEY );
		}
		else
		if (g_nAppMode == MODE_DEBUG)
		{
			g_bDebugDelayBreakCheck = true;
			ProcessButtonClick(BTN_RUN);
		}
		else
		{
			DebugBegin();
		}*/
      break;

    case BTN_SETUP:	// setup is in conf file - linapple.conf.
	    		// may be it should be implemented using SDL??? 0_0 --bb
	// Now Shift-F8 save settings changed run-tme in linapple.conf
	// F8 - save current screen as a .bmp file
	    // Currently these setting are just next:
	if(mod & KMOD_SHIFT) {
		RegSaveValue(TEXT("Configuration"),TEXT("Video Emulation"),1,videotype);
		RegSaveValue(TEXT("Configuration"),TEXT("Emulation Speed"),1,g_dwSpeed);
		RegSaveValue(TEXT("Configuration"),TEXT("Fullscreen"),1,fullscreen);
	}
	else {
		FrameSaveBMP();
	}

//      {
//		  PSP_Init();
      //}
      break;


////////////////////////// my buttons handlers F9..F12 ////////////////////////////
    case BTN_CYCLE: // F9 - CYCLE through allowed video modes
//	  printf("F9 has been pressed!\n");
	  videotype++;	// Cycle through available video modes
	  if (videotype >= VT_NUM_MODES)
		  videotype = 0;
	  VideoReinitialize();
	  if ((g_nAppMode != MODE_LOGO) || ((g_nAppMode == MODE_DEBUG) && (g_bDebuggerViewingAppleOutput))) // +PATCH
	  {
		  VideoRedrawScreen();
		  g_bDebuggerViewingAppleOutput = true;  // +PATCH
	  }

  	  break;
    case BTN_QUIT:	// F10 - exit from emulator?

		qe.type = SDL_QUIT;
		SDL_PushEvent(&qe);// push quit event
		break;	//

    case BTN_SAVEST:	// Save state (F11)
	    if(mod & KMOD_ALT) { // quick save
		    Snapshot_SaveState();
	    }
	  else
	  if(PSP_SaveStateSelectImage(true))
	  {
		  Snapshot_SaveState();
	  }
  	break;
    case BTN_LOADST:	// Load state (F12) or Hot Reset (Ctrl+F12)
	    if(mod & KMOD_CTRL) {
			// Ctrl+Reset
			if (!IS_APPLE2)
				MemResetPaging();

			DiskReset();
			KeybReset();
			if (!IS_APPLE2)
				VideoResetState();	// Switch Alternate char set off
			MB_Reset();
			CpuReset();
		}
	else if(mod & KMOD_ALT)	// quick load state
	{
		Snapshot_LoadState();
	}
    	else if(PSP_SaveStateSelectImage(false))
    	  {
	   	Snapshot_LoadState();
    	  }
	  break;
}//switch (button)
//////////////////////////////////////////// end of my buttons handlers //////////////////

  if((g_nAppMode != MODE_DEBUG) && (g_nAppMode != MODE_PAUSED))
  {
	  SoundCore_SetFade(FADE_IN);
  }
}