mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 17:26:48 +02:00
Refactored platform code to use interfaces for patch code with a special feature and improved patch code file names
This commit is contained in:
31
arm9/source/patches/arm7/VerifySavePatchCode.h
Normal file
31
arm9/source/patches/arm7/VerifySavePatchCode.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "sections.h"
|
||||
#include "patches/PatchCode.h"
|
||||
#include "patches/ISectorRemapPatchCode.h"
|
||||
#include "patches/platform/IReadSectorsPatchCode.h"
|
||||
|
||||
DEFINE_SECTION_SYMBOLS(verifysave);
|
||||
|
||||
extern "C" void verifysave_asm(u32, u32 saveSrc, void* memoryDst, u32 byteLength);
|
||||
|
||||
extern u32 verifysave_tmpBufferPtr;
|
||||
extern u32 verifysave_save_offset_to_sd_sector_asm_address;
|
||||
extern u32 verifysave_sdread_asm_address;
|
||||
|
||||
class VerifySavePatchCode : public PatchCode
|
||||
{
|
||||
public:
|
||||
VerifySavePatchCode(PatchHeap& patchHeap, const ISectorRemapPatchCode* sectorRemapPatchCode,
|
||||
const IReadSectorsPatchCode* readSectorsPatchCode, void* tmpBuffer)
|
||||
: PatchCode(SECTION_START(verifysave), SECTION_SIZE(verifysave), patchHeap)
|
||||
{
|
||||
verifysave_save_offset_to_sd_sector_asm_address = (u32)sectorRemapPatchCode->GetRemapFunction();
|
||||
verifysave_sdread_asm_address = (u32)readSectorsPatchCode->GetReadSectorsFunction();
|
||||
verifysave_tmpBufferPtr = (u32)tmpBuffer;
|
||||
}
|
||||
|
||||
const void* GetVerifySaveFunction() const
|
||||
{
|
||||
return GetAddressAtTarget((void*)verifysave_asm);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user