您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FCEU_printf函数代码示例

51自学网 2021-06-01 20:40:43
  C++
这篇教程C++ FCEU_printf函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中FCEU_printf函数的典型用法代码示例。如果您正苦于以下问题:C++ FCEU_printf函数的具体用法?C++ FCEU_printf怎么用?C++ FCEU_printf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了FCEU_printf函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DINF

static int DINF(FCEUFILE *fp){	char name[100], method[100];	uint8 d, m;	uint16 y;	int t;	if(FCEU_fread(name,1,100,fp)!=100)		return(0);	if((t=FCEU_fgetc(fp))==EOF) return(0);	d=t;	if((t=FCEU_fgetc(fp))==EOF) return(0);	m=t;	if((t=FCEU_fgetc(fp))==EOF) return(0);	y=t;	if((t=FCEU_fgetc(fp))==EOF) return(0);	y|=t<<8;	if(FCEU_fread(method,1,100,fp)!=100)		return(0);	name[99]=method[99]=0;	FCEU_printf(" Dumped by: %s/n",name);	FCEU_printf(" Dumped with: %s/n",method);	{		char *months[12]={"January","February","March","April","May","June","July",			"August","September","October","November","December"};		FCEU_printf(" Dumped on: %s %d, %d/n",months[(m-1)%12],d,y);	}	return(1);}
开发者ID:glennimoss,项目名称:marionet,代码行数:29,


示例2: CTRL

static int CTRL(FCEUFILE *fp) {	int t;	uint32 i;	if(uchead.info == 1) {		if ((t = FCEU_fgetc(fp)) == EOF)			return(0);		/* The information stored in this byte isn't very helpful, but it's		better than nothing...maybe.		*/		if (t & 1)			FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_GAMEPAD;		else			FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_NONE;		if (t & 2)			FCEUGameInfo->input[1] = SI_ZAPPER;	} else {		FCEU_printf(" Incorrect Control Chunk Size (%d). Data is:", uchead.info);		for(i = 0; i < uchead.info; i++) {			t = FCEU_fgetc(fp);			FCEU_printf(" %02x", t);		}		FCEU_printf("/n");		FCEUGameInfo->input[0] = FCEUGameInfo->input[1] = SI_GAMEPAD;	}	return(1);}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:27,


示例3: LoadCHR

static int LoadCHR(FCEUFILE *fp){	int z,t;	z=uchead.ID[3]-'0';	if(z<0 || z>15)		return(0);	FCEU_printf(" CHR ROM %d size: %d",z,(int) uchead.info);	if(malloced[16+z])		free(malloced[16+z]);	t=FixRomSize(uchead.info,8192);	if(!(malloced[16+z]=(uint8 *)FCEU_malloc(t)))		return(0);	mallocedsizes[16+z]=t;	memset(malloced[16+z]+uchead.info,0xFF,t-uchead.info);	if(FCEU_fread(malloced[16+z],1,uchead.info,fp)!=uchead.info)	{		FCEU_printf("Read Error!/n");		return(0);	}	else		FCEU_printf("/n");	SetupCartCHRMapping(z,malloced[16+z],t,0);	return(1);}
开发者ID:glennimoss,项目名称:marionet,代码行数:25,


示例4: GetBPP

static int GetBPP(void){	DDPIXELFORMAT ddpix;	memset(&ddpix,0,sizeof(ddpix));	ddpix.dwSize=sizeof(ddpix);	ddrval=IDirectDrawSurface7_GetPixelFormat(lpDDSPrimary,&ddpix);	if (ddrval != DD_OK)	{		//ShowDDErr("Error getting primary surface pixel format.");		FCEU_printf("Error getting primary surface pixel format./n");		return 0;	}	if(ddpix.dwFlags&DDPF_RGB)	{		//mbg merge 7/17/06 removed silly dummy union stuff now that we have c++		bpp=ddpix.dwRGBBitCount;		CBM[0]=ddpix.dwRBitMask;		CBM[1]=ddpix.dwGBitMask;		CBM[2]=ddpix.dwBBitMask;	}	else	{		//ShowDDErr("RGB data not valid.");		FCEU_printf("RGB data not valid./n");		return 0;	}	if(bpp==15) bpp=16;	return 1;}
开发者ID:sashavolv2,项目名称:tasbot,代码行数:33,


示例5: UNIFLoad

int UNIFLoad(const char *name, FCEUFILE *fp){	FCEU_fseek(fp,0,SEEK_SET);	FCEU_fread(&unhead,1,4,fp);	if(memcmp(&unhead,"UNIF",4))		return 0;	ResetCartMapping();	ResetExState(0,0);	ResetUNIF();	if(!FCEU_read32le(&unhead.info,fp))		goto aborto;	if(FCEU_fseek(fp,0x20,SEEK_SET)<0)		goto aborto;	if(!LoadUNIFChunks(fp))		goto aborto;	{		int x;		struct md5_context md5;		md5_starts(&md5);		for(x=0;x<32;x++)			if(malloced[x])			{				md5_update(&md5,malloced[x],mallocedsizes[x]);			}			md5_finish(&md5,UNIFCart.MD5);			FCEU_printf(" ROM MD5:  0x");			for(x=0;x<16;x++)				FCEU_printf("%02x",UNIFCart.MD5[x]);			FCEU_printf("/n");			memcpy(&GameInfo->MD5,&UNIFCart.MD5,sizeof(UNIFCart.MD5));	}	if(!InitializeBoard())		goto aborto;	#if !defined(GEKKO)|| !defined(_XBOX)	FCEU_LoadGameSave(&UNIFCart);	#endif	strcpy(LoadedRomFName,name); //For the debugger list	GameInterface=UNIFGI;	return 1;aborto:	FreeUNIF();	ResetUNIF();	return 0;}
开发者ID:buliaoyin,项目名称:fce360,代码行数:55,


示例6: sizeof

POPUP_DISPLAY::POPUP_DISPLAY(){	hwndScreenshotBitmap = 0;	hwndNoteDescription = 0;	// create BITMAPINFO	screenshotBmi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));	// 256 color in palette	screenshotBmi->bmiHeader.biSize = sizeof(screenshotBmi->bmiHeader);	screenshotBmi->bmiHeader.biWidth = SCREENSHOT_WIDTH;	screenshotBmi->bmiHeader.biHeight = -SCREENSHOT_HEIGHT;		// negative value = top-down bmp	screenshotBmi->bmiHeader.biPlanes = 1;	screenshotBmi->bmiHeader.biBitCount = 8;	screenshotBmi->bmiHeader.biCompression = BI_RGB;	screenshotBmi->bmiHeader.biSizeImage = 0;	// register SCREENSHOT_DISPLAY window class	winCl1.hInstance = fceu_hInstance;	winCl1.lpszClassName = szClassName;	winCl1.lpfnWndProc = screenshotBitmapWndProc;	winCl1.style = CS_DBLCLKS;	winCl1.cbSize = sizeof(WNDCLASSEX);	winCl1.hIcon = 0;	winCl1.hIconSm = 0;	winCl1.hCursor = 0;	winCl1.lpszMenuName = 0;	winCl1.cbClsExtra = 0;	winCl1.cbWndExtra = 0;	winCl1.hbrBackground = 0;	if (!RegisterClassEx(&winCl1))		FCEU_printf("Error registering SCREENSHOT_DISPLAY window class/n");	// register NOTE_DESCRIPTION window class	winCl2.hInstance = fceu_hInstance;	winCl2.lpszClassName = szClassName2;	winCl2.lpfnWndProc = noteDescriptionWndProc;	winCl2.style = CS_DBLCLKS;	winCl2.cbSize = sizeof(WNDCLASSEX);	winCl2.hIcon = 0;	winCl2.hIconSm = 0;	winCl2.hCursor = 0;	winCl2.lpszMenuName = 0;	winCl2.cbClsExtra = 0;	winCl2.cbWndExtra = 0;	winCl2.hbrBackground = 0;	if (!RegisterClassEx(&winCl2))		FCEU_printf("Error registering NOTE_DESCRIPTION window class/n");	// create blendfunction	blend.BlendOp = AC_SRC_OVER;	blend.BlendFlags = 0;	blend.AlphaFormat = 0;	blend.SourceConstantAlpha = 255;}
开发者ID:Plombo,项目名称:fceux,代码行数:52,


示例7: UNIFLoad

int UNIFLoad(const char *name, int fp){        FCEU_fseek(fp,0,SEEK_SET);        FCEU_fread(&unhead,1,4,fp);        if(memcmp(&unhead,"UNIF",4))         return 0;	ResetCartMapping();        ResetExState(0,0);        ResetUNIF();        if(!FCEU_read32(&unhead.info,fp))	 goto aborto;        if(FCEU_fseek(fp,0x20,SEEK_SET)<0)	 goto aborto;        if(!LoadUNIFChunks(fp))	 goto aborto;	{	 int x;	 struct md5_context md5;	 md5_starts(&md5);	 for(x=0;x<32;x++)	  if(malloced[x])	  {	   md5_update(&md5,malloced[x],mallocedsizes[x]);	  }	  md5_finish(&md5,UNIFCart.MD5);          FCEU_printf(" ROM MD5:  0x");          for(x=0;x<16;x++)           FCEU_printf("%02x",UNIFCart.MD5[x]);          FCEU_printf("/n");	  memcpy(FCEUGameInfo.MD5,UNIFCart.MD5,sizeof(UNIFCart.MD5));	}        if(!InitializeBoard())	 goto aborto;	FCEU_LoadGameSave(&UNIFCart);        GameInterface=UNIFGI;        return 1;	aborto:	FreeUNIF();	ResetUNIF();	return 0;}
开发者ID:PINKONG,项目名称:AndroidNesoid,代码行数:51,


示例8: EnableBattery

static int EnableBattery(FCEUFILE *fp) {	FCEU_printf(" Battery-backed./n");	if (FCEU_fgetc(fp) == EOF)		return(0);	UNIFCart.battery = 1;	return(1);}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:7,


示例9: Sync

static void Sync(void){  FCEU_printf("%02x: %02x %02x/n", bank_mode, bank_value, prgb[0]);    switch(bank_mode&7)  {    case 0:         setprg32(0x8000,bank_value&7); break;    case 1:         setprg16(0x8000,((8+(bank_value&7))>>1)+prgb[1]);         setprg16(0xC000,(bank_value&7)>>1);    case 4:         setprg32(0x8000,8+(bank_value&7)); break;    case 5:         setprg16(0x8000,((8+(bank_value&7))>>1)+prgb[1]);         setprg16(0xC000,((8+(bank_value&7))>>1)+prgb[3]);    case 2:         setprg8(0x8000,prgb[0]>>2);         setprg8(0xa000,prgb[1]);         setprg8(0xc000,prgb[2]);         setprg8(0xe000,~0);         break;    case 3:         setprg8(0x8000,prgb[0]);         setprg8(0xa000,prgb[1]);         setprg8(0xc000,prgb[2]);         setprg8(0xe000,prgb[3]);         break;  }}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:29,


示例10: DECLFW

static DECLFW(UNLDSOUNDV1WriteSnd) {    if(A == 0x5800) {        if(V & 0xF0) {            pcm_enable = 1;//			pcmwrite(0x4011, (V & 0xF) << 3);            pcmwrite(0x4011, decode(V & 0xf));        } else            pcm_enable = 0;    } else        FCEU_printf("misc %04x:%02x/n", A, V);}
开发者ID:Zaneris,项目名称:emu-ex-plus-alpha,代码行数:11,


示例11: DetectMMC5WRAMSize

int DetectMMC5WRAMSize(uint32 crc32) {	int x;	for (x = 0; x < MMC5_NOCARTS; x++) {		if (crc32 == MMC5CartList[x].crc32) {			if (MMC5CartList[x].size > 1)				FCEU_printf(" >8KB external WRAM present.  Use UNIF if you hack the ROM image./n");			return(MMC5CartList[x].size * 8);		}	}	return 64;}
开发者ID:GinBunBun,项目名称:Fceumm-PS2,代码行数:11,


示例12: Mapper4_Init

void Mapper4_Init(CartInfo *info) {	int ws = 8;	if ((info->CRC32 == 0x93991433 || info->CRC32 == 0xaf65aa84)) {		FCEU_printf("Low-G-Man can not work normally in the iNES format./nThis game has been recognized by its CRC32 value, and the appropriate changes will be made so it will run./nIf you wish to hack this game, you should use the UNIF format for your hack./n/n");		ws = 0;	}	GenMMC3_Init(info, 512, 256, ws, info->battery);	info->Power = M4Power;	hackm4 = info->mirror;}
开发者ID:Plombo,项目名称:fceux,代码行数:11,


示例13: SetBoardName

static int SetBoardName(FCEUFILE *fp) {	if (!(boardname = (uint8*)FCEU_malloc(uchead.info + 1)))		return(0);	FCEU_fread(boardname, 1, uchead.info, fp);	boardname[uchead.info] = 0;	FCEU_printf(" Board name: %s/n", boardname);	sboardname = boardname;	if (!memcmp(boardname, "NES-", 4) || !memcmp(boardname, "UNL-", 4) || !memcmp(boardname, "HVC-", 4) || !memcmp(boardname, "BTL-", 4) || !memcmp(boardname, "BMC-", 4))		sboardname += 4;	return(1);}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:11,


示例14: NAME

static int NAME(FCEUFILE *fp) {    char namebuf[100];    int index;    int t;    FCEU_printf(" Name: ");    index = 0;    while ((t = FCEU_fgetc(fp)) > 0)        if (index < 99)            namebuf[index++] = t;    namebuf[index] = 0;    FCEU_printf("%s/n", namebuf);    if (!GameInfo->name) {        GameInfo->name = (uint8*)malloc(strlen(namebuf) + 1); //mbg merge 7/17/06 added cast        strcpy((char*)GameInfo->name, namebuf); //mbg merge 7/17/06 added cast    }    return(1);}
开发者ID:gamecip,项目名称:em-fceux,代码行数:21,


示例15: NAME

static int NAME(FCEUFILE *fp) {	char namebuf[100];	int index;	int t;	FCEU_printf(" Name: ");	index = 0;	while ((t = FCEU_fgetc(fp)) > 0)		if (index < 99)			namebuf[index++] = t;	namebuf[index] = 0;	FCEU_printf("%s/n", namebuf);	if (!FCEUGameInfo->name) {		FCEUGameInfo->name = malloc(strlen(namebuf) + 1);		strcpy(FCEUGameInfo->name, namebuf);	}	return(1);}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:21,


示例16: DoMirroring

static int DoMirroring(FCEUFILE *fp){	uint8 t;	t=FCEU_fgetc(fp);	mirrortodo=t;	{		static char *stuffo[6]={"Horizontal","Vertical","$2000","$2400","/"Four-screen/"","Controlled by Mapper Hardware"};		if(t<6)			FCEU_printf(" Name/Attribute Table Mirroring: %s/n",stuffo[t]);	}	return(1);}
开发者ID:glennimoss,项目名称:marionet,代码行数:13,


示例17: InitializeDDraw

static int InitializeDDraw(int fs){	//only init the palette the first time through	if(firstInitialize) {		firstInitialize = false;    color_palette = (PALETTEENTRY*)malloc(256 * sizeof(PALETTEENTRY));	}	//(disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY:	ddrval = DirectDrawCreate((disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY:NULL, &lpDD, NULL);	if (ddrval != DD_OK)	{		//ShowDDErr("Error creating DirectDraw object.");		FCEU_printf("Error creating DirectDraw object./n");		return 0;	}	//mbg merge 7/17/06 changed:	ddrval = IDirectDraw_QueryInterface(lpDD,IID_IDirectDraw7,(LPVOID *)&lpDD7);	//ddrval = IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw7,(LPVOID *)&lpDD7);	IDirectDraw_Release(lpDD);	if (ddrval != DD_OK)	{		//ShowDDErr("Error querying interface.");		FCEU_printf("Error querying interface./n");		return 0;	}	caps.dwSize=sizeof(caps);	if(IDirectDraw7_GetCaps(lpDD7,&caps,0)!=DD_OK)	{		//ShowDDErr("Error getting capabilities.");		FCEU_printf("Error getting capabilities./n");		return 0;	}	return 1;}
开发者ID:sashavolv2,项目名称:tasbot,代码行数:38,


示例18: TVCI

static int TVCI(FCEUFILE *fp) {	int t;	if ((t = FCEU_fgetc(fp)) == EOF)		return(0);	if (t <= 2) {		char *stuffo[3] = { "NTSC", "PAL", "NTSC and PAL" };		if (t == 0)			FCEUGameInfo->vidsys = GIV_NTSC;		else if (t == 1)			FCEUGameInfo->vidsys = GIV_PAL;		FCEU_printf(" TV Standard Compatibility: %s/n", stuffo[t]);	}	return(1);}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:14,


示例19: uncompress

void POPUP_DISPLAY::changeScreenshotBitmap(){	// uncompress	uLongf destlen = SCREENSHOT_SIZE;	int e = uncompress(&screenshotRasterPointer[0], &destlen, &bookmarks.bookmarksArray[bookmarks.itemUnderMouse].savedScreenshot[0], bookmarks.bookmarksArray[bookmarks.itemUnderMouse].savedScreenshot.size());	if (e != Z_OK && e != Z_BUF_ERROR)	{		// error decompressing		FCEU_printf("Error decompressing screenshot %d/n", bookmarks.itemUnderMouse);		// at least fill bitmap with zeros		memset(&screenshotRasterPointer[0], 0, SCREENSHOT_SIZE);	}	redrawScreenshotBitmap();}
开发者ID:Plombo,项目名称:fceux,代码行数:14,


示例20: DECLFW

static DECLFW(MCN22MWrite){FCEU_printf("bs %04x %02x/n",A,V);  switch(A)  {    case 0x8c00:    case 0x8c01:    case 0x8c02: reg[A&3]=V; break;    case 0x8d10: reg[3]=V; break;    case 0x8d11: reg[4]=V; break;    case 0x8d16: reg[5]=V; break;    case 0x8d17: reg[6]=V; break;  }  Sync();}
开发者ID:RuiVarela,项目名称:rengine,代码行数:15,


示例21: DoMirroring

static int DoMirroring(FCEUFILE *fp) {	int t;	uint32 i;	if(uchead.info == 1) {		if ((t = FCEU_fgetc(fp)) == EOF)			return(0);		mirrortodo = t;		{			static char *stuffo[6] = { "Horizontal", "Vertical", "$2000", "$2400", "/"Four-screen/"", "Controlled by Mapper Hardware" };			if (t < 6)				FCEU_printf(" Name/Attribute Table Mirroring: %s/n", stuffo[t]);		}	} else {		FCEU_printf(" Incorrect Mirroring Chunk Size (%d). Data is:", uchead.info);		for(i = 0; i < uchead.info; i++) {			if ((t = FCEU_fgetc(fp)) == EOF)				return(0);			FCEU_printf(" %02x", t);		}		FCEU_printf("/n Default Name/Attribute Table Mirroring: Horizontal/n", uchead.info);		mirrortodo = 0;	}	return(1);}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:24,


示例22: DECLFW

static DECLFW(BMC13in1JY110Write){  FCEU_printf("%04x:%04x/n",A,V);  switch(A)  {    case 0x8000:    case 0x8001:    case 0x8002:    case 0x8003: prgb[A&3]=V; break;    case 0xD000: bank_mode=V; break;    case 0xD001: setmirror(V&3);    case 0xD002: break;    case 0xD003: bank_value=V; break;  }  Sync();}
开发者ID:CatalystG,项目名称:fceu-next,代码行数:16,


示例23: DetectMMC1WRAMSize

static int DetectMMC1WRAMSize(uint32 crc32){    switch(crc32)    {    case 0xc6182024:       /* Romance of the 3 Kingdoms */    case 0x2225c20f:       /* Genghis Khan */    case 0x4642dda6:       /* Nobunaga's Ambition */    case 0x29449ba9:       /* ""        "" (J) */    case 0x2b11e0b0:       /* ""        "" (J) */    case 0xb8747abf:       /* Best Play Pro Yakyuu Special (J) */    case 0xc9556b36:       /* Final Fantasy I & II (J) [!] */        FCEU_printf(" >8KB external WRAM present.  Use UNIF if you hack the ROM image./n");        return(16);        break;    default:        return(8);    }}
开发者ID:quarnster,项目名称:emu-ex-plus-alpha,代码行数:18,


示例24: TVCI

static int TVCI(int fp){ int t; if( (t=FCEU_fgetc(fp)) ==EOF)  return(0); if(t<=2) {  char *stuffo[3]={"NTSC","PAL","NTSC and PAL"};  if(t==0)  {   FCEUGameInfo.vidsys=GIV_NTSC;   FCEUI_SetVidSystem(0);  }  else if(t==1)  {   FCEUGameInfo.vidsys=GIV_PAL;   FCEUI_SetVidSystem(1);  }  FCEU_printf(" TV Standard Compatibility: %s/n",stuffo[t]); } return(1);}
开发者ID:PINKONG,项目名称:AndroidNesoid,代码行数:22,


示例25: ResetGameLoaded

FCEUGI *FCEUI_CopyFamiStart(void){	ResetGameLoaded();	FCEUGameInfo = malloc(sizeof(FCEUGI));	memset(FCEUGameInfo, 0, sizeof(FCEUGI));	FCEUGameInfo->soundchan = 0;	FCEUGameInfo->soundrate = 0;	FCEUGameInfo->name="copyfami";	FCEUGameInfo->type=GIT_CART;	FCEUGameInfo->vidsys=GIV_USER;	FCEUGameInfo->input[0]=FCEUGameInfo->input[1]=-1;	FCEUGameInfo->inputfc=-1;	FCEUGameInfo->cspecial=0;#ifdef FCEU_LOG	FCEU_printf("Starting CopyFamicom.../n/n");#endif	if(!CopyFamiLoad())		return 0;	/*An error occurred while starting CopyFamicom*/	FCEU_ResetVidSys();	if(FSettings.GameGenie)		OpenGenie();	PowerNES();	FCEU_LoadGamePalette();	FCEU_LoadGameCheats(0);	FCEU_ResetPalette();	return(FCEUGameInfo);}
开发者ID:ficoos,项目名称:fceu-next,代码行数:36,


示例26: DECLFW

static DECLFW(SSSNROMWrite) {#if 0	FCEU_printf("write %04x %02x/n",A,V);	regs[A&7] = V;#endif}
开发者ID:frangarcj,项目名称:libretro-fceumm,代码行数:6,


示例27: InitVideo

/** * Attempts to initialize the graphical video display.  Returns 0 on * success, -1 on failure. */intInitVideo(FCEUGI *gi){	// XXX soules - const?  is this necessary?	const SDL_VideoInfo *vinf;	int error, flags = 0;	int doublebuf, xstretch, ystretch, xres, yres, show_fps;	FCEUI_printf("Initializing video...");	// load the relevant configuration variables	g_config->getOption("SDL.Fullscreen", &s_fullscreen);	g_config->getOption("SDL.DoubleBuffering", &doublebuf);#ifdef OPENGL	g_config->getOption("SDL.OpenGL", &s_useOpenGL);#endif	g_config->getOption("SDL.SpecialFilter", &s_sponge);	g_config->getOption("SDL.XStretch", &xstretch);	g_config->getOption("SDL.YStretch", &ystretch);	g_config->getOption("SDL.LastXRes", &xres);	g_config->getOption("SDL.LastYRes", &yres);	g_config->getOption("SDL.ClipSides", &s_clipSides);	g_config->getOption("SDL.NoFrame", &noframe);	g_config->getOption("SDL.ShowFPS", &show_fps);	// check the starting, ending, and total scan lines	FCEUI_GetCurrentVidSystem(&s_srendline, &s_erendline);	s_tlines = s_erendline - s_srendline + 1;	// check if we should auto-set x/y resolution    // check for OpenGL and set the global flags#if OPENGL	if(s_useOpenGL && !s_sponge) {		flags = SDL_OPENGL;	}#endif	// initialize the SDL video subsystem if it is not already active	if(!SDL_WasInit(SDL_INIT_VIDEO)) {		error = SDL_InitSubSystem(SDL_INIT_VIDEO);		if(error) {			FCEUD_PrintError(SDL_GetError());			return -1;		}	}	s_inited = 1;	// shows the cursor within the display window	SDL_ShowCursor(1);	// determine if we can allocate the display on the video card	vinf = SDL_GetVideoInfo();	if(vinf->hw_available) {		flags |= SDL_HWSURFACE;	}    	// get the monitor's current resolution if we do not already have it	if(s_nativeWidth < 0) {		s_nativeWidth = vinf->current_w;	}	if(s_nativeHeight < 0) {		s_nativeHeight = vinf->current_h;	}	// check to see if we are showing FPS	FCEUI_SetShowFPS(show_fps);    	// check if we are rendering fullscreen	if(s_fullscreen) {		int no_cursor;		g_config->getOption("SDL.NoFullscreenCursor", &no_cursor);		flags |= SDL_FULLSCREEN;		SDL_ShowCursor(!no_cursor);	}	else {		SDL_ShowCursor(1);	}    	if(noframe) {		flags |= SDL_NOFRAME;	}	// gives the SDL exclusive palette control... ensures the requested colors	// flags |= SDL_HWPALETTE;	// enable double buffering if requested and we have hardware support#ifdef OPENGL	if(s_useOpenGL) {		FCEU_printf("Initializing with OpenGL (Disable with '--opengl 0')./n");		if(doublebuf) {			 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);		}	} else#endif		if(doublebuf && (flags & SDL_HWSURFACE)) {//.........这里部分代码省略.........
开发者ID:kyle-lu,项目名称:fceux.js,代码行数:101,


示例28: free

void EDITOR::init(){	free();	// load autofire_patterns	int total_patterns = 0;	char nameo[2048];	strncpy(nameo, FCEU_GetPath(FCEUMKF_TASEDITOR).c_str(), 2047);	strncat(nameo, patternsFilename, 2047 - strlen(nameo));	EMUFILE_FILE ifs(nameo, "rb");	if (!ifs.fail())	{		std::string tempstr1, tempstr2;		while (readStringFromPatternsFile(&ifs, tempstr1))		{			if (readStringFromPatternsFile(&ifs, tempstr2))			{				total_patterns++;				// save the name				patternsNames.push_back(tempstr1);				// parse 2nd string to sequence of 1s and 0s				patterns.resize(total_patterns);				patterns[total_patterns - 1].resize(tempstr2.size());				for (int i = tempstr2.size() - 1; i >= 0; i--)				{					if (tempstr2[i] == autofire_patterns_flagpress)						patterns[total_patterns - 1][i] = 1;					else						patterns[total_patterns - 1][i] = 0;				}			}		}	} else	{		FCEU_printf("Could not load tools//taseditor_patterns.txt!/n");	}	if (patterns.size() == 0)	{		FCEU_printf("Will be using default set of patterns.../n");		patterns.resize(4);		patternsNames.resize(4);		// Default Pattern 0: Alternating (1010...)		patternsNames[0] = "Alternating (1010...)";		patterns[0].resize(2);		patterns[0][0] = 1;		patterns[0][1] = 0;		// Default Pattern 1: Alternating at 30FPS (11001100...)		patternsNames[1] = "Alternating at 30FPS (11001100...)";		patterns[1].resize(4);		patterns[1][0] = 1;		patterns[1][1] = 1;		patterns[1][2] = 0;		patterns[1][3] = 0;		// Default Pattern 2: One Quarter (10001000...)		patternsNames[2] = "One Quarter (10001000...)";		patterns[2].resize(4);		patterns[2][0] = 1;		patterns[2][1] = 0;		patterns[2][2] = 0;		patterns[2][3] = 0;		// Default Pattern 3: Tap'n'Hold (1011111111111111111111111111111111111...)		patternsNames[3] = "Tap'n'Hold (101111111...)";		patterns[3].resize(1000);		patterns[3][0] = 1;		patterns[3][1] = 0;		for (int i = 2; i < 1000; ++i)			patterns[3][i] = 1;	}	// reset current_pattern if it's outside the range	if (taseditorConfig.currentPattern < 0 || taseditorConfig.currentPattern >= (int)patterns.size())		taseditorConfig.currentPattern = 0;	taseditorWindow.updatePatternsMenu();	reset();}
开发者ID:CharlexH,项目名称:Provenance,代码行数:74,


示例29: reset

// returns true if couldn't loadbool HISTORY::load(EMUFILE *is, unsigned int offset){	int i = -1;	SNAPSHOT snap;	BOOKMARK bookm;	if (offset)	{		if (is->fseek(offset, SEEK_SET)) goto error;	} else	{		reset();		return false;	}	// read "HISTORY" string	char save_id[HISTORY_ID_LEN];	if ((int)is->fread(save_id, HISTORY_ID_LEN) < HISTORY_ID_LEN) goto error;	if (!strcmp(historySkipSaveID, save_id))	{		// string says to skip loading History		FCEU_printf("No History in the file/n");		reset();		return false;	}	if (strcmp(historySaveID, save_id)) goto error;		// string is not valid	// delete old items	snapshots.resize(historySize);	bookmarkBackups.resize(historySize);	currentBranchNumberBackups.resize(historySize);	// read vars	if (!read32le(&historyCursorPos, is)) goto error;	if (!read32le(&historyTotalItems, is)) goto error;	if (historyCursorPos > historyTotalItems) goto error;	historyStartPos = 0;	// read items	int total = historyTotalItems;	if (historyTotalItems > historySize)	{		// user can't afford that much undo levels, skip some items		int num_items_to_skip = historyTotalItems - historySize;		// first try to skip items over history_cursor_pos (future items), because "redo" is less important than "undo"		int num_redo_items = historyTotalItems-1 - historyCursorPos;		if (num_items_to_skip >= num_redo_items)		{			// skip all redo items			historyTotalItems = historyCursorPos+1;			num_items_to_skip -= num_redo_items;			// and still need to skip some undo items			for (i = 0; i < num_items_to_skip; ++i)			{				if (snap.skipLoad(is)) goto error;				if (bookm.skipLoad(is)) goto error;				if (is->fseek(1, SEEK_CUR)) goto error;		// backup_current_branch			}			total -= num_items_to_skip;			historyCursorPos -= num_items_to_skip;		}		historyTotalItems -= num_items_to_skip;	}	// load items	for (i = 0; i < historyTotalItems; ++i)	{		if (snapshots[i].load(is)) goto error;		if (bookmarkBackups[i].load(is)) goto error;		if (is->fread(&currentBranchNumberBackups[i], 1) != 1) goto error;		playback.setProgressbar(i, historyTotalItems);	}	// skip redo items if needed	for (; i < total; ++i)	{		if (snap.skipLoad(is)) goto error;		if (bookm.skipLoad(is)) goto error;		if (is->fseek(1, SEEK_CUR)) goto error;		// backup_current_branch	}	// everything went well	// init vars	undoHintPos = oldUndoHintPos = undoHintTimer = -1;	oldShowUndoHint = showUndoHint = false;	updateList();	redrawList();	return false;error:	FCEU_printf("Error loading History/n");	reset();	return true;}
开发者ID:sashavolv2,项目名称:tasbot,代码行数:88,



注:本文中的FCEU_printf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ FCGI_Accept函数代码示例
C++ FB2OFB函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。