Example #1
0
void BSpit::checkYtramCatch(bool playSound) {
	// Check if we've caught a Ytram

	uint32 &ytramTime = _vm->_vars["bytramtime"];

	// The trap has been moved back up.
	// You can't catch those sneaky Ytrams that way.
	if (ytramTime == 0) {
		return;
	}

	// If the trap still has not gone off, reinstall our timer
	// This is in case you set the trap, walked away, and returned
	if (_vm->getTotalPlayTime() < ytramTime) {
		installTimer(TIMER(BSpit, ytramTrapTimer), ytramTime - _vm->getTotalPlayTime());
		return;
	}

	// Increment the movie per catch (max = 3)
	uint32 &ytramMovie = _vm->_vars["bytram"];
	ytramMovie++;
	if (ytramMovie > 3)
		ytramMovie = 3;

	// Reset variables
	_vm->_vars["bytrapped"] = 1;
	_vm->_vars["bbait"] = 0;
	_vm->_vars["bytrap"] = 0;
	ytramTime = 0;

	// Play the capture sound, if requested
	if (playSound)
		_vm->_sound->playSound(33);
}
Example #2
0
int kickoff() {
	initVideo();	
	putStr("Hello World! - Team Virtua!!!\n");
	
 	installDescriptorTables();
	installTimer();
	installKeyboard();	
    initializePaging();    
	putStr("Hello, paging world! - Team Virtua !!!\n");	

	enableInterrupts();	

	
	// u32 end_addr = (u32)&end;
	// u32 *ptr = (u32 *)end_addr;		
	
	// while(1) {
		// putStr("End Address : ");
		// putHex(end_addr);
		// putStr(" ");
		// putHex((u32)ptr);
		// putStr(" : ");
		// putNum(*ptr);
		// putStr("\n");
		// ptr++;	
	// }
			
    putStr("Gotcha!!!\n");

    for (;;);
	return 0;	
}
Example #3
0
void PSpit::installCardTimer() {
	if (getCurrentCardGlobalId() == 0x3a85) {
		// Top of elevator on prison island
		// Handle Catherine hardcoded videos
		installTimer(TIMER(PSpit, catherineIdleTimer), _vm->_rnd->getRandomNumberRng(1, 33) * 1000);
	} else {
		RivenStack::installCardTimer();
	}
}
Example #4
0
void BSpit::xbsettrap(const ArgumentArray &args) {
	// Set the Ytram trap

	// We can catch the Ytram between 10 seconds and 3 minutes from now
	uint32 timeUntilCatch = _vm->_rnd->getRandomNumberRng(10, 60 * 3) * 1000;
	_vm->_vars["bytramtime"] = timeUntilCatch + _vm->getTotalPlayTime();

	// And set the timer too
	installTimer(TIMER(BSpit, ytramTrapTimer), timeUntilCatch);
}
Example #5
0
void TabstractAnim::initAnim(int currStep, int stepNr, int timerStep, bool install) {
  if (install)
      installTimer();
  if (stepNr < 0)
      m_stepCount = duration() / CLIP_TIME;
  else
      m_stepCount = stepNr;
  m_currentStep = currStep;
  timer()->start(timerStep);
  animationRoutine();
}
Example #6
0
void MohawkEngine_Riven::installCardTimer() {
	switch (getCurCardRMAP()) {
	case 0x3a85: // Top of elevator on prison island
		// Handle Catherine hardcoded videos
		installTimer(&catherineIdleTimer, _rnd->getRandomNumberRng(1, 33) * 1000);
		break;
	case 0x77d6: // Sunners, top of stairs
		installTimer(&sunnersTopStairsTimer, 500);
		break;
	case 0x79bd: // Sunners, middle of stairs
		installTimer(&sunnersMidStairsTimer, 500);
		break;
	case 0x7beb: // Sunners, bottom of stairs
		installTimer(&sunnersLowerStairsTimer, 500);
		break;
	case 0xb6ca: // Sunners, shoreline
		installTimer(&sunnersBeachTimer, 500);
		break;
	}
}
Example #7
0
void PSpit::catherineIdleTimer() {
	uint32 &cathCheck = _vm->_vars["pcathcheck"];
	uint32 &cathState = _vm->_vars["acathstate"];
	uint16 movie;

	// Choose a random movie based on where Catherine is
	if (cathCheck == 0) {
		static const int movieList[] = { 5, 6, 7, 8 };
		cathCheck = 1;
		movie = movieList[_vm->_rnd->getRandomNumber(3)];
	} else if (cathState == 1) {
		static const int movieList[] = { 11, 14 };
		movie = movieList[_vm->_rnd->getRandomBit()];
	} else {
		static const int movieList[] = { 9, 10, 12, 13 };
		movie = movieList[_vm->_rnd->getRandomNumber(3)];
	}

	// Update her state if she moves from left/right or right/left, resp.
	if (movie == 5 || movie == 7 || movie == 11 || movie == 14)
		cathState = 2;
	else
		cathState = 1;

	// Play the movie, blocking
	_vm->getCard()->playMovie(movie);
	RivenVideo *video = _vm->_video->openSlot(movie);
	video->playBlocking();

	// Install the next timer for the next video
	uint32 timeUntilNextMovie = _vm->_rnd->getRandomNumber(120) * 1000;

	_vm->_vars["pcathtime"] = timeUntilNextMovie + _vm->getTotalPlayTime();

	installTimer(TIMER(PSpit, catherineIdleTimer), timeUntilNextMovie);
}