mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +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/IReadSectorsDmaPatchCode.h
Normal file
26
arm9/source/patches/platform/IReadSectorsDmaPatchCode.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
/// @brief Abstract base class for patch code implementing dma sector reads
|
||||
class IReadSectorsDmaPatchCode
|
||||
{
|
||||
protected:
|
||||
IReadSectorsDmaPatchCode() { }
|
||||
|
||||
public:
|
||||
/// @brief Pointer to a function for reading a single SD sector using the given dmaChannel.
|
||||
/// In first sector of batch read, previousSrcSector will be 0.
|
||||
/// On further reads previousSrcSector will contains the previous srcSector
|
||||
/// which can be used to continue a sequential read.
|
||||
typedef void (*ReadSectorsDmaFunc)(u32 srcSector, u32 previousSrcSector, u32 dmaChannel, void* dst);
|
||||
|
||||
/// @brief Pointer to a function for finishing a batch of dma reads.
|
||||
typedef void (*ReadSectorsDmaFinishFunc)(void);
|
||||
|
||||
/// @brief Gets a pointer to the dma SD read function in the patch code.
|
||||
/// @return The pointer to the dma SD read function.
|
||||
virtual const ReadSectorsDmaFunc GetSdReadDmaFunction() const = 0;
|
||||
|
||||
/// @brief Gets a pointer to the dma SD read finish function in the patch code.
|
||||
/// @return The pointer to the dma SD read finish function.
|
||||
virtual const ReadSectorsDmaFinishFunc GetSdReadDmaFinishFunction() const = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user