本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: EnableBattery
static int EnableBattery(FCEUFILE *fp) {
FCEU_printf(" Battery-backed.\n");
if (FCEU_fgetc(fp) == EOF)
return(0);
UNIFCart.battery = 1;
return(1);
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}