We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ecac41 commit 844a884Copy full SHA for 844a884
1 file changed
source/ndscreate.cpp
@@ -11,6 +11,8 @@
11
#include "sha1.h"
12
#include "crc.h"
13
14
+#include <algorithm>
15
+
16
unsigned int arm9_align = 0x1FF;
17
unsigned int arm7_align = 0x1FF;
18
unsigned int fnt_align = 0x1FF; // 0x3 0x1FF
@@ -692,7 +694,8 @@ void Create()
692
694
// Set flags in DSi extended header
693
695
if (header.unitcode & 2)
696
{
- newfilesize = (ftell(fNDS) + file_align) & ~file_align;
697
+ newfilesize = std::max( ftell(fNDS) , static_cast<long>(header.banner_offset + 0x23c0));
698
+ newfilesize = (newfilesize + file_align) & ~file_align;
699
header.total_rom_size = newfilesize;
700
701
if (newfilesize != ftell(fNDS) ) {
0 commit comments