Named most things in presentDll
This commit is contained in:
parent
a7bde60c97
commit
3a7cde9f33
7 changed files with 1301 additions and 1127 deletions
|
|
@ -7,69 +7,74 @@
|
|||
|
||||
#include "REL/present.h"
|
||||
|
||||
typedef struct UnkPresentStruct {
|
||||
/* 0x00 */ UnkWindowDataStruct *unk_00;
|
||||
/* 0x04 */ s32 unk_04;
|
||||
} UnkPresentStruct; /* size = 0x08 */
|
||||
typedef struct StateWork {
|
||||
/* 0x00 */ PresentWindow *window;
|
||||
/* 0x04 */ s32 quitTimer;
|
||||
} StateWork; /* size = 0x08 */
|
||||
|
||||
typedef struct UnkPresentStruct4 {
|
||||
/* 0x00 */ Vec unk_00;
|
||||
/* 0x0C */ Vec unk_0C;
|
||||
/* 0x18 */ Vec unk_18;
|
||||
} UnkPresentStruct4; /* size = 0x1C */
|
||||
typedef struct UnkShadowDataStruct {
|
||||
/* 0x00 */ Vec pos;
|
||||
/* 0x0C */ Vec up;
|
||||
/* 0x18 */ Vec target;
|
||||
} UnkShadowDataStruct; /* size = 0x24 */
|
||||
|
||||
omObjData *lbl_1_bss_20;
|
||||
omObjData *presentGuide;
|
||||
|
||||
UnkPresentStruct4 lbl_1_data_F0 = { { 0.0f, 3000.0f, 1.0f }, { 0.0f, 1.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } };
|
||||
static UnkShadowDataStruct shadowPosTbl = {
|
||||
{ 0.0f, 3000.0f, 1.0f },
|
||||
{ 0.0f, 1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
};
|
||||
|
||||
static void fn_1_3B8C(omObjData *object);
|
||||
static void fn_1_3DB8(omObjData *object);
|
||||
static void fn_1_4190(UnkWindowDataStruct *arg0);
|
||||
static void fn_1_41BC(UnkWindowDataStruct *arg0, s32 arg1);
|
||||
static void fn_1_41E0(void);
|
||||
static void ExecPresentView(omObjData *object);
|
||||
static void ExecPresentGet(omObjData *object);
|
||||
void PresentWinDispOff(PresentWindow *work);
|
||||
void PresentWinChoiceSet(PresentWindow *work, s32 choice);
|
||||
static void ExecWindow(void);
|
||||
|
||||
omObjData *fn_1_39A8(void)
|
||||
omObjData *PresentStateCreate(void)
|
||||
{
|
||||
omObjData *object = omAddObjEx(lbl_1_bss_4, 1000, 0, 0, 4, NULL);
|
||||
UnkPresentStruct *var_r30 = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(UnkPresentStruct), MEMORY_DEFAULT_NUM);
|
||||
object->data = var_r30;
|
||||
omObjData *object = omAddObjEx(presentObjMan, 1000, 0, 0, 4, NULL);
|
||||
StateWork *work = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(StateWork), MEMORY_DEFAULT_NUM);
|
||||
object->data = work;
|
||||
|
||||
var_r30->unk_04 = 0;
|
||||
lbl_1_bss_8 = fn_1_6B4();
|
||||
lbl_1_bss_10 = fn_1_1458();
|
||||
lbl_1_bss_20 = fn_1_42F4();
|
||||
var_r30->unk_00 = fn_1_3EA4(0);
|
||||
work->quitTimer = 0;
|
||||
presentCamera = PresentCameraCreate();
|
||||
present = PresentCreate();
|
||||
presentGuide = PresentGuideCreate();
|
||||
work->window = PresentWinCreate(0);
|
||||
Hu3DShadowCreate(30.0f, 20.0f, 5000.0f);
|
||||
Hu3DShadowTPLvlSet(0.45f);
|
||||
Hu3DShadowPosSet(&lbl_1_data_F0.unk_00, &lbl_1_data_F0.unk_0C, &lbl_1_data_F0.unk_18);
|
||||
Hu3DShadowPosSet(&shadowPosTbl.pos, &shadowPosTbl.up, &shadowPosTbl.target);
|
||||
|
||||
if (omovlevtno > 0) {
|
||||
OSReport("*** PRESENTROOM ( PRESENT GET MODE ) ***\n");
|
||||
object->func = fn_1_3DB8;
|
||||
object->func = ExecPresentGet;
|
||||
object->unk10 = 0;
|
||||
}
|
||||
else {
|
||||
OSReport("*** PRESENTROOM ( PRESENT VIEW MODE ) ***\n");
|
||||
object->func = fn_1_3B8C;
|
||||
object->func = ExecPresentView;
|
||||
object->unk10 = 0;
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
void fn_1_3B18(omObjData *object)
|
||||
void PresentStateKill(omObjData *object)
|
||||
{
|
||||
UnkWindowDataStruct **var_r31 = object->data;
|
||||
PresentWindow **var_r31 = object->data;
|
||||
|
||||
fn_1_8F0(lbl_1_bss_8);
|
||||
fn_1_1784(lbl_1_bss_10);
|
||||
fn_1_4534(lbl_1_bss_20);
|
||||
fn_1_4040(*var_r31);
|
||||
PresentCameraKill(presentCamera);
|
||||
PresentKill(present);
|
||||
PresentGuideKill(presentGuide);
|
||||
PresentWinKill(*var_r31);
|
||||
HuMemDirectFree(var_r31);
|
||||
}
|
||||
|
||||
static void fn_1_3B8C(omObjData *object)
|
||||
static void ExecPresentView(omObjData *object)
|
||||
{
|
||||
UnkPresentStruct *var_r30 = object->data;
|
||||
StateWork *work = object->data;
|
||||
|
||||
switch (object->unk10) {
|
||||
case 0:
|
||||
|
|
@ -81,39 +86,39 @@ static void fn_1_3B8C(omObjData *object)
|
|||
}
|
||||
object->unk10 = 2;
|
||||
case 2:
|
||||
fn_1_180C(lbl_1_bss_10, 1);
|
||||
PresentExecModeSet(present, 1);
|
||||
object->unk10 = 3;
|
||||
case 3:
|
||||
if (fn_1_1850(lbl_1_bss_10)) {
|
||||
if (PresentExecModeGet(present)) {
|
||||
return;
|
||||
}
|
||||
object->unk10 = 4;
|
||||
case 4:
|
||||
fn_1_45C0(lbl_1_bss_20, 1);
|
||||
PresentGuideExecModeSet(presentGuide, PRESENT_GUIDE_MODE_ENTER);
|
||||
object->unk10 = 5;
|
||||
case 5:
|
||||
if (fn_1_4604(lbl_1_bss_20)) {
|
||||
if (PresentGuideExecModeGet(presentGuide)) {
|
||||
return;
|
||||
}
|
||||
object->unk10 = 6;
|
||||
case 6:
|
||||
HuAudFXPlay(66);
|
||||
fn_1_4080(var_r30->unk_00);
|
||||
fn_1_40B0(var_r30->unk_00, 0x320002);
|
||||
PresentWinAnimIn(work->window);
|
||||
PresentWinMesSet(work->window, 0x320002);
|
||||
object->unk10 = 7;
|
||||
case 7:
|
||||
if (var_r30->unk_00->unk_20) {
|
||||
if (work->window->state) {
|
||||
return;
|
||||
}
|
||||
fn_1_41BC(var_r30->unk_00, 1);
|
||||
PresentWinChoiceSet(work->window, 1);
|
||||
object->unk10 = 8;
|
||||
case 8:
|
||||
if (var_r30->unk_00->unk_20) {
|
||||
if (work->window->state) {
|
||||
return;
|
||||
}
|
||||
fn_1_4098(var_r30->unk_00);
|
||||
if (!var_r30->unk_00->choice) {
|
||||
var_r30->unk_04 = 0;
|
||||
PresentWinAnimOut(work->window);
|
||||
if (!work->window->choice) {
|
||||
work->quitTimer = 0;
|
||||
object->unk10 = 11;
|
||||
return;
|
||||
}
|
||||
|
|
@ -122,23 +127,23 @@ static void fn_1_3B8C(omObjData *object)
|
|||
return;
|
||||
}
|
||||
case 9:
|
||||
fn_1_45C0(lbl_1_bss_20, 2);
|
||||
PresentGuideExecModeSet(presentGuide, PRESENT_GUIDE_MODE_LEAVE);
|
||||
object->unk10 = 10;
|
||||
return;
|
||||
case 10:
|
||||
if (fn_1_4604(lbl_1_bss_20)) {
|
||||
if (PresentGuideExecModeGet(presentGuide)) {
|
||||
return;
|
||||
}
|
||||
object->unk10 = 2;
|
||||
return;
|
||||
case 11:
|
||||
object->unk10 = 12;
|
||||
var_r30->unk_04 = 0;
|
||||
work->quitTimer = 0;
|
||||
case 12:
|
||||
if (var_r30->unk_00->unk_20) {
|
||||
if (work->window->state) {
|
||||
return;
|
||||
}
|
||||
if (var_r30->unk_04++ >= 60) {
|
||||
if (work->quitTimer++ >= 60) {
|
||||
omSysExitReq = 1;
|
||||
object->func = NULL;
|
||||
object->unk10 = 0;
|
||||
|
|
@ -148,48 +153,48 @@ static void fn_1_3B8C(omObjData *object)
|
|||
}
|
||||
}
|
||||
|
||||
static void fn_1_3DB8(omObjData *arg0)
|
||||
static void ExecPresentGet(omObjData *object)
|
||||
{
|
||||
void *sp8 = arg0->data;
|
||||
void *sp8 = object->data;
|
||||
|
||||
switch (arg0->unk10) {
|
||||
switch (object->unk10) {
|
||||
case 0:
|
||||
fn_1_186C(lbl_1_bss_10, omovlevtno - 1);
|
||||
arg0->unk10 = 1;
|
||||
PresentSelectedIDSet(present, omovlevtno - 1);
|
||||
object->unk10 = 1;
|
||||
case 1:
|
||||
fn_1_180C(lbl_1_bss_10, 3);
|
||||
arg0->unk10 = 2;
|
||||
PresentExecModeSet(present, PRESENT_MODE_GET);
|
||||
object->unk10 = 2;
|
||||
case 2:
|
||||
if (!fn_1_1850(lbl_1_bss_10)) {
|
||||
arg0->unk10 = 3;
|
||||
if (PresentExecModeGet(present) == PRESENT_MODE_NONE) {
|
||||
object->unk10 = 3;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
arg0->unk10 = 4;
|
||||
object->unk10 = 4;
|
||||
case 4:
|
||||
omSysExitReq = 1;
|
||||
arg0->func = NULL;
|
||||
arg0->unk10 = 0;
|
||||
object->func = NULL;
|
||||
object->unk10 = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UnkWindowDataStruct *fn_1_3EA4(s32 arg0)
|
||||
PresentWindow *PresentWinCreate(s32 id)
|
||||
{
|
||||
UnkWindowDataStruct *var_r31 = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(UnkWindowDataStruct), MEMORY_DEFAULT_NUM);
|
||||
PresentWindow *var_r31 = HuMemDirectMallocNum(HEAP_SYSTEM, sizeof(PresentWindow), MEMORY_DEFAULT_NUM);
|
||||
|
||||
var_r31->unk18 = 0;
|
||||
var_r31->unk10 = 0;
|
||||
var_r31->unk14 = 0;
|
||||
var_r31->unk_20 = 0;
|
||||
var_r31->process = HuPrcChildCreate(fn_1_41E0, 1000, 8192, 0, lbl_1_bss_4);
|
||||
var_r31->messToBeSet = 0;
|
||||
var_r31->messWaitSignal = 0;
|
||||
var_r31->choiceSignal = 0;
|
||||
var_r31->state = 0;
|
||||
var_r31->process = HuPrcChildCreate(ExecWindow, 1000, 8192, 0, presentObjMan);
|
||||
var_r31->process->user_data = var_r31;
|
||||
var_r31->unk08 = arg0;
|
||||
switch (arg0) {
|
||||
var_r31->id = id;
|
||||
switch (id) {
|
||||
case 0:
|
||||
var_r31->window = HuWinExCreateStyled(-10000.0f, 360.0f, 480, 80, -1, 1);
|
||||
HuWinBGTPLvlSet(var_r31->window, 0.8f);
|
||||
|
|
@ -204,112 +209,112 @@ UnkWindowDataStruct *fn_1_3EA4(s32 arg0)
|
|||
break;
|
||||
}
|
||||
HuWinDrawNoSet(var_r31->window, 63);
|
||||
fn_1_4190(var_r31);
|
||||
PresentWinDispOff(var_r31);
|
||||
HuSprExecLayerSet(63, 2);
|
||||
return var_r31;
|
||||
}
|
||||
|
||||
void fn_1_4040(UnkWindowDataStruct *windowData)
|
||||
void PresentWinKill(PresentWindow *work)
|
||||
{
|
||||
HuWinExCleanup(windowData->window);
|
||||
HuPrcKill(windowData->process);
|
||||
HuMemDirectFree(windowData);
|
||||
HuWinExCleanup(work->window);
|
||||
HuPrcKill(work->process);
|
||||
HuMemDirectFree(work);
|
||||
}
|
||||
|
||||
void fn_1_4080(UnkWindowDataStruct *windowData)
|
||||
void PresentWinAnimIn(PresentWindow *work)
|
||||
{
|
||||
if (!windowData->unk0C) {
|
||||
windowData->unk_20 = 1;
|
||||
if (!work->visible) {
|
||||
work->state = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void fn_1_4098(UnkWindowDataStruct *windowData)
|
||||
void PresentWinAnimOut(PresentWindow *work)
|
||||
{
|
||||
if (windowData->unk0C) {
|
||||
windowData->unk_20 = 2;
|
||||
if (work->visible) {
|
||||
work->state = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void fn_1_40B0(UnkWindowDataStruct *windowData, u32 mess)
|
||||
void PresentWinMesSet(PresentWindow *work, u32 mess)
|
||||
{
|
||||
if (!windowData->unk_20) {
|
||||
HuWinMesSet(windowData->window, mess);
|
||||
if (!work->state) {
|
||||
HuWinMesSet(work->window, mess);
|
||||
return;
|
||||
}
|
||||
windowData->unk18 = mess;
|
||||
work->messToBeSet = mess;
|
||||
}
|
||||
|
||||
void fn_1_4104(UnkWindowDataStruct *windowData, u32 mess, s16 index)
|
||||
void PresentWinInsertMesSet(PresentWindow *work, u32 mess, s16 index)
|
||||
{
|
||||
HuWinInsertMesSet(windowData->window, mess, index);
|
||||
HuWinInsertMesSet(work->window, mess, index);
|
||||
}
|
||||
|
||||
static void fn_1_4144(UnkWindowDataStruct *windowData, float x, float y)
|
||||
void PresentWinPosSet(PresentWindow *work, float x, float y)
|
||||
{
|
||||
HuWinPosSet(windowData->window, x, y);
|
||||
HuWinPosSet(work->window, x, y);
|
||||
}
|
||||
|
||||
static void fn_1_4184(UnkWindowDataStruct *windowData)
|
||||
void PresentWinDispOn(PresentWindow *work)
|
||||
{
|
||||
windowData->unk0C = 1;
|
||||
work->visible = TRUE;
|
||||
}
|
||||
|
||||
static void fn_1_4190(UnkWindowDataStruct *windowData)
|
||||
void PresentWinDispOff(PresentWindow *work)
|
||||
{
|
||||
windowData->unk0C = 0;
|
||||
work->visible = FALSE;
|
||||
}
|
||||
|
||||
void fn_1_419C(UnkWindowDataStruct *windowData)
|
||||
void PresentWinMesWait(PresentWindow *work)
|
||||
{
|
||||
if (!windowData->unk_20) {
|
||||
windowData->unk_20 = 3;
|
||||
if (!work->state) {
|
||||
work->state = 3;
|
||||
}
|
||||
windowData->unk10 = 1;
|
||||
work->messWaitSignal = 1;
|
||||
}
|
||||
|
||||
static void fn_1_41BC(UnkWindowDataStruct *windowData, s32 arg1)
|
||||
void PresentWinChoiceSet(PresentWindow *work, s32 choice)
|
||||
{
|
||||
if (!windowData->unk_20) {
|
||||
windowData->unk_20 = 4;
|
||||
if (!work->state) {
|
||||
work->state = 4;
|
||||
}
|
||||
windowData->unk14 = 1;
|
||||
windowData->choice = arg1;
|
||||
work->choiceSignal = 1;
|
||||
work->choice = choice;
|
||||
}
|
||||
|
||||
static void fn_1_41E0(void)
|
||||
static void ExecWindow(void)
|
||||
{
|
||||
UnkWindowDataStruct *windowData = HuPrcCurrentGet()->user_data;
|
||||
PresentWindow *work = HuPrcCurrentGet()->user_data;
|
||||
|
||||
while (TRUE) {
|
||||
switch (windowData->unk_20) {
|
||||
switch (work->state) {
|
||||
case 1:
|
||||
windowData->unk0C = 1;
|
||||
HuWinExAnimIn(windowData->window);
|
||||
work->visible = 1;
|
||||
HuWinExAnimIn(work->window);
|
||||
break;
|
||||
case 2:
|
||||
HuWinExAnimOut(windowData->window);
|
||||
windowData->unk0C = 0;
|
||||
HuWinExAnimOut(work->window);
|
||||
work->visible = 0;
|
||||
break;
|
||||
case 3:
|
||||
winData[windowData->window].active_pad = 1;
|
||||
HuWinMesWait(windowData->window);
|
||||
windowData->unk10 = 0;
|
||||
winData[work->window].active_pad = 1;
|
||||
HuWinMesWait(work->window);
|
||||
work->messWaitSignal = 0;
|
||||
break;
|
||||
case 4:
|
||||
windowData->choice = HuWinChoiceGet(windowData->window, windowData->choice);
|
||||
windowData->unk14 = 0;
|
||||
work->choice = HuWinChoiceGet(work->window, work->choice);
|
||||
work->choiceSignal = 0;
|
||||
break;
|
||||
}
|
||||
if (windowData->unk18 != 0) {
|
||||
HuWinMesSet(windowData->window, windowData->unk18);
|
||||
windowData->unk18 = 0;
|
||||
if (work->messToBeSet != 0) {
|
||||
HuWinMesSet(work->window, work->messToBeSet);
|
||||
work->messToBeSet = 0;
|
||||
}
|
||||
windowData->unk_20 = 0;
|
||||
if (windowData->unk10 != 0) {
|
||||
windowData->unk_20 = 3;
|
||||
work->state = 0;
|
||||
if (work->messWaitSignal != 0) {
|
||||
work->state = 3;
|
||||
}
|
||||
if (windowData->unk14 != 0) {
|
||||
windowData->unk_20 = 4;
|
||||
if (work->choiceSignal != 0) {
|
||||
work->state = 4;
|
||||
}
|
||||
HuPrcVSleep();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue