mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +02:00
Added check to CardiTaskThreadPatch that the required slot is actually mapped to arm7. Fixes #60
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "SdWritePatchCode.h"
|
||||
#include "../PatchHeap.h"
|
||||
#include "../PatchCodeCollection.h"
|
||||
#include "LoaderPlatformType.h"
|
||||
|
||||
/// @brief Abstract class for platform (flashcard or other sd access method) specific parts of the loader.
|
||||
class LoaderPlatform
|
||||
@@ -38,6 +39,10 @@ public:
|
||||
virtual const SdReadPatchCode* CreateRomReadPatchCode(
|
||||
PatchCodeCollection& patchCodeCollection, PatchHeap& patchHeap) const { return nullptr; }
|
||||
|
||||
/// @brief Returns the type of this loader platform.
|
||||
/// @return The type of this loader platform.
|
||||
virtual LoaderPlatformType GetPlatformType() const = 0;
|
||||
|
||||
/// @brief Checks if the platform supports rom reads directly.
|
||||
/// @return True if the platform supports rom reads, or false otherwise.
|
||||
virtual bool HasRomReads() const { return false; }
|
||||
|
||||
11
arm9/source/patches/platform/LoaderPlatformType.h
Normal file
11
arm9/source/patches/platform/LoaderPlatformType.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
/// @brief Enum representing the type of loader platform.
|
||||
enum class LoaderPlatformType
|
||||
{
|
||||
/// @brief Slot 1 (DS) cartridge.
|
||||
Slot1,
|
||||
|
||||
/// @brief Slot 2 (GBA) cartridge.
|
||||
Slot2
|
||||
};
|
||||
@@ -34,5 +34,7 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
|
||||
bool HasDmaSdReads() const override { return true; }
|
||||
};
|
||||
|
||||
@@ -11,6 +11,8 @@ public:
|
||||
explicit IoRPGLoaderPlatform(u8 ioRpgCmdSdioByte)
|
||||
: _ioRpgCmdSdioByte(ioRpgCmdSdioByte) { }
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
|
||||
bool InitializeSdCard() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -43,5 +43,7 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
|
||||
bool HasDmaSdReads() const override { return true; }
|
||||
};
|
||||
|
||||
@@ -34,5 +34,7 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
|
||||
bool InitializeSdCard() override;
|
||||
};
|
||||
|
||||
@@ -30,4 +30,6 @@ public:
|
||||
return new EZPWriteSectorsPatchCode(patchHeap);
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
};
|
||||
|
||||
@@ -34,5 +34,7 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
|
||||
bool HasDmaSdReads() const override { return true; }
|
||||
};
|
||||
|
||||
@@ -27,6 +27,8 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot2; }
|
||||
|
||||
private:
|
||||
u32 GetAgbRamPtr() const
|
||||
{
|
||||
|
||||
@@ -33,4 +33,6 @@ public:
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
};
|
||||
|
||||
@@ -25,4 +25,6 @@ public:
|
||||
return new MelonDSWriteSdPatchCode(patchHeap);
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
};
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
});
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot1; }
|
||||
|
||||
bool HasRomReads() const override { return true; }
|
||||
|
||||
void PrepareRomBoot(u32 romDirSector, u32 romDirSectorOffset) const override;
|
||||
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
LoaderPlatformType GetPlatformType() const override { return LoaderPlatformType::Slot2; }
|
||||
|
||||
bool InitializeSdCard() override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user