本文整理汇总了C++中SysPrintf函数的典型用法代码示例。如果您正苦于以下问题:C++ SysPrintf函数的具体用法?C++ SysPrintf怎么用?C++ SysPrintf使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SysPrintf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PAD__init
long PAD__init(long flags) {
SysPrintf("start PAD_init()\r\n");
PadFlags |= flags;
/* Read Configuration here */
SysPrintf("end PAD_init()\r\n");
return PSE_PAD_ERR_SUCCESS;
}
示例2: CDR__close
long CDR__close(void) {
SysPrintf("start CDR_close()\r\n");
fclose(CD.cd);
free(CD.tl);
SysPrintf("end CDR_close()\r\n");
return 0;
}
示例3: LoadMcd
void LoadMcd(int mcd, char *str) {
FILE *f;
char *data = NULL;
if (mcd != 1 && mcd != 2)
return;
if (mcd == 1) {
data = Mcd1Data;
cardh1[1] |= 8; // mark as new
}
if (mcd == 2) {
data = Mcd2Data;
cardh2[1] |= 8;
}
McdDisable[mcd - 1] = 0;
if (str == NULL || strcmp(str, "none") == 0) {
McdDisable[mcd - 1] = 1;
return;
}
if (*str == 0)
return;
f = fopen(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
CreateMcd(str);
f = fopen(str, "rb");
if (f != NULL) {
struct stat buf;
if (stat(str, &buf) != -1) {
if (buf.st_size == MCD_SIZE + 64)
fseek(f, 64, SEEK_SET);
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
fread(data, 1, MCD_SIZE, f);
fclose(f);
}
else
SysMessage(_("Memory card %s failed to load!\n"), str);
}
else {
struct stat buf;
SysPrintf(_("Loading memory card %s\n"), str);
if (stat(str, &buf) != -1) {
if (buf.st_size == MCD_SIZE + 64)
fseek(f, 64, SEEK_SET);
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
fread(data, 1, MCD_SIZE, f);
fclose(f);
}
}
示例4: emu_on_new_cd
void emu_on_new_cd(int show_hud_msg)
{
ClearAllCheats();
parse_cwcheat();
if (Config.HLE) {
SysPrintf("note: running with HLE BIOS, expect compatibility problems\n");
SysPrintf("----------------------------------------------------------\n");
}
if (show_hud_msg) {
snprintf(hud_msg, sizeof(hud_msg), BOOT_MSG);
hud_new_msg = 3;
}
}
示例5: PAD__open
long PAD__open(void)
{
SysPrintf("start PAD1_open()\r\n");
return 0;
}
示例6: CDR__open
long CDR__open(void)
{
char str[256];
SysPrintf("start CDR_open()\r\n");
// newCD("/cd/cd.bin");
strcpy(str, CDConfiguration.dn);
strcat(str, "/");
strcat(str, CDConfiguration.fn);
newCD(str);
SysPrintf("end CDR_open()\r\n");
return 0;
}
示例7: psxMemReset
void psxMemReset() {
FILE *f = NULL;
char Bios[256];
memset(psxM, 0, 0x00200000);
memset(psxP, 0, 0x00010000);
if(!Config.HLE)
{
sprintf(Bios, "%s%s", Config.BiosDir, Config.Bios);
f = fopen(Bios, "rb");
if (f == NULL) {
SysPrintf ("BIOS NOT FOUND: %s", Bios);
gp2x_timer_delay(2000);
memset(psxR, 0, 0x80000);
Config.HLE = 1;
}
else {
fread(psxR, 1, 0x80000, f);
fclose(f);
}
}
else
{
memset(psxR, 0, 0x80000);
}
}
示例8: SaveStateGz
int SaveStateGz(gzFile f, long* gzsize) {
int Size;
unsigned char pMemGpuPic[SZ_GPUPIC];
//if (f == NULL) return -1;
gzwrite(f, (void *)PcsxrHeader, sizeof(PcsxrHeader));
gzwrite(f, (void *)&SaveVersion, sizeof(u32));
gzwrite(f, (void *)&Config.HLE, sizeof(boolean));
if (gzsize)GPU_getScreenPic(pMemGpuPic); // Not necessary with ephemeral saves
gzwrite(f, pMemGpuPic, SZ_GPUPIC);
if (Config.HLE)
psxBiosFreeze(1);
gzwrite(f, psxM, 0x00200000);
gzwrite(f, psxR, 0x00080000);
gzwrite(f, psxH, 0x00010000);
gzwrite(f, (void *)&psxRegs, sizeof(psxRegs));
// gpu
if (!gpufP)gpufP = (GPUFreeze_t *)malloc(sizeof(GPUFreeze_t));
gpufP->ulFreezeVersion = 1;
GPU_freeze(1, gpufP);
gzwrite(f, gpufP, sizeof(GPUFreeze_t));
// SPU Plugin cannot change during run, so we query size info just once per session
if (!spufP) {
spufP = (SPUFreeze_t *)malloc(offsetof(SPUFreeze_t, SPUPorts)); // only first 3 elements (up to Size)
SPU_freeze(2, spufP);
Size = spufP->Size;
SysPrintf("SPUFreezeSize %i/(%i)\n", Size, offsetof(SPUFreeze_t, SPUPorts));
free(spufP);
spufP = (SPUFreeze_t *) malloc(Size);
spufP->Size = Size;
if (spufP->Size <= 0) {
gzclose(f);
free(spufP);
spufP = NULL;
return 1; // error
}
}
// spu
gzwrite(f, &(spufP->Size), 4);
SPU_freeze(1, spufP);
gzwrite(f, spufP, spufP->Size);
sioFreeze(f, 1);
cdrFreeze(f, 1);
psxHwFreeze(f, 1);
psxRcntFreeze(f, 1);
mdecFreeze(f, 1);
if(gzsize)*gzsize = gztell(f);
gzclose(f);
return 0;
}
示例9: psxException
void psxException(u32 code, u32 bd) {
// Set the Cause
psxRegs.CP0.n.Cause = (psxRegs.CP0.n.Cause & 0x300) | code;
// Set the EPC & PC
if (bd) {
#ifdef PSXCPU_LOG
PSXCPU_LOG("bd set!!!\n");
#endif
SysPrintf("bd set!!!\n");
psxRegs.CP0.n.Cause |= 0x80000000;
psxRegs.CP0.n.EPC = (psxRegs.pc - 4);
} else
psxRegs.CP0.n.EPC = (psxRegs.pc);
if (psxRegs.CP0.n.Status & 0x400000)
psxRegs.pc = 0xbfc00180;
else
psxRegs.pc = 0x80000080;
// Set the Status
psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status &~0x3f) |
((psxRegs.CP0.n.Status & 0xf) << 2);
if (Config.HLE) psxBiosException();
}
示例10: _rcntTestTarget
static void __fastcall _rcntTestTarget( int i )
{
if( psxCounters[i].count < psxCounters[i].target ) return;
PSXCNT_LOG("IOP Counter[%d] target 0x%I64x >= 0x%I64x (mode: %x)\n",
i, psxCounters[i].count, psxCounters[i].target, psxCounters[i].mode);
if (psxCounters[i].mode & IOPCNT_INT_TARGET)
{
// Target interrupt
if(psxCounters[i].mode & 0x80)
psxCounters[i].mode &= ~0x0400; // Interrupt flag
psxCounters[i].mode |= 0x0800; // Target flag
psxHu32(0x1070) |= psxCounters[i].interrupt;
}
if (psxCounters[i].mode & 0x08)
{
// Reset on target
psxCounters[i].count -= psxCounters[i].target;
if(!(psxCounters[i].mode & 0x40))
{
SysPrintf("Counter %x repeat intr not set on zero ret, ignoring target\n", i);
psxCounters[i].target |= IOPCNT_FUTURE_TARGET;
}
} else psxCounters[i].target |= IOPCNT_FUTURE_TARGET;
}
示例11: psxRcnt5Wmode
void psxRcnt5Wmode(u32 value)
{
PSXCNT_LOG("IOP Counter[5] writeMode = %lx\n", value);
psxCounters[5].mode = value;
psxCounters[5].mode|= 0x0400;
switch(value & 0x6000)
{
case 0x0000: psxCounters[5].rate = 1; break;
case 0x2000: psxCounters[5].rate = 8; break;
case 0x4000: psxCounters[5].rate = 16; break;
case 0x6000: psxCounters[5].rate = 256; break;
}
// Need to set a rate and target
if((psxCounters[5].mode & 0x7) == 0x7 || (psxCounters[5].mode & 0x7) == 0x1)
{
SysPrintf("Gate set on IOP C5, disabling\n");
psxCounters[5].mode |= IOPCNT_STOPPED;
}
psxCounters[5].count = 0;
psxCounters[5].sCycleT = psxRegs.cycle;
psxCounters[5].target &= 0xffffffff;
_rcntSet( 5 );
}
示例12: _ext_memRead16
mem16_t __fastcall _ext_memRead16(u32 mem)
{
switch (p)
{
case 1: // hwm
return hwRead16(mem);
case 2: // psh
return psxHwRead16(mem);
case 4: // b80
MEM_LOG("b800000 Memory read16 address %x\n", mem);
return 0;
case 5: // ba0
return ba0R16(mem);
case 6: // gsm
return gsRead16(mem);
case 7: // dev9
{
mem16_t retval = DEV9read16(mem & ~0xa4000000);
SysPrintf("DEV9 read16 %8.8lx: %4.4lx\n", mem & ~0xa4000000, retval);
return retval;
}
case 8: // spu2
return SPU2read(mem);
}
MEM_LOG("Unknown Memory read16 from address %8.8x\n", mem);
cpuTlbMissR(mem, cpuRegs.branch);
return 0;
}
示例13: LoadMcd
void LoadMcd(int mcd, char *str) {
FILE *f;
char *data = NULL;
if (mcd == 1) data = Mcd1Data;
if (mcd == 2) data = Mcd2Data;
if (*str == 0) {
sprintf(str, "%s/.pcsxr/memcards/card%d.mcd", getenv("HOME"), mcd); // TODO: maybe just whine and quit..
SysPrintf(_("No memory card value was specified - using a default card %s\n"), str);
}
f = fopen(str, "rb");
if (f == NULL) {
SysPrintf(_("The memory card %s doesn't exist - creating it\n"), str);
CreateMcd(str);
f = fopen(str, "rb");
if (f != NULL) {
struct stat buf;
if (stat(str, &buf) != -1) {
if (buf.st_size == MCD_SIZE + 64)
fseek(f, 64, SEEK_SET);
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
fread(data, 1, MCD_SIZE, f);
fclose(f);
}
else
SysMessage(_("Memory card %s failed to load!\n"), str);
}
else {
struct stat buf;
SysPrintf(_("Loading memory card %s\n"), str);
if (stat(str, &buf) != -1) {
if (buf.st_size == MCD_SIZE + 64)
fseek(f, 64, SEEK_SET);
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
fread(data, 1, MCD_SIZE, f);
fclose(f);
}
// flag indicating entries have not yet been read (i.e. new card plugged)
cardh[1] |= MCDST_CHANGED;
}
示例14: ClosePlugins
void ClosePlugins() {
int ret;
ret = CDR_close();
if (ret < 0) { SysPrintf("Error Closing CDR Plugin\n"); return; }
ret = SPU_close();
if (ret < 0) { SysPrintf("Error Closing SPU Plugin\n"); return; }
ret = PAD1_close();
if (ret < 0) { SysPrintf("Error Closing PAD1 Plugin\n"); return; }
ret = PAD2_close();
if (ret < 0) { SysPrintf("Error Closing PAD2 Plugin\n"); return; }
ret = GPU_close();
if (ret < 0) { SysPrintf("Error Closing GPU Plugin\n"); return; }
if (Config.UseNet) {
NET_pause();
}
}
示例15: emu_core_init
int emu_core_init(void)
{
SysPrintf("Starting PCSX-ReARMed " REV "\n");
if (EmuInit() == -1) {
SysPrintf("PSX emulator couldn't be initialized.\n");
return -1;
}
LoadMcds(Config.Mcd1, Config.Mcd2);
#ifdef DEBUG
if (Config.Debug)
StartDebugger();
#endif
return 0;
}