Пример #1
0
void
AppendErrorString(std::string &result, int code)
{
  char buf[128];
  if (!appendErrorString(result, buf, strerror_r(code, buf, sizeof(buf)))) {
    AppendFormat(result, "Unknown error %d",  code);
  }
}
Пример #2
0
OP_STATUS OpString16::SetConcat(
	const OpStringC16& str1, const OpStringC16& str2,
	const OpStringC16& str3, const OpStringC16& str4)
{
	if (iBuffer)
		*iBuffer = '\0';
	return AppendFormat(UNI_L("%s%s%s%s"), GetS(str1), GetS(str2), GetS(str3), GetS(str4));
}
Пример #3
0
OP_STATUS OpString8::SetConcat(
	const OpStringC8& str1, const OpStringC8& str2,
	const OpStringC8& str3, const OpStringC8& str4,
	const OpStringC8& str5, const OpStringC8& str6,
	const OpStringC8& str7, const OpStringC8& str8)
{
	if (iBuffer)
		*iBuffer = '\0';
	return AppendFormat("%s%s%s%s%s%s%s%s", GetS(str1), GetS(str2), GetS(str3), GetS(str4),
											GetS(str5), GetS(str6), GetS(str7), GetS(str8));
}
Пример #4
0
lcpp::String
lcpp::LispFunction_UserDefined::toString() const
{
    static auto anonymous = String("<procedure>");
    static auto nonAnonymousFormat = String("<procedure:%s>");

    if (!m_pName)
    {
        return "<procedure>";
    }

    auto builder = ezStringBuilder();
    builder.AppendFormat("<procedure:%s>", m_pName->value().GetData());
    return builder;
}
Пример #5
0
CString BugReport::createReport()
{
  theApp.winCheckFullscreen();

  CString report = "";
  AppendFormat(report, "Emu version  : %s\r\n", VERSION);
  AppendFormat(report, "Emu Type     : %s\r\n",
#ifdef FINAL_VERSION
#ifdef DEV_VERSION
               "Development Version"
#else
               "Normal Version"
#endif
#else
               "Debug Version"
#endif
               );

  if(emulating) {
    AppendFormat(report, "File         : %s\r\n", theApp.szFile);

    char buffer[20];
    if(theApp.cartridgeType == 0) {
      u32 check = 0;
      for(int i = 0; i < 0x4000; i += 4) {
        check += *((u32 *)&bios[i]);
      }
      AppendFormat(report, "BIOS Checksum: %08X\r\n", check);

      strncpy(buffer, (const char *)&rom[0xa0], 12);
      buffer[12] = 0;
      AppendFormat(report, "Internal name: %s\r\n", buffer);
      
      strncpy(buffer, (const char *)&rom[0xac], 4);
      buffer[4] = 0;
      AppendFormat(report, "Game code    : %s\r\n", buffer);

      CString res = "";
      u32 *p = (u32 *)rom;
      u32 *end = (u32 *)((char *)rom+theApp.romSize);
      while(p  < end) {
        u32 d = READ32LE(p);
    
        if(d == 0x52504545) {
          if(memcmp(p, "EEPROM_", 7) == 0) {
            res += (const char *)p;
            res += ' ';
          }
        } else if (d == 0x4D415253) {
          if(memcmp(p, "SRAM_", 5) == 0) {
            res += (const char *)p;
            res += ' ';
          }
        } else if (d == 0x53414C46) {
          if(memcmp(p, "FLASH1M_", 8) == 0) {
            res += (const char *)p;
            res += ' ';
          }
        } else if(memcmp(p, "FLASH", 5) == 0) {
          res += (const char *)p;
          res += ' ';
        } else if (d == 0x52494953) {
          if(memcmp(p, "SIIRTC_V", 8) == 0) {
            res += (const char *)p;
            res += ' ';
          }
        }
        p++;
      }
      if(res.GetLength() > 0)
        AppendFormat(report, "Cart Save    : %s\r\n", res);
    } else if(theApp.cartridgeType == 1) {
      strncpy(buffer, (const char *)&gbRom[0x134], 15);
      buffer[15] = 0;
      AppendFormat(report, "Game title   : %s\r\n", buffer);
    }
  }
  
  AppendFormat(report, "Using BIOS   : %d\r\n", theApp.useBiosFile);
  AppendFormat(report, "Skip BIOS    : %d\r\n", theApp.skipBiosFile);
  AppendFormat(report, "Disable SFX  : %d\r\n", cpuDisableSfx);
  AppendFormat(report, "Skip intro   : %d\r\n", theApp.removeIntros);
  AppendFormat(report, "Throttle     : %d\r\n", theApp.throttle);
  AppendFormat(report, "Rewind       : %d\r\n", theApp.rewindTimer);
  AppendFormat(report, "Auto frame   : %d\r\n", theApp.autoFrameSkip);
  AppendFormat(report, "Video option : %d\r\n", theApp.videoOption);
  AppendFormat(report, "Render type  : %d\r\n", theApp.renderMethod);
  AppendFormat(report, "Color depth  : %d\r\n", systemColorDepth);
  AppendFormat(report, "Red shift    : %08x\r\n", systemRedShift);
  AppendFormat(report, "Green shift  : %08x\r\n", systemGreenShift);
  AppendFormat(report, "Blue shift   : %08x\r\n", systemBlueShift);
  AppendFormat(report, "Layer setting: %04X\r\n", layerSettings);
  AppendFormat(report, "Save type    : %d (%d)\r\n", 
               theApp.winSaveType, cpuSaveType);
  AppendFormat(report, "Flash size   : %08X (%08x)\r\n", 
               theApp.winFlashSize, flashSize);
  AppendFormat(report, "RTC          : %d (%d)\r\n", theApp.winRtcEnable,
               rtcIsEnabled());
  AppendFormat(report, "AGBPrint     : %d\r\n", agbPrintIsEnabled());
  AppendFormat(report, "Speed toggle : %d\r\n", theApp.speedupToggle);
  AppendFormat(report, "Synchronize  : %d\r\n", synchronize);
  AppendFormat(report, "Sound OFF    : %d\r\n", soundOffFlag);
  AppendFormat(report, "Channels     : %04x\r\n", soundGetEnable() & 0x30f);
  AppendFormat(report, "Old Sync     : %d\r\n", theApp.useOldSync);
  AppendFormat(report, "Priority     : %d\r\n", theApp.threadPriority);
  AppendFormat(report, "Filters      : %d (%d)\r\n", theApp.filterType, theApp.ifbType);
  AppendFormat(report, "Cheats       : %d\r\n", cheatsNumber);
  AppendFormat(report, "GB Cheats    : %d\r\n", gbCheatNumber);
  AppendFormat(report, "GB Emu Type  : %d\r\n", gbEmulatorType);

  return report;
}