mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-06 13:54:09 +08:00
修复文件名不正确导致的prefetch abort异常
This commit is contained in:
parent
d5aca97197
commit
fcd5bc1ae9
@ -1001,28 +1001,28 @@ static void repairBootFirm( char *firm_path )
|
||||
{
|
||||
if( 0 == strcmp(firm_path, autorun) )
|
||||
{
|
||||
char firmname[0x40];
|
||||
memset( firmname, 0, 0x40 );
|
||||
if( RES_OK == fsQuickRead("autorun", firmname, 0x3f) )
|
||||
char firmname[512]; // 为啥不是0x40?因为fsLoadPathFromFile要的是512
|
||||
if( RES_OK == fsLoadPathFromFile("autorun", firmname) )
|
||||
{
|
||||
fRename( autorun, firmname );
|
||||
strncpy( firm_path, firmname, 0x40 );
|
||||
strncpy( firm_path, firmname, 0x3f );
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *default_path = "sdmc:/luma/payloads/open_agb_firm.firm";
|
||||
fRename( autorun, default_path );
|
||||
strncpy( firm_path, default_path, 0x40 );
|
||||
strncpy( firm_path, default_path, 0x3f );
|
||||
}
|
||||
firm_path[0x3f] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
Result oafPreboot( const char *firm_path )
|
||||
{
|
||||
ee_puts( firm_path );
|
||||
// 记下来要恢复的文件名。加上\n是因为fsLoadPathFromFile靠它来识别路径结尾
|
||||
char memo[0x50];
|
||||
ee_snprintf(memo, 0x49, "%s\n", firm_path);
|
||||
fsQuickWrite("autorun", memo, strlen(memo));
|
||||
|
||||
fsQuickWrite("autorun", firm_path, strlen(firm_path));
|
||||
Result ret = fRename(firm_path, autorun);
|
||||
TIMER_sleepMs(500);
|
||||
return ret;
|
||||
return fRename(firm_path, autorun);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user