Exemple #1
0
void	Hardware_Init( void )
{
	System_Init();
	Vbl_Init();
	Video_Init();
	IKBD_Init();
	Graphic_Init();
}
Exemple #2
0
i32 devinit()
{
	i32 ret = 0;
	COM_INFO comInfo;
	VIDEO_PARAM videoParam;
	
	function_in();
	memset(&comInfo, 0, sizeof(comInfo));
	memset(&videoParam, 0, sizeof(videoParam));
	
	comInst = Com_Init();
	if(comInst!=NULL)
	{
		comInfo.baundRate = BR115200;
		comInfo.dataNum = DN8;
		comInfo.parity = NOP;
		comInfo.stop = S1;
		ret = Com_SetConfig(comInst, &comInfo);
		if(ret < 0)
		{
			run_err("com set failed,ret = %d\n",ret);
		}
	}

	videoInst = Video_Init();

	if(videoInst!=NULL)
	{
		Video_Show_CAP(videoInst);
		Video_show_FMTDESC(videoInst);
		
		videoParam.vCrop.bCROP = 0;
		videoParam.vFmt.pixFmt = YUYV8bit;
		videoParam.vFmt.width = picWd;
		videoParam.vFmt.height = picHt;
		
		ret = Video_SetConfig(videoInst, &videoParam);
		if(ret < 0)
		{
			run_err("Video_SetConfig failed,ret = %d\n",ret);
		}
		Video_Showt_CurrentFMT(videoInst);
		ret = Video_BuffersInit(videoInst);
		if(ret < 0)
		{
			run_err("Video_Buffers Init failed,ret = %d\n",ret);
		}
	}
	function_out();

	return ret;
	
}
Exemple #3
0
static bool Unknown_25C4_000E(void)
{
	Timer_Init();

	if (!Video_Init()) return false;

	Mouse_Init();

	/* Add the general tickers */
	Timer_Add(Video_Tick, 1000000 / 60);
	Timer_Add(Timer_Tick, 1000000 / 60);

	g_var_7097 = -1;

	GFX_Init();
	GFX_ClearScreen();

	if (!Font_Init()) {
		Error(
			"--------------------------\n"
			"ERROR LOADING DATA FILE\n"
			"\n"
			"Did you copy the Dune2 1.07eu data files into the data directory ?\n"
			"\n"
		);

		return false;
	}

	Font_Select(g_fontNew8p);

	g_palette_998A = calloc(256 * 3, sizeof(uint8));

	memset(&g_palette_998A[45], 63, 3);

	GFX_SetPalette(g_palette_998A);

	Tools_RandomLCG_Seed((unsigned)time(NULL));

	Widget_SetCurrentWidget(0);

	return true;
}
Exemple #4
0
/**
 * Initialize Timer, Video, Mouse, GFX, Fonts, Random number generator
 * and current Widget
 */
static bool OpenDune_Init(int screen_magnification, VideoScaleFilter filter)
{
	if (!Font_Init()) {
		Error(
			"--------------------------\n"
			"ERROR LOADING DATA FILE\n"
			"\n"
			"Did you copy the Dune2 1.07eu data files into the data directory ?\n"
			"\n"
		);

		return false;
	}

	Timer_Init();

	if (!Video_Init(screen_magnification, filter)) return false;

	Mouse_Init();

	/* Add the general tickers */
	Timer_Add(Timer_Tick, 1000000 / 60, false);
	Timer_Add(Video_Tick, 1000000 / 60, true);

	g_mouseDisabled = -1;

	GFX_Init();
	GFX_ClearScreen();

	Font_Select(g_fontNew8p);

	g_palette_998A = calloc(256 * 3, sizeof(uint8));

	memset(&g_palette_998A[45], 63, 3);

	GFX_SetPalette(g_palette_998A);

	Tools_RandomLCG_Seed((unsigned)time(NULL));

	Widget_SetCurrentWidget(0);

	return true;
}
Exemple #5
0
static bool Unknown_25C4_000E()
{
	if (!Video_Init())
		return false;

	/* g_var_7097 = -1; */

	GFX_Init();
	GFX_ClearScreen();

	if (!Font_Init())
	{
		Error(
		      "--------------------------\n"
		      "ERROR LOADING DATA FILE\n"
		      "\n"
		      "Did you copy the Dune2 1.07eu data files into the data directory\n"
		      "%s/data ?\n"
		      "\n",
		      g_dune_data_dir
		     );

		return false;
	}

	Font_Select(g_fontNew8p);
	memset(g_palette_998A, 0, 3 * 256);
	memset(&g_palette_998A[45], 63, 3);
	GFX_SetPalette(g_palette_998A);
	srand((unsigned)time(NULL));
	Tools_RandomLCG_Seed((unsigned)time(NULL));

	Widget_SetCurrentWidget(0);

	return true;
}
extern "C" int Alynx_Init(char* rom, char* bios)
{
	StartTicks();
	
	mpLynx = new CSystem(rom, bios);

	if( !Video_Setup(LynxScale) ) return 0;
	
	if(gAudioEnabled)
	{
		if(Audio_Init())
		{
			gAudioEnabled = TRUE;
		}
	}
	
	Video_Init();

	start_time = GetTicks();
	KeyMask = mpLynx->GetButtonData();
	
	a_printf("Starting Lynx Emulation...\n");
	
	emulation=0;
	pause=0;
	
	while(!emulation)
	{	
		mpLynx->SetButtonData(KeyMask);

		// Update TimerCount
		gTimerCount++;

		while( Alynx_Update()  )
		{
			if(!gSystemHalt)
			{
				for(ULONG loop=1024;loop;loop--) mpLynx->Update();
			}
			else gTimerCount++;
		}
		
		if(gAudioEnabled) Audio_CallBack();
		
		this_time = GetTicks();

		fps_counter = (((float)gTimerCount/(this_time-start_time))*1000.0);

		if( (Throttle) && (fps_counter > 59.99) ) Delay( (Uint32)fps_counter );
		native_fps = static_cast<int>(fps_counter);

		while(pause==1)
		{
			Delay(20);
		}
	}
	
	free(mpLynxBuffer);
	free(HandyBuffer);
	free(mainSurface);
	start_render=0;
	delete mpLynx;
	
	a_printf("Stoping...\n");
	return 0;
}
Exemple #7
0
bool_t Context_Init(const tchar_t* Name,const tchar_t* Version,int Id,const tchar_t* CmdLine,void* Application)
{
	context* p = malloc(sizeof(context));
	if (!p) return 0;

#ifdef PREALLOC
	{ int i; for (i=0;i<PREALLOC;++i) q[i] = malloc(65536); }
#endif

	memset(p,0,sizeof(context));
	p->Version = CONTEXT_VERSION;
	p->ProgramId = Id;
	p->ProgramName = Name;
	p->ProgramVersion = Version;
	p->CmdLine = CmdLine;
	p->Lang = DefaultLang();
	p->StartUpMemory = AvailMemory();
	p->LowMemory = p->StartUpMemory < LOWMEMORY_LIMIT;
	p->Application = Application;

	SetContext(p);

	Mem_Init();
	DynCode_Init();
	String_Init();
	PCM_Init();
	Blit_Init();
	Node_Init();
	Platform_Init();
	Stream_Init();
	Advanced_Init();
	Flow_Init();
	Codec_Init();
	Audio_Init();
	Video_Init();
	Format_Init();
	Playlist_Init();
	FormatBase_Init();
	NullOutput_Init();
	RawAudio_Init();
	RawImage_Init();
	Timer_Init();
	IDCT_Init();
	Overlay_Init();
	M3U_Init();
	PLS_Init();
	ASX_Init();
	WaveOut_Init();
	SoftIDCT_Init();
#if defined(CONFIG_SUBS)
	SubTitle_Init();
#endif
#if defined(TARGET_PALMOS)
	OverlayHIRES_Init();
	//Win_Init();
	//About_Init();
	//BenchResult_Init();
	//MediaInfo_Init();
	//Settings_Init();
	ASF_Init();
	AVI_Init();
	WAV_Init();
	MP4_Init();
	MPG_Init();
	NSV_Init();
	Law_Init();
	ADPCM_Init();
#elif defined(TARGET_WIN32) || defined(TARGET_WINCE)
#if defined(TARGET_WINCE)
	if (QueryPlatform(PLATFORM_TYPENO) != TYPE_SMARTPHONE)
	{
		OverlayRAW_Init();
		OverlayGAPI_Init();
	}
	else
	{
		OverlayGAPI_Init(); // prefer GAPI with smartphones (Sagem MyS-7 crashes with Raw FrameBuffer?)
		OverlayRAW_Init();
	}
	OverlayDirect_Init();
	OverlayS1D13806_Init();
#else
	OverlayConsole_Init();
#endif
	OverlayXScale_Init();
	OverlayDDraw_Init(); // after GAPI and RAW and XScale
	OverlayFlyTV_Init();
	OverlayGDI_Init();
#elif defined(TARGET_SYMBIAN)
	OverlaySymbian_Init();
#endif
#ifdef NO_PLUGINS
	Static_Init();
#else
	Plugins_Init();
#endif
	Association_Init(); // after all formats are registered
	Color_Init(); 
	Equalizer_Init();
	Player_Init(); // after all output drivers are registered
	return 1;
}