mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +02:00
Initial work on homebrew return to loader
This commit is contained in:
38
arm9/source/patches/homebrew/BootstubPatchCode.h
Normal file
38
arm9/source/patches/homebrew/BootstubPatchCode.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "sections.h"
|
||||
#include "LoaderInfo.h"
|
||||
#include "patches/PatchCode.h"
|
||||
|
||||
DEFINE_SECTION_SYMBOLS(patch_bootstub);
|
||||
|
||||
extern IReadSectorsPatchCode::ReadSectorsFunc patch_bootstub_arm9reboot_readSdSectors_address;
|
||||
extern const void* patch_bootstub_arm9reboot_dldi_address;
|
||||
extern const char* patch_bootstub_arm9reboot_launcher_path;
|
||||
extern loader_info_t patch_bootstub_arm9reboot_loader_info;
|
||||
|
||||
extern "C" void patch_bootstub_arm9reboot(void);
|
||||
extern "C" void patch_bootstub_arm7reboot(void);
|
||||
|
||||
class BootstubPatchCode : public PatchCode
|
||||
{
|
||||
public:
|
||||
BootstubPatchCode(PatchHeap& patchHeap, void* dldi, const char* launcherPath, const loader_info_t* loaderInfo,
|
||||
const IReadSectorsPatchCode* readSectorsPatchCode)
|
||||
: PatchCode(SECTION_START(patch_bootstub), SECTION_SIZE(patch_bootstub), patchHeap)
|
||||
{
|
||||
patch_bootstub_arm9reboot_dldi_address = dldi;
|
||||
patch_bootstub_arm9reboot_readSdSectors_address = readSectorsPatchCode->GetReadSectorsFunction();
|
||||
patch_bootstub_arm9reboot_launcher_path = launcherPath;
|
||||
patch_bootstub_arm9reboot_loader_info = *loaderInfo;
|
||||
}
|
||||
|
||||
const void* GetArm9RebootFunction() const
|
||||
{
|
||||
return GetAddressAtTarget((void*)patch_bootstub_arm9reboot);
|
||||
}
|
||||
|
||||
const void* GetArm7RebootFunction() const
|
||||
{
|
||||
return GetAddressAtTarget((void*)patch_bootstub_arm7reboot);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user