当前位置: 首页>>代码示例>>C++>>正文


C++ PanicAlertT函数代码示例

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


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

示例1: NO_UID

std::string CVolumeGC::GetUniqueID() const
{
  static const std::string NO_UID("NO_UID");
  if (m_pReader == nullptr)
    return NO_UID;

  char ID[6];

  if (!Read(0, sizeof(ID), reinterpret_cast<u8*>(ID)))
  {
    PanicAlertT("Failed to read unique ID from disc image");
    return NO_UID;
  }

  return DecodeString(ID);
}
开发者ID:Antidote,项目名称:dolphin,代码行数:16,代码来源:VolumeGC.cpp

示例2: _dbg_assert_msg_

u8* WiiWAD::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset)
{
	if (_Size > 0)
	{
		u8* pTmpBuffer = new u8[_Size];
		_dbg_assert_msg_(BOOT, pTmpBuffer!=nullptr, "WiiWAD: Can't allocate memory for WAD entry");

		if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
		{
			ERROR_LOG(DISCIO, "WiiWAD: Could not read from file");
			PanicAlertT("WiiWAD: Could not read from file");
		}
		return pTmpBuffer;
	}
	return nullptr;
}
开发者ID:70michal19,项目名称:dolphin,代码行数:16,代码来源:WiiWad.cpp

示例3: PanicAlertT

s32 MemoryCard::Write(u32 destaddress, s32 length, u8 *srcaddress)
{
	if (!IsAddressInBounds(destaddress))
	{
		PanicAlertT("MemoryCard: Write called with invalid destination address, %x",
					destaddress);
		return -1;
	}

	{
		std::unique_lock<std::mutex> l(m_flush_mutex);
		memcpy(&m_memcard_data[destaddress], srcaddress, length);
	}
	MakeDirty();
	return length;
}
开发者ID:70michal19,项目名称:dolphin,代码行数:16,代码来源:GCMemcardRaw.cpp

示例4: operator

    bool operator()(const BootParameters::Executable& executable) const
    {
      NOTICE_LOG(BOOT, "Booting from executable: %s", executable.path.c_str());

      if (!executable.reader->IsValid())
        return false;

      if (!executable.reader->LoadIntoMemory())
      {
        PanicAlertT("Failed to load the executable to memory.");
        return false;
      }

      SetDefaultDisc();

      SetupMSR();
      SetupBAT(config.bWii);
      CopyDefaultExceptionHandlers();

      if (config.bWii)
      {
        PowerPC::ppcState.spr[SPR_HID0] = 0x0011c464;
        PowerPC::ppcState.spr[SPR_HID4] = 0x82000000;

        // Set a value for the SP. It doesn't matter where this points to,
        // as long as it is a valid location. This value is taken from a homebrew binary.
        PowerPC::ppcState.gpr[1] = 0x8004d4bc;

        // Because there is no TMD to get the requested system (IOS) version from,
        // we default to IOS58, which is the version used by the Homebrew Channel.
        SetupWiiMemory();
        IOS::HLE::GetIOS()->BootIOS(Titles::IOS(58));
      }
      else
      {
        SetupGCMemory();
      }

      PC = executable.reader->GetEntryPoint();

      if (executable.reader->LoadSymbols() || LoadMapFromFilename())
      {
        UpdateDebugger_MapLoaded();
        HLE::PatchFunctions();
      }
      return true;
    }
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:47,代码来源:Boot.cpp

示例5: ext

void SConfig::CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion,
                               bool isSlotA)
{
  std::string ext("." + gameRegion + ".raw");
  if (memcardPath.empty())
  {
    // Use default memcard path if there is no user defined name
    std::string defaultFilename = isSlotA ? GC_MEMCARDA : GC_MEMCARDB;
    memcardPath = File::GetUserPath(D_GCUSER_IDX) + defaultFilename + ext;
  }
  else
  {
    std::string filename = memcardPath;
    std::string region = filename.substr(filename.size() - 7, 3);
    bool hasregion = false;
    hasregion |= region.compare(USA_DIR) == 0;
    hasregion |= region.compare(JAP_DIR) == 0;
    hasregion |= region.compare(EUR_DIR) == 0;
    if (!hasregion)
    {
      // filename doesn't have region in the extension
      if (File::Exists(filename))
      {
        // If the old file exists we are polite and ask if we should copy it
        std::string oldFilename = filename;
        filename.replace(filename.size() - 4, 4, ext);
        if (PanicYesNoT("Memory Card filename in Slot %c is incorrect\n"
                        "Region not specified\n\n"
                        "Slot %c path was changed to\n"
                        "%s\n"
                        "Would you like to copy the old file to this new location?\n",
                        isSlotA ? 'A' : 'B', isSlotA ? 'A' : 'B', filename.c_str()))
        {
          if (!File::Copy(oldFilename, filename))
            PanicAlertT("Copy failed");
        }
      }
      memcardPath = filename;  // Always correct the path!
    }
    else if (region.compare(gameRegion) != 0)
    {
      // filename has region, but it's not == gameRegion
      // Just set the correct filename, the EXI Device will create it if it doesn't exist
      memcardPath = filename.replace(filename.size() - ext.size(), ext.size(), ext);
    }
  }
}
开发者ID:TwitchPlaysPokemon,项目名称:dolphinWatch,代码行数:47,代码来源:ConfigManager.cpp

示例6: PanicAlertT

void GamepadPage::SaveProfile(wxCommandEvent&)
{
	std::string fname;
	GamepadPage::GetProfilePath(fname);
	File::CreateFullPath(fname);

	if (false == fname.empty())
	{
		IniFile inifile;
		controller->SaveConfig(inifile.GetOrCreateSection("Profile"));
		inifile.Save(fname);
		
		m_config_dialog->UpdateProfileComboBox();
	}
	else
		PanicAlertT("You must enter a valid profile name.");
}
开发者ID:madnessw,项目名称:thesnow,代码行数:17,代码来源:InputConfigDiag.cpp

示例7: SetState

void SetState(EState _State)
{
	switch (_State)
	{
	case CORE_PAUSE:
		CCPU::EnableStepping(true);  // Break
		Wiimote::Pause();
		break;
	case CORE_RUN:
		CCPU::EnableStepping(false);
		Wiimote::Resume();
		break;
	default:
		PanicAlertT("Invalid state");
		break;
	}
}
开发者ID:dragonbane0,项目名称:Dolphin-Zelda-Build-OLD-,代码行数:17,代码来源:CORE.CPP

示例8: MemoryCardBase

GCMemcardDirectory::GCMemcardDirectory(const std::string& directory, int slot, u16 sizeMb,
                                       bool ascii, DiscIO::Country card_region, int gameId)
    : MemoryCardBase(slot, sizeMb), m_GameId(gameId), m_LastBlock(-1), m_hdr(slot, sizeMb, ascii),
      m_bat1(sizeMb), m_saves(0), m_SaveDirectory(directory), m_exiting(false)
{
  // Use existing header data if available
  if (File::Exists(m_SaveDirectory + MC_HDR))
  {
    File::IOFile hdrfile((m_SaveDirectory + MC_HDR), "rb");
    hdrfile.ReadBytes(&m_hdr, BLOCK_SIZE);
  }

  std::vector<std::string> rFilenames = DoFileSearch({".gci"}, {m_SaveDirectory});

  if (rFilenames.size() > 112)
  {
    Core::DisplayMessage("Warning: There are more than 112 save files on this memory card.\n"
                         " Only loading the first 112 in the folder, unless the game ID is the "
                         "same as the current game's ID",
                         4000);
  }

  for (const std::string& gciFile : rFilenames)
  {
    if (m_saves.size() == DIRLEN)
    {
      PanicAlertT(
          "There are too many GCI files in the folder\n%s.\nOnly the first 127 will be available",
          m_SaveDirectory.c_str());
      break;
    }
    int index = LoadGCI(gciFile, card_region, m_saves.size() > 112);
    if (index != NO_INDEX)
    {
      m_loaded_saves.push_back(m_saves.at(index).m_gci_header.GCI_FileName());
    }
  }

  m_loaded_saves.clear();
  m_dir1.fixChecksums();
  m_dir2 = m_dir1;
  m_bat2 = m_bat1;

  m_flush_thread = std::thread(&GCMemcardDirectory::FlushThread, this);
}
开发者ID:Antidote,项目名称:dolphin,代码行数:45,代码来源:GCMemcardDirectory.cpp

示例9: PanicAlertT

// called from ---GUI--- thread and ---NETPLAY--- thread (client side)
bool NetPlayClient::StopGame()
{
	if (!m_is_running.load())
	{
		PanicAlertT("Game isn't running!");
		return false;
	}

	m_dialog->AppendChat(" -- STOPPING GAME -- ");

	m_is_running.store(false);
	NetPlay_Disable();

	// stop game
	m_dialog->StopGame();

	return true;
}
开发者ID:moncefmechri,项目名称:dolphin,代码行数:19,代码来源:NetPlayClient.cpp

示例10: SetState

void SetState(EState _State)
{
	switch (_State)
	{
	case CORE_UNINITIALIZED:
		Stop();
		break;
	case CORE_PAUSE:
		CCPU::EnableStepping(true);  // Break
		break;
	case CORE_RUN:
		CCPU::EnableStepping(false);
		break;
	default:
		PanicAlertT("Invalid state");
		break;
	}
}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:18,代码来源:Core.cpp

示例11: GetScheduledEventsSummary

std::string GetScheduledEventsSummary()
{
	Event *ptr = first;
	std::string text = "Scheduled events\n";
	text.reserve(1000);
	while (ptr)
	{
		unsigned int t = ptr->type;
		if (t >= event_types.size())
			PanicAlertT("Invalid event type %i", t);
		const char *name = event_types[ptr->type].name;
		if (!name)
			name = "[unknown]";
		text += StringFromFormat("%s : %i %08x%08x\n", event_types[ptr->type].name, ptr->time, ptr->userdata >> 32, ptr->userdata);
		ptr = ptr->next;
	}
	return text;
}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:18,代码来源:CoreTiming.cpp

示例12: SetFilePointer

void DriveReader::GetBlock(u64 block_num, u8* out_ptr)
{
	u8* const lpSector = new u8[m_blocksize];
#ifdef _WIN32
	u32 NotUsed;
	u64 offset = m_blocksize * block_num;
	LONG off_low = (LONG)offset & 0xFFFFFFFF;
	LONG off_high = (LONG)(offset >> 32);
	SetFilePointer(hDisc, off_low, &off_high, FILE_BEGIN);
	if (!ReadFile(hDisc, lpSector, m_blocksize, (LPDWORD)&NotUsed, nullptr))
		PanicAlertT("Disc Read Error");
#else
	file_.Seek(m_blocksize * block_num, SEEK_SET);
	file_.ReadBytes(lpSector, m_blocksize);
#endif
	memcpy(out_ptr, lpSector, m_blocksize);
	delete[] lpSector;
}
开发者ID:Catnips,项目名称:dolphin,代码行数:18,代码来源:DriveBlob.cpp

示例13: GetScheduledEventsSummary

std::string GetScheduledEventsSummary()
{
	Event *ptr = first;
	std::string text = "Scheduled events\n";
	text.reserve(1000);
	while (ptr)
	{
		unsigned int t = ptr->type;
		if (t >= event_types.size())
			PanicAlertT("Invalid event type %i", t);

		const std::string& name = event_types[ptr->type].name;

		text += StringFromFormat("%s : %" PRIi64 " %016" PRIx64 "\n", name.c_str(), ptr->time, ptr->userdata);
		ptr = ptr->next;
	}
	return text;
}
开发者ID:calmbrain,项目名称:dolphin,代码行数:18,代码来源:CoreTiming.cpp

示例14: DoState

void DoState(PointerWrap& p)
{
  // By waiting for the DVD thread to be done working, we ensure
  // that s_request_queue will be empty and that the DVD thread
  // won't be touching anything while this function runs.
  WaitUntilIdle();

  // Move all results from s_result_queue to s_result_map because
  // PointerWrap::Do supports std::map but not Common::SPSCQueue.
  // This won't affect the behavior of FinishRead.
  ReadResult result;
  while (s_result_queue.Pop(result))
    s_result_map.emplace(result.first.id, std::move(result));

  // Both queues are now empty, so we don't need to savestate them.
  p.Do(s_result_map);
  p.Do(s_next_id);

  // s_disc isn't savestated (because it points to files on the
  // local system). Instead, we check that the status of the disc
  // is the same as when the savestate was made. This won't catch
  // cases of having the wrong disc inserted, though.
  // TODO: Check the game ID, disc number, revision?
  bool had_disc = HasDisc();
  p.Do(had_disc);
  if (had_disc != HasDisc())
  {
    if (had_disc)
      PanicAlertT("An inserted disc was expected but not found.");
    else
      s_disc.reset();
  }

  // TODO: Savestates can be smaller if the buffers of results aren't saved,
  // but instead get re-read from the disc when loading the savestate.

  // TODO: It would be possible to create a savestate faster by stopping
  // the DVD thread regardless of whether there are pending requests.

  // After loading a savestate, the debug log in FinishRead will report
  // screwed up times for requests that were submitted before the savestate
  // was made. Handling that properly may be more effort than it's worth.
}
开发者ID:booto,项目名称:dolphin,代码行数:43,代码来源:DVDThread.cpp

示例15: PanicAlertT

// called from ---GUI--- thread
bool NetPlayServer::RequestStartGame()
{
  if (m_settings.m_SyncSaveData && m_players.size() > 1)
  {
    if (!SyncSaveData())
    {
      PanicAlertT("Error synchronizing save data!");
      return false;
    }

    m_start_pending = true;
  }
  else
  {
    return StartGame();
  }

  return true;
}
开发者ID:MerryMage,项目名称:dolphin,代码行数:20,代码来源:NetPlayServer.cpp


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