Automate building the menuhax 3dsx and copying the pathchanger stuff

This commit is contained in:
Aurora 2016-09-14 19:14:45 +02:00
parent ae7a7ba365
commit 0853f6f7ad
5 changed files with 30 additions and 3 deletions

View File

@ -24,6 +24,8 @@ dir_arm9_exceptions := $(dir_exceptions)/arm9
dir_arm11_exceptions := $(dir_exceptions)/arm11
dir_mset := CakeHax
dir_ninjhax := CakeBrah
dir_menuhax := menuhax
dir_pathchanger := pathchanger
dir_build := build
dir_out := out
@ -47,7 +49,7 @@ title := \"$(name) $(revision) configuration\"
endif
.PHONY: all
all: launcher a9lh ninjhax
all: launcher a9lh ninjhax menuhax
.PHONY: launcher
launcher: $(dir_out)/$(name).dat
@ -58,6 +60,9 @@ a9lh: $(dir_out)/arm9loaderhax.bin
.PHONY: ninjhax
ninjhax: $(dir_out)/3ds/$(name)
.PHONY: menuhax
menuhax: $(dir_out)/menuhax/boot.3dsx
.PHONY: release
ifeq ($(strip $(DEV)),TRUE)
release: $(dir_out)/$(name)$(revision)-dev.7z
@ -82,6 +87,12 @@ $(dir_out)/$(name).dat: $(dir_build)/main.bin $(dir_out)
@$(MAKE) $(FLAGS) -C $(dir_mset) launcher
@dd if=$(dir_build)/main.bin of=$@ bs=512 seek=144
$(dir_out)/menuhax/boot.3dsx: $(dir_menuhax)/menuhax.diff $(dir_out)
@mkdir -p "$(@D)"
@cd $(dir_ninjhax); patch -p1 < ../$(dir_menuhax)/menuhax.diff; $(MAKE) $(FLAGS); git reset --hard
@mv $(dir_out)/$(name).3dsx $@
@rm $(dir_out)/$(name).smdh
$(dir_out)/arm9loaderhax.bin: $(dir_build)/main.bin $(dir_out)
@cp -a $(dir_build)/main.bin $@
@ -90,10 +101,15 @@ $(dir_out)/3ds/$(name): $(dir_out)
@$(MAKE) $(FLAGS) -C $(dir_ninjhax)
@mv $(dir_out)/$(name).3dsx $(dir_out)/$(name).smdh $@
$(dir_out)/$(name)$(revision).7z: launcher a9lh ninjhax
$(dir_out)/pathchanger: $(dir_pathchanger)/pathchanger.py $(dir_pathchanger)/prebuilt $(dir_out)
@mkdir -p "$@"
@cp $(dir_pathchanger)/pathchanger.py $@
@cp -rfT $(dir_pathchanger)/prebuilt $@
$(dir_out)/$(name)$(revision).7z: all $(dir_out)/pathchanger
@7z a -mx $@ ./$(@D)/*
$(dir_out)/$(name)$(revision)-dev.7z: launcher a9lh ninjhax
$(dir_out)/$(name)$(revision)-dev.7z: all $(dir_out)/pathchanger
@7z a -mx $@ ./$(@D)/* ./$(dir_exceptions)/exception_dump_parser.py
$(dir_build)/main.bin: $(dir_build)/main.elf

11
menuhax/menuhax.diff Normal file
View File

@ -0,0 +1,11 @@
diff -uNr a/source/main.c b/source/main.c
--- a/source/main.c 2016-09-11 01:04:25.665231884 +0200
+++ b/source/main.c 2016-09-14 12:36:28.601439550 +0200
@@ -9,6 +9,7 @@
#endif
int main (void) {
+ svcSleepThread(2500 * 1000000ULL);
if (brahma_init()) {
if (load_arm9_payload_offset("/" LAUNCHER_PATH, 0x12000, 0x10000) != 1)
goto error;

Binary file not shown.

Binary file not shown.

Binary file not shown.