summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NewerProject.yaml1
-rw-r--r--include/game.h58
-rw-r--r--kamek_ntsc.x278
-rw-r--r--kamek_ntsc2.x278
-rw-r--r--kamek_pal.x10
-rw-r--r--kamek_pal2.x278
-rw-r--r--poweruphax.yaml2
-rw-r--r--randtilegen.rb376
-rw-r--r--randtiles.yaml31
-rw-r--r--src/poweruphax.S38
-rw-r--r--src/randtiles.cpp215
-rw-r--r--src/randtiles.h63
-rw-r--r--tools/hooks.pycbin5873 -> 5873 bytes
13 files changed, 1505 insertions, 123 deletions
diff --git a/NewerProject.yaml b/NewerProject.yaml
index 560b015..0441d98 100644
--- a/NewerProject.yaml
+++ b/NewerProject.yaml
@@ -10,6 +10,7 @@ modules:
# - processed/gakenoko.yaml
- processed/poweruphax.yaml
# - processed/heapbar.yaml
+ - processed/randtiles.yaml
- processed/tilegod.yaml
- processed/linegod.yaml
- processed/tilesetfixer.yaml
diff --git a/include/game.h b/include/game.h
index 8bc0dc2..7412762 100644
--- a/include/game.h
+++ b/include/game.h
@@ -40,6 +40,9 @@ inline void *GetDVDClass2() {
void *DVD_GetFile(void *dvdclass2, const char *arc, const char *file);
void *DVD_GetFile(void *dvdclass2, const char *arc, const char *file, u32 *length);
+int MakeRandomNumber(int count);
+int MakeRandomNumberForTiles(int count);
+
extern int Player_Active[4];
extern int Player_ID[4];
@@ -2034,5 +2037,60 @@ namespace m2d {
}
+
+/* Tilemap related stuff */
+class TilemapClass {
+ public:
+ virtual ~TilemapClass();
+
+ u16 *allocatedBlocks[256];
+ u32 _404;
+
+ u8 blockLookup[2048];
+
+ u16 blockCount;
+
+ u32 _C0C;
+ u32 ts1ID, ts2ID, ts3ID, layerID, areaID, frmHeap, is2Castle;
+
+ // Only the public API is listed
+ u16 *getPointerToTile(int x, int y, u32 *blockNum = 0, bool unkBool = 0);
+ // TODO: more?
+};
+
+class BGDatClass {
+ public:
+ BGDatClass();
+ virtual ~BGDatClass();
+
+ u8 *bgData[4][3];
+ TilemapClass *tilemaps[4][3];
+ u8 *tsObjIndexData[4][4];
+ u8 *tsObjData[4][4];
+ char tsNames[4][4][0x20];
+ // this is fucked up!
+ // the parent heap is frmHeaps[0][0]
+ // each tileset's heap is frmHeaps[AREA][LAYER+1]
+ void *frmHeaps[4][4];
+
+ static BGDatClass *instance; // 8042A0D0
+
+ // I've only listed the public API because other stuff isn't really needed atm.
+ const char *getTilesetName(int area, int number);
+ // TODO: more?
+};
+
+struct BGRender {
+ u8 unk[0xC00];
+ u8 *objectData;
+ u8 _C04, _C05;
+ u16 _C06, _C08;
+ u16 blockNumber;
+ u16 curX, curY;
+ u16 tileToPlace;
+ u16 objDataOffset, objType, objX, objY, objWidth, objHeight;
+ u16 tileNumberWithinBlock, areaID;
+};
+
#endif
diff --git a/kamek_ntsc.x b/kamek_ntsc.x
index 45db184..ab702c3 100644
--- a/kamek_ntsc.x
+++ b/kamek_ntsc.x
@@ -6,6 +6,7 @@ OUTPUT_FORMAT ("binary")
SECTIONS {
GetSpecificPlayerActor = 0x8005F900;
+ Actor_SearchByID = 0x80162D00;
TimeStopFlag = 0x80429CFA;
TimerBranch = 0x800E39C8;
MarioDescentRate = 0x8042B864;
@@ -16,6 +17,8 @@ SECTIONS {
AlwaysDrawFlag = 0x80064540;
AlwaysDrawBranch = 0x80064544;
GenerateRandomNumber = 0x800B2EE0;
+ OneofManySoundPlayers = 0x800CE8C0;
+ BombExplodeState = 0x80B12A68;
_savefpr_14 = 0x802DCCA8;
_savefpr_15 = 0x802DCCAC;
@@ -101,6 +104,9 @@ SECTIONS {
__construct_new_array = 0x802DC7E0;
__destroy_new_array = 0x802DCB10;
+ __register_global_object = 0x802DC780;
+ __ptmf_scall = 0x802DCBFC;
+
setup__13FunctionChainFPPFPv_bUs = 0x8015F600;
@@ -113,16 +119,216 @@ SECTIONS {
GetExplanationString__7dBase_cFv = 0x8006C660;
+ __vt__15daEnBlockMain_c = 0x80301EA8;
+ __dt__15daEnBlockMain_cFv = 0x80023340;
+ calledWhenUpMoveBegins__15daEnBlockMain_cFv = 0x80022E80;
+ calledWhenDownMoveBegins__15daEnBlockMain_cFv = 0x80022F60;
+ calledWhenUpMoveExecutes__15daEnBlockMain_cFv = 0x80022F30;
+ calledWhenUpMoveDiffExecutes__15daEnBlockMain_cFv = 0x800231A0;
+ calledWhenDownMoveExecutes__15daEnBlockMain_cFv = 0x80023010;
+ calledWhenDownMoveEndExecutes__15daEnBlockMain_cFv = 0x80023080;
+ calledWhenDownMoveDiffExecutes__15daEnBlockMain_cFv = 0x800232C0;
+ calledWhenDownMoveDiffEndExecutes__15daEnBlockMain_cFv = 0x80023330;
+ updateScale__15daEnBlockMain_cFb = 0x80022DC0;
+ upMove_Begin__15daEnBlockMain_cFv = 0x80022E60;
+ upMove_Execute__15daEnBlockMain_cFv = 0x80022EA0;
+ upMove_End__15daEnBlockMain_cFv = 0x80022E90;
+ downMove_Begin__15daEnBlockMain_cFv = 0x80022F40;
+ downMove_Execute__15daEnBlockMain_cFv = 0x80022F80;
+ downMove_End__15daEnBlockMain_cFv = 0x80022F70;
+ downMoveEnd_Begin__15daEnBlockMain_cFv = 0x80023020;
+ downMoveEnd_Execute__15daEnBlockMain_cFv = 0x80023040;
+ downMoveEnd_End__15daEnBlockMain_cFv = 0x80023030;
+ upMove_Diff_Begin__15daEnBlockMain_cFv = 0x80023090;
+ upMove_Diff_Execute__15daEnBlockMain_cFv = 0x800230D0;
+ upMove_Diff_End__15daEnBlockMain_cFv = 0x800230C0;
+ downMove_Diff_Begin__15daEnBlockMain_cFv = 0x800231B0;
+ downMove_Diff_Execute__15daEnBlockMain_cFv = 0x800231F0;
+ downMove_Diff_End__15daEnBlockMain_cFv = 0x800231E0;
+ downMove_DiffEnd_Begin__15daEnBlockMain_cFv = 0x800232D0;
+ downMove_DiffEnd_Execute__15daEnBlockMain_cFv = 0x800232F0;
+ downMove_DiffEnd_End__15daEnBlockMain_cFv = 0x800232E0;
+ blockInit__15daEnBlockMain_cFf = 0x80021690;
+ blockUpdate__15daEnBlockMain_cFv = 0x800217B0;
+ blockResult__15daEnBlockMain_cFv = 0x800212C0;
+ PhysicsCallback1__15daEnBlockMain_c = 0x80021180;
+ PhysicsCallback2__15daEnBlockMain_c = 0x80021170;
+ PhysicsCallback3__15daEnBlockMain_c = 0x800211A0;
+ OPhysicsCallback1__15daEnBlockMain_c = 0x80020BF0;
+ OPhysicsCallback2__15daEnBlockMain_c = 0x80020E70;
+ OPhysicsCallback3__15daEnBlockMain_c = 0x80021010;
+ StateID_UpMove__15daEnBlockMain_c = 0x80352A34;
+ StateID_DownMove__15daEnBlockMain_c = 0x80352A74;
+ StateID_DownMoveEnd__15daEnBlockMain_c = 0x80352AB4;
+ StateID_UpMove_Diff__15daEnBlockMain_c = 0x80352AF4;
+ StateID_DownMove_Diff__15daEnBlockMain_c = 0x80352B34;
+ StateID_DownMove_DiffEnd__15daEnBlockMain_c = 0x80352B74;
+
+ __ct__5dEn_cFv = 0x80094E80;
+ afterCreate__5dEn_cFi = 0x800951D0;
+ afterExecute__5dEn_cFi = 0x80095480;
+ kill__5dEn_cFv = 0x80097F70;
+ eatIn__5dEn_cFv = 0x80097C40;
+ disableEatIn__5dEn_cFv = 0x80097CB0;
+ _vf8C__5dEn_cFPv = 0x80097D30;
+ _vfCC__5dEn_cFP7Point2d = 0x800973F0;
+ _vfD0__5dEn_cFP7Point2d = 0x800974F0;
+ doStateChange__5dEn_cFP9StateBase = 0x800A7DF0;
+ preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095CE0;
+ prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095D30;
+ preYoshiCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095F50;
+ stageActorCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80096060;
+ spriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095C10;
+ playerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095C20;
+ yoshiCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095C80;
+ collisionCat3_StarPower__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009F840;
+ collisionCat5_Mario__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FB50;
+ _vf108__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FE40;
+ collisionCatD_GroundPound__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FFD0;
+ _vf110__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FFC0;
+ collisionCat8_FencePunch__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FCE0;
+ collisionCat7_WMWaggleWater__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0150;
+ collisionCat7_WMWaggleWaterYoshi__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A02D0;
+ _vf120__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FCD0;
+ collisionCatA_PenguinMario__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FCC0;
+ collisionCat11_PipeCannon__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009F9D0;
+ collisionCat9_RollingObject__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0700;
+ collisionCat1_Fireball_E_Explosion__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A08D0;
+ collisionCat2_IceBall_15_YoshiIce__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0A30;
+ collisionCat13_Hammer__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A03C0;
+ collisionCat14_YoshiFire__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0550;
+ _vf140__5dEn_cFP13dStageActor_c = 0x800A10B0;
+ _vf144__5dEn_cFi = 0x800A0C70;
+ _vf148__5dEn_cFv = 0x800A12A0;
+ _vf14C__5dEn_cFv = 0x800A1370;
+ _vf150__5dEn_cFv = 0x800206D0;
+ eatenByYoshiProbably__5dEn_cFv = 0x80096230;
+ playHpdpSound1__5dEn_cFv = 0x800A1C00;
+ playEnemyDownSound1__5dEn_cFv = 0x800A1BB0;
+ playEnemyDownComboSound__5dEn_cFPv = 0x800A1C80;
+ playHpdpSound2__5dEn_cFv = 0x800A1D90;
+ _vf168__5dEn_cFv = 0x800A1E10;
+ dieFumi_Begin__5dEn_cFv = 0x800A1470;
+ dieFumi_Execute__5dEn_cFv = 0x800A1600;
+ dieFumi_End__5dEn_cFv = 0x800A1820;
+ dieFall_Begin__5dEn_cFv = 0x800A16A0;
+ dieFall_Execute__5dEn_cFv = 0x800A1830;
+ dieFall_End__5dEn_cFv = 0x800A1820;
+ dieBigFall_Begin__5dEn_cFv = 0x800A1910;
+ dieBigFall_Execute__5dEn_cFv = 0x800A1930;
+ dieBigFall_End__5dEn_cFv = 0x800A1920;
+ dieSmoke_Begin__5dEn_cFv = 0x800A1980;
+ dieSmoke_Execute__5dEn_cFv = 0x800A1A00;
+ dieSmoke_End__5dEn_cFv = 0x800A19F0;
+ dieYoshiFumi_Begin__5dEn_cFv = 0x800A1AC0;
+ dieYoshiFumi_Execute__5dEn_cFv = 0x800A1B40;
+ dieYoshiFumi_End__5dEn_cFv = 0x800A1B30;
+ dieIceVanish_Begin__5dEn_cFv = 0x800A1A10;
+ dieIceVanish_Execute__5dEn_cFv = 0x800A1AB0;
+ dieIceVanish_End__5dEn_cFv = 0x800A1AA0;
+ dieGoal_Begin__5dEn_cFv = 0x800A1B50;
+ dieGoal_Execute__5dEn_cFv = 0x800A1B70;
+ dieGoal_End__5dEn_cFv = 0x800A1B60;
+ dieOther_Begin__5dEn_cFv = 0x800A1B80;
+ dieOther_Execute__5dEn_cFv = 0x800A1BA0;
+ dieOther_End__5dEn_cFv = 0x800A1B90;
+ eatIn_Begin__5dEn_cFv = 0x800A81C0;
+ eatIn_Execute__5dEn_cFv = 0x800A81E0;
+ eatIn_End__5dEn_cFv = 0x800A81D0;
+ eatNow_Begin__5dEn_cFv = 0x800A8260;
+ eatNow_Execute__5dEn_cFv = 0x800A8280;
+ eatNow_End__5dEn_cFv = 0x800A8270;
+ eatOut_Begin__5dEn_cFv = 0x800A8290;
+ eatOut_Execute__5dEn_cFv = 0x800A82B0;
+ eatOut_End__5dEn_cFv = 0x800A82A0;
+ hitSpin_Begin__5dEn_cFv = 0x800A8190;
+ hitSpin_Execute__5dEn_cFv = 0x800A81B0;
+ hitSpin_End__5dEn_cFv = 0x800A81A0;
+ ice_Begin__5dEn_cFv = 0x800A7E90;
+ ice_Execute__5dEn_cFv = 0x800A7F40;
+ ice_End__5dEn_cFv = 0x800A7F30;
+ spawnHitEffectAtPosition__5dEn_cF7Point2d = 0x80095520;
+ doSomethingWithHardHitAndSoftHitEffects__5dEn_cF7Point3d = 0x80095530;
+ playEnemyDownSound2__5dEn_cFv = 0x80095580;
+ add2ToYSpeed__5dEn_cFv = 0x800955D0;
+ _vf218__5dEn_cFv = 0x80095890;
+ _vf21C__5dEn_cFv = 0x80097770;
+ _vf220__5dEn_cFPv = 0x80097F20;
+ _vf224__5dEn_cFv = 0x80097F60;
+ _vf228__5dEn_cFv = 0x800206C0;
+ _vf22C__5dEn_cFv = 0x800A8060;
+ _vf230__5dEn_cFv = 0x800A8150;
+ _vf234__5dEn_cFv = 0x800A8160;
+ _vf238__5dEn_cFv = 0x800A8180;
+ _vf23C__5dEn_cFv = 0x800206B0;
+ _vf240__5dEn_cFv = 0x800206A0;
+ _vf244__5dEn_cFv = 0x80020690;
+ _vf248__5dEn_cFi = 0x800968E0;
+ _vf24C__5dEn_cFPv = 0x80096710;
+ _vf250__5dEn_cFPv = 0x80096700;
+ _vf254__5dEn_cFPv = 0x80096720;
+ _vf258__5dEn_cFPv = 0x80096760;
+ _vf25C__5dEn_cFPv = 0x80096770;
+ _vf260__5dEn_cFPv = 0x80096910;
+ _vf264__5dEn_cFP13dStageActor_c = 0x80096D60;
+ _vf268__5dEn_cFPv = 0x80096A20;
+ spawnHitEffectAtPositionAgain__5dEn_cF7Point2d = 0x80096DF0;
+ playMameStepSound__5dEn_cFv = 0x80096C40;
+ _vf274__5dEn_cFv = 0x80096E50;
+ _vf278__5dEn_cFPv = 0x80096B30;
+ _vf27C__5dEn_cFv = 0x80096E40;
+
+ _vfD8__18dActorMultiState_cFv = 0x80067590;
+ _vfDC__18dActorMultiState_cFv = 0x800675B0;
+ _vfE0__18dActorMultiState_cFv = 0x800675A0;
+
+ __ct__13dStageActor_cFv = 0x80064110;
+ __dt__13dStageActor_cFv = 0x800642B0;
+ beforeCreate__13dStageActor_cFv = 0x80064350;
+ afterCreate__13dStageActor_cFi = 0x80064380;
+ beforeDelete__13dStageActor_cFv = 0x80064390;
+ afterDelete__13dStageActor_cFi = 0x800643E0;
+ beforeExecute__13dStageActor_cFv = 0x800643F0;
+ afterExecute__13dStageActor_cFi = 0x80064490;
+ beforeDraw__13dStageActor_cFv = 0x80064540;
+ afterDraw__13dStageActor_cFi = 0x800645E0;
+ GetExplanationString__13dStageActor_cFv = 0x800645F0;
+ _vf60__13dStageActor_cFv = 0x80065080;
+ _vf68__13dStageActor_cFv = 0x8001D210;
+ _vf6C__13dStageActor_cFv = 0x8001D200;
+ _vf70__13dStageActor_cFv = 0x80065620;
+ _vf74__13dStageActor_cFv = 0x8001D1F0;
+ _vf78__13dStageActor_cFv = 0x80065820;
+ _vf7C__13dStageActor_cFv = 0x8001D1E0;
+ _vf88__13dStageActor_cFv = 0x80065860;
+ _vf90__13dStageActor_cFP13dStageActor_c = 0x80065880;
+ _vf94__13dStageActor_cFPv = 0x80065AC0;
+ removeMyActivePhysics__13dStageActor_cFv = 0x80066080;
+ addMyActivePhysics__13dStageActor_cFv = 0x80066090;
+ returnRegularScale__13dStageActor_cFv = 0x80065950;
+ _vfA4__13dStageActor_cFPv = 0x80065970;
+ _vfA8__13dStageActor_cFPv = 0x80065A00;
+ _vfAC__13dStageActor_cFPv = 0x80065A40;
+ _vfB0__13dStageActor_cFv = 0x80065660;
+ _vfB4__13dStageActor_cFv = 0x80065B40;
+ _vfB8__13dStageActor_cFv = 0x8001D1D0;
+ _vfBC__13dStageActor_cFv = 0x80065B50;
+ _vfC0__13dStageActor_cFv = 0x80065B60;
+ _vfC4__13dStageActor_cFv = 0x80065B70;
+ _vfC8__13dStageActor_cFP7Point2d = 0x80065CC0;
+ checkZoneBoundaries__13dStageActor_cFUi = 0x80064F50;
+ create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc = 0x80064610;
+
__ct__8dScene_cFv = 0x800E19B0;
__dt__8dScene_cFv = 0x800E1A20;
beforeCreate__8dScene_cFv = 0x800E1AA0;
- afterCreate__8dScene_cFv = 0x800E1AE0;
+ afterCreate__8dScene_cFi = 0x800E1AE0;
beforeDelete__8dScene_cFv = 0x800E1B50;
- afterDelete__8dScene_cFv = 0x800E1B80;
+ afterDelete__8dScene_cFi = 0x800E1B80;
beforeExecute__8dScene_cFv = 0x800E1BE0;
- afterExecute__8dScene_cFv = 0x800E1D20;
+ afterExecute__8dScene_cFi = 0x800E1D20;
beforeDraw__8dScene_cFv = 0x800E1D70;
- afterDraw__8dScene_cFv = 0x800E1DA0;
+ afterDraw__8dScene_cFi = 0x800E1DA0;
__ct__8dActor_cFv = 0x8006C6D0;
__dt__8dActor_cFv = 0x8006C7F0;
@@ -130,13 +336,13 @@ SECTIONS {
__ct__7dBase_cFv = 0x8006C420;
__dt__7dBase_cFv = 0x8006C490;
beforeCreate__7dBase_cFv = 0x8006C540;
- afterCreate__7dBase_cFv = 0x8006C570;
+ afterCreate__7dBase_cFi = 0x8006C570;
beforeDelete__7dBase_cFv = 0x8006C580;
- afterDelete__7dBase_cFv = 0x8006C5B0;
+ afterDelete__7dBase_cFi = 0x8006C5B0;
beforeExecute__7dBase_cFv = 0x8006C5C0;
- afterExecute__7dBase_cFv = 0x8006C600;
+ afterExecute__7dBase_cFi = 0x8006C600;
beforeDraw__7dBase_cFv = 0x8006C610;
- afterDraw__7dBase_cFv = 0x8006C650;
+ afterDraw__7dBase_cFi = 0x8006C650;
onDraw__7fBase_cFv = 0x801621D0;
@@ -145,6 +351,46 @@ SECTIONS {
_vf58__8dActor_cFv = 0x8001D1C0;
_vf5C__8dActor_cFv = 0x8001D1B0;
+ __ct__9StateBaseFPCc = 0x8015F7C0;
+ __dt__9StateBaseFv = 0x8015F800;
+ isInvalid__9StateBaseFv = 0x8015F840;
+ isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0x8015F850;
+ isEqual__9StateBaseFP9StateBase = 0x8015F8C0;
+ isNotEqual__9StateBaseFP9StateBase = 0x8015F8D0;
+ getName__9StateBaseFv = 0x8015F920;
+ getID__9StateBaseFv = 0x8015F930;
+
+ __ct__10dFlagMgr_c = 0x800E3AE0;
+ setup__10dFlagMgr_cFb = 0x800E3BA0;
+ applyAndClearAllTimedActions__10dFlagMgr_cFv = 0x800E3F20;
+ execute__10dFlagMgr_cFv = 0x800E4010;
+ set__10dFlagMgr_cFUcibbbUi = 0x800E41C0;
+ findLowestFlagInSet__10dFlagMgr_cFUiUl = 0x800E4470;
+ setSpecial__10dFlagMgr_cFUcffUcUiUl = 0x800E4550;
+ get8__10dFlagMgr_cFUc = 0x800E4590;
+ get108__10dFlagMgr_cFUc = 0x800E45A0;
+ get208__10dFlagMgr_cFUc = 0x800E45B0;
+ get248__10dFlagMgr_cFUc = 0x800E45C0;
+ get448__10dFlagMgr_cFUc = 0x800E45E0;
+ instance__10dFlagMgr_c = 0x8042A078;
+
+
+ __ct__7PhysicsFv = 0x8007F7A0;
+ setup__7PhysicsFP8dActor_cPQ27Physics4InfoUcUcP7Point2d = 0x8007FB10;
+ addToList__7PhysicsFv = 0x8007F900;
+ removeFromList__7PhysicsFv = 0x8007F950;
+ update__7PhysicsFv = 0x8007FDA0;
+
+ getTileRendererList__7dBgGm_cFi = 0x80078520;
+
+ add__Q212TileRenderer4ListFP12TileRenderer = 0x80014820;
+ remove__Q212TileRenderer4ListFP12TileRenderer = 0x80014860;
+
+ __ct__12TileRendererFv = 0x800145B0;
+ __dt__12TileRendererFv = 0x800145F0;
+ setPosition__12TileRendererFfff = 0x800146B0;
+ setVars__12TileRendererFf = 0x800146D0;
+
__ct__21dPlayerModelHandler_cFUc = 0x800D6CC0;
loadModel__21dPlayerModelHandler_cFUcii = 0x800D6DF0;
setSRT__21dPlayerModelHandler_cF7Point3d6S16Vec7Point3d = 0x800D6F40;
@@ -277,8 +523,13 @@ SECTIONS {
GameHeaps = 0x80377C48;
BGDatClass = 0x80429DF0;
+ instance__10BGDatClass = 0x80429DF0;
GetTilesetName__FPvii = 0x800813F0;
+ getTilesetName__10BGDatClassFii = 0x800813F0;
+
+ getPointerToTile__12TilemapClassFiiPUib = 0x80083B40;
+
IsWideScreen__Fv = 0x800B54B0;
Player_Active = 0x80354E50;
@@ -379,6 +630,7 @@ SECTIONS {
strncpy = 0x802E19F8;
strcmp = 0x802E1AB4;
sprintf = 0x802E17DC;
+ strrchr = 0x802E1C40;
wcslen = 0x802E441C;
@@ -692,6 +944,7 @@ SECTIONS {
dSys_c__RootHeapMEM2 = 0x8042A094;
BG_GM_ptr = 0x80429DD0;
+ instance__7dBgGm_c = 0x80429DD0;
BgActorDefs = 0x80429DDC;
@@ -735,6 +988,8 @@ SECTIONS {
continuePlumberSetPowerupTextureDebug = 0x800CA5C4;
+ returnFromPowerupSoundChange = 0x801412FC;
+
ExitFromTileGodHack = 0x807E1684;
SomeTable_802F5440 = 0x802F5140;
@@ -753,6 +1008,9 @@ SECTIONS {
GetRandomSeed = 0x800B2EC0;
RandomSeed = 0x80429F44;
+ MakeRandomNumber__Fi = 0x800B2EE0;
+ MakeRandomNumberForTiles__Fi = 0x801613A0;
+
StrangeReplayValue1 = 0x8042792E;
StrangeReplayValue2 = 0x80429D69;
StrangeReplayValue3 = 0x80429D6A;
@@ -768,13 +1026,16 @@ SECTIONS {
SomeWipeClass = 0x8042A440;
QueryGlobal5758 = 0x800B3B50;
+
.text : {
FILL (0)
__text_start = . ;
*(.init)
*(.text)
+ __ctor_loc = . ;
*(.ctors)
+ __ctor_end = . ;
*(.dtors)
*(.rodata)
/**(.sdata)*/
@@ -786,4 +1047,3 @@ SECTIONS {
__text_end = . ;
}
}
-
diff --git a/kamek_ntsc2.x b/kamek_ntsc2.x
index a35703f..f803db3 100644
--- a/kamek_ntsc2.x
+++ b/kamek_ntsc2.x
@@ -6,6 +6,7 @@ OUTPUT_FORMAT ("binary")
SECTIONS {
GetSpecificPlayerActor = 0x8005F900;
+ Actor_SearchByID = 0x80162D00;
TimeStopFlag = 0x80429CFA;
TimerBranch = 0x800E39C8;
MarioDescentRate = 0x8042B864;
@@ -16,6 +17,8 @@ SECTIONS {
AlwaysDrawFlag = 0x80064540;
AlwaysDrawBranch = 0x80064544;
GenerateRandomNumber = 0x800B2EE0;
+ OneofManySoundPlayers = 0x800CE8C0;
+ BombExplodeState = 0x80B12A88;
_savefpr_14 = 0x802DCCA8;
_savefpr_15 = 0x802DCCAC;
@@ -101,6 +104,9 @@ SECTIONS {
__construct_new_array = 0x802DC7E0;
__destroy_new_array = 0x802DCB10;
+ __register_global_object = 0x802DC780;
+ __ptmf_scall = 0x802DCBFC;
+
setup__13FunctionChainFPPFPv_bUs = 0x8015F600;
@@ -113,16 +119,216 @@ SECTIONS {
GetExplanationString__7dBase_cFv = 0x8006C660;
+ __vt__15daEnBlockMain_c = 0x80301EA8;
+ __dt__15daEnBlockMain_cFv = 0x80023340;
+ calledWhenUpMoveBegins__15daEnBlockMain_cFv = 0x80022E80;
+ calledWhenDownMoveBegins__15daEnBlockMain_cFv = 0x80022F60;
+ calledWhenUpMoveExecutes__15daEnBlockMain_cFv = 0x80022F30;
+ calledWhenUpMoveDiffExecutes__15daEnBlockMain_cFv = 0x800231A0;
+ calledWhenDownMoveExecutes__15daEnBlockMain_cFv = 0x80023010;
+ calledWhenDownMoveEndExecutes__15daEnBlockMain_cFv = 0x80023080;
+ calledWhenDownMoveDiffExecutes__15daEnBlockMain_cFv = 0x800232C0;
+ calledWhenDownMoveDiffEndExecutes__15daEnBlockMain_cFv = 0x80023330;
+ updateScale__15daEnBlockMain_cFb = 0x80022DC0;
+ upMove_Begin__15daEnBlockMain_cFv = 0x80022E60;
+ upMove_Execute__15daEnBlockMain_cFv = 0x80022EA0;
+ upMove_End__15daEnBlockMain_cFv = 0x80022E90;
+ downMove_Begin__15daEnBlockMain_cFv = 0x80022F40;
+ downMove_Execute__15daEnBlockMain_cFv = 0x80022F80;
+ downMove_End__15daEnBlockMain_cFv = 0x80022F70;
+ downMoveEnd_Begin__15daEnBlockMain_cFv = 0x80023020;
+ downMoveEnd_Execute__15daEnBlockMain_cFv = 0x80023040;
+ downMoveEnd_End__15daEnBlockMain_cFv = 0x80023030;
+ upMove_Diff_Begin__15daEnBlockMain_cFv = 0x80023090;
+ upMove_Diff_Execute__15daEnBlockMain_cFv = 0x800230D0;
+ upMove_Diff_End__15daEnBlockMain_cFv = 0x800230C0;
+ downMove_Diff_Begin__15daEnBlockMain_cFv = 0x800231B0;
+ downMove_Diff_Execute__15daEnBlockMain_cFv = 0x800231F0;
+ downMove_Diff_End__15daEnBlockMain_cFv = 0x800231E0;
+ downMove_DiffEnd_Begin__15daEnBlockMain_cFv = 0x800232D0;
+ downMove_DiffEnd_Execute__15daEnBlockMain_cFv = 0x800232F0;
+ downMove_DiffEnd_End__15daEnBlockMain_cFv = 0x800232E0;
+ blockInit__15daEnBlockMain_cFf = 0x80021690;
+ blockUpdate__15daEnBlockMain_cFv = 0x800217B0;
+ blockResult__15daEnBlockMain_cFv = 0x800212C0;
+ PhysicsCallback1__15daEnBlockMain_c = 0x80021180;
+ PhysicsCallback2__15daEnBlockMain_c = 0x80021170;
+ PhysicsCallback3__15daEnBlockMain_c = 0x800211A0;
+ OPhysicsCallback1__15daEnBlockMain_c = 0x80020BF0;
+ OPhysicsCallback2__15daEnBlockMain_c = 0x80020E70;
+ OPhysicsCallback3__15daEnBlockMain_c = 0x80021010;
+ StateID_UpMove__15daEnBlockMain_c = 0x80352A34;
+ StateID_DownMove__15daEnBlockMain_c = 0x80352A74;
+ StateID_DownMoveEnd__15daEnBlockMain_c = 0x80352AB4;
+ StateID_UpMove_Diff__15daEnBlockMain_c = 0x80352AF4;
+ StateID_DownMove_Diff__15daEnBlockMain_c = 0x80352B34;
+ StateID_DownMove_DiffEnd__15daEnBlockMain_c = 0x80352B74;
+
+ __ct__5dEn_cFv = 0x80094E80;
+ afterCreate__5dEn_cFi = 0x800951D0;
+ afterExecute__5dEn_cFi = 0x80095480;
+ kill__5dEn_cFv = 0x80097F70;
+ eatIn__5dEn_cFv = 0x80097C40;
+ disableEatIn__5dEn_cFv = 0x80097CB0;
+ _vf8C__5dEn_cFPv = 0x80097D30;
+ _vfCC__5dEn_cFP7Point2d = 0x800973F0;
+ _vfD0__5dEn_cFP7Point2d = 0x800974F0;
+ doStateChange__5dEn_cFP9StateBase = 0x800A7DF0;
+ preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095CE0;
+ prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095D30;
+ preYoshiCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095F50;
+ stageActorCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80096060;
+ spriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095C10;
+ playerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095C20;
+ yoshiCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x80095C80;
+ collisionCat3_StarPower__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009F840;
+ collisionCat5_Mario__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FB50;
+ _vf108__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FE40;
+ collisionCatD_GroundPound__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FFD0;
+ _vf110__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FFC0;
+ collisionCat8_FencePunch__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FCE0;
+ collisionCat7_WMWaggleWater__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0150;
+ collisionCat7_WMWaggleWaterYoshi__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A02D0;
+ _vf120__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FCD0;
+ collisionCatA_PenguinMario__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009FCC0;
+ collisionCat11_PipeCannon__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x8009F9D0;
+ collisionCat9_RollingObject__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0700;
+ collisionCat1_Fireball_E_Explosion__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A08D0;
+ collisionCat2_IceBall_15_YoshiIce__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0A30;
+ collisionCat13_Hammer__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A03C0;
+ collisionCat14_YoshiFire__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0x800A0550;
+ _vf140__5dEn_cFP13dStageActor_c = 0x800A10B0;
+ _vf144__5dEn_cFi = 0x800A0C70;
+ _vf148__5dEn_cFv = 0x800A12A0;
+ _vf14C__5dEn_cFv = 0x800A1370;
+ _vf150__5dEn_cFv = 0x800206D0;
+ eatenByYoshiProbably__5dEn_cFv = 0x80096230;
+ playHpdpSound1__5dEn_cFv = 0x800A1C00;
+ playEnemyDownSound1__5dEn_cFv = 0x800A1BB0;
+ playEnemyDownComboSound__5dEn_cFPv = 0x800A1C80;
+ playHpdpSound2__5dEn_cFv = 0x800A1D90;
+ _vf168__5dEn_cFv = 0x800A1E10;
+ dieFumi_Begin__5dEn_cFv = 0x800A1470;
+ dieFumi_Execute__5dEn_cFv = 0x800A1600;
+ dieFumi_End__5dEn_cFv = 0x800A1820;
+ dieFall_Begin__5dEn_cFv = 0x800A16A0;
+ dieFall_Execute__5dEn_cFv = 0x800A1830;
+ dieFall_End__5dEn_cFv = 0x800A1820;
+ dieBigFall_Begin__5dEn_cFv = 0x800A1910;
+ dieBigFall_Execute__5dEn_cFv = 0x800A1930;
+ dieBigFall_End__5dEn_cFv = 0x800A1920;
+ dieSmoke_Begin__5dEn_cFv = 0x800A1980;
+ dieSmoke_Execute__5dEn_cFv = 0x800A1A00;
+ dieSmoke_End__5dEn_cFv = 0x800A19F0;
+ dieYoshiFumi_Begin__5dEn_cFv = 0x800A1AC0;
+ dieYoshiFumi_Execute__5dEn_cFv = 0x800A1B40;
+ dieYoshiFumi_End__5dEn_cFv = 0x800A1B30;
+ dieIceVanish_Begin__5dEn_cFv = 0x800A1A10;
+ dieIceVanish_Execute__5dEn_cFv = 0x800A1AB0;
+ dieIceVanish_End__5dEn_cFv = 0x800A1AA0;
+ dieGoal_Begin__5dEn_cFv = 0x800A1B50;
+ dieGoal_Execute__5dEn_cFv = 0x800A1B70;
+ dieGoal_End__5dEn_cFv = 0x800A1B60;
+ dieOther_Begin__5dEn_cFv = 0x800A1B80;
+ dieOther_Execute__5dEn_cFv = 0x800A1BA0;
+ dieOther_End__5dEn_cFv = 0x800A1B90;
+ eatIn_Begin__5dEn_cFv = 0x800A81C0;
+ eatIn_Execute__5dEn_cFv = 0x800A81E0;
+ eatIn_End__5dEn_cFv = 0x800A81D0;
+ eatNow_Begin__5dEn_cFv = 0x800A8260;
+ eatNow_Execute__5dEn_cFv = 0x800A8280;
+ eatNow_End__5dEn_cFv = 0x800A8270;
+ eatOut_Begin__5dEn_cFv = 0x800A8290;
+ eatOut_Execute__5dEn_cFv = 0x800A82B0;
+ eatOut_End__5dEn_cFv = 0x800A82A0;
+ hitSpin_Begin__5dEn_cFv = 0x800A8190;
+ hitSpin_Execute__5dEn_cFv = 0x800A81B0;
+ hitSpin_End__5dEn_cFv = 0x800A81A0;
+ ice_Begin__5dEn_cFv = 0x800A7E90;
+ ice_Execute__5dEn_cFv = 0x800A7F40;
+ ice_End__5dEn_cFv = 0x800A7F30;
+ spawnHitEffectAtPosition__5dEn_cF7Point2d = 0x80095520;
+ doSomethingWithHardHitAndSoftHitEffects__5dEn_cF7Point3d = 0x80095530;
+ playEnemyDownSound2__5dEn_cFv = 0x80095580;
+ add2ToYSpeed__5dEn_cFv = 0x800955D0;
+ _vf218__5dEn_cFv = 0x80095890;
+ _vf21C__5dEn_cFv = 0x80097770;
+ _vf220__5dEn_cFPv = 0x80097F20;
+ _vf224__5dEn_cFv = 0x80097F60;
+ _vf228__5dEn_cFv = 0x800206C0;
+ _vf22C__5dEn_cFv = 0x800A8060;
+ _vf230__5dEn_cFv = 0x800A8150;
+ _vf234__5dEn_cFv = 0x800A8160;
+ _vf238__5dEn_cFv = 0x800A8180;
+ _vf23C__5dEn_cFv = 0x800206B0;
+ _vf240__5dEn_cFv = 0x800206A0;
+ _vf244__5dEn_cFv = 0x80020690;
+ _vf248__5dEn_cFi = 0x800968E0;
+ _vf24C__5dEn_cFPv = 0x80096710;
+ _vf250__5dEn_cFPv = 0x80096700;
+ _vf254__5dEn_cFPv = 0x80096720;
+ _vf258__5dEn_cFPv = 0x80096760;
+ _vf25C__5dEn_cFPv = 0x80096770;
+ _vf260__5dEn_cFPv = 0x80096910;
+ _vf264__5dEn_cFP13dStageActor_c = 0x80096D60;
+ _vf268__5dEn_cFPv = 0x80096A20;
+ spawnHitEffectAtPositionAgain__5dEn_cF7Point2d = 0x80096DF0;
+ playMameStepSound__5dEn_cFv = 0x80096C40;
+ _vf274__5dEn_cFv = 0x80096E50;
+ _vf278__5dEn_cFPv = 0x80096B30;
+ _vf27C__5dEn_cFv = 0x80096E40;
+
+ _vfD8__18dActorMultiState_cFv = 0x80067590;
+ _vfDC__18dActorMultiState_cFv = 0x800675B0;
+ _vfE0__18dActorMultiState_cFv = 0x800675A0;
+
+ __ct__13dStageActor_cFv = 0x80064110;
+ __dt__13dStageActor_cFv = 0x800642B0;
+ beforeCreate__13dStageActor_cFv = 0x80064350;
+ afterCreate__13dStageActor_cFi = 0x80064380;
+ beforeDelete__13dStageActor_cFv = 0x80064390;
+ afterDelete__13dStageActor_cFi = 0x800643E0;
+ beforeExecute__13dStageActor_cFv = 0x800643F0;
+ afterExecute__13dStageActor_cFi = 0x80064490;
+ beforeDraw__13dStageActor_cFv = 0x80064540;
+ afterDraw__13dStageActor_cFi = 0x800645E0;
+ GetExplanationString__13dStageActor_cFv = 0x800645F0;
+ _vf60__13dStageActor_cFv = 0x80065080;
+ _vf68__13dStageActor_cFv = 0x8001D210;
+ _vf6C__13dStageActor_cFv = 0x8001D200;
+ _vf70__13dStageActor_cFv = 0x80065620;
+ _vf74__13dStageActor_cFv = 0x8001D1F0;
+ _vf78__13dStageActor_cFv = 0x80065820;
+ _vf7C__13dStageActor_cFv = 0x8001D1E0;
+ _vf88__13dStageActor_cFv = 0x80065860;
+ _vf90__13dStageActor_cFP13dStageActor_c = 0x80065880;
+ _vf94__13dStageActor_cFPv = 0x80065AC0;
+ removeMyActivePhysics__13dStageActor_cFv = 0x80066080;
+ addMyActivePhysics__13dStageActor_cFv = 0x80066090;
+ returnRegularScale__13dStageActor_cFv = 0x80065950;
+ _vfA4__13dStageActor_cFPv = 0x80065970;
+ _vfA8__13dStageActor_cFPv = 0x80065A00;
+ _vfAC__13dStageActor_cFPv = 0x80065A40;
+ _vfB0__13dStageActor_cFv = 0x80065660;
+ _vfB4__13dStageActor_cFv = 0x80065B40;
+ _vfB8__13dStageActor_cFv = 0x8001D1D0;
+ _vfBC__13dStageActor_cFv = 0x80065B50;
+ _vfC0__13dStageActor_cFv = 0x80065B60;
+ _vfC4__13dStageActor_cFv = 0x80065B70;
+ _vfC8__13dStageActor_cFP7Point2d = 0x80065CC0;
+ checkZoneBoundaries__13dStageActor_cFUi = 0x80064F50;
+ create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc = 0x80064610;
+
__ct__8dScene_cFv = 0x800E19B0;
__dt__8dScene_cFv = 0x800E1A20;
beforeCreate__8dScene_cFv = 0x800E1AA0;
- afterCreate__8dScene_cFv = 0x800E1AE0;
+ afterCreate__8dScene_cFi = 0x800E1AE0;
beforeDelete__8dScene_cFv = 0x800E1B50;
- afterDelete__8dScene_cFv = 0x800E1B80;
+ afterDelete__8dScene_cFi = 0x800E1B80;
beforeExecute__8dScene_cFv = 0x800E1BE0;
- afterExecute__8dScene_cFv = 0x800E1D20;
+ afterExecute__8dScene_cFi = 0x800E1D20;
beforeDraw__8dScene_cFv = 0x800E1D70;
- afterDraw__8dScene_cFv = 0x800E1DA0;
+ afterDraw__8dScene_cFi = 0x800E1DA0;
__ct__8dActor_cFv = 0x8006C6D0;
__dt__8dActor_cFv = 0x8006C7F0;
@@ -130,13 +336,13 @@ SECTIONS {
__ct__7dBase_cFv = 0x8006C420;
__dt__7dBase_cFv = 0x8006C490;
beforeCreate__7dBase_cFv = 0x8006C540;
- afterCreate__7dBase_cFv = 0x8006C570;
+ afterCreate__7dBase_cFi = 0x8006C570;
beforeDelete__7dBase_cFv = 0x8006C580;
- afterDelete__7dBase_cFv = 0x8006C5B0;
+ afterDelete__7dBase_cFi = 0x8006C5B0;
beforeExecute__7dBase_cFv = 0x8006C5C0;
- afterExecute__7dBase_cFv = 0x8006C600;
+ afterExecute__7dBase_cFi = 0x8006C600;
beforeDraw__7dBase_cFv = 0x8006C610;
- afterDraw__7dBase_cFv = 0x8006C650;
+ afterDraw__7dBase_cFi = 0x8006C650;
onDraw__7fBase_cFv = 0x801621D0;
@@ -145,6 +351,46 @@ SECTIONS {
_vf58__8dActor_cFv = 0x8001D1C0;
_vf5C__8dActor_cFv = 0x8001D1B0;
+ __ct__9StateBaseFPCc = 0x8015F7C0;
+ __dt__9StateBaseFv = 0x8015F800;
+ isInvalid__9StateBaseFv = 0x8015F840;
+ isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0x8015F850;
+ isEqual__9StateBaseFP9StateBase = 0x8015F8C0;
+ isNotEqual__9StateBaseFP9StateBase = 0x8015F8D0;
+ getName__9StateBaseFv = 0x8015F920;
+ getID__9StateBaseFv = 0x8015F930;
+
+ __ct__10dFlagMgr_c = 0x800E3AE0;
+ setup__10dFlagMgr_cFb = 0x800E3BA0;
+ applyAndClearAllTimedActions__10dFlagMgr_cFv = 0x800E3F20;
+ execute__10dFlagMgr_cFv = 0x800E4010;
+ set__10dFlagMgr_cFUcibbbUi = 0x800E41C0;
+ findLowestFlagInSet__10dFlagMgr_cFUiUl = 0x800E4470;
+ setSpecial__10dFlagMgr_cFUcffUcUiUl = 0x800E4550;
+ get8__10dFlagMgr_cFUc = 0x800E4590;
+ get108__10dFlagMgr_cFUc = 0x800E45A0;
+ get208__10dFlagMgr_cFUc = 0x800E45B0;
+ get248__10dFlagMgr_cFUc = 0x800E45C0;
+ get448__10dFlagMgr_cFUc = 0x800E45E0;
+ instance__10dFlagMgr_c = 0x8042A078;
+
+
+ __ct__7PhysicsFv = 0x8007F7A0;
+ setup__7PhysicsFP8dActor_cPQ27Physics4InfoUcUcP7Point2d = 0x8007FB10;
+ addToList__7PhysicsFv = 0x8007F900;
+ removeFromList__7PhysicsFv = 0x8007F950;
+ update__7PhysicsFv = 0x8007FDA0;
+
+ getTileRendererList__7dBgGm_cFi = 0x80078520;
+
+ add__Q212TileRenderer4ListFP12TileRenderer = 0x80014820;
+ remove__Q212TileRenderer4ListFP12TileRenderer = 0x80014860;
+
+ __ct__12TileRendererFv = 0x800145B0;
+ __dt__12TileRendererFv = 0x800145F0;
+ setPosition__12TileRendererFfff = 0x800146B0;
+ setVars__12TileRendererFf = 0x800146D0;
+
__ct__21dPlayerModelHandler_cFUc = 0x800D6CC0;
loadModel__21dPlayerModelHandler_cFUcii = 0x800D6DF0;
setSRT__21dPlayerModelHandler_cF7Point3d6S16Vec7Point3d = 0x800D6F40;
@@ -277,8 +523,13 @@ SECTIONS {
GameHeaps = 0x80377C48;
BGDatClass = 0x80429DF0;
+ instance__10BGDatClass = 0x80429DF0;
GetTilesetName__FPvii = 0x800813F0;
+ getTilesetName__10BGDatClassFii = 0x800813F0;
+
+ getPointerToTile__12TilemapClassFiiPUib = 0x80083B40;
+
IsWideScreen__Fv = 0x800B54B0;
Player_Active = 0x80354E50;
@@ -379,6 +630,7 @@ SECTIONS {
strncpy = 0x802E19F8;
strcmp = 0x802E1AB4;
sprintf = 0x802E17DC;
+ strrchr = 0x802E1C40;
wcslen = 0x802E441C;
@@ -692,6 +944,7 @@ SECTIONS {
dSys_c__RootHeapMEM2 = 0x8042A094;
BG_GM_ptr = 0x80429DD0;
+ instance__7dBgGm_c = 0x80429DD0;
BgActorDefs = 0x80429DDC;
@@ -735,6 +988,8 @@ SECTIONS {
continuePlumberSetPowerupTextureDebug = 0x800CA5C4;
+ returnFromPowerupSoundChange = 0x801412FC;
+
ExitFromTileGodHack = 0x807E1694;
SomeTable_802F5440 = 0x802F5140;
@@ -753,6 +1008,9 @@ SECTIONS {
GetRandomSeed = 0x800B2EC0;
RandomSeed = 0x80429F44;
+ MakeRandomNumber__Fi = 0x800B2EE0;
+ MakeRandomNumberForTiles__Fi = 0x801613A0;
+
StrangeReplayValue1 = 0x8042792E;
StrangeReplayValue2 = 0x80429D69;
StrangeReplayValue3 = 0x80429D6A;
@@ -768,13 +1026,16 @@ SECTIONS {
SomeWipeClass = 0x8042A440;
QueryGlobal5758 = 0x800B3B50;
+
.text : {
FILL (0)
__text_start = . ;
*(.init)
*(.text)
+ __ctor_loc = . ;
*(.ctors)
+ __ctor_end = . ;
*(.dtors)
*(.rodata)
/**(.sdata)*/
@@ -786,4 +1047,3 @@ SECTIONS {
__text_end = . ;
}
}
-
diff --git a/kamek_pal.x b/kamek_pal.x
index 6bf4875..81be80c 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -523,8 +523,13 @@ SECTIONS {
GameHeaps = 0x80377F48;
BGDatClass = 0x8042A0D0;
+ instance__10BGDatClass = 0x8042A0D0;
GetTilesetName__FPvii = 0x800813F0;
+ getTilesetName__10BGDatClassFii = 0x800813F0;
+
+ getPointerToTile__12TilemapClassFiiPUib = 0x80083B40;
+
IsWideScreen__Fv = 0x800B5500;
Player_Active = 0x80355150;
@@ -983,6 +988,8 @@ SECTIONS {
continuePlumberSetPowerupTextureDebug = 0x800CA6B4;
+ returnFromPowerupSoundChange = 0x8014143C;
+
ExitFromTileGodHack = 0x807E1684;
SomeTable_802F5440 = 0x802F5440;
@@ -1001,6 +1008,9 @@ SECTIONS {
GetRandomSeed = 0x800B2EC0;
RandomSeed = 0x8042A224;
+ MakeRandomNumber__Fi = 0x800B2EE0;
+ MakeRandomNumberForTiles__Fi = 0x801614E0;
+
StrangeReplayValue1 = 0x80427C2E;
StrangeReplayValue2 = 0x8042A049;
StrangeReplayValue3 = 0x8042A04A;
diff --git a/kamek_pal2.x b/kamek_pal2.x
index 16d9c48..f9f8a9a 100644
--- a/kamek_pal2.x
+++ b/kamek_pal2.x
@@ -6,6 +6,7 @@ OUTPUT_FORMAT ("binary")
SECTIONS {
GetSpecificPlayerActor = 0xDEADBEEF;
+ Actor_SearchByID = 0xDEADBEEF;
TimeStopFlag = 0xDEADBEEF;
TimerBranch = 0xDEADBEEF;
MarioDescentRate = 0xDEADBEEF;
@@ -16,6 +17,8 @@ SECTIONS {
AlwaysDrawFlag = 0xDEADBEEF;
AlwaysDrawBranch = 0xDEADBEEF;
GenerateRandomNumber = 0xDEADBEEF;
+ OneofManySoundPlayers = 0xDEADBEEF;
+ BombExplodeState = 0xDEADBEEF;
_savefpr_14 = 0xDEADBEEF;
_savefpr_15 = 0xDEADBEEF;
@@ -101,6 +104,9 @@ SECTIONS {
__construct_new_array = 0xDEADBEEF;
__destroy_new_array = 0xDEADBEEF;
+ __register_global_object = 0xDEADBEEF;
+ __ptmf_scall = 0xDEADBEEF;
+
setup__13FunctionChainFPPFPv_bUs = 0xDEADBEEF;
@@ -113,16 +119,216 @@ SECTIONS {
GetExplanationString__7dBase_cFv = 0xDEADBEEF;
+ __vt__15daEnBlockMain_c = 0xDEADBEEF;
+ __dt__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenUpMoveBegins__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenDownMoveBegins__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenUpMoveExecutes__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenUpMoveDiffExecutes__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenDownMoveExecutes__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenDownMoveEndExecutes__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenDownMoveDiffExecutes__15daEnBlockMain_cFv = 0xDEADBEEF;
+ calledWhenDownMoveDiffEndExecutes__15daEnBlockMain_cFv = 0xDEADBEEF;
+ updateScale__15daEnBlockMain_cFb = 0xDEADBEEF;
+ upMove_Begin__15daEnBlockMain_cFv = 0xDEADBEEF;
+ upMove_Execute__15daEnBlockMain_cFv = 0xDEADBEEF;
+ upMove_End__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_Begin__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_Execute__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_End__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMoveEnd_Begin__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMoveEnd_Execute__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMoveEnd_End__15daEnBlockMain_cFv = 0xDEADBEEF;
+ upMove_Diff_Begin__15daEnBlockMain_cFv = 0xDEADBEEF;
+ upMove_Diff_Execute__15daEnBlockMain_cFv = 0xDEADBEEF;
+ upMove_Diff_End__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_Diff_Begin__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_Diff_Execute__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_Diff_End__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_DiffEnd_Begin__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_DiffEnd_Execute__15daEnBlockMain_cFv = 0xDEADBEEF;
+ downMove_DiffEnd_End__15daEnBlockMain_cFv = 0xDEADBEEF;
+ blockInit__15daEnBlockMain_cFf = 0xDEADBEEF;
+ blockUpdate__15daEnBlockMain_cFv = 0xDEADBEEF;
+ blockResult__15daEnBlockMain_cFv = 0xDEADBEEF;
+ PhysicsCallback1__15daEnBlockMain_c = 0xDEADBEEF;
+ PhysicsCallback2__15daEnBlockMain_c = 0xDEADBEEF;
+ PhysicsCallback3__15daEnBlockMain_c = 0xDEADBEEF;
+ OPhysicsCallback1__15daEnBlockMain_c = 0xDEADBEEF;
+ OPhysicsCallback2__15daEnBlockMain_c = 0xDEADBEEF;
+ OPhysicsCallback3__15daEnBlockMain_c = 0xDEADBEEF;
+ StateID_UpMove__15daEnBlockMain_c = 0xDEADBEEF;
+ StateID_DownMove__15daEnBlockMain_c = 0xDEADBEEF;
+ StateID_DownMoveEnd__15daEnBlockMain_c = 0xDEADBEEF;
+ StateID_UpMove_Diff__15daEnBlockMain_c = 0xDEADBEEF;
+ StateID_DownMove_Diff__15daEnBlockMain_c = 0xDEADBEEF;
+ StateID_DownMove_DiffEnd__15daEnBlockMain_c = 0xDEADBEEF;
+
+ __ct__5dEn_cFv = 0xDEADBEEF;
+ afterCreate__5dEn_cFi = 0xDEADBEEF;
+ afterExecute__5dEn_cFi = 0xDEADBEEF;
+ kill__5dEn_cFv = 0xDEADBEEF;
+ eatIn__5dEn_cFv = 0xDEADBEEF;
+ disableEatIn__5dEn_cFv = 0xDEADBEEF;
+ _vf8C__5dEn_cFPv = 0xDEADBEEF;
+ _vfCC__5dEn_cFP7Point2d = 0xDEADBEEF;
+ _vfD0__5dEn_cFP7Point2d = 0xDEADBEEF;
+ doStateChange__5dEn_cFP9StateBase = 0xDEADBEEF;
+ preSpriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ prePlayerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ preYoshiCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ stageActorCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ spriteCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ playerCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ yoshiCollision__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat3_StarPower__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat5_Mario__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ _vf108__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCatD_GroundPound__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ _vf110__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat8_FencePunch__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat7_WMWaggleWater__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat7_WMWaggleWaterYoshi__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ _vf120__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCatA_PenguinMario__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat11_PipeCannon__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat9_RollingObject__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat1_Fireball_E_Explosion__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat2_IceBall_15_YoshiIce__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat13_Hammer__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ collisionCat14_YoshiFire__5dEn_cFP13ActivePhysicsP13ActivePhysics = 0xDEADBEEF;
+ _vf140__5dEn_cFP13dStageActor_c = 0xDEADBEEF;
+ _vf144__5dEn_cFi = 0xDEADBEEF;
+ _vf148__5dEn_cFv = 0xDEADBEEF;
+ _vf14C__5dEn_cFv = 0xDEADBEEF;
+ _vf150__5dEn_cFv = 0xDEADBEEF;
+ eatenByYoshiProbably__5dEn_cFv = 0xDEADBEEF;
+ playHpdpSound1__5dEn_cFv = 0xDEADBEEF;
+ playEnemyDownSound1__5dEn_cFv = 0xDEADBEEF;
+ playEnemyDownComboSound__5dEn_cFPv = 0xDEADBEEF;
+ playHpdpSound2__5dEn_cFv = 0xDEADBEEF;
+ _vf168__5dEn_cFv = 0xDEADBEEF;
+ dieFumi_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieFumi_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieFumi_End__5dEn_cFv = 0xDEADBEEF;
+ dieFall_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieFall_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieFall_End__5dEn_cFv = 0xDEADBEEF;
+ dieBigFall_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieBigFall_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieBigFall_End__5dEn_cFv = 0xDEADBEEF;
+ dieSmoke_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieSmoke_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieSmoke_End__5dEn_cFv = 0xDEADBEEF;
+ dieYoshiFumi_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieYoshiFumi_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieYoshiFumi_End__5dEn_cFv = 0xDEADBEEF;
+ dieIceVanish_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieIceVanish_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieIceVanish_End__5dEn_cFv = 0xDEADBEEF;
+ dieGoal_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieGoal_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieGoal_End__5dEn_cFv = 0xDEADBEEF;
+ dieOther_Begin__5dEn_cFv = 0xDEADBEEF;
+ dieOther_Execute__5dEn_cFv = 0xDEADBEEF;
+ dieOther_End__5dEn_cFv = 0xDEADBEEF;
+ eatIn_Begin__5dEn_cFv = 0xDEADBEEF;
+ eatIn_Execute__5dEn_cFv = 0xDEADBEEF;
+ eatIn_End__5dEn_cFv = 0xDEADBEEF;
+ eatNow_Begin__5dEn_cFv = 0xDEADBEEF;
+ eatNow_Execute__5dEn_cFv = 0xDEADBEEF;
+ eatNow_End__5dEn_cFv = 0xDEADBEEF;
+ eatOut_Begin__5dEn_cFv = 0xDEADBEEF;
+ eatOut_Execute__5dEn_cFv = 0xDEADBEEF;
+ eatOut_End__5dEn_cFv = 0xDEADBEEF;
+ hitSpin_Begin__5dEn_cFv = 0xDEADBEEF;
+ hitSpin_Execute__5dEn_cFv = 0xDEADBEEF;
+ hitSpin_End__5dEn_cFv = 0xDEADBEEF;
+ ice_Begin__5dEn_cFv = 0xDEADBEEF;
+ ice_Execute__5dEn_cFv = 0xDEADBEEF;
+ ice_End__5dEn_cFv = 0xDEADBEEF;
+ spawnHitEffectAtPosition__5dEn_cF7Point2d = 0xDEADBEEF;
+ doSomethingWithHardHitAndSoftHitEffects__5dEn_cF7Point3d = 0xDEADBEEF;
+ playEnemyDownSound2__5dEn_cFv = 0xDEADBEEF;
+ add2ToYSpeed__5dEn_cFv = 0xDEADBEEF;
+ _vf218__5dEn_cFv = 0xDEADBEEF;
+ _vf21C__5dEn_cFv = 0xDEADBEEF;
+ _vf220__5dEn_cFPv = 0xDEADBEEF;
+ _vf224__5dEn_cFv = 0xDEADBEEF;
+ _vf228__5dEn_cFv = 0xDEADBEEF;
+ _vf22C__5dEn_cFv = 0xDEADBEEF;
+ _vf230__5dEn_cFv = 0xDEADBEEF;
+ _vf234__5dEn_cFv = 0xDEADBEEF;
+ _vf238__5dEn_cFv = 0xDEADBEEF;
+ _vf23C__5dEn_cFv = 0xDEADBEEF;
+ _vf240__5dEn_cFv = 0xDEADBEEF;
+ _vf244__5dEn_cFv = 0xDEADBEEF;
+ _vf248__5dEn_cFi = 0xDEADBEEF;
+ _vf24C__5dEn_cFPv = 0xDEADBEEF;
+ _vf250__5dEn_cFPv = 0xDEADBEEF;
+ _vf254__5dEn_cFPv = 0xDEADBEEF;
+ _vf258__5dEn_cFPv = 0xDEADBEEF;
+ _vf25C__5dEn_cFPv = 0xDEADBEEF;
+ _vf260__5dEn_cFPv = 0xDEADBEEF;
+ _vf264__5dEn_cFP13dStageActor_c = 0xDEADBEEF;
+ _vf268__5dEn_cFPv = 0xDEADBEEF;
+ spawnHitEffectAtPositionAgain__5dEn_cF7Point2d = 0xDEADBEEF;
+ playMameStepSound__5dEn_cFv = 0xDEADBEEF;
+ _vf274__5dEn_cFv = 0xDEADBEEF;
+ _vf278__5dEn_cFPv = 0xDEADBEEF;
+ _vf27C__5dEn_cFv = 0xDEADBEEF;
+
+ _vfD8__18dActorMultiState_cFv = 0xDEADBEEF;
+ _vfDC__18dActorMultiState_cFv = 0xDEADBEEF;
+ _vfE0__18dActorMultiState_cFv = 0xDEADBEEF;
+
+ __ct__13dStageActor_cFv = 0xDEADBEEF;
+ __dt__13dStageActor_cFv = 0xDEADBEEF;
+ beforeCreate__13dStageActor_cFv = 0xDEADBEEF;
+ afterCreate__13dStageActor_cFi = 0xDEADBEEF;
+ beforeDelete__13dStageActor_cFv = 0xDEADBEEF;
+ afterDelete__13dStageActor_cFi = 0xDEADBEEF;
+ beforeExecute__13dStageActor_cFv = 0xDEADBEEF;
+ afterExecute__13dStageActor_cFi = 0xDEADBEEF;
+ beforeDraw__13dStageActor_cFv = 0xDEADBEEF;
+ afterDraw__13dStageActor_cFi = 0xDEADBEEF;
+ GetExplanationString__13dStageActor_cFv = 0xDEADBEEF;
+ _vf60__13dStageActor_cFv = 0xDEADBEEF;
+ _vf68__13dStageActor_cFv = 0xDEADBEEF;
+ _vf6C__13dStageActor_cFv = 0xDEADBEEF;
+ _vf70__13dStageActor_cFv = 0xDEADBEEF;
+ _vf74__13dStageActor_cFv = 0xDEADBEEF;
+ _vf78__13dStageActor_cFv = 0xDEADBEEF;
+ _vf7C__13dStageActor_cFv = 0xDEADBEEF;
+ _vf88__13dStageActor_cFv = 0xDEADBEEF;
+ _vf90__13dStageActor_cFP13dStageActor_c = 0xDEADBEEF;
+ _vf94__13dStageActor_cFPv = 0xDEADBEEF;
+ removeMyActivePhysics__13dStageActor_cFv = 0xDEADBEEF;
+ addMyActivePhysics__13dStageActor_cFv = 0xDEADBEEF;
+ returnRegularScale__13dStageActor_cFv = 0xDEADBEEF;
+ _vfA4__13dStageActor_cFPv = 0xDEADBEEF;
+ _vfA8__13dStageActor_cFPv = 0xDEADBEEF;
+ _vfAC__13dStageActor_cFPv = 0xDEADBEEF;
+ _vfB0__13dStageActor_cFv = 0xDEADBEEF;
+ _vfB4__13dStageActor_cFv = 0xDEADBEEF;
+ _vfB8__13dStageActor_cFv = 0xDEADBEEF;
+ _vfBC__13dStageActor_cFv = 0xDEADBEEF;
+ _vfC0__13dStageActor_cFv = 0xDEADBEEF;
+ _vfC4__13dStageActor_cFv = 0xDEADBEEF;
+ _vfC8__13dStageActor_cFP7Point2d = 0xDEADBEEF;
+ checkZoneBoundaries__13dStageActor_cFUi = 0xDEADBEEF;
+ create__13dStageActor_cF6ActorsUiP7Point3dP6S16VecUc = 0xDEADBEEF;
+
__ct__8dScene_cFv = 0xDEADBEEF;
__dt__8dScene_cFv = 0xDEADBEEF;
beforeCreate__8dScene_cFv = 0xDEADBEEF;
- afterCreate__8dScene_cFv = 0xDEADBEEF;
+ afterCreate__8dScene_cFi = 0xDEADBEEF;
beforeDelete__8dScene_cFv = 0xDEADBEEF;
- afterDelete__8dScene_cFv = 0xDEADBEEF;
+ afterDelete__8dScene_cFi = 0xDEADBEEF;
beforeExecute__8dScene_cFv = 0xDEADBEEF;
- afterExecute__8dScene_cFv = 0xDEADBEEF;
+ afterExecute__8dScene_cFi = 0xDEADBEEF;
beforeDraw__8dScene_cFv = 0xDEADBEEF;
- afterDraw__8dScene_cFv = 0xDEADBEEF;
+ afterDraw__8dScene_cFi = 0xDEADBEEF;
__ct__8dActor_cFv = 0xDEADBEEF;
__dt__8dActor_cFv = 0xDEADBEEF;
@@ -130,13 +336,13 @@ SECTIONS {
__ct__7dBase_cFv = 0xDEADBEEF;
__dt__7dBase_cFv = 0xDEADBEEF;
beforeCreate__7dBase_cFv = 0xDEADBEEF;
- afterCreate__7dBase_cFv = 0xDEADBEEF;
+ afterCreate__7dBase_cFi = 0xDEADBEEF;
beforeDelete__7dBase_cFv = 0xDEADBEEF;
- afterDelete__7dBase_cFv = 0xDEADBEEF;
+ afterDelete__7dBase_cFi = 0xDEADBEEF;
beforeExecute__7dBase_cFv = 0xDEADBEEF;
- afterExecute__7dBase_cFv = 0xDEADBEEF;
+ afterExecute__7dBase_cFi = 0xDEADBEEF;
beforeDraw__7dBase_cFv = 0xDEADBEEF;
- afterDraw__7dBase_cFv = 0xDEADBEEF;
+ afterDraw__7dBase_cFi = 0xDEADBEEF;
onDraw__7fBase_cFv = 0xDEADBEEF;
@@ -145,6 +351,46 @@ SECTIONS {
_vf58__8dActor_cFv = 0xDEADBEEF;
_vf5C__8dActor_cFv = 0xDEADBEEF;
+ __ct__9StateBaseFPCc = 0xDEADBEEF;
+ __dt__9StateBaseFv = 0xDEADBEEF;
+ isInvalid__9StateBaseFv = 0xDEADBEEF;
+ isEqualNotUsedForSomeReason__9StateBaseFP9StateBase = 0xDEADBEEF;
+ isEqual__9StateBaseFP9StateBase = 0xDEADBEEF;
+ isNotEqual__9StateBaseFP9StateBase = 0xDEADBEEF;
+ getName__9StateBaseFv = 0xDEADBEEF;
+ getID__9StateBaseFv = 0xDEADBEEF;
+
+ __ct__10dFlagMgr_c = 0xDEADBEEF;
+ setup__10dFlagMgr_cFb = 0xDEADBEEF;
+ applyAndClearAllTimedActions__10dFlagMgr_cFv = 0xDEADBEEF;
+ execute__10dFlagMgr_cFv = 0xDEADBEEF;
+ set__10dFlagMgr_cFUcibbbUi = 0xDEADBEEF;
+ findLowestFlagInSet__10dFlagMgr_cFUiUl = 0xDEADBEEF;
+ setSpecial__10dFlagMgr_cFUcffUcUiUl = 0xDEADBEEF;
+ get8__10dFlagMgr_cFUc = 0xDEADBEEF;
+ get108__10dFlagMgr_cFUc = 0xDEADBEEF;
+ get208__10dFlagMgr_cFUc = 0xDEADBEEF;
+ get248__10dFlagMgr_cFUc = 0xDEADBEEF;
+ get448__10dFlagMgr_cFUc = 0xDEADBEEF;
+ instance__10dFlagMgr_c = 0xDEADBEEF;
+
+
+ __ct__7PhysicsFv = 0xDEADBEEF;
+ setup__7PhysicsFP8dActor_cPQ27Physics4InfoUcUcP7Point2d = 0xDEADBEEF;
+ addToList__7PhysicsFv = 0xDEADBEEF;
+ removeFromList__7PhysicsFv = 0xDEADBEEF;
+ update__7PhysicsFv = 0xDEADBEEF;
+
+ getTileRendererList__7dBgGm_cFi = 0xDEADBEEF;
+
+ add__Q212TileRenderer4ListFP12TileRenderer = 0xDEADBEEF;
+ remove__Q212TileRenderer4ListFP12TileRenderer = 0xDEADBEEF;
+
+ __ct__12TileRendererFv = 0xDEADBEEF;
+ __dt__12TileRendererFv = 0xDEADBEEF;
+ setPosition__12TileRendererFfff = 0xDEADBEEF;
+ setVars__12TileRendererFf = 0xDEADBEEF;
+
__ct__21dPlayerModelHandler_cFUc = 0xDEADBEEF;
loadModel__21dPlayerModelHandler_cFUcii = 0xDEADBEEF;
setSRT__21dPlayerModelHandler_cF7Point3d6S16Vec7Point3d = 0xDEADBEEF;
@@ -277,8 +523,13 @@ SECTIONS {
GameHeaps = 0xDEADBEEF;
BGDatClass = 0xDEADBEEF;
+ instance__10BGDatClass = 0xDEADBEEF;
GetTilesetName__FPvii = 0xDEADBEEF;
+ getTilesetName__10BGDatClassFii = 0xDEADBEEF;
+
+ getPointerToTile__12TilemapClassFiiPUib = 0xDEADBEEF;
+
IsWideScreen__Fv = 0xDEADBEEF;
Player_Active = 0xDEADBEEF;
@@ -379,6 +630,7 @@ SECTIONS {
strncpy = 0xDEADBEEF;
strcmp = 0xDEADBEEF;
sprintf = 0xDEADBEEF;
+ strrchr = 0xDEADBEEF;
wcslen = 0xDEADBEEF;
@@ -692,6 +944,7 @@ SECTIONS {
dSys_c__RootHeapMEM2 = 0xDEADBEEF;
BG_GM_ptr = 0xDEADBEEF;
+ instance__7dBgGm_c = 0xDEADBEEF;
BgActorDefs = 0xDEADBEEF;
@@ -735,6 +988,8 @@ SECTIONS {
continuePlumberSetPowerupTextureDebug = 0xDEADBEEF;
+ returnFromPowerupSoundChange = 0xDEADBEEF;
+
ExitFromTileGodHack = 0xDEADBEEF;
SomeTable_802F5440 = 0xDEADBEEF;
@@ -753,6 +1008,9 @@ SECTIONS {
GetRandomSeed = 0xDEADBEEF;
RandomSeed = 0xDEADBEEF;
+ MakeRandomNumber__Fi = 0xDEADBEEF;
+ MakeRandomNumberForTiles__Fi = 0xDEADBEEF;
+
StrangeReplayValue1 = 0xDEADBEEF;
StrangeReplayValue2 = 0xDEADBEEF;
StrangeReplayValue3 = 0xDEADBEEF;
@@ -768,13 +1026,16 @@ SECTIONS {
SomeWipeClass = 0xDEADBEEF;
QueryGlobal5758 = 0xDEADBEEF;
+
.text : {
FILL (0)
__text_start = . ;
*(.init)
*(.text)
+ __ctor_loc = . ;
*(.ctors)
+ __ctor_end = . ;
*(.dtors)
*(.rodata)
/**(.sdata)*/
@@ -786,4 +1047,3 @@ SECTIONS {
__text_end = . ;
}
}
-
diff --git a/poweruphax.yaml b/poweruphax.yaml
index 1eb53af..191c31d 100644
--- a/poweruphax.yaml
+++ b/poweruphax.yaml
@@ -186,7 +186,7 @@ hooks:
- name: FixPowerupSound
type: branch_insn
- branch_type: bl
+ branch_type: b
src_addr_pal: 0x80141334
target_func: 'FixPowerupSound'
diff --git a/randtilegen.rb b/randtilegen.rb
new file mode 100644
index 0000000..b807c2f
--- /dev/null
+++ b/randtilegen.rb
@@ -0,0 +1,376 @@
+class RandTileGenerator
+ Types = [:none, :horz, :vert, :both]
+ Specials = [nil, :vdouble_top, :vdouble_bottom]
+
+ def initialize
+ @sections = {}
+ end
+
+ def section(*namelist)
+ raise "what" unless namelist.all?{|x| x.is_a?(String)}
+ @current_section = (@sections[namelist] ||= {entries: []})
+ yield
+ end
+
+ def random(range, type=:both, numbers=nil)
+ case range
+ when Range
+ # Regular handling
+ numbers = range if numbers.nil?
+ @current_section[:entries] << {range: range, type: type, numbers: numbers.to_a}
+ when Numeric
+ # One number
+ random(range..range, type, numbers)
+ when Enumerable
+ # An array or something else similar
+ numbers = range if numbers.nil?
+ range.each { |r| random(r, type, numbers) }
+ end
+ end
+
+ def pack
+ # first, work out an offset for every section and entry
+ # also, collect the data for each individual entry into an Array
+ current_offset = 8 + (@sections.count * 4)
+ all_entry_data = []
+
+ @sections.each_pair do |name, section|
+ section[:offset] = current_offset
+ current_offset += 8
+
+ section[:entries].each do |entry|
+ entry[:offset] = current_offset
+ all_entry_data << entry[:numbers]
+ current_offset += 8
+ end
+ end
+
+ # assign an offset to each section name list
+ namelist_offsets = {}
+ @sections.each_key do |namelist|
+ namelist_offsets[namelist] = current_offset
+ current_offset += 4 + (4 * namelist.size)
+ end
+
+ # assign an offset to each piece of entry data
+ data_offsets = {}
+ all_entry_data.uniq!
+
+ all_entry_data.each do |data|
+ data_offsets[data] = current_offset
+ current_offset += data.size
+ end
+
+ # assign an offset to each section name
+ name_offsets = {}
+ @sections.each_key do |namelist|
+ namelist.each do |name|
+ name_offsets[name] = current_offset
+ current_offset += name.size + 1
+ end
+ end
+
+ # now pack it all together
+ header = ['NwRT', @sections.count].pack('a4 N')
+ offsets = @sections.each_value.map{|s| s[:offset]}.pack('N*')
+
+ section_data = @sections.each_pair.map do |namelist, section|
+ namelist_offset = namelist_offsets[namelist] - section[:offset]
+ entry_count = section[:entries].count
+
+ entry_data = section[:entries].map do |entry|
+ lower_bound = entry[:range].min
+ upper_bound = entry[:range].max
+
+ count = entry[:numbers].count
+
+ type_sym, special_sym = entry[:type].to_s.split('_', 2).map(&:to_sym)
+ type_id = Types.index(type_sym)
+ special_id = Specials.index(special_sym)
+ type = type_id | (special_id << 2)
+
+ num_offset = data_offsets[entry[:numbers]] - entry[:offset]
+
+ [lower_bound, upper_bound, count, type, num_offset].pack('CCCC N')
+ end
+
+ [namelist_offset, entry_count].pack('NN') + entry_data.join
+ end
+
+ namelist_data = @sections.each_key.map do |namelist|
+ puts "Writing list: #{namelist.inspect}"
+ count = namelist.size
+ c_offsets = namelist.map{|n| name_offsets[n] - namelist_offsets[namelist]}
+ puts "Offsets: #{c_offsets.inspect}"
+
+ [count].pack('N') + c_offsets.pack('N*')
+ end
+
+ output = [header, offsets]
+ output += section_data
+ output += namelist_data
+ output += all_entry_data.map{|data| data.pack('C*')}
+ output << @sections.keys.flatten.join("\0")
+ output << "\0"
+ output.join
+ end
+
+
+ def regular_terrain
+ # Left Side
+ random([0x10, 0x20, 0x30, 0x40], :vert)
+ # Right Side
+ random([0x11, 0x21, 0x31, 0x41], :vert)
+ # Top Side
+ random(2..7, :horz)
+ # Bottom Side
+ random(0x22..0x27, :horz)
+ # Middle
+ random(0x12..0x17)
+ end
+
+ def sub_terrain
+ # Left Side
+ random([0x18, 0x28, 0x38, 0x48], :vert)
+ # Right Side
+ random([0x19, 0x29, 0x39, 0x49], :vert)
+ # Top Side
+ random(0xA..0xF, :horz)
+ # Bottom Side
+ random(0x2A..0x2F, :horz)
+ # Middle
+ random(0x1A..0x1F)
+ end
+end
+
+
+g = RandTileGenerator.new
+g.section('TestTileset') do
+ g.random(1..20)
+ g.random(21..24, :none)
+ g.random(250..255, :vert, 0..5)
+end
+
+regular_ts1 = %w(chika setsugen shiro suichu daishizen sabaku_chika)
+regular_ts1 += %w(nohara2 kurayami_chika shiro_yogan koopa_out shiro_koopa gake_yougan)
+regular_ts2 = %w(doukutu doukutu2 doukutu3 doukutu4 doukutu5 doukutu6 doukutu8)
+newer = %w(ghostrocks Pa1_daishizenkuri Pa1_darkmtmush Pa1_e3setsugen Pa2_darkcave)
+newer += %w(Pa3_autumnbg Pa2_volcanobg Pa1_mushcastle Pa1_pumpkin)
+
+regular_ts1.map!{ |x| "Pa1_#{x}" }
+regular_ts2.map!{ |x| "Pa2_#{x}" }
+g.section(*regular_ts1, *regular_ts2, *newer) do
+ g.regular_terrain
+end
+
+nohara_clones = %w(nohara cracks springwater space)
+g.section(*nohara_clones.map{ |x| "Pa1_#{x}"}) do
+ g.regular_terrain
+ g.sub_terrain
+end
+
+g.section('Pa1_gake', 'Pa1_gake_nocoll', 'Pa1_Mountains') do
+ g.regular_terrain
+ g.sub_terrain
+ g.random([0xAA, 0xBA, 0xCA, 0xDA], :vert)
+ g.random([0xAB, 0xBB, 0xCB, 0xDB], :vert)
+ g.random([0x8E, 0x9E, 0xAE, 0xBE], :vert)
+ g.random([0x8F, 0x9F, 0xAF, 0xBF], :vert)
+ g.random(0xC4..0xC9, :horz)
+ g.random(0xD4..0xD9, :horz)
+ g.random(0xE4..0xE9, :horz)
+end
+
+g.section('Pa1_kaigan', 'Pa1_kaiganplus') do
+ g.regular_terrain
+ g.random(0x18..0x1B)
+ g.random(0x28..0x2A)
+ g.random(0x3A..0x3D)
+end
+
+g.section('Pa1_obake_soto') do
+ g.random(0xA..0xF, :horz)
+ g.random(0x1A..0x1F)
+ g.random(0x2A..0x2F, :horz)
+ g.random([0x4E, 0x5E, 0x6E, 0x7E], :vert)
+ g.random([0x4F, 0x5F, 0x6F, 0x7F], :vert)
+end
+
+g.section('Pa1_korichika') do
+ g.regular_terrain
+ g.random(0x6A..0x6F, :horz)
+ g.random(0x7A..0x7F)
+ g.random(0x8A..0x8F, :horz)
+ g.random([0x1E, 0x2E, 0x3E, 0x4E], :vert)
+ g.random([0x1F, 0x2F, 0x3F, 0x4F], :vert)
+ g.random(0x6A..0x6F, :horz)
+ g.random(0x7A..0x7F)
+ g.random(0x8A..0x8F, :horz)
+ g.random([0xB8, 0xC8, 0xD8, 0xE8], :vert)
+ g.random([0xB9, 0xC9, 0xD9, 0xE9], :vert)
+end
+
+g.section('Pa1_shiro_boss1') do
+ g.regular_terrain
+ g.random(0x60..0x65, :horz)
+end
+
+g.section('Pa2_kori', 'Pa2_e3kori') do
+ g.regular_terrain
+ g.random(0xA0..0xA5, :horz)
+ g.random(0xB0..0xB5, :horz)
+end
+
+
+g.section('Cloudscape', 'pa2_clouds') do
+ g.random(0x20..0x23, :horz)
+ g.random(0x30..0x33)
+ g.random(0x24..0x27, :horz)
+ g.random([0x8, 0x18, 0x28, 0x38], :vert)
+ g.random([0x9, 0x19, 0x29, 0x39], :vert)
+end
+
+g.section('Pa1_autumncastle', 'Pa3_autumncastle', 'Pa1_snowfort', 'Pa2_ghostcastle', 'Pa2_crystalcastle') do
+ g.random([0xB0, 0xC0, 0xD0, 0xE0], :vert)
+ g.random([0xB1, 0xC1, 0xD1, 0xE1], :vert)
+ g.random(0xB2..0xB7, :horz)
+ g.random(0xC2..0xC7)
+ g.random(0xD2..0xD7, :horz)
+end
+
+g.section('CrackedMega') do
+ g.random([0x20, 0x30, 0x40], :vert)
+ g.random([0x21, 0x31, 0x41], :vert)
+ g.random(0x22..0x27, :horz)
+ g.random(0x2A..0x2F, :horz)
+ g.random([0x5E, 0x6E, 0x7E], :vert)
+ g.random([0x5F, 0x6F, 0x7F], :vert)
+ g.random(0xB0..0xDF)
+ g.random(0x2..0x7, :horz_vdouble_top)
+ g.random(0x12..0x17, :horz_vdouble_bottom)
+ g.random(0xA..0xF, :horz_vdouble_top)
+ g.random(0x1A..0x1F, :horz_vdouble_bottom)
+end
+
+g.section('Pa1_dessert') do
+ g.regular_terrain
+ g.random(0xC..0xE, :horz)
+ g.random(0x1C..0x1E, :horz)
+end
+
+g.section('Pa1_freezeflame') do
+ g.random(0x1A..0x1F, :horz)
+ g.random(0x2A..0x2F, :horz)
+ g.random([0x10, 0x20, 0x30, 0x40], :vert)
+ g.random([0x11, 0x21, 0x31, 0x41], :vert)
+ g.random([0x18, 0x28, 0x38, 0x48], :vert)
+ g.random([0x19, 0x29, 0x39, 0x49], :vert)
+ g.random(0x2..0x7, :horz)
+ g.random(0x12..0x17)
+ g.random(0x22..0x27, :horz)
+ g.random(0x6A..0x6F)
+ g.random(0x52..0x57, :horz)
+ g.random([0x96, 0xA6, 0xB6, 0xC6], :vert)
+ g.random([0x97, 0xA7, 0xB7, 0xC7], :vert)
+ g.random([0xBE, 0xCE, 0xDE, 0xEE], :vert)
+ g.random([0xBF, 0xCF, 0xDF, 0xEF], :vert)
+ g.random(0xB8..0xBD, :horz)
+ g.random(0xC8..0xCD)
+ g.random(0xD8..0xDD, :horz)
+ g.random(0xE8..0xED)
+ g.random(0xF8..0xFD, :horz)
+end
+
+g.section(*%w(Pa1_magicsnow Pa2_magicsnow Pa3_magicsnow)) do
+ g.random(0xB4..0xB9, :horz)
+end
+
+g.section('Pa1_graveyard', 'Pa3_graveyars', 'Pa3_graveyard') do
+ g.regular_terrain
+ g.random(0x19..0x1E, :horz)
+end
+
+g.section('Pa3_ghostship') do
+ g.random(0xA..0xF, :horz)
+ g.random(0x1A..0x1F)
+ g.random(0x2A..0x2F, :horz)
+ g.random([0x4E, 0x5E, 0x6E, 0x7E], :vert)
+ g.random([0x4F, 0x5F, 0x6F, 0x7F], :vert)
+ g.random(0xA0..0xA3, :horz)
+end
+
+g.section('Pa1_lavaglow') do
+ g.random([0x20, 0x30, 0x40, 0x50], :vert)
+ g.random([0x21, 0x31, 0x41, 0x51], :vert)
+ g.random(0x2..0x7, :horz_vdouble_top)
+ g.random(0x12..0x17, :horz_vdouble_bottom)
+ g.random(0x22..0x27)
+ g.random(0x32..0x37, :horz)
+ g.random(0x28..0x2D, :horz)
+end
+
+g.section('Pa1_StarRoad') do
+ g.random(0x11, :both, [0x11, 0x4C, 0x4D, 0x4E, 0x4F, 0x5C, 0x5D, 0x5E, 0x5F])
+end
+
+g.section('Pa2_forestobake') do
+ g.random(0..5, :horz)
+ g.random(0x10..0x15)
+ g.random(0x20..0x25, :horz)
+ g.random([0x40, 0x50, 0x60, 0x70], :vert)
+ g.random([0x41, 0x51, 0x61, 0x71], :vert)
+end
+
+g.section('Pa1_newnohara') do
+ g.sub_terrain
+
+ g.random(2..7, :horz)
+ g.random(0x22..0x27, :horz)
+ g.random([0x10, 0x20, 0x30, 0x40], :vert)
+ g.random([0x11, 0x21, 0x31, 0x41], :vert)
+ random_set = (0xAA..0xAF).to_a + (0xBA..0xBF).to_a + (0xCA..0xCF).to_a
+ random_set += (0xDA..0xDF).to_a + (0xEA..0xEF).to_a + (0xFA..0xFF).to_a
+ g.random(0x12..0x17, :both, random_set)
+ g.random(0xAA..0xAF, :both, random_set)
+ g.random(0xBA..0xBF, :both, random_set)
+ g.random(0xCA..0xCF, :both, random_set)
+ g.random(0xDA..0xDF, :both, random_set)
+ g.random(0xEA..0xEF, :both, random_set)
+ g.random(0xFA..0xFF, :both, random_set)
+end
+
+g.section('Pa1_mtmush') do
+ g.sub_terrain
+
+ g.random(2..7, :horz)
+ g.random(0x22..0x27, :horz)
+ g.random([0x10, 0x20, 0x30, 0x40], :vert)
+ g.random([0x11, 0x21, 0x31, 0x41], :vert)
+ random_set = (0xDA..0xDF).to_a + (0xEA..0xEF).to_a + (0xFA..0xFF).to_a
+ g.random(0x12..0x17, :both, random_set)
+ g.random(0xDA..0xDF, :both, random_set)
+ g.random(0xEA..0xEF, :both, random_set)
+ g.random(0xFA..0xFF, :both, random_set)
+end
+
+g.section('Pa1_darkmtmush') do
+ g.sub_terrain
+
+ g.random(2..7, :horz)
+ g.random(0x22..0x27, :horz)
+ g.random([0x10, 0x20, 0x30, 0x40], :vert)
+ g.random([0x11, 0x21, 0x31, 0x41], :vert)
+ random_set = (0xCC..0xCF).to_a + (0xDC..0xDF).to_a + (0xEC..0xEF).to_a + (0xFC..0xFF).to_a
+ g.random(0x12..0x17, :both, random_set)
+ g.random(0xCC..0xCF, :both, random_set)
+ g.random(0xDC..0xDF, :both, random_set)
+ g.random(0xEC..0xEF, :both, random_set)
+ g.random(0xFC..0xFF, :both, random_set)
+end
+
+
+
+File.open('/home/me/Games/Newer/DolphinPatch/NewerRes/RandTiles.bin', 'wb') do |f|
+ f.write g.pack
+end
+
diff --git a/randtiles.yaml b/randtiles.yaml
new file mode 100644
index 0000000..5bdc11c
--- /dev/null
+++ b/randtiles.yaml
@@ -0,0 +1,31 @@
+---
+source_files: [../src/randtiles.cpp]
+hooks:
+ - name: ModifyTilemapClassSize
+ type: patch
+ addr_pal: 0x80083598
+ data: '3860 0C3C'
+
+ - name: LoadRandTiles
+ type: branch_insn
+ branch_type: b
+ src_addr_pal: 0x8015BCD0
+ target_func: 'RandTileLoadHook'
+
+ - name: HookIdentifyTilesets
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x800838AC
+ target_func: 'IdentifyTilesets'
+
+ - name: HookTilePlacer
+ type: branch_insn
+ branch_type: bl
+ src_addr_pal: 0x80086B48
+ target_func: 'TryAndRandomise'
+
+ - name: AHackOfGiganticProportions
+ type: patch
+ addr_pal: 0x80086B4C
+ data: '4800 0120'
+
diff --git a/src/poweruphax.S b/src/poweruphax.S
index 9274b78..e028eb9 100644
--- a/src/poweruphax.S
+++ b/src/poweruphax.S
@@ -16,6 +16,7 @@
.extern continuePlumberSetPowerupTexture
.extern doneSettingThePowerupTexture
.extern doneSettingThePowerupTexture2
+.extern returnFromPowerupSoundChange
#ifndef __MWERKS__
.set r0,0; .set r1,1; .set r2,2; .set r3,3; .set r4,4
@@ -391,16 +392,30 @@ _not19:
.global FixPowerupSound
FixPowerupSound:
- # WARNING! This is a bad, bad, bad hack.
- # I was too lazy to add anything to the linker script, so...
-
- # We branch at 80141334, so our LR is 80141338
- # We need to jump to 80141384
- mflr r3
- addi r3, r3, 0x4C
- mtlr r3
+ #lis r3, DBString@h
+ #ori r3, r3, DBString@l
+ #lwz r4, 0x1090(r29)
+ #crclr 4*cr1+eq
+ #bl OSReport
+
+ lwz r5, 0x14DC(r29) # Original powerup
+ lwz r0, 0x1090(r29) # New powerup
+ # if NEW is 1 (big) and OLD is not 0 or 3, then play 273 (powerdown)
+ cmpwi r0, 1
+ bne dontConsiderPowerdown
+
+ cmpwi r5, 0
+ beq dontConsiderPowerdown
+ cmpwi r5, 3
+ beq dontConsiderPowerdown
+ # If the player is here, he was downgraded from a higher powerup to Big Mario
+ # So play the powerdown sound
+ mr r3, r29
+ li r4, 273
+ li r5, 0
+ b returnFromPowerupSoundChange
- lwz r0, 0x1090(r29)
+dontConsiderPowerdown:
lis r3, PowerupSounds@h
ori r3, r3, PowerupSounds@l
slwi r4, r0, 2
@@ -408,7 +423,7 @@ FixPowerupSound:
mr r3, r29
li r5, 0
- blr
+ b returnFromPowerupSoundChange
.global WeirdAnimLoadHack
@@ -719,6 +734,9 @@ I_hammerModelName:
PowerupTexDebugStr:
.string "Plumber::SetPowerupTexture() called on class %p with texnum %d lr=%p\n"
+DBString:
+ .string "PW:%d\n"
+
#.global BrosModelFilename
#BrosModelFilename:
# .string "g3d/bros.brres"
diff --git a/src/randtiles.cpp b/src/randtiles.cpp
index 0bc2ede..1508200 100644
--- a/src/randtiles.cpp
+++ b/src/randtiles.cpp
@@ -1,22 +1,193 @@
-#include "randtiles.h"
-
-u32 djb2(u8 *str) {
- u32 hash = 5381;
- int c;
-
- while (c = *str++)
- hash = ((hash << 5) + hash) + c;
-
- return hash;
-}
-
-RandTiles_Section *RandTiles_Search(void *file, u32 nameHash) {
- for (int i = 0; i < RandTiles_GetSectionCount(file); i++) {
- RandTiles_Section *sect = RandTiles_GetSection(file, i);
-
- if (sect->nameHash == nameHash)
- return sect;
- }
-
- return 0;
-}
+#include <game.h>
+
+class RandomTileData {
+public:
+ enum Type {
+ CHECK_NONE = 0,
+ CHECK_HORZ = 1,
+ CHECK_VERT = 2,
+ CHECK_BOTH = 3
+ };
+
+ enum Special {
+ SP_NONE = 0,
+ SP_VDOUBLE_TOP = 1,
+ SP_VDOUBLE_BOTTOM = 2
+ };
+
+ class NameList {
+ public:
+ u32 count;
+ u32 offsets[1]; // variable size
+
+ const char *getName(int index) {
+ return ((char*)this) + offsets[index];
+ }
+
+ bool contains(const char *name) {
+ for (int i = 0; i < count; i++) {
+ if (strcmp(name, getName(i)) == 0)
+ return true;
+ }
+
+ return false;
+ }
+ };
+
+ class Entry {
+ public:
+ u8 lowerBound, upperBound;
+ u8 count, type;
+ u32 tileNumOffset;
+
+ u8 *getTileNums() {
+ return ((u8*)this) + tileNumOffset;
+ }
+ };
+
+ class Section {
+ public:
+ u32 nameListOffset;
+ u32 entryCount;
+ Entry entries[1]; // variable size
+
+ NameList *getNameList() {
+ return (NameList*)(((u32)this) + nameListOffset);
+ }
+ };
+
+ u32 magic;
+ u32 sectionCount;
+ u32 offsets[1]; // variable size
+
+ Section *getSection(int id) {
+ return (Section*)(((char*)this) + offsets[id]);
+ }
+
+ Section *getSection(const char *name);
+
+ static RandomTileData *instance;
+};
+
+class RTilemapClass : public TilemapClass {
+public:
+ // NEWER ADDITIONS
+ RandomTileData::Section *sections[4];
+};
+
+RandomTileData::Section *RandomTileData::getSection(const char *name) {
+ for (int i = 0; i < sectionCount; i++) {
+ RandomTileData::Section *sect = getSection(i);
+
+ if (sect->getNameList()->contains(name))
+ return sect;
+ }
+
+ return 0;
+}
+
+
+// Real tile handling code
+
+RandomTileData *RandomTileData::instance = 0;
+
+dDvdLoader_c RandTileLoader;
+
+extern "C" bool RandTileLoadHook() {
+ OSReport("Trying to load...");
+ void *buf = RandTileLoader.load("/NewerRes/RandTiles.bin");
+ if (buf == 0) {
+ OSReport("Failed.\n");
+ return false;
+ } else {
+ OSReport("Successfully loaded RandTiles.bin [%p].\n", buf);
+ RandomTileData::instance = (RandomTileData*)buf;
+ return true;
+ }
+}
+
+
+extern "C" void IdentifyTilesets(RTilemapClass *self) {
+ self->_C0C = 0xFFFFFFFF;
+
+ for (int i = 0; i < 4; i++) {
+ const char *tilesetName = BGDatClass::instance->getTilesetName(self->areaID, i);
+
+ self->sections[i] = RandomTileData::instance->getSection(tilesetName);
+ OSReport("[%d] Chose %p for %s\n", i, self->sections[i], tilesetName);
+ }
+}
+
+extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) {
+ int fullTile = bgr->tileToPlace & 0x3FF;
+ int tile = fullTile & 0xFF;
+ int tileset = fullTile >> 8;
+
+ RandomTileData::Section *rtSect = self->sections[tileset];
+ if (rtSect == 0)
+ return;
+
+ for (int i = 0; i < rtSect->entryCount; i++) {
+ RandomTileData::Entry *entry = &rtSect->entries[i];
+
+ if (tile >= entry->lowerBound && tile <= entry->upperBound) {
+ // Found it!!
+ // Try to make one until we meet the conditions
+ u8 type = entry->type & 3;
+ u8 special = entry->type >> 2;
+
+ u8 *tileNums = entry->getTileNums();
+ u16 chosen = 0xFF;
+
+ // If it's the top special, then ignore this tile, we'll place that one
+ // once we choose the bottom one
+ if (special == RandomTileData::SP_VDOUBLE_TOP)
+ break;
+
+ u16 *top = 0, *left = 0, *right = 0, *bottom = 0;
+ if (type == RandomTileData::CHECK_HORZ || type == RandomTileData::CHECK_BOTH) {
+ left = self->getPointerToTile((bgr->curX - 1) * 16, bgr->curY * 16);
+ right = self->getPointerToTile((bgr->curX + 1) * 16, bgr->curY * 16);
+ }
+
+ if (type == RandomTileData::CHECK_VERT || type == RandomTileData::CHECK_BOTH) {
+ top = self->getPointerToTile(bgr->curX * 16, (bgr->curY - 1) * 16);
+ bottom = self->getPointerToTile(bgr->curX * 16, (bgr->curY + 1) * 16);
+ }
+
+ int attempts = 0;
+ while (true) {
+ // is there even a point to using that special random function?
+ chosen = (tileset << 8) | tileNums[MakeRandomNumberForTiles(entry->count)];
+
+ // avoid infinite loops
+ attempts++;
+ if (attempts > 5)
+ break;
+
+ if (top != 0 && *top == chosen)
+ continue;
+ if (bottom != 0 && *bottom == chosen)
+ continue;
+ if (left != 0 && *left == chosen)
+ continue;
+ if (right != 0 && *right == chosen)
+ continue;
+ break;
+ }
+
+ bgr->tileToPlace = chosen;
+
+ if (special == RandomTileData::SP_VDOUBLE_BOTTOM) {
+ if (top == 0)
+ top = self->getPointerToTile(bgr->curX * 16, (bgr->curY - 1) * 16);
+
+ *top = (chosen - 0x10);
+ }
+
+ return;
+ }
+ }
+}
+
+
diff --git a/src/randtiles.h b/src/randtiles.h
deleted file mode 100644
index 14355da..0000000
--- a/src/randtiles.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef __NEWER_RANDTILES_H
-#define __NEWER_RANDTILES_H
-
-#include <common.h>
-#include "fileload.h"
-
-#define RAND_CHECK_HORZ
-#define RAND_CHECK_VERT
-#define RAND_CHECK_BOTH
-
-struct RandTiles_Header {
- u32 magic;
- u32 sectionCount;
-};
-
-struct RandTiles_Section {
- u32 nameHash;
- u32 entryCount;
-};
-
-struct RandTiles_Entry {
- u16 startTile;
- u16 endTile;
- u8 count;
- u8 type;
- u16 reserved;
- u32 dataOffset;
-};
-
-inline u32 RandTiles_GetSectionCount(void *file) {
- return ((RandTiles_Header*)file)->sectionCount;
-}
-
-inline u32 *RandTiles_GetOffsets(void *file) {
- return (u32*)(((RandTiles_Header*)file)+1);
-}
-
-inline RandTiles_Section *RandTiles_GetSection(void *file, int id) {
- u32 offs = RandTiles_GetOffsets(file)[id];
- return (RandTiles_Section*)(((char*)file)+offs);
-};
-
-inline RandTiles_Entry *RandTiles_GetTiles(void *file, RandTiles_Section *section) {
- return (RandTiles_Entry*)(section+1);
-}
-
-inline RandTiles_Entry *RandTiles_GetTiles(void *file, int sectionID) {
- return (RandTiles_Entry*)(RandTiles_GetSection(file, sectionID)+1);
-}
-
-inline char *RandTiles_GetName(void *file, RandTiles_Section *section) {
- return ((char*)file)+section->nameOffset;
-}
-
-inline u16 *RandTiles_GetData(void *file, RandTiles_Entry *entry) {
- return (u16*)(((char*)file)+entry->dataOffset);
-}
-
-u32 djb2(u8 *str);
-RandTiles_Section *RandTiles_Search(void *file, u32 nameHash);
-
-
-#endif
diff --git a/tools/hooks.pyc b/tools/hooks.pyc
index e345d54..84b5c26 100644
--- a/tools/hooks.pyc
+++ b/tools/hooks.pyc
Binary files differ