Adapt changes from b9s/next
This commit is contained in:
@@ -443,6 +443,7 @@ bool checkFirmPayload(void)
|
||||
(section->address + section->size < section->address) || //Overflow check
|
||||
((u32)section->address & 3) || (section->offset & 0x1FF) || (section->size & 0x1FF) || //Alignment check
|
||||
(overlaps((u32)section->address, (u32)section->address + section->size, 0x27FFE000 - 0x1000, 0x28000000)) ||
|
||||
(overlaps((u32)section->address, (u32)section->address + section->size, 0x1FFFFC00, 0x20000000)) ||
|
||||
(overlaps((u32)section->address, (u32)section->address + section->size, (u32)firm + section->offset, (u32)firm + size)))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -170,12 +170,10 @@ void loadPayload(u32 pressed, const char *payloadPath)
|
||||
else
|
||||
sprintf(absPath, "sdmc:/luma/%s", path);
|
||||
|
||||
char *argv[1] = {absPath};
|
||||
char *argv[2] = {absPath, (char *)fbs};
|
||||
initScreens();
|
||||
|
||||
if((u8 *)firm + payloadSize < (u8 *)0x23FFFE00)
|
||||
memcpy((void *)0x23FFFE00, fbs, sizeof(fbs));
|
||||
launchFirm(1, argv);
|
||||
launchFirm((firm->reserved2[0] & 1) ? 2 : 1, argv);
|
||||
}
|
||||
|
||||
void payloadMenu(void)
|
||||
|
||||
@@ -50,9 +50,9 @@ struct fb fbs[2];
|
||||
|
||||
static void invokeArm11Function(Arm11Operation op)
|
||||
{
|
||||
while(*operation != NO_ARM11_OPERATION);
|
||||
while(*operation != ARM11_READY);
|
||||
*operation = op;
|
||||
while(*operation != NO_ARM11_OPERATION);
|
||||
while(*operation != ARM11_READY);
|
||||
}
|
||||
|
||||
void prepareArm11ForFirmlaunch(void)
|
||||
@@ -125,5 +125,6 @@ void initScreens(void)
|
||||
}
|
||||
|
||||
clearScreens(false);
|
||||
clearScreens(true);
|
||||
swapFramebuffers(false);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#define ARESCREENSINITIALIZED (PDN_GPU_CNT != 1)
|
||||
|
||||
#define ARM11_PARAMETERS_ADDRESS 0x1FFFC000
|
||||
#define ARM11_PARAMETERS_ADDRESS 0x1FFFF000
|
||||
|
||||
#define SCREEN_TOP_WIDTH 400
|
||||
#define SCREEN_BOTTOM_WIDTH 320
|
||||
@@ -45,22 +45,21 @@ struct fb {
|
||||
u8 *top_left;
|
||||
u8 *top_right;
|
||||
u8 *bottom;
|
||||
} __attribute__((packed)); //*const fbs = (volatile struct fb *)0x23FFFE00;
|
||||
|
||||
extern struct fb fbs[2];
|
||||
} __attribute__((packed));
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NO_ARM11_OPERATION = 0,
|
||||
INIT_SCREENS_SEQUENCE,
|
||||
INIT_SCREENS_SEQUENCE = 0,
|
||||
SETUP_FRAMEBUFFERS,
|
||||
CLEAR_SCREENS,
|
||||
SWAP_FRAMEBUFFERS,
|
||||
UPDATE_BRIGHTNESS,
|
||||
DEINIT_SCREENS,
|
||||
PREPARE_ARM11_FOR_FIRMLAUNCH,
|
||||
ARM11_READY,
|
||||
} Arm11Operation;
|
||||
|
||||
extern struct fb fbs[2];
|
||||
extern CfgData configData;
|
||||
|
||||
void prepareArm11ForFirmlaunch(void);
|
||||
|
||||
Reference in New Issue
Block a user