Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Nov 11, 2024
1 parent 13ca33c commit f6de3ea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion settings/bootloader/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,12 @@ int main (void) {
#endif
if (wantToPatchDLDI) {
toncset((u32*)0x06000000, 0, 0x8000);
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string + bootloader in DLDI driver space
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space
const u16 dldiFileSize = 1 << *(u8*)0x02FF418D;
tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize);
dldiRelocateBinary();

toncset((u32*)0x02FF4000, 0, 0x8180); // Clear bootstub + DLDI driver
} else if (*(u32*)0x02FF8004 == 0x69684320) { // DLDI ' Chi' string
const u16 dldiFileSize = 1 << *(u8*)0x02FF800D;
tonccpy((u32*)0x06000000, (u32*)0x02FF8000, (dldiFileSize > 0x4000) ? 0x4000 : dldiFileSize);
Expand Down
4 changes: 3 additions & 1 deletion title/bootloader/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,12 @@ int main (void) {
#endif
if (wantToPatchDLDI) {
toncset((u32*)0x06000000, 0, 0x8000);
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string + bootloader in DLDI driver space
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space
const u16 dldiFileSize = 1 << *(u8*)0x02FF418D;
tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize);
dldiRelocateBinary();

toncset((u32*)0x02FF4000, 0, 0x8180); // Clear bootstub + DLDI driver
} else if (*(u32*)0x02FF8004 == 0x69684320) { // DLDI ' Chi' string
const u16 dldiFileSize = 1 << *(u8*)0x02FF800D;
tonccpy((u32*)0x06000000, (u32*)0x02FF8000, (dldiFileSize > 0x4000) ? 0x4000 : dldiFileSize);
Expand Down
4 changes: 3 additions & 1 deletion universal/bootloader_app/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,12 @@ int main (void) {
#endif
if (wantToPatchDLDI) {
toncset((u32*)0x06000000, 0, 0x8000);
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string + bootloader in DLDI driver space
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space
const u16 dldiFileSize = 1 << *(u8*)0x02FF418D;
tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize);
dldiRelocateBinary();

toncset((u32*)0x02FF4000, 0, 0x8180); // Clear bootstub + DLDI driver
} else if (*(u32*)0x02FF8004 == 0x69684320) { // DLDI ' Chi' string
const u16 dldiFileSize = 1 << *(u8*)0x02FF800D;
tonccpy((u32*)0x06000000, (u32*)0x02FF8000, (dldiFileSize > 0x4000) ? 0x4000 : dldiFileSize);
Expand Down
4 changes: 3 additions & 1 deletion universal/bootloader_menu/source/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,12 @@ int main (void) {
#endif
if (wantToPatchDLDI) {
toncset((u32*)0x06000000, 0, 0x8000);
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string + bootloader in DLDI driver space
if (*(u32*)0x02FF4184 == 0x69684320) { // DLDI ' Chi' string in bootstub space + bootloader in DLDI driver space
const u16 dldiFileSize = 1 << *(u8*)0x02FF418D;
tonccpy((u32*)0x06000000, (u32*)0x02FF4180, dldiFileSize);
dldiRelocateBinary();

toncset((u32*)0x02FF4000, 0, 0x8180); // Clear bootstub + DLDI driver
} else if (*(u32*)0x02FF8004 == 0x69684320) { // DLDI ' Chi' string
const u16 dldiFileSize = 1 << *(u8*)0x02FF800D;
tonccpy((u32*)0x06000000, (u32*)0x02FF8000, (dldiFileSize > 0x4000) ? 0x4000 : dldiFileSize);
Expand Down

0 comments on commit f6de3ea

Please sign in to comment.