bool GB::loadState() { if (loadState(statePath(p_->cpu.saveBasePath(), p_->stateNo))) { p_->cpu.setOsdElement(newStateLoadedOsdElement(p_->stateNo)); return true; } return false; }
bool GB::saveState(gambatte::uint_least32_t const *videoBuf, std::ptrdiff_t pitch) { if (saveState(videoBuf, pitch, statePath(p_->cpu.saveBasePath(), p_->stateNo))) { p_->cpu.setOsdElement(newStateSavedOsdElement(p_->stateNo)); return true; } return false; }
void GB::selectState(int n) { n -= (n / 10) * 10; p_->stateNo = n < 0 ? n + 10 : n; #ifndef GAMBATTE_NO_OSD if (p_->cpu.loaded()) p_->cpu.setOsdElement(newSaveStateOsdElement(statePath(p_->cpu.saveBasePath(), p_->stateNo), p_->stateNo)); #endif }
bool GB::saveState(const gambatte::PixelType *const videoBuf, const int pitch) { if (p_->cpu.loaded()) { #ifndef GAMBATTE_NO_OSD p_->cpu.setOsdElement(newStateSavedOsdElement(p_->stateNo)); #endif return saveState(videoBuf, pitch, statePath(p_->cpu.saveBasePath(), p_->stateNo)); } return false; }
void GB::selectState(int n) { n -= (n / 10) * 10; p_->stateNo = n < 0 ? n + 10 : n; if (p_->cpu.loaded()) { std::string const &path = statePath(p_->cpu.saveBasePath(), p_->stateNo); p_->cpu.setOsdElement(newSaveStateOsdElement(path, p_->stateNo)); } }
bool GB::loadState() { if (loadState(statePath(p_->cpu.saveBasePath(), p_->stateNo))) { #ifndef GAMBATTE_NO_OSD p_->cpu.setOsdElement(newStateLoadedOsdElement(p_->stateNo)); #endif return true; } return false; }
bool GB::saveState(gambatte::PixelType const *videoBuf, std::ptrdiff_t pitch) { if (saveState(videoBuf, pitch, statePath(p_->cpu.saveBasePath(), p_->stateNo))) { #ifndef GAMBATTE_NO_OSD p_->cpu.setOsdElement(newStateSavedOsdElement(p_->stateNo)); #endif return true; } return false; }
void BinaryFileTreeDataStateBase::saveState(Node* a_pNode, uint a_uiStateId) { BinaryFileTreeNode* pNode = as<BinaryFileTreeNode*>(a_pNode); o_assert(pNode); BinaryFileTreeDataBase* pDB = static_cast<BinaryFileTreeDataBase*>(pNode->getDataBase()); const string & path = statePath(a_pNode, a_uiStateId); if(NOT(boost::filesystem::exists(path.c_str()))) { boost::filesystem::create_directories(path.c_str()); } const BinaryFileTreeNode::data_vector& nodeData = pNode->m_Data; BinaryFileTreeNode::data_vector::const_iterator it = nodeData.begin(); BinaryFileTreeNode::data_vector::const_iterator end = nodeData.end(); for(;it!=end;++it) { const phantom::data& d = *it; saveDataState(d, pDB->getGuid(d), a_pNode, a_uiStateId); } }
void BinaryFileTreeDataStateBase::loadState(Node* a_pNode, uint a_uiStateId) { BinaryFileTreeNode* pNode = as<BinaryFileTreeNode*>(a_pNode); o_assert(pNode); BinaryFileTreeDataBase* pDB = static_cast<BinaryFileTreeDataBase*>(pNode->getDataBase()); o_assert(pDB); const string & path = statePath(a_pNode, a_uiStateId); if (hasStateSaved(a_pNode, a_uiStateId)) { const BinaryFileTreeNode::data_vector& nodeData = pNode->m_Data; BinaryFileTreeNode::data_vector::const_iterator it = nodeData.begin(); BinaryFileTreeNode::data_vector::const_iterator end = nodeData.end(); for(;it!=end;++it) { const phantom::data& d = *it; loadDataState(d, pDB->getGuid(d), a_pNode, a_uiStateId); } } }
bool GB::loadState() { return loadState(statePath(p_->cpu.saveBasePath(), p_->stateNo), true); }