mirror of https://github.com/zeldaret/tp.git
JAHostIO, JAWExtSystem debug (#2985)
This commit is contained in:
parent
47ac1d4a4c
commit
f156a2a413
21
configure.py
21
configure.py
|
|
@ -1098,6 +1098,25 @@ config.libs = [
|
|||
Object(MatchingFor(ALL_GCN), "JSystem/JAudio2/JAUStreamFileTable.cpp"),
|
||||
],
|
||||
),
|
||||
JSystemLib(
|
||||
"JAWExtSystem",
|
||||
[
|
||||
Object(Matching, "JSystem/JAWExtSystem/JAWSystem.cpp"),
|
||||
Object(NonMatching, "JSystem/JAWExtSystem/JAWWindow.cpp"),
|
||||
Object(Matching, "JSystem/JAWExtSystem/JAWWindow3D.cpp"),
|
||||
Object(NonMatching, "JSystem/JAWExtSystem/JAWGraphContext.cpp"),
|
||||
Object(NonMatching, "JSystem/JAWExtSystem/JAWExtSystem.cpp"),
|
||||
],
|
||||
),
|
||||
JSystemLib(
|
||||
"JAHostIO",
|
||||
[
|
||||
Object(Matching, "JSystem/JAHostIO/JAHioMessage.cpp"),
|
||||
Object(NonMatching, "JSystem/JAHostIO/JAHioMgr.cpp"),
|
||||
Object(NonMatching, "JSystem/JAHostIO/JAHioNode.cpp"),
|
||||
Object(NonMatching, "JSystem/JAHostIO/JAHioUtil.cpp"),
|
||||
]
|
||||
),
|
||||
JSystemLib(
|
||||
"JMessage",
|
||||
[
|
||||
|
|
@ -1136,6 +1155,8 @@ config.libs = [
|
|||
Object(MatchingFor(ALL_GCN), "Z2AudioLib/Z2WolfHowlMgr.cpp"),
|
||||
Object(MatchingFor(ALL_GCN), "Z2AudioLib/Z2SpeechMgr2.cpp"),
|
||||
Object(Equivalent, "Z2AudioLib/Z2AudioMgr.cpp"), # weak func order
|
||||
Object(NonMatching, "Z2AudioLib/Z2DebugSys.cpp"),
|
||||
Object(NonMatching, "Z2AudioLib/Z2SoundPlayer.cpp"),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ public:
|
|||
virtual s32 getGrafType() const { return 1; }
|
||||
virtual void setLookat();
|
||||
|
||||
f32 getWidthPower() const { return mBounds.getWidth() / mOrtho.getWidth(); }
|
||||
f32 getHeightPower() const { return mBounds.getHeight() / mOrtho.getHeight(); }
|
||||
f32 getWidthPower() { return mBounds.getWidth() / mOrtho.getWidth(); }
|
||||
f32 getHeightPower() { return mBounds.getHeight() / mOrtho.getHeight(); }
|
||||
|
||||
void setOrtho(f32 x, f32 y, f32 width, f32 height, f32 far, f32 near) {
|
||||
JGeometry::TBox2<f32> ortho(x, y, x + width, y + height);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@ public:
|
|||
|
||||
virtual ~J2DPrint();
|
||||
|
||||
JUTFont* getFont() const { return mFont; }
|
||||
f32 getCursorV() const { return mCursorV; }
|
||||
void setCharColor(JUtility::TColor color) { mCharColor = color; }
|
||||
void setGradColor(JUtility::TColor color) { mGradColor = color; }
|
||||
|
||||
f32 print_va(u8 alpha, const char* fmt, va_list args) {
|
||||
return J2DPrint_print_alpha_va(this, alpha, fmt, args);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,15 +256,15 @@ public:
|
|||
private:
|
||||
/* 0x0 */ u32 mFlags;
|
||||
|
||||
GXIndTexStageID getIndStage() const { return (GXIndTexStageID)(mFlags & 0x03); }
|
||||
GXIndTexFormat getIndFormat() const { return (GXIndTexFormat)((mFlags >> 2) & 0x03); }
|
||||
GXIndTexBiasSel getBiasSel() const { return (GXIndTexBiasSel)((mFlags >> 4) & 0x07); }
|
||||
GXIndTexWrap getWrapS() const { return (GXIndTexWrap)((mFlags >> 8) & 0x07); }
|
||||
GXIndTexWrap getWrapT() const { return (GXIndTexWrap)((mFlags >> 11) & 0x07); }
|
||||
GXIndTexMtxID getMtxSel() const { return (GXIndTexMtxID)((mFlags >> 16) & 0x0F); }
|
||||
GXBool getPrev() const { return (GXBool)((mFlags >> 20) & 0x01); }
|
||||
GXBool getLod() const { return (GXBool)((mFlags >> 21) & 0x01); }
|
||||
GXIndTexAlphaSel getAlphaSel() const { return (GXIndTexAlphaSel)((mFlags >> 22) & 0x03); }
|
||||
u8 getIndStage() const { return (mFlags & 0x03); }
|
||||
u8 getIndFormat() const { return (mFlags >> 2) & 0x03; }
|
||||
u8 getBiasSel() const { return (mFlags >> 4) & 0x07; }
|
||||
u8 getWrapS() const { return (mFlags >> 8) & 0x07; }
|
||||
u8 getWrapT() const { return (mFlags >> 11) & 0x07; }
|
||||
u8 getMtxSel() const { return (mFlags >> 16) & 0x0F; }
|
||||
u8 getPrev() const { return (mFlags >> 20) & 0x01; }
|
||||
u8 getLod() const { return (mFlags >> 21) & 0x01; }
|
||||
u8 getAlphaSel() const { return (mFlags >> 22) & 0x03; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -171,7 +171,9 @@ public:
|
|||
/* 0x0130 */ u8 mFlags;
|
||||
/* 0x0131 */ bool mTextFontOwned;
|
||||
/* 0x0132 */ u16 mStringLength;
|
||||
#if PLATFORM_GCN
|
||||
/* 0x0134 */ u8 field_0x134[4];
|
||||
#endif
|
||||
}; // Size: 0x138
|
||||
|
||||
#endif /* J2DTEXTBOX_H */
|
||||
|
|
|
|||
|
|
@ -7,6 +7,13 @@
|
|||
class JSURandomInputStream;
|
||||
class JUTTexture;
|
||||
|
||||
enum J2DTextureBase {
|
||||
TEXTUREBASE_0 = 0,
|
||||
};
|
||||
|
||||
enum J2DWindowMirror {
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
*
|
||||
|
|
@ -32,8 +39,12 @@ public:
|
|||
J2DWindow(J2DPane*, JSURandomInputStream*, J2DMaterial*);
|
||||
J2DWindow(J2DPane*, JSURandomInputStream*, JKRArchive*);
|
||||
J2DWindow();
|
||||
J2DWindow(u64, const JGeometry::TBox2<f32>&, const char*, J2DTextureBase, const ResTLUT*);
|
||||
void initiate(const ResTIMG*, const ResTIMG*, const ResTIMG*, const ResTIMG*, const ResTLUT*, J2DWindowMirror, const JGeometry::TBox2<f32>&);
|
||||
void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
|
||||
void initinfo();
|
||||
void initinfo2();
|
||||
static J2DWindowMirror convertMirror(J2DTextureBase);
|
||||
void draw_private(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
|
||||
void setContentsColor(JUtility::TColor, JUtility::TColor, JUtility::TColor,
|
||||
JUtility::TColor);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAHSOUNDPLAYERNODE_H
|
||||
#define JAHSOUNDPLAYERNODE_H
|
||||
|
||||
#include "JSystem/JAHostIO/JAHFrameNode.h"
|
||||
|
||||
class JAHSoundPlayerNode : public JAHFrameNode {
|
||||
public:
|
||||
JAHSoundPlayerNode();
|
||||
};
|
||||
|
||||
#endif /* JAHSOUNDPLAYERNODE_H */
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef JAHFRAMENODE_H
|
||||
#define JAHFRAMENODE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
|
||||
class JAHVirtualNode;
|
||||
|
||||
class JAHFrameNode : public JAHioNode {
|
||||
public:
|
||||
JAHFrameNode(const char*);
|
||||
/* vt[07] */ virtual ~JAHFrameNode();
|
||||
/* vt[02] */ virtual void listenPropertyEvent(const JORPropertyEvent*);
|
||||
/* vt[05] */ virtual void genMessage(JORMContext*);
|
||||
/* vt[06] */ virtual void listenNodeEvent(const JORNodeEvent*);
|
||||
/* vt[0C] */ virtual s32 getNodeType();
|
||||
/* vt[11] */ virtual void onCurrentNodeFrame();
|
||||
/* vt[12] */ virtual void onFrame();
|
||||
|
||||
void framework();
|
||||
void currentFramework();
|
||||
|
||||
JSULink<JAHFrameNode>* getFrameNodeLink() { return &mFrameNodeLink; }
|
||||
|
||||
/* 0x44 */ JSUTree<JAHVirtualNode> mTree;
|
||||
/* 0x60 */ JSULink<JAHFrameNode> mFrameNodeLink;
|
||||
};
|
||||
|
||||
#endif /* JAHFRAMENODE_H */
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef JAHPUBDEFINE_H
|
||||
#define JAHPUBDEFINE_H
|
||||
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
template<class T>
|
||||
class JAHSingletonBase {
|
||||
public:
|
||||
JAHSingletonBase() { sInstance = (T*)this; }
|
||||
virtual ~JAHSingletonBase() { sInstance = NULL; }
|
||||
|
||||
static T* newInstance() {
|
||||
JUT_ASSERT(82, sInstance==NULL);
|
||||
if (!sInstance) {
|
||||
sInstance = new T();
|
||||
}
|
||||
JUT_ASSERT(85, sInstance!=NULL);
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
static T* getIns() {
|
||||
JUT_ASSERT(110, sInstance);
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
static T* sInstance;
|
||||
};
|
||||
|
||||
#endif /* JAHPUBDEFINE_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAHUTABLEDIT_H
|
||||
#define JAHUTABLEDIT_H
|
||||
|
||||
#include "JSystem/JAHostIO/JAHVirtualNode.h"
|
||||
|
||||
class JAHUSeBox : public JAHVirtualNode {
|
||||
public:
|
||||
JAHUSeBox();
|
||||
};
|
||||
|
||||
#endif /* JAHUTABLEDIT_H */
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef JAHVIRTUALNODE_H
|
||||
#define JAHVIRTUALNODE_H
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
class JAHControl;
|
||||
|
||||
class JAHVirtualNode {
|
||||
public:
|
||||
JAHVirtualNode();
|
||||
virtual void updateNode();
|
||||
virtual void message(JAHControl&);
|
||||
virtual void onFrame();
|
||||
virtual void onCurrentNodeFrame();
|
||||
virtual void propertyEvent(JAH_P_Event, u32);
|
||||
virtual void nodeEvent(JAH_N_Event);
|
||||
|
||||
/* 0x04 */ JSUTree<JAHVirtualNode> mTree;
|
||||
/* 0x20 */ char mName[32];
|
||||
};
|
||||
|
||||
#endif /* JAHVIRTUALNODE_H */
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
#ifndef JAHIOMESSAGE_H
|
||||
#define JAHIOMESSAGE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JAHioNode;
|
||||
class JORMContext;
|
||||
|
||||
class JAHControl {
|
||||
public:
|
||||
JAHControl(JORMContext*, JAHioNode*);
|
||||
void returnY(u16);
|
||||
void indent(s8);
|
||||
void makeComment(const char*, u32, u8, u32);
|
||||
|
||||
static u16 getLineHeight() { return smLineHeight; }
|
||||
static u16 getContWidth() { return smContWidth; }
|
||||
static u16 getIntervalX() { return smIntX; }
|
||||
static u16 getNameWidth() { return smNameWidth; }
|
||||
|
||||
static u16 smButtonWidth[];
|
||||
static u16 smCommentWidth[];
|
||||
static u16 smComboWidth[];
|
||||
static u16 smYTop;
|
||||
static u16 smXLeft;
|
||||
static u16 smIndentSize;
|
||||
static u16 smLineHeight;
|
||||
static u16 smContWidth;
|
||||
static u16 smIntX;
|
||||
static u16 smIntY;
|
||||
static u16 smNameWidth;
|
||||
|
||||
u16 getX() { return mX; }
|
||||
u16 getY() { return mY; }
|
||||
JORMContext* getContext() { return mContext; }
|
||||
|
||||
void tabX(u16 param_1) {
|
||||
mX += param_1 + smIntX;
|
||||
}
|
||||
void returnYDirectSize(u16 param_1) {
|
||||
mY += param_1;
|
||||
mX = smXLeft + field_0x4 * smIndentSize;
|
||||
}
|
||||
|
||||
/* 0x00 */ u16 mX;
|
||||
/* 0x02 */ u16 mY;
|
||||
/* 0x04 */ u16 field_0x4;
|
||||
/* 0x08 */ JORMContext* mContext;
|
||||
/* 0x0C */ JAHioNode* mNode;
|
||||
};
|
||||
|
||||
#endif /* JAHIOMESSAGE_H */
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef JAHIOMGR_H
|
||||
#define JAHIOMGR_H
|
||||
|
||||
#include "JSystem/JAHostIO/JAHPubDefine.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
class JAHFrameNode;
|
||||
class JAHioNode;
|
||||
class JORReflexible;
|
||||
|
||||
class JAHioMgr : public JAHSingletonBase<JAHioMgr> {
|
||||
public:
|
||||
JAHioMgr();
|
||||
void init_OnGame();
|
||||
bool isGameMode();
|
||||
void appendRootNode(JORReflexible*, JAHioNode*);
|
||||
void appendFrameNode(JAHioNode*);
|
||||
void removeFrameNode(JAHioNode*);
|
||||
u32 framework();
|
||||
|
||||
u32 getNodeSysType() { return field_0x8; }
|
||||
|
||||
/* 0x04 */ s32 field_0x4;
|
||||
/* 0x08 */ u32 field_0x8;
|
||||
JSUList<JAHFrameNode> field_0xc;
|
||||
};
|
||||
|
||||
#endif /* JAHIOMGR_H */
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef JAHIONODE_H
|
||||
#define JAHIONODE_H
|
||||
|
||||
#include "JSystem/JHostIO/JORReflexible.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
enum JAH_N_Event {
|
||||
JAH_N_EVENT0 = 0,
|
||||
JAH_N_EVENT1 = 1,
|
||||
JAH_N_EVENT2 = 2,
|
||||
};
|
||||
|
||||
enum JAH_P_Event {
|
||||
JAH_P_EVENT0 = 0,
|
||||
JAH_P_EVENT1 = 1,
|
||||
};
|
||||
|
||||
class JAHControl;
|
||||
|
||||
class JAHioNode : public JORReflexible {
|
||||
public:
|
||||
JAHioNode(const char*);
|
||||
/* vt[07] */ virtual ~JAHioNode();
|
||||
/* vt[02] */ virtual void listenPropertyEvent(const JORPropertyEvent*);
|
||||
/* vt[05] */ virtual void genMessage(JORMContext*);
|
||||
/* vt[06] */ virtual void listenNodeEvent(const JORNodeEvent*);
|
||||
/* vt[08] */ virtual void message(JAHControl&) {}
|
||||
/* vt[09] */ virtual void appendNode(JAHioNode*, const char*);
|
||||
/* vt[0A] */ virtual void prependNode(JAHioNode*, const char*);
|
||||
/* vt[0B] */ virtual void removeNode(JAHioNode*);
|
||||
/* vt[0C] */ virtual s32 getNodeType() { return 0; }
|
||||
/* vt[0D] */ virtual u32 getNodeKind() const;
|
||||
/* vt[0E] */ virtual u32 getNodeIcon() const { return 0; }
|
||||
/* vt[0F] */ virtual void propertyEvent(JAH_P_Event, u32) {}
|
||||
/* vt[10] */ virtual void nodeEvent(JAH_N_Event) {}
|
||||
void updateNode();
|
||||
void setNodeName(const char*);
|
||||
void generateRealChildren(JORMContext*);
|
||||
void generateTempChildren(JORMContext*);
|
||||
JAHioNode* getParent();
|
||||
|
||||
static JAHioNode* getCurrentNode() { return smCurrentNode; }
|
||||
|
||||
static JAHioNode* smCurrentNode;
|
||||
|
||||
JSUTree<JAHioNode>* getTree() { return &mTree; }
|
||||
char* getNodeName() { return mName; }
|
||||
void setLastChild(JAHioNode* node) { mLastChild = node; }
|
||||
|
||||
/* 0x04 */ JSUTree<JAHioNode> mTree;
|
||||
/* 0x20 */ char mName[32];
|
||||
/* 0x40 */ JAHioNode* mLastChild;
|
||||
};
|
||||
|
||||
#endif /* JAHIONODE_H */
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef JAHIOUTIL_H
|
||||
#define JAHIOUTIL_H
|
||||
|
||||
namespace JAHioUtil {
|
||||
char* getString(const char* msg, ...);
|
||||
|
||||
extern char mStringBuffer[];
|
||||
}
|
||||
|
||||
#endif /* JAHIOUTIL_H */
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef JAWEXTSYSTEM_H
|
||||
#define JAWEXTSYSTEM_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWSystem.h"
|
||||
#include "JSystem/JGadget/std-list.h"
|
||||
|
||||
class JAWWindow;
|
||||
class JUTGamePad;
|
||||
|
||||
namespace JAWExtSystem {
|
||||
BOOL registWindow(u32, JAWWindow*, int, int);
|
||||
BOOL destroyWindow(u32, JAWWindow*);
|
||||
void nextPage();
|
||||
void prevPage();
|
||||
void nextWindow();
|
||||
void prevWindow();
|
||||
void draw();
|
||||
void padProc(const JUTGamePad&);
|
||||
|
||||
class TSystemInterface : public JAWSystemInterface {
|
||||
public:
|
||||
TSystemInterface() {}
|
||||
virtual BOOL registWindow(u32 param_1, JAWWindow* param_2, int param_3, int param_4) {
|
||||
return JAWExtSystem::registWindow(param_1, param_2, param_3, param_4);
|
||||
}
|
||||
virtual BOOL destroyWindow(u32 param_1, JAWWindow* param_2) {
|
||||
return JAWExtSystem::destroyWindow(param_1, param_2);
|
||||
}
|
||||
virtual void setForegroundWindow(JAWWindow*) {}
|
||||
};
|
||||
|
||||
class TCurrentHeap {
|
||||
public:
|
||||
TCurrentHeap(const TSystemInterface& interface) {
|
||||
heap = JKRGetCurrentHeap();
|
||||
JKRSetCurrentHeap(interface.getCurrentHeap());
|
||||
}
|
||||
~TCurrentHeap() { JKRSetCurrentHeap(heap); }
|
||||
|
||||
/* 0x00 */ JKRHeap* heap;
|
||||
};
|
||||
|
||||
extern JGadget::TList<JAWWindow*> sPage[128];
|
||||
extern TSystemInterface sInterface;
|
||||
extern s32 sCurrentPage;
|
||||
extern u8 lbl_80748E44;
|
||||
}
|
||||
|
||||
#endif /* JAWEXTSYSTEM_H */
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef JAWGRAPHCONTEXT_H
|
||||
#define JAWGRAPHCONTEXT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
class J2DPrint;
|
||||
class JUTResFont;
|
||||
|
||||
class JAWGraphContext {
|
||||
public:
|
||||
JAWGraphContext();
|
||||
~JAWGraphContext();
|
||||
void reset();
|
||||
void color(u8, u8, u8, u8);
|
||||
void color(const JUtility::TColor&);
|
||||
void locate(int, int);
|
||||
void print(char const*, ...);
|
||||
void print(int, int, const char*, ...);
|
||||
void color(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
|
||||
void fillBox(const JGeometry::TBox2<f32>&);
|
||||
void drawFrame(const JGeometry::TBox2<f32>&);
|
||||
void line(const JGeometry::TVec2<f32>&, const JGeometry::TVec2<f32>&);
|
||||
void setGXforPrint();
|
||||
void setGXforDraw();
|
||||
|
||||
/* 0x00 */ J2DPrint* field_0x0;
|
||||
/* 0x04 */ JUtility::TColor field_0x4;
|
||||
/* 0x08 */ JUtility::TColor field_0x8;
|
||||
/* 0x0C */ JUtility::TColor field_0xc;
|
||||
/* 0x10 */ JUtility::TColor field_0x10;
|
||||
/* 0x14 */ u8 mParentAlpha;
|
||||
/* 0x15 */ u8 field_0x15;
|
||||
/* 0x16 */ u8 field_0x16;
|
||||
/* 0x18 */ int field_0x18;
|
||||
|
||||
void setParentAlpha(u8 alpha) { mParentAlpha = alpha; }
|
||||
|
||||
static JUTResFont* sFont;
|
||||
static bool lbl_8074CD30;
|
||||
};
|
||||
|
||||
#endif /* JAWGRAPHCONTEXT_H */
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef JAWSYSTEM_H
|
||||
#define JAWSYSTEM_H
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
class JAWWindow;
|
||||
|
||||
class JAWSystemInterface {
|
||||
public:
|
||||
JAWSystemInterface();
|
||||
virtual BOOL registWindow(u32, JAWWindow*, int, int) = 0;
|
||||
virtual BOOL destroyWindow(u32, JAWWindow*) = 0;
|
||||
virtual void setForegroundWindow(JAWWindow*) = 0;
|
||||
|
||||
/* 0x04 */ JKRHeap* mHeap;
|
||||
|
||||
JKRHeap* getCurrentHeap() const;
|
||||
|
||||
static JAWSystemInterface* sInstance;
|
||||
};
|
||||
|
||||
#endif /* JAWSYSTEM_H */
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
#ifndef JAWWINDOW_H
|
||||
#define JAWWINDOW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include "JSystem/J2DGraph/J2DWindow.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
class JAWGraphContext;
|
||||
class JUTGamePad;
|
||||
|
||||
class JUTPoint {
|
||||
public:
|
||||
JUTPoint(int i_x, int i_y) {
|
||||
x = i_x;
|
||||
y = i_y;
|
||||
}
|
||||
|
||||
/* 0x00*/ int x;
|
||||
/* 0x04*/ int y;
|
||||
};
|
||||
|
||||
class JAWWindow {
|
||||
public:
|
||||
class TJ2DWindowDraw : public J2DWindow {
|
||||
public:
|
||||
TJ2DWindowDraw(u32, const JGeometry::TBox2<f32>&, const char*);
|
||||
|
||||
void drawPane(int x, int y, const J2DGrafContext* p_grafCtx) {
|
||||
J2DPane::draw(x, y, p_grafCtx, true, true);
|
||||
calcMtx();
|
||||
}
|
||||
};
|
||||
|
||||
class TWindowText : public J2DPane {
|
||||
public:
|
||||
TWindowText(JAWWindow*);
|
||||
virtual void drawSelf(f32, f32);
|
||||
virtual void drawSelf(f32, f32, Mtx*);
|
||||
|
||||
/* 0x0FC */ JAWGraphContext field_0xfc;
|
||||
/* 0x118 */ JAWWindow* m_pParent;
|
||||
/* 0x11C */ JUTPoint field_0x11c;
|
||||
};
|
||||
|
||||
JAWWindow(const char*, int, int);
|
||||
virtual ~JAWWindow();
|
||||
virtual void onDraw(JAWGraphContext*);
|
||||
virtual BOOL onInit();
|
||||
virtual void frameWork() {}
|
||||
virtual void onPadProc(const JUTGamePad&) {}
|
||||
virtual void onTrigA(const JUTGamePad&) {}
|
||||
virtual void onTrigB(const JUTGamePad&) {}
|
||||
virtual void onTrigX(const JUTGamePad&) {}
|
||||
virtual void onTrigY(const JUTGamePad&) {}
|
||||
virtual void onTrigMenu(const JUTGamePad&) {}
|
||||
virtual void onTrigL(const JUTGamePad&) {}
|
||||
virtual void onTrigZ(const JUTGamePad&) {}
|
||||
virtual void onTrigUp(const JUTGamePad&) {}
|
||||
virtual void onTrigDown(const JUTGamePad&) {}
|
||||
virtual void onTrigLeft(const JUTGamePad&) {}
|
||||
virtual void onTrigRight(const JUTGamePad&) {}
|
||||
virtual void onReleaseA(const JUTGamePad&) {}
|
||||
virtual void onReleaseB(const JUTGamePad&) {}
|
||||
virtual void onReleaseX(const JUTGamePad&) {}
|
||||
virtual void onReleaseY(const JUTGamePad&) {}
|
||||
virtual void onReleaseMenu(const JUTGamePad&) {}
|
||||
virtual void onReleaseL(const JUTGamePad&) {}
|
||||
virtual void onReleaseZ(const JUTGamePad&) {}
|
||||
virtual void onReleaseUp(const JUTGamePad&) {}
|
||||
virtual void onReleaseDown(const JUTGamePad&) {}
|
||||
virtual void onReleaseLeft(const JUTGamePad&) {}
|
||||
virtual void onReleaseRight(const JUTGamePad&) {}
|
||||
virtual void onKeyA(const JUTGamePad&) {}
|
||||
virtual void onKeyB(const JUTGamePad&) {}
|
||||
virtual void onKeyX(const JUTGamePad&) {}
|
||||
virtual void onKeyY(const JUTGamePad&) {}
|
||||
virtual void onKeyMenu(const JUTGamePad&) {}
|
||||
virtual void onKeyL(const JUTGamePad&) {}
|
||||
virtual void onKeyZ(const JUTGamePad&) {}
|
||||
virtual void onKeyUp(const JUTGamePad&) {}
|
||||
virtual void onKeyDown(const JUTGamePad&) {}
|
||||
virtual void onKeyLeft(const JUTGamePad&) {}
|
||||
virtual void onKeyRight(const JUTGamePad&) {}
|
||||
|
||||
BOOL initIf();
|
||||
void setTitleColor(const JUtility::TColor&, const JUtility::TColor&);
|
||||
void setWindowColor(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
|
||||
void move(f32, f32);
|
||||
void addPosition(f32, f32);
|
||||
void addSize(f32, f32);
|
||||
static JUtility::TColor convJudaColor(u16);
|
||||
void padProc(const JUTGamePad&);
|
||||
|
||||
/* 0x004 */ Mtx mMatrix;
|
||||
/* 0x034 */ u8 field_0x34[0x38 - 0x34];
|
||||
/* 0x038 */ TJ2DWindowDraw field_0x38;
|
||||
/* 0x180 */ J2DTextBox field_0x180;
|
||||
/* 0x2B0 */ TWindowText field_0x2b0;
|
||||
/* 0x3D8 */ JUtility::TColor field_0x3d8;
|
||||
/* 0x3DC */ JUtility::TColor field_0x3dc;
|
||||
/* 0x3E0 */ JUtility::TColor field_0x3e0;
|
||||
/* 0x3E4 */ JUtility::TColor field_0x3e4;
|
||||
/* 0x3E8 */ int field_0x3e8;
|
||||
/* 0x3EC */ u8 field_0x3ec;
|
||||
|
||||
void setMatrix(Mtx mtx) { MTXCopy(mtx, mMatrix); }
|
||||
void setAlpha(u8 alpha) { field_0x38.setAlpha(alpha); }
|
||||
void draw(int x, int y, const J2DGrafContext* p_grafCtx) { field_0x38.drawPane(x, y, p_grafCtx); }
|
||||
};
|
||||
|
||||
#endif /* JAWWINDOW_H */
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef JAWWINDOW3D_H
|
||||
#define JAWWINDOW3D_H
|
||||
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
namespace JAWWindow3D {
|
||||
extern JGeometry::TVec2<f32> sPtOrigin;
|
||||
}
|
||||
|
||||
#endif /* JAWWINDOW3D_H */
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef JAWBANKVIEW_H
|
||||
#define JAWBANKVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWBankView : public JAWWindow {
|
||||
public:
|
||||
JAWBankView();
|
||||
|
||||
/* 0x3F0 */ int field_0x3f0;
|
||||
/* 0x3F4 */ int field_0x3f4;
|
||||
/* 0x3F8 */ int field_0x3f8;
|
||||
/* 0x3FC */ int field_0x3fc;
|
||||
/* 0x400 */ u8 field_0x400;
|
||||
/* 0x404 */ int field_0x404;
|
||||
/* 0x408 */ f32 field_0x408;
|
||||
/* 0x40C */ u8 field_0x40c[4];
|
||||
};
|
||||
|
||||
#endif /* JAWBANKVIEW_H */
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef JAWCHVIEW_H
|
||||
#define JAWCHVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWChView : public JAWWindow {
|
||||
public:
|
||||
JAWChView();
|
||||
|
||||
/* 0x3F0 */ int field_0x3f0;
|
||||
/* 0x3F4 */ u8 field_0x3f4[4];
|
||||
};
|
||||
|
||||
#endif /* JAWCHVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWENTRYSEVIEW_H
|
||||
#define JAWENTRYSEVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWEntrySeViewBasic : public JAWWindow {
|
||||
public:
|
||||
JAWEntrySeViewBasic();
|
||||
};
|
||||
|
||||
#endif /* JAWENTRYSEVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWHIOBANKEDIT_H
|
||||
#define JAWHIOBANKEDIT_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWHioBankEdit : public JAWWindow {
|
||||
public:
|
||||
JAWHioBankEdit();
|
||||
};
|
||||
|
||||
#endif /* JAWHIOBANKEDIT_H */
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef JAWHIORECEIVER_H
|
||||
#define JAWHIORECEIVER_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
#include "JSystem/JHostIO/JHIComm.h"
|
||||
#include "JSystem/JHostIO/JHICommonMem.h"
|
||||
#include "JSystem/JAudio2/JAISound.h"
|
||||
|
||||
class JAISeqData;
|
||||
|
||||
class JADHioReceiver : JHITag<JHICmnMem> {
|
||||
public:
|
||||
JADHioReceiver();
|
||||
virtual ~JADHioReceiver();
|
||||
virtual void receive(const char*, s32);
|
||||
virtual u32 parse(u32,char*, u32) = 0;
|
||||
};
|
||||
|
||||
|
||||
class JAWHioReceiver : public JAWWindow {
|
||||
public:
|
||||
class TSeqList {
|
||||
public:
|
||||
class TSeqData {
|
||||
public:
|
||||
};
|
||||
|
||||
bool getSeqData(JAISoundID, JAISeqData*) const;
|
||||
|
||||
/* 0x00 */ JSUList<TSeqData> mList;
|
||||
};
|
||||
|
||||
class THioReceiver : public JADHioReceiver {
|
||||
public:
|
||||
THioReceiver();
|
||||
virtual ~THioReceiver();
|
||||
virtual u32 parse(u32,char*, u32);
|
||||
|
||||
/* 0x0C */ int field_0xc;
|
||||
/* 0x10 */ u8 field_0x10;
|
||||
/* 0x14 */ TSeqList field_0x14;
|
||||
/* 0x20 */ int field_0x20;
|
||||
/* 0x24 */ int field_0x24;
|
||||
/* 0x28 */ int field_0x28;
|
||||
/* 0x2C */ int field_0x2c;
|
||||
};
|
||||
|
||||
JAWHioReceiver();
|
||||
|
||||
const TSeqList* getSeqList() const { return &field_0x3f0.field_0x14; }
|
||||
|
||||
/* 0x3F0 */ THioReceiver field_0x3f0;
|
||||
};
|
||||
|
||||
#endif /* JAWHIORECEIVER_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWPLAYSEVIEW_H
|
||||
#define JAWPLAYSEVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWPlaySeViewBasic : public JAWWindow {
|
||||
public:
|
||||
JAWPlaySeViewBasic();
|
||||
};
|
||||
|
||||
#endif /* JAWPLAYSEVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWPLAYERCHVIEW_H
|
||||
#define JAWPLAYERCHVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWPlayerChView : public JAWWindow {
|
||||
public:
|
||||
JAWPlayerChView();
|
||||
};
|
||||
|
||||
#endif /* JAWPLAYERCHVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWREPORTVIEW_H
|
||||
#define JAWREPORTVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWReportView : public JAWWindow {
|
||||
public:
|
||||
JAWReportView();
|
||||
};
|
||||
|
||||
#endif /* JAWREPORTVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWSYSMEMVIEW_H
|
||||
#define JAWSYSMEMVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWSysMemView : public JAWWindow {
|
||||
public:
|
||||
JAWSysMemView();
|
||||
};
|
||||
|
||||
#endif /* JAWSYSMEMVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef JAWVOLUME_H
|
||||
#define JAWVOLUME_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class JAWVolume : public JAWWindow {
|
||||
public:
|
||||
JAWVolume(int, int);
|
||||
};
|
||||
|
||||
#endif /* JAWVOLUME_H */
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
#ifndef JASREPORT_H
|
||||
#define JASREPORT_H
|
||||
|
||||
class JKRHeap;
|
||||
|
||||
void JASReportInit(JKRHeap*, int);
|
||||
int JASReportGetLineMax();
|
||||
int JASReportCopyBuffer(char *, int);
|
||||
void JASReport(const char* message, ...);
|
||||
|
||||
#endif /* JASREPORT_H */
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public:
|
|||
~JAUSeqDataMgr_SeqCollection();
|
||||
|
||||
const void* getResource() const { return field_0x4; }
|
||||
void init(const void* param_1) { JAUSeqCollection::init(param_1); }
|
||||
|
||||
/* 0x14 */ JAISeqDataUser* user_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ template <typename Category, typename T, typename Distance, typename Pointer, ty
|
|||
struct TIterator : public std::iterator<Category, T, Distance, Pointer, Reference> {
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct TIterator_reverse : public std::reverse_iterator<Iterator> {
|
||||
TIterator_reverse() {}
|
||||
TIterator_reverse(Iterator it) : std::reverse_iterator<Iterator>(it) {}
|
||||
};
|
||||
|
||||
template <typename Iterator, typename T, typename Predicate>
|
||||
inline Iterator findUpperBound_binary_all(Iterator first, Iterator last, const T& val, Predicate p) {
|
||||
return std::upper_bound(first, last, val, p);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
#ifndef STD_LIST_H
|
||||
#define STD_LIST_H
|
||||
|
||||
#include "JSystem/JGadget/define.h"
|
||||
#include "JSystem/JGadget/search.h"
|
||||
#include "JSystem/JGadget/std-memory.h"
|
||||
|
||||
namespace JGadget {
|
||||
template <typename T, typename Allocator = JGadget::TAllocator<T> >
|
||||
struct TList {
|
||||
struct TNode_ {
|
||||
/* 0x00 */ TNode_* pNext_;
|
||||
/* 0x04 */ TNode_* pPrev_;
|
||||
};
|
||||
|
||||
struct iterator : public TIterator<std::bidirectional_iterator_tag, T, s32, T*, T&> {
|
||||
iterator() {p_ = NULL; }
|
||||
iterator(TNode_* pNode) { p_ = pNode; }
|
||||
|
||||
iterator& operator++() { p_ = p_->pNext_; return *this; }
|
||||
iterator& operator--() { p_ = p_->pPrev_; return *this; }
|
||||
iterator operator++(int) { const iterator old(*this); (void)++*this; return old; }
|
||||
iterator operator--(int) { const iterator old(*this); (void)--*this; return old; }
|
||||
friend bool operator==(iterator a, iterator b) { return a.p_ == b.p_; }
|
||||
friend bool operator!=(iterator a, iterator b) { return !(a == b); }
|
||||
T& operator*() const {
|
||||
JUT_ASSERT(125, p_!=NULL);
|
||||
return *(T*)&p_[1];
|
||||
}
|
||||
|
||||
/* 0x00 */ TNode_* p_;
|
||||
};
|
||||
|
||||
struct const_iterator {
|
||||
const_iterator(TNode_* pNode) { p_ = pNode; }
|
||||
|
||||
const_iterator& operator++() { p_ = p_->pNext_; return *this; }
|
||||
const_iterator& operator--() { p_ = p_->pPrev_; return *this; }
|
||||
friend bool operator==(const_iterator a, const_iterator b) { return a.p_ == b.p_; }
|
||||
friend bool operator!=(const_iterator a, const_iterator b) { return !(a == b); }
|
||||
|
||||
/* 0x00 */ TNode_* p_;
|
||||
};
|
||||
|
||||
TList(const Allocator& allocator = Allocator()) {
|
||||
field_0x4 = 0;
|
||||
Initialize_();
|
||||
}
|
||||
~TList() {
|
||||
int r30;
|
||||
int r29;
|
||||
JGadget_outMessage* r28;
|
||||
int r27;
|
||||
Confirm();
|
||||
clear();
|
||||
r30 = 0;
|
||||
r29 = 1;
|
||||
if (empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, 229);
|
||||
r30 = 1;
|
||||
r28 = &out;
|
||||
*r28 << "empty()";
|
||||
r27 = 0;
|
||||
if (!r27) {
|
||||
r29 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
iterator push_front(const T& element) { return insert(begin(), element); }
|
||||
iterator push_back(const T& element) { return insert(end(), element); }
|
||||
iterator insert(iterator it, const T& element) {
|
||||
TNode_* p = it.p_;
|
||||
JUT_ASSERT(286, p!=NULL);
|
||||
TNode_* prev = p->pPrev_;
|
||||
TNode_* node = CreateNode_(p, prev, element);
|
||||
if (!node) {
|
||||
return end();
|
||||
}
|
||||
p->pPrev_ = node;
|
||||
prev->pNext_ = node;
|
||||
field_0x4++;
|
||||
return iterator(node);
|
||||
}
|
||||
|
||||
iterator erase(iterator start, iterator end) {
|
||||
while (start != end) {
|
||||
start = erase(start);
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
iterator erase(iterator it) {
|
||||
JUT_ASSERT(314, !empty());
|
||||
TNode_* p = it.p_;
|
||||
JUT_ASSERT(316, p!=NULL);
|
||||
TNode_* next = p->pNext_;
|
||||
p->pPrev_->pNext_ = next;
|
||||
next->pPrev_ = p->pPrev_;
|
||||
DestroyNode_(p);
|
||||
field_0x4--;
|
||||
return iterator(next);
|
||||
}
|
||||
|
||||
void clear() { erase(begin(), end()); }
|
||||
BOOL empty() const { return size() == 0; }
|
||||
int size() const { return field_0x4; }
|
||||
iterator begin() { return iterator(oEnd_.pNext_); }
|
||||
iterator end() { return iterator(&oEnd_); }
|
||||
const_iterator begin() const { return const_iterator(oEnd_.pNext_); }
|
||||
const_iterator end() const { return const_iterator((TNode_*)&oEnd_); }
|
||||
TIterator_reverse<iterator> rbegin() { return TIterator_reverse<iterator>(begin()); }
|
||||
TIterator_reverse<iterator> rend() { return TIterator_reverse<iterator>(end()); }
|
||||
|
||||
void Initialize_() {
|
||||
oEnd_.pNext_ = &oEnd_;
|
||||
oEnd_.pPrev_ = &oEnd_;
|
||||
}
|
||||
|
||||
BOOL Confirm() const {
|
||||
u32 r28 = 0;
|
||||
const_iterator local_24 = end();
|
||||
if (local_24.p_ != &oEnd_) {
|
||||
return FALSE;
|
||||
}
|
||||
const_iterator local_28 = begin();
|
||||
if (local_28.p_ != oEnd_.pNext_) {
|
||||
return FALSE;
|
||||
}
|
||||
for (; local_28 != local_24; ++local_28) {
|
||||
TNode_* node = local_28.p_;
|
||||
if (node->pNext_->pPrev_ != node) {
|
||||
return FALSE;
|
||||
}
|
||||
if (node->pPrev_->pNext_ != node) {
|
||||
return FALSE;
|
||||
}
|
||||
r28++;
|
||||
}
|
||||
if (local_28.p_ != &oEnd_) {
|
||||
return FALSE;
|
||||
}
|
||||
if (r28 != size()) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TNode_* CreateNode_(TNode_ *pNext, TNode_ *pPrev, const T& pObject) {
|
||||
JUT_ASSERT(483, pNext!=NULL);
|
||||
JUT_ASSERT(484, pPrev!=NULL);
|
||||
TNode_* node = (TNode_*)mAllocator.AllocateRaw(sizeof(TNode_) + sizeof(T));
|
||||
if (!node) {
|
||||
JGADGET_WARNMSG(489, "can\'t allocate memory");
|
||||
return NULL;
|
||||
}
|
||||
node->pNext_ = pNext;
|
||||
node->pPrev_ = pPrev;
|
||||
mAllocator.construct((T*)&node[1], pObject);
|
||||
return node;
|
||||
}
|
||||
|
||||
void DestroyNode_(TNode_* p) {
|
||||
JUT_ASSERT(501, p!=NULL);
|
||||
JUT_ASSERT(502, p!=&oEnd_);
|
||||
JUT_ASSERT(503, p->pNext_->pPrev_!=p);
|
||||
JUT_ASSERT(504, p->pPrev_->pNext_!=p);
|
||||
mAllocator.destroy((T*)&p[1]);
|
||||
mAllocator.DeallocateRaw((T*)p);
|
||||
}
|
||||
|
||||
/* 0x00 */ Allocator mAllocator;
|
||||
/* 0x04 */ int field_0x4;
|
||||
/* 0x08 */ TNode_ oEnd_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* STD_LIST_H */
|
||||
|
|
@ -22,7 +22,13 @@ struct TAllocator {
|
|||
delete mem;
|
||||
}
|
||||
|
||||
void construct(T* p, const T& other) {
|
||||
JUT_ASSERT(67, p!=NULL);
|
||||
new(p) T(other);
|
||||
}
|
||||
|
||||
void destroy(T* p) {
|
||||
(void)p;
|
||||
JUT_ASSERT(68, p!=NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@ struct JORPropertyEvent : JOREvent {
|
|||
};
|
||||
|
||||
struct JORGenEvent : JOREvent {};
|
||||
struct JORNodeEvent : JOREvent {};
|
||||
|
||||
struct JORNodeEvent : JOREvent {
|
||||
/* 0x00 */ u32 field_0x0;
|
||||
};
|
||||
|
||||
struct JORMContext;
|
||||
struct JORServer;
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public:
|
|||
/* 0x1107C */ CallbackLinkList m_eventCallbackList;
|
||||
};
|
||||
|
||||
inline void JOR_MESSAGELOOP() {
|
||||
inline u32 JOR_MESSAGELOOP() {
|
||||
JORServer* server = JORServer::getInstance();
|
||||
JHIComPortManager<JHICmnMem>::getInstance()->dispatchMessage();
|
||||
if (server->getEvent()) {
|
||||
|
|
@ -160,7 +160,7 @@ inline void JOR_MESSAGELOOP() {
|
|||
}
|
||||
server->doneEvent();
|
||||
}
|
||||
JHIEventLoop();
|
||||
return JHIEventLoop();
|
||||
}
|
||||
|
||||
inline void JOR_INIT() {
|
||||
|
|
@ -174,8 +174,17 @@ inline void JOR_SETROOTNODE(const char* name, JORReflexible* node, u32 param_3,
|
|||
inline JORMContext* attachJORMContext(u32 msgID) {
|
||||
return JORServer::getInstance()->attachMCTX(msgID);
|
||||
}
|
||||
|
||||
inline JORMContext* JORAttachMContext(u32 msgID) {
|
||||
return JORServer::getInstance()->attachMCTX(msgID);
|
||||
}
|
||||
|
||||
inline void releaseJORMContext(JORMContext* mctx) {
|
||||
JORServer::getInstance()->releaseMCTX(mctx);
|
||||
}
|
||||
|
||||
inline void JORReleaseMContext(JORMContext* mctx) {
|
||||
JORServer::getInstance()->releaseMCTX(mctx);
|
||||
}
|
||||
|
||||
#endif /* JORSERVER_H */
|
||||
|
|
|
|||
|
|
@ -190,6 +190,8 @@ public:
|
|||
|
||||
bool appendChild(JSUTree<T>* child) { return this->append(child); }
|
||||
|
||||
bool prependChild(JSUTree<T>* child) { return this->prepend(child); }
|
||||
|
||||
bool removeChild(JSUTree<T>* child) { return this->remove(child); }
|
||||
|
||||
bool insertChild(JSUTree<T>* before, JSUTree<T>* child) { return this->insert(before, child); }
|
||||
|
|
@ -226,11 +228,11 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
T* getObject() { return this->mTree->getObject(); }
|
||||
T* getObject() const { return this->mTree->getObject(); }
|
||||
|
||||
bool operator==(JSUTree<T>* other) { return this->mTree == other; }
|
||||
|
||||
bool operator!=(JSUTree<T>* other) { return this->mTree != other; }
|
||||
bool operator!=(const JSUTree<T>* other) const { return this->mTree != other; }
|
||||
|
||||
JSUTreeIterator<T> operator++(int) {
|
||||
JSUTreeIterator<T> prev = *this;
|
||||
|
|
@ -245,7 +247,7 @@ public:
|
|||
|
||||
T* operator*() { return this->getObject(); }
|
||||
|
||||
T* operator->() { return this->getObject(); }
|
||||
T* operator->() const { return this->getObject(); }
|
||||
|
||||
private:
|
||||
JSUTree<T>* mTree;
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ public:
|
|||
|
||||
u32 getButton() const { return mButton.mButton; }
|
||||
u32 getTrigger() const { return mButton.mTrigger; }
|
||||
u32 getRelease() const { return mButton.mRelease; }
|
||||
u32 getRepeat() const { return mButton.mRepeat; }
|
||||
f32 getMainStickX() const { return mMainStick.mPosX; }
|
||||
f32 getMainStickY() const { return mMainStick.mPosY; }
|
||||
f32 getMainStickValue() const { return mMainStick.mValue; }
|
||||
|
|
@ -100,6 +102,7 @@ public:
|
|||
JUTGamePadRecordBase* getPadReplay() const { return mPadReplay; }
|
||||
JUTGamePadRecordBase* getPadRecord() const { return mPadRecord; }
|
||||
|
||||
bool testButton(u32 button) const { return mButton.mButton & button; }
|
||||
bool testTrigger(u32 button) const { return mButton.mTrigger & button; }
|
||||
|
||||
bool isPushing3ButtonReset() const {
|
||||
|
|
|
|||
|
|
@ -80,5 +80,6 @@ public:
|
|||
};
|
||||
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[16736];
|
||||
extern u8 const JUTResFONT_Ascfont_fix16[16736];
|
||||
|
||||
#endif /* JUTRESFONT_H */
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ public:
|
|||
|
||||
const ResTIMG* getTexInfo() const { return mTexInfo; }
|
||||
s32 getFormat() const { return mTexInfo->format; }
|
||||
s32 getTransparency() { return mTexInfo->alphaEnabled; }
|
||||
s32 getTransparency() const { return mTexInfo->alphaEnabled; }
|
||||
s32 getWidth() const { return mTexInfo->width; }
|
||||
s32 getHeight() const { return mTexInfo->height; }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef Z2AUDIOCS_H
|
||||
#define Z2AUDIOCS_H
|
||||
|
||||
#include <revolution/wpad.h>
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JKRHeap;
|
||||
class JKRArchive;
|
||||
|
|
@ -9,8 +9,8 @@ class JKRArchive;
|
|||
class Z2AudioCS {
|
||||
public:
|
||||
static void newSpkSoundMemPool();
|
||||
int init(JKRHeap*, JKRArchive*, s32, s32);
|
||||
void update();
|
||||
static int init(JKRHeap*, JKRArchive*, s32, s32);
|
||||
static void update();
|
||||
static void connect(s32);
|
||||
static void disconnect(s32);
|
||||
static void extensionProcess(s32, s32);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,45 @@
|
|||
#ifndef Z2DEBUGSYS_H
|
||||
#define Z2DEBUGSYS_H
|
||||
|
||||
#include "JSystem/JAudio2/JASGadget.h"
|
||||
#include "JSystem/JAudio2/JAISeqDataMgr.h"
|
||||
#include "JSystem/JAudio2/JASGadget.h"
|
||||
#include "JSystem/JAudio2/JAUSeqCollection.h"
|
||||
#include "JSystem/JAHostIO/JAHFrameNode.h"
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAWWinLib/JAWHioReceiver.h"
|
||||
|
||||
class Z2ParamNode : public JAHFrameNode {
|
||||
public:
|
||||
Z2ParamNode() : JAHFrameNode("サウンド各種パラメータ") {}
|
||||
|
||||
/* vt[07] */ virtual ~Z2ParamNode() {}
|
||||
/* vt[08] */ virtual void message(JAHControl& control);
|
||||
/* vt[0F] */ virtual void propertyEvent(JAH_P_Event, u32);
|
||||
/* vt[12] */ virtual void onFrame();
|
||||
};
|
||||
|
||||
class Z2HioSeSeqDataMgr : public JAUSeqDataMgr_SeqCollection {
|
||||
public:
|
||||
Z2HioSeSeqDataMgr(const void * param_1, const JAWHioReceiver* param_2) {
|
||||
field_0x18 = param_2;
|
||||
init(param_1);
|
||||
};
|
||||
virtual ~Z2HioSeSeqDataMgr() {}
|
||||
virtual SeqDataReturnValue getSeqData(JAISoundID param_1, JAISeqData* param_2) {
|
||||
if (field_0x18->getSeqList()->getSeqData(param_1, param_2)) {
|
||||
param_2->field_0x4 = 4;
|
||||
return SeqDataReturnValue_2;
|
||||
} else {
|
||||
return JAUSeqDataMgr_SeqCollection::getSeqData(param_1, param_2);
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x18 */ const JAWHioReceiver * field_0x18;
|
||||
};
|
||||
|
||||
struct Z2DebugSys : public JASGlobalInstance<Z2DebugSys> {
|
||||
Z2DebugSys();
|
||||
~Z2DebugSys();
|
||||
~Z2DebugSys() {}
|
||||
|
||||
void initJAW();
|
||||
void initSoundHioNode();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
#ifndef Z2F1TESTWINDOW_H
|
||||
#define Z2F1TESTWINDOW_H
|
||||
|
||||
#include "JSystem/JAHostIO/JAHUTableEdit.h"
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class Z2F1TestWindow : public JAWWindow {
|
||||
public:
|
||||
Z2F1TestWindow();
|
||||
|
||||
/* 0x3F0 */ f32 field_0x3f0;
|
||||
/* 0x3F4 */ f32 field_0x3f4;
|
||||
/* 0x3F8 */ f32 field_0x3f8[500];
|
||||
/* 0xBC8 */ int field_0xbc8;
|
||||
/* 0xBCC */ int field_0xbcc;
|
||||
/* 0xBD0 */ u8 field_0xbd0;
|
||||
/* 0xBD4 */ f32 field_0xbd4;
|
||||
};
|
||||
|
||||
class Z2F1SwingTestNode : public JAHFrameNode, public Z2F1TestWindow {
|
||||
public:
|
||||
Z2F1SwingTestNode();
|
||||
|
||||
/* 0xC48 */ JAHUSeBox field_0xc48;
|
||||
/* 0xCD0 */ JAHUSeBox field_0xcd0;
|
||||
/* 0xD58 */ u8 field_0xd58;
|
||||
/* 0xD59 */ u8 field_0xd59;
|
||||
/* 0xD5A */ u8 field_0xd5a;
|
||||
/* 0xD5B */ u8 field_0xd5b;
|
||||
/* 0xD5C */ f32 field_0xd5c;
|
||||
/* 0xD60 */ f32 field_0xd60;
|
||||
/* 0xD64 */ f32 field_0xd64;
|
||||
/* 0xD68 */ f32 field_0xd68;
|
||||
/* 0xD6C */ u8 field_0xd6c[0xD70 - 0xD6C];
|
||||
};
|
||||
|
||||
class Z2AudSettingView : public JAWWindow {
|
||||
public:
|
||||
Z2AudSettingView();
|
||||
};
|
||||
|
||||
class Z2DSPCheck : public JAWWindow {
|
||||
public:
|
||||
Z2DSPCheck() : JAWWindow("Z2DSPCheck", 500, 450) {}
|
||||
};
|
||||
|
||||
#endif /* Z2F1TESTWINDOW_H */
|
||||
|
|
@ -2,11 +2,16 @@
|
|||
#define Z2FXLINEMGR_H
|
||||
|
||||
#include "JSystem/JAudio2/JASGadget.h"
|
||||
#include "JSystem/JAHostIO/JAHFrameNode.h"
|
||||
|
||||
class JKRArchive;
|
||||
class JKRExpHeap;
|
||||
class JKRHeap;
|
||||
|
||||
struct Z2FxLineEditNode {};
|
||||
class Z2FxLineEditNode : public JAHFrameNode {
|
||||
public:
|
||||
Z2FxLineEditNode(JKRExpHeap*);
|
||||
};
|
||||
|
||||
struct Z2FxLineConfig {
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef Z2SEVIEW_H
|
||||
#define Z2SEVIEW_H
|
||||
|
||||
#include "JSystem/JAWWinLib/JAWEntrySeView.h"
|
||||
#include "JSystem/JAWWinLib/JAWPlaySeView.h"
|
||||
|
||||
class Z2EntrySeView : public JAWEntrySeViewBasic {
|
||||
public:
|
||||
Z2EntrySeView() {}
|
||||
};
|
||||
|
||||
class Z2PlaySeView : public JAWPlaySeViewBasic {
|
||||
public:
|
||||
Z2PlaySeView() {}
|
||||
};
|
||||
|
||||
#endif /* Z2SEVIEW_H */
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
#ifndef Z2SOUNDPLAYER_H
|
||||
#define Z2SOUNDPLAYER_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
#include "JSystem/JAudio2/JAISoundHandles.h"
|
||||
|
||||
class Z2SoundPlayer : public JAWWindow {
|
||||
public:
|
||||
Z2SoundPlayer(const char*);
|
||||
virtual ~Z2SoundPlayer() {}
|
||||
virtual void onDraw(JAWGraphContext*);
|
||||
virtual void frameWork();
|
||||
virtual void onPadProc(const JUTGamePad&);
|
||||
virtual void onTrigA(const JUTGamePad&);
|
||||
virtual void onTrigB(const JUTGamePad&);
|
||||
virtual void onTrigX(const JUTGamePad&);
|
||||
virtual void onTrigY(const JUTGamePad&);
|
||||
virtual void onTrigL(const JUTGamePad&);
|
||||
virtual void onTrigZ(const JUTGamePad&);
|
||||
virtual void onKeyMenu(const JUTGamePad&);
|
||||
virtual void onKeyUp(const JUTGamePad&);
|
||||
virtual void onKeyDown(const JUTGamePad&);
|
||||
virtual void onKeyLeft(const JUTGamePad&);
|
||||
virtual void onKeyRight(const JUTGamePad&);
|
||||
|
||||
u32 getCursorMoveMax(const JUTGamePad&);
|
||||
|
||||
/* 0x3ED */ u8 field_0x3ed;
|
||||
/* 0x3EE */ u8 field_0x3ee;
|
||||
/* 0x3EF */ u8 field_0x3ef;
|
||||
/* 0x3F0 */ u8 field_0x3f0;
|
||||
/* 0x3F4 */ const char* field_0x3f4;
|
||||
/* 0x3F8 */ short field_0x3f8;
|
||||
/* 0x3FA */ short field_0x3fa;
|
||||
/* 0x3FC */ short field_0x3fc;
|
||||
/* 0x3FE */ short field_0x3fe;
|
||||
/* 0x400 */ short field_0x400;
|
||||
/* 0x402 */ short field_0x402;
|
||||
/* 0x404 */ const char* field_0x404;
|
||||
/* 0x408 */ const char* field_0x408;
|
||||
/* 0x40C */ const char* field_0x40c;
|
||||
/* 0x410 */ const char* field_0x410;
|
||||
/* 0x414 */ const char* field_0x414;
|
||||
/* 0x418 */ const char* field_0x418;
|
||||
/* 0x41C */ const char* field_0x41c;
|
||||
/* 0x420 */ const char* field_0x420;
|
||||
/* 0x424 */ const char* field_0x424;
|
||||
/* 0x428 */ const char* field_0x428;
|
||||
/* 0x42C */ const char* field_0x42c;
|
||||
/* 0x430 */ const char* field_0x430;
|
||||
/* 0x434 */ const char* field_0x434;
|
||||
/* 0x438 */ const char* field_0x438;
|
||||
/* 0x43C */ const char* field_0x43c;
|
||||
/* 0x440 */ const char* field_0x440;
|
||||
/* 0x444 */ short field_0x444;
|
||||
/* 0x446 */ u8 field_0x446;
|
||||
/* 0x448 */ short* field_0x448[7];
|
||||
/* 0x464 */ int field_0x464;
|
||||
/* 0x468 */ int field_0x468;
|
||||
/* 0x46C */ JAISoundHandle field_0x46c[8];
|
||||
/* 0x48C */ JAISoundHandles field_0x48c;
|
||||
/* 0x494 */ JAISoundHandle field_0x494;
|
||||
/* 0x498 */ JAISoundHandle* field_0x498;
|
||||
/* 0x49C */ JAISoundHandle field_0x49c;
|
||||
/* 0x4A0 */ int field_0x4a0;
|
||||
/* 0x4A4 */ f32 field_0x4a4;
|
||||
/* 0x4A8 */ f32 field_0x4a8;
|
||||
/* 0x4AC */ f32 field_0x4ac;
|
||||
/* 0x4B0 */ f32 field_0x4b0;
|
||||
/* 0x4B4 */ f32 field_0x4b4;
|
||||
/* 0x4B8 */ f32 field_0x4b8;
|
||||
};
|
||||
|
||||
#endif /* Z2SOUNDPLAYER_H */
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef Z2TRACKVIEW_H
|
||||
#define Z2TRACKVIEW_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class Z2TrackView : public JAWWindow {
|
||||
public:
|
||||
enum DispMode {
|
||||
DISPMODE0
|
||||
};
|
||||
|
||||
Z2TrackView(u8, DispMode);
|
||||
};
|
||||
|
||||
#endif /* Z2TRACKVIEW_H */
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef Z2WAVEARCLOADER_H
|
||||
#define Z2WAVEARCLOADER_H
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
|
||||
class Z2WaveArcLoader : public JAWWindow {
|
||||
public:
|
||||
Z2WaveArcLoader();
|
||||
};
|
||||
|
||||
#endif /* Z2WAVEARCLOADER_H */
|
||||
|
|
@ -8,9 +8,20 @@
|
|||
class mDoAud_zelAudio_c : public Z2AudioMgr {
|
||||
public:
|
||||
void reset();
|
||||
mDoAud_zelAudio_c() {}
|
||||
mDoAud_zelAudio_c() {
|
||||
#if DEBUG
|
||||
setMode(2);
|
||||
#endif
|
||||
}
|
||||
~mDoAud_zelAudio_c() {}
|
||||
|
||||
#if DEBUG
|
||||
u8 getMode() { return field_0x13bd; }
|
||||
void setMode(u8 mode) { field_0x13bd = mode; }
|
||||
|
||||
/* 0x13BD */ u8 field_0x13bd;
|
||||
#endif
|
||||
|
||||
static void onInitFlag() { mInitFlag = true; }
|
||||
static bool isInitFlag() { return mInitFlag; }
|
||||
static bool isResetFlag() { return mResetFlag; }
|
||||
|
|
@ -293,6 +304,14 @@ inline void mDoAud_talkIn() {
|
|||
Z2AudioMgr::getInterface()->talkIn();
|
||||
}
|
||||
|
||||
inline void mDoAud_setOutputMode(u32 mode) {
|
||||
Z2AudioMgr::getInterface()->setOutputMode(mode);
|
||||
}
|
||||
|
||||
inline void mDoAud_loadStaticWaves() {
|
||||
Z2AudioMgr::getInterface()->loadStaticWaves();
|
||||
}
|
||||
|
||||
inline int mDoAud_monsSeStart(u32 i_soundId, const Vec* i_pos, u32 i_actorId, u32 param_3,
|
||||
s8 i_reverb) {
|
||||
(void)i_actorId;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
J2DGrafContext::J2DGrafContext(f32 x, f32 y, f32 width, f32 height)
|
||||
: mBounds(x, y, x + width, y + height), mScissorBounds(x, y, x + width, y + height) {
|
||||
if (x < 0.0f || y < 0.0f) {
|
||||
OS_REPORT("J2DWarning::ViewPort-Bounds \"Avoid using negative values for left or top.\"\n");
|
||||
}
|
||||
JUtility::TColor color(-1);
|
||||
setColor(color);
|
||||
setLineWidth(6);
|
||||
|
|
@ -81,6 +84,11 @@ void J2DGrafContext::scissor(JGeometry::TBox2<f32> const& bounds) {
|
|||
}
|
||||
|
||||
void J2DGrafContext::place(JGeometry::TBox2<f32> const& bounds) {
|
||||
if (bounds.i.x < 0.0f || bounds.i.y < 0.0f) {
|
||||
if (mBounds.i.x >= 0.0f && mBounds.i.y >= 0.0f) {
|
||||
OS_REPORT("J2DWarning::ViewPort-Bounds \"Avoid using negative values for left or top.\"\n");
|
||||
}
|
||||
}
|
||||
mBounds = bounds;
|
||||
mScissorBounds = bounds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ void J2DMaterial::setGX() {
|
|||
}
|
||||
|
||||
J2DTevBlock* J2DMaterial::createTevBlock(int block_type, bool noAlign) {
|
||||
J2DTevBlock* block;
|
||||
J2DTevBlock* block = NULL;
|
||||
|
||||
if (noAlign) {
|
||||
if (block_type <= 1) {
|
||||
|
|
@ -67,12 +67,15 @@ J2DTevBlock* J2DMaterial::createTevBlock(int block_type, bool noAlign) {
|
|||
block = new (-4) J2DTevBlock16();
|
||||
}
|
||||
}
|
||||
if (!block) {
|
||||
OS_PANIC(101, "Error : allocate memory.");
|
||||
}
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
J2DIndBlock* J2DMaterial::createIndBlock(int block_type, bool noAlign) {
|
||||
J2DIndBlock* block;
|
||||
J2DIndBlock* block = NULL;
|
||||
|
||||
if (noAlign) {
|
||||
if (block_type != 0) {
|
||||
|
|
@ -87,6 +90,9 @@ J2DIndBlock* J2DMaterial::createIndBlock(int block_type, bool noAlign) {
|
|||
block = new (-4) J2DIndBlockNull();
|
||||
}
|
||||
}
|
||||
if (!block) {
|
||||
OS_PANIC(133, "Error : allocate memory.");
|
||||
}
|
||||
|
||||
return block;
|
||||
}
|
||||
|
|
@ -116,8 +122,18 @@ J2DMaterial::J2DMaterialAnmPointer::J2DMaterialAnmPointer() {
|
|||
}
|
||||
|
||||
void J2DMaterial::makeAnmPointer() {
|
||||
int r29;
|
||||
int r28;
|
||||
if (mAnmPointer == NULL) {
|
||||
mAnmPointer = new J2DMaterialAnmPointer();
|
||||
r29 = 1;
|
||||
if (mAnmPointer == NULL) {
|
||||
OS_PANIC(171, "Error : allocate memory.");
|
||||
r28 = 0;
|
||||
if (!r28) {
|
||||
r29 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -157,9 +173,7 @@ void J2DMaterial::setAnimation(J2DAnmTextureSRTKey* anm) {
|
|||
u16 index = getIndex();
|
||||
|
||||
for (u16 i = 0; i < matNum; i++) {
|
||||
u16 matID = anm->getUpdateMaterialID(i);
|
||||
|
||||
if (index == matID) {
|
||||
if (index == anm->getUpdateMaterialID(i)) {
|
||||
u8 mtxID = anm->getUpdateTexMtxID(i);
|
||||
mAnmPointer->mSRTIds[mtxID] = i;
|
||||
}
|
||||
|
|
@ -183,9 +197,7 @@ void J2DMaterial::setAnimation(J2DAnmTexPattern* anm) {
|
|||
J3DAnmTexPatternFullTable* anmTbl = anm->getAnmTable();
|
||||
|
||||
for (u16 i = 0; i < matNum; i++) {
|
||||
u16 matID = anm->getUpdateMaterialID(i);
|
||||
|
||||
if (index == matID) {
|
||||
if (index == anm->getUpdateMaterialID(i)) {
|
||||
mAnmPointer->mPatternIds[anmTbl[i].mTexNo] = i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@
|
|||
#include "dolphin/gx.h"
|
||||
|
||||
void J2DTexMtx::load(u32 mtxIdx) {
|
||||
GXLoadTexMtxImm(mTexMtx, mtxIdx * 3 + GX_TEXMTX0, mInfo.getTexMtxType());
|
||||
GXLoadTexMtxImm(mTexMtx, mtxIdx * 3 + GX_TEXMTX0, (GXTexMtxType)mInfo.mTexMtxType);
|
||||
}
|
||||
|
||||
void J2DTexMtx::calc() {
|
||||
if (mInfo.mTexMtxDCC == J2DTexMtxInfo::DCC_NONE) {
|
||||
u32 dcc = mInfo.mTexMtxDCC;
|
||||
if (dcc == J2DTexMtxInfo::DCC_NONE) {
|
||||
getTextureMtx(mInfo.mTexSRTInfo, mInfo.mCenter, mTexMtx);
|
||||
} else if (mInfo.mTexMtxDCC == J2DTexMtxInfo::DCC_MAYA) {
|
||||
} else if (dcc == J2DTexMtxInfo::DCC_MAYA) {
|
||||
getTextureMtxMaya(mInfo.mTexSRTInfo, mTexMtx);
|
||||
}
|
||||
}
|
||||
|
|
@ -58,8 +59,8 @@ void J2DTexMtx::getTextureMtxMaya(J2DTextureSRTInfo const& param_0, Mtx param_1)
|
|||
}
|
||||
|
||||
void J2DIndTevStage::load(u8 tevStage) {
|
||||
GXSetTevIndirect((GXTevStageID)tevStage, getIndStage(), getIndFormat(), getBiasSel(),
|
||||
getMtxSel(), getWrapS(), getWrapT(), getPrev(), getLod(), getAlphaSel());
|
||||
GXSetTevIndirect((GXTevStageID)tevStage, (GXIndTexStageID)getIndStage(), (GXIndTexFormat)getIndFormat(), (GXIndTexBiasSel)getBiasSel(),
|
||||
(GXIndTexMtxID)getMtxSel(), (GXIndTexWrap)getWrapS(), (GXIndTexWrap)getWrapT(), (GXBool)getPrev(), (GXBool)getLod(), (GXIndTexAlphaSel)getAlphaSel());
|
||||
}
|
||||
|
||||
void J2DIndTexMtx::load(u8 indTexMtx) {
|
||||
|
|
@ -68,11 +69,11 @@ void J2DIndTexMtx::load(u8 indTexMtx) {
|
|||
}
|
||||
|
||||
void J2DIndTexCoordScale::load(u8 indTexStage) {
|
||||
GXSetIndTexCoordScale((GXIndTexStageID)indTexStage, mInfo.getScaleS(), mInfo.getScaleT());
|
||||
GXSetIndTexCoordScale((GXIndTexStageID)indTexStage, (GXIndTexScale)mInfo.mScaleS, (GXIndTexScale)mInfo.mScaleT);
|
||||
}
|
||||
|
||||
void J2DIndTexOrder::load(u8 indTexStage) {
|
||||
GXSetIndTexOrder((GXIndTexStageID)indTexStage, mInfo.getTexCoordID(), mInfo.getTexMapID());
|
||||
GXSetIndTexOrder((GXIndTexStageID)indTexStage, (GXTexCoordID)mInfo.mTexCoordID, (GXTexMapID)mInfo.mTexMapID);
|
||||
}
|
||||
|
||||
static void dummyVirtual(J2DTevBlock* block, J2DIndBlock* indBlock) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "JSystem/J2DGraph/J2DPrint.h"
|
||||
#include "JSystem/JSupport/JSURandomInputStream.h"
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
#include "JSystem/JUtility/JUTResource.h"
|
||||
|
||||
J2DTextBox::J2DTextBox()
|
||||
: mFont(NULL), mCharColor(), mGradientColor(), mStringPtr(NULL), mWhiteColor(), mBlackColor() {
|
||||
|
|
@ -77,12 +78,8 @@ J2DTextBox::J2DTextBox(J2DPane* p_pane, JSURandomInputStream* p_stream, u32 para
|
|||
|
||||
if (mStringPtr != NULL) {
|
||||
mStringLength = strLength;
|
||||
int temp_r0 = (u16)strLength - 1;
|
||||
u16 var_r26_2 = info.field_0x1e;
|
||||
|
||||
if (temp_r0 < var_r26_2) {
|
||||
var_r26_2 = (u16)temp_r0;
|
||||
}
|
||||
u16 var_r26_2 = strLength - 1 < info.field_0x1e ? u16(strLength - 1) : info.field_0x1e;
|
||||
|
||||
p_stream->peek(mStringPtr, var_r26_2);
|
||||
mStringPtr[var_r26_2] = 0;
|
||||
|
|
@ -94,20 +91,11 @@ J2DTextBox::J2DTextBox(J2DPane* p_pane, JSURandomInputStream* p_stream, u32 para
|
|||
mWhiteColor = JUtility::TColor(0xFFFFFFFF);
|
||||
|
||||
if (mat != NULL && mat->getTevBlock() != NULL) {
|
||||
if (mat->getTevBlock()->getTevStageNum() != 1) {
|
||||
J2DGXColorS10* color0p = mat->getTevBlock()->getTevColor(0);
|
||||
GXColorS10 color0;
|
||||
color0.r = color0p->r;
|
||||
color0.g = color0p->g;
|
||||
color0.b = color0p->b;
|
||||
color0.a = color0p->a;
|
||||
u8 tevStageNum = u32(mat->getTevBlock()->getTevStageNum());
|
||||
if (tevStageNum != 1) {
|
||||
J2DGXColorS10 color0(*mat->getTevBlock()->getTevColor(0));
|
||||
|
||||
J2DGXColorS10* color1p = mat->getTevBlock()->getTevColor(1);
|
||||
GXColorS10 color1;
|
||||
color1.r = color1p->r;
|
||||
color1.g = color1p->g;
|
||||
color1.b = color1p->b;
|
||||
color1.a = color1p->a;
|
||||
J2DGXColorS10 color1(*mat->getTevBlock()->getTevColor(1));
|
||||
|
||||
mBlackColor = JUtility::TColor(((u8)color0.r << 0x18) | ((u8)color0.g << 0x10) |
|
||||
((u8)color0.b << 8) | (u8)color0.a);
|
||||
|
|
@ -194,6 +182,7 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
|||
mKind = header.mTag;
|
||||
|
||||
makePaneStream(p_pane, p_stream);
|
||||
{JUTResReference ref;}
|
||||
u8 spA = p_stream->readU8();
|
||||
|
||||
ResFONT* fontPtr = (ResFONT*)getPointer(p_stream, 'FONT', p_archive);
|
||||
|
|
@ -203,7 +192,8 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
|||
|
||||
mCharColor.set(p_stream->read32b());
|
||||
mGradientColor.set(p_stream->read32b());
|
||||
mFlags = p_stream->read8b();
|
||||
u8 tmp = p_stream->read8b();
|
||||
mFlags = tmp;
|
||||
mCharSpacing = p_stream->readS16();
|
||||
mLineSpacing = p_stream->readS16();
|
||||
mFontSizeX = p_stream->read16b();
|
||||
|
|
@ -223,8 +213,8 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
|||
|
||||
spA -= 10;
|
||||
if (spA != 0) {
|
||||
u8 sp8 = p_stream->read8b();
|
||||
if (sp8 != 0) {
|
||||
tmp = p_stream->read8b();
|
||||
if (tmp != 0) {
|
||||
setConnectParent(true);
|
||||
}
|
||||
|
||||
|
|
@ -241,6 +231,7 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
|||
|
||||
if (spA != 0) {
|
||||
mWhiteColor.set(p_stream->read32b());
|
||||
spA--;
|
||||
}
|
||||
|
||||
field_0x10c = 0.0f;
|
||||
|
|
@ -283,7 +274,7 @@ void J2DTextBox::draw(f32 posX, f32 posY) {
|
|||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, 125);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60);
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
print.print(0.0f, 0.0f, mAlpha, "%s", mStringPtr);
|
||||
|
|
@ -309,7 +300,7 @@ void J2DTextBox::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBind)
|
|||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, 125);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60);
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
print.printReturn(mStringPtr, param_2, 0.0f, hBind, VBIND_TOP, 0.0f, -mFontSizeY,
|
||||
|
|
@ -337,8 +328,7 @@ s32 J2DTextBox::setString(char const* string, ...) {
|
|||
}
|
||||
|
||||
mStringLength = 0;
|
||||
char* tmp = new char[len + 1];
|
||||
mStringPtr = tmp;
|
||||
mStringPtr = new char[len + 1];
|
||||
|
||||
if (mStringPtr) {
|
||||
mStringLength = len + 1;
|
||||
|
|
@ -416,7 +406,7 @@ void J2DTextBox::drawSelf(f32 param_0, f32 param_1, Mtx* p_mtx) {
|
|||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60, GX_FALSE, 125);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 60);
|
||||
|
||||
print.locate(param_0 + mBounds.i.x, param_1 + mBounds.i.y);
|
||||
if (mStringPtr != NULL) {
|
||||
|
|
|
|||
|
|
@ -70,12 +70,8 @@ J2DTextBoxEx::J2DTextBoxEx(J2DPane* p_pane, JSURandomInputStream* p_stream, u32
|
|||
|
||||
if (mStringPtr != NULL) {
|
||||
mStringLength = strLength;
|
||||
int temp_r0 = (u16)strLength - 1;
|
||||
u16 var_r26_2 = info.field_0x1e;
|
||||
|
||||
if (temp_r0 < var_r26_2) {
|
||||
var_r26_2 = (u16)temp_r0;
|
||||
}
|
||||
u16 var_r26_2 = strLength - 1 < info.field_0x1e ? u16(strLength - 1) : info.field_0x1e;
|
||||
|
||||
p_stream->peek(mStringPtr, var_r26_2);
|
||||
mStringPtr[var_r26_2] = 0;
|
||||
|
|
@ -291,7 +287,8 @@ void J2DTextBoxEx::setTevStage(bool param_0) {
|
|||
setStage(stage, STAGE_0);
|
||||
} else {
|
||||
setStage(stage, STAGE_1);
|
||||
setStage(mMaterial->getTevBlock()->getTevStage(1), STAGE_2);
|
||||
stage = mMaterial->getTevBlock()->getTevStage(1);
|
||||
setStage(stage, STAGE_2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -360,12 +357,10 @@ bool J2DTextBoxEx::setBlackWhite(JUtility::TColor param_0, JUtility::TColor para
|
|||
return false;
|
||||
}
|
||||
|
||||
bool bvar = false;
|
||||
if (param_0 != 0 || param_1 != -1) {
|
||||
bvar = true;
|
||||
}
|
||||
bool bvar = (param_0 != 0) || (param_1 != -1);
|
||||
|
||||
mMaterial->getTevBlock()->setTevStageNum(bvar ? 2 : 1);
|
||||
u8 stageNum = bvar ? 2 : 1;
|
||||
mMaterial->getTevBlock()->setTevStageNum(stageNum);
|
||||
setTevOrder(bvar);
|
||||
setTevStage(bvar);
|
||||
|
||||
|
|
@ -396,38 +391,32 @@ bool J2DTextBoxEx::getBlackWhite(JUtility::TColor* param_0, JUtility::TColor* pa
|
|||
return false;
|
||||
}
|
||||
|
||||
bool tevStageNum = mMaterial->getTevBlock()->getTevStageNum() != 1;
|
||||
u32 tevStageNum = mMaterial->getTevBlock()->getTevStageNum();
|
||||
bool manyTevStages = tevStageNum == 1 ? false : true;
|
||||
*param_0 = JUtility::TColor(0);
|
||||
*param_1 = JUtility::TColor(0xffffffff);
|
||||
if (tevStageNum) {
|
||||
J2DGXColorS10* local_30 = mMaterial->getTevBlock()->getTevColor(0);
|
||||
s16 color0r = local_30->r;
|
||||
s16 color0g = local_30->g;
|
||||
s16 color0b = local_30->b;
|
||||
s16 color0a = local_30->a;
|
||||
J2DGXColorS10* local_38 = mMaterial->getTevBlock()->getTevColor(1);
|
||||
s16 color1r = local_38->r;
|
||||
s16 color1g = local_38->g;
|
||||
s16 color1b = local_38->b;
|
||||
s16 color1a = local_38->a;
|
||||
if (manyTevStages) {
|
||||
J2DGXColorS10 color0(*mMaterial->getTevBlock()->getTevColor(0));
|
||||
J2DGXColorS10 color1(*mMaterial->getTevBlock()->getTevColor(1));
|
||||
*param_0 = JUtility::TColor(
|
||||
(((u8)color0r) << 24) | (((u8)color0g) << 16) | (((u8)color0b) << 8) |
|
||||
((u8)color0a));
|
||||
(((u8)color0.r) << 24) | (((u8)color0.g) << 16) | (((u8)color0.b) << 8) |
|
||||
((u8)color0.a));
|
||||
*param_1 = JUtility::TColor(
|
||||
(((u8)color1r) << 24) | (((u8)color1g) << 16) | (((u8)color1b) << 8) |
|
||||
((u8)color1a));
|
||||
(((u8)color1.r) << 24) | (((u8)color1.g) << 16) | (((u8)color1.b) << 8) |
|
||||
((u8)color1.a));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool J2DTextBoxEx::isSetBlackWhite(JUtility::TColor param_0, JUtility::TColor param_1) const {
|
||||
if ((u32)param_0 == 0 && (u32)param_1 == 0xffffffff) {
|
||||
if (param_0 == 0 && param_1 == 0xffffffff) {
|
||||
return 1;
|
||||
}
|
||||
mMaterial->getTevBlock()->getTevStageNum();
|
||||
if (mMaterial->getTevBlock()->getMaxStage() == 1) {
|
||||
u32 tevStageNum = mMaterial->getTevBlock()->getTevStageNum();
|
||||
u8 maxStage = mMaterial->getTevBlock()->getMaxStage();
|
||||
if (maxStage == 1) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/J2DGraph/J2DWindow.h"
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "JSystem/JSupport/JSURandomInputStream.h"
|
||||
#include "JSystem/JUtility/JUTPalette.h"
|
||||
#include "JSystem/JUtility/JUTResource.h"
|
||||
|
|
@ -144,6 +145,43 @@ J2DWindow::J2DWindow(J2DPane* param_0, JSURandomInputStream* param_1, J2DMateria
|
|||
initinfo2();
|
||||
}
|
||||
|
||||
J2DWindow::J2DWindow(u64 param_0, const JGeometry::TBox2<f32>& param_1, const char* param_2, J2DTextureBase param_3, const ResTLUT* param_4) :
|
||||
J2DPane(param_0, param_1),
|
||||
field_0x100(NULL),
|
||||
field_0x104(NULL),
|
||||
field_0x108(NULL),
|
||||
field_0x10c(NULL),
|
||||
field_0x110(NULL),
|
||||
mPalette(NULL) {
|
||||
const ResTIMG* r30 = (const ResTIMG*)J2DScreen::getNameResource(param_2);
|
||||
initiate(r30, r30, r30, r30, param_4, convertMirror(param_3), param_1);
|
||||
}
|
||||
|
||||
void J2DWindow::initiate(const ResTIMG* param_0, const ResTIMG* param_1, const ResTIMG* param_2, const ResTIMG* param_3, const ResTLUT* param_4, J2DWindowMirror param_5, const JGeometry::TBox2<f32>& param_6) {
|
||||
if (param_0) {
|
||||
field_0x100 = new JUTTexture(param_0, 0);
|
||||
}
|
||||
if (param_1) {
|
||||
field_0x104 = new JUTTexture(param_1, 0);
|
||||
}
|
||||
if (param_2) {
|
||||
field_0x108 = new JUTTexture(param_2, 0);
|
||||
}
|
||||
if (param_3) {
|
||||
field_0x10c = new JUTTexture(param_3, 0);
|
||||
}
|
||||
if (param_4) {
|
||||
mPalette = new JUTPalette(GX_TLUT0, const_cast<ResTLUT*>(param_4));
|
||||
}
|
||||
field_0x144 = param_5;
|
||||
if (field_0x100 && field_0x104 && field_0x108 && field_0x10c) {
|
||||
field_0x114.set(field_0x100->getWidth(), field_0x100->getHeight(), param_6.getWidth() - field_0x104->getWidth(), param_6.getHeight() - field_0x108->getHeight());
|
||||
} else {
|
||||
field_0x114.set(0.0f, 0.0f, param_6.getWidth(), param_6.getHeight());
|
||||
}
|
||||
initinfo();
|
||||
}
|
||||
|
||||
void J2DWindow::private_readStream(J2DPane* param_0, JSURandomInputStream* param_1,
|
||||
JKRArchive* param_2) {
|
||||
s32 local_188 = param_1->getPosition();
|
||||
|
|
@ -183,7 +221,7 @@ void J2DWindow::private_readStream(J2DPane* param_0, JSURandomInputStream* param
|
|||
field_0x12C.set(param_1->read32b());
|
||||
field_0x130.set(param_1->read32b());
|
||||
field_0x134.set(param_1->read32b());
|
||||
r27 -= 14;
|
||||
r27 -= u8(14);
|
||||
field_0x110 = NULL;
|
||||
if (r27) {
|
||||
timg = (ResTIMG*)getPointer(param_1, 'TIMG', param_2);
|
||||
|
|
@ -200,11 +238,20 @@ void J2DWindow::private_readStream(J2DPane* param_0, JSURandomInputStream* param
|
|||
}
|
||||
if (r27) {
|
||||
mWhite = JUtility::TColor(param_1->readU32());
|
||||
r27--;
|
||||
}
|
||||
param_1->seek(local_188 + local_180[1], JSUStreamSeekFrom_SET);
|
||||
initinfo2();
|
||||
}
|
||||
|
||||
void J2DWindow::initinfo() {
|
||||
mKind = 'WIN1';
|
||||
setContentsColor(JUtility::TColor(0xffffffff));
|
||||
mBlack = JUtility::TColor(0);
|
||||
mWhite = JUtility::TColor(0xffffffff);
|
||||
initinfo2();
|
||||
}
|
||||
|
||||
void J2DWindow::initinfo2() {
|
||||
if (field_0x100 && field_0x104 && field_0x108 && field_0x10c) {
|
||||
field_0x140 = field_0x100->getWidth() + field_0x104->getWidth();
|
||||
|
|
@ -229,6 +276,10 @@ void J2DWindow::initinfo2() {
|
|||
}
|
||||
}
|
||||
|
||||
J2DWindowMirror J2DWindow::convertMirror(J2DTextureBase) {
|
||||
|
||||
}
|
||||
|
||||
J2DWindow::~J2DWindow() {
|
||||
delete field_0x100;
|
||||
delete field_0x104;
|
||||
|
|
@ -488,10 +539,27 @@ void J2DWindow::drawFrameTexture(JUTTexture* param_0, f32 param_1, f32 param_2,
|
|||
|
||||
void J2DWindow::drawFrameTexture(JUTTexture* param_0, f32 param_1, f32 param_2, bool param_3,
|
||||
bool param_4, bool param_5) {
|
||||
u16 r31 = param_4 ? u16(0x8000) : u16(0);
|
||||
u16 r30 = param_3 ? u16(0x8000) : u16(0);
|
||||
u16 r29 = param_4 ? u16(0) : u16(0x8000);
|
||||
u16 r28 = param_3 ? u16(0) : u16(0x8000);
|
||||
u16 r31, r30, r29, r28;
|
||||
if (param_4) {
|
||||
r31 = 0x8000;
|
||||
} else {
|
||||
r31 = 0;
|
||||
}
|
||||
if (param_3) {
|
||||
r30 = 0x8000;
|
||||
} else {
|
||||
r30 = 0;
|
||||
}
|
||||
if (param_4) {
|
||||
r29 = 0;
|
||||
} else {
|
||||
r29 = 0x8000;
|
||||
}
|
||||
if (param_3) {
|
||||
r28 = 0;
|
||||
} else {
|
||||
r28 = 0x8000;
|
||||
}
|
||||
drawFrameTexture(param_0, param_1, param_2, param_0->getWidth(), param_0->getHeight(), r28, r29,
|
||||
r30, r31, param_5);
|
||||
}
|
||||
|
|
@ -575,11 +643,7 @@ void J2DWindow::setTevMode(JUTTexture* param_0, JUtility::TColor param_1,
|
|||
}
|
||||
|
||||
JUTTexture* J2DWindow::getFrameTexture(u8 param_0, u8 param_1) const {
|
||||
JUTTexture* tmp[4] = {NULL, NULL, NULL, NULL};
|
||||
tmp[0] = field_0x100;
|
||||
tmp[1] = field_0x104;
|
||||
tmp[2] = field_0x108;
|
||||
tmp[3] = field_0x10c;
|
||||
JUTTexture* tmp[4] = {field_0x100, field_0x104, field_0x108, field_0x10c};
|
||||
if (param_0 >= 4 || param_1 != 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -587,12 +651,7 @@ JUTTexture* J2DWindow::getFrameTexture(u8 param_0, u8 param_1) const {
|
|||
}
|
||||
|
||||
bool J2DWindow::isUsed(ResTIMG const* param_0) {
|
||||
JUTTexture* tmp[5] = {NULL, NULL, NULL, NULL, NULL};
|
||||
tmp[0] = field_0x100;
|
||||
tmp[1] = field_0x104;
|
||||
tmp[2] = field_0x108;
|
||||
tmp[3] = field_0x10c;
|
||||
tmp[4] = field_0x110;
|
||||
JUTTexture* tmp[5] = {field_0x100, field_0x104, field_0x108, field_0x10c, field_0x110};
|
||||
for (u8 i = 0; i < 5; i++) {
|
||||
if (tmp[i] && tmp[i]->getTexInfo() == param_0) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
#include "JSystem/JAHostIO/JAHioUtil.h"
|
||||
#include "JSystem/JHostIO/JORMContext.h"
|
||||
|
||||
u16 JAHControl::smButtonWidth[] = {20, 50, 100, 150, 300, 600};
|
||||
u16 JAHControl::smCommentWidth[] = {20, 50, 100, 200, 400, 800};
|
||||
u16 JAHControl::smComboWidth[] = { 50, 100, 150, 200, 300, 600};
|
||||
u16 JAHControl::smYTop = 5;
|
||||
u16 JAHControl::smXLeft = 5;
|
||||
u16 JAHControl::smIndentSize = 30;
|
||||
u16 JAHControl::smLineHeight = 23;
|
||||
u16 JAHControl::smContWidth = 450;
|
||||
u16 JAHControl::smIntX = 2;
|
||||
u16 JAHControl::smIntY = 5;
|
||||
u16 JAHControl::smNameWidth = 150;
|
||||
|
||||
void JAHControl::returnY(u16 param_1) {
|
||||
mY += u16(smIntY + smLineHeight * param_1);
|
||||
mX = smXLeft + field_0x4 * smIndentSize;
|
||||
}
|
||||
|
||||
void JAHControl::indent(s8 param_1) {
|
||||
field_0x4 += param_1;
|
||||
mX = smXLeft + field_0x4 * smIndentSize;
|
||||
}
|
||||
|
||||
void JAHControl::makeComment(const char* label, u32 id, u8 param_3, u32 style) {
|
||||
mContext->genLabel(label, id, style, NULL, mX, mY, smCommentWidth[param_3], smLineHeight);
|
||||
returnY(1);
|
||||
}
|
||||
|
||||
JAHControl::JAHControl(JORMContext* mctx, JAHioNode* node) {
|
||||
mContext = mctx;
|
||||
mNode = node;
|
||||
mX = smXLeft;
|
||||
mY = smYTop;
|
||||
field_0x4 = 0;
|
||||
char* name = node->getNodeName();
|
||||
if (name) {
|
||||
makeComment(JAHioUtil::getString("■■■ %s ■■■", name), 0xCCCC0000, 5, 0);
|
||||
} else {
|
||||
makeComment("■■■ NO NAMED NODE ■■■", 0, 5, 0);
|
||||
}
|
||||
indent(1);
|
||||
returnY(1);
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioMgr.h"
|
||||
#include "JSystem/JAHostIO/JAHFrameNode.h"
|
||||
#include "JSystem/JHostIO/JORServer.h"
|
||||
|
||||
JAHioMgr::JAHioMgr() : field_0x4(0), field_0x8(0) {}
|
||||
|
||||
void JAHioMgr::init_OnGame() {
|
||||
field_0x4 = 0;
|
||||
}
|
||||
|
||||
bool JAHioMgr::isGameMode() {
|
||||
return field_0x4 == 0;
|
||||
}
|
||||
|
||||
void JAHioMgr::appendRootNode(JORReflexible* param_1, JAHioNode* node) {
|
||||
JUT_ASSERT(44, isGameMode());
|
||||
JORMContext* mctx = JORAttachMContext(12);
|
||||
mctx->genNode(param_1, 1, node->getNodeName(), node, 0, 0);
|
||||
JORReleaseMContext(mctx);
|
||||
appendFrameNode(node);
|
||||
}
|
||||
|
||||
void JAHioMgr::appendFrameNode(JAHioNode* node) {
|
||||
if (node->getNodeType() == 1) {
|
||||
field_0xc.append(((JAHFrameNode*)node)->getFrameNodeLink());
|
||||
}
|
||||
}
|
||||
|
||||
void JAHioMgr::removeFrameNode(JAHioNode* node) {
|
||||
if (node->getNodeType() == 1) {
|
||||
field_0xc.remove(((JAHFrameNode*)node)->getFrameNodeLink());
|
||||
}
|
||||
JSUTreeIterator<JAHioNode> it;
|
||||
for (it = node->getTree()->getFirstChild(); it != node->getTree()->getEndChild(); ++it) {
|
||||
removeFrameNode(*it);
|
||||
}
|
||||
}
|
||||
|
||||
u32 JAHioMgr::framework() {
|
||||
JSUListIterator<JAHFrameNode> it;
|
||||
for (it = field_0xc.getFirst(); it != field_0xc.getEnd(); ++it) {
|
||||
it->framework();
|
||||
}
|
||||
JAHioNode* node = JAHioNode::getCurrentNode();
|
||||
if (node && node->getNodeType() == 1) {
|
||||
((JAHFrameNode*)node)->currentFramework();
|
||||
}
|
||||
u32 r30 = 0;
|
||||
if (field_0x4 == 1) {
|
||||
r30 = JOR_MESSAGELOOP();
|
||||
}
|
||||
return r30;
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAHostIO/JAHioMgr.h"
|
||||
#include "JSystem/JHostIO/JORServer.h"
|
||||
|
||||
JAHioNode::JAHioNode(const char* name) : mTree(this) {
|
||||
mLastChild = NULL;
|
||||
if (name) {
|
||||
setNodeName(name);
|
||||
} else {
|
||||
setNodeName("no named");
|
||||
}
|
||||
}
|
||||
|
||||
JAHioNode::~JAHioNode() {
|
||||
if (getParent()) {
|
||||
getParent()->removeNode(this);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHioNode::updateNode() {
|
||||
JORMContext* mctx = JORReflexible::getJORServer()->attachMCTX(5);
|
||||
mctx->invalidNode(this, 3);
|
||||
JORReflexible::getJORServer()->releaseMCTX(mctx);
|
||||
}
|
||||
|
||||
void JAHioNode::setNodeName(const char* name) {
|
||||
int size = strlen(name) + 1;
|
||||
JUT_ASSERT(51, size < 32);
|
||||
strcpy(mName, name);
|
||||
}
|
||||
|
||||
void JAHioNode::genMessage(JORMContext* mctx) {
|
||||
JAHControl control(mctx, this);
|
||||
message(control);
|
||||
if (JAHSingletonBase<JAHioMgr>::getIns()->getNodeSysType() == 0) {
|
||||
generateTempChildren(mctx);
|
||||
} else {
|
||||
generateRealChildren(mctx);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHioNode::appendNode(JAHioNode* node, const char* name) {
|
||||
mTree.appendChild(&node->mTree);
|
||||
JAHSingletonBase<JAHioMgr>::getIns()->appendFrameNode(node);
|
||||
if (name) {
|
||||
node->setNodeName(name);
|
||||
}
|
||||
updateNode();
|
||||
}
|
||||
|
||||
void JAHioNode::prependNode(JAHioNode* node, const char* name) {
|
||||
mTree.prependChild(&node->mTree);
|
||||
JAHSingletonBase<JAHioMgr>::getIns()->appendFrameNode(node);
|
||||
if (name) {
|
||||
node->setNodeName(name);
|
||||
}
|
||||
updateNode();
|
||||
}
|
||||
|
||||
void JAHioNode::removeNode(JAHioNode* node) {
|
||||
if (smCurrentNode == this) {
|
||||
smCurrentNode = NULL;
|
||||
}
|
||||
mTree.removeChild(&node->mTree);
|
||||
JAHSingletonBase<JAHioMgr>::getIns()->removeFrameNode(node);
|
||||
updateNode();
|
||||
}
|
||||
|
||||
void JAHioNode::generateRealChildren(JORMContext* mctx) {
|
||||
for (JSUTreeIterator<JAHioNode> it(mTree.getFirstChild()); it != mTree.getEndChild(); ++it) {
|
||||
JAHioNode* node = it.getObject();
|
||||
mctx->startNode(node->mName, node, 4, node->getNodeIcon());
|
||||
node->genMessage(mctx);
|
||||
mctx->endNode();
|
||||
}
|
||||
}
|
||||
|
||||
void JAHioNode::generateTempChildren(JORMContext* mctx) {
|
||||
for (JSUTreeIterator<JAHioNode> it(mTree.getFirstChild()); it != mTree.getEndChild(); ++it) {
|
||||
JAHioNode* node = it.getObject();
|
||||
mctx->genNode(node->mName, node, 4, node->getNodeIcon());
|
||||
}
|
||||
}
|
||||
|
||||
u32 JAHioNode::getNodeKind() const { return 0; }
|
||||
|
||||
JAHioNode* JAHioNode::getParent() {
|
||||
if (mTree.getParent()) {
|
||||
return mTree.getParent()->getObject();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void JAHioNode::listenPropertyEvent(const JORPropertyEvent* event) {
|
||||
propertyEvent(JAH_P_EVENT0, (u32)event->id);
|
||||
JORReflexible::listenPropertyEvent(event);
|
||||
propertyEvent(JAH_P_EVENT1, (u32)event->id);
|
||||
}
|
||||
|
||||
void JAHioNode::listenNodeEvent(const JORNodeEvent* event) {
|
||||
if (event->field_0x0 == 3) {
|
||||
smCurrentNode = this;
|
||||
if (getParent()) {
|
||||
getParent()->setLastChild(this);
|
||||
}
|
||||
nodeEvent(JAH_N_EVENT0);
|
||||
} else if (event->field_0x0 == 4) {
|
||||
nodeEvent(JAH_N_EVENT1);
|
||||
} else if (event->field_0x0 == 5) {
|
||||
nodeEvent(JAH_N_EVENT2);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioUtil.h"
|
||||
#include "stdio.h"
|
||||
|
||||
char JAHioUtil::mStringBuffer[256];
|
||||
|
||||
char* JAHioUtil::getString(const char* msg, ...) {
|
||||
va_list args;
|
||||
va_start(msg, args);
|
||||
vsprintf(mStringBuffer, msg, args);
|
||||
va_end(args);
|
||||
return mStringBuffer;
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWExtSystem.h"
|
||||
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
|
||||
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "algorithm.h"
|
||||
|
||||
JGadget::TList<JAWWindow*> JAWExtSystem::sPage[128];
|
||||
JAWExtSystem::TSystemInterface JAWExtSystem::sInterface;
|
||||
s32 JAWExtSystem::sCurrentPage = ARRAY_SIZE(sPage) - 1;
|
||||
u8 JAWExtSystem::lbl_80748E44;
|
||||
|
||||
BOOL JAWExtSystem::registWindow(u32 param_1, JAWWindow* param_2, int param_3, int param_4) {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (param_1 >= ARRAY_SIZE(sPage)) {
|
||||
return FALSE;
|
||||
}
|
||||
param_2->move(param_3, param_4);
|
||||
sPage[param_1].push_back(param_2);
|
||||
if (sCurrentPage > param_1) {
|
||||
sCurrentPage = param_1;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL JAWExtSystem::destroyWindow(u32 param_1, JAWWindow* param_2) {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (param_1 >= ARRAY_SIZE(sPage)) {
|
||||
return FALSE;
|
||||
}
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[param_1];
|
||||
JGadget::TList<JAWWindow*>::iterator it = std::find(page->begin(), page->end(), param_2);
|
||||
if (it == page->end()) {
|
||||
return FALSE;
|
||||
}
|
||||
page->erase(it);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void JAWExtSystem::nextPage() {
|
||||
int page = sCurrentPage;
|
||||
do {
|
||||
sCurrentPage++;
|
||||
if (sCurrentPage >= ARRAY_SIZE(sPage)) {
|
||||
sCurrentPage = 0;
|
||||
}
|
||||
if (page == sCurrentPage) {
|
||||
break;
|
||||
}
|
||||
} while (sPage[sCurrentPage].empty());
|
||||
}
|
||||
|
||||
void JAWExtSystem::prevPage() {
|
||||
int page = sCurrentPage;
|
||||
do {
|
||||
sCurrentPage--;
|
||||
if (sCurrentPage < 0) {
|
||||
sCurrentPage = ARRAY_SIZE(sPage) - 1;
|
||||
}
|
||||
if (page == sCurrentPage) {
|
||||
break;
|
||||
}
|
||||
} while (sPage[sCurrentPage].empty());
|
||||
}
|
||||
|
||||
void JAWExtSystem::nextWindow() {
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TList<JAWWindow*>::iterator begin = page->begin();
|
||||
if (begin == page->end()) {
|
||||
return;
|
||||
}
|
||||
JAWWindow* window = *begin;
|
||||
page->erase(begin);
|
||||
page->push_back(window);
|
||||
}
|
||||
|
||||
void JAWExtSystem::prevWindow() {
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TList<JAWWindow*>::iterator end = page->end();
|
||||
end--;
|
||||
if (end == page->end()) {
|
||||
return;
|
||||
}
|
||||
JAWWindow* window = *end;
|
||||
page->erase(end);
|
||||
page->push_front(window);
|
||||
}
|
||||
|
||||
void JAWExtSystem::draw() {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (!JAWGraphContext::lbl_8074CD30) {
|
||||
return;
|
||||
}
|
||||
J2DOrthoGraph ortho(0.0f, 0.0f, 640.0f, 480.0f, -1.0f, 1.0f);
|
||||
ortho.setOrtho(0.0f, -20.0f, 640.0f, 520.0f, -1.0, 1.0f);
|
||||
ortho.setPort();
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TIterator_reverse<JGadget::TList<JAWWindow*>::iterator> it;
|
||||
for (it = page->rbegin(); it != page->rend(); it++) {
|
||||
JAWWindow** window = &*it;
|
||||
(*window)->initIf();
|
||||
(*window)->setAlpha(lbl_80748E44);
|
||||
(*window)->draw(0, 0, &ortho);
|
||||
}
|
||||
for (int i = 0; i < ARRAY_SIZE(sPage); i++) {
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[i];
|
||||
JGadget::TIterator_reverse<JGadget::TList<JAWWindow*>::iterator> it;
|
||||
for (it = page->rbegin(); it != page->rend(); it++) {
|
||||
JAWWindow** window = &*it;
|
||||
(*window)->frameWork();
|
||||
}
|
||||
}
|
||||
GXSetScissor(0, 0, 640, 480);
|
||||
}
|
||||
|
||||
void JAWExtSystem::padProc(const JUTGamePad& pad) {
|
||||
TCurrentHeap heap(sInterface);
|
||||
if (pad.getAnalogR() && pad.testTrigger(PAD_BUTTON_MENU)) {
|
||||
JAWGraphContext::lbl_8074CD30 ^= true;
|
||||
}
|
||||
if (!JAWGraphContext::lbl_8074CD30) {
|
||||
return;
|
||||
}
|
||||
JGadget::TList<JAWWindow*>* page = &sPage[sCurrentPage];
|
||||
JGadget::TList<JAWWindow*>::iterator begin = page->begin();
|
||||
if (begin == page->end()) {
|
||||
return;
|
||||
}
|
||||
JAWWindow* window = *begin;
|
||||
if (pad.getAnalogR()) {
|
||||
f32 f31 = pad.getAnalogL() * 0.1f + 8.0f;
|
||||
int r25 = f31 * pad.getMainStickX();
|
||||
int r28 = -int(f31 * pad.getMainStickY());
|
||||
if (pad.testButton(PAD_BUTTON_X)) {
|
||||
window->addSize(r25, r28);
|
||||
} else if (pad.testButton(PAD_BUTTON_B)) {
|
||||
int r29 = lbl_80748E44;
|
||||
r29 += (r28 > 0 ? -2 : r28 < 0 ? 2 : 0) * (pad.getAnalogL() ? 2 : 1);
|
||||
if (r29 < 0) {
|
||||
r29 = 0;
|
||||
}
|
||||
if (r29 >= 256) {
|
||||
r29 = 255;
|
||||
}
|
||||
lbl_80748E44 = r29;
|
||||
} else {
|
||||
window->addPosition(r25, r28);
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_RIGHT)) {
|
||||
nextPage();
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_LEFT)) {
|
||||
prevPage();
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_UP)) {
|
||||
prevWindow();
|
||||
}
|
||||
if (pad.testTrigger(PAD_BUTTON_DOWN)) {
|
||||
nextWindow();
|
||||
}
|
||||
} else {
|
||||
window->padProc(pad);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
|
||||
#include "JSystem/J2DGraph/J2DPrint.h"
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
|
||||
JUTResFont* JAWGraphContext::sFont;
|
||||
bool JAWGraphContext::lbl_8074CD30;
|
||||
|
||||
JAWGraphContext::JAWGraphContext() :
|
||||
field_0x0(NULL),
|
||||
field_0x4(255, 255, 255, 255),
|
||||
field_0x8(255, 255, 255, 255),
|
||||
field_0xc(255, 255, 255, 255),
|
||||
field_0x10(255, 255, 255, 255) {
|
||||
mParentAlpha = 255;
|
||||
field_0x15 = 6;
|
||||
field_0x16 = 6;
|
||||
field_0x18 = 0;
|
||||
if (!sFont) {
|
||||
sFont = new JUTResFont((ResFONT*)JUTResFONT_Ascfont_fix12, NULL);
|
||||
}
|
||||
field_0x0 = new J2DPrint(sFont, JUtility::TColor(255, 255, 255, 255), JUtility::TColor(255, 255, 255, 255));
|
||||
field_0x0->initiate();
|
||||
locate(0, 0);
|
||||
}
|
||||
|
||||
JAWGraphContext::~JAWGraphContext() {}
|
||||
|
||||
void JAWGraphContext::reset() {
|
||||
locate(0, 0);
|
||||
color(255, 255, 255, 255);
|
||||
setGXforPrint();
|
||||
}
|
||||
|
||||
void JAWGraphContext::color(u8 r, u8 g, u8 b, u8 a) {
|
||||
color(JUtility::TColor(r, g, b, a));
|
||||
}
|
||||
|
||||
void JAWGraphContext::color(const JUtility::TColor& c) {
|
||||
color(c, c, c, c);
|
||||
}
|
||||
|
||||
void JAWGraphContext::locate(int param_1, int param_2) {
|
||||
field_0x0->locate(param_1 * field_0x0->getFont()->getWidth(), (param_2 + 1) * field_0x0->getFont()->getHeight());
|
||||
}
|
||||
|
||||
void JAWGraphContext::print(char const* msg, ...) {
|
||||
va_list args;
|
||||
if (field_0x0->getCursorV() > 640.0f) {
|
||||
return;
|
||||
}
|
||||
if (field_0x18) {
|
||||
setGXforPrint();
|
||||
}
|
||||
va_start(args, msg);
|
||||
u8 alpha = field_0x4.a * mParentAlpha / 255;
|
||||
field_0x0->print_va(alpha, msg, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void JAWGraphContext::print(int param_1, int param_2, const char* msg, ...) {
|
||||
va_list args;
|
||||
locate(param_1, param_2);
|
||||
if (field_0x0->getCursorV() > 640.0f) {
|
||||
return;
|
||||
}
|
||||
if (field_0x18) {
|
||||
setGXforPrint();
|
||||
}
|
||||
va_start(args, msg);
|
||||
u8 alpha = field_0x4.a * mParentAlpha / 255;
|
||||
field_0x0->print_va(alpha, msg, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void JAWGraphContext::color(const JUtility::TColor& param_1, const JUtility::TColor& param_2, const JUtility::TColor& param_3, const JUtility::TColor& param_4) {
|
||||
field_0x4 = param_1;
|
||||
field_0x8 = param_2;
|
||||
field_0xc = param_3;
|
||||
field_0x10 = param_4;
|
||||
field_0x0->setCharColor(param_1);
|
||||
field_0x0->setGradColor(param_2);
|
||||
}
|
||||
|
||||
void JAWGraphContext::fillBox(const JGeometry::TBox2<f32>& box) {
|
||||
if (field_0x18 != 1) {
|
||||
setGXforDraw();
|
||||
}
|
||||
JUtility::TColor color0(field_0x4);
|
||||
JUtility::TColor color1(field_0x8);
|
||||
JUtility::TColor color2(field_0xc);
|
||||
JUtility::TColor color3(field_0x10);
|
||||
if (mParentAlpha != 255) {
|
||||
color0.a = field_0x4.a * mParentAlpha / 255;
|
||||
color1.a = field_0x8.a * mParentAlpha / 255;
|
||||
color2.a = field_0xc.a * mParentAlpha / 255;
|
||||
color3.a = field_0x10.a * mParentAlpha / 255;
|
||||
}
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3s16(box.i.x, box.i.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXPosition3s16(box.f.x, box.i.y, 0);
|
||||
GXColor1u32(color2);
|
||||
GXPosition3s16(box.f.x, box.f.y, 0);
|
||||
GXColor1u32(color3);
|
||||
GXPosition3s16(box.i.x, box.f.y, 0);
|
||||
GXColor1u32(color1);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
void JAWGraphContext::drawFrame(const JGeometry::TBox2<f32>& box) {
|
||||
if (field_0x18 != 1) {
|
||||
setGXforDraw();
|
||||
}
|
||||
JUtility::TColor color0(field_0x4);
|
||||
JUtility::TColor color1(field_0x8);
|
||||
JUtility::TColor color2(field_0xc);
|
||||
JUtility::TColor color3(field_0x10);
|
||||
if (mParentAlpha != 255) {
|
||||
color0.a = field_0x4.a * mParentAlpha / 255;
|
||||
color1.a = field_0x8.a * mParentAlpha / 255;
|
||||
color2.a = field_0xc.a * mParentAlpha / 255;
|
||||
color3.a = field_0x10.a * mParentAlpha / 255;
|
||||
}
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, 5);
|
||||
GXPosition3s16(box.i.x, box.i.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXPosition3s16(box.f.x, box.i.y, 0);
|
||||
GXColor1u32(color2);
|
||||
GXPosition3s16(box.f.x, box.f.y, 0);
|
||||
GXColor1u32(color3);
|
||||
GXPosition3s16(box.i.x, box.f.y, 0);
|
||||
GXColor1u32(color1);
|
||||
GXPosition3s16(box.i.x, box.i.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
void JAWGraphContext::line(const JGeometry::TVec2<f32>& p1, const JGeometry::TVec2<f32>& p2) {
|
||||
if (field_0x18 != 1) {
|
||||
setGXforDraw();
|
||||
}
|
||||
JUtility::TColor color0(field_0x4);
|
||||
JUtility::TColor color1(field_0x8);
|
||||
if (mParentAlpha != 255) {
|
||||
color0.a = field_0x4.a * mParentAlpha / 255;
|
||||
color1.a = field_0x8.a * mParentAlpha / 255;
|
||||
}
|
||||
GXBegin(GX_LINES, GX_VTXFMT0, 2);
|
||||
GXPosition3s16(p1.x, p1.y, 0);
|
||||
GXColor1u32(color0);
|
||||
GXPosition3s16(p2.x, p2.y, 0);
|
||||
GXColor1u32(color1);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
void JAWGraphContext::setGXforPrint() {
|
||||
GXSetNumChans(1);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
||||
GXSetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_RGBX8, 15);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
field_0x18 = 0;
|
||||
}
|
||||
|
||||
void JAWGraphContext::setGXforDraw() {
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
GXSetNumChans(1);
|
||||
GXSetNumTexGens(0);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, 0, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0);
|
||||
GXSetPointSize(field_0x15, GX_TO_ZERO);
|
||||
GXSetLineWidth(field_0x16, GX_TO_ZERO);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
field_0x18 = 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWSystem.h"
|
||||
|
||||
JAWSystemInterface* JAWSystemInterface::sInstance;
|
||||
|
||||
JAWSystemInterface::JAWSystemInterface() {
|
||||
mHeap = NULL;
|
||||
sInstance = this;
|
||||
}
|
||||
|
||||
JKRHeap* JAWSystemInterface::getCurrentHeap() const {
|
||||
if (mHeap) {
|
||||
return mHeap;
|
||||
}
|
||||
return JKRGetCurrentHeap();
|
||||
}
|
||||
|
|
@ -0,0 +1,213 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "JSystem/JUtility/JUTResFont.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
JAWWindow::JAWWindow(const char* param_1, int param_2, int param_3) :
|
||||
field_0x38('WIN1', JGeometry::TBox2<f32>(0.0f, 0.0f, param_2, param_3), "frame_lu.bti"),
|
||||
field_0x180('TITL', JGeometry::TBox2<f32>(10.0f, 10.0f, 640.0f, 170.0f), (const ResFONT*)JUTResFONT_Ascfont_fix16, param_1, -1, HBIND_LEFT, VBIND_TOP),
|
||||
field_0x2b0(this),
|
||||
field_0x3d8(JUtility::TColor(0, 0, 0, 255)),
|
||||
field_0x3dc(JUtility::TColor(0, 0, 0, 255)),
|
||||
field_0x3e0(JUtility::TColor(0, 0, 0, 255)),
|
||||
field_0x3e4(JUtility::TColor(0, 0, 0, 255)) {
|
||||
field_0x3e8 = 0;
|
||||
field_0x3ec = 0;
|
||||
field_0x38.setContentsColor(field_0x3d8, field_0x3e0, field_0x3dc, field_0x3e4);
|
||||
field_0x180.setCharColor(JUtility::TColor(0, 255, 0, 255));
|
||||
field_0x180.setGradColor(JUtility::TColor(255, 255, 255, 255));
|
||||
field_0x38.appendChild(&field_0x180);
|
||||
field_0x38.appendChild(&field_0x2b0);
|
||||
}
|
||||
|
||||
JAWWindow::TJ2DWindowDraw::TJ2DWindowDraw(u32 param_1, const JGeometry::TBox2<f32>& param_2, const char* param_3) : J2DWindow(param_1, param_2, param_3, TEXTUREBASE_0, NULL) {}
|
||||
|
||||
JAWWindow::~JAWWindow() {}
|
||||
|
||||
BOOL JAWWindow::initIf() {
|
||||
if (field_0x3ec) {
|
||||
return TRUE;
|
||||
} else {
|
||||
field_0x3ec = TRUE;
|
||||
return onInit();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL JAWWindow::onInit() { return TRUE; }
|
||||
|
||||
void JAWWindow::setTitleColor(const JUtility::TColor& param_1, const JUtility::TColor& param_2) {
|
||||
field_0x180.setCharColor(param_1);
|
||||
field_0x180.setGradColor(param_2);
|
||||
}
|
||||
|
||||
void JAWWindow::setWindowColor(const JUtility::TColor& param_1, const JUtility::TColor& param_2, const JUtility::TColor& param_3, const JUtility::TColor& param_4) {
|
||||
field_0x3d8 = param_1;
|
||||
field_0x3dc = param_2;
|
||||
field_0x3e0 = param_3;
|
||||
field_0x3e4 = param_4;
|
||||
field_0x38.setContentsColor(field_0x3d8, field_0x3e0, field_0x3dc, field_0x3e4);
|
||||
}
|
||||
|
||||
void JAWWindow::onDraw(JAWGraphContext*) {}
|
||||
|
||||
void JAWWindow::move(f32 param_1, f32 param_2) {
|
||||
field_0x38.move(param_1, param_2);
|
||||
}
|
||||
|
||||
void JAWWindow::addPosition(f32 param_1, f32 param_2) {
|
||||
field_0x38.add(param_1, param_2);
|
||||
}
|
||||
|
||||
void JAWWindow::addSize(f32 width, f32 height) {
|
||||
JGeometry::TBox2<f32> bounds = field_0x38.getBounds();
|
||||
f32 newWidth = width + bounds.getWidth();
|
||||
f32 newHeight = height + bounds.getHeight();
|
||||
if (newWidth < 36.0f) {
|
||||
newWidth = 36.0f;
|
||||
} else if (newWidth > 640.0f) {
|
||||
newWidth = 640.0f;
|
||||
}
|
||||
if (newHeight < 36.0f) {
|
||||
newHeight = 36.0f;
|
||||
} else if (newHeight > 480.0f) {
|
||||
newHeight = 480.0f;
|
||||
}
|
||||
field_0x38.resize(newWidth, newHeight);
|
||||
}
|
||||
|
||||
JUtility::TColor JAWWindow::convJudaColor(u16 param_1) {
|
||||
return JUtility::TColor((param_1 & 0xf800) >> 8, (param_1 & 0x7c0) >> 3, (param_1 & 0x3e) << 2, 255);
|
||||
}
|
||||
|
||||
void JAWWindow::padProc(const JUTGamePad& pad) {
|
||||
u32 trigger = pad.getTrigger();
|
||||
u32 release = pad.getRelease();
|
||||
u32 button = pad.getButton();
|
||||
u32 repeat = pad.getRepeat();
|
||||
onPadProc(pad);
|
||||
if (trigger & PAD_BUTTON_A) {
|
||||
onTrigA(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_B) {
|
||||
onTrigB(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_X) {
|
||||
onTrigX(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_Y) {
|
||||
onTrigY(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_MENU) {
|
||||
onTrigMenu(pad);
|
||||
}
|
||||
if (trigger & PAD_TRIGGER_L) {
|
||||
onTrigL(pad);
|
||||
}
|
||||
if (trigger & PAD_TRIGGER_Z) {
|
||||
onTrigZ(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_UP) {
|
||||
onTrigUp(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_DOWN) {
|
||||
onTrigDown(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_LEFT) {
|
||||
onTrigLeft(pad);
|
||||
}
|
||||
if (trigger & PAD_BUTTON_RIGHT) {
|
||||
onTrigRight(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_A) {
|
||||
onReleaseA(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_B) {
|
||||
onReleaseB(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_X) {
|
||||
onReleaseX(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_Y) {
|
||||
onReleaseY(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_MENU) {
|
||||
onReleaseMenu(pad);
|
||||
}
|
||||
if (release & PAD_TRIGGER_L) {
|
||||
onReleaseL(pad);
|
||||
}
|
||||
if (release & PAD_TRIGGER_Z) {
|
||||
onReleaseZ(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_UP) {
|
||||
onReleaseUp(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_DOWN) {
|
||||
onReleaseDown(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_LEFT) {
|
||||
onReleaseLeft(pad);
|
||||
}
|
||||
if (release & PAD_BUTTON_RIGHT) {
|
||||
onReleaseRight(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_A) {
|
||||
onKeyA(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_B) {
|
||||
onKeyB(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_X) {
|
||||
onKeyX(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_Y) {
|
||||
onKeyY(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_MENU) {
|
||||
onKeyMenu(pad);
|
||||
}
|
||||
if (repeat & PAD_TRIGGER_L) {
|
||||
onKeyL(pad);
|
||||
}
|
||||
if (repeat & PAD_TRIGGER_Z) {
|
||||
onKeyZ(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_UP) {
|
||||
onKeyUp(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_DOWN) {
|
||||
onKeyDown(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_LEFT) {
|
||||
onKeyLeft(pad);
|
||||
}
|
||||
if (repeat & PAD_BUTTON_RIGHT) {
|
||||
onKeyRight(pad);
|
||||
}
|
||||
}
|
||||
|
||||
JAWWindow::TWindowText::TWindowText(JAWWindow* window) :
|
||||
J2DPane('TEXT', JGeometry::TBox2<f32>(10.0f, 30.0f, 650.0f, 510.0f)),
|
||||
m_pParent(window),
|
||||
field_0x11c(0, 0) {
|
||||
}
|
||||
|
||||
void JAWWindow::TWindowText::drawSelf(f32 param_1, f32 param_2) {
|
||||
Mtx mtx;
|
||||
MTXIdentity(mtx);
|
||||
drawSelf(param_1, param_2, &mtx);
|
||||
}
|
||||
|
||||
void JAWWindow::TWindowText::drawSelf(f32, f32, Mtx* param_3) {
|
||||
field_0xfc.reset();
|
||||
MTXTrans(*param_3, -field_0x11c.x, -field_0x11c.y, 0.0f);
|
||||
Mtx stack_48;
|
||||
MTXConcat(*param_3, mGlobalMtx, stack_48);
|
||||
GXLoadPosMtxImm(stack_48, 0);
|
||||
field_0xfc.setParentAlpha(mColorAlpha);
|
||||
JUT_ASSERT(209, m_pParent != 0);
|
||||
m_pParent->setMatrix(stack_48);
|
||||
m_pParent->onDraw(&field_0xfc);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAWExtSystem/JAWWindow3D.h"
|
||||
|
||||
JGeometry::TVec2<f32> JAWWindow3D::sPtOrigin(0, 0);
|
||||
|
|
@ -5,7 +5,9 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAudio2/JASReport.h"
|
||||
#include "JSystem/JAudio2/JASCalc.h"
|
||||
#include "JSystem/JAudio2/JASMutex.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "stdio.h"
|
||||
|
||||
static OSMutex sMutex;
|
||||
|
|
@ -18,19 +20,58 @@ static int sLineCount;
|
|||
|
||||
static int sTop;
|
||||
|
||||
void JASReport(const char * str, ...) {
|
||||
if(sBuffer) {
|
||||
va_list vl;
|
||||
va_start(vl, str);
|
||||
JASMutexLock mutexLock(&sMutex);
|
||||
vsnprintf(sBuffer + (sTop * 64), 64, str, vl);
|
||||
va_end(vl);
|
||||
|
||||
sTop++;
|
||||
if (sTop >= sLineMax)
|
||||
sTop = 0;
|
||||
|
||||
if (sLineCount < sLineMax)
|
||||
sLineCount++;
|
||||
}
|
||||
void JASReportInit(JKRHeap* heap, int lineMax) {
|
||||
JUT_ASSERT(33, sBuffer == NULL);
|
||||
JUT_ASSERT(35, heap != NULL);
|
||||
OSInitMutex(&sMutex);
|
||||
sLineMax = lineMax;
|
||||
sBuffer = new (heap, 0) char[sLineMax * 64];
|
||||
JUT_ASSERT(41, sBuffer);
|
||||
}
|
||||
|
||||
int JASReportGetLineMax() {
|
||||
return sLineMax;
|
||||
}
|
||||
|
||||
int JASReportCopyBuffer(char *param_1,int lines) {
|
||||
if (!sBuffer) {
|
||||
return 0;
|
||||
}
|
||||
if (lines < 0) {
|
||||
lines = sLineMax;
|
||||
}
|
||||
char* dest = param_1;
|
||||
JASMutexLock lock(&sMutex);
|
||||
int i;
|
||||
int r30 = sTop - 1;
|
||||
char* src;
|
||||
for (i = 0; i < sLineCount && i < lines; i++) {
|
||||
if (r30 < 0) {
|
||||
r30 = sLineMax - 1;
|
||||
}
|
||||
src = &sBuffer[r30 * 64];
|
||||
JASCalc::bcopy(src, dest, 64);
|
||||
r30--;
|
||||
dest += 64;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
void JASReport(const char * str, ...) {
|
||||
va_list vl;
|
||||
if(!sBuffer) {
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(vl, str);
|
||||
JASMutexLock mutexLock(&sMutex);
|
||||
vsnprintf(sBuffer + (sTop * 64), 64, str, vl);
|
||||
va_end(vl);
|
||||
|
||||
sTop++;
|
||||
if (sTop >= sLineMax)
|
||||
sTop = 0;
|
||||
|
||||
if (sLineCount < sLineMax)
|
||||
sLineCount++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,37 @@ template<
|
|||
typedef Category iterator_category;
|
||||
};
|
||||
|
||||
template <class Iterator>
|
||||
struct reverse_iterator : public iterator<typename iterator_traits<Iterator>::iterator_category,
|
||||
typename iterator_traits<Iterator>::value_type,
|
||||
typename iterator_traits<Iterator>::difference_type,
|
||||
typename iterator_traits<Iterator>::pointer,
|
||||
typename iterator_traits<Iterator>::reference> {
|
||||
typedef typename iterator_traits<Iterator>::difference_type difference_type;
|
||||
typedef typename iterator_traits<Iterator>::value_type value_type;
|
||||
typedef typename iterator_traits<Iterator>::pointer pointer;
|
||||
typedef typename iterator_traits<Iterator>::reference reference;
|
||||
typedef typename iterator_traits<Iterator>::iterator_category iterator_category;
|
||||
|
||||
reverse_iterator() {}
|
||||
reverse_iterator(Iterator it) : current(it) {}
|
||||
reverse_iterator operator++(int) { const reverse_iterator old(*this); --current; return old; }
|
||||
reference operator*() {
|
||||
tmp = current;
|
||||
return *--tmp;
|
||||
}
|
||||
|
||||
Iterator base() const { return current; }
|
||||
|
||||
Iterator tmp;
|
||||
Iterator current;
|
||||
};
|
||||
|
||||
template <class Iterator1, class Iterator2>
|
||||
bool operator!= (const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs) {
|
||||
return (lhs.base() != rhs.base()) != false;
|
||||
}
|
||||
|
||||
template <class InputIterator, class Distance>
|
||||
inline void __advance(InputIterator& i, Distance n, input_iterator_tag) {
|
||||
for (; n > 0; --n)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ int printf(const char* format, ...);
|
|||
int sprintf(char* s, const char* format, ...);
|
||||
int snprintf(char* s, size_t n, const char* format, ...);
|
||||
int vsnprintf(char* s, size_t n, const char* format, va_list arg);
|
||||
int vsprintf(char* s, const char* format, va_list arg);
|
||||
int vprintf(const char* format, va_list arg);
|
||||
|
||||
int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
#include "Z2AudioLib/Z2DebugSys.h"
|
||||
#include "JSystem/JAHNodeLib/JAHSoundPlayerNode.h"
|
||||
#include "JSystem/JAHostIO/JAHioMgr.h"
|
||||
#include "JSystem/JAWExtSystem/JAWExtSystem.h"
|
||||
#include "JSystem/JAWWinLib/JAWBankView.h"
|
||||
#include "JSystem/JAWWinLib/JAWChView.h"
|
||||
#include "JSystem/JAWWinLib/JAWHioBankEdit.h"
|
||||
#include "JSystem/JAWWinLib/JAWHioReceiver.h"
|
||||
#include "JSystem/JAWWinLib/JAWPlayerChView.h"
|
||||
#include "JSystem/JAWWinLib/JAWReportView.h"
|
||||
#include "JSystem/JAWWinLib/JAWSysMemView.h"
|
||||
#include "JSystem/JAWWinLib/JAWVolume.h"
|
||||
#include "JSystem/JAudio2/JASReport.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "Z2AudioLib/Z2F1TestWindow.h"
|
||||
#include "Z2AudioLib/Z2FxLineMgr.h"
|
||||
#include "Z2AudioLib/Z2SeView.h"
|
||||
#include "Z2AudioLib/Z2SoundPlayer.h"
|
||||
#include "Z2AudioLib/Z2TrackView.h"
|
||||
#include "Z2AudioLib/Z2WaveArcLoader.h"
|
||||
#include "m_Do/m_Do_hostIO.h"
|
||||
#include "m_Do/m_Do_ext.h"
|
||||
|
||||
Z2DebugSys::Z2DebugSys() : JASGlobalInstance<Z2DebugSys>(true) { }
|
||||
|
||||
void Z2DebugSys::initJAW() {
|
||||
JKRHeap* oldHeap = JKRHeap::getCurrentHeap();
|
||||
JKRExpHeap* heap = mDoExt_getGameHeap();
|
||||
Z2SoundPlayer* soundPlayer;
|
||||
JAWSysMemView* sysMemView;
|
||||
JAWBankView* bankView;
|
||||
JAWChView* chView;
|
||||
Z2TrackView* trackView;
|
||||
JAWReportView* reportView;
|
||||
JAWHioBankEdit* hioBankEdit;
|
||||
Z2WaveArcLoader* waveArcLoader;
|
||||
JAWVolume* volume;
|
||||
Z2PlaySeView* playSeView;
|
||||
Z2AudSettingView* audSettingView;
|
||||
Z2DSPCheck* dspCheck;
|
||||
Z2EntrySeView* entrySeView;
|
||||
JAWPlayerChView* playerChView;
|
||||
JKRSetCurrentHeap(heap);
|
||||
u32 local_50 = heap->getFreeSize();
|
||||
soundPlayer = new (heap, 0) Z2SoundPlayer("GC-Zelda2");
|
||||
sysMemView = new (heap, 0) JAWSysMemView();
|
||||
bankView = new (heap, 0) JAWBankView();
|
||||
chView = new (heap, 0) JAWChView();
|
||||
trackView = new (heap, 0) Z2TrackView(0, Z2TrackView::DISPMODE0);
|
||||
reportView = new (heap, 0) JAWReportView();
|
||||
JASReportInit(heap, 500);
|
||||
hioBankEdit = new (heap, 0) JAWHioBankEdit();
|
||||
waveArcLoader = new (heap, 0) Z2WaveArcLoader();
|
||||
volume = new (heap, 0) JAWVolume(90, 480);
|
||||
playSeView = new (heap, 0) Z2PlaySeView();
|
||||
audSettingView = new (heap, 0) Z2AudSettingView();
|
||||
dspCheck = new (heap, 0) Z2DSPCheck();
|
||||
JAWExtSystem::registWindow(1, soundPlayer, 10, 22);
|
||||
entrySeView = new (heap, 0) Z2EntrySeView();
|
||||
JAWExtSystem::registWindow(2, entrySeView, 10, 22);
|
||||
JAWExtSystem::registWindow(3, playSeView, 10, 22);
|
||||
JAWExtSystem::registWindow(4, sysMemView, 10, 22);
|
||||
JAWExtSystem::registWindow(5, bankView, 10, 22);
|
||||
JAWExtSystem::registWindow(6, chView, 10, 22);
|
||||
JAWExtSystem::registWindow(7, trackView, 10, 22);
|
||||
playerChView = new (heap, 0) JAWPlayerChView();
|
||||
JAWExtSystem::registWindow(8, playerChView, 10, 22);
|
||||
JAWExtSystem::registWindow(11, reportView, 330, 0);
|
||||
JAWExtSystem::registWindow(12, hioBankEdit, 10, 0);
|
||||
JAWExtSystem::registWindow(13, volume, 0, 0);
|
||||
JAWExtSystem::registWindow(15, waveArcLoader, 10, 100);
|
||||
JAWExtSystem::registWindow(16, dspCheck, 10, 100);
|
||||
JAWExtSystem::registWindow(17, audSettingView, 10, 100);
|
||||
JKRSetCurrentHeap(oldHeap);
|
||||
}
|
||||
|
||||
void Z2DebugSys::initSoundHioNode() {
|
||||
JKRHeap* oldHeap = JKRHeap::getCurrentHeap();
|
||||
JKRExpHeap* heap = mDoExt_getGameHeap();
|
||||
JKRSetCurrentHeap(heap);
|
||||
s32 freeSize = heap->getFreeSize();
|
||||
JAHSingletonBase<JAHioMgr>::newInstance();
|
||||
JAHioNode* soundRoot = new (heap, 0) JAHioNode("サウンド");
|
||||
JUT_ASSERT(239, soundRoot);
|
||||
JAHSingletonBase<JAHioMgr>::getIns()->init_OnGame();
|
||||
JAHSingletonBase<JAHioMgr>::getIns()->appendRootNode(&mDoHIO_root, soundRoot);
|
||||
mDoHIO_createChild("サウンド", soundRoot);
|
||||
JAHSoundPlayerNode* soundPlayerNode = new (heap, 0) JAHSoundPlayerNode();
|
||||
JUT_ASSERT(258, soundPlayerNode);
|
||||
soundRoot->appendNode(soundPlayerNode, NULL);
|
||||
Z2ParamNode* paramNode = new (heap, 0) Z2ParamNode();
|
||||
JUT_ASSERT(262, paramNode);
|
||||
soundRoot->appendNode(paramNode, NULL);
|
||||
Z2FxLineEditNode* fxNode = new (heap, 0) Z2FxLineEditNode(heap);
|
||||
JUT_ASSERT(267, fxNode);
|
||||
soundRoot->appendNode(fxNode, NULL);
|
||||
Z2F1SwingTestNode* f1TestWin = new (heap, 0) Z2F1SwingTestNode();
|
||||
JUT_ASSERT(284, f1TestWin);
|
||||
soundRoot->appendNode(f1TestWin, NULL);
|
||||
JAWExtSystem::registWindow(10, f1TestWin, 10, 22);
|
||||
JKRSetCurrentHeap(oldHeap);
|
||||
}
|
||||
|
||||
void Z2DebugSys::debugframework() {
|
||||
JAHSingletonBase<JAHioMgr>::getIns()->framework();
|
||||
}
|
||||
|
||||
JAISeqDataMgr* Z2DebugSys::initSeSeqDataMgr(const void* param_1) {
|
||||
Z2HioSeSeqDataMgr* seqDataMgr = NULL;
|
||||
JKRHeap* oldHeap = JKRHeap::getCurrentHeap();
|
||||
JKRExpHeap* heap = mDoExt_getGameHeap();
|
||||
JKRSetCurrentHeap(heap);
|
||||
s32 freeSize = heap->getFreeSize();
|
||||
JAWHioReceiver* receiver = new (heap, 0) JAWHioReceiver();
|
||||
JAWExtSystem::registWindow(0, receiver, 10, 22);
|
||||
seqDataMgr = new (heap, 0) Z2HioSeSeqDataMgr(param_1, receiver);
|
||||
JKRSetCurrentHeap(oldHeap);
|
||||
return seqDataMgr;
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
#include "Z2AudioLib/Z2SoundPlayer.h"
|
||||
#include "Z2AudioLib/Z2SeqMgr.h"
|
||||
|
||||
Z2SoundPlayer::Z2SoundPlayer(const char* param_1) : JAWWindow("Player for JAudio2", 500, 140), field_0x48c(field_0x46c, 8) {
|
||||
field_0x3ed = 0;
|
||||
field_0x3ee = 0;
|
||||
field_0x3ef = 0;
|
||||
field_0x3f0 = 0;
|
||||
field_0x3f4 = param_1;
|
||||
field_0x3f8 = 0;
|
||||
field_0x3fc = 0;
|
||||
field_0x3fa = 0;
|
||||
field_0x3fe = 0;
|
||||
field_0x400 = 0;
|
||||
field_0x402 = 0;
|
||||
field_0x444 = 0;
|
||||
field_0x446 = 0;
|
||||
field_0x404 = "CMD_PORT";
|
||||
field_0x408 = "END_PORT";
|
||||
field_0x40c = "STA_PORT";
|
||||
field_0x410 = "WAIT_PORT";
|
||||
field_0x414 = "NUM_PORT";
|
||||
field_0x418 = "PORT_5";
|
||||
field_0x41c = "MAP_PORT";
|
||||
field_0x420 = "NOTE_PORT";
|
||||
field_0x424 = "SE_SELECT_PORT";
|
||||
field_0x428 = "BGM_STATUS_PORT";
|
||||
field_0x42c = "BGM_PORT2";
|
||||
field_0x430 = "BGM_PORT3";
|
||||
field_0x434 = "PORT12";
|
||||
field_0x438 = "PORT13";
|
||||
field_0x43c = "FILTER_PORT";
|
||||
field_0x440 = "FX_PORT";
|
||||
u8 r30 = 0;
|
||||
field_0x448[r30++] = &field_0x3f8;
|
||||
field_0x448[r30++] = &field_0x3fa;
|
||||
field_0x448[r30++] = &field_0x3fc;
|
||||
field_0x448[r30++] = &field_0x3fe;
|
||||
field_0x448[r30++] = &field_0x400;
|
||||
field_0x448[r30++] = &field_0x402;
|
||||
field_0x448[r30] = &field_0x444;
|
||||
field_0x464 = 0;
|
||||
field_0x468 = 7;
|
||||
field_0x4a0 = 0;
|
||||
field_0x4a4 = 1.0f;
|
||||
field_0x4a8 = 0.5f;
|
||||
field_0x4ac = 1.0f;
|
||||
field_0x4b0 = 0.0f;
|
||||
field_0x4b4 = 0.0f;
|
||||
field_0x4b8 = 1.0f;
|
||||
field_0x498 = Z2GetSeqMgr()->getSubBgmHandle();
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onDraw(JAWGraphContext*) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onTrigA(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onTrigB(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::frameWork() {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onPadProc(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onTrigX(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onTrigY(const JUTGamePad&) {
|
||||
|
||||
|
||||
}
|
||||
void Z2SoundPlayer::onTrigZ(const JUTGamePad&) {
|
||||
|
||||
|
||||
}
|
||||
void Z2SoundPlayer::onTrigL(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onKeyLeft(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onKeyRight(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onKeyUp(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onKeyDown(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
void Z2SoundPlayer::onKeyMenu(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
||||
u32 Z2SoundPlayer::getCursorMoveMax(const JUTGamePad&) {
|
||||
|
||||
}
|
||||
|
|
@ -4,11 +4,20 @@
|
|||
*/
|
||||
|
||||
#include "m_Do/m_Do_audio.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JKernel/JKRMemArchive.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "Z2AudioLib/Z2AudioCS.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_debug_viewer.h"
|
||||
#include "m_Do/m_Do_Reset.h"
|
||||
#include "m_Do/m_Do_dvd_thread.h"
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
#include <revolution/sc.h>
|
||||
#endif
|
||||
|
||||
/* 80450BB8 0001+00 data_80450BB8 None */
|
||||
/* 80450BB9 0001+00 data_80450BB9 None */
|
||||
/* 80450BBA 0002+00 data_80450BBA None */
|
||||
|
|
@ -30,32 +39,88 @@ static mDoDvdThd_toMainRam_c* l_affCommand;
|
|||
|
||||
static mDoDvdThd_mountXArchive_c* l_arcCommand;
|
||||
|
||||
static mDoDvdThd_mountArchive_c* l_CSarcCommand;
|
||||
|
||||
#if DEBUG
|
||||
static void dummy() {
|
||||
OSReport("mDoAud_Create():Initial of Audio system \n");
|
||||
}
|
||||
#endif
|
||||
|
||||
static void mDoAud_Create() {
|
||||
if (l_affCommand == NULL) {
|
||||
#if DEBUG
|
||||
if (!mDoRst::getLogoScnFlag()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
l_affCommand = mDoDvdThd_toMainRam_c::create("/Audiores/Z2Sound.baa", 2, NULL);
|
||||
|
||||
if (l_affCommand == NULL) {
|
||||
return;
|
||||
}
|
||||
#if DEBUG
|
||||
JUTReportConsole("mDoAud_Create loading Z2Sound.baa \n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (l_arcCommand == NULL) {
|
||||
#if DEBUG
|
||||
if (!mDoRst::getLogoScnFlag()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
l_arcCommand = mDoDvdThd_mountXArchive_c::create("/Audiores/Seqs/Z2SoundSeqs.arc", 0,
|
||||
JKRArchive::MOUNT_DVD, NULL);
|
||||
|
||||
if (l_arcCommand == NULL) {
|
||||
return;
|
||||
}
|
||||
#if DEBUG
|
||||
JUTReportConsole_f("mDoAud_Create loading Z2SoundSeqs.arc\n");
|
||||
#endif
|
||||
}
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
if (l_CSarcCommand == NULL) {
|
||||
#if DEBUG
|
||||
if (!mDoRst::getLogoScnFlag()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (l_affCommand->sync() && l_arcCommand->sync()) {
|
||||
l_CSarcCommand = mDoDvdThd_mountArchive_c::create("/Audiores/Z2CSRes.arc", 0, JKRHeap::getRootHeap2());
|
||||
|
||||
if (l_CSarcCommand == NULL) {
|
||||
return;
|
||||
}
|
||||
#if DEBUG
|
||||
JUTReportConsole_f("mDoAud_Create loading Z2CSRes.arc\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
if (
|
||||
l_affCommand->sync()
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
&& l_CSarcCommand->sync()
|
||||
#endif
|
||||
&& l_arcCommand->sync()
|
||||
) {
|
||||
#if DEBUG
|
||||
JUTReportConsole("mDoAud_Create sync ok.\n");
|
||||
#endif
|
||||
if (g_mDoAud_audioHeap != NULL) {
|
||||
s32 groupID = JKRHeap::sCurrentHeap->changeGroupID(5);
|
||||
g_mDoAud_zelAudio
|
||||
.init(g_mDoAud_audioHeap, 0xA00000, l_affCommand->getMemAddress(),
|
||||
l_arcCommand->getArchive());
|
||||
JKRHeap::sCurrentHeap->changeGroupID(groupID);
|
||||
g_mDoAud_audioHeap->adjustSize();
|
||||
s32 groupID = JKRGetCurrentHeap()->changeGroupID(5);
|
||||
#if PLATFORM_GCN
|
||||
const int audioMemSize = 0xA00000;
|
||||
#else
|
||||
const int audioMemSize = 0xB00000;
|
||||
#endif
|
||||
g_mDoAud_zelAudio.init(g_mDoAud_audioHeap, audioMemSize, l_affCommand->getMemAddress(), l_arcCommand->getArchive());
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
Z2AudioCS::init(mDoExt_getGameHeap(), l_CSarcCommand->getArchive(), 15, 1);
|
||||
#endif
|
||||
JKRGetCurrentHeap()->changeGroupID(groupID);
|
||||
s32 r28 = g_mDoAud_audioHeap->adjustSize();
|
||||
} else {
|
||||
// "Cannot initialize audio due to heap allocation failure\n"
|
||||
OSReport_Error("ヒープ確保失敗につきオーディオ初期化できません\n");
|
||||
|
|
@ -63,16 +128,31 @@ static void mDoAud_Create() {
|
|||
|
||||
(g_mDoAud_zelAudio)
|
||||
.setEventBit(dComIfGs_getPEventBit());
|
||||
#if DEBUG
|
||||
JUTReportConsole("mDoAud_Create g_mDoAud_zelAudio.reset before \n");
|
||||
#endif
|
||||
(g_mDoAud_zelAudio).reset();
|
||||
#if DEBUG
|
||||
JUTReportConsole("mDoAud_Create g_mDoAud_zelAudio.reset after\n");
|
||||
#endif
|
||||
|
||||
u32 soundMode = OSGetSoundMode();
|
||||
Z2AudioMgr::getInterface()->setOutputMode(soundMode);
|
||||
JKRHeap::free(l_affCommand->getMemAddress(), NULL);
|
||||
#if PLATFORM_GCN
|
||||
mDoAud_setOutputMode(OSGetSoundMode());
|
||||
#else
|
||||
mDoAud_setOutputMode(SCGetSoundMode());
|
||||
#endif
|
||||
JKRFree(l_affCommand->getMemAddress());
|
||||
l_affCommand->destroy();
|
||||
l_arcCommand->destroy();
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
l_CSarcCommand->destroy();
|
||||
mDoAud_loadStaticWaves();
|
||||
#endif
|
||||
mDoAud_zelAudio_c::onInitFlag();
|
||||
mDoDvdThd::SyncWidthSound = true;
|
||||
#if DEBUG
|
||||
JUTReportConsole("mDoAud_Create done!\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +162,31 @@ void mDoAud_Execute() {
|
|||
mDoAud_Create();
|
||||
}
|
||||
} else {
|
||||
#if DEBUG
|
||||
static const char* l_outputModeName[3] = {"MONO", "STEREO", "DOLBY"};
|
||||
static const u32 l_outputMode[3] = {0, 1, 2};
|
||||
if (mDoCPd_c::getHoldL(0)) {
|
||||
if (mDoCPd_c::getTrigLeft(0)) {
|
||||
if (g_mDoAud_zelAudio.getMode() == 0) {
|
||||
g_mDoAud_zelAudio.setMode(2);
|
||||
} else {
|
||||
g_mDoAud_zelAudio.setMode(g_mDoAud_zelAudio.getMode() - 1);
|
||||
}
|
||||
} else if (mDoCPd_c::getTrigRight(0)) {
|
||||
if (g_mDoAud_zelAudio.getMode() >= 2) {
|
||||
g_mDoAud_zelAudio.setMode(0);
|
||||
} else {
|
||||
g_mDoAud_zelAudio.setMode(g_mDoAud_zelAudio.getMode() + 1);
|
||||
}
|
||||
}
|
||||
g_mDoAud_zelAudio.setOutputMode(l_outputMode[g_mDoAud_zelAudio.getMode()]);
|
||||
}
|
||||
dDbVw_Report(20, 30, "%s", l_outputModeName[g_mDoAud_zelAudio.getMode()]);
|
||||
#endif
|
||||
g_mDoAud_zelAudio.gframeProcess();
|
||||
#if DEBUG
|
||||
Z2AudioCS::update();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue