Skip to content

Commit

Permalink
add no-lepton build, change adrenaline detection code
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Sep 20, 2024
1 parent cbf7eeb commit 65586b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/include/ark.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ extern "C" {
#define ARK_MAJOR_VERSION 4
#define ARK_MINOR_VERSION 20
#define ARK_MICRO_VERSION 69
#define ARK_REVISION 15
#define ARK_REVISION 16
#define MAX_FLASH0_SIZE 0x32000

/*
Expand Down
15 changes: 12 additions & 3 deletions core/compat/psp/rebootex/patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include <fat.h>
#endif

// This replaces UMD driver with Inferno at all times, prevents crashes on consoles with broken Lepton
//#define NO_LEPTON 1

enum {
CFW_ARK,
CFW_PRO,
Expand Down Expand Up @@ -410,25 +413,31 @@ int UnpackBootConfigPatched(char **p_buffer, int length)
newsize = patch_bootconf_pops(buffer, result);
if (newsize > 0) result = newsize;

// Insert Inferno and RTM
// Insert Inferno
if (IS_ARK_CONFIG(reboot_conf)){
switch(reboot_conf->iso_mode) {
default:
#ifndef NO_LEPTON
break;
#endif
case MODE_VSHUMD:
#ifndef NO_LEPTON
newsize = patch_bootconf_vshumd(buffer, result);
if (newsize > 0) result = newsize;
break;
#endif
case MODE_UPDATERUMD:
#ifndef NO_LEPTON
newsize = patch_bootconf_updaterumd(buffer, result);
if (newsize > 0) result = newsize;
break;
#endif
case MODE_MARCH33:
case MODE_INFERNO:
reboot_conf->iso_mode = MODE_INFERNO;
newsize = patch_bootconf_inferno(buffer, result);
if (newsize > 0) result = newsize;
break;
default:
break;
}
//reboot variable set
if(reboot_conf->rtm_mod.before && reboot_conf->rtm_mod.buffer && reboot_conf->rtm_mod.size)
Expand Down
7 changes: 3 additions & 4 deletions loader/live/kernel/kernel_loader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,14 @@ int autoDetectDevice(ARKConfig* config){
return -1;
}
else{
int fd = k_tbl->KernelIOOpen("flash1:/config.adrenaline", PSP_O_RDONLY, 0);
if (fd >= 0){
u32 kuKernelMemcpy = k_tbl->FindFunction("SystemControl", "KUBridge", 0x6B4B577F);
if (kuKernelMemcpy == 0){
// Adrenaline
k_tbl->KernelIOClose(fd);
config->exec_mode = PSV_ADR;
return 0;
}
else {
// early eCFW
// early ARK?
return -1;
}
}
Expand Down

0 comments on commit 65586b7

Please sign in to comment.