Esempio n. 1
0
		Result Tracker::Execute
		(
			Machine& machine,
			Video::Output* const video,
			Sound::Output* const sound,
			Input::Controllers* input
		)
		{
			if (machine.Is(Api::Machine::ON))
			{
				++frame;

				try
				{
					if (machine.Is(Api::Machine::GAME))
					{
						if (rewinder)
						{
							rewinder->Execute( video, sound, input );
							return RESULT_OK;
						}
						else if (movie)
						{
							if (!movie->Execute())
							{
								StopMovie();
							}
							else if (movie->IsPlaying())
							{
								input = NULL;
							}
						}
					}

					machine.Execute( video, sound, input );
					return RESULT_OK;
				}
				catch (Result result)
				{
					return machine.PowerOff( result );
				}
				catch (const std::bad_alloc&)
				{
					return machine.PowerOff( RESULT_ERR_OUT_OF_MEMORY );
				}
				catch (...)
				{
					return machine.PowerOff( RESULT_ERR_GENERIC );
				}
			}
			else
			{
				return RESULT_ERR_NOT_READY;
			}
		}
Esempio n. 2
0
		Result Tracker::Execute
		(
			Machine& emulator,
			Video::Output* const video,
			Sound::Output* const sound,
			Input::Controllers* input
		)
		{
			if (emulator.Is(Api::Machine::ON))
			{
				++frame;

				if (emulator.Is(Api::Machine::GAME))
				{
					if (rewinder)
					{
						rewinder->Execute( video, sound, input );
						return RESULT_OK;
					}
					else if (movie)
					{
						if (!movie->Execute())
						{
							StopMovie();
						}
						else if (movie->IsPlaying())
						{
							input = NULL;
						}
					}
				}

				emulator.Execute( video, sound, input );
				return RESULT_OK;
			}
			else
			{
				return RESULT_ERR_NOT_READY;
			}
		}