Пример #1
0
void FighterOpponentIvo::handleAction(FightAction action) {
	switch (action) {
	default:
		Fighter::handleAction(action);
		break;

	case kFightAction3:
		if ((_sequenceIndex != 1 && _sequenceIndex != 3) || checkFrame(4)) {
			setSequenceAndDraw(6, kFightSequenceType1);
			_opponent->setSequenceAndDraw(6, kFightSequenceType1);
			_opponent->handleAction(kFightAction103);
		}
		break;

	case kFightAction4:
		if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) {
			setSequenceAndDraw(6, kFightSequenceType1);
			_opponent->setSequenceAndDraw(5, kFightSequenceType1);
			_opponent->handleAction(kFightAction103);
		}
		break;

	case kFightAction131:
		if (_sequenceIndex)
			break;

		if (rnd(100) <= (unsigned int)(_countdown > 2 ? 60 : 75)) {
			setSequenceAndDraw(3 , kFightSequenceType1);
			if (_opponent->getSequenceIndex() == 4)
				setSequenceAndDraw(2, kFightSequenceType2);
		}
		break;
	}
}
Пример #2
0
void FighterPlayerMilos::handleAction(FightAction action) {
	switch (action) {
	default:
		Fighter::handleAction(action);
		return;

	case kFightAction1:
		if (_sequenceIndex != 1 || checkFrame(4)) {
			setSequenceAndDraw(6, kFightSequenceType1);
			_opponent->setSequenceAndDraw(3, kFightSequenceType1);

			_opponent->handleAction(kFightAction103);
			update();
		} else {
			_field_34++;
		}
		break;

	case kFightAction2:
		if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) {
			setSequenceAndDraw(6, kFightSequenceType1);
			_opponent->setSequenceAndDraw(4, kFightSequenceType1);

			_opponent->handleAction(kFightAction103);
			update();
		} else {
			_field_34++;
		}
		break;

	case kFightAction128:
		if (_sequenceIndex != 1 || checkFrame(4) || _opponent->getSequenceIndex() != 1) {
			switch (_opponent->getSequenceIndex()) {
			default:
				setSequenceAndDraw(rnd(3) + 1, kFightSequenceType0);
				break;

			case 1:
				setSequenceAndDraw(1, kFightSequenceType0);
				break;

			case 2:
				setSequenceAndDraw(3, kFightSequenceType0);
				break;
			}
		} else {
			setSequenceAndDraw(4, kFightSequenceType1);
			update();
		}
		break;
	}
}
Пример #3
0
void FighterPlayerIvo::handleAction(FightAction action) {
	switch (action) {
	default:
		Fighter::handleAction(action);
		return;

	case kFightAction1:
		if (_sequenceIndex != 1 || checkFrame(4)) {
			setSequenceAndDraw(7, kFightSequenceType1);
			_opponent->setSequenceAndDraw(4, kFightSequenceType1);

			_opponent->handleAction(kFightAction103);
			update();
		}
		break;

	case kFightAction2:
		if ((_sequenceIndex != 2 && _sequenceIndex != 3) || checkFrame(4)) {
			setSequenceAndDraw(7, kFightSequenceType1);
			_opponent->setSequenceAndDraw(5, kFightSequenceType1);

			_opponent->handleAction(kFightAction103);
			update();
		}
		break;

	case kFightAction128:
		switch (_opponent->getSequenceIndex()) {
		default:
		case 1:
			setSequenceAndDraw(1, kFightSequenceType0);
			break;

		case 2:
			setSequenceAndDraw(2, kFightSequenceType0);
			break;
		}
		break;

	case kFightAction129:
		setSequenceAndDraw((_opponent->getCountdown() > 1) ? 4 : 3, _sequenceIndex ? kFightSequenceType2 : kFightSequenceType0);
		break;

	case kFightAction130:
		setSequenceAndDraw(3, _sequenceIndex ? kFightSequenceType2 : kFightSequenceType0);
		break;
	}
}
Пример #4
0
void cInvalOp(isrVal_t regs)
{
  printf("IV\n");
  checkFrame(&regs);
  cBreakp(regs);
  panic("Invalid Opcode!");
}
Пример #5
0
void	VLCAudioPlayer::play()
{
	libvlc_media_player_play(mediaPlayer, &vlc_ex);
	QTimer *timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(checkFrame()));
	timer->start(50);
}
Пример #6
0
static void traceCallback(ActRec* fp, Cell* sp, Offset bcOff) {
  if (Trace::moduleEnabled(Trace::hhirTracelets)) {
    FTRACE(0, "{} {} {} {} {}\n",
           fp->m_func->fullName()->data(), bcOff, fp, sp,
           __builtin_return_address(0));
  }
  checkFrame(fp, sp, true /* fullCheck */, bcOff);
}
Пример #7
0
void FighterOpponentIvo::update() {
	if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) {

		if (_opponent->getField34() >= 2) {
			switch (rnd(5)) {
			default:
				break;

			case 0:
				setSequenceAndDraw(1, kFightSequenceType0);
				break;

			case 1:
				setSequenceAndDraw(2, kFightSequenceType0);
				break;

			case 2:
				setSequenceAndDraw(1, kFightSequenceType0);
				setSequenceAndDraw(2, kFightSequenceType2);
				break;

			case 3:
				setSequenceAndDraw(0, kFightSequenceType2);
				setSequenceAndDraw(1, kFightSequenceType2);
				break;

			case 4:
				setSequenceAndDraw(0, kFightSequenceType1);
				setSequenceAndDraw(1, kFightSequenceType2);
				break;
			}
		}

		// Update field_38
		_field_38 = 3 * _countdown + (int32)rnd(10);
	}

	if (_frame && checkFrame(2)) {

		if (_opponent->getCountdown() <= 0) {
			setSequenceAndDraw(7, kFightSequenceType1);
			_opponent->setSequenceAndDraw(8, kFightSequenceType1);
			getSoundQueue()->stop(kEntityTables0);

			_opponent->handleAction(kFightActionWin);

			return;
		}

		if (_sequenceIndex == 1 || _sequenceIndex == 2)
			_opponent->handleAction((FightAction)_sequenceIndex);
	}

	Fighter::update();
}
Пример #8
0
void FighterOpponentMilos::update() {
	if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) {

		if (_opponent->getField34() >= 2) {
			switch (rnd(5)) {
			default:
				break;

			case 0:
				setSequenceAndDraw(1, kFightSequenceType0);
				break;

			case 1:
				setSequenceAndDraw(2, kFightSequenceType0);
				break;

			case 2:
				setSequenceAndDraw(2, kFightSequenceType0);
				setSequenceAndDraw(2, kFightSequenceType1);
				break;

			case 3:
				setSequenceAndDraw(1, kFightSequenceType0);
				setSequenceAndDraw(2, kFightSequenceType2);
				break;

			case 4:
				setSequenceAndDraw(1, kFightSequenceType0);
				setSequenceAndDraw(1, kFightSequenceType2);
				break;
			}
		} else {
			setSequenceAndDraw(2, kFightSequenceType0);
		}

		// Update field_38
		if (_opponent->getField34() < 5)
			_field_38 = 6 * (5 - _opponent->getField34());
		else
			_field_38 = 0;
	}

	if (_frame && checkFrame(2)) {
		if (_sequenceIndex == 1 || _sequenceIndex == 2)
			_opponent->handleAction((FightAction)_sequenceIndex);

		if (_opponent->getCountdown() <= 0) {
			getSoundQueue()->removeFromQueue(kEntityTables0);
			handleAction(kFightActionLost);
		}
	}

	Fighter::update();
}
Пример #9
0
void cGenProt(isrVal_t regs)
{
  printf("GP\n");
  printf("\nGeneral Protection Fault\neip\tcs\tds\teflags\tprocesp\tss\n");
  printf("%X\t%X\t%X\t%X\t%X\n", regs.eip, regs.cs, regs.ds, regs.eflags,
                                                        regs.procesp, regs.ss);
  printf("\nCurrent:\n");
  printf("CS\tDS\tSS\tESP\n");
  printf("%X\t%X\t%X\t%X\n", getCS(), getDS(), getSS(), getESP());
  checkFrame(&regs);
//   panic("General Protection fault");
}
Пример #10
0
bool FighterPlayerMilos::canInteract(FightAction action) {
	if (action != kFightAction128
	 || _sequenceIndex != 1
	 || !_frame
	 || checkFrame(4)
	 || _opponent->getSequenceIndex() != 1) {
		 return Fighter::canInteract();
	}

	_engine->getCursor()->setStyle(kCursorHand);

	return true;
}
Пример #11
0
void FighterPlayerVesna::handleAction(FightAction action) {
	switch (action) {
	default:
		Fighter::handleAction(action);
		return;

	case kFightAction1:
		if (_sequenceIndex != 1) {
			_opponent->handleAction(kFightAction103);
			update();
		} else {
			_field_34++;
		}
		break;

	case kFightAction2:
		if (_sequenceIndex != 2) {
			_opponent->handleAction(kFightAction103);
			update();
		} else {
			_field_34++;
		}
		break;

	case kFightAction5:
		if (_sequenceIndex != 3) {
			_opponent->handleAction(kFightAction103);
			update();
		}
		break;

	case kFightAction128:
		if (_sequenceIndex == 1 && _opponent->getSequenceIndex() == 1 && checkFrame(4)) {
			setSequenceAndDraw(5, kFightSequenceType1);
		} else {
			setSequenceAndDraw((_opponent->getSequenceIndex() == 5) ? 3 : 1, kFightSequenceType0);
		}
		break;

	case kFightAction132:
		setSequenceAndDraw(2, kFightSequenceType0);
		break;
	}

	if (_field_34 > 10) {
		_opponent->setSequenceAndDraw(5, kFightSequenceType2);
		_opponent->setCountdown(1);
		_field_34 = 0;
	}
}
Пример #12
0
void cBreakp(isrVal_t regs)
{
  printf("BP\n");
  checkFrame(&regs);
  printf("Debug:\n");

  printf("eax\tebx\tecx\tedx\n%X\t%X\t%X\t%X\n", regs.eax, regs.ebx, regs.ecx, regs.edx);
  printf("\nds\n%X\n", regs.ds);
  printf("\nedi\tesi\tebp\tesp\n%X\t%X\t%X\t%X\n", regs.edi, regs.esi, regs.ebp, regs.esp);
  printf("\neip\tcs\teflags\tuseresp\tss\n%X\t%X\t%X\t%X\t%X\n", regs.eip, regs.cs, regs.eflags, regs.procesp, regs.ss);
  printf("\nerr_code\tfunc_ptr\n%X\t%X\n", regs.errCode, regs.funcPtr);
  printf("\n\nCurrent:\n");
  printf("CS\tDS\tSS\tESP\n%X\t%X\t%X\t%X\n", getCS(), getDS(), getSS(), getESP());
}
Пример #13
0
void cDivByZero(isrVal_t regs)
{
  printf("D0\n");
  checkFrame(&regs);
  if (regs.cs != 0x8)
  {
    panic("No process killing code yet");
  }
  printf("\nDiv by 0\neip\tcs\teflags\tprocesp\tss\n");
  printf("%X\t%X\t%X\t%X\t%X\n", regs.eip, regs.cs, regs.eflags, regs.procesp, regs.ss);
  printf("\nCurrent:\n");
  printf("CS\tDS\tSS\tESP\n");
  printf("%X\t%X\t%X\t%X\n", getCS(), getDS(), getSS(), getESP());
  panic ("Devide by zero");
}
Пример #14
0
bool JavaVM::execThread(StackFrame * currentThread, int timeEscalonator)
{
	try
	{
		while(time(NULL) + timeEscalonator > time(NULL))
		{
			Frame * f = currentThread->top(); //here I get the top frame, if a new method was stacked, I got him.
			if (!checkFrame(f))
				break;

			if (f->_method->getAccessFlags() & ACC_NATIVE)
			{
				invokeNativeMethod(f); //exceptions need to set _hasException on Frame and exception needs to be on top _operandStack
				continue;
			}

			//return true, false or undefined, true if this method is finished, false if it doesnt finished yet, undefined if it thorws an exception
			boost::logic::tribool ret = this->executionEngine(currentThread);
			if (!ret) { /* not finished yet*/ }
			else if (ret)
			{
				if (f->_method->getAccessFlags() & ACC_SYNCHRONIZED)
				{
					f->_localVariable[0]._var._objectref->_monitor--;
					this->notify(f->_localVariable[0]._var._objectref);
					//if this method has ACC_SYNCHRONIZED I need to do monitorexit
					//I need to sinalize I have unlock this object
				}

				Variable ret;
				if (currentThread->methodSDone(&ret))
					currentThread->top()->_operandStack.push(ret);
			}
			else //exception
			{
				currentThread->setException();
			}
		}
	}
	catch(std::exception & ex)
	{
//		throw ex;
		return false;
	}
	return true;
}
Пример #15
0
void FighterPlayerVesna::update() {
	if (_frame && checkFrame(2)) {

		if (_sequenceIndex == 3)
			_opponent->handleAction(kFightAction3);

		if (_opponent->getCountdown() <= 0) {
			getSoundQueue()->stop(kEntityTables0);
			_fight->bailout(Fight::kFightEndWin);
			return;
		}

		if (_sequenceIndex == 5)
			_opponent->handleAction(kFightAction5);
	}

	Fighter::update();
}
Пример #16
0
    /*!
     * \brief VideoService::VideoService The service will provide the video from the drone.
     * \param droneIP the ip of the drone
     * \param port the port number of the video port
     * \param parent QObject parent
     *
     * The current frame can be accessed with getMatrix(), when the nextFrameReady() signal is emited.
     */
    VideoService::VideoService(QString droneIP, int port, QObject *parent) :
        CuteService(droneIP, port, parent)
    {
        capture = new cv::VideoCapture();
        fps = -1;
        lostConnection = true;
        lostTimer = new QTimer(this);
        lostTimer->setInterval(2000);
        timer->setInterval(100000);

        connect(lostTimer,      SIGNAL(timeout()), this,    SLOT(checkLost()));
        connect(timer,          SIGNAL(timeout()), this,    SLOT(checkFrame()));
        connect(workerThread,   SIGNAL(started()), this,    SLOT(provision()));
        connect(workerThread,   SIGNAL(started()), timer,   SLOT(start()));

        tcpString = "tcp://" + droneIP + ":" + QString::number(port);
        moveToThread(workerThread);
    }
Пример #17
0
bool FighterPlayerVesna::canInteract(FightAction action) {
	if (action != kFightAction128)
		return Fighter::canInteract();

	if (_sequenceIndex != 1) {

		if (_opponent->getSequenceIndex() == 5) {
			_engine->getCursor()->setStyle(kCursorDown);
			return true;
		}

		return Fighter::canInteract();
	}

	if (_opponent->getSequenceIndex() == 1 && checkFrame(4)) {
		_engine->getCursor()->setStyle(kCursorPunchLeft);
		return true;
	}

	return false;
}
Пример #18
0
void FighterPlayerMilos::update() {
	if (_frame && checkFrame(2)) {

		// Draw sequences
		if (_opponent->getCountdown() <= 0) {
			setSequenceAndDraw(5, kFightSequenceType1);
			_opponent->setSequenceAndDraw(6, kFightSequenceType1);

			getSoundQueue()->removeFromQueue(kEntityTables0);
			getSound()->playSound(kEntityTrain, "MUS029", kFlagDefault);

			handleAction(kFightActionWin);
		}

		if (_sequenceIndex == 4) {
			_opponent->handleAction(kFightAction4);
			_fight->setEndType(Fight::kFightEndLost);
		}
	}

	Fighter::update();
}
Пример #19
0
void FighterPlayerIvo::update() {

	if ((_sequenceIndex == 3 || _sequenceIndex == 4) && !_frameIndex)
		_opponent->handleAction(kFightAction131);

	if (_frame && checkFrame(2)) {

		// Draw sequences
		if (_opponent->getCountdown() <= 0) {
			setSequenceAndDraw(9, kFightSequenceType1);
			_opponent->setSequenceAndDraw(8, kFightSequenceType1);
			getSoundQueue()->stop(kEntityTables0);

			handleAction(kFightActionWin);
			return;
		}

		if (_sequenceIndex == 3 || _sequenceIndex == 4)
			_opponent->handleAction((FightAction)_sequenceIndex);
	}

	Fighter::update();
}
Пример #20
0
//运行本节点,参数为是否在root中运行,为真则参与绘制,为假则不会被画出
int Element::run(bool in_root /*= true*/)
{
    exit_ = false;
    visible_ = true;
    if (in_root)
    {
        addOnRootTop(this);
    }
    onEntrance();
    running_ = true;
    while (true)
    {
        if (root_.empty())
        {
            break;
        }
        if (exit_)
        {
            break;
        }
        dealEventSelfChilds(true);
        if (exit_)
        {
            break;
        }
        drawAll();
        checkFrame();
        present();
    }
    running_ = false;
    onExit();
    if (in_root)
    {
        removeFromRoot(this);
    }
    return result_;
}
Пример #21
0
void cInvalidTSS(isrVal_t regs)
{
  printf("IT\n");
  checkFrame(&regs);
  panic("Invalid TSS");
}
Пример #22
0
void cFpu(isrVal_t regs)
{
  printf("FP\n");
  checkFrame(&regs);
  panic("Floating point exception");
}
Пример #23
0
void cStackFault(isrVal_t regs)
{
  printf("SF\n");
  checkFrame(&regs);
  panic("Stack fault!");
}
Пример #24
0
void FighterOpponentVesna::update() {
	if (!_field_38 && canInteract(kFightAction1) && !_sequenceIndex2) {

		if (_opponent->getField34() == 1) {
			setSequenceAndDraw(2, kFightSequenceType0);
		} else {
			switch (rnd(6)) {
			default:
				break;

			case 0:
				setSequenceAndDraw(1, kFightSequenceType0);
				break;

			case 1:
				setSequenceAndDraw(1, kFightSequenceType0);
				setSequenceAndDraw(1, kFightSequenceType2);
				break;

			case 2:
				setSequenceAndDraw(2, kFightSequenceType0);
				break;

			case 3:
				setSequenceAndDraw(2, kFightSequenceType0);
				setSequenceAndDraw(2, kFightSequenceType2);
				break;

			case 4:
				setSequenceAndDraw(1, kFightSequenceType0);
				setSequenceAndDraw(2, kFightSequenceType2);
				break;

			case 5:
				setSequenceAndDraw(2, kFightSequenceType0);
				setSequenceAndDraw(1, kFightSequenceType2);
				break;
			}
		}

		// Update field_38
		_field_38 = 4 * _countdown;
	}

	if (_frame && checkFrame(2)) {
		if (_sequenceIndex == 1 || _sequenceIndex == 2 || _sequenceIndex == 5)
			_opponent->handleAction((FightAction)_sequenceIndex);

		if (_opponent->getCountdown() <= 0) {

			switch (_sequenceIndex) {
			default:
				break;

			case 1:
				setSequenceAndDraw(3, kFightSequenceType1);
				break;

			case 2:
				setSequenceAndDraw(4, kFightSequenceType1);
				break;

			case 5:
				setSequenceAndDraw(6, kFightSequenceType1);
				break;
			}

			_opponent->setSequenceAndDraw(4, kFightSequenceType1);

			handleAction(kFightActionLost);
			_opponent->update();
			Fighter::update();

			getSoundQueue()->stop(kEntityTables0);

			// Stop processing
			return;
		}
	}

	Fighter::update();
}
Пример #25
0
void cAlligned(isrVal_t regs)
{
  printf("AL\n");
  checkFrame(&regs);
  panic("Alligned exception");
}
Пример #26
0
void cSimd(isrVal_t regs)
{
  printf("SIMD\n");
  checkFrame(&regs);
  panic("SSE exception");
}
Пример #27
0
void cNmi(isrVal_t regs)
{
  printf("NMI\n");
  checkFrame(&regs);
  panic("Don't know what a non-maskable interrupt does!!!");
}
Пример #28
0
void cOverflow(isrVal_t regs)
{
  printf("OF\n");
  checkFrame(&regs);
  panic("Overflow");
}
Пример #29
0
void cBound(isrVal_t regs)
{
  printf("BD\n");
  checkFrame(&regs);
  panic("Bounds");
}
Пример #30
0
void cSnp(isrVal_t regs)
{
  printf("FF\n");
  checkFrame(&regs);
  panic("Stack not present!");
}