Cleanup
This commit is contained in:
parent
9656fe1b6f
commit
2e561f7ea9
@ -14,8 +14,8 @@
|
||||
_start:
|
||||
|
||||
; Jumps here before the fsOpenFileDirectly call
|
||||
_mountSd:
|
||||
b mountSd
|
||||
_mountArchive:
|
||||
b mountArchive
|
||||
.word 0xdead0000 ; Substituted opcode
|
||||
.word 0xdead0001 ; Branch to hooked function
|
||||
|
||||
@ -25,10 +25,10 @@ _start:
|
||||
.word 0xdead0002 ; Substituted opcode
|
||||
.word 0xdead0003 ; Branch to hooked function
|
||||
|
||||
; Mounts SDMC and registers the archive as 'sdmc:'
|
||||
mountSd:
|
||||
; Mounts the archive and registers it as 'lfs:'
|
||||
mountArchive:
|
||||
cmp r3, #3
|
||||
bne _mountSd+4
|
||||
bne _mountArchive + 4
|
||||
stmfd sp!, {r0-r4, lr}
|
||||
sub sp, sp, #4
|
||||
load r1, archiveId
|
||||
@ -43,12 +43,12 @@ _start:
|
||||
blx r4
|
||||
add sp, sp, #4
|
||||
ldmfd sp!, {r0-r4, lr}
|
||||
b _mountSd+4
|
||||
b _mountArchive + 4
|
||||
|
||||
; Check the path passed to iFileOpen.
|
||||
; If it is trying to access a RomFS file, we try to
|
||||
; open it from the title folder on the sdcard.
|
||||
; If the file cannot be opened from the sdcard, we just open
|
||||
; open it from the LayeredFS folder.
|
||||
; If the file cannot be opened, we just open
|
||||
; it from its original archive like nothing happened
|
||||
fsRedir:
|
||||
stmfd sp!, {r0-r12, lr}
|
||||
@ -90,10 +90,10 @@ _start:
|
||||
|
||||
.pool
|
||||
.align 4
|
||||
archiveName : .word 0xdead0007
|
||||
archiveName : .dcb "lfs:"
|
||||
fsMountArchive : .word 0xdead0005
|
||||
fsRegisterArchive : .word 0xdead0006
|
||||
archiveId : .word 0xdead0008
|
||||
archiveId : .word 0xdead0007
|
||||
customPath : .word 0xdead0004
|
||||
|
||||
.close
|
||||
|
@ -520,7 +520,7 @@ static inline bool patchLayeredFs(u64 progId, u8* code, u32 size)
|
||||
|
||||
if(!archiveId) return true;
|
||||
|
||||
const char *archiveName = archiveId == ARCHIVE_SDMC ? "sdc:" : "nnd:";
|
||||
static const char *archiveName = "lfs:";
|
||||
|
||||
u32 fsMountArchive = 0xFFFFFFFF,
|
||||
fsRegisterArchive = 0xFFFFFFFF,
|
||||
@ -564,9 +564,6 @@ static inline bool patchLayeredFs(u64 progId, u8* code, u32 size)
|
||||
payload32[i] = 0x100000 + fsRegisterArchive;
|
||||
break;
|
||||
case 0xdead0007:
|
||||
memcpy(payload32 + i, archiveName, 4);
|
||||
break;
|
||||
case 0xdead0008:
|
||||
payload32[i] = archiveId;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user