mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-03 01:36:58 +02:00
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
#include "../LoaderPlatform.h"
|
|
#include "IsNitroSdReadPatchCode.h"
|
|
#include "IsNitroSdWritePatchCode.h"
|
|
#include "sharedMemory.h"
|
|
|
|
/// @brief Implementation of LoaderPlatform for the IS-NITRO-EMULATOR with agb semihosting
|
|
class IsNitroLoaderPlatform : public LoaderPlatform
|
|
{
|
|
public:
|
|
const IReadSectorsPatchCode* CreateSdReadPatchCode(
|
|
PatchCodeCollection& patchCodeCollection, PatchHeap& patchHeap) const override
|
|
{
|
|
return patchCodeCollection.GetOrAddSharedPatchCode([&]
|
|
{
|
|
return new IsNitroSdReadPatchCode(patchHeap, GetAgbRamPtr());
|
|
});
|
|
}
|
|
|
|
const IWriteSectorsPatchCode* CreateSdWritePatchCode(
|
|
PatchCodeCollection& patchCodeCollection, PatchHeap& patchHeap) const override
|
|
{
|
|
return patchCodeCollection.GetOrAddSharedPatchCode([&]
|
|
{
|
|
return new IsNitroSdWritePatchCode(patchHeap, GetAgbRamPtr());
|
|
});
|
|
}
|
|
|
|
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot2; }
|
|
|
|
private:
|
|
u32 GetAgbRamPtr() const
|
|
{
|
|
return *(vu32*)&TWL_SHARED_MEMORY->ntrSharedMem.isDebuggerData[0x1C];
|
|
}
|
|
};
|