diff --git a/.github/README.md b/.github/README.md index ad763cf7d4..0f240e88a9 100644 --- a/.github/README.md +++ b/.github/README.md @@ -64,14 +64,14 @@ pokeemerald-expansion是基于pret的[pokeemerald](https://github.com/pret/pokee - 检查你的当前版本。 - 你可以在调试菜单的`Utilities -> Expansion Version`选项中检查。 - 如果该选项不可用,你可能拥有的是1.6.2或更早的版本。在那种情况下,请查看[更改日志](docs/CHANGELOG.md)以确定你的版本,基于你仓库中可用的功能。 -- ***重要提示***:如果你落后了几个版本,我们建议你一次更新一个小版本,而不是直接跳到最新的补丁版本(例如,1.5.3 -> 1.6.2 -> 1.7.4等等。查看在线文档网站](https://rh-hideout.github.io/pokeemerald-expansion/CHANGELOG.html)以查看每个步骤的最新版本。) +- ***重要提示***:如果你落后了几个版本,我们建议你一次更新一个小版本,而不是直接跳到最新的补丁版本(例如,1.5.3 -> 1.6.2 -> 1.7.4等等。[查看在线文档网站](https://rh-hideout.github.io/pokeemerald-expansion/CHANGELOG.html)以查看每个步骤的最新版本。) - 一旦你设置了远程仓库,请运行命令`git pull RHH expansion/X.Y.Z`,将X、Y和Z替换为你想要更新到的相应版本的数字(例如,要更新到1.11.1,请使用`git pull RHH expansion/1.11.1`)。 - ***重要提示***:如果你落后了几个版本,我们建议你一次更新一个小版本,而不是直接跳到最新的补丁版本(例如,1.5.3 -> 1.6.2 -> 1.7.4等等) - 另外,你可以更新到扩展的未发布版本。 - ***master(稳定版)***:它包含将在下一个补丁版本中发布的***bug修复***。要合并,请使用`git pull RHH master`。 - ***upcoming(不稳定版,可能存在bug)***:它包含将在下一个小版本中发布的***功能***。要合并,请使用`git pull RHH upcoming`。 -### 请考虑在你的项目中归功于整个贡献者名单](https://github.com/rh-hideout/pokeemerald-expansion/wiki/Credits),因为他们都为开发这个项目付出了辛勤的努力 :) +### 请考虑在你的项目中归功于整个[贡献者名单](https://github.com/rh-hideout/pokeemerald-expansion/wiki/Credits),因为他们都为开发这个项目付出了辛勤的努力 :) ## 谁在维护这个项目? @@ -246,4 +246,4 @@ pokeemerald-expansion是基于pret的[pokeemerald](https://github.com/pret/pokee - 《黑2/白2》及以后的驱虫喷雾系统,也支持《Let's Go!皮卡丘/伊布》中的香水。 - 第六世代及以后的努力值上限。 - 包含了pret的所有错误修复。 - - 修复了地图上的下雪天气效果。 \ No newline at end of file + - 修复了地图上的下雪天气效果。 diff --git a/Makefile b/Makefile index f2128cc25d..aaa8e9db4a 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,7 @@ endif PREFIX := arm-none-eabi- OBJCOPY := $(PREFIX)objcopy OBJDUMP := $(PREFIX)objdump +READELF := $(PREFIX)readelf AS := $(PREFIX)as LD := $(PREFIX)ld @@ -86,6 +87,7 @@ endif ELF := $(ROM:.gba=.elf) MAP := $(ROM:.gba=.map) SYM := $(ROM:.gba=.sym) +NOCASHSYM := $(ROM:.gba=.sym) # Commonly used directories C_SUBDIR = src @@ -294,6 +296,8 @@ endif syms: $(SYM) +nosyms: $(NOCASHSYM) + clean: tidy clean-tools clean-check-tools clean-generated clean-assets @$(MAKE) clean -C libagbsyscall @@ -465,3 +469,7 @@ $(ROM): $(ELF) # Symbol file (`make syms`) $(SYM): $(ELF) $(OBJDUMP) -t $< | sort -u | grep -E "^0[2389]" | $(PERL) -p -e 's/^(\w{8}) (\w).{6} \S+\t(\w{8}) (\S+)$$/\1 \2 \3 \4/g' > $@ + +# Symbol file (`make nosyms) +$(NOCASHSYM): $(ELF) + $(READELF) -Ws $< | tail -n +4 | awk '$$4 !~/(FILE|NOTYPE)/ && $$8 !~/^(\$$|\.)/ {print $$2,$$8}' | sort -k 1 | awk '!seen[$$1]++' > $@ diff --git a/docs/install/windows/WSL_ZH.md b/docs/install/windows/WSL_ZH.md index 991de2a25c..8fc5ede07b 100644 --- a/docs/install/windows/WSL_ZH.md +++ b/docs/install/windows/WSL_ZH.md @@ -113,4 +113,40 @@ mkdir decomps ```bash cd ~/decomps +``` + +## WSL更新或安装依赖时错误解决 + +更新WSL安装依赖项时如果出现以下错误提示 + +```console +E: Sub-process /usr/bin/dpkg returned an error code (1) +``` + +可先执行以下命令 + +```bash +sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old +sudo mkdir /var/lib/dpkg/info +``` + +等待命令执行完毕后再次运行更新WSL安装依赖项命令。更新或安装完毕后运行以下命令以恢复pkg信息 + +```bash +sudo mv /var/lib/dpkg/info_old/* /var/lib/dpkg/info/ +sudo rmdir /var/lib/dpkg/info_old +``` + +如果出现以下提示,并列出可移除的包名(以libllvm17t64为例) + +```console +The following package was automatically installed and is no longer required: + libllvm17t64 +``` + +可执行以下命令解决该提示 + +```bash +sudo apt autoremove +sudo apt install libllvm17t64 ``` \ No newline at end of file diff --git a/python_tools/test.py b/python_tools/test.py index db53d85da8..3da0158781 100644 --- a/python_tools/test.py +++ b/python_tools/test.py @@ -1,3 +1,4 @@ +#!/usr/bin/python python3 # 原始字符串 text = "全副武装的样子。\n即使是极巨化宝可梦的\n攻击也能轻易抵挡。" diff --git a/python_tools/test_follow.py b/python_tools/test_follow.py index a37a02974c..07b1f309bd 100644 --- a/python_tools/test_follow.py +++ b/python_tools/test_follow.py @@ -1,9 +1,19 @@ +#!/usr/bin/python python3 +import os import openpyxl import re +# 获取py文件所在文件夹绝对路径 +pydir = os.path.dirname(os.path.realpath(__file__)) + +#获取excel相对py文件路径 +excel_path = os.path.join(pydir, "src", "精灵跟随.xlsx") + +# 获取C文件所在文件夹相对py文件路径 +cdir = os.path.join(os.path.dirname(pydir), "src") + # 文件路径 -excel_path = r"c:\Users\Nox\Documents\GitHub\pokeemerald-expansion-Chinese\python_tools\src\精灵跟随.xlsx" -c_file_path = r"c:\Users\Nox\Documents\GitHub\pokeemerald-expansion-Chinese\src\follower_helper.c" +c_file_path = os.path.join(cdir, "follower_helper.c") # 读取 Excel 文件 wb = openpyxl.load_workbook(excel_path) diff --git a/python_tools/test_string_extract.py b/python_tools/test_string_extract.py index 1d26e42607..8ad841ac67 100644 --- a/python_tools/test_string_extract.py +++ b/python_tools/test_string_extract.py @@ -1,8 +1,16 @@ +#!/usr/bin/python python3 +import os import re +# 获取py文件所在文件夹绝对路径 +pydir = os.path.dirname(os.path.realpath(__file__)) + +# 获取C文件所在文件夹相对py文件路径 +cdir = os.path.join(os.path.dirname(pydir), "src") + # 文件路径 -input_file = r"c:\Users\Nox\Documents\GitHub\pokeemerald-expansion-Chinese\src\strings.c" -output_file = r"c:\Users\Nox\Documents\GitHub\pokeemerald-expansion-Chinese\extracted_strings.txt" +input_file = os.path.join(cdir, "strings.c") +output_file = os.path.join(os.path.dirname(pydir), "extracted_strings.txt") # 正则表达式匹配变量名和 _("...") 之间的内容 pattern = re.compile(r'const\s+u8\s+(\w+)\[\]\s*=\s*_\("([^"]*)"\)') diff --git a/python_tools/translate_battle_message.py b/python_tools/translate_battle_message.py index 9b895933ba..f41b913609 100644 --- a/python_tools/translate_battle_message.py +++ b/python_tools/translate_battle_message.py @@ -1,10 +1,13 @@ +#!/usr/bin/python python3 import re import os from openpyxl import load_workbook +pydir = os.path.dirname(os.path.abspath(__file__)) + # 文件路径 -c_file_path = os.path.dirname(os.path.abspath(__file__))+"/../src/battle_message.c" -xlsx_file_path = os.path.dirname(os.path.abspath(__file__))+"/src/战斗文本.xlsx" +c_file_path = os.path.join(os.path.dirname(pydir), "src", "battle_message.c") +xlsx_file_path = os.path.join(pydir, "src", "战斗文本.xlsx") # 读取 xlsx 文件并解析为字典 def load_translations(xlsx_file_path): diff --git a/python_tools/translate_debug.py b/python_tools/translate_debug.py index ac685988f8..8e7624d8d9 100644 --- a/python_tools/translate_debug.py +++ b/python_tools/translate_debug.py @@ -1,3 +1,4 @@ +#!/usr/bin/python python3 import re import openpyxl import os @@ -45,8 +46,8 @@ def replace_in_c_file(c_file, replacement_dict): # 主函数 def main(): current_folder = os.path.dirname(os.path.abspath(__file__)) - xlsx_file = current_folder+"/src/debug文本.xlsx" # Excel 文件路径 - c_file = current_folder+"/../src/battle_debug.c" # C 文件路径 + xlsx_file = os.path.join(current_folder, "src", "debug文本.xlsx") # Excel 文件路径 + c_file = os.path.join(os.path.dirname(current_folder), "src", "battle_debug.c") # C 文件路径 # 加载替换字典 replacement_dict = load_replacement_dict(xlsx_file) diff --git a/python_tools/translate_decoration.py b/python_tools/translate_decoration.py index 282f3ed249..1697847d53 100644 --- a/python_tools/translate_decoration.py +++ b/python_tools/translate_decoration.py @@ -1,11 +1,12 @@ +#!/usr/bin/python python3 import openpyxl import re import os # 文件路径 base_dir = os.path.dirname(os.path.abspath(__file__)) -h_file_path = os.path.join(base_dir, "../src/data/decoration/header.h") -xlsx_path = os.path.join(base_dir, "src/装饰物品.xlsx") +h_file_path = os.path.join(os.path.dirname(base_dir), "src", "data", "decoration", "header.h") +xlsx_path = os.path.join(base_dir, "src", "装饰物品.xlsx") # 加载Excel文件 wb = openpyxl.load_workbook(xlsx_path) diff --git a/python_tools/translate_decoration2.py b/python_tools/translate_decoration2.py index 2ea84296fc..906f1c91c6 100644 --- a/python_tools/translate_decoration2.py +++ b/python_tools/translate_decoration2.py @@ -1,10 +1,12 @@ +#!/usr/bin/python python3 import openpyxl import re import os # 文件路径 -h_file_path = os.path.dirname(os.path.abspath(__file__))+"/../src/data/decoration/description.h" -xlsx_path = os.path.dirname(os.path.abspath(__file__))+"/src/装饰物品.xlsx" +base_dir = os.path.dirname(os.path.abspath(__file__)) +h_file_path = os.path.join(os.path.dirname(base_dir), "src", "data", "decoration", "description.h") +xlsx_path = os.path.join(base_dir, "src", "装饰物品.xlsx") # 加载Excel文件 wb = openpyxl.load_workbook(xlsx_path) diff --git a/python_tools/translate_items.py b/python_tools/translate_items.py index 32d9f346c0..f7d59b2863 100644 --- a/python_tools/translate_items.py +++ b/python_tools/translate_items.py @@ -1,3 +1,4 @@ +#!/usr/bin/python python3 import os import re import pandas as pd @@ -60,13 +61,13 @@ def replace_item_info(content, df): return content def log(message): - with open(current_folder+"\log.txt", "a", encoding="utf-8") as log_file: + with open(os.path.join(current_folder, "log.txt"), "a", encoding="utf-8") as log_file: log_file.write(message + "\n") print(message) if __name__ == "__main__": - work_file = current_folder +"\..\src\data\items.h" - df = pd.read_excel(current_folder +r'\src\道具.xlsx') + work_file = os.path.join(os.path.dirname(current_folder), "src", "data", "items.h") + df = pd.read_excel(os.path.join(current_folder, "src", "道具.xlsx")) df.set_index('道具', inplace=True) diff --git a/python_tools/translate_pokemon.py b/python_tools/translate_pokemon.py index 58c98edbe0..f96ad05c85 100644 --- a/python_tools/translate_pokemon.py +++ b/python_tools/translate_pokemon.py @@ -1,3 +1,4 @@ +#!/usr/bin/python python3 import os import re import pandas as pd @@ -56,14 +57,13 @@ def replace_species_info(content, df): return content def log(message): - with open(current_folder+"\log.txt", "a", encoding="utf-8") as log_file: + with open(os.path.join(current_folder, "log.txt"), "a", encoding="utf-8") as log_file: log_file.write(message + "\n") print(message) if __name__ == "__main__": - - work_folder = current_folder +"\..\src\data\pokemon\species_info" - df = pd.read_excel(current_folder +r'\src\图鉴.xlsx') + work_folder = os.path.join(os.path.dirname(current_folder), "src", "data", "pokemon", "species_info") + df = pd.read_excel(os.path.join(current_folder, "src", "图鉴.xlsx")) df.set_index('name', inplace=True) for filename in os.listdir(work_folder): diff --git a/python_tools/translate_skills.py b/python_tools/translate_skills.py index 4e8a215fb5..a3b21ccf25 100644 --- a/python_tools/translate_skills.py +++ b/python_tools/translate_skills.py @@ -1,3 +1,4 @@ +#!/usr/bin/python python3 import os import re import pandas as pd @@ -60,14 +61,13 @@ def replace_move_info(content, df): return content def log(message): - with open(current_folder+"\log.txt", "a", encoding="utf-8") as log_file: + with open(os.path.join(current_folder, "log.txt"), "a", encoding="utf-8") as log_file: log_file.write(message + "\n") print(message) if __name__ == "__main__": - - work_file = current_folder +"\..\src\data\moves_info.h" - df = pd.read_excel(current_folder +r'\src\招式.xlsx') + work_file = os.path.join(os.path.dirname(current_folder), "src", "data", "moves_info.h") + df = pd.read_excel(os.path.join(current_folder, "src", "招式.xlsx")) df.set_index('招式', inplace=True) diff --git a/python_tools/translate_string.py b/python_tools/translate_string.py index 1783699a0a..5156ed61c3 100644 --- a/python_tools/translate_string.py +++ b/python_tools/translate_string.py @@ -1,4 +1,4 @@ - +#!/usr/bin/python python3 import os import re import pandas as pd @@ -44,13 +44,12 @@ def replace_move_info(content, df): return content def log(message): - with open(current_folder+"\log.txt", "a", encoding="utf-8") as log_file: + with open(os.path.join(current_folder, "log.txt"), "a", encoding="utf-8") as log_file: log_file.write(message + "\n") print(message) if __name__ == "__main__": - - work_file = current_folder +"\..\src\strings.c" - df = pd.read_excel(current_folder + r'\src\文本.xlsx') + work_file = os.path.join(os.path.dirname(current_folder), "src", "strings.c") + df = pd.read_excel(os.path.join(current_folder, "src", "文本.xlsx")) # 检查并清理重复的“变量名” df = df.drop_duplicates(subset='变量名', keep='first')