Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'official' into 3gx-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloMK7 committed Mar 17, 2022
2 parents e30cd7e + 8038600 commit 8ed8f86
Show file tree
Hide file tree
Showing 23 changed files with 404 additions and 240 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ boot.firm: $(SUBFOLDERS)
@echo built... $(notdir $@)

boot.3dsx:
@curl -sSL "https://github.com/fincs/new-hbmenu/releases/latest/download/boot.3dsx" -o "$@"
@curl -sSfLO "https://github.com/fincs/new-hbmenu/releases/latest/download/$@"
@echo downloaded... $(notdir $@)

$(SUBFOLDERS):
Expand Down
4 changes: 2 additions & 2 deletions arm9/source/crypto.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -348,7 +348,7 @@ int ctrNandInit(void)
u8 __attribute__((aligned(4))) temp[0x200];

//Read NCSD header
result = firmSource == FIRMWARE_SYSNAND ? sdmmc_nand_readsectors(0, 1, temp) : sdmmc_sdcard_readsectors(emuHeader, 1, temp);
result = firmSource == FIRMWARE_SYSNAND ? sdmmc_nand_readsectors(0, 1, temp) : sdmmc_sdcard_readsectors(emuOffset + emuHeader, 1, temp);

if(!result)
{
Expand Down
6 changes: 3 additions & 3 deletions arm9/source/emunand.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -77,15 +77,15 @@ void locateEmuNand(FirmwareSource *nandType)
if(!sdmmc_sdcard_readsectors(nandOffset + 1, 1, temp) && memcmp(temp + 0x100, "NCSD", 4) == 0)
{
emuOffset = nandOffset + 1;
emuHeader = nandOffset + 1;
emuHeader = 0;
return;
}

//Check for Gateway EmuNAND
else if(i != 2 && !sdmmc_sdcard_readsectors(nandOffset + nandSize, 1, temp) && memcmp(temp + 0x100, "NCSD", 4) == 0)
{
emuOffset = nandOffset;
emuHeader = nandOffset + nandSize;
emuHeader = nandSize;
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/firm.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/fs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/fs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/loader/source/ifile.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <3ds/types.h>
#include <3ds/services/fs.h>

#define PATH_MAX 255

Expand Down
16 changes: 9 additions & 7 deletions sysmodules/loader/source/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,14 @@ static inline bool patchLayeredFs(u64 progId, u8 *code, u32 size, u32 textSize,

void patchCode(u64 progId, u16 progVer, u8 *code, u32 size, u32 textSize, u32 roSize, u32 dataSize, u32 roAddress, u32 dataAddress)
{
if(progId == 0x0004003000008F02LL || //USA Home Menu
progId == 0x0004003000008202LL || //JPN Home Menu
progId == 0x0004003000009802LL || //EUR Home Menu
progId == 0x000400300000A902LL || //KOR Home Menu
progId == 0x000400300000A102LL || //CHN Home Menu
progId == 0x000400300000B102LL) //TWN Home Menu
bool isHomeMenu = progId == 0x0004003000008F02LL || //USA Home Menu
progId == 0x0004003000008202LL || //JPN Home Menu
progId == 0x0004003000009802LL || //EUR Home Menu
progId == 0x000400300000A902LL || //KOR Home Menu
progId == 0x000400300000A102LL || //CHN Home Menu
progId == 0x000400300000B102LL; //TWN Home Menu

if(isHomeMenu)
{
bool applyRegionFreePatch = true;

Expand Down Expand Up @@ -864,7 +866,7 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size, u32 textSize, u32 ro
if(!patcherApplyCodeBpsPatch(progId, code, size)) goto error;
if(!applyCodeIpsPatch(progId, code, size)) goto error;

if((u32)((progId >> 0x20) & 0xFFFFFFEDULL) == 0x00040000)
if((u32)((progId >> 0x20) & 0xFFFFFFEDULL) == 0x00040000 || isHomeMenu)
{
u8 mask,
regionId,
Expand Down
4 changes: 2 additions & 2 deletions sysmodules/rosalina/include/ifile.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2022 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -26,7 +26,7 @@

#pragma once

#include <3ds/types.h>
#include <3ds/services/fs.h>

#define PATH_MAX 255

Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/include/menu.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/include/menus/miscellaneous.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 3 additions & 3 deletions sysmodules/rosalina/include/ntp.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,6 +29,6 @@
#include <3ds/types.h>
#include <time.h>

Result ntpGetTimeStamp(time_t *outTimestamp);
Result ntpSetTimeDate(time_t timestamp);
Result ntpGetTimeStamp(u64 *msSince1900, u64 *samplingTick);
Result ntpSetTimeDate(u64 msSince1900, u64 samplingTick);
Result ntpNullifyUserTimeOffset(void); // not actually used for NTP
2 changes: 1 addition & 1 deletion sysmodules/rosalina/include/process_patches.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/source/ifile.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/source/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2021 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 3 additions & 1 deletion sysmodules/rosalina/source/menu.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of Luma3DS
* Copyright (C) 2016-2020 Aurora Wright, TuxSH
* Copyright (C) 2016-2022 Aurora Wright, TuxSH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -444,6 +444,8 @@ void menuShow(Menu *root)
}
else if(pressed & KEY_B)
{
while (nbPreviousMenus == 0 && (scanHeldKeys() & KEY_B)); // wait a bit before exiting rosalina

Draw_Lock();
Draw_ClearFramebuffer();
Draw_FlushFramebuffer();
Expand Down
2 changes: 1 addition & 1 deletion sysmodules/rosalina/source/menus.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void RosalinaMenu_ShowCredits(void)
Draw_Lock();
Draw_DrawString(10, 10, COLOR_TITLE, "Rosalina -- Luma3DS credits");

u32 posY = Draw_DrawString(10, 30, COLOR_WHITE, "Luma3DS (c) 2016-2020 AuroraWright, TuxSH") + SPACING_Y;
u32 posY = Draw_DrawString(10, 30, COLOR_WHITE, "Luma3DS (c) 2016-2022 AuroraWright, TuxSH") + SPACING_Y;

posY = Draw_DrawString(10, posY + SPACING_Y, COLOR_WHITE, "3DSX loading code by fincs");
posY = Draw_DrawString(10, posY + SPACING_Y, COLOR_WHITE, "Networking code & basic GDB functionality by Stary");
Expand Down
Loading

0 comments on commit 8ed8f86

Please sign in to comment.