Skip to content

Commit

Permalink
fix 2
Browse files Browse the repository at this point in the history
Signed-off-by: Simo <[email protected]>
  • Loading branch information
Simo3ds authored Nov 21, 2023
1 parent 6b67a11 commit 8f694dd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions arm9/source/firm.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static inline u32 loadFirmFromStorage(FirmwareType firmType)

if(!firmSize) return 0;

static const char *extFirmError = "The external FIRM is not valid.";
static const char *extFirmError = "Il FIRM esterno non è valido.";

if(firmSize <= sizeof(Cxi) + 0x200) error(extFirmError);

Expand All @@ -137,14 +137,14 @@ static inline u32 loadFirmFromStorage(FirmwareType firmType)
u8 cetk[0xA50];

if(fileRead(cetk, cetkFiles[(u32)firmType], sizeof(cetk)) != sizeof(cetk))
error("The cetk is missing or corrupted.");
error("Il cetk è mancante o corrotto.");

firmSize = decryptNusFirm((Ticket *)(cetk + 0x140), (Cxi *)firm, firmSize);

if(!firmSize) error("Unable to decrypt the external FIRM.");
if(!firmSize) error("Impossibile scriptare il FIRM esterno.");
}

if(!checkFirm(firmSize)) error("The external FIRM is invalid or corrupted.");
if(!checkFirm(firmSize)) error("Il FIRM esterno non è valido o è corrotto.");

return firmSize;
}
Expand Down Expand Up @@ -181,20 +181,20 @@ u32 loadNintendoFirm(FirmwareType *firmType, FirmwareSource nandType, bool loadF
loadedFromStorage = true;
firmSize = result;
}
else if(ctrNandError) error("Unable to mount CTRNAND or load the CTRNAND FIRM.\nPlease use an external one.");
else if(ctrNandError) error("Impossibile montare la CTRNAND o caricare il CTRNAND FIRM.\nPlerfavore usarne uno esterno.");
}

//Check that the FIRM is right for the console from the Arm9 section address
if((firm->section[3].offset != 0 ? firm->section[3].address : firm->section[2].address) != (ISN3DS ? (u8 *)0x8006000 : (u8 *)0x8006800))
error("The %s FIRM is not for this console.", loadedFromStorage ? "external" : "CTRNAND");
error("Il %s FIRM non è per questa console.", loadedFromStorage ? "external" : "CTRNAND");

if(!ISN3DS && *firmType == NATIVE_FIRM && firm->section[0].address == (u8 *)0x1FF80000)
{
//We can't boot < 3.x EmuNANDs
if(nandType != FIRMWARE_SYSNAND) error("An old unsupported EmuNAND has been detected.\nCustomLuma3DS is unable to boot it.");
if(nandType != FIRMWARE_SYSNAND) error("Un EmuNAND vecchia e non supportata è stata individuata.\nCustomLuma3DS non è capace di avviarla.");

//If you want to use SAFE_FIRM on 1.0, use Luma from NAND & comment this line:
if(isSafeMode) error("SAFE_MODE is not supported on 1.x/2.x FIRM.");
if(isSafeMode) error("SAFE_MODE non è supportato su 1.x/2.x FIRM.");

*firmType = NATIVE_FIRM1X2X;
}
Expand Down Expand Up @@ -248,7 +248,7 @@ void loadHomebrewFirm(u32 pressed)
u32 maxPayloadSize = (u32)((u8 *)0x27FFE000 - (u8 *)firm),
payloadSize = fileRead(firm, path, maxPayloadSize);

if(payloadSize <= 0x200 || !checkFirm(payloadSize)) error("The payload is invalid or corrupted.");
if(payloadSize <= 0x200 || !checkFirm(payloadSize)) error("La payload è invalida o corrotta.");

char absPath[24 + 255];

Expand Down Expand Up @@ -339,7 +339,7 @@ typedef struct CopyKipResult {
// Copy a KIP, decompressing it in place if necessary (TwlBg)
static CopyKipResult copyKip(u8 *dst, const u8 *src, u32 maxSize, bool decompress)
{
const char *extModuleSizeError = "The external FIRM modules are too large.";
const char *extModuleSizeError = "Il modulo del FIRM esterno è troppo grande.";
CopyKipResult res = { 0 };
Cxi *dstCxi = (Cxi *)dst;
const Cxi *srcCxi = (const Cxi *)src;
Expand All @@ -360,7 +360,7 @@ static CopyKipResult copyKip(u8 *dst, const u8 *src, u32 maxSize, bool decompres
u8 *codeAddr = (u8 *)exefs + sizeof(ExeFsHeader) + fh->offset;

if (memcmp(fh->name, ".code\0\0\0", 8) != 0 || fh->offset != 0 || exefs->fileHeaders[1].size != 0)
error("One of the external FIRM modules have invalid layout.");
error("Uno dei moduli dei FIRM esterni ha un layout invalido.");

// If it's already decompressed or we don't need to, there is not much left to do
if (!decompress || !isCompressed)
Expand Down Expand Up @@ -446,7 +446,7 @@ static void mergeSection0(FirmwareType firmType, u32 firmVersion, bool loadFromS

//3) Read or copy the modules
u8 *dst = firm->section[0].address;
const char *extModuleSizeError = "The external FIRM modules are too large.";
const char *extModuleSizeError = "I moduli dei FIRM esterni sono troppo grandi.";
// SAFE_FIRM only for N3DS and only if ENABLESAFEFIRMROSALINA is on
u32 maxModuleSize = !isLgyFirm ? 0x80000 : 0x600000;
u32 dstModuleSize = 0;
Expand All @@ -469,7 +469,7 @@ static void mergeSection0(FirmwareType firmType, u32 firmVersion, bool loadFromS
fileRead(dst, fileName, dstModuleSize) != dstModuleSize ||
memcmp(((Cxi *)dst)->ncch.magic, "NCCH", 4) != 0 ||
memcmp(moduleList[i].name, ((Cxi *)dst)->exHeader.systemControlInfo.appTitle, sizeof(((Cxi *)dst)->exHeader.systemControlInfo.appTitle)) != 0)
error("An external FIRM module is invalid or corrupted.");
error("Un modulo di FIRM esterno è invalido o corrotto.");

dst += dstModuleSize;
maxModuleSize -= dstModuleSize;
Expand Down Expand Up @@ -499,12 +499,12 @@ static void mergeSection0(FirmwareType firmType, u32 firmVersion, bool loadFromS
if (isLgyFirm)
{
if (patchK11ModuleLoadingLgy(newKipSectionSize, kernel11Addr, kernel11Size) != 0)
error("Failed to load sysmodules");
error("Caricamento dei moduli di sistema fallito");
}
else
{
if (patchK11ModuleLoading(oldKipSectionSize, newKipSectionSize, nbModules, kernel11Addr, kernel11Size) != 0)
error("Failed to load sysmodules");
error("Caricamento dei moduli di sistema fallito");
}
}

Expand Down

0 comments on commit 8f694dd

Please sign in to comment.