From 8b5cdbd374df6b0b8124b2f6c00db3248d62f8ed Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Sun, 5 Jun 2016 01:18:22 -0400 Subject: [PATCH] Fix up langemu path (it changed) and make langemu data part of release builds --- Makefile | 12 ++++++------ README.txt | 19 +++++++++++++------ external/loader/source/patcher.c | 4 ++-- host/generate_langemu_conf.sh | 11 +++++++---- host/symtab.sh | 18 ------------------ 5 files changed, 28 insertions(+), 36 deletions(-) delete mode 100755 host/symtab.sh diff --git a/Makefile b/Makefile index 1cdd6c1..8414d45 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,9 @@ objects_cfw = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \ all: a9lh patch external .PHONY: full -full: host/langemu.conf all +full: all out/corbenik/locale + cp README.txt out/ + cd out && zip -r9 release.zip * .PHONY: external external: @@ -49,11 +51,9 @@ a9lh: $(dir_out)/arm9loaderhax.bin reformat: clang-format -i $(dir_source)/*.{c,h} $(dir_source)/*/*.{c,h} external/loader/source/*.{c,h} -host/langemu.conf: - echo "Generating langemu.conf - may take a bit" - cd host && ./generate_langemu_conf.sh - mkdir -p $(dir_out)/corbenik/etc - cp host/langemu.conf $(dir_out)/corbenik/config/langemu.conf +out/corbenik/locale: all + echo "Generating langemu data from 3dsdb - may take a bit" + cd out/corbenik && ../../host/generate_langemu_conf.sh .PHONY: clean clean: diff --git a/README.txt b/README.txt index 657e2a9..f1df93a 100644 --- a/README.txt +++ b/README.txt @@ -29,16 +29,22 @@ Old 3DS (Native FIRM, 11.0): New 3DS (Native FIRM, 11.0): http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/00000021 -You'll need the firmkey for it as well unless you have decrypted it, which should -be placed at `/corbenik/keys/native.key`. I can't tell you how to get it -obviously, but a good place to start may be an older version of Plailect's guide -when it still had a section on Cakes. +You'll need the firmkey for it as well unless you have decrypted your firmware, +and it should be placed at `/corbenik/keys/native.key`. I can't tell you how to +get it obviously, but a good place to start may be an older version of Plailect's +guide when it still had a section on Cakes. On New3DS units, there's additional crypto on arm9loader which requires the 9.6 key to decrypt. It usually is named ``Slot0x11Key96.bin`, and I also can't tell you where to find this, aside from "check Plailect's guide." Corbenik will attempt to read this from the root as well as `/corbenik/keys/11.key`. +The folder `corbenik/locale` is automatically generated language emulation +files from 3dbrew for games that only specify one region and one language. +Games which support more than one language are not generated, because there's +no 'correct' language. You can remove this if the number of files unnerves +you. It isn't required. + Setup ------------------------- @@ -67,9 +73,10 @@ You'll also want these patches, which are done by loader and therefore require i If you're on 11.0, you also want these: - * Title Downgrade Fix + * Title Downgrade Fix (Only enable with 11.0 firmware - others will fail) -If you're deliberately still running 10.4 or something, you'll want these: +If you're deliberately still running older firmware on your NAND, you'll +want these: * Fake Friends Version diff --git a/external/loader/source/patcher.c b/external/loader/source/patcher.c index a6c6396..aa32f54 100644 --- a/external/loader/source/patcher.c +++ b/external/loader/source/patcher.c @@ -96,8 +96,8 @@ loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId) // This really does need a rewrite. - char path[] = "/corbenik/etc/locale/0000000000000000"; - u32 i = 36; + char path[] = "/corbenik/locale/0000000000000000"; + u32 i = 32; while (progId) { static const char hexDigits[] = "0123456789ABCDEF"; path[i--] = hexDigits[(u32)(progId & 0xF)]; diff --git a/host/generate_langemu_conf.sh b/host/generate_langemu_conf.sh index 5354778..c034636 100755 --- a/host/generate_langemu_conf.sh +++ b/host/generate_langemu_conf.sh @@ -4,6 +4,8 @@ # a langemu config for single-language single-region games, which can have langemu # without any ill consequences. +rm -rf locale + # Fetch XML. wget "http://3dsdb.com/xml.php" -O 3ds.tmp @@ -27,12 +29,13 @@ while true; do if [ ! $R = 0 ]; then # Only one language found, since no comma. # Output an entry. - echo "$titleid $region $languages" | tr [:lower:] [:upper:] | sed -e 's|GER|EUR|g' -e 's|ITA|EUR|g' -e 's|FRA|EUR|g' -e 's|UKV|EUR|g' -e 's|NLD|EUR|g' -e 's|WLD|JPN|g' >> langemu.tmp + mkdir -p locale + echo "$region $languages" | tr [:lower:] [:upper:] | sed -e 's|GER|EUR|g' -e 's|ITA|EUR|g' -e 's|FRA|EUR|g' -e 's|UKV|EUR|g' -e 's|NLD|EUR|g' > "locale/$titleid" ENTS=$((ENTS + 1)) fi fi done 3 langemu.conf -cat langemu.tmp | sort | uniq >> langemu.conf -rm -f *.tmp +echo "$(date) - $ENTS entries" > locale/info + +rm *.tmp diff --git a/host/symtab.sh b/host/symtab.sh deleted file mode 100755 index 35e185d..0000000 --- a/host/symtab.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -echo "// This file is automatically generated. Don't edit it." -echo "#ifndef __SYMTAB_H" -echo "#define __SYMTAB_H" -grep ' 0x00000000........ ' build/link.map | \ - while read sym; do - declare -a dat - dat=($sym) - offs=${dat[0]} - name=${dat[1]} - - offs="$(echo "$offs" | sed 's|00000000||g')" - - if [ "$name" != "." ]; then - echo " #define ${name}_offset ((void*)${offs})" - fi -done -echo "#endif" -- 2.39.5