-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code_80140DC.s -> string_format #243
Conversation
Ready for review |
Looks like there are merge conflicts from the |
@@ -54,7 +54,7 @@ bool8 sub_802DB28(u8 jobSlotIndex, u8 dungeon) | |||
sUnknown_203B2FC->monPortrait.pos.y = 8; | |||
|
|||
if (sUnknown_203B2FC->monPortrait.faceFile != NULL) | |||
sUnknown_203B2FC->monPortrait.faceData = sUnknown_203B2FC->monPortrait.faceFile->data; | |||
sUnknown_203B2FC->monPortrait.faceData = (void *) sUnknown_203B2FC->monPortrait.faceFile->data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are all these casts to void*
instead of the new PortraitGfx
struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because, void * is faster to type 😂
@@ -74,7 +74,7 @@ _0801F2E0: | |||
b _0801F31A | |||
.align 2, 0 | |||
_0801F30C: .4byte gUnknown_203B270 | |||
_0801F310: .4byte gAvailablePokemonNames | |||
_0801F310: .4byte gFormatBuffer_Monsters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about these particular names for the format string buffers.
gFormatBuffer_Monsters and gFormatBuffer_Items ($m and $i formats) do not actually correspond to pokemon and items.
$nX does actually correspond to the name of the X'th gGroundLives entity (at 0x202E2B8, currently incorrectly named gPlayerName - since the first GroundLives does seem to always correspond to the players), but the others are rather generic slots for format strings, and are used as such.
gFormatArgs is fine but unclear it refers to numeric format arguments specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard the gPlayerName part - I didn't see you fully decompiled xxx_format_string when I was writing this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the names from charmap.txt
@@ -71,11 +70,11 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) | |||
else | |||
{ | |||
if (pokemon == target) { | |||
SetMessageArgument(gAvailablePokemonNames,target,0); | |||
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be a lot of work done, not in this PR, but properly renaming all the functions that write to the format buffers.
You can't trust the name of the buffer itself to know what's being written, you have to name the functions appropriately, in that case.
This one should be PrintEntityName, SetMessageArgument_2 should be PrintMonsterName, and so on.
(Maybe I can do that once this gets merged, seems like a fun reversing project)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's definitely a good idea to do so. But as you said, let's keep it for another PR.
Done |
WIP