summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegazig <megazig@megazig.(none)>2012-01-11 01:45:32 -0600
committermegazig <megazig@megazig.(none)>2012-01-11 01:45:32 -0600
commit81edb47b7f677ba37e81f896645ecdc023f4adb9 (patch)
tree6ae00bb3d5bcae69a10869f58dde6147f4767a2d
parentef5d3be97708ba98f242a25e4a63127a8138dbf9 (diff)
downloadkamek-81edb47b7f677ba37e81f896645ecdc023f4adb9.tar.gz
kamek-81edb47b7f677ba37e81f896645ecdc023f4adb9.zip
changed class1EC to collisionMgr class
changed class484 to freezeMgr class added daEnDosun_c definition fixed bossMegaGecko to use new collisionMgr class changed bossThwompaDomp to inherit from daEnDosun_c (need to make it actually different now)
Diffstat (limited to '')
-rw-r--r--NewerProject.yaml2
-rw-r--r--bossThwompaDomp.yaml22
-rw-r--r--include/common.h2
-rw-r--r--include/daEnDosun_c.h74
-rw-r--r--include/daEnemy_c.h30
-rw-r--r--include/g3dhax.h16
-rwxr-xr-xinclude/game.h114
-rw-r--r--kamek_pal.x98
-rw-r--r--src/bossMegaGoomba.cpp39
-rw-r--r--src/bossThwompaDomp.cpp179
10 files changed, 532 insertions, 44 deletions
diff --git a/NewerProject.yaml b/NewerProject.yaml
index 0e90902..7bd958b 100644
--- a/NewerProject.yaml
+++ b/NewerProject.yaml
@@ -32,7 +32,7 @@ modules:
# - processed/classic_controller.yaml
- processed/bossMegaGoomba.yaml
- processed/bossFuzzyBear.yaml
-# - processed/bossThwompaDomp.yaml
+ - processed/bossThwompaDomp.yaml
- processed/bossRamboo.yaml
- processed/bossBalboaWrench.yaml
- processed/bossWrenchThrow.yaml
diff --git a/bossThwompaDomp.yaml b/bossThwompaDomp.yaml
index ad82c4b..1994794 100644
--- a/bossThwompaDomp.yaml
+++ b/bossThwompaDomp.yaml
@@ -1,20 +1,10 @@
---
-# Replaces EN_WALLINSECT
+# Replaces EN_GHOST_JUGEM
-source_files: [../src/bossThwompaDomp.cpp, ../src/bossThwompaDomp.S]
+source_files: [../src/bossThwompaDomp.cpp]
hooks:
- - name: ThwompaDompMove
- type: branch_insn
- branch_type: bl
- src_addr_pal: 0x809F689C
- target_func: 'ThwompaDompMove'
+ - name: ThwompaDompBuild
+ type: add_func_pointer
+ src_addr_pal: 0x80aebda0
+ target_func: 'daEnMegaDosun_c::build(void)'
- - name: ThwompaDompDontDie
- type: patch
- data: '60000000'
- addr_pal: 0x809F5E40
-
-
-
-# DOSUN physics struct - 809F5C40
-# DOSUN scale set - 809F5D6C \ No newline at end of file
diff --git a/include/common.h b/include/common.h
index e212eb4..a070a56 100644
--- a/include/common.h
+++ b/include/common.h
@@ -40,7 +40,7 @@ typedef f32 ROMtx[4][3];
typedef f32 (*ROMtxPtr)[3];
typedef struct { f32 x, y; } VEC2, Vec2, *Vec2Ptr, Point2d, *Point2dPtr;
-typedef struct { f32 x, y, z; } VEC3, Vec, *VecPtr, Point3d, *Point3dPtr;
+typedef struct { f32 x, y, z; } VEC3, Vec, Vec3, *VecPtr, Point3d, *Point3dPtr;
typedef struct { s16 x; s16 y; s16 z; }S16Vec, *S16VecPtr;
typedef struct { f32 x, y, z, w; } Quaternion, *QuaternionPtr, Qtrn, *QtrnPtr;
diff --git a/include/daEnDosun_c.h b/include/daEnDosun_c.h
new file mode 100644
index 0000000..49acabe
--- /dev/null
+++ b/include/daEnDosun_c.h
@@ -0,0 +1,74 @@
+#ifndef __DOSUN_H
+#define __DOSUN_H
+
+#include <daEnemy_c.h>
+
+/* All Addresses NTSCv2 */
+
+class daEnDosun_c : public daEnemy_c {
+public:
+ //vtable // 80ae8268
+ //ctor - Normal // 809f5ad0
+ //ctor - Big // 809f5b60
+ int onCreate(); // 809f5bf0
+ int onDelete(); // 809f5fd0
+ int onExecute(); // 809f5e50
+ int onDraw(); // 809f5ea0
+ //~daEnBigDosun_c(); // 809f7140
+ void kill(); // 809f7110
+ void killedByLevelClear(); // 809f6810
+ void collisionCat3_StarPower(ActivePhysics* apThis, ActivePhysics *apOther); // 809f6050
+ void _vf108(ActivePhysics* apThis, ActivePhysics* apOther); // 809f5fe0
+ void collisionCatD_GroundPound(ActivePhysics* apThis, ActivePhysics* apOther); // 809f7130
+ void _vf110(ActivePhysics* apThis, ActivePhysics* apOther); // 809f6090
+ void collisionCat7_WMWaggleWater(ActivePhysics* apThis, ActivePhysics* apOther); // 809f7120
+ void collisionCat9_RollingObject(ActivePhysics* apThis, ActivePhysics* apOther); // 809f70a0
+ void collisionCat1_Fireball_E_Explosion(ActivePhysics* apThis, ActivePhysics* apOther); // 809f70e0
+ bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics* apThis, ActivePhysics* apOther); // 809f70b0
+ void _vf144(int something); // 809f6120
+ //State Functions
+ void DieFall_Begin(); // 809f6e00
+ void DieFall_Execute(); // 809f6f10
+ void DieFall_End(); // 809f6f00
+ void Ice_Begin(); // 809f7020
+ void Ice_Execute(); // 809f7090
+ void Ice_End(); // 809f7080
+ bool CreateIceActors(); // 809f6260
+
+ mHeapAllocator_c allocator; // _524
+ nw4r::g3d::ResFile resFile; // _540
+ m3d::mdl_c bodyModel; // _544
+ m3d::anmVis_c anmVis; // _584
+ //u8 collision_struct[4]; // _5BC
+ u32 collision_struct; // _5BC
+ u32 _5C0, _5C4, _5C8;
+ float posXrelated_1; // _5CC
+ u32 bigOrSmall; // _5D0 0=small,1=big
+ u32 holdsFromSettings; // _5D4
+ u16 puruMoveCounter; // _5D8
+ u16 _5DA;
+ u32 countdownTimer; // _5DC
+ u32 anotherCounter; // _5E0
+ float posXrelated_2; // _5E4
+ float posYrelated_1; // _5E8
+ u32 _5EC;
+
+ /* don't have params yet */
+ void setupBodyModel(); // 809f63f0
+ void s_809F6530(); // 809f6530
+ void spawnEffects(); // 809f66a0
+
+ USING_STATES(daEnDosun_c);
+ REF_NINTENDO_STATE(UpWait);
+ REF_NINTENDO_STATE(DownMoveWait);
+ REF_NINTENDO_STATE(PuruMove);
+ REF_NINTENDO_STATE(DownMove_Kameck);
+ REF_NINTENDO_STATE(DownMove);
+ REF_NINTENDO_STATE(DownWait);
+ REF_NINTENDO_STATE(UpMove);
+ REF_NINTENDO_STATE(DieFall);
+ REF_NINTENDO_STATE(Ice);
+};
+
+#endif
+
diff --git a/include/daEnemy_c.h b/include/daEnemy_c.h
new file mode 100644
index 0000000..36fd574
--- /dev/null
+++ b/include/daEnemy_c.h
@@ -0,0 +1,30 @@
+#ifndef __ENEMY_H
+#define __ENEMY_H
+
+#include <common.h>
+#include <game.h>
+#include <g3dhax.h>
+
+/* All Addresses NTSCv2 */
+
+class daEnemy_c : public dEn_c {
+public:
+ int _vf58(); // 809a54e0 // daEnAkoya_c
+ void _vf5C(); // 809a54d0 // daEnAkoya_c
+ int _vf68(); // 809a5520 // daEnAkoya_c
+ //u8* _vf6C(); // 809a3550 // daEnAkoya_c
+ //FIXME
+ u8* ptrToWhichPlayer(); // 809a3550 // daEnAkoya_c
+ int _vf74(); // 809a5510 // dActorState_c
+ void _vf7C(); // 809a5500 // dActorState_c
+ void _vfB8(); // 809a54f0 // dActorState_c
+ void _vf228(); // 809a5560 // smthg w/InitlScale
+ void _vf23C(); // 809a5550 // nullsub
+ void _vf240(); // 809a5540 // nullsub
+ int _vf244(); // 809a5530 // return 0;
+
+ void setupBodyModel(); //FIXME
+};
+
+#endif
+
diff --git a/include/g3dhax.h b/include/g3dhax.h
index d4aa9a0..f13aab3 100644
--- a/include/g3dhax.h
+++ b/include/g3dhax.h
@@ -29,6 +29,7 @@ namespace nw4r {
};
class ResAnmChr { public: void* data; ResAnmChr(void *p = NULL) { data = p; } };
+ class ResAnmVis { public: void* data; ResAnmVis(void *p = NULL) { data = p; } };
class ResAnmTexPat { public: void* data; ResAnmTexPat(void *p = NULL) { data = p; } };
class ResAnmTexSrt { public: void* data; ResAnmTexSrt(void *p = NULL) { data = p; } };
@@ -49,7 +50,7 @@ namespace nw4r {
void * /*ResTex*/ GetResTex(const ResName n) const;
void * /*ResTex*/ GetResTex(u32 idx) const;
ResAnmChr GetResAnmChr(const char *str) const;
- void * /*ResAnmVis*/ GetResAnmVis(const char *str) const;
+ ResAnmVis GetResAnmVis(const char *str) const;
void * /*ResAnmClr*/ GetResAnmClr(const char *str) const;
ResAnmTexPat GetResAnmTexPat(const char *str) const;
ResAnmTexSrt GetResAnmTexSrt(const char *str) const;
@@ -279,7 +280,7 @@ namespace m3d {
// 28 might be Max Frame?
float _28, _2C, currentFrame;
- u8 _34;
+ u8 _34; // animation group??
};
class anmChr_c : public fanm_c {
@@ -293,6 +294,17 @@ namespace m3d {
void bind(/*b*/mdl_c *model, nw4r::g3d::ResAnmChr anmRes, int unk);
};
+ class anmVis_c : public fanm_c {
+ public:
+ ~anmVis_c();
+ int _vf0C();
+
+ bool setup(nw4r::g3d::ResMdl modelRes, nw4r::g3d::ResAnmVis anmRes,
+ mAllocator_c *allocator, u32 *sizeOutPtr);
+
+ void bind(/*b*/mdl_c *model, nw4r::g3d::ResAnmVis anmRes, int unk);
+ };
+
class anmTexPat_c : public banm_c {
public:
class child_c : public fanm_c {
diff --git a/include/game.h b/include/game.h
index 0fa72c9..5fd71d5 100755
--- a/include/game.h
+++ b/include/game.h
@@ -1232,6 +1232,107 @@ public:
};
+class dStageActor_c; // forward declaration
+class collisionMgr_c {
+public:
+ collisionMgr_c();
+ virtual ~collisionMgr_c();
+
+ //FIXME params and returns and add more
+ void Clear1();
+ void Clear2();
+ void Init(dStageActor_c*,u8*,u8*,u8*);
+
+ void Clear3();
+ int CollidedWithTile();
+
+ dStageActor_c* owner;
+ void* struct1_ptr;
+ void* struct2_ptr;
+ void* some_ptr;
+ Vec3* parent_pos_ptr;
+ Vec3* parent_last_pos_ptr;
+ Vec3* parent_speed_ptr;
+ Vec3 someVelocityThing;
+ float xDeltaMaybe;
+ float yDeltaMaybe;
+ u8 _34[24]; //FIXME
+ float someFloat;
+ void* class2DC_ptr; //FIXME
+ void* another_ptr;
+ void* ptr_to_ptr_to_underneath_actor;
+ u8 _5C[44]; //FIXME
+ u32 bitfield_for_checks;
+ u32 bitfield_backup;
+ u32 _90, _94;
+ u8 which_player_of_parent;
+ u8 which_controller;
+ u16 _9A, _9C;
+ u8 _9E[2]; //FIXME
+ u32 another_bitfield;
+ u8 _A4;
+ u8 _A5[3]; //FIXME
+ u32 yet_another_bitfield;
+ u8 _AC;
+ u8 _AD[3]; //FIXME
+ u32 directional_bitfields[2]; // left right
+ u8 flagsB8;
+ u8 flagsB9;
+ u8 _BA[2]; //FIXME
+ u8 _BC, _BD;
+ u16 _BE;
+ u8 _C0, _C1;
+ u16 _C2;
+ u8 _C4[4]; //FIXME
+ u16 _C8;
+ u8 _CA[22]; //FIXME
+ u8 _E0, _E1, _E2;
+ u8 _E3; //FIXME
+ u8 _E4, _E5;
+ u8 _E6[2]; //FIXME
+ u32 current_layer_ptr;
+ u8 current_layer;
+ u8 _ED[3]; //FIXME
+};
+
+class freezeMgr_c {
+public:
+ u32 some_count;
+ u32 ice_timer1;
+ u32 ice_timer2;
+ u32 _mstate; //0=not,1=frozen,3=die_coin
+ u32 _10;
+ u32 _nstate; //1=countdown,2=meltedNormal
+ u32 spawns_coin; //1=delete,3=coin
+ u32 _1C_timerLenType;
+ u32 _20_defaultTimerLenType;
+ u32 _24;
+ u32 _28;
+ u32 perm_freeze;
+ u32 _30;
+ u32 actorIds[12];
+ void* owner; // _64
+
+ freezeMgr_c();
+ ~freezeMgr_c();
+ //FIXME add params and returns
+ void doSomethingCool1();
+ void doSomethingCool2();
+ void setSomething(u32,u32,u32);
+ void Create_ICEACTORs(void*,int);
+ void Delete_ICEACTORs();
+ void SetIceTimer_pt1();
+ void SetIceTimer_pt2();
+ void CheckIceTimer_lte_Value();
+ void doSomethingCool3();
+ void doSomethingCool4();
+ void doSomethingCool5();
+ void doSomethingCool6();
+ void DoMeltNormal();
+ void doSomethingCool7();
+ void CheckCountdownTimer();
+};
+
class fBase_c {
public:
u32 id;
@@ -1339,7 +1440,7 @@ public:
Vec pos;
Vec last_pos;
Vec pos_delta;
- Vec _D0;
+ Vec pos_delta2;
Vec scale;
Vec speed;
Vec max_speed;
@@ -1370,8 +1471,7 @@ public:
float _140;
u32 _144;
ActivePhysics aPhysics;
- u8 classAt1EC[236];
- u32 _2D8;
+ collisionMgr_c collMgr;
u8 classAt2DC[0x34];
u32 _310, _314;
float spriteSomeRectX, spriteSomeRectY;
@@ -1426,7 +1526,7 @@ public:
virtual void _vfA4(void *other); // AcPy/PlBase? similar to vf94 but not quite the same
virtual float _vfA8(void *other); // AcPy/PlBase? what DOES this do...? does a bit of float math
virtual void _vfAC(void *other); // copies somethingRelatedToScale into scale, then multiplies scale by vfA8's return
- virtual void _vfB0(); // plays Wm_en_burst_s at actor position
+ virtual void killedByLevelClear(); // plays Wm_en_burst_s at actor position
virtual void _vfB4(); // params unknown. nullsub
virtual void _vfB8(); // params unknown. nullsub
virtual void _vfBC(); // params unknown. nullsub
@@ -1512,7 +1612,9 @@ public:
u32 _474, _478;
dEn_c *_47C;
u32 _480;
- u8 classAt484[0x4EC - 0x484];
+ //FIXME verify that size fits
+ //u8 classAt484[0x4EC - 0x484];
+ freezeMgr_c frzMgr;
u32 _4EC;
float _4F0, _4F4, _4F8;
u32 flags_4FC;
@@ -1634,7 +1736,7 @@ public:
virtual void _vf220(void *other); // some type of actor, PlBase? calls vf3F4 on other with r4=this, r5=0
virtual void _vf224(); // stores a couple of values into the struct at 464
virtual void _vf228(); // more fun stuff with 464 and floats
- virtual bool _vf22C(); // does stuff involving ICE_ACTORs and arrays
+ virtual bool CreateIceActors(); // does stuff involving ICE_ACTORs and arrays
virtual void _vf230(); // "relatedToPlayerOrYoshiCollision" apparently. nullsub, params unknown for now.
virtual void _vf234(); // nullsub, params unknown
virtual void _vf238(); // calls vf34 on class394, params unknown
diff --git a/kamek_pal.x b/kamek_pal.x
index 38e1b54..a036ddd 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -144,6 +144,34 @@ SECTIONS {
setup__13FunctionChainFPPFPv_bUs = 0x8015F740;
+ /* collisionMgr_c */
+ __ct__14collisionMgr_c = 0x8006cf40;
+ __dt__14collisionMgr_c = 0x8006cf40;
+ Clear1__14collisionMgr_c = 0x8006cfe0;
+ Clear2__14collisionMgr_c = 0x8006d000;
+ Init__14collisionMgr_cFP13dStageActor_cPUcPUcPUc = 0x8006d090;
+ Clear3__14collisionMgr_c = 0x8006d440;
+ CollidedWithTile__14collisionMgr_c = 0x80070cb0;
+
+ /* freezeMgr_c */
+ __ct_11freezeMgr_c = 0x800b8490;
+ __dt__11freezeMgr_cFv = 0x800b8530;
+ doSomethingCool1__11freezeMgr_c = 0x800b85a0;
+ doSomethingCool2__11freezeMgr_c = 0x800b8670;
+ setSomething__11freezeMgr_cFUiUiUi = 0x800b8740;
+ Create_ICEACTORs__11freezeMgr_c = 0x800b8750;
+ Delete_ICEACTORs__11freezeMgr_c = 0x800b88a0;
+ SetIceTimer_pt1__11freezeMgr_c = 0x800b8920;
+ SetIceTimer_pt2__11freezeMgr_c = 0x800b8980;
+ CheckIceTimer_lte_Value__11freezeMgr_c = 0x800b8a00;
+ doSomethingCool3__11freezeMgr_c = 0x800b8a70;
+ doSomethingCool4__11freezeMgr_c = 0x800b8b00;
+ doSomethingCool5__11freezeMgr_c = 0x800b8b80;
+ doSomethingCool6__11freezeMgr_c = 0x800b8c00;
+ DoMeltNormal__11freezeMgr_c = 0x800b8c80;
+ doSomethingCool7__11freezeMgr_c = 0x800b8d40;
+ CheckCountdownTimer__11freezeMgr_c = 0x800b8f30;
+
willBeDeleted__7fBase_cFv = 0x80162410;
moreHeapShit__7fBase_cFUiPv = 0x80162730;
createHeap__7fBase_cFUiPv = 0x80162930;
@@ -292,7 +320,7 @@ SECTIONS {
_vf220__5dEn_cFPv = 0x80097F20;
_vf224__5dEn_cFv = 0x80097F60;
_vf228__5dEn_cFv = 0x800206C0;
- _vf22C__5dEn_cFv = 0x800A8060;
+ CreateIceActors__5dEn_cFv = 0x800A8060;
_vf230__5dEn_cFv = 0x800A8150;
_vf234__5dEn_cFv = 0x800A8160;
_vf238__5dEn_cFv = 0x800A8180;
@@ -354,7 +382,7 @@ SECTIONS {
_vfA4__13dStageActor_cFPv = 0x80065970;
_vfA8__13dStageActor_cFPv = 0x80065A00;
_vfAC__13dStageActor_cFPv = 0x80065A40;
- _vfB0__13dStageActor_cFv = 0x80065660;
+ killedByLevelClear__13dStageActor_cFv = 0x80065660;
_vfB4__13dStageActor_cFv = 0x80065B40;
_vfB8__13dStageActor_cFv = 0x8001D1D0;
_vfBC__13dStageActor_cFv = 0x80065B50;
@@ -992,10 +1020,12 @@ SECTIONS {
GetResMdl = 0x80239F70;
GetResAnmChr = 0x8023A1F0;
+ GetResAnmVis = 0x8023A260;
GetResAnmTexPat = 0x8023A340;
GetResAnmTexSrt = 0x8023a3b0;
GetResAnmChr__Q34nw4r3g3d7ResFileCFPCc = 0x8023a1f0;
+ GetResAnmVis__Q34nw4r3g3d7ResFileCFPCc = 0x8023a260;
GetResAnmTexPat__Q34nw4r3g3d7ResFileCFPCc = 0x8023a340;
GetResAnmTexSrt__Q34nw4r3g3d7ResFileCFPCc = 0x8023a3b0;
@@ -1023,7 +1053,6 @@ SECTIONS {
isAnimationDone__Q23m3d6fanm_cFv = 0x80169160;
querySomething__Q23m3d6fanm_cFv = 0x80169220;
- /*FIXME not right dtor ?*/
__vt__Q23m3d8anmChr_c = 0x80303708;
__dt__Q23m3d8anmChr_cFv = 0x800260c0;
vf0C__Q23m3d8anmChr_cFv = 0x8002a210;
@@ -1031,6 +1060,14 @@ SECTIONS {
bind__Q23m3d8anmChr_cFPQ23m3d5mdl_cQ34nw4r3g3d9ResAnmChri = 0x80165330;
internalBind__Q23m3d8anmChr_cFv = 0x801653c0;
+ /* m3d::anmVis_c */
+ __vt__Q23m3d8anmVis_c = 0x80ad8158;
+ __dt__Q23m3d8anmVis_cFv = 0x809b2090;
+ vf0C__Q23m3d8anmVis_cFv = 0x809b3c20;
+ setup__Q23m3d8anmVis_cFQ34nw4r3g3d6ResMdlQ34nw4r3g3d9ResAnmVisP12mAllocator_cPUi = 0x80167d80;
+ bind__Q23m3d8anmVis_cFPQ23m3d5mdl_cQ34nw4r3g3d9ResAnmVisi = 0x80167ea0;
+ internalBind__Q23m3d8anmVis_cFv = 0x80167f90;
+
__vt__Q23m3d11anmTexPat_c = 0x80329890;
__dt__Q23m3d11anmTexPat_cFv = 0x80166bb0;
detach__Q23m3d11anmTexPat_cFv = 0x80166c20;
@@ -1198,6 +1235,61 @@ SECTIONS {
SmoothRotation = 0x8015f630;
ClassAt1EC_Init = 0x8006D090;
+ /* daEnemy_c */
+ /*FIXME bad vtable address :( */
+ __vt__9daEnemy_c = 0x80ae8268;
+ _vf58__9daEnemy_cFv = 0x809a54a0;
+ _vf5C__9daEnemy_cFv = 0x809a5490;
+ _vf68__9daEnemy_cFv = 0x809a54e0;
+ ptrToWhichPlayer__9daEnemy_cFv = 0x809a3510;
+ _vf74__9daEnemy_cFv = 0x809a54d0;
+ _vf7C__9daEnemy_cFv = 0x809a54c0;
+ _vfB8__9daEnemy_cFv = 0x809a54b0;
+ _vf228__9daEnemy_cFv = 0x809a5520;
+ _vf23C__9daEnemy_cFv = 0x809a5510;
+ _vf240__9daEnemy_cFv = 0x809a5500;
+ _vf244__9daEnemy_cFv = 0x809a54f0;
+
+ /* daEnDosun_c */
+ __ct_11daEnDosun_cFv = 0x809f5a90;
+ __ct_14daEnBigDosun_cFv = 0x809f5b20;
+ __vt__11daEnDosun_c = 0x80ae8228;
+ onCreate__11daEnDosun_cFv = 0x809f5bb0;
+ onDelete__11daEnDosun_cFv = 0x809f5f90;
+ onExecute__11daEnDosun_cFv = 0x809f5e10;
+ onDraw__11daEnDosun_cFv = 0x809f5e60;
+ __dt_11daEnDosun_cFv = 0x809f7100;
+ kill__11daEnDosun_cFv = 0x809f70d0;
+ killedByLevelClear__11daEnDosun_cFv = 0x809f67d0;
+ collisionCat3_StarPower__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f6010;
+ _vf108__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f5fa0;
+ collisionCatD_GroundPound__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f70f0;
+ _vf110__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f6050;
+ collisionCat7_WMWaggleWater__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f70e0;
+ collisionCat9_RollingObject__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f7060;
+ collisionCat1_Fireball_E_Explosion__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f70a0;
+ collisionCat2_IceBall_15_YoshiIce__11daEnDosun_cFP13ActivePhysicsP13ActivePhysics = 0x809f7070;
+ _vf144__11daEnDosun_cFi = 0x809f60e0;
+ DieFall_Begin__11daEnDosun_cFv = 0x809f6dc0;
+ DieFall_Execute__11daEnDosun_cFv = 0x809f6ed0;
+ DieFall_End__11daEnDosun_cFv = 0x809f6ec0;
+ Ice_Begin__11daEnDosun_cFv = 0x809f6fe0;
+ Ice_Execute__11daEnDosun_cFv = 0x809f7050;
+ Ice_End__11daEnDosun_cFv = 0x809f7040;
+ CreateIceActors__11daEnDosun_cFv = 0x809f6220;
+ setupBodyModel__11daEnDosun_cFv = 0x809f63b0;
+ s_809F6530__11daEnDosun_cFv = 0x809f64f0;
+ spawnEffects__11daEnDosun_cFv = 0x809f6660;
+ StateID_UpWait__11daEnDosun_c = 0x80b14350;
+ StateID_DownMoveWait__11daEnDosun_c = 0x80b14390;
+ StateID_PuruMove__11daEnDosun_c = 0x80b143d0;
+ StateID_DownMove_Kameck__11daEnDosun_c = 0x80b14410;
+ StateID_DownMove__11daEnDosun_c = 0x80b14450;
+ StateID_DownWait__11daEnDosun_c = 0x80b14490;
+ StateID_UpMove__11daEnDosun_c = 0x80b144d0;
+ StateID_DieFall__11daEnDosun_c = 0x80b1450c;
+ StateID_Ice__11daEnDosun_c = 0x80b1454c;
+
.text : {
FILL (0)
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp
index d70f6cd..996a609 100644
--- a/src/bossMegaGoomba.cpp
+++ b/src/bossMegaGoomba.cpp
@@ -130,7 +130,6 @@ extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1);
extern "C" void doSpriteMovement(dStageActor_c* actor);
extern "C" int SomeStrangeModification(dStageActor_c* actor);
-extern "C" int CollidedWithTile(u8* c_1EC);
extern "C" void DoStuffAndMarkDead(dStageActor_c *actor, Vec vector, float unk);
extern "C" int SmoothRotation(short* rot, u16 amt, int unk2);
@@ -194,8 +193,25 @@ void daMegaGoomba_c::spriteCollision(ActivePhysics *apThis, ActivePhysics *apOth
void daMegaGoomba_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
OSReport("Mario collision.\n");
+ /* * * * * * * * * * * * * * * * * * * * *
+ * 0=normal??,1=dontHit,2=dontKill
+ * daEnBrosBase_c ::player = 0
+ * daEnBrosBase_c::yoshi = 0
+ * daEnPipePirahna::player = 1
+ * daEnPipePirahna::yoshi = 1
+ * daEnKuriboBase_c::player = 0
+ * daEnKuriboBase_c::yoshi = 0
+ * daEnLargeKuribo_c::player = 0
+ * daEnLargeKuribo_c::yoshi = 2
+ * daEnNokonoko_c::player = 0
+ * daEnNokonoko_c::yoshi = 0
+ * daEnSubBoss_c = 2
+ *
+ * * * * * * * * * * * * * * * * * * * * */
//FIXME rename and make part of dStageActor_c
- char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 0);
+ //unk=0 does _vfs, unk=1 does playSeCmnStep
+ //char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 0);
+ char ret = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2);
if(ret == 1) { // regular jump
apOther->someFlagByte |= 2;
OSReport("ret == 1; regular jump;\n");
@@ -303,18 +319,16 @@ void daMegaGoomba_c::setupBodyModel() {
allocator.unlink();
}
-extern "C" void ClassAt1EC_Init(u8*, dStageActor_c*, u8*, u8*, u8*);
-
void daMegaGoomba_c::setupCollision() {
//POINTLESS WITH GROWTH
this->scale.x = this->scale.y = this->scale.z = 0.666;
- ClassAt1EC_Init(this->classAt1EC, this, struct_1, 0, struct_3);
+ this->collMgr.Init(this, struct_1, 0, struct_3);
char foo = this->_391;
- this->_D0.x = 0.0;
- this->_D0.y = 16.0;
- this->_D0.z = 0.0;
+ this->pos_delta2.x = 0.0;
+ this->pos_delta2.y = 16.0;
+ this->pos_delta2.z = 0.0;
this->spriteSomeRectX = 32.0;
this->spriteSomeRectY = 32.0;
@@ -645,13 +659,13 @@ void daMegaGoomba_c::executeState_Walk() {
int ret = SomeStrangeModification(this);
if(ret & 1)
this->speed.y = 0.0;
- u32 bitfield = *(u32*)(this->classAt1EC+0x88);
+ u32 bitfield = this->collMgr.bitfield_for_checks;
if(bitfield & (0x15<<this->direction)) {
this->pos.x = this->last_pos.x;
this->doStateChange(&StateID_Turn);
//this->acState.setField10ToOne();
}
- u32 bitfield2 = *(u32*)(this->classAt1EC+0xb0+(4-(this->direction*4)));
+ u32 bitfield2 = this->collMgr.directional_bitfields[this->direction];
if(bitfield2) {
OSReport("Found wall: %08x\n", bitfield2);
this->doStateChange(&StateID_Turn);
@@ -679,8 +693,9 @@ void daMegaGoomba_c::executeState_Walk() {
}
#if 0
- if(CollidedWithTile(this->classAt1EC)) {
- OSReport("CollidedWithTile() : true [%08x]\n", *(u32*)(this->classAt1EC+0x88));
+ //if(CollidedWithTile(this->classAt1EC)) {
+ if( this->collMgr.CollidedWithTile() {
+ OSReport("CollidedWithTile() : true [%08x]\n", this->collMgr.bitfield_for_checks);
}
#endif
diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp
index 70a3d17..1c366b8 100644
--- a/src/bossThwompaDomp.cpp
+++ b/src/bossThwompaDomp.cpp
@@ -2,7 +2,173 @@
#include <game.h>
#include <g3dhax.h>
+#include "daEnDosun_c.h"
+#if 0
+/* called from _vf228 */
+/* handles overall scale */
+void sub_8009ea50( _464_struct* data ) {
+ u32 ctr = data->ctr; // _0x14
+ dEn_c* en = data->en; // _0x18
+
+ if(!ctr) {
+ en->scale.x = en->scale.y = en->scale.z = 1.0;
+ data->x = data->y = data->z = data->_0xC = 1.0
+ return;
+ }
+ data->ctr--;
+
+ /*FIXME continue */
+}
+#endif
+
+class daEnMegaDosun_c : public daEnDosun_c {
+ //int onCreate(); // overload for mega
+ //int onExecute();
+ static daEnMegaDosun_c *build();
+
+ //int checkZoneBoundaries(int);
+
+ //FIXME
+ //USING_STATES(daEnMegaDosun_c);
+ //DECLARE_STATE(Wait);
+};
+
+daEnMegaDosun_c *daEnMegaDosun_c::build() {
+ void *buffer = AllocFromGameHeap1(sizeof(daEnMegaDosun_c));
+ return new(buffer) daEnMegaDosun_c;
+}
+
+#if 0
+int daEnMegaDosun_c::onCreate() {
+ //FIXME
+ this->bigOrSmall = 1; // 0=small,1=big,2=mega
+
+ this->setupBodyModel(); // add this for linking/rename
+
+ this->_36D = 0; // byte
+ this->holdsFromSettings = this->settings & 0xf; //0=normal,1=??,2=fall
+
+ this->frzMgr.setSomething(1,1,1); //@0x809f5c5c
+
+ this->pos.y -= 21.0;
+ this->pos.z = -280.0; // behind layer1 (hides spikes)
+
+ //FIXME might be u32 0x11804101
+ /*
+ this->collision_struct[0] = 0x11;
+ this->collision_struct[1] = 0x80;
+ this->collision_struct[2] = 0x41;
+ this->collision_struct[3] = 0x01;
+ */
+ this->collision_struct = 0x11804101;
+ this->_5C0 = 0xFFFE1000;
+ this->_5C4 = 0x1F000;
+ this->_5C8 = 0x5000;
+
+ /*
+ //0x80ACF990 + 0x8C = 80acfa1C
+ 0.0,41.0,36.0,38.0,
+ 0x03, 0x00, 0x0000,0x0000004F,0x0000820E,0x0100,0x0000
+ dEn_c::collisionCallback (0x80095950)
+ */
+ ActivePhysics::Info hm;
+ hm.xDistToCenter = 0.0;
+ hm.yDistToCenter = 41.0;
+ hm.xDistToEdge = 36.0;
+ hm.yDistToEdge = 38.0;
+ hm.category1 = 0x03;
+ hm.category2 = 0x00;
+ hm.bitfield1 = 0x0000004F;
+ hm.bitfield2 = 0x0000820E;
+ hm.unkShort1C = 0x0100;
+ hm.callback = &dEn_c::collisionCallback;
+ this->aPhysics.initWithStruct(this, &hm);
+
+ /* 0x00000001,0xfffe1000,0x0001f000,0x00055000,
+ * 0.0,20.0,16.0,19.0
+ * 0x03000000,0x0000004f,0x0000820e,0x01000000,
+ * dEn_c::collisionCallback
+ */
+ u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0,5,0x50,0};
+ //FIXME 0x80ACF990 + 0x58 = 80acf9e8
+ this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0);
+
+ this->pos_delta2.x = 0.0;
+ this->pos_delta2.y = 36.0;
+ this->pos_delta2.z = 0.0;
+ this->_320 = 0.0;
+ this->_324 = 48.0;
+
+ this->aPhysics.addToList();
+
+ this->scale.x = 1.0;
+ this->scale.y = 1.0;
+ this->scale.z = 1.0;
+ this->max_speed.x = 0.0;
+ this->max_speed.y = -8.0;
+ this->max_speed.z = 0.0;
+ this->y_speed_inc = -0.25;
+ this->rot.x = 0;
+ this->rot.y = 0;
+ this->rot.z = 0;
+
+ // check settings bit
+ if(this->holdsFromSettings == 2) {
+ this->doStateChange(&StateID_DownMove_Kameck);
+ }else{
+ this->doStateChange(&StateID_UpWait);
+ }
+
+ return 1;
+}
+#endif
+
+#if 0
+int daEnMegaDosun_c::onExecute() {
+
+ acState.execute();
+
+ //FIXME change to do outro when leaving screen
+ //this->checkZoneBoundaries(0);
+
+ return 1;
+}
+#endif
+
+//FIXME
+#if 0
+int daEnMegaDosun_c::checkZoneBoundaries(int foo) {
+ if(this->_36C == 2) { // is eaten
+ return 0;
+ }
+
+ if( (0 == (foo&0x8)) && \
+ (this->collMgr.checkBits15and16ofBitfield() != 0) ) {
+ return 0;
+ }
+
+ int ret = 0;
+
+#if 0
+ Rect tempRect = (Rect){this->_320, this->_324,
+ 0.5 * this->spriteSomeRectX, 0.5 * this->spriteSomeRectY};
+ Rect tempRect2 = (Rect){_338, _33C, _340, _344};
+ if(this->s800064da0(pos, &tempRect, currentZoneId) ||
+ (!(foo&0x4) && s_800b56e0(pos, &tempRect, &tempRect2, currentZoneId)) )
+ {
+ ret = 1;
+ }
+#endif
+
+ if(ret && !(foo & 0x2))
+ this->Delete(this->_390);
+
+ return ret;
+}
+#endif
+
+#if 0
extern "C" bool CollidedWithTile(u8 *);
extern "C" void *SomeStrangeModification(dEn_c *);
@@ -14,9 +180,9 @@ void ThwompaDompMoveC(dEn_c *Sprite) {
bool SecondCheck;
// Check for collisions with walls?
- FirstCheck = CollidedWithTile(Sprite->classAt1EC);
+ FirstCheck = CollidedWithTile(Sprite->collMgr);
SomeStrangeModification(Sprite);
- SecondCheck = CollidedWithTile(Sprite->classAt1EC);
+ SecondCheck = CollidedWithTile(Sprite->collMgr);
OSReport("XPos = %f, FirstCheck = %d, SecondCheck = %d", Sprite->pos.x, FirstCheck, SecondCheck);
@@ -42,4 +208,11 @@ void ThwompaDompMoveC(dEn_c *Sprite) {
return;
-} \ No newline at end of file
+}
+#endif
+
+/*
+class daYoshi_c : public dStageActor_c {
+ u32 _1520; // holds actorID of actor eaten
+};
+*/