├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── research-topic.md ├── actions │ └── build-resymgen │ │ └── action.yml └── workflows │ ├── check-headers.yml │ ├── check-resymgen.yml │ ├── check-symbol-compatibility.yml │ ├── check-symbol-header-sync.yml │ ├── check-symbols.yml │ └── release.yml ├── .gitignore ├── CREDITS.txt ├── Cargo.toml ├── LICENSE.txt ├── README.md ├── check_and_format.sh ├── docs ├── contributing.md ├── ghidra-setup.md ├── images │ ├── dslazy.png │ ├── gh-actions-headers.png │ ├── gh-actions-symbols.png │ ├── ghidra-bitfields.png │ ├── ghidra-create-new-script.png │ ├── ghidra-data-types.png │ ├── ghidra-enum-labels.png │ ├── ghidra-equates.png │ ├── ghidra-import-symbols-script.png │ ├── ghidra-language.png │ ├── ghidra-manage-script-directories.png │ ├── ghidra-markup-register-variable-references.png │ ├── ghidra-new-project.png │ ├── ghidra-parameters.png │ ├── ghidra-parsing-c.png │ ├── ghidra-project-selection.png │ ├── ghidra-register-variables.png │ ├── ghidra-retype-label.png │ ├── ghidra-retype-variable.png │ ├── ghidra-symbol-file.png │ ├── ghidra-symbols-with-descriptions.png │ ├── ghidra-symbols.png │ ├── nocash-files.png │ ├── nocash-symbols.png │ ├── nocash-symfile.png │ ├── top-readme-ghidra.png │ ├── top-readme-nocash.png │ └── top-readme-tech-docs.png ├── overlays.md ├── resources.md ├── resymgen.md └── using-debug-info.md ├── headers ├── .clang-format ├── LICENSE.txt ├── Makefile ├── README.md ├── augment_headers.py ├── data │ ├── arm9.h │ ├── arm9 │ │ └── itcm.h │ ├── data.h │ ├── literals.h │ ├── overlay01.h │ ├── overlay09.h │ ├── overlay10.h │ ├── overlay11.h │ ├── overlay13.h │ ├── overlay14.h │ ├── overlay15.h │ ├── overlay16.h │ ├── overlay17.h │ ├── overlay18.h │ ├── overlay19.h │ ├── overlay20.h │ ├── overlay21.h │ ├── overlay22.h │ ├── overlay23.h │ ├── overlay24.h │ ├── overlay25.h │ ├── overlay27.h │ ├── overlay29.h │ ├── overlay29 │ │ └── move_effects.h │ ├── overlay31.h │ ├── overlay34.h │ └── ram.h ├── functions │ ├── arm7.h │ ├── arm9.h │ ├── arm9 │ │ ├── itcm.h │ │ └── libs.h │ ├── functions.h │ ├── overlay00.h │ ├── overlay01.h │ ├── overlay09.h │ ├── overlay10.h │ ├── overlay11.h │ ├── overlay13.h │ ├── overlay14.h │ ├── overlay19.h │ ├── overlay29.h │ ├── overlay29 │ │ └── move_effects.h │ ├── overlay30.h │ ├── overlay31.h │ └── overlay34.h ├── pmdsky.h ├── pmdsky_eu.h ├── pmdsky_jp.h ├── pmdsky_na.h ├── symbol_check.py ├── types │ ├── common │ │ ├── common.h │ │ ├── enums.h │ │ ├── file_io.h │ │ ├── graphics.h │ │ ├── sound.h │ │ ├── util.h │ │ └── window.h │ ├── dungeon_mode │ │ ├── dungeon.h │ │ ├── dungeon_mode.h │ │ ├── dungeon_mode_common.h │ │ └── enums.h │ ├── files │ │ ├── rescue.h │ │ └── wan.h │ ├── ground_mode │ │ ├── enums.h │ │ ├── ground_mode.h │ │ └── version_dep_enums.h │ ├── sentry_duty │ │ └── sentry_duty.h │ └── types.h └── versions.h ├── src ├── checks.rs ├── data_formats.rs ├── data_formats │ ├── ghidra.rs │ ├── ghidra_csv.rs │ ├── json.rs │ ├── sym.rs │ ├── symgen_yml.rs │ └── symgen_yml │ │ ├── adapter.rs │ │ ├── bounds.rs │ │ ├── error.rs │ │ ├── merge.rs │ │ ├── symgen.rs │ │ ├── symgen │ │ └── cursor.rs │ │ └── types.rs ├── formatting.rs ├── lib.rs ├── main.rs ├── transform.rs └── util.rs ├── symbols ├── LICENSE.txt ├── README.md ├── arm7.yml ├── arm9.yml ├── arm9 │ ├── itcm.yml │ └── libs.yml ├── literals.yml ├── overlay00.yml ├── overlay01.yml ├── overlay02.yml ├── overlay03.yml ├── overlay04.yml ├── overlay05.yml ├── overlay06.yml ├── overlay07.yml ├── overlay08.yml ├── overlay09.yml ├── overlay10.yml ├── overlay11.yml ├── overlay12.yml ├── overlay13.yml ├── overlay14.yml ├── overlay15.yml ├── overlay16.yml ├── overlay17.yml ├── overlay18.yml ├── overlay19.yml ├── overlay20.yml ├── overlay21.yml ├── overlay22.yml ├── overlay23.yml ├── overlay24.yml ├── overlay25.yml ├── overlay26.yml ├── overlay27.yml ├── overlay28.yml ├── overlay29.yml ├── overlay29 │ └── move_effects.yml ├── overlay30.yml ├── overlay31.yml ├── overlay32.yml ├── overlay33.yml ├── overlay34.yml ├── overlay35.yml └── ram.yml └── tools ├── README.md ├── ansi.py ├── arm5find.py ├── ghidra_scripts ├── import_symbols_json.py └── import_symbols_ntr_ghidra.py ├── offsets.py ├── resymgen.py ├── symbols_vfill.py ├── symcompat.py └── symdiff.py /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop environment** 27 | - OS: [e.g. iOS] 28 | - Version [e.g. 22] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/research-topic.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Research topic 3 | about: Symbols, headers, etc. that aren't fully understood and need more research 4 | title: '' 5 | labels: research 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Existing information** 11 | What we currently know about this topic. 12 | 13 | **Relevant addresses** 14 | Function, data, or instruction addresses (and the corresponding binary version(s)) relevant to this topic. 15 | -------------------------------------------------------------------------------- /.github/actions/build-resymgen/action.yml: -------------------------------------------------------------------------------- 1 | name: Build resymgen 2 | description: Build and install resymgen (release profile and tests) or retrieve it from cache 3 | runs: 4 | using: composite 5 | steps: 6 | - name: Check cache 7 | id: cache-lookup 8 | uses: actions/cache@v3 9 | with: 10 | path: | 11 | ~/.cargo/bin/resymgen 12 | ~/.cargo/registry 13 | ~/.cargo/git 14 | target 15 | key: cache-v3_${{ runner.os }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('src/**') }} 16 | - name: Build resymgen 17 | run: cargo build --release --verbose 18 | shell: bash 19 | if: steps.cache-lookup.outputs.cache-hit != 'true' 20 | - name: Build tests 21 | run: cargo build --tests --verbose 22 | shell: bash 23 | if: steps.cache-lookup.outputs.cache-hit != 'true' 24 | - name: Install 25 | run: cargo install --path . 26 | shell: bash 27 | if: steps.cache-lookup.outputs.cache-hit != 'true' 28 | -------------------------------------------------------------------------------- /.github/workflows/check-headers.yml: -------------------------------------------------------------------------------- 1 | name: Check C Headers 2 | 3 | on: 4 | pull_request: 5 | paths: 'headers/**' 6 | branches: 7 | - master 8 | workflow_call: 9 | inputs: 10 | no-format-on-check-fail: 11 | required: false 12 | type: boolean 13 | default: false 14 | 15 | jobs: 16 | compile: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Compile 22 | run: make -C headers headers-aligned CFLAGS='-Wno-incompatible-library-redeclaration' 23 | implicit-padding-check: 24 | runs-on: ubuntu-latest 25 | needs: compile 26 | steps: 27 | - name: Checkout 28 | uses: actions/checkout@v4 29 | - name: Compile with implicit packing 30 | run: make -C headers headers-packed CFLAGS='-Wno-incompatible-library-redeclaration' 31 | compile-no-builtin: 32 | runs-on: ubuntu-latest 33 | needs: compile 34 | steps: 35 | - name: Checkout 36 | uses: actions/checkout@v4 37 | - name: Compile with no builtin function declarations 38 | run: make -C headers headers-no-builtin 39 | compile-unsized: 40 | runs-on: ubuntu-latest 41 | needs: compile 42 | steps: 43 | - name: Checkout 44 | uses: actions/checkout@v4 45 | - name: Compile with unsized types 46 | run: make -C headers headers-unsized 47 | format-check: 48 | runs-on: ubuntu-latest 49 | steps: 50 | - name: Checkout 51 | uses: actions/checkout@v4 52 | - name: Format check 53 | run: make -C headers format-check 54 | format: 55 | runs-on: ubuntu-latest 56 | needs: format-check 57 | if: failure() && !inputs.no-format-on-check-fail 58 | steps: 59 | - name: Checkout 60 | uses: actions/checkout@v4 61 | - name: Format 62 | run: make -C headers format 63 | - name: Package reformatted files 64 | run: zip clang-format-output.zip $(git diff --relative --name-only) 65 | working-directory: headers 66 | - name: Upload reformatted files 67 | uses: actions/upload-artifact@v4 68 | with: 69 | name: formatted-headers 70 | path: headers/clang-format-output.zip 71 | retention-days: 1 72 | - name: Provide download link 73 | run: | 74 | echo 'Download link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts' 75 | echo "You can download these properly formatted header files if you don't have the formatter (clang-format) set up in your environment." 76 | -------------------------------------------------------------------------------- /.github/workflows/check-resymgen.yml: -------------------------------------------------------------------------------- 1 | name: Check resymgen 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - 'src/**.rs' 7 | - 'Cargo.toml' 8 | branches: 9 | - master 10 | workflow_call: 11 | 12 | env: 13 | CARGO_TERM_COLOR: always 14 | 15 | jobs: 16 | format-check: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Format check 22 | run: cargo fmt --verbose -- --check 23 | build-and-test: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v4 28 | - name: Build 29 | uses: ./.github/actions/build-resymgen 30 | - name: Test 31 | run: cargo test --verbose 32 | clippy-check: 33 | runs-on: ubuntu-latest 34 | continue-on-error: true 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v4 38 | - name: Install Clippy 39 | run: rustup component add clippy 40 | - name: Run Clippy 41 | uses: actions-rs/clippy-check@v1 42 | with: 43 | token: ${{ secrets.GITHUB_TOKEN }} 44 | args: --all-features 45 | -------------------------------------------------------------------------------- /.github/workflows/check-symbol-compatibility.yml: -------------------------------------------------------------------------------- 1 | name: Check Symbol Compatibility 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - 'symbols/**.yml' 7 | branches: 8 | - master 9 | 10 | env: 11 | PYTHON_TERM_COLOR: always 12 | 13 | jobs: 14 | compat-check: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v4 19 | with: 20 | fetch-depth: 2 21 | - name: Symbol compatibility check 22 | # HEAD is $GITHUB_SHA, which is the PR merge commit; see: 23 | # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request 24 | # This means that HEAD^ should be the target branch head, i.e., master 25 | run: tools/symcompat.py --warn HEAD^ 26 | # Ideally there would be an "allow-failure" option (continue-on-error isn't it); see: 27 | # https://github.com/actions/runner/issues/2347 28 | -------------------------------------------------------------------------------- /.github/workflows/check-symbol-header-sync.yml: -------------------------------------------------------------------------------- 1 | name: Check Symbol-Header Synchronization 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - 'symbols/**.yml' 7 | - 'headers/functions/**.h' 8 | - 'headers/data/**.h' 9 | - 'headers/symbol_check.py' 10 | branches: 11 | - master 12 | workflow_call: 13 | 14 | jobs: 15 | sync-check: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Symbol sync check 21 | run: make -C headers symbol-check 22 | -------------------------------------------------------------------------------- /.github/workflows/check-symbols.yml: -------------------------------------------------------------------------------- 1 | name: Check Symbols 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - 'symbols/**.yml' 7 | - 'src/**.rs' 8 | - 'Cargo.toml' 9 | branches: 10 | - master 11 | workflow_call: 12 | inputs: 13 | no-format-on-check-fail: 14 | required: false 15 | type: boolean 16 | default: false 17 | 18 | env: 19 | CARGO_TERM_COLOR: always 20 | 21 | jobs: 22 | format-check: 23 | runs-on: ubuntu-latest 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v4 27 | - name: Install resymgen 28 | uses: ./.github/actions/build-resymgen 29 | - name: Format check 30 | run: resymgen fmt --recursive --check symbols/*.yml 31 | format: 32 | runs-on: ubuntu-latest 33 | needs: format-check 34 | if: failure() && !inputs.no-format-on-check-fail 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v4 38 | - name: Install resymgen 39 | uses: ./.github/actions/build-resymgen 40 | - name: Format 41 | run: resymgen fmt --recursive symbols/*.yml 42 | - name: Package reformatted files 43 | run: zip resymgen-fmt-output.zip $(git diff --relative --name-only) 44 | working-directory: symbols 45 | - name: Upload reformatted files 46 | uses: actions/upload-artifact@v4 47 | with: 48 | name: formatted-symbols 49 | path: symbols/resymgen-fmt-output.zip 50 | retention-days: 1 51 | - name: Provide download link 52 | run: | 53 | echo 'Download link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts' 54 | echo "You can download these properly formatted symbol files if you don't have the formatter (the Rust toolchain) set up in your environment." 55 | test: 56 | runs-on: ubuntu-latest 57 | steps: 58 | - name: Checkout 59 | uses: actions/checkout@v4 60 | - name: Install resymgen 61 | uses: ./.github/actions/build-resymgen 62 | - name: Test 63 | run: resymgen check --recursive --complete-version-list --explicit-versions --in-bounds-symbols --no-overlap --nonempty-maps --unique-symbols --data-names SCREAMING_SNAKE_CASE --function-names Pascal_Snake_Case --function-names snake_case symbols/*.yml 64 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Package 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'src/**.rs' 7 | - 'symbols/**.yml' 8 | - 'headers/**' 9 | - 'Cargo.toml' 10 | - '.github/workflows/release.yml' 11 | branches: 12 | - master 13 | 14 | env: 15 | CARGO_TERM_COLOR: always 16 | 17 | jobs: 18 | check-resymgen: 19 | uses: UsernameFodder/pmdsky-debug/.github/workflows/check-resymgen.yml@master 20 | check-symbols: 21 | uses: UsernameFodder/pmdsky-debug/.github/workflows/check-symbols.yml@master 22 | with: 23 | no-format-on-check-fail: true 24 | check-headers: 25 | uses: UsernameFodder/pmdsky-debug/.github/workflows/check-headers.yml@master 26 | with: 27 | no-format-on-check-fail: true 28 | check-symbol-header-sync: 29 | needs: 30 | - check-symbols 31 | - check-headers 32 | uses: UsernameFodder/pmdsky-debug/.github/workflows/check-symbol-header-sync.yml@master 33 | generate-and-deploy: 34 | runs-on: ubuntu-latest 35 | needs: 36 | - check-resymgen 37 | - check-symbols 38 | - check-headers 39 | - check-symbol-header-sync 40 | env: 41 | RELEASE_VERSION: '0.10.1' 42 | OUTPUT_DIR: out 43 | RELEASE_INSTALL_DIR: release-install 44 | RELEASE_ASSETS_DIR: release-assets 45 | RELEASE_HASH_FILE: release-assets.sha256 46 | steps: 47 | - name: Checkout 48 | uses: actions/checkout@v4 49 | - name: Install resymgen 50 | uses: ./.github/actions/build-resymgen 51 | - name: Generate symbols 52 | run: resymgen gen --sort --output-dir ${{ env.OUTPUT_DIR }} symbols/*.yml 53 | - name: Create release directories 54 | run: mkdir -p ${{ env.RELEASE_INSTALL_DIR }} ${{ env.RELEASE_ASSETS_DIR }} 55 | - name: Install symbols 56 | shell: bash 57 | run: | 58 | # Install the symbol packages 59 | for f in $(ls ${{ env.OUTPUT_DIR }}/*); do 60 | version_and_format="${f##*_}" 61 | version="${version_and_format%.*}" 62 | format="${version_and_format##*.}" 63 | dir="${{ env.RELEASE_INSTALL_DIR }}/symbols-${format}/${version}" 64 | mkdir -p "${dir}" 65 | cp "${f}" "${dir}" 66 | done 67 | - name: Install headers 68 | run: rsync -av --include '*/' --include '*.h' --exclude '*' headers ${{ env.RELEASE_INSTALL_DIR }} 69 | - name: Install headers with autogenerated aliases and docstrings 70 | run: | 71 | headers/augment_headers.py --verbose --aliases --docstrings 72 | rm -rf headers/__pycache__ 73 | rsync -av --include '*/' --include '*.h' --exclude '*' headers/* ${{ env.RELEASE_INSTALL_DIR }}/headers-with-aliases-and-docstrings 74 | - name: Archive packages 75 | run: | 76 | for f in $(ls); do 77 | zip -r "../${{ env.RELEASE_ASSETS_DIR }}/${f}.zip" ${f} 78 | done 79 | working-directory: ${{ env.RELEASE_INSTALL_DIR }} 80 | - name: Compute SHA-256 hash for the release package 81 | env: 82 | HASH_FILE: ${{ env.RELEASE_ASSETS_DIR }}/${{ env.RELEASE_HASH_FILE }} 83 | id: new_hash 84 | run: | 85 | echo ${{ hashFiles(format('{0}/**', env.RELEASE_INSTALL_DIR)) }} > ${HASH_FILE} 86 | echo "sha256=$(cat ${HASH_FILE})" >> $GITHUB_OUTPUT 87 | - name: Retrieve SHA-256 hash of the previous release package 88 | env: 89 | HASH_FILE: ${{ env.RELEASE_HASH_FILE }}.old 90 | id: old_hash 91 | run: | 92 | curl --location --fail "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/latest/download/${{ env.RELEASE_HASH_FILE }}" > ${HASH_FILE} || echo "Could not locate previous release package" 93 | cat ${HASH_FILE} 94 | echo "sha256=$(cat ${HASH_FILE})" >> $GITHUB_OUTPUT 95 | - name: Generate release tag 96 | id: tag 97 | run: echo "release_tag=v${{ env.RELEASE_VERSION }}+${GITHUB_SHA:0:10}" >> $GITHUB_OUTPUT 98 | if: steps.new_hash.outputs.sha256 != steps.old_hash.outputs.sha256 99 | - name: Create release 100 | uses: softprops/action-gh-release@v1 101 | with: 102 | tag_name: ${{ steps.tag.outputs.release_tag }} 103 | target_commitish: ${{ github.sha }} 104 | files: '${{ env.RELEASE_ASSETS_DIR }}/*' 105 | fail_on_unmatched_files: true 106 | if: steps.new_hash.outputs.sha256 != steps.old_hash.outputs.sha256 107 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | /out 4 | __pycache__ 5 | .vscode 6 | -------------------------------------------------------------------------------- /CREDITS.txt: -------------------------------------------------------------------------------- 1 | This file contains a list of people who have made notable contributions to the 2 | substantive contents of pmdsky-debug. List order is determined by when 3 | someone's contributions were incorporated into this repository, and is 4 | unrelated to contribution size or importance. 5 | 6 | If you have made a contribution, whether to the symbol tables, C headers, or 7 | other parts of the project, feel free to add yourself to this file! 8 | 9 | - UsernameFodder 10 | - psy_commando 11 | - evandixon 12 | - Capypara 13 | - Frostbyte 14 | - irdkwia 15 | - Nov 16 | - AnonymousRandomPerson 17 | - OgreGunner 18 | - ShinxHijinx 19 | - ZappedAmpharos 20 | - Nerketur 21 | - Aissurteivos 22 | - SBDWolf 23 | - marius851000 24 | - Metalcape 25 | - kkzero 26 | - EpicYoshiMaster 27 | - Jawshoeuh 28 | - Adex 29 | - Laioxy 30 | - Adakite 31 | - tech-ticks 32 | - Rhokin 33 | - ShadyGamerX 34 | - ElectricGeorge 35 | - Assidion 36 | - Chritchy 37 | - happylappy 38 | - The rest of the contributors to Project Pokémon's technical documentation 39 | for the NDS Mystery Dungeon games, which can be found here: 40 | https://projectpokemon.org/home/docs/mystery-dungeon-nds/ 41 | - The rest of the contributors to Frostbyte's dungeon data doc, 42 | which can be found here: 43 | https://docs.google.com/document/d/1UfiFz4xAPtGd-1X2JNE0Jy2z-BLkze1PE4Fo9u-QeYo 44 | - The rest of the contributors to the PMD Info Spreadsheet, 45 | which can be found here: 46 | https://docs.google.com/spreadsheets/d/18utO_lCpWQ7iXY9wpbtxXpgmzebEI2IRjADp6IrUKZ0 47 | - The rest of the contributors to the pmd-sky decompilation project, 48 | which can be found here: https://github.com/pret/pmd-sky 49 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "resymgen" 3 | description = "Generates symbol tables for reverse engineering applications from a YAML specification" 4 | version = "0.6.0" 5 | authors = ["UsernameFodder "] 6 | edition = "2018" 7 | rust-version = "1.58" 8 | repository = "https://github.com/UsernameFodder/pmdsky-debug" 9 | license = "GPL-3.0-only" 10 | readme = "docs/resymgen.md" 11 | include = [ 12 | "src/**", 13 | ".gitignore", 14 | ] 15 | categories = ["command-line-utilities"] 16 | 17 | [dependencies] 18 | clap = "2.34.0" 19 | csv = "1.1.6" 20 | regex = "1.5.4" 21 | serde = { version = "1.0.130", features = ["derive"] } 22 | serde_json = "1.0.79" 23 | serde_yaml = "0.8.21" 24 | similar = "2.1.0" 25 | syn = "1.0.82" 26 | tempfile = "3.2.0" 27 | termcolor = "1.1.2" 28 | -------------------------------------------------------------------------------- /check_and_format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Convenience script that runs the checks and formatters for both the C headers and symbol tables. 4 | # Expects the working directory to be the repo root. 5 | 6 | set -e 7 | 8 | make -C headers 9 | make -C headers format 10 | make -C headers symbol-check 11 | 12 | cargo run --release -- check -r -Vvbomu -d screaming_snake_case -f pascal_snake_case -f snake_case symbols/*.yml 13 | cargo run --release -- fmt -r symbols/*.yml 14 | 15 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to `pmdsky-debug` 2 | Contributions are welcome, no matter how small! This can be new symbols, new type definitions, changes to `resymgen`, bug fixes, documentation, etc. Make sure to add yourself to [`CREDITS.txt`](../CREDITS.txt) if you're a new contributor! 3 | 4 | You can contribute by opening a pull request. If you've never done this before, [this tutorial](https://github.com/firstcontributions/first-contributions/blob/main/README.md) is a friendly introduction to the process. You can also follow GitHub's official [quickstart guide](https://docs.github.com/en/get-started/quickstart/contributing-to-projects), if you prefer. 5 | 6 | This repository is designed to make contributing simple while maintaining quality. No setup is required to contribute to the symbol tables and C headers beyond a normal text editor and the ability to create pull requests on GitHub. When you open or update a pull request, the relevant GitHub Actions jobs will automatically test your changes (and run the formatter for you if necessary). Changes to `resymgen` require the standard Rust toolchain. 7 | 8 | ## Symbols (functions and data) 9 | See the [`symbols/` README](../symbols/README.md#contributing) for more information on adding new symbols. 10 | 11 | **NOTE:** If you're adding symbols, you might also want to add [new types](#types-structs-enums-function-signatures-global-declarations) to accompany them. This is optional but recommended, especially if you're adding functions. Providing function signatures in the C headers allows you to strictly specify function parameters and their types. Providing global variable declarations in the C headers allows you to strictly specify data structure types. 12 | 13 | ## Types (structs, enums, function signatures, global declarations) 14 | See the [`headers/` README](../headers/README.md#contributing) for more information on adding new types. 15 | 16 | ## Incomplete information that needs more research 17 | It's common in reverse engineering to have only a vague idea about how something works. For example, you might have a suspicion about what a function does without being certain about it. Partial or incomplete information is still better than nothing, so feel free to contribute symbols and types anyway (just note the uncertainty in the symbol description and/or as a comment in the C headers). Alternatively, if you feel that more understanding is necessary to make a proper contribution, you can also [file a new issue](https://github.com/UsernameFodder/pmdsky-debug/issues) using the "Research topic" issue template. 18 | 19 | ## `resymgen` 20 | If you want to contribute to `resymgen` (e.g., adding support for more data formats), you'll need to [install Rust](https://www.rust-lang.org/tools/install). The `resymgen` package is a standard [Cargo](https://doc.rust-lang.org/cargo/) project (so build with `cargo build`, run tests with `cargo test`, etc.). You can view the rendered library docs on [Docs.rs](https://docs.rs/resymgen/latest/resymgen/). 21 | 22 | ## Documentation 23 | If you see an error in the existing docs, feel free to make a pull request to correct it. If you want to add a new guide, tutorial, reference, etc., please add it to the [`docs/`](.) directory. 24 | -------------------------------------------------------------------------------- /docs/images/dslazy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/dslazy.png -------------------------------------------------------------------------------- /docs/images/gh-actions-headers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/gh-actions-headers.png -------------------------------------------------------------------------------- /docs/images/gh-actions-symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/gh-actions-symbols.png -------------------------------------------------------------------------------- /docs/images/ghidra-bitfields.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-bitfields.png -------------------------------------------------------------------------------- /docs/images/ghidra-create-new-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-create-new-script.png -------------------------------------------------------------------------------- /docs/images/ghidra-data-types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-data-types.png -------------------------------------------------------------------------------- /docs/images/ghidra-enum-labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-enum-labels.png -------------------------------------------------------------------------------- /docs/images/ghidra-equates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-equates.png -------------------------------------------------------------------------------- /docs/images/ghidra-import-symbols-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-import-symbols-script.png -------------------------------------------------------------------------------- /docs/images/ghidra-language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-language.png -------------------------------------------------------------------------------- /docs/images/ghidra-manage-script-directories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-manage-script-directories.png -------------------------------------------------------------------------------- /docs/images/ghidra-markup-register-variable-references.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-markup-register-variable-references.png -------------------------------------------------------------------------------- /docs/images/ghidra-new-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-new-project.png -------------------------------------------------------------------------------- /docs/images/ghidra-parameters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-parameters.png -------------------------------------------------------------------------------- /docs/images/ghidra-parsing-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-parsing-c.png -------------------------------------------------------------------------------- /docs/images/ghidra-project-selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-project-selection.png -------------------------------------------------------------------------------- /docs/images/ghidra-register-variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-register-variables.png -------------------------------------------------------------------------------- /docs/images/ghidra-retype-label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-retype-label.png -------------------------------------------------------------------------------- /docs/images/ghidra-retype-variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-retype-variable.png -------------------------------------------------------------------------------- /docs/images/ghidra-symbol-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-symbol-file.png -------------------------------------------------------------------------------- /docs/images/ghidra-symbols-with-descriptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-symbols-with-descriptions.png -------------------------------------------------------------------------------- /docs/images/ghidra-symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/ghidra-symbols.png -------------------------------------------------------------------------------- /docs/images/nocash-files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/nocash-files.png -------------------------------------------------------------------------------- /docs/images/nocash-symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/nocash-symbols.png -------------------------------------------------------------------------------- /docs/images/nocash-symfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/nocash-symfile.png -------------------------------------------------------------------------------- /docs/images/top-readme-ghidra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/top-readme-ghidra.png -------------------------------------------------------------------------------- /docs/images/top-readme-nocash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/top-readme-nocash.png -------------------------------------------------------------------------------- /docs/images/top-readme-tech-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UsernameFodder/pmdsky-debug/0b82db54c9f941c0ee52afe621309412ad49f225/docs/images/top-readme-tech-docs.png -------------------------------------------------------------------------------- /docs/overlays.md: -------------------------------------------------------------------------------- 1 | # Nintendo DS Overlays 2 | ## What is an overlay? 3 | Like many other embedded systems, the Nintendo DS is quite memory-constrained (it only has 4 MiB of RAM). In order to reduce RAM usage, NDS games like _Explorers of Sky_ use a technique called [overlaying](https://en.wikipedia.org/wiki/Overlay_(programming)). 4 | 5 | A program that uses overlays is split up into multiple binary files, with each file containing a just a subset of the instructions needed to run the program as a whole. When the program needs to run code from a certain overlay, it will load that overlay into memory for execution. When an overlay is no longer needed, it will be unloaded (and possibly swapped for a different overlay) to free up space for other purposes. 6 | 7 | Overlaying is particularly useful if the program has certain chunks of code that are used very infrequently, or if it has several distinct modes of execution that will never be run at the same time. For example, EoS has separate overlays for controlling various menu interfaces for things like the Kecleon Shop and Kangaskhan Storage; this code isn't used very often, so keeping it loaded all the time would just waste space. It also has separate overlays for controlling "ground mode" (when you're walking around freely in the overworld or watching cutscenes) and "dungeon mode" (when you're exploring a Mystery Dungeon); there's quite a lot of code for these two modes, but since they never run at the same time, the game can save quite a lot of space by only loading one at a time (in fact, these two overlays have the same load address, so the game quite literally swaps between the two binaries when switching modes). 8 | 9 | ## NDS overlay specifics 10 | NDS overlays are stored as special files in a ROM's file system (the [NitroFS](https://problemkaputt.de/gbatek.htm#dscartridgenitroromandnitroarcfilesystems)) (you can access them by [unpacking the ROM](ghidra-setup.md#unpack-the-rom)). Each overlay has a specific load address assigned to it: when an overlay is loaded, it will always be loaded at its assigned location in memory. The load addresses for EoS overlays have already been documented; you can see them in their respective files in [`symbols/`](../symbols) (the top-level `address` field) (or in the [Project Pokémon technical documentation](https://projectpokemon.org/home/docs/mystery-dungeon-nds/pok%C3%A9mon-mystery-dungeon-explorers-r78/), although it only lists addresses for the North American version). If you're wondering where these addresses come from, they're directly encoded in the [overlay tables](https://problemkaputt.de/gbatek.htm#dscartridgenitroromandnitroarcfilesystems) in the ROM itself. 11 | 12 | _Side note: The phrase "load an overlay" is quite literal and means the same thing as loading any other binary. If you look at RAM (for example, DeSmuME and No$GBA both have memory viewers on Windows) at an overlay's load address after it's been loaded, you'll see the exact same bytes you would see if you opened the overlay binary in a hex editor._ 13 | 14 | Of course, overlays can't load themselves. When an NDS game is booted up, one of the first things the system does is load the main ARM9 binary (often called `arm9.bin`) into memory, which contains the "core" code needed to run the game (actually, there's also a second ARM7 binary for the NDS's second CPU, but you don't need to worry about it in most cases when working with EoS). This core code includes instructions to load and unload other overlays, as needed by the game. Unlike the overlays, the ARM9 binary is never unloaded while the game is running. 15 | 16 | ## _Explorers of Sky_ overlay specifics 17 | Overlays add some extra complexity when reverse engineering NDS games like EoS, because it means you need to know which overlays are relevant to the part of the game you're trying to research. It also complicates setup for reverse engineering tools like Ghidra. Fortunately, the purposes of many EoS overlays (especially the important ones) have already been documented; you can see descriptions of each overlay in their respective files in [`symbols/`](../symbols) (the top-level `description` field) (or in the [Project Pokémon technical documentation](https://projectpokemon.org/home/docs/mystery-dungeon-nds/pok%C3%A9mon-mystery-dungeon-explorers-r78/), although many of its descriptions are incomplete). 18 | 19 | For convenience, here are the relevant overlays in the two most common cases: 20 | 21 | - Dungeon mode (while exploring a Mystery Dungeon): 22 | - overlay 29 (dungeon mode) 23 | - overlay 10 (game data/mechanics) 24 | - overlay 31 (dungeon menu) 25 | - Ground mode (while walking around in the overworld or during cutscenes): 26 | - overlay 11 (script engine) 27 | - overlay 10 (game data/mechanics) 28 | 29 | In EoS, the game can has 3 "slots" for loading overlays, which means there can be a maximum of 3 overlays loaded at once (this may or may not be general to all NDS games; I'm not sure). You can read more about how this works in [`arm9.yml`](../symbols/arm9.yml), in the descriptions of the `LOADED_OVERLAY_GROUP_*` symbols. You can also look at the values at `LOADED_OVERLAY_GROUP_*` in a memory viewer if you ever need to determine exactly which overlays are loaded at a certain point in the game. 30 | -------------------------------------------------------------------------------- /headers/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | # These options should all be supported in clang-format 6+ 3 | Language: Cpp 4 | AlignAfterOpenBracket: Align 5 | AlignEscapedNewlines: Right 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: true 8 | AllowShortFunctionsOnASingleLine: All 9 | AlwaysBreakBeforeMultilineStrings: false 10 | BinPackArguments: true 11 | BinPackParameters: true 12 | BraceWrapping: 13 | AfterEnum: false 14 | AfterFunction: false 15 | AfterStruct: false 16 | AfterUnion: false 17 | AfterExternBlock: false 18 | IndentBraces: false 19 | SplitEmptyFunction: true 20 | SplitEmptyRecord: true 21 | BreakBeforeBraces: Attach 22 | BreakStringLiterals: true 23 | ColumnLimit: 100 24 | ContinuationIndentWidth: 4 25 | IndentPPDirectives: None 26 | IndentWidth: 4 27 | IndentWrappedFunctionNames: false 28 | KeepEmptyLinesAtTheStartOfBlocks: true 29 | MaxEmptyLinesToKeep: 1 30 | PenaltyBreakAssignment: 2 31 | PenaltyBreakBeforeFirstCallParameter: 19 32 | PenaltyBreakComment: 300 33 | PenaltyBreakFirstLessLess: 120 34 | PenaltyBreakString: 1000 35 | PenaltyExcessCharacter: 1000000 36 | PenaltyReturnTypeOnItsOwnLine: 60 37 | PointerAlignment: Left 38 | ReflowComments: true 39 | SortIncludes: false 40 | SpaceAfterCStyleCast: false 41 | SpaceBeforeAssignmentOperators: true 42 | SpaceBeforeParens: ControlStatements 43 | SpaceInEmptyParentheses: false 44 | SpacesBeforeTrailingComments: 1 45 | SpacesInContainerLiterals: true 46 | SpacesInCStyleCastParentheses: false 47 | SpacesInParentheses: false 48 | SpacesInSquareBrackets: false 49 | Standard: Auto 50 | TabWidth: 8 51 | UseTab: Never 52 | ... 53 | 54 | -------------------------------------------------------------------------------- /headers/LICENSE.txt: -------------------------------------------------------------------------------- 1 | NOTE: The following license applies only to the files within this directory. 2 | 3 | MIT License 4 | 5 | Copyright (c) 2022 UsernameFodder 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /headers/Makefile: -------------------------------------------------------------------------------- 1 | # Look for clang or gcc 2 | CLANG_VERSION := $(shell clang --version 2>/dev/null) 3 | GCC_VERSION := $(shell gcc --version 2>/dev/null) 4 | ifdef CLANG_VERSION 5 | CC := clang 6 | else ifdef GCC_VERSION 7 | CC := gcc 8 | else 9 | $(error C compiler not found) 10 | endif 11 | 12 | # Top-level headers that define a version explicitly 13 | VERSIONED_HEADERS := pmdsky_na.h pmdsky_eu.h pmdsky_jp.h 14 | 15 | # Compile headers 16 | # Structs constrained by ASSERT_SIZE can only compile under both natural 17 | # alignment and packing if there is no implicit padding between members. 18 | .PHONY: headers 19 | headers: headers-aligned headers-packed headers-no-builtin 20 | 21 | # Compile headers with natural struct member alignment by default 22 | .PHONY: headers-aligned 23 | headers-aligned: 24 | # -mno-ms-bitfields is needed for some Windows builds, e.g., MinGW's gcc/clang 25 | $(CC) $(CFLAGS) -m32 -fshort-wchar -fsyntax-only -mno-ms-bitfields pmdsky.h 26 | $(CC) $(CFLAGS) -m32 -fshort-wchar -fsyntax-only -mno-ms-bitfields $(VERSIONED_HEADERS) 27 | 28 | # Compile headers with implicit packing by default 29 | .PHONY: headers-packed 30 | headers-packed: 31 | # -mno-ms-bitfields is needed for some Windows builds, e.g., MinGW's gcc/clang 32 | $(CC) $(CFLAGS) -m32 -fshort-wchar -fsyntax-only -mno-ms-bitfields -DIMPLICIT_STRUCT_PACKING pmdsky.h 33 | $(CC) $(CFLAGS) -m32 -fshort-wchar -fsyntax-only -mno-ms-bitfields -DIMPLICIT_STRUCT_PACKING -Wno-pragma-pack $(VERSIONED_HEADERS) 34 | 35 | # Variant of the headers that excludes declarations for common builtin functions. This mode is 36 | # intended for dev use, if the builtin declarations cause unexpected compilation issues. 37 | .PHONY: headers-no-builtin 38 | headers-no-builtin: 39 | $(CC) $(CFLAGS) -m32 -fshort-wchar -fsyntax-only -mno-ms-bitfields -DPMDSKY_NO_BUILTIN pmdsky.h 40 | $(CC) $(CFLAGS) -m32 -fshort-wchar -fsyntax-only -mno-ms-bitfields -DPMDSKY_NO_BUILTIN $(VERSIONED_HEADERS) 41 | 42 | # Unsized variant of the headers. This isn't included in the default target because it assumes 43 | # the presence of system headers. Don't use any funky options here, since this mode is intended 44 | # for normal dev use. 45 | .PHONY: headers-unsized 46 | headers-unsized: 47 | $(CC) $(CFLAGS) -fsyntax-only -DPMDSKY_UNSIZED_HEADERS pmdsky.h 48 | $(CC) $(CFLAGS) -fsyntax-only -DPMDSKY_UNSIZED_HEADERS $(VERSIONED_HEADERS) 49 | 50 | .PHONY: format 51 | format: 52 | find . -iname '*.h' | xargs clang-format -i 53 | 54 | .PHONY: format-check 55 | format-check: 56 | find . -iname '*.h' | xargs clang-format --dry-run -Werror 57 | 58 | .PHONY: symbol-check 59 | symbol-check: 60 | ./symbol_check.py --sort-order 61 | 62 | .PHONY: symbol-check-extra 63 | symbol-check-extra: 64 | ./symbol_check.py --extra-symbols 65 | -------------------------------------------------------------------------------- /headers/data/arm9/itcm.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_ARM9_ITCM_H_ 2 | #define HEADERS_DATA_ARM9_ITCM_H_ 3 | 4 | extern struct mem_alloc_table MEMORY_ALLOCATION_TABLE; 5 | extern struct mem_arena DEFAULT_MEMORY_ARENA; 6 | extern struct mem_block DEFAULT_MEMORY_ARENA_BLOCKS[256]; 7 | extern render_3d_element_fn_t RENDER_3D_FUNCTIONS[4]; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /headers/data/data.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_H_ 2 | #define HEADERS_DATA_H_ 3 | 4 | #include "arm9.h" 5 | #include "overlay01.h" 6 | #include "overlay09.h" 7 | #include "overlay10.h" 8 | #include "overlay11.h" 9 | #include "overlay13.h" 10 | #include "overlay14.h" 11 | #include "overlay15.h" 12 | #include "overlay16.h" 13 | #include "overlay17.h" 14 | #include "overlay18.h" 15 | #include "overlay19.h" 16 | #include "overlay20.h" 17 | #include "overlay21.h" 18 | #include "overlay22.h" 19 | #include "overlay23.h" 20 | #include "overlay24.h" 21 | #include "overlay25.h" 22 | #include "overlay27.h" 23 | #include "overlay29.h" 24 | #include "overlay31.h" 25 | #include "overlay34.h" 26 | #include "literals.h" 27 | #include "ram.h" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /headers/data/literals.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_LITERALS_H_ 2 | #define HEADERS_DATA_LITERALS_H_ 3 | 4 | // ARM9 5 | extern const struct data_processing_instruction JUICE_BAR_NECTAR_IQ_GAIN; 6 | extern const struct data_processing_instruction DEBUG_TEXT_SPEED; 7 | extern const struct data_processing_instruction REGULAR_TEXT_SPEED; 8 | extern const struct data_processing_instruction HERO_START_LEVEL; 9 | extern const struct data_processing_instruction PARTNER_START_LEVEL; 10 | 11 | // Overlay 0 12 | extern const struct data_processing_instruction TOP_MENU_MUSIC_ID; 13 | 14 | // Overlay 10 15 | extern const struct data_processing_instruction DEFEAT_ITEM_LOSS_CHANCE; 16 | 17 | // Overlay 29 18 | extern const struct data_processing_instruction VISIBLE_TRAP_FAIL_CHANCE; 19 | extern const struct data_processing_instruction HIDDEN_TRAP_FAIL_CHANCE; 20 | extern const struct data_processing_instruction NECTAR_IQ_BOOST; 21 | extern const struct data_processing_instruction COMPRESSED_SPRITE_BUFFER_SIZE; 22 | 23 | // Overlay 9 24 | extern const struct data_processing_instruction TOP_MENU_RETURN_MUSIC_ID; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /headers/data/overlay01.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY01_H_ 2 | #define HEADERS_DATA_OVERLAY01_H_ 3 | 4 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_1; 5 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_2; 6 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_3; 7 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_4; 8 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_5; 9 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_6; 10 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_7; 11 | extern struct simple_menu_id_item MAIN_MENU_ITEMS_CONFIRM[3]; 12 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_8; 13 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_9; 14 | extern struct simple_menu_id_item MAIN_DEBUG_MENU_ITEMS_1[12]; 15 | extern struct window_params MAIN_MENU_WINDOW_PARAMS_10; 16 | extern struct simple_menu_id_item MAIN_DEBUG_MENU_ITEMS_2[7]; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /headers/data/overlay09.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY09_H_ 2 | #define HEADERS_DATA_OVERLAY09_H_ 3 | 4 | extern struct window_params JUKEBOX_TRACK_MENU_DEFAULT_WINDOW_PARAMS; 5 | extern struct window_params PLAYBACK_CONTROLS_MENU_DEFAULT_WINDOW_PARAMS; 6 | extern struct window_params INPUT_LOCK_BOX_DEFAULT_WINDOW_PARAMS; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /headers/data/overlay11.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY11_H_ 2 | #define HEADERS_DATA_OVERLAY11_H_ 3 | 4 | extern undefined SCRIPT_COMMAND_PARSING_DATA[32]; 5 | extern char SCRIPT_OP_CODE_NAMES[0]; // Length might differ by version; needs verification 6 | extern struct script_opcode_table SCRIPT_OP_CODES; 7 | extern char OVERLAY11_DEBUG_STRINGS[0]; // Length might differ by version; needs verification 8 | extern char C_ROUTINE_NAMES[0]; // Length might differ by version; needs verification 9 | extern struct common_routine_table C_ROUTINES; 10 | extern struct ground_weather_entry GROUND_WEATHER_TABLE[12]; 11 | extern char GROUND_WAN_FILES_TABLE[343][12]; 12 | extern struct script_object OBJECTS[0]; // Length differs by version 13 | extern struct dungeon_id_16 RECRUITMENT_TABLE_LOCATIONS[22]; 14 | extern int16_t RECRUITMENT_TABLE_LEVELS[22]; 15 | extern struct monster_id_16 RECRUITMENT_TABLE_SPECIES[22]; 16 | extern struct level_tilemap_list_entry LEVEL_TILEMAP_LIST[81]; 17 | extern struct ground_entity_function_table ACTOR_FUNCTION_TABLE; 18 | extern struct animation_data SETANIMATION_TABLE[84]; 19 | extern struct ground_entity_function_table OBJECT_FUNCTION_TABLE; 20 | extern struct ground_entity_function_table PERFORMER_FUNCTION_TABLE; 21 | extern struct window_params TEAM_INFO_BOX_DEFAULT_WINDOW_PARAMS; 22 | extern struct overlay_load_entry OVERLAY11_OVERLAY_LOAD_TABLE[21]; 23 | extern struct main_ground_data GROUND_STATE_PTRS; 24 | extern uint32_t WORLD_MAP_MODE; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /headers/data/overlay13.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY13_H_ 2 | #define HEADERS_DATA_OVERLAY13_H_ 3 | 4 | extern struct window_params QUIZ_WINDOW_PARAMS_1; 5 | extern struct window_params QUIZ_WINDOW_PARAMS_2; 6 | extern struct window_params QUIZ_WINDOW_PARAMS_3; 7 | extern struct window_params QUIZ_WINDOW_PARAMS_4; 8 | extern struct simple_menu_id_item QUIZ_MENU_ITEMS_1[3]; 9 | extern struct monster_id_16 STARTERS_PARTNER_IDS[21]; 10 | extern struct monster_id_16 STARTERS_HERO_IDS[32]; 11 | extern uint16_t STARTERS_STRINGS[48]; 12 | extern uint16_t QUIZ_QUESTION_STRINGS[66]; 13 | extern uint16_t QUIZ_ANSWER_STRINGS[176]; 14 | extern struct quiz_answer_points_entry QUIZ_ANSWER_POINTS[174]; 15 | extern uint32_t PARTNER_SELECT_MENU_OPTION_TRACKER; 16 | extern uint32_t PARTNER_SELECT_MENU_OPTION_TIMER; 17 | extern struct window_params QUIZ_WINDOW_PARAMS_5; 18 | extern struct window_params QUIZ_WINDOW_PARAMS_6; 19 | extern struct simple_menu_id_item QUIZ_DEBUG_MENU_ITEMS[9]; 20 | extern uint16_t QUIZ_QUESTION_ANSWER_ASSOCIATIONS[66]; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /headers/data/overlay14.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY14_H_ 2 | #define HEADERS_DATA_OVERLAY14_H_ 3 | 4 | extern uint32_t SENTRY_DUTY_STRUCT_SIZE; 5 | extern enum monster_id SENTRY_LOUDRED_MONSTER_ID; 6 | extern int STRING_ID_SENTRY_TOP_SESSIONS; 7 | extern int STRING_ID_SENTRY_INSTRUCTIONS; 8 | extern int STRING_ID_SENTRY_HERE_COMES; 9 | extern int STRING_ID_SENTRY_WHOSE_FOOTPRINT; 10 | extern int STRING_ID_SENTRY_TRY_AGAIN; 11 | extern int STRING_ID_SENTRY_OUT_OF_TIME; 12 | extern int STRING_ID_SENTRY_FOOTPRINT_IS_6EE; 13 | extern int STRING_ID_SENTRY_COME_IN_6EF; 14 | extern int STRING_ID_SENTRY_WRONG; 15 | extern int STRING_ID_SENTRY_BUCK_UP; 16 | extern int STRING_ID_SENTRY_FOOTPRINT_IS_6EC; 17 | extern int STRING_ID_SENTRY_COME_IN_6ED; 18 | extern int STRING_ID_SENTRY_KEEP_YOU_WAITING; 19 | extern int STRING_ID_SENTRY_THATLL_DO_IT; 20 | extern enum monster_id SENTRY_CHATOT_MONSTER_ID; 21 | extern int STRING_ID_SENTRY_NO_MORE_VISITORS; 22 | extern int STRING_ID_SENTRY_THATS_ALL; 23 | extern enum monster_id SENTRY_GROVYLE_MONSTER_ID; 24 | extern struct simple_menu_id_item SENTRY_DEBUG_MENU_ITEMS[9]; 25 | extern struct sentry_duty* SENTRY_DUTY_PTR; 26 | extern state_handler_fn_t SENTRY_DUTY_STATE_HANDLER_TABLE[35]; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /headers/data/overlay15.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY15_H_ 2 | #define HEADERS_DATA_OVERLAY15_H_ 3 | 4 | extern struct simple_menu_id_item BANK_MAIN_MENU_ITEMS[5]; 5 | extern struct window_params BANK_WINDOW_PARAMS_1; 6 | extern struct window_params BANK_WINDOW_PARAMS_2; 7 | extern struct window_params BANK_WINDOW_PARAMS_3; 8 | extern struct window_params BANK_WINDOW_PARAMS_4; 9 | extern struct window_params BANK_WINDOW_PARAMS_5; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /headers/data/overlay16.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY16_H_ 2 | #define HEADERS_DATA_OVERLAY16_H_ 3 | 4 | extern struct simple_menu_id_item EVO_MENU_ITEMS_CONFIRM[3]; 5 | extern struct simple_menu_id_item EVO_SUBMENU_ITEMS[4]; 6 | extern struct simple_menu_id_item EVO_MAIN_MENU_ITEMS[4]; 7 | extern uint16_t EVO_MENU_STRING_IDS[26]; 8 | extern struct window_params EVO_WINDOW_PARAMS_1; 9 | extern struct window_params EVO_WINDOW_PARAMS_2; 10 | extern struct window_params EVO_WINDOW_PARAMS_3; 11 | extern struct window_params EVO_WINDOW_PARAMS_4; 12 | extern struct window_params EVO_WINDOW_PARAMS_5; 13 | extern struct window_params EVO_WINDOW_PARAMS_6; 14 | extern struct window_params EVO_WINDOW_PARAMS_7; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /headers/data/overlay17.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY17_H_ 2 | #define HEADERS_DATA_OVERLAY17_H_ 3 | 4 | extern struct window_params ASSEMBLY_WINDOW_PARAMS_1; 5 | extern struct window_params ASSEMBLY_WINDOW_PARAMS_2; 6 | extern struct window_params ASSEMBLY_WINDOW_PARAMS_3; 7 | extern struct window_params ASSEMBLY_WINDOW_PARAMS_4; 8 | extern struct window_params ASSEMBLY_WINDOW_PARAMS_5; 9 | extern struct simple_menu_id_item ASSEMBLY_MENU_ITEMS_CONFIRM[3]; 10 | extern struct simple_menu_id_item ASSEMBLY_MAIN_MENU_ITEMS_1[3]; 11 | extern struct simple_menu_id_item ASSEMBLY_MAIN_MENU_ITEMS_2[4]; 12 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_1[5]; 13 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_2[6]; 14 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_3[6]; 15 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_4[7]; 16 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_5[7]; 17 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_6[7]; 18 | extern struct simple_menu_id_item ASSEMBLY_SUBMENU_ITEMS_7[8]; 19 | extern void* OVERLAY17_FUNCTION_POINTER_TABLE[42]; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /headers/data/overlay18.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY18_H_ 2 | #define HEADERS_DATA_OVERLAY18_H_ 3 | 4 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_1; 5 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_2; 6 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_3; 7 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_4; 8 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_5; 9 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_6; 10 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_7; 11 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_8; 12 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_9; 13 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_10; 14 | extern struct window_params LINK_SHOP_WINDOW_PARAMS_11; 15 | extern struct simple_menu_id_item LINK_SHOP_MENU_ITEMS_CONFIRM[3]; 16 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_1[4]; 17 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_2[4]; 18 | extern struct simple_menu_id_item LINK_SHOP_MAIN_MENU_ITEMS[4]; 19 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_3[5]; 20 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_4[6]; 21 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_5[9]; 22 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_6[9]; 23 | extern struct simple_menu_id_item LINK_SHOP_SUBMENU_ITEMS_7[9]; 24 | extern void* OVERLAY18_FUNCTION_POINTER_TABLE[76]; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /headers/data/overlay19.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY19_H_ 2 | #define HEADERS_DATA_OVERLAY19_H_ 3 | 4 | extern struct dungeon_id_16 BAR_UNLOCKABLE_DUNGEONS_TABLE[6]; 5 | extern struct monster_id_16 BAR_RECRUITABLE_MONSTER_TABLE[108]; 6 | extern struct bar_item BAR_AVAILABLE_ITEMS[66]; 7 | extern struct window_params BAR_WINDOW_PARAMS_1; 8 | extern struct window_params BAR_WINDOW_PARAMS_2; 9 | extern struct window_params BAR_WINDOW_PARAMS_3; 10 | extern struct simple_menu_id_item BAR_MENU_ITEMS_CONFIRM_1[3]; 11 | extern struct simple_menu_id_item BAR_MENU_ITEMS_CONFIRM_2[3]; 12 | extern struct simple_menu_id_item BAR_MAIN_MENU_ITEMS[4]; 13 | extern struct simple_menu_id_item BAR_SUBMENU_ITEMS_1[4]; 14 | extern struct simple_menu_id_item BAR_SUBMENU_ITEMS_2[6]; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /headers/data/overlay20.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY20_H_ 2 | #define HEADERS_DATA_OVERLAY20_H_ 3 | 4 | extern struct simple_menu_id_item RECYCLE_MENU_ITEMS_CONFIRM_1[3]; 5 | extern struct simple_menu_id_item RECYCLE_MENU_ITEMS_CONFIRM_2[3]; 6 | extern struct simple_menu_id_item RECYCLE_SUBMENU_ITEMS_1[3]; 7 | extern struct simple_menu_id_item RECYCLE_SUBMENU_ITEMS_2[4]; 8 | extern struct simple_menu_id_item RECYCLE_MAIN_MENU_ITEMS_1[5]; 9 | extern struct window_params RECYCLE_WINDOW_PARAMS_1; 10 | extern struct window_params RECYCLE_WINDOW_PARAMS_2; 11 | extern struct window_params RECYCLE_WINDOW_PARAMS_3; 12 | extern struct window_params RECYCLE_WINDOW_PARAMS_4; 13 | extern struct window_params RECYCLE_WINDOW_PARAMS_5; 14 | extern struct window_params RECYCLE_WINDOW_PARAMS_6; 15 | extern struct simple_menu_id_item RECYCLE_MAIN_MENU_ITEMS_2[4]; 16 | extern struct window_params RECYCLE_WINDOW_PARAMS_7; 17 | extern struct window_params RECYCLE_WINDOW_PARAMS_8; 18 | extern struct window_params RECYCLE_WINDOW_PARAMS_9; 19 | extern struct window_params RECYCLE_WINDOW_PARAMS_10; 20 | extern struct window_params RECYCLE_WINDOW_PARAMS_11; 21 | extern struct simple_menu_id_item RECYCLE_MAIN_MENU_ITEMS_3[3]; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /headers/data/overlay21.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY21_H_ 2 | #define HEADERS_DATA_OVERLAY21_H_ 3 | 4 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_1; 5 | extern struct simple_menu_id_item SWAP_SHOP_MENU_ITEMS_CONFIRM[3]; 6 | extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_1[3]; 7 | extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_2[4]; 8 | extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_1[4]; 9 | extern struct simple_menu_id_item SWAP_SHOP_MAIN_MENU_ITEMS_2[5]; 10 | extern struct simple_menu_id_item SWAP_SHOP_SUBMENU_ITEMS_3[6]; 11 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_2; 12 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_3; 13 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_4; 14 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_5; 15 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_6; 16 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_7; 17 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_8; 18 | extern struct window_params SWAP_SHOP_WINDOW_PARAMS_9; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /headers/data/overlay22.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY22_H_ 2 | #define HEADERS_DATA_OVERLAY22_H_ 3 | 4 | extern struct window_params SHOP_WINDOW_PARAMS_1; 5 | extern struct window_params SHOP_WINDOW_PARAMS_2; 6 | extern struct simple_menu_id_item SHOP_MENU_ITEMS_CONFIRM[3]; 7 | extern struct simple_menu_id_item SHOP_MAIN_MENU_ITEMS_1[4]; 8 | extern struct simple_menu_id_item SHOP_MAIN_MENU_ITEMS_2[4]; 9 | extern struct simple_menu_id_item SHOP_MAIN_MENU_ITEMS_3[6]; 10 | extern struct window_params SHOP_WINDOW_PARAMS_3; 11 | extern struct window_params SHOP_WINDOW_PARAMS_4; 12 | extern struct window_params SHOP_WINDOW_PARAMS_5; 13 | extern struct window_params SHOP_WINDOW_PARAMS_6; 14 | extern struct window_params SHOP_WINDOW_PARAMS_7; 15 | extern struct window_params SHOP_WINDOW_PARAMS_8; 16 | extern struct window_params SHOP_WINDOW_PARAMS_9; 17 | extern struct window_params SHOP_WINDOW_PARAMS_10; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /headers/data/overlay23.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY23_H_ 2 | #define HEADERS_DATA_OVERLAY23_H_ 3 | 4 | extern struct simple_menu_id_item STORAGE_MENU_ITEMS_CONFIRM[3]; 5 | extern struct simple_menu_id_item STORAGE_MAIN_MENU_ITEMS_1[4]; 6 | extern struct simple_menu_id_item STORAGE_MAIN_MENU_ITEMS_2[4]; 7 | extern struct simple_menu_id_item STORAGE_MAIN_MENU_ITEMS_3[4]; 8 | extern struct simple_menu_id_item STORAGE_MAIN_MENU_ITEMS_4[5]; 9 | extern struct window_params STORAGE_WINDOW_PARAMS_1; 10 | extern struct window_params STORAGE_WINDOW_PARAMS_2; 11 | extern struct window_params STORAGE_WINDOW_PARAMS_3; 12 | extern struct window_params STORAGE_WINDOW_PARAMS_4; 13 | extern struct window_params STORAGE_WINDOW_PARAMS_5; 14 | extern struct window_params STORAGE_WINDOW_PARAMS_6; 15 | extern struct window_params STORAGE_WINDOW_PARAMS_7; 16 | extern struct window_params STORAGE_WINDOW_PARAMS_8; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /headers/data/overlay24.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY24_H_ 2 | #define HEADERS_DATA_OVERLAY24_H_ 3 | 4 | extern struct simple_menu_id_item DAYCARE_MENU_ITEMS_CONFIRM[3]; 5 | extern struct simple_menu_id_item DAYCARE_MAIN_MENU_ITEMS[4]; 6 | extern struct window_params DAYCARE_WINDOW_PARAMS_1; 7 | extern struct window_params DAYCARE_WINDOW_PARAMS_2; 8 | extern struct window_params DAYCARE_WINDOW_PARAMS_3; 9 | extern struct window_params DAYCARE_WINDOW_PARAMS_4; 10 | extern struct window_params DAYCARE_WINDOW_PARAMS_5; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /headers/data/overlay25.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY25_H_ 2 | #define HEADERS_DATA_OVERLAY25_H_ 3 | 4 | extern struct window_params APPRAISAL_WINDOW_PARAMS_1; 5 | extern struct simple_menu_id_item APPRAISAL_MENU_ITEMS_CONFIRM[3]; 6 | extern struct simple_menu_id_item APPRAISAL_MAIN_MENU_ITEMS[4]; 7 | extern struct simple_menu_id_item APPRAISAL_SUBMENU_ITEMS[4]; 8 | extern struct window_params APPRAISAL_WINDOW_PARAMS_2; 9 | extern struct window_params APPRAISAL_WINDOW_PARAMS_3; 10 | extern struct window_params APPRAISAL_WINDOW_PARAMS_4; 11 | extern struct window_params APPRAISAL_WINDOW_PARAMS_5; 12 | extern struct window_params APPRAISAL_WINDOW_PARAMS_6; 13 | extern struct window_params APPRAISAL_WINDOW_PARAMS_7; 14 | extern struct window_params APPRAISAL_WINDOW_PARAMS_8; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /headers/data/overlay27.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY27_H_ 2 | #define HEADERS_DATA_OVERLAY27_H_ 3 | 4 | extern struct simple_menu_id_item DISCARD_ITEMS_MENU_ITEMS_CONFIRM[3]; 5 | extern struct simple_menu_id_item DISCARD_ITEMS_SUBMENU_ITEMS_1[4]; 6 | extern struct simple_menu_id_item DISCARD_ITEMS_SUBMENU_ITEMS_2[4]; 7 | extern struct simple_menu_id_item DISCARD_ITEMS_MAIN_MENU_ITEMS[5]; 8 | extern struct window_params DISCARD_WINDOW_PARAMS_1; 9 | extern struct window_params DISCARD_WINDOW_PARAMS_2; 10 | extern struct window_params DISCARD_WINDOW_PARAMS_3; 11 | extern struct window_params DISCARD_WINDOW_PARAMS_4; 12 | extern struct window_params DISCARD_WINDOW_PARAMS_5; 13 | extern struct window_params DISCARD_WINDOW_PARAMS_6; 14 | extern struct window_params DISCARD_WINDOW_PARAMS_7; 15 | extern struct window_params DISCARD_WINDOW_PARAMS_8; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /headers/data/overlay29.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY29_H_ 2 | #define HEADERS_DATA_OVERLAY29_H_ 3 | 4 | #include "overlay29/move_effects.h" 5 | 6 | extern uint32_t DUNGEON_STRUCT_SIZE; 7 | extern int32_t MAX_HP_CAP; 8 | extern uint32_t OFFSET_OF_DUNGEON_FLOOR_PROPERTIES; 9 | extern int32_t SPAWN_RAND_MAX; 10 | extern uint32_t DUNGEON_PRNG_LCG_MULTIPLIER; 11 | extern uint32_t DUNGEON_PRNG_LCG_INCREMENT_SECONDARY; 12 | extern int32_t ATTACK_SPRITE_BUFFER_SIZE; 13 | extern enum monster_id KECLEON_FEMALE_ID; 14 | extern enum monster_id KECLEON_MALE_ID; 15 | extern int32_t MSG_ID_SLOW_START; 16 | extern int32_t EXPERIENCE_POINT_GAIN_CAP; 17 | extern enum move_id JUDGMENT_MOVE_ID; 18 | extern enum move_id REGULAR_ATTACK_MOVE_ID; 19 | extern enum monster_id DEOXYS_ATTACK_ID; 20 | extern enum monster_id DEOXYS_SPEED_ID; 21 | extern enum monster_id GIRATINA_ALTERED_ID; 22 | extern enum move_id PUNISHMENT_MOVE_ID; 23 | extern int32_t OFFENSE_STAT_MAX; 24 | extern enum move_id PROJECTILE_MOVE_ID; 25 | extern fx32_16 BELLY_LOST_PER_TURN; 26 | extern int MONSTER_HEAL_HP_MAX; 27 | extern struct move_target_and_range MOVE_TARGET_AND_RANGE_SPECIAL_USER_HEALING; 28 | extern int32_t PLAIN_SEED_STRING_ID; 29 | extern int32_t MAX_ELIXIR_PP_RESTORATION; 30 | extern int32_t SLIP_SEED_FAIL_STRING_ID; 31 | extern enum move_id ROCK_WRECKER_MOVE_ID; 32 | extern enum monster_id CASTFORM_NORMAL_FORM_MALE_ID; 33 | extern enum monster_id CASTFORM_NORMAL_FORM_FEMALE_ID; 34 | extern enum monster_id CHERRIM_SUNSHINE_FORM_MALE_ID; 35 | extern enum monster_id CHERRIM_OVERCAST_FORM_FEMALE_ID; 36 | extern enum monster_id CHERRIM_SUNSHINE_FORM_FEMALE_ID; 37 | extern struct floor_generation_status* FLOOR_GENERATION_STATUS_PTR; 38 | extern uint32_t OFFSET_OF_DUNGEON_N_NORMAL_ITEM_SPAWNS; 39 | extern uint32_t DUNGEON_GRID_COLUMN_BYTES; 40 | extern int32_t DEFAULT_MAX_POSITION; 41 | extern uint32_t OFFSET_OF_DUNGEON_GUARANTEED_ITEM_ID; 42 | extern struct fixed_room_tile_spawn_entry FIXED_ROOM_TILE_SPAWN_TABLE[11]; 43 | extern struct item_id_16 TREASURE_BOX_1_ITEM_IDS[12]; 44 | extern struct fixed_room_id_8 FIXED_ROOM_REVISIT_OVERRIDES[256]; 45 | extern struct fixed_room_monster_spawn_entry FIXED_ROOM_MONSTER_SPAWN_TABLE[120]; 46 | extern struct fixed_room_item_spawn_entry FIXED_ROOM_ITEM_SPAWN_TABLE[63]; 47 | extern struct fixed_room_entity_spawn_entry FIXED_ROOM_ENTITY_SPAWN_TABLE[269]; 48 | extern struct status_icon_flags STATUS_ICON_ARRAY_MUZZLED[2]; 49 | extern struct status_icon_flags STATUS_ICON_ARRAY_MAGNET_RISE[2]; 50 | extern struct status_icon_flags STATUS_ICON_ARRAY_MIRACLE_EYE[3]; 51 | extern struct status_icon_flags STATUS_ICON_ARRAY_LEECH_SEED[3]; 52 | extern struct status_icon_flags STATUS_ICON_ARRAY_LONG_TOSS[3]; 53 | extern struct status_icon_flags STATUS_ICON_ARRAY_BLINDED[5]; 54 | extern struct status_icon_flags STATUS_ICON_ARRAY_BURN[5]; 55 | extern struct status_icon_flags STATUS_ICON_ARRAY_SURE_SHOT[5]; 56 | extern struct status_icon_flags STATUS_ICON_ARRAY_INVISIBLE[5]; 57 | extern struct status_icon_flags STATUS_ICON_ARRAY_SLEEP[8]; 58 | extern struct status_icon_flags STATUS_ICON_ARRAY_CURSE[7]; 59 | extern struct status_icon_flags STATUS_ICON_ARRAY_FREEZE[8]; 60 | extern struct status_icon_flags STATUS_ICON_ARRAY_CRINGE[8]; 61 | extern struct status_icon_flags STATUS_ICON_ARRAY_BIDE[14]; 62 | extern struct status_icon_flags STATUS_ICON_ARRAY_REFLECT[18]; 63 | extern enum direction_id POSITION_DISPLACEMENT_TO_DIRECTION[3][3]; 64 | extern int16_t DIRECTIONS_XY[8][2]; 65 | extern struct position DISPLACEMENTS_WITHIN_2_LARGEST_FIRST[26]; 66 | extern struct position DISPLACEMENTS_WITHIN_2_SMALLEST_FIRST[26]; 67 | extern struct position DISPLACEMENTS_WITHIN_3[50]; 68 | extern struct action_16 ITEM_CATEGORY_ACTIONS[16]; 69 | extern int16_t FRACTIONAL_TURN_SEQUENCE[125]; 70 | extern uint16_t BELLY_DRAIN_IN_WALLS_INT; 71 | extern uint16_t BELLY_DRAIN_IN_WALLS_THOUSANDTHS; 72 | extern enum monster_treatment MONSTER_TREATMENT_DATA[4][2][2][2]; 73 | extern struct fx64_16 DAMAGE_MULTIPLIER_0_5; 74 | extern struct fx64_16 DAMAGE_MULTIPLIER_1_5; 75 | extern struct fx64_16 DAMAGE_MULTIPLIER_2; 76 | extern struct fx64_16 CLOUDY_DAMAGE_MULTIPLIER; 77 | extern struct fx64_16 SOLID_ROCK_MULTIPLIER; 78 | extern struct fx64_16 DAMAGE_FORMULA_MAX_BASE; 79 | extern struct fx64_16 WONDER_GUARD_MULTIPLIER; 80 | extern struct fx64_16 DAMAGE_FORMULA_MIN_BASE; 81 | extern struct damage_negating_exclusive_eff_entry TYPE_DAMAGE_NEGATING_EXCLUSIVE_ITEM_EFFECTS[28]; 82 | extern struct status_two_turn_id_8 TWO_TURN_STATUSES[11]; 83 | extern struct two_turn_move_and_status TWO_TURN_MOVES_AND_STATUSES[22]; 84 | extern int32_t SPATK_STAT_IDX; 85 | extern int32_t ATK_STAT_IDX; 86 | extern fx32_8 ROLLOUT_DAMAGE_MULT_TABLE[10]; 87 | extern struct rgba MAP_COLOR_TABLE[9]; 88 | extern bool CORNER_CARDINAL_NEIGHBOR_IS_OPEN[4][8]; 89 | extern int16_t GUMMI_LIKE_STRING_IDS[4]; 90 | extern int16_t GUMMI_IQ_STRING_IDS[5]; 91 | extern int16_t DAMAGE_STRING_IDS[27]; 92 | extern struct dungeon* DUNGEON_PTR; 93 | extern struct dungeon* DUNGEON_PTR_MASTER; 94 | extern struct top_screen_status* TOP_SCREEN_STATUS_PTR; 95 | extern struct entity* LEADER_PTR; 96 | extern struct prng_state DUNGEON_PRNG_STATE; 97 | extern uint32_t DUNGEON_PRNG_STATE_SECONDARY_VALUES[5]; 98 | extern uint16_t LOADED_ATTACK_SPRITE_FILE_INDEX; 99 | extern enum pack_file_id LOADED_ATTACK_SPRITE_PACK_ID; 100 | extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_WEATHER_ATK_SPEED_BOOST[8]; 101 | extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_WEATHER_MOVE_SPEED_BOOST[8]; 102 | extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_WEATHER_NO_STATUS[8]; 103 | extern uint32_t AI_THROWN_ITEM_ACTION_CHOICE_COUNT; 104 | extern struct exclusive_item_effect_id_8 EXCL_ITEM_EFFECTS_EVASION_BOOST[8]; 105 | extern struct tile DEFAULT_TILE; 106 | extern bool HIDDEN_STAIRS_SPAWN_BLOCKED; 107 | extern void* FIXED_ROOM_DATA_PTR; 108 | extern struct dungeon_fades* DUNGEON_FADES_PTR; 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /headers/data/overlay29/move_effects.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY29_MOVE_EFFECTS_H_ 2 | #define HEADERS_DATA_OVERLAY29_MOVE_EFFECTS_H_ 3 | 4 | extern int32_t MAX_HP_CAP_MOVE_EFFECTS; 5 | extern int32_t LUNAR_DANCE_PP_RESTORATION; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /headers/data/overlay31.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY31_H_ 2 | #define HEADERS_DATA_OVERLAY31_H_ 3 | 4 | extern struct window_params DUNGEON_WINDOW_PARAMS_1; 5 | extern struct window_params DUNGEON_WINDOW_PARAMS_2; 6 | extern struct window_params DUNGEON_WINDOW_PARAMS_3; 7 | extern struct window_params DUNGEON_WINDOW_PARAMS_4; 8 | extern struct simple_menu_id_item DUNGEON_MAIN_MENU_ITEMS[8]; 9 | extern char DUNGEON_MENU_SWITCH_STR1[12]; 10 | extern struct window_params DUNGEON_WINDOW_PARAMS_5; 11 | extern struct window_params DUNGEON_WINDOW_PARAMS_6; 12 | extern struct window_params DUNGEON_WINDOW_PARAMS_7; 13 | extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_1[4]; 14 | extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_2[4]; 15 | extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_3[4]; 16 | extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_4[4]; 17 | extern struct window_params DUNGEON_WINDOW_PARAMS_8; 18 | extern struct window_params DUNGEON_WINDOW_PARAMS_9; 19 | extern struct window_params DUNGEON_WINDOW_PARAMS_10; 20 | extern struct window_params DUNGEON_WINDOW_PARAMS_11; 21 | extern struct window_params DUNGEON_WINDOW_PARAMS_12; 22 | extern struct window_params DUNGEON_WINDOW_PARAMS_13; 23 | extern struct window_params DUNGEON_WINDOW_PARAMS_14; 24 | extern struct window_params DUNGEON_WINDOW_PARAMS_15; 25 | extern struct window_params DUNGEON_WINDOW_PARAMS_16; 26 | extern struct window_params DUNGEON_WINDOW_PARAMS_17; 27 | extern struct window_params DUNGEON_WINDOW_PARAMS_18; 28 | extern struct window_params DUNGEON_WINDOW_PARAMS_19; 29 | extern struct window_params DUNGEON_WINDOW_PARAMS_20; 30 | extern struct window_params DUNGEON_WINDOW_PARAMS_21; 31 | extern struct window_params DUNGEON_WINDOW_PARAMS_22; 32 | extern struct window_params DUNGEON_WINDOW_PARAMS_23; 33 | extern struct window_params DUNGEON_WINDOW_PARAMS_24; 34 | extern struct window_params DUNGEON_WINDOW_PARAMS_25; 35 | extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_5[3]; 36 | extern struct window_params DUNGEON_WINDOW_PARAMS_26; 37 | extern struct window_params DUNGEON_WINDOW_PARAMS_27; 38 | extern struct window_params DUNGEON_WINDOW_PARAMS_28; 39 | extern struct simple_menu_id_item DUNGEON_SUBMENU_ITEMS_6[9]; 40 | extern struct window_params DUNGEON_WINDOW_PARAMS_29; 41 | extern struct window_params DUNGEON_WINDOW_PARAMS_30; 42 | extern struct window_params DUNGEON_WINDOW_PARAMS_31; 43 | extern struct window_params DUNGEON_WINDOW_PARAMS_32; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /headers/data/overlay34.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_OVERLAY34_H_ 2 | #define HEADERS_DATA_OVERLAY34_H_ 3 | 4 | extern struct simple_menu_id_item START_MENU_ITEMS_CONFIRM[3]; 5 | extern struct simple_menu_id_item DUNGEON_DEBUG_MENU_ITEMS[5]; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /headers/data/ram.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_DATA_RAM_H_ 2 | #define HEADERS_DATA_RAM_H_ 3 | 4 | extern uint8_t DEFAULT_MEMORY_ARENA_MEMORY[1991680]; 5 | extern struct mem_arena GROUND_MEMORY_ARENA_2; 6 | extern struct mem_block GROUND_MEMORY_ARENA_2_BLOCKS[32]; 7 | extern uint8_t GROUND_MEMORY_ARENA_2_MEMORY[720100]; 8 | extern struct rgba* DUNGEON_COLORMAP_PTR; 9 | extern struct dungeon DUNGEON_STRUCT; 10 | extern struct move_data_table MOVE_DATA_TABLE; 11 | extern struct mem_arena SOUND_MEMORY_ARENA; 12 | extern struct mem_block SOUND_MEMORY_ARENA_BLOCKS[20]; 13 | extern uint8_t SOUND_MEMORY_ARENA_MEMORY[245252]; 14 | extern uint32_t FRAMES_SINCE_LAUNCH; 15 | extern struct touchscreen_status TOUCHSCREEN_STATUS; 16 | extern struct item BAG_ITEMS[50]; 17 | extern struct item* BAG_ITEMS_PTR; 18 | extern struct item_id_16 STORAGE_ITEMS[1000]; 19 | extern uint16_t STORAGE_ITEM_QUANTITIES[1000]; 20 | extern struct bulk_item* KECLEON_SHOP_ITEMS_PTR; 21 | extern struct bulk_item KECLEON_SHOP_ITEMS[8]; 22 | extern struct bulk_item UNUSED_KECLEON_SHOP_ITEMS[8]; 23 | extern struct bulk_item* KECLEON_WARES_ITEMS_PTR; 24 | extern struct bulk_item KECLEON_WARES_ITEMS[4]; 25 | extern struct bulk_item UNUSED_KECLEON_WARES_ITEMS[4]; 26 | extern int32_t MONEY_CARRIED; 27 | extern int32_t MONEY_STORED; 28 | extern struct audio_command AUDIO_COMMANDS_BUFFER[16]; 29 | extern struct mem_arena* SOUND_MEMORY_ARENA_PTR; 30 | extern struct window_list WINDOW_LIST; 31 | extern uint16_t CURSOR_16_SPRITE_ID; 32 | extern uint16_t CURSOR_SPRITE_ID; 33 | extern struct animation_control* CURSOR_ANIMATION_CONTROL; 34 | extern struct animation_control* CURSOR_16_ANIMATION_CONTROL; 35 | extern uint16_t ALERT_SPRITE_ID; 36 | extern struct animation_control* ALERT_ANIMATION_CONTROL; 37 | extern struct move LAST_NEW_MOVE; 38 | extern struct script_var_value_table SCRIPT_VARS_VALUES; 39 | extern uint8_t BAG_LEVEL; 40 | extern struct special_episode_type_8 DEBUG_SPECIAL_EPISODE_NUMBER; 41 | extern struct file_stream KAOMADO_STREAM; 42 | extern struct dungeon_id_8 PENDING_DUNGEON_ID; 43 | extern uint8_t PENDING_STARTING_FLOOR; 44 | extern uint32_t PLAY_TIME_SECONDS; 45 | extern uint8_t PLAY_TIME_FRAME_COUNTER; 46 | #if PMDSKY_VERSION == PMDSKY_JP 47 | #define TEAM_NAME_LENGTH_ 5 48 | #else 49 | #define TEAM_NAME_LENGTH_ 10 50 | #endif 51 | extern char TEAM_NAME[TEAM_NAME_LENGTH_]; 52 | extern struct monster_id_16 LEVEL_UP_DATA_MONSTER_ID; 53 | extern struct level_up_entry LEVEL_UP_DATA_DECOMPRESS_BUFFER[100]; 54 | extern struct team_member_table TEAM_MEMBER_TABLE; 55 | extern uint16_t DISP_MODE; 56 | extern uint16_t GXI_VRAM_LOCK_ID; 57 | extern struct vram_banks_set ENABLED_VRAM_BANKS; 58 | extern undefined4 SUB_BG_EXT_PLTT; 59 | extern undefined4 CLR_IMG; 60 | extern struct thread_info THREAD_INFO_STRUCT; 61 | extern uint32_t FRAMES_SINCE_LAUNCH_TIMES_THREE; 62 | extern struct mem_arena* GROUND_MEMORY_ARENA_1_PTR; 63 | extern struct mem_arena* GROUND_MEMORY_ARENA_2_PTR; 64 | extern bool LOCK_NOTIFY_ARRAY[20]; 65 | extern struct mem_arena GROUND_MEMORY_ARENA_1; 66 | extern struct mem_block GROUND_MEMORY_ARENA_1_BLOCKS[52]; 67 | extern uint8_t GROUND_MEMORY_ARENA_1_MEMORY[408324]; 68 | extern struct sentry_duty SENTRY_DUTY_STRUCT; 69 | extern bool TURNING_ON_THE_SPOT_FLAG; 70 | extern struct loaded_attack_sprite_data* LOADED_ATTACK_SPRITE_DATA; 71 | extern bool AI_THROWN_ITEM_DIRECTION_IS_USED[8]; 72 | extern uint32_t AI_THROWN_ITEM_PROBABILITIES[8]; 73 | extern uint32_t AI_THROWN_ITEM_DIRECTIONS[8]; 74 | extern bool ROLLOUT_ICE_BALL_MISSED; 75 | extern bool MULTIHIT_FATIGUE_MOVE_USED; 76 | extern bool TWINEEDLE_HIT_TRACKER; 77 | extern bool RAPID_SPIN_BINDING_REMOVAL; 78 | extern int ROLLOUT_ICE_BALL_SUCCESSIVE_HITS; 79 | extern int MULTIHIT_MOVE_SUCCESSIVE_HITS; 80 | extern int TRIPLE_KICK_SUCCESSIVE_HITS; 81 | extern int METRONOME_NEXT_INDEX; 82 | extern struct floor_generation_status FLOOR_GENERATION_STATUS; 83 | extern struct stairs_menu* STAIRS_MENU_PTR; 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /headers/functions/arm7.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_ARM7_H_ 2 | #define HEADERS_FUNCTIONS_ARM7_H_ 3 | 4 | void _start_arm7(void); 5 | void do_autoload_arm7(void); 6 | void StartAutoloadDoneCallbackArm7(void); 7 | void NitroSpMain(void); 8 | void HardwareInterrupt(void); 9 | void ReturnFromInterrupt(void); 10 | void AudioInterrupt(int function_index); 11 | bool ClearImeFlag(void); 12 | int ClearIeFlag(int flag_id); 13 | long long GetCurrentPlaybackTime(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /headers/functions/arm9/itcm.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_ARM9_ITCM_H_ 2 | #define HEADERS_FUNCTIONS_ARM9_ITCM_H_ 3 | 4 | void CopyAndInterleave(uint16_t* dst, uint16_t* src, uint32_t len, uint8_t val); 5 | void CopyAndInterleave0(uint16_t* dst, uint16_t* src, int len); 6 | void Render3dSetTextureParams(struct render_3d_texture_params* params, int vram_offset); 7 | void Render3dSetPaletteBase(struct render_3d_texture_params* params, uint32_t palette_base_addr); 8 | void Render3dRectangle(struct render_3d_rectangle* rectangle); 9 | void GeomSetPolygonAttributes(uint8_t polygon_id, uint8_t alpha); 10 | void Render3dQuadrilateral(struct render_3d_quadrilateral* quadrilateral); 11 | void Render3dTiling(struct render_3d_tiling* tiling); 12 | void Render3dTextureInternal(struct render_3d_texture* texture); 13 | void Render3dTexture(struct render_3d_texture* texture); 14 | void Render3dTextureNoSetup(struct render_3d_texture* texture); 15 | union render_3d_element* NewRender3dElement(void); 16 | void EnqueueRender3dTexture(union render_3d_element* element); 17 | void EnqueueRender3dTiling(union render_3d_element* element); 18 | struct render_3d_rectangle* NewRender3dRectangle(void); 19 | struct render_3d_quadrilateral* NewRender3dQuadrilateral(void); 20 | struct render_3d_texture* NewRender3dTexture(void); 21 | struct render_3d_tiling* NewRender3dTiling(void); 22 | void Render3dProcessQueue(void); 23 | void GetKeyN2MSwitch(int key, int sw); 24 | enum monster_id GetKeyN2M(int key); 25 | enum monster_id GetKeyN2MBaseForm(int key); 26 | void GetKeyM2NSwitch(enum monster_id monster_id, int sw); 27 | int GetKeyM2N(enum monster_id monster_id); 28 | int GetKeyM2NBaseForm(enum monster_id monster_id); 29 | void HardwareInterrupt(void); 30 | void ReturnFromInterrupt(void); 31 | void InitDmaTransfer_Standard(uint8_t channel, void* src, void* dst, uint16_t word_count); 32 | bool ShouldMonsterRunAwayVariationOutlawCheck(struct entity* monster, undefined param_2); 33 | void AiMovement(struct entity* monster, bool show_run_away_effect); 34 | void CalculateAiTargetPos(struct entity* monster); 35 | void ChooseAiMove(struct entity* monster); 36 | bool LightningRodStormDrainCheck(struct entity* attacker, struct entity* defender, 37 | struct move* move, bool storm_drain); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /headers/functions/functions.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_H_ 2 | #define HEADERS_FUNCTIONS_H_ 3 | 4 | #include "arm9.h" 5 | #include "arm7.h" 6 | #include "overlay01.h" 7 | #include "overlay09.h" 8 | #include "overlay10.h" 9 | #include "overlay11.h" 10 | #include "overlay13.h" 11 | #include "overlay14.h" 12 | #include "overlay19.h" 13 | #include "overlay29.h" 14 | #include "overlay30.h" 15 | #include "overlay31.h" 16 | #include "overlay34.h" 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /headers/functions/overlay00.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY00_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY00_H_ 3 | 4 | void SelectRandomBackground(void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /headers/functions/overlay01.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY01_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY01_H_ 3 | 4 | void CreateMainMenus(void); 5 | void AddMainMenuOption(int action_id, bool enabled); 6 | void AddSubMenuOption(int action_id, bool enabled); 7 | void ProcessContinueScreenContents(undefined4 param_1); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /headers/functions/overlay09.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY09_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY09_H_ 3 | 4 | int CreateJukeboxTrackMenu(struct window_params* params, struct window_flags flags, 5 | struct window_extra_info* extra_info, 6 | struct simple_menu_id_item* menu_items, int n_items); 7 | void CloseJukeboxTrackMenu(int window_id); 8 | bool IsJukeboxTrackMenuActive(int window_id); 9 | void UpdateJukeboxTrackMenu(struct window* window); 10 | int CreatePlaybackControlsMenu(struct window_params* params, struct window_flags flags, 11 | struct window_extra_info* extra_info, undefined4 param_4, 12 | struct simple_menu_id_item* menu_items1, 13 | struct simple_menu_id_item* menu_items2); 14 | int ClosePlaybackControlsMenu(int window_id); 15 | bool IsPlaybackControlsMenuActive(int window_id); 16 | void UpdatePlaybackControlsMenu(struct window* window); 17 | int CreateInputLockBox(struct window_params* params, struct window_flags flags, 18 | struct window_extra_info* extra_info, undefined4 param_4, 19 | uint16_t string_id); 20 | void CloseInputLockBox(int window_id); 21 | bool IsInputLockBoxActive(int window_id); 22 | void UpdateInputLockBox(struct window* window); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /headers/functions/overlay10.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY10_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY10_H_ 3 | 4 | int CreateInventoryMenu(struct window_params* params, struct window_flags flags, 5 | struct window_extra_info* window_extra_info, undefined* param_4, 6 | undefined4 param_5, int n_items, int n_items_per_page, uint8_t param_8); 7 | void SetInventoryMenuState0(int window_id); 8 | void SetInventoryMenuState6(int window_id); 9 | void CloseInventoryMenu(int window_id); 10 | bool IsInventoryMenuActive(int window_id); 11 | bool CheckInventoryMenuField0x1A0(int window_id); 12 | uint8_t PopInventoryMenuField0x1A3(int window_id); 13 | void UpdateInventoryMenu(struct window* window); 14 | bool IsInventoryMenuState3(int window_id); 15 | int GetEffectAnimationField0x19(int anim_id); 16 | bool AnimationHasMoreFrames(int param_1); 17 | struct effect_animation* GetEffectAnimation(int anim_id); 18 | struct move_animation* GetMoveAnimation(enum move_id move_id); 19 | struct special_monster_move_animation* GetSpecialMonsterMoveAnimation(int ent_id); 20 | int16_t GetTrapAnimation(enum trap_id trap_id); 21 | int16_t GetItemAnimation1(enum item_id item_id); 22 | int16_t GetItemAnimation2(enum item_id item_id); 23 | int GetMoveAnimationSpeed(enum move_id move_id); 24 | undefined4 DrawTeamStats(undefined4 param_1, int param_2, undefined4 param_3, uint32_t param_4); 25 | void UpdateTeamStats(void); 26 | int FreeTeamStats(void); 27 | int FreeMapAndTeam(void); 28 | void ProcessTeamStatsLvHp(int idx); 29 | void ProcessTeamStatsNameGender(int idx); 30 | bool IsBackgroundTileset(int tileset_id); 31 | void InitTilesetBuffer(void* buffer, int tileset_id, uint32_t malloc_flags); 32 | int MainGame(int end_cond); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /headers/functions/overlay13.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY13_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY13_H_ 3 | 4 | void EntryOverlay13(void); 5 | void ExitOverlay13(void); 6 | int Overlay13SwitchFunctionNa238A1C8(void); 7 | void Overlay13SwitchFunctionNa238A574(void); 8 | int GetPersonality(void); // TODO: Change return type to enum 9 | char* GetOptionStringFromID(char* output, int option_id); 10 | void WaitForNextStep(int switch_case); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /headers/functions/overlay14.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY14_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY14_H_ 3 | 4 | int SentrySetupState(int state0); 5 | void SentryUpdateDisplay(void); 6 | void SentrySetExitingState(void); 7 | int SentryRunState(void); 8 | void SentrySetStateIntermediate(int state); 9 | void SentryState0(void); 10 | void SentryState1(void); 11 | void SentryState2(void); 12 | void SentryState3(void); 13 | void SentryState4(void); 14 | void SentryStateExit(void); 15 | void SentryState6(void); 16 | void SentryState7(void); 17 | void SentryState8(void); 18 | void SentryState9(void); 19 | void SentryStateA(void); 20 | void SentryStateB(void); 21 | void SentryStateGenerateChoices(void); 22 | void SentryStateGetUserChoice(void); 23 | void SentryStateFinalizeRound(void); 24 | void SentryStateF(void); 25 | void SentryState10(void); 26 | void SentryState11(void); 27 | void SentryState12(void); 28 | void SentryState13(void); 29 | void SentryState14(void); 30 | void SentryState15(void); 31 | void SentryState16(void); 32 | void SentryState17(void); 33 | void SentryState18(void); 34 | void SentryState19(void); 35 | void SentryState1A(void); 36 | void SentryStateFinalizePoints(void); 37 | void SentryState1C(void); 38 | void SentryState1D(void); 39 | void SentryState1E(void); 40 | void SentryState1F(void); 41 | void SentryState20(void); 42 | void SentryState21(void); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /headers/functions/overlay19.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY19_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY19_H_ 3 | 4 | struct bar_item* GetBarItem(enum item_id item_id); 5 | int GetRecruitableMonsterAll(void); 6 | int GetRecruitableMonsterList(void); 7 | int GetRecruitableMonsterListRestricted(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /headers/functions/overlay30.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY30_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY30_H_ 3 | 4 | void WriteQuicksaveData(void* buffer, int buffer_size); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /headers/functions/overlay31.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY31_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY31_H_ 3 | 4 | void EntryOverlay31(void); 5 | void DrawDungeonMenuStatusWindow(int param_1); 6 | void DungeonMenuSwitch(int idx); 7 | void CreateStairsMenuState(struct entity* entity); 8 | void StairsSubheadingCallback(int window_id); 9 | int HandleStairsMenu(void); 10 | void MovesMenu(struct action_data* action); 11 | bool HandleMovesMenuWrapper0(undefined* param_1, undefined param_2, undefined param_3, 12 | int monster_index); 13 | bool HandleMovesMenuWrapper1(undefined* param_1, undefined param_2, undefined param_3, 14 | int monster_index); 15 | bool HandleMovesMenu(undefined* param_1, undefined param_2, undefined param_3, int monster_index); 16 | undefined TeamMenu(struct entity* leader); 17 | void RestMenu(void); 18 | int RecruitmentSearchMenuLoop(void); 19 | int HelpMenuLoop(void); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /headers/functions/overlay34.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_FUNCTIONS_OVERLAY34_H_ 2 | #define HEADERS_FUNCTIONS_OVERLAY34_H_ 3 | 4 | int ExplorersOfSkyMain(int mode); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /headers/pmdsky_eu.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_PMDSKY_EU_H_ 2 | #define HEADERS_PMDSKY_EU_H_ 3 | 4 | #include "versions.h" 5 | #define PMDSKY_VERSION PMDSKY_EU 6 | #include "pmdsky.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /headers/pmdsky_jp.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_PMDSKY_JP_H_ 2 | #define HEADERS_PMDSKY_JP_H_ 3 | 4 | #include "versions.h" 5 | #define PMDSKY_VERSION PMDSKY_JP 6 | #include "pmdsky.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /headers/pmdsky_na.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_PMDSKY_NA_H_ 2 | #define HEADERS_PMDSKY_NA_H_ 3 | 4 | #include "versions.h" 5 | #define PMDSKY_VERSION PMDSKY_NA 6 | #include "pmdsky.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /headers/types/common/file_io.h: -------------------------------------------------------------------------------- 1 | // Structures about reading files from the filesystem, as well as parsing them. 2 | 3 | #ifndef HEADERS_TYPES_COMMON_FILE_IO_H_ 4 | #define HEADERS_TYPES_COMMON_FILE_IO_H_ 5 | 6 | #include "enums.h" 7 | 8 | // This is essentially the standard (32-bit) Unix I/O vector struct. 9 | // It's used for file I/O and represents a buffer of data with a pointer and a length. 10 | struct iovec { 11 | void* iov_base; 12 | uint32_t iov_len; 13 | }; 14 | ASSERT_SIZE(struct iovec, 8); 15 | 16 | struct rect16_xywh { 17 | int16_t x; 18 | int16_t y; 19 | int16_t w; 20 | int16_t h; 21 | }; 22 | ASSERT_SIZE(struct rect16_xywh, 8); 23 | 24 | // A structure that represents a file stream for file I/O. 25 | struct file_stream { 26 | undefined4 field_0x0; 27 | undefined4 field_0x4; 28 | undefined4 field_0x8; 29 | undefined4 field_0xc; 30 | undefined4 field_0x10; 31 | undefined4 field_0x14; 32 | undefined4 field_0x18; 33 | undefined4 field_0x1c; 34 | undefined4 field_0x20; 35 | void* start_address; 36 | void* end_address; 37 | void* current_address; 38 | undefined4 field_0x30; 39 | undefined4 field_0x34; 40 | undefined4 field_0x38; 41 | undefined4 field_0x3c; 42 | undefined4 field_0x40; 43 | undefined4 field_0x44; 44 | }; 45 | ASSERT_SIZE(struct file_stream, 72); 46 | 47 | // Contain information about a single file contained inside a Pack archive 48 | struct pack_file_table_of_content { 49 | uint32_t offset; // The offset of the file relative to the start of the Pack file 50 | uint32_t length; // The size of the file 51 | }; 52 | ASSERT_SIZE(struct pack_file_table_of_content, 8); 53 | 54 | /* Information for reading a .bin Pack file 55 | 56 | A pack file is an archive that contains multiple other files. They aren't named. 57 | 58 | File format documentation at 59 | https://projectpokemon.org/docs/mystery-dungeon-nds/pmd2-pack-file-format-r42 */ 60 | struct pack_file_opened { 61 | struct pack_file_table_of_content* table_of_content; 62 | undefined4 zero; // Loaded from file, but is always zero here. Seemingly unused. 63 | uint32_t nb_entry_table_of_content; // loaded from file 64 | struct file_stream opened_file; 65 | }; 66 | ASSERT_SIZE(struct pack_file_opened, 84); 67 | 68 | // Data to return result of the AllocAndLoadFileInPack function 69 | struct pack_alloc_and_load_result { 70 | void* data; 71 | uint32_t length; 72 | }; 73 | ASSERT_SIZE(struct pack_alloc_and_load_result, 8); 74 | 75 | /* Handle to a memory-allocated WTE file. 76 | 77 | The WTE file format is a simple file format found both in file directories 78 | and in the ROM filesystem. This format specializes in storing texture data, 79 | and is closely linked to the 3D engine, as well as the 3D resource manager! 80 | 81 | While EoS is not a 3D game, the game still utilizes the 3D hardware to draw 82 | graphics onto the screen. Examples of its usage are the Dungeon Mode GUI 83 | (DUNGEON/dungeon.bin+0x3F4) and the fog (DUNGEON/dungeon.bin+0x401) */ 84 | struct wte_handle { 85 | void* content; // Pointer to the heap-allocated WTE data. Only stored for freeing the data 86 | struct wte_header* header; 87 | }; 88 | ASSERT_SIZE(struct wte_handle, 8); 89 | 90 | // These arguments are almost directly passed to the TEXIMAGE_PARAM register, just rearranged 91 | // For more information see: 92 | // https://problemkaputt.de/gbatek.htm#ds3dtextureattributes 93 | #pragma pack(push, 2) 94 | struct wte_texture_params { 95 | uint8_t texture_smult : 3; 96 | uint8_t texture_tmult : 3; 97 | uint8_t unused6 : 2; 98 | enum texture_format format : 3; 99 | bool repeat_x : 1; 100 | bool repeat_y : 1; 101 | uint8_t unusedD : 3; 102 | }; 103 | ASSERT_SIZE(struct wte_texture_params, 2); 104 | #pragma pack(pop) 105 | 106 | struct wte_header { 107 | char signature[4]; // 0x0: Signature bytes (must be "\x57\x54\x45\x00") 108 | void* texture; // 0x4 109 | uint32_t texture_size; // 0x8 110 | struct wte_texture_params params; // 0xC 111 | uint16_t _padding_0xe; 112 | /* These bounds are NOT used by the game, but they prove useful to extract the texture out 113 | of the file. The offsets are redundant and should be zero 114 | 115 | The width specified here should always be the same as the one specified in the texture 116 | params, but the height may be lower. The reason is that just like the width, the height 117 | needs to be a power of 2 in the range of 8..1024. The actual texture can have a lower 118 | height, but not a lower width, as the width is required to properly read the image */ 119 | struct rect16_xywh texture_bounds; // 0x10 120 | struct rgba* palette; // 0x18 121 | uint16_t color_amt; // 0x1C: How many colors are stored in the palette 122 | uint16_t _padding_0x1e; 123 | }; 124 | ASSERT_SIZE(struct wte_header, 32); 125 | 126 | struct bg_list_entry_sub_struct { 127 | char name[10]; // Null-terminated string 128 | }; 129 | ASSERT_SIZE(struct bg_list_entry_sub_struct, 10); 130 | 131 | // Represents an entry in the bg_list.dat file, after being loaded by LoadBgListEntry 132 | struct bg_list_entry { 133 | struct bg_list_entry_sub_struct bpl; 134 | struct bg_list_entry_sub_struct bpc; 135 | struct bg_list_entry_sub_struct bma; 136 | struct bg_list_entry_sub_struct others_bpa[8]; 137 | }; 138 | ASSERT_SIZE(struct bg_list_entry, 110); 139 | 140 | #endif 141 | -------------------------------------------------------------------------------- /headers/types/dungeon_mode/dungeon_mode_common.h: -------------------------------------------------------------------------------- 1 | // These are types that logically belong to dungeon mode, but also need to be generally accessible 2 | // for transitional code on the interface between dungeon mode and other modes. 3 | 4 | #ifndef HEADERS_TYPES_DUNGEON_MODE_COMMON_H_ 5 | #define HEADERS_TYPES_DUNGEON_MODE_COMMON_H_ 6 | 7 | #include "enums.h" 8 | 9 | // Item info 10 | struct item { 11 | // 0x0: flags: 1-byte bitfield 12 | bool f_exists : 1; // Validity flag 13 | bool f_in_shop : 1; // In a Kecleon Shop 14 | bool f_unpaid : 1; // Picked up from a Kecleon Shop but not paid for yet 15 | bool f_sticky : 1; // Sticky 16 | bool f_set : 1; // Usable by L+R 17 | bool flag_unk5 : 1; 18 | // For stolen items to recover from outlaws (has red X)? Could be for other items for other 19 | // types of missions? (Uncertain) 20 | bool f_unk_mission_item1 : 1; 21 | // For stolen items to recover from outlaws (has red X)? Could be for other items for other 22 | // types of missions? (Uncertain) Definitely used temporarily when sorting the items in 23 | // storage. 24 | bool f_unk_mission_item2 : 1; 25 | // 0x1: For bag items. 0 for none, 1 if held by the leader, 2 for the second party member, etc. 26 | uint8_t held_by; 27 | // 0x2: Only for stackable items. Will be 0 if unapplicable. For Poké, this is an "amount code" 28 | // rather than the literal amount (see MONEY_QUANTITY_TABLE) 29 | uint16_t quantity; 30 | struct item_id_16 id; // 0x4 31 | }; 32 | ASSERT_SIZE(struct item, 6); 33 | 34 | // Monster move info 35 | struct move { 36 | // 0x0: flags0: 1-byte bitfield 37 | bool f_exists : 1; // This move will show up in the move list 38 | bool f_subsequent_in_link_chain : 1; // This move is in a link chain, but not the first move 39 | bool f_enabled_for_ai : 1; // AI can use this move 40 | bool f_set : 1; // Usable by L+A 41 | bool f_last_used : 1; // This move was the last one used (for things like Torment?) 42 | bool f_disabled : 1; // For Torment (and maybe others) 43 | uint8_t flags0_unk6 : 2; 44 | 45 | undefined field_0x1; 46 | 47 | // 0x2: flags2: 2-byte bitfield 48 | bool f_sealed : 1; // Sealed by a Seal Trap. Also prevents AI from using this move 49 | uint16_t flags2_unk1 : 2; 50 | bool f_consume_pp : 1; // This move will consume PP this turn 51 | bool f_consume_2_pp : 1; // Consume 2 PP this turn. No effect unless f_consume_pp is set 52 | uint16_t flags2_unk5 : 1; 53 | // Consume 4 PP this turn. No effect unless f_consume_pp is set, overrides f_consume_2_pp 54 | bool f_consume_4_pp : 1; 55 | uint16_t flags2_unk7 : 1; 56 | bool f_multitalent_pp_boost : 1; // The IQ skill Multitalent is actively boosting move PP 57 | bool f_exclusive_item_pp_boost : 1; // A PP-boosting exclusive item is in effect 58 | bool f_unknown_pp_boost : 1; // A PP-boosting effect? Possibly unused? 59 | uint16_t flags3_unk11 : 5; 60 | 61 | struct move_id_16 id; // 0x4 62 | uint8_t pp; // 0x6: Current PP 63 | uint8_t ginseng; // 0x7: Ginseng boost 64 | }; 65 | ASSERT_SIZE(struct move, 8); 66 | 67 | // Used in menus and the post-dungeon summary. 68 | struct monster_summary { 69 | struct monster_id_16 id; // 0x0 70 | char monster_name[10]; // 0x2 71 | undefined field_0xC; 72 | undefined field_0xD; 73 | undefined field_0xE; 74 | undefined field_0xF; 75 | undefined field_0x10; 76 | undefined field_0x11; 77 | undefined field_0x12; 78 | undefined field_0x13; 79 | undefined field_0x14; 80 | undefined field_0x15; 81 | struct type_id_8 types[2]; // 0x16 82 | struct ability_id_8 abilities[2]; // 0x18 83 | struct dungeon_id_8 joined_at; // 0x1A 84 | uint8_t joined_at_floor; // 0x1B 85 | struct item held_item; // 0x1C 86 | undefined field_0x22; 87 | undefined field_0x23; 88 | int32_t hp; // 0x24: Current HP 89 | int32_t max_hp; // 0x28: Actual max HP (hp + hp boost) 90 | uint32_t level; // 0x2C 91 | int exp; // 0x30 92 | uint8_t offensive_stats[2]; // 0x34: {atk, sp_atk} 93 | uint8_t defensive_stats[2]; // 0x36: {def, sp_def} 94 | bool is_team_leader; // 0x38 95 | uint8_t attack_boost; // 0x39: from things like Power Band, Munch Belt 96 | uint8_t special_attack_boost; // 0x3A 97 | uint8_t defense_boost; // 0x3B 98 | uint8_t special_defense_boost; // 0x3C 99 | undefined field_0x3D; 100 | int16_t iq; // 0x3E 101 | undefined field_0x40; 102 | undefined field_0x41; 103 | // 0x42: Level upon first evolution. Set to 0 in dungeon mode. 104 | uint8_t level_at_first_evo; 105 | // 0x43: Level upon first evolution. Set to 0 in dungeon mode. 106 | uint8_t level_at_second_evo; 107 | // 0x44: Evolution status. In ground_mode, accounts for luminous spring being unlocked. 108 | uint8_t evo_status; 109 | bool inflicted_with_gastro_acid; // 0x45 110 | undefined field_0x46; 111 | undefined field_0x47; 112 | uint32_t iq_skill_flags[3]; // 0x48 113 | struct tactic_id_8 tactic; // 0x54 114 | undefined field_0x55; 115 | undefined field_0x56; 116 | undefined field_0x57; 117 | // 0x58: Appears to be a list of all the currently inflicted statues in their enum form. The 118 | // last entry (30th) appears to always be STATUS_NONE to serve as a terminator for the list. 119 | // While in ground mode, it's always filled with STATUS_NONE. 120 | struct status_id_8 active_statuses[30]; 121 | undefined2 _padding_0x76; 122 | }; 123 | ASSERT_SIZE(struct monster_summary, 120); 124 | 125 | #endif 126 | -------------------------------------------------------------------------------- /headers/types/files/wan.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_TYPES_FILES_WAN_H_ 2 | #define HEADERS_TYPES_FILES_WAN_H_ 3 | 4 | #include "../common/util.h" 5 | 6 | enum wan_sprite_type { 7 | WAN_SPRITE_PROPS_UI = 0, // for object and UI objects 8 | WAN_SPRITE_CHARA = 1, // for monster sprites 9 | WAN_SPRITE_UNK_2 = 2, 10 | WAN_SPRITE_UNK_3 = 3, // use the 3D engine for rendering. Used by a few sprites in effect.bin. 11 | }; 12 | 13 | // This is usually stored as a 16-bit integer 14 | #pragma pack(push, 2) 15 | ENUM_16_BIT(wan_sprite_type); 16 | #pragma pack(pop) 17 | 18 | struct wan_animation_header { 19 | struct wan_fragment** frames; // first level is a frame, pointing to a list of fragments 20 | struct wan_offset* frame_offsets; 21 | struct wan_animation_group* animations; 22 | uint16_t nb_animation_groups; 23 | uint16_t allocation_for_max_frame; 24 | undefined field5_0x10; 25 | undefined field6_0x11; 26 | undefined field7_0x12; 27 | undefined field8_0x13; 28 | // appears to always be 0, but the game seems to still decode it 29 | // if the image header is missing for some reason 30 | uint16_t is_256_color_alt; 31 | undefined field9_0x16; 32 | undefined field10_0x17; 33 | }; 34 | ASSERT_SIZE(struct wan_animation_header, 24); 35 | 36 | struct wan_palettes { 37 | struct rgba* palette_bytes; 38 | uint16_t unk1; 39 | uint16_t nb_color; 40 | uint16_t unk2; 41 | uint8_t unk3; 42 | uint8_t unk4; 43 | uint32_t unk5; // Normally always 0 44 | }; 45 | ASSERT_SIZE(struct wan_palettes, 16); 46 | 47 | // An animation group is a set of animations, either a single one or 8 for the eight possible 48 | // orientations of a monster. An animation is itself made of frames. 49 | struct wan_animation_group { 50 | // first level is animations, second is frame pointer 51 | struct wan_animation_frame** pnt; 52 | uint16_t len; 53 | // The frame offset relative to the first frame of the animation that will be used instead of 54 | // the first frame when looping the animation. (untested) 55 | uint16_t loop_start; 56 | }; 57 | ASSERT_SIZE(struct wan_animation_group, 8); 58 | 59 | struct wan_animation_frame { 60 | uint8_t duration; 61 | uint8_t flag; 62 | uint16_t frame_id; 63 | struct vec2_16 offset; 64 | struct vec2_16 shadow_offset; 65 | }; 66 | ASSERT_SIZE(struct wan_animation_frame, 12); 67 | 68 | struct wan_image_header { 69 | // first level is a group of assembly entry, that can be used to build a fragment_bytes 70 | struct wan_fragment_bytes_assembly_entry** fragments_bytes_store; 71 | struct wan_palettes* palettes; 72 | uint16_t unk1; 73 | bool is_256_color; 74 | undefined1 padding1; 75 | uint16_t unk2; 76 | uint16_t nb_fragments; 77 | }; 78 | ASSERT_SIZE(struct wan_image_header, 16); 79 | 80 | struct wan_offset { 81 | struct uvec2_16 head; 82 | struct uvec2_16 hand_left; 83 | struct uvec2_16 hand_right; 84 | struct uvec2_16 center; 85 | }; 86 | ASSERT_SIZE(struct wan_offset, 16); 87 | 88 | // A sprite file, that are directly loaded from memory as they are stored (after decompression if 89 | // needed). Names comes from the pmd_wan project. 90 | #pragma pack(push, 2) 91 | struct wan_header { 92 | struct wan_animation_header* anim_header; 93 | struct wan_image_header* image_header; 94 | struct wan_sprite_type_16 sprite_type; 95 | }; 96 | #pragma pack(pop) 97 | ASSERT_SIZE(struct wan_header, 10); 98 | 99 | struct wan_fragment { 100 | // negative mean using the previous defined fragment bytes (or to not update it?) 101 | int16_t fragment_bytes_index; 102 | int8_t unk1; 103 | int8_t unk2; 104 | 105 | // 2 bytes 106 | int8_t offset_y : 8; 107 | bool unk3 : 1; 108 | bool unk4 : 1; 109 | uint8_t likely_padding_1 : 3; 110 | bool is_mosaic : 1; 111 | uint8_t shape_indice : 2; // as used in OBJ attribute 1 112 | 113 | // 2 bytes 114 | uint16_t offset_x : 9; // The value to be used is this - 256, which can end up negative. 115 | bool likely_padding_2 : 1; 116 | bool unk5 : 1; 117 | bool is_last : 1; 118 | bool h_flip : 1; 119 | bool v_flip : 1; 120 | uint8_t size_indice : 2; // as used in OBJ attribute 0 121 | 122 | // 2 bytes 123 | uint16_t fragment_alloc_counter : 10; 124 | uint8_t likely_padding_3 : 2; 125 | uint8_t palette_id : 4; 126 | }; 127 | ASSERT_SIZE(struct wan_fragment, 10); 128 | 129 | // Structure used to store a wan fragment while removing contiguous zeros. 130 | struct wan_fragment_bytes_assembly_entry { 131 | void* pixel_src; // if null, the space is filled with 0 132 | // byte amount of the pointed pixel_src. If 0, then the last entry is reached (this final 0 one 133 | // is ignored) 134 | uint32_t byte_amount; 135 | uint32_t z_index; // presumably 136 | }; 137 | ASSERT_SIZE(struct wan_fragment_bytes_assembly_entry, 12); 138 | #endif 139 | -------------------------------------------------------------------------------- /headers/types/types.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_TYPES_H_ 2 | #define HEADERS_TYPES_H_ 3 | 4 | #include "common/common.h" 5 | #include "dungeon_mode/dungeon_mode.h" 6 | #include "ground_mode/ground_mode.h" 7 | #include "sentry_duty/sentry_duty.h" 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /headers/versions.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADERS_VERSIONS_H_ 2 | #define HEADERS_VERSIONS_H_ 3 | 4 | // Arbitrary numbering (based on release order) 5 | #define PMDSKY_JP 1 6 | #define PMDSKY_NA 2 7 | #define PMDSKY_EU 3 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/data_formats.rs: -------------------------------------------------------------------------------- 1 | //! This module contains structs and methods for reading, writing, and manipulating different 2 | //! symbol data formats. 3 | //! 4 | //! The code for each data format is separated into its own module, including the `resymgen` YAML 5 | //! format itself (the [`symgen_yml`] module). 6 | 7 | pub mod ghidra; 8 | pub mod ghidra_csv; 9 | pub mod json; 10 | pub mod sym; 11 | pub mod symgen_yml; 12 | 13 | use std::error::Error; 14 | use std::fs::File; 15 | use std::io::{Read, Write}; 16 | use std::path::Path; 17 | 18 | use ghidra::GhidraFormatter; 19 | use ghidra_csv::CsvLoader; 20 | use json::JsonFormatter; 21 | use sym::SymFormatter; 22 | pub use symgen_yml::Generate; 23 | use symgen_yml::{Load, LoadParams, Subregion, SymGen, Symbol}; 24 | 25 | // `OutFormat` is like a poor man's version of trait objects for Generate. Real trait objects don't 26 | // work because `Generate` isn't object-safe (generate() is generic), so we can't use dynamic 27 | // polymorphism and need to define an enum instead for static polymorphism (the idea is to be able 28 | // to make an array of `Generate` objects). 29 | 30 | /// Output formats that can be generated from the [`resymgen` YAML] format 31 | /// (all types that are [`Generate`]). 32 | /// 33 | /// [`resymgen` YAML]: symgen_yml 34 | #[derive(Debug, Clone, Copy)] 35 | pub enum OutFormat { 36 | /// [`ghidra`] format 37 | Ghidra, 38 | /// [`sym`] format 39 | Sym, 40 | /// [`json`] format 41 | Json, 42 | } 43 | 44 | // Technically this makes it redundant to impl Generate for the individual formatters, but I think 45 | // the trait still adds clarity, even though it doesn't add utility :) 46 | impl Generate for OutFormat { 47 | fn generate( 48 | &self, 49 | writer: W, 50 | symgen: &SymGen, 51 | version: &str, 52 | ) -> Result<(), Box> { 53 | match self { 54 | Self::Ghidra => GhidraFormatter {}.generate(writer, symgen, version), 55 | Self::Sym => SymFormatter {}.generate(writer, symgen, version), 56 | Self::Json => JsonFormatter {}.generate(writer, symgen, version), 57 | } 58 | } 59 | } 60 | 61 | impl OutFormat { 62 | /// Returns the [`OutFormat`] corresponding to the given `name`, if there is one. 63 | pub fn from(name: &str) -> Option { 64 | match name { 65 | "ghidra" => Some(Self::Ghidra), 66 | "sym" => Some(Self::Sym), 67 | "json" => Some(Self::Json), 68 | _ => None, 69 | } 70 | } 71 | /// Returns the file extension associated with the [`OutFormat`]. 72 | pub fn extension(&self) -> String { 73 | match self { 74 | Self::Ghidra => String::from("ghidra"), 75 | Self::Sym => String::from("sym"), 76 | Self::Json => String::from("json"), 77 | } 78 | } 79 | /// Returns an [`Iterator`] over all [`OutFormat`] variants. 80 | pub fn all() -> impl Iterator { 81 | [Self::Ghidra, Self::Sym, Self::Json].iter().copied() 82 | } 83 | } 84 | 85 | /// Input formats that can be merged into a symbol table in the [`resymgen` YAML] format 86 | /// (all types that are [`Load`]). 87 | /// 88 | /// [`resymgen` YAML]: symgen_yml 89 | #[derive(Debug, Clone, Copy)] 90 | pub enum InFormat { 91 | /// [`resymgen` YAML] format. 92 | /// 93 | /// [`resymgen` YAML]: symgen_yml 94 | Yaml, 95 | /// A specific [CSV] format exported from Ghidra projects. 96 | /// 97 | /// [CSV]: ghidra_csv 98 | Csv, 99 | } 100 | 101 | impl InFormat { 102 | /// Returns the [`InFormat`] corresponding to the given `name`, if there is one. 103 | pub fn from(name: &str) -> Option { 104 | match name { 105 | "yml" => Some(Self::Yaml), 106 | "csv" => Some(Self::Csv), 107 | _ => None, 108 | } 109 | } 110 | /// Returns the file extension associated with the [`InFormat`]. 111 | pub fn extension(&self) -> String { 112 | match self { 113 | Self::Yaml => String::from("yml"), 114 | Self::Csv => String::from("csv"), 115 | } 116 | } 117 | /// Returns an [`Iterator`] over all [`InFormat`] variants. 118 | pub fn all() -> impl Iterator { 119 | [Self::Yaml, Self::Csv].iter().copied() 120 | } 121 | 122 | /// Reads data from `rdr` in the format specified by the [`InFormat`], and merges it into 123 | /// `symgen` using the options specified in `params`. 124 | /// 125 | /// If a `file_name` is provided, it may be used for subregion resolution, depending on the 126 | /// [`InFormat`]. 127 | pub fn merge( 128 | &self, 129 | symgen: &mut SymGen, 130 | rdr: R, 131 | file_name: Option

, 132 | params: &LoadParams, 133 | ) -> Result, Box> 134 | where 135 | R: Read, 136 | P: AsRef, 137 | { 138 | let unmerged = match self { 139 | Self::Yaml => { 140 | let mut other = SymGen::read_no_init(rdr)?; 141 | if let Some(file_name) = file_name { 142 | other 143 | .resolve_subregions(Subregion::subregion_dir(file_name.as_ref()), |p| { 144 | File::open(p) 145 | })?; 146 | } 147 | symgen.merge_symgen(&other)?; 148 | Vec::new() 149 | } 150 | Self::Csv => symgen.merge_symbols(CsvLoader::load(rdr, params)?)?, 151 | }; 152 | Ok(unmerged) 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /src/data_formats/ghidra.rs: -------------------------------------------------------------------------------- 1 | //! A Ghidra-compatible symbol table format (.ghidra). 2 | //! 3 | //! This format is the symbol table format read by the `ImportSymbolsScript.py` Ghidra script. 4 | //! Each symbol is listed on a separate line, and consists of a name, a memory address (as raw 5 | //! hexadecimal), and a letter identifying the symbol type ('f' for functions and 'l' for labels). 6 | //! If a symbol has aliases, each alias is listed on a separate line. 7 | //! 8 | //! # Example 9 | //! ```csv 10 | //! main 2000000 f 11 | //! function1 2400000 f 12 | //! SOME_DATA 2FFFFFF l 13 | //! ``` 14 | 15 | use std::error::Error; 16 | use std::io::Write; 17 | 18 | use csv::WriterBuilder; 19 | use serde::{Serialize, Serializer}; 20 | 21 | use super::symgen_yml::{Generate, SymGen, Uint}; 22 | 23 | /// Generator for the .ghidra format. 24 | pub struct GhidraFormatter {} 25 | 26 | #[derive(Debug)] 27 | enum SymbolType { 28 | Function, 29 | Label, 30 | } 31 | 32 | impl Serialize for SymbolType { 33 | fn serialize(&self, serializer: S) -> Result 34 | where 35 | S: Serializer, 36 | { 37 | match self { 38 | Self::Function => serializer.serialize_char('f'), 39 | Self::Label => serializer.serialize_char('l'), 40 | } 41 | } 42 | } 43 | 44 | fn serialize_as_hex(x: &Uint, s: S) -> Result 45 | where 46 | S: Serializer, 47 | { 48 | s.serialize_str(&format!("{:X}", x)) 49 | } 50 | 51 | #[derive(Debug, Serialize)] 52 | struct Entry<'a> { 53 | name: &'a str, 54 | #[serde(serialize_with = "serialize_as_hex")] 55 | address: Uint, 56 | stype: SymbolType, 57 | } 58 | 59 | impl Generate for GhidraFormatter { 60 | fn generate( 61 | &self, 62 | writer: W, 63 | symgen: &SymGen, 64 | version: &str, 65 | ) -> Result<(), Box> { 66 | let mut wtr = WriterBuilder::new() 67 | .delimiter(b' ') 68 | .has_headers(false) 69 | .from_writer(writer); 70 | for f in symgen.functions_realized(version) { 71 | wtr.serialize(Entry { 72 | name: f.name, 73 | address: f.address, 74 | stype: SymbolType::Function, 75 | })?; 76 | if let Some(aliases) = f.aliases { 77 | for alias in aliases { 78 | wtr.serialize(Entry { 79 | name: alias, 80 | address: f.address, 81 | stype: SymbolType::Function, 82 | })?; 83 | } 84 | } 85 | } 86 | for d in symgen.data_realized(version) { 87 | wtr.serialize(Entry { 88 | name: d.name, 89 | address: d.address, 90 | stype: SymbolType::Label, 91 | })?; 92 | if let Some(aliases) = d.aliases { 93 | for alias in aliases { 94 | wtr.serialize(Entry { 95 | name: alias, 96 | address: d.address, 97 | stype: SymbolType::Label, 98 | })?; 99 | } 100 | } 101 | } 102 | Ok(()) 103 | } 104 | } 105 | 106 | #[cfg(test)] 107 | mod tests { 108 | use super::*; 109 | 110 | fn get_test_symgen() -> SymGen { 111 | SymGen::read( 112 | r" 113 | main: 114 | versions: 115 | - v1 116 | - v2 117 | address: 118 | v1: 0x2000000 119 | v2: 0x2000000 120 | length: 121 | v1: 0x100000 122 | v2: 0x100000 123 | description: foo 124 | functions: 125 | - name: fn1 126 | aliases: 127 | - fn1_alias 128 | address: 129 | v1: 0x2000000 130 | v2: 0x2002000 131 | length: 132 | v1: 0x1000 133 | v2: 0x1000 134 | description: bar 135 | - name: fn2 136 | address: 137 | v1: 138 | - 0x2001000 139 | - 0x2002000 140 | v2: 0x2003000 141 | description: baz 142 | data: 143 | - name: SOME_DATA 144 | address: 145 | v1: 0x2003000 146 | v2: 0x2004000 147 | length: 148 | v1: 0x1000 149 | v2: 0x2000 150 | description: foo bar baz 151 | " 152 | .as_bytes(), 153 | ) 154 | .expect("Read failed") 155 | } 156 | 157 | #[test] 158 | fn test_generate() { 159 | let symgen = get_test_symgen(); 160 | let f = GhidraFormatter {}; 161 | assert_eq!( 162 | f.generate_str(&symgen, "v1").expect("generate failed"), 163 | "fn1 2000000 f\nfn1_alias 2000000 f\nfn2 2001000 f\nfn2 2002000 f\nSOME_DATA 2003000 l\n" 164 | ); 165 | assert_eq!( 166 | f.generate_str(&symgen, "v2").expect("generate failed"), 167 | "fn1 2002000 f\nfn1_alias 2002000 f\nfn2 2003000 f\nSOME_DATA 2004000 l\n" 168 | ); 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /src/data_formats/sym.rs: -------------------------------------------------------------------------------- 1 | //! The SYM (.sym) format. 2 | //! 3 | //! The SYM format is a simple symbol table format. Each symbol is listed on a separate line, and 4 | //! consists of a memory address (as a raw, 8-character hexadecimal number) and a name separated 5 | //! by spaces. Symbols are always listed by their primary name; any aliases are ignored. 6 | //! 7 | //! # Example 8 | //! ```csv 9 | //! 02000000 main 10 | //! 02400000 function1 11 | //! 02FFFFFF SOME_DATA 12 | //! ``` 13 | 14 | use std::error::Error; 15 | use std::io::Write; 16 | 17 | use csv::WriterBuilder; 18 | use serde::{Serialize, Serializer}; 19 | 20 | use super::symgen_yml::{Generate, SymGen, Uint}; 21 | 22 | /// Generator for the .sym format. 23 | pub struct SymFormatter {} 24 | 25 | fn serialize_as_hex8(x: &Uint, s: S) -> Result 26 | where 27 | S: Serializer, 28 | { 29 | // If x is larger than u32::MAX, it'll just be printed with as many characters as needed. 30 | // SYM only supports 32-bit numbers by virtue of requiring 8-character hex offsets, 31 | // so there isn't really a well defined way to handle this case ¯\_(ツ)_/¯. 32 | s.serialize_str(&format!("{:08X}", x)) 33 | } 34 | 35 | #[derive(Debug, Serialize)] 36 | struct Entry<'a> { 37 | #[serde(serialize_with = "serialize_as_hex8")] 38 | address: Uint, 39 | name: &'a str, 40 | } 41 | 42 | impl Generate for SymFormatter { 43 | fn generate( 44 | &self, 45 | writer: W, 46 | symgen: &SymGen, 47 | version: &str, 48 | ) -> Result<(), Box> { 49 | let mut wtr = WriterBuilder::new() 50 | .delimiter(b' ') 51 | .has_headers(false) 52 | .from_writer(writer); 53 | for s in symgen.symbols_realized(version) { 54 | // NOTE: aliases are ignored here on purpose; only write the primary name 55 | wtr.serialize(Entry { 56 | address: s.address, 57 | name: s.name, 58 | })?; 59 | } 60 | Ok(()) 61 | } 62 | } 63 | 64 | #[cfg(test)] 65 | mod tests { 66 | use super::*; 67 | 68 | fn get_test_symgen() -> SymGen { 69 | SymGen::read( 70 | r" 71 | main: 72 | versions: 73 | - v1 74 | - v2 75 | address: 76 | v1: 0x2000000 77 | v2: 0x2000000 78 | length: 79 | v1: 0x100000 80 | v2: 0x100000 81 | description: foo 82 | functions: 83 | - name: fn1 84 | aliases: 85 | - fn1_alias 86 | address: 87 | v1: 0x2000000 88 | v2: 0x2002000 89 | length: 90 | v1: 0x1000 91 | v2: 0x1000 92 | description: bar 93 | - name: fn2 94 | address: 95 | v1: 96 | - 0x2001FFF 97 | - 0x2002000 98 | v2: 0x2003000 99 | description: baz 100 | data: 101 | - name: SOME_DATA 102 | address: 103 | v1: 0x2003000 104 | v2: 0x2004000 105 | length: 106 | v1: 0x1000 107 | v2: 0x2000 108 | description: foo bar baz 109 | " 110 | .as_bytes(), 111 | ) 112 | .expect("Read failed") 113 | } 114 | 115 | #[test] 116 | fn test_generate() { 117 | let symgen = get_test_symgen(); 118 | let f = SymFormatter {}; 119 | assert_eq!( 120 | f.generate_str(&symgen, "v1").expect("generate failed"), 121 | "02000000 fn1\n02001FFF fn2\n02002000 fn2\n02003000 SOME_DATA\n" 122 | ); 123 | assert_eq!( 124 | f.generate_str(&symgen, "v2").expect("generate failed"), 125 | "02002000 fn1\n02003000 fn2\n02004000 SOME_DATA\n" 126 | ); 127 | } 128 | 129 | #[test] 130 | fn test_generate_64bit() { 131 | let symgen = SymGen::read( 132 | r" 133 | main: 134 | address: 0x2000000 135 | length: 0x10000000000 136 | functions: 137 | - name: fn1 138 | address: 0x100000000 139 | - name: fn2 140 | address: 0x2000000 141 | - name: fn3 142 | address: 0xFFFFFFFFFF 143 | data: [] 144 | " 145 | .as_bytes(), 146 | ) 147 | .expect("Read failed"); 148 | 149 | let f = SymFormatter {}; 150 | // The format makes no official specification on how 64-bit numbers should behave, 151 | // but resymgen should still deal with them in a consistent manner. 152 | assert_eq!( 153 | f.generate_str(&symgen, "").expect("generate failed"), 154 | "100000000 fn1\n02000000 fn2\nFFFFFFFFFF fn3\n" 155 | ); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/data_formats/symgen_yml.rs: -------------------------------------------------------------------------------- 1 | //! The `resymgen` YAML format and associated APIs to integrate with other data formats. 2 | //! 3 | //! [`SymGen`] represents an entire `resymgen` YAML file. Through this type and its methods, 4 | //! `resymgen` files can be read from files, manipulated in various ways, and written to files. 5 | //! 6 | //! A `resymgen` YAML file consists of one or more named [`Block`]s. Each [`Block`] is tagged with 7 | //! some metadata, and contains two lists of [`Symbol`]s, one for functions and one for data. 8 | //! A [`Symbol`] represents one or more memory regions containing an identifiable chunk of 9 | //! instructions or data. 10 | //! 11 | //! Optionally, each [`Block`] can also contain a list of [`Subregion`]s. A [`Subregion`] 12 | //! represents a nested [`SymGen`], which has one or more of its own named [`Block`]s, that is 13 | //! contained within the parent [`Block`]. In a `resymgen` YAML file, a [`Subregion`] is 14 | //! represented as a file name. If the `resymgen` YAML file has the file path 15 | //! `/path/to/parent.yml`, and one of its blocks has a subregion with the name `sub.yml`, then 16 | //! this subregion name references a corresponding subregion file (which is itself a `resymgen` 17 | //! YAML file) with the file path `/path/to/parent/sub.yml`. 18 | //! 19 | //! # Example 20 | //! ```yml 21 | //! main: 22 | //! versions: 23 | //! - v1 24 | //! - v2 25 | //! address: 26 | //! v1: 0x2000000 27 | //! v2: 0x2010000 28 | //! length: 29 | //! v1: 0x100000 30 | //! v2: 0x100000 31 | //! description: The main memory region 32 | //! subregions: 33 | //! - sub1.yml 34 | //! - sub2.yml 35 | //! functions: 36 | //! - name: function1 37 | //! aliases: 38 | //! - function1_alias1 39 | //! - function1_alias2 40 | //! address: 41 | //! v1: 0x2001000 42 | //! v2: 0x2012000 43 | //! description: |- 44 | //! multi 45 | //! line 46 | //! description 47 | //! - name: function2 48 | //! address: 49 | //! v1: 50 | //! - 0x2002000 51 | //! - 0x2003000 52 | //! v2: 0x2013000 53 | //! description: simple description 54 | //! data: 55 | //! - name: SOME_DATA 56 | //! address: 57 | //! v1: 0x2000000 58 | //! v2: 0x2010000 59 | //! length: 60 | //! v1: 0x1000 61 | //! v2: 0x1600 62 | //! other: 63 | //! address: 0x2400000 64 | //! length: 0x100000 65 | //! functions: [] 66 | //! data: 67 | //! - name: OTHER_DATA 68 | //! address: 0x2400000 69 | //! ``` 70 | 71 | mod adapter; 72 | mod error; 73 | mod merge; 74 | mod symgen; 75 | mod types; 76 | 77 | pub mod bounds; 78 | 79 | pub use adapter::*; 80 | pub use error::*; 81 | pub use symgen::*; 82 | pub use types::{Linkable, MaybeVersionDep, OrdString, OrderMap, Sort, Uint, Version, VersionDep}; 83 | -------------------------------------------------------------------------------- /src/data_formats/symgen_yml/adapter.rs: -------------------------------------------------------------------------------- 1 | //! Adapter APIs to integrate the `resymgen` YAML format with other data formats 2 | //! (through the `gen` and `merge` commands). 3 | 4 | use std::error::Error; 5 | use std::io::{Read, Write}; 6 | 7 | use super::symgen::{SymGen, Symbol}; 8 | 9 | /// `Generate` implementers can convert a [`SymGen`] into a different data format. 10 | pub trait Generate { 11 | /// Write the contents of `symgen` for `version` to `writer` in the desired format. 12 | fn generate( 13 | &self, 14 | writer: W, 15 | symgen: &SymGen, 16 | version: &str, 17 | ) -> Result<(), Box>; 18 | 19 | /// Write the contents of `symgen` for `version` to a [`String`]. 20 | fn generate_str(&self, symgen: &SymGen, version: &str) -> Result> { 21 | let mut bytes = Vec::::new(); 22 | self.generate(&mut bytes, symgen, version)?; 23 | Ok(String::from_utf8(bytes)?) 24 | } 25 | } 26 | 27 | /// Types of symbols within a [`SymGen`]. 28 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 29 | pub enum SymbolType { 30 | Function, 31 | Data, 32 | } 33 | 34 | /// A [`Symbol`] tagged with metadata to be added into a [`SymGen`]. 35 | #[derive(Debug, Clone, PartialEq, Eq)] 36 | pub struct AddSymbol { 37 | pub symbol: Symbol, 38 | pub stype: SymbolType, 39 | pub block_name: Option, 40 | } 41 | 42 | /// Parameters to control how data in a foreign format is merged into a [`SymGen`]. 43 | #[derive(Clone)] 44 | pub struct LoadParams { 45 | /// Name of the block in which to place a symbol if none is present. 46 | pub default_block_name: Option, 47 | /// Default symbol type to assign to a symbol if none is present. 48 | pub default_symbol_type: Option, 49 | /// Default version name to assign to a symbol if none is present. 50 | pub default_version_name: Option, 51 | } 52 | 53 | /// `Load` implementers can read the contents of a [`Read`] type and produce a stream of 54 | /// [`AddSymbol`]s, which are used for merging foreign formats into a [`SymGen`]. 55 | pub trait Load { 56 | type Source: Iterator; 57 | 58 | /// Load data in some format from `rdr` and return an iterator of [`AddSymbol`]s based on 59 | /// the options specified in `params`. 60 | fn load(rdr: R, params: &LoadParams) -> Result>; 61 | } 62 | -------------------------------------------------------------------------------- /src/data_formats/symgen_yml/error.rs: -------------------------------------------------------------------------------- 1 | //! Error types for this module. 2 | 3 | use std::fmt::{self, Display, Formatter}; 4 | use std::path::PathBuf; 5 | use std::{error, io, result, string}; 6 | 7 | use serde_yaml; 8 | 9 | use super::merge::{BlockInferenceError, MergeConflict, MissingBlock}; 10 | 11 | /// Error encountered when resolving a [`Subregion`]. 12 | /// 13 | /// [`Subregion`]: super::Subregion 14 | #[derive(Debug)] 15 | pub enum SubregionError { 16 | InvalidPath(PathBuf), 17 | Symlink(PathBuf), 18 | SymGen((PathBuf, Box)), 19 | } 20 | 21 | impl error::Error for SubregionError {} 22 | 23 | impl Display for SubregionError { 24 | fn fmt(&self, f: &mut Formatter) -> fmt::Result { 25 | match self { 26 | Self::InvalidPath(p) => write!(f, "invalid subregion path: '{}'", p.display()), 27 | Self::Symlink(p) => write!( 28 | f, 29 | "subregion directory '{}' is a symlink; not supported", 30 | p.display() 31 | ), 32 | Self::SymGen((p, e)) => write!(f, "{}: {}", p.display(), e), 33 | } 34 | } 35 | } 36 | 37 | /// Error encountered while processing a [`SymGen`]. 38 | /// 39 | /// [`SymGen`]: super::SymGen 40 | #[derive(Debug)] 41 | pub enum Error { 42 | Yaml(serde_yaml::Error), 43 | Io(io::Error), 44 | FromUtf8(string::FromUtf8Error), 45 | Subregion(SubregionError), 46 | } 47 | 48 | impl error::Error for Error {} 49 | 50 | impl Display for Error { 51 | fn fmt(&self, f: &mut Formatter) -> fmt::Result { 52 | match self { 53 | // YAML errors are probably the most common error a user will encounter, 54 | // so it's worth labeling it explicitly. 55 | Self::Yaml(e) => write!(f, "YAML: {}", e), 56 | Self::Io(e) => write!(f, "{}", e), 57 | Self::FromUtf8(e) => write!(f, "{}", e), 58 | Self::Subregion(e) => write!(f, "{}", e), 59 | } 60 | } 61 | } 62 | 63 | /// `Result` from processing a [`SymGen`]. 64 | /// 65 | /// [`SymGen`]: super::SymGen 66 | pub type Result = result::Result; 67 | 68 | /// Error encountered while merging into a [`SymGen`]. 69 | /// 70 | /// [`SymGen`]: super::SymGen 71 | #[derive(Debug)] 72 | pub enum MergeError { 73 | Conflict(MergeConflict), 74 | MissingBlock(MissingBlock), 75 | BlockInference(BlockInferenceError), 76 | } 77 | 78 | impl error::Error for MergeError {} 79 | 80 | impl Display for MergeError { 81 | fn fmt(&self, f: &mut Formatter) -> fmt::Result { 82 | match self { 83 | Self::Conflict(e) => write!(f, "{}", e), 84 | Self::MissingBlock(e) => write!(f, "{}", e), 85 | Self::BlockInference(e) => write!(f, "{}", e), 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/formatting.rs: -------------------------------------------------------------------------------- 1 | //! Formatting `resymgen` YAML files. Implements the `fmt` command. 2 | 3 | use std::error::Error; 4 | use std::fmt::Display; 5 | use std::fs::{self, File}; 6 | use std::io::{self, Write}; 7 | use std::path::Path; 8 | 9 | use similar::TextDiff; 10 | use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; 11 | 12 | use super::data_formats::symgen_yml::{IntFormat, Sort, Subregion, SymGen}; 13 | use super::util; 14 | 15 | /// Formats a given `input_file` using the given `int_format`. 16 | /// 17 | /// In `recursive` mode, subregion files are also formatted. 18 | /// 19 | /// # Examples 20 | /// ```ignore 21 | /// format_file("/path/to/symbols.yml", false, IntFormat::Hexadecimal).expect("Format failed"); 22 | /// ``` 23 | pub fn format_file>( 24 | input_file: P, 25 | recursive: bool, 26 | int_format: IntFormat, 27 | ) -> Result<(), Box> { 28 | let input_file = input_file.as_ref(); 29 | let mut contents = { 30 | let f = File::open(input_file)?; 31 | SymGen::read(&f)? 32 | }; 33 | if recursive { 34 | contents.resolve_subregions(Subregion::subregion_dir(input_file), |p| File::open(p))?; 35 | } 36 | contents.sort(); 37 | util::symgen_write_recursive(&contents, input_file, int_format) 38 | } 39 | 40 | /// Checks the format of a given `input_file`, subject to the given `int_format`. 41 | /// 42 | /// In `recursive` mode, subregion files are also checked. 43 | /// 44 | /// On success, returns `true`. On failure, returns `false` and prints a diff. 45 | /// 46 | /// # Examples 47 | /// ```ignore 48 | /// let succeeded = format_check_file("/path/to/symbols.yml", false, IntFormat::Hexadecimal) 49 | /// .expect("Format check failed"); 50 | /// ``` 51 | pub fn format_check_file>( 52 | input_file: P, 53 | recursive: bool, 54 | int_format: IntFormat, 55 | ) -> Result> { 56 | let input_file = input_file.as_ref(); 57 | let mut contents = { 58 | let f = File::open(input_file)?; 59 | SymGen::read(&f)? 60 | }; 61 | if recursive { 62 | contents.resolve_subregions(Subregion::subregion_dir(input_file), |p| File::open(p))?; 63 | } 64 | contents.sort(); 65 | 66 | let mut success = true; 67 | // Depth-first traversal is more intuitive for reporting formatting issues 68 | for cursor in contents.cursor(input_file).dtraverse() { 69 | // It's unfortunate we're reading the same file twice, but it's simpler than trying to 70 | // resolve subregions manually, and less memory intensive than caching. If this ever 71 | // becomes a performance issue, it can be optimized. 72 | let text = fs::read_to_string(cursor.path())?; 73 | let formatted_text = cursor.symgen().write_to_str(int_format)?; 74 | if text != formatted_text { 75 | print_format_diff(&text, &formatted_text, cursor.path().display())?; 76 | // Keep going to check any other subregion files, but fail the check as a whole 77 | success = false; 78 | } 79 | } 80 | Ok(success) 81 | } 82 | 83 | /// Prints a diff between a file and its formatted version in unified diff format. 84 | /// The title is printed as part of the diff header. 85 | fn print_format_diff(old: &str, new: &str, title: D) -> io::Result<()> { 86 | let mut stderr = StandardStream::stderr(ColorChoice::Always); 87 | let mut print_colored_diff = || -> io::Result<()> { 88 | let diff = TextDiff::from_lines(old, new) 89 | .unified_diff() 90 | .header(&format!("[cur] {}", title), &format!("[fmt] {}", title)) 91 | .to_string(); 92 | let mut color = ColorSpec::new(); 93 | // Manually add pretty colors to the diff output (based on `git diff`) :) 94 | for (i, line) in diff.lines().enumerate() { 95 | // Don't color the first 2 lines from the header 96 | if i > 1 && line.starts_with('+') { 97 | stderr.set_color(color.set_fg(Some(Color::Green)))?; 98 | let trimmed = line.trim_end(); 99 | if trimmed.len() < line.len() { 100 | // Trailing whitespace on added lines should be colored red 101 | write!(&mut stderr, "{}", trimmed)?; 102 | stderr.set_color(color.set_bg(Some(Color::Red)))?; 103 | write!(&mut stderr, "{}", &line[trimmed.len()..])?; 104 | color.clear(); 105 | stderr.reset()?; 106 | writeln!(&mut stderr)?; 107 | } else { 108 | writeln!(&mut stderr, "{}", line)?; 109 | } 110 | } else if i > 1 && line.starts_with('-') { 111 | stderr.set_color(color.set_fg(Some(Color::Red)))?; 112 | writeln!(&mut stderr, "{}", line)?; 113 | } else if let Some(stripped_line) = line.strip_prefix("@@") { 114 | // Only color the stuff between the first two instances of "@@" 115 | stderr.set_color(color.set_fg(Some(Color::Cyan)))?; 116 | let end = match stripped_line.find("@@") { 117 | Some(end_shifted) => { 118 | end_shifted + 4 // + 2 for the shift, + 2 to move past the found "@@" 119 | } 120 | None => line.len(), // Color the whole line 121 | }; 122 | write!(&mut stderr, "{}", &line[..end])?; 123 | stderr.reset()?; 124 | writeln!(&mut stderr, "{}", &line[end..])?; 125 | } else { 126 | stderr.reset()?; 127 | writeln!(&mut stderr, "{}", line)?; 128 | } 129 | } 130 | Ok(()) 131 | }; 132 | let res = print_colored_diff(); 133 | // Always try to clean up color settings before returning 134 | stderr.reset()?; // throw away Ok() output 135 | res 136 | } 137 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! # Working with the `resymgen` YAML format 2 | //! 3 | //! This crate contains utilities for working with the YAML configuration files of the `resymgen` 4 | //! (**r**everse **e**ngineering **sym**bol table **gen**erator) command line tool. 5 | //! 6 | //! The top-level library functions implement the subcommands of `resymgen`. That is, they take 7 | //! input files containing symbol data, process the file contents based on specified configuration 8 | //! parameters, and generate output related to the symbol data in the form of console output or 9 | //! files. 10 | //! 11 | //! The [`data_formats`] module defines structures and methods related to parsing and manipulating 12 | //! raw symbol data in various formats. 13 | 14 | mod checks; 15 | pub mod data_formats; 16 | mod formatting; 17 | mod transform; 18 | mod util; 19 | 20 | pub use checks::*; 21 | pub use data_formats::symgen_yml::{IntFormat, LoadParams, SymbolType}; 22 | pub use data_formats::{InFormat, OutFormat}; 23 | pub use formatting::*; 24 | pub use transform::*; 25 | pub use util::*; 26 | -------------------------------------------------------------------------------- /src/util.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::fmt::{self, Display, Formatter}; 3 | use std::fs; 4 | use std::path::Path; 5 | 6 | use tempfile::{NamedTempFile, PersistError}; 7 | 8 | use super::data_formats::symgen_yml::{IntFormat, SymGen}; 9 | 10 | /// Encapsulates a collection of similar errors for different files. 11 | #[derive(Debug)] 12 | pub struct MultiFileError { 13 | pub base_msg: String, 14 | pub errors: Vec<(String, Box)>, 15 | } 16 | 17 | impl Error for MultiFileError {} 18 | 19 | impl Display for MultiFileError { 20 | fn fmt(&self, f: &mut Formatter) -> fmt::Result { 21 | write!(f, "{} [{} file(s)]", self.base_msg, self.errors.len())?; 22 | for (filename, err) in self.errors.iter() { 23 | write!(f, "\n{}: {}", filename, err)?; 24 | } 25 | Ok(()) 26 | } 27 | } 28 | 29 | /// Persist the temporary file at the target path. 30 | /// 31 | /// This wraps `NamedTempFile::persist()` with fallback to manual copying. 32 | /// On some systems, the normal `persist()` might not always work. For example, on Unix 33 | /// systems `persist()` ultimately relies on `std::fs::rename()`: 34 | /// https://github.com/Stebalien/tempfile/blob/66aa57f7d3a38234fcd393077366b61d36171e42/src/file/imp/unix.rs#L131 35 | /// which will fail if the tempfile and target path are not on the same filesystem: 36 | /// https://doc.rust-lang.org/std/fs/fn.rename.html. Since `/tmp` (the normal return value of 37 | /// `std::env::temp_dir()` on Linux) can sometimes be mounted on a separate filesystem, this is 38 | /// a fairly common case. 39 | /// 40 | /// If the normal `persist()` method fails, try manually copying the tempfile to the destination. 41 | /// Unlike `std::fs::rename()`, `std::fs::copy()` works even across filesystems. 42 | pub fn persist_named_temp_file_safe>( 43 | file: NamedTempFile, 44 | new_path: P, 45 | ) -> Result<(), PersistError> { 46 | if let Err(e) = file.persist(&new_path) { 47 | let file = NamedTempFile::from(e); // Grab the file handle again 48 | if let Err(io_err) = fs::copy(file.path(), new_path) { 49 | return Err(PersistError { 50 | error: io_err, 51 | file, 52 | }); 53 | } 54 | } 55 | Ok(()) 56 | } 57 | 58 | /// Recursively write a [`SymGen`] and all its subregions to files, starting with the top-level 59 | /// file path specified by `top_path`, and using the given `int_format`. 60 | pub fn symgen_write_recursive>( 61 | symgen: &SymGen, 62 | top_path: P, 63 | int_format: IntFormat, 64 | ) -> Result<(), Box> { 65 | for cursor in symgen.cursor(top_path.as_ref()).btraverse() { 66 | // Write to a tempfile first, then replace the old one atomically. 67 | let output_file = NamedTempFile::new()?; 68 | cursor.symgen().write(&output_file, int_format)?; 69 | persist_named_temp_file_safe(output_file, cursor.path())?; 70 | } 71 | Ok(()) 72 | } 73 | -------------------------------------------------------------------------------- /symbols/LICENSE.txt: -------------------------------------------------------------------------------- 1 | NOTE: The following license applies only to the files within this directory. 2 | 3 | MIT License 4 | 5 | Copyright (c) 2022 UsernameFodder 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /symbols/overlay00.yml: -------------------------------------------------------------------------------- 1 | overlay0: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x22BD3C0 8 | NA: 0x22BCA80 9 | JP: 0x22BE220 10 | length: 11 | EU: 0x60880 12 | NA: 0x609A0 13 | JP: 0x609A0 14 | description: |- 15 | Likely contains supporting data and code related to the top menu. 16 | 17 | This is loaded together with overlay 1 while in the top menu. Since it's in overlay group 2 (together with overlay 10, which is another "data" overlay), this overlay probably plays a similar role. It mentions several files from the BACK folder that are known backgrounds for the top menu. 18 | functions: 19 | - name: SelectRandomBackground 20 | address: 21 | EU: 0x22BF12C 22 | NA: 0x22BE918 23 | JP: 0x22C00C4 24 | description: |- 25 | Selects a random background from the BACK/s09p04-10a.bgp files to be used as the background for the top menu. 26 | 27 | No params. 28 | data: [] 29 | -------------------------------------------------------------------------------- /symbols/overlay02.yml: -------------------------------------------------------------------------------- 1 | overlay2: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x2329D40 8 | NA: 0x2329520 9 | JP: 0x232ACC0 10 | length: 11 | EU: 0x2AFC0 12 | NA: 0x2AFA0 13 | JP: 0x2AFA0 14 | description: "Controls the Nintendo WFC Settings interface, accessed from the top menu (Other > Nintendo WFC > Nintendo WFC Settings). Presumably contains code for Nintendo Wi-Fi setup." 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay03.yml: -------------------------------------------------------------------------------- 1 | overlay3: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x233D200 8 | NA: 0x233CA80 9 | JP: 0x233E300 10 | length: 11 | EU: 0xA160 12 | NA: 0xA160 13 | JP: 0xA160 14 | description: Controls the Friend Rescue submenu within the top menu. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay04.yml: -------------------------------------------------------------------------------- 1 | overlay4: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x233D200 8 | NA: 0x233CA80 9 | JP: 0x233E300 10 | length: 11 | EU: 0x2BE0 12 | NA: 0x2BE0 13 | JP: 0x2BE0 14 | description: Controls the Trade Items submenu within the top menu. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay05.yml: -------------------------------------------------------------------------------- 1 | overlay5: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x233D200 8 | NA: 0x233CA80 9 | JP: 0x233E300 10 | length: 11 | EU: 0x3240 12 | NA: 0x3240 13 | JP: 0x3260 14 | description: Controls the Trade Team submenu within the top menu. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay06.yml: -------------------------------------------------------------------------------- 1 | overlay6: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x233D200 8 | NA: 0x233CA80 9 | JP: 0x233E300 10 | length: 11 | EU: 0x2460 12 | NA: 0x2460 13 | JP: 0x2460 14 | description: Controls the Wonder Mail S submenu within the top menu. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay07.yml: -------------------------------------------------------------------------------- 1 | overlay7: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x233D200 8 | NA: 0x233CA80 9 | JP: 0x233E300 10 | length: 11 | EU: 0x3300 12 | NA: 0x5100 13 | JP: 0x53E0 14 | description: "Controls the Nintendo WFC submenu within the top menu (under \"Other\")." 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay08.yml: -------------------------------------------------------------------------------- 1 | overlay8: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x233D200 8 | NA: 0x233CA80 9 | JP: 0x233E300 10 | length: 11 | EU: 0x2620 12 | NA: 0x2200 13 | JP: 0x2200 14 | description: "Controls the Send Demo Dungeon submenu within the top menu (under \"Other\")." 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay12.yml: -------------------------------------------------------------------------------- 1 | overlay12: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x20 12 | NA: 0x20 13 | JP: 0x20 14 | description: Unused; all zeroes. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay15.yml: -------------------------------------------------------------------------------- 1 | overlay15: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x1080 12 | NA: 0x1060 13 | JP: 0x1060 14 | description: Controls the Duskull Bank. 15 | functions: [] 16 | data: 17 | - name: BANK_MAIN_MENU_ITEMS 18 | address: 19 | EU: 0x238BBC0 20 | NA: 0x238B054 21 | JP: 0x238C5CC 22 | length: 23 | EU: 0x28 24 | NA: 0x28 25 | JP: 0x28 26 | - name: BANK_WINDOW_PARAMS_1 27 | address: 28 | NA: 0x238B07C 29 | length: 30 | NA: 0x10 31 | description: "Note: unverified, ported from Irdkwia's notes" 32 | - name: BANK_WINDOW_PARAMS_2 33 | address: 34 | EU: 0x238BBF8 35 | NA: 0x238B08C 36 | JP: 0x238C604 37 | length: 38 | EU: 0x10 39 | NA: 0x10 40 | description: "Note: unverified, ported from Irdkwia's notes" 41 | - name: BANK_WINDOW_PARAMS_3 42 | address: 43 | EU: 0x238BC08 44 | NA: 0x238B09C 45 | JP: 0x238C614 46 | length: 47 | EU: 0x10 48 | NA: 0x10 49 | description: "Note: unverified, ported from Irdkwia's notes" 50 | - name: BANK_WINDOW_PARAMS_4 51 | address: 52 | EU: 0x238BC18 53 | NA: 0x238B0AC 54 | JP: 0x238C624 55 | length: 56 | EU: 0x10 57 | NA: 0x10 58 | description: "Note: unverified, ported from Irdkwia's notes" 59 | - name: BANK_WINDOW_PARAMS_5 60 | address: 61 | NA: 0x238B0BC 62 | length: 63 | NA: 0x10 64 | description: "Note: unverified, ported from Irdkwia's notes" 65 | - name: OVERLAY15_RESERVED_SPACE 66 | address: 67 | NA: 0x238B164 68 | length: 69 | NA: 0x1C 70 | description: "Note: unverified, ported from Irdkwia's notes" 71 | - name: OVERLAY15_UNKNOWN_POINTER__NA_238B180 72 | address: 73 | EU: 0x238BCE0 74 | NA: 0x238B180 75 | JP: 0x238C6E0 76 | length: 77 | NA: 0x4 78 | description: "Note: unverified, ported from Irdkwia's notes" 79 | -------------------------------------------------------------------------------- /symbols/overlay16.yml: -------------------------------------------------------------------------------- 1 | overlay16: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x2D20 12 | NA: 0x2D20 13 | JP: 0x2D40 14 | description: Controls Luminous Spring. 15 | functions: [] 16 | data: 17 | - name: EVO_MENU_ITEMS_CONFIRM 18 | address: 19 | EU: 0x238D84C 20 | NA: 0x238CD08 21 | JP: 0x238E288 22 | length: 23 | EU: 0x18 24 | NA: 0x18 25 | JP: 0x18 26 | - name: EVO_SUBMENU_ITEMS 27 | address: 28 | EU: 0x238D864 29 | NA: 0x238CD20 30 | JP: 0x238E2A0 31 | length: 32 | EU: 0x20 33 | NA: 0x20 34 | JP: 0x20 35 | - name: EVO_MAIN_MENU_ITEMS 36 | address: 37 | EU: 0x238D884 38 | NA: 0x238CD40 39 | JP: 0x238E2C0 40 | length: 41 | EU: 0x20 42 | NA: 0x20 43 | JP: 0x20 44 | - name: EVO_MENU_STRING_IDS 45 | address: 46 | NA: 0x238CD60 47 | length: 48 | NA: 0x34 49 | description: |- 50 | 26*0x2 51 | 52 | Note: unverified, ported from Irdkwia's notes 53 | - name: EVO_WINDOW_PARAMS_1 54 | address: 55 | NA: 0x238CD94 56 | length: 57 | NA: 0x10 58 | description: "Note: unverified, ported from Irdkwia's notes" 59 | - name: EVO_WINDOW_PARAMS_2 60 | address: 61 | NA: 0x238CDA4 62 | length: 63 | NA: 0x10 64 | description: "Note: unverified, ported from Irdkwia's notes" 65 | - name: EVO_WINDOW_PARAMS_3 66 | address: 67 | NA: 0x238CDB4 68 | length: 69 | NA: 0x10 70 | description: "Note: unverified, ported from Irdkwia's notes" 71 | - name: EVO_WINDOW_PARAMS_4 72 | address: 73 | EU: 0x238D908 74 | NA: 0x238CDC4 75 | JP: 0x238E344 76 | length: 77 | EU: 0x10 78 | NA: 0x10 79 | description: "Note: unverified, ported from Irdkwia's notes" 80 | - name: EVO_WINDOW_PARAMS_5 81 | address: 82 | EU: 0x238D918 83 | NA: 0x238CDD4 84 | JP: 0x238E354 85 | length: 86 | EU: 0x10 87 | NA: 0x10 88 | description: "Note: unverified, ported from Irdkwia's notes" 89 | - name: EVO_WINDOW_PARAMS_6 90 | address: 91 | EU: 0x238D928 92 | NA: 0x238CDE4 93 | JP: 0x238E364 94 | length: 95 | EU: 0x10 96 | NA: 0x10 97 | description: "Note: unverified, ported from Irdkwia's notes" 98 | - name: EVO_WINDOW_PARAMS_7 99 | address: 100 | NA: 0x238CDF4 101 | length: 102 | NA: 0x10 103 | description: "Note: unverified, ported from Irdkwia's notes" 104 | - name: OVERLAY16_RESERVED_SPACE 105 | address: 106 | NA: 0x238CE34 107 | length: 108 | NA: 0xC 109 | description: "Note: unverified, ported from Irdkwia's notes" 110 | - name: OVERLAY16_UNKNOWN_POINTER__NA_238CE40 111 | address: 112 | EU: 0x238D980 113 | NA: 0x238CE40 114 | JP: 0x238E3C0 115 | length: 116 | NA: 0x4 117 | description: "Note: unverified, ported from Irdkwia's notes" 118 | - name: OVERLAY16_UNKNOWN_POINTER__NA_238CE58 119 | address: 120 | NA: 0x238CE58 121 | length: 122 | NA: 0x4 123 | description: "Note: unverified, ported from Irdkwia's notes" 124 | -------------------------------------------------------------------------------- /symbols/overlay17.yml: -------------------------------------------------------------------------------- 1 | overlay17: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x1CE0 12 | NA: 0x1CE0 13 | JP: 0x1CE0 14 | description: Controls the Chimecho Assembly. 15 | functions: [] 16 | data: 17 | - name: ASSEMBLY_WINDOW_PARAMS_1 18 | address: 19 | EU: 0x238C674 20 | NA: 0x238BB34 21 | JP: 0x238D090 22 | length: 23 | EU: 0x10 24 | NA: 0x10 25 | description: "Note: unverified, ported from Irdkwia's notes" 26 | - name: ASSEMBLY_WINDOW_PARAMS_2 27 | address: 28 | EU: 0x238C684 29 | NA: 0x238BB44 30 | JP: 0x238D0A0 31 | length: 32 | EU: 0x10 33 | NA: 0x10 34 | description: "Note: unverified, ported from Irdkwia's notes" 35 | - name: ASSEMBLY_WINDOW_PARAMS_3 36 | address: 37 | EU: 0x238C694 38 | NA: 0x238BB54 39 | JP: 0x238D0B0 40 | length: 41 | EU: 0x10 42 | NA: 0x10 43 | description: "Note: unverified, ported from Irdkwia's notes" 44 | - name: ASSEMBLY_WINDOW_PARAMS_4 45 | address: 46 | EU: 0x238C6A4 47 | NA: 0x238BB64 48 | JP: 0x238D0C0 49 | length: 50 | EU: 0x10 51 | NA: 0x10 52 | description: "Note: unverified, ported from Irdkwia's notes" 53 | - name: ASSEMBLY_WINDOW_PARAMS_5 54 | address: 55 | EU: 0x238C6B4 56 | NA: 0x238BB74 57 | JP: 0x238D0D0 58 | length: 59 | EU: 0x10 60 | NA: 0x10 61 | description: "Note: unverified, ported from Irdkwia's notes" 62 | - name: ASSEMBLY_MENU_ITEMS_CONFIRM 63 | address: 64 | EU: 0x238C6C4 65 | NA: 0x238BB84 66 | JP: 0x238D0E0 67 | length: 68 | EU: 0x18 69 | NA: 0x18 70 | JP: 0x18 71 | - name: ASSEMBLY_MAIN_MENU_ITEMS_1 72 | address: 73 | EU: 0x238C6DC 74 | NA: 0x238BB9C 75 | JP: 0x238D0F8 76 | length: 77 | EU: 0x18 78 | NA: 0x18 79 | JP: 0x18 80 | - name: ASSEMBLY_MAIN_MENU_ITEMS_2 81 | address: 82 | EU: 0x238C6F4 83 | NA: 0x238BBB4 84 | JP: 0x238D110 85 | length: 86 | EU: 0x20 87 | NA: 0x20 88 | JP: 0x20 89 | - name: ASSEMBLY_SUBMENU_ITEMS_1 90 | address: 91 | EU: 0x238C714 92 | NA: 0x238BBD4 93 | JP: 0x238D130 94 | length: 95 | EU: 0x28 96 | NA: 0x28 97 | JP: 0x28 98 | - name: ASSEMBLY_SUBMENU_ITEMS_2 99 | address: 100 | EU: 0x238C73C 101 | NA: 0x238BBFC 102 | JP: 0x238D158 103 | length: 104 | EU: 0x30 105 | NA: 0x30 106 | JP: 0x30 107 | - name: ASSEMBLY_SUBMENU_ITEMS_3 108 | address: 109 | EU: 0x238C76C 110 | NA: 0x238BC2C 111 | JP: 0x238D188 112 | length: 113 | EU: 0x30 114 | NA: 0x30 115 | JP: 0x30 116 | - name: ASSEMBLY_SUBMENU_ITEMS_4 117 | address: 118 | EU: 0x238C79C 119 | NA: 0x238BC5C 120 | JP: 0x238D1B8 121 | length: 122 | EU: 0x38 123 | NA: 0x38 124 | JP: 0x38 125 | - name: ASSEMBLY_SUBMENU_ITEMS_5 126 | address: 127 | EU: 0x238C7D4 128 | NA: 0x238BC94 129 | JP: 0x238D1F0 130 | length: 131 | EU: 0x38 132 | NA: 0x38 133 | JP: 0x38 134 | - name: ASSEMBLY_SUBMENU_ITEMS_6 135 | address: 136 | EU: 0x238C80C 137 | NA: 0x238BCCC 138 | JP: 0x238D228 139 | length: 140 | EU: 0x38 141 | NA: 0x38 142 | JP: 0x38 143 | - name: ASSEMBLY_SUBMENU_ITEMS_7 144 | address: 145 | EU: 0x238C844 146 | NA: 0x238BD04 147 | JP: 0x238D260 148 | length: 149 | EU: 0x40 150 | NA: 0x40 151 | JP: 0x40 152 | - name: OVERLAY17_FUNCTION_POINTER_TABLE 153 | address: 154 | EU: 0x238C884 155 | NA: 0x238BD44 156 | JP: 0x238D2A0 157 | length: 158 | NA: 0xA8 159 | description: "Note: unverified, ported from Irdkwia's notes" 160 | - name: OVERLAY17_RESERVED_SPACE 161 | address: 162 | NA: 0x238BDEC 163 | length: 164 | NA: 0x14 165 | description: "Note: unverified, ported from Irdkwia's notes" 166 | - name: OVERLAY17_UNKNOWN_POINTER__NA_238BE00 167 | address: 168 | EU: 0x238C940 169 | NA: 0x238BE00 170 | JP: 0x238D360 171 | length: 172 | NA: 0x4 173 | description: "Note: unverified, ported from Irdkwia's notes" 174 | - name: OVERLAY17_UNKNOWN_POINTER__NA_238BE04 175 | address: 176 | NA: 0x238BE04 177 | length: 178 | NA: 0x4 179 | description: "Note: unverified, ported from Irdkwia's notes" 180 | - name: OVERLAY17_UNKNOWN_POINTER__NA_238BE08 181 | address: 182 | NA: 0x238BE08 183 | length: 184 | NA: 0x4 185 | description: "Note: unverified, ported from Irdkwia's notes" 186 | -------------------------------------------------------------------------------- /symbols/overlay18.yml: -------------------------------------------------------------------------------- 1 | overlay18: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x3500 12 | NA: 0x3500 13 | JP: 0x3520 14 | description: Controls the Electivire Link Shop. 15 | functions: [] 16 | data: 17 | - name: LINK_SHOP_WINDOW_PARAMS_1 18 | address: 19 | EU: 0x238DDB0 20 | NA: 0x238D270 21 | JP: 0x238E7DC 22 | length: 23 | EU: 0x10 24 | NA: 0x10 25 | description: "Note: unverified, ported from Irdkwia's notes" 26 | - name: LINK_SHOP_WINDOW_PARAMS_2 27 | address: 28 | EU: 0x238DDC0 29 | NA: 0x238D280 30 | JP: 0x238E7EC 31 | length: 32 | EU: 0x10 33 | NA: 0x10 34 | description: "Note: unverified, ported from Irdkwia's notes" 35 | - name: LINK_SHOP_WINDOW_PARAMS_3 36 | address: 37 | EU: 0x238DDD0 38 | NA: 0x238D290 39 | JP: 0x238E7FC 40 | length: 41 | EU: 0x10 42 | NA: 0x10 43 | description: "Note: unverified, ported from Irdkwia's notes" 44 | - name: LINK_SHOP_WINDOW_PARAMS_4 45 | address: 46 | EU: 0x238DDE0 47 | NA: 0x238D2A0 48 | JP: 0x238E80C 49 | length: 50 | EU: 0x10 51 | NA: 0x10 52 | description: "Note: unverified, ported from Irdkwia's notes" 53 | - name: LINK_SHOP_WINDOW_PARAMS_5 54 | address: 55 | EU: 0x238DDF0 56 | NA: 0x238D2B0 57 | JP: 0x238E81C 58 | length: 59 | EU: 0x10 60 | NA: 0x10 61 | description: "Note: unverified, ported from Irdkwia's notes" 62 | - name: LINK_SHOP_WINDOW_PARAMS_6 63 | address: 64 | EU: 0x238DE00 65 | NA: 0x238D2C0 66 | JP: 0x238E82C 67 | length: 68 | EU: 0x10 69 | NA: 0x10 70 | description: "Note: unverified, ported from Irdkwia's notes" 71 | - name: LINK_SHOP_WINDOW_PARAMS_7 72 | address: 73 | EU: 0x238DE10 74 | NA: 0x238D2D0 75 | JP: 0x238E83C 76 | length: 77 | EU: 0x10 78 | NA: 0x10 79 | description: "Note: unverified, ported from Irdkwia's notes" 80 | - name: LINK_SHOP_WINDOW_PARAMS_8 81 | address: 82 | EU: 0x238DE20 83 | NA: 0x238D2E0 84 | JP: 0x238E84C 85 | length: 86 | EU: 0x10 87 | NA: 0x10 88 | description: "Note: unverified, ported from Irdkwia's notes" 89 | - name: LINK_SHOP_WINDOW_PARAMS_9 90 | address: 91 | EU: 0x238DE30 92 | NA: 0x238D2F0 93 | JP: 0x238E85C 94 | length: 95 | EU: 0x10 96 | NA: 0x10 97 | description: "Note: unverified, ported from Irdkwia's notes" 98 | - name: LINK_SHOP_WINDOW_PARAMS_10 99 | address: 100 | EU: 0x238DE40 101 | NA: 0x238D300 102 | JP: 0x238E86C 103 | length: 104 | EU: 0x10 105 | NA: 0x10 106 | description: "Note: unverified, ported from Irdkwia's notes" 107 | - name: LINK_SHOP_WINDOW_PARAMS_11 108 | address: 109 | EU: 0x238DE50 110 | NA: 0x238D310 111 | JP: 0x238E87C 112 | length: 113 | EU: 0x10 114 | NA: 0x10 115 | description: "Note: unverified, ported from Irdkwia's notes" 116 | - name: LINK_SHOP_MENU_ITEMS_CONFIRM 117 | address: 118 | EU: 0x238DE60 119 | NA: 0x238D320 120 | JP: 0x238E88C 121 | length: 122 | EU: 0x18 123 | NA: 0x18 124 | JP: 0x18 125 | - name: LINK_SHOP_SUBMENU_ITEMS_1 126 | address: 127 | EU: 0x238DE78 128 | NA: 0x238D338 129 | JP: 0x238E8A4 130 | length: 131 | EU: 0x20 132 | NA: 0x20 133 | JP: 0x20 134 | - name: LINK_SHOP_SUBMENU_ITEMS_2 135 | address: 136 | EU: 0x238DE98 137 | NA: 0x238D358 138 | JP: 0x238E8C4 139 | length: 140 | EU: 0x20 141 | NA: 0x20 142 | JP: 0x20 143 | - name: LINK_SHOP_MAIN_MENU_ITEMS 144 | address: 145 | EU: 0x238DEB8 146 | NA: 0x238D378 147 | JP: 0x238E8E4 148 | length: 149 | EU: 0x20 150 | NA: 0x20 151 | JP: 0x20 152 | - name: LINK_SHOP_SUBMENU_ITEMS_3 153 | address: 154 | EU: 0x238DED8 155 | NA: 0x238D398 156 | JP: 0x238E904 157 | length: 158 | EU: 0x28 159 | NA: 0x28 160 | JP: 0x28 161 | - name: LINK_SHOP_SUBMENU_ITEMS_4 162 | address: 163 | EU: 0x238DF00 164 | NA: 0x238D3C0 165 | JP: 0x238E92C 166 | length: 167 | EU: 0x30 168 | NA: 0x30 169 | JP: 0x30 170 | - name: LINK_SHOP_SUBMENU_ITEMS_5 171 | address: 172 | EU: 0x238DF30 173 | NA: 0x238D3F0 174 | JP: 0x238E95C 175 | length: 176 | EU: 0x48 177 | NA: 0x48 178 | JP: 0x48 179 | - name: LINK_SHOP_SUBMENU_ITEMS_6 180 | address: 181 | EU: 0x238DF78 182 | NA: 0x238D438 183 | JP: 0x238E9A4 184 | length: 185 | EU: 0x48 186 | NA: 0x48 187 | JP: 0x48 188 | - name: LINK_SHOP_SUBMENU_ITEMS_7 189 | address: 190 | EU: 0x238DFC0 191 | NA: 0x238D480 192 | JP: 0x238E9EC 193 | length: 194 | EU: 0x48 195 | NA: 0x48 196 | JP: 0x48 197 | - name: OVERLAY18_FUNCTION_POINTER_TABLE 198 | address: 199 | EU: 0x238E008 200 | NA: 0x238D4C8 201 | JP: 0x238EA34 202 | length: 203 | NA: 0x130 204 | description: "Note: unverified, ported from Irdkwia's notes" 205 | - name: OVERLAY18_RESERVED_SPACE 206 | address: 207 | NA: 0x238D61C 208 | length: 209 | NA: 0x4 210 | description: "Note: unverified, ported from Irdkwia's notes" 211 | - name: OVERLAY18_UNKNOWN_POINTER__NA_238D620 212 | address: 213 | EU: 0x238E160 214 | NA: 0x238D620 215 | JP: 0x238EBA0 216 | length: 217 | NA: 0x4 218 | description: "Note: unverified, ported from Irdkwia's notes" 219 | - name: OVERLAY18_UNKNOWN_POINTER__NA_238D624 220 | address: 221 | NA: 0x238D624 222 | length: 223 | NA: 0x4 224 | description: "Note: unverified, ported from Irdkwia's notes" 225 | - name: OVERLAY18_UNKNOWN_POINTER__NA_238D628 226 | address: 227 | NA: 0x238D628 228 | length: 229 | NA: 0x4 230 | description: "Note: unverified, ported from Irdkwia's notes" 231 | -------------------------------------------------------------------------------- /symbols/overlay19.yml: -------------------------------------------------------------------------------- 1 | overlay19: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x4220 12 | NA: 0x4240 13 | JP: 0x4220 14 | description: "Controls Spinda's Juice Bar." 15 | functions: 16 | - name: GetBarItem 17 | address: 18 | EU: 0x238AC80 19 | NA: 0x238A140 20 | JP: 0x238B6A0 21 | description: |- 22 | Gets the struct bar_item from BAR_AVAILABLE_ITEMS with the specified item ID. 23 | 24 | r0: item ID 25 | return: struct bar_item* 26 | - name: GetRecruitableMonsterAll 27 | address: 28 | EU: 0x238AD04 29 | NA: 0x238A1C4 30 | JP: 0x238B724 31 | description: |- 32 | Note: unverified, ported from Irdkwia's notes 33 | 34 | return: int? 35 | - name: GetRecruitableMonsterList 36 | address: 37 | EU: 0x238ADB4 38 | NA: 0x238A274 39 | JP: 0x238B7D4 40 | description: |- 41 | Note: unverified, ported from Irdkwia's notes 42 | 43 | return: int? 44 | - name: GetRecruitableMonsterListRestricted 45 | address: 46 | EU: 0x238AE5C 47 | NA: 0x238A31C 48 | JP: 0x238B87C 49 | description: |- 50 | Note: unverified, ported from Irdkwia's notes 51 | 52 | return: int? 53 | data: 54 | - name: OVERLAY19_UNKNOWN_TABLE__NA_238DAE0 55 | address: 56 | EU: 0x238E614 57 | NA: 0x238DAE0 58 | JP: 0x238F038 59 | length: 60 | NA: 0x8 61 | description: |- 62 | 4*0x2 63 | 64 | Note: unverified, ported from Irdkwia's notes 65 | - name: BAR_UNLOCKABLE_DUNGEONS_TABLE 66 | address: 67 | EU: 0x238E61C 68 | NA: 0x238DAE8 69 | JP: 0x238F040 70 | length: 71 | NA: 0xC 72 | description: |- 73 | Note: unverified, ported from Irdkwia's notes 74 | 75 | type: struct dungeon_id_16[6] 76 | - name: BAR_RECRUITABLE_MONSTER_TABLE 77 | address: 78 | EU: 0x238E628 79 | NA: 0x238DAF4 80 | JP: 0x238F04C 81 | length: 82 | NA: 0xD8 83 | JP: 0xD8 84 | description: |- 85 | Note: unverified, ported from Irdkwia's notes 86 | 87 | type: struct monster_id_16[108] 88 | - name: BAR_AVAILABLE_ITEMS 89 | address: 90 | EU: 0x238E700 91 | NA: 0x238DBCC 92 | JP: 0x238F124 93 | length: 94 | NA: 0x5AC 95 | description: |- 96 | Note: unverified, ported from Irdkwia's notes 97 | 98 | type: struct bar_item[66] 99 | - name: OVERLAY19_UNKNOWN_STRING_IDS__NA_238E178 100 | address: 101 | EU: 0x238ECAC 102 | NA: 0x238E178 103 | JP: 0x238F6D0 104 | length: 105 | NA: 0x2C 106 | description: "Note: unverified, ported from Irdkwia's notes" 107 | - name: OVERLAY19_UNKNOWN_STRUCT__NA_238E1A4 108 | address: 109 | EU: 0x238ECD8 110 | NA: 0x238E1A4 111 | JP: 0x238F6FC 112 | length: 113 | NA: 0x28 114 | description: |- 115 | 5*0x8 116 | 117 | Note: unverified, ported from Irdkwia's notes 118 | - name: OVERLAY19_UNKNOWN_STRING_IDS__NA_238E1CC 119 | address: 120 | EU: 0x238ED00 121 | NA: 0x238E1CC 122 | JP: 0x238F724 123 | length: 124 | NA: 0xC 125 | description: "Note: unverified, ported from Irdkwia's notes" 126 | - name: BAR_WINDOW_PARAMS_1 127 | address: 128 | EU: 0x238ED0C 129 | NA: 0x238E1D8 130 | JP: 0x238F730 131 | length: 132 | EU: 0x10 133 | NA: 0x10 134 | description: "Note: unverified, ported from Irdkwia's notes" 135 | - name: BAR_WINDOW_PARAMS_2 136 | address: 137 | EU: 0x238ED1C 138 | NA: 0x238E1E8 139 | JP: 0x238F740 140 | length: 141 | EU: 0x10 142 | NA: 0x10 143 | description: "Note: unverified, ported from Irdkwia's notes" 144 | - name: BAR_WINDOW_PARAMS_3 145 | address: 146 | EU: 0x238ED2C 147 | NA: 0x238E1F8 148 | JP: 0x238F750 149 | length: 150 | EU: 0x10 151 | NA: 0x10 152 | description: "Note: unverified, ported from Irdkwia's notes" 153 | - name: BAR_MENU_ITEMS_CONFIRM_1 154 | address: 155 | EU: 0x238ED3C 156 | NA: 0x238E208 157 | JP: 0x238F760 158 | length: 159 | EU: 0x18 160 | NA: 0x18 161 | JP: 0x18 162 | - name: BAR_MENU_ITEMS_CONFIRM_2 163 | address: 164 | EU: 0x238ED54 165 | NA: 0x238E220 166 | JP: 0x238F778 167 | length: 168 | EU: 0x18 169 | NA: 0x18 170 | JP: 0x18 171 | - name: OVERLAY19_UNKNOWN_STRING_IDS__NA_238E238 172 | address: 173 | EU: 0x238ED6C 174 | NA: 0x238E238 175 | JP: 0x238F790 176 | length: 177 | NA: 0x18 178 | description: "Note: unverified, ported from Irdkwia's notes" 179 | - name: BAR_MAIN_MENU_ITEMS 180 | address: 181 | EU: 0x238ED84 182 | NA: 0x238E250 183 | JP: 0x238F7A8 184 | length: 185 | EU: 0x20 186 | NA: 0x20 187 | JP: 0x20 188 | - name: BAR_SUBMENU_ITEMS_1 189 | address: 190 | EU: 0x238EDA4 191 | NA: 0x238E270 192 | JP: 0x238F7C8 193 | length: 194 | EU: 0x20 195 | NA: 0x20 196 | JP: 0x20 197 | - name: BAR_SUBMENU_ITEMS_2 198 | address: 199 | EU: 0x238EDC4 200 | NA: 0x238E290 201 | JP: 0x238F7E8 202 | length: 203 | EU: 0x30 204 | NA: 0x30 205 | JP: 0x30 206 | - name: OVERLAY19_RESERVED_SPACE 207 | address: 208 | NA: 0x238E344 209 | length: 210 | NA: 0x1C 211 | description: "Note: unverified, ported from Irdkwia's notes" 212 | - name: OVERLAY19_UNKNOWN_POINTER__NA_238E360 213 | address: 214 | EU: 0x238EE80 215 | NA: 0x238E360 216 | JP: 0x238F8A0 217 | length: 218 | NA: 0x4 219 | description: "Note: unverified, ported from Irdkwia's notes" 220 | - name: OVERLAY19_UNKNOWN_POINTER__NA_238E364 221 | address: 222 | NA: 0x238E364 223 | length: 224 | NA: 0x4 225 | description: "Note: unverified, ported from Irdkwia's notes" 226 | -------------------------------------------------------------------------------- /symbols/overlay21.yml: -------------------------------------------------------------------------------- 1 | overlay21: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x2E20 12 | NA: 0x2E20 13 | JP: 0x2E40 14 | description: Controls the Croagunk Swap Shop. 15 | functions: [] 16 | data: 17 | - name: SWAP_SHOP_WINDOW_PARAMS_1 18 | address: 19 | EU: 0x238D568 20 | NA: 0x238CA28 21 | JP: 0x238DF98 22 | length: 23 | EU: 0x10 24 | NA: 0x10 25 | description: "Note: unverified, ported from Irdkwia's notes" 26 | - name: SWAP_SHOP_MENU_ITEMS_CONFIRM 27 | address: 28 | EU: 0x238D578 29 | NA: 0x238CA38 30 | JP: 0x238DFA8 31 | length: 32 | EU: 0x18 33 | NA: 0x18 34 | JP: 0x18 35 | - name: SWAP_SHOP_SUBMENU_ITEMS_1 36 | address: 37 | EU: 0x238D590 38 | NA: 0x238CA50 39 | JP: 0x238DFC0 40 | length: 41 | EU: 0x18 42 | NA: 0x18 43 | JP: 0x18 44 | - name: SWAP_SHOP_SUBMENU_ITEMS_2 45 | address: 46 | EU: 0x238D5A8 47 | NA: 0x238CA68 48 | JP: 0x238DFD8 49 | length: 50 | EU: 0x20 51 | NA: 0x20 52 | JP: 0x20 53 | - name: SWAP_SHOP_MAIN_MENU_ITEMS_1 54 | address: 55 | EU: 0x238D5C8 56 | NA: 0x238CA88 57 | JP: 0x238DFF8 58 | length: 59 | EU: 0x20 60 | NA: 0x20 61 | JP: 0x20 62 | - name: SWAP_SHOP_MAIN_MENU_ITEMS_2 63 | address: 64 | EU: 0x238D5E8 65 | NA: 0x238CAA8 66 | JP: 0x238E018 67 | length: 68 | EU: 0x28 69 | NA: 0x28 70 | JP: 0x28 71 | - name: SWAP_SHOP_SUBMENU_ITEMS_3 72 | address: 73 | EU: 0x238D610 74 | NA: 0x238CAD0 75 | JP: 0x238E040 76 | length: 77 | EU: 0x30 78 | NA: 0x30 79 | JP: 0x30 80 | - name: OVERLAY21_UNKNOWN_STRING_IDS 81 | address: 82 | NA: 0x238CB00 83 | length: 84 | NA: 0x38 85 | description: "Note: unverified, ported from Irdkwia's notes" 86 | - name: SWAP_SHOP_WINDOW_PARAMS_2 87 | address: 88 | NA: 0x238CB38 89 | length: 90 | NA: 0x10 91 | description: "Note: unverified, ported from Irdkwia's notes" 92 | - name: SWAP_SHOP_WINDOW_PARAMS_3 93 | address: 94 | NA: 0x238CB48 95 | length: 96 | NA: 0x10 97 | description: "Note: unverified, ported from Irdkwia's notes" 98 | - name: SWAP_SHOP_WINDOW_PARAMS_4 99 | address: 100 | NA: 0x238CB58 101 | length: 102 | NA: 0x10 103 | description: "Note: unverified, ported from Irdkwia's notes" 104 | - name: SWAP_SHOP_WINDOW_PARAMS_5 105 | address: 106 | EU: 0x238D6A8 107 | NA: 0x238CB68 108 | JP: 0x238E0D8 109 | length: 110 | EU: 0x10 111 | NA: 0x10 112 | description: "Note: unverified, ported from Irdkwia's notes" 113 | - name: SWAP_SHOP_WINDOW_PARAMS_6 114 | address: 115 | EU: 0x238D6B8 116 | NA: 0x238CB78 117 | JP: 0x238E0E8 118 | length: 119 | EU: 0x10 120 | NA: 0x10 121 | description: "Note: unverified, ported from Irdkwia's notes" 122 | - name: SWAP_SHOP_WINDOW_PARAMS_7 123 | address: 124 | EU: 0x238D6C8 125 | NA: 0x238CB88 126 | JP: 0x238E0F8 127 | length: 128 | EU: 0x10 129 | NA: 0x10 130 | description: "Note: unverified, ported from Irdkwia's notes" 131 | - name: SWAP_SHOP_WINDOW_PARAMS_8 132 | address: 133 | EU: 0x238D6D8 134 | NA: 0x238CB98 135 | JP: 0x238E108 136 | length: 137 | EU: 0x10 138 | NA: 0x10 139 | description: "Note: unverified, ported from Irdkwia's notes" 140 | - name: SWAP_SHOP_WINDOW_PARAMS_9 141 | address: 142 | EU: 0x238D6E8 143 | NA: 0x238CBA8 144 | JP: 0x238E118 145 | length: 146 | EU: 0x10 147 | NA: 0x10 148 | description: "Note: unverified, ported from Irdkwia's notes" 149 | - name: OVERLAY21_JP_STRING 150 | address: 151 | EU: 0x238DA5C 152 | NA: 0x238CF1C 153 | JP: 0x238E48C 154 | length: 155 | NA: 0x8 156 | description: 合成: 157 | - name: OVERLAY21_RESERVED_SPACE 158 | address: 159 | NA: 0x238CF38 160 | length: 161 | NA: 0x8 162 | description: "Note: unverified, ported from Irdkwia's notes" 163 | - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF40 164 | address: 165 | EU: 0x238DA80 166 | NA: 0x238CF40 167 | JP: 0x238E4C0 168 | length: 169 | NA: 0x4 170 | description: "Note: unverified, ported from Irdkwia's notes" 171 | - name: OVERLAY21_UNKNOWN_POINTER__NA_238CF44 172 | address: 173 | NA: 0x238CF44 174 | length: 175 | NA: 0x4 176 | description: "Note: unverified, ported from Irdkwia's notes" 177 | -------------------------------------------------------------------------------- /symbols/overlay22.yml: -------------------------------------------------------------------------------- 1 | overlay22: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x4B40 12 | NA: 0x4B40 13 | JP: 0x4B40 14 | description: Controls the Kecleon Shop in Treasure Town. 15 | functions: [] 16 | data: 17 | - name: SHOP_WINDOW_PARAMS_1 18 | address: 19 | EU: 0x238F35C 20 | NA: 0x238E81C 21 | JP: 0x238FD7C 22 | length: 23 | EU: 0x10 24 | NA: 0x10 25 | description: "Note: unverified, ported from Irdkwia's notes" 26 | - name: SHOP_WINDOW_PARAMS_2 27 | address: 28 | EU: 0x238F37C 29 | NA: 0x238E83C 30 | JP: 0x238FD9C 31 | length: 32 | EU: 0x10 33 | NA: 0x10 34 | description: "Note: unverified, ported from Irdkwia's notes" 35 | - name: OVERLAY22_UNKNOWN_STRUCT__NA_238E85C 36 | address: 37 | EU: 0x238F39C 38 | NA: 0x238E85C 39 | JP: 0x238FDBC 40 | length: 41 | NA: 0xC 42 | description: "Note: unverified, ported from Irdkwia's notes" 43 | - name: SHOP_MENU_ITEMS_CONFIRM 44 | address: 45 | EU: 0x238F3A8 46 | NA: 0x238E868 47 | JP: 0x238FDC8 48 | length: 49 | EU: 0x18 50 | NA: 0x18 51 | JP: 0x18 52 | - name: SHOP_MAIN_MENU_ITEMS_1 53 | address: 54 | EU: 0x238F3C0 55 | NA: 0x238E880 56 | JP: 0x238FDE0 57 | length: 58 | EU: 0x20 59 | NA: 0x20 60 | JP: 0x20 61 | - name: SHOP_MAIN_MENU_ITEMS_2 62 | address: 63 | EU: 0x238F3E0 64 | NA: 0x238E8A0 65 | JP: 0x238FE00 66 | length: 67 | EU: 0x20 68 | NA: 0x20 69 | JP: 0x20 70 | - name: SHOP_MAIN_MENU_ITEMS_3 71 | address: 72 | EU: 0x238F400 73 | NA: 0x238E8C0 74 | JP: 0x238FE20 75 | length: 76 | EU: 0x30 77 | NA: 0x30 78 | JP: 0x30 79 | - name: OVERLAY22_UNKNOWN_STRING_IDS 80 | address: 81 | EU: 0x238F430 82 | NA: 0x238E8F0 83 | JP: 0x238FE50 84 | length: 85 | NA: 0x60 86 | description: "Note: unverified, ported from Irdkwia's notes" 87 | - name: SHOP_WINDOW_PARAMS_3 88 | address: 89 | NA: 0x238E950 90 | length: 91 | NA: 0x10 92 | description: "Note: unverified, ported from Irdkwia's notes" 93 | - name: SHOP_WINDOW_PARAMS_4 94 | address: 95 | NA: 0x238E960 96 | length: 97 | NA: 0x10 98 | description: "Note: unverified, ported from Irdkwia's notes" 99 | - name: SHOP_WINDOW_PARAMS_5 100 | address: 101 | NA: 0x238E970 102 | length: 103 | NA: 0x10 104 | description: "Note: unverified, ported from Irdkwia's notes" 105 | - name: SHOP_WINDOW_PARAMS_6 106 | address: 107 | EU: 0x238F4C0 108 | NA: 0x238E980 109 | JP: 0x238FEE0 110 | length: 111 | EU: 0x10 112 | NA: 0x10 113 | description: "Note: unverified, ported from Irdkwia's notes" 114 | - name: SHOP_WINDOW_PARAMS_7 115 | address: 116 | EU: 0x238F4D0 117 | NA: 0x238E990 118 | JP: 0x238FEF0 119 | length: 120 | EU: 0x10 121 | NA: 0x10 122 | description: "Note: unverified, ported from Irdkwia's notes" 123 | - name: SHOP_WINDOW_PARAMS_8 124 | address: 125 | EU: 0x238F4E0 126 | NA: 0x238E9A0 127 | JP: 0x238FF00 128 | length: 129 | EU: 0x10 130 | NA: 0x10 131 | description: "Note: unverified, ported from Irdkwia's notes" 132 | - name: SHOP_WINDOW_PARAMS_9 133 | address: 134 | EU: 0x238F4F0 135 | NA: 0x238E9B0 136 | JP: 0x238FF10 137 | length: 138 | EU: 0x10 139 | NA: 0x10 140 | description: "Note: unverified, ported from Irdkwia's notes" 141 | - name: SHOP_WINDOW_PARAMS_10 142 | address: 143 | EU: 0x238F500 144 | NA: 0x238E9C0 145 | JP: 0x238FF20 146 | length: 147 | EU: 0x10 148 | NA: 0x10 149 | description: "Note: unverified, ported from Irdkwia's notes" 150 | - name: OVERLAY22_RESERVED_SPACE 151 | address: 152 | NA: 0x238EC58 153 | length: 154 | NA: 0x8 155 | description: "Note: unverified, ported from Irdkwia's notes" 156 | - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC60 157 | address: 158 | EU: 0x238F7A0 159 | NA: 0x238EC60 160 | JP: 0x23901C0 161 | length: 162 | NA: 0x4 163 | description: "Note: unverified, ported from Irdkwia's notes" 164 | - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC64 165 | address: 166 | NA: 0x238EC64 167 | length: 168 | NA: 0x4 169 | description: "Note: unverified, ported from Irdkwia's notes" 170 | - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC68 171 | address: 172 | EU: 0x238F7A8 173 | NA: 0x238EC68 174 | JP: 0x23901C8 175 | length: 176 | NA: 0x4 177 | description: "Note: unverified, ported from Irdkwia's notes" 178 | - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC6C 179 | address: 180 | NA: 0x238EC6C 181 | length: 182 | NA: 0x4 183 | description: "Note: unverified, ported from Irdkwia's notes" 184 | - name: OVERLAY22_UNKNOWN_POINTER__NA_238EC70 185 | address: 186 | EU: 0x238F7B0 187 | NA: 0x238EC70 188 | JP: 0x23901D0 189 | length: 190 | NA: 0x4 191 | description: "Note: unverified, ported from Irdkwia's notes" 192 | -------------------------------------------------------------------------------- /symbols/overlay23.yml: -------------------------------------------------------------------------------- 1 | overlay23: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x3780 12 | NA: 0x3780 13 | JP: 0x37E0 14 | description: Controls Kangaskhan Storage (both in Treasure Town and via Kangaskhan Rocks). 15 | functions: [] 16 | data: 17 | - name: OVERLAY23_UNKNOWN_VALUE__NA_238D2E8 18 | address: 19 | EU: 0x238DE28 20 | NA: 0x238D2E8 21 | JP: 0x238E8A0 22 | length: 23 | NA: 0x4 24 | description: "Note: unverified, ported from Irdkwia's notes" 25 | - name: OVERLAY23_UNKNOWN_VALUE__NA_238D2EC 26 | address: 27 | EU: 0x238DE2C 28 | NA: 0x238D2EC 29 | JP: 0x238E8A4 30 | length: 31 | NA: 0x4 32 | description: "Note: unverified, ported from Irdkwia's notes" 33 | - name: OVERLAY23_UNKNOWN_STRUCT__NA_238D2F0 34 | address: 35 | EU: 0x238DE30 36 | NA: 0x238D2F0 37 | JP: 0x238E8A8 38 | length: 39 | NA: 0xC 40 | description: "Note: unverified, ported from Irdkwia's notes" 41 | - name: STORAGE_MENU_ITEMS_CONFIRM 42 | address: 43 | EU: 0x238DE3C 44 | NA: 0x238D2FC 45 | JP: 0x238E8B4 46 | length: 47 | EU: 0x18 48 | NA: 0x18 49 | JP: 0x18 50 | - name: STORAGE_MAIN_MENU_ITEMS_1 51 | address: 52 | EU: 0x238DE54 53 | NA: 0x238D314 54 | JP: 0x238E8CC 55 | length: 56 | EU: 0x20 57 | NA: 0x20 58 | JP: 0x20 59 | - name: STORAGE_MAIN_MENU_ITEMS_2 60 | address: 61 | EU: 0x238DE74 62 | NA: 0x238D334 63 | JP: 0x238E8EC 64 | length: 65 | EU: 0x20 66 | NA: 0x20 67 | JP: 0x20 68 | - name: STORAGE_MAIN_MENU_ITEMS_3 69 | address: 70 | EU: 0x238DE94 71 | NA: 0x238D354 72 | JP: 0x238E90C 73 | length: 74 | EU: 0x20 75 | NA: 0x20 76 | JP: 0x20 77 | - name: STORAGE_MAIN_MENU_ITEMS_4 78 | address: 79 | EU: 0x238DEB4 80 | NA: 0x238D374 81 | JP: 0x238E92C 82 | length: 83 | EU: 0x28 84 | NA: 0x28 85 | JP: 0x28 86 | - name: OVERLAY23_UNKNOWN_STRING_IDS 87 | address: 88 | NA: 0x238D39C 89 | length: 90 | NA: 0x2C 91 | description: "Note: unverified, ported from Irdkwia's notes" 92 | - name: STORAGE_WINDOW_PARAMS_1 93 | address: 94 | NA: 0x238D3C8 95 | length: 96 | NA: 0x10 97 | description: "Note: unverified, ported from Irdkwia's notes" 98 | - name: STORAGE_WINDOW_PARAMS_2 99 | address: 100 | NA: 0x238D3D8 101 | length: 102 | NA: 0x10 103 | description: "Note: unverified, ported from Irdkwia's notes" 104 | - name: STORAGE_WINDOW_PARAMS_3 105 | address: 106 | NA: 0x238D3E8 107 | length: 108 | NA: 0x10 109 | description: "Note: unverified, ported from Irdkwia's notes" 110 | - name: STORAGE_WINDOW_PARAMS_4 111 | address: 112 | EU: 0x238DF38 113 | NA: 0x238D3F8 114 | JP: 0x238E9B0 115 | length: 116 | EU: 0x10 117 | NA: 0x10 118 | description: "Note: unverified, ported from Irdkwia's notes" 119 | - name: STORAGE_WINDOW_PARAMS_5 120 | address: 121 | EU: 0x238DF48 122 | NA: 0x238D408 123 | JP: 0x238E9C0 124 | length: 125 | EU: 0x10 126 | NA: 0x10 127 | description: "Note: unverified, ported from Irdkwia's notes" 128 | - name: STORAGE_WINDOW_PARAMS_6 129 | address: 130 | EU: 0x238DF58 131 | NA: 0x238D418 132 | JP: 0x238E9D0 133 | length: 134 | EU: 0x10 135 | NA: 0x10 136 | description: "Note: unverified, ported from Irdkwia's notes" 137 | - name: STORAGE_WINDOW_PARAMS_7 138 | address: 139 | EU: 0x238DF68 140 | NA: 0x238D428 141 | JP: 0x238E9E0 142 | length: 143 | EU: 0x10 144 | NA: 0x10 145 | description: "Note: unverified, ported from Irdkwia's notes" 146 | - name: STORAGE_WINDOW_PARAMS_8 147 | address: 148 | EU: 0x238DF78 149 | NA: 0x238D438 150 | JP: 0x238E9F0 151 | length: 152 | EU: 0x10 153 | NA: 0x10 154 | description: "Note: unverified, ported from Irdkwia's notes" 155 | - name: OVERLAY23_RESERVED_SPACE 156 | address: 157 | NA: 0x238D888 158 | length: 159 | NA: 0x18 160 | description: "Note: unverified, ported from Irdkwia's notes" 161 | - name: OVERLAY23_UNKNOWN_POINTER__NA_238D8A0 162 | address: 163 | EU: 0x238E3E0 164 | NA: 0x238D8A0 165 | JP: 0x238EE60 166 | length: 167 | NA: 0x4 168 | description: "Note: unverified, ported from Irdkwia's notes" 169 | -------------------------------------------------------------------------------- /symbols/overlay24.yml: -------------------------------------------------------------------------------- 1 | overlay24: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x24E0 12 | NA: 0x24E0 13 | JP: 0x24E0 14 | description: Controls the Chansey Day Care. 15 | functions: [] 16 | data: 17 | - name: OVERLAY24_UNKNOWN_STRUCT__NA_238C508 18 | address: 19 | EU: 0x238D048 20 | NA: 0x238C508 21 | JP: 0x238DA70 22 | length: 23 | NA: 0xC 24 | description: "Note: unverified, ported from Irdkwia's notes" 25 | - name: OVERLAY24_UNKNOWN_STRUCT__NA_238C514 26 | address: 27 | EU: 0x238D054 28 | NA: 0x238C514 29 | JP: 0x238DA7C 30 | length: 31 | NA: 0xC 32 | description: "Note: unverified, ported from Irdkwia's notes" 33 | - name: DAYCARE_MENU_ITEMS_CONFIRM 34 | address: 35 | EU: 0x238D060 36 | NA: 0x238C520 37 | JP: 0x238DA88 38 | length: 39 | EU: 0x18 40 | NA: 0x18 41 | JP: 0x18 42 | - name: DAYCARE_MAIN_MENU_ITEMS 43 | address: 44 | EU: 0x238D078 45 | NA: 0x238C538 46 | JP: 0x238DAA0 47 | length: 48 | EU: 0x20 49 | NA: 0x20 50 | JP: 0x20 51 | - name: OVERLAY24_UNKNOWN_STRING_IDS 52 | address: 53 | NA: 0x238C558 54 | length: 55 | NA: 0x38 56 | description: "Note: unverified, ported from Irdkwia's notes" 57 | - name: DAYCARE_WINDOW_PARAMS_1 58 | address: 59 | NA: 0x238C590 60 | length: 61 | NA: 0x10 62 | description: "Note: unverified, ported from Irdkwia's notes" 63 | - name: DAYCARE_WINDOW_PARAMS_2 64 | address: 65 | NA: 0x238C5A0 66 | length: 67 | NA: 0x10 68 | description: "Note: unverified, ported from Irdkwia's notes" 69 | - name: DAYCARE_WINDOW_PARAMS_3 70 | address: 71 | NA: 0x238C5B0 72 | length: 73 | NA: 0x10 74 | description: "Note: unverified, ported from Irdkwia's notes" 75 | - name: DAYCARE_WINDOW_PARAMS_4 76 | address: 77 | EU: 0x238D100 78 | NA: 0x238C5C0 79 | JP: 0x238DB28 80 | length: 81 | EU: 0x10 82 | NA: 0x10 83 | description: "Note: unverified, ported from Irdkwia's notes" 84 | - name: DAYCARE_WINDOW_PARAMS_5 85 | address: 86 | NA: 0x238C5D0 87 | length: 88 | NA: 0x10 89 | description: "Note: unverified, ported from Irdkwia's notes" 90 | - name: OVERLAY24_RESERVED_SPACE 91 | address: 92 | NA: 0x238C5E0 93 | length: 94 | NA: 0x20 95 | description: "Note: unverified, ported from Irdkwia's notes" 96 | - name: OVERLAY24_UNKNOWN_POINTER__NA_238C600 97 | address: 98 | EU: 0x238D140 99 | NA: 0x238C600 100 | JP: 0x238DB60 101 | length: 102 | NA: 0x4 103 | description: "Note: unverified, ported from Irdkwia's notes" 104 | -------------------------------------------------------------------------------- /symbols/overlay25.yml: -------------------------------------------------------------------------------- 1 | overlay25: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x14C0 12 | NA: 0x14C0 13 | JP: 0x14C0 14 | description: Controls Xatu Appraisal. 15 | functions: [] 16 | data: 17 | - name: OVERLAY25_UNKNOWN_STRUCT__NA_238B498 18 | address: 19 | EU: 0x238BFD8 20 | NA: 0x238B498 21 | JP: 0x238C9F8 22 | length: 23 | NA: 0xC 24 | description: "Note: unverified, ported from Irdkwia's notes" 25 | - name: APPRAISAL_WINDOW_PARAMS_1 26 | address: 27 | EU: 0x238BFE4 28 | NA: 0x238B4A4 29 | JP: 0x238CA04 30 | length: 31 | EU: 0x10 32 | NA: 0x10 33 | description: "Note: unverified, ported from Irdkwia's notes" 34 | - name: APPRAISAL_MENU_ITEMS_CONFIRM 35 | address: 36 | EU: 0x238BFF4 37 | NA: 0x238B4B4 38 | JP: 0x238CA14 39 | length: 40 | EU: 0x18 41 | NA: 0x18 42 | JP: 0x18 43 | - name: APPRAISAL_MAIN_MENU_ITEMS 44 | address: 45 | EU: 0x238C00C 46 | NA: 0x238B4CC 47 | JP: 0x238CA2C 48 | length: 49 | EU: 0x20 50 | NA: 0x20 51 | JP: 0x20 52 | - name: APPRAISAL_SUBMENU_ITEMS 53 | address: 54 | EU: 0x238C02C 55 | NA: 0x238B4EC 56 | JP: 0x238CA4C 57 | length: 58 | EU: 0x20 59 | NA: 0x20 60 | JP: 0x20 61 | - name: OVERLAY25_UNKNOWN_STRING_IDS 62 | address: 63 | NA: 0x238B50C 64 | length: 65 | NA: 0x28 66 | description: "Note: unverified, ported from Irdkwia's notes" 67 | - name: APPRAISAL_WINDOW_PARAMS_2 68 | address: 69 | NA: 0x238B534 70 | length: 71 | NA: 0x10 72 | description: "Note: unverified, ported from Irdkwia's notes" 73 | - name: APPRAISAL_WINDOW_PARAMS_3 74 | address: 75 | NA: 0x238B544 76 | length: 77 | NA: 0x10 78 | description: "Note: unverified, ported from Irdkwia's notes" 79 | - name: APPRAISAL_WINDOW_PARAMS_4 80 | address: 81 | NA: 0x238B554 82 | length: 83 | NA: 0x10 84 | description: "Note: unverified, ported from Irdkwia's notes" 85 | - name: APPRAISAL_WINDOW_PARAMS_5 86 | address: 87 | EU: 0x238C0A4 88 | NA: 0x238B564 89 | JP: 0x238CAC4 90 | length: 91 | EU: 0x10 92 | NA: 0x10 93 | description: "Note: unverified, ported from Irdkwia's notes" 94 | - name: APPRAISAL_WINDOW_PARAMS_6 95 | address: 96 | EU: 0x238C0B4 97 | NA: 0x238B574 98 | JP: 0x238CAD4 99 | length: 100 | EU: 0x10 101 | NA: 0x10 102 | description: "Note: unverified, ported from Irdkwia's notes" 103 | - name: APPRAISAL_WINDOW_PARAMS_7 104 | address: 105 | EU: 0x238C0C4 106 | NA: 0x238B584 107 | JP: 0x238CAE4 108 | length: 109 | EU: 0x10 110 | NA: 0x10 111 | description: "Note: unverified, ported from Irdkwia's notes" 112 | - name: APPRAISAL_WINDOW_PARAMS_8 113 | address: 114 | EU: 0x238C0D4 115 | NA: 0x238B594 116 | JP: 0x238CAF4 117 | length: 118 | EU: 0x10 119 | NA: 0x10 120 | description: "Note: unverified, ported from Irdkwia's notes" 121 | - name: OVERLAY25_RESERVED_SPACE 122 | address: 123 | NA: 0x238B5C4 124 | length: 125 | NA: 0x1C 126 | description: "Note: unverified, ported from Irdkwia's notes" 127 | - name: OVERLAY25_UNKNOWN_POINTER__NA_238B5E0 128 | address: 129 | EU: 0x238C120 130 | NA: 0x238B5E0 131 | JP: 0x238CB40 132 | length: 133 | NA: 0x4 134 | description: "Note: unverified, ported from Irdkwia's notes" 135 | -------------------------------------------------------------------------------- /symbols/overlay26.yml: -------------------------------------------------------------------------------- 1 | overlay26: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0xE40 12 | NA: 0xE40 13 | JP: 0xE40 14 | description: "Related to mission completion. It's loaded when the dungeon completion summary is shown upon exiting a dungeon, and during the cutscenes where you collect mission rewards from clients." 15 | functions: [] 16 | data: 17 | - name: OVERLAY26_UNKNOWN_TABLE__NA_238AE20 18 | address: 19 | EU: 0x238B960 20 | NA: 0x238AE20 21 | length: 22 | NA: 0x8C 23 | description: |- 24 | 0x6 + 11*0xC + 0x2 25 | 26 | Note: unverified, ported from Irdkwia's notes 27 | - name: OVERLAY26_RESERVED_SPACE 28 | address: 29 | NA: 0x238AF48 30 | length: 31 | NA: 0x18 32 | description: "Note: unverified, ported from Irdkwia's notes" 33 | - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF60 34 | address: 35 | EU: 0x238BAA0 36 | NA: 0x238AF60 37 | length: 38 | NA: 0x4 39 | description: "Note: unverified, ported from Irdkwia's notes" 40 | - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF64 41 | address: 42 | EU: 0x238BAA4 43 | NA: 0x238AF64 44 | length: 45 | NA: 0x4 46 | description: "Note: unverified, ported from Irdkwia's notes" 47 | - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF68 48 | address: 49 | EU: 0x238BAA8 50 | NA: 0x238AF68 51 | length: 52 | NA: 0x4 53 | description: "Note: unverified, ported from Irdkwia's notes" 54 | - name: OVERLAY26_UNKNOWN_POINTER__NA_238AF6C 55 | address: 56 | EU: 0x238BAAC 57 | NA: 0x238AF6C 58 | length: 59 | NA: 0x4 60 | description: "Note: unverified, ported from Irdkwia's notes" 61 | - name: OVERLAY26_UNKNOWN_POINTER5__NA_238AF70 62 | address: 63 | EU: 0x238BAB0 64 | NA: 0x238AF70 65 | length: 66 | NA: 0x4 67 | description: "Note: unverified, ported from Irdkwia's notes" 68 | -------------------------------------------------------------------------------- /symbols/overlay27.yml: -------------------------------------------------------------------------------- 1 | overlay27: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0x2D60 12 | NA: 0x2D60 13 | JP: 0x2DA0 14 | description: Controls the special episode item discard menu. 15 | functions: [] 16 | data: 17 | - name: OVERLAY27_UNKNOWN_VALUE__NA_238C948 18 | address: 19 | EU: 0x238D488 20 | NA: 0x238C948 21 | JP: 0x238DED8 22 | length: 23 | NA: 0x4 24 | description: "Note: unverified, ported from Irdkwia's notes" 25 | - name: OVERLAY27_UNKNOWN_VALUE__NA_238C94C 26 | address: 27 | EU: 0x238D48C 28 | NA: 0x238C94C 29 | JP: 0x238DEDC 30 | length: 31 | NA: 0x4 32 | description: "Note: unverified, ported from Irdkwia's notes" 33 | - name: OVERLAY27_UNKNOWN_STRUCT__NA_238C950 34 | address: 35 | EU: 0x238D490 36 | NA: 0x238C950 37 | JP: 0x238DEE0 38 | length: 39 | NA: 0xC 40 | description: "Note: unverified, ported from Irdkwia's notes" 41 | - name: DISCARD_ITEMS_MENU_ITEMS_CONFIRM 42 | address: 43 | EU: 0x238D49C 44 | NA: 0x238C95C 45 | JP: 0x238DEEC 46 | length: 47 | EU: 0x18 48 | NA: 0x18 49 | JP: 0x18 50 | - name: DISCARD_ITEMS_SUBMENU_ITEMS_1 51 | address: 52 | EU: 0x238D4B4 53 | NA: 0x238C974 54 | JP: 0x238DF04 55 | length: 56 | EU: 0x20 57 | NA: 0x20 58 | JP: 0x20 59 | - name: DISCARD_ITEMS_SUBMENU_ITEMS_2 60 | address: 61 | EU: 0x238D4D4 62 | NA: 0x238C994 63 | JP: 0x238DF24 64 | length: 65 | EU: 0x20 66 | NA: 0x20 67 | JP: 0x20 68 | - name: DISCARD_ITEMS_MAIN_MENU_ITEMS 69 | address: 70 | EU: 0x238D4F4 71 | NA: 0x238C9B4 72 | JP: 0x238DF44 73 | length: 74 | EU: 0x28 75 | NA: 0x28 76 | JP: 0x28 77 | - name: OVERLAY27_UNKNOWN_STRING_IDS 78 | address: 79 | NA: 0x238C9DC 80 | length: 81 | NA: 0x30 82 | description: "Note: unverified, ported from Irdkwia's notes" 83 | - name: DISCARD_WINDOW_PARAMS_1 84 | address: 85 | NA: 0x238CA0C 86 | length: 87 | NA: 0x10 88 | description: "Note: unverified, ported from Irdkwia's notes" 89 | - name: DISCARD_WINDOW_PARAMS_2 90 | address: 91 | NA: 0x238CA1C 92 | length: 93 | NA: 0x10 94 | description: "Note: unverified, ported from Irdkwia's notes" 95 | - name: DISCARD_WINDOW_PARAMS_3 96 | address: 97 | NA: 0x238CA2C 98 | length: 99 | NA: 0x10 100 | description: "Note: unverified, ported from Irdkwia's notes" 101 | - name: DISCARD_WINDOW_PARAMS_4 102 | address: 103 | NA: 0x238CA3C 104 | length: 105 | NA: 0x10 106 | description: "Note: unverified, ported from Irdkwia's notes" 107 | - name: DISCARD_WINDOW_PARAMS_5 108 | address: 109 | EU: 0x238D58C 110 | NA: 0x238CA4C 111 | JP: 0x238DFDC 112 | length: 113 | EU: 0x10 114 | NA: 0x10 115 | description: "Note: unverified, ported from Irdkwia's notes" 116 | - name: DISCARD_WINDOW_PARAMS_6 117 | address: 118 | EU: 0x238D59C 119 | NA: 0x238CA5C 120 | JP: 0x238DFEC 121 | length: 122 | EU: 0x10 123 | NA: 0x10 124 | description: "Note: unverified, ported from Irdkwia's notes" 125 | - name: DISCARD_WINDOW_PARAMS_7 126 | address: 127 | EU: 0x238D5AC 128 | NA: 0x238CA6C 129 | JP: 0x238DFFC 130 | length: 131 | EU: 0x10 132 | NA: 0x10 133 | description: "Note: unverified, ported from Irdkwia's notes" 134 | - name: DISCARD_WINDOW_PARAMS_8 135 | address: 136 | NA: 0x238CA7C 137 | length: 138 | NA: 0x10 139 | description: "Note: unverified, ported from Irdkwia's notes" 140 | - name: OVERLAY27_RESERVED_SPACE 141 | address: 142 | NA: 0x238CE70 143 | length: 144 | NA: 0x10 145 | description: "Note: unverified, ported from Irdkwia's notes" 146 | - name: OVERLAY27_UNKNOWN_POINTER__NA_238CE80 147 | address: 148 | EU: 0x238D9C0 149 | NA: 0x238CE80 150 | JP: 0x238E420 151 | length: 152 | NA: 0x4 153 | description: "Note: unverified, ported from Irdkwia's notes" 154 | - name: OVERLAY27_UNKNOWN_POINTER__NA_238CE84 155 | address: 156 | EU: 0x238D9C4 157 | NA: 0x238CE84 158 | JP: 0x238E424 159 | length: 160 | NA: 0x4 161 | description: "Note: unverified, ported from Irdkwia's notes" 162 | -------------------------------------------------------------------------------- /symbols/overlay28.yml: -------------------------------------------------------------------------------- 1 | overlay28: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x238AC80 8 | NA: 0x238A140 9 | JP: 0x238B6A0 10 | length: 11 | EU: 0xC60 12 | NA: 0xC60 13 | JP: 0xC60 14 | description: Controls the staff credits sequence. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay30.yml: -------------------------------------------------------------------------------- 1 | overlay30: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x2383420 8 | NA: 0x2382820 9 | JP: 0x2383AA0 10 | length: 11 | EU: 0x38A0 12 | NA: 0x38A0 13 | JP: 0x3880 14 | description: Controls quicksaving in dungeons. 15 | functions: 16 | - name: WriteQuicksaveData 17 | address: 18 | EU: 0x2383868 19 | NA: 0x2382C68 20 | JP: 0x2383ED8 21 | description: |- 22 | Function responsible for writing dungeon data when quicksaving. 23 | 24 | Among other things, it contains a loop that goes through all the monsters in the current dungeon, copying their data to the buffer. The data is not copied as-is though, the game uses a reduced version of the monster struct containing only the minimum required data to resume the game later. 25 | 26 | r0: Pointer to buffer where data should be written 27 | r1: Buffer size. Seems to be 0x5800 (22 KB) when the function is called. 28 | data: 29 | - name: OVERLAY30_JP_STRING_1 30 | address: 31 | EU: 0x2386C84 32 | NA: 0x2386080 33 | JP: 0x23872E0 34 | length: 35 | EU: 0xC 36 | NA: 0xC 37 | JP: 0xC 38 | description: みさき様 39 | - name: OVERLAY30_JP_STRING_2 40 | address: 41 | EU: 0x2386C90 42 | NA: 0x238608C 43 | JP: 0x23872EC 44 | length: 45 | EU: 0xC 46 | NA: 0xC 47 | JP: 0xC 48 | description: やよい様 49 | -------------------------------------------------------------------------------- /symbols/overlay32.yml: -------------------------------------------------------------------------------- 1 | overlay32: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x2383420 8 | NA: 0x2382820 9 | JP: 0x2383AA0 10 | length: 11 | EU: 0x20 12 | NA: 0x20 13 | JP: 0x20 14 | description: Unused; all zeroes. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay33.yml: -------------------------------------------------------------------------------- 1 | overlay33: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x2383420 8 | NA: 0x2382820 9 | JP: 0x2383AA0 10 | length: 11 | EU: 0x20 12 | NA: 0x20 13 | JP: 0x20 14 | description: Unused; all zeroes. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /symbols/overlay34.yml: -------------------------------------------------------------------------------- 1 | overlay34: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x22DCB80 8 | NA: 0x22DC240 9 | JP: 0x22DD8E0 10 | length: 11 | EU: 0xDC0 12 | NA: 0xE60 13 | JP: 0xDC0 14 | description: |- 15 | Related to launching the game. 16 | 17 | There are mention in the strings of logos like the ESRB logo. This only seems to be loaded during the ESRB rating splash screen, so this is likely the sole purpose of this overlay. 18 | functions: 19 | - name: ExplorersOfSkyMain 20 | address: 21 | EU: 0x22DCB80 22 | NA: 0x22DC240 23 | JP: 0x22DD8E0 24 | description: |- 25 | The main function for Explorers of Sky. 26 | 27 | Note: unverified, ported from Irdkwia's notes 28 | 29 | r0: probably a game mode ID? 30 | return: probably a return code? 31 | data: 32 | - name: OVERLAY34_UNKNOWN_STRUCT__NA_22DD014 33 | address: 34 | EU: 0x22DD8BC 35 | NA: 0x22DD014 36 | JP: 0x22DE618 37 | length: 38 | NA: 0x10 39 | description: |- 40 | 1*0x4 + 3*0x4 41 | 42 | Note: unverified, ported from Irdkwia's notes 43 | - name: START_MENU_ITEMS_CONFIRM 44 | address: 45 | EU: 0x22DD8CC 46 | NA: 0x22DD024 47 | JP: 0x22DE628 48 | length: 49 | EU: 0x18 50 | NA: 0x18 51 | JP: 0x18 52 | - name: OVERLAY34_UNKNOWN_STRUCT__NA_22DD03C 53 | address: 54 | EU: 0x22DD8E4 55 | NA: 0x22DD03C 56 | JP: 0x22DE640 57 | length: 58 | NA: 0x10 59 | description: |- 60 | 1*0x4 + 3*0x4 61 | 62 | Note: unverified, ported from Irdkwia's notes 63 | - name: DUNGEON_DEBUG_MENU_ITEMS 64 | address: 65 | EU: 0x22DD8F4 66 | NA: 0x22DD04C 67 | JP: 0x22DE650 68 | length: 69 | EU: 0x28 70 | NA: 0x28 71 | JP: 0x28 72 | - name: OVERLAY34_RESERVED_SPACE 73 | address: 74 | NA: 0x22DD074 75 | length: 76 | NA: 0xC 77 | description: "Note: unverified, ported from Irdkwia's notes" 78 | - name: OVERLAY34_UNKNOWN_POINTER__NA_22DD080 79 | address: 80 | EU: 0x22DD920 81 | NA: 0x22DD080 82 | JP: 0x22DE680 83 | length: 84 | NA: 0x4 85 | description: "Note: unverified, ported from Irdkwia's notes" 86 | - name: OVERLAY34_UNKNOWN_POINTER__NA_22DD084 87 | address: 88 | EU: 0x22DD924 89 | NA: 0x22DD084 90 | JP: 0x22DE684 91 | length: 92 | NA: 0x4 93 | description: "Note: unverified, ported from Irdkwia's notes" 94 | - name: OVERLAY34_UNKNOWN_POINTER__NA_22DD088 95 | address: 96 | NA: 0x22DD088 97 | length: 98 | NA: 0x4 99 | description: "Note: unverified, ported from Irdkwia's notes" 100 | - name: OVERLAY34_UNKNOWN_POINTER__NA_22DD08C 101 | address: 102 | EU: 0x22DD92C 103 | NA: 0x22DD08C 104 | JP: 0x22DE68C 105 | length: 106 | NA: 0x4 107 | description: "Note: unverified, ported from Irdkwia's notes" 108 | - name: OVERLAY34_UNKNOWN_POINTER__NA_22DD090 109 | address: 110 | NA: 0x22DD090 111 | length: 112 | NA: 0x4 113 | description: "Note: unverified, ported from Irdkwia's notes" 114 | -------------------------------------------------------------------------------- /symbols/overlay35.yml: -------------------------------------------------------------------------------- 1 | overlay35: 2 | versions: 3 | - EU 4 | - NA 5 | - JP 6 | address: 7 | EU: 0x22BD3C0 8 | NA: 0x22BCA80 9 | JP: 0x22BE220 10 | length: 11 | EU: 0x20 12 | NA: 0x20 13 | JP: 0x20 14 | description: Unused; all zeroes. 15 | functions: [] 16 | data: [] 17 | -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | # Tools 2 | 3 | This directory contains miscellaneous tools for reverse engineering _Explorers of Sky_. 4 | 5 | ## `arm5find.py` 6 | `arm5find.py` is a command line utility for searching for matching instructions or data across different ARMv5 binaries. It can be used to fill in symbol addresses that are known in some EoS versions but not others. The tool will search in one or more target binaries for the specified byte segments in a source file. With assembly instructions, matches don't need to be exact, just equivalent (e.g., function call offsets can differ). The script is invokable with the `python3` command. See the help text (`python3 arm5find.py --help`) for usage instructions, and see the description in [`arm5find.py`](arm5find.py) itself for more details. 7 | 8 | ## `offsets.py` 9 | `offsets.py` is a command line utility for converting EoS offsets between absolute memory addresses and relative file offsets. One possible use is for converting addresses in the symbol tables into file-relative offsets for `arm5find.py`, and vice versa, but the tool is useful whenever such conversions are needed. The script is invokable with the `python3` command. See the help text (`python3 offsets.py --help`) for usage instructions, and see the description in [`offsets.py`](offsets.py) itself for more details. 10 | 11 | ## `resymgen.py` 12 | `resymgen.py` is a Python interface for calling `resymgen` programmatically from Python via `subprocess`. It requires `cargo` to be available in the runtime environment. See the description of [`resymgen.py`](resymgen.py) for usage instructions. 13 | 14 | ## `symbols_vfill.py` 15 | `symbols_vfill.py` is a command line utility for filling in missing function addresses in the `pmdsky-debug` [symbol tables](../symbols), for addresses that are known in some game versions (e.g., NA, EU) but not in others. It relies on [`resymgen.py`](#resymgenpy) and thus has the same prerequisites. See the help text (`python3 symbols_vfill.py --help`) for usage instructions, and see the description in [`symbols_vfill.py`](symbols_vfill.py) itself for more details. 16 | 17 | ## `symcompat.py` 18 | `symcompat.py` is a command line utility for checking symbol name compatibility across different revisions of the `pmdsky-debug` [symbol tables](../symbols). It is largely based on [`symdiff.py`](symdiff.py). See the help text (`python3 symcompat.py --help`) for usage instructions, and see the description in [`symcompat.py`](symcompat.py) itself for more details. 19 | 20 | ## `symdiff.py` 21 | `symdiff.py` is a command line diff utility for comparing the `pmdsky-debug` [symbol tables](../symbols) across different revisions. It has a similar interface to `git diff`, but runs a specialized diffing algorithm. See the help text (`python3 symdiff.py --help`) for usage instructions, and see the description in [`symdiff.py`](symdiff.py) itself for more details. 22 | -------------------------------------------------------------------------------- /tools/ansi.py: -------------------------------------------------------------------------------- 1 | """ 2 | A simple, no-dependency Python module for printing with ANSI escape codes. 3 | 4 | Example usage: 5 | ``` 6 | ansi.print(ansi.BOLD, "bold text") 7 | ansi.print(ansi.BOLD + ansi.RED, "bold red text") 8 | ansi.print(ansi.GREEN + ansi.CYAN_BG, "green text with cyan background") 9 | ``` 10 | """ 11 | 12 | import os 13 | import sys 14 | 15 | 16 | class Code: 17 | """ANSI escape code sequence""" 18 | 19 | def __init__(self, params): 20 | self.params = params 21 | 22 | def __add__(self, other): 23 | return Code(f"{self.params};{other.params}") 24 | 25 | def __repr__(self): 26 | return f"\\033[{self.params}m" 27 | 28 | def __str__(self): 29 | return f"\033[{self.params}m" 30 | 31 | 32 | # Commonly supported ANSI escape codes 33 | RESET = Code("0") 34 | 35 | BOLD = Code("1") 36 | 37 | BLACK = Code("30") 38 | RED = Code("31") 39 | GREEN = Code("32") 40 | YELLOW = Code("33") 41 | BLUE = Code("34") 42 | MAGENTA = Code("35") 43 | CYAN = Code("36") 44 | WHITE = Code("37") 45 | 46 | BLACK_BG = Code("40") 47 | RED_BG = Code("41") 48 | GREEN_BG = Code("42") 49 | YELLOW_BG = Code("43") 50 | BLUE_BG = Code("44") 51 | MAGENTA_BG = Code("45") 52 | CYAN_BG = Code("46") 53 | WHITE_BG = Code("47") 54 | 55 | # This is how the termcolor Rust crate checks for ANSI support 56 | # The effect of this variable may still be overridden by the PYTHON_TERM_COLOR 57 | # environment variable, see ansi_enabled() below. 58 | ALLOWED_IN_ENV = bool( 59 | "NO_COLOR" not in os.environ 60 | and "TERM" in os.environ 61 | and os.environ["TERM"] != "dumb" 62 | and (os.name != "nt" or os.environ["TERM"] != "cygwin") 63 | ) 64 | 65 | 66 | def ansi_enabled(file=None): 67 | """ 68 | Checks if ansi.print() should use ANSI escape codes for a given file. 69 | 70 | Args: 71 | file (IO, optional): file being written to, same as in the print() function. 72 | If None, sys.stdout will be used. 73 | """ 74 | # The PYTHON_TERM_COLOR environment variable mimics the CARGO_TERM_COLOR 75 | # environment variable that cargo uses 76 | PYTHON_TERM_COLOR = os.getenv("PYTHON_TERM_COLOR", "auto") 77 | if PYTHON_TERM_COLOR == "always": 78 | return True 79 | if PYTHON_TERM_COLOR == "never": 80 | return False 81 | 82 | if file is None: 83 | file = sys.stdout 84 | # Only print ANSI codes if they're supported in the environment and the 85 | # output file is a tty 86 | return ALLOWED_IN_ENV and file.isatty() 87 | 88 | 89 | _builtin_print = print 90 | 91 | 92 | def print(code, *args, **kwargs): 93 | """ 94 | Print with ANSI escape codes if supported in the current environment. 95 | The end argument is printed normally, without ANSI escape codes. 96 | Arguments besides the code are passed to the built-in print() function. 97 | 98 | Args: 99 | code (Code): ANSI escape code sequence to use while printing 100 | """ 101 | if ansi_enabled(kwargs.get("file")): 102 | flush = kwargs.get("flush", False) 103 | end = kwargs.get("end") 104 | kwargs["flush"] = False 105 | kwargs["end"] = "" 106 | _builtin_print(code, **kwargs) 107 | _builtin_print(*args, **kwargs) 108 | _builtin_print(RESET, end=end, file=kwargs.get("file"), flush=flush) 109 | else: 110 | # Ignore ANSI codes on non-ANSI terminals 111 | _builtin_print(*args, **kwargs) 112 | -------------------------------------------------------------------------------- /tools/ghidra_scripts/import_symbols_json.py: -------------------------------------------------------------------------------- 1 | # Imports symbols from a JSON file 2 | # @author UsernameFodder 3 | # @category Data 4 | 5 | import json 6 | import ghidra.program.model.symbol.SourceType as SourceType 7 | 8 | COMMENT_TAG = "=== imported description ===\n" 9 | functionManager = currentProgram.getFunctionManager() 10 | 11 | jythonFile = askFile("Select symbol JSON file", "Import") 12 | with open(jythonFile.absolutePath, "r") as f: 13 | symbols = json.load(f) 14 | 15 | for s in symbols: 16 | stype = s["type"] 17 | name = s["name"] 18 | address = s["address"] 19 | if type(address) != int: 20 | address = int(address, 0) 21 | address = toAddr(address) 22 | description = s.get("description") 23 | 24 | if stype == "function": 25 | func = functionManager.getFunctionAt(address) 26 | 27 | if func is None: 28 | func = createFunction(address, name) 29 | print("Created function {} at address {}".format(name, address)) 30 | else: 31 | old_name = func.getName() 32 | func.setName(name, SourceType.USER_DEFINED) 33 | print( 34 | "Renamed function {} to {} at address {}".format( 35 | old_name, name, address 36 | ) 37 | ) 38 | else: 39 | print("Created primary label {} at address {}".format(name, address)) 40 | createLabel(address, name, True) 41 | for alias in s.get("aliases", []): 42 | print("Created label {} at address {}".format(alias, address)) 43 | createLabel(address, alias, False) 44 | 45 | if description: 46 | comment = getPlateComment(address) 47 | if not comment: 48 | comment = COMMENT_TAG + description 49 | else: 50 | commentParts = comment.split(COMMENT_TAG) 51 | if len(commentParts) == 1: 52 | commentParts[0] += "\n\n" 53 | commentParts.append("") 54 | commentParts[1] = description 55 | comment = COMMENT_TAG.join(commentParts) 56 | setPlateComment(address, comment) 57 | -------------------------------------------------------------------------------- /tools/ghidra_scripts/import_symbols_ntr_ghidra.py: -------------------------------------------------------------------------------- 1 | # Imports pmdsky-debug symbols into an NTRGhidra project 2 | # @author UsernameFodder 3 | # @category Data 4 | 5 | import json 6 | import os 7 | import re 8 | import ghidra.program.model.symbol.SourceType as SourceType 9 | 10 | COMMENT_TAG = "=== imported description ===\n" 11 | 12 | functionManager = currentProgram.getFunctionManager() 13 | 14 | globalNsBody = currentProgram.globalNamespace.body 15 | addrSpaceMap = {r.addressSpace.name: r.addressSpace for r in globalNsBody} 16 | 17 | 18 | def shouldImport(filename): 19 | return "arm" in filename or "overlay" in filename 20 | 21 | 22 | def getFileAddrSpace(filename): 23 | match = re.match("overlay(\d+)", os.path.basename(filename)) 24 | if match: 25 | overlayNum = int(match.group(1)) 26 | # This is the naming scheme NTRGhidra uses for overlays 27 | return "overlay_{}".format(overlayNum) 28 | return "ram" # Default address space name 29 | 30 | 31 | jythonDir = askDirectory("Select directory containing symbol JSON files", "Import") 32 | filenames = sorted( 33 | [ 34 | os.path.join(jythonDir.absolutePath, f) 35 | for f in os.listdir(jythonDir.absolutePath) 36 | if shouldImport(f) 37 | ] 38 | ) 39 | 40 | for fname in filenames: 41 | addrSpace = addrSpaceMap[getFileAddrSpace(fname)] 42 | with open(fname, "r") as f: 43 | symbols = json.load(f) 44 | 45 | for s in symbols: 46 | stype = s["type"] 47 | name = s["name"] 48 | address = s["address"] 49 | if type(address) != int: 50 | address = int(address, 0) 51 | address = addrSpace.getAddressInThisSpaceOnly(address) 52 | description = s.get("description") 53 | 54 | if stype == "function": 55 | func = functionManager.getFunctionAt(address) 56 | 57 | if func is None: 58 | func = createFunction(address, name) 59 | print("Created function {} at address {}".format(name, address)) 60 | else: 61 | old_name = func.getName() 62 | func.setName(name, SourceType.USER_DEFINED) 63 | print( 64 | "Renamed function {} to {} at address {}".format( 65 | old_name, name, address 66 | ) 67 | ) 68 | else: 69 | print("Created primary label {} at address {}".format(name, address)) 70 | createLabel(address, name, True) 71 | for alias in s.get("aliases", []): 72 | print("Created label {} at address {}".format(alias, address)) 73 | createLabel(address, alias, False) 74 | 75 | if description: 76 | comment = getPlateComment(address) 77 | if not comment: 78 | comment = COMMENT_TAG + description 79 | else: 80 | commentParts = comment.split(COMMENT_TAG) 81 | if len(commentParts) == 1: 82 | commentParts[0] += "\n\n" 83 | commentParts.append("") 84 | commentParts[1] = description 85 | comment = COMMENT_TAG.join(commentParts) 86 | setPlateComment(address, comment) 87 | -------------------------------------------------------------------------------- /tools/resymgen.py: -------------------------------------------------------------------------------- 1 | """ 2 | A simple Python interface for calling resymgen commands via subprocess. 3 | Requires cargo to be installed and available in the runtime environment. 4 | 5 | Example usage: 6 | ``` 7 | from resymgen import resymgen 8 | resymgen.help([]).check_returncode() 9 | resymgen.fmt(["--check", ""]).check_returncode() 10 | ``` 11 | """ 12 | 13 | import os 14 | import subprocess 15 | 16 | 17 | class Resymgen: 18 | MANIFEST_PATH = os.path.join( 19 | os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "Cargo.toml" 20 | ) 21 | CARGO_MANIFEST_PATH_ARG = f"--manifest-path={MANIFEST_PATH}" 22 | 23 | def __init__(self): 24 | # Eagerly build resymgen so it doesn't happen lazily on the first run 25 | # (this also confirms that cargo is available in the user environment) 26 | subprocess.run( 27 | ["cargo", "build", "--release", "--quiet", Resymgen.CARGO_MANIFEST_PATH_ARG] 28 | ).check_returncode() 29 | 30 | def __getattr__(self, command): 31 | """Attributes are passed straight to resymgen to be interpreted as commands 32 | 33 | Args: 34 | command (str): resymgen command 35 | 36 | Returns: 37 | A function that behaves just like subprocess.run, except the args 38 | list will be passed to resymgen. 39 | """ 40 | 41 | def run_command(args, **kwargs): 42 | """Same API as subprocess.run""" 43 | subprocess_args = [ 44 | "cargo", 45 | "run", 46 | "--release", 47 | Resymgen.CARGO_MANIFEST_PATH_ARG, 48 | "--", 49 | command, 50 | ] 51 | if type(args) == list: 52 | subprocess_args += args 53 | else: 54 | subprocess_args.append(args) 55 | return subprocess.run(subprocess_args, **kwargs) 56 | 57 | return run_command 58 | 59 | 60 | resymgen = Resymgen() 61 | -------------------------------------------------------------------------------- /tools/symcompat.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | `symcompat.py` is a command line utility for checking symbol name compatibility 5 | across Git revisions of the pmdsky-debug symbol tables. A name compatibility 6 | issue is defined as a symbol name in the base revision that is no longer 7 | present (either as a primary name or an alias) in the target revision. 8 | 9 | This script is largely based on `symdiff.py`, and reuses much of the same 10 | parsing logic. It also relies on the diffing algorithm when inferring symbol 11 | renames. 12 | 13 | Example usage: 14 | 15 | python3 symcompat.py 16 | python3 symcompat.py HEAD~5 HEAD~2 -- 17 | """ 18 | 19 | import argparse 20 | from pathlib import Path 21 | from typing import List, Optional 22 | 23 | import ansi 24 | import symdiff 25 | 26 | 27 | def get_symbols(table: symdiff.SymbolTable) -> List[str]: 28 | """Get all symbols in a given a SymbolTable, including aliases.""" 29 | return [ 30 | name 31 | for block in table.blocks.values() 32 | for l in [block.functions, block.data] 33 | for s in l 34 | for name in [s.name] + s.aliases 35 | ] 36 | 37 | 38 | def print_help_text(): 39 | ansi.print( 40 | ansi.BOLD + ansi.YELLOW, 41 | "CAUTION: Detected symbols that have been removed or renamed without aliasing!", 42 | ) 43 | ansi.print( 44 | ansi.YELLOW, 45 | "Please note that other projects may depend on these symbols, and removing" 46 | " them may cause compatibility issues. If this is intentional, this notice can" 47 | " be ignored. However, if this is unintentional, and symbols are being" 48 | " renamed, consider adding the old symbol names as aliases, like so:", 49 | ) 50 | print(" - name: NewSymbolName") 51 | ansi.print(ansi.GREEN, "+ aliases:") 52 | # NOTE: For GitHub Actions, each line must be printed separately, see 53 | # https://github.com/orgs/community/discussions/40864 54 | ansi.print(ansi.GREEN, "+ - OldSymbolName") 55 | print() 56 | 57 | 58 | def check_symbol_compatibility( 59 | path: Path, base: str, target: Optional[str], *, show_help_text: bool = False 60 | ) -> bool: 61 | old_table = symdiff.SymbolTable(path, revision=base) 62 | new_table = symdiff.SymbolTable(path, revision=target) 63 | if not old_table.valid and not new_table.valid: 64 | return True 65 | 66 | old_symbols = get_symbols(old_table) 67 | new_symbols_set = set(get_symbols(new_table)) 68 | # Maintain symbol order for reporting determinism 69 | removed_symbols = [s for s in old_symbols if s not in new_symbols_set] 70 | if not removed_symbols: 71 | return True 72 | 73 | # Deletions detected 74 | if show_help_text: 75 | print_help_text() 76 | # Try to infer renames if possible 77 | diff = new_table.diff(old_table) 78 | renames = { 79 | d.path.name: d.new_path.name 80 | for d in diff.modified 81 | if d.new_path is not None and d.path.name != d.new_path.name 82 | } 83 | ansi.print( 84 | ansi.BOLD + ansi.CYAN, 85 | f"Removed symbols from {path.resolve().relative_to(symdiff.SYMBOL_DIR)}:", 86 | ) 87 | for removed in removed_symbols: 88 | line = f" - {removed}" 89 | renamed_to = renames.get(removed) 90 | if renamed_to is not None: 91 | line += f" (renamed to {renamed_to}?)" 92 | ansi.print(ansi.CYAN, line) 93 | print() 94 | return False 95 | 96 | 97 | if __name__ == "__main__": 98 | parser = argparse.ArgumentParser( 99 | description="Check symbol name compatibility across Git revisions of" 100 | + " the pmdsky-debug symbol tables.", 101 | ) 102 | parser.add_argument( 103 | "-w", 104 | "--warn", 105 | action="store_true", 106 | help="print an extended warning message for compatibility issues", 107 | ) 108 | args = symdiff.symdiff_parse_args(parser) 109 | 110 | compat_issues = False 111 | for path in args.path: 112 | compat_issues |= not check_symbol_compatibility( 113 | path, 114 | args.base, 115 | args.target, 116 | show_help_text=args.warn and not compat_issues, 117 | ) 118 | if compat_issues: 119 | raise SystemExit(1) 120 | --------------------------------------------------------------------------------