Optimize space usage of supercard platform (#74)

This commit is contained in:
Edoardo Lolletti
2025-12-28 17:38:28 +01:00
committed by GitHub
parent 9f6311014d
commit 7134c4b330
8 changed files with 81 additions and 68 deletions

View File

@@ -3,23 +3,32 @@
#include "thumbInstructions.h"
#include "../SdReadPatchCode.h"
DEFINE_SECTION_SYMBOLS(scsd_change_mode);
DEFINE_SECTION_SYMBOLS(scsd_common);
extern "C" void sccmn_changeMode();
extern "C" void sccmn_sdSendClock10();
extern "C" void sccmn_sdio4BitCrc16();
class SuperCardChangeModePatchCode : public PatchCode
{
public:
explicit SuperCardChangeModePatchCode(PatchHeap& patchHeap)
: PatchCode(SECTION_START(scsd_change_mode), SECTION_SIZE(scsd_change_mode), patchHeap) { }
const void* GetScChangeModeFunction() const
{
return GetAddressAtTarget((void*)sccmn_changeMode);
}
};
class SuperCardCommonPatchCode : public PatchCode
{
public:
explicit SuperCardCommonPatchCode(PatchHeap& patchHeap)
: PatchCode(SECTION_START(scsd_common), SECTION_SIZE(scsd_common), patchHeap) { }
const void* GetScChangeModeFunction() const
{
return GetAddressAtTarget((void*)sccmn_changeMode);
}
const void* GetSdSendClock10Function() const
{
return GetAddressAtTarget((void*)sccmn_sdSendClock10);