mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
update si types
This commit is contained in:
parent
a9310efa85
commit
99ac1cf053
@ -201,7 +201,7 @@ typedef struct Trigger {
|
|||||||
/* 0x28 */ char unk_28[8];
|
/* 0x28 */ char unk_28[8];
|
||||||
/* 0x30 */ u8 unk_30;
|
/* 0x30 */ u8 unk_30;
|
||||||
/* 0x31 */ char unk_31[3];
|
/* 0x31 */ char unk_31[3];
|
||||||
/* 0x34 */ s32 runningScriptID;
|
/* 0x34 */ ScriptID runningScriptID;
|
||||||
} Trigger; // size = 0x38
|
} Trigger; // size = 0x38
|
||||||
|
|
||||||
typedef struct ScriptInstance {
|
typedef struct ScriptInstance {
|
||||||
@ -232,7 +232,7 @@ typedef struct ScriptInstance {
|
|||||||
/* 0x138 */ s32* buffer;
|
/* 0x138 */ s32* buffer;
|
||||||
/* 0x13C */ s32* array;
|
/* 0x13C */ s32* array;
|
||||||
/* 0x140 */ s32* flagArray;
|
/* 0x140 */ s32* flagArray;
|
||||||
/* 0x144 */ s32 uniqueID;
|
/* 0x144 */ ScriptID id;
|
||||||
/* 0x148 */ struct Enemy* ownerActorID; /* controller*, battle ID, trigger* */
|
/* 0x148 */ struct Enemy* ownerActorID; /* controller*, battle ID, trigger* */
|
||||||
/* 0x14C */ u32 ownerID; /* can be an npcID, a triggerID, a trigger ptr */
|
/* 0x14C */ u32 ownerID; /* can be an npcID, a triggerID, a trigger ptr */
|
||||||
/* 0x150 */ f32 timeScale;
|
/* 0x150 */ f32 timeScale;
|
||||||
@ -525,9 +525,9 @@ typedef struct BattleStatus {
|
|||||||
/* 0x0B4 */ UNK_FUN_PTR(preUpdateCallback);
|
/* 0x0B4 */ UNK_FUN_PTR(preUpdateCallback);
|
||||||
/* 0x0B8 */ char unk_B8[4];
|
/* 0x0B8 */ char unk_B8[4];
|
||||||
/* 0x0BC */ struct ScriptInstance* controlScript; /* control handed over to this when changing partners */
|
/* 0x0BC */ struct ScriptInstance* controlScript; /* control handed over to this when changing partners */
|
||||||
/* 0x0C0 */ s32 controlScriptID;
|
/* 0x0C0 */ ScriptID controlScriptID;
|
||||||
/* 0x0C4 */ struct ScriptInstance* camMovementScript;
|
/* 0x0C4 */ struct ScriptInstance* camMovementScript;
|
||||||
/* 0x0C8 */ s32 camMovementScriptID;
|
/* 0x0C8 */ ScriptID camMovementScriptID;
|
||||||
/* 0x0CC */ char unk_CC[12];
|
/* 0x0CC */ char unk_CC[12];
|
||||||
/* 0x0D8 */ struct Actor* playerActor;
|
/* 0x0D8 */ struct Actor* playerActor;
|
||||||
/* 0x0DC */ struct Actor* partnerActor;
|
/* 0x0DC */ struct Actor* partnerActor;
|
||||||
@ -848,7 +848,7 @@ typedef struct GameStatus {
|
|||||||
/* 0x068 */ s16 demoButtonInput;
|
/* 0x068 */ s16 demoButtonInput;
|
||||||
/* 0x06A */ s8 demoStickX;
|
/* 0x06A */ s8 demoStickX;
|
||||||
/* 0x06B */ s8 demoStickY;
|
/* 0x06B */ s8 demoStickY;
|
||||||
/* 0x06C */ s32 mainScriptID;
|
/* 0x06C */ ScriptID mainScriptID;
|
||||||
/* 0x070 */ s8 isBattle;
|
/* 0x070 */ s8 isBattle;
|
||||||
/* 0x071 */ s8 demoState; /* (0 = not demo, 1 = map demo, 2 = demo map changing) */
|
/* 0x071 */ s8 demoState; /* (0 = not demo, 1 = map demo, 2 = demo map changing) */
|
||||||
/* 0x072 */ u8 nextDemoScene; /* which part of the demo to play next */
|
/* 0x072 */ u8 nextDemoScene; /* which part of the demo to play next */
|
||||||
@ -1220,10 +1220,10 @@ typedef struct Actor {
|
|||||||
/* 0x1D4 */ struct ScriptInstance* takeTurnScript;
|
/* 0x1D4 */ struct ScriptInstance* takeTurnScript;
|
||||||
/* 0x1D8 */ struct ScriptInstance* onHitScript;
|
/* 0x1D8 */ struct ScriptInstance* onHitScript;
|
||||||
/* 0x1DC */ struct ScriptInstance* onTurnChangeScript;
|
/* 0x1DC */ struct ScriptInstance* onTurnChangeScript;
|
||||||
/* 0x1E0 */ s32 idleScriptID;
|
/* 0x1E0 */ ScriptID idleScriptID;
|
||||||
/* 0x1E4 */ s32 takeTurnID;
|
/* 0x1E4 */ ScriptID takeTurnID;
|
||||||
/* 0x1E8 */ s32 onHitID;
|
/* 0x1E8 */ ScriptID onHitID;
|
||||||
/* 0x1EC */ s32 onTurnChangeID;
|
/* 0x1EC */ ScriptID onTurnChangeID;
|
||||||
/* 0x1F0 */ u8 lastEventType;
|
/* 0x1F0 */ u8 lastEventType;
|
||||||
/* 0x1F1 */ u8 turnPriority;
|
/* 0x1F1 */ u8 turnPriority;
|
||||||
/* 0x1F2 */ u8 enemyIndex; /* actorID = this | 200 */
|
/* 0x1F2 */ u8 enemyIndex; /* actorID = this | 200 */
|
||||||
|
@ -13,12 +13,15 @@ typedef Vec4f EntryList[];
|
|||||||
|
|
||||||
typedef struct MapHeader {
|
typedef struct MapHeader {
|
||||||
/* 0x00 */ char unk_00[0x10];
|
/* 0x00 */ char unk_00[0x10];
|
||||||
/* 0x10 */ Bytecode* main;
|
/* 0x10 */ Script* main;
|
||||||
/* 0x14 */ EntryList* entryList;
|
/* 0x14 */ EntryList* entryList;
|
||||||
/* 0x18 */ s32 entryCount;
|
/* 0x18 */ s32 entryCount;
|
||||||
/* 0x1C */ char unk_1C[0x1C];
|
/* 0x1C */ char unk_1C[0x1C];
|
||||||
/* 0x38 */ s32 background; // 0x80200000 if there is one, 0 otherwise
|
/* 0x38 */ BackgroundHeader* background;
|
||||||
/* 0x3C */ UNK_FUN_PTR(tattle); // or string id
|
/* 0x3C */ union {
|
||||||
|
MessageID msgID;
|
||||||
|
UNK_FUN_PTR(get);
|
||||||
|
} tattle;
|
||||||
} MapHeader; // size = 0x40
|
} MapHeader; // size = 0x40
|
||||||
|
|
||||||
typedef struct NpcAISettings {
|
typedef struct NpcAISettings {
|
||||||
@ -36,21 +39,21 @@ typedef struct NpcAISettings {
|
|||||||
/* 0x2C */ s32 unk_2C; // bool
|
/* 0x2C */ s32 unk_2C; // bool
|
||||||
} NpcAISettings; // size = 0x30
|
} NpcAISettings; // size = 0x30
|
||||||
|
|
||||||
typedef struct StaticNpcSettings {
|
typedef struct NpcSettings {
|
||||||
/* 0x00 */ char unk_00[4];
|
/* 0x00 */ char unk_00[4];
|
||||||
/* 0x04 */ s16 height;
|
/* 0x04 */ s16 height;
|
||||||
/* 0x06 */ s16 radius;
|
/* 0x06 */ s16 radius;
|
||||||
/* 0x08 */ UNK_PTR otherAI;
|
/* 0x08 */ UNK_PTR otherAI;
|
||||||
/* 0x0C */ Bytecode* interactScript;
|
/* 0x0C */ Script* onInteract;
|
||||||
/* 0x10 */ Bytecode* aiScript;
|
/* 0x10 */ Script* ai;
|
||||||
/* 0x14 */ Bytecode* hitScript;
|
/* 0x14 */ Script* onHit;
|
||||||
/* 0x18 */ Bytecode* auxScript;
|
/* 0x18 */ Script* aux;
|
||||||
/* 0x1C */ Bytecode* defeatScript;
|
/* 0x1C */ Script* onDefeat;
|
||||||
/* 0x20 */ s32 flags;
|
/* 0x20 */ s32 flags;
|
||||||
/* 0x24 */ char unk_24[4];
|
/* 0x24 */ char unk_24[4];
|
||||||
/* 0x28 */ s16 level;
|
/* 0x28 */ s16 level;
|
||||||
/* 0x2A */ s16 unk_2A;
|
/* 0x2A */ s16 unk_2A;
|
||||||
} StaticNpcSettings; // size = 0x2C
|
} NpcSettings; // size = 0x2C
|
||||||
|
|
||||||
typedef struct ItemDrop {
|
typedef struct ItemDrop {
|
||||||
/* 0x00 */ ItemId item;
|
/* 0x00 */ ItemId item;
|
||||||
@ -120,7 +123,7 @@ typedef struct StatDrop {
|
|||||||
|
|
||||||
typedef struct StaticNPC {
|
typedef struct StaticNPC {
|
||||||
/* 0x000 */ NpcId id;
|
/* 0x000 */ NpcId id;
|
||||||
/* 0x004 */ StaticNpcSettings* settings;
|
/* 0x004 */ NpcSettings* settings;
|
||||||
/* 0x008 */ Vec3f pos;
|
/* 0x008 */ Vec3f pos;
|
||||||
/* 0x014 */ s32 flags;
|
/* 0x014 */ s32 flags;
|
||||||
/* 0x018 */ Bytecode* init;
|
/* 0x018 */ Bytecode* init;
|
||||||
@ -138,7 +141,7 @@ typedef struct StaticNPC {
|
|||||||
/* 0x1A0 */ s32 animations[16];
|
/* 0x1A0 */ s32 animations[16];
|
||||||
/* 0x1E0 */ char unk_1E0[8];
|
/* 0x1E0 */ char unk_1E0[8];
|
||||||
/* 0x1E8 */ UNK_PTR extraAnimations;
|
/* 0x1E8 */ UNK_PTR extraAnimations;
|
||||||
/* 0x1EC */ s32 tattle;
|
/* 0x1EC */ MessageID tattle;
|
||||||
} StaticNpc; // size = 0x1F0
|
} StaticNpc; // size = 0x1F0
|
||||||
|
|
||||||
typedef struct Enemy {
|
typedef struct Enemy {
|
||||||
@ -151,7 +154,7 @@ typedef struct Enemy {
|
|||||||
/* 0x0A */ s16 spawnPos[3];
|
/* 0x0A */ s16 spawnPos[3];
|
||||||
/* 0x10 */ Vec3s unk_10;
|
/* 0x10 */ Vec3s unk_10;
|
||||||
/* 0x16 */ char unk_16[2];
|
/* 0x16 */ char unk_16[2];
|
||||||
/* 0x18 */ struct StaticNpcSettings* npcSettings;
|
/* 0x18 */ struct NpcSettings* npcSettings;
|
||||||
/* 0x1C */ Bytecode* initBytecode;
|
/* 0x1C */ Bytecode* initBytecode;
|
||||||
/* 0x20 */ Bytecode* interactBytecode;
|
/* 0x20 */ Bytecode* interactBytecode;
|
||||||
/* 0x24 */ Bytecode* aiBytecode;
|
/* 0x24 */ Bytecode* aiBytecode;
|
||||||
@ -164,12 +167,12 @@ typedef struct Enemy {
|
|||||||
/* 0x40 */ struct ScriptInstance* hitScript;
|
/* 0x40 */ struct ScriptInstance* hitScript;
|
||||||
/* 0x44 */ struct ScriptInstance* auxScript;
|
/* 0x44 */ struct ScriptInstance* auxScript;
|
||||||
/* 0x48 */ struct ScriptInstance* defeatScript;
|
/* 0x48 */ struct ScriptInstance* defeatScript;
|
||||||
/* 0x4C */ s32 initScriptID;
|
/* 0x4C */ ScriptID initScriptID;
|
||||||
/* 0x50 */ s32 interactScriptID;
|
/* 0x50 */ ScriptID interactScriptID;
|
||||||
/* 0x54 */ s32 aiScriptID;
|
/* 0x54 */ ScriptID aiScriptID;
|
||||||
/* 0x58 */ s32 hitScriptID;
|
/* 0x58 */ ScriptID hitScriptID;
|
||||||
/* 0x5C */ s32 auxScriptID;
|
/* 0x5C */ ScriptID auxScriptID;
|
||||||
/* 0x60 */ s32 defeatScriptID;
|
/* 0x60 */ ScriptID defeatScriptID;
|
||||||
/* 0x64 */ char unk_64[8];
|
/* 0x64 */ char unk_64[8];
|
||||||
/* 0x6C */ s32 varTable[16];
|
/* 0x6C */ s32 varTable[16];
|
||||||
/* 0xAC */ char unk_AC[9];
|
/* 0xAC */ char unk_AC[9];
|
||||||
|
@ -259,76 +259,76 @@ ApiStatus GetDamageIntensity(ScriptInstance* script, s32 isInitialCall);
|
|||||||
ApiStatus ActorAddMovePos(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus ActorAddMovePos(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus LoadStarPowerScript(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus LoadStarPowerScript(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
|
||||||
extern Bytecode PlayerScriptDispatcher[];
|
extern Script PlayerScriptDispatcher;
|
||||||
extern Bytecode PeachScriptDispatcher[];
|
extern Script PeachScriptDispatcher;
|
||||||
extern Bytecode ExecutePlayerAction[];
|
extern Script ExecutePlayerAction;
|
||||||
extern Bytecode ExecutePeachAction[];
|
extern Script ExecutePeachAction;
|
||||||
extern Bytecode HandleEvent_Player[];
|
extern Script HandleEvent_Player;
|
||||||
extern Bytecode BtlPutPartnerAway[];
|
extern Script BtlPutPartnerAway;
|
||||||
extern Bytecode BtlBringPartnerOut[];
|
extern Script BtlBringPartnerOut;
|
||||||
extern Bytecode MarioEnterStage[];
|
extern Script MarioEnterStage;
|
||||||
extern Bytecode PeachEnterStage[];
|
extern Script PeachEnterStage;
|
||||||
extern Bytecode PlayerFirstStrike[];
|
extern Script PlayerFirstStrike;
|
||||||
extern Bytecode StartDefend[];
|
extern Script StartDefend;
|
||||||
extern Bytecode RunAwayStart[];
|
extern Script RunAwayStart;
|
||||||
extern Bytecode RunAwayFail[];
|
extern Script RunAwayFail;
|
||||||
extern Bytecode RunAwayReset[];
|
extern Script RunAwayReset;
|
||||||
extern Bytecode PlayEatFX[];
|
extern Script PlayEatFX;
|
||||||
extern Bytecode PlayDrinkFX[];
|
extern Script PlayDrinkFX;
|
||||||
extern Bytecode UseLifeShroom[];
|
extern Script UseLifeShroom;
|
||||||
extern Bytecode MerleeRunOut[];
|
extern Script MerleeRunOut;
|
||||||
extern Bytecode MerleeAttackBonus[];
|
extern Script MerleeAttackBonus;
|
||||||
extern Bytecode MerleeDefenseBonus[];
|
extern Script MerleeDefenseBonus;
|
||||||
extern Bytecode MerleeExpBonus[];
|
extern Script MerleeExpBonus;
|
||||||
extern Bytecode PlayerHappy[];
|
extern Script PlayerHappy;
|
||||||
extern Bytecode DoDizzyAttack[];
|
extern Script DoDizzyAttack;
|
||||||
extern Bytecode RegainAbility[];
|
extern Script RegainAbility;
|
||||||
extern Bytecode UseMystery[];
|
extern Script UseMystery;
|
||||||
extern Bytecode DoSleepHit[];
|
extern Script DoSleepHit;
|
||||||
extern Bytecode DoDizzyHit[];
|
extern Script DoDizzyHit;
|
||||||
extern Bytecode DoParalyzeHit[];
|
extern Script DoParalyzeHit;
|
||||||
extern Bytecode DoPoisonHit[];
|
extern Script DoPoisonHit;
|
||||||
extern Bytecode DoStopHit[];
|
extern Script DoStopHit;
|
||||||
extern Bytecode DoFreezeHit[];
|
extern Script DoFreezeHit;
|
||||||
extern Bytecode DoShinkHit[];
|
extern Script DoShinkHit;
|
||||||
extern Bytecode ForceNextTarget[];
|
extern Script ForceNextTarget;
|
||||||
extern Bytecode DoNormalHit[];
|
extern Script DoNormalHit;
|
||||||
extern Bytecode DoBurnHit[];
|
extern Script DoBurnHit;
|
||||||
extern Bytecode DoShockHit[];
|
extern Script DoShockHit;
|
||||||
extern Bytecode DoImmune[];
|
extern Script DoImmune;
|
||||||
extern Bytecode DoDeath[];
|
extern Script DoDeath;
|
||||||
extern Bytecode Collapse[];
|
extern Script Collapse;
|
||||||
extern Bytecode DoScareAway[];
|
extern Script DoScareAway;
|
||||||
extern Bytecode DoSpinSmashHit[];
|
extern Script DoSpinSmashHit;
|
||||||
extern Bytecode DoJumpBack[];
|
extern Script DoJumpBack;
|
||||||
extern Bytecode DoReturnHome[];
|
extern Script DoReturnHome;
|
||||||
extern Bytecode DoRecover[];
|
extern Script DoRecover;
|
||||||
extern Bytecode DoAirLift[];
|
extern Script DoAirLift;
|
||||||
extern Bytecode DoBlowAway[];
|
extern Script DoBlowAway;
|
||||||
extern Bytecode Rumble_1[];
|
extern Script Rumble_1;
|
||||||
extern Bytecode Rumble_2[];
|
extern Script Rumble_2;
|
||||||
extern Bytecode Rumble_3[];
|
extern Script Rumble_3;
|
||||||
extern Bytecode Rumble_4[];
|
extern Script Rumble_4;
|
||||||
extern Bytecode Rumble_5[];
|
extern Script Rumble_5;
|
||||||
extern Bytecode Rumble_6[];
|
extern Script Rumble_6;
|
||||||
extern Bytecode Rumble_7[];
|
extern Script Rumble_7;
|
||||||
extern Bytecode Rumble_Unused_1[];
|
extern Script Rumble_Unused_1;
|
||||||
extern Bytecode Rumble_Unused_2[];
|
extern Script Rumble_Unused_2;
|
||||||
extern Bytecode Rumble_Unused_3[];
|
extern Script Rumble_Unused_3;
|
||||||
extern Bytecode Rumble_Unused_4[];
|
extern Script Rumble_Unused_4;
|
||||||
extern Bytecode CamPreset_A[];
|
extern Script CamPreset_A;
|
||||||
extern Bytecode CamPreset_B[];
|
extern Script CamPreset_B;
|
||||||
extern Bytecode CamPreset_C[];
|
extern Script CamPreset_C;
|
||||||
extern Bytecode CamPreset_D[];
|
extern Script CamPreset_D;
|
||||||
extern Bytecode CamPreset_E[];
|
extern Script CamPreset_E;
|
||||||
extern Bytecode CamPreset_F[];
|
extern Script CamPreset_F;
|
||||||
extern Bytecode CamPreset_G[];
|
extern Script CamPreset_G;
|
||||||
extern Bytecode CamPreset_H[];
|
extern Script CamPreset_H;
|
||||||
extern Bytecode CamPreset_I[];
|
extern Script CamPreset_I;
|
||||||
extern Bytecode CamPreset_J[];
|
extern Script CamPreset_J;
|
||||||
extern Bytecode CamPreset_K[];
|
extern Script CamPreset_K;
|
||||||
extern Bytecode CamPreset_L[];
|
extern Script CamPreset_L;
|
||||||
extern Bytecode CamPreset_M[];
|
extern Script CamPreset_M;
|
||||||
extern Bytecode CamPreset_N[];
|
extern Script CamPreset_N;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -267,7 +267,10 @@ ApiStatus func_802CFD30(ScriptInstance* script, s32 isInitialCall);
|
|||||||
ApiStatus func_800441F0(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus func_800441F0(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus func_802D5830(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus func_802D5830(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
|
||||||
extern Bytecode* ShakeCam1;
|
extern Script ShakeCam1;
|
||||||
extern Bytecode* ShakeCamX;
|
extern Script ShakeCamX;
|
||||||
|
|
||||||
|
extern Script EnemyNpcHit;
|
||||||
|
extern Script EnemyNpcDefeat;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -20,14 +20,14 @@ ApiStatus GetGridIndexFromPos(ScriptInstance* script, s32 isInitialCall);
|
|||||||
ApiStatus SetPushBlockFallEffect(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus SetPushBlockFallEffect(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus TeleportPartnerToPlayer(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus TeleportPartnerToPlayer(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
|
||||||
extern Bytecode EnterWalk[];
|
extern Script EnterWalk;
|
||||||
extern Bytecode EnterWalkShort[];
|
extern Script EnterWalkShort;
|
||||||
extern Bytecode EnterSavePoint[];
|
extern Script EnterSavePoint;
|
||||||
extern Bytecode ExitWalk[];
|
extern Script ExitWalk;
|
||||||
extern Bytecode ExitSingleDoor[];
|
extern Script ExitSingleDoor;
|
||||||
extern Bytecode EnterSingleDoor[];
|
extern Script EnterSingleDoor;
|
||||||
extern Bytecode ExitDoubleDoor[];
|
extern Script ExitDoubleDoor;
|
||||||
extern Bytecode EnterDoubleDoor[];
|
extern Script EnterDoubleDoor;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
typedef s32 Bytecode;
|
||||||
|
typedef s32 ScriptID;
|
||||||
|
|
||||||
#define SI_VAR(v) (v - 30000000)
|
#define SI_VAR(v) (v - 30000000)
|
||||||
#define SI_MAP_VAR(v) (v - 50000000)
|
#define SI_MAP_VAR(v) (v - 50000000)
|
||||||
#define SI_FLAG(v) (v - 70000000)
|
#define SI_FLAG(v) (v - 70000000)
|
||||||
@ -147,6 +150,6 @@ typedef s32 ApiStatus;
|
|||||||
SI_WAIT_FRAMES(100), \
|
SI_WAIT_FRAMES(100), \
|
||||||
SI_RETURN(), \
|
SI_RETURN(), \
|
||||||
SI_END(), \
|
SI_END(), \
|
||||||
};
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,6 +10,4 @@
|
|||||||
#define UNK_FUN_PTR(name) void(*name)(void)
|
#define UNK_FUN_PTR(name) void(*name)(void)
|
||||||
#define UNK_ARGS
|
#define UNK_ARGS
|
||||||
|
|
||||||
typedef s32 Bytecode;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
15
src/si.c
15
src/si.c
@ -8,15 +8,15 @@ s32 si_goto_end_case(ScriptInstance* script);
|
|||||||
s32 si_goto_next_case(ScriptInstance* script);
|
s32 si_goto_next_case(ScriptInstance* script);
|
||||||
s32 get_variable_index(ScriptInstance* script, s32 var);
|
s32 get_variable_index(ScriptInstance* script, s32 var);
|
||||||
|
|
||||||
f32 fixed_var_to_float(s32 scriptVar) {
|
f32 fixed_var_to_float(Bytecode scriptVar) {
|
||||||
if (scriptVar <= -220000000) {
|
if (scriptVar <= -220000000) {
|
||||||
return (scriptVar + 230000000) * (1 / 1024.0f);
|
return (scriptVar + 230000000) / 1024.0f;
|
||||||
} else {
|
} else {
|
||||||
return scriptVar;
|
return scriptVar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 float_to_fixed_var(f32 value) {
|
Bytecode float_to_fixed_var(f32 value) {
|
||||||
return (s32)(value * 1024.0f) - 230000000;
|
return (s32)(value * 1024.0f) - 230000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +130,6 @@ ApiStatus si_handle_if_equal(ScriptInstance* script) {
|
|||||||
return ApiStatus_DONE2;
|
return ApiStatus_DONE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ApiStatus si_handle_if_not_equal(ScriptInstance* script) {
|
ApiStatus si_handle_if_not_equal(ScriptInstance* script) {
|
||||||
Bytecode* args = script->ptrReadPos;
|
Bytecode* args = script->ptrReadPos;
|
||||||
|
|
||||||
@ -907,7 +906,7 @@ ApiStatus si_handle_exec2(ScriptInstance* script) {
|
|||||||
newScript->array = script->array;
|
newScript->array = script->array;
|
||||||
newScript->flagArray = script->flagArray;
|
newScript->flagArray = script->flagArray;
|
||||||
|
|
||||||
set_variable(script, arg2, newScript->uniqueID);
|
set_variable(script, arg2, newScript->id);
|
||||||
|
|
||||||
return ApiStatus_DONE2;
|
return ApiStatus_DONE2;
|
||||||
}
|
}
|
||||||
@ -936,7 +935,7 @@ s32 _bound_script_trigger_handler(Trigger* trigger) {
|
|||||||
|
|
||||||
script = start_script(scriptStart, trigger->priority, 0x20);
|
script = start_script(scriptStart, trigger->priority, 0x20);
|
||||||
trigger->runningScript = script;
|
trigger->runningScript = script;
|
||||||
trigger->runningScriptID = script->uniqueID;
|
trigger->runningScriptID = script->id;
|
||||||
script->varTable[0] = trigger->scriptVars[0];
|
script->varTable[0] = trigger->scriptVars[0];
|
||||||
script->varTable[1] = trigger->scriptVars[1];
|
script->varTable[1] = trigger->scriptVars[1];
|
||||||
script->varTable[2] = trigger->scriptVars[2];
|
script->varTable[2] = trigger->scriptVars[2];
|
||||||
@ -1045,7 +1044,7 @@ ApiStatus si_handle_resume(ScriptInstance* script) {
|
|||||||
|
|
||||||
ApiStatus si_handle_does_script_exist(ScriptInstance* script) {
|
ApiStatus si_handle_does_script_exist(ScriptInstance* script) {
|
||||||
Bytecode* args = script->ptrReadPos;
|
Bytecode* args = script->ptrReadPos;
|
||||||
Bytecode scriptID = get_variable(script, *args++);
|
ScriptID scriptID = get_variable(script, *args++);
|
||||||
Bytecode var2 = *args++;
|
Bytecode var2 = *args++;
|
||||||
|
|
||||||
set_variable(script, var2, does_script_exist(scriptID));
|
set_variable(script, var2, does_script_exist(scriptID));
|
||||||
@ -1056,7 +1055,7 @@ void si_standard_trigger_executor(Trigger* trigger) {
|
|||||||
if (trigger->runningScript == NULL) {
|
if (trigger->runningScript == NULL) {
|
||||||
ScriptInstance* newScript = start_script(trigger->scriptStart, trigger->priority, 0x20);
|
ScriptInstance* newScript = start_script(trigger->scriptStart, trigger->priority, 0x20);
|
||||||
trigger->runningScript = newScript;
|
trigger->runningScript = newScript;
|
||||||
trigger->runningScriptID = newScript->uniqueID;
|
trigger->runningScriptID = newScript->id;
|
||||||
newScript->varTable[0] = trigger->scriptVars[0];
|
newScript->varTable[0] = trigger->scriptVars[0];
|
||||||
newScript->varTable[1] = trigger->scriptVars[1];
|
newScript->varTable[1] = trigger->scriptVars[1];
|
||||||
newScript->varTable[2] = trigger->scriptVars[2];
|
newScript->varTable[2] = trigger->scriptVars[2];
|
||||||
|
@ -52,12 +52,12 @@ static Script goomba_ai = {
|
|||||||
SI_END(),
|
SI_END(),
|
||||||
};
|
};
|
||||||
|
|
||||||
static StaticNpcSettings goomba_npc_settings = {
|
static NpcSettings goomba_npc_settings = {
|
||||||
.height = 20,
|
.height = 20,
|
||||||
.radius = 23,
|
.radius = 23,
|
||||||
.aiScript = &goomba_ai,
|
.ai = &goomba_ai,
|
||||||
.hitScript = (Bytecode*)0x80077F70,
|
.onHit = EnemyNpcHit,
|
||||||
.defeatScript = (Bytecode*)0x8007809C,
|
.onDefeat = EnemyNpcDefeat,
|
||||||
.level = 5,
|
.level = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ MapHeader header = {
|
|||||||
.main = kmr_12_main,
|
.main = kmr_12_main,
|
||||||
.entryList = entryList,
|
.entryList = entryList,
|
||||||
.entryCount = ENTRY_COUNT(entryList),
|
.entryCount = ENTRY_COUNT(entryList),
|
||||||
.background = 0x80200000,
|
.background = &gBackgroundImage,
|
||||||
.tattle = MessageID_TATTLE_KMR_12,
|
.tattle = MessageID_TATTLE_KMR_12,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1894,3 +1894,5 @@ gSpeakingActorIdleAnim;0x8029FA70
|
|||||||
gSpeakingActor;0x8029FA74
|
gSpeakingActor;0x8029FA74
|
||||||
gSpeakingActorPart;0x8029FA7C
|
gSpeakingActorPart;0x8029FA7C
|
||||||
EnterWalk;0x80285960
|
EnterWalk;0x80285960
|
||||||
|
EnemyNpcHit;0x80077F70
|
||||||
|
EnemyNpcDefeat;0x8007809C
|
||||||
|
@ -257,3 +257,6 @@ DoSpinSmashHit = 0x8029B998;
|
|||||||
DoStopHit = 0x80294650;
|
DoStopHit = 0x80294650;
|
||||||
ShakeCam1 = 0x802D9CB0;
|
ShakeCam1 = 0x802D9CB0;
|
||||||
ShakeCamX = 0x802D9CE8;
|
ShakeCamX = 0x802D9CE8;
|
||||||
|
|
||||||
|
EnemyNpcHit = 0x80077F70;
|
||||||
|
EnemyNpcDefeat = 0x8007809C;
|
||||||
|
Loading…
Reference in New Issue
Block a user