Skip to content

Commit

Permalink
Link screenScene.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartPiece44 committed Sep 15, 2023
1 parent 1fba2eb commit 6ac4bfd
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 1,013 deletions.
922 changes: 0 additions & 922 deletions asm/sysGCU/screenScene.s

This file was deleted.

2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@
"sysGCU/pikmin2THPPlayer",
["sysGCU/captionMgr", True],
"sysGCU/captionMessage",
"sysGCU/screenScene",
["sysGCU/screenScene", True],
"sysGCU/screenMgr",
"sysGCU/screenObj",
"sysGCU/JSTObjectParticleActor",
Expand Down
13 changes: 8 additions & 5 deletions include/Screen/screenMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ struct Mgr : public MgrBase {
virtual bool startScene(StartSceneArg*); // _10
virtual void endScene(EndSceneArg*); // _14
virtual bool reset(); // _18
virtual void setColorBG(JUtility::TColor&); // _1C (weak)
virtual void setBGMode(int); // _20 (weak)
virtual void setColorBG(JUtility::TColor&) { } // _1C (weak)
virtual void setBGMode(int) { } // _20 (weak)
virtual ::Screen::SceneBase* doGetSceneBase(long); // _24
virtual void drawBG(Graphics&); // _28 (weak)
virtual void drawBG(Graphics&) { } // _28 (weak)
virtual void drawWipe(Graphics&) { } // _2C (weak)

void init();
Expand Down Expand Up @@ -60,8 +60,6 @@ struct Mgr : public MgrBase {
P2ASSERTLINE(280, controller);
}

inline SceneInfoList* getInfoList() { return (SceneInfoList*)_60.mChild; }

// _00 = VTBL
// _00-_18 = MgrBase
u8 _18; // _18
Expand All @@ -88,6 +86,11 @@ struct Mgr : public MgrBase {
static Mgr* sScreenMgr;
};

inline void checkSceneList(SceneInfoList* list)
{
P2ASSERTLINE(329, list);
}

} // namespace Screen

namespace newScreen {
Expand Down
2 changes: 2 additions & 0 deletions include/Screen/screenObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ struct SceneBase {
u32 getBackupSceneType();
void setBGMode(int);

inline Mgr* getScreenMgr() { return mScreenMgr; }

// _00 = VTBL
char mName[256]; // _004
Controller* mController; // _104
Expand Down
1 change: 1 addition & 0 deletions include/stl/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extern "C" {
int memcmp(const void*, const void*, size_t);
void* memchr(u8*, int, size_t);
void* memmove(void*, const void*, size_t);
void* memcpy(void* dest, const void* src, size_t n);

#ifdef __cplusplus
};
Expand Down
2 changes: 1 addition & 1 deletion src/sysGCU/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GC_FILES:=\
$(BUILD_DIR)/asm/sysGCU/pikmin2THPPlayer.o\
$(BUILD_DIR)/src/sysGCU/captionMgr.o\
$(BUILD_DIR)/asm/sysGCU/captionMessage.o\
$(BUILD_DIR)/asm/sysGCU/screenScene.o\
$(BUILD_DIR)/src/sysGCU/screenScene.o\
$(BUILD_DIR)/asm/sysGCU/screenMgr.o\
$(BUILD_DIR)/asm/sysGCU/screenObj.o\
$(BUILD_DIR)/asm/sysGCU/JSTObjectParticleActor.o\
Expand Down
95 changes: 11 additions & 84 deletions src/sysGCU/screenScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "Screen/screenObj.h"
#include "Screen/screenMgr.h"
#include "System.h"
#include "stl/mem.h"
#include "types.h"

namespace Screen {
Expand Down Expand Up @@ -261,15 +262,15 @@ bool SceneBase::confirmEndScene(Screen::EndSceneArg* arg) { return (mObjMgr->con
* Address: 80451F30
* Size: 000030
*/
void SceneBase::setScene(Screen::SetSceneArg& arg) { mScreenMgr->setScene(arg); }
bool SceneBase::setScene(Screen::SetSceneArg& arg) { return mScreenMgr->setScene(arg); }

/*
* startScene__Q26Screen9SceneBaseFPQ26Screen13StartSceneArg
* --INFO--
* Address: 80451F60
* Size: 000030
*/
void SceneBase::startScene(Screen::StartSceneArg* arg) { mScreenMgr->startScene(arg); }
bool SceneBase::startScene(Screen::StartSceneArg* arg) { return mScreenMgr->startScene(arg); }

/*
* endScene__Q26Screen9SceneBaseFPQ26Screen11EndSceneArg
Expand Down Expand Up @@ -298,84 +299,14 @@ bool SceneBase::setBackupScene()

result = mScreenMgr->setScene(arg);
if (result) {
mgr = mScreenMgr;
mgr = getScreenMgr();
list = (SceneInfoList*)mgr->_60.mChild;
P2ASSERTLINE(329, list);
checkSceneList(list);
list->del();
mgr->mSceneInfoList.add(list);
}
}
return result;
/*
stwu r1, -0x30(r1)
mflr r0
stw r0, 0x34(r1)
stw r31, 0x2c(r1)
stw r30, 0x28(r1)
mr r30, r3
stw r29, 0x24(r1)
li r29, 0
lwz r4, 0x108(r3)
lwz r5, 0x70(r4)
cmplwi r5, 0
beq lbl_804520A0
lwz r7, 0x18(r5)
lis r4, __vt__Q26Screen12SceneArgBase@ha
addi r0, r4, __vt__Q26Screen12SceneArgBase@l
lis r4, __vt__Q26Screen11SetSceneArg@ha
stw r0, 8(r1)
addi r4, r4, __vt__Q26Screen11SetSceneArg@l
addi r0, r5, 0x1c
li r6, 0
li r5, 1
stw r4, 8(r1)
addi r4, r1, 8
stw r7, 0xc(r1)
stb r6, 0x10(r1)
stb r5, 0x11(r1)
stw r0, 0x14(r1)
lwz r12, 0(r3)
lwz r12, 0x48(r12)
mtctr r12
bctrl
lwz r3, 0x108(r30)
addi r4, r1, 8
lwz r12, 0(r3)
lwz r12, 0xc(r12)
mtctr r12
bctrl
clrlwi. r0, r3, 0x18
mr r29, r3
beq lbl_804520A0
lwz r31, 0x108(r30)
lwz r30, 0x70(r31)
cmplwi r30, 0
bne lbl_8045208C
lis r3, lbl_8049B8BC@ha
lis r5, lbl_8049B8B0@ha
addi r3, r3, lbl_8049B8BC@l
li r4, 0x149
addi r5, r5, lbl_8049B8B0@l
crclr 6
bl panic_f__12JUTExceptionFPCciPCce
lbl_8045208C:
mr r3, r30
bl del__5CNodeFv
mr r4, r30
addi r3, r31, 0x78
bl add__5CNodeFP5CNode
lbl_804520A0:
lwz r0, 0x34(r1)
mr r3, r29
lwz r31, 0x2c(r1)
lwz r30, 0x28(r1)
lwz r29, 0x24(r1)
mtlr r0
addi r1, r1, 0x30
blr
*/
}

/*
Expand Down Expand Up @@ -429,16 +360,12 @@ void SceneBase::setColorBG(u8 r, u8 g, u8 b, u8 a)

/*
* --INFO--
* Address: 804522C8
* Size: 000004
*/
void Mgr::setColorBG(JUtility::TColor&) { }

/*
* --INFO--
* Address: 804522CC
* Size: 000004
* Address: ........
* Size: 000030
*/
void Mgr::setBGMode(int) { }
void SceneBase::setBGMode(int mode)
{
mScreenMgr->setBGMode(mode);
}

} // namespace Screen
2 changes: 2 additions & 0 deletions tools/progress.csv
Original file line number Diff line number Diff line change
Expand Up @@ -533,3 +533,5 @@ You have 2612 out of 10000 Pokos and 74 out of 201 treasures.",2023-09-12 16:09:
You have 2613 out of 10000 Pokos and 74 out of 201 treasures.",2023-09-12 20:28:42.908752
2618,1218068,0.26181767845597237,77,273242,0.3833060253403212,"
You have 2618 out of 10000 Pokos and 77 out of 201 treasures.",2023-09-12 22:50:28.209910
2622,1220288,0.26229485645110256,77,273300,0.38338738819621354,"
You have 2622 out of 10000 Pokos and 77 out of 201 treasures.",2023-09-15 13:52:05.130743

0 comments on commit 6ac4bfd

Please sign in to comment.