forked from Mirror/GodMode9
Improve FIRM v2.1.0 mount code
... maybe all older FIRMS, unsure.
This commit is contained in:
parent
3ac2297f39
commit
c93295df42
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#define FIRM_MAX_SIZE 0x400000 // 4MB, due to FIRM partition size
|
#define FIRM_MAX_SIZE 0x400000 // 4MB, due to FIRM partition size
|
||||||
#define ARM9BIN_OFFSET 0x800
|
#define ARM9BIN_OFFSET 0x800
|
||||||
|
#define ARM11V2_OFFSET 0x2B000
|
||||||
|
|
||||||
// see: https://www.3dbrew.org/wiki/FIRM#Firmware_Section_Headers
|
// see: https://www.3dbrew.org/wiki/FIRM#Firmware_Section_Headers
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -415,7 +415,9 @@ bool BuildVGameFirmDir(void) {
|
|||||||
}
|
}
|
||||||
} else if (section->type == 1) { // ARM11 section, search for modules
|
} else if (section->type == 1) { // ARM11 section, search for modules
|
||||||
NcchHeader firm_ncch;
|
NcchHeader firm_ncch;
|
||||||
for (u32 p = 0; p < section->size; p += firm_ncch.size * NCCH_MEDIA_UNIT) {
|
for (u32 v = 0; v < 2; v++) {
|
||||||
|
u32 start = v ? ARM11V2_OFFSET : 0;
|
||||||
|
for (u32 p = start; p < section->size; p += firm_ncch.size * NCCH_MEDIA_UNIT) {
|
||||||
char name[8];
|
char name[8];
|
||||||
if ((ReadImageBytes((u8*) &firm_ncch, section->offset + p, 0x200) != 0) ||
|
if ((ReadImageBytes((u8*) &firm_ncch, section->offset + p, 0x200) != 0) ||
|
||||||
(ReadImageBytes((u8*) name, section->offset + p + 0x200, 0x8) != 0) ||
|
(ReadImageBytes((u8*) name, section->offset + p + 0x200, 0x8) != 0) ||
|
||||||
@ -435,6 +437,7 @@ bool BuildVGameFirmDir(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
n_templates_firm = n;
|
n_templates_firm = n;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user