This commit is contained in:
intns 2021-11-03 16:38:05 +00:00
parent 5e853d9eab
commit a9a6052fa5
5 changed files with 36 additions and 167 deletions

View File

@ -73,6 +73,7 @@ When compiling the project, this patch is automatically applied, if it fails to
- plugProjectKonoU
- plugProjectOgawaU
- <a href="https://github.com/doldecomp/pikmin2/tree/main/src/plugProjectOgawaU/ogAngleMgr.cpp">plugProjectOgawaU/ogAngleMgr.cpp</a>
- <a href="https://github.com/doldecomp/pikmin2/tree/main/src/plugProjectOgawaU/ogLib2D.cpp">plugProjectOgawaU/ogLib2D.cpp</a>
- plugProjectKandoU
- <a href="https://github.com/doldecomp/pikmin2/tree/main/src/plugProjectKandoU/gameSoundEvent.cpp">plugProjectKandoU/gameSoundEvent.cpp</a>
- <a href="https://github.com/doldecomp/pikmin2/tree/main/src/plugProjectKandoU/objectTypes.cpp">plugProjectKandoU/objectTypes.cpp</a>

View File

@ -1,86 +0,0 @@
.include "macros.inc"
.section .data, "wa" # 0x8049E220 - 0x804EFC20
.balign 0x8
.global __vt__Q22og5Lib2D
__vt__Q22og5Lib2D:
.4byte 0
.4byte 0
.4byte __dt__Q22og5Lib2DFv
.4byte 0
.section .sbss # 0x80514D80 - 0x80516360
.balign 0x8
.global gLib2D__2og
gLib2D__2og:
.skip 0x8
.section .text, "ax" # 0x800056C0 - 0x80472F00
.global __dt__Q22og5Lib2DFv
__dt__Q22og5Lib2DFv:
/* 8030F600 0030C540 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8030F604 0030C544 7C 08 02 A6 */ mflr r0
/* 8030F608 0030C548 90 01 00 14 */ stw r0, 0x14(r1)
/* 8030F60C 0030C54C 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8030F610 0030C550 7C 9F 23 78 */ mr r31, r4
/* 8030F614 0030C554 93 C1 00 08 */ stw r30, 8(r1)
/* 8030F618 0030C558 7C 7E 1B 79 */ or. r30, r3, r3
/* 8030F61C 0030C55C 41 82 00 30 */ beq lbl_8030F64C
/* 8030F620 0030C560 3C 80 80 4E */ lis r4, __vt__Q22og5Lib2D@ha
/* 8030F624 0030C564 38 00 00 00 */ li r0, 0
/* 8030F628 0030C568 38 A4 83 88 */ addi r5, r4, __vt__Q22og5Lib2D@l
/* 8030F62C 0030C56C 38 80 00 00 */ li r4, 0
/* 8030F630 0030C570 90 BE 00 00 */ stw r5, 0(r30)
/* 8030F634 0030C574 90 0D 97 C0 */ stw r0, gLib2D__2og@sda21(r13)
/* 8030F638 0030C578 4B D0 D9 FD */ bl __dt__11JKRDisposerFv
/* 8030F63C 0030C57C 7F E0 07 35 */ extsh. r0, r31
/* 8030F640 0030C580 40 81 00 0C */ ble lbl_8030F64C
/* 8030F644 0030C584 7F C3 F3 78 */ mr r3, r30
/* 8030F648 0030C588 4B D1 4A 6D */ bl __dl__FPv
lbl_8030F64C:
/* 8030F64C 0030C58C 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8030F650 0030C590 7F C3 F3 78 */ mr r3, r30
/* 8030F654 0030C594 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8030F658 0030C598 83 C1 00 08 */ lwz r30, 8(r1)
/* 8030F65C 0030C59C 7C 08 03 A6 */ mtlr r0
/* 8030F660 0030C5A0 38 21 00 10 */ addi r1, r1, 0x10
/* 8030F664 0030C5A4 4E 80 00 20 */ blr
.global create__Q22og5Lib2DFv
create__Q22og5Lib2DFv:
/* 8030F668 0030C5A8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8030F66C 0030C5AC 7C 08 02 A6 */ mflr r0
/* 8030F670 0030C5B0 90 01 00 14 */ stw r0, 0x14(r1)
/* 8030F674 0030C5B4 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8030F678 0030C5B8 80 0D 97 C0 */ lwz r0, gLib2D__2og@sda21(r13)
/* 8030F67C 0030C5BC 28 00 00 00 */ cmplwi r0, 0
/* 8030F680 0030C5C0 40 82 00 5C */ bne lbl_8030F6DC
/* 8030F684 0030C5C4 38 60 00 1C */ li r3, 0x1c
/* 8030F688 0030C5C8 4B D1 48 1D */ bl __nw__FUl
/* 8030F68C 0030C5CC 7C 60 1B 79 */ or. r0, r3, r3
/* 8030F690 0030C5D0 41 82 00 48 */ beq lbl_8030F6D8
/* 8030F694 0030C5D4 7C 1F 03 78 */ mr r31, r0
/* 8030F698 0030C5D8 4B D0 D9 35 */ bl __ct__11JKRDisposerFv
/* 8030F69C 0030C5DC 3C 60 80 4E */ lis r3, __vt__Q22og5Lib2D@ha
/* 8030F6A0 0030C5E0 38 00 00 00 */ li r0, 0
/* 8030F6A4 0030C5E4 38 83 83 88 */ addi r4, r3, __vt__Q22og5Lib2D@l
/* 8030F6A8 0030C5E8 38 60 00 04 */ li r3, 4
/* 8030F6AC 0030C5EC 90 9F 00 00 */ stw r4, 0(r31)
/* 8030F6B0 0030C5F0 90 1F 00 18 */ stw r0, 0x18(r31)
/* 8030F6B4 0030C5F4 4B D1 47 F1 */ bl __nw__FUl
/* 8030F6B8 0030C5F8 7C 60 1B 79 */ or. r0, r3, r3
/* 8030F6BC 0030C5FC 41 82 00 0C */ beq lbl_8030F6C8
/* 8030F6C0 0030C600 48 12 E5 2D */ bl __ct__Q25P2JME13SimpleMessageFv
/* 8030F6C4 0030C604 7C 60 1B 78 */ mr r0, r3
lbl_8030F6C8:
/* 8030F6C8 0030C608 90 1F 00 18 */ stw r0, 0x18(r31)
/* 8030F6CC 0030C60C 80 7F 00 18 */ lwz r3, 0x18(r31)
/* 8030F6D0 0030C610 48 12 E5 21 */ bl init__Q25P2JME13SimpleMessageFv
/* 8030F6D4 0030C614 7F E0 FB 78 */ mr r0, r31
lbl_8030F6D8:
/* 8030F6D8 0030C618 90 0D 97 C0 */ stw r0, gLib2D__2og@sda21(r13)
lbl_8030F6DC:
/* 8030F6DC 0030C61C 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8030F6E0 0030C620 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8030F6E4 0030C624 7C 08 03 A6 */ mtlr r0
/* 8030F6E8 0030C628 38 21 00 10 */ addi r1, r1, 0x10
/* 8030F6EC 0030C62C 4E 80 00 20 */ blr

21
include/og/ogLib2D.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef _OG_OGLIB2D_H
#define _OG_OGLIB2D_H
#include "types.h"
#include "JSystem/JKR/JKRDisposer.h"
#include "P2JME/SimpleMessage.h"
namespace og {
struct Lib2D : public JKRDisposer {
Lib2D();
virtual ~Lib2D();
static void create();
P2JME::SimpleMessage* m_message; // _18
};
extern Lib2D* gLib2D;
} // namespace og
#endif

View File

@ -887,7 +887,7 @@ OGAWA:=\
$(BUILD_DIR)/asm/plugProjectOgawaU/ogCopyPane.o\
$(BUILD_DIR)/asm/plugProjectOgawaU/ogBloGroup.o\
$(BUILD_DIR)/asm/plugProjectOgawaU/DispMemberBase.o\
$(BUILD_DIR)/asm/plugProjectOgawaU/ogLib2D.o\
$(BUILD_DIR)/src/plugProjectOgawaU/ogLib2D.o\
$(BUILD_DIR)/asm/plugProjectOgawaU/ogObjSMenuMap.o\
$(BUILD_DIR)/asm/plugProjectOgawaU/ogSceneSMenuMap.o\
$(BUILD_DIR)/asm/plugProjectOgawaU/ogObjSMenuItem.o\

View File

@ -1,13 +1,18 @@
#include "og/ogLib2D.h"
og::Lib2D* og::gLib2D;
namespace og {
/*
* --INFO--
* Address: ........
* Size: 000068
*/
void og::Lib2D::__ct(void)
inline Lib2D::Lib2D()
{
// UNUSED FUNCTION
m_message = nullptr;
m_message = new P2JME::SimpleMessage();
m_message->init();
}
/*
@ -15,89 +20,17 @@ void og::Lib2D::__ct(void)
* Address: 8030F600
* Size: 000068
*/
void og::Lib2D::__dt(void)
{
/*
.loc_0x0:
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
mr r31, r4
stw r30, 0x8(r1)
mr. r30, r3
beq- .loc_0x4C
lis r4, 0x804E
li r0, 0
subi r5, r4, 0x7C78
li r4, 0
stw r5, 0x0(r30)
stw r0, -0x6840(r13)
bl -0x2F2604
extsh. r0, r31
ble- .loc_0x4C
mr r3, r30
bl -0x2EB594
.loc_0x4C:
lwz r0, 0x14(r1)
mr r3, r30
lwz r31, 0xC(r1)
lwz r30, 0x8(r1)
mtlr r0
addi r1, r1, 0x10
blr
*/
}
Lib2D::~Lib2D() { og::gLib2D = nullptr; }
/*
* --INFO--
* Address: 8030F668
* Size: 000088
*/
void og::Lib2D::create(void)
void og::Lib2D::create()
{
/*
.loc_0x0:
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xC(r1)
lwz r0, -0x6840(r13)
cmplwi r0, 0
bne- .loc_0x74
li r3, 0x1C
bl -0x2EB7E4
mr. r0, r3
beq- .loc_0x70
mr r31, r0
bl -0x2F26CC
lis r3, 0x804E
li r0, 0
subi r4, r3, 0x7C78
li r3, 0x4
stw r4, 0x0(r31)
stw r0, 0x18(r31)
bl -0x2EB810
mr. r0, r3
beq- .loc_0x60
bl 0x12E52C
mr r0, r3
.loc_0x60:
stw r0, 0x18(r31)
lwz r3, 0x18(r31)
bl 0x12E520
mr r0, r31
.loc_0x70:
stw r0, -0x6840(r13)
.loc_0x74:
lwz r0, 0x14(r1)
lwz r31, 0xC(r1)
mtlr r0
addi r1, r1, 0x10
blr
*/
if (!og::gLib2D) {
og::gLib2D = new og::Lib2D();
}
}
} // namespace og