Random progress.

This commit is contained in:
SodiumChlorideLogic 2021-11-24 16:22:45 -05:00
parent ea3aeee339
commit 4e133f0b5a
54 changed files with 2161 additions and 2189 deletions

View File

@ -1,12 +1,41 @@
#ifndef _BOOTSECTION_H
#define _BOOTSECTION_H
struct BootSection {
BootSection(struct JKRHeap*);
#include "DvdThreadCommand.h"
#include "Game/BaseHIOSection.h"
struct Graphics;
template <typename T> struct IDelegate1;
struct JKRHeap;
struct JUTTexture;
struct TinyPikmin;
namespace ebi {
struct TScreenProgre;
}
struct BootSection : public Game::BaseHIOSection {
typedef bool RunWaitCallback(const void*, void*);
enum StateID {
SID_LOAD_RESOURCE_FIRST = 0,
SID_LOAD_MEMORY_CARD,
SID_INIT_NINTENDO_LOGO_MAYBE,
SID_UNUSED_3,
SID_NINTENDO_LOGO,
SID_WAIT_PROGRESSIVE,
SID_SET_INTERLACE,
SID_SET_PROGRESSIVE,
SID_DOLBY_LOGO_1,
SID_DOLBY_LOGO_2,
_FORCE_UINT = 0xFFFFFFFF
};
BootSection(JKRHeap*);
~BootSection();
void doDraw(struct Graphics&);
void doUpdate();
void doDraw(Graphics&);
virtual bool doUpdate();
void drawDolbyLogo(Graphics&);
void drawEpilepsy(Graphics&);
@ -15,7 +44,7 @@ struct BootSection {
void drawSetInterlace(Graphics&);
void drawSetProgressive(Graphics&);
void forceReset();
virtual bool forceReset();
void init();
void load2DResource();
@ -23,7 +52,7 @@ struct BootSection {
void loadResident();
void run();
void runWait(BootSection, bool(const void*, void*));
void runWait(RunWaitCallback);
void setMode(int);
void setModeEpilepsy();
@ -34,6 +63,22 @@ struct BootSection {
void updateProgressive();
void updateWaitProgressive();
void waitLoadResource();
StateID m_stateID; // _48
int _4C; // _4C
float _50; // _50
JUTTexture* m_warningTexture; // _54
JUTTexture* m_warningPressStartTexture; // _58
JUTTexture* m_nintendoLogoTexture; // _5C
JUTTexture* m_dolbyMarkTexture; // _60
DvdThreadCommand m_threadCommand; // _64
IDelegate1<BootSection>* _D0; // _D0
Controller* _D4; // _D4
ebi::TScreenProgre* _D8; // _D8
bool m_inProgreSet; // _DC
u8 _DD; // _DD
TinyPikmin* m_tinyPikis; // _E0
float m_unknownScaleE4; // _E4
};
#endif

View File

@ -1,8 +1,13 @@
#ifndef _BUILDSETTINGS_H
#define _BUILDSETTINGS_H
// TODO: These should probably go into a precompiled header or build flags or something.
// TODO: These should probably go into a precompiled header or build flags or
// something.
#define LOCALIZED true
#define MATCHING true
#define MATCHING true
#define USADEMO1 1
#define USAFINAL 2
#define BUILDTARGET USAFINAL
#endif

28
include/Demo.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef _DEMO_H
#define _DEMO_H
// Header for entire Demo namespace.
#include "DvdThreadCommand.h"
#include "Game/BaseHIOSection.h"
#include "Game/THPPlayer.h"
struct JUTTexture;
namespace Demo {
struct HIORootNode {
};
// Size: 0x1B0
struct Section : public Game::BaseHIOSection {
Section(JKRHeap*);
DvdThreadCommand m_threadCommand; // _048
Controller* _D8; // _0D8
float _DC; // _0DC
Game::THPPlayer m_thpPlayer; // _0E0
JUTTexture* _1AC; // _1AC
};
} // namespace Demo
#endif

View File

@ -18,8 +18,16 @@ typedef u8 GXBool;
#define GX_ENABLE ((GXBool)1)
#define GX_DISABLE ((GXBool)0)
// TODO: Replace(?) this block of typedefs. They're just placeholders for now.
typedef uint GXCullMode;
typedef uint GXTexMapID;
typedef uint _GXAttr;
typedef uint _GXAttrType;
typedef uint _GXVtxFmt;
typedef uint _GXVtxFmt;
typedef uint _GXCompCnt;
typedef uint _GXCompType;
// Names are guessed
typedef enum _SDK_GXFogType {

View File

@ -5,10 +5,27 @@
namespace Game {
struct AILOD {
enum Flags {
FLAG_UNKNOWN1 = 0x01,
FLAG_UNKNOWN2 = 0x02,
FLAG_NEED_SHADOW = 0x04,
FLAG_UNKNOWN4 = 0x08
};
AILOD();
s8 m_flags; // _00
s8 m_sndVpId; // _01, sound viewport ID
// union {
// // Use with Flags.
// Flags byteView;
// // For hacks only.
// // Vanilla didn't use a bitfield.
// u8 padding : 4,
// m_unknown4 : 1,
// m_needShadow : 1,
// m_unknown2 : 1,
// m_unknown1 : 1;
// } m_flags; // _00
Flags m_flags; // _00
s8 m_sndVpId; // _01, sound viewport ID
};
} // namespace Game

View File

@ -1,6 +1,8 @@
#ifndef _GAME_AILODPARM_H
#define _GAME_AILODPARM_H
#include "types.h"
namespace Game {
struct AILODParm {
AILODParm();

View File

@ -1,17 +1,12 @@
#ifndef _GAME_BASEGAMESECTION_H
#define _GAME_BASEGAMESECTION_H
#include "Game/BaseHIOSection.h"
#include "Vector3.h"
#include "Rect.h"
// NOTE, EVERYTHING UP UNTIL THE ACTUAL "STRUCT"
// DECLARATION ARE JUST FORWARD DECLARATIONS!
// TODO: replace with Section struct when implemented
namespace Section {
typedef int EDrawInitMode;
} // namespace Section
namespace PSGame {
struct SceneInfo;
}
@ -35,7 +30,7 @@ struct Piki;
struct CourseInfo;
struct GameMessage;
struct BaseGameSection {
struct BaseGameSection : public BaseHIOSection {
struct ZoomCamera {
~ZoomCamera();
@ -68,7 +63,7 @@ struct BaseGameSection {
void doSetView(int);
void doSimpleDraw(Viewport*);
void doSimulation(float);
void doUpdate();
virtual bool doUpdate();
void doViewCalc();
void draw_Ogawa2D(Graphics&);
void draw2D(Graphics&);
@ -79,7 +74,7 @@ struct BaseGameSection {
void dvdloadGameSystem();
void enableAllocHalt();
void enableTimer(float, unsigned long);
void forceFinish();
virtual bool forceFinish();
void getCaveFilename();
void getCaveID();
void getCurrentCourseInfo();

View File

@ -0,0 +1,36 @@
#ifndef _GAME_BASEHIOSECTION_H
#define _GAME_BASEHIOSECTION_H
#include "Section.h"
struct CNode;
struct Controller;
struct JFWDisplay;
struct JKRHeap;
struct HIORootNode;
namespace Game {
struct GameMessage;
struct BaseHIOSection : public Section {
BaseHIOSection(JKRHeap*);
virtual bool doUpdate(); // _34
virtual void initHIO(HIORootNode*); // _40
virtual void refreshHIO(); // _44
void addGenNode(CNode*);
void createScreenRootNode();
void setDisplay(JFWDisplay*, int);
#if BUILDTARGET == USADEMO1
u8 _DemoPadding1[0x1C];
#endif
HIORootNode* m_hioRootNode; // _3C
u8 _40[4]; // _40
Controller* _44; // _44
#if BUILDTARGET == USADEMO1
u8 _DemoPadding2[0x4];
#endif
};
} // namespace Game
#endif

View File

@ -2,11 +2,22 @@
#define _GAME_CREATURE_H
#include "types.h"
#include "Game/AILOD.h"
#include "Game/cellPyramid.h"
#include "Game/updateMgr.h"
#include "Rect.h"
#include "SysShape/Animator.h"
#include "Vector3.h"
struct Graphics;
struct Matrixf;
struct CollPart;
struct CollTree;
struct Parameters;
namespace PSM {
struct Creature;
}
namespace Sys {
struct Triangle;
@ -22,145 +33,208 @@ namespace Game {
struct AILODParm;
struct CellObject;
struct CollEvent;
struct Footmarks;
struct Generator;
struct WaterBox;
struct ShadowParam;
struct LifeGaugeParam;
struct CreatureInitArg;
struct CreatureKillArg;
struct MoviePlayer;
struct Interaction;
struct PlatEvent;
struct Creature {
struct LifeGaugeParam {
Vector3f _00; // _00
float _0C; // _0C
float _10; // _10
u8 _14; // _14
};
enum CreatureFlags {
CF_IS_ATARI = 0x00000001,
CF_IS_ALIVE = 0x00000002,
CF_IS_COLLISION_FLICK = 0x00000004,
CF_IS_MOVIE_ACTOR = 0x00000010,
CF_IS_MOVIE_MOTION = 0x00000020,
CF_IS_MOVIE_EXTRA = 0x00000040,
CF_IS_DEBUG_COLLISION = 0x80000000
};
struct Creature : public CellObject {
struct CheckHellArg {
};
Creature();
virtual Vector3f getPosition() = 0; // _00
virtual void checkCollision(CellObject*); // _04
virtual void getBoundingSphere(Sys::Sphere&) = 0; // _08
virtual bool collisionUpdatable(); // _0C
virtual bool isPiki(); // _10
virtual bool isNavi(); // _14
virtual bool deferPikiCollision(); // _18
virtual char* getTypeName(); // _1C
virtual u8 getObjType(); // _20
virtual void constructor(); // _24
virtual void onInit(CreatureInitArg*); // _28
virtual void onKill(CreatureKillArg*); // _2C
virtual void onInitPost(CreatureInitArg*); // _30
virtual void doAnimation(); // _34
virtual void doEntry(); // _38
virtual void doSetView(int); // _3C
virtual void doViewCalc(); // _40
virtual void doSimulation(float); // _44
virtual void doDirectDraw(Graphics&); // _48
virtual float getBodyRadius(); // _4C
virtual float getCellRadius(); // _50
virtual void initPosition(Vector3f&); // _54
virtual void onInitPosition(Vector3f&); // _58
virtual float getFaceDir() = 0; // _5C
virtual void setVelocity(Vector3f&) = 0; // _60
virtual Vector3f getVelocity() = 0; // _64
virtual void onSetPosition(Vector3f&) = 0; // _68
virtual void onSetPositionPost(Vector3f&); // _6C
virtual void updateTrMatrix() = 0; // _70
virtual bool isTeki(); // _74
virtual bool isPellet(); // _78
virtual void inWaterCallback(WaterBox*); // _7C
virtual void outWaterCallback(); // _80
virtual bool inWater(); // _84
virtual void getFlockMgr(); // _88
virtual void onStartCapture(); // _8C
virtual void onUpdateCapture(Matrixf&); // _90
virtual void onEndCapture(); // _94
virtual bool isAtari(); // _98
virtual void setAtari(bool); // _9C
virtual bool isAlive(); // _A0
virtual void setAlive(bool); // _A4
virtual bool isCollisionFlick(); // _A8
virtual void setCollisionFlick(bool); // _AC
virtual bool isMovieActor(); // _B0
virtual bool isMovieExtra(); // _B4
virtual bool isMovieMotion(); // _B8
virtual void setMovieMotion(bool); // _BC
virtual bool isBuried(); // _C0
virtual bool isFlying(); // _C4
virtual bool isUnderground(); // _C8
virtual bool isLivingThing(); // _CC
virtual bool isDebugCollision(); // _D0
virtual void setDebugCollision(bool); // _D4
virtual void doSave(Stream&); // _D8
virtual void doLoad(Stream&); // _DC
virtual void bounceCallback(Sys::Triangle*); // _E0
virtual void collisionCallback(CollEvent&); // _E4
virtual void platCallback(PlatEvent&); // _E8
virtual void getJAIObject(); // _EC
virtual PSM::Creature* getPSCreature(); // _F0
virtual void getSound_AILOD(); // _F4
virtual Vector3f* getSound_PosPtr(); // _F8
virtual bool sound_culling(); // _FC
virtual float getSound_CurrAnimFrame(); // _100
virtual float getSound_CurrAnimSpeed(); // _104
virtual void on_movie_begin(bool); // _108
virtual void on_movie_end(bool); // _10C
virtual void movieStartAnimation(ulong); // _110
virtual void movieStartDemoAnimation(SysShape::AnimInfo*); // _114
virtual void movieSetAnimationLastFrame(); // _118
virtual void movieSetTranslation(Vector3f&, float); // _11C
virtual void movieSetFaceDir(float); // _120
virtual void movieGotoPosition(Vector3f&); // _124
virtual void movieUserCommand(ulong, MoviePlayer*); // _128
virtual void getShadowParam(ShadowParam&); // _12C
virtual bool needShadow(); // _130
virtual void getLifeGaugeParam(LifeGaugeParam&); // _134
virtual void getLODSphere(Sys::Sphere&); // _138
virtual void getLODCylinder(Sys::Cylinder&); // _13C
virtual void startPick(); // _140
virtual void endPick(bool); // _144
virtual u32* getMabiki(); // _148
virtual Footmarks* getFootmarks(); // _14C
virtual void onStickStart(Creature*); // _150
virtual void onStickEnd(Creature*); // _154
virtual void onStickStartSelf(Creature*); // _158
virtual void onStickEndSelf(Creature*); // _15C
virtual bool isSlotFree(short); // _160
virtual int getFreeStickSlot(); // _164
virtual int getNearFreeStickSlot(Vector3f&); // _168
virtual int getRandomFreeStickSlot(); // _16C
virtual void onSlotStickStart(Creature*, short); // _170
virtual void onSlotStickEnd(Creature*, short); // _174
virtual void calcStickSlotGlobal(short, Vector3f&); // _178
virtual void getVelocityAt(Vector3f&, Vector3f&) = 0; // _17C
virtual void getAngularEffect(Vector3f&, Vector3f&); // _180
virtual void applyImpulse(Vector3f&, Vector3f&); // _184
virtual bool ignoreAtari(Creature*); // _188
virtual void getSuckPos(); // _18C
virtual void getGoalPos(); // _190
virtual bool isSuckReady(); // _194
virtual bool isSuckArriveWait(); // _198
virtual void stimulate(Interaction&); // _19C
virtual char* getCreatureName(); // _1A0
virtual s32 getCreatureID(); // _1A4
void applyAirDrag(float, float, float);
void applyImpulse(Vector3f&, Vector3f&);
void bounceCallback(Sys::Triangle*);
void calcSphereDistance(Game::Creature*);
void calcStickSlotGlobal(short, Vector3f&);
virtual void checkCollision(Game::CellObject*);
void checkHell(struct CheckHellArg&);
void checkHell(CheckHellArg&);
void checkWater(Game::WaterBox*, Sys::Sphere&);
void clearCapture();
void clearStick();
void collisionCallback(Game::CollEvent&);
virtual void collisionUpdatable();
void constructor();
void doAnimation();
void doDirectDraw(Graphics&);
void doEntry();
void doLoad(Stream&);
void doSave(Stream&);
void doSetView(int);
void doSimulation(float);
void doViewCalc();
void drawLODInfo(Graphics&, Vector3f&);
void endCapture();
void endPick(bool);
void endStick();
void getAngularEffect(Vector3f&, Vector3f&);
void getBodyRadius();
void getCellPikiCount();
void getCellRadius();
void getCreatureID();
void getCreatureName();
void getFlockMgr();
void getFootmarks();
void getFreeStickSlot();
void getGoalPos();
void getJAIObject();
void getLifeGaugeParam(Game::LifeGaugeParam&);
void getLODCylinder(Sys::Cylinder&);
void getLODSphere(Sys::Sphere&);
void getMabiki();
void getNearFreeStickSlot(Vector3f&);
void getObjType();
void getPSCreature();
void getRandomFreeStickSlot();
void getShadowParam(Game::ShadowParam&);
void getSound_AILOD();
void getSound_CurrAnimFrame();
void getSound_CurrAnimSpeed();
void getSound_PosPtr();
void getSuckPos();
void getTypeName();
int getCellPikiCount();
void getYVector(Vector3f&);
void ignoreAtari(Game::Creature*);
void init(Game::CreatureInitArg*);
void initPosition(Vector3f&);
void inWater();
void inWaterCallback(Game::WaterBox*);
virtual bool isAlive();
virtual bool isAtari();
virtual bool isBuried();
virtual bool isCollisionFlick();
virtual bool isDebugCollision();
virtual bool isFlying();
virtual bool isLivingThing();
virtual bool isMovieActor();
virtual bool isMovieExtra();
virtual bool isMovieMotion();
virtual bool isNavi();
virtual bool isPellet();
virtual bool isPiki();
virtual bool isSlotFree(short);
virtual bool isStickTo();
virtual bool isStickToMouth();
virtual bool isSuckArriveWait();
virtual bool isSuckReady();
virtual bool isTeki();
virtual bool isUnderground();
void kill(Game::CreatureKillArg*);
void load(Stream&, unsigned char);
void movie_begin(bool);
void movie_end(bool);
void movieGotoPosition(Vector3f&);
void movieSetAnimationLastFrame();
void movieSetFaceDir(float);
void movieSetTranslation(Vector3f&, float);
void movieStartAnimation(unsigned long);
void movieStartDemoAnimation(SysShape::AnimInfo*);
void movieUserCommand(unsigned long, Game::MoviePlayer*);
void needShadow();
void on_movie_begin(bool);
void on_movie_end(bool);
void onEndCapture();
void onInit(Game::CreatureInitArg*);
void onInitPosition(Vector3f&);
void onInitPost(Game::CreatureInitArg*);
void onKill(Game::CreatureKillArg*);
void onSetPositionPost(Vector3f&);
void onSlotStickEnd(Game::Creature*, short);
void onSlotStickStart(Game::Creature*, short);
void onStartCapture();
void onStickEnd(Game::Creature*);
void onStickEndSelf(Game::Creature*);
void onStickStart(Game::Creature*);
void onStickStartSelf(Game::Creature*);
void onUpdateCapture(struct Matrixf&);
void outWaterCallback();
void platCallback(Game::PlatEvent&);
void releaseAllStickers();
void resolveOneColl(CollPart*, CollPart*, Vector3f&);
void save(Stream&, unsigned char);
void setAlive(bool);
void setAtari(bool);
void setCollisionFlick(bool);
void setDebugCollision(bool);
void setMovieMotion(bool);
void setPosition(Vector3f&, bool);
void sound_culling();
void startCapture(Matrixf*);
void startPick();
void startStick(Game::Creature*, CollPart*);
void startStick(Game::Creature*, short);
void startStickMouth(Game::Creature*, CollPart*);
void stimulate(Game::Interaction&);
void updateCapture(Matrixf&);
void updateCell();
void updateLOD(Game::AILODParm&);
void updateStick(Vector3f&);
Matrixf* m_captureMatrix; // _0B8
union {
u8 byteView[4];
// Use this with CreatureFlags.
u32 intView;
// The following bitfield is here for mod usage.
// Vanilla seems to just use the previous 2 representations.
// u32 m_isDebugCollision : 1, : 24, m_isMovieExtra : 1,
// m_isMovieMotion : 1, m_isMovieActor : 1, padding2 : 1,
// m_isCollisionFlick : 1, m_isAlive : 1, m_isAtari : 1;
} m_flags; // _0BC
Parameters* m_parms; // _0C0
Generator* m_generator; // _0C4
int _0C8; // _0C8
Vector3f m_collisionPosition; // _0CC
AILOD m_lod; // _0D8
int m_cellLayerIndex; // _0DC
Recti m_cellRect; // _0E0
Creature* m_sticked; // _0F0
Creature* m_sticker; // _0F4
CollPart* _0F8; // _0F8
Creature* m_captured; // _0FC
Creature* m_capture; // _100
Vector3f _104; // _104
short m_hasStick; // _110
CollTree* m_collTree; // _114
float _118; // _118
Vector3f _11C; // _11C
ushort m_objectTypeID; // _128
UpdateContext m_updateContext; // _12C
Matrixf m_mainMatrix; // _138
Vector3f m_scale; // _168 /* Not sure if just model scale. */
SysShape::Model* m_model; // _174
};
} // namespace Game

View File

@ -3,127 +3,132 @@
#include "Game/AILODParm.h"
#include "Game/Creature.h"
#include "SysShape/Animator.h"
#include "Vector3.h"
#include "types.h"
namespace SysShape {
struct KeyEvent;
struct MotionListener {
virtual void onKeyEvent(const KeyEvent&);
};
} // namespace SysShape
namespace Game {
struct EnemyBase : public Creature {
virtual void getPosition(); // _00
virtual void checkCollision(CellObject*); // _04
virtual void getBoundingSphere(Sys::Sphere&); // _08
virtual void collisionUpdatable(); // _0C
virtual bool isPiki(); // _10
virtual bool isNavi(); // _14
virtual void deferPikiCollision(); // _18
virtual void getTypeName(); // _1C
virtual void getObjType(); // _20
virtual void constructor(); // _24
virtual void onInit(CreatureInitArg*); // _28
virtual void onKill(CreatureKillArg*); // _2C
virtual void onInitPost(CreatureInitArg*); // _30
virtual void doAnimation(); // _34
virtual void doEntry(); // _38
virtual void doSetView(int); // _3C
virtual void doViewCalc(); // _40
virtual void doSimulation(float); // _44
virtual void doDirectDraw(Graphics&); // _48
virtual void getBodyRadius(); // _4C
virtual void getCellRadius(); // _50
virtual void initPosition(Vector3f&); // _54
virtual void onInitPosition(Vector3f&); // _58
virtual void getFaceDir(); // _5C
virtual void setVelocity(Vector3f&); // _60
virtual void getVelocity(); // _64
virtual void onSetPosition(Vector3f&); // _68
virtual void onSetPositionPost(Vector3f&); // _6C
virtual void updateTrMatrix(); // _70
virtual bool isTeki(); // _74
virtual bool isPellet(); // _78
virtual void inWaterCallback(WaterBox*); // _7C
virtual void outWaterCallback(); // _80
virtual void inWater(); // _84
virtual void getFlockMgr(); // _88
virtual void onStartCapture(); // _8C
virtual void onUpdateCapture(Matrixf&); // _90
virtual void onEndCapture(); // _94
virtual bool isAtari(); // _98
virtual void setAtari(bool); // _9C
virtual bool isAlive(); // _A0
virtual void setAlive(bool); // _A4
virtual bool isCollisionFlick(); // _A8
virtual void setCollisionFlick(bool); // _AC
virtual bool isMovieActor(); // _B0
virtual bool isMovieExtra(); // _B4
virtual bool isMovieMotion(); // _B8
virtual void setMovieMotion(bool); // _BC
virtual bool isBuried(); // _C0
virtual bool isFlying(); // _C4
virtual bool isUnderground(); // _C8
virtual bool isLivingThing(); // _CC
virtual bool isDebugCollision(); // _D0
virtual void setDebugCollision(bool); // _D4
virtual void doSave(Stream&); // _D8
virtual void doLoad(Stream&); // _DC
virtual void bounceCallback(Sys::Triangle*); // _E0
virtual void collisionCallback(CollEvent&); // _E4
virtual void platCallback(PlatEvent&); // _E8
virtual void getJAIObject(); // _EC
virtual void getPSCreature(); // _F0
virtual void getSound_AILOD(); // _F4
virtual void getSound_PosPtr(); // _F8
virtual void sound_culling(); // _FC
virtual void getSound_CurrAnimFrame(); // _100
virtual void getSound_CurrAnimSpeed(); // _104
virtual void on_movie_begin(bool); // _108
virtual void on_movie_end(bool); // _10C
virtual void movieStartAnimation(unsigned long); // _110
virtual void movieStartDemoAnimation(SysShape::AnimInfo*); // _114
virtual void movieSetAnimationLastFrame(); // _118
virtual void movieSetTranslation(Vector3f&, float); // _11C
virtual void movieSetFaceDir(float); // _120
virtual void movieGotoPosition(Vector3f&); // _124
virtual void movieUserCommand(unsigned long, MoviePlayer*); // _128
virtual void getShadowParam(ShadowParam&); // _12C
virtual void needShadow(); // _130
virtual void getLifeGaugeParam(LifeGaugeParam&); // _134
virtual void getLODSphere(Sys::Sphere&); // _138
virtual void getLODCylinder(Sys::Cylinder&); // _13C
virtual void startPick(); // _140
virtual void endPick(bool); // _144
virtual void getMabiki(); // _148
virtual void getFootmarks(); // _14C
virtual void onStickStart(Creature*); // _150
virtual void onStickEnd(Creature*); // _154
virtual void onStickStartSelf(Creature*); // _158
virtual void onStickEndSelf(Creature*); // _15C
virtual bool isSlotFree(short); // _160
virtual void getFreeStickSlot(); // _164
virtual void getNearFreeStickSlot(Vector3f&); // _168
virtual void getRandomFreeStickSlot(); // _16C
virtual void onSlotStickStart(Creature*, short); // _170
virtual void onSlotStickEnd(Creature*, short); // _174
virtual void calcStickSlotGlobal(short, Vector3f&); // _178
virtual void getVelocityAt(Vector3f&, Vector3f&); // _17C
virtual void getAngularEffect(Vector3f&, Vector3f&); // _180
virtual void applyImpulse(Vector3f&, Vector3f&); // _184
virtual void ignoreAtari(Creature*); // _188
virtual void getSuckPos(); // _18C
virtual void getGoalPos(); // _190
virtual bool isSuckReady(); // _194
virtual bool isSuckArriveWait(); // _198
virtual void stimulate(Interaction&); // _19C
virtual void getCreatureName(); // _1A0
virtual void getCreatureID(); // _1A4
virtual void _1B0(); // _1A8
struct EnemyInitialParamBase;
struct EnemyBase : public Creature, SysShape::MotionListener {
virtual Vector3f getPosition(); // _00
virtual void checkCollision(CellObject*); // _04
virtual void getBoundingSphere(Sys::Sphere&); // _08
virtual bool collisionUpdatable(); // _0C
virtual bool isPiki(); // _10
virtual bool isNavi(); // _14
virtual bool deferPikiCollision(); // _18
virtual char* getTypeName(); // _1C
virtual u8 getObjType(); // _20
virtual void constructor(); // _24
virtual void onInit(CreatureInitArg*); // _28
virtual void onKill(CreatureKillArg*); // _2C
virtual void onInitPost(CreatureInitArg*); // _30
virtual void doAnimation(); // _34
virtual void doEntry(); // _38
virtual void doSetView(int); // _3C
virtual void doViewCalc(); // _40
virtual void doSimulation(float); // _44
virtual void doDirectDraw(Graphics&); // _48
virtual float getBodyRadius(); // _4C
virtual float getCellRadius(); // _50
virtual void initPosition(Vector3f&); // _54
virtual void onInitPosition(Vector3f&); // _58
virtual float getFaceDir(); // _5C
virtual void setVelocity(Vector3f&); // _60
virtual Vector3f getVelocity(); // _64
virtual void onSetPosition(Vector3f&); // _68
virtual void onSetPositionPost(Vector3f&); // _6C
virtual void updateTrMatrix(); // _70
virtual bool isTeki(); // _74
virtual bool isPellet(); // _78
virtual void inWaterCallback(WaterBox*); // _7C
virtual void outWaterCallback(); // _80
virtual bool inWater(); // _84
virtual void getFlockMgr(); // _88
virtual void onStartCapture(); // _8C
virtual void onUpdateCapture(Matrixf&); // _90
virtual void onEndCapture(); // _94
virtual bool isAtari(); // _98
virtual void setAtari(bool); // _9C
virtual bool isAlive(); // _A0
virtual void setAlive(bool); // _A4
virtual bool isCollisionFlick(); // _A8
virtual void setCollisionFlick(bool); // _AC
virtual bool isMovieActor(); // _B0
virtual bool isMovieExtra(); // _B4
virtual bool isMovieMotion(); // _B8
virtual void setMovieMotion(bool); // _BC
virtual bool isBuried(); // _C0
virtual bool isFlying(); // _C4
virtual bool isUnderground(); // _C8
virtual bool isLivingThing(); // _CC
virtual bool isDebugCollision(); // _D0
virtual void setDebugCollision(bool); // _D4
virtual void doSave(Stream&); // _D8
virtual void doLoad(Stream&); // _DC
virtual void bounceCallback(Sys::Triangle*); // _E0
virtual void collisionCallback(CollEvent&); // _E4
virtual void platCallback(PlatEvent&); // _E8
virtual void getJAIObject(); // _EC
virtual PSM::Creature* getPSCreature(); // _F0
virtual void getSound_AILOD(); // _F4
virtual Vector3f* getSound_PosPtr(); // _F8
virtual bool sound_culling(); // _FC
virtual float getSound_CurrAnimFrame(); // _100
virtual float getSound_CurrAnimSpeed(); // _104
virtual void on_movie_begin(bool); // _108
virtual void on_movie_end(bool); // _10C
virtual void movieStartAnimation(unsigned long); // _110
virtual void movieStartDemoAnimation(SysShape::AnimInfo*); // _114
virtual void movieSetAnimationLastFrame(); // _118
virtual void movieSetTranslation(Vector3f&, float); // _11C
virtual void movieSetFaceDir(float); // _120
virtual void movieGotoPosition(Vector3f&); // _124
virtual void movieUserCommand(unsigned long, MoviePlayer*); // _128
virtual void getShadowParam(ShadowParam&); // _12C
virtual bool needShadow(); // _130
virtual void getLifeGaugeParam(LifeGaugeParam&); // _134
virtual void getLODSphere(Sys::Sphere&); // _138
virtual void getLODCylinder(Sys::Cylinder&); // _13C
virtual void startPick(); // _140
virtual void endPick(bool); // _144
virtual u32* getMabiki(); // _148
virtual Footmarks* getFootmarks(); // _14C
virtual void onStickStart(Creature*); // _150
virtual void onStickEnd(Creature*); // _154
virtual void onStickStartSelf(Creature*); // _158
virtual void onStickEndSelf(Creature*); // _15C
virtual bool isSlotFree(short); // _160
virtual int getFreeStickSlot(); // _164
virtual int getNearFreeStickSlot(Vector3f&); // _168
virtual int getRandomFreeStickSlot(); // _16C
virtual void onSlotStickStart(Creature*, short); // _170
virtual void onSlotStickEnd(Creature*, short); // _174
virtual void calcStickSlotGlobal(short, Vector3f&); // _178
virtual void getVelocityAt(Vector3f&, Vector3f&); // _17C
virtual void getAngularEffect(Vector3f&, Vector3f&); // _180
virtual void applyImpulse(Vector3f&, Vector3f&); // _184
virtual bool ignoreAtari(Creature*); // _188
virtual void getSuckPos(); // _18C
virtual void getGoalPos(); // _190
virtual bool isSuckReady(); // _194
virtual bool isSuckArriveWait(); // _198
virtual void stimulate(Interaction&); // _19C
virtual char* getCreatureName(); // _1A0
virtual s32 getCreatureID(); // _1A4
// VTBL 2
virtual ~EnemyBase(); // _1AC
virtual void birth(Vector3f&, float); // _1B0
virtual void _1BC() = 0; // _1B4
virtual void SetInitialSetting(EnemyInitialParamBase*) = 0; // _1B4
virtual void update(); // _1B8
virtual void _1C4() = 0; // _1BC
virtual void doUpdate() = 0; // _1BC
virtual void doUpdateCommon(); // _1C0
virtual void doUpdateCarcass(); // _1C4
virtual void doAnimationUpdateAnimator(); // _1C8
@ -158,7 +163,7 @@ struct EnemyBase : public Creature {
virtual void updateEfxHamon(); // _23C
virtual void createEfxHamon(); // _240
virtual void fadeEfxHamon(); // _244
virtual void _250() = 0; // _248
virtual s32 getEnemyTypeID() = 0; // _248
virtual void getMouthSlots(); // _24C
virtual void doGetLifeGaugeParam(LifeGaugeParam&); // _250
virtual void throwupItem(); // _254

View File

@ -25,20 +25,32 @@ struct GameSystem : public NodeObjectMgr<GenericObjectMgr> {
GameSystem(Game::BaseGameSection*);
~GameSystem();
virtual void doAnimation(); // _00
virtual void doEntry(); // _04
virtual void doSetView(int); // _08
virtual void doViewCalc(); // _0C
virtual void doSimulation(float); // _10
virtual void doDirectDraw(Graphics&); // _14
virtual void doSimpleDraw(Viewport*); // _18
virtual void loadResources(); // _1C
virtual void resetMgr(); // _20
virtual bool pausable(); // _24
virtual bool frozenable(); // _28
virtual u32 getMatrixLoadType(); // _2C
virtual void startFrame(); // _78
virtual void endFrame(); // _7C
virtual void directDraw(Graphics&); // _84
virtual void startFadeout(float); // _88
virtual void startFadein(float); // _8C
virtual void startFadeoutin(float); // _90
virtual void startFadeblack(); // _94
virtual void startFadewhite(); // _98
void addObjectMgr_reuse(TObjectNode<GenericObjectMgr>*);
void addObjectMgr(GenericObjectMgr*);
s32 calcFrameDist(int);
void detachObjectMgr_reuse(GenericObjectMgr*);
void detachObjectMgr(GenericObjectMgr*);
void directDraw(Graphics&);
void doAnimation();
void doDirectDraw(Graphics&);
void doEntry();
void doSetView(int);
void doSimpleDraw(Viewport*);
void doSimulation(float);
void doViewCalc();
void endFrame();
void getLightMgr();
void init();
void isZukanMode();
@ -48,12 +60,6 @@ struct GameSystem : public NodeObjectMgr<GenericObjectMgr> {
void setFrozen(bool, char*);
void setMoviePause(bool, char*);
void setPause(bool, char*, int);
void startFadeblack();
void startFadein(float);
void startFadeout(float);
void startFadeoutin(float);
void startFadewhite();
void startFrame();
void startPause(bool, int, char*);
u8 _3C; // _3C /* bitfield */

View File

@ -7,18 +7,18 @@ struct Graphics;
struct Viewport;
struct GenericObjectMgr {
virtual void doAnimation();
virtual void doEntry();
virtual void doSetView(int);
virtual void doViewCalc();
virtual void doSimulation(float);
virtual void doDirectDraw(Graphics&);
virtual void doSimpleDraw(Viewport*);
virtual void loadResources();
virtual void resetMgr();
virtual bool pausable();
virtual bool frozenable();
virtual u32 getMatrixLoadType();
virtual void doAnimation() = 0; // _00
virtual void doEntry(); // _04
virtual void doSetView(int) = 0; // _08
virtual void doViewCalc() = 0; // _0C
virtual void doSimulation(float) = 0; // _10
virtual void doDirectDraw(Graphics&) = 0; // _14
virtual void doSimpleDraw(Viewport*); // _18
virtual void loadResources(); // _1C
virtual void resetMgr(); // _20
virtual bool pausable(); // _24
virtual bool frozenable(); // _28
virtual u32 getMatrixLoadType(); // _2C
};
#endif

View File

@ -1,8 +1,9 @@
#ifndef _STATEMACHINE_H
#define _STATEMACHINE_H
#ifndef _GAME_STATEMACHINE_H
#define _GAME_STATEMACHINE_H
#include "types.h"
namespace Game {
template <typename T> struct StateMachine;
struct StateArg {
@ -45,5 +46,6 @@ template <typename T> struct StateMachine {
// ID of current (active) state.
int m_currentID; // _18
};
} // namespace Game
#endif

35
include/Game/THPPlayer.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef _GAME_THPPLAYER_H
#define _GAME_THPPLAYER_H
#include "types.h"
#include "CNode.h"
#include "DvdThreadCommand.h"
#include "IDelegate.h"
#include "JSystem/JKR/JKRDisposer.h"
namespace Caption {
struct Mgr;
}
namespace Game {
struct THPPlayer : public JKRDisposer, public CNode {
int _30; // _30
long _34; // _34
void* m_videoInfo; // _38
u8 _3C[8]; // _3C
void* m_audioInfo; // _44
u8 _48[8]; // _48
uint _50; // _50
Caption::Mgr* m_captionMgr; // _54
JKRHeap* _58; // _58
DvdThreadCommand m_threadCommand; // _5C
Delegate<THPPlayer> _C8; // _C8
char* m_thpFilePath; // _DC
char* m_iniFilePath; // _E0
u8 _E4; // _E4
u32 : 0; // reset alignment
u8 _E8; // _E8
};
} // namespace Game
#endif

View File

@ -2,11 +2,28 @@
#define _GAME_VSGAMESECTION_H
#include "types.h"
#include "Game/BaseGameSection.h"
#include "Vector3.h"
namespace Game {
struct VsGameSection {
struct PikiContainer;
struct MovieConfig;
namespace ItemHole {
struct Item;
} // namespace ItemHole
namespace ItemBigFountain {
struct Item;
} // namespace ItemBigFountain
struct VsGameSection : public BaseGameSection {
struct DropCardArg {
};
VsGameSection(JKRHeap*, bool);
~VsGameSection();
virtual ~VsGameSection();
void addChallengeScore(int);
void calcVsScores();
@ -14,13 +31,13 @@ struct VsGameSection {
void clearCaveMenus();
void clearGetCherryCount();
void clearGetDopeCount();
void createFallPikmins(Game::PikiContainer&, int);
void createRedBlueBedamas(Vector3<float>&);
void createFallPikmins(PikiContainer&, int);
void createRedBlueBedamas(Vector3f&);
void createVsPikmins();
void createYellowBedamas(int);
void doDraw(Graphics&);
void doUpdate();
void dropCard(void DropCardArg&);
virtual bool doUpdate();
void dropCard(DropCardArg&);
void getCaveFilename();
void getCurrFloor();
void getEditorFilename();
@ -28,7 +45,7 @@ struct VsGameSection {
void getVsEditNumber();
void gmOrimaDown(int);
void gmPikminZero();
void goNextFloor(Game::ItemHole::Item*);
void goNextFloor(ItemHole::Item*);
void initCardGeneration();
void initCardPellets();
void initPlayData();
@ -36,17 +53,17 @@ struct VsGameSection {
void loadVsStageList();
void onClearHeap();
void onInit();
void onMovieDone(Game::MovieConfig*, unsigned long, unsigned long);
void onMovieStart(Game::MovieConfig*, unsigned long, unsigned long);
void onMovieDone(MovieConfig*, ulong, ulong);
void onMovieStart(MovieConfig*, ulong, ulong);
void onSetSoundScene();
void onSetupFloatMemory();
void openCaveMoreMenu(Game::ItemHole::Item*, Controller*);
void openKanketuMenu(Game::ItemBigFountain::Item*, Controller*);
void openCaveMoreMenu(ItemHole::Item*, Controller*);
void openKanketuMenu(ItemBigFountain::Item*, Controller*);
void player2enabled();
void postSetupFloatMemory();
void pre2dDraw(Graphics&);
void section_fadeout();
void sendMessage(Game::GameMessage&);
void sendMessage(GameMessage&);
void startMainBgm();
void updateCardGeneration();
void updateCaveMenus();

View File

@ -17,6 +17,8 @@ struct Generator : public CNode {
virtual void doSetView(int); // _10
virtual void doViewCalc(); // _14
void informDeath(Creature*);
u32* _18; // _18
u32 _1C; // _1C /* Initialized to '____' */
char _20[32]; // _20

View File

@ -3,26 +3,31 @@
#include "types.h"
struct SectionInfo;
struct ISection;
struct Section;
struct JKRHeap;
struct ISectionMgr {
ISectionMgr() { }
virtual void run() = 0;
virtual void getCurrentSection();
virtual ISection* getCurrentSection();
};
struct GameFlow : public ISectionMgr {
GameFlow();
virtual void run();
virtual void getCurrentSection();
virtual ISection* getCurrentSection();
void setSection();
void getSectionInfo(int);
SectionInfo* getSectionInfo(int);
static void createSection(struct JKRHeap*);
static ISection* createSection(JKRHeap*);
static u32 mActiveSectionFlag;
struct Section* m_section; // _04
Section* m_section; // _04
};
#endif

View File

@ -2,11 +2,24 @@
#define _GRAPHICS_H
#include "types.h"
#include "Dolphin/gx.h"
#include "Matrixf.h"
#include "JSystem/J2D/J2DGrafContext.h"
struct Color4;
template <typename T> struct IDelegate1;
template <typename A, typename B> struct IDelegate2;
struct JUTTexture;
struct PerspPrintfInfo;
struct Plane;
template <typename T> struct Rect;
typedef Rect<float> Rectf;
struct Viewport;
namespace Sys {
struct Sphere;
}
struct _GraphicsParent {
ushort m_primitiveDrawCount; // _000
char* m_tokens[0x20]; // _004
@ -26,6 +39,7 @@ struct _GraphicsParent {
// Size: 0x2A0
struct Graphics : public _GraphicsParent {
Graphics();
virtual void doJ3DDrawInit(); // _00
virtual void doJ3DDraw(int); // _04
virtual void doJ3DFrameInit(); // _08
@ -35,6 +49,69 @@ struct Graphics : public _GraphicsParent {
virtual void doJ3DViewCalc(); // _18
virtual void _1C() = 0; // _1C
void allocateViewports(int);
void addViewport(Viewport*);
void deleteViewports();
int getNumActiveViewports();
Viewport* getViewport(int);
void mapViewport(IDelegate1<Viewport*>*);
void mapViewport(IDelegate2<Graphics&, Viewport*>*);
void renderJ3D();
void updateJ3D();
int findTokenIndex(char*);
ushort getToken();
char* getTokenName(ushort);
void graphicsTokenCallback(ushort);
void setToken(char*);
void drawAxis(float, Matrixf*);
void drawBox(Vector3f&, Vector3f*, float*, float*);
void drawBox(Vector3f&, Vector3f&, Vector3f&, Vector3f&);
void drawCone(Vector3f&, Vector3f&, float, int);
void drawCylinder(Vector3f&, Vector3f&, float);
void drawLine(Vector3f&, Vector3f&);
void drawMarker(float, Matrixf*);
void drawMesh(Matrixf*);
void drawPlane(Plane&, float);
void drawPoint(Vector3f&);
void drawPoint(Vector3f*, ushort);
void drawRect(Rectf&, Color4&);
void drawRect(Rectf&, JUTTexture*);
void drawRectangle(Rectf&, bool);
void drawSphere(Vector3f&, float);
void drawSphere(float, Matrixf*);
void drawTexture(JUTTexture*, float, float, float, float);
void drawTile(Sys::Sphere&, Sys::Sphere&, JUTTexture*);
void drawTube(Vector3f&, Vector3f&, float, float);
void initPrimDraw(Matrixf*);
void loadPrimViewMtx();
void clearZBuffer(Rectf&);
void fillZBuffer(Rectf&, float);
void initJ2DOrthoGraph(J2DOrthoGraph*);
void initJ2DPerspGraph(J2DPerspGraph*);
void setupJ2DOrthoGraphDefault();
void setupJ2DPerspGraphDefault();
void clearVtxDesc();
void setVtxDesc(_GXAttr, _GXAttrType);
void setVtxAttrFmt(_GXVtxFmt, _GXAttr, _GXCompCnt, _GXCompType, uchar);
void disableLight();
void disableTexture();
void setTextureGX();
void initPerspPrintf(Viewport*);
void perspPrintf(PerspPrintfInfo&, Vector3f&, char*, ...);
void initGX();
void dirtyInitGX();
void clearInitGX();
// _GraphicsParent _000
// VTBL _26C
u8 _270[0x30]; // _270

View File

@ -1,42 +0,0 @@
#ifndef _JSYSTEM_JSUINPUTSTREAM_H
#define _JSYSTEM_JSUINPUTSTREAM_H
#include "types.h"
typedef ulong JSUStreamSeekFrom;
struct JKRFile;
struct JSUInputStream {
virtual ~JSUInputStream(); // _00
virtual u8 getAvailable() = 0; // _04
virtual u8 skip(long); // _08
virtual size_t readData(void*, long) = 0; // _0C
virtual int getLength() = 0; // _10
u8 read(void*, long);
u8 read(char*);
// VTBL _00
u8 m_isEOFMaybe; // _04
};
struct JSUMemoryInputStream : public JSUInputStream {
virtual int getPosition();
virtual u8 seekPos(long, JSUStreamSeekFrom);
JKRFile* file; // _08 /* This might be more general at this point in the chain? */
int m_length; // _0C
int m_position; // _10
};
struct JSURandomInputStream : public JSUMemoryInputStream {
void seek(long, JSUStreamSeekFrom);
};
// Size: 0x10
struct JSUFileInputStream : public JSURandomInputStream {
};
#endif

View File

@ -0,0 +1,80 @@
#ifndef _JSYSTEM_JSUINPUTSTREAM_H
#define _JSYSTEM_JSUINPUTSTREAM_H
#include "types.h"
struct JKRFile;
// Named after standard C++ constants with the exact same meaning.
// (Except _FORCE_UINT, of course.)
enum JSUStreamSeekFrom {
SEEK_SET = 0,
SEEK_CUR,
SEEK_END,
_SEEK_FORCE_UINT = 0xFFFFFFFF
};
struct JSUIosBase {
inline JSUIosBase()
: m_isEOFMaybe(0) {};
virtual ~JSUIosBase(); //_00
// VTBL _00
u8 m_isEOFMaybe; // _04
};
struct JSUInputStream : public JSUIosBase {
virtual ~JSUInputStream(); // _00
virtual u8 getAvailable() = 0; // _04
virtual void skip(long); // _08
virtual size_t readData(void*, long) = 0; // _0C
virtual int getLength() const = 0; // _10
void read(void*, long);
void read(char*);
};
struct JSUMemoryInputStream : public JSUInputStream {
virtual ~JSUMemoryInputStream(); // _00
virtual size_t readData(void*, long); // _0C
virtual int getLength() const; // _10
virtual int getPosition() const; // _14
virtual int seekPos(long, JSUStreamSeekFrom); // _18
void setBuffer(const void*, long);
void* m_object; // _08
long m_length; // _0C
int m_position; // _10
};
struct JSURandomInputStream : public JSUMemoryInputStream {
virtual ~JSURandomInputStream(); // _00
virtual void skip(long); // _08
uint align(long);
size_t peek(void*, long);
void seek(long, JSUStreamSeekFrom);
};
// Size: 0x10
struct JSUFileInputStream : public JSURandomInputStream {
JSUFileInputStream(JKRFile*);
virtual size_t readData(void*, long); // _0C
virtual int getLength() const; // _10
virtual int getPosition() const; // _14
virtual int seekPos(long, JSUStreamSeekFrom); // _18
};
/* Not much remains of this. */
struct JSUOutputStream : public JSUIosBase {
/* No calls to this appear to have survived. */
virtual void _04(); // _04
/* Just a guess. No instances of this survived in vanilla. */
virtual long writeData(const void*, long) = 0; // _08
void write(const void*, long);
void write(const char*);
};
#endif

View File

@ -1,7 +1,23 @@
#ifndef _JSYSTEM_JUT_JUTFONT_H
#define _JSYSTEM_JUT_JUTFONT_H
#include "JSystem/JUtility.h"
struct JUTFont {
JUTFont();
// TODO: Finish VTBL.
virtual ~JUTFont(); // _00
virtual float getCellWidth() const;
virtual float getCellHeight() const;
void initialize_state();
void setCharColor(JUtility::TColor);
void setGradColor(JUtility::TColor, JUtility::TColor);
void drawString_size_scale(float, float, float, float, const char*, ulong,
bool);
void setGX(JUtility::TColor, JUtility::TColor);
// TODO: Finish data members
};
#endif

View File

@ -5,10 +5,29 @@
namespace JUtility {
struct TColor {
u8 r;
u8 g;
u8 b;
u8 a;
TColor() {};
inline TColor(u8 red, u8 green, u8 blue, u8 alpha)
{
channels.r = red;
channels.g = green;
channels.b = blue;
channels.a = alpha;
}
inline TColor(u32 value) { asU32 = value; }
union {
u32 asU32;
struct {
u8 r, g, b, a;
} channels;
// u8 r: 8, g : 8, b : 8, a : 8;
};
// u32 asU32;
// struct {
// u8 r;
// u8 g;
// u8 b;
// u8 a;
// };
};
} // namespace JUtility

View File

@ -11,7 +11,20 @@ struct Matrixf {
void makeSRT(Vector3f&, Vector3f&, Vector3f&);
f32 m_matrix[3][4];
union {
f32 mtxView[3][4];
struct {
f32 x[4];
f32 y[4];
f32 z[4];
} vecView;
struct {
float xx, yx, zx, tx;
float xy, yy, zy, ty;
float xz, yz, zz, tz;
} structView;
} m_matrix;
// f32 m_matrix[3][4];
};
// sizeof is 48
#endif

View File

@ -5,6 +5,15 @@
#include "Game/GenericObjectMgr.h"
template <typename T> struct ObjectMgr : public Container<T>, GenericObjectMgr {
// first VTBL:
virtual ~ObjectMgr(); // _00
// second VTBL:
virtual void doAnimation(); // _00
virtual void doEntry(); // _04
virtual void doSetView(int); // _08
virtual void doViewCalc(); // _0C
virtual void doSimulation(float); // _10
virtual void doDirectDraw(Graphics&); // _14
};
template <typename T> struct TObjectNode : public CNode {
@ -12,7 +21,18 @@ template <typename T> struct TObjectNode : public CNode {
};
template <typename T> struct NodeObjectMgr : public ObjectMgr<T> {
TObjectNode<T> m_node; // _20
// first VTBL:
virtual ~NodeObjectMgr();
virtual int getNext(int);
virtual int getStart();
virtual int getEnd();
virtual T* get(int);
// second VTBL:
virtual void resetMgr(); // _20
// TODO: Remove this once the VTBLs work properly
u32 _1C_REMOVE_ME_PLEASE; // _1C
TObjectNode<T> m_node; // _20
};
#endif

View File

@ -8,7 +8,7 @@ struct MenuSection : public Section {
virtual ~MenuSection() { }
virtual void run();
virtual void getCurrentSection();
virtual Section* getCurrentSection();
};
struct RootMenuSection : public MenuSection {

View File

@ -1,36 +1,61 @@
#ifndef _SECTION_H
#define _SECTION_H
struct ISection {
virtual ~ISection();
#include "JSystem/JKR/JKRDisposer.h"
virtual void run() = 0;
virtual void update() = 0;
virtual void draw(struct Graphics&) = 0;
struct Graphics;
struct JFWDisplay;
struct JKRHeap;
struct JUTFader;
struct ISection : public JKRDisposer {
virtual ~ISection(); // _00
virtual void run() = 0; // _04
virtual void update() = 0; // _08
virtual void draw(Graphics&) = 0; // _0C
virtual void init() = 0; // _10
};
struct Section : public ISection /*, public JKRDisposer*/ {
struct Section : public ISection {
enum EDrawInitMode { One };
virtual ~Section();
Section(JFWDisplay*, JKRHeap*, bool);
virtual void run();
virtual void update();
virtual void draw(struct Graphics&);
virtual void init();
virtual void drawInit(Graphics&);
virtual void drawInit(Graphics&, Section::EDrawInitMode);
virtual void doExit();
virtual void forceFinish();
virtual void forceReset();
virtual void getCurrentSection();
virtual void doLoadingStart();
virtual void doLoading();
virtual ~Section(); // _00
virtual void run(); // _04
virtual void update(); // _08
virtual void draw(Graphics&); // _0C
virtual void init(); // _10
virtual void drawInit(Graphics&); // _14
virtual void drawInit(Graphics&, EDrawInitMode); // _18
virtual void doExit(); // _1C
virtual bool forceFinish(); // _20
virtual bool forceReset(); // _24
virtual Section* getCurrentSection(); // _28
virtual void doLoadingStart(); // _2C
virtual bool doLoading(); // _30
virtual bool doUpdate() = 0; // _34
virtual void doDraw(Graphics&) = 0; // _38
virtual bool isFinishable(); // _3C
virtual bool doUpdate() = 0;
virtual void doDraw(Graphics&) = 0;
bool beginFrame();
void beginRender();
void endFrame();
void endRender();
void exit();
virtual void isFinishable();
u32 _18; // _18
JKRHeap* _1C; // _1C
JKRHeap* _20; // _20
JFWDisplay* m_display; // _24
JUTFader* m_fader; // _28
Graphics* m_graphics; // _2C
float _30; // _30
u8 _34; // _34
u8 _35; // _35
u8 _36; // _36
u8 m_isFinishedMaybe; // _37
u8 _38; // _38
};
#endif

45
include/Title.h Normal file
View File

@ -0,0 +1,45 @@
#ifndef _TITLE_H
#define _TITLE_H
// Header for entire Demo namespace.
#include "DvdThreadCommand.h"
#include "Game/BaseHIOSection.h"
#include "ebi/Omake.h"
#include "ebi/Option.h"
#include "ebi/TMainTitleMgr.h"
template <typename T> struct IDelegate1;
struct JUTTexture;
struct Menu;
namespace Game {
struct THPPlayer;
}
namespace Title {
// Size: 0x1B0
struct Section : public Game::BaseHIOSection {
Section(JKRHeap*);
int _48; // _0048
float _4C; // _004C
Menu* _50; // _0050
DvdThreadCommand m_threadCommand; // _0054
IDelegate1<Section>* _C0; // _00C0
Controller* _C4; // _00C4
Controller* _C8; // _00C8
ebi::TMainTitleMgr m_mainTitleMgr; // _00CC
ebi::Option::TMgr m_optionMgr; // _1730
u8 _2670[8]; // _2670
ebi::Omake::TMgr m_omakeMgr; // _2678
u8 _2F34[8]; // _2F34
Game::THPPlayer* m_thpPlayer; // _2F38
int m_movieIndex; // _2F3C
JKRArchive* _2F40; // _2F40
u8 _2F44; // _2F44
u8 _2F48[8]; // _2F48
};
} // namespace Title
#endif

View File

@ -2,11 +2,18 @@
#define _VECTOR3_H
#include "stream.h"
#include "Dolphin/math.h"
#include "sysMath.h"
template <typename T> struct Vector3 {
T x, y, z;
inline Vector3() {};
Vector3(const Vector3<T>&);
inline Vector3(const Vector3<T>& other)
{
x = other.x;
y = other.y;
z = other.z;
}
inline Vector3& operator=(Vector3& other)
{
@ -16,15 +23,26 @@ template <typename T> struct Vector3 {
return *this;
}
void operator=(const Vector3<T>&);
inline void operator=(const Vector3<T>& other)
{
x = other.x;
y = other.y;
z = other.z;
}
inline T distance(Vector3<T>&);
void length() const;
void normalise();
float normalise();
void read(Stream&);
void write(Stream&);
static Vector3<T> zero;
};
// template <> struct Vector3<float> {
// static Vector3<float> zero;
// };
// Use instead of Vector3<float> or Vector3<f32>
typedef Vector3<float> Vector3f;

172
include/ebi/Omake.h Normal file
View File

@ -0,0 +1,172 @@
#ifndef _EBI_OMAKE_H
#define _EBI_OMAKE_H
#include "types.h"
#include "ebi/Screen/TScreenBase.h"
#include "Game/StateMachine.h"
struct Controller;
namespace ebi {
namespace Omake {
struct TMgr;
} // namespace Omake
} // namespace ebi
/*
* FSM template specializations
*/
namespace Game {
template <> struct FSMState<ebi::Omake::TMgr> {
virtual void init(ebi::Omake::TMgr*, StateArg*); // _00
virtual void exec(ebi::Omake::TMgr*); // _04
virtual void cleanup(ebi::Omake::TMgr*); // _08
virtual void resume(ebi::Omake::TMgr*); // _0C
virtual void restart(ebi::Omake::TMgr*); // _10
virtual void transit(ebi::Omake::TMgr*, StateArg*); // _14
};
template <> struct StateMachine<ebi::Omake::TMgr> {
virtual void init(ebi::Omake::TMgr*); // _00
virtual u32 start(ebi::Omake::TMgr*, int, StateArg*); // _04
virtual void exec(ebi::Omake::TMgr*); // _08
virtual void transit(ebi::Omake::TMgr*, int, StateArg*); // _0C
};
} // namespace Game
namespace ebi {
/*
* Omake Screens
*/
namespace Screen {
struct ArgOpenOmake : public ArgOpen {
virtual char* getName();
};
struct TOmake : public TScreenBase {
TOmake();
~TOmake();
virtual void doSetArchive(JKRArchive*); // _1C
virtual void doOpenScreen(ArgOpen*); // _20
virtual void doCloseScreen(ArgClose*); // _24
virtual void doInitWaitState(); // _2C
virtual bool doUpdateStateOpen(); // _30
virtual bool doUpdateStateWait(); // _34
virtual bool doUpdateStateClose(); // _38
virtual void doDraw(); // _3C
virtual char* getName(); // _40
void hidePanes() const;
void openFromCardE() const;
void openFromMovie() const;
void setController(Controller*);
void showPanes() const;
// TODO: Data members.
u8 _0C[0x454];
};
struct TOmakeCardE : public TScreenBase {
TOmakeCardE();
~TOmakeCardE();
virtual void doSetArchive(JKRArchive*); // _1C
virtual void doOpenScreen(ArgOpen*); // _20
virtual void doCloseScreen(ArgClose*); // _24
virtual void doInitWaitState(); // _2C
virtual bool doUpdateStateOpen(); // _30
virtual bool doUpdateStateWait(); // _34
virtual bool doUpdateStateClose(); // _38
virtual void doDraw(); // _3C
virtual char* getName(); // _40
// virtual void _44(); // _44
// TODO: Data members.
u8 _0C[0x164];
};
struct TOmakeGame : public TScreenBase {
TOmakeGame();
~TOmakeGame();
virtual void doSetArchive(JKRArchive*); // _1C
virtual void doOpenScreen(ArgOpen*); // _20
virtual void doCloseScreen(ArgClose*); // _24
virtual bool doUpdateStateOpen(); // _30
virtual bool doUpdateStateWait(); // _34
virtual bool doUpdateStateClose(); // _38
virtual void doDraw(); // _3C
virtual char* getName(); // _40
// virtual void _44(); // _44
bool isDelegateControl();
bool openMsg(long);
void setController(Controller*);
void setSelfControl();
// TODO: Data members.
u8 _0C[0x2A8];
};
} // namespace Screen
/*
* ebi::Omake::*
*/
namespace Omake {
// TODO: Additional state data members, if any.
struct FSMState : public Game::FSMState<TMgr> {
virtual void init(TMgr*, Game::StateArg*); // _00
virtual void exec(TMgr*); // _04
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_CardEScreen : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_OmakeScreen : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_SelectGame : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMStateMachine : public Game::StateMachine<TMgr> {
virtual void init(TMgr*); // _00
};
struct TMgr {
void draw();
int getMovieID();
int getStateID();
void goEnd() const;
bool isFinish();
bool isMovieState();
void loadResource();
void newCardEMgrAndTask();
void restartFromMovieState();
void start();
void update();
Controller* m_controller; // _000
u8 _004[4]; // _004
ebi::Screen::TOmake m_omake; // _008
ebi::Screen::TOmakeCardE m_omakeCardE; // _468
u8 _5D8[4]; // _5D8
ebi::Screen::TOmakeGame m_omakeGame; // _5DC
u8 _890; // _890
u32 _894; // _894
u32 _898; // _898
FSMStateMachine m_stateMachine; // _89C
u32 _8B8;
};
} // namespace Omake
} // namespace ebi
#endif

156
include/ebi/Option.h Normal file
View File

@ -0,0 +1,156 @@
#ifndef _EBI_OPTION_H
#define _EBI_OPTION_H
#include "types.h"
#include "ebi/Screen/TScreenBase.h"
#include "Game/StateMachine.h"
struct Controller;
namespace ebi {
namespace Option {
struct TMgr;
} // namespace Option
namespace Save {
struct TMgr;
} // namespace Save
} // namespace ebi
/*
* FSM template specializations
*/
namespace Game {
template <> struct FSMState<ebi::Option::TMgr> {
virtual void init(ebi::Option::TMgr*, StateArg*); // _00
virtual void exec(ebi::Option::TMgr*); // _04
virtual void cleanup(ebi::Option::TMgr*); // _08
virtual void resume(ebi::Option::TMgr*); // _0C
virtual void restart(ebi::Option::TMgr*); // _10
virtual void transit(ebi::Option::TMgr*, StateArg*); // _14
};
template <> struct StateMachine<ebi::Option::TMgr> {
virtual void init(ebi::Option::TMgr*); // _00
virtual u32 start(ebi::Option::TMgr*, int, StateArg*); // _04
virtual void exec(ebi::Option::TMgr*); // _08
virtual void transit(ebi::Option::TMgr*, int, StateArg*); // _0C
};
} // namespace Game
namespace ebi {
/*
* Option Screens
*/
namespace Screen {
struct TOptionParameter {
void initParamForTest();
void loadRam();
void saveRam();
u8 _00; // _00
u8 _01; // _01
long _04; // _04
long _08; // _08
long _0C; // _0C
u8 _10; // _10
};
struct TOption : public TScreenBase {
TOption();
~TOption();
virtual void doSetArchive(JKRArchive*); // _1C
virtual void doOpenScreen(ArgOpen*); // _20
virtual void doCloseScreen(ArgClose*); // _24
virtual void doInitWaitState(); // _2C
virtual bool doUpdateStateOpen(); // _30
virtual bool doUpdateStateWait(); // _34
virtual bool doUpdateStateClose(); // _38
virtual void doDraw(); // _3C
virtual char* getName(); // _40
void initScreen() const;
void setOptionParamToScreen() const;
void loadResource();
void setController(Controller*);
// TODO: Data members.
u8 _0C[0xF0C];
};
} // namespace Screen
/*
* ebi::Option::*
*/
namespace Option {
// TODO: Additional state data members, if any.
struct FSMState : public Game::FSMState<TMgr> {
virtual void init(TMgr*, Game::StateArg*); // _00
virtual void exec(TMgr*); // _04
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_LoadOption : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_SaveMgr : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_ScreenClose : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_ScreenOpen : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_ScreenWait : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_WaitCloseForNoCard : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMState_WorldMapInfoWindow : public FSMState {
virtual void do_exec(TMgr*); // _18
virtual void do_init(TMgr*, Game::StateArg*); // _1C
};
struct FSMStateMachine : public Game::StateMachine<TMgr> {
virtual void init(TMgr*); // _00
};
struct TMgr {
TMgr();
~TMgr();
void draw();
int getStateID();
void goEnd() const;
bool isFinish();
void loadResource();
void setController(Controller*);
void start();
void update();
Screen::TOption m_optionScreen; // _000
ebi::Save::TMgr* m_saveTMgr; // _F18
Controller* m_controller; // _F1C
u8 _F20; // _F20
FSMStateMachine m_stateMachine; // _F24
};
} // namespace Option
} // namespace ebi
#endif

View File

@ -22,23 +22,23 @@ namespace Screen {
};
struct TScreenBase {
virtual void setArchive(JKRArchive*);
virtual bool openScreen(ArgOpen*);
virtual bool closeScreen(ArgClose*);
virtual void killScreen();
virtual void update();
virtual void draw();
virtual u8 isFinishScreen();
virtual void doSetArchive(JKRArchive*);
virtual void doOpenScreen(ArgOpen*);
virtual void doCloseScreen(ArgClose*);
virtual void doKillScreen();
virtual void doInitWaitState();
virtual bool doUpdateStateOpen();
virtual bool doUpdateStateWait();
virtual bool doUpdateStateClose();
virtual void doDraw();
virtual char* getName();
virtual void setArchive(JKRArchive*); // _00
virtual bool openScreen(ArgOpen*); // _04
virtual bool closeScreen(ArgClose*); // _08
virtual void killScreen(); // _0C
virtual void update(); // _10
virtual void draw(); // _14
virtual u8 isFinishScreen(); // _18
virtual void doSetArchive(JKRArchive*); // _1C
virtual void doOpenScreen(ArgOpen*); // _20
virtual void doCloseScreen(ArgClose*); // _24
virtual void doKillScreen(); // _28
virtual void doInitWaitState(); // _2C
virtual bool doUpdateStateOpen(); // _30
virtual bool doUpdateStateWait(); // _34
virtual bool doUpdateStateClose(); // _38
virtual void doDraw(); // _3C
virtual char* getName(); // _40
u8 isOpenScreen(void);
u8 isWaitScreen(void);

View File

@ -0,0 +1,13 @@
#ifndef _EBI_TMAINTITLEMGR_H
#define _EBI_TMAINTITLEMGR_H
#include "types.h"
// TODO: Everything.
namespace ebi {
struct TMainTitleMgr {
u8 _00[0x1664]; // _00
};
} // namespace ebi
#endif

View File

@ -105,10 +105,10 @@ namespace Screen {
virtual ulonglong getMemberID() = 0; // _08
virtual void doSetSubMemberAll(); // _10
bool isID(ScreenOwnerID, ScreenMemberID);
bool isID(ulong, ulonglong);
void getMemberName(char*);
bool setSubMember(DispMemberBase*);
DispMemberBase* getSubMember(ScreenOwnerID, ScreenMemberID);
DispMemberBase* getSubMember(ulong, ulonglong);
void setSubMemberAll();
// inline void getOwnerName(char* outName) {

View File

@ -10,6 +10,7 @@ namespace newScreen {
virtual void end(); // _0C
// _00 VTBL
// TODO: non-virtual functions and data members
};
} // namespace newScreen
} // namespace og

View File

@ -4,32 +4,55 @@
#include "types.h"
struct Stream {
Stream();
Stream(int);
virtual void read(void*, int); // _00
virtual void write(void*, int); // _04
virtual bool eof(); // _08
virtual u32 getPending(); // _0C
void differentEndian();
bool isSpace(char);
void copyToTextBuffer();
void printf(char*, ...);
void skipReading(ulong);
void skipReadingText();
void skipSpace();
void skipPadding(ulong);
char* getNextToken();
void writeByte(unsigned char);
void writeByte(uchar);
void writeShort(short);
void writeInt(int);
void writeFloat(float);
void writeString(char*);
void writeFixedString(char*);
void writePadding(ulong);
u8 readByte();
uchar readByte();
u16 readU16();
float readFloat();
int readInt();
short readShort();
char* readString(char*, int);
char* readFixedString();
void skipReading(u32);
void textBeginGroup(char*);
void textEndGroup();
void textWriteTab(int);
void textWriteText(char*, ...);
u32 m_vtbl; // _000
void _read(void*, int);
void _write(void*, int);
uchar _readByte();
void _writeByte(uchar);
u32 _04; // _004
int m_position; // _008
int m_isTextMode; // _00C
@ -41,9 +64,9 @@ struct Stream {
struct RamStream : Stream {
RamStream(void*, int);
void set(uchar*, int);
void read(void*, int);
void write(void*, int);
bool eof();
virtual void read(void*, int); // _00
virtual void write(void*, int); // _04
virtual bool eof(); // _0C
inline void resetPosition(bool a1, int a2)
{

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "JSystem/J2D/J2DGrafContext.h"
/*
Generated from dpostproc

View File

@ -4,7 +4,7 @@
#include "JSystem/J2D/J2DAnm.h"
#include "JSystem/J2D/J2DGrafContext.h"
#include "JSystem/JGeometry.h"
#include "JSystem/JSU/JSUInputStream.h"
#include "JSystem/JSU/JSUStream.h"
#include "JSystem/JSU/JSUTreeIterator.h"
JGeometry::TBox2f J2DPane::static_mBounds(0.0f, 0.0f, 0.0f, 0.0f);

View File

@ -1,4 +1,6 @@
#include "types.h"
#include "JSystem/JKR/JKRFile.h"
#include "JSystem/JSU/JSUStream.h"
/*
Generated from dpostproc
@ -19,12 +21,17 @@
*/
/*
* __ct
*
* --INFO--
* Address: 80026EE4
* Size: 000044
*/
JSUFileInputStream::JSUFileInputStream(JKRFile*)
JSUFileInputStream::JSUFileInputStream(JKRFile* file)
: JSURandomInputStream()
{
m_object = file;
m_length = 0;
/*
lis r5, __vt__10JSUIosBase@ha
lis r7, __vt__14JSUInputStream@ha
@ -51,74 +58,25 @@ JSUFileInputStream::JSUFileInputStream(JKRFile*)
* Address: 80026F28
* Size: 0000E0
*/
void JSUFileInputStream::readData(void*, long)
size_t JSUFileInputStream::readData(void* buffer, long byteCount)
{
/*
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
stw r31, 0x1c(r1)
li r31, 0
stw r30, 0x18(r1)
mr r30, r5
stw r29, 0x14(r1)
mr r29, r4
stw r28, 0x10(r1)
mr r28, r3
lwz r3, 8(r3)
lbz r0, 0x18(r3)
cmplwi r0, 0
beq lbl_80026FE4
lwz r12, 0(r3)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
lwz r0, 0xc(r28)
add r0, r0, r30
cmplw r0, r3
ble lbl_80026FA0
lwz r3, 8(r28)
lwz r12, 0(r3)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
lwz r0, 0xc(r28)
subf r30, r0, r3
lbl_80026FA0:
cmpwi r30, 0
ble lbl_80026FE4
lwz r3, 8(r28)
mr r4, r29
mr r5, r30
lwz r6, 0xc(r28)
lwz r12, 0(r3)
lwz r12, 0x14(r12)
mtctr r12
bctrl
or. r31, r3, r3
bge lbl_80026FD8
li r3, 0
b lbl_80026FE8
lbl_80026FD8:
lwz r0, 0xc(r28)
add r0, r0, r31
stw r0, 0xc(r28)
lbl_80026FE4:
mr r3, r31
lbl_80026FE8:
lwz r0, 0x24(r1)
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
lwz r29, 0x14(r1)
lwz r28, 0x10(r1)
mtlr r0
addi r1, r1, 0x20
blr
*/
int readBytes = 0;
if (((JKRFile*)m_object)->_18) {
if ((ulong)(m_length + byteCount)
> ((JKRFile*)m_object)->getFileSize()) {
byteCount = ((JKRFile*)m_object)->getFileSize() - m_length;
}
if (byteCount > 0) {
readBytes
= ((JKRFile*)m_object)->readData(buffer, byteCount, m_length);
if (readBytes < 0) {
return 0;
} else {
m_length += readBytes;
}
}
}
return readBytes;
}
/*
@ -126,82 +84,29 @@ lbl_80026FE8:
* Address: 80027008
* Size: 0000E8
*/
void JSUFileInputStream::seekPos(long, JSUStreamSeekFrom)
int JSUFileInputStream::seekPos(long offset, JSUStreamSeekFrom mode)
{
/*
stwu r1, -0x20(r1)
mflr r0
cmpwi r5, 1
stw r0, 0x24(r1)
stw r31, 0x1c(r1)
stw r30, 0x18(r1)
mr r30, r4
stw r29, 0x14(r1)
mr r29, r3
lwz r31, 0xc(r3)
beq lbl_80027078
bge lbl_80027044
cmpwi r5, 0
bge lbl_80027050
b lbl_80027080
lbl_80027044:
cmpwi r5, 3
bge lbl_80027080
b lbl_80027058
lbl_80027050:
stw r30, 0xc(r29)
b lbl_80027080
lbl_80027058:
lwz r3, 8(r29)
lwz r12, 0(r3)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
subf r0, r30, r3
stw r0, 0xc(r29)
b lbl_80027080
lbl_80027078:
add r0, r31, r30
stw r0, 0xc(r29)
lbl_80027080:
lwz r0, 0xc(r29)
cmpwi r0, 0
bge lbl_80027094
li r0, 0
stw r0, 0xc(r29)
lbl_80027094:
lwz r3, 8(r29)
lwz r12, 0(r3)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
lwz r0, 0xc(r29)
cmpw r0, r3
ble lbl_800270CC
lwz r3, 8(r29)
lwz r12, 0(r3)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
stw r3, 0xc(r29)
lbl_800270CC:
lwz r0, 0xc(r29)
subf r3, r31, r0
lwz r0, 0x24(r1)
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
lwz r29, 0x14(r1)
mtlr r0
addi r1, r1, 0x20
blr
*/
ulong originalLength = m_length;
switch (mode) {
case SEEK_SET:
m_length = offset;
break;
case SEEK_END:
m_length = ((JKRFile*)m_object)->getFileSize() - offset;
break;
case SEEK_CUR:
m_length += offset;
break;
default:
break;
}
if (0 > m_length) {
m_length = 0;
}
if (m_length > ((JKRFile*)m_object)->getFileSize()) {
m_length = ((JKRFile*)m_object)->getFileSize();
}
return m_length - originalLength;
}
/*
@ -209,22 +114,9 @@ lbl_800270CC:
* Address: 800270F0
* Size: 000030
*/
void JSUFileInputStream::getLength() const
int JSUFileInputStream::getLength() const
{
/*
stwu r1, -0x10(r1)
mflr r0
lwz r3, 8(r3)
stw r0, 0x14(r1)
lwz r12, 0(r3)
lwz r12, 0x1c(r12)
mtctr r12
bctrl
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
*/
return ((JKRFile*)m_object)->getFileSize();
}
/*
@ -232,10 +124,4 @@ void JSUFileInputStream::getLength() const
* Address: 80027120
* Size: 000008
*/
void JSUFileInputStream::getPosition() const
{
/*
lwz r3, 0xc(r3)
blr
*/
}
int JSUFileInputStream::getPosition() const { return m_length; }

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "JSystem/JSU/JSUStream.h"
/*
Generated from dpostproc
@ -218,7 +219,7 @@ lbl_80026544:
* Address: 80026564
* Size: 00008C
*/
void JSURandomInputStream::align(long)
uint JSURandomInputStream::align(long)
{
/*
stwu r1, -0x10(r1)
@ -266,8 +267,11 @@ lbl_800265D4:
* Address: 800265F0
* Size: 00005C
*/
void JSURandomInputStream::skip(long)
void JSURandomInputStream::skip(long offset)
{
if (seekPos(offset, SEEK_CUR) != offset) {
m_isEOFMaybe |= 1;
}
/*
stwu r1, -0x10(r1)
mflr r0
@ -302,8 +306,17 @@ lbl_80026634:
* Address: 8002664C
* Size: 0000BC
*/
void JSURandomInputStream::peek(void*, long)
size_t JSURandomInputStream::peek(void* buffer, long byteCount)
{
int position = getPosition();
int dataLength = readData(buffer, byteCount);
if (dataLength != byteCount) {
m_isEOFMaybe |= 1;
}
if (dataLength != 0) {
seekPos(position, SEEK_SET);
}
return dataLength;
/*
stwu r1, -0x20(r1)
mflr r0
@ -364,27 +377,10 @@ lbl_800266E4:
* Address: 80026708
* Size: 000044
*/
void JSURandomInputStream::seek(long, JSUStreamSeekFrom)
void JSURandomInputStream::seek(long offset, JSUStreamSeekFrom mode)
{
/*
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xc(r1)
mr r31, r3
lwz r12, 0(r3)
lwz r12, 0x20(r12)
mtctr r12
bctrl
lbz r0, 4(r31)
rlwinm r0, r0, 0, 0x18, 0x1e
stb r0, 4(r31)
lwz r0, 0x14(r1)
lwz r31, 0xc(r1)
mtlr r0
addi r1, r1, 0x10
blr
*/
seekPos(offset, mode);
m_isEOFMaybe &= ~1;
}
/*

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "JSystem/JSU/JSUStream.h"
/*
Generated from dpostproc
@ -23,15 +24,11 @@
* Address: 80026D5C
* Size: 000014
*/
void JSUMemoryInputStream::setBuffer(const void*, long)
void JSUMemoryInputStream::setBuffer(const void* buffer, long length)
{
/*
stw r4, 8(r3)
li r0, 0
stw r5, 0xc(r3)
stw r0, 0x10(r3)
blr
*/
m_object = const_cast<void*>(buffer);
m_length = length;
m_position = 0;
}
/*
@ -39,7 +36,7 @@ void JSUMemoryInputStream::setBuffer(const void*, long)
* Address: 80026D70
* Size: 000078
*/
void JSUMemoryInputStream::readData(void*, long)
size_t JSUMemoryInputStream::readData(void*, long)
{
/*
stwu r1, -0x10(r1)
@ -84,55 +81,29 @@ lbl_80026DCC:
* Address: 80026DE8
* Size: 00007C
*/
void JSUMemoryInputStream::seekPos(long, JSUStreamSeekFrom)
int JSUMemoryInputStream::seekPos(long offset, JSUStreamSeekFrom mode)
{
/*
cmpwi r5, 1
lwz r6, 0x10(r3)
beq lbl_80026E28
bge lbl_80026E04
cmpwi r5, 0
bge lbl_80026E10
b lbl_80026E30
lbl_80026E04:
cmpwi r5, 3
bge lbl_80026E30
b lbl_80026E18
lbl_80026E10:
stw r4, 0x10(r3)
b lbl_80026E30
lbl_80026E18:
lwz r0, 0xc(r3)
subf r0, r4, r0
stw r0, 0x10(r3)
b lbl_80026E30
lbl_80026E28:
add r0, r6, r4
stw r0, 0x10(r3)
lbl_80026E30:
lwz r0, 0x10(r3)
cmpwi r0, 0
bge lbl_80026E44
li r0, 0
stw r0, 0x10(r3)
lbl_80026E44:
lwz r0, 0x10(r3)
lwz r4, 0xc(r3)
cmpw r0, r4
ble lbl_80026E58
stw r4, 0x10(r3)
lbl_80026E58:
lwz r0, 0x10(r3)
subf r3, r6, r0
blr
*/
ulong originalPosition = m_position;
switch (mode) {
case SEEK_SET:
m_position = offset;
break;
case SEEK_END:
m_position = m_length - offset;
break;
case SEEK_CUR:
m_position += offset;
break;
default:
break;
}
if (0 > m_position) {
m_position = 0;
}
if (m_position > m_length) {
m_position = m_length;
}
return m_position - originalPosition;
}
/*
@ -183,23 +154,11 @@ lbl_80026EB8:
* Address: 80026ED4
* Size: 000008
*/
void JSUMemoryInputStream::getLength() const
{
/*
lwz r3, 0xc(r3)
blr
*/
}
int JSUMemoryInputStream::getLength() const { return m_length; }
/*
* --INFO--
* Address: 80026EDC
* Size: 000008
*/
void JSUMemoryInputStream::getPosition() const
{
/*
lwz r3, 0x10(r3)
blr
*/
}
int JSUMemoryInputStream::getPosition() const { return m_position; }

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "JSystem/JSU/JSUStream.h"
/*
Generated from dpostproc
@ -17,8 +18,11 @@
* Address: 800261E0
* Size: 000058
*/
void JSUOutputStream::write(const void*, long)
void JSUOutputStream::write(const void* data, long length)
{
if (length != writeData(data, length)) {
m_isEOFMaybe |= 1;
}
/*
stwu r1, -0x10(r1)
mflr r0

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "JSystem/JUT/JUTFont.h"
/*
Generated from dpostproc
@ -152,7 +153,7 @@ void JUTFont::setGradColor(JUtility::TColor, JUtility::TColor)
* Size: 000118
*/
void JUTFont::drawString_size_scale(float, float, float, float, const char*,
unsigned long, bool)
ulong, bool)
{
/*
.loc_0x0:
@ -293,7 +294,7 @@ void JUTFont::setGX(JUtility::TColor, JUtility::TColor)
* Address: 8002D400
* Size: 00002C
*/
void JUTFont::getCellWidth() const
float JUTFont::getCellWidth() const
{
/*
stwu r1, -0x10(r1)
@ -315,7 +316,7 @@ void JUTFont::getCellWidth() const
* Address: 8002D42C
* Size: 00002C
*/
void JUTFont::getCellHeight() const
float JUTFont::getCellHeight() const
{
/*
stwu r1, -0x10(r1)

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "JSystem/JUT/JUTNameTab.h"
/*
Generated from dpostproc
@ -165,7 +166,7 @@ lbl_8002EE08:
* Address: 8002EE1C
* Size: 000030
*/
void JUTNameTab::getName(unsigned short) const
char* JUTNameTab::getName(ushort) const
{
/*
lhz r0, 0xc(r3)

View File

@ -1,6 +1,6 @@
#include "types.h"
#include "cellPyramid.h"
#include "Game/cellPyramid.h"
#include "BaseParm.h"
#include "CellMgrParms.h"
#include "Dolphin/math.h"
@ -450,23 +450,23 @@ inline void Cell::dump()
// return 0.0f;
// }
inline float pikmin2_sqrtf(float x)
{
if (!(x > 0.0f)) { // if x <= 0
return x;
}
// inline float pikmin2_sqrtf(float x)
// {
// if (!(x > 0.0f)) { // if x <= 0
// return x;
// }
register float reg1 = x;
register float reg2 = 0.0f;
register float result;
// register float reg1 = x;
// register float reg2 = 0.0f;
// register float result;
asm {
frsqrte reg2, reg1
fmuls result, reg2, reg1
}
// asm {
// frsqrte reg2, reg1
// fmuls result, reg2, reg1
// }
return result;
}
// return result;
// }
/*
* --INFO--
@ -2534,14 +2534,15 @@ void CellPyramid::entry(CellObject* param_1, Sys::Sphere& param_2, int& param_3,
cell->exit(&param_1->m_cellLegs.arrayView[iVar9], bVar5);
// if (cell->_1C == &param_1.m_cellLegs.arrayView[iVar9]) {
// cell->_1C =
// param_1.m_cellLegs.arrayView[iVar9].m_next; if (cell->_1C
// param_1.m_cellLegs.arrayView[iVar9].m_next; if
// (cell->_1C
// != nullptr) { cell->_1C->m_prev = nullptr;
// }
// }
// if ((bVar5) && (cell->_14 != 0)) {
// cell->_14--;
// for (Cell* iCell = cell->_10; iCell != nullptr; iCell
// = iCell->_10) { iCell->_16--;
// for (Cell* iCell = cell->_10; iCell != nullptr;
// iCell = iCell->_10) { iCell->_16--;
// }
// }
// cell->_18--;

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
#include "types.h"
#include "Vector3.h"
/*
Generated from dpostproc
@ -3955,7 +3956,7 @@ lbl_80207DCC:
* Address: 80207DE0
* Size: 000090
*/
void Vector3f::normalise()
template<> inline void Vector3f::normalise()
{
/*
lfs f3, 0(r3)

View File

@ -1,3 +1,4 @@
#include "Screen/Enums.h"
#include "types.h"
#include "og/Screen/ogScreen.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +0,0 @@
#ifndef _GAME_SHADOWMGR_H
#define _GAME_SHADOWMGR_H
struct CNode {
virtual void _00() = 0; // _00
virtual void getChildCount(); // _04
// _00 VTBL
};
namespace Game {
struct ShadowMgr : public CNode {
virtual ~ShadowMgr(); // _00
virtual void getChildCount(); // _04
virtual void getSize(); // _08
virtual void getMax(); // _0C
virtual void getCreature(int); // _10
virtual void getFirst(); // _14
virtual void getNext(int); // _18
virtual void isDone(int); // _1C
virtual void write(Stream&); // _20
virtual void read(Stream&); // _24
// _00 VTBL
};
} // namespace Game
#endif

View File

@ -1,16 +0,0 @@
#ifndef _J3DMODEL_H
#define _J3DMODEL_H
struct J3DModel {
virtual void update(); // _00
virtual void entry(); // _04
virtual void calc(); // _08
virtual void calcMaterial(); // _0C
virtual void calcDiffTexMtx(); // _10
virtual void viewCalc(); // _14
virtual ~J3DModel(); // _18
// _00 VTBL
};
#endif

View File

@ -1,46 +0,0 @@
#ifndef _SCREEN_OBJBASE_H
#define _SCREEN_OBJBASE_H
struct CNode {
virtual void _00() = 0; // _00
virtual void getChildCount(); // _04
// _00 VTBL
};
namespace Screen {
struct ObjBase : public CNode {
virtual ~ObjBase(); // _00
virtual void getChildCount(); // _04
virtual void _08() = 0; // _08
virtual void _0C() = 0; // _0C
virtual void @24 @__dt(); // _10
virtual void update(); // _14
virtual void draw(Graphics&); // _18
virtual void start(const StartSceneArg*); // _1C
virtual void end(const EndSceneArg*); // _20
virtual void setOwner(SceneBase*); // _24
virtual void getOwner() const; // _28
virtual void create(JKRArchive*); // _2C
virtual void confirmSetScene(SetSceneArg&); // _30
virtual void confirmStartScene(StartSceneArg*); // _34
virtual void confirmEndScene(EndSceneArg*); // _38
virtual void doStart(const StartSceneArg*); // _3C
virtual void doEnd(const EndSceneArg*); // _40
virtual void doCreate(JKRArchive*); // _44
virtual void doUpdateFadein(); // _48
virtual void doUpdateFadeinFinish(); // _4C
virtual void doUpdate(); // _50
virtual void doUpdateFinish(); // _54
virtual void doUpdateFadeout(); // _58
virtual void doUpdateFadeoutFinish(); // _5C
virtual void doDraw(Graphics&); // _60
virtual void doConfirmSetScene(SetSceneArg&); // _64
virtual void doConfirmStartScene(StartSceneArg*); // _68
virtual void doConfirmEndScene(EndSceneArg*&); // _6C
// _00 VTBL
};
} // namespace Screen
#endif

View File

@ -1,29 +0,0 @@
#ifndef _SCREEN_SCENEBASE_H
#define _SCREEN_SCENEBASE_H
namespace Screen {
struct SceneBase {
virtual void _00() = 0; // _00
virtual void _04() = 0; // _04
virtual void _08() = 0; // _08
virtual void isUseBackupSceneInfo(); // _0C
virtual void isDrawInDemo() const; // _10
virtual void _14() = 0; // _14
virtual void _18() = 0; // _18
virtual void doUserCallBackFunc(Resource::MgrCommand*); // _1C
virtual void setPort(Graphics&); // _20
virtual void doUpdateActive(); // _24
virtual void doConfirmSetScene(SetSceneArg&); // _28
virtual void doConfirmStartScene(StartSceneArg*); // _2C
virtual void doConfirmEndScene(EndSceneArg*&); // _30
virtual void doStart(StartSceneArg*); // _34
virtual void doEnd(EndSceneArg*); // _38
virtual void setDefaultDispMember(); // _3C
virtual void doSetBackupScene(SetSceneArg&); // _40
virtual void doGetFinishState(); // _44
// _00 VTBL
};
} // namespace Screen
#endif

View File

@ -1,43 +0,0 @@
#ifndef _OG_SCREEN_CALLBACK_COUNTERRV_H
#define _OG_SCREEN_CALLBACK_COUNTERRV_H
struct CNode {
virtual void _00() = 0; // _00
virtual void getChildCount(); // _04
// _00 VTBL
};
namespace P2DScreen {
struct Node {
virtual void _00() = 0; // _00
virtual void _04() = 0; // _04
virtual void _08() = 0; // _08
virtual void _0C() = 0; // _0C
virtual void doInit(); // _10
// _00 VTBL
};
} // namespace P2DScreen
namespace og {
namespace Screen {
struct CallBack_CounterRV : public CNode, public Node {
virtual ~CallBack_CounterRV(); // _00
virtual void getChildCount(); // _04
virtual void update(); // _08
virtual void draw(Graphics&, J2DGrafContext&); // _0C
virtual void doInit(); // _10
virtual void init(J2DScreen*, unsigned long long, unsigned long long,
unsigned long long, unsigned long*, bool); // _14
virtual void show(); // _18
virtual void hide(); // _1C
virtual void setValue(bool, bool); // _20
virtual void setValue(); // _24
// _00 VTBL
};
} // namespace Screen
} // namespace og
#endif

View File

@ -1,56 +0,0 @@
#ifndef _OG_NEWSCREEN_FLOOR_H
#define _OG_NEWSCREEN_FLOOR_H
namespace Screen {
struct SceneBase {
virtual void _00() = 0; // _00
virtual void _04() = 0; // _04
virtual void _08() = 0; // _08
virtual void isUseBackupSceneInfo(); // _0C
virtual void isDrawInDemo() const; // _10
virtual void _14() = 0; // _14
virtual void _18() = 0; // _18
virtual void _1C() = 0; // _1C
virtual void setPort(Graphics&); // _20
virtual void doUpdateActive(); // _24
virtual void doConfirmSetScene(SetSceneArg&); // _28
virtual void doConfirmStartScene(StartSceneArg*); // _2C
virtual void doConfirmEndScene(EndSceneArg*&); // _30
virtual void doStart(StartSceneArg*); // _34
virtual void doEnd(EndSceneArg*); // _38
virtual void setDefaultDispMember(); // _3C
virtual void doSetBackupScene(SetSceneArg&); // _40
virtual void doGetFinishState(); // _44
// _00 VTBL
};
} // namespace Screen
namespace og {
namespace newScreen {
struct Floor : public SceneBase {
virtual void getSceneType(); // _00
virtual void getOwnerID(); // _04
virtual void getMemberID(); // _08
virtual void isUseBackupSceneInfo(); // _0C
virtual void isDrawInDemo() const; // _10
virtual void getResName() const; // _14
virtual void doCreateObj(JKRArchive*); // _18
virtual void doUserCallBackFunc(Resource::MgrCommand*); // _1C
virtual void setPort(Graphics&); // _20
virtual void doUpdateActive(); // _24
virtual void doConfirmSetScene(SetSceneArg&); // _28
virtual void doConfirmStartScene(StartSceneArg*); // _2C
virtual void doConfirmEndScene(EndSceneArg*&); // _30
virtual void doStart(StartSceneArg*); // _34
virtual void doEnd(EndSceneArg*); // _38
virtual void setDefaultDispMember(); // _3C
virtual void doSetBackupScene(SetSceneArg&); // _40
virtual void doGetFinishState(); // _44
// _00 VTBL
};
} // namespace newScreen
} // namespace og
#endif