Add support for Slot 2 flashcarts using Compact Flash (#84)

- Supercard CF (SUPERCARDCF)
- GBA Media Player CF (MPCF)
- M3 Adapter CF (M3CF)
- Max Media Dock CF (MMCF)
This commit is contained in:
Edoardo Lolletti
2026-01-10 23:00:39 +01:00
committed by GitHub
parent eac8f7e734
commit 6a97b677a7
22 changed files with 945 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
#include "common.h"
#include "sections.h"
#include "../LoaderPlatform.h"
#include "CompactFlashRegisters.h"
DEFINE_SECTION_SYMBOLS(cf_wait_functions);
extern "C" bool cf_waitCardAvailableForCommands();
extern "C" bool cf_waitNextBlockReady();
extern vu16* cf_waitFunctions_reg_cmd;
class CompactFlashStatusFunctionsPatchCode : public PatchCode
{
public:
CompactFlashStatusFunctionsPatchCode(PatchHeap& patchHeap, const cf_registers_t& registers)
: PatchCode(SECTION_START(cf_wait_functions), SECTION_SIZE(cf_wait_functions), patchHeap)
{
cf_waitFunctions_reg_cmd = registers.command;
}
const void* GetWaitCardAvailableForCommandsFunction() const
{
return GetAddressAtTarget((void*)cf_waitCardAvailableForCommands);
}
const void* GetWaitNextBlockReadyFunction() const
{
return GetAddressAtTarget((void*)cf_waitNextBlockReady);
}
};