Fix some of the bugs
This commit is contained in:
parent
a65f7fbf88
commit
f3b2a6c30d
2
Makefile
2
Makefile
@ -22,7 +22,7 @@ $(NAME)$(REVISION).zip: boot.firm exception_dump_parser
|
||||
|
||||
boot.firm: $(SUBFOLDERS)
|
||||
@firmtool build $@ -D sysmodules/sysmodules.bin arm11/arm11.elf arm9/arm9.elf k11_extension/k11_extension.elf \
|
||||
-A 0x18180000 0x18000000 -C XDMA XDMA NDMA XDMA
|
||||
-A 0x18180000 -C XDMA XDMA NDMA XDMA
|
||||
@echo built... $(notdir $@)
|
||||
|
||||
$(SUBFOLDERS):
|
||||
|
@ -89,9 +89,7 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||
|
||||
export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||
|
||||
ifeq ($(strip $(APP_TITLE)),)
|
||||
APP_TITLE := $(notdir $(OUTPUT))
|
||||
endif
|
||||
export APP_TITLE := $(notdir $(TOPDIR)/..)
|
||||
|
||||
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "emunand.h"
|
||||
#include "utils.h"
|
||||
#include "alignedseqmemcpy.h"
|
||||
#include "strings.h"
|
||||
#include "fatfs/sdmmc/sdmmc.h"
|
||||
|
||||
/****************************************************************
|
||||
@ -581,9 +582,7 @@ void kernel9Loader(Arm9Bin *arm9Section)
|
||||
u8 arm9BinSlot = k9lVersion == 0 ? 0x15 : 0x16;
|
||||
|
||||
// Get size
|
||||
u32 arm9SectionSize = 0;
|
||||
for(u32 i = 0; i < 8; i++)
|
||||
arm9SectionSize = (arm9Section->size[i] - '0') + 10*arm9SectionSize;
|
||||
u32 arm9SectionSize = decAtoi(arm9Section->size, 8);
|
||||
|
||||
//Set keyX
|
||||
__attribute__((aligned(4))) u8 keyX[AES_BLOCK_SIZE];
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "buttons.h"
|
||||
#include "firm.h"
|
||||
#include "crypto.h"
|
||||
#include "strings.h"
|
||||
|
||||
static FATFS sdFs,
|
||||
nandFs;
|
||||
@ -272,10 +273,7 @@ u32 firmRead(void *dest, u32 firmType)
|
||||
//Not a cxi
|
||||
if(info.fname[9] != 'a' || strlen(info.fname) != 12) continue;
|
||||
|
||||
u32 tempVersion = 0;
|
||||
char *tmp = info.fname;
|
||||
for(u32 i = 0; i < 8 && *tmp != 0; tmp++, i++)
|
||||
tempVersion = (*tmp > '9' ? (*tmp >= 'A' ? *tmp - 'A' : *tmp - 'a') + 10 : *tmp - '0') + (tempVersion << 4);
|
||||
u32 tempVersion = hexAtoi(info.altname, 8);
|
||||
|
||||
//Found an older cxi
|
||||
if(tempVersion < firmVersion) firmVersion = tempVersion;
|
||||
|
@ -25,25 +25,6 @@
|
||||
*/
|
||||
|
||||
#include "strings.h"
|
||||
#include "memory.h"
|
||||
|
||||
u32 strlen(const char *string)
|
||||
{
|
||||
char *stringEnd = (char *)string;
|
||||
|
||||
while(*stringEnd != 0) stringEnd++;
|
||||
|
||||
return stringEnd - string;
|
||||
}
|
||||
|
||||
u32 strnlen(const char *string, u32 maxlen)
|
||||
{
|
||||
u32 size;
|
||||
|
||||
for(size = 0; size < maxlen && *string; string++, size++);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
u32 hexAtoi(const char *in, u32 digits)
|
||||
{
|
||||
|
@ -28,7 +28,5 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
u32 strlen(const char *string);
|
||||
u32 strnlen(const char *string, u32 maxlen);
|
||||
u32 hexAtoi(const char *in, u32 digits);
|
||||
u32 decAtoi(const char *in, u32 digits);
|
||||
|
@ -110,7 +110,7 @@ SECTIONS
|
||||
*(.bss.*)
|
||||
*(.gnu.linkonce.b*)
|
||||
*(COMMON)
|
||||
. = ALIGN(8);
|
||||
. = ALIGN(0x1000);
|
||||
PROVIDE (__bss_end__ = ABSOLUTE(.));
|
||||
PROVIDE (__end__ = ABSOLUTE(.));
|
||||
} >main :NONE
|
||||
|
Reference in New Issue
Block a user