mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +02:00
Initial commit
This commit is contained in:
22
arm7/source/loader/SaveList.cpp
Normal file
22
arm7/source/loader/SaveList.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "common.h"
|
||||
#include <algorithm>
|
||||
#include "SaveList.h"
|
||||
|
||||
const SaveListEntry* SaveList::FindEntry(u32 gameCode)
|
||||
{
|
||||
if (_count != 0)
|
||||
{
|
||||
const auto gameEntry = std::lower_bound(_entries.get(), _entries.get() + _count, gameCode,
|
||||
[] (const SaveListEntry& entry, u32 value)
|
||||
{
|
||||
return entry.GetGameCode() < value;
|
||||
});
|
||||
|
||||
if (gameEntry != _entries.get() + _count && gameEntry->GetGameCode() == gameCode)
|
||||
{
|
||||
return gameEntry;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user