mirror of
https://github.com/zeldaret/tp
synced 2026-08-04 09:09:30 -04:00
m_Do_printf / JUTConsole
This commit is contained in:
@@ -5,12 +5,34 @@
|
||||
|
||||
namespace JGadget {
|
||||
struct TLinkListNode {
|
||||
TLinkListNode() {
|
||||
mNext = NULL;
|
||||
mPrev = NULL;
|
||||
}
|
||||
|
||||
TLinkListNode* mNext;
|
||||
TLinkListNode* mPrev;
|
||||
};
|
||||
|
||||
struct TNodeLinkList {
|
||||
struct iterator {};
|
||||
struct iterator {
|
||||
iterator(TLinkListNode* pNode) { node = pNode; }
|
||||
iterator(const iterator& iter) { *this = iter; }
|
||||
|
||||
TLinkListNode* node;
|
||||
};
|
||||
|
||||
TNodeLinkList() : mListNode() { Initialize_(); }
|
||||
void Initialize_() {
|
||||
ptr = NULL;
|
||||
mListNode.mNext = &mListNode;
|
||||
mListNode.mPrev = &mListNode;
|
||||
}
|
||||
|
||||
iterator end() {
|
||||
iterator iter(&mListNode);
|
||||
return iter;
|
||||
}
|
||||
|
||||
/* 802DCA1C */ ~TNodeLinkList();
|
||||
/* 802DCAA0 */ void erase(JGadget::TNodeLinkList::iterator, JGadget::TNodeLinkList::iterator);
|
||||
@@ -20,6 +42,38 @@ struct TNodeLinkList {
|
||||
/* 802DCBA8 */ void Insert(JGadget::TNodeLinkList::iterator, JGadget::TLinkListNode*);
|
||||
/* 802DCBD4 */ void Erase(JGadget::TLinkListNode*);
|
||||
/* 802DCBF8 */ void Remove(JGadget::TLinkListNode*);
|
||||
|
||||
/* 0x00 */ TNodeLinkList* ptr;
|
||||
/* 0x04 */ TLinkListNode mListNode;
|
||||
}; // Size: 0xC
|
||||
|
||||
template <typename T, int I>
|
||||
struct TLinkList : public TNodeLinkList {
|
||||
TLinkList() : TNodeLinkList() {}
|
||||
|
||||
struct iterator : TNodeLinkList::iterator {
|
||||
iterator(TNodeLinkList::iterator iter) : TNodeLinkList::iterator(iter) {}
|
||||
};
|
||||
|
||||
TLinkListNode* Element_toNode(T* element) const {
|
||||
return &element->mListNode;
|
||||
}
|
||||
|
||||
void Insert(TLinkList::iterator iter, T* element) {
|
||||
TLinkListNode* node = Element_toNode(element);
|
||||
TNodeLinkList::Insert(iter, node);
|
||||
}
|
||||
|
||||
TLinkList::iterator end() {
|
||||
TNodeLinkList::iterator node_iter = TNodeLinkList::end();
|
||||
TLinkList::iterator iter(node_iter);
|
||||
return iter;
|
||||
}
|
||||
|
||||
void Push_back(T* element) {
|
||||
TLinkList::iterator iter(TLinkList::end());
|
||||
this->Insert(iter, element);
|
||||
}
|
||||
};
|
||||
|
||||
}; // namespace JGadget
|
||||
|
||||
@@ -5,24 +5,27 @@
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JUTConsole : public JKRDisposer {
|
||||
public:
|
||||
enum EConsoleType {};
|
||||
enum EConsoleType {
|
||||
UNK_TYPE2 = 2,
|
||||
};
|
||||
|
||||
/* 802E73E4 */ void create(unsigned int, void*, u32);
|
||||
/* 802E7354 */ void create(unsigned int, unsigned int, JKRHeap*);
|
||||
/* 802E746C */ JUTConsole(unsigned int, unsigned int, bool);
|
||||
/* 802E75CC */ void getObjectSizeFromBufferSize(unsigned int, unsigned int);
|
||||
/* 802E75DC */ void getLineFromObjectSize(u32, unsigned int);
|
||||
/* 802E75CC */ static size_t getObjectSizeFromBufferSize(unsigned int, unsigned int);
|
||||
/* 802E75DC */ static size_t getLineFromObjectSize(u32, unsigned int);
|
||||
/* 802E75EC */ void clear();
|
||||
/* 802E7648 */ void doDraw(JUTConsole::EConsoleType) const;
|
||||
/* 802E7BB8 */ void print_f(char const*, ...);
|
||||
/* 802E7C38 */ void print(char const*);
|
||||
/* 802E7F7C */ void dumpToTerminal(unsigned int);
|
||||
/* 802E80A8 */ void scroll(int);
|
||||
/* 802E8184 */ void getUsedLine() const;
|
||||
/* 802E8184 */ int getUsedLine() const;
|
||||
/* 802E81A8 */ int getLineOffset() const;
|
||||
|
||||
/* 802E755C */ virtual ~JUTConsole();
|
||||
@@ -44,11 +47,27 @@ public:
|
||||
|
||||
void setVisible(bool visible) { mVisible = visible; }
|
||||
|
||||
private:
|
||||
void setLineAttr(int param_0, u8 param_1) {
|
||||
*((u8*)mBuf + (field_0x20 + 2) * param_0) = param_1;
|
||||
}
|
||||
|
||||
u8* getLinePtr(int param_0) const {
|
||||
return ((u8*)mBuf + (field_0x20 + 2) * param_0 + 1);
|
||||
}
|
||||
|
||||
int diffIndex(int param_0, int param_1) const {
|
||||
int diff = param_1 - param_0;
|
||||
if (diff >= 0) {
|
||||
return diff;
|
||||
}
|
||||
return diff += field_0x24;
|
||||
}
|
||||
|
||||
/* 0x18 */ JGadget::TLinkListNode mListNode;
|
||||
private:
|
||||
/* 0x20 */ u32 field_0x20;
|
||||
/* 0x24 */ u32 field_0x24;
|
||||
/* 0x28 */ u32 field_0x28;
|
||||
/* 0x28 */ void* mBuf;
|
||||
/* 0x2C */ bool field_0x2c;
|
||||
/* 0x30 */ int field_0x30;
|
||||
/* 0x34 */ int field_0x34;
|
||||
@@ -70,4 +89,32 @@ private:
|
||||
/* 0x6B */ bool field_0x6b;
|
||||
}; // Size: 0x6C
|
||||
|
||||
class JUTConsoleManager {
|
||||
public:
|
||||
/* 802E81CC */ JUTConsoleManager();
|
||||
/* 802E81F4 */ static JUTConsoleManager* createManager(JKRHeap*);
|
||||
/* 802E8240 */ void appendConsole(JUTConsole*);
|
||||
/* 802E82B0 */ void removeConsole(JUTConsole*);
|
||||
/* 802E8384 */ void draw() const;
|
||||
/* 802E8450 */ void drawDirect(bool) const;
|
||||
/* 802E84C4 */ void setDirectConsole(JUTConsole*);
|
||||
|
||||
static JUTConsoleManager* getManager() { return sManager; }
|
||||
|
||||
static JUTConsoleManager* sManager;
|
||||
|
||||
private:
|
||||
/* 0x00 */ JGadget::TLinkList<JUTConsole, 4> mLinkList;
|
||||
/* 0x0C */ JUTConsole* mActiveConsole;
|
||||
/* 0x10 */ JUTConsole* mDirectConsole;
|
||||
}; // Size: 0x14
|
||||
|
||||
void JUTConsole_print_f_va_(JUTConsole*, const char*, va_list);
|
||||
void JUTSetReportConsole(JUTConsole*);
|
||||
JUTConsole* JUTGetReportConsole();
|
||||
void JUTSetWarningConsole(JUTConsole*);
|
||||
JUTConsole* JUTGetWarningConsole();
|
||||
void JUTReportConsole_f_va(const char*, va_list);
|
||||
void JUTReportConsole_f(const char*, ...);
|
||||
|
||||
#endif /* JUTCONSOLE_H */
|
||||
|
||||
Reference in New Issue
Block a user