Skip to content

Conversation

@AARJL
Copy link
Contributor

@AARJL AARJL commented Jan 4, 2026

  • Made small cosmetic changes for empty space and neatness
  • Moved reset_auto_wait to lower down the file
  • Changed "unsigned long" to "size_t" for ztalkbox::load
  • ztalkbox::load_settings(xIniFile& ini) at 95%, seems to be missing a string but could not solve in scratch
  • read_bool to 99%, not sure how to fix the issue with the negative and positive arrays
  • parse_tag_trap to 99%, I could get to 100% when the if statements are triple nested and goto is used. Might be a better way.
  • reset_tag_sound, reset_tag_trap, reset_tag_allow_quit, trigger_allow_quit, trigger_auto_wait all done at 100%
  • wait_context& wait_context::operator=(const wait_context& rhs)... yeah....
  • stop_audio_effect to 32%, still working on this
  • reset_auto_wait, reset_tag_auto_wait, and trigger_trap at 100%
  • Added various offsets in zTalkBox.h
  • Added struct sound_context in zTalkBox.h

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

main/SB/Game/zTalkBox

Section From To Bytes
📈 .rodata 0.00% 15.29% +69
📈 .sdata2 0.00% 42.86% +13
📈 .text 13.36% 20.27% +994
Function From To Bytes
@unnamed@zTalkBox_cpp@::read_bool(const substr&, bool) 0.00% 100.00% +188
@unnamed@zTalkBox_cpp@::reset_auto_wait() 2.22% 100.00% +176
@unnamed@zTalkBox_cpp@::reset_tag_auto_wait(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +112
@unnamed@zTalkBox_cpp@::trigger_auto_wait(const xtextbox::jot&) 0.00% 100.00% +56
@unnamed@zTalkBox_cpp@::reset_tag_sound(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
@unnamed@zTalkBox_cpp@::reset_tag_allow_quit(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
@unnamed@zTalkBox_cpp@::trigger_allow_quit(const xtextbox::jot&) 0.00% 100.00% +40
📈 @unnamed@zTalkBox_cpp@::parse_tag_trap(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 99.63% +107
@unnamed@zTalkBox_cpp@::reset_tag_trap(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
📈 @unnamed@zTalkBox_cpp@::stop_audio_effect() 0.00% 32.14% +27
📈 ztalkbox::load_settings(xIniFile&) 0.00% 95.96% +95

Copy link
Collaborator

@JoshSanch JoshSanch left a comment

Choose a reason for hiding this comment

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

Nice progress :)

Left some feedback so we can work to get this in a merge-ready state.

}

void ztalkbox::load(xBase& data, xDynAsset& asset, unsigned long)
void ztalkbox::load(xBase& data, xDynAsset& asset, size_t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason you made this change? It differs from the signature in objdiff which already matched:
ztalkbox::load(xBase&, xDynAsset&, unsigned long)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I made this change because at some point I was asked to use the types.h file when defining variables as signed or unsigned. I guess this does not apply to function signatures.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah I see - good instincts then, but we don't want to use size_t in this instance. Use lowercase u32 instead. size_t has a specific semantic meaning wherein it is the size the particular CPU architecture uses for iterator variables in bits. Since this argument isn't used as an iterator for a loop or anything, u32 is more appropriate.

This article is a solid discussion on size_t to reference: https://www.embedded.com/why-size_t-matters/

void ztalkbox::load_settings(xIniFile& ini) //TODO
{
shared.volume = xIniGetFloat(&ini, "talk_box.volume", 2.0f);
xDebugAddTweak("Talk Box|\u{1}Globals|volume", &shared.volume, 0.1f, 10.0f, NULL, NULL, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Objdiff displays literal characters a little strange - we haven't figured out yet why these particular strings are this way but this is probably a better match for this one:

Suggested change
xDebugAddTweak("Talk Box|\u{1}Globals|volume", &shared.volume, 0.1f, 10.0f, NULL, NULL, 0);
xDebugAddTweak("Talk Box|\01Globals|volume", &shared.volume, 0.1f, 10.0f, NULL, NULL, 0);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the change but no change in objdiff.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's prefer the changed code but share in the Discord somehow so we can help you finish the match. Might just be that the string data memory location is off but the actual code matches.

((ztalkbox&)data).load((const ztalkbox::asset_type&)asset);
}

void ztalkbox::load_settings(xIniFile& ini) //TODO
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to leave these TODO comments - objdiff and our reporting tooling will show these as not matching 100% so it's redundant here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left these in by mistake, they were for me when I was coding to remember what I was doing. I will remove them along with the DONE comments.


namespace
{
static U8 read_bool(const substr& s, bool def) //TODO 99%
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as earlier here - no need for the TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

static U8 read_bool(const substr& s, bool def) //TODO 99%
{
extern const substr negative[6];
extern const substr positive[6];
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are definitely not extern - you can see in objdiff that there's data for these two arrays within the file. Please work with the Discord to figure these ones out.

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I see this but was not sure what to make of it. I will reach out in Discord. Given that I can't seem to use decomp.me for this function due to namespacing issues, what is the best way to get help with that? Most of zTalkBox is in an anonymous namespace and that makes it difficult to reach out for help using that tool.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be a vc screenshare or just sharing pics as we go. I have some thoughts already since it'll have some form like:

Suggested change
extern const substr positive[6];
const substr positive[6] = {
{"string1", 1},
...
};

shared.auto_wait.query = Q_SKIP;
}
static void reset_tag_auto_wait(xtextbox::jot& j, const xtextbox&, const xtextbox& ctb,
const xtextbox::split_tag&) //DONE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the DONE comment in line with the other review comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

*(U16*)&this->type = 0;
}

static U8 trigger_trap(const xtextbox::jot& j) //DONE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove the DONE comment in line with the other review comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

Comment on lines 316 to 318
ACTION_SET = 0,
ACTION_PUSH = 1,
ACTION_POP = 2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

When enums start at 0 and increment by one, we leave them implicitly defined to avoid visual noise. Opt for this instead, please:

Suggested change
ACTION_SET = 0,
ACTION_PUSH = 1,
ACTION_POP = 2,
ACTION_SET,
ACTION_PUSH,
ACTION_POP,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For these I simply copy and pasted from the dwarf file. I will go ahead and make the changes for all enums from here.

Comment on lines 322 to 325
TYPE_INVALID = 0,
TYPE_VOLUME = 1,
TYPE_TARGET = 2,
TYPE_ORIGIN = 3,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Apply general enum styling feedback from the other one here as well, please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

Comment on lines 329 to 330
SOURCE_MEMORY = 0,
SOURCE_STREAM = 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Apply general enum styling feedback from the other one here as well, please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above.

@AARJL
Copy link
Contributor Author

AARJL commented Jan 5, 2026

Any comment on wait_context& wait_context::operator=(const wait_context& rhs) ?

I am not sure why it didn't show up as a change here, but we briefly went over this during our VC and I was asked to include it in my next PR to go over it. Line 501

@JoshSanch
Copy link
Collaborator

Any comment on wait_context& wait_context::operator=(const wait_context& rhs) ?

I am not sure why it didn't show up as a change here, but we briefly went over this during our VC and I was asked to include it in my next PR to go over it. Line 501

I'm going to spend some time seeing if I can get this to match on my own.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

main/SB/Game/zTalkBox

Section From To Bytes
📈 .rodata 0.00% 15.48% +70
📈 .sdata2 0.00% 42.86% +13
📈 .text 13.36% 18.96% +806
Function From To Bytes
@unnamed@zTalkBox_cpp@::reset_auto_wait() 2.22% 100.00% +176
@unnamed@zTalkBox_cpp@::reset_tag_auto_wait(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +112
@unnamed@zTalkBox_cpp@::trigger_auto_wait(const xtextbox::jot&) 0.00% 100.00% +56
@unnamed@zTalkBox_cpp@::reset_tag_sound(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
@unnamed@zTalkBox_cpp@::reset_tag_allow_quit(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
@unnamed@zTalkBox_cpp@::trigger_allow_quit(const xtextbox::jot&) 0.00% 100.00% +40
📈 @unnamed@zTalkBox_cpp@::parse_tag_trap(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 99.63% +107
@unnamed@zTalkBox_cpp@::reset_tag_trap(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
📈 @unnamed@zTalkBox_cpp@::stop_audio_effect() 0.00% 32.14% +27
📈 ztalkbox::load_settings(xIniFile&) 0.00% 95.96% +95

@AARJL
Copy link
Contributor Author

AARJL commented Jan 5, 2026

read_bool went to 0% when trying to make changes to it, I'll work with the team on that.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

main/SB/Game/zTalkBox

Section From To Bytes
📈 .rodata 0.00% 15.48% +70
📈 .sdata2 0.00% 42.86% +13
📈 .text 13.36% 20.27% +994
Function From To Bytes
@unnamed@zTalkBox_cpp@::read_bool(const substr&, bool) 0.00% 100.00% +188
@unnamed@zTalkBox_cpp@::reset_auto_wait() 2.22% 100.00% +176
@unnamed@zTalkBox_cpp@::reset_tag_auto_wait(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +112
@unnamed@zTalkBox_cpp@::trigger_auto_wait(const xtextbox::jot&) 0.00% 100.00% +56
@unnamed@zTalkBox_cpp@::reset_tag_sound(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
@unnamed@zTalkBox_cpp@::reset_tag_allow_quit(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
@unnamed@zTalkBox_cpp@::trigger_allow_quit(const xtextbox::jot&) 0.00% 100.00% +40
📈 @unnamed@zTalkBox_cpp@::parse_tag_trap(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 99.63% +107
@unnamed@zTalkBox_cpp@::reset_tag_trap(xtextbox::jot&, const xtextbox&, const xtextbox&, const xtextbox::split_tag&) 0.00% 100.00% +64
📈 @unnamed@zTalkBox_cpp@::stop_audio_effect() 0.00% 32.14% +27
📈 ztalkbox::load_settings(xIniFile&) 0.00% 95.96% +95

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