Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,8 @@ def MatchingFor(*versions):
Object(Matching, "Kameda/J2DManager.cpp"),
Object(Matching, "Kameda/Task.cpp"),
Object(NonMatching, "Kameda/Goal2D.cpp"),
Object(NonMatching, "Kameda/PauseManager.cpp"),
Object(NonMatching, "Kameda/Pause2D.cpp"),
Object(Matching, "Kameda/PauseManager.cpp"),
Object(Matching, "Kameda/Pause2D.cpp"),
Object(Matching, "Kameda/WipeManager.cpp"),
Object(Matching, "Kameda/Fade.cpp"),
Object(Matching, "Kameda/K2DPicture.cpp"),
Expand Down
79 changes: 78 additions & 1 deletion include/JSystem/JGeometry/Vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,24 @@ namespace JGeometry {
y += other.y;
}

void scale(T scalar) {
void sub(const TVec2<T> &other)
{
x -= other.x;
y -= other.y;
}

void scale(T scalar)
{
x *= scalar;
y *= scalar;
}

void div(T divisor)
{
x /= divisor;
y /= divisor;
}

void zero() { x = y = 0; }

f32 dot(const TVec2<T> &other) const { return x * other.x + y * other.y; }
Expand All @@ -131,6 +144,70 @@ namespace JGeometry {

bool isAbove(const TVec2<T> &other) const { return (x >= other.x) && (y >= other.y) ? true : false; }

// operators

// TODO: Odd return type (reference to local variable), but improves match percentage.
const TVec2 &operator+(const TVec2 &operand) const
{
TVec2 result(*this);
result.x += operand.x;
result.y += operand.y;
return result;
}

TVec2 operator-(const TVec2 &operand) const
{
TVec2 result(*this);
result.x -= operand.x;
result.y -= operand.y;
return result;
}

TVec2 operator*(f32 scalar) const
{
TVec2 result(*this);
result.x *= scalar;
result.y *= scalar;
return result;
}

// TODO: Odd return type (reference to local variable), but improves match percentage.
const TVec2 &operator/(f32 divisor) const
{
TVec2 result(*this);
result.x /= divisor;
result.y /= divisor;
return result;
}

TVec2 &operator+=(const TVec2 &operand)
{
x += operand.x;
y += operand.y;
return *this;
}

TVec2 &operator-=(const TVec2 &operand)
{
x -= operand.x;
y -= operand.y;
return *this;
}

TVec2 &operator*=(f32 scalar)
{
x *= scalar;
y *= scalar;
return *this;
}

TVec2 &operator/=(f32 divisor)
{
x /= divisor;
y /= divisor;
return *this;
}

T x, y;
};

Expand Down
113 changes: 78 additions & 35 deletions include/Kameda/Pause2D.h
Original file line number Diff line number Diff line change
@@ -1,58 +1,101 @@
#ifndef PAUSE2D_H
#define PAUSE2D_H

#include "JSystem/J2D/J2DAnmLoader.h"
#include "JSystem/J2D/J2DGrafContext.h"
#include "JSystem/J2D/J2DPane.h"
#include "JSystem/J2D/J2DPicture.h"
#include "JSystem/J2D/J2DScreen.h"
#include "JSystem/JGeometry/Vec.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JORReflexible.h"
#include "Kaneshige/HioMgr.h"
#include "Osako/kartPad.h"

class Pause2DParam : public JORReflexible {
class Pause2DParam : public JORReflexible
{
public:
// Inline/Unused
Pause2DParam();
virtual ~Pause2DParam() {}

u8 mFlag; // 0x04
};

class Pause2DHioNode : public HioNode {
class Pause2DHioNode : public HioNode
{
public:
Pause2DHioNode();
Pause2DHioNode() : HioNode("ポーズ表示", &mParam, 0, 0) {}
virtual ~Pause2DHioNode() {}

Pause2DParam mParam;
};

class Pause2D { // Autogenerated
class Pause2D
{
public:
enum PauseStatus {

enum PauseStatus
{
PAUSE_ZERO = 0,
PAUSE_ONE = 1,
PAUSE_TWO = 2,
PAUSE_THREE = 3,
PAUSE_FOUR = 4,
};

Pause2D(JKRHeap *); // 0x8013554c
void init(); // 0x80136308
void draw(); // 0x801364d0
void calc(KartGamePad *); // 0x8013653c
void selectorGP(KartGamePad *); // 0x8013672c
void selectorVS(KartGamePad *); // 0x80136854
void selectorTA(KartGamePad *); // 0x801369d4
void selectorMG(KartGamePad *); // 0x80136b54
void selectorCommon(); // 0x80136cec
void setDrawGP(); // 0x80136d34
void setDrawVS(); // 0x80136ee4
void setDrawTA(); // 0x80137408
void setDrawMG(); // 0x8013792c
void setDrawCommon(); // 0x80137ff4
void getScale(int); // 0x801381b4
static int getPauseSelector(); // 0x801381fc
static PauseStatus getPauseStatus(); // 0x80138204
static void setPauseStatus(PauseStatus); // 0x8013820c
void setPadText(); // 0x80138214
static int mPauseSelector; // 0x804162b8
static PauseStatus mStatus; // 0x804162bc
// Inline/Unused
Pause2D(JKRHeap *heap); // 0x8013554c
~Pause2D();
static void *mLineTag;
static void *mPrintMessageTag;
static void *mStarTag;
static void *mStarDrawTag;
}; // class Pause2D
#endif // PAUSE2D_H

void init(); // 0x80136308
void draw(); // 0x801364d0
void calc(KartGamePad *pad); // 0x8013653c
void selectorGP(KartGamePad *pad); // 0x8013672c
void selectorVS(KartGamePad *pad); // 0x80136854
void selectorTA(KartGamePad *pad); // 0x801369d4
void selectorMG(KartGamePad *pad); // 0x80136b54
void selectorCommon(); // 0x80136cec
void setDrawGP(); // 0x80136d34
void setDrawVS(); // 0x80136ee4
void setDrawTA(); // 0x80137408
void setDrawMG(); // 0x8013792c
void setDrawCommon(); // 0x80137ff4
f32 getScale(int); // 0x801381b4
static int getPauseSelector(); // 0x801381fc
static PauseStatus getPauseStatus(); // 0x80138204
static void setPauseStatus(PauseStatus status); // 0x8013820c
void setPadText(); // 0x80138214

private:
static int mPauseSelector; // 0x804162b8
static PauseStatus mStatus; // 0x804162bc

Pause2DHioNode *mHioNode; // 0x00
J2DOrthoGraph *mOrthoGraph; // 0x04
J2DScreen *mScreen; // 0x08
J2DAnmTransform *mTransform; // 0x0c
J2DAnmColor *mColor; // 0x10
s32 _14; // 0x14
s32 _18; // 0x18
s32 mAnmFrame[2]; // 0x1c
f32 mScale[2]; // 0x24
J2DPicture *mMenuEntries[6]; // 0x2c
J2DPane *mPaneStarsPosOffset; // 0x44
J2DPane *mPaneStarsPos[12]; // 0x48
JGeometry::TVec2f mStarsPos[12]; // 0x78
J2DPane *mStars[2]; // 0xd8
s32 mCounter; // 0xe0
JGeometry::TVec2f mInitialPos[2]; // 0xe4
JGeometry::TVec2f mTargetPos[2]; // 0xf4
JGeometry::TVec2f mDrawPos[2]; // 0x104

struct LinePane
{
J2DAnmBase *mAnm; // 0x00
J2DPane *mPane; // 0x04
f32 mScale; // 0x08
} mPaneLines[6]; // 0x114

void (Pause2D::*mSelector)(KartGamePad *); // 0x15c
void (Pause2D::*mSetDraw)(); // 0x168
};

#endif // PAUSE2D_H
95 changes: 63 additions & 32 deletions include/Kameda/PauseManager.h
Original file line number Diff line number Diff line change
@@ -1,53 +1,84 @@
#ifndef PAUSEMANAGER_H
#define PAUSEMANAGER_H

#include "JSystem/J2D/J2DGrafContext.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "Kameda/Pause2D.h"
#include "Kameda/PrintMemoryCard.h"
#include "Kameda/Result2D.h"
#include "Osako/kartPad.h"
#include "types.h"

class PauseManager {
class PauseManager
{
public:
PauseManager(JKRHeap *); // 0x801343d0
void reset(); // 0x801345fc
void draw(); // 0x801346d0
void exec(); // 0x801348f8
static bool tstPause(); // 0x80135288
void wipeOut(int); // 0x80135290
static int getPauseChoice(); // 0x801352d0
void setTA(); // 0x8013541c

void setResultStartFlag(bool flag) {mResultStart = flag; }
PauseManager(JKRHeap *heap); // 0x801343d0
~PauseManager();
void reset(); // 0x801345fc
void setPause();
void clrPause();
void draw(); // 0x801346d0
void exec(); // 0x801348f8
static bool tstPause(); // 0x80135288
void wipeIn();
void wipeOut(int); // 0x80135290
static int getPauseChoice(); // 0x801352d0
void getCharRankPos(int);
void setTA(); // 0x8013541c

void setResultStartFlag(bool flag) { mResultStart = flag; }
void setGameOverFlag(bool flag) { mGameOver = flag; }
void setExecFlag(bool flag) { mExec = flag; }
void setPauseEndFlag(bool flag) { mPauseEnd = flag; }

void enablePause() { _14 = 0; }

static PauseManager *getManager() {
return mThis;
}
static PauseManager *getManager() { return mThis; }

JKRArchive *getArchive() const { return mArchive; }

bool isResultStart() const { return mResultStart; }

private:
static PauseManager *mThis; // 0x80416298
static bool mIsPause; // 0x8041629c
static int mPauseSelector; // 0x804162a0
static int mPauseChoice; // 0x804162a4
static int mPauseNextChoice; // 0x804162a8
static KartGamePad *mPausePad; // 0x804162ac

u8 _0[0xe];
bool mResultStart;
bool _f;
bool mGameOver;
u8 _11[0x13 - 0x11];
bool mExec;
u32 _14;
bool mPauseEnd;
u8 _19[0x3c - 0x19];
static PauseManager *mThis; // 0x80416298
static bool mIsPause; // 0x8041629c
static int mPauseSelector; // 0x804162a0
static int mPauseChoice; // 0x804162a4
static int mPauseNextChoice; // 0x804162a8
static KartGamePad *mPausePad; // 0x804162ac

bool mNetFlag; // 0x00
u8 _1[3]; // 0x01
JKRArchive *mArchive; // 0x04
PrintMemoryCard *mPrintMemoryCard; // 0x08
u8 _c; // 0x0c
u8 _d; // 0x0d
bool mResultStart; // 0x0e
bool _f; // 0x0f
bool mGameOver; // 0x10
u8 _11; // 0x11
u8 _12; // 0x12
bool mExec; // 0x13
s32 _14; // 0x14
bool mPauseEnd; // 0x18
u8 _19; // 0x19
u8 _1a; // 0x1a
u8 _1b; // 0x1b
Pause2D *mPause2D; // 0x1c
Result2D *mResult2D; // 0x20
J2DOrthoGraph *mOrthoGraph; // 0x24
s32 _28; // 0x28
s32 mWipeOutFrame; // 0x2c
s32 mWipeOutDuration; // 0x30
u32 _34; // 0x30
bool _38; // 0x38
u8 _39[3]; // 0x39
};

inline PauseManager *GETPauseManager() { return PauseManager::getManager(); }
inline PauseManager *GETPauseManager()
{
return PauseManager::getManager();
}

#endif
16 changes: 12 additions & 4 deletions include/Kameda/Result2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Result2D { // Autogenerated
void setDrawVS(); // 0x8014cb58
void setDrawTA(); // 0x8014cc10
void setDrawMG(); // 0x8014cd94
void getResultSelector(); // 0x8014ce48
static int getResultSelector(); // 0x8014ce48
void setRaceRank(); // 0x8014ce50
void setGPRank(); // 0x8014d924
void setVS(); // 0x8014df84
Expand All @@ -81,9 +81,12 @@ class Result2D { // Autogenerated
void getFrameColor(JUTColor &); // 0x80150500
void getScale(int); // 0x8015057c
void setScale(int); // 0x801505c4
void setGPClr(); // 0x80150804
void getAnmEnd(); // 0x80150830

static void setGPClr(); // 0x80150804
bool getAnmEnd(); // 0x80150830

static inline bool getDrawFlag();
static inline void setDrawFlag(bool drawFlag);

static const u64 mSetWordLineTag[9]; // 0x8036ec18
static const u64 mResultLayoutTag[11]; // 0x8036ec60
static const u64 mResultLineTag[20]; // 0x8036ecb8
Expand All @@ -101,6 +104,11 @@ class Result2D { // Autogenerated
// Inline/Unused
~Result2D();
void getCharPos(int);

public:
u8 _0[0x1980]; // 0x0
u32 _1980; // 0x1980
u8 _1984[0x1c24 - 0x1984]; // 0x1984
}; // class Result2D

#endif // RESULT2D_H
Loading
Loading