Match and link CRemoveColorOverrideInstruction

This commit is contained in:
Phillip Stephens 2023-01-11 12:16:02 -08:00
parent e0d723eaeb
commit d0b7837042
7 changed files with 40 additions and 8 deletions

View File

@ -3,8 +3,8 @@
.section .data .section .data
.balign 8 .balign 8
.global lbl_803ED6D8 .global __vt__31CRemoveColorOverrideInstruction
lbl_803ED6D8: __vt__31CRemoveColorOverrideInstruction:
# ROM: 0x3EA6D8 # ROM: 0x3EA6D8
.4byte 0 .4byte 0
.4byte 0 .4byte 0
@ -25,8 +25,8 @@ __dt__31CRemoveColorOverrideInstructionFv:
/* 80301848 002FE7A8 93 E1 00 0C */ stw r31, 0xc(r1) /* 80301848 002FE7A8 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8030184C 002FE7AC 7C 7F 1B 79 */ or. r31, r3, r3 /* 8030184C 002FE7AC 7C 7F 1B 79 */ or. r31, r3, r3
/* 80301850 002FE7B0 41 82 00 30 */ beq lbl_80301880 /* 80301850 002FE7B0 41 82 00 30 */ beq lbl_80301880
/* 80301854 002FE7B4 3C 60 80 3F */ lis r3, lbl_803ED6D8@ha /* 80301854 002FE7B4 3C 60 80 3F */ lis r3, __vt__31CRemoveColorOverrideInstruction@ha
/* 80301858 002FE7B8 38 03 D6 D8 */ addi r0, r3, lbl_803ED6D8@l /* 80301858 002FE7B8 38 03 D6 D8 */ addi r0, r3, __vt__31CRemoveColorOverrideInstruction@l
/* 8030185C 002FE7BC 90 1F 00 00 */ stw r0, 0(r31) /* 8030185C 002FE7BC 90 1F 00 00 */ stw r0, 0(r31)
/* 80301860 002FE7C0 41 82 00 10 */ beq lbl_80301870 /* 80301860 002FE7C0 41 82 00 10 */ beq lbl_80301870
/* 80301864 002FE7C4 3C 60 80 3E */ lis r3, __vt__12CInstruction@ha /* 80301864 002FE7C4 3C 60 80 3E */ lis r3, __vt__12CInstruction@ha

View File

@ -1739,10 +1739,10 @@ __ct__31CRemoveColorOverrideInstructionFi:
/* 80303358 003002B8 7C 7F 1B 79 */ or. r31, r3, r3 /* 80303358 003002B8 7C 7F 1B 79 */ or. r31, r3, r3
/* 8030335C 003002BC 41 82 00 20 */ beq lbl_8030337C /* 8030335C 003002BC 41 82 00 20 */ beq lbl_8030337C
/* 80303360 003002C0 3C 80 80 3E */ lis r4, __vt__12CInstruction@ha /* 80303360 003002C0 3C 80 80 3E */ lis r4, __vt__12CInstruction@ha
/* 80303364 003002C4 3C 60 80 3F */ lis r3, lbl_803ED6D8@ha /* 80303364 003002C4 3C 60 80 3F */ lis r3, __vt__31CRemoveColorOverrideInstruction@ha
/* 80303368 003002C8 38 04 9A 6C */ addi r0, r4, __vt__12CInstruction@l /* 80303368 003002C8 38 04 9A 6C */ addi r0, r4, __vt__12CInstruction@l
/* 8030336C 003002CC 90 1F 00 00 */ stw r0, 0(r31) /* 8030336C 003002CC 90 1F 00 00 */ stw r0, 0(r31)
/* 80303370 003002D0 38 03 D6 D8 */ addi r0, r3, lbl_803ED6D8@l /* 80303370 003002D0 38 03 D6 D8 */ addi r0, r3, __vt__31CRemoveColorOverrideInstruction@l
/* 80303374 003002D4 90 1F 00 00 */ stw r0, 0(r31) /* 80303374 003002D4 90 1F 00 00 */ stw r0, 0(r31)
/* 80303378 003002D8 93 DF 00 04 */ stw r30, 4(r31) /* 80303378 003002D8 93 DF 00 04 */ stw r30, 4(r31)
lbl_8030337C: lbl_8030337C:

View File

@ -545,7 +545,7 @@ LIBS = [
["Kyoto/Text/CPopStateInstruction", True], ["Kyoto/Text/CPopStateInstruction", True],
["Kyoto/Text/CPushStateInstruction", True], ["Kyoto/Text/CPushStateInstruction", True],
["Kyoto/Text/CRasterFont", False], ["Kyoto/Text/CRasterFont", False],
"Kyoto/Text/CRemoveColorOverrideInstruction", ["Kyoto/Text/CRemoveColorOverrideInstruction", True],
["Kyoto/Text/CSaveableState", True], ["Kyoto/Text/CSaveableState", True],
"Kyoto/Text/CTextExecuteBuffer", "Kyoto/Text/CTextExecuteBuffer",
"Kyoto/Text/CTextInstruction", "Kyoto/Text/CTextInstruction",

View File

@ -12,10 +12,13 @@ public:
void PushState(); void PushState();
void PopState(); void PopState();
void SetColor(EColorType type, const CTextColor& color); void SetColor(EColorType type, const CTextColor& color);
void RefreshPalette();
const TToken<CRasterFont>& GetFont() { return x0_state.GetFont(); } const TToken<CRasterFont>& GetFont() { return x0_state.GetFont(); }
void SetLineSpacing(float spacing) { x0_state.SetLineSpacing(spacing); } void SetLineSpacing(float spacing) { x0_state.SetLineSpacing(spacing); }
void SetExtraLineSpace(int spacing) { x0_state.SetLineExtraSpace(spacing); } void SetExtraLineSpace(int spacing) { x0_state.SetLineExtraSpace(spacing); }
rstl::vector<bool>& GetOverride() { return x0_state.GetOverride(); }
private: private:
CSaveableState x0_state; CSaveableState x0_state;
CBlockInstruction* x88_curBlock; CBlockInstruction* x88_curBlock;

View File

@ -0,0 +1,16 @@
#ifndef _CREMOVECOLOROVERRIDEINSTRUCTION
#define _CREMOVECOLOROVERRIDEINSTRUCTION
#include "Kyoto/Text/CInstruction.hpp"
class CRemoveColorOverrideInstruction : public CInstruction {
public:
explicit CRemoveColorOverrideInstruction(int idx) : x4_idx(idx) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
private:
int x4_idx;
};
#endif // _CREMOVECOLOROVERRIDEINSTRUCTION

View File

@ -18,6 +18,7 @@ public:
void SetLineSpacing(float spacing) { x74_lineSpacing = spacing; } void SetLineSpacing(float spacing) { x74_lineSpacing = spacing; }
void SetLineExtraSpace(int spacing) { x78_extraLineSpacing = spacing; } void SetLineExtraSpace(int spacing) { x78_extraLineSpacing = spacing; }
rstl::vector<bool>& GetOverride() { return x64_colorOverrides; }
private: private:
CDrawStringOptions x0_drawStringOptions; CDrawStringOptions x0_drawStringOptions;

View File

@ -0,0 +1,12 @@
#include "Kyoto/Text/CRemoveColorOverrideInstruction.hpp"
#include "Kyoto/Text/CFontRenderState.hpp"
void CRemoveColorOverrideInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const {
state.GetOverride()[x4_idx] = false;
state.RefreshPalette();
}
void CRemoveColorOverrideInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const {
Invoke(state, buf);
}