Skip to content

Commit 7fd6846

Browse files
committed
Add sleepInputWriteSignatureAlt
Disables sleep mode in *Face Training*
1 parent 5ffa2c2 commit 7fd6846

6 files changed

Lines changed: 24 additions & 3 deletions

File tree

retail/bootloader/source/arm7/find_arm7.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static const u16 sleepPatchThumbAlt[2] = {0xD002, 0x0440};
8888
static const u32 sleepInputWriteEndSignature1[2] = {0x04000136, 0x027FFFA8};
8989
static const u32 sleepInputWriteEndSignature5[2] = {0x04000136, 0x02FFFFA8};
9090
static const u32 sleepInputWriteSignature[1] = {0x13A04902};
91+
static const u32 sleepInputWriteSignatureAlt[1] = {0x11A05004};
9192
static const u16 sleepInputWriteBeqSignatureThumb[1] = {0xD000};
9293

9394
// RAM clear
@@ -1007,6 +1008,12 @@ u32* findSleepInputWriteOffset(const tNDSHeader* ndsHeader, const module_params_
10071008
endOffset, 0x38,
10081009
sleepInputWriteSignature, 1
10091010
);
1011+
if (!offset) {
1012+
offset = findOffsetBackwards(
1013+
endOffset, 0x3C,
1014+
sleepInputWriteSignatureAlt, 1
1015+
);
1016+
}
10101017
if (!offset) {
10111018
u32 thumbOffset = (u32)findOffsetBackwardsThumb(
10121019
(u16*)endOffset, 0x30,

retail/bootloader/source/arm7/patch_arm7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static void patchSleepInputWrite(const tNDSHeader* ndsHeader, const module_param
302302
}
303303

304304
if (!sleepMode) {
305-
if (*offset == 0x13A04902) {
305+
if (*offset == 0x13A04902 || *offset == 0x11A05004) {
306306
*offset = 0xE1A00000; // nop
307307
} else {
308308
u16* offsetThumb = (u16*)offset;

retail/bootloaderi/source/arm7/find_arm7.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ static const u16 sleepPatchThumbAlt[2] = {0xD002, 0x0440};
8989
static const u32 sleepInputWriteEndSignature1[2] = {0x04000136, 0x027FFFA8};
9090
static const u32 sleepInputWriteEndSignature5[2] = {0x04000136, 0x02FFFFA8};
9191
static const u32 sleepInputWriteSignature[1] = {0x13A04902};
92+
static const u32 sleepInputWriteSignatureAlt[1] = {0x11A05004};
9293
static const u16 sleepInputWriteBeqSignatureThumb[1] = {0xD000};
9394

9495
// RAM clear
@@ -1062,6 +1063,12 @@ u32* findSleepInputWriteOffset(const tNDSHeader* ndsHeader, const module_params_
10621063
endOffset, 0x38,
10631064
sleepInputWriteSignature, 1
10641065
);
1066+
if (!offset) {
1067+
offset = findOffsetBackwards(
1068+
endOffset, 0x3C,
1069+
sleepInputWriteSignatureAlt, 1
1070+
);
1071+
}
10651072
if (!offset) {
10661073
u32 thumbOffset = (u32)findOffsetBackwardsThumb(
10671074
(u16*)endOffset, 0x30,

retail/bootloaderi/source/arm7/patch_arm7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ void patchSleepInputWrite(const tNDSHeader* ndsHeader, const module_params_t* mo
395395
}
396396

397397
if (!sleepMode) {
398-
if (*offset == 0x13A04902) {
398+
if (*offset == 0x13A04902 || *offset == 0x11A05004) {
399399
*offset = 0xE1A00000; // nop
400400
} else {
401401
u16* offsetThumb = (u16*)offset;

retail/cardenginei/arm7/source/patcher/find_arm7.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ static const u16 sleepPatchThumbAlt[2] = {0xD002, 0x0440};
7474
static const u32 sleepInputWriteEndSignature1[2] = {0x04000136, 0x027FFFA8};
7575
static const u32 sleepInputWriteEndSignature5[2] = {0x04000136, 0x02FFFFA8};
7676
static const u32 sleepInputWriteSignature[1] = {0x13A04902};
77+
static const u32 sleepInputWriteSignatureAlt[1] = {0x11A05004};
7778
static const u16 sleepInputWriteBeqSignatureThumb[1] = {0xD000};
7879

7980
// Card check pull out
@@ -860,6 +861,12 @@ u32* findSleepInputWriteOffset(const tNDSHeader* ndsHeader, const module_params_
860861
endOffset, 0x38,
861862
sleepInputWriteSignature, 1
862863
);
864+
if (!offset) {
865+
offset = findOffsetBackwards(
866+
endOffset, 0x3C,
867+
sleepInputWriteSignatureAlt, 1
868+
);
869+
}
863870
if (!offset) {
864871
u32 thumbOffset = (u32)findOffsetBackwardsThumb(
865872
(u16*)endOffset, 0x30,

retail/cardenginei/arm7/source/patcher/patch_arm7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void patchSleepInputWrite(const tNDSHeader* ndsHeader, const module_param
187187
return;
188188
}
189189

190-
if (*offset == 0x13A04902) {
190+
if (*offset == 0x13A04902 || *offset == 0x11A05004) {
191191
*offset = 0xE1A00000; // nop
192192
} else {
193193
u16* offsetThumb = (u16*)offset;

0 commit comments

Comments
 (0)