Skip to content

Commit

Permalink
A bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Feb 27, 2025
1 parent b1f2d81 commit 9b6e3e8
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 24 deletions.
14 changes: 7 additions & 7 deletions config/SOUE01/rels/d_a_obj_dungeon_shipNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ _unresolved = .text:0x00000060; // type:function size:0x4 scope:global
__register_global_object = .text:0x00000070; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global
dAcODungeonShip_c_classInit__Fv = .text:0x000000F0; // type:function size:0x1CC
fn_485_2C0 = .text:0x000002C0; // type:function size:0x58
fn_485_320 = .text:0x00000320; // type:function size:0x40
__dt__12TimeProcBaseFv = .text:0x000002C0; // type:function size:0x58
__dt__Q34nw4r3g3d15IScnObjCallbackFv = .text:0x00000320; // type:function size:0x40
__dt__30sFState_c<17dAcODungeonShip_c>Fv = .text:0x00000360; // type:function size:0x58
__dt__33sFStateFct_c<17dAcODungeonShip_c>Fv = .text:0x000003C0; // type:function size:0x6C
__dt__86sStateMgr_c<17dAcODungeonShip_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000430; // type:function size:0xA0
Expand Down Expand Up @@ -38,12 +38,12 @@ eventIn__17dAcODungeonShip_cFv = .text:0x00001610; // type:function size:0x4
eventEnd__17dAcODungeonShip_cFv = .text:0x00001620; // type:function size:0x3C
fn_485_1660__17dAcODungeonShip_cFv = .text:0x00001660; // type:function size:0xB4
fn_485_1720__17dAcODungeonShip_cFv = .text:0x00001720; // type:function size:0x110
fn_485_1830 = .text:0x00001830; // type:function size:0xC8
fn_485_1830__17dAcODungeonShip_cFllPl = .text:0x00001830; // type:function size:0xC8
fn_485_1900__17dAcODungeonShip_cFv = .text:0x00001900; // type:function size:0x58
fn_485_1960 = .text:0x00001960; // type:function size:0xE8
fn_485_1A50 = .text:0x00001A50; // type:function size:0xC
fn_485_1A60 = .text:0x00001A60; // type:function size:0xC
fn_485_1A70 = .text:0x00001A70; // type:function size:0x18
fn_485_1960__17dAcODungeonShip_cFv = .text:0x00001960; // type:function size:0xE8
fn_485_1A50__17dAcODungeonShip_cFv = .text:0x00001A50; // type:function size:0xC
fn_485_1A60__17dAcODungeonShip_cFv = .text:0x00001A60; // type:function size:0xC
fn_485_1A70__17dAcODungeonShip_cFP7mVec3_c = .text:0x00001A70; // type:function size:0x18
fn_485_1A90__17dAcODungeonShip_cFv = .text:0x00001A90; // type:function size:0x154
fn_485_1BF0__17dAcODungeonShip_cFv = .text:0x00001BF0; // type:function size:0x200
fn_485_1DF0__17dAcODungeonShip_cFv = .text:0x00001DF0; // type:function size:0xA0
Expand Down
72 changes: 67 additions & 5 deletions config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ fn_800298C0 = .text:0x800298C0; // type:function size:0x4C
fn_80029910 = .text:0x80029910; // type:function size:0x4
fn_80029920 = .text:0x80029920; // type:function size:0x54
fn_80029980 = .text:0x80029980; // type:function size:0x64
fn_800299F0 = .text:0x800299F0; // type:function size:0x20
fn_800299F0__13EffectsStructFUsP6mMtx_cPvPv = .text:0x800299F0; // type:function size:0x20
fn_80029A10__13EffectsStructFUsP7mVec3_cP7mAng3_cP7mVec3_cPvPv = .text:0x80029A10; // type:function size:0x54
fn_80029A70 = .text:0x80029A70; // type:function size:0x64
fn_80029AE0 = .text:0x80029AE0; // type:function size:0x20
Expand Down Expand Up @@ -3691,7 +3691,7 @@ fn_800A6F90 = .text:0x800A6F90; // type:function size:0x184
fn_800A7120 = .text:0x800A7120; // type:function size:0x464
fn_800A7590 = .text:0x800A7590; // type:function size:0x3BC
fn_800A7950 = .text:0x800A7950; // type:function size:0x324
fn_800A7C80 = .text:0x800A7C80; // type:function size:0x4CC
fn_800A7C80__11ActorOnRailFiR7mVec3_cf = .text:0x800A7C80; // type:function size:0x4CC
fn_800A8150 = .text:0x800A8150; // type:function size:0x124
fn_800A8280 = .text:0x800A8280; // type:function size:0x138
fn_800A83C0 = .text:0x800A83C0; // type:function size:0x144
Expand All @@ -3713,7 +3713,7 @@ fn_800A9470 = .text:0x800A9470; // type:function size:0x74
__ct__15ActorOnRail_ExtFv = .text:0x800A94F0; // type:function size:0x60
__dt__15ActorOnRail_ExtFv = .text:0x800A9550; // type:function size:0x58
initExt__15ActorOnRail_ExtFiiiiifff = .text:0x800A95B0; // type:function size:0x9C
fn_800A9650 = .text:0x800A9650; // type:function size:0x208
fn_800A9650__15ActorOnRail_ExtFv = .text:0x800A9650; // type:function size:0x208
fn_800A9860 = .text:0x800A9860; // type:function size:0x50
fn_800A98B0 = .text:0x800A98B0; // type:function size:0x58
fn_800A9910 = .text:0x800A9910; // type:function size:0x48
Expand Down Expand Up @@ -17871,7 +17871,7 @@ fn_802F2920 = .text:0x802F2920; // type:function size:0x48
createProjectionXZ__7mVec3_cFRC7mAng3_cf = .text:0x802F2970; // type:function size:0x110
mVec__fromXY = .text:0x802F2A80; // type:function size:0xF0
normalize__7mVec3_cFv = .text:0x802F2B70; // type:function size:0x78
mVec__normalizeRS = .text:0x802F2BF0; // type:function size:0x84
normalizeRS__7mVec3_cFv = .text:0x802F2BF0; // type:function size:0x84
rotX__7mVec3_cFRC4mAng = .text:0x802F2C80; // type:function size:0xA8
rotY__7mVec3_cFRC4mAng = .text:0x802F2D30; // type:function size:0xAC
rotZ__7mVec3_cFRC4mAng = .text:0x802F2DE0; // type:function size:0xA8
Expand Down Expand Up @@ -44021,7 +44021,69 @@ PARTICLE_RESOURCE_ID_MAPPING_620_ = .sdata2:0x8057A888; // type:object size:0x2
PARTICLE_RESOURCE_ID_MAPPING_621_ = .sdata2:0x8057A88A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_622_ = .sdata2:0x8057A88C; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_623_ = .sdata2:0x8057A88E; // type:object size:0x2
PARTICLE_RESOURCE_ID_MAPPING_624_ = .sdata2:0x8057A890; // type:object size:0x7E data:2byte
PARTICLE_RESOURCE_ID_MAPPING_624_ = .sdata2:0x8057A890; // type:object size:0x2 data:2byte
lbl_8057A892 = .sdata2:0x8057A892; // type:object size:0x2
lbl_8057A894 = .sdata2:0x8057A894; // type:object size:0x2
lbl_8057A896 = .sdata2:0x8057A896; // type:object size:0x2
lbl_8057A898 = .sdata2:0x8057A898; // type:object size:0x2
lbl_8057A89A = .sdata2:0x8057A89A; // type:object size:0x2
lbl_8057A89C = .sdata2:0x8057A89C; // type:object size:0x2
lbl_8057A89E = .sdata2:0x8057A89E; // type:object size:0x2
lbl_8057A8A0 = .sdata2:0x8057A8A0; // type:object size:0x2
lbl_8057A8A2 = .sdata2:0x8057A8A2; // type:object size:0x2
lbl_8057A8A4 = .sdata2:0x8057A8A4; // type:object size:0x2
lbl_8057A8A6 = .sdata2:0x8057A8A6; // type:object size:0x2
lbl_8057A8A8 = .sdata2:0x8057A8A8; // type:object size:0x2
lbl_8057A8AA = .sdata2:0x8057A8AA; // type:object size:0x2
lbl_8057A8AC = .sdata2:0x8057A8AC; // type:object size:0x2
lbl_8057A8AE = .sdata2:0x8057A8AE; // type:object size:0x2
lbl_8057A8B0 = .sdata2:0x8057A8B0; // type:object size:0x2
lbl_8057A8B2 = .sdata2:0x8057A8B2; // type:object size:0x2
lbl_8057A8B4 = .sdata2:0x8057A8B4; // type:object size:0x2
lbl_8057A8B6 = .sdata2:0x8057A8B6; // type:object size:0x2
lbl_8057A8B8 = .sdata2:0x8057A8B8; // type:object size:0x2
lbl_8057A8BA = .sdata2:0x8057A8BA; // type:object size:0x2
lbl_8057A8BC = .sdata2:0x8057A8BC; // type:object size:0x2
lbl_8057A8BE = .sdata2:0x8057A8BE; // type:object size:0x2
lbl_8057A8C0 = .sdata2:0x8057A8C0; // type:object size:0x2
lbl_8057A8C2 = .sdata2:0x8057A8C2; // type:object size:0x2
lbl_8057A8C4 = .sdata2:0x8057A8C4; // type:object size:0x2
lbl_8057A8C6 = .sdata2:0x8057A8C6; // type:object size:0x2
lbl_8057A8C8 = .sdata2:0x8057A8C8; // type:object size:0x2
lbl_8057A8CA = .sdata2:0x8057A8CA; // type:object size:0x2
lbl_8057A8CC = .sdata2:0x8057A8CC; // type:object size:0x2
lbl_8057A8CE = .sdata2:0x8057A8CE; // type:object size:0x2
lbl_8057A8D0 = .sdata2:0x8057A8D0; // type:object size:0x2
lbl_8057A8D2 = .sdata2:0x8057A8D2; // type:object size:0x2
lbl_8057A8D4 = .sdata2:0x8057A8D4; // type:object size:0x2
lbl_8057A8D6 = .sdata2:0x8057A8D6; // type:object size:0x2
lbl_8057A8D8 = .sdata2:0x8057A8D8; // type:object size:0x2
lbl_8057A8DA = .sdata2:0x8057A8DA; // type:object size:0x2
lbl_8057A8DC = .sdata2:0x8057A8DC; // type:object size:0x2
lbl_8057A8DE = .sdata2:0x8057A8DE; // type:object size:0x2
lbl_8057A8E0 = .sdata2:0x8057A8E0; // type:object size:0x2
lbl_8057A8E2 = .sdata2:0x8057A8E2; // type:object size:0x2
lbl_8057A8E4 = .sdata2:0x8057A8E4; // type:object size:0x2
lbl_8057A8E6 = .sdata2:0x8057A8E6; // type:object size:0x2
lbl_8057A8E8 = .sdata2:0x8057A8E8; // type:object size:0x2
lbl_8057A8EA = .sdata2:0x8057A8EA; // type:object size:0x2
lbl_8057A8EC = .sdata2:0x8057A8EC; // type:object size:0x2
lbl_8057A8EE = .sdata2:0x8057A8EE; // type:object size:0x2
lbl_8057A8F0 = .sdata2:0x8057A8F0; // type:object size:0x2
lbl_8057A8F2 = .sdata2:0x8057A8F2; // type:object size:0x2
lbl_8057A8F4 = .sdata2:0x8057A8F4; // type:object size:0x2
lbl_8057A8F6 = .sdata2:0x8057A8F6; // type:object size:0x2
lbl_8057A8F8 = .sdata2:0x8057A8F8; // type:object size:0x2
lbl_8057A8FA = .sdata2:0x8057A8FA; // type:object size:0x2
lbl_8057A8FC = .sdata2:0x8057A8FC; // type:object size:0x2
lbl_8057A8FE = .sdata2:0x8057A8FE; // type:object size:0x2
lbl_8057A900 = .sdata2:0x8057A900; // type:object size:0x2
lbl_8057A902 = .sdata2:0x8057A902; // type:object size:0x2
PARTICLE_RESOURCE_ID_MAPPING_682_ = .sdata2:0x8057A904; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_683_ = .sdata2:0x8057A906; // type:object size:0x2 data:2byte
lbl_8057A908 = .sdata2:0x8057A908; // type:object size:0x2
lbl_8057A90A = .sdata2:0x8057A90A; // type:object size:0x2
lbl_8057A90C = .sdata2:0x8057A90C; // type:object size:0x2
PARTICLE_RESOURCE_ID_MAPPING_687_ = .sdata2:0x8057A90E; // type:object size:0x12 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_696_ = .sdata2:0x8057A920; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_697_ = .sdata2:0x8057A922; // type:object size:0xC data:2byte
Expand Down
12 changes: 10 additions & 2 deletions include/d/a/obj/d_a_obj_dungeon_ship.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ class dAcODungeonShip_c : public dAcObjBase_c {

void fn_485_1660();
void fn_485_1720();
u32 fn_485_1900();
bool fn_485_1830(s32 pathSegmentIndex, s32 direction, s32 *out);
u16 fn_485_1900();
u32 fn_485_1960();
f32 fn_485_1A50();
f32 fn_485_1A60();
static void fn_485_1A70(mVec3_c *);

void fn_485_1A90();
void fn_485_1BF0();
void fn_485_1DF0();
Expand Down Expand Up @@ -72,12 +77,15 @@ class dAcODungeonShip_c : public dAcObjBase_c {
/* 0x849 */ u8 field_0x849;
/* 0x84A */ u8 mAppearEvent;
/* 0x84B */ u8 mPathIdx;
/* 0x84C */ u8 field_0x84C[0x850 - 0x84C];
/* 0x84C */ u16 field_0x84C;
/* 0x850 */ u32 field_0x850;
/* 0x854 */ u8 mNumTimesHit;
/* 0x855 */ u8 field_0x855;
/* 0x856 */ s8 field_0x856;
/* 0x858 */ f32 field_0x858;
/* 0x85C */ UNKWORD field_0x85C;
/* 0x862 */ u8 field_0x860;
/* 0x862 */ u8 field_0x861;
/* 0x862 */ u8 field_0x862;
/* 0x863 */ u8 field_0x863;
/* 0x864 */ u8 field_0x864;
Expand Down
14 changes: 13 additions & 1 deletion include/toBeSorted/actor_on_rail.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class ActorOnRail {
bool init(int pathIndex, int roomId, int pathSubtype);
/* 800A68B0 */
mVec3_c *getPntPosForIndex(int index);

void fn_800A7C80(int segmentIndex, mVec3_c &vec, f32 segmentFraction);
};

class ActorOnRail_Ext : public ActorOnRail {
Expand All @@ -29,7 +31,12 @@ class ActorOnRail_Ext : public ActorOnRail {

void setSegment(u16 segmentIndex, f32 segmentFraction);
bool initExt(int pathIndex, int roomId, int, int pathSegment, int pathSubtype, f32, f32, f32);
void fn_800A9650();

s32 getSegmentIndex() const {
return mSegmentIndex;
}

f32 getSegmentFraction() const {
return mSegmentFraction;
}
Expand All @@ -50,11 +57,16 @@ class ActorOnRail_Ext : public ActorOnRail {
return mPosition;
}

void setSpeed(f32 speed) {
mSpeed = speed;
}



private:
s32 mSegmentIndex;
f32 mSegmentFraction;
UNKWORD field_0x18;
f32 mSpeed;
u32 field_0x1C;
f32 field_0x20;
UNKWORD field_0x24;
Expand Down
121 changes: 112 additions & 9 deletions src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "d/a/obj/d_a_obj_dungeon_ship.h"

#include "c/c_lib.h"
#include "c/c_math.h"
#include "common.h"
#include "d/a/d_a_player.h"
#include "d/col/bg/d_bg_s.h"
Expand All @@ -8,13 +10,15 @@
#include "d/flag/storyflag_manager.h"
#include "f/f_base.h"
#include "m/m3d/m_fanm.h"
#include "m/m_angle.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "nw4r/g3d/g3d_anmclr.h"
#include "nw4r/g3d/res/g3d_resanmchr.h"
#include "nw4r/g3d/res/g3d_resanmclr.h"
#include "nw4r/g3d/res/g3d_resfile.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
#include "nw4r/math/math_triangular.h"
#include "s/s_Math.h"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/event.h"
Expand Down Expand Up @@ -55,7 +59,8 @@ void dAcODungeonShip_c::eventEnd_Wrapper(void *arg) {
}

bool dAcODungeonShip_c::createHeap() {
mRes = nw4r::g3d::ResFile(getOarcResFile("ShipDungeon"));
const char *arcName = "ShipDungeon";
mRes = nw4r::g3d::ResFile(getOarcResFile(arcName));
nw4r::g3d::ResMdl mdl = mRes.GetResMdl("ShipDungeonN");
if (!mMdl.fn_8001F3B0(mdl, &heap_allocator, 0x120)) {
return false;
Expand All @@ -76,19 +81,25 @@ bool dAcODungeonShip_c::createHeap() {
mAnmChr.setRate(0.0f);
mMdl.setPriorityDraw(0x7F, 4);

void *dzb = getOarcDZB("ShipDungeon", "ShipDungeonN");
void *plc = getOarcPLC("ShipDungeon", "ShipDungeonN");
const char *dzbPlcName = "ShipDungeonN";
void *dzb = getOarcDZB(arcName, dzbPlcName);
void *plc = getOarcPLC(arcName, dzbPlcName);
updateMatrix();
if (mBg.Set((cBgD_t *)dzb, (PLC *)plc, 1, &mWorldMtx, &mScale)) {
return false;
}

if (!SceneflagManager::sInstance->checkBoolFlag(roomid, (params >> 0x10) & 0xFF) ||
(BOOL)mBg.InitMapStuff(&heap_allocator)) {
return true;
// wat
if (!SceneflagManager::sInstance->checkBoolFlag(roomid, (params >> 0x10) & 0xFF)) {
goto ok;
} else {
bool result = (BOOL)mBg.InitMapStuff(&heap_allocator);
if (result == false) {
return false;
}
}

return false;
ok:
return true;
}

#pragma explicit_zero_data on
Expand Down Expand Up @@ -368,7 +379,7 @@ void dAcODungeonShip_c::executeState_AppearEvent() {
default: mEvent.advanceNext(); break;
}
} else {
Event ev(mAppearEvent, roomid, 0x10001, (void *)&eventIn_Wrapper, (void *)&eventEnd_Wrapper);
Event ev(mAppearEvent, roomid, 0x100001, (void *)&eventIn_Wrapper, (void *)&eventEnd_Wrapper);
mEvent.scheduleEvent(ev, 0);
}
} else {
Expand Down Expand Up @@ -424,6 +435,92 @@ void dAcODungeonShip_c::fn_485_1660() {
}
}

static u32 rot_7fff = 0x7FFF;
static u32 rot_4000 = 0x4000;

void dAcODungeonShip_c::fn_485_1720() {
mPath.setSpeed(forwardSpeed);
mPath.fn_800A9650();
// TODO
position = mPath.getPosition();

mVec3_c tmp;
mPath.fn_800A7C80(mPath.getSegmentIndex(), tmp, mPath.getSegmentFraction());
rotation.y = cM::atan2s(tmp.x, tmp.z);
if (mPath.CheckFlag(0x40000000)) {
rotation.y += rot_7fff;
}
rotation.y += rot_4000;
angle.y = rotation.y;

int factor = 0x12C;
f32 tmp2 = nw4r::math::SinIdx((field_0x850 * 800));
tmp2 *= factor;
field_0x84C = tmp2;
}

bool dAcODungeonShip_c::fn_485_1830(s32 pathSegmentIndex, s32 direction, s32 *out) {

}

u16 dAcODungeonShip_c::fn_485_1900() {
s32 sign = mPath.CheckFlag(0x40000000) ? -1 : 1;
s32 result;
if (fn_485_1830(mPath.getSegmentIndex(), sign, &result)) {
return result;
} else {
return -1;
}
}

u32 dAcODungeonShip_c::fn_485_1960() {
const dAcPy_c *link = dAcPy_c::GetLink();
if (link == nullptr) {
return 0;
}
mVec3_c v = mVec3_c::Ez;
v.rotY(angle.y + mAng(-0x4000));
mVec3_c dist = link->position - position;
dist.y = 0.0f;
dist.normalizeRS();
int a1 = cLib::targetAngleY(mVec3_c::Zero, v);
int a2 = cLib::targetAngleY(mVec3_c::Zero, dist);
// okay
return labs(mAng(mAng(a1) - mAng(a2)));
}

f32 dAcODungeonShip_c::fn_485_1A50() {
return 4000.0f;
}

f32 dAcODungeonShip_c::fn_485_1A60() {
return 2000.0f;
}

void dAcODungeonShip_c::fn_485_1A70(mVec3_c *v) {
v->set(0.0f, 0.0f, 0.0f);
}

void dAcODungeonShip_c::fn_485_1A90() {

}

void dAcODungeonShip_c::fn_485_1BF0() {

}

void dAcODungeonShip_c::fn_485_1DF0() {
const dAcPy_c *link = dAcPy_c::GetLink();
if (link != nullptr) {
// unused, stack problems
mVec3_c dist = position - link->position;
fn_485_1960();
field_0x858 = 30.0f;
sLib::addCalc(&forwardSpeed, 30.0f, 0.02f, 1.0f, 0.1f);
fn_485_1720();
}
}

void dAcODungeonShip_c::updateMatrixAndScale() {
updateMatrix();
mMdl.setLocalMtx(mWorldMtx);
Expand All @@ -439,3 +536,9 @@ void dAcODungeonShip_c::fn_485_1EE0() {
nw4r::g3d::ClrAnmResult result;
field_0x862 = nw4rObj->GetResult(&result, 0)->rgba[nw4r::g3d::ClrAnmResult::CLA_TEV1];
}

void unusedFloats() {
// these are probably not floats but I have no idea why this data is here
2.24E-43f;
5.6E-44f;
}

0 comments on commit 9b6e3e8

Please sign in to comment.