Merge pull request #285 from dbalatoni13/main

Finish e3setup/mgselect.c
This commit is contained in:
Rainchus 2024-04-30 15:33:38 -05:00 committed by GitHub
commit f5bcd410bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 9533 additions and 49 deletions

4
.clang-format Normal file
View file

@ -0,0 +1,4 @@
BasedOnStyle: WebKit
IndentWidth: 4
ColumnLimit: 120
PointerAlignment: Right

View file

@ -42,35 +42,36 @@ InitCamera = .text:0x000056A8; // type:function size:0x7C scope:local
UpdateCamera = .text:0x00005724; // type:function size:0x12C scope:local
_ctors = .ctors:0x00000000; // type:label scope:global data:4byte
_dtors = .dtors:0x00000000; // type:label scope:global data:4byte
lbl_2_rodata_10 = .rodata:0x00000010; // type:object size:0x4 data:float
lbl_2_rodata_14 = .rodata:0x00000014; // type:object size:0x4 data:float
lbl_2_rodata_18 = .rodata:0x00000018; // type:object size:0x4 data:float
lbl_2_rodata_1C = .rodata:0x0000001C; // type:object size:0x4 data:float
lbl_2_rodata_20 = .rodata:0x00000020; // type:object size:0x4 data:float
lbl_2_rodata_24 = .rodata:0x00000024; // type:object size:0x4 data:float
lbl_2_rodata_28 = .rodata:0x00000028; // type:object size:0x4 data:float
lbl_2_rodata_2C = .rodata:0x0000002C; // type:object size:0x4 data:float
lbl_2_rodata_30 = .rodata:0x00000030; // type:object size:0x4 data:float
lbl_2_rodata_34 = .rodata:0x00000034; // type:object size:0x4 data:float
lbl_2_rodata_38 = .rodata:0x00000038; // type:object size:0x4 data:float
lbl_2_rodata_3C = .rodata:0x0000003C; // type:object size:0x4 data:float
lbl_2_rodata_40 = .rodata:0x00000040; // type:object size:0x4 data:float
lbl_2_rodata_44 = .rodata:0x00000044; // type:object size:0x4 data:float
lbl_2_rodata_48 = .rodata:0x00000048; // type:object size:0x4 data:float
lbl_2_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 data:float
lbl_2_rodata_50 = .rodata:0x00000050; // type:object size:0x4 data:float
lbl_2_rodata_54 = .rodata:0x00000054; // type:object size:0x4 data:float
lbl_2_rodata_58 = .rodata:0x00000058; // type:object size:0x4 data:float
lbl_2_rodata_5C = .rodata:0x0000005C; // type:object size:0x4 data:float
lbl_2_rodata_60 = .rodata:0x00000060; // type:object size:0x4 data:float
lbl_2_rodata_64 = .rodata:0x00000064; // type:object size:0x4 data:float
lbl_2_rodata_68 = .rodata:0x00000068; // type:object size:0x4 data:float
lbl_2_rodata_6C = .rodata:0x0000006C; // type:object size:0x4 data:float
lbl_2_rodata_70 = .rodata:0x00000070; // type:object size:0x4 data:float
lbl_2_rodata_74 = .rodata:0x00000074; // type:object size:0x4 data:float
lbl_2_rodata_78 = .rodata:0x00000078; // type:object size:0x4 data:float
lbl_2_rodata_7C = .rodata:0x0000007C; // type:object size:0x4 data:float
lbl_2_rodata_80 = .rodata:0x00000080; // type:object size:0x8 data:float
lbl_2_rodata_0 = .rodata:0x00000000; // type:object size:0x10
lbl_2_rodata_10 = .rodata:0x00000010; // type:object size:0x4 scope:local data:float
lbl_2_rodata_14 = .rodata:0x00000014; // type:object size:0x4 scope:local data:float
lbl_2_rodata_18 = .rodata:0x00000018; // type:object size:0x4 scope:local data:float
lbl_2_rodata_1C = .rodata:0x0000001C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_20 = .rodata:0x00000020; // type:object size:0x4 scope:local data:float
lbl_2_rodata_24 = .rodata:0x00000024; // type:object size:0x4 scope:local data:float
lbl_2_rodata_28 = .rodata:0x00000028; // type:object size:0x4 scope:local data:float
lbl_2_rodata_2C = .rodata:0x0000002C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_30 = .rodata:0x00000030; // type:object size:0x4 scope:local data:float
lbl_2_rodata_34 = .rodata:0x00000034; // type:object size:0x4 scope:local data:float
lbl_2_rodata_38 = .rodata:0x00000038; // type:object size:0x4 scope:local data:float
lbl_2_rodata_3C = .rodata:0x0000003C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_40 = .rodata:0x00000040; // type:object size:0x4 scope:local data:float
lbl_2_rodata_44 = .rodata:0x00000044; // type:object size:0x4 scope:local data:float
lbl_2_rodata_48 = .rodata:0x00000048; // type:object size:0x4 scope:local data:float
lbl_2_rodata_4C = .rodata:0x0000004C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_50 = .rodata:0x00000050; // type:object size:0x4 scope:local data:float
lbl_2_rodata_54 = .rodata:0x00000054; // type:object size:0x4 scope:local data:float
lbl_2_rodata_58 = .rodata:0x00000058; // type:object size:0x4 scope:local data:float
lbl_2_rodata_5C = .rodata:0x0000005C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_60 = .rodata:0x00000060; // type:object size:0x4 scope:local data:float
lbl_2_rodata_64 = .rodata:0x00000064; // type:object size:0x4 scope:local data:float
lbl_2_rodata_68 = .rodata:0x00000068; // type:object size:0x4 scope:local data:float
lbl_2_rodata_6C = .rodata:0x0000006C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_70 = .rodata:0x00000070; // type:object size:0x4 scope:local data:float
lbl_2_rodata_74 = .rodata:0x00000074; // type:object size:0x4 scope:local data:float
lbl_2_rodata_78 = .rodata:0x00000078; // type:object size:0x4 scope:local data:float
lbl_2_rodata_7C = .rodata:0x0000007C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_80 = .rodata:0x00000080; // type:object size:0x8 scope:local data:float
lbl_2_rodata_88 = .rodata:0x00000088; // type:object size:0x4 scope:local data:float
lbl_2_rodata_8C = .rodata:0x0000008C; // type:object size:0x4 scope:local data:float
lbl_2_rodata_90 = .rodata:0x00000090; // type:object size:0x4 scope:local data:float
@ -112,29 +113,29 @@ lbl_2_rodata_120 = .rodata:0x00000120; // type:object size:0x4 scope:local data:
lbl_2_rodata_124 = .rodata:0x00000124; // type:object size:0x4 scope:local data:float
lbl_2_rodata_128 = .rodata:0x00000128; // type:object size:0x4 scope:local data:float
lbl_2_rodata_12C = .rodata:0x0000012C; // type:object size:0x4 scope:local data:float
lbl_2_data_0 = .data:0x00000000; // type:object size:0x24
lbl_2_data_24 = .data:0x00000024; // type:object size:0x11 data:string
lbl_2_data_0 = .data:0x00000000; // type:object size:0x24 data:float
lbl_2_data_24 = .data:0x00000024; // type:object size:0x11 scope:local data:string
lbl_2_data_36 = .data:0x00000036; // type:object size:0x8
mgOvlTbl = .data:0x0000003E; // type:object size:0x1A scope:local
mgIdTbl = .data:0x00000058; // type:object size:0x1C scope:local
mgNameTbl = .data:0x00000074; // type:object size:0x34 scope:local
lbl_2_data_A8 = .data:0x000000A8; // type:object size:0x21
lbl_2_data_C9 = .data:0x000000C9; // type:object size:0x16
lbl_2_data_DF = .data:0x000000DF; // type:object size:0x16
lbl_2_data_F5 = .data:0x000000F5; // type:object size:0x16
lbl_2_data_10B = .data:0x0000010B; // type:object size:0xD
lbl_2_data_118 = .data:0x00000118; // type:object size:0x16
lbl_2_data_12E = .data:0x0000012E; // type:object size:0xD
lbl_2_data_13B = .data:0x0000013B; // type:object size:0x16
lbl_2_data_151 = .data:0x00000151; // type:object size:0x16
lbl_2_data_167 = .data:0x00000167; // type:object size:0x16
lbl_2_data_17D = .data:0x0000017D; // type:object size:0x16
lbl_2_data_193 = .data:0x00000193; // type:object size:0x16
lbl_2_data_1A9 = .data:0x000001A9; // type:object size:0x17
lbl_2_data_A8 = .data:0x000000A8; // type:object size:0x21 data:string
lbl_2_data_C9 = .data:0x000000C9; // type:object size:0x16 data:string
lbl_2_data_DF = .data:0x000000DF; // type:object size:0x16 data:string
lbl_2_data_F5 = .data:0x000000F5; // type:object size:0x16 data:string
lbl_2_data_10B = .data:0x0000010B; // type:object size:0xD data:string
lbl_2_data_118 = .data:0x00000118; // type:object size:0x16 data:string
lbl_2_data_12E = .data:0x0000012E; // type:object size:0xD data:string
lbl_2_data_13B = .data:0x0000013B; // type:object size:0x16 data:string
lbl_2_data_151 = .data:0x00000151; // type:object size:0x16 data:string
lbl_2_data_167 = .data:0x00000167; // type:object size:0x16 data:string
lbl_2_data_17D = .data:0x0000017D; // type:object size:0x16 data:string
lbl_2_data_193 = .data:0x00000193; // type:object size:0x16 data:string
lbl_2_data_1A9 = .data:0x000001A9; // type:object size:0x17 data:string
mgNameTestTbl = .data:0x000001C0; // type:object size:0x34 scope:local
cursorYOfsTbl = .data:0x000001F4; // type:object size:0x14 scope:local
cursorYOfsTbl = .data:0x000001F4; // type:object size:0x14 scope:local data:float
mgPicTbl = .data:0x00000208; // type:object size:0x34 scope:local
startText = .data:0x0000023C; // type:object size:0x14 scope:local
startText = .data:0x0000023C; // type:object size:0x14 scope:local data:string
shadowPos = .data:0x00000250; // type:object size:0xC scope:local
shadowTarget = .data:0x0000025C; // type:object size:0xC scope:local
shadowUp = .data:0x00000268; // type:object size:0xC scope:local
@ -158,13 +159,15 @@ camViewTbl = .data:0x00000418; // type:object size:0x60 scope:local data:float
lbl_2_data_478 = .data:0x00000478; // type:object size:0x24 data:float
lbl_2_data_49C = .data:0x0000049C; // type:object size:0x24 data:float
lbl_2_data_4C0 = .data:0x000004C0; // type:object size:0x10
lbl_2_bss_0 = .bss:0x00000000; // type:object size:0xA data:2byte
lbl_2_bss_A = .bss:0x0000000A; // type:object size:0x2 data:2byte
lbl_2_bss_C = .bss:0x0000000C; // type:object size:0x2 data:2byte
lbl_2_bss_E = .bss:0x0000000E; // type:object size:0x2 data:2byte
lbl_2_bss_10 = .bss:0x00000010; // type:object size:0x2 data:2byte
lbl_2_bss_14 = .bss:0x00000014; // type:object size:0x4 data:4byte
mgPicObj = .bss:0x00000018; // type:object size:0x4 scope:local data:4byte
mgSelectObj = .bss:0x0000001C; // type:object size:0x4 scope:local data:4byte
mgInterface = .bss:0x00000020; // type:object size:0x4 scope:local data:4byte
mgInterfaceObj = .bss:0x00000020; // type:object size:0x4 scope:local data:4byte
mgDefault = .bss:0x00000024; // type:object size:0x2 scope:local data:2byte
repBtn = .bss:0x00000028; // type:object size:0x2 scope:local data:2byte
lbl_2_bss_2A = .bss:0x0000002A; // type:object size:0xA data:2byte

View file

@ -781,7 +781,7 @@ config.libs = [
),
Rel('E3setupDLL',
objects = {
Object(NonMatching, "REL/E3setupDLL/mgselect.c"),
Object(Matching, "REL/E3setupDLL/mgselect.c"),
Object(Matching, "REL/executor.c"),
Object(Matching, "REL/E3setupDLL/main.c"),
}

6525
ctx_asd.c Normal file

File diff suppressed because it is too large Load diff

2402
ctx_working.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
#ifndef E3SETUPDLL_H
#define E3SETUPDLL_H
#include "game/animdata.h"
#include "game/object.h"
#include "game/pad.h"
@ -11,13 +12,59 @@ typedef struct e3pad {
u16 unk6;
} E3Pad;
typedef struct mgInterface {
/* 0x00 */ AnimData *unk_00[2];
/* 0x08 */ s32 unk08[5];
/* 0x1C */ s16 group;
/* 0x1E */ s16 group2;
/* 0x20 */ s32 unk20[3];
/* 0x2C */ s16 unk_2C;
/* 0x30 */ s32 unk30;
} mgInterface;
typedef struct mgPic {
/* 0x00 */ AnimData *unk_00[2];
/* 0x08 */ s32 unk08[9];
/* 0x2C */ s16 unk_2C;
/* 0x2E */ s32 unk2E[4];
/* 0x40 */ s16 unk_40;
/* 0x44 */ s32 unk44[2];
/* 0x4C */ s32 unk_4C;
/* 0x50 */ s32 unk50;
} mgPic;
typedef struct mgSelect {
/* 0x00 */ AnimData *unk_00[4];
/* 0x10 */ s32 unk10[3];
/* 0x1C */ s16 unk_1C;
/* 0x1E */ s16 unk_1E;
/* 0x20 */ s16 unk_20;
/* 0x22 */ s16 unk22;
/* 0x24 */ s32 unk24[2];
/* 0x2C */ s16 unk_2C;
/* 0x2E */ s16 unk_2E[4];
/* 0x36 */ s16 unk36;
/* 0x38 */ s16 unk_38[4];
/* 0x40 */ s16 unk40;
/* 0x42 */ s16 unk_42;
/* 0x44 */ s16 unk_44;
/* 0x46 */ s16 unk_46;
/* 0x48 */ s32 unk48[3];
} mgSelect;
extern E3Pad e3PadData[4];
extern s16 e3PadCtrl;
extern s16 e3ConfigPlayerCnt;
extern s16 e3ConfigPlayerF;
extern s32 e3ExitEnableF;
extern OverlayID e3NextOvl;
extern s32 e3NextEvent;
extern u32 e3ExitMode;
extern float e3CameraFov;
extern omObjData *e3MenuMainObj;
extern omObjData *e3ViewObj;
extern omObjData *e3OvlWatchObj;
extern omObjData *e3BGObj;
void E3MainInit(void);
void E3MGSelectInit(void);
@ -27,4 +74,4 @@ void E3OvlWatchInit(omObjData *object);
void E3BGCreate(omObjData *object);
void E3LightInit(void);
#endif
#endif

View file

@ -0,0 +1,501 @@
#include "ext_math.h"
#include "game/gamework_data.h"
#include "game/hsfman.h"
#include "game/init.h"
#include "game/objsub.h"
#include "game/sprite.h"
#include "game/window.h"
#include "rel_sqrt_consts.h"
#include "REL/E3SetupDLL.h"
static s16 mgDefault;
static omObjData *mgInterfaceObj;
static omObjData *mgSelectObj;
static omObjData *mgPicObj;
s32 lbl_2_bss_14;
s16 lbl_2_bss_10;
s16 lbl_2_bss_E;
s16 lbl_2_bss_C;
s16 lbl_2_bss_A;
static s16 lbl_2_bss_0[5];
float lbl_2_data_0[] = { 0, 12000, 0, 0, 0, 0, 0, 0, -1 };
static void StartMGSelect(omObjData *object);
static void UpdatePad(omObjData *object);
static void CreateMGSelect(omObjData *object);
static void CreateMGPic(omObjData *object);
static void UpdateMGInterface(omObjData *object);
static void CreateMGInterface(omObjData *object);
void E3MGSelectInit()
{
s32 var_r29;
s32 var_r30;
Process *var_r31;
for (var_r29 = 0, var_r30 = 0; var_r29 < 4; var_r29++) {
if (HuPadStatGet(var_r29) == 0) {
var_r30++;
}
}
e3ConfigPlayerCnt = var_r30;
if (var_r30 <= 0) {
OSReport("No pad detected\n");
var_r30++;
}
mgDefault = 0;
HuSysVWaitSet(1);
var_r31 = omInitObjMan(0x50, 0x2000);
HuWinInit(1);
CRot.x = -4.0f;
CRot.y = 0.0f;
CRot.z = 0.0f;
Center.x = 0.0f;
Center.y = 160.0f;
Center.z = 0.0f;
CZoom = 1960.0;
e3CameraFov = 40.0f;
Hu3DCameraCreate(1);
Hu3DCameraPerspectiveSet(1, e3CameraFov, 100.0f, 25000.0f, 4.0f / 3.0f);
e3ViewObj = omAddObjEx(var_r31, 32730, 0, 0, -1, omOutView);
e3OvlWatchObj = omAddObjEx(var_r31, 200, 0, 0, -1, E3OvlWatchInit);
e3MenuMainObj = omAddObjEx(var_r31, 10, 0, 0, -1, StartMGSelect);
e3BGObj = omAddObjEx(var_r31, 0x14, 0, 0, -1, E3BGCreate);
mgInterfaceObj = omAddObjEx(var_r31, 20, 0, 0, -1, CreateMGInterface);
mgSelectObj = omAddObjEx(var_r31, 30, 0, 0, -1, CreateMGSelect);
mgPicObj = omAddObjEx(var_r31, 31, 0, 0, -1, CreateMGPic);
mgPicObj->work[0] = mgDefault;
E3LightInit();
WipeCreate(1, 0, -1);
}
s16 lbl_2_data_36[] = { 0x0023, 0x0026, 0x0029, 0x002C };
static s16 mgOvlTbl[] = {
11,
12,
15,
18,
20,
23,
26,
27,
33,
34,
39,
44,
46,
};
static s16 mgIdTbl[] = { 403, 404, 407, 410, 412, 415, 418, 419, 425, 426, 431, 436, 438, 0 };
static s32 mgNameTbl[] = {
0x00170003,
0x00170004,
0x00170007,
0x0017000A,
0x0017000C,
0x0017000F,
0x00170012,
0x00170013,
0x00170019,
0x0017001A,
0x0017001F,
0x00170024,
0x00170026,
};
char lbl_2_data_A8[] = "\013TEST MINIGAME NAME01\n test";
char lbl_2_data_C9[] = "\013TEST MINIGAME NAME02";
char lbl_2_data_DF[] = "\013TEST MINIGAME NAME03";
char lbl_2_data_F5[] = "\013TEST MINIGAME NAME04";
char lbl_2_data_10B[] = "\013TEST NAME05";
char lbl_2_data_118[] = "\013TEST MINIGAME NAME06";
char lbl_2_data_12E[] = "\013TEST NAME07";
char lbl_2_data_13B[] = "\013TEST MINIGAME NAME08";
char lbl_2_data_151[] = "\013TEST MINIGAME NAME09";
char lbl_2_data_167[] = "\013TEST MINIGAME NAME10";
char lbl_2_data_17D[] = "\013TEST MINIGAME NAME11";
char lbl_2_data_193[] = "\013TEST MINIGAME NAME12";
char lbl_2_data_1A9[] = "\013TEST MINIGAME NAME13";
static char *mgNameTestTbl[] = {
lbl_2_data_A8,
lbl_2_data_C9,
lbl_2_data_DF,
lbl_2_data_F5,
lbl_2_data_10B,
lbl_2_data_118,
lbl_2_data_12E,
lbl_2_data_13B,
lbl_2_data_151,
lbl_2_data_167,
lbl_2_data_17D,
lbl_2_data_193,
lbl_2_data_1A9,
};
static float cursorYOfsTbl[] = { -100.0f, -50.0f, 0.0f, 50.0f, 100.0f };
static s32 mgPicTbl[] = { 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 };
static char startText[] = "\013\016\r PRESS START";
static void StartMGSelect(omObjData *object)
{
HuAudSeqPlay(0x2B);
lbl_2_bss_14 = 0;
lbl_2_bss_10 = -1;
lbl_2_bss_C = 0x1E;
lbl_2_bss_A = 0;
object->func = UpdatePad;
worstVcount = 0;
object->work[0] = 0;
object->work[1] = 0;
}
static void UpdatePad(omObjData *object)
{
s32 i;
s32 players;
if (e3ExitEnableF == 0) {
for (i = 0, players = 0; i < 4; i++) {
E3PadUpdate(i, &e3PadData[i]);
if (!e3PadData[i].enable) {
players++;
}
}
e3ConfigPlayerCnt = players;
}
}
static void UpdateMGSelect(omObjData *object)
{
mgSelect *var_r31;
s32 var_r30;
u32 var_r28;
s16 var_r27;
s16 var_r26;
s16 var_r25;
s16 var_r24;
u16 var_r23;
s16 var_r22;
s32 var_r21;
float sp8[2];
var_r31 = object->data;
var_r23 = e3PadData[e3PadCtrl].btnDown;
if (object->work[3] != 0) {
if ((var_r23 & 0x1100) != 0) {
HuAudFXPlay(1);
mgDefault = var_r31->unk_44;
var_r21 = mgIdTbl[var_r31->unk_44];
GWMGAvailSet(var_r21);
GWSystem.mg_next = var_r21 - 401;
e3NextOvl = 3;
e3NextEvent = 0;
e3ExitMode = 2;
e3ExitEnableF = 1;
var_r28 = mgOvlTbl[var_r31->unk_44];
for (var_r30 = 0; var_r30 < 50; var_r30++) {
if (var_r28 == mgInfoTbl[var_r30].ovl) {
break;
}
}
if (var_r30 >= 50) {
e3ExitMode = 0;
e3NextOvl = 0;
};
switch (mgInfoTbl[var_r30].type) {
case 0:
case 3:
case 4:
case 5:
case 6:
for (var_r30 = 0; var_r30 < 4; var_r30++) {
GWPlayerCfg[var_r30].group = var_r30;
}
break;
case 1:
var_r28 = frand();
var_r28 &= 3;
for (var_r30 = 0; var_r30 < 4; var_r30++) {
if (var_r28 == var_r30) {
GWPlayerCfg[var_r30].group = 0;
} else {
GWPlayerCfg[var_r30].group = 1;
}
}
break;
case 2:
for (var_r30 = 0; var_r30 < 2; var_r30++) {
GWPlayerCfg[var_r30].group = 0;
}
for (var_r30 = 2; var_r30 < 4; var_r30++) {
GWPlayerCfg[var_r30].group = 1;
}
break;
}
object->work[3] = 0;
return;
}
if ((var_r23 & 0x200) != 0) {
HuAudFXPlay(3);
e3ExitMode = 0;
e3NextOvl = 0;
e3NextEvent = 0;
e3ExitEnableF = 1;
object->work[3] = 0;
return;
}
if (object->work[3] != 0) {
if ((var_r23 & 8) != 0) {
HuAudFXPlay(0);
var_r31->unk_44--;
if (var_r31->unk_44 < 0) {
var_r31->unk_44 = 0xC;
}
} else if ((var_r23 & 4) != 0) {
HuAudFXPlay(0);
var_r31->unk_44++;
if (var_r31->unk_44 >= 13) {
var_r31->unk_44 = 0;
}
}
if (var_r31->unk_46 != var_r31->unk_44) {
mgPicObj->work[0] = var_r31->unk_44;
var_r27 = var_r31->unk_44 - var_r31->unk_46;
if ((var_r27 > 1) || (var_r27 < -1)) {
if (var_r27 < 0) {
var_r27 = 1;
} else {
var_r27 = -1;
}
}
var_r25 = var_r31->unk_42 + var_r27;
if ((var_r25 < 0) || (var_r25 >= 5)) {
for (var_r30 = 0; var_r30 < 5; var_r30++) {
var_r22 = var_r31->unk_2E[var_r30];
var_r26 = var_r31->unk_38[var_r30];
var_r24 = var_r26 - var_r27;
if ((var_r24 < 0) || (var_r24 >= 5)) {
var_r28 = mgNameTbl[var_r31->unk_44];
HuWinMesSizeCancelCRSet(1);
HuWinMesMaxSizeGet(1, sp8, var_r28);
HuWinCenterPosSet(var_r22, (296.0f - sp8[0]) / -2.0f, (68.0f - sp8[1]) / -2.0f);
HuWinMesSet(var_r22, var_r28);
if (var_r24 < 0) {
var_r26 = 4;
} else {
var_r26 = 0;
}
} else {
var_r26 = var_r24;
}
HuWinPosSet(var_r22, 36.0f, 237.0f + cursorYOfsTbl[var_r26]);
var_r31->unk_38[var_r30] = var_r26;
}
} else {
var_r31->unk_42 = var_r25;
HuSprPosSet(var_r31->unk_1C, 1, 0.0f, cursorYOfsTbl[var_r25]);
}
var_r31->unk_46 = var_r31->unk_44;
}
}
}
}
static void CreateMGSelect(omObjData *object)
{
mgSelect *temp_r31;
s16 temp_r30;
s16 temp_r29;
s32 var_r28;
s16 var_r26;
s16 index2;
u32 temp_r22;
s32 temp_r21;
AnimData *temp_r25;
AnimData *temp_r23;
float sp8[2];
omSetStatBit(object, OM_STAT_MODEL_PAUSED);
object->data = HuMemDirectMallocNum(HEAP_SYSTEM, 0x48, MEMORY_DEFAULT_NUM);
temp_r31 = object->data;
index2 = 0;
temp_r30 = HuSprGrpCreate(3);
temp_r31->unk_1C = temp_r30;
HuSprGrpPosSet(temp_r30, 174.0f, 271.0f);
temp_r25 = HuSprAnimRead(HuDataReadNum(0x21, MEMORY_DEFAULT_NUM));
temp_r31->unk_00[index2] = temp_r25;
temp_r29 = HuSprCreate(temp_r25, 0x7540, 0);
HuSprGrpMemberSet(temp_r30, index2, temp_r29);
index2++;
temp_r25 = HuSprAnimRead(HuDataReadNum(0x27, MEMORY_DEFAULT_NUM));
temp_r31->unk_00[index2] = temp_r25;
temp_r29 = HuSprCreate(temp_r25, 0x64, 0);
HuSprGrpMemberSet(temp_r30, index2, temp_r29);
HuSprScaleSet(temp_r30, index2, 1.1f, 1.0f);
HuSprTPLvlSet(temp_r30, index2, 0.5f);
temp_r31->unk_42 = 0;
HuSprPosSet(temp_r30, index2, 0.0f, cursorYOfsTbl[temp_r31->unk_42]);
index2++;
temp_r25 = HuSprAnimRead(HuDataReadNum(0x35, MEMORY_DEFAULT_NUM));
temp_r31->unk_00[index2++] = temp_r25;
temp_r23 = HuSprAnimRead(HuDataReadNum(0x36, MEMORY_DEFAULT_NUM));
temp_r31->unk_00[index2++] = temp_r23;
temp_r30 = HuSprGrpCreate(2);
temp_r31->unk_1E = temp_r30;
HuSprGrpPosSet(temp_r30, 174.0f, 128.0f);
temp_r29 = HuSprCreate(temp_r25, 4, 0);
HuSprGrpMemberSet(temp_r30, 0, temp_r29);
temp_r29 = HuSprCreate(temp_r23, 6, 0);
HuSprGrpMemberSet(temp_r30, 1, temp_r29);
HuSprTPLvlSet(temp_r30, 1, 0.7f);
HuSprPosSet(temp_r30, 1, 0.0f, -4.0f);
temp_r30 = HuSprGrpCreate(2);
temp_r31->unk_20 = temp_r30;
HuSprGrpPosSet(temp_r30, 174.0f, 414.0f);
temp_r29 = HuSprCreate(temp_r25, 4, 1);
HuSprGrpMemberSet(temp_r30, 0, temp_r29);
temp_r29 = HuSprCreate(temp_r23, 6, 1);
HuSprGrpMemberSet(temp_r30, 1, temp_r29);
HuSprTPLvlSet(temp_r30, 1, 0.7f);
HuSprPosSet(temp_r30, 1, 0.0f, -4.0f);
temp_r21 = GWSystem.mg_next + 401;
var_r26 = temp_r21;
for (var_r28 = 0; var_r28 < 13;) {
if (var_r26 != mgIdTbl[var_r28]) {
var_r28++;
} else {
break;
}
}
if (var_r28 >= 13) {
var_r28 = 0;
}
mgDefault = var_r28;
var_r26 = mgDefault;
mgPicObj->work[0] = var_r26;
temp_r31->unk_44 = var_r26;
temp_r31->unk_46 = var_r26;
for (var_r28 = 0; var_r28 < 5;) {
if (var_r26 >= 13) {
var_r26 = 0;
}
temp_r29 = HuWinCreate(36.0f, 237.0f + cursorYOfsTbl[var_r28], 0x128, 0x44, 0x4E20);
temp_r31->unk_2E[var_r28] = temp_r29;
temp_r31->unk_38[var_r28] = var_r28;
HuWinBGTPLvlSet(temp_r29, 0.0f);
HuWinMesSpeedSet(temp_r29, 0);
temp_r22 = mgNameTbl[var_r26];
HuWinAttrSet(temp_r29, 0x100);
HuWinMesSizeCancelCRSet(1);
HuWinMesMaxSizeGet(1, sp8, temp_r22);
HuWinCenterPosSet(temp_r29, (296.0f - sp8[0]) / -2.0f, (68.0f - sp8[1]) / -2.0f);
HuWinMesSet(temp_r29, temp_r22);
var_r28++;
var_r26++;
}
object->work[3] = 1;
object->func = UpdateMGSelect;
}
static void UpdateMGPic(omObjData *object)
{
mgPic *temp_r30 = (mgPic *)object->data;
s16 temp_r29;
if (object->work[1] != object->work[0]) {
temp_r29 = temp_r30->unk_40;
HuSprAttrSet(temp_r29, object->work[1], 4);
HuSprAttrReset(temp_r29, object->work[0], 4);
object->work[1] = object->work[0];
}
}
static void CreateMGPic(omObjData *object)
{
mgPic *temp_r28;
AnimData *temp_r3_2;
s16 temp_r3;
s32 var_r30;
s32 index;
s16 index2;
s16 group;
omSetStatBit(object, OM_STAT_MODEL_PAUSED);
object->data = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(mgPic), MEMORY_DEFAULT_NUM);
temp_r28 = object->data;
index2 = 0;
temp_r3 = HuSprGrpCreate(14);
temp_r28->unk_40 = temp_r3;
HuSprGrpPosSet(temp_r3, 444.0f, 228.0f);
for (var_r30 = 0; var_r30 < 13; var_r30++) {
temp_r3_2 = HuSprAnimRead(HuDataReadNum(mgPicTbl[var_r30], MEMORY_DEFAULT_NUM));
temp_r28->unk_00[var_r30] = temp_r3_2;
group = HuSprCreate(temp_r3_2, 0x2710, 0);
HuSprGrpMemberSet(temp_r3, var_r30, group);
HuSprScaleSet(temp_r3, var_r30, 0.6f, 0.6f);
HuSprAttrSet(temp_r3, var_r30, 4);
}
index2 = var_r30;
temp_r3_2 = HuSprAnimRead(HuDataReadNum(0x22, MEMORY_DEFAULT_NUM));
temp_r28->unk_00[index2] = temp_r3_2;
group = HuSprCreate(temp_r3_2, 0x7540, 0);
HuSprGrpMemberSet(temp_r3, index2, group);
HuSprTPLvlSet(temp_r3, index2, 0.7f);
index2++;
object->work[1] = object->work[0];
HuSprAttrReset(temp_r3, object->work[1], 4);
object->func = UpdateMGPic;
}
static void UpdateMGInterface(omObjData *object) { void *sp8 = object->data; }
static void CreateMGInterface(omObjData *object)
{
mgInterface *unkStruct;
s16 index;
s16 group;
s16 index2;
AnimData *temp_r3_2;
float sp8[2];
omSetStatBit(object, OM_STAT_MODEL_PAUSED);
object->data = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(mgInterface), MEMORY_DEFAULT_NUM);
unkStruct = object->data;
index2 = 0;
group = HuSprGrpCreate(1);
unkStruct->group = group;
HuSprGrpPosSet(group, 288.0f, 64.0f);
temp_r3_2 = HuSprAnimRead(HuDataReadNum(0x24, MEMORY_DEFAULT_NUM));
unkStruct->unk_00[index2] = temp_r3_2;
index = HuSprCreate(temp_r3_2, 0x2710, 0);
HuSprGrpMemberSet(group, 0, index);
index2++;
group = HuSprGrpCreate(1);
unkStruct->group2 = group;
HuSprGrpPosSet(group, 444.0f, 384.0f);
temp_r3_2 = HuSprAnimRead(HuDataReadNum(0x23, MEMORY_DEFAULT_NUM));
unkStruct->unk_00[index2] = temp_r3_2;
index = HuSprCreate(temp_r3_2, 0x271A, 0);
HuSprGrpMemberSet(group, 0, index);
index2++;
HuWinMesMaxSizeGet(1, sp8, &startText);
index = HuWinCreate(340.0f, 362.0f, sp8[0], sp8[1], 0);
unkStruct->unk_2C = index;
HuWinMesColSet(index, 0);
HuWinBGTPLvlSet(index, 0.0f);
HuWinMesSpeedSet(index, 0);
HuWinMesSet(index, MAKE_MESSID_PTR(startText));
object->func = UpdateMGInterface;
}

View file

@ -0,0 +1,2 @@
build_system = "ninja"
compiler_type = "mwcc"