@@ -116,7 +116,6 @@ DSi::DSi(DSiArgs&& args, void* userdata) noexcept :
116116 NWRAM_B = JIT .Memory .GetNWRAM_B ();
117117 NWRAM_C = JIT .Memory .GetNWRAM_C ();
118118
119- SetFullBIOSBoot (args.FullBIOSBoot );
120119 SetDSPHLE (args.DSPHLE );
121120}
122121
@@ -130,6 +129,20 @@ DSi::~DSi() noexcept
130129
131130void DSi::Reset ()
132131{
132+ // determine if we can do a full BIOS boot
133+ // if we have incomplete BIOS dumps, we need to manually load boot2 from NAND
134+
135+ u32 crc_low[2 ], crc_full[2 ];
136+ crc_low[0 ] = CRC32 (ARM9iBIOS.data (), 0x8000 );
137+ crc_low[1 ] = CRC32 (ARM7iBIOS.data (), 0x8000 );
138+ crc_full[0 ] = CRC32 (ARM9iBIOS.data (), 0x10000 );
139+ crc_full[1 ] = CRC32 (ARM7iBIOS.data (), 0x10000 );
140+
141+ bool bios9full = (crc_low[0 ] != ARM9iBIOSLowCRC32) || (crc_full[0 ] == ARM9iBIOSCRC32);
142+ bool bios7full = (crc_low[1 ] != ARM7iBIOSLowCRC32) || (crc_full[1 ] == ARM7iBIOSCRC32);
143+ FullBIOSBoot = bios9full && bios7full;
144+ Log (LogLevel::Debug, " DSi: full BIOS boot = %d\n " , FullBIOSBoot);
145+
133146 // ARM9.CP15Write(0x910, 0x0D00000A);
134147 // ARM9.CP15Write(0x911, 0x00000020);
135148 // ARM9.CP15Write(0x100, ARM9.CP15Read(0x100) | 0x00050000);
@@ -165,6 +178,7 @@ void DSi::Reset()
165178 SCFG_BIOS = 0x0101 ;
166179 ARM7BIOSProt = 0x20 ;
167180 }
181+
168182 SCFG_Clock9 = 0x0187 ; // CHECKME
169183 SCFG_Clock7 = 0x0187 ;
170184 SCFG_EXT [0 ] = 0x8307F100 ;
@@ -739,6 +753,7 @@ void DSi::SoftReset()
739753 {
740754 SCFG_BIOS = 0x0101 ;
741755 }
756+
742757 SCFG_Clock9 = 0x0187 ; // CHECKME
743758 SCFG_Clock7 = 0x0187 ;
744759 SCFG_EXT [0 ] = 0x8307F100 ;
0 commit comments