當前位置: 首頁>>代碼示例>>C++>>正文


C++ FCEU_printf函數代碼示例

本文整理匯總了C++中FCEU_printf函數的典型用法代碼示例。如果您正苦於以下問題:C++ FCEU_printf函數的具體用法?C++ FCEU_printf怎麽用?C++ FCEU_printf使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FCEU_printf函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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,代碼來源:unif.cpp

示例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,代碼來源:unif.c

示例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,代碼來源:unif.cpp

示例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,代碼來源:video.cpp

示例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,代碼來源:unif.cpp

示例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,代碼來源:popup_display.cpp

示例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,代碼來源:unif.c

示例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,代碼來源:unif.c

示例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,代碼來源:bmc13in1jy110.c

示例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,代碼來源:dsoundv1.cpp

示例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,代碼來源:mmc5.c

示例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,代碼來源:mmc3.cpp

示例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,代碼來源:unif.c

示例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,代碼來源:unif.cpp

示例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,代碼來源:unif.c


注:本文中的FCEU_printf函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。