Added automatic version number printing, success messages are now green

This commit is contained in:
Aurora 2016-03-27 19:33:21 +02:00
parent 0ede524c31
commit 9833b29c78
5 changed files with 14 additions and 12 deletions

View File

@ -6,6 +6,7 @@ LD := arm-none-eabi-ld
OC := arm-none-eabi-objcopy
name := SafeA9LHInstaller
version := $(shell git describe --abbrev=0 --tags)
dir_source := source
dir_mset := CakeHax
@ -15,6 +16,7 @@ dir_out := out
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 += -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
objects= $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \

View File

@ -39,7 +39,7 @@ void installer(void){
//Detect the console being used
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(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);
@ -111,7 +111,7 @@ void installer(void){
path = "a9lh/payload_stage1.bin";
u32 size = fileSize(path);
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);
fileRead((void *)STAGE1_OFFSET, path, size);
@ -119,7 +119,7 @@ void installer(void){
path = "a9lh/payload_stage2.bin";
size = fileSize(path);
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);
fileRead((void *)STAGE2_OFFSET, path, size);
@ -131,5 +131,5 @@ void installer(void){
sdmmc_nand_writesectors(0x96, 1, (vu8 *)SECTOR_OFFSET); }
writeFirm((u8 *)FIRM0_OFFSET, 0, FIRM_SIZE);
shutdown(1, a9lhBoot ? "Update: success!" : "Full install: success!");
shutdown(2, a9lhBoot ? "Update: success!" : "Full install: success!");
}

View File

@ -3,7 +3,7 @@
#include "i2c.h"
void initScreens(void){
vu32 *const arm11 = (vu32 *)0x1FFFFFF8;
vu32 *const arm11 = (u32 *)0x1FFFFFF8;
void __attribute__((naked)) ARM11(void){
__asm(".word 0xF10C01C0");

View File

@ -3,7 +3,7 @@
#include "i2c.h"
u16 waitInput(void){
u32 pressedkey = 0;
u32 pressedKey = 0;
u16 key;
//Wait for no keys to be pressed
@ -16,18 +16,17 @@ u16 waitInput(void){
//Make sure it's pressed
for(u32 i = 0x13000; i; i--){
if (key != HID_PAD)
break;
if(i == 1) pressedkey = 1;
if(key != HID_PAD) break;
if(i == 1) pressedKey = 1;
}
} while(!pressedkey);
} while(!pressedKey);
return key;
}
void shutdown(u32 mode, const char *message){
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);
waitInput();
}

View File

@ -8,8 +8,9 @@
#define COLOR_TITLE 0xFF9900
#define COLOR_WHITE 0xFFFFFF
#define COLOR_RED 0x0000FF
#define COLOR_GREEN 0x00FF00
extern int pos_y;
int pos_y;
u16 waitInput(void);
void shutdown(u32 mode, const char *message);