mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Initial work on implementing support for cheats
This commit is contained in:
25
arm9/source/cheats/UsrCheatRepository.h
Normal file
25
arm9/source/cheats/UsrCheatRepository.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include "fat/File.h"
|
||||
#include "ICheatRepository.h"
|
||||
#include "UsrCheatDat.h"
|
||||
|
||||
class UsrCheatRepository : public ICheatRepository
|
||||
{
|
||||
public:
|
||||
UsrCheatRepository(std::unique_ptr<File> usrCheatDatFile,
|
||||
std::unique_ptr<usr_cheat_index_entry_t[]> sortedIndices, u32 numberOfIndices)
|
||||
: _usrCheatFile(std::move(usrCheatDatFile))
|
||||
, _sortedIndices(std::move(sortedIndices)), _numberOfIndices(numberOfIndices) { }
|
||||
|
||||
std::unique_ptr<GameCheats> GetCheatsForGame(u32 gameCode, u32 headerCrc32) const override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<File> _usrCheatFile;
|
||||
std::unique_ptr<usr_cheat_index_entry_t[]> _sortedIndices;
|
||||
u32 _numberOfIndices;
|
||||
|
||||
const usr_cheat_index_entry_t* FindIndex(u32 gameCode, u32 headerCrc32) const;
|
||||
void ParseCategory(CheatCategory& category, u8*& ptr) const;
|
||||
void ParseCheat(Cheat& cheat, u8*& ptr) const;
|
||||
};
|
||||
Reference in New Issue
Block a user