Skip to content

Document most of the Battle Hall logic - #1220

Merged
lhearachel merged 3 commits into
pret:mainfrom
VicSevenT:battle_hall_logic
Jun 24, 2026
Merged

Document most of the Battle Hall logic#1220
lhearachel merged 3 commits into
pret:mainfrom
VicSevenT:battle_hall_logic

Conversation

@VicSevenT

Copy link
Copy Markdown
Contributor

This covers most of the battle hall-specific frontier script commands, including all the logic for picking the next opponent. The main chunk of logic left remaining for the Battle Hall is the communication code, which I am leaving until after #1179 is merged.

battle_hall_helpers.c contains some massive lists used to help generate the next opponent. One of these is a listing of frontier trainer classes, and I was able to generate this in frontierproc. The other two are related to the pokemon in pl_bsdpm.narc, which is still not unpacked. I hope to be able to unpack this and generate those lists to in the near future.

Comment thread asm/macros/frscrcmd.inc Outdated
Comment thread asm/macros/frscrcmd.inc
.short \arg0
.short \arg1
.short \arg2
.macro BattleHall_SendCommMessage command, arg, returnVar

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I would like to annotate the arguments to script-commands with :req to denote that they are required. Otherwise, it's a pretty big foot-gun for an end-user. That can be a separate PR, but we should definitely do it.

I have a basic awk-script for this, if that interests you:

#!/usr/bin/env -vS awk -f

! /\.macro/ { print $0 }

/\.macro/ {
    for (i = 3; i <= NF; i++) {
        if ($i ~ /.*,/) {
            sub(/,/, ":req,", $i)
        } else {
            $i = $i ":req"
        }
    }

    print "    " $0
}

Stick this in a file, make it executable, and run it against the input file:

./annotate.awk asm/macros/frscrcmd.inc > asm/macros/frscrcmd.inc.new

Then you can check the output and replace the old file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but as you say, I think this should be in a separate PR.

Comment thread src/overlay104/battle_hall.c Outdated
Comment thread src/overlay104/battle_hall.c
Comment thread src/overlay104/battle_hall_helpers.c Outdated
Comment thread src/overlay104/battle_hall_helpers.c Outdated
@VicSevenT
VicSevenT requested a review from lhearachel June 24, 2026 00:29
@lhearachel
lhearachel merged commit 82e69c3 into pret:main Jun 24, 2026
2 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants