Super Mario 64 ROM Hacking 工具集使用教程
1. 项目的目录结构及介绍
该项目的目录结构如下:
sm64tools/
├── configs/ # 配置文件示例
├── examples/ # 示例文件
├── ext/ # 扩展文件
├── release/ # 发布文件
├── tests/example1/ # 测试示例
├── tools/ # 工具源代码
│ ├── blast.c
│ ├── config.h
│ ├── f3d.c
│ ├── f3d2obj.c
│ ├── libblast.h
│ ├── libmio0.c
│ ├── libmio0.h
│ ├── libsfx.c
│ ├── libsfx.h
│ ├── libsm64.c
│ ├── libsm64.h
│ ├── mipsdisasm.c
│ ├── mipsdisasm.h
│ ├── n64cksum.c
│ ├── n64graphics.c
│ ├── n64graphics.h
│ ├── n64split.c
│ ├── n64split.collision.mtl.h
│ ├── n64split.makefile.h
│ ├── sm64compress.c
│ ├── sm64extend.c
│ ├── sm64geo.c
│ ├── sm64walk.c
│ ├── strutils.c
│ ├── strutils.h
│ ├── utils.c
│ ├── utils.h
│ └── yamlconfig.c
├── .gitignore
├── .gitmodules
├── CMakeLists.txt # CMake 构建配置文件
├── LICENSE # 许可证文件
├── Makefile # Makefile 构建文件
├── README.md # 项目说明文件
└── TODO # 待办事项
目录详细介绍
- configs/: 包含示例配置文件,用于不同版本的 Super Mario 64 ROM。
- examples/: 提供一些示例文件,帮助用户理解工具的使用方法。
- ext/: 存放扩展文件,可能包括一些额外的库或工具。
- release/: 用于存放发布的版本文件。
- tests/example1/: 包含测试示例,用于验证工具的功能。
- tools/: 包含所有工具的源代码,如
n64split
、sm64extend
、sm64compress
等。 - .gitignore: 指定 Git 忽略的文件和目录。
- .gitmodules: 用于管理子模块的配置文件。
- CMakeLists.txt: CMake 构建系统的配置文件,用于生成 Makefile。
- LICENSE: 项目使用的许可证文件,这里是 MIT 许可证。
- Makefile: 用于构建项目的 Makefile 文件。
- README.md: 项目说明文件,包含项目介绍和使用方法。
- TODO: 记录项目待办事项的文件。
2. 项目的启动文件介绍
项目的启动文件主要是 Makefile
和 CMakeLists.txt
。
Makefile
Makefile
是用于构建项目的文件,通过执行 make
命令可以编译项目中的工具。以下是一些常用的 Makefile 命令:
make # 编译所有工具
make clean # 清除编译生成的文件
make install # 安装编译后的工具到系统
CMakeLists.txt
CMakeLists.txt
是 CMake 构建系统的配置文件,用于生成 Makefile。使用 CMake 可以更灵活地配置构建环境。以下是如何使用 CMake 构建:
mkdir build
cd build
cmake ..
make
3. 项目的配置文件介绍
项目的配置文件主要位于 configs/
目录下,这些文件用于配置不同版本的 Super Mario 64 ROM。
配置文件示例
假设有一个配置文件 example_config.txt
,其内容可能如下:
[ROM]
name = Super Mario 64 (USA)
version = 1.0
[Assets]
texture_dir = textures/
model_dir = models/
level_dir = levels/
配置文件使用
在运行工具时,可以通过 -c
参数指定配置文件。例如,使用 n64split
工具时:
n64split -c configs/example_config.txt rom.z64
这将根据指定的配置文件来拆分和构建 ROM。
配置文件参数
配置文件中可以包含多种参数,如 ROM 名称、版本、资源目录等。具体的参数取决于使用的工具和需求。
总结
本文介绍了 Super Mario 64 ROM Hacking 工具集的目录结构、启动文件和配置
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考