Exemple #1
0
void ScummEngine_v72he::resetScummVars() {
	ScummEngine_v70he::resetScummVars();

	VAR(VAR_VIDEO_PERFORMANCE) = 26;

	VAR(VAR_NUM_ROOMS) = _numRooms - 1;
	VAR(VAR_NUM_SCRIPTS) = _numScripts - 1;
	VAR(VAR_NUM_SOUNDS) = _numSounds - 1;
	VAR(VAR_NUM_COSTUMES) = _numCostumes - 1;
	VAR(VAR_NUM_IMAGES) = _numImages - 1;
	VAR(VAR_NUM_CHARSETS) = _numCharsets - 1;
	VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;

	if (_game.heversion <= 74) {
		// Songs are disabled, if sound is disabled.
		VAR(VAR_SOUND_ENABLED) = 1;
	}

	if (_game.heversion == 74) {
		// Uses different values, compared to later HE80+ games.
		if (_game.platform == Common::kPlatformMacintosh) {
			VAR(VAR_PLATFORM) = 3;
		} else {
			VAR(VAR_PLATFORM) = 2;
		}
	}
}
Exemple #2
0
Obj *prim_cons(Env *env, Obj *root, Obj **list)
{
    VAR(args);
    *args = eval_list(env, root, list);
    return make_cell(env, root, &(*args)->car, &(*args)->cdr->car);
}
Exemple #3
0
/* Returns non-zero if tab size changed */
int settabsize(unsigned mode)
{
	switch (mode & MAJORMODE) {
	case CMODE:
		if (Tabsize == VAR(VCTABS))
			return 0;
		return Tabsize = VAR(VCTABS);
	case SHMODE:
		if (Tabsize == VAR(VTABS) && Taboffset == VAR(VSHTABS))
			return 0;
		Taboffset = VAR(VSHTABS);
		return Tabsize = VAR(VTABS);
	case PYMODE:
		if (Tabsize == VAR(VSHTABS) && Taboffset == VAR(VSHTABS))
			return 0;
		return Tabsize = Taboffset = VAR(VSHTABS);
	default:
		if (Tabsize == VAR(VTABS))
			return 0;
		return Tabsize = VAR(VTABS);
	}
}
static int
pass_CallNode(void *self, Pass pass, int level, void *par)
{
   VAR(CallNode, np, self);
   switch (pass)
   {
   case Print:
      fprintfOffs(stdout, level, "CallNode: %s (%d) byref=%d, isC=%d, rest=%d\n", np->name, np->argc, np->byref, np->isC, np->rest);
      break;
   case PrintSrc:
      {
	 VAR(CodestrNode, cp, par);
	 VAR(StrBuf, out, cp->buf);
	 VAR(Node, npp, self);
	 int r, n = 0;

	 putString_StrBuf(out, np->name);
	 putString_StrBuf(out, "(");
	 for (r = first_List(&npp->list); r; r = next_List(&npp->list))
	 {
		 VAR(Node, p, npp->list.current_of_List);
	    if (n)
	       putString_StrBuf(out, ", ");
	    n++;
	    if (p->pass(p, pass, level + 1, par))
	       break;
	 }
	 putString_StrBuf(out, ")");
      }
      return 0;
   case Codegen1:
      {
	 Node *npp = (Node *) np;

	 int r;

	 for (r = first_List(&npp->list); r; r = next_List(&npp->list))
	 {
		 VAR(Node, p, npp->list.current_of_List);
	    if (!strcmp(p->name, "ref"))
	    {
	       Node *np1 = ((RefNode *) p)->expr;

	       if (np1 && !strcmp(np1->name, "fmemvar"))
	       {
		  ((VarNode *) np1)->isArg = 1;
	       }
	    }
	 }
      }
      break;
   case CalcDeep:
      {
	 VAR(Function, fp, par);
	 int deep, ret;

	 np->isC = add_to_undeclared(np->name, &np->func);
	 addDeep(fp, 1);
	 deep = fp->deep_of_Function;
	 ret = pass_Node(self, pass, level, par);
	 fp->deep_of_Function = deep;
	 if (np->func && !np->func->isPublic_of_Function)
	    np->name = np->func->name_of_Function;
	 return ret;
      }
      break;
   case CText:
      {
	 VAR(FILE, out, par);
	 fprintfOffs(out, level, "_clip_push_nil( _mp );\n");
	 pass_Node(self, pass, level - 1, par);
	 switch (np->isC)
	 {
	 case 2:
	    fprintfOffs(out, level, "if ( (_ret=_clip_%s(_mp, clip_%s, %d, %d, %s))) goto _trap_%d;\n", np->node.isTop ? "proc" : "func", np->name, np->argc, np->rest, ref_name(np), np->node.seqNo);
	    break;
	 case 1:
	 case 0:
	    fprintfOffs(out, level,
			"if ( (_ret=_clip_%s_hash(_mp, %ld /* %s */, %d, %d, %s))) goto _trap_%d;\n",
			np->node.isTop ? "proc" : "func", (long) hashstr(np->name), np->name, np->argc, np->rest, ref_name(np), np->node.seqNo);
	    break;
	 }
	 return 0;
      }
      break;
   case OText:
      {
	 VAR(StrBuf, out, par);
	 putByte_StrBuf(out, CLIP_PUSH_NIL);
	 pass_Node(self, pass, level - 1, par);
	 switch (np->isC)
	 {
	 case 2:
	    if (np->node.isTop)
	       putByte_StrBuf(out, np->rest ? CLIP_SPROCR : CLIP_SPROC);
	    else
	       putByte_StrBuf(out, np->rest ? CLIP_SFUNCR : CLIP_SFUNC);
	    putByte_StrBuf(out, np->argc);
	    putShort_StrBuf(out, np->func->mno_of_Function);
	    break;
	 case 1:
	 case 0:
	    if (np->node.isTop)
	       putByte_StrBuf(out, np->rest ? CLIP_PROCR : CLIP_PROC);
	    else
	       putByte_StrBuf(out, np->rest ? CLIP_FUNCR : CLIP_FUNC);
	    putByte_StrBuf(out, np->argc);
	    putLong_StrBuf(out, hashstr(np->name));
	    break;
	 }
	 return 0;
      }
      break;
   case Traverse:
      {
	 VAR(TraversePar, tp, par);
	 tp->func((Node *) self, tp->par);
      }
      break;
   default:
      break;
   }

   return pass_Node(self, pass, level, par);
}
Exemple #5
0
// Read in the config file for the whole application
int ConfigAppLoad()
{
	TCHAR szConfig[MAX_PATH];
	TCHAR szLine[1024];
	FILE* h;
	
#ifdef _UNICODE
	setlocale(LC_ALL, "");
#endif

	CreateConfigName(szConfig);

	if ((h = _tfopen(szConfig, _T("rt"))) == NULL) {
		return 1;
	}

	// Go through each line of the config file
	while (_fgetts(szLine, sizeof(szLine), h)) {
		int nLen = _tcslen(szLine);

		// Get rid of the linefeed at the end
		if (szLine[nLen - 1] == 10) {
			szLine[nLen - 1] = 0;
			nLen--;
		}

#define VAR(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x));			\
  if (szValue) x = _tcstol(szValue, NULL, 0); }
#define VAR64(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x));			\
  if (szValue) x = (long long)_tcstod(szValue, NULL); }
#define FLT(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x));			\
  if (szValue) x = _tcstod(szValue, NULL); }
#define STR(x) { TCHAR* szValue = LabelCheck(szLine,_T(#x) _T(" "));	\
  if (szValue) _tcscpy(x,szValue); }

		VAR(nIniVersion);

		// Emulation
		VAR(bBurnUseASMCPUEmulation);

		// Video
		VAR(nVidDepth); VAR(nVidRefresh);
		VAR(nVidRotationAdjust);

		// horizontal oriented
		VAR(nVidHorWidth); VAR(nVidHorHeight);
		VAR(bVidArcaderesHor);
		VAR(VidPreset[0].nWidth); VAR(VidPreset[0].nHeight);
		VAR(VidPreset[1].nWidth); VAR(VidPreset[1].nHeight);
		VAR(VidPreset[2].nWidth); VAR(VidPreset[2].nHeight);
		VAR(VidPreset[3].nWidth); VAR(VidPreset[3].nHeight);
		VAR(nScreenSizeHor);

		// vertical oriented
		VAR(nVidVerWidth); VAR(nVidVerHeight);
		VAR(bVidArcaderesVer);
		VAR(VidPresetVer[0].nWidth); VAR(VidPresetVer[0].nHeight);
		VAR(VidPresetVer[1].nWidth); VAR(VidPresetVer[1].nHeight);
		VAR(VidPresetVer[2].nWidth); VAR(VidPresetVer[2].nHeight);
		VAR(VidPresetVer[3].nWidth); VAR(VidPresetVer[3].nHeight);
		VAR(nScreenSizeVer);

		VAR(nWindowSize);
		VAR(nWindowPosX); VAR(nWindowPosY);
		VAR(bDoGamma);
		VAR(bVidUseHardwareGamma);
		VAR(bHardwareGammaOnly);
		FLT(nGamma);
		VAR(bVidFullStretch);
		VAR(bVidCorrectAspect);
		
		VAR(bVidAutoSwitchFull);

		VAR(bVidTripleBuffer);
		VAR(bVidVSync);

		VAR(bVidScanlines);
		VAR(nVidScanIntensity);
		VAR(bMonitorAutoCheck);
		VAR(nVidScrnAspectX);
		VAR(nVidScrnAspectY);
		VAR(bForce60Hz);
		VAR(bAlwaysDrawFrames);

		VAR(bVidUsePlaceholder);
		STR(szPlaceHolder);

		VAR(nVidSelect);
		VAR(nVidBlitterOpt[0]);
		VAR64(nVidBlitterOpt[1]);
		VAR(nVidBlitterOpt[2]);
		VAR(nVidBlitterOpt[3]);

		// DirectDraw blitter
		VAR(bVidScanHalf);

		// Direct3D blitter
		VAR(bVidBilinear);
		VAR(bVidScanDelay);
		VAR(bVidScanRotate);
		VAR(bVidScanBilinear);
		VAR(nVidFeedbackIntensity);
		VAR(nVidFeedbackOverSaturation);
		FLT(fVidScreenAngle);
		FLT(fVidScreenCurvature);
		VAR(bVidForce16bit);
		VAR(nVidTransferMethod);

		// DirectX Graphics blitter
		FLT(dVidCubicB);
		FLT(dVidCubicC);

		// Sound
		VAR(nAudSelect);
		VAR(nAudSegCount);
		VAR(nInterpolation);
		VAR(nFMInterpolation);
		VAR(nAudSampleRate[0]);
		VAR(nAudDSPModule[0]);
		VAR(nAudSampleRate[1]);
		VAR(nAudDSPModule[1]);

		// Other
		STR(szLocalisationTemplate);
		STR(szGamelistLocalisationTemplate);

		VAR(nVidSDisplayStatus);
		VAR(nMinChatFontSize);
		VAR(nMaxChatFontSize);

		VAR(bModelessMenu);

		VAR(nSplashTime);

		VAR(bDrvSaveAll);
		VAR(nAppThreadPriority);
		VAR(bAlwaysProcessKeyboardInput);
		VAR(bAutoPause);
		VAR(bSaveInputs);

		VAR(nLoadMenuShowX);
		VAR(nLoadMenuBoardTypeFilter);
		VAR(nLoadMenuGenreFilter);
		VAR(nLoadMenuFamilyFilter);

		STR(szAppRomPaths[0]);
		STR(szAppRomPaths[1]);
		STR(szAppRomPaths[2]);
		STR(szAppRomPaths[3]);
		STR(szAppRomPaths[4]);
		STR(szAppRomPaths[5]);
		STR(szAppRomPaths[6]);
		STR(szAppRomPaths[7]);
		
		STR(szAppPreviewsPath);
		STR(szAppTitlesPath);
		STR(szAppSelectPath);
		STR(szAppVersusPath);
		STR(szAppHowtoPath);
		STR(szAppScoresPath);
		STR(szAppBossesPath);
		STR(szAppGameoverPath);
		STR(szAppFlyersPath);
		STR(szAppMarqueesPath);
		STR(szAppControlsPath);
		STR(szAppCabinetsPath);
		STR(szAppPCBsPath);
		STR(szAppCheatsPath);
		STR(szAppHistoryPath);
		STR(szAppListsPath);
		STR(szAppDatListsPath);
		STR(szAppIpsPath);
		STR(szAppIconsPath);
		STR(szAppArchivesPath);
		STR(szAppHiscorePath);
		
		VAR(nMenuUITheme);
		
		VAR(bNoChangeNumLock);
		
		VAR(bSaveCRoms);
		
		VAR(EnableHiscores);
		
		VAR(nSelectedLanguage);

		VAR(bEnableIcons);
		VAR(nIconsSize);

		STR(szPrevGames[0]);
		STR(szPrevGames[1]);
		STR(szPrevGames[2]);
		STR(szPrevGames[3]);
		STR(szPrevGames[4]);
		STR(szPrevGames[5]);
		STR(szPrevGames[6]);
		STR(szPrevGames[7]);
		STR(szPrevGames[8]);
		STR(szPrevGames[9]);

		// Default Controls
		VAR(nPlayerDefaultControls[0]);
		STR(szPlayerDefaultIni[0]);
		VAR(nPlayerDefaultControls[1]);
		STR(szPlayerDefaultIni[1]);
		VAR(nPlayerDefaultControls[2]);
		STR(szPlayerDefaultIni[2]);
		VAR(nPlayerDefaultControls[3]);
		STR(szPlayerDefaultIni[3]);

#undef STR
#undef FLT
#undef VAR
#undef VAR64
	}

	fclose(h);
	return 0;
}
Exemple #6
0
term hlist(register term H, register term regs, stack wam)
{ no i; cell xval; bp_long ival; byte stamp;
#if TRACE>0
  fprintf(STD_err,"entering hlist, wam=%d, bboard=%d H=%d\n",
    wam,g.shared[BBoardStk].base,H);
  bbcheck(wam);
#endif
  if(!INTEGER(X(1))) return NULL; /* first arg: stamp */
  stamp=(byte)(OUTPUT_INT(X(1)));
  xval=X(2); /* second arg: starting arity of listed terms */
  if(!INTEGER(xval)) return NULL;
  ival=OUTPUT_INT(xval);
  for(i=0; i<HMAX; i++)
    if(hstamp[i]>=stamp && HUSED())
      { term xref=C2T(g.predmark);

        if(hstamp[i]<=RUNTIME)
          { /* gets preds of arity < ival `represented' as g.predmark*/
            if(g.predmark!=htable[i].pred 
                || GETARITY(htable[i].fun)<(no)ival) 
              continue;
              xval=g.predmark;
          }
        else
          { /* gets RUNTIME data of arity > ival */
            cell v=htable[i].val;
			if(NULL==(term)v) 
			  continue;
            if(VAR(v) &&
              !(
                 ONSTACK(g.shared[BBoardStk],v) ||
                 ONSTACK(g.shared[InstrStk],v) /*|| ON(HeapStk,v) */
               )) { 
#if TRACE>0
                fprintf(STD_err,
                 "unexpected data in htable[%d]=>\n<%s,%s>->%s\n",i,
                  smartref(htable[i].pred,wam),
                  smartref(htable[i].fun,wam),
                  smartref(v,wam));
#endif
                /* continue; */
            }      
         
            FDEREF(v);

            if((INTEGER(xval) && ival>0) 
                || VAR(xval)
                || (GETARITY(xval) < (no)ival)
                || xval==g.empty 
             )  
            continue;
            if(COMPOUND(xval))
              xval=T2C(xref);
          }
        IF_OVER("COPY_KEYS",(term *)H,HeapStk,bp_halt(9));
        SAVE_FUN(htable[i].pred);
        SAVE_FUN(htable[i].fun);
#if 0
        ASSERT2(( ATOMIC(xval)
           || ONSTACK(g.shared[BBoardStk],xval)
           || ON(HeapStk,xval)), /* will fail with multiple engines */
        xval);
#endif
        PUSH_LIST(xval);
      }
  PUSH_NIL();
  return H;
}
Exemple #7
0
	void before() {
		for(int i=1;i<reps*history_size;i++)
			VAR(done[i]) = false;
	}
Exemple #8
0
void ScummEngine_v60he::o60_roomOps() {
	int a, b, c, d, e;

	byte subOp = fetchScriptByte();

	switch (subOp) {
	case 172:		// SO_ROOM_SCROLL
		b = pop();
		a = pop();
		if (a < (_screenWidth / 2))
			a = (_screenWidth / 2);
		if (b < (_screenWidth / 2))
			b = (_screenWidth / 2);
		if (a > _roomWidth - (_screenWidth / 2))
			a = _roomWidth - (_screenWidth / 2);
		if (b > _roomWidth - (_screenWidth / 2))
			b = _roomWidth - (_screenWidth / 2);
		VAR(VAR_CAMERA_MIN_X) = a;
		VAR(VAR_CAMERA_MAX_X) = b;
		break;

	case 174:		// SO_ROOM_SCREEN
		b = pop();
		a = pop();
		if (_game.heversion >= 71)
			initScreens(a, _screenHeight);
		else
			initScreens(a, b);
		break;

	case 175:		// SO_ROOM_PALETTE
		d = pop();
		c = pop();
		b = pop();
		a = pop();
		setPalColor(d, a, b, c);
		break;

	case 176:		// SO_ROOM_SHAKE_ON
		setShake(1);
		break;

	case 177:		// SO_ROOM_SHAKE_OFF
		setShake(0);
		break;

	case 179:		// SO_ROOM_INTENSITY
		c = pop();
		b = pop();
		a = pop();
		darkenPalette(a, a, a, b, c);
		break;

	case 180:		// SO_ROOM_SAVEGAME
		_saveTemporaryState = true;
		_saveLoadSlot = pop();
		_saveLoadFlag = pop();
		break;

	case 181:		// SO_ROOM_FADE
		a = pop();
		if (_game.heversion >= 70) {
			// Defaults to 1 but doesn't use fade effects
		} else if (a) {
			_switchRoomEffect = (byte)(a & 0xFF);
			_switchRoomEffect2 = (byte)(a >> 8);
		} else {
			fadeIn(_newEffect);
		}
		break;

	case 182:		// SO_RGB_ROOM_INTENSITY
		e = pop();
		d = pop();
		c = pop();
		b = pop();
		a = pop();
		darkenPalette(a, b, c, d, e);
		break;

	case 183:		// SO_ROOM_SHADOW
		e = pop();
		d = pop();
		c = pop();
		b = pop();
		a = pop();
		if (_game.heversion == 60)
			setShadowPalette(a, b, c, d, e, 0, 256);
		break;

	case 186:		// SO_ROOM_TRANSFORM
		d = pop();
		c = pop();
		b = pop();
		a = pop();
		palManipulateInit(a, b, c, d);
		break;

	case 187:		// SO_CYCLE_SPEED
		b = pop();
		a = pop();
		assertRange(1, a, 16, "o60_roomOps: 187: color cycle");
		_colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0;
		break;

	case 213:		// SO_ROOM_NEW_PALETTE
		a = pop();
		setCurrentPalette(a);
		break;
	case 220:
		a = pop();
		b = pop();
		copyPalColor(a, b);
		break;
	case 221:
		byte buffer[100];
		int len, r;

		convertMessageToString(_scriptPointer, buffer, sizeof(buffer));
		len = resStrLen(_scriptPointer);
		_scriptPointer += len + 1;

		r = convertFilePath(buffer, sizeof(buffer));
		memcpy(_saveLoadFileName, buffer + r, sizeof(buffer) - r);
		debug(1, "o60_roomOps: case 221: filename %s", _saveLoadFileName);

		_saveLoadFlag = pop();
		_saveLoadSlot = 255;
		_saveTemporaryState = true;
		break;
	case 234:		// HE 7.1
		b = pop();
		a = pop();
		swapObjects(a, b);
		break;
	case 236:		// HE 7.1
		b = pop();
		a = pop();
		setRoomPalette(a, b);
		break;
	default:
		error("o60_roomOps: default case %d", subOp);
	}
Exemple #9
0
/**
 * Start a 'scene' by loading the specified room with the given main actor.
 * The actor is placed next to the object indicated by objectNr.
 */
void startScene(int room, Actor* a, int objectNr)
{
	int i, where;

	printf("Loading room %d\n", room);

	stopTalk();

	//fadeOut(_switchRoomEffect2);
	//_newEffect = _switchRoomEffect;

	ScriptSlot *ss = &vm.slot[_currentScript];

	if (_currentScript != 0xFF) {
		if (ss->where == WIO_ROOM || ss->where == WIO_FLOBJECT) {
			if (ss->cutsceneOverride)
				printf("Error: Object %d stopped with active cutscene/override in exit\n", ss->number);

			//nukeArrays(_currentScript);
			_currentScript = 0xFF;
		} else if (ss->where == WIO_LOCAL) {
			if (ss->cutsceneOverride)
				printf("Error: Script %d stopped with active cutscene/override in exit\n", ss->number);

			//nukeArrays(_currentScript);
			_currentScript = 0xFF;
		}
	}

	VAR(VAR_NEW_ROOM) = room;

	runExitScript();

	killScriptsAndResources();


	InitFrameBuffers();

	// For HE80+ games
	for (i = 0; i < 4096; i++)
		_roomVars[i] = 0;

	//nukeArrays(0xFF);

	for (i = 1; i < _numActors; i++) {
		hideActor(&_actors[i]);
	}

		/*for (i = 0; i < 256; i++) {
			_roomPalette[i] = i;
			if (_shadowPalette)
				_shadowPalette[i] = i;
		}*/

	VAR(VAR_ROOM) = room;
	//_fullRedraw = true;

	//_res->increaseResourceCounters();

	_currentRoom = room;
	VAR(VAR_ROOM) = room;

	//if (room >= 0x80 && _game.version < 7 && _game.heversion <= 71)
	//	_roomResource = _resourceMapper[room & 0x7F];
	//else
	_roomResource = room;

	VAR(VAR_ROOM_RESOURCE) = _roomResource;

	//if (room != 0)
	//	ensureResourceLoaded(rtRoom, room);

	//clearRoomObjects();
	ClearObjectFrameBuffer();
	clearDrawObjectQueue();

	if(RoomResource != NULL) freeLFLF(RoomResource);

	if (_currentRoom == 0) {
		RoomResource = NULL;
		//_ENCD_offs = _EXCD_offs = 0;
		//_numObjectsInRoom = 0;
		return;
	}
	else 
	{
		readRoom(HE1_File, &Room, getLFLFOffset(HE0_File, &HE0_Data, room));
		RoomResource = &Room;
		ConvertRoomBackground(HE1_File, RoomResource);
	}

	//setupRoomSubBlocks();
	//resetRoomSubBlocks();

	//initBGBuffers(_roomHeight);

	//resetRoomObjects();

	VAR(VAR_ROOM_WIDTH) = 640;//_roomWidth;
	VAR(VAR_ROOM_HEIGHT) = 480;//_roomHeight;


	/*if (VAR_CAMERA_MIN_X != 0xFF)
		VAR(VAR_CAMERA_MIN_X) = _screenWidth / 2;
	if (VAR_CAMERA_MAX_X != 0xFF)
		VAR(VAR_CAMERA_MAX_X) = _roomWidth - (_screenWidth / 2);

		camera._mode = kNormalCameraMode;
		if (_game.version > 2)
			camera._cur.x = camera._dest.x = _screenWidth / 2;
		camera._cur.y = camera._dest.y = _screenHeight / 2;*/

	if (_roomResource == 0)
		return;

	//memset(gfxUsageBits, 0, sizeof(gfxUsageBits));

	if (a) {
		//where = whereIsObject(objectNr);
		//if (where != WIO_ROOM && where != WIO_FLOBJECT)
		//	printf("Error: startScene: Object %d is not in room %d\n", objectNr,
		//			_currentRoom);
		/*int x, y, dir;
		getObjectXYPos(objectNr, x, y, dir);
		a->putActor(x, y, _currentRoom);
		a->setDirection(dir + 180);
		a->stopActorMoving();
		*/
	}

	showActors();

	_egoPositioned = false;

	runEntryScript();
	
		/*if (a && !_egoPositioned) {
			int x, y;
			getObjectXYPos(objectNr, x, y);
			a->putActor(x, y, _currentRoom);
			a->_moving = 0;
		}*/

	//_doEffect = true;

}
Exemple #10
0
void Map_v2::loadMapObjects(const char *avjFile) {
	uint8 wayPointsCount;
	uint16 var;
	int16 id;
	int16 mapWidth, mapHeight;
	int16 tmp;
	byte *variables;
	uint32 tmpPos;
	uint32 passPos;

	var = _vm->_game->_script->readVarIndex();
	variables = _vm->_inter->_variables->getAddressOff8(var);

	id = _vm->_game->_script->readInt16();

	if (((uint16) id) >= 65520) {
		switch ((uint16) id) {
			case 65530:
				for (int i = 0; i < _mapWidth * _mapHeight; i++)
					_passMap[i] -= READ_VARO_UINT8(var + i);
				break;
			case 65531:
				for (int i = 0; i < _mapWidth * _mapHeight; i++)
					_passMap[i] += READ_VARO_UINT8(var + i);
				break;
			case 65532:
				for (int i = 0; i < _mapWidth * _mapHeight; i++)
					WRITE_VARO_UINT8(var + i, 0x00);
				break;
			case 65533:
				warning("Map_v2::loadMapObjects(): ID == 65533");
				break;
			case 65534:
				_tilesWidth = READ_VARO_UINT8(var);
				_tilesHeight = READ_VARO_UINT8(var + 1);
				_mapWidth = READ_VARO_UINT8(var + 2);
				_mapHeight = READ_VARO_UINT8(var + 3);
				_mapUnknownBool = READ_VARO_UINT8(var + 4) ? true : false;
				break;
			case 65535:
				_passMap = (int8 *)_vm->_inter->_variables->getAddressOff8(var);
				break;
			default:
				warning("Map_v2::loadMapObjects(): ID == %d", (uint16) id);
				break;
		}
		return;
	}

	Resource *resource = _vm->_game->_resources->getResource(id);
	if (!resource)
		return;

	Common::SeekableReadStream &mapData = *resource->stream();

	_mapVersion = mapData.readByte();
	if (_mapVersion == 4) {
		_screenWidth = 640;
		_screenHeight = 400;
	} else if (_mapVersion == 3) {
		_passWidth = 65;
		_screenWidth = 640;
		_screenHeight = 200;
	} else {
		_passWidth = 40;
		_screenWidth = 320;
		_screenHeight = 200;
	}

	_wayPointCount = mapData.readByte();
	_tilesWidth = mapData.readSint16LE();
	_tilesHeight = mapData.readSint16LE();

	_bigTiles = !(_tilesHeight & 0xFF00);
	_tilesHeight &= 0xFF;

	if (_mapVersion == 4) {
		_screenWidth = mapData.readSint16LE();
		_screenHeight = mapData.readSint16LE();
	}

	_mapWidth = _screenWidth / _tilesWidth;
	_mapHeight = _screenHeight / _tilesHeight;

	passPos = mapData.pos();
	mapData.skip(_mapWidth * _mapHeight);

	if (resource->getData()[0] == 1)
		wayPointsCount = _wayPointCount = 40;
	else
		wayPointsCount = _wayPointCount == 0 ? 1 : _wayPointCount;

	delete[] _wayPoints;
	_wayPoints = new WayPoint[wayPointsCount];
	for (int i = 0; i < _wayPointCount; i++) {
		_wayPoints[i].x = mapData.readSByte();
		_wayPoints[i].y = mapData.readSByte();
		_wayPoints[i].notWalkable = mapData.readSByte();
	}

	if (_mapVersion == 4) {
		_mapWidth  = VAR(17);
		_passWidth = _mapWidth;
	}

	// In the original asm, this writes byte-wise into the variables-array
	tmpPos = mapData.pos();
	mapData.seek(passPos);
	if ((variables != 0) &&
	    (variables != _vm->_inter->_variables->getAddressOff8(0))) {

		_passMap = (int8 *)variables;
		mapHeight = _screenHeight / _tilesHeight;
		mapWidth = _screenWidth / _tilesWidth;

		for (int i = 0; i < mapHeight; i++) {
			for (int j = 0; j < mapWidth; j++)
				setPass(j, i, mapData.readSByte());
			_vm->_inter->_variables->getAddressOff8(var + i * _passWidth);
		}
	}
	mapData.seek(tmpPos);

	tmp = mapData.readSint16LE();
	mapData.skip(tmp * 14);
	tmp = mapData.readSint16LE();
	mapData.skip(tmp * 14 + 28);
	tmp = mapData.readSint16LE();
	mapData.skip(tmp * 14);

	_vm->_goblin->_gobsCount = tmp;
	for (int i = 0; i < _vm->_goblin->_gobsCount; i++)
		loadGoblinStates(mapData, i);

	_vm->_goblin->_soundSlotsCount = _vm->_game->_script->readInt16();
	for (int i = 0; i < _vm->_goblin->_soundSlotsCount; i++)
		_vm->_goblin->_soundSlots[i] = _vm->_inter->loadSound(1);

	delete resource;
}
FUNC(void, OS_CODE) tpl_init_pit(void)
{
  TPL_PIT.MCR = PIT_MCR_FRZ;
}


#if 0 /* We're using the generated function tpl_load_pits for now */
/**
 * tpl_load_pit loads the given pit channel with a value and starts the channel
 *
 * @param pit     chan pit channel id to load
 * @param ticks   value to load
 *
 */
FUNC(void, OS_CODE) tpl_load_pit(
  VAR(uint8, AUTOMATIC) chan,
  VAR(uint32, AUTOMATIC) ticks)
{
  /* loads the value */
  PIT_LVR(chan) = ticks;
  /* clear interrupt flag */
  PIT_FR(chan) = PIT_FR_TIF;
  /* start the channel and enable interrupt */
  PIT_CR(chan) = PIT_CR_TEN | PIT_CR_TIE;
}

/**
 * tpl_start_pit starts a given pit channel
 *
 * @param pit     chan pit channel id to start
 *
void getDescriptor(int W, int H, const double *SSH, int x1, int y1, int x2, int y2, int DS1, int DS2, double *descriptor) 
{
        int bbwidth=x2-x1;
        int bbheight=y2-y1;
        
        for(uint a=0;a<DS1;++a) {
                int il=int(x1+a*bbwidth/DS1)-1;
                int iu=int((x1)+(a+1)*bbwidth/DS1);
                
                for(uint b=0;b<DS1;++b) {
                        int jl=int(y1+b*bbheight/DS1)-1;
                        int ju=int((y1)+(b+1)*bbheight/DS1);
                        
                        for(uint c=0;c<DS2;++c) {
                                int xl=int(x1+c*bbwidth/DS2)-1;
                                int xu=int((x1)+(c+1)*bbwidth/DS2);
                                
                                for(uint d=0;d<DS2;++d) {
                                        int yl=int(y1+d*bbheight/DS2)-1;
                                        int yu=int((y1)+(d+1)*bbheight/DS2);

                                        
                                        DBG(10) <<  VAR(il) << " - " << VAR(iu) <<" "
                                               <<  VAR(jl) << " - " << VAR(ju) <<" "
                                               <<  VAR(xl) << " - " << VAR(xu) <<" "
                                               <<  VAR(yl) << " - " << VAR(yu) << std::endl;
                                        
                                                
                                        descriptor[b+a*DS1+d*DS1*DS1+c*DS1*DS1*DS2]
                                                = MATRIX(SSH, ju , iu , yu , xu , H, W, H, W)
                                                
                                                - MATRIX(SSH, jl, iu, yu, xu, H, W, H, W) 
                                                - MATRIX(SSH, ju, il, yu, xu, H, W, H, W) 
                                                - MATRIX(SSH, ju, iu, yl, xu, H, W, H, W) 
                                                - MATRIX(SSH, ju, iu, yu, xl, H, W, H, W) 
                                                
                                                + MATRIX(SSH, jl, il, yu, xu, H, W, H, W) 
                                                + MATRIX(SSH, jl, iu, yl, xu, H, W, H, W) 
                                                + MATRIX(SSH, jl, iu, yu, xl, H, W, H, W) 
                                                + MATRIX(SSH, ju, il, yl, xu, H, W, H, W) 
                                                + MATRIX(SSH, ju, il, yu, xl, H, W, H, W) 
                                                + MATRIX(SSH, ju, iu, yl, xl, H, W, H, W) 
                                                
                                                - MATRIX(SSH, ju, il, yl, xl, H, W, H, W) 
                                                - MATRIX(SSH, jl, iu, yl, xl, H, W, H, W) 
                                                - MATRIX(SSH, jl, il, yu, xl, H, W, H, W) 
                                                - MATRIX(SSH, jl, il, yl, xu, H, W, H, W) 

                                                + MATRIX(SSH , jl, il, yl, xl, H, W, H, W);


                                        DBG(10) << "[" << a << " " << b << " " << c << " " << d <<"]:"
                                                << xl << "-" << xu << " "
                                                << yl << "-" << yu << " " 
                                                << il << "-" << iu << " " 
                                                << jl << "-" << ju << " " 
                                                << " V=" << MATRIX(descriptor, b,a,d,c, DS1,DS1,DS2,DS2)
                                                << std::endl;
                                        
                                        //DBG(10) << VAR(b)<< " " <<VAR(a) << " " <<VAR(d) << " " << VAR(c) << " "<< VAR(MATRIX(descriptor, b,a,d,c, DS1,DS1,DS2,DS2)) << std::endl; 
                                }
                        }
                }
        }
}
qPBReaderConfigDialog::qPBReaderConfigDialog() :
   qPBReaderDialog(0, tr("qPBReader configuration"), Qt::Popup)
{
   TRSCOPE(cfg, "qPBReaderConfigDialog::qPBReaderConfigDialog");

   qPBReaderVerticalWidget * pVert = new qPBReaderVerticalWidget(this);
   addWidget(pVert);

   // ----------------------------------
   // main language
   // ----------------------------------
   {
      _pCBLang = new qPBReaderComboBox(tr("Application language"), this);
      const QStringList & lsLang = qPBReaderLangLists::GetAvailableApplicationLanguages();
      _pCBLang->_pComboBox->addItems(lsLang);
      pVert->AddWidget(_pCBLang);

      int nPos = lsLang.indexOf(qPBReaderConfig::GetApplicationLanguage());
      if (nPos < 0)
      {
         nPos = 0;
      }
      _pCBLang->_pComboBox->setCurrentIndex(nPos);


      QObject::connect(
         _pCBLang->_pComboBox, SIGNAL(currentIndexChanged(const QString &)),
         this                , SLOT  (ApplicationLanguageChanged(const QString &))
      );
   }

   // ----------------------------------
   // magnification
   // ----------------------------------

   {
      _pZoom = new qPBReaderZoomWidgetWithLabel(tr("Font size"), this);
      _pZoom->_pZoomWidget->SetValue(qPBReaderConfig::GetDefaultMagnificationFactor());
      pVert->AddWidget(_pZoom);

      QObject::connect(_pZoom->_pZoomWidget, SIGNAL(Minus()), this, SLOT(MagnificationStepMinus()));
      QObject::connect(_pZoom->_pZoomWidget, SIGNAL(Plus()),  this, SLOT(MagnificationStepPlus()));
   }

   // ----------------------------------
   // margins
   // ----------------------------------

   {
      bool bUseBookMargin = qPBReaderConfig::GetDefaultUseBookMargin();
      Qt::CheckState state = bUseBookMargin ? Qt::Checked : Qt::Unchecked;
      int top, side, bottom;
      qPBReaderConfig::GetDefaultMargins(top, side, bottom);

      // default margin
      _pUseBookMarginCheckBox = new QCheckBox(tr("Use book margin"), pVert);
      _pUseBookMarginCheckBox->setCheckState(state);
      pVert->AddWidget(_pUseBookMarginCheckBox);

      // top margin
      _pTop = new qPBReaderSetValueWidgetWithLabel(tr("Top margin"), this);
      _pTop->_pSetValueWidget->SetText(QString::number(top));
      _pTop->_pSetValueWidget->setEnabled(!bUseBookMargin);
      pVert->AddWidget(_pTop);

      // side margin
      _pSide = new qPBReaderSetValueWidgetWithLabel(tr("Side margin"), this);
      _pSide->_pSetValueWidget->SetText(QString::number(side));
      _pSide->_pSetValueWidget->setEnabled(!bUseBookMargin);
      pVert->AddWidget(_pSide);

      // bottom margin
      _pBottom = new qPBReaderSetValueWidgetWithLabel("Bottom margin", this);
      _pBottom->_pSetValueWidget->SetText(QString::number(bottom));
      _pBottom->_pSetValueWidget->setEnabled(!bUseBookMargin);
      pVert->AddWidget(_pBottom);

      QObject::connect(_pUseBookMarginCheckBox, SIGNAL(stateChanged(int)),
                       this, SLOT(UseBookMarginChanged(int)));

      QObject::connect(_pTop->_pSetValueWidget, SIGNAL(Minus()),
                       this                   , SLOT(TopMarginMinus()));
      QObject::connect(_pTop->_pSetValueWidget, SIGNAL(Plus()),
                       this                   , SLOT(TopMarginPlus()));
      QObject::connect(_pSide->_pSetValueWidget, SIGNAL(Minus()),
                       this                    , SLOT(SideMarginMinus()));
      QObject::connect(_pSide->_pSetValueWidget, SIGNAL(Plus()),
                       this                    , SLOT(SideMarginPlus()));
      QObject::connect(_pBottom->_pSetValueWidget, SIGNAL(Minus()),
                       this                      , SLOT(BottomMarginMinus()));
      QObject::connect(_pBottom->_pSetValueWidget, SIGNAL(Plus()),
                       this                      , SLOT(BottomMarginPlus()));
   }


   // ----------------------------------
   // hyphens
   // ----------------------------------

   {
      QString sHyphenPatt = qPBReaderConfig::GetDefaultHyphenPatternLang();
      bool bUseHyphens = !sHyphenPatt.isEmpty();
      Qt::CheckState state = bUseHyphens ? Qt::Checked : Qt::Unchecked;
      TRACE << VAR(bUseHyphens) << endl;
      const QStringList & lsLang = qPBReaderLangLists::GetAvailableHyphenPatterns();

      // use hyphens

      _pUseHyphens = new QCheckBox(tr("Hyphenation"), pVert);
      _pUseHyphens->setCheckState(state);
      pVert->AddWidget(_pUseHyphens);

      // hyphen lang

      _pHyphenDic = new qPBReaderComboBox(tr("Hyphen dictionary language"), this);
      _pHyphenDic->_pComboBox->addItems(lsLang);
      int nPos = lsLang.indexOf(sHyphenPatt);
      if (nPos < 0)
      {
         nPos = 9; // en-us
      }
      _pHyphenDic->_pComboBox->setCurrentIndex(nPos);
      _pHyphenDic->_pComboBox->setEnabled(bUseHyphens);
      pVert->AddWidget(_pHyphenDic);

      QObject::connect(_pUseHyphens, SIGNAL(stateChanged(int)),
                       this, SLOT(UseHyphensChanged(int)));

      QObject::connect(_pHyphenDic->_pComboBox,
                       SIGNAL(currentIndexChanged(const QString &)),
                       this, SLOT(HyphenDicChanged(const QString &)));
   }

   // ----------------------------------
   // fonts
   // ----------------------------------

   {   
      bool bIgnoreFonts = qPBReaderConfig::GetDefaultIgnoreFonts();

      // ignore book fonts

      _pIgnoreFontsCheckBox = new QCheckBox(tr("Ignore book fonts"), pVert);
      Qt::CheckState state = bIgnoreFonts ? Qt::Checked : Qt::Unchecked;
      _pIgnoreFontsCheckBox->setCheckState(state);
      pVert->AddWidget(_pIgnoreFontsCheckBox);

      // serif

      _pFonts[0] = new qPBReaderFontSelectorWidget(tr("Serif"), pVert);
      QString sSerif = qPBReaderConfig::GetDefaultSerifFont();
      _pFonts[0]->_pFontComboBox->setCurrentFont(QFont(sSerif));
      pVert->AddWidget(_pFonts[0]);

      // sans

      _pFonts[1] = new qPBReaderFontSelectorWidget(tr("Sans-serif"), pVert);
      QString sSans = qPBReaderConfig::GetDefaultSansFont();
      _pFonts[1]->_pFontComboBox->setCurrentFont(QFont(sSans));
      pVert->AddWidget(_pFonts[1]);

      // mono

      _pFonts[2] = new qPBReaderFontSelectorWidget(tr("Monospace"), pVert);
      QString sMono = qPBReaderConfig::GetDefaultMonoFont();
      _pFonts[2]->_pFontComboBox->setCurrentFont(QFont(sMono));
      pVert->AddWidget(_pFonts[2]);

      // std

      _pType = new qPBReaderTypeSelectorWidget(tr("Standard"), pVert);
      int idx = qPBReaderConfig::GetDefaultStandardFont();
      _pType->_pComboBox->setCurrentIndex(idx);
      pVert->AddWidget(_pType);



      QObject::connect(_pIgnoreFontsCheckBox, SIGNAL(stateChanged(int)),
                       this                 , SLOT(IgnoreFontsChanged(int)));

      QObject::connect(_pFonts[0]->_pFontComboBox,
                       SIGNAL(currentFontChanged(const QFont &)),
                       this, SLOT(SelectionChanged()));
      QObject::connect(_pFonts[1]->_pFontComboBox,
                       SIGNAL(currentFontChanged(const QFont &)),
                       this, SLOT(SelectionChanged()));
      QObject::connect(_pFonts[2]->_pFontComboBox,
                       SIGNAL(currentFontChanged(const QFont &)),
                       this, SLOT(SelectionChanged()));
      QObject::connect(_pType->_pComboBox, SIGNAL(currentIndexChanged(int)),
                       this, SLOT(SelectionChanged()));
   }


    QObject::connect(this, SIGNAL(finished(int)), QCoreApplication::instance(), SLOT(quit()));

}
Exemple #14
0
void ScummEngine::resetScummVars() {
	if (_game.heversion < 70 && _game.version <= 6) {
		// VAR_SOUNDCARD modes
		// 0 PC Speaker
		// 1 Tandy
		// 2 CMS
		// 3 AdLib
		// 4 Roland
		switch (_sound->_musicType) {
		case MDT_NONE:
		case MDT_PCSPK:
			VAR(VAR_SOUNDCARD) = 0;
			break;
		case MDT_PCJR:
			VAR(VAR_SOUNDCARD) = 1;
			break;
		case MDT_CMS:
			VAR(VAR_SOUNDCARD) = 2;
			break;
		case MDT_ADLIB:
			VAR(VAR_SOUNDCARD) = 3;
			break;
		default:
			if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA || (_game.id == GID_LOOM && _game.version == 3))
			   &&  (_game.platform == Common::kPlatformDOS)) {
				VAR(VAR_SOUNDCARD) = 4;
			} else {
				VAR(VAR_SOUNDCARD) = 3;
			}
			break;
		}

		if (_game.platform == Common::kPlatformFMTowns)
			VAR(VAR_VIDEOMODE) = 42;
		// Value only used by the Macintosh version of Indiana Jones and the Last Crusade
		else if (_game.platform == Common::kPlatformMacintosh && _game.version == 3)
			VAR(VAR_VIDEOMODE) = 50;
		// Value only used by the Amiga version of Monkey Island 2
		else if (_game.platform == Common::kPlatformAmiga)
			VAR(VAR_VIDEOMODE) = 82;
		else if (_renderMode == Common::kRenderCGA)
			VAR(VAR_VIDEOMODE) = 4;
		else if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG)
			VAR(VAR_VIDEOMODE) = 30;
		else if (_renderMode == Common::kRenderEGA)
			VAR(VAR_VIDEOMODE) = 13;
		else
			VAR(VAR_VIDEOMODE) = 19;

		if (_game.platform == Common::kPlatformMacintosh && (_game.features & GF_OLD_BUNDLE)) {
			// Set screen size for the Macintosh version of Indy3/Loom
			VAR(39) = 320;
		}
		if (_game.platform == Common::kPlatformDOS && _game.id == GID_LOOM && _game.version == 3) {
			// Set number of sound resources
			VAR(39) = 80;
		}

		if (_game.id == GID_LOOM || _game.version >= 4)
			VAR(VAR_HEAPSPACE) = 1400;
		if (_game.version >= 4)
			VAR(VAR_FIXEDDISK) = 1;
		if (_game.version >= 5)
			VAR(VAR_INPUTMODE) = 3;
		if (_game.version == 6)
			VAR(VAR_V6_EMSSPACE) = 10000;

		if (_game.heversion >= 60) {
			// Set fast speed, to enable all animations
			VAR(VAR_MACHINE_SPEED) = 2;

			VAR(VAR_SOUNDPARAM) = 1;  // Soundblaster for music
			VAR(VAR_SOUNDPARAM2) = 1; // Soundblaster for sound effects
		}
	}

	if (VAR_ROOM_WIDTH != 0xFF && VAR_ROOM_HEIGHT != 0xFF) {
		VAR(VAR_ROOM_WIDTH) = _screenWidth;
		VAR(VAR_ROOM_HEIGHT) = _screenHeight;
	}

	if (VAR_DEBUGMODE != 0xFF) {
		VAR(VAR_DEBUGMODE) = _debugMode;
		if (_game.heversion >= 80 && _debugMode)
			VAR(85) = 1;
	}

	if (VAR_FADE_DELAY != 0xFF)
		VAR(VAR_FADE_DELAY) = 3;

	VAR(VAR_CHARINC) = 4;
	setTalkingActor(0);
}
Exemple #15
0
Model::Model(const std::string& filename, VARAreaRef varStatic) {
    // This loads an IFS file.  Note that we could have used G3D::IFSModel::load to
    // parse the file for us.

    // file := 
    //    fileheader +
    //    vertexheader +
    //    vertex* +
    //    triheader +
    //    tri*
    //
    //  fileheader   := (string32) "IFS" + (float32)1.0 + (string32)modelname
    //  vertexheader := (string32) "VERTICES" + (uint32)numVertices
    //  vertex       := (float32)x + (float32)y + (float32)z
    //  triheader    := (string32)"TRIANGLES" + (uint32)numFaces
    //  tri          := (uint32)v0 + (uint32)v1 + (uint32)v2

    Log::common()->println(std::string("Loading ") + filename);

    BinaryInput b(filename, G3D_LITTLE_ENDIAN);

    std::string fmt         = b.readString32();
    float       version     = b.readFloat32();
    (void) version;
    std::string name        = b.readString32();

    debugAssert(fmt     == "IFS");
    debugAssert(version == 1.0);

    std::string vertexHeader = b.readString32();

    // Load the vertices
    vertex.resize(b.readUInt32());

    for (int v = 0; v < vertex.size(); ++v) {
        vertex[v] = b.readVector3() * 5;
    }

    // Per-vertex normals
    normal.resize(vertex.size());

    // Load the triangles
    std::string triHeader   = b.readString32();

    int numTris = b.readUInt32();

    for (int t = 0; t < numTris; ++t) {
        int v0 = b.readUInt32();
        int v1 = b.readUInt32();
        int v2 = b.readUInt32();

        // Compute the non-unit face normal
        Vector3 faceNormal = 
          (vertex[v1] - vertex[v0]).cross( 
           (vertex[v2] - vertex[v0]));

        normal[v0] += faceNormal;
        normal[v1] += faceNormal;
        normal[v2] += faceNormal;

        // Record the indices
        index.append(v0, v1, v2);
    }

    // Rescale the normals to unit length
    for (int n = 0; n < normal.size(); ++n) {
        normal[n] = normal[n].direction();
    }

    varVertex = VAR(vertex, varStatic);
    varNormal = VAR(normal, varStatic);
    debugAssertGLOk();    
}
Exemple #16
0
inline void litsettrue(satinstance sati,int l) { VARVALUE(VAR(l)) = VALUE(l); }
Exemple #17
0
};

#define MAX_KINDS (2)

struct psc_es1 {
  // parameters
  double om_pe;
  double om_ce;
  struct psc_es1_species species[MAX_KINDS];
};

#define to_psc_es1(psc) mrc_to_subobj(psc, struct psc_es1)

#define VAR(x) (void *)offsetof(struct psc_es1, x)
static struct param psc_es1_descr[] = {
  { "om_pe"         , VAR(om_pe)            , PARAM_DOUBLE(1.)            },
  { "om_ce"         , VAR(om_ce)            , PARAM_DOUBLE(2.)            },

  { "nlg_1"         , VAR(species[0].nlg)   , PARAM_INT(1)                },
  { "q_1"           , VAR(species[0].q)     , PARAM_DOUBLE(-1.)           },
  { "m_1"           , VAR(species[0].m)     , PARAM_DOUBLE(1.)            },
  { "mode_1"        , VAR(species[0].mode)  , PARAM_DOUBLE(1.)            },
  { "v0_1"          , VAR(species[0].v0)    , PARAM_DOUBLE(0.)            },
  { "x1_1"          , VAR(species[0].x1)    , PARAM_DOUBLE(.001)          },
  { "v1_1"          , VAR(species[0].v1)    , PARAM_DOUBLE(0.)            },
  { "thetax_1"      , VAR(species[0].thetax), PARAM_DOUBLE(0.)            },
  { "thetav_1"      , VAR(species[0].thetav), PARAM_DOUBLE(0.)            },

  { "nlg_2"         , VAR(species[1].nlg)   , PARAM_INT(1)                },
  { "q_2"           , VAR(species[1].q)     , PARAM_DOUBLE(-1.)           },
  { "m_2"           , VAR(species[1].m)     , PARAM_DOUBLE(1.)            },
Exemple #18
0
inline void litunset(satinstance sati,int l) { VARVALUE(VAR(l)) = UNASS; }
  virtual double distance(const BaseFeature* queryFeature, const BaseFeature* databaseFeature) {
    double result;
    
    const FaceFeature* db=dynamic_cast<const FaceFeature*>(databaseFeature);
    const FaceFeature* query=dynamic_cast<const FaceFeature*>(queryFeature);
    
    if(db && query) {
      DBG(55) << VAR(query->numberOfVectors()) << " " << VAR(db->numberOfVectors()) << ::std::endl;
      if(query->numberOfVectors() ==0) {
        // no query face
        result=0.0;
      } else {
        
        //using all faces in query image

        if(useAll) {
          if(db->numberOfVectors()==0) {
            //current database image has no face
            result=0.0;
            for(uint i=0;i<query->numberOfVectors();++i) {
              double tmp=0.0;
              const vector<double> &f=query->operator[](i);
              for(uint i=0;i<f.size();++i) {
                tmp+=f[i]*f[i];
              }
              result+=tmp;
            }
          } else {
            //database and query image have faces

            result=0.0;
            for(uint i=0;i<query->numberOfVectors();++i) {
              const vector<double> &f=query->operator[](i);

              double tmpres=::std::numeric_limits<double>::max();
              
              for(uint j=0;j<db->numberOfVectors();++j) {
                double tmp=0.0;              
                
                const vector<double> &fd=db->operator[](j);
                for(uint d=0;d<f.size();++d) {
                  double t=f[d]-fd[d];
                  tmp+=t*t;
                }
                if(tmp<tmpres) tmpres=tmp;
              }
              result+=tmpres;
            }
          }          
        } else {
          // using only best match from query image
          if(db->numberOfVectors()==0) {
            //current database image has no face
            result=0.0;
            for(uint i=0;i<query->numberOfVectors();++i) {
              double tmp=0.0;
              const vector<double> &f=query->operator[](i);
              for(uint i=0;i<f.size();++i) {
                tmp+=f[i]*f[i];
              }
              if(tmp>result) result=tmp;
            }
          } else {
            //database and query image have faces
            result=::std::numeric_limits<double>::max();
            for(uint i=0;i<query->numberOfVectors();++i) {
              const vector<double> &f=query->operator[](i);
              
              for(uint j=0;j<db->numberOfVectors();++j) {
                double tmp=0.0;              
                
                const vector<double> &fd=db->operator[](j);
                for(uint d=0;d<f.size();++d) {
                  double t=f[d]-fd[d];
                  tmp+=t*t;
                }
                if(tmp<result) result=tmp;
              }
            }
          }
        }
      }
      return result;
    } else {
      ERR << "Features not comparable" << ::std::endl;
      return -1 ;
    }
  }
Exemple #20
0
inline int litunsetp(satinstance sati,int l) { return varunsetp(sati,VAR(l)); }
Exemple #21
0
	void after() {
		for(int i=1;i<reps*history_size;i++)
			assert(VAR(done[i]));
	}
Exemple #22
0
inline int littruep(satinstance sati,int l) { return (VARVALUE(VAR(l)) == VALUE(l)); }
Exemple #23
0
// Write out the config file for the whole application
int ConfigAppSave()
{
	TCHAR szConfig[MAX_PATH];
	FILE *h;

	if (bCmdOptUsed) {
		return 1;
	}
	
#ifdef _UNICODE
	setlocale(LC_ALL, "");
#endif

	CreateConfigName(szConfig);

	if ((h = _tfopen(szConfig, _T("wt"))) == NULL) {
		return 1;
	}

	// Write title
	_ftprintf(h, _T("// ") _T(APP_TITLE) _T(" v%s --- Main Config File\n\n"), szAppBurnVer);
	_ftprintf(h, _T("// Don't edit this file manually unless you know what you're doing\n"));
	_ftprintf(h, _T("// ") _T(APP_TITLE) _T(" will restore default settings when this file is deleted\n"));

#define VAR(x) _ftprintf(h, _T(#x) _T(" %d\n"),  x)
#define VAR64(x) _ftprintf(h, _T(#x) _T(" %lf\n"),  (float)x)
#define FLT(x) _ftprintf(h, _T(#x) _T(" %lf\n"), x)
#define STR(x) _ftprintf(h, _T(#x) _T(" %s\n"),  x)

	_ftprintf(h, _T("\n// The application version this file was saved from\n"));
	// We can't use the macros for this!
	_ftprintf(h, _T("nIniVersion 0x%06X"), nBurnVer);

	_ftprintf(h, _T("\n\n\n"));
	_ftprintf(h, _T("// --- emulation --------------------------------------------------------------\n"));

	_ftprintf(h, _T("\n// If non-zero, use A68K for MC68000 emulation\n"));
	VAR(bBurnUseASMCPUEmulation);

	_ftprintf(h, _T("\n\n\n"));
	_ftprintf(h, _T("// --- Video ------------------------------------------------------------------\n"));

	// Horizontal oriented
	_ftprintf(h, _T("\n// (Horizontal Oriented) The display mode to use for fullscreen\n"));
	VAR(nVidHorWidth); VAR(nVidHorHeight);	
	_ftprintf(h, _T("\n// (Horizontal Oriented) If non-zero, use the same fullscreen resolution as the original arcade game\n"));
	VAR(bVidArcaderesHor);
	_ftprintf(h, _T("\n// (Horizontal Oriented) The preset resolutions appearing in the menu\n"));
	VAR(VidPreset[0].nWidth); VAR(VidPreset[0].nHeight);
	VAR(VidPreset[1].nWidth); VAR(VidPreset[1].nHeight);
	VAR(VidPreset[2].nWidth); VAR(VidPreset[2].nHeight);
	VAR(VidPreset[3].nWidth); VAR(VidPreset[3].nHeight);
	_ftprintf(h, _T("\n// (Horizontal Oriented) Full-screen size (0 = use display mode variables)\n"));
	VAR(nScreenSizeHor);

	// Vertical oriented
	_ftprintf(h, _T("\n// (Vertical Oriented) The display mode to use for fullscreen\n"));
	VAR(nVidVerWidth); VAR(nVidVerHeight);
	_ftprintf(h, _T("\n// (Vertical Oriented) If non-zero, use the same fullscreen resolution as the original arcade game\n"));
	VAR(bVidArcaderesVer);
	_ftprintf(h, _T("\n// (Vertical Oriented) The preset resolutions appearing in the menu\n"));
	VAR(VidPresetVer[0].nWidth); VAR(VidPresetVer[0].nHeight);
	VAR(VidPresetVer[1].nWidth); VAR(VidPresetVer[1].nHeight);
	VAR(VidPresetVer[2].nWidth); VAR(VidPresetVer[2].nHeight);
	VAR(VidPresetVer[3].nWidth); VAR(VidPresetVer[3].nHeight);
	_ftprintf(h, _T("\n// (Vertical Oriented) Full-screen size (0 = use display mode variables)\n"));
	VAR(nScreenSizeVer);

	_ftprintf(h, _T("\n// Full-screen bit depth\n"));
	VAR(nVidDepth);
	_ftprintf(h, _T("\n// Specify the refresh rate, 0 = default (changing this will not work with many video cards)\n"));
	VAR(nVidRefresh);
	_ftprintf(h, _T("\n// If non-zero, do not rotate the graphics for vertical games\n"));
	VAR(nVidRotationAdjust);
	_ftprintf(h, _T("\n// Initial window size (0 = autosize)\n"));
	VAR(nWindowSize);
	_ftprintf(h, _T("\n// Window position\n"));
	VAR(nWindowPosX); VAR(nWindowPosY);
	_ftprintf(h, _T("\n// If non-zero, perform gamma correction\n"));
	VAR(bDoGamma);
	_ftprintf(h, _T("\n// If non-zero, use the video hardware to correct gamma\n"));
	VAR(bVidUseHardwareGamma);
	_ftprintf(h, _T("\n// If non-zero, don't fall back on software gamma correction\n"));
	VAR(bHardwareGammaOnly);
	_ftprintf(h, _T("\n// Gamma to correct with\n"));
	FLT(nGamma);
	_ftprintf(h, _T("\n// If non-zero, auto-switch to fullscreen after loading game\n"));
	VAR(bVidAutoSwitchFull);
	_ftprintf(h, _T("\n// If non-zero, allow stretching of the image to any size\n"));
	VAR(bVidFullStretch);
	_ftprintf(h, _T("\n// If non-zero, stretch the image to the largest size preserving aspect ratio\n"));
	VAR(bVidCorrectAspect);
	_ftprintf(h, _T("\n// If non-zero, try to use a triple buffer in fullscreen\n"));
	VAR(bVidTripleBuffer);
	_ftprintf(h, _T("\n// If non-zero, try to synchronise blits with the display\n"));
	VAR(bVidVSync);
	_ftprintf(h, _T("\n// Transfer method:  0 = blit from system memory / use driver/DirectX texture management;\n"));
	_ftprintf(h, _T("//                   1 = copy to a video memory surface, then use bltfast();\n"));
	_ftprintf(h, _T("//                  -1 = autodetect for DirectDraw, equals 1 for Direct3D\n"));
	VAR(nVidTransferMethod);
	_ftprintf(h, _T("\n// If non-zero, draw scanlines to simulate a low-res monitor\n"));
	VAR(bVidScanlines);
	_ftprintf(h, _T("\n// Maximum scanline intensity\n"));
	VAR(nVidScanIntensity);
	_ftprintf(h, _T("\n// If non-zero, rotate scanlines and RGB effects for rotated games\n"));
	VAR(bVidScanRotate);
	_ftprintf(h, _T("\n// The selected blitter module\n"));
	VAR(nVidSelect);
	_ftprintf(h, _T("\n// Options for the blitter modules\n"));
	VAR(nVidBlitterOpt[0]);
	VAR64(nVidBlitterOpt[1]);
	VAR(nVidBlitterOpt[2]);
	VAR(nVidBlitterOpt[3]);
	_ftprintf(h, _T("\n// If non-zero, attempt to auto-detect the monitor aspect ratio\n"));
	VAR(bMonitorAutoCheck);
	_ftprintf(h, _T("\n// The aspect ratio of the monitor\n"));
	VAR(nVidScrnAspectX);
	VAR(nVidScrnAspectY);
	_ftprintf(h, _T("\n// If non-zero, force all games to use a 60Hz refresh rate\n"));
	VAR(bForce60Hz);
	_ftprintf(h, _T("\n// If non-zero, skip frames when needed to keep the emulation running at full speed\n"));
	VAR(bAlwaysDrawFrames);

	_ftprintf(h, _T("\n// If non-zero, use a placeholder image when no game is loaded\n"));
	VAR(bVidUsePlaceholder);
	_ftprintf(h, _T("\n// The filename of the placeholder image to use (empty filename = use built-in)\n"));
	STR(szPlaceHolder);

	_ftprintf(h, _T("\n"));
	_ftprintf(h, _T("// --- DirectDraw blitter module settings -------------------------------------\n"));
	_ftprintf(h, _T("\n// If non-zero, draw scanlines at 50%% intensity\n"));
	VAR(bVidScanHalf);
	_ftprintf(h, _T("\n"));
	_ftprintf(h, _T("// --- Direct3D 7 blitter module settings -------------------------------------\n"));
	_ftprintf(h, _T("\n// If non-zero, use bi-linear filtering to display the image\n"));
	VAR(bVidBilinear);
	_ftprintf(h, _T("\n// If non-zero, simulate slow phosphors (feedback)\n"));
	VAR(bVidScanDelay);
	_ftprintf(h, _T("\n// If non-zero, use bi-linear filtering for the scanlines\n"));
	VAR(bVidScanBilinear);
	_ftprintf(h, _T("\n// Feedback amount for slow phosphor simulation\n"));
	VAR(nVidFeedbackIntensity);
	_ftprintf(h, _T("\n// Oversaturation amount for slow phosphor simulation\n"));
	VAR(nVidFeedbackOverSaturation);
	_ftprintf(h, _T("\n// Angle at wich the emulated screen is tilted (in radians)\n"));
	FLT(fVidScreenAngle);
	_ftprintf(h, _T("\n// Angle of the sphere segment used for the 3D screen (in radians)\n"));
	FLT(fVidScreenCurvature);
	_ftprintf(h, _T("\n// If non-zero, force 16 bit emulation even in 32-bit screenmodes\n"));
	VAR(bVidForce16bit);
	_ftprintf(h, _T("\n"));
	_ftprintf(h, _T("// --- DirectX Graphics 9 blitter module settings -----------------------------\n"));
	_ftprintf(h, _T("\n// The filter parameters for the cubic filter\n"));
	FLT(dVidCubicB);
	FLT(dVidCubicC);

	_ftprintf(h, _T("\n\n\n"));
	_ftprintf(h, _T("// --- Sound ------------------------------------------------------------------\n"));
	_ftprintf(h, _T("\n// The selected audio plugin\n"));
	VAR(nAudSelect);
	_ftprintf(h, _T("\n// Number of frames in sound buffer (= sound lag)\n"));
	VAR(nAudSegCount);
	_ftprintf(h, _T("\n// The order of PCM/ADPCM interpolation\n"));
	VAR(nInterpolation);
	_ftprintf(h, _T("\n// The order of FM interpolation\n"));
	VAR(nFMInterpolation);
	_ftprintf(h, _T("\n"));
	_ftprintf(h, _T("// --- DirectSound plugin settings --------------------------------------------\n"));
	_ftprintf(h, _T("\n// Sample rate\n"));
	VAR(nAudSampleRate[0]);
	_ftprintf(h, _T("\n// DSP module to use for sound enhancement: 0 = none, 1 = low-pass filter\n"));
	VAR(nAudDSPModule[0]);
	_ftprintf(h, _T("\n"));
	_ftprintf(h, _T("// --- XAudio2 plugin settings ------------------------------------------------\n"));
	_ftprintf(h, _T("\n// Sample rate\n"));
	VAR(nAudSampleRate[1]);
	_ftprintf(h, _T("\n// DSP module to use for sound enhancement: 0 = none, 1 = low-pass filter, 2 = reverb\n"));
	VAR(nAudDSPModule[1]);

	_ftprintf(h, _T("\n\n\n"));
	_ftprintf(h, _T("// --- UI ---------------------------------------------------------------------\n"));

	_ftprintf(h, _T("\n// Filename of the active UI translation template\n"));
	STR(szLocalisationTemplate);
	
	_ftprintf(h, _T("\n// Filename of the active game list translation template\n"));
	STR(szGamelistLocalisationTemplate);

	_ftprintf(h, _T("\n// 1 = display pause/record/replay/kaillera icons in the upper right corner of the display\n"));
	VAR(nVidSDisplayStatus);
	_ftprintf(h, _T("\n// Minimum height (in pixels) of the font used for the Kaillera chat function (used for arcade resolution)\n"));
	VAR(nMinChatFontSize);
	_ftprintf(h, _T("\n// Maximum height (in pixels) of the font used for the Kaillera chat function (used for 1280x960 or higher).\n"));
	VAR(nMaxChatFontSize);

	_ftprintf(h, _T("\n// Make the menu modeless\n"));
	VAR(bModelessMenu);

	_ftprintf(h, _T("\n// Minimum length of time to display the splash screen (in milliseconds)\n"));
	VAR(nSplashTime);

	_ftprintf(h, _T("\n// If non-zero, load and save all ram (the state)\n"));
	VAR(bDrvSaveAll);
	_ftprintf(h, _T("\n// The thread priority for the application. Do *NOT* edit this manually\n"));
	VAR(nAppThreadPriority);
	_ftprintf(h, _T("\n// If non-zero, process keyboard input even when the application loses focus\n"));
	VAR(bAlwaysProcessKeyboardInput);
	_ftprintf(h, _T("\n// If non-zero, pause when the application loses focus\n"));
	VAR(bAutoPause);
	_ftprintf(h, _T("\n// If non-zero, save the inputs for each game\n"));
	VAR(bSaveInputs);
	_ftprintf(h, _T("\n"));
	_ftprintf(h, _T("// --- Load Game Dialog -------------------------------------------------------\n"));
	_ftprintf(h, _T("\n// Load game dialog options\n"));
	VAR(nLoadMenuShowX);
	
	_ftprintf(h, _T("\n// Load game dialog board type filter options\n"));
	VAR(nLoadMenuBoardTypeFilter);
	
	_ftprintf(h, _T("\n// Load game dialog genre filter options\n"));
	VAR(nLoadMenuGenreFilter);
	
	_ftprintf(h, _T("\n// Load game dialog family filter options\n"));
	VAR(nLoadMenuFamilyFilter);

	_ftprintf(h, _T("\n// The paths to search for rom zips (include trailing backslash)\n"));
	STR(szAppRomPaths[0]);
	STR(szAppRomPaths[1]);
	STR(szAppRomPaths[2]);
	STR(szAppRomPaths[3]);
	STR(szAppRomPaths[4]);
	STR(szAppRomPaths[5]);
	STR(szAppRomPaths[6]);
	STR(szAppRomPaths[7]);
	
	_ftprintf(h, _T("\n// The paths to search for support files (include trailing backslash)\n"));
	STR(szAppPreviewsPath);
	STR(szAppTitlesPath);
	STR(szAppSelectPath);
	STR(szAppVersusPath);
	STR(szAppHowtoPath);
	STR(szAppScoresPath);
	STR(szAppBossesPath);
	STR(szAppGameoverPath);
	STR(szAppFlyersPath);
	STR(szAppMarqueesPath);
	STR(szAppControlsPath);
	STR(szAppCabinetsPath);
	STR(szAppPCBsPath);
	STR(szAppCheatsPath);
	STR(szAppHistoryPath);
	STR(szAppListsPath);
	STR(szAppDatListsPath);
	STR(szAppIpsPath);
	STR(szAppIconsPath);
	STR(szAppArchivesPath);
	STR(szAppHiscorePath);

	_ftprintf(h, _T("\n\n\n"));
	_ftprintf(h, _T("// --- miscellaneous ---------------------------------------------------------\n"));

	_ftprintf(h, _T("\n// If non-zero, use an image menu theme.\n"));
	VAR(nMenuUITheme);
	
	_ftprintf(h, _T("\n// If non-zero, don't change the status of the Num Lock key.\n"));
	VAR(bNoChangeNumLock);
	
	_ftprintf(h, _T("\n// If non-zero, write the decrypted Neo-Geo 'C' roms to disc.\n"));
	VAR(bSaveCRoms);
	
	_ftprintf(h, _T("\n// If non-zero, enable high score saving support.\n"));
	VAR(EnableHiscores);
	
	_ftprintf(h, _T("\n// The language index to use for the IPS Patch Manager dialog.\n"));
	VAR(nSelectedLanguage);

	_ftprintf(h, _T("\n// If non-zero, display drivers icons.\n"));
	VAR(bEnableIcons);

	_ftprintf(h, _T("\n// Specify icons display size, 0 = 16x16 , 1 = 24x24, 2 = 32x32.\n"));
	VAR(nIconsSize);

	_ftprintf(h, _T("\n// Previous games list.\n"));
	STR(szPrevGames[0]);
	STR(szPrevGames[1]);
	STR(szPrevGames[2]);
	STR(szPrevGames[3]);
	STR(szPrevGames[4]);
	STR(szPrevGames[5]);
	STR(szPrevGames[6]);
	STR(szPrevGames[7]);
	STR(szPrevGames[8]);
	STR(szPrevGames[9]);
	
	_ftprintf(h, _T("\n// Player default controls, number is the index of the configuration in the input dialog\n"));
	VAR(nPlayerDefaultControls[0]);
	STR(szPlayerDefaultIni[0]);
	VAR(nPlayerDefaultControls[1]);
	STR(szPlayerDefaultIni[1]);
	VAR(nPlayerDefaultControls[2]);
	STR(szPlayerDefaultIni[2]);
	VAR(nPlayerDefaultControls[3]);
	STR(szPlayerDefaultIni[3]);

	_ftprintf(h, _T("\n\n\n"));

#undef STR
#undef FLT
#undef VAR

	fclose(h);
	return 0;
}
Exemple #24
0
inline int litfalsep(satinstance sati,int l) { return (VARVALUE(VAR(l)) == 1-VALUE(l)); }
Exemple #25
0
Obj *prim_cdr(Env *env, Obj *root, Obj **list)
{
    VAR(args);
    *args = eval_list(env, root, list);
    return (*args)->car->cdr;
}
Exemple #26
0
  VAR(#member, conftype, member, initvalue)

/** Array of "state" variables saved to the ~/.tor/state file. */
static config_var_t state_vars_[] = {
  /* Remember to document these in state-contents.txt ! */

  V(AccountingBytesReadInInterval,    MEMUNIT,  NULL),
  V(AccountingBytesWrittenInInterval, MEMUNIT,  NULL),
  V(AccountingExpectedUsage,          MEMUNIT,  NULL),
  V(AccountingIntervalStart,          ISOTIME,  NULL),
  V(AccountingSecondsActive,          INTERVAL, NULL),
  V(AccountingSecondsToReachSoftLimit,INTERVAL, NULL),
  V(AccountingSoftLimitHitAt,         ISOTIME,  NULL),
  V(AccountingBytesAtSoftLimit,       MEMUNIT,  NULL),

  VAR("EntryGuard",              LINELIST_S,  EntryGuards,             NULL),
  VAR("EntryGuardDownSince",     LINELIST_S,  EntryGuards,             NULL),
  VAR("EntryGuardUnlistedSince", LINELIST_S,  EntryGuards,             NULL),
  VAR("EntryGuardAddedBy",       LINELIST_S,  EntryGuards,             NULL),
  VAR("EntryGuardPathBias",      LINELIST_S,  EntryGuards,             NULL),
  VAR("EntryGuardPathUseBias",   LINELIST_S,  EntryGuards,             NULL),
  V(EntryGuards,                 LINELIST_V,  NULL),

  VAR("TransportProxy",               LINELIST_S, TransportProxies, NULL),
  V(TransportProxies,                 LINELIST_V, NULL),

  V(HidServRevCounter,            LINELIST, NULL),

  V(BWHistoryReadEnds,                ISOTIME,  NULL),
  V(BWHistoryReadInterval,            UINT,     "900"),
  V(BWHistoryReadValues,              CSV,      ""),
Exemple #27
0
void add_primitive(Env *env, Obj *root, char *name, Primitive *fn) {
    VAR(prim);
    *prim = make_primitive(env, root, fn);
    add_var(env, root, name, prim);
}
static int
pass_OrNode(void *self, Pass pass, int level, void *par)
{
   VAR(OpNode, np, self);
   int no = np->op;

   switch (pass)
   {
   case Print:
      fprintfOffs(stdout, level, "OrNode label=%d\n", no);
      break;
   case PrintSrc:
      {
	 VAR(CodestrNode, cp, par);
	 VAR(StrBuf, out, cp->buf);
	 putString_StrBuf(out, "(");
	 np->expr1->pass(np->expr1, pass, level + 1, par);
	 putString_StrBuf(out, ".OR.");
	 np->expr2->pass(np->expr2, pass, level + 1, par);
	 putString_StrBuf(out, ")");
      }
      return 0;
   case CalcDeep:
      break;
   case CText:
      {
	 VAR(FILE, out, par);
	 np->expr1->pass(np->expr1, pass, level, par);
	 fprintfOffs(out, level, "if ((_ret=_clip_tcond( _mp, &_if ))) goto _trap_%d;\n", np->node.seqNo);
	 fprintfOffs(out, level, "if ( _if ) goto _endor_%d;\n", no);
	 fprintfOffs(out, level, "_clip_pop(_mp);\n");
	 np->expr2->pass(np->expr2, pass, level, par);
	 fprintfOffs(out, level, "_endor_%d:\n", no);
      }
      return 0;
   case OText:
      {
	 VAR(StrBuf, out, par);
	 int jmp;

	 np->expr1->pass(np->expr1, pass, level, par);

	 putByte_StrBuf(out, CLIP_ITCOND);
	 jmp = out->ptr_of_StrBuf - out->buf_of_StrBuf;
	 putShort_StrBuf(out, 0);

	 putByte_StrBuf(out, CLIP_POP);
	 np->expr2->pass(np->expr2, pass, level, par);
	 SETSHORT(out, jmp, (out->ptr_of_StrBuf - out->buf_of_StrBuf) - (jmp + sizeof(short)));

      }
      return 0;
   case Traverse:
      {
	 VAR(TraversePar, tp, par);
	 tp->func((Node *) self, tp->par);
      }
      break;
   default:
      break;
   }
   np->expr1->pass(np->expr1, pass, level + 1, par);
   np->expr2->pass(np->expr2, pass, level + 1, par);
   return 0;
}
Exemple #29
0
  double Ti_over_Te;
  double lambda; // in d_i
  double pert;
  double eta0;

  // normalized quantities
  double LLL; // lambda in d_e
  double AA; // perturbation amplitude (from pert)
  double Te, Ti;
};

#define to_psc_harris(psc) mrc_to_subobj(psc, struct psc_harris)

#define VAR(x) (void *)offsetof(struct psc_harris, x)
static struct param psc_harris_descr[] = {
  { "B0"            , VAR(B0)              , PARAM_DOUBLE(.5)     },
  { "mi_over_me"    , VAR(mi_over_me)      , PARAM_DOUBLE(40.)    },
  { "nb"            , VAR(nb)              , PARAM_DOUBLE(.3)     },
  { "LLy"           , VAR(LLy)             , PARAM_DOUBLE(50.)    },
  { "LLz"           , VAR(LLz)             , PARAM_DOUBLE(200.)   },
  { "Ti_over_Te"    , VAR(Ti_over_Te)      , PARAM_DOUBLE(1.)     },
  { "lambda"        , VAR(lambda)          , PARAM_DOUBLE(2.)     },
  { "pert"          , VAR(pert)            , PARAM_DOUBLE(.025)   },
  { "eta0"          , VAR(eta0)            , PARAM_DOUBLE(.0)     },
  {},
};
#undef VAR

// ----------------------------------------------------------------------
// psc_harris_create
Exemple #30
0
void ScummEngine_v8::resetScummVars() {
	ScummEngine_v7::resetScummVars();

	// FIXME: How do we deal with non-cd installs?
	VAR(VAR_CURRENTDISK) = 1;

	switch (_language) {
	case Common::EN_ANY:
	case Common::EN_USA:
	case Common::EN_GRB:
		VAR(VAR_LANGUAGE) = 0;
		break;
	case Common::DE_DEU:
		VAR(VAR_LANGUAGE) = 1;
		break;
	case Common::FR_FRA:
		VAR(VAR_LANGUAGE) = 2;
		break;
	case Common::IT_ITA:
		VAR(VAR_LANGUAGE) = 3;
		break;
	case Common::PT_BRA:
		VAR(VAR_LANGUAGE) = 4;
		break;
	case Common::ES_ESP:
		VAR(VAR_LANGUAGE) = 5;
		break;
	case Common::JA_JPN:
		VAR(VAR_LANGUAGE) = 6;
		break;
	case Common::ZH_TWN:
		VAR(VAR_LANGUAGE) = 7;
		break;
	case Common::KO_KOR:
		VAR(VAR_LANGUAGE) = 8;
		break;
	default:
		VAR(VAR_LANGUAGE) = 0;	// Default to english
	}
}