Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b51574ebf | ||
|
|
df112b550b | ||
|
|
85615d1916 | ||
|
|
c6d3158b56 | ||
|
|
e651c3d9cc | ||
|
|
bfc2448662 | ||
|
|
5a9d0e2569 | ||
|
|
041ca8451e | ||
|
|
2382e6d82c |
12
Makefile
12
Makefile
@@ -101,8 +101,8 @@ $(dir_build)/screeninit.h: $(dir_screeninit)/Makefile
|
|||||||
@mv $(dir_screeninit)/screeninit.bin $(@D)
|
@mv $(dir_screeninit)/screeninit.bin $(@D)
|
||||||
@bin2c -o $@ -n screeninit $(@D)/screeninit.bin
|
@bin2c -o $@ -n screeninit $(@D)/screeninit.bin
|
||||||
|
|
||||||
$(dir_build)/memory.o : CFLAGS += -O3
|
$(dir_build)/memory.o: CFLAGS += -O3
|
||||||
$(dir_build)/config.o : CFLAGS += -DCONFIG_TITLE="\"$(name) $(version) configuration\""
|
$(dir_build)/config.o: CFLAGS += -DCONFIG_TITLE="\"$(name) $(version) configuration\""
|
||||||
|
|
||||||
$(dir_build)/%.o: $(dir_source)/%.c $(bundled)
|
$(dir_build)/%.o: $(dir_source)/%.c $(bundled)
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
@@ -111,12 +111,4 @@ $(dir_build)/%.o: $(dir_source)/%.c $(bundled)
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
|
|
||||||
$(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.c
|
|
||||||
@mkdir -p "$(@D)"
|
|
||||||
$(COMPILE.c) $(OUTPUT_OPTION) $<
|
|
||||||
|
|
||||||
$(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.s
|
|
||||||
@mkdir -p "$(@D)"
|
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
include $(call rwildcard, $(dir_build), *.d)
|
||||||
|
|||||||
@@ -509,8 +509,8 @@ void patchCode(u64 progId, u8 *code, u32 size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,12 +44,4 @@ $(dir_build)/%.o: $(dir_source)/%.c
|
|||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
||||||
|
|
||||||
$(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.c
|
|
||||||
@mkdir -p "$(@D)"
|
|
||||||
$(COMPILE.c) $(OUTPUT_OPTION) $<
|
|
||||||
|
|
||||||
$(dir_build)/fatfs/%.o: $(dir_source)/fatfs/%.s
|
|
||||||
@mkdir -p "$(@D)"
|
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
|
||||||
include $(call rwildcard, $(dir_build), *.d)
|
include $(call rwildcard, $(dir_build), *.d)
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
|
|
||||||
#define HID_PAD (*(vu32 *)0x10146000 ^ 0xFFF)
|
|
||||||
#define BUTTON_RIGHT (1 << 4)
|
|
||||||
#define BUTTON_LEFT (1 << 5)
|
|
||||||
#define BUTTON_UP (1 << 6)
|
|
||||||
#define BUTTON_DOWN (1 << 7)
|
|
||||||
#define BUTTON_A 1
|
|
||||||
#define BUTTON_X (1 << 10)
|
|
||||||
#define BUTTON_Y (1 << 11)
|
|
||||||
#define BUTTON_R1 (1 << 8)
|
|
||||||
#define BUTTON_SELECT (1 << 2)
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
/ and optional writing functions as well. */
|
/ and optional writing functions as well. */
|
||||||
|
|
||||||
|
|
||||||
#define _FS_MINIMIZE 1
|
#define _FS_MINIMIZE 3
|
||||||
/* This option defines minimization level to remove some basic API functions.
|
/* This option defines minimization level to remove some basic API functions.
|
||||||
/
|
/
|
||||||
/ 0: All basic functions are enabled.
|
/ 0: All basic functions are enabled.
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
/ 2: Enable with LF-CRLF conversion. */
|
/ 2: Enable with LF-CRLF conversion. */
|
||||||
|
|
||||||
|
|
||||||
#define _USE_FIND 1
|
#define _USE_FIND 0
|
||||||
/* This option switches filtered directory read functions, f_findfirst() and
|
/* This option switches filtered directory read functions, f_findfirst() and
|
||||||
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
|
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "../../types.h"
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
//Common data types
|
||||||
|
typedef uint8_t u8;
|
||||||
|
typedef uint16_t u16;
|
||||||
|
typedef uint32_t u32;
|
||||||
|
typedef uint64_t u64;
|
||||||
|
typedef volatile u8 vu8;
|
||||||
|
typedef volatile u16 vu16;
|
||||||
|
typedef volatile u32 vu32;
|
||||||
|
typedef volatile u64 vu64;
|
||||||
@@ -1,39 +1,6 @@
|
|||||||
#include "types.h"
|
|
||||||
#include "buttons.h"
|
|
||||||
#include "fatfs/ff.h"
|
#include "fatfs/ff.h"
|
||||||
|
|
||||||
#define PAYLOAD_ADDRESS 0x23F00000
|
#define PAYLOAD_ADDRESS 0x23F00000
|
||||||
#define LOAD_PAYLOAD(a) loadPayload(a "_*.bin")
|
|
||||||
|
|
||||||
static u32 loadPayload(const char *pattern)
|
|
||||||
{
|
|
||||||
char path[30] = "/luma/payloads";
|
|
||||||
|
|
||||||
DIR dir;
|
|
||||||
FILINFO info;
|
|
||||||
|
|
||||||
FRESULT result = f_findfirst(&dir, &info, path, pattern);
|
|
||||||
|
|
||||||
f_closedir(&dir);
|
|
||||||
|
|
||||||
if(result != FR_OK || !info.fname[0])
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
path[14] = '/';
|
|
||||||
u32 i;
|
|
||||||
for(i = 0; info.fname[i]; i++)
|
|
||||||
path[15 + i] = info.fname[i];
|
|
||||||
path[15 + i] = '\0';
|
|
||||||
|
|
||||||
FIL payload;
|
|
||||||
unsigned int br;
|
|
||||||
|
|
||||||
f_open(&payload, path, FA_READ);
|
|
||||||
f_read(&payload, (void *)PAYLOAD_ADDRESS, f_size(&payload), &br);
|
|
||||||
f_close(&payload);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
@@ -41,18 +8,12 @@ void main(void)
|
|||||||
|
|
||||||
f_mount(&fs, "0:", 1);
|
f_mount(&fs, "0:", 1);
|
||||||
|
|
||||||
//Get pressed buttons
|
FIL payload;
|
||||||
u32 pressed = HID_PAD;
|
unsigned int read;
|
||||||
|
|
||||||
if(((pressed & BUTTON_RIGHT) && LOAD_PAYLOAD("right")) ||
|
f_open(&payload, (char *)0x24F00004, FA_READ);
|
||||||
((pressed & BUTTON_LEFT) && LOAD_PAYLOAD("left")) ||
|
f_read(&payload, (void *)PAYLOAD_ADDRESS, f_size(&payload), &read);
|
||||||
((pressed & BUTTON_UP) && LOAD_PAYLOAD("up")) ||
|
f_close(&payload);
|
||||||
((pressed & BUTTON_DOWN) && LOAD_PAYLOAD("down")) ||
|
|
||||||
((pressed & BUTTON_X) && LOAD_PAYLOAD("x")) ||
|
((void (*)())PAYLOAD_ADDRESS)();
|
||||||
((pressed & BUTTON_Y) && LOAD_PAYLOAD("y")) ||
|
|
||||||
((pressed & BUTTON_R1) && LOAD_PAYLOAD("r")) ||
|
|
||||||
((pressed & BUTTON_A) && LOAD_PAYLOAD("a")) ||
|
|
||||||
((pressed & BUTTON_SELECT) && LOAD_PAYLOAD("sel")) ||
|
|
||||||
LOAD_PAYLOAD("def"))
|
|
||||||
((void (*)())PAYLOAD_ADDRESS)();
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,11 @@
|
|||||||
.align 4
|
.align 4
|
||||||
.global _start
|
.global _start
|
||||||
_start:
|
_start:
|
||||||
|
b start
|
||||||
|
|
||||||
|
.word 0, 0, 0, 0, 0, 0, 0
|
||||||
|
|
||||||
|
start:
|
||||||
@ Flush caches
|
@ Flush caches
|
||||||
mov r0, #0
|
mov r0, #0
|
||||||
mcr p15, 0, r0, c7, c5, 0 @ flush I-cache
|
mcr p15, 0, r0, c7, c5, 0 @ flush I-cache
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
//Common data types
|
|
||||||
typedef uint8_t u8;
|
|
||||||
typedef uint16_t u16;
|
|
||||||
typedef uint32_t u32;
|
|
||||||
typedef uint64_t u64;
|
|
||||||
typedef volatile u8 vu8;
|
|
||||||
typedef volatile u16 vu16;
|
|
||||||
typedef volatile u32 vu32;
|
|
||||||
typedef volatile u64 vu64;
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = 0x24F03000;
|
. = 0x24F02000;
|
||||||
.text.start : { *(.text.start) }
|
.text.start : { *(.text.start) }
|
||||||
.text : { *(.text) }
|
.text : { *(.text) }
|
||||||
.data : { *(.data) }
|
.data : { *(.data) }
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};
|
const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};
|
||||||
u32 brightnessLevel = *(vu32 *)0x24F03008;
|
u32 brightnessLevel = *(vu32 *)0x24F02008;
|
||||||
vu32 *const arm11 = (u32 *)0x1FFFFFF8;
|
vu32 *const arm11 = (u32 *)0x1FFFFFF8;
|
||||||
|
|
||||||
*(vu32 *)0x10141200 = 0x1007F;
|
*(vu32 *)0x10141200 = 0x1007F;
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ void loadSplash(void)
|
|||||||
initScreens();
|
initScreens();
|
||||||
|
|
||||||
//Don't delay boot if no splash image is on the SD
|
//Don't delay boot if no splash image is on the SD
|
||||||
if(fileRead(fb->top_left, "/luma/splash.bin", 0x46500) +
|
if(!(fileRead(fb->top_left, "/luma/splash.bin", 0x46500) +
|
||||||
fileRead(fb->bottom, "/luma/splashbottom.bin", 0x38400))
|
fileRead(fb->bottom, "/luma/splashbottom.bin", 0x38400)))
|
||||||
{
|
{
|
||||||
u64 i = 0x1400000;
|
u64 i = 0x1400000;
|
||||||
while(i--) __asm("mov r0, r0"); //Less Ghetto sleep func
|
while(i--) __asm("mov r0, r0"); //Less Ghetto sleep func
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "screeninit.h"
|
#include "screeninit.h"
|
||||||
#include "loader.h"
|
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
#include "../build/patches.h"
|
#include "../build/patches.h"
|
||||||
|
|
||||||
@@ -43,7 +42,7 @@ void main(void)
|
|||||||
|
|
||||||
//Attempt to read the configuration file
|
//Attempt to read the configuration file
|
||||||
const char configPath[] = "/luma/config.bin";
|
const char configPath[] = "/luma/config.bin";
|
||||||
if(fileRead(&config, configPath, 4)) needConfig = 1;
|
if(!fileRead(&config, configPath, 4)) needConfig = 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
config = 0;
|
config = 0;
|
||||||
@@ -129,7 +128,7 @@ void main(void)
|
|||||||
the Safe Mode combo is not pressed, chainload an external payload */
|
the Safe Mode combo is not pressed, chainload an external payload */
|
||||||
if(((pressed & SINGLE_PAYLOAD_BUTTONS) || ((pressed & BUTTON_L1) && (pressed & L_PAYLOAD_BUTTONS)))
|
if(((pressed & SINGLE_PAYLOAD_BUTTONS) || ((pressed & BUTTON_L1) && (pressed & L_PAYLOAD_BUTTONS)))
|
||||||
&& pressed != SAFE_MODE)
|
&& pressed != SAFE_MODE)
|
||||||
loadPayload();
|
loadPayload(pressed);
|
||||||
|
|
||||||
//If no configuration file exists or SELECT is held, load configuration menu
|
//If no configuration file exists or SELECT is held, load configuration menu
|
||||||
if(needConfig == 2 || (pressed & BUTTON_SELECT))
|
if(needConfig == 2 || (pressed & BUTTON_SELECT))
|
||||||
@@ -190,10 +189,13 @@ static inline void loadFirm(u32 firmType, u32 externalFirm)
|
|||||||
{
|
{
|
||||||
section = firm->section;
|
section = firm->section;
|
||||||
|
|
||||||
|
u32 externalFirmLoaded = externalFirm &&
|
||||||
|
!fileRead(firm, "/luma/firmware.bin", 0) &&
|
||||||
|
(((u32)section[2].address >> 8) & 0xFF) == (console ? 0x60 : 0x68);
|
||||||
|
|
||||||
/* If the conditions to load the external FIRM aren't met, or reading fails, or the FIRM
|
/* If the conditions to load the external FIRM aren't met, or reading fails, or the FIRM
|
||||||
doesn't match the console, load it from CTRNAND */
|
doesn't match the console, load FIRM from CTRNAND */
|
||||||
if(!externalFirm || !fileRead(firm, "/luma/firmware.bin", 0) ||
|
if(!externalFirmLoaded)
|
||||||
(((u32)section[2].address >> 8) & 0xFF) != (console ? 0x60 : 0x68))
|
|
||||||
{
|
{
|
||||||
const char *firmFolders[3][2] = {{ "00000002", "20000002" },
|
const char *firmFolders[3][2] = {{ "00000002", "20000002" },
|
||||||
{ "00000102", "20000102" },
|
{ "00000102", "20000102" },
|
||||||
|
|||||||
77
source/fs.c
77
source/fs.c
@@ -4,7 +4,13 @@
|
|||||||
|
|
||||||
#include "fs.h"
|
#include "fs.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "screeninit.h"
|
||||||
#include "fatfs/ff.h"
|
#include "fatfs/ff.h"
|
||||||
|
#include "buttons.h"
|
||||||
|
#include "../build/loader.h"
|
||||||
|
|
||||||
|
#define PAYLOAD_ADDRESS 0x24F00000
|
||||||
|
#define PATTERN(a) a "_*.bin"
|
||||||
|
|
||||||
static FATFS sdFs,
|
static FATFS sdFs,
|
||||||
nandFs;
|
nandFs;
|
||||||
@@ -19,46 +25,73 @@ u32 mountFs(void)
|
|||||||
|
|
||||||
u32 fileRead(void *dest, const char *path, u32 size)
|
u32 fileRead(void *dest, const char *path, u32 size)
|
||||||
{
|
{
|
||||||
FRESULT fr;
|
FRESULT result;
|
||||||
FIL fp;
|
FIL file;
|
||||||
unsigned int br = 0;
|
|
||||||
|
|
||||||
fr = f_open(&fp, path, FA_READ);
|
result = f_open(&file, path, FA_READ);
|
||||||
if(fr == FR_OK)
|
if(result == FR_OK)
|
||||||
{
|
{
|
||||||
if(!size) size = f_size(&fp);
|
unsigned int read;
|
||||||
fr = f_read(&fp, dest, size, &br);
|
if(!size) size = f_size(&file);
|
||||||
|
result = f_read(&file, dest, size, &read);
|
||||||
}
|
}
|
||||||
|
|
||||||
f_close(&fp);
|
f_close(&file);
|
||||||
|
|
||||||
return fr ? 0 : 1;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 fileWrite(const void *buffer, const char *path, u32 size)
|
u32 fileWrite(const void *buffer, const char *path, u32 size)
|
||||||
{
|
{
|
||||||
FRESULT fr;
|
FRESULT result;
|
||||||
FIL fp;
|
FIL file;
|
||||||
unsigned int br = 0;
|
|
||||||
|
|
||||||
fr = f_open(&fp, path, FA_WRITE | FA_OPEN_ALWAYS);
|
result = f_open(&file, path, FA_WRITE | FA_OPEN_ALWAYS);
|
||||||
if(fr == FR_OK) fr = f_write(&fp, buffer, size, &br);
|
if(result == FR_OK)
|
||||||
|
{
|
||||||
|
unsigned int read;
|
||||||
|
result = f_write(&file, buffer, size, &read);
|
||||||
|
}
|
||||||
|
|
||||||
f_close(&fp);
|
f_close(&file);
|
||||||
|
|
||||||
return fr ? 0 : 1;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 defPayloadExists(void)
|
void loadPayload(u32 pressed)
|
||||||
{
|
{
|
||||||
|
const char *pattern;
|
||||||
|
|
||||||
|
if(pressed & BUTTON_RIGHT) pattern = PATTERN("right");
|
||||||
|
else if(pressed & BUTTON_LEFT) pattern = PATTERN("left");
|
||||||
|
else if(pressed & BUTTON_UP) pattern = PATTERN("up");
|
||||||
|
else if(pressed & BUTTON_DOWN) pattern = PATTERN("down");
|
||||||
|
else if(pressed & BUTTON_X) pattern = PATTERN("x");
|
||||||
|
else if(pressed & BUTTON_Y) pattern = PATTERN("y");
|
||||||
|
else if(pressed & BUTTON_R1) pattern = PATTERN("r");
|
||||||
|
else if(pressed & BUTTON_A) pattern = PATTERN("a");
|
||||||
|
else if(pressed & BUTTON_START) pattern = PATTERN("start");
|
||||||
|
else pattern = PATTERN("select");
|
||||||
|
|
||||||
DIR dir;
|
DIR dir;
|
||||||
FILINFO info;
|
FILINFO info;
|
||||||
|
char path[] = "/luma/payloads";
|
||||||
|
|
||||||
FRESULT result = f_findfirst(&dir, &info, "/luma/payloads", "def_*.bin");
|
FRESULT result = f_findfirst(&dir, &info, path, pattern);
|
||||||
|
|
||||||
f_closedir(&dir);
|
f_closedir(&dir);
|
||||||
|
|
||||||
return (result == FR_OK && info.fname[0]);
|
if(result == FR_OK && info.fname[0])
|
||||||
|
{
|
||||||
|
initScreens();
|
||||||
|
memcpy((void *)PAYLOAD_ADDRESS, loader, loader_size);
|
||||||
|
|
||||||
|
path[sizeof(path) - 1] = '/';
|
||||||
|
memcpy((void *)(PAYLOAD_ADDRESS + 4), path, sizeof(path));
|
||||||
|
memcpy((void *)(PAYLOAD_ADDRESS + 4 + sizeof(path)), info.altname, 13);
|
||||||
|
|
||||||
|
((void (*)())PAYLOAD_ADDRESS)();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void firmRead(void *dest, const char *firmFolder)
|
void firmRead(void *dest, const char *firmFolder)
|
||||||
@@ -71,7 +104,7 @@ void firmRead(void *dest, const char *firmFolder)
|
|||||||
|
|
||||||
f_opendir(&dir, path);
|
f_opendir(&dir, path);
|
||||||
|
|
||||||
u32 id = 0;
|
u32 id = 0xFFFFFFFF;
|
||||||
|
|
||||||
//Parse the target directory
|
//Parse the target directory
|
||||||
while(f_readdir(&dir, &info) == FR_OK && info.fname[0])
|
while(f_readdir(&dir, &info) == FR_OK && info.fname[0])
|
||||||
@@ -87,8 +120,8 @@ void firmRead(void *dest, const char *firmFolder)
|
|||||||
tempId += *tmp > '9' ? *tmp - 'A' + 10 : *tmp - '0';
|
tempId += *tmp > '9' ? *tmp - 'A' + 10 : *tmp - '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
//Found a newer cxi
|
//Found an older cxi
|
||||||
if(tempId > id) id = tempId;
|
if(tempId < id) id = tempId;
|
||||||
}
|
}
|
||||||
|
|
||||||
f_closedir(&dir);
|
f_closedir(&dir);
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
u32 mountFs(void);
|
u32 mountFs(void);
|
||||||
u32 fileRead(void *dest, const char *path, u32 size);
|
u32 fileRead(void *dest, const char *path, u32 size);
|
||||||
u32 fileWrite(const void *buffer, const char *path, u32 size);
|
u32 fileWrite(const void *buffer, const char *path, u32 size);
|
||||||
u32 defPayloadExists(void);
|
void loadPayload(u32 pressed);
|
||||||
void firmRead(void *dest, const char *firmFolder);
|
void firmRead(void *dest, const char *firmFolder);
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
/*
|
|
||||||
* loader.c
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "loader.h"
|
|
||||||
#include "fs.h"
|
|
||||||
#include "memory.h"
|
|
||||||
#include "screeninit.h"
|
|
||||||
#include "../build/loader.h"
|
|
||||||
|
|
||||||
#define PAYLOAD_ADDRESS 0x24F00000
|
|
||||||
|
|
||||||
void loadPayload(void)
|
|
||||||
{
|
|
||||||
if(defPayloadExists())
|
|
||||||
{
|
|
||||||
initScreens();
|
|
||||||
memcpy((void *)PAYLOAD_ADDRESS, loader, loader_size);
|
|
||||||
((void (*)())PAYLOAD_ADDRESS)();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
* loader.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "types.h"
|
|
||||||
|
|
||||||
void loadPayload(void);
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "../build/screeninit.h"
|
#include "../build/screeninit.h"
|
||||||
|
|
||||||
#define SCREENINIT_ADDRESS 0x24F03000
|
#define SCREENINIT_ADDRESS 0x24F02000
|
||||||
|
|
||||||
vu32 *arm11Entry = (u32 *)0x1FFFFFF8;
|
vu32 *arm11Entry = (u32 *)0x1FFFFFF8;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user