Fix conflicting files

This commit is contained in:
PabloMK7 2019-06-29 23:34:45 +02:00
commit 9705083b65
4 changed files with 17 additions and 8 deletions

View File

@ -561,18 +561,24 @@ u32 patchP9AMTicketWrapperZeroKeyIV(u8 *pos, u32 size, u32 firmVersion)
static const u8 pattern[] = {0x20, 0x21, 0xA6, 0xA8}; static const u8 pattern[] = {0x20, 0x21, 0xA6, 0xA8};
u32 function = (u32)memsearch(pos, __rt_memclr_pattern, size, sizeof(__rt_memclr_pattern)); u32 function = (u32)memsearch(pos, __rt_memclr_pattern, size, sizeof(__rt_memclr_pattern));
u32 *off = (u32 *)memsearch(pos, pattern, size, sizeof(pattern)); u16 *off = (u16 *)memsearch(pos, pattern, size, sizeof(pattern));
if(function == 0 || off == NULL) return firmVersion == 0xFFFFFFFF ? 0 : 1; if(function == 0 || off == NULL) return firmVersion == 0xFFFFFFFF ? 0 : 1;
s32 opjumpdistance = (s32)(function - ((u32)&off[2])) / 2; //After the found code it's a BL call (at &off[2]), that will be replaced
//From Thumb, op distance for setting in BLX can be got with,
//(Destination_offset - blx_op_offset+2) / 2
s32 opjumpdistance = (s32)(function - ((u32)&off[3])) / 2;
//Beyond limit //Beyond limit
if(opjumpdistance < -0x1fffff || opjumpdistance > 0x1fffff) return 1; if(opjumpdistance < -0x1fffff || opjumpdistance > 0x1fffff) return 1;
//r0 and r1 for old call are already correct for this one //r0 and r1 for old call are already correct for this one
//BLX __rt_memclr //BLX __rt_memclr
off[1] = 0xE800F000U | (((u32)opjumpdistance & 0x7FF) << 16) | (((u32)opjumpdistance >> 11) & 0x3FF) | (((u32)opjumpdistance >> 21) & 0x400); u32 op = (0xE800F000U | (((u32)opjumpdistance & 0x7FF) << 16) | (((u32)opjumpdistance >> 11) & 0x3FF) | (((u32)opjumpdistance >> 21) & 0x400)) & ~(1<<16);
off[2] = op;
off[3] = op >> 16;
return 0; return 0;
} }

View File

@ -28,7 +28,8 @@ INCLUDES := include include/gdb include/menus include/redshift
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
DEFINES := -DARM11 -D_3DS DEFINES := -DARM11 -D_3DS
CFLAGS := -g -std=gnu11 -Wall -Wextra -O2 -mword-relocations \
CFLAGS := -g -std=gnu11 -Wall -Wextra -Wno-unused-value -O2 -mword-relocations \
-fomit-frame-pointer -ffunction-sections -fdata-sections \ -fomit-frame-pointer -ffunction-sections -fdata-sections \
$(ARCH) $(DEFINES) $(ARCH) $(DEFINES)

View File

@ -354,7 +354,6 @@ void MiscellaneousMenu_SyncTimeDate(void)
Draw_Lock(); Draw_Lock();
Draw_DrawString(10, 10, COLOR_TITLE, "Miscellaneous options menu"); Draw_DrawString(10, 10, COLOR_TITLE, "Miscellaneous options menu");
//posY = Draw_DrawFormattedString(10, 30, COLOR_WHITE, "Current UTC offset: ");
absOffset = utcOffset - 12; absOffset = utcOffset - 12;
absOffset = absOffset < 0 ? -absOffset : absOffset; absOffset = absOffset < 0 ? -absOffset : absOffset;
posY = Draw_DrawFormattedString(10, 30, COLOR_WHITE, "Current UTC offset: %c%02d", utcOffset < 12 ? '-' : '+', absOffset); posY = Draw_DrawFormattedString(10, 30, COLOR_WHITE, "Current UTC offset: %c%02d", utcOffset < 12 ? '-' : '+', absOffset);
@ -398,11 +397,11 @@ void MiscellaneousMenu_SyncTimeDate(void)
absOffset = absOffset < 0 ? -absOffset : absOffset; absOffset = absOffset < 0 ? -absOffset : absOffset;
Draw_DrawFormattedString(10, 30, COLOR_WHITE, "Current UTC offset: %c%02d", utcOffset < 0 ? '-' : '+', absOffset); Draw_DrawFormattedString(10, 30, COLOR_WHITE, "Current UTC offset: %c%02d", utcOffset < 0 ? '-' : '+', absOffset);
if (cantStart) if (cantStart)
posY = Draw_DrawFormattedString(10, posY + 2 * SPACING_Y, COLOR_WHITE, "Can't sync time/date before the system\nhas finished loading.") + SPACING_Y; Draw_DrawFormattedString(10, posY + 2 * SPACING_Y, COLOR_WHITE, "Can't sync time/date before the system\nhas finished loading.") + SPACING_Y;
else if (R_FAILED(res)) else if (R_FAILED(res))
posY = Draw_DrawFormattedString(10, posY + 2 * SPACING_Y, COLOR_WHITE, "Operation failed (%08lx).", (u32)res) + SPACING_Y; Draw_DrawFormattedString(10, posY + 2 * SPACING_Y, COLOR_WHITE, "Operation failed (%08lx).", (u32)res) + SPACING_Y;
else else
posY = Draw_DrawFormattedString(10, posY + 2 * SPACING_Y, COLOR_WHITE, "Timedate & RTC updated successfully.\nYou may need to reboot to see the changes.") + SPACING_Y; Draw_DrawFormattedString(10, posY + 2 * SPACING_Y, COLOR_WHITE, "Timedate & RTC updated successfully.\nYou may need to reboot to see the changes.") + SPACING_Y;
input = waitInput(); input = waitInput();

View File

@ -166,8 +166,11 @@ Result ntpSetTimeDate(const struct tm *localt)
// First, set the config RTC offset to 0 // First, set the config RTC offset to 0
u8 rtcOff = 0; u8 rtcOff = 0;
u8 rtcOff2[8] = {0};
res = CFG_SetConfigInfoBlk4(1, 0x10000, &rtcOff); res = CFG_SetConfigInfoBlk4(1, 0x10000, &rtcOff);
if (R_FAILED(res)) goto cleanup; if (R_FAILED(res)) goto cleanup;
res = CFG_SetConfigInfoBlk4(8, 0x30001, rtcOff2);
if (R_FAILED(res)) goto cleanup;
u8 yr = (u8)(localt->tm_year - 100); u8 yr = (u8)(localt->tm_year - 100);
// Update the RTC // Update the RTC