Ejemplo n.º 1
0
static void defaultErrorHandler(const char *msg) {
	// Unless this error -originated- within the debugger itself, we
	// now invoke the debugger, if available / supported.
	if (g_engine) {
		GUI::Debugger *debugger = g_engine->getDebugger();
#ifdef _WIN32_WCE
		if (isSmartphone())
			debugger = 0;
#endif

#if defined(USE_TASKBAR)
		g_system->getTaskbarManager()->notifyError();
#endif

		if (debugger && !debugger->isActive()) {
			debugger->attach(msg);
			debugger->onFrame();
		}


#if defined(USE_TASKBAR)
		g_system->getTaskbarManager()->clearError();
#endif

	}
}
Ejemplo n.º 2
0
static void defaultErrorHandler(const char *msg) {
	// Unless this error -originated- within the debugger itself, we
	// now invoke the debugger, if available / supported.
	if (g_engine) {
		GUI::Debugger *debugger = g_engine->getDebugger();
#ifdef _WIN32_WCE
		if (isSmartphone())
			debugger = 0;
#endif
		if (debugger && !debugger->isActive()) {
			debugger->attach(msg);
			debugger->onFrame();
		}
	}
}
Ejemplo n.º 3
0
bool Cheater_Geisha::cheat(GUI::Debugger &console) {
	// A cheat to get around the Diving minigame
	if (_diving->isPlaying()) {
		_diving->cheatWin();
		return false;
	}

	// A cheat to get around the Penetration minigame
	if (_penetration->isPlaying()) {
		_penetration->cheatWin();
		return false;
	}

	// A cheat to get around the mastermind puzzle
	if (_vm->isCurrentTot("hard.tot") && _vm->_inter->_variables) {
		uint32 digit1 = READ_VARO_UINT32(0x768);
		uint32 digit2 = READ_VARO_UINT32(0x76C);
		uint32 digit3 = READ_VARO_UINT32(0x770);
		uint32 digit4 = READ_VARO_UINT32(0x774);
		uint32 digit5 = READ_VARO_UINT32(0x778);

		if (digit1 && digit2 && digit3 && digit4 && digit5)
			console.DebugPrintf("Mastermind solution: %d %d %d %d %d\n",
			                    digit1, digit2, digit3, digit4, digit5);

		return true;
	}

	return true;
}
Ejemplo n.º 4
0
int PreAgiEngine::getSelection(SelectionTypes type) {
	Common::Event event;
	GUI::Debugger *console = getDebugger();

	while (!shouldQuit()) {
		while (_eventMan->pollEvent(event)) {
			switch (event.type) {
			case Common::EVENT_RTL:
			case Common::EVENT_QUIT:
				return 0;
			case Common::EVENT_RBUTTONUP:
				return 0;
			case Common::EVENT_LBUTTONUP:
				if (type == kSelYesNo || type == kSelAnyKey)
					return 1;
			case Common::EVENT_KEYDOWN:
				if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL) && console) {
					console->attach();
					console->onFrame();
					//FIXME: If not cleared, clicking again will start the console
					event.kbd.keycode = Common::KEYCODE_INVALID;
					event.kbd.flags = 0;
					continue;
				}
				switch (event.kbd.keycode) {
				case Common::KEYCODE_y:
					if (type == kSelYesNo)
						return 1;
				case Common::KEYCODE_n:
					if (type == kSelYesNo)
						return 0;
				case Common::KEYCODE_ESCAPE:
					if (type == kSelNumber || type == kSelAnyKey)
						return 0;
				case Common::KEYCODE_1:
				case Common::KEYCODE_2:
				case Common::KEYCODE_3:
				case Common::KEYCODE_4:
				case Common::KEYCODE_5:
				case Common::KEYCODE_6:
				case Common::KEYCODE_7:
				case Common::KEYCODE_8:
				case Common::KEYCODE_9:
					if (type == kSelNumber)
						return event.kbd.keycode - Common::KEYCODE_1 + 1;
				case Common::KEYCODE_SPACE:
					if (type == kSelSpace)
						return 1;
				case Common::KEYCODE_BACKSPACE:
					if (type == kSelBackspace)
						return 0;
				default:
					if (event.kbd.flags & Common::KBD_CTRL)
						break;
					if (type == kSelYesNo) {
						return 2;
					} else if (type == kSelNumber) {
						return 10;
					} else if (type == kSelAnyKey || type == kSelBackspace) {
						return 1;
					}
				}
				break;
			default:
				break;
			}
		}
		_system->updateScreen();
		_system->delayMillis(10);
	}
	return 0;
}