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:
26
arm9/source/patches/platform/ak2/Ak2SdReadSectorPatchCode.h
Normal file
26
arm9/source/patches/platform/ak2/Ak2SdReadSectorPatchCode.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include "sections.h"
|
||||
#include "thumbInstructions.h"
|
||||
#include "../acekard-common/IoRpgSdWaitForStatePatchCode.h"
|
||||
|
||||
DEFINE_SECTION_SYMBOLS(ak2_sdreadsector);
|
||||
|
||||
extern "C" void ak2_sdReadSector(u32 srcSector, void* dst, u32 sectorCount);
|
||||
|
||||
extern u32 ak2_sdReadSector_sdWaitForState_address;
|
||||
|
||||
class Ak2SdReadSectorPatchCode : public PatchCode
|
||||
{
|
||||
public:
|
||||
explicit Ak2SdReadSectorPatchCode(PatchHeap& patchHeap,
|
||||
const IoRpgSdWaitForStatePatchCode* iorpgSdWaitForStatePatchCode)
|
||||
: PatchCode(SECTION_START(ak2_sdreadsector), SECTION_SIZE(ak2_sdreadsector), patchHeap)
|
||||
{
|
||||
ak2_sdReadSector_sdWaitForState_address = (u32)iorpgSdWaitForStatePatchCode->GetSDWaitForStateFunction();
|
||||
}
|
||||
|
||||
const void* GetSDReadSectorFunction() const
|
||||
{
|
||||
return GetAddressAtTarget((void*)ak2_sdReadSector);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user