Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b79fc69
Matched 10 small functions
AARJL Dec 21, 2025
1c48385
ztalkbox load and state_type update
AARJL Dec 22, 2025
9ef4f04
Made suggested changes for primative types and updated variables. als…
AARJL Dec 22, 2025
bd48ce3
Merge branch 'bfbbdecomp:main' into main
AARJL Jan 2, 2026
30db20c
Merge remote-tracking branch 'upstream/main'
AARJL Jan 4, 2026
634562c
Merge branch 'main' of https://github.com/AARJL/bfbb
AARJL Jan 4, 2026
da22f62
Update
AARJL Jan 4, 2026
9785b64
Made suggested updates
AARJL Jan 5, 2026
ae0fe8a
Reverted read_bool back to the state it was at
AARJL Jan 5, 2026
eca2e2e
13 functions in zTalkBox.cpp missing 100% match
AARJL Mar 1, 2026
443c4c5
Merge branch 'main' of https://github.com/AARJL/bfbb
AARJL Mar 1, 2026
9fff40b
13 functions in zTalkBox.cpp under 100% match
AARJL Mar 1, 2026
228625b
Merge branch 'bfbbdecomp:main' into main
AARJL Mar 1, 2026
355d401
Reverted back containers.h
AARJL Mar 1, 2026
c0e6eaf
Fixed containers.h
AARJL Mar 1, 2026
b3479ba
Resolved logic formatting for variable 'i'
AARJL Mar 1, 2026
3c2802d
Updated cb_dispatch to use correct Event tags
AARJL Mar 1, 2026
4c71f8c
Merge branch 'bfbbdecomp:main' into main
AARJL Mar 1, 2026
58da531
Merge branch 'main' of https://github.com/AARJL/bfbb
AARJL Mar 1, 2026
c89d0cc
Fixed mistake with "const" in sound_queue class.
AARJL Mar 1, 2026
c3b4245
Some cleanup of zTalkBox before I moved on
AARJL Aug 13, 2026
cc95af0
Merge branch 'main' of https://github.com/AARJL/bfbb
AARJL Aug 13, 2026
c8a17a8
Remove duplicated declarations from botched merge
AARJL Aug 15, 2026
4a73a9b
Fixed regression of zEntPlayerOOBState of changes
AARJL Aug 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/SB/Core/x/xFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ struct xtextbox::layout
F32 yextent(F32 max, S32& size, S32 begin_jot, S32 end_jot) const;
bool changed(const xtextbox& ctb);
size_t jots_size() const;
jot* jots() const;
jot* jots()
const //added definition here to get gw match in zTalkBox.cpp for xtextbox::layout::jots() const
{
return (jot*)_jots;
}
};

void render_fill_rect(const basic_rect<F32>& bounds, iColor_tag color);
Expand Down
250 changes: 126 additions & 124 deletions src/SB/Game/zTalkBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ namespace
{ "true", 4 }, { "t", 1 }, { "on", 2 }

};

/// BUG: The string "no" has a size of 3 but should have a size of 3
/// Could lead to read_bool returing default value when reading tags that pass "no" as the substr
static const substr negative[6] = { { "no", 3 }, { "n", 1 }, { "0", 1 },
{ "false", 5 }, { "f", 1 }, { "off", 3 }

Expand Down Expand Up @@ -534,11 +537,6 @@ namespace
}
}
}
void __deadstripped_zTalkbox()
{
xprintf("pointer");
xprintf("location");
}
static void reset_tag_sound(xtextbox::jot& j, const xtextbox& ctb, const xtextbox& tb,
const xtextbox::split_tag& ti)
{
Expand Down Expand Up @@ -576,13 +574,12 @@ namespace
if (shared.sounds.size() > 0)
{
shared.sounds.pop();
return 1;
}
break;
case sound_context::ACTION_SET:
shared.sounds.clear();
speak_stop();
return 1;
break;
}

if (c.id == 0)
Expand All @@ -591,11 +588,14 @@ namespace
}

F32 vol = c.volume.left;
if (!(vol > c.volume.right))
if (vol > c.volume.right)
{
vol = vol;
}
else
{
vol = c.volume.right;
}

shared.sounds.play(c.id, shared.volume * vol, 0.0f, 0x80, 0,
(U32)&shared.stream_locked[shared.next_stream], SND_CAT_DIALOG);

Expand Down Expand Up @@ -931,11 +931,20 @@ namespace
}
static void stop_audio_effect()
{
if ((shared.active) && (shared.active->asset->audio_effect != 1))
if (shared.active == NULL)
{
zMusicSetVolume(1.0f, music_fade_delay);
return;
}

switch (shared.active->asset->audio_effect)
{
case 1:
zMusicSetVolume(1.0f, music_fade_delay);
break;
case 0:
default:
break;
}
}

static void deactivate()
Expand Down Expand Up @@ -1057,13 +1066,10 @@ namespace
active.quit_box->activate();
}
}
else if (shared.allow_quit && shared.quit_delay <= 0.0f)
{
active.quit_box->deactivate();
}
else if (active.prompt.noquit)
else if (((!shared.allow_quit) || (shared.quit_delay > 0.0f)) && (active.prompt.noquit))
{
active.quit_box->set_text(active.prompt.noquit);

if (active.flag.visible)
{
active.quit_box->activate();
Expand All @@ -1075,6 +1081,7 @@ namespace
}
}
}

static void update_prompt_status(F32 dt)
{
if (!shared.wait.type.prompt)
Expand Down Expand Up @@ -1331,6 +1338,13 @@ void ztalkbox::set_text(const char* s)
shared.state = shared.states[1];
shared.state->start();
}
void state_type::start()
{
}

void state_type::stop()
{
}
void ztalkbox::set_text(U32 id)
{
if (id == 0)
Expand Down Expand Up @@ -1615,10 +1629,10 @@ namespace
wait_state_type::wait_state_type() : state_type((state_enum)3)
{
}
next_state_type::next_state_type() : state_type((state_enum)2)
next_state_type::next_state_type() : state_type(STATE_NEXT)
{
}
start_state_type::start_state_type() : state_type((state_enum)1)
start_state_type::start_state_type() : state_type(STATE_START)
{
}

Expand Down Expand Up @@ -1664,11 +1678,8 @@ void ztalkbox::update_all(xScene& s, F32 dt)
{
trigger_pads_enum tp = (trigger_pads_enum)shared.active->asset->trigger_pads;

if (tp == TP_ACTIVE && !globals.cmgr)
{
trigger_pads(*pad_pressed());
}
else if (tp == TP_TRAPPED && globals.cmgr)
if ((tp == TP_ACTIVE && !globals.player.ControlOff) ||
(tp == TP_TRAPPED && globals.player.ControlOff))
{
trigger_pads(*pad_pressed());
}
Expand Down Expand Up @@ -1754,23 +1765,105 @@ void ztalkbox::permit(U32 add_flags, U32 remove_flags)

namespace
{
void stop_state_type::start()
static bool trigger_jot(S32 index);
static bool trigger_jot(const xtextbox::jot& j);

void start_state_type::start()
{
shared.page_end_jot = 0;
shared.end_jot = 0;
shared.begin_jot = 0;
shared.wait.reset_type();
shared.wait.type.time = true;
shared.wait.delay = 0.0f;
shared.quit_delay = 0.25f;
shared.prompt_delay = 0.25f;
shared.quit_ready = false;
shared.prompt_ready = false;
refresh_prompts();
}
void stop_state_type::stop()
void start_state_type::stop()
{
}

state_enum stop_state_type::update(xScene& scn, F32 dt)
state_enum start_state_type::update(xScene& scn, F32 dt)
{
return (state_enum)-1;
return (state_enum)2;
}
void next_state_type::start()
{
if (shared.end_jot == shared.page_end_jot)
{
xtextbox& tb = shared.active->dialog_box->tb;
S32 jots_size = ((xtextbox::layout*)&shared.lt)->jots_size();
((xtextbox::layout*)&shared.lt)->jots();

shared.begin_jot = shared.end_jot;
S32 size;
tb.yextent(tb.bounds.h, size, *(xtextbox::layout*)&shared.lt, shared.begin_jot, -1);

if ((size == 0) && (jots_size > shared.begin_jot))
{
size = 1;
}

shared.page_end_jot = shared.begin_jot + size;
}

while (shared.end_jot < shared.page_end_jot)
{
if (!trigger_jot(shared.end_jot++))
{
break;
}
}

if (shared.end_jot == shared.page_end_jot)
{
xtextbox::jot* jots = ((xtextbox::layout*)&shared.lt)->jots();
xtextbox::jot* last = &jots[shared.end_jot] - 1;

if ((last->flag.page_break) && ((S32)(shared.end_jot - 1) > shared.begin_jot))
{
last--;
}
if (!is_wait_jot(*last))
{
shared.wait = shared.auto_wait;
}
}
return;
}
void state_type::start()
static bool trigger_jot(S32 index)
{
xtextbox::jot* jots = ((xtextbox::layout*)&shared.lt)->jots();
return trigger_jot(jots[index]);
}
static bool trigger_jot(const xtextbox::jot& j)
{
if (!j.tag)
{
return true;
}

if (j.tag->context)
{
return ((bool (*)(const xtextbox::jot&))j.tag->context)(j);
}

void state_type::stop()
return true;
}

void next_state_type::stop()
{
}
state_enum next_state_type::update(xScene& scn, F32 dt)
{
if (shared.begin_jot == shared.page_end_jot)
{
return (state_enum)4;
}
return (state_enum)3;
}
void wait_state_type::start()
{
Expand Down Expand Up @@ -1805,10 +1898,6 @@ namespace
{
trigger(0x1C5);
}
else
{
trigger(0x1C6);
}
}

shared.wait.reset_type();
Expand Down Expand Up @@ -1894,103 +1983,16 @@ namespace

return (state_enum)3;
}
static bool trigger_jot(const xtextbox::jot& j)
{
if (!j.tag)
{
return true;
}

if (j.tag->context)
{
return ((bool (*)(const xtextbox::jot&))j.tag->context)(j);
}

return true;
}
static bool trigger_jot(S32 index)
{
xtextbox::jot* jots = ((xtextbox::layout*)&shared.lt)->jots();
return trigger_jot(jots[index]);
}
void next_state_type::start()
{
if (shared.end_jot == shared.page_end_jot)
{
xtextbox& tb = shared.active->dialog_box->tb;
S32 jots_size = ((xtextbox::layout*)&shared.lt)->jots_size();
((xtextbox::layout*)&shared.lt)->jots();

shared.begin_jot = shared.end_jot;
S32 size;
tb.yextent(tb.bounds.h, size, *(xtextbox::layout*)&shared.lt, shared.begin_jot, -1);

if (size == 0 && jots_size > shared.begin_jot)
{
size = 1;
}

shared.page_end_jot = shared.begin_jot + size;
}

while (shared.end_jot < shared.page_end_jot)
{
shared.end_jot++;
if (!trigger_jot(shared.end_jot - 1))
{
break;
}
}

if (shared.end_jot == shared.page_end_jot)
{
xtextbox::jot* jots = ((xtextbox::layout*)&shared.lt)->jots();
xtextbox::jot* last = &jots[shared.end_jot - 1];

if (last->flag.page_break && (S32)(shared.end_jot - 1) > shared.begin_jot)
{
last--;
}

if (!is_wait_jot(*last))
{
shared.wait = shared.auto_wait;
}
}
}

void next_state_type::stop()
{
}
state_enum next_state_type::update(xScene& scn, F32 dt)
{
if (shared.begin_jot == shared.page_end_jot)
{
return (state_enum)4;
}
return (state_enum)3;
}
void start_state_type::start()
void stop_state_type::start()
{
shared.page_end_jot = 0;
shared.end_jot = 0;
shared.begin_jot = 0;
shared.wait.reset_type();
shared.wait.type.time = true;
shared.wait.delay = 0.0f;
shared.quit_delay = 0.25f;
shared.prompt_delay = 0.25f;
shared.quit_ready = false;
shared.prompt_ready = false;
refresh_prompts();
}
void start_state_type::stop()
void stop_state_type::stop()
{
}

state_enum start_state_type::update(xScene& scn, F32 dt)
state_enum stop_state_type::update(xScene& scn, F32 dt)
{
return (state_enum)2;
return (state_enum)-1;
}

} // namespace
Loading
Loading