mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Various JSystem work (#2383)
* JKernel and JStudio cleanup * JMessage cleanup * JAudio cleanup * JASBNKParser work * functionvalue work * fvb work * J2D and J3D cleanup * steal from tww * J2DPictureEx mostly done * fix build
This commit is contained in:
@@ -1731,7 +1731,7 @@ JSystem/JStudio/JStudio/ctb.cpp:
|
||||
.data start:0x803C4878 end:0x803C48E0
|
||||
|
||||
JSystem/JStudio/JStudio/functionvalue.cpp:
|
||||
.text start:0x80281648 end:0x80283E24
|
||||
.text start:0x80281648 end:0x80283F80
|
||||
.rodata start:0x8039A9F0 end:0x8039AA00
|
||||
.data start:0x803C48E0 end:0x803C49C0
|
||||
.sbss start:0x804511E8 end:0x804511F0
|
||||
@@ -1740,17 +1740,11 @@ JSystem/JStudio/JStudio/functionvalue.cpp:
|
||||
JSystem/JStudio/JStudio/fvb-data.cpp:
|
||||
.sdata2 start:0x80455450 end:0x80455458
|
||||
|
||||
JSystem/JStudio/JStudio/functionvalue-inline.cpp:
|
||||
.text start:0x80283E24 end:0x80283F80
|
||||
|
||||
JSystem/JStudio/JStudio/fvb.cpp:
|
||||
.text start:0x80283F80 end:0x80285018
|
||||
.text start:0x80283F80 end:0x802850AC
|
||||
.rodata start:0x8039AA00 end:0x8039AA40
|
||||
.data start:0x803C49C0 end:0x803C4AC0
|
||||
|
||||
JSystem/JStudio/JStudio/fvb-inline.cpp:
|
||||
.text start:0x80285018 end:0x802850AC
|
||||
|
||||
JSystem/JStudio/JStudio/fvb-data-parse.cpp:
|
||||
.text start:0x802850AC end:0x80285114
|
||||
|
||||
|
||||
@@ -13703,7 +13703,7 @@ JSUConvertOffsetToPtr<11_GXCullMode>__FPCvPCv = .text:0x802F4290; // type:functi
|
||||
JSUConvertOffsetToPtr<14J2DIndInitData>__FPCvPCv = .text:0x802F42A8; // type:function size:0x18 scope:global align:4
|
||||
JSUConvertOffsetToPtr<Us>__FPCvPCv = .text:0x802F42C0; // type:function size:0x18 scope:global align:4
|
||||
JSUConvertOffsetToPtr<19J2DMaterialInitData>__FPCvPCv = .text:0x802F42D8; // type:function size:0x18 scope:global align:4
|
||||
J2DPrint_print_alpha_va = .text:0x802F42F0; // type:function size:0xA4 scope:global align:4
|
||||
J2DPrint_print_alpha_va__FP8J2DPrintUcPCcP16__va_list_struct = .text:0x802F42F0; // type:function size:0xA4 scope:global align:4
|
||||
__ct__8J2DPrintFP7JUTFontffQ28JUtility6TColorQ28JUtility6TColorQ28JUtility6TColorQ28JUtility6TColor = .text:0x802F4394; // type:function size:0x8C scope:global align:4
|
||||
__dt__8J2DPrintFv = .text:0x802F4420; // type:function size:0x48 scope:global align:4
|
||||
private_initiate__8J2DPrintFP7JUTFontffQ28JUtility6TColorQ28JUtility6TColorQ28JUtility6TColorQ28JUtility6TColorb = .text:0x802F4468; // type:function size:0x1F0 scope:global align:4
|
||||
|
||||
+18
-20
@@ -768,20 +768,18 @@ config.libs = [
|
||||
JSystemLib(
|
||||
"JStudio",
|
||||
[
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/ctb.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/ctb.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/ctb-data.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/functionvalue.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/functionvalue-inline.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/fvb.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/fvb-inline.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/fvb-data.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/fvb-data-parse.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/jstudio-control.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/jstudio-data.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/jstudio-math.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/jstudio-math.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/jstudio-object.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/object-id.cpp"),
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio/stb.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/stb.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/stb-data-parse.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio/stb-data.cpp"),
|
||||
],
|
||||
@@ -789,7 +787,7 @@ config.libs = [
|
||||
JSystemLib(
|
||||
"JStudio_JStage",
|
||||
[
|
||||
Object(NonMatching, "JSystem/JStudio/JStudio_JStage/control.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio_JStage/control.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio_JStage/object.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio_JStage/object-actor.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JStudio/JStudio_JStage/object-ambientlight.cpp"),
|
||||
@@ -819,7 +817,7 @@ config.libs = [
|
||||
Object(NonMatching, "JSystem/JAudio2/JASTaskThread.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASDvdThread.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASCallback.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JASHeapCtrl.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio2/JASHeapCtrl.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASResArcLoader.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASProbe.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASReport.cpp"),
|
||||
@@ -888,11 +886,11 @@ config.libs = [
|
||||
JSystemLib(
|
||||
"JMessage",
|
||||
[
|
||||
Object(NonMatching, "JSystem/JMessage/control.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JMessage/control.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JMessage/data.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/processor.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/processor.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(NonMatching, "JSystem/JMessage/resource.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/locale.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JMessage/locale.cpp"),
|
||||
],
|
||||
),
|
||||
{
|
||||
@@ -957,13 +955,13 @@ config.libs = [
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRArchivePub.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRArchivePri.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRMemArchive.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRAramArchive.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRAramArchive.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRDvdArchive.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRCompArchive.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRFile.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRDvdFile.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRDvdRipper.cpp"),
|
||||
Object(NonMatching, "JSystem/JKernel/JKRDvdAramRipper.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRDvdAramRipper.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JKernel/JKRDecomp.cpp"),
|
||||
],
|
||||
),
|
||||
@@ -980,9 +978,9 @@ config.libs = [
|
||||
JSystemLib(
|
||||
"JGadget",
|
||||
[
|
||||
Object(NonMatching, "JSystem/JGadget/binary.cpp"),
|
||||
Object(NonMatching, "JSystem/JGadget/linklist.cpp"),
|
||||
Object(Equivalent, "JSystem/JGadget/std-vector.cpp", extra_cflags=['-pragma "nosyminline off"']), # just weak order
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JGadget/binary.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JGadget/linklist.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/JGadget/std-vector.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
],
|
||||
),
|
||||
JSystemLib(
|
||||
@@ -1016,14 +1014,14 @@ config.libs = [
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DGrafContext.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DOrthoGraph.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DTevs.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DMaterial.cpp"),
|
||||
Object(Equivalent, "JSystem/J2DGraph/J2DMaterial.cpp", extra_cflags=['-pragma "nosyminline off"']), # weak func order
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DMatBlock.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DMaterialFactory.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DPrint.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DPrint.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DPane.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DScreen.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DWindow.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DPicture.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DPicture.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J2DGraph/J2DTextBox.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DWindowEx.cpp"),
|
||||
Object(NonMatching, "JSystem/J2DGraph/J2DPictureEx.cpp"),
|
||||
@@ -1045,7 +1043,7 @@ config.libs = [
|
||||
Object(NonMatching, "JSystem/J3DGraphBase/J3DShapeMtx.cpp"),
|
||||
Object(NonMatching, "JSystem/J3DGraphBase/J3DShapeDraw.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphBase/J3DShape.cpp"),
|
||||
Object(NonMatching, "JSystem/J3DGraphBase/J3DMaterial.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphBase/J3DMaterial.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(NonMatching, "JSystem/J3DGraphBase/J3DMatBlock.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphBase/J3DTevs.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphBase/J3DDrawBuffer.cpp"),
|
||||
@@ -1075,7 +1073,7 @@ config.libs = [
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DMaterialFactory_v21.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DClusterLoader.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DModelLoader.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
Object(NonMatching, "JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DJointFactory.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DShapeFactory.cpp"),
|
||||
Object(MatchingFor("GZ2E01"), "JSystem/J3DGraphLoader/J3DAnmLoader.cpp", extra_cflags=['-pragma "nosyminline off"']),
|
||||
|
||||
@@ -774,48 +774,12 @@ public:
|
||||
void setTexGenNum(u32 num) { mTexGenNum = num; }
|
||||
void setTexCoord(u32 i, J2DTexCoord coord) { mTexGenCoord[i] = coord; }
|
||||
void setTexMtx(u32 i, J2DTexMtx* mtx) { mTexMtx[i] = mtx; }
|
||||
J2DTexMtx& getTexMtx(u32 i) { return *mTexMtx[i]; }
|
||||
J2DTexCoord& getTexCoord(u32 i) { return mTexGenCoord[i]; }
|
||||
|
||||
/* 802EB620 */ virtual ~J2DTexGenBlock();
|
||||
}; // Size: 0x48
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
*
|
||||
*/
|
||||
struct J2DColorChanInfo {
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
/* 0x0 */ u8 field_0x1;
|
||||
/* 0x0 */ u8 field_0x2;
|
||||
/* 0x0 */ u8 field_0x3;
|
||||
};
|
||||
|
||||
inline u8 J2DCalcColorChanID(const J2DColorChanInfo& info) { return info.field_0x1; }
|
||||
extern const J2DColorChanInfo j2dDefaultColorChanInfo;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
*
|
||||
*/
|
||||
class J2DColorChan {
|
||||
public:
|
||||
/* 802EB280 */ J2DColorChan() {
|
||||
setColorChanInfo(j2dDefaultColorChanInfo);
|
||||
}
|
||||
J2DColorChan(const J2DColorChanInfo& info) {
|
||||
mColorChan = J2DCalcColorChanID(info);
|
||||
}
|
||||
|
||||
void setColorChanInfo(const J2DColorChanInfo& info) {
|
||||
mColorChan = J2DCalcColorChanID(info);
|
||||
}
|
||||
|
||||
u16 getMatSrc() const { return mColorChan & 1; }
|
||||
|
||||
private:
|
||||
/* 0x0 */ u16 mColorChan;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
*
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#define J2DPICTURE_H
|
||||
|
||||
#include "JSystem/J2DGraph/J2DPane.h"
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
|
||||
class J2DMaterial;
|
||||
class JUTPalette;
|
||||
class JUTTexture;
|
||||
struct ResTIMG;
|
||||
struct ResTLUT;
|
||||
|
||||
@@ -55,28 +55,42 @@ struct J2DScrnBlockPictureParameter {
|
||||
class J2DPicture : public J2DPane {
|
||||
public:
|
||||
/* 802FCFF0 */ virtual ~J2DPicture();
|
||||
/* 802FF2E8 */ virtual u16 getTypeID() const;
|
||||
/* 802FF2E8 */ virtual u16 getTypeID() const { return 18; }
|
||||
/* 802FDB28 */ virtual void drawSelf(f32, f32);
|
||||
/* 802FDB90 */ virtual void drawSelf(f32, f32, Mtx*);
|
||||
/* 802FF09C */ virtual bool isUsed(ResTIMG const*);
|
||||
/* 802FF63C */ virtual bool isUsed(ResFONT const*);
|
||||
/* 802FF65C */ virtual void rewriteAlpha();
|
||||
/* 802FCCDC */ virtual void initiate(ResTIMG const*, ResTLUT const*);
|
||||
/* 802FD098 */ virtual bool prepareTexture(u8);
|
||||
/* 801BDD40 */ virtual bool append(ResTIMG const*, f32);
|
||||
/* 802FF238 */ virtual bool append(ResTIMG const*, JUTPalette*, f32);
|
||||
/* 801BDD40 */ virtual bool append(ResTIMG const* param_0, f32 param_1) {
|
||||
return insert(param_0, mTextureNum, param_1);
|
||||
}
|
||||
/* 802FF238 */ virtual bool append(ResTIMG const* param_0, JUTPalette* param_1, f32 param_2) {
|
||||
return insert(param_0, param_1, mTextureNum, param_2);
|
||||
}
|
||||
/* 80020338 */ virtual bool append(char const* param_0, f32 param_1) {
|
||||
return insert(param_0, mTextureNum, param_1);
|
||||
}
|
||||
|
||||
/* 802FF2F0 */ virtual bool append(char const*, JUTPalette*, f32);
|
||||
/* 802FF208 */ virtual bool append(JUTTexture*, f32);
|
||||
/* 802FF3E0 */ virtual void prepend(ResTIMG const*, f32);
|
||||
/* 802FF3B0 */ virtual void prepend(ResTIMG const*, JUTPalette*, f32);
|
||||
/* 802FF380 */ virtual void prepend(char const*, f32);
|
||||
/* 802FF350 */ virtual void prepend(char const*, JUTPalette*, f32);
|
||||
/* 802FF320 */ virtual void prepend(JUTTexture*, f32);
|
||||
/* 801BDD70 */ virtual void insert(ResTIMG const*, u8, f32);
|
||||
/* 802FF2F0 */ virtual bool append(char const* param_0, JUTPalette* param_1, f32 param_2) {
|
||||
return insert(param_0, param_1, mTextureNum, param_2);
|
||||
}
|
||||
/* 802FF208 */ virtual bool append(JUTTexture* param_0, f32 param_1) {
|
||||
return insert(param_0, mTextureNum, param_1);
|
||||
}
|
||||
/* 802FF3E0 */ virtual void prepend(ResTIMG const* param_0, f32 param_1) {
|
||||
insert(param_0, 0, param_1);
|
||||
}
|
||||
/* 802FF3B0 */ virtual void prepend(ResTIMG const* param_0, JUTPalette* param_1, f32 param_2) {
|
||||
insert(param_0, param_1, 0, param_2);
|
||||
}
|
||||
/* 802FF380 */ virtual void prepend(char const* param_0, f32 param_1) {
|
||||
insert(param_0, 0, param_1);
|
||||
}
|
||||
/* 802FF350 */ virtual void prepend(char const* param_0, JUTPalette* param_1, f32 param_2) {
|
||||
insert(param_0, param_1, 0, param_2);
|
||||
}
|
||||
/* 802FF320 */ virtual void prepend(JUTTexture* param_0, f32 param_1) {
|
||||
insert(param_0, 0, param_1);
|
||||
}
|
||||
/* 801BDD70 */ virtual bool insert(ResTIMG const*, u8, f32);
|
||||
/* 802FD168 */ virtual bool insert(ResTIMG const*, JUTPalette*, u8, f32);
|
||||
/* 80020368 */ virtual bool insert(char const* param_0, u8 param_1, f32 param_2) {
|
||||
return insert(param_0, NULL, param_1, param_2);
|
||||
@@ -84,16 +98,40 @@ public:
|
||||
/* 802FD4B4 */ virtual bool insert(char const*, JUTPalette*, u8, f32);
|
||||
/* 802FD524 */ virtual bool insert(JUTTexture*, u8, f32);
|
||||
/* 802FD6F4 */ virtual bool remove(u8);
|
||||
/* 802FF410 */ virtual bool remove();
|
||||
/* 802FF410 */ virtual bool remove() { return remove(mTextureNum - 1); }
|
||||
/* 802FD814 */ virtual bool remove(JUTTexture*);
|
||||
/* 802FF4E0 */ virtual void draw(f32, f32, bool, bool, bool);
|
||||
/* 802FF448 */ virtual void draw(f32, f32, u8, bool, bool, bool);
|
||||
/* 802FF4E0 */ virtual void draw(f32 param_0, f32 param_1, bool param_2, bool param_3,
|
||||
bool param_4) {
|
||||
draw(param_0, param_1, 0, param_2, param_3, param_4);
|
||||
}
|
||||
/* 802FF448 */ virtual void draw(f32 param_0, f32 param_1, u8 param_2, bool param_3,
|
||||
bool param_4, bool param_5) {
|
||||
if (param_2 < mTextureNum && mTexture[param_2] != NULL) {
|
||||
draw(param_0, param_1, mTexture[param_2]->getWidth(), mTexture[param_2]->getHeight(),
|
||||
param_3, param_4, param_5);
|
||||
}
|
||||
}
|
||||
/* 802FDC70 */ virtual void draw(f32, f32, f32, f32, bool, bool, bool);
|
||||
/* 802FF588 */ virtual void drawOut(f32, f32, f32, f32, f32, f32);
|
||||
/* 802FF524 */ virtual void drawOut(f32, f32, f32, f32, f32, f32, f32, f32);
|
||||
/* 802FF588 */ virtual void drawOut(f32 param_0, f32 param_1, f32 param_2, f32 param_3,
|
||||
f32 param_4, f32 param_5) {
|
||||
if (mTexture[0] != NULL) {
|
||||
drawOut(JGeometry::TBox2<f32>(param_0, param_1, param_0 + param_2, param_1 + param_3),
|
||||
JGeometry::TBox2<f32>(param_4, param_5, param_4 + mTexture[0]->getWidth(),
|
||||
param_5 + mTexture[0]->getHeight()));
|
||||
}
|
||||
}
|
||||
/* 802FF524 */ virtual void drawOut(f32 param_0, f32 param_1, f32 param_2, f32 param_3,
|
||||
f32 param_4, f32 param_5, f32 param_6, f32 param_7) {
|
||||
drawOut(JGeometry::TBox2<f32>(param_0, param_1, param_0 + param_2, param_1 + param_3),
|
||||
JGeometry::TBox2<f32>(param_4, param_5, param_4 + param_6, param_5 + param_7));
|
||||
}
|
||||
/* 802FDF88 */ virtual void drawOut(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
|
||||
/* 802FF29C */ virtual void load(_GXTexMapID, u8);
|
||||
/* 802FF268 */ virtual void load(u8);
|
||||
/* 802FF29C */ virtual void load(_GXTexMapID param_0, u8 param_1) {
|
||||
if (param_1 < mTextureNum && param_1 < 2 && mTexture[param_1] != NULL) {
|
||||
mTexture[param_1]->load(param_0);
|
||||
}
|
||||
}
|
||||
/* 802FF268 */ virtual void load(u8 param_0) { load((_GXTexMapID)param_0, param_0); }
|
||||
/* 800202CC */ virtual void setBlendRatio(f32 param_0, f32 param_1) {
|
||||
setBlendColorRatio(param_0, param_1);
|
||||
setBlendAlphaRatio(param_0, param_1);
|
||||
@@ -105,7 +143,7 @@ public:
|
||||
/* 802FD9BC */ virtual const ResTIMG* changeTexture(ResTIMG const*, u8, JUTPalette*);
|
||||
/* 802FDAC8 */ virtual const ResTIMG* changeTexture(char const*, u8, JUTPalette*);
|
||||
/* 800539DC */ virtual JUTTexture* getTexture(u8) const;
|
||||
/* 802FF634 */ virtual u8 getTextureCount() const;
|
||||
/* 802FF634 */ virtual u8 getTextureCount() const { return mTextureNum; }
|
||||
/* 80053C6C */ virtual bool setBlack(JUtility::TColor i_black) {
|
||||
mBlack = i_black;
|
||||
return true;
|
||||
@@ -130,6 +168,9 @@ public:
|
||||
/* 802FE380 */ virtual void drawTexCoord(f32, f32, f32, f32, s16, s16, s16, s16, s16, s16, s16,
|
||||
s16, Mtx*);
|
||||
/* 802FF100 */ virtual u8 getUsableTlut(u8);
|
||||
/* 802FF09C */ virtual bool isUsed(ResTIMG const*);
|
||||
/* 802FF63C */ virtual bool isUsed(ResFONT const* param_0) { return J2DPane::isUsed(param_0); }
|
||||
/* 802FF65C */ virtual void rewriteAlpha() {}
|
||||
|
||||
/* 802FC800 */ J2DPicture(u64, JGeometry::TBox2<f32> const&, ResTIMG const*, ResTLUT const*);
|
||||
/* 802FC708 */ J2DPicture(ResTIMG const*);
|
||||
|
||||
@@ -12,7 +12,16 @@ class J2DMaterial;
|
||||
*/
|
||||
class J2DPictureEx : public J2DPicture {
|
||||
public:
|
||||
enum stage_enum {};
|
||||
enum stage_enum {
|
||||
STAGE_0,
|
||||
STAGE_1,
|
||||
STAGE_2,
|
||||
STAGE_3,
|
||||
STAGE_4,
|
||||
STAGE_5,
|
||||
STAGE_6,
|
||||
STAGE_7,
|
||||
};
|
||||
|
||||
/* 803036EC */ J2DPictureEx(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*);
|
||||
/* 803040E4 */ void insertCommon(u8, f32);
|
||||
@@ -57,7 +66,7 @@ public:
|
||||
/* 80306F94 */ virtual void prepend(char const*, f32);
|
||||
/* 80306F64 */ virtual void prepend(char const*, JUTPalette*, f32);
|
||||
/* 80306F34 */ virtual void prepend(JUTTexture*, f32);
|
||||
/* 80307058 */ virtual void insert(ResTIMG const*, u8, f32);
|
||||
/* 80307058 */ virtual bool insert(ResTIMG const*, u8, f32);
|
||||
/* 80303F34 */ virtual bool insert(ResTIMG const*, JUTPalette*, u8, f32);
|
||||
/* 80307024 */ virtual bool insert(char const*, u8, f32);
|
||||
/* 80303FD8 */ virtual bool insert(char const*, JUTPalette*, u8, f32);
|
||||
@@ -100,8 +109,9 @@ private:
|
||||
/* 0x160 */ f32 field_0x160[6]; // related to blend color ratio
|
||||
/* 0x178 */ f32 field_0x178[6]; // related to blend alpha ratio
|
||||
/* 0x190 */ u8 field_0x190;
|
||||
/* 0x194 */ int field_0x194;
|
||||
/* 0x198 */ int field_0x198;
|
||||
/* 0x194 */ J2DAnmVisibilityFull* field_0x194;
|
||||
/* 0x198 */ J2DAnmVtxColor* field_0x198;
|
||||
/* 0x19C */ u8 field_0x19c;
|
||||
};
|
||||
|
||||
#endif /* J2DPICTUREEX_H */
|
||||
|
||||
@@ -279,11 +279,11 @@ extern J2DTexCoordInfo const j2dDefaultTexCoordInfo[8];
|
||||
class J2DTexCoord {
|
||||
public:
|
||||
/* 802EB260 */ inline J2DTexCoord() {
|
||||
*(J2DTexCoordInfo*)this = j2dDefaultTexCoordInfo[0];
|
||||
mTexCoordInfo = j2dDefaultTexCoordInfo[0];
|
||||
}
|
||||
|
||||
J2DTexCoord(const J2DTexCoordInfo& info) {
|
||||
*(J2DTexCoordInfo*)this = info;
|
||||
mTexCoordInfo = info;
|
||||
}
|
||||
void setTexCoordInfo(const J2DTexCoordInfo& info) { mTexCoordInfo = info; }
|
||||
void setTexGenMtx(u8 texGenMtx) { mTexCoordInfo.mTexGenMtx = texGenMtx; }
|
||||
@@ -553,6 +553,43 @@ private:
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
*
|
||||
*/
|
||||
struct J2DColorChanInfo {
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
/* 0x0 */ u8 field_0x1;
|
||||
/* 0x0 */ u8 field_0x2;
|
||||
/* 0x0 */ u8 field_0x3;
|
||||
};
|
||||
|
||||
inline u8 J2DCalcColorChanID(const J2DColorChanInfo& info) { return info.field_0x1; }
|
||||
extern const J2DColorChanInfo j2dDefaultColorChanInfo;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
*
|
||||
*/
|
||||
class J2DColorChan {
|
||||
public:
|
||||
/* 802EB280 */ J2DColorChan() {
|
||||
setColorChanInfo(j2dDefaultColorChanInfo);
|
||||
}
|
||||
J2DColorChan(const J2DColorChanInfo& info) {
|
||||
mColorChan = J2DCalcColorChanID(info);
|
||||
}
|
||||
|
||||
void setColorChanInfo(const J2DColorChanInfo& info) {
|
||||
mColorChan = J2DCalcColorChanID(info);
|
||||
}
|
||||
|
||||
u16 getMatSrc() const { return mColorChan & 1; }
|
||||
|
||||
private:
|
||||
/* 0x0 */ u16 mColorChan;
|
||||
};
|
||||
|
||||
extern const GXColor j2dDefaultColInfo;
|
||||
extern const GXColorS10 j2dDefaultTevColor;
|
||||
extern const GXColor j2dDefaultTevKColor;
|
||||
|
||||
@@ -31,7 +31,8 @@ struct J3DGXColor : public GXColor {
|
||||
/* 8000E538 */ J3DGXColor() {}
|
||||
J3DGXColor(J3DGXColor const& other) { __memcpy(this, &other, sizeof(J3DGXColor)); }
|
||||
J3DGXColor(GXColor const& color) : GXColor(color) {}
|
||||
J3DGXColor& operator=(const GXColor& color) {
|
||||
// making color a reference breaks J3DColorBlockLightOff::initialize et al
|
||||
J3DGXColor& operator=(GXColor color) {
|
||||
*(GXColor*)this = color;
|
||||
return *this;
|
||||
}
|
||||
@@ -1054,8 +1055,8 @@ public:
|
||||
/* 80317414 */ virtual void setIndTexMtx(u32, J3DIndTexMtx const*) {}
|
||||
/* 8000E060 */ virtual void setIndTexMtx(u32, J3DIndTexMtx) {}
|
||||
/* 8000DF6C */ virtual J3DIndTexMtx* getIndTexMtx(u32) { return NULL; }
|
||||
/* 8000E020 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale) {}
|
||||
/* 80317418 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale const*) {}
|
||||
/* 8000E020 */ virtual void setIndTexCoordScale(u32, J3DIndTexCoordScale) {}
|
||||
/* 8000DF64 */ virtual J3DIndTexCoordScale* getIndTexCoordScale(u32) { return NULL; }
|
||||
/* 8031726C */ virtual ~J3DIndBlock() {}
|
||||
};
|
||||
@@ -1066,9 +1067,9 @@ public:
|
||||
*/
|
||||
class J3DIndBlockNull : public J3DIndBlock {
|
||||
public:
|
||||
/* 803173A0 */ virtual void reset(J3DIndBlock*) {}
|
||||
/* 80317398 */ virtual void diff(u32) {}
|
||||
/* 8031739C */ virtual void load() {}
|
||||
/* 803173A0 */ virtual void reset(J3DIndBlock*) {}
|
||||
/* 803173A4 */ virtual u32 getType() { return 'IBLN'; }
|
||||
/* 803173B0 */ virtual ~J3DIndBlockNull() {}
|
||||
};
|
||||
|
||||
@@ -94,7 +94,7 @@ struct J3DTexCoord : public J3DTexCoordInfo {
|
||||
u8 getTexGenType() const { return mTexGenType; }
|
||||
u8 getTexGenSrc() const { return mTexGenSrc; }
|
||||
u8 getTexGenMtx() const { return mTexGenMtx; }
|
||||
u16 getTexMtxReg() const { return mTexMtxReg & 0xff; }
|
||||
u32 getTexMtxReg() const { return mTexMtxReg & 0xff; }
|
||||
void setTexGenMtx(u8 param_1) { mTexGenMtx = param_1; }
|
||||
void setTexMtxReg(u16 reg) { mTexMtxReg = reg; }
|
||||
J3DTexCoord& operator=(const J3DTexCoord& other) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define JASBNKPARSER_H
|
||||
|
||||
#include "JSystem/JAudio2/JASOscillator.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
|
||||
class JASBank;
|
||||
class JASBasicBank;
|
||||
@@ -53,24 +54,85 @@ namespace JASBNKParser {
|
||||
/* 0xC */ u32 mOffsets[0];
|
||||
};
|
||||
|
||||
/* 80299600 */ static TChunk* findChunk(void const*, u32);
|
||||
/* 8029963C */ static JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299600 */ TChunk* findChunk(void const*, u32);
|
||||
/* 8029963C */ JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
};
|
||||
|
||||
namespace Ver0 {
|
||||
struct THeader {};
|
||||
template<typename T>
|
||||
struct TOffset {
|
||||
/* 0x0 */ u32 offset;
|
||||
T* ptr(void const* stream) const { return JSUConvertOffsetToPtr<T>(stream, offset); }
|
||||
};
|
||||
|
||||
struct TOsc {};
|
||||
struct TOsc {
|
||||
/* 0x00 */ u8 mTarget;
|
||||
/* 0x04 */ f32 field_0x4;
|
||||
/* 0x08 */ TOffset<JASOscillator::Point> mPointOffset;
|
||||
/* 0x0C */ TOffset<JASOscillator::Point> field_0xc;
|
||||
/* 0x10 */ f32 mScale;
|
||||
/* 0x14 */ f32 field_0x14;
|
||||
};
|
||||
|
||||
/* 80299A3C */ static JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299E68 */ static void findOscPtr(JASBasicBank*, THeader const*, TOsc const*);
|
||||
/* 80299F8C */ static void getOscTableEndPtr(JASOscillator::Point const*);
|
||||
struct TVmap {
|
||||
/* 0x00 */ u8 field_0x0[4];
|
||||
/* 0x04 */ u32 field_0x4;
|
||||
/* 0x08 */ f32 field_0x8;
|
||||
/* 0x0C */ f32 field_0xc;
|
||||
};
|
||||
|
||||
struct TKeymap {
|
||||
/* 0x00 */ u8 mHighKey;
|
||||
/* 0x01 */ u8 field_0x1[7];
|
||||
/* 0x08 */ TOffset<TVmap> mVmapOffset;
|
||||
};
|
||||
|
||||
struct TInst {
|
||||
/* 0x00 */ u8 field_0x0[8];
|
||||
/* 0x08 */ f32 mVolume;
|
||||
/* 0x0C */ f32 mPitch;
|
||||
/* 0x10 */ TOffset<TOsc> mOscOffset[2];
|
||||
/* 0x18 */ u8 field_0x18[0x10];
|
||||
/* 0x28 */ u32 mKeyRegionCount;
|
||||
/* 0x2C */ TOffset<TKeymap> mKeymapOffset[0];
|
||||
};
|
||||
|
||||
struct TPmap {
|
||||
/* 0x00 */ f32 mVolume;
|
||||
/* 0x04 */ f32 mPitch;
|
||||
/* 0x08 */ u8 field_0x8[0xc];
|
||||
/* 0x14 */ TOffset<TVmap> mVmapOffset;
|
||||
};
|
||||
|
||||
struct TPerc {
|
||||
/* 0x000 */ u32 mMagic;
|
||||
/* 0x000 */ u8 field_0x0[0x84];
|
||||
/* 0x088 */ TOffset<TPmap> mPmapOffset[0x80];
|
||||
/* 0x288 */ s8 mPan[0x80];
|
||||
/* 0x308 */ u16 mRelease[0x80];
|
||||
};
|
||||
|
||||
struct TOffsetData {
|
||||
/* 0x000 */ u8 field_0x20[4];
|
||||
/* 0x004 */ TOffset<TInst> mInstOffset[0x80];
|
||||
/* 0x204 */ u8 field_0x204[0x190];
|
||||
/* 0x394 */ TOffset<TPerc> mPercOffset[12];
|
||||
};
|
||||
|
||||
struct THeader {
|
||||
/* 0x00 */ u8 field_0x0[0x20];
|
||||
/* 0x20 */ TOffsetData mOffsets;
|
||||
};
|
||||
|
||||
/* 80299A3C */ JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299E68 */ JASOscillator::Data* findOscPtr(JASBasicBank*, THeader const*, TOsc const*);
|
||||
/* 80299F8C */ JASOscillator::Point const* getOscTableEndPtr(JASOscillator::Point const*);
|
||||
};
|
||||
|
||||
/* 80299538 */ static JASBank* createBank(void const*, JKRHeap*);
|
||||
/* 80299558 */ static JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299538 */ JASBank* createBank(void const*, JKRHeap*);
|
||||
/* 80299558 */ JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
|
||||
inline static u32 getBankNumber(const void* param_0) { return ((u32*)param_0)[2]; }
|
||||
inline u32 getBankNumber(const void* param_0) { return ((u32*)param_0)[2]; }
|
||||
|
||||
extern u32 sUsedHeapSize;
|
||||
};
|
||||
|
||||
@@ -68,13 +68,11 @@ namespace JASThreadingModel {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename A0>
|
||||
struct ObjectLevelLockable {
|
||||
// Should be templated on the chunk memory but couldn't initialize it inside the class itself
|
||||
//template <typename A0>
|
||||
struct Lock {
|
||||
Lock(OSMutex* mutex) {
|
||||
mMutex = mutex;
|
||||
Lock(A0 const& mutex) {
|
||||
mMutex = (A0*)&mutex;
|
||||
OSLockMutex(mMutex);
|
||||
}
|
||||
|
||||
@@ -82,7 +80,7 @@ namespace JASThreadingModel {
|
||||
OSUnlockMutex(mMutex);
|
||||
}
|
||||
|
||||
OSMutex* mMutex;
|
||||
A0* mMutex;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -105,8 +103,8 @@ namespace JASKernel { JKRHeap* getSystemHeap(); };
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*/
|
||||
template<u32 ChunkSize, typename T>
|
||||
class JASMemChunkPool {
|
||||
template<u32 ChunkSize, template<typename> class T>
|
||||
class JASMemChunkPool : public OSMutex {
|
||||
struct MemoryChunk {
|
||||
MemoryChunk(MemoryChunk* nextChunk) {
|
||||
mNextChunk = nextChunk;
|
||||
@@ -156,7 +154,7 @@ class JASMemChunkPool {
|
||||
};
|
||||
public:
|
||||
JASMemChunkPool() {
|
||||
OSInitMutex(&mMutex);
|
||||
OSInitMutex(this);
|
||||
field_0x18 = NULL;
|
||||
createNewChunk();
|
||||
}
|
||||
@@ -185,7 +183,7 @@ public:
|
||||
}
|
||||
|
||||
void* alloc(u32 size) {
|
||||
typename T::Lock lock(&mMutex);
|
||||
typename T<JASMemChunkPool<ChunkSize, T> >::Lock lock(*this);
|
||||
if (field_0x18->getFreeSize() < size) {
|
||||
if (ChunkSize < size) {
|
||||
return NULL;
|
||||
@@ -198,7 +196,7 @@ public:
|
||||
}
|
||||
|
||||
void free(void* ptr) {
|
||||
typename T::Lock lock(&mMutex);
|
||||
typename T<JASMemChunkPool<ChunkSize, T> >::Lock lock(*this);
|
||||
MemoryChunk* chunk = field_0x18;
|
||||
MemoryChunk* prevChunk = NULL;
|
||||
while (chunk != NULL) {
|
||||
@@ -216,7 +214,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/* 0x00 */ OSMutex mMutex;
|
||||
/* 0x18 */ MemoryChunk* field_0x18;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "JSystem/JAudio2/JASSeqCtrl.h"
|
||||
#include "JSystem/JAudio2/JASTrackPort.h"
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "global.h"
|
||||
|
||||
struct JASSoundParams;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ struct TParseData_aligned : public TParseData {
|
||||
|
||||
// Base for header and/or block parsing
|
||||
struct TParse_header_block {
|
||||
virtual ~TParse_header_block();
|
||||
virtual ~TParse_header_block() = 0;
|
||||
|
||||
virtual bool parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 arg2) = 0;
|
||||
virtual bool parseBlock_next(const void** ppData_inout, u32* puData_out, u32 arg2) = 0;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define LINKLIST_H
|
||||
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include <iterator.h>
|
||||
|
||||
namespace JGadget {
|
||||
struct TLinkListNode {
|
||||
@@ -146,6 +147,12 @@ struct TLinkList : public TNodeLinkList {
|
||||
T* operator->() const { return Element_toValue(base.operator->()); }
|
||||
T& operator*() const { return *operator->(); }
|
||||
|
||||
typedef s32 difference_type;
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
|
||||
public:
|
||||
/* 0x00 */ TNodeLinkList::iterator base;
|
||||
};
|
||||
@@ -221,7 +228,7 @@ struct TLinkList : public TNodeLinkList {
|
||||
|
||||
template <typename T, int I>
|
||||
struct TLinkList_factory : public TLinkList<T, I> {
|
||||
virtual ~TLinkList_factory() {}
|
||||
inline virtual ~TLinkList_factory() = 0;
|
||||
virtual T* Do_create() = 0;
|
||||
virtual void Do_destroy(T*) = 0;
|
||||
void Clear_destroy() {
|
||||
@@ -233,6 +240,9 @@ struct TLinkList_factory : public TLinkList<T, I> {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, int I>
|
||||
TLinkList_factory<T, I>::~TLinkList_factory() {}
|
||||
|
||||
template <typename T>
|
||||
struct TEnumerator {
|
||||
inline TEnumerator(T _current, T _end)
|
||||
|
||||
@@ -2,9 +2,24 @@
|
||||
#define SEARCH_H
|
||||
|
||||
#include "dolphin/os.h"
|
||||
#include <iterator.h>
|
||||
#include <functional.h>
|
||||
#include <algorithm.h>
|
||||
|
||||
namespace JGadget {
|
||||
|
||||
namespace search {
|
||||
|
||||
template <typename T>
|
||||
struct TExpandStride_ {};
|
||||
|
||||
template <>
|
||||
struct TExpandStride_<s32> {
|
||||
static s32 get(s32 n) { return n << 3; }
|
||||
};
|
||||
|
||||
} // namespace search
|
||||
|
||||
//! @todo: mangled name isn't correct, fix this
|
||||
//! Current: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d
|
||||
//! Target: toValueFromIndex<PFdd_d>__7JGadgetFiPCPFdd_dUlRCPFdd_d_RCPFdd_d
|
||||
@@ -14,6 +29,92 @@ inline const T& toValueFromIndex(int idx, const T* pValue, u32 count, const T& f
|
||||
return (idx >= count) ? fallback : pValue[idx];
|
||||
}
|
||||
|
||||
template <typename Iterator, typename T, typename Predicate>
|
||||
inline Iterator findUpperBound_binary_all(Iterator first, Iterator last, const T& val, Predicate p) {
|
||||
return upper_bound(first, last, val, p);
|
||||
}
|
||||
|
||||
template <typename Iterator, typename T, typename Predicate>
|
||||
inline Iterator findUpperBound_binary_begin(Iterator first, Iterator last, const T& val, Predicate p) {
|
||||
if (first == last) {
|
||||
return last;
|
||||
}
|
||||
|
||||
typedef typename std::iterator_traits<Iterator>::difference_type difference_type;
|
||||
difference_type dist = std::distance(first, last);
|
||||
difference_type stride = 1;
|
||||
search::TExpandStride_<difference_type> expand;
|
||||
Iterator i = first;
|
||||
|
||||
while (true) {
|
||||
if (p(val, *i)) {
|
||||
if (stride == 1) {
|
||||
return i;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
first = i;
|
||||
dist -= stride;
|
||||
if (dist <= 0) {
|
||||
i = last;
|
||||
break;
|
||||
}
|
||||
i += stride;
|
||||
stride = expand.get(stride);
|
||||
}
|
||||
|
||||
return findUpperBound_binary_all(first, i, val, p);
|
||||
}
|
||||
|
||||
template <typename Iterator, typename T, typename Predicate>
|
||||
inline Iterator findUpperBound_binary_end(Iterator first, Iterator last, const T& val, Predicate p) {
|
||||
if (first == last) {
|
||||
return last;
|
||||
}
|
||||
|
||||
typedef typename std::iterator_traits<Iterator>::difference_type difference_type;
|
||||
--last;
|
||||
difference_type dist = std::distance(first, last);
|
||||
difference_type stride = 1;
|
||||
search::TExpandStride_<difference_type> expand;
|
||||
Iterator i = last;
|
||||
|
||||
while (true) {
|
||||
if (!p(val, *i)) {
|
||||
if (stride == 1) {
|
||||
return ++i;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
last = i;
|
||||
dist -= stride;
|
||||
if (dist <= 0) {
|
||||
i = first;
|
||||
break;
|
||||
}
|
||||
i -= stride;
|
||||
stride = expand.get(stride);
|
||||
}
|
||||
|
||||
return findUpperBound_binary_all(i, ++last, val, p);
|
||||
}
|
||||
|
||||
template <typename Iterator, typename T, typename Predicate>
|
||||
Iterator findUpperBound_binary_current(Iterator first, Iterator last, Iterator current, const T& val, Predicate p) {
|
||||
return current == last || p(val, *current) ?
|
||||
findUpperBound_binary_end(first, current, val, p)
|
||||
: findUpperBound_binary_begin(current, last, val, p);
|
||||
}
|
||||
|
||||
// NONMATCHING stack alloc
|
||||
template <typename Iterator, typename T>
|
||||
Iterator findUpperBound_binary_current(Iterator first, Iterator last, Iterator current, const T& val) {
|
||||
std::less<T> less;
|
||||
return findUpperBound_binary_current(first, last, current, val, less);
|
||||
}
|
||||
|
||||
} // namespace JGadget
|
||||
|
||||
#endif /* SEARCH_H */
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define STD_VECTOR_H
|
||||
|
||||
#include "JSystem/JGadget/std-memory.h"
|
||||
#include "algorithm.h"
|
||||
#include "msl_memory.h"
|
||||
#include <algorithm.h>
|
||||
#include <msl_memory.h>
|
||||
|
||||
namespace JGadget {
|
||||
namespace vector {
|
||||
@@ -41,12 +41,6 @@ struct TVector {
|
||||
mAllocator.deallocate(pBegin_, 0);
|
||||
}
|
||||
|
||||
T* insert(T* pos, const T& val) {
|
||||
u32 diff = (int)((u32)pos - (u32)begin()) / 4;
|
||||
insert(pos, 1, val);
|
||||
return pBegin_ + diff;
|
||||
}
|
||||
|
||||
void insert(T* pos, u32 count, const T& val) {
|
||||
if (count != 0) {
|
||||
T* ptr = Insert_raw(pos, count);
|
||||
@@ -110,11 +104,17 @@ struct TVector {
|
||||
return endOfCopy;
|
||||
}
|
||||
|
||||
T* begin() { return pBegin_; }
|
||||
T* insert(T* pos, const T& val) {
|
||||
u32 diff = (int)((u32)pos - (u32)begin()) / 4;
|
||||
insert(pos, 1, val);
|
||||
return pBegin_ + diff;
|
||||
}
|
||||
|
||||
T* end() { return pEnd_; }
|
||||
T* begin() const { return pBegin_; }
|
||||
|
||||
u32 size() {
|
||||
T* end() const { return pEnd_; }
|
||||
|
||||
u32 size() const {
|
||||
if (pBegin_ == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -171,6 +171,23 @@ struct TVector_pointer_void : public TVector<void*, TAllocator<void*> > {
|
||||
void clear() { erase(begin(), end()); }
|
||||
void push_back(const void*& value) { insert(end(), (void* const&)value); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TVector_pointer : TVector_pointer_void {
|
||||
TVector_pointer(const TAllocator<void*>& allocator) : TVector_pointer_void(allocator) {}
|
||||
~TVector_pointer() {}
|
||||
|
||||
const T* begin() const { return (const T*)TVector_pointer_void::begin(); }
|
||||
T* begin() { return (T*)TVector_pointer_void::begin(); }
|
||||
|
||||
const T* end() const { return (const T*)TVector_pointer_void::end(); }
|
||||
T* end() { return (T*)TVector_pointer_void::end(); }
|
||||
|
||||
void push_back(const T& ref) {
|
||||
static_cast<TVector_pointer_void*>(this)->push_back((const void*&)ref);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace JGadget
|
||||
|
||||
#endif /* STD_VECTOR_H */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef VECTOR_H
|
||||
#define VECTOR_H
|
||||
|
||||
#include <dolphin/types.h>
|
||||
|
||||
extern u8 data_804511E0;
|
||||
extern u8 lit_569[];
|
||||
|
||||
namespace JGadget {
|
||||
|
||||
@@ -18,7 +18,7 @@ typedef u32 (*ExtendFunc)(u32, u32, u32);
|
||||
template <typename T>
|
||||
struct TAllocator {
|
||||
static TAllocator get() {}
|
||||
inline TAllocator() { _0 = lit_569[0]; }
|
||||
inline TAllocator(u8 param_0) { _0 = param_0; }
|
||||
/* 0x0 */ u8 _0;
|
||||
/* 0x4 */ u32 _4;
|
||||
/* 0x8 */ u32 _8;
|
||||
|
||||
@@ -46,8 +46,8 @@ template<>
|
||||
struct TUtil<double> {
|
||||
static inline double epsilon() { return 32.0f * FLT_EPSILON; }
|
||||
static inline double one() { return 1.0; }
|
||||
static inline double atan2(double x, double y) { return atan2(x, y); }
|
||||
static inline double asin(double x) { return asin(x); }
|
||||
static inline double atan2(double x, double y) { return ::atan2(x, y); }
|
||||
static inline double asin(double x) { return ::asin(x); }
|
||||
static inline double halfPI() { return 1.5707963267948966; }
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
|
||||
class JKRAramBlock;
|
||||
class JKRDvdFile;
|
||||
class JKRFile;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jkernel
|
||||
@@ -31,7 +31,7 @@ private:
|
||||
/* 0x00 */ // vtable
|
||||
/* 0x04 */ // JKRArchive
|
||||
/* 0x64 */ JKRAramBlock* mBlock;
|
||||
/* 0x68 */ JKRDvdFile* mDvdFile;
|
||||
/* 0x68 */ JKRFile* mDvdFile;
|
||||
}; // Size = 0x6C
|
||||
|
||||
#endif /* JKRARAMARCHIVE_H */
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
static bool syncAram(JKRADCommand*, int);
|
||||
|
||||
static void setSZSBufferSize(u32 size) { sSZSBufferSize = size; }
|
||||
static bool isErrorRetry() { return errorRetry; }
|
||||
|
||||
// TODO: fix type
|
||||
static JSUList<JKRADCommand> sDvdAramAsyncList;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user