Skip to content
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

Continue with d_tag_processor #94

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3904,7 +3904,7 @@ __ct__15dTagProcessor_cFv = .text:0x800B35C0; // type:function size:0x260
__dt__15dTagProcessor_cFv = .text:0x800B3820; // type:function size:0x58
fn_800B3880 = .text:0x800B3880; // type:function size:0x8C
eventFlowTextProcessingRelated__15dTagProcessor_cFP10dTextBox_cPCwPwUlPUl = .text:0x800B3910; // type:function size:0x980
fn_800B4290 = .text:0x800B4290; // type:function size:0x5AC
alsoProcessingRelated__15dTagProcessor_cFP10dTextBox_cPCwPwlPUsP27SomeTextProcessingOutStruct = .text:0x800B4290; // type:function size:0x5AC
Process__15dTagProcessor_cFUsPQ34nw4r2ut15PrintContext<w> = .text:0x800B4840; // type:function size:0x10
CalcRect__15dTagProcessor_cFPQ34nw4r2ut4RectUsPQ34nw4r2ut15PrintContext<w> = .text:0x800B4850; // type:function size:0x4
ProcessTags__15dTagProcessor_cFPQ34nw4r2ut4RectUsPQ34nw4r2ut15PrintContext<w> = .text:0x800B4860; // type:function size:0x78C
Expand Down Expand Up @@ -3935,20 +3935,20 @@ fn_800B6450__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>UcPw
fn_800B6790 = .text:0x800B6790; // type:function size:0x750
makeSpaceForIconMaybe__15dTagProcessor_cFPQ34nw4r2ut4RectPQ34nw4r2ut15PrintContext<w>Pw = .text:0x800B6EE0; // type:function size:0x1E8
fn_800B70D0 = .text:0x800B70D0; // type:function size:0x3A4
somethingWithScrapperAndMusic = .text:0x800B7480; // type:function size:0xB8
somethingWithScrapperAndMusic__15dTagProcessor_cFPw = .text:0x800B7480; // type:function size:0xB8
restoreColor__15dTagProcessor_cFPQ34nw4r2ut15PrintContext<w>Uc = .text:0x800B7540; // type:function size:0x250
writeTextNormal__15dTagProcessor_cFPCwPwPlUcl = .text:0x800B7790; // type:function size:0xD8
symbolToFontIdx__15dTagProcessor_cFl = .text:0x800B7870; // type:function size:0x10
fn_800B7880 = .text:0x800B7880; // type:function size:0x210
fn_800B7880__15dTagProcessor_cFUl = .text:0x800B7880; // type:function size:0x210
fn_800B7A90 = .text:0x800B7A90; // type:function size:0x9C
fn_800B7B30 = .text:0x800B7B30; // type:function size:0x46C
setStringArg__15dTagProcessor_cFPCwl = .text:0x800B7FA0; // type:function size:0xA0
fn_800B8040__15dTagProcessor_cFScUl = .text:0x800B8040; // type:function size:0x1F0
fn_800B8230 = .text:0x800B8230; // type:function size:0x10C
fn_800B8340 = .text:0x800B8340; // type:function size:0x18C
fn_800B84D0 = .text:0x800B84D0; // type:function size:0x8C
fn_800B8560 = .text:0x800B8560; // type:function size:0x54
fn_800B85C0 = .text:0x800B85C0; // type:function size:0x290
fn_800B8560__15dTagProcessor_cFl = .text:0x800B8560; // type:function size:0x54
fn_800B85C0__15dTagProcessor_cFl = .text:0x800B85C0; // type:function size:0x290
getNumLines__15dTagProcessor_cFl = .text:0x800B8850; // type:function size:0x38
getTextCommand__15dTagProcessor_cFwPCwPUcPlPPw = .text:0x800B8890; // type:function size:0x38
process0xFCommand__15dTagProcessor_cFwPCwPl = .text:0x800B88D0; // type:function size:0xC
Expand Down
25 changes: 25 additions & 0 deletions include/d/d_tag_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
#include "nw4r/ut/ut_TagProcessorBase.h"
#include "nw4r/ut/ut_TextWriterBase.h"


struct SomeTextProcessingOutStruct {
/* 0x00 */ f32 f0;
/* 0x04 */ f32 f1;
/* 0x08 */ f32 f2;
/* 0x0C */ wchar_t field_0x0C;
/* 0x0E */ wchar_t field_0x0E;
/* 0x10 */ UNKWORD field_0x10;
};

// inofficial name
// size: 0xEF4
class dTagProcessor_c : public nw4r::ut::TagProcessorBase<wchar_t> {
Expand All @@ -19,6 +29,11 @@ class dTagProcessor_c : public nw4r::ut::TagProcessorBase<wchar_t> {
virtual nw4r::ut::Operation CalcRect(nw4r::ut::Rect *rect, u16 ch, nw4r::ut::PrintContext<wchar_t> *ctx) override;

nw4r::ut::Operation ProcessTags(nw4r::ut::Rect *rect, u16 ch, nw4r::ut::PrintContext<wchar_t> *ctx);

void alsoProcessingRelated(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, s32 unkArg, u16 *pOutLen, SomeTextProcessingOutStruct *outStructs);
f32 fn_800B8560(s32);
f32 fn_800B85C0(s32);
void somethingWithScrapperAndMusic(wchar_t* src);

void changeScale(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, bool);
wchar_t *writeItem(wchar_t *dest, wchar_t *src, s32 *, s32);
Expand Down Expand Up @@ -69,6 +84,16 @@ class dTagProcessor_c : public nw4r::ut::TagProcessorBase<wchar_t> {
s32 tick0x830();

private:
wchar_t *getTmpBuffer() {
return field_0x008[field_0x90E - 1];
}

void onWriteTmpBuffer() {
if (field_0x90E - 1 < 4) {
field_0x808[field_0x90E - 1]++;
}
}

/* 0x004 */ dTextBox_c *field_0x004;
/* 0x008 */ wchar_t field_0x008[4][256];
/* 0x808 */ wchar_t field_0x808[4];
Expand Down
11 changes: 11 additions & 0 deletions include/d/d_textunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class UnkTextThing {
return 0.0f;
}

inline static f32 getField0x764() {
if (sInstance != nullptr) {
return sInstance->field_0x764;
}
return 0.0f;
}

inline static f32 getField0x768() {
if (sInstance != nullptr) {
return sInstance->field_0x768;
Expand All @@ -35,6 +42,10 @@ class UnkTextThing {
return 0.0f;
}

inline static f32 getField0x788() {
return sInstance->field_0x76C;
}

inline static f32 getFn800B1F70() {
if (sInstance != nullptr) {
return sInstance->fn_800B1F70();
Expand Down
7 changes: 4 additions & 3 deletions include/libms/msgfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define LIBMS_MSGFILE_H

#include "common.h"
#include <wchar.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -17,9 +18,9 @@ struct MsbtAttrInfo {
struct MsbtInfo *LMS_InitMessage(void *data);
void LMS_CloseMessage(struct MsbtInfo *info);
int LMS_GetTextIndexByLabel(struct MsbtInfo *info, const char *label);
const char *LMS_GetText(struct MsbtInfo *info, int index);
const char *LMS_GetTextByLabel(struct MsbtInfo *info, const char *label);
const char *LMS_GetLabelByTextIndex(struct MsbtInfo *info, int index);
const wchar_t *LMS_GetText(struct MsbtInfo *info, int index);
const wchar_t *LMS_GetTextByLabel(struct MsbtInfo *info, const char *label);
const wchar_t *LMS_GetLabelByTextIndex(struct MsbtInfo *info, int index);
struct MsbtAttrInfo *LMS_GetAttribute(struct MsbtInfo *info, int index);

#ifdef __cplusplus
Expand Down
Loading