Added automatic version number printing, success messages are now green
This commit is contained in:
parent
0ede524c31
commit
9833b29c78
2
Makefile
2
Makefile
@ -6,6 +6,7 @@ LD := arm-none-eabi-ld
|
|||||||
OC := arm-none-eabi-objcopy
|
OC := arm-none-eabi-objcopy
|
||||||
|
|
||||||
name := SafeA9LHInstaller
|
name := SafeA9LHInstaller
|
||||||
|
version := $(shell git describe --abbrev=0 --tags)
|
||||||
|
|
||||||
dir_source := source
|
dir_source := source
|
||||||
dir_mset := CakeHax
|
dir_mset := CakeHax
|
||||||
@ -15,6 +16,7 @@ dir_out := out
|
|||||||
|
|
||||||
ASFLAGS := -mlittle-endian -mcpu=arm946e-s -march=armv5te
|
ASFLAGS := -mlittle-endian -mcpu=arm946e-s -march=armv5te
|
||||||
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -ffast-math
|
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -ffast-math
|
||||||
|
CFLAGS += -DTITLE="\"$(name) $(version)\""
|
||||||
FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-proof ARM9LoaderHax installer/updater." APP_AUTHOR="Aurora Wright" --no-print-directory
|
FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-proof ARM9LoaderHax installer/updater." APP_AUTHOR="Aurora Wright" --no-print-directory
|
||||||
|
|
||||||
objects= $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
objects= $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
||||||
|
@ -39,7 +39,7 @@ void installer(void){
|
|||||||
//Detect the console being used
|
//Detect the console being used
|
||||||
u32 console = (PDN_MPCORE_CFG == 1) ? 0 : 1;
|
u32 console = (PDN_MPCORE_CFG == 1) ? 0 : 1;
|
||||||
|
|
||||||
drawString("Safe A9LH Installer v1.5.1", 10, 10, COLOR_TITLE);
|
drawString(TITLE, 10, 10, COLOR_TITLE);
|
||||||
pos_y = drawString("Thanks to delebile, #cakey and StandardBus", 10, 40, COLOR_WHITE);
|
pos_y = drawString("Thanks to delebile, #cakey and StandardBus", 10, 40, COLOR_WHITE);
|
||||||
pos_y = drawString(a9lhBoot ? "Press SELECT to update A9LH" : "Press SELECT for a full install", 10, pos_y + SPACING_VERT, COLOR_WHITE);
|
pos_y = drawString(a9lhBoot ? "Press SELECT to update A9LH" : "Press SELECT for a full install", 10, pos_y + SPACING_VERT, COLOR_WHITE);
|
||||||
pos_y = drawString("Press any other button to shutdown", 10, pos_y, COLOR_WHITE);
|
pos_y = drawString("Press any other button to shutdown", 10, pos_y, COLOR_WHITE);
|
||||||
@ -111,7 +111,7 @@ void installer(void){
|
|||||||
path = "a9lh/payload_stage1.bin";
|
path = "a9lh/payload_stage1.bin";
|
||||||
u32 size = fileSize(path);
|
u32 size = fileSize(path);
|
||||||
if(!size || size > MAX_STAGE1_SIZE)
|
if(!size || size > MAX_STAGE1_SIZE)
|
||||||
shutdown(1, "Error: stage1.bin doesn't exist or exceeds\nmax size");
|
shutdown(1, "Error: payload_stage1.bin doesn't exist or\nexceeds max size");
|
||||||
memset((void *)STAGE1_OFFSET, 0, MAX_STAGE1_SIZE);
|
memset((void *)STAGE1_OFFSET, 0, MAX_STAGE1_SIZE);
|
||||||
fileRead((void *)STAGE1_OFFSET, path, size);
|
fileRead((void *)STAGE1_OFFSET, path, size);
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ void installer(void){
|
|||||||
path = "a9lh/payload_stage2.bin";
|
path = "a9lh/payload_stage2.bin";
|
||||||
size = fileSize(path);
|
size = fileSize(path);
|
||||||
if(!size || size > MAX_STAGE2_SIZE)
|
if(!size || size > MAX_STAGE2_SIZE)
|
||||||
shutdown(1, "Error: stage2.bin doesn't exist or exceeds\nmax size");
|
shutdown(1, "Error: payload_stage2.bin doesn't exist or\nexceeds max size");
|
||||||
memset((void *)STAGE2_OFFSET, 0, MAX_STAGE2_SIZE);
|
memset((void *)STAGE2_OFFSET, 0, MAX_STAGE2_SIZE);
|
||||||
fileRead((void *)STAGE2_OFFSET, path, size);
|
fileRead((void *)STAGE2_OFFSET, path, size);
|
||||||
|
|
||||||
@ -131,5 +131,5 @@ void installer(void){
|
|||||||
sdmmc_nand_writesectors(0x96, 1, (vu8 *)SECTOR_OFFSET); }
|
sdmmc_nand_writesectors(0x96, 1, (vu8 *)SECTOR_OFFSET); }
|
||||||
writeFirm((u8 *)FIRM0_OFFSET, 0, FIRM_SIZE);
|
writeFirm((u8 *)FIRM0_OFFSET, 0, FIRM_SIZE);
|
||||||
|
|
||||||
shutdown(1, a9lhBoot ? "Update: success!" : "Full install: success!");
|
shutdown(2, a9lhBoot ? "Update: success!" : "Full install: success!");
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
|
||||||
void initScreens(void){
|
void initScreens(void){
|
||||||
vu32 *const arm11 = (vu32 *)0x1FFFFFF8;
|
vu32 *const arm11 = (u32 *)0x1FFFFFF8;
|
||||||
|
|
||||||
void __attribute__((naked)) ARM11(void){
|
void __attribute__((naked)) ARM11(void){
|
||||||
__asm(".word 0xF10C01C0");
|
__asm(".word 0xF10C01C0");
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
|
||||||
u16 waitInput(void){
|
u16 waitInput(void){
|
||||||
u32 pressedkey = 0;
|
u32 pressedKey = 0;
|
||||||
u16 key;
|
u16 key;
|
||||||
|
|
||||||
//Wait for no keys to be pressed
|
//Wait for no keys to be pressed
|
||||||
@ -16,18 +16,17 @@ u16 waitInput(void){
|
|||||||
|
|
||||||
//Make sure it's pressed
|
//Make sure it's pressed
|
||||||
for(u32 i = 0x13000; i; i--){
|
for(u32 i = 0x13000; i; i--){
|
||||||
if (key != HID_PAD)
|
if(key != HID_PAD) break;
|
||||||
break;
|
if(i == 1) pressedKey = 1;
|
||||||
if(i == 1) pressedkey = 1;
|
|
||||||
}
|
}
|
||||||
} while(!pressedkey);
|
} while(!pressedKey);
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
void shutdown(u32 mode, const char *message){
|
void shutdown(u32 mode, const char *message){
|
||||||
if(mode){
|
if(mode){
|
||||||
pos_y = drawString(message, 10, pos_y + SPACING_VERT, COLOR_RED);
|
pos_y = drawString(message, 10, pos_y + SPACING_VERT, mode == 1 ? COLOR_RED : COLOR_GREEN);
|
||||||
drawString("Press any button to shutdown", 10, pos_y, COLOR_WHITE);
|
drawString("Press any button to shutdown", 10, pos_y, COLOR_WHITE);
|
||||||
waitInput();
|
waitInput();
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,9 @@
|
|||||||
#define COLOR_TITLE 0xFF9900
|
#define COLOR_TITLE 0xFF9900
|
||||||
#define COLOR_WHITE 0xFFFFFF
|
#define COLOR_WHITE 0xFFFFFF
|
||||||
#define COLOR_RED 0x0000FF
|
#define COLOR_RED 0x0000FF
|
||||||
|
#define COLOR_GREEN 0x00FF00
|
||||||
|
|
||||||
extern int pos_y;
|
int pos_y;
|
||||||
|
|
||||||
u16 waitInput(void);
|
u16 waitInput(void);
|
||||||
void shutdown(u32 mode, const char *message);
|
void shutdown(u32 mode, const char *message);
|
Loading…
x
Reference in New Issue
Block a user