DSTT: Add DMA support and reduce code size (#162) Fixes #111

This commit is contained in:
lifehackerhansol
2026-05-10 00:37:38 -07:00
committed by GitHub
parent ae034ae1f6
commit e227cff9ee
12 changed files with 452 additions and 140 deletions

View File

@@ -1,7 +1,10 @@
#pragma once
#include "../LoaderPlatform.h"
#include "DsttReadSdPatchCode.h"
#include "DsttReadSdDmaPatchCode.h"
#include "DsttWriteSdPatchCode.h"
#include "DsttSdStopTransmissionPatchCode.h"
#include "DsttReadSdHelperPatchCode.h"
/// @brief Implementation of LoaderPlatform for the DSTT flashcard
class DsttLoaderPlatform : public LoaderPlatform
@@ -15,11 +18,30 @@ public:
return new DsttReadSdPatchCode(patchHeap,
patchCodeCollection.GetOrAddSharedPatchCode([&]
{
return new DsttReadSdStopTransmissionPatchCode(patchHeap);
return new DsttSdStopTransmissionPatchCode(patchHeap);
}),
patchCodeCollection.GetOrAddSharedPatchCode([&]
{
return new DsttReadSdHelperPatchCode(patchHeap);
}));
});
}
const IReadSectorsDmaPatchCode* CreateSdReadDmaPatchCode(PatchCodeCollection& patchCodeCollection,
PatchHeap& patchHeap, const void* miiCardDmaCopy32Ptr) const override
{
return patchCodeCollection.AddUniquePatchCode<DsttReadSdDmaPatchCode>(
patchHeap, miiCardDmaCopy32Ptr,
patchCodeCollection.GetOrAddSharedPatchCode([&]
{
return new DsttSdStopTransmissionPatchCode(patchHeap);
}),
patchCodeCollection.GetOrAddSharedPatchCode([&]
{
return new DsttReadSdHelperPatchCode(patchHeap);
}));
}
const IWriteSectorsPatchCode* CreateSdWritePatchCode(
PatchCodeCollection& patchCodeCollection, PatchHeap& patchHeap) const override
{
@@ -35,5 +57,7 @@ public:
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
bool HasDmaSdReads() const override { return true; }
bool InitializeSdCard() override;
};