mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 01:06:50 +02:00
@@ -3,36 +3,30 @@
|
||||
#include "thumbInstructions.h"
|
||||
#include "patches/PatchCode.h"
|
||||
#include "../IReadSectorsPatchCode.h"
|
||||
#include "DsttSdStopTransmissionPatchCode.h"
|
||||
#include "DsttReadSdHelperPatchCode.h"
|
||||
|
||||
DEFINE_SECTION_SYMBOLS(dstt_readsd);
|
||||
DEFINE_SECTION_SYMBOLS(dstt_readsd_stopTransmission);
|
||||
|
||||
extern "C" void dstt_readSd(u32 srcSector, void* dst, u32 sectorCount);
|
||||
extern "C" void dstt_stopTransmission();
|
||||
|
||||
extern u32 dstt_readSd_applySectorCommand_address;
|
||||
extern u32 dstt_waitDataReady_address;
|
||||
extern u32 dstt_transferData_address;
|
||||
extern u32 dstt_stopTransmission_address;
|
||||
extern u16 dstt_readSd_sdsc_shift;
|
||||
|
||||
class DsttReadSdStopTransmissionPatchCode : public PatchCode
|
||||
{
|
||||
public:
|
||||
explicit DsttReadSdStopTransmissionPatchCode(PatchHeap& patchHeap)
|
||||
: PatchCode(SECTION_START(dstt_readsd_stopTransmission), SECTION_SIZE(dstt_readsd_stopTransmission), patchHeap) { }
|
||||
|
||||
const void* GetStopTransmissionFunction() const
|
||||
{
|
||||
return GetAddressAtTarget((void*)dstt_stopTransmission);
|
||||
}
|
||||
};
|
||||
|
||||
class DsttReadSdPatchCode : public PatchCode, public IReadSectorsPatchCode
|
||||
{
|
||||
public:
|
||||
explicit DsttReadSdPatchCode(PatchHeap& patchHeap,
|
||||
const DsttReadSdStopTransmissionPatchCode* dsttReadSdStopTransmissionPatchCode)
|
||||
const DsttSdStopTransmissionPatchCode* dsttSdStopTransmissionPatchCode,
|
||||
const DsttReadSdHelperPatchCode* dsttReadSdHelperPatchCode)
|
||||
: PatchCode(SECTION_START(dstt_readsd), SECTION_SIZE(dstt_readsd), patchHeap)
|
||||
{
|
||||
dstt_stopTransmission_address = (u32)dsttReadSdStopTransmissionPatchCode->GetStopTransmissionFunction();
|
||||
dstt_readSd_applySectorCommand_address = (u32)dsttReadSdHelperPatchCode->GetApplySectorCommandFunction();
|
||||
dstt_stopTransmission_address = (u32)dsttSdStopTransmissionPatchCode->GetStopTransmissionFunction();
|
||||
dstt_waitDataReady_address = (u32)dsttReadSdHelperPatchCode->GetWaitDataReadyFunction();
|
||||
dstt_transferData_address = (u32)dsttReadSdHelperPatchCode->GetTransferDataFunction();
|
||||
}
|
||||
|
||||
const ReadSectorsFunc GetReadSectorsFunction() const override
|
||||
|
||||
Reference in New Issue
Block a user