Document most of the Battle Hall logic - #1220
Merged
Merged
Conversation
lhearachel
reviewed
Jun 23, 2026
| .short \arg0 | ||
| .short \arg1 | ||
| .short \arg2 | ||
| .macro BattleHall_SendCommMessage command, arg, returnVar |
Collaborator
There was a problem hiding this comment.
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.newThen you can check the output and replace the old file.
Contributor
Author
There was a problem hiding this comment.
Makes sense, but as you say, I think this should be in a separate PR.
lhearachel
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ccontains 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 infrontierproc. The other two are related to the pokemon inpl_bsdpm.narc, which is still not unpacked. I hope to be able to unpack this and generate those lists to in the near future.