Get rid of duplicate directory

This commit is contained in:
Mow
2025-12-06 09:16:48 -05:00
committed by GitHub
parent 79018dee0d
commit 8550b36dc6
4 changed files with 0 additions and 127 deletions

View File

@@ -1,45 +0,0 @@
#include "common.h"
#include "../../../PatchContext.h"
#include "PokemonIrApPatchAsm.h"
#include "PokemonIrApPatch.h"
const void* PokemonIrApPatch::InsertPatch(PatchContext& patchContext)
{
ConfigurePatch();
return patchContext.GetPatchCodeCollection().AddUniquePatchCode<PokemonIrApPatchCode>
(
patchContext.GetPatchHeap(),
next ? next->InsertPatch(patchContext) : nullptr
)->GetPatchFunction();
}
void PokemonIrApPatch::ConfigurePatch() const {
switch (_version)
{
// All of these offsets are luckily region-independent
case PokemonIrVersion::Hgss:
{
pokemonirappatch_overlayId = 1;
pokemonirappatch_offset = 0xD2C + 0x12;
break;
}
case PokemonIrVersion::Bw1:
{
pokemonirappatch_overlayId = 231;
pokemonirappatch_offset = 0x1B8 + 0x12;
break;
}
case PokemonIrVersion::Bw2:
{
pokemonirappatch_overlayId = 338;
pokemonirappatch_offset = 0x1B8 + 0x12;
break;
}
default:
{
LOG_WARNING("Unsupported Pokemon IR version\n");
pokemonirappatch_overlayId = 0xFFFFFFFF;
break;
}
}
}

View File

@@ -1,16 +0,0 @@
#pragma once
#include "../OverlayPatch.h"
#include "PokemonIrVersion.h"
/// @brief Arm9 overlay patch to disable the IR-sensor anti-piracy in Pokemon HeartGold, SoulSilver, Black, White, Black 2, and White 2.
class PokemonIrApPatch : public OverlayPatch
{
public:
PokemonIrApPatch(PokemonIrVersion version) : _version(version) { }
const void* InsertPatch(PatchContext& patchContext) override;
private:
PokemonIrVersion _version;
void ConfigurePatch() const;
};

View File

@@ -1,26 +0,0 @@
#pragma once
#include "sections.h"
#include "../../../PatchCode.h"
DEFINE_SECTION_SYMBOLS(pokemonirappatch);
extern "C" void pokemonirappatch_entry();
extern u32 pokemonirappatch_overlayId;
extern u32 pokemonirappatch_offset;
extern u32 pokemonirappatch_nextAddress;
class PokemonIrApPatchCode : public PatchCode
{
public:
PokemonIrApPatchCode(PatchHeap& patchHeap, const void* nextPatch)
: PatchCode(SECTION_START(pokemonirappatch), SECTION_SIZE(pokemonirappatch), patchHeap)
{
pokemonirappatch_nextAddress = (u32)nextPatch;
}
const void* GetPatchFunction() const
{
return GetAddressAtTarget((void*)pokemonirappatch_entry);
}
};

View File

@@ -1,40 +0,0 @@
.cpu arm946e-s
.syntax unified
.section "pokemonirappatch", "ax"
.thumb
.global pokemonirappatch_entry
.type pokemonirappatch_entry, %function
pokemonirappatch_entry:
push {r5,lr}
ldmia r5!, {r1, r2} // overlay id, ram address
ldr r0, pokemonirappatch_overlayId
cmp r0, r1
bne continue_to_next
ldr r1, pokemonirappatch_offset
movs r0, #1 // force return value of function to 1 instead of 0
strb r0, [r2, r1]
continue_to_next:
ldr r0, pokemonirappatch_nextAddress
pop {r5,pc}
.balign 4
.global pokemonirappatch_overlayId
pokemonirappatch_overlayId:
.word 0
.global pokemonirappatch_offset
pokemonirappatch_offset:
.word 0
.global pokemonirappatch_nextAddress
pokemonirappatch_nextAddress:
.word 0
.pool
.end