diff --git a/config/GZLE01/splits.txt b/config/GZLE01/splits.txt index 6226bc5ed..10aac9a2e 100644 --- a/config/GZLE01/splits.txt +++ b/config/GZLE01/splits.txt @@ -481,7 +481,7 @@ d/d_cloth_packet.cpp: .sbss start:0x803F6B90 end:0x803F6BA0 .sdata2 start:0x803F8440 end:0x803F84C8 -d/actor/d_a_obj.cpp: +d/d_a_obj.cpp: .text start:0x800666EC end:0x80067D1C .rodata start:0x8034FBB8 end:0x8034FC58 .data start:0x80376FB8 end:0x80377018 diff --git a/config/GZLJ01/splits.txt b/config/GZLJ01/splits.txt index 7f8582fd7..7b818d7b6 100644 --- a/config/GZLJ01/splits.txt +++ b/config/GZLJ01/splits.txt @@ -481,7 +481,7 @@ d/d_cloth_packet.cpp: .sbss start:0x803EA060 end:0x803EA070 .sdata2 start:0x803EB8F8 end:0x803EB980 -d/actor/d_a_obj.cpp: +d/d_a_obj.cpp: .text start:0x80064520 end:0x80065B50 .rodata start:0x80343618 end:0x803436B8 .data start:0x8036A458 end:0x8036A4B8 diff --git a/config/GZLP01/splits.txt b/config/GZLP01/splits.txt index 216265d4a..9ab888dbd 100644 --- a/config/GZLP01/splits.txt +++ b/config/GZLP01/splits.txt @@ -481,7 +481,7 @@ d/d_cloth_packet.cpp: .sbss start:0x803FE390 end:0x803FE3A0 .sdata2 start:0x803FFC68 end:0x803FFCF0 -d/actor/d_a_obj.cpp: +d/d_a_obj.cpp: .text start:0x8006A4CC end:0x8006BAFC .rodata start:0x80355F08 end:0x80355FA8 .data start:0x8037DC98 end:0x8037DCF8 diff --git a/configure.py b/configure.py index fccddd7f2..a722ab280 100644 --- a/configure.py +++ b/configure.py @@ -345,7 +345,7 @@ config.libs = [ Object(NonMatching, "d/d_jnt_hit.cpp"), Object(NonMatching, "d/d_chain.cpp"), Object(NonMatching, "d/d_cloth_packet.cpp"), - Object(NonMatching, "d/actor/d_a_obj.cpp"), + Object(NonMatching, "d/d_a_obj.cpp"), Object(NonMatching, "d/d_a_obj_tribox_static.cpp"), Object(Matching, "d/d_a_ship_static.cpp"), Object(Matching, "d/d_a_boko_static.cpp"), diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 9b7ec3bc4..5b6e739cf 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -370,6 +370,11 @@ template<> struct TBox > { addPos(TVec2(x, y)); } + void setSize(TVec2 size) { + f.x = size.x; + f.y = size.y; + } + void addPos(const TVec2& pos) { i.add(pos); f.add(pos); diff --git a/src/JSystem/J2DGraph/J2DWindow.cpp b/src/JSystem/J2DGraph/J2DWindow.cpp index a767c699e..1fe3460c2 100644 --- a/src/JSystem/J2DGraph/J2DWindow.cpp +++ b/src/JSystem/J2DGraph/J2DWindow.cpp @@ -112,7 +112,7 @@ J2DWindow::~J2DWindow() { /* 802D1B44-802D1F5C .text draw_private__9J2DWindowFRCQ29JGeometry8TBox2RCQ29JGeometry8TBox2 */ void J2DWindow::draw_private(const JGeometry::TBox2& frameBox, const JGeometry::TBox2& contentsBox) { - /* Nonmatching - not finished yet */ + /* Nonmatching */ drawContents(contentsBox); GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); @@ -123,47 +123,45 @@ void J2DWindow::draw_private(const JGeometry::TBox2& frameBox, const JGeome if (mpFrameTexture1 != NULL && mpFrameTexture2 != NULL && mpFrameTexture3 != NULL && mpFrameTexture4 != NULL) { f32 right = frameBox.getWidth() - mpFrameTexture4->getWidth(); f32 top = frameBox.getHeight() - mpFrameTexture4->getHeight(); - f32 left = frameBox.i.x + mpFrameTexture1->getWidth(); - f32 bottom = frameBox.i.y + mpFrameTexture1->getHeight(); + // This isn't right, this should be 0.0f + + f32 left = 1.0f + mpFrameTexture1->getWidth(); + f32 bottom = 1.0f + mpFrameTexture1->getHeight(); + u16 s0, s1, t0, t1; - drawFrameTexture(mpFrameTexture1, 0.0f, 0.0f, - ((field_0x110 >> 7) & 1), - ((field_0x110 >> 6) & 1), true); - drawFrameTexture(mpFrameTexture2, right, 0.0f, - ((field_0x110 >> 5) & 1), - ((field_0x110 >> 4) & 1), (field_0x111 & 1)); + drawFrameTexture(mpFrameTexture1, 0.0f, 0.0f, + (field_0x110 >> 7) & 1, + (field_0x110 >> 6) & 1, true); + drawFrameTexture(mpFrameTexture2, right, 0.0f, + (field_0x110 >> 5) & 1, + (field_0x110 >> 4) & 1, (field_0x111 >> 0) & 1); - u16 local_a6 = ((field_0x110 >> 5) & 1) ? (u16)0x8000 : (u16)0; - u16 local_a8 = ((field_0x110 >> 4) & 1) ? (u16)0x8000 : (u16)0; - u16 local_a82 = local_a8 ^ 0x8000; - drawFrameTexture(mpFrameTexture2, left, 0.0f, right - left, (f32)mpFrameTexture2->getHeight(), - local_a6, local_a8, local_a6, local_a82, false); + s0 = ((field_0x110 >> 5) & 1) ? (u16)0x8000 : (u16)0; + t0 = ((field_0x110 >> 4) & 1) ? (u16)0x8000 : (u16)0; + t1 = (u16)(t0 ^ 0x8000); + drawFrameTexture(mpFrameTexture2, left, 0.0f, right - left, (f32)mpFrameTexture2->getHeight(), s0, t0, s0, t1, false); drawFrameTexture(mpFrameTexture4, right, top, - ((field_0x110 >> 1) & 1), - ((field_0x110 >> 0) & 1), (field_0x111 & 1)); + (field_0x110 >> 1) & 1, + (field_0x110 >> 0) & 1, (field_0x111 & 1)); - u16 local_aa = ((field_0x110 >> 1) & 1) ? (u16)0x8000 : (u16)0; - u16 local_ac = ((field_0x110 >> 0) & 1) ? (u16)0 : (u16)0x8000; - u16 local_ac2 = local_ac ^ 0x8000; - drawFrameTexture(mpFrameTexture4, left, top, right - left, (f32)mpFrameTexture4->getHeight(), - local_aa, local_ac, local_aa, local_ac2, false); + s0 = ((field_0x110 >> 1) & 1) ? (u16)0x8000 : (u16)0; + t0 = ((field_0x110 >> 0) & 1) ? (u16)0 : (u16)0x8000; + t1 = (u16)(t0 ^ 0x8000); + drawFrameTexture(mpFrameTexture4, left, top, right - left, (f32)mpFrameTexture4->getHeight(), s0, t0, s0, t1, false); - u16 local_ae = ((field_0x110 >> 1) & 1) ? (u16)0 : (u16)0x8000; - u16 local_ae2 = local_ae ^ 0x8000; - u16 local_b0 = ((field_0x110 >> 0) & 1) ? (u16)0x8000 : (u16)0; - drawFrameTexture(mpFrameTexture4, right, bottom, (f32)mpFrameTexture4->getWidth(), top - bottom, - local_ae, local_b0, local_ae2, local_b0, false); + s0 = ((field_0x110 >> 1) & 1) ? (u16)0 : (u16)0x8000; + s1 = (u16)(s0 ^ 0x8000); + t0 = ((field_0x110 >> 0) & 1) ? (u16)0x8000 : (u16)0; + drawFrameTexture(mpFrameTexture4, right, bottom, (f32)mpFrameTexture4->getWidth(), top - bottom, s0, t0, s1, t0, false); drawFrameTexture(mpFrameTexture3, 0.0f, top, - ((field_0x110 >> 3) & 1), - ((field_0x110 >> 2) & 1), (field_0x111 & 1)); + (field_0x110 >> 3) & 1, + (field_0x110 >> 2) & 1, (field_0x111 & 1)); - u16 local_b2 = ((field_0x110 >> 3) & 1) ? (u16)0 : (u16)0x8000; - u16 local_b22 = local_b2 ^ 0x8000; - u16 local_b4 = ((field_0x110 >> 2) & 1) ? (u16)0x8000 : (u16)0; - drawFrameTexture(mpFrameTexture3, 0.0f, bottom, (f32)mpFrameTexture3->getWidth(), top - bottom, - local_b2, local_b4, local_b22, local_b4, false); + s0 = ((field_0x110 >> 3) & 1) ? (u16)0 : (u16)0x8000; + s1 = (u16)(s0 ^ 0x8000); + t0 = ((field_0x110 >> 2) & 1) ? (u16)0x8000 : (u16)0; + drawFrameTexture(mpFrameTexture3, 0.0f, bottom, (f32)mpFrameTexture3->getWidth(), top - bottom, s0, t0, s1, t0, false); } GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR); @@ -308,7 +306,6 @@ void J2DWindow::drawFrameTexture(JUTTexture* pTexture, f32 x0, f32 y0, f32 w, f3 /* 802D26E4-802D2784 .text drawFrameTexture__9J2DWindowFP10JUTTextureffbbb */ void J2DWindow::drawFrameTexture(JUTTexture* pTexture, f32 x, f32 y, bool flipS, bool flipT, bool bSetupTev) { - /* Nonmatching */ drawFrameTexture(pTexture, x, y, pTexture->getWidth(), pTexture->getHeight(), flipS ? (u16)0 : (u16)0x8000, flipT ? (u16)0 : (u16)0x8000, diff --git a/src/JRenderer/JRenderer.cpp b/src/JSystem/JRenderer/JRenderer.cpp similarity index 53% rename from src/JRenderer/JRenderer.cpp rename to src/JSystem/JRenderer/JRenderer.cpp index a42e71d66..794c89a19 100644 --- a/src/JRenderer/JRenderer.cpp +++ b/src/JSystem/JRenderer/JRenderer.cpp @@ -3,10 +3,9 @@ // Translation Unit: JRenderer.cpp // -#include "JSystem/JRenderer/JRenderer.h" -#include "dolphin/types.h" +#include "dolphin/gx/GX.h" /* 802D5EB8-802D5F38 .text JRNLoadTexCached__F11_GXTexMapIDUl15_GXTexCacheSizeUl15_GXTexCacheSize */ -void JRNLoadTexCached(_GXTexMapID, unsigned long, _GXTexCacheSize, unsigned long, _GXTexCacheSize) { +void JRNLoadTexCached(GXTexMapID texmap, u32, GXTexCacheSize, u32, GXTexCacheSize) { /* Nonmatching */ }