diff options
author | red031000 <rubenru09@aol.com> | 2020-07-11 16:13:04 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-07-11 16:13:04 +0100 |
commit | d038e60ba5baee009a0b76466cf362ae7747d48f (patch) | |
tree | 6cd6fe67c1b9ace9fab35c20f2ea47da738c7381 /tools/nitrogfx/util.c | |
parent | 6d1ac864f23076399e99c00a4a875e5ce88af674 (diff) |
add sopc support to ncgr
Diffstat (limited to 'tools/nitrogfx/util.c')
-rw-r--r-- | tools/nitrogfx/util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/nitrogfx/util.c b/tools/nitrogfx/util.c index 304a2319..7dc4ca89 100644 --- a/tools/nitrogfx/util.c +++ b/tools/nitrogfx/util.c @@ -124,7 +124,7 @@ void WriteWholeFile(char *path, void *buffer, int bufferSize) fclose(fp); } -void WriteGenericNtrHeader(FILE* fp, const char* magicNumber, uint32_t size, bool byteorder, bool version101) +void WriteGenericNtrHeader(FILE* fp, const char* magicNumber, uint32_t size, bool byteorder, bool version101, uint16_t sectionCount) { unsigned char header[0x10] = { 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00 }; @@ -149,5 +149,9 @@ void WriteGenericNtrHeader(FILE* fp, const char* magicNumber, uint32_t size, boo header[10] = (size >> 16) & 0xFF; header[11] = (size >> 24) & 0xFF; + //section count + header[14] = sectionCount & 0xFF; + header[15] = (sectionCount >> 8) & 0xFF; + fwrite(header, 1, 0x10, fp); } |