mapfs shape data (#1087)

* script

* fix prologue printing

* added type hints for return types

* model docs

* more models

* pretty print for sprite xmls on earlier python ver

* 1x oops

* sprite xml labels

* cod cleanup

* type cleanup

* fixes, script erroring

* script fixes

* objcopy

* link, objcopy, etc

* map_shape.ld

* discard

* kpa_117 match

* move stuff into /geom

* fix some shapes

* 253

* 221

* opaque lights

* 488

* all clear

* fixies

* RDP_MATRIX macro

* more explicit property 5F

---------

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
Ethan Roseman 2023-07-18 18:07:58 +09:00 committed by GitHub
parent 1118ee8110
commit 4ad11af535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 2116 additions and 1273 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ ctx.c.m2c
build.ninja
.ninja*
*.ld
!src/map_shape.ld
*.elf
*.z64
*.v64

View File

@ -264,7 +264,7 @@ typedef struct Npc {
/* 0x0AA */ s8 renderMode;
/* 0x0AB */ s8 verticalRenderOffset;
/* 0x0AC */ u8 alpha;
/* 0x0AD */ u8 alpha2; ///< Multiplied with Npc::alpha
/* 0x0AD */ u8 hideAlpha; ///< Used when hiding NPCs; Multiplied with Npc::alpha
/* 0x0AE */ char unk_AE[2];
/* 0x0B0 */ AnimID* extraAnimList;
/* 0x0B4 */ s8 palSwapType; // 0..4 inclusive

View File

@ -3538,6 +3538,71 @@ enum WindowPriority {
WINDOW_PRIORITY_64 = 64,
};
enum RenderModeIndex {
RENDER_MODE_IDX_00 = 0x00,
RENDER_MODE_IDX_01 = 0x01,
RENDER_MODE_IDX_02 = 0x02,
RENDER_MODE_IDX_03 = 0x03,
RENDER_MODE_IDX_04 = 0x04,
RENDER_MODE_IDX_05 = 0x05,
RENDER_MODE_IDX_06 = 0x06,
RENDER_MODE_IDX_07 = 0x07,
RENDER_MODE_IDX_08 = 0x08,
RENDER_MODE_IDX_09 = 0x09,
RENDER_MODE_IDX_0A = 0x0A,
RENDER_MODE_IDX_0B = 0x0B,
RENDER_MODE_IDX_0C = 0x0C,
RENDER_MODE_IDX_0D = 0x0D,
RENDER_MODE_IDX_0E = 0x0E,
RENDER_MODE_IDX_0F = 0x0F,
RENDER_MODE_IDX_10 = 0x10,
RENDER_MODE_IDX_11 = 0x11,
RENDER_MODE_IDX_12 = 0x12,
RENDER_MODE_IDX_13 = 0x13,
RENDER_MODE_IDX_14 = 0x14,
RENDER_MODE_IDX_15 = 0x15,
RENDER_MODE_IDX_16 = 0x16,
RENDER_MODE_IDX_17 = 0x17,
RENDER_MODE_IDX_18 = 0x18,
RENDER_MODE_IDX_19 = 0x19,
RENDER_MODE_IDX_1A = 0x1A,
RENDER_MODE_IDX_1B = 0x1B,
RENDER_MODE_IDX_1C = 0x1C,
RENDER_MODE_IDX_1D = 0x1D,
RENDER_MODE_IDX_1E = 0x1E,
RENDER_MODE_IDX_1F = 0x1F,
RENDER_MODE_IDX_20 = 0x20,
RENDER_MODE_IDX_21 = 0x21,
RENDER_MODE_IDX_22 = 0x22,
RENDER_MODE_IDX_23 = 0x23,
RENDER_MODE_IDX_24 = 0x24,
RENDER_MODE_IDX_25 = 0x25,
RENDER_MODE_IDX_26 = 0x26,
RENDER_MODE_IDX_27 = 0x27,
RENDER_MODE_IDX_28 = 0x28,
RENDER_MODE_IDX_29 = 0x29,
RENDER_MODE_IDX_2A = 0x2A,
RENDER_MODE_IDX_2B = 0x2B,
RENDER_MODE_IDX_2C = 0x2C,
RENDER_MODE_IDX_2D = 0x2D,
RENDER_MODE_IDX_2E = 0x2E,
RENDER_MODE_IDX_2F = 0x2F,
RENDER_MODE_IDX_30 = 0x30,
RENDER_MODE_IDX_31 = 0x31,
RENDER_MODE_IDX_32 = 0x32,
RENDER_MODE_IDX_33 = 0x33,
RENDER_MODE_IDX_34 = 0x34,
RENDER_MODE_IDX_35 = 0x35,
RENDER_MODE_IDX_36 = 0x36,
RENDER_MODE_IDX_37 = 0x37,
RENDER_MODE_IDX_38 = 0x38,
RENDER_MODE_IDX_39 = 0x39,
RENDER_MODE_IDX_3A = 0x3A,
RENDER_MODE_IDX_3B = 0x3B,
RENDER_MODE_IDX_3C = 0x3C,
RENDER_MODE_IDX_3D = 0x3D,
};
/// not really
enum RenderMode {
RENDER_MODE_SURF_SOLID_AA_ZB_LAYER0 = 0x00000000,
@ -4786,25 +4851,37 @@ enum GlobalOverrides {
GLOBAL_OVERRIDES_CANT_PICK_UP_ITEMS = 0x00200000,
};
#define MODEL_FLAGS_MASK_FFF0 (MODEL_FLAG_USES_CUSTOM_GFX | MODEL_FLAG_FLAG_20 | MODEL_FLAG_FLAG_40 | MODEL_FLAG_HAS_LOCAL_VERTEX_COPY | MODEL_FLAG_USE_CAMERA_UNK_MATRIX | MODEL_FLAG_FLAG_200 | MODEL_FLAG_HAS_TRANSFORM_APPLIED | MODEL_FLAG_HAS_TEX_PANNER | MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_FLAG_2000 | MODEL_FLAG_FLAG_4000 | MODEL_FLAG_FLAG_8000)
#define MODEL_FLAGS_MASK_FFF0 (\
MODEL_FLAG_USES_CUSTOM_GFX \
| MODEL_FLAG_20 \
| MODEL_FLAG_40 \
| MODEL_FLAG_HAS_LOCAL_VERTEX_COPY \
| MODEL_FLAG_USE_CAMERA_UNK_MATRIX \
| MODEL_FLAG_DO_BOUNDS_CULLING \
| MODEL_FLAG_HAS_TRANSFORM \
| MODEL_FLAG_HAS_TEX_PANNER \
| MODEL_FLAG_MATRIX_DIRTY \
| MODEL_FLAG_IGNORE_MATRIX \
| MODEL_FLAG_4000 \
| MODEL_FLAG_8000)
enum ModelFlags {
MODEL_FLAG_FLAG_1 = 0x0001,
MODEL_FLAG_VALID = 0x0001,
MODEL_FLAG_HIDDEN = 0x0002,
MODEL_FLAG_FLAG_4 = 0x0004,
MODEL_FLAG_INACTIVE = 0x0004,
MODEL_FLAG_TRANSFORM_GROUP_MEMBER = 0x0008,
MODEL_FLAG_USES_CUSTOM_GFX = 0x0010,
MODEL_FLAG_FLAG_20 = 0x0020,
MODEL_FLAG_FLAG_40 = 0x0040,
MODEL_FLAG_20 = 0x0020,
MODEL_FLAG_40 = 0x0040,
MODEL_FLAG_HAS_LOCAL_VERTEX_COPY = 0x0080,
MODEL_FLAG_USE_CAMERA_UNK_MATRIX = 0x0100,
MODEL_FLAG_FLAG_200 = 0x0200,
MODEL_FLAG_HAS_TRANSFORM_APPLIED = 0x0400,
MODEL_FLAG_DO_BOUNDS_CULLING = 0x0200,
MODEL_FLAG_HAS_TRANSFORM = 0x0400,
MODEL_FLAG_HAS_TEX_PANNER = 0x0800,
MODEL_FLAG_USES_TRANSFORM_MATRIX = 0x1000,
MODEL_FLAG_FLAG_2000 = 0x2000,
MODEL_FLAG_FLAG_4000 = 0x4000,
MODEL_FLAG_FLAG_8000 = 0x8000,
MODEL_FLAG_MATRIX_DIRTY = 0x1000, // transform matrix changed and combined matrix needs to be recalculated
MODEL_FLAG_IGNORE_MATRIX = 0x2000, // set until dirty combined matrix has been recalculated
MODEL_FLAG_4000 = 0x4000,
MODEL_FLAG_8000 = 0x8000,
};
enum ModelGroupVisibility {
@ -5081,10 +5158,9 @@ enum MusicSettingsFlags {
MUSIC_SETTINGS_FLAG_20 = 0x00000020,
};
// the lower byte of Collider::flags
// the lower byte of ColliderFlags
enum SurfaceType {
SURFACE_TYPE_DEFAULT = 0,
/*
SURFACE_TYPE_WATER = 1,
SURFACE_TYPE_SPIKES = 2,
SURFACE_TYPE_LAVA = 3,
@ -5094,7 +5170,7 @@ enum SurfaceType {
SURFACE_TYPE_CLOUD = 7, ///< used with clouds in flo_19 and flo_21
SURFACE_TYPE_SNOW = 8,
SURFACE_TYPE_HEDGES = 9, ///< used within hedge maze in flo_11
*/
SURFACE_TYPE_INVALID = -1,
};
typedef enum SurfaceInteractMode {
@ -5103,23 +5179,9 @@ typedef enum SurfaceInteractMode {
SURFACE_INTERACT_LAND = 2,
} SurfaceInteractMode;
//TODO -- temporarily combined with SurfaceType for map data dumper
enum ColliderFlags {
COLLIDER_FLAGS_UPPER_MASK = 0x7FFFFE00, // map data dumper needs this to be first
COLLIDER_FLAGS_SURFACE_TYPE_MASK = 0x000000FF,
// SURFACE_TYPE_DEFAULT = 0,
SURFACE_TYPE_HEDGES = 9, ///< used within hedge maze in flo_11
SURFACE_TYPE_SNOW = 8,
SURFACE_TYPE_CLOUD = 7, ///< used with clouds in flo_19 and flo_21
SURFACE_TYPE_FLOWERS = 6,
SURFACE_TYPE_SLIDE = 5,
SURFACE_TYPE_DOCK_WALL = 4,
SURFACE_TYPE_LAVA = 3,
SURFACE_TYPE_SPIKES = 2,
SURFACE_TYPE_WATER = 1,
SURFACE_TYPE_INVALID = -1,
COLLIDER_FLAG_SAFE_FLOOR = 0x00000100,
COLLIDER_FLAG_IGNORE_SHELL = 0x00008000,
COLLIDER_FLAG_IGNORE_PLAYER = 0x00010000,
@ -5127,7 +5189,6 @@ enum ColliderFlags {
COLLIDER_FLAG_HAS_MODEL_PARENT = 0x80000000
};
//TODO reversed for map dumper with 0 separated
enum ColliderFlagsModifyMode {
MODIFY_COLLIDER_FLAGS_SET_SURFACE = 3,
@ -5147,41 +5208,6 @@ enum CollisionChannels {
COLLISION_ONLY_ENTITIES = 0x00100000,
};
enum CameraInitDataFlags {
CAMERA_INIT_DATA_FLAG_1 = 0x00000001,
CAMERA_INIT_DATA_FLAG_2 = 0x00000002,
CAMERA_INIT_DATA_FLAG_4 = 0x00000004,
CAMERA_INIT_DATA_FLAG_8 = 0x00000008,
CAMERA_INIT_DATA_FLAG_10 = 0x00000010,
CAMERA_INIT_DATA_FLAG_20 = 0x00000020,
CAMERA_INIT_DATA_FLAG_40 = 0x00000040,
CAMERA_INIT_DATA_FLAG_80 = 0x00000080,
CAMERA_INIT_DATA_FLAG_100 = 0x00000100,
CAMERA_INIT_DATA_FLAG_200 = 0x00000200,
CAMERA_INIT_DATA_FLAG_400 = 0x00000400,
CAMERA_INIT_DATA_FLAG_800 = 0x00000800,
CAMERA_INIT_DATA_FLAG_1000 = 0x00001000,
CAMERA_INIT_DATA_FLAG_2000 = 0x00002000,
CAMERA_INIT_DATA_FLAG_4000 = 0x00004000,
CAMERA_INIT_DATA_FLAG_8000 = 0x00008000,
CAMERA_INIT_DATA_FLAG_10000 = 0x00010000,
CAMERA_INIT_DATA_FLAG_20000 = 0x00020000,
CAMERA_INIT_DATA_FLAG_40000 = 0x00040000,
CAMERA_INIT_DATA_FLAG_80000 = 0x00080000,
CAMERA_INIT_DATA_FLAG_100000 = 0x00100000,
CAMERA_INIT_DATA_FLAG_200000 = 0x00200000,
CAMERA_INIT_DATA_FLAG_400000 = 0x00400000,
CAMERA_INIT_DATA_FLAG_800000 = 0x00800000,
CAMERA_INIT_DATA_FLAG_1000000 = 0x01000000,
CAMERA_INIT_DATA_FLAG_2000000 = 0x02000000,
CAMERA_INIT_DATA_FLAG_4000000 = 0x04000000,
CAMERA_INIT_DATA_FLAG_8000000 = 0x08000000,
CAMERA_INIT_DATA_FLAG_10000000 = 0x10000000,
CAMERA_INIT_DATA_FLAG_20000000 = 0x20000000,
CAMERA_INIT_DATA_FLAG_40000000 = 0x40000000,
CAMERA_INIT_DATA_FLAG_80000000 = 0x80000000,
};
enum CameraFlags {
CAMERA_FLAG_1 = 0x00000001,
CAMERA_FLAG_DISABLED = 0x00000002,
@ -5420,39 +5446,8 @@ enum ModelAnimatorFlags {
};
enum ShopFlags {
SHOP_FLAG_0 = 0x00000000,
SHOP_FLAG_1 = 0x00000001,
SHOP_FLAG_2 = 0x00000002,
SHOP_FLAG_4 = 0x00000004,
SHOP_FLAG_8 = 0x00000008,
SHOP_FLAG_10 = 0x00000010,
SHOP_FLAG_20 = 0x00000020,
SHOP_FLAG_40 = 0x00000040,
SHOP_FLAG_80 = 0x00000080,
SHOP_FLAG_100 = 0x00000100,
SHOP_FLAG_200 = 0x00000200,
SHOP_FLAG_400 = 0x00000400,
SHOP_FLAG_800 = 0x00000800,
SHOP_FLAG_1000 = 0x00001000,
SHOP_FLAG_2000 = 0x00002000,
SHOP_FLAG_4000 = 0x00004000,
SHOP_FLAG_8000 = 0x00008000,
SHOP_FLAG_10000 = 0x00010000,
SHOP_FLAG_20000 = 0x00020000,
SHOP_FLAG_40000 = 0x00040000,
SHOP_FLAG_80000 = 0x00080000,
SHOP_FLAG_100000 = 0x00100000,
SHOP_FLAG_200000 = 0x00200000,
SHOP_FLAG_400000 = 0x00400000,
SHOP_FLAG_800000 = 0x00800000,
SHOP_FLAG_1000000 = 0x01000000,
SHOP_FLAG_2000000 = 0x02000000,
SHOP_FLAG_4000000 = 0x04000000,
SHOP_FLAG_8000000 = 0x08000000,
SHOP_FLAG_10000000 = 0x10000000,
SHOP_FLAG_20000000 = 0x20000000,
SHOP_FLAG_40000000 = 0x40000000,
SHOP_FLAG_80000000 = 0x80000000,
};
enum {
@ -5614,38 +5609,12 @@ enum TempSetZoneEnabledFlags {
};
enum ModelTransformGroupFlags {
MODEL_TRANSFORM_GROUP_FLAG_1 = 0x00000001,
MODEL_TRANSFORM_GROUP_FLAG_2 = 0x00000002,
MODEL_TRANSFORM_GROUP_FLAG_4 = 0x00000004,
MODEL_TRANSFORM_GROUP_FLAG_8 = 0x00000008,
MODEL_TRANSFORM_GROUP_FLAG_10 = 0x00000010,
MODEL_TRANSFORM_GROUP_FLAG_20 = 0x00000020,
MODEL_TRANSFORM_GROUP_FLAG_40 = 0x00000040,
MODEL_TRANSFORM_GROUP_FLAG_80 = 0x00000080,
MODEL_TRANSFORM_GROUP_FLAG_100 = 0x00000100,
MODEL_TRANSFORM_GROUP_FLAG_200 = 0x00000200,
MODEL_TRANSFORM_GROUP_FLAG_400 = 0x00000400,
MODEL_TRANSFORM_GROUP_FLAG_800 = 0x00000800,
MODEL_TRANSFORM_GROUP_FLAG_1000 = 0x00001000,
MODEL_TRANSFORM_GROUP_FLAG_2000 = 0x00002000,
MODEL_TRANSFORM_GROUP_FLAG_4000 = 0x00004000,
MODEL_TRANSFORM_GROUP_FLAG_8000 = 0x00008000,
MODEL_TRANSFORM_GROUP_FLAG_10000 = 0x00010000,
MODEL_TRANSFORM_GROUP_FLAG_20000 = 0x00020000,
MODEL_TRANSFORM_GROUP_FLAG_40000 = 0x00040000,
MODEL_TRANSFORM_GROUP_FLAG_80000 = 0x00080000,
MODEL_TRANSFORM_GROUP_FLAG_100000 = 0x00100000,
MODEL_TRANSFORM_GROUP_FLAG_200000 = 0x00200000,
MODEL_TRANSFORM_GROUP_FLAG_400000 = 0x00400000,
MODEL_TRANSFORM_GROUP_FLAG_800000 = 0x00800000,
MODEL_TRANSFORM_GROUP_FLAG_1000000 = 0x01000000,
MODEL_TRANSFORM_GROUP_FLAG_2000000 = 0x02000000,
MODEL_TRANSFORM_GROUP_FLAG_4000000 = 0x04000000,
MODEL_TRANSFORM_GROUP_FLAG_8000000 = 0x08000000,
MODEL_TRANSFORM_GROUP_FLAG_10000000 = 0x10000000,
MODEL_TRANSFORM_GROUP_FLAG_20000000 = 0x20000000,
MODEL_TRANSFORM_GROUP_FLAG_40000000 = 0x40000000,
MODEL_TRANSFORM_GROUP_FLAG_80000000 = 0x80000000,
TRANSFORM_GROUP_FLAG_VALID = 0x00000001,
TRANSFORM_GROUP_FLAG_HIDDEN = 0x00000002, // update, but do not render
TRANSFORM_GROUP_FLAG_INACTIVE = 0x00000004,
TRANSFORM_GROUP_FLAG_HAS_TRANSFORM = 0x00000400,
TRANSFORM_GROUP_FLAG_MATRIX_DIRTY = 0x00001000,
TRANSFORM_GROUP_FLAG_IGNORE_MATRIX = 0x00002000, // set until dirty matrix has been recalculated
};
enum NpcDropFlags {
@ -5660,7 +5629,7 @@ enum NpcDropFlags {
};
enum ImgFXStateFlags {
IMGFX_FLAG_IN_USE = 0x00000001,
IMGFX_FLAG_VALID = 0x00000001,
IMGFX_FLAG_G_CULL_BACK = 0x00000002,
IMGFX_FLAG_G_CULL_FRONT = 0x00000004,
IMGFX_FLAG_8 = 0x00000008,

View File

@ -479,7 +479,7 @@ void set_entity_fog_dist(s32 start, s32 end);
void set_entity_fog_color(s32 r, s32 g, s32 b, s32 a);
struct ModelTransformGroup* get_transform_group(s32 index);
void make_transform_group(u16 modelID);
void mdl_make_transform_group(u16 modelID);
void enable_transform_group(u16 modelID);
void disable_transform_group(u16 modelID);
void set_map_transition_effect(ScreenTransition);
@ -579,7 +579,7 @@ void start_bounce_b(void);
void update_input(void);
void update_max_rumble_duration(void);
void func_8011BAE8(void);
void mdl_reset_transform_flags(void);
void update_workers(void);
void update_triggers(void);
void update_scripts(void);
@ -1086,7 +1086,7 @@ f32 get_player_normal_pitch(void);
void partner_kill_ability_script(void);
void func_800EF3D4(s32);
void func_80116698(void);
void mdl_update_transform_matrices(void);
void func_8011B950(u16, s32, s32, s32);
void backup_map_collision_data(void);
@ -1098,6 +1098,6 @@ void update_item_entities(void);
void iterate_models(void);
void restore_map_collision_data(void);
void mdl_load_all_textures(struct ModelNode* model, s32 romOffset, s32 size);
void calculate_model_sizes(void);
void mdl_calculate_model_sizes(void);
#endif

View File

@ -218,6 +218,45 @@
#define DMG_STATUS_ALWAYS(typeFlag, duration) (STATUS_FLAG_80000000 | STATUS_FLAG_RIGHT_ON | typeFlag | (duration << 8))
#define DMG_STATUS_IGNORE_RES(typeFlag, duration) (STATUS_KEY_IGNORE_RES | typeFlag | (duration << 8))
#define _RDP_WHOLE(x) (((s32)(x * 65536.0) >> 16) & 0xFFFF)
#define _RDP_FRAC(x) ((s32)(x * 65536.0) & 0xFFFF)
#define _RDP_PACK_WHOLE(a, b) (_RDP_WHOLE(a) << 16) | _RDP_WHOLE(b)
#define _RDP_PACK_FRAC(a, b) (_RDP_FRAC(a) << 16) | _RDP_FRAC(b)
#define RDP_MATRIX( \
Ax, Bx, Cx, Dx, \
Ay, By, Cy, Dy, \
Az, Bz, Cz, Dz, \
Aw, Bw, Cw, Dw ) \
{ \
.m = { \
{ \
_RDP_PACK_WHOLE(Ax, Ay), \
_RDP_PACK_WHOLE(Az, Aw), \
_RDP_PACK_WHOLE(Bx, By), \
_RDP_PACK_WHOLE(Bz, Bw), \
}, \
{ \
_RDP_PACK_WHOLE(Cx, Cy), \
_RDP_PACK_WHOLE(Cz, Cw), \
_RDP_PACK_WHOLE(Dx, Dy), \
_RDP_PACK_WHOLE(Dz, Dw), \
}, \
{ \
_RDP_PACK_FRAC(Ax, Ay), \
_RDP_PACK_FRAC(Az, Aw), \
_RDP_PACK_FRAC(Bx, By), \
_RDP_PACK_FRAC(Bz, Bw), \
}, \
{ \
_RDP_PACK_FRAC(Cx, Cy), \
_RDP_PACK_FRAC(Cz, Cw), \
_RDP_PACK_FRAC(Dx, Dy), \
_RDP_PACK_FRAC(Dz, Dw), \
} \
} \
};
#define PM_CC_01 0, 0, 0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_02 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_03 TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, SHADE, 0

View File

@ -46,18 +46,18 @@ typedef struct ModelNode {
typedef struct Model {
/* 0x00 */ u16 flags;
/* 0x02 */ u16 modelID;
/* 0x04 */ Mtx* currentMatrix;
/* 0x04 */ Mtx* bakedMtx; // pointer to stack-allocated copy of matrix supplied by the shape file for this model
/* 0x08 */ ModelNode* modelNode;
/* 0x0C */ ModelGroupData* groupData;
/* 0x10 */ Mtx* currentSpecialMatrix;
/* 0x10 */ Mtx* finalMtx; // the matrix actually used while building the display list
/* 0x14 */ char unk_14[4];
/* 0x18 */ Mtx specialMatrix;
/* 0x58 */ Matrix4f transformMatrix;
/* 0x18 */ Mtx savedMtx;
/* 0x58 */ Matrix4f userTransformMtx; // provided for user code to apply an additional multiplicative transformation
/* 0x98 */ Vec3f center;
/* 0xA4 */ u8 texPannerID;
/* 0xA5 */ u8 customGfxIndex;
/* 0xA6 */ s8 renderMode;
/* 0xA7 */ u8 matrixMode;
/* 0xA7 */ u8 matrixFreshness;
/* 0xA8 */ u8 textureID;
/* 0xA9 */ s8 textureVariation;
/* 0xAA */ char unk_AA[6];
@ -66,16 +66,16 @@ typedef struct Model {
typedef struct ModelTransformGroup {
/* 0x00 */ u16 flags;
/* 0x02 */ u16 groupModelID;
/* 0x04 */ Mtx* matrixRDP_N;
/* 0x08 */ ModelNode* modelNode;
/* 0x0C */ Mtx* transformMtx;
/* 0x10 */ Mtx matrixA;
/* 0x50 */ Matrix4f matrixB;
/* 0x04 */ Mtx* bakedMtx; // would point to copy of matrix from shape file, but seems to always be NULL.
/* 0x08 */ ModelNode* baseModelNode;
/* 0x0C */ Mtx* finalMtx; // the matrix actually used while building the display list
/* 0x10 */ Mtx savedMtx;
/* 0x50 */ Matrix4f userTransformMtx; // provided for user code to apply an additional multiplicative transformation
/* 0x90 */ Vec3f center;
/* 0x9C */ u8 minChildModelIndex;
/* 0x9D */ u8 maxChildModelIndex;
/* 0x9E */ u8 renderMode;
/* 0x9F */ u8 matrixMode;
/* 0x9F */ u8 matrixFreshness;
} ModelTransformGroup; // size = 0xA0
typedef Model* ModelList[MAX_MODELS];
@ -130,7 +130,7 @@ typedef enum ModelPropertyKeys {
MODEL_PROP_KEY_CAMERA_DATA = 0x5D,
MODEL_PROP_KEY_TEXTURE_NAME = 0x5E,
MODEL_PROP_KEY_SPECIAL = 0x5F,
MODEL_PROP_KEY_GROUP_TYPE = 0x60,
MODEL_PROP_KEY_GROUP_INFO = 0x60,
MODEL_PROP_KEY_BOUNDING_BOX = 0x61,
MODEL_PROP_KEY_62 = 0x62,
} ModelPropertyKeys;
@ -142,6 +142,11 @@ typedef enum ShapeTypes {
SHAPE_TYPE_SPECIAL_GROUP = 10,
} ShapeTypes;
typedef enum GroupTypes {
GROUP_TYPE_0 = 0,
GROUP_TYPE_1 = 1,
} GroupTypes;
typedef enum ExtraTileTypes {
EXTRA_TILE_NONE = 0,
EXTRA_TILE_MIPMAPS = 1,

View File

@ -2899,7 +2899,7 @@ void btl_bonk_update(void* data) {
if (message->unk_24 != 0) {
message->unk_24--;
if (message->unk_24 == 0) {
clear_entity_model_flags(modelIdx, MODEL_FLAG_FLAG_20);
clear_entity_model_flags(modelIdx, MODEL_FLAG_20);
}
exec_entity_model_commandlist(modelIdx);
break;

View File

@ -89,7 +89,7 @@ void render_frame(s32 isSecondPass) {
if (!isSecondPass) {
gCurrentCamID = CAM_DEFAULT;
func_80116698();
mdl_update_transform_matrices();
}
if (isSecondPass) {

View File

@ -683,10 +683,10 @@ void animator_node_update_model_transform(ModelAnimator* animator, f32 (*flipMtx
if (node->flags & MODEL_ANIMATOR_FLAG_HAS_MODEL) {
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(node->fcData.modelID));
copy_matrix(sp10, model->transformMatrix);
copy_matrix(sp10, model->userTransformMtx);
guMtxL2F(sp10, rootTransform);
guMtxCatF(model->transformMatrix, sp10, model->transformMatrix);
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX;
guMtxCatF(model->userTransformMtx, sp10, model->userTransformMtx);
model->flags |= MODEL_FLAG_MATRIX_DIRTY;
}
for (i = 0; i < ARRAY_COUNT(node->children); i++) {

View File

@ -121,7 +121,7 @@ void bgm_update_music_settings(void) {
case 2:
flags = music->flags;
music->flags &= ~flag4;
if (flags & 1) {
if (flags & MUSIC_SETTINGS_FLAG_1) {
if (au_song_is_playing(music->songName) == AU_RESULT_OK) {
music->flags &= ~MUSIC_SETTINGS_FLAG_1;
music->state = 3;

View File

@ -1217,51 +1217,51 @@ EvtScript N(EVS_FakeBowser_Idle) = {
EVT_CALL(RotateGroup, MODEL_atama, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_atama, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_atama, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_k1, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k2, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k3, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k4, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k5, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k6, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k7, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k8, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k9, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k1, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k2, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k3, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k4, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k5, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k6, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k7, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k8, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_k9, MODEL_FLAG_40, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_BODY, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_dou, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_BODY, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_dou, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_dou, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_dou, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_d1, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_d2, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_d3, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_d1, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_d2, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_d3, MODEL_FLAG_40, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_SHELL, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_koura, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_SHELL, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_koura, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_koura, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_koura, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_s1, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s2, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s3, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s4, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s5, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s1, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s2, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s3, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s4, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_s5, MODEL_FLAG_40, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_LEFT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_left_arm, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_LEFT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_left_arm, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_left_arm, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_left_arm, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_u1, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_u2, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_u3, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_u1, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_u2, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_u3, MODEL_FLAG_40, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_TAIL, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_shippo, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_TAIL, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_shippo, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_shippo, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_shippo, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_p1, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_p1, MODEL_FLAG_40, TRUE)
EVT_SET(LVar0, ArrayVar(0))
EVT_IF_EQ(LVar0, ANIM_DOING_DEATH)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_FRONT_WHEELS, LVar0, LVar1, LVar2)
@ -1275,7 +1275,7 @@ EvtScript N(EVS_FakeBowser_Idle) = {
EVT_CALL(RotateGroup, MODEL_koma1, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_koma1, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_koma1, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_km1, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_km1, MODEL_FLAG_40, TRUE)
EVT_SET(LVar0, ArrayVar(0))
EVT_IF_EQ(LVar0, ANIM_DOING_DEATH)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_BACK_WHEELS, LVar0, LVar1, LVar2)
@ -1289,25 +1289,25 @@ EvtScript N(EVS_FakeBowser_Idle) = {
EVT_CALL(RotateGroup, MODEL_koma2, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_koma2, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_koma2, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_km2, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_km2, MODEL_FLAG_40, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_RIGHT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_right_arm, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_RIGHT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_right_arm, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_right_arm, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_right_arm, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_o171, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o172, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o183, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o171, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o172, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o183, MODEL_FLAG_40, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_FEET, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_ashi, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_FEET, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_ashi, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_ashi, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_ashi, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_o118, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o120, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o165, MODEL_FLAG_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o118, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o120, MODEL_FLAG_40, TRUE)
EVT_CALL(SetModelFlags, MODEL_o165, MODEL_FLAG_40, TRUE)
// spawn puffs of smoke if health is low enough
// written to have different effects at every quintile, but every case in the final
// version just executes the same script

View File

@ -53,12 +53,12 @@ API_CALLABLE(N(UpdateRockingHorse)) {
offsetY = SQ(rotZ) / 90.0f;
model = get_model_from_list_index(get_model_list_index_from_tree_index(horse->modelID));
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
guTranslateF(mtxPivot, -horse->offsetX, 0.0f, -horse->offsetZ);
guRotateF(mtxRotate, rotZ, 0.0f, 0.0f, 1.0f);
guMtxCatF(mtxPivot, mtxRotate, model->transformMatrix);
guMtxCatF(mtxPivot, mtxRotate, model->userTransformMtx);
guTranslateF(mtxPivot, horse->offsetX, offsetY, horse->offsetZ);
guMtxCatF(model->transformMatrix, mtxPivot, model->transformMatrix);
guMtxCatF(model->userTransformMtx, mtxPivot, model->userTransformMtx);
}
return ApiStatus_BLOCK;
}

View File

@ -9,18 +9,18 @@ typedef struct HitFile {
typedef struct ColliderBackupEntry {
/* 0x00 */ s32 flags;
/* 0x04 */ s16 parentModelIndex;
/* 0x06 */ s16 unk_06;
/* 0x06 */ char pad_06[2];
} ColliderBackupEntry; // size = 0x08
typedef struct HitFileHeader {
/* 0x00 */ s16 numColliders;
/* 0x02 */ s16 unk_02;
/* 0x02 */ char pad_02[2];
/* 0x04 */ s32 collidersOffset;
/* 0x08 */ s16 numVertices;
/* 0x0A */ s16 unk_0a;
/* 0x0A */ char pad_0A[2];
/* 0x0C */ s32 verticesOffset;
/* 0x10 */ s16 boundingBoxesDataSize;
/* 0x12 */ s16 unk_12;
/* 0x12 */ char pad_12[2];
/* 0x14 */ s32 boundingBoxesOffset;
} HitFileHeader; // size = 0x18
@ -382,11 +382,11 @@ void update_collider_transform(s16 colliderID) {
collider = &gCollisionData.colliderList[colliderID];
model = get_model_from_list_index(collider->parentModelIndex);
if (!model->currentMatrix) {
copy_matrix(model->transformMatrix, matrix);
if (model->bakedMtx == NULL) {
copy_matrix(model->userTransformMtx, matrix);
} else {
guMtxL2F(matrix, (Mtx*)model->currentMatrix);
guMtxCatF(model->transformMatrix, matrix, matrix);
guMtxL2F(matrix, (Mtx*)model->bakedMtx);
guMtxCatF(model->userTransformMtx, matrix, matrix);
}
triangle = collider->triangleTable;

View File

@ -60,20 +60,20 @@ API_CALLABLE(N(TransformFoliage)) {
Model* model = get_model_from_list_index(modelListIndex);
Matrix4f mtx;
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, 0.0f, dy, 0.0f);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guTranslateF(model->userTransformMtx, 0.0f, dy, 0.0f);
N(foliage_setup_shear_mtx)(mtx, scale, dx, dz);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
guTranslateF(mtx, 0.0f, -dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM_APPLIED | MODEL_FLAG_USES_TRANSFORM_MATRIX);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM | MODEL_FLAG_MATRIX_DIRTY);
} else {
guTranslateF(mtx, 0.0f, dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
N(foliage_setup_shear_mtx)(mtx, scale, dx, dz);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
guTranslateF(mtx, 0.0f, -dy, 0.0f);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
return ApiStatus_DONE2;

View File

@ -322,26 +322,12 @@ Vp gBoxViewport = {
#include "vtx/drawbox1.vtx.inc.c"
/*
| 0.0 0.0 0.0 0.0|
| 0.0 0.0 0.0 0.0|
| 0.0 0.0 0.0 0.0|
|-6.0 0.0 0.0 0.0|
*/
Mtx gBoxMatrix = {
.m = {
// integer portion
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0xFFFA0000, 0x00000000 },
// fractional portion
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx gBoxMatrix = RDP_MATRIX(
0.000000, 0.000000, 0.000000, -6.000000,
0.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 0.000000
);
s32 draw_box(s32 flags, WindowStyle windowStyle, s32 posX, s32 posY, s32 posZ, s32 width, s32 height, u8 opacity,
u8 darkening, f32 scaleX, f32 scaleY, f32 rotX, f32 rotY, f32 rotZ, void (*fpDrawContents)(s32, s32, s32, s32, s32, s32, s32),

View File

@ -8,7 +8,7 @@ extern EntityScript Entity_Chest_ScriptOpened;
extern Gfx Entity_Chest_RenderBox[];
extern Gfx Entity_Chest_RenderLid[];
extern Mtx Entity_Chest_lidMtx;
extern Mtx Entity_Chest_LidMtx;
EvtScript Entity_Chest_AdjustCam_ISK = {
EVT_THREAD
@ -98,7 +98,7 @@ void entity_Chest_setupGfx(s32 entityIndex) {
Gfx* gfx;
guRotateF(sp58, data->lidAngle, 1.0f, 0.0f, 0.0f);
guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &Entity_Chest_lidMtx));
guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &Entity_Chest_LidMtx));
guMtxCatF(sp58, sp18, sp18);
guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -28,18 +28,12 @@ Gfx Entity_ArrowSign_LoadTexture[] = {
gsSPEndDisplayList(),
};
Mtx Entity_ArrowSign_mtxSign = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0xFFFF0014, 0x00010001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0xD1B40000, 0x00000000 }
}
};
Mtx Entity_ArrowSign_mtxSign = RDP_MATRIX(
1.000000, 0.000000, 0.000000, -0.180848,
0.000000, 1.000000, 0.000000, 20.000000,
0.000000, 0.000000, 1.000000, 1.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_ArrowSign_RenderPole[] = {
gsDPPipeSync(),

View File

@ -33,31 +33,19 @@ Gfx Entity_BlueSwitch_LoadExclMark[] = {
gsSPEndDisplayList(),
};
Mtx Entity_BlueSwitch_mtxExclMark = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000006, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_BlueSwitch_mtxExclMark = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 6.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Mtx Entity_BlueSwitch_mtxBlueBubble = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0xFFFF0005, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0xF9310000, 0x9BEF0000 }
}
};
Mtx Entity_BlueSwitch_mtxBlueBubble = RDP_MATRIX(
1.000000, 0.000000, 0.000000, -0.026597,
0.000000, 1.000000, 0.000000, 5.000000,
0.000000, 0.000000, 1.000000, 0.609116,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_BlueSwitch_RenderBlueBubble[] = {
gsDPPipeSync(),

View File

@ -36,18 +36,12 @@ Gfx Entity_BlueWarpPipe_LoadTexturePipe[] = {
gsSPEndDisplayList(),
};
Mtx Entity_BlueWarpPipe_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x0000FFC9, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_BlueWarpPipe_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, -55.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_BlueWarpPipe_RenderBase[] = {
gsDPPipeSync(),

View File

@ -54,18 +54,12 @@ Gfx Entity_Chest_LoadTextureLock[] = {
gsSPEndDisplayList(),
};
Mtx Entity_Chest_lidMtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x0000001D, 0xFFE90001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_Chest_LidMtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 29.000000,
0.000000, 0.000000, 1.000000, -23.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_Chest_RenderLidLock[] = {
gsDPPipeSync(),

View File

@ -24,35 +24,23 @@ Gfx Entity_CymbalPlant_LoadTexture[] = {
#include "entity/model/CymbalPlant_7.vtx.inc.c"
#include "entity/model/CymbalPlant_8.vtx.inc.c"
Mtx D_0A001078_E9A368 = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x0002001A, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0xAB15AB15, 0x00000000 }
}
};
Mtx Entity_CymbalPlant_RightMtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 2.668290,
0.000000, 1.000000, 0.000000, 26.668290,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Mtx D_0A0010B8_E9A3A8 = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0xFFFD001A, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0xAB15AB15, 0x00000000 }
}
};
Mtx Entity_CymbalPlant_LeftMtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, -2.331711,
0.000000, 1.000000, 0.000000, 26.668290,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_CymbalPlant_RenderNode3[] = {
gsDPPipeSync(),
gsSPMatrix(&D_0A0010B8_E9A3A8, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_LeftMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPDisplayList(Entity_CymbalPlant_LoadTexture),
@ -80,7 +68,7 @@ Gfx Entity_CymbalPlant_RenderNode3[] = {
Gfx Entity_CymbalPlant_RenderNode4[] = {
gsDPPipeSync(),
gsSPMatrix(&D_0A0010B8_E9A3A8, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_LeftMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPDisplayList(Entity_CymbalPlant_LoadTexture),
@ -108,7 +96,7 @@ Gfx Entity_CymbalPlant_RenderNode4[] = {
Gfx Entity_CymbalPlant_RenderNode5[] = {
gsDPPipeSync(),
gsSPMatrix(&D_0A0010B8_E9A3A8, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_LeftMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
@ -126,7 +114,7 @@ Gfx Entity_CymbalPlant_RenderNode5[] = {
};
Gfx D_0A001308_E9A5F8[] = {
gsSPMatrix(&D_0A0010B8_E9A3A8, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_LeftMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPDisplayList(Entity_CymbalPlant_RenderNode5),
gsSPDisplayList(Entity_CymbalPlant_RenderNode4),
gsSPDisplayList(Entity_CymbalPlant_RenderNode3),
@ -136,7 +124,7 @@ Gfx D_0A001308_E9A5F8[] = {
Gfx Entity_CymbalPlant_RenderNode7[] = {
gsDPPipeSync(),
gsSPMatrix(&D_0A001078_E9A368, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_RightMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPDisplayList(Entity_CymbalPlant_LoadTexture),
@ -164,7 +152,7 @@ Gfx Entity_CymbalPlant_RenderNode7[] = {
Gfx Entity_CymbalPlant_RenderNode9[] = {
gsDPPipeSync(),
gsSPMatrix(&D_0A001078_E9A368, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_RightMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsSPDisplayList(Entity_CymbalPlant_LoadTexture),
@ -192,7 +180,7 @@ Gfx Entity_CymbalPlant_RenderNode9[] = {
Gfx Entity_CymbalPlant_RenderNode8[] = {
gsDPPipeSync(),
gsSPMatrix(&D_0A001078_E9A368, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_RightMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
@ -209,7 +197,7 @@ Gfx Entity_CymbalPlant_RenderNode8[] = {
};
Gfx D_0A001540_E9A830[] = {
gsSPMatrix(&D_0A001078_E9A368, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPMatrix(&Entity_CymbalPlant_RightMtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),
gsSPDisplayList(Entity_CymbalPlant_RenderNode8),
gsSPDisplayList(Entity_CymbalPlant_RenderNode9),
gsSPDisplayList(Entity_CymbalPlant_RenderNode7),

View File

@ -37,18 +37,12 @@ Gfx Entity_GreenStompSwitch_LoadExclMark[] = {
gsSPEndDisplayList(),
};
Mtx Entity_GreenStompSwitch_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_GreenStompSwitch_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_GreenStompSwitch_RenderBase[] = {
gsDPPipeSync(),

View File

@ -50,18 +50,12 @@ Gfx Entity_Padlock_LoadTextureBody[] = {
gsSPEndDisplayList(),
};
Mtx Entity_Padlock_mtxShackle = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000016, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00008000, 0x00000000 }
}
};
Mtx Entity_Padlock_mtxShackle = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 22.500000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_Padlock_RenderShackleMain[] = {
gsDPPipeSync(),

View File

@ -48,18 +48,12 @@ Gfx Entity_PadlockBlueFace_LoadTextureBody[] = {
gsSPEndDisplayList(),
};
Mtx Entity_PadlockBlueFace_mtxShackle = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000016, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00008000, 0x00000000 }
}
};
Mtx Entity_PadlockBlueFace_mtxShackle = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 22.500000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_PadlockBlueFace_RenderShackleMain[] = {
gsDPPipeSync(),

View File

@ -48,18 +48,12 @@ Gfx Entity_PadlockRedFace_LoadTextureBody[] = {
gsSPEndDisplayList(),
};
Mtx Entity_PadlockRedFace_mtxShackle = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000016, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00008000, 0x00000000 }
}
};
Mtx Entity_PadlockRedFace_mtxShackle = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 22.500000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_PadlockRedFace_RenderShackleMain[] = {
gsDPPipeSync(),

View File

@ -35,18 +35,12 @@ Gfx Entity_PadlockRedFrame_LoadTextureFace[] = {
gsSPEndDisplayList(),
};
Mtx Entity_PadlockRedFrame_mtxShackle = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_PadlockRedFrame_mtxShackle = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_PadlockRedFrame_RenderShackleMain[] = {
gsDPPipeSync(),

View File

@ -31,18 +31,12 @@ Gfx D_0A001020_E9C520[] = {
gsSPEndDisplayList(),
};
Mtx D_0A001098_E9C598 = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0xFFF60019, 0x000D0001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx D_0A001098_E9C598 = RDP_MATRIX(
1.000000, 0.000000, 0.000000, -10.000000,
0.000000, 1.000000, 0.000000, 25.000000,
0.000000, 0.000000, 1.000000, 13.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_PinkFlower_RenderNode3[] = {
gsDPPipeSync(),

View File

@ -17,18 +17,12 @@ Gfx Entity_PowBlock_LoadTexture[] = {
gsSPEndDisplayList(),
};
Mtx Entity_PowBlock_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_PowBlock_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_PowBlock_RenderTopBottom[] = {
gsDPPipeSync(),

View File

@ -17,18 +17,12 @@ Gfx Entity_PushBlock_LoadTexture[] = {
gsSPEndDisplayList(),
};
Mtx Entity_PushBlock_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_PushBlock_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_PushBlock_RenderFaces[] = {
gsDPPipeSync(),

View File

@ -32,31 +32,20 @@ Gfx Entity_RedSwitch_LoadExclMark[] = {
gsSPEndDisplayList(),
};
Mtx Entity_RedSwitch_mtxExclMark = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000006, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_RedSwitch_mtxExclMark = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 6.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Mtx Entity_RedSwitch_mtxRedBubble = RDP_MATRIX(
1.000000, 0.000000, 0.000000, -0.026600,
0.000000, 1.000000, 0.000000, 5.000000,
0.000000, 0.000000, 1.000000, 0.609116,
0.000000, 0.000000, 0.000000, 1.000000
);
Mtx Entity_RedSwitch_mtxRedBubble = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0xFFFF0005, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0xF9310000, 0x9BEF0000 }
}
};
Gfx Entity_RedSwitch_RenderRedBubble[] = {
gsDPPipeSync(),

View File

@ -42,18 +42,12 @@ Gfx Entity_SaveBlock_LoadTextureLetterS[] = {
gsSPEndDisplayList(),
};
Mtx Entity_SaveBlock_Mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_SaveBlock_Mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_SaveBlock_RenderLetterS[] = {
gsDPPipeSync(),

View File

@ -31,18 +31,12 @@ Gfx D_0A000AF8_E9D3F8[] = {
gsSPEndDisplayList(),
};
Mtx D_0A000B70_E9D470 = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000014, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx D_0A000B70_E9D470 = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 20.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx D_0A000BB0_E9D4B0[] = {
gsDPPipeSync(),

View File

@ -48,18 +48,12 @@ Gfx Entity_StarBoxLauncher_LoadTextureBox[] = {
gsSPEndDisplayList(),
};
Mtx Entity_StarBoxLauncher_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_StarBoxLauncher_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_StarBoxLauncher_RenderChain[] = {
gsDPPipeSync(),

View File

@ -17,18 +17,12 @@ Gfx Entity_SuperBlock_LoadTexture[] = {
gsSPEndDisplayList(),
};
Mtx Entity_SuperBlock_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_SuperBlock_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_SuperBlock_RenderTop[] = {
gsDPPipeSync(),

View File

@ -47,31 +47,19 @@ Gfx Entity_Tweester_LoadTextureFace[] = {
gsSPEndDisplayList(),
};
Mtx Entity_Tweester_mtxInnerWhirl = {
.m = {
{ 0x0000FFFF, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0xFFF6FB88, 0x00000000,
0x0478FFF6, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_Tweester_mtxInnerWhirl = RDP_MATRIX(
0.999848, 0.017457, 0.000000, 0.000000,
-0.01746, 0.999848, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Mtx Entity_Tweester_mtxOuterWhirl = {
.m = {
{ 0x00010000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x33330000, 0x00000000,
0x0000E666, 0x00000000 },
{ 0x00000000, 0x33330000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_Tweester_mtxOuterWhirl = RDP_MATRIX(
1.199997, 0.000000, 0.000000, 0.000000,
0.000000, 0.899994, 0.000000, 0.000000,
0.000000, 0.000000, 1.199997, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx D_0A0019E8_E58848[] = {
gsDPPipeSync(),

View File

@ -17,18 +17,12 @@ Gfx Entity_UltraBlock_LoadTexture[] = {
gsSPEndDisplayList(),
};
Mtx Entity_UltraBlock_mtx = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx Entity_UltraBlock_mtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx Entity_UltraBlock_RenderTop[] = {
gsDPPipeSync(),

View File

@ -34,18 +34,12 @@ Gfx D_0A000968_E3D738[] = {
gsSPEndDisplayList(),
};
Mtx D_0A000A20_E3D7F0 = {
.m = {
{ 0x00010000, 0x00000000,
0x00000001, 0x00000000 },
{ 0x00000000, 0x00010000,
0x00000000, 0x00000001 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 },
{ 0x00000000, 0x00000000,
0x00000000, 0x00000000 }
}
};
Mtx D_0A000A20_E3D7F0 = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
Gfx D_0A000A60_E3D830[] = {
gsDPPipeSync(),

View File

@ -19,14 +19,14 @@ ApiStatus TranslateModel(Evt* script, s32 isInitialCall) {
z = evt_get_float_variable(script, *args++);
model = get_model_from_list_index(modelIndex);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, x, y, z);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM_APPLIED | MODEL_FLAG_USES_TRANSFORM_MATRIX);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guTranslateF(model->userTransformMtx, x, y, z);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM | MODEL_FLAG_MATRIX_DIRTY);
} else {
Matrix4f mtx;
guTranslateF(mtx, x, y, z);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
return ApiStatus_DONE2;
@ -42,14 +42,14 @@ ApiStatus RotateModel(Evt* script, s32 isInitialCall) {
f32 z = evt_get_float_variable(script, *args++);
Model* model = get_model_from_list_index(modelListIndex);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guRotateF(model->transformMatrix, a, x, y, z);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM_APPLIED | MODEL_FLAG_USES_TRANSFORM_MATRIX);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guRotateF(model->userTransformMtx, a, x, y, z);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM | MODEL_FLAG_MATRIX_DIRTY);
} else {
Matrix4f mtx;
guRotateF(mtx, a, x, y, z);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
return ApiStatus_DONE2;
@ -69,14 +69,14 @@ ApiStatus ScaleModel(Evt* script, s32 isInitialCall) {
z = evt_get_float_variable(script, *args++);
model = get_model_from_list_index(modelIndex);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guScaleF(model->transformMatrix, x, y, z);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM_APPLIED | MODEL_FLAG_USES_TRANSFORM_MATRIX);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guScaleF(model->userTransformMtx, x, y, z);
model->flags |= (MODEL_FLAG_HAS_TRANSFORM | MODEL_FLAG_MATRIX_DIRTY);
} else {
Matrix4f mtx;
guScaleF(mtx, x, y, z);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
return ApiStatus_DONE2;
@ -96,7 +96,7 @@ ApiStatus InvalidateModelTransform(Evt* script, s32 isInitialCall) {
Bytecode modelID = evt_get_variable(script, *args++);
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(modelID));
model->flags &= ~MODEL_FLAG_HAS_TRANSFORM_APPLIED;
model->flags &= ~MODEL_FLAG_HAS_TRANSFORM;
return ApiStatus_DONE2;
}
@ -338,7 +338,7 @@ void apply_transform_to_children(ApiStatus (*apiFunc)(Evt*, s32), Evt* script) {
}
ApiStatus MakeTransformGroup(Evt* script, s32 isInitialCall) {
make_transform_group((u16)evt_get_variable(script, *script->ptrReadPos));
mdl_make_transform_group((u16)evt_get_variable(script, *script->ptrReadPos));
return ApiStatus_DONE2;
}
@ -357,8 +357,8 @@ ApiStatus SetTransformGroupEnabled(Evt* script, s32 isInitialCall) {
ApiStatus TranslateGroup(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 modelIndex = evt_get_variable(script, *args);
s32 index = get_transform_group_index(modelIndex);
s32 modelID = evt_get_variable(script, *args);
s32 index = get_transform_group_index(modelID);
ModelTransformGroup* transformGroup;
Matrix4f mtx;
f32 x, y, z;
@ -376,13 +376,14 @@ ApiStatus TranslateGroup(Evt* script, s32 isInitialCall) {
transformGroup = get_transform_group(index);
index = transformGroup->flags & MODEL_TRANSFORM_GROUP_FLAG_400; // TODO fix weird match
index = transformGroup->flags & TRANSFORM_GROUP_FLAG_HAS_TRANSFORM; // TODO fix weird match
if (!index) {
guTranslateF(transformGroup->matrixB, x, y, z);
transformGroup->flags |= (MODEL_TRANSFORM_GROUP_FLAG_400 | MODEL_TRANSFORM_GROUP_FLAG_1000);
guTranslateF(transformGroup->userTransformMtx, x, y, z);
transformGroup->flags |= TRANSFORM_GROUP_FLAG_HAS_TRANSFORM;
transformGroup->flags |= TRANSFORM_GROUP_FLAG_MATRIX_DIRTY;
} else {
guTranslateF(mtx, x, y, z);
guMtxCatF(mtx, transformGroup->matrixB, transformGroup->matrixB);
guMtxCatF(mtx, transformGroup->userTransformMtx, transformGroup->userTransformMtx);
}
return ApiStatus_DONE2;
@ -390,8 +391,10 @@ ApiStatus TranslateGroup(Evt* script, s32 isInitialCall) {
ApiStatus RotateGroup(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 index = get_transform_group_index(evt_get_variable(script, *args));
s32 modelID = evt_get_variable(script, *args);
s32 index = get_transform_group_index(modelID);
ModelTransformGroup* transformGroup;
Matrix4f mtx;
f32 a, x, y, z;
if (index == -1) {
@ -408,14 +411,13 @@ ApiStatus RotateGroup(Evt* script, s32 isInitialCall) {
transformGroup = get_transform_group(index);
if (!(transformGroup->flags & MODEL_TRANSFORM_GROUP_FLAG_400)) {
guRotateF(transformGroup->matrixB, a, x, y, z);
transformGroup->flags |= (MODEL_TRANSFORM_GROUP_FLAG_400 | MODEL_TRANSFORM_GROUP_FLAG_1000);
if (!(transformGroup->flags & TRANSFORM_GROUP_FLAG_HAS_TRANSFORM)) {
guRotateF(transformGroup->userTransformMtx, a, x, y, z);
transformGroup->flags |= TRANSFORM_GROUP_FLAG_HAS_TRANSFORM;
transformGroup->flags |= TRANSFORM_GROUP_FLAG_MATRIX_DIRTY;
} else {
Matrix4f mtx;
guRotateF(mtx, a, x, y, z);
guMtxCatF(mtx, transformGroup->matrixB, transformGroup->matrixB);
guMtxCatF(mtx, transformGroup->userTransformMtx, transformGroup->userTransformMtx);
}
return ApiStatus_DONE2;
@ -426,6 +428,7 @@ ApiStatus ScaleGroup(Evt* script, s32 isInitialCall) {
s32 modelID = evt_get_variable(script, *args);
s32 transformIndex = get_transform_group_index(modelID);
ModelTransformGroup* transformGroup;
Matrix4f mtx;
f32 x, y, z;
if (transformIndex == -1) {
@ -441,15 +444,14 @@ ApiStatus ScaleGroup(Evt* script, s32 isInitialCall) {
transformGroup = get_transform_group(transformIndex);
transformIndex = transformGroup->flags & MODEL_TRANSFORM_GROUP_FLAG_400; // TODO fix weird match
transformIndex = transformGroup->flags & TRANSFORM_GROUP_FLAG_HAS_TRANSFORM; // TODO fix weird match
if (!(transformIndex)) {
guScaleF(transformGroup->matrixB, x, y, z);
transformGroup->flags |= (MODEL_TRANSFORM_GROUP_FLAG_400 | MODEL_TRANSFORM_GROUP_FLAG_1000);
guScaleF(transformGroup->userTransformMtx, x, y, z);
transformGroup->flags |= TRANSFORM_GROUP_FLAG_HAS_TRANSFORM;
transformGroup->flags |= TRANSFORM_GROUP_FLAG_MATRIX_DIRTY;
} else {
Matrix4f mtx;
guScaleF(mtx, x, y, z);
guMtxCatF(mtx, transformGroup->matrixB, transformGroup->matrixB);
guMtxCatF(mtx, transformGroup->userTransformMtx, transformGroup->userTransformMtx);
}
return ApiStatus_DONE2;
@ -457,16 +459,17 @@ ApiStatus ScaleGroup(Evt* script, s32 isInitialCall) {
ApiStatus GetTransformGroup(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 modelID = evt_get_variable(script, *args++);
Bytecode var2 = *args++;
evt_set_variable(script, var2, get_transform_group_index(var1));
evt_set_variable(script, var2, get_transform_group_index(modelID));
return ApiStatus_DONE2;
}
ApiStatus EnableGroup(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 index = get_transform_group_index(evt_get_variable(script, *args));
s32 modelID = evt_get_variable(script, *args);
s32 index = get_transform_group_index(modelID);
s32 flagUnset;
ModelTransformGroup* transformGroup;
@ -514,16 +517,16 @@ void modify_collider_family_flags(s32 index, s32 flags, s32 mode) {
}
switch (mode) {
case 0:
case MODIFY_COLLIDER_FLAGS_SET_BITS:
collider->flags |= flags;
break;
case 1:
case MODIFY_COLLIDER_FLAGS_CLEAR_BITS:
collider->flags &= ~flags;
break;
case 2:
case MODIFY_COLLIDER_FLAGS_SET_VALUE:
collider->flags = flags;
break;
case 3:
case MODIFY_COLLIDER_FLAGS_SET_SURFACE:
collider->flags &= ~0xFF;
collider->flags |= flags & 0xFF;
break;

View File

@ -284,16 +284,16 @@ void func_8013A4D0(void) {
imgfx_vtxCount = 0;
imgfx_init_instance(&(*ImgFXInstances)[0]);
(*ImgFXInstances)[0].flags |= IMGFX_FLAG_IN_USE;
(*ImgFXInstances)[0].flags |= IMGFX_FLAG_VALID;
for (i = 1; i < ARRAY_COUNT(*ImgFXInstances); i++) {
if (((*ImgFXInstances)[i].flags & IMGFX_FLAG_IN_USE) && (*ImgFXInstances)[i].lastAnimCmd != IMGFX_SET_ANIM) {
if (((*ImgFXInstances)[i].flags & IMGFX_FLAG_VALID) && (*ImgFXInstances)[i].lastAnimCmd != IMGFX_SET_ANIM) {
imgfx_cache_instance_data(&(*ImgFXInstances)[i]);
}
}
for (i = 1; i < ARRAY_COUNT(*ImgFXInstances); i++) {
if ((*ImgFXInstances)[i].flags & IMGFX_FLAG_IN_USE && (*ImgFXInstances)[i].colorBuf != NULL) {
if ((*ImgFXInstances)[i].flags & IMGFX_FLAG_VALID && (*ImgFXInstances)[i].colorBuf != NULL) {
if ((*ImgFXInstances)[i].lastColorCmd == IMGFX_COLOR_BUF_SET_MULTIPLY) {
continue;
}
@ -357,7 +357,7 @@ s32 imgfx_get_free_instances(s32 count) {
numAssigned = 0;
for (i = 1; i < ARRAY_COUNT(*ImgFXInstances); i++) {
if (!((*ImgFXInstances)[i].flags & IMGFX_FLAG_IN_USE)) {
if (!((*ImgFXInstances)[i].flags & IMGFX_FLAG_VALID)) {
numAssigned++;
}
}
@ -371,7 +371,7 @@ s32 imgfx_get_free_instances(s32 count) {
numAssigned = 0;
iPrev = -1;
for (i = 1; i < ARRAY_COUNT(*ImgFXInstances); i++) {
if ((*ImgFXInstances)[i].flags & IMGFX_FLAG_IN_USE) {
if ((*ImgFXInstances)[i].flags & IMGFX_FLAG_VALID) {
continue;
}
@ -385,7 +385,7 @@ s32 imgfx_get_free_instances(s32 count) {
(*ImgFXInstances)[i].arrayIdx = i;
imgfx_init_instance(&(*ImgFXInstances)[i]);
numAssigned++;
(*ImgFXInstances)[i].flags |= IMGFX_FLAG_IN_USE;
(*ImgFXInstances)[i].flags |= IMGFX_FLAG_VALID;
iPrev = i;
if (numAssigned == count) {
(*ImgFXInstances)[i].nextIdx = -1;
@ -503,7 +503,7 @@ void imgfx_update(u32 idx, ImgFXType type, s32 imgfxArg1, s32 imgfxArg2, s32 img
s32 t1;
u8 r, g, b, a;
if (!(state->flags & IMGFX_FLAG_IN_USE) || (idx >= MAX_IMGFX_INSTANCES)) {
if (!(state->flags & IMGFX_FLAG_VALID) || (idx >= MAX_IMGFX_INSTANCES)) {
return;
}
@ -521,7 +521,7 @@ void imgfx_update(u32 idx, ImgFXType type, s32 imgfxArg1, s32 imgfxArg2, s32 img
state->ints.raw[0][0] = -1;
state->ints.raw[1][0] = -1;
state->flags &= IMGFX_FLAG_IN_USE;
state->flags &= IMGFX_FLAG_VALID;
if (flags != 0) {
state->flags |= flags;
} else {
@ -592,7 +592,7 @@ void imgfx_update(u32 idx, ImgFXType type, s32 imgfxArg1, s32 imgfxArg2, s32 img
state->ints.args.color[3] = imgfxArg4;
}
state->flags &= IMGFX_FLAG_IN_USE;
state->flags &= IMGFX_FLAG_VALID;
if (flags != 0) {
state->flags |= flags;
}
@ -704,7 +704,7 @@ void imgfx_update(u32 idx, ImgFXType type, s32 imgfxArg1, s32 imgfxArg2, s32 img
}
void imgfx_set_state_flags(s32 idx, u16 flagBits, s32 mode) {
if ((*ImgFXInstances)[idx].flags & IMGFX_FLAG_IN_USE) {
if ((*ImgFXInstances)[idx].flags & IMGFX_FLAG_VALID) {
if (mode) {
(*ImgFXInstances)[idx].flags |= flagBits;
} else {
@ -762,7 +762,7 @@ s32 imgfx_appendGfx_component(s32 idx, ImgFXTexture* ifxImg, u32 flagBits, Matri
state->renderType = IMGFX_RENDER_DEFAULT;
state->ints.raw[0][0] = -1;
state->ints.raw[1][0] = -1;
state->flags &= IMGFX_FLAG_IN_USE;
state->flags &= IMGFX_FLAG_VALID;
ret = 1;
}
return ret;

View File

@ -24,20 +24,12 @@ s16 D_800741A0 = 0;
s16 D_800741A2 = 0;
s32 D_800741A4 = 0;
Matrix4s MasterIdentityMtx = {
.whole = {
{1, 0, 0, 0},
{0, 1, 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}
},
.frac = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
}
};
Mtx MasterIdentityMtx = RDP_MATRIX(
1.000000, 0.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000
);
s32 D_800741E8[2] = {0, 0}; // padding?
u16 gMatrixListPos = 0;
@ -81,7 +73,7 @@ void step_game_loop(void) {
}
}
func_8011BAE8();
mdl_reset_transform_flags();
npc_iter_no_op();
update_workers();
update_triggers();

14
src/map_shape.ld Normal file
View File

@ -0,0 +1,14 @@
SECTIONS
{
. = 0x80210000;
.data : { *(.data) }
.rodata : {
*(.rodata)
. = ALIGN(0x10);
}
/DISCARD/ :
{
*(*);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -131,7 +131,7 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) {
npc->unk_96 = 0; // TODO: fix
npc->verticalRenderOffset = 0;
npc->alpha = 255;
npc->alpha2 = 255;
npc->hideAlpha = 255;
npc->jumpScale = 1.0f;
npc->moveSpeed = 4.0f;
npc->scale.x = 1.0f;
@ -964,12 +964,12 @@ void render_npcs(void) {
if (npc->flags & NPC_FLAG_HIDING) {
u8 r, g, b, a;
get_background_color_blend(&r, &g, &b, &a);
npc->alpha2 = 255 - a;
npc->hideAlpha = 255 - a;
} else {
npc->alpha2 = 255;
npc->hideAlpha = 255;
}
if (npc->alpha2 != 0) {
if (npc->hideAlpha != 0) {
queue_render_task(renderTaskPtr);
}
@ -1323,7 +1323,7 @@ void npc_draw_palswap_mode_0(Npc* npc, s32 arg1, Matrix4f mtx) {
}
if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
s32 alpha = (npc->alpha * npc->alpha2 / 255);
s32 alpha = (npc->alpha * npc->hideAlpha / 255);
u32 mask;
if (alpha < 255) {
mask = DRAW_SPRITE_OVERRIDE_ALPHA;
@ -1419,7 +1419,7 @@ s32 npc_draw_palswap_mode_1(Npc* npc, s32 arg1, Matrix4f mtx) {
}
if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
s32 alpha = npc->alpha * npc->alpha2 / 255;
s32 alpha = npc->alpha * npc->hideAlpha / 255;
u32 mask;
if (alpha < 255) {
mask = DRAW_SPRITE_OVERRIDE_ALPHA;
@ -1557,7 +1557,7 @@ s32 npc_draw_palswap_mode_2(Npc* npc, s32 arg1, s32 arg2, Matrix4f mtx) {
if (npc->palSwapState >= 0) {
if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) {
u32 mask;
blendAlpha = npc->alpha * npc->alpha2 / 255;
blendAlpha = npc->alpha * npc->hideAlpha / 255;
if (blendAlpha < 255) {
mask = DRAW_SPRITE_OVERRIDE_ALPHA;
} else {
@ -1701,7 +1701,7 @@ s32 npc_draw_palswap_mode_4(Npc* npc, s32 arg1, Matrix4f mtx) {
s32 temp;
u32 spriteInstanceMask;
blendAlpha = npc->alpha * npc->alpha2 / 255;
blendAlpha = npc->alpha * npc->hideAlpha / 255;
temp = blendAlpha < 255;
spriteInstanceMask = ((temp) << 31) | DRAW_SPRITE_OVERRIDE_PALETTES;
spr_draw_npc_sprite(npc->spriteInstanceID | spriteInstanceMask, arg1, blendAlpha, npc->localPalettes, mtx);

View File

@ -196,7 +196,7 @@ void state_step_end_battle(void) {
}
mdl_load_all_textures(mapSettings->modelTreeRoot, get_asset_offset(wMapTexName, &sizeTemp), sizeTemp);
calculate_model_sizes();
mdl_calculate_model_sizes();
npc_reload_all();
playerStatus->animFlags = D_800A0904;

View File

@ -323,7 +323,7 @@ void state_step_exit_language_select(void) {
set_background_size(296, 200, 12, 20);
}
calculate_model_sizes();
mdl_calculate_model_sizes();
npc_reload_all();
status_bar_respond_to_changes();
set_time_freeze_mode(TIME_FREEZE_PARTIAL);

View File

@ -200,7 +200,7 @@ void state_step_unpause(void) {
}
gGameStatusPtr->backgroundDarkness = gGameStatusPtr->savedBackgroundDarkness;
calculate_model_sizes();
mdl_calculate_model_sizes();
npc_reload_all();
set_windows_visible(WINDOW_GROUP_ALL);
status_bar_respond_to_changes();

View File

@ -5,7 +5,7 @@
extern s32 N(SpotlightsAlpha);
API_CALLABLE(N(SetWorldDark)) {
func_8011B950(MODEL_Root, -1, 1, 0);
func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_1, 0);
set_background_color_blend(0, 0, 0, 255);
return ApiStatus_DONE2;
}
@ -23,7 +23,7 @@ API_CALLABLE(N(FadeInWorld)) {
set_background_color_blend(0, 0, 0, script->functionTemp[1]);
if (script->functionTemp[1] == 0) {
func_8011B950(MODEL_Root, -1, 0, 0);
func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_0, 0);
return ApiStatus_DONE2;
} else {
return ApiStatus_BLOCK;
@ -265,7 +265,7 @@ EvtScript N(EVS_UpdateLightshow) = {
EVT_CALL(EnableModel, MODEL_kino8, TRUE)
EVT_CALL(EnableTexPanning, MODEL_kino8, TRUE)
EVT_CALL(SetModelCustomGfx, MODEL_kino7, CUSTOM_GFX_1, -1)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_set_spotlight_alpha)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_set_spotlight_alpha)), NULL)
EVT_CHILD_THREAD
EVT_CALL(MakeLerp, 0, 255, 90, EASING_LINEAR)
EVT_LOOP(0)

View File

@ -387,7 +387,7 @@ EvtScript N(EVS_SetupBubbles) = {
EVT_SET(LVar0, CLONED_MODEL(5))
EVT_EXEC(N(EVS_ManageBlownBubble))
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o167, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_big_bubble)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_big_bubble)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o167, CUSTOM_GFX_1, -1)
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(1), 1, -1)
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(2), 1, -1)
@ -395,7 +395,7 @@ EvtScript N(EVS_SetupBubbles) = {
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(4), 1, -1)
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(5), 1, -1)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o57, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(gfx_build_bubble_flower)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(gfx_build_bubble_flower)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o57, CUSTOM_GFX_2, -1)
EVT_RETURN
EVT_END

View File

@ -153,7 +153,7 @@ EvtScript N(EVS_SetupAurora) = {
EVT_END_THREAD
EVT_CALL(SetTexPanner, MODEL_o160, TEX_PANNER_7)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o76, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_aurora)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_aurora)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_1, FOG_MODE_UNCHANGED)
EVT_RETURN
EVT_END

View File

@ -16,12 +16,12 @@ ApiStatus N(MoveBush_AnimateShearing)(Evt* script) {
Model* mdl = get_model_from_list_index(modelIndex);
Matrix4f mtx;
if (!(mdl->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
N(MoveBush_apply_shear_mtx)(mdl->transformMatrix, f);
mdl->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
if (!(mdl->flags & MODEL_FLAG_HAS_TRANSFORM)) {
N(MoveBush_apply_shear_mtx)(mdl->userTransformMtx, f);
mdl->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
} else {
N(MoveBush_apply_shear_mtx)(mtx, f);
guMtxCatF(mtx, mdl->transformMatrix, mdl->transformMatrix);
guMtxCatF(mtx, mdl->userTransformMtx, mdl->userTransformMtx);
}
return ApiStatus_DONE2;
}

View File

@ -218,10 +218,10 @@ EvtScript N(D_8024652C_B26A6C) = {
EvtScript N(EVS_802467AC) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_karada, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(unkAngleFunc002)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(unkAngleFunc002)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_karada, CUSTOM_GFX_1, -1)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_onaka, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(unkAngleFunc003)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(unkAngleFunc003)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_onaka, CUSTOM_GFX_2, -1)
EVT_THREAD
EVT_LABEL(0)

View File

@ -107,7 +107,7 @@ EvtScript N(EVS_StartTongueWiggle) = {
EVT_CALL(EnableModel, TONGUE_COPY_MODEL_ID, FALSE)
EVT_EXEC(N(EVS_WiggleTongue))
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_sita, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(make_tongue_gfx)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(make_tongue_gfx)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_sita, CUSTOM_GFX_1, -1)
EVT_CALL(HidePlayerShadow, TRUE)
EVT_RETURN

View File

@ -59,10 +59,10 @@ void N(set_spotlight_pos_scale)(s32 modelID, f32 x, f32 y, f32 z, f32 scale) {
Matrix4f mtxTemp;
Model* model = get_model_from_list_index(get_model_list_index_from_tree_index(modelID));
guTranslateF(model->transformMatrix, x, y, z);
guTranslateF(model->userTransformMtx, x, y, z);
guScaleF(mtxTemp, scale, 1.0f, scale);
guMtxCatF(mtxTemp, model->transformMatrix, model->transformMatrix);
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
guMtxCatF(mtxTemp, model->userTransformMtx, model->userTransformMtx);
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
}
API_CALLABLE(N(UpdateSearchlight)) {

View File

@ -1411,7 +1411,7 @@ API_CALLABLE(N(func_80242F08_8B2F78)) {
}
API_CALLABLE(N(func_80242F28_8B2F98)) {
func_8011B950(MODEL_kinopi, -1, 1, 1);
func_8011B950(MODEL_kinopi, CUSTOM_GFX_NONE, FOG_MODE_1, 1);
set_background_color_blend(0, 0, 0, 255);
gCameras[CAM_DEFAULT].bgColor[0] = 0;
gCameras[CAM_DEFAULT].bgColor[1] = 0;

View File

@ -8,7 +8,7 @@
#define NAME_SUFFIX
API_CALLABLE(N(func_80241C9C_8EDABC)) {
func_8011B950(MODEL_g62, -1, 1, 1);
func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_1, 1);
set_background_color_blend(0, 0, 0, 255);
gCameras[CAM_DEFAULT].bgColor[0] = 0;

View File

@ -7,7 +7,7 @@
#define NAME_SUFFIX
API_CALLABLE(N(func_80242030_8EDE50)) {
func_8011B950(MODEL_g62, -1, 0, 1);
func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_0, 1);
set_background_color_blend(0, 0, 0, 0);
gCameras[CAM_DEFAULT].bgColor[0] = 0;

View File

@ -197,7 +197,7 @@ EvtScript N(EVS_Scene_TheEnd) = {
EVT_CALL(SetModelCustomGfx, MODEL_e, CUSTOM_GFX_1, -1)
EVT_CALL(SetModelCustomGfx, MODEL_d, CUSTOM_GFX_1, -1)
EVT_CALL(SetModelCustomGfx, MODEL_n, CUSTOM_GFX_1, -1)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_the_end)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_the_end)), NULL)
EVT_CALL(MakeLerp, 0, 255, 90, EASING_LINEAR)
EVT_LOOP(0)
EVT_CALL(UpdateLerp)

View File

@ -27,7 +27,7 @@ void N(gfx_build_water)(void) {
EvtScript N(EVS_SetupWaterCustomGfx) = {
EVT_WAIT(1)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(gfx_build_water)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(gfx_build_water)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_water, CUSTOM_GFX_0, -1)
EVT_RETURN
EVT_END

View File

@ -17,7 +17,7 @@ API_CALLABLE(N(SetDojoBattle)) {
}
API_CALLABLE(N(ResetBackgroundPostBattle)) {
func_8011B950(MODEL_minka_1, -1, FOG_MODE_1, 1);
func_8011B950(MODEL_minka_1, CUSTOM_GFX_NONE, FOG_MODE_1, 1);
set_background_color_blend(0, 0, 0, 255);
gCameras[CAM_DEFAULT].bgColor[0] = 0;
gCameras[CAM_DEFAULT].bgColor[1] = 0;

View File

@ -128,7 +128,7 @@ EvtScript N(EVS_SetupCrystalBallGfx) = {
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(gfx_build_crystal_ball_pre)), EVT_PTR(N(gfx_build_crystal_ball_post)))
EVT_CALL(SetModelCustomGfx, MODEL_mirrorball, CUSTOM_GFX_2, -1)
EVT_CALL(EnableModel, MODEL_mirrorball, FALSE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(gfx_build_inside_crystal_ball)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(gfx_build_inside_crystal_ball)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_tama, CUSTOM_GFX_3, -1)
EVT_CALL(SetModelFlags, MODEL_tama, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE)
EVT_CALL(SetModelFlags, MODEL_ohosi, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE)

View File

@ -256,7 +256,7 @@ API_CALLABLE(N(func_802448A0_805120)) {
if (isInitialCall) {
if (script->varTable[0] == 0) {
func_8011B950(script->varTable[15], -1, FOG_MODE_1, 1);
func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, 1);
}
script->functionTemp[0] = 0;
}
@ -279,7 +279,7 @@ API_CALLABLE(N(func_802448A0_805120)) {
if (script->functionTemp[0] >= 255) {
if (script->varTable[0] == 3) {
func_8011B950(script->varTable[15], -1, FOG_MODE_0, 1);
func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, 1);
}
return ApiStatus_DONE2;
}

View File

@ -621,7 +621,7 @@ EvtScript N(EVS_NpcInit_Rowf) = {
EVT_END_IF
EVT_END_SWITCH
EVT_SET(AF_MAC_41, FALSE)
EVT_CALL(SetModelFlags, MODEL_ju_2, MODEL_FLAG_FLAG_200, FALSE)
EVT_CALL(SetModelFlags, MODEL_ju_2, MODEL_FLAG_DO_BOUNDS_CULLING, FALSE)
EVT_CALL(EnableGroup, MODEL_jutan1, FALSE)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_b1, COLLIDER_FLAGS_UPPER_MASK)
EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_b2, COLLIDER_FLAGS_UPPER_MASK)
@ -631,7 +631,7 @@ EvtScript N(EVS_NpcInit_Rowf) = {
EVT_CALL(ScaleGroup, MODEL_jutan2, EVT_FLOAT(1.3), 1, EVT_FLOAT(1.3))
EVT_SET(MV_RowfRugRotateAngle, 60)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_ju_1, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(gfx_build_rowf_rug_with_ripples)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(gfx_build_rowf_rug_with_ripples)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_ju_1, CUSTOM_GFX_0, -1)
EVT_IF_EQ(AF_MAC_40, TRUE)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_EnterBadgeShop)), TRIGGER_FLOOR_TOUCH, COLLIDER_roten, 1, 0)
@ -640,9 +640,9 @@ EvtScript N(EVS_NpcInit_Rowf) = {
EVT_END_IF
EVT_THREAD
EVT_WAIT(5)
EVT_CALL(SetModelFlags, MODEL_b1, MODEL_FLAG_FLAG_4, FALSE)
EVT_CALL(SetModelFlags, MODEL_b2, MODEL_FLAG_FLAG_4, FALSE)
EVT_CALL(SetModelFlags, MODEL_b3, MODEL_FLAG_FLAG_4, FALSE)
EVT_CALL(SetModelFlags, MODEL_b1, MODEL_FLAG_INACTIVE, FALSE)
EVT_CALL(SetModelFlags, MODEL_b2, MODEL_FLAG_INACTIVE, FALSE)
EVT_CALL(SetModelFlags, MODEL_b3, MODEL_FLAG_INACTIVE, FALSE)
EVT_CALL(N(HideRowfBadges))
EVT_LABEL(0)
EVT_IF_EQ(GF_MAC01_RowfBadgeAvailableA, FALSE)

View File

@ -5,7 +5,7 @@ API_CALLABLE(N(InitEntryFromTunnels)) {
Npc* npc;
s32 i;
func_8011B950(MODEL_souko, -1, FOG_MODE_1, 1);
func_8011B950(MODEL_souko, CUSTOM_GFX_NONE, FOG_MODE_1, 1);
set_background_color_blend(0, 0, 0, 255);
gCameras[CAM_DEFAULT].bgColor[0] = 0;
gCameras[CAM_DEFAULT].bgColor[1] = 0;

View File

@ -3,7 +3,7 @@
s32 set_background_color_blend(s32, s32, s32, s32);
API_CALLABLE(N(InitEntryFromToybox)) {
func_8011B950(MODEL_heiho_house, -1, FOG_MODE_1, 1);
func_8011B950(MODEL_heiho_house, CUSTOM_GFX_NONE, FOG_MODE_1, 1);
set_background_color_blend(0, 0, 0, 255);
gCameras[CAM_DEFAULT].bgColor[0] = 0;
gCameras[CAM_DEFAULT].bgColor[1] = 0;

View File

@ -229,10 +229,10 @@ EvtScript N(D_802516CC_86383C) = {
EvtScript N(EVS_8025194C) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_karada, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(unkAngleFunc002)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(unkAngleFunc002)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_karada, CUSTOM_GFX_1, -1)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_onaka, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(unkAngleFunc003)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(unkAngleFunc003)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_onaka, CUSTOM_GFX_2, -1)
EVT_THREAD
EVT_LABEL(0)

View File

@ -94,7 +94,7 @@ void N(gfx_build_club_64)(s32 index) {
EvtScript N(EVS_AnimateClub64Sign) = {
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o187, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(gfx_build_club_64)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(gfx_build_club_64)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o187, CUSTOM_GFX_3, -1)
EVT_RETURN
EVT_END

View File

@ -225,10 +225,10 @@ EvtScript N(EVS_WhaleState_Walk) = {
EvtScript N(EVS_WhaleMain) = {
EVT_SET_GROUP(EVT_GROUP_00)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_karada, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(unkAngleFunc002)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(unkAngleFunc002)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_karada, CUSTOM_GFX_1, -1)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_onaka, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(unkAngleFunc003)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(unkAngleFunc003)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_onaka, CUSTOM_GFX_2, -1)
EVT_CALL(SetNpcVar, NPC_Whale, 0, 0)
EVT_THREAD

View File

@ -164,11 +164,11 @@ API_CALLABLE(N(func_802412AC_865DEC)) {
Model* model = get_model_from_list_index(modelIndex);
f32 x, y, z;
if (model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED) {
if (model->flags & MODEL_FLAG_HAS_TRANSFORM) {
// get model translation from transform matrix
x = model->transformMatrix[3][0];
y = model->transformMatrix[3][1];
z = model->transformMatrix[3][2];
x = model->userTransformMtx[3][0];
y = model->userTransformMtx[3][1];
z = model->userTransformMtx[3][2];
} else {
z = 0.0f;
y = 0.0f;

View File

@ -696,13 +696,13 @@ API_CALLABLE(N(RunMinigame)) {
data->box[i].stateTimer = 0;
model = get_model_from_list_index(get_model_list_index_from_tree_index(data->box[i].peachPanelModelID));
model->flags &= ~MODEL_FLAG_HIDDEN;
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, npc->pos.x, npc->pos.y, npc->pos.z);
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guTranslateF(model->userTransformMtx, npc->pos.x, npc->pos.y, npc->pos.z);
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
}
else {
guTranslateF(mtx, npc->pos.x, npc->pos.y, npc->pos.z);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
}
break;
@ -711,12 +711,12 @@ API_CALLABLE(N(RunMinigame)) {
npc->pos.y += npc->jumpVelocity;
npc->jumpVelocity -= npc->jumpScale;
model = get_model_from_list_index(get_model_list_index_from_tree_index(data->box[i].peachPanelModelID));
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, npc->pos.x, npc->pos.y, npc->pos.z);
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guTranslateF(model->userTransformMtx, npc->pos.x, npc->pos.y, npc->pos.z);
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
} else {
guTranslateF(mtx, npc->pos.x, npc->pos.y, npc->pos.z);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
if ((npc->moveToPos.y + 20.0f) < npc->pos.y) {
enable_npc_shadow(npc);
@ -742,12 +742,12 @@ API_CALLABLE(N(RunMinigame)) {
hittingPeachBlock = TRUE;
model = get_model_from_list_index(get_model_list_index_from_tree_index(data->box[i].peachPanelModelID));
centerY = update_lerp(EASING_QUADRATIC_OUT, npc->moveToPos.y, npc->moveToPos.y + 30.0, npc->duration, 30);
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM_APPLIED)) {
guTranslateF(model->transformMatrix, npc->pos.x, centerY, npc->pos.z);
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) {
guTranslateF(model->userTransformMtx, npc->pos.x, centerY, npc->pos.z);
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
} else {
guTranslateF(mtx, npc->pos.x, centerY, npc->pos.z);
guMtxCatF(mtx, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtx, model->userTransformMtx, model->userTransformMtx);
}
npc->duration++;
if (npc->duration >= 30) {

View File

@ -67,7 +67,7 @@ EvtScript N(EVS_ManageEvilTree) = {
};
EvtScript N(EVS_SetupExitHint) = {
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_evil_tree_face)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_evil_tree_face)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_kao, CUSTOM_GFX_1, -1)
EVT_CALL(SetModelFlags, MODEL_kao, MODEL_FLAG_USES_CUSTOM_GFX, TRUE)
EVT_WAIT(20)

View File

@ -111,7 +111,7 @@ EvtScript N(EVS_OnInspectEvilRock) = {
};
EvtScript N(EVS_SetupExitHint) = {
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_evil_rock_face)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_evil_rock_face)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o440, CUSTOM_GFX_1, -1)
EVT_CALL(SetModelFlags, MODEL_o440, MODEL_FLAG_USES_CUSTOM_GFX, TRUE)
EVT_BIND_TRIGGER(EVT_PTR(N(EVS_OnInspectEvilRock)), TRIGGER_WALL_PRESS_A, COLLIDER_o491, 1, 0)

View File

@ -1478,7 +1478,7 @@ EvtScript N(EVS_SetupMinigame) = {
EVT_CALL(EnableNpcShadow, NPC_Fuzzy_01, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Fuzzy_02, FALSE)
EVT_CALL(EnableNpcShadow, NPC_Fuzzy_03, FALSE)
EVT_CALL(SetModelFlags, MODEL_o177, MODEL_FLAG_FLAG_200, FALSE)
EVT_CALL(SetModelFlags, MODEL_o177, MODEL_FLAG_DO_BOUNDS_CULLING, FALSE)
EVT_IF_GE(GB_StoryProgress, STORY_CH1_FUZZY_THIEF_HID_IN_TREE)
EVT_CALL(N(GetTreeHidingSpotPos), LVar4, LVar0, LVar1, LVar2)
EVT_CALL(SetNpcPos, NPC_BossFuzzy, LVar0, LVar1, LVar2)

View File

@ -171,24 +171,24 @@ API_CALLABLE(N(UpdateRockingChair)) {
physics->verticalOffset = SQ(physics->rotationAngle) / 90.0f;
model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_i3));
model->flags |= (MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED);
guTranslateF(model->transformMatrix, 0.0f, physics->verticalOffset, 0.0f);
model->flags |= (MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM);
guTranslateF(model->userTransformMtx, 0.0f, physics->verticalOffset, 0.0f);
guRotateF(tempMtx, physics->rotationAngle, 0.0f, 0.0f, 1.0f);
guMtxCatF(model->transformMatrix, tempMtx, model->transformMatrix);
guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx);
update_collider_transform(COLLIDER_i3);
update_collider_transform(COLLIDER_i2);
model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_i2));
model->flags |= (MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED);
guTranslateF(model->transformMatrix, 0.0f, physics->verticalOffset, 0.0f);
model->flags |= (MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM);
guTranslateF(model->userTransformMtx, 0.0f, physics->verticalOffset, 0.0f);
guRotateF(tempMtx, physics->rotationAngle, 0.0f, 0.0f, 1.0f);
guMtxCatF(model->transformMatrix, tempMtx, model->transformMatrix);
guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx);
model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_i1));
model->flags |= (MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED);
guTranslateF(model->transformMatrix, 0.0f, physics->verticalOffset, 0.0f);
model->flags |= (MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM);
guTranslateF(model->userTransformMtx, 0.0f, physics->verticalOffset, 0.0f);
guRotateF(tempMtx, physics->rotationAngle, 0.0f, 0.0f, 1.0f);
guMtxCatF(model->transformMatrix, tempMtx, model->transformMatrix);
guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx);
update_collider_transform(COLLIDER_i1);
return ApiStatus_BLOCK;

View File

@ -111,7 +111,7 @@ API_CALLABLE(N(UpdateChandelier)) {
}
model = chandelier->models[0];
copy_matrix(model->transformMatrix, chandelier->transformMtx);
copy_matrix(model->userTransformMtx, chandelier->transformMtx);
lastDropDistance = 0.0f;
chandelier->dropDistance = 0.0f;
@ -247,17 +247,17 @@ API_CALLABLE(N(UpdateChandelier)) {
}
script->varTable[1] = cabinetPos;
guTranslateF(model->transformMatrix, 0.0f, chandelier->dropDistance - 300.0f, 0.0f);
guTranslateF(model->userTransformMtx, 0.0f, chandelier->dropDistance - 300.0f, 0.0f);
guRotateF(tempMtx, chandelier->swingAngle, 0.0f, 0.0f, 1.0f);
guMtxCatF(model->transformMatrix, tempMtx, model->transformMatrix);
guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx);
guTranslateF(tempMtx, 0.0f, 300.0f, 0.0f);
guMtxCatF(model->transformMatrix, tempMtx, model->transformMatrix);
guMtxCatF(chandelier->transformMtx, model->transformMatrix, model->transformMatrix);
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx);
guMtxCatF(chandelier->transformMtx, model->userTransformMtx, model->userTransformMtx);
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
for (i = 1; i < ARRAY_COUNT(chandelier->models); i++) {
copy_matrix(model->transformMatrix, chandelier->models[i]->transformMatrix);
chandelier->models[i]->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
copy_matrix(model->userTransformMtx, chandelier->models[i]->userTransformMtx);
chandelier->models[i]->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
}
if (chandelier->flags & CHANDELIER_FLAG_TETHER_PLAYER) {

View File

@ -52,12 +52,12 @@ API_CALLABLE(N(UpdateRockingHorses)) {
horse->lastRockAngle = rockAngle;
}
model = get_model_from_list_index(get_model_list_index_from_tree_index(horse->modelID));
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
guTranslateF(mtxPivot, -horse->posX, 0.0f, -horse->posZ);
guRotateF(mtxRotate, rockAngle, 0.0f, 0.0f, 1.0f);
guMtxCatF(mtxPivot, mtxRotate, model->transformMatrix);
guMtxCatF(mtxPivot, mtxRotate, model->userTransformMtx);
guTranslateF(mtxPivot, horse->posX, offsetY, horse->posZ);
guMtxCatF(model->transformMatrix, mtxPivot, model->transformMatrix);
guMtxCatF(model->userTransformMtx, mtxPivot, model->userTransformMtx);
}
return ApiStatus_BLOCK;
}

View File

@ -111,7 +111,7 @@ API_CALLABLE(N(AnimateBarricadeParts)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
part->transformMatrix[j][k] = model->transformMatrix[j][k];
part->transformMatrix[j][k] = model->userTransformMtx[j][k];
}
}
}
@ -150,11 +150,11 @@ API_CALLABLE(N(AnimateBarricadeParts)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
model->transformMatrix[j][k] = part->transformMatrix[j][k];
model->userTransformMtx[j][k] = part->transformMatrix[j][k];
}
}
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
guTranslateF(mtxTransform, part->pos.x - part->origin.x, part->pos.y - part->origin.y, part->pos.z - part->origin.z);
part->rot.x += part->angularVelocity.x;
part->rot.y += part->angularVelocity.y;
@ -168,7 +168,7 @@ API_CALLABLE(N(AnimateBarricadeParts)) {
guMtxCatF(mtxRotZ, mtxRotX, mtxRotX);
guMtxCatF(mtxRotX, mtxRotY, mtxRotY);
guMtxCatF(mtxRotY, mtxTransform, mtxTransform);
guMtxCatF(model->transformMatrix, mtxTransform, model->transformMatrix);
guMtxCatF(model->userTransformMtx, mtxTransform, model->userTransformMtx);
}
if ((u32) script->functionTemp[1] >= ARRAY_COUNT(N(BarricadeModels))) {

View File

@ -142,7 +142,7 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
it->transformMatrix[j][k] = loopModel->transformMatrix[j][k];
it->transformMatrix[j][k] = loopModel->userTransformMtx[j][k];
}
}
@ -155,7 +155,7 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
it->transformMatrix[j][k] = loopModel->transformMatrix[j][k];
it->transformMatrix[j][k] = loopModel->userTransformMtx[j][k];
}
}
}
@ -167,11 +167,11 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
loopModel->transformMatrix[j][k] = it->transformMatrix[j][k];
loopModel->userTransformMtx[j][k] = it->transformMatrix[j][k];
}
}
loopModel->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
loopModel->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
guTranslateF(sp20, it->relativePos.x, it->relativePos.y, it->relativePos.z);
guRotateF(spA0, script->functionTemp[1], 0.0f, 0.0f, 1.0f);
guTranslateF(sp60, -it->relativePos.x, -it->relativePos.y, -it->relativePos.z);
@ -179,9 +179,9 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) {
guMtxCatF(sp20, spA0, spA0);
guMtxCatF(spA0, sp60, sp60);
guMtxCatF(spE0, sp60, sp60);
guMtxCatF(loopModel->transformMatrix, sp60, loopModel->transformMatrix);
guMtxCatF(loopModel->userTransformMtx, sp60, loopModel->userTransformMtx);
update_collider_transform(N(RotatingPlatformColliders)[i]);
guMtxXFMF(loopModel->transformMatrix, 0.0f, 0.0f, 0.0f, &ox, &oy, &oz);
guMtxXFMF(loopModel->userTransformMtx, 0.0f, 0.0f, 0.0f, &ox, &oy, &oz);
if (gCollisionStatus.currentFloor == N(RotatingPlatformColliders)[i] ||
gCollisionStatus.lastTouchedFloor == N(RotatingPlatformColliders)[i])
{
@ -199,12 +199,12 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) {
it->lastRelativePos.z = oz;
}
guRotateF(axisModel->transformMatrix, script->functionTemp[1], 0.0f, 0.0f, 1.0f);
axisModel->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
guRotateF(axisModel->userTransformMtx, script->functionTemp[1], 0.0f, 0.0f, 1.0f);
axisModel->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
update_collider_transform(COLLIDER_fl);
guRotateF(ringModel->transformMatrix, script->functionTemp[1], 0.0f, 0.0f, 1.0f);
ringModel->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
guRotateF(ringModel->userTransformMtx, script->functionTemp[1], 0.0f, 0.0f, 1.0f);
ringModel->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
update_collider_transform(COLLIDER_1_0);
isPounding = FALSE;

View File

@ -286,7 +286,7 @@ API_CALLABLE(N(func_80242538_D223C8)) {
if (isInitialCall) {
if (script->varTable[0] == 0) {
func_8011B950(script->varTable[15], -1, FOG_MODE_1, 1);
func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, 1);
}
script->functionTemp[0] = 0;
}
@ -309,7 +309,7 @@ API_CALLABLE(N(func_80242538_D223C8)) {
if (script->functionTemp[0] >= 255) {
if (script->varTable[0] == 3) {
func_8011B950(script->varTable[15], -1, FOG_MODE_0, 1);
func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, 1);
}
return ApiStatus_DONE2;
}

View File

@ -63,7 +63,7 @@ API_CALLABLE(N(AnimateIceShattering)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
it->transformMatrix[j][k] = model->transformMatrix[j][k];
it->transformMatrix[j][k] = model->userTransformMtx[j][k];
}
}
}
@ -87,11 +87,11 @@ API_CALLABLE(N(AnimateIceShattering)) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
model->transformMatrix[j][k] = it->transformMatrix[j][k];
model->userTransformMtx[j][k] = it->transformMatrix[j][k];
}
}
model->flags |= MODEL_FLAG_USES_TRANSFORM_MATRIX | MODEL_FLAG_HAS_TRANSFORM_APPLIED;
model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM;
guTranslateF(mtxTransform, it->pos.x - it->initialPos.x, it->pos.y - it->initialPos.y, it->pos.z - it->initialPos.z);
it->rot.x += it->rotVel.x;
it->rot.y += it->rotVel.y;
@ -105,7 +105,7 @@ API_CALLABLE(N(AnimateIceShattering)) {
guMtxCatF(mtxRotZ, mtxRotX, mtxRotX);
guMtxCatF(mtxRotX, mtxRotY, mtxRotY);
guMtxCatF(mtxRotY, mtxTransform, mtxTransform);
guMtxCatF(mtxTransform, model->transformMatrix, model->transformMatrix);
guMtxCatF(mtxTransform, model->userTransformMtx, model->userTransformMtx);
}
if ((u32) script->functionTemp[1] >= ARRAY_COUNT(N(IceShardModels))) {

View File

@ -25,7 +25,7 @@ void N(worker_render_player_reflection)(void) {
if (playerStatus->flags & PS_FLAG_HAS_REFLECTION) {
entityModel = get_entity_model(get_shadow_by_index(playerStatus->shadowID)->entityModelID);
entityModel->flags |= MODEL_FLAG_FLAG_200;
entityModel->flags |= ENTITY_MODEL_FLAG_REFLECT;
get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z,
&screenX, &screenY, &screenZ);

View File

@ -296,7 +296,7 @@ void N(build_gfx_floor)(void) {
guScaleF(sp50, x, y, z);
guMtxCatF(sp50, sp10, sp10);
guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
mdl_project_tex_coords(1, N(shockwave_gfx), sp10, NULL);
mdl_project_tex_coords(MODEL_o152, N(shockwave_gfx), sp10, NULL);
gDPPipeSync(gMainGfxPos++);
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);

View File

@ -34,7 +34,7 @@ API_CALLABLE(N(UnkFunc27)) {
if (*modelIDList == 0xFFFF) {
break;
}
func_8011B950(*modelIDList, -1, fogType, 0);
func_8011B950(*modelIDList, CUSTOM_GFX_NONE, fogType, 0);
modelIDList++;
};
break;

View File

@ -387,7 +387,7 @@ EvtScript N(EVS_SetupBubbles) = {
EVT_SET(LVar0, CLONED_MODEL(5))
EVT_EXEC(N(EVS_ManageBlownBubble))
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o167, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_big_bubble)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(gfx_build_big_bubble)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o167, CUSTOM_GFX_1, -1)
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(1), CUSTOM_GFX_1, -1)
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(2), CUSTOM_GFX_1, -1)
@ -395,7 +395,7 @@ EvtScript N(EVS_SetupBubbles) = {
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(4), CUSTOM_GFX_1, -1)
EVT_CALL(SetModelCustomGfx, CLONED_MODEL(5), CUSTOM_GFX_1, -1)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o57, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(gfx_build_bubble_flower)), 0)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(gfx_build_bubble_flower)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o57, CUSTOM_GFX_2, -1)
EVT_RETURN
EVT_END

View File

@ -257,7 +257,7 @@ API_CALLABLE(RoomVisibilityToggleImpl) {
if (isInitialCall) {
if (script->varTable[0] == ROOM_VISIBILITY_SHOW) {
func_8011B950(script->varTable[15], -1, FOG_MODE_1, 1);
func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, 1);
}
script->functionTemp[1] = 0;
}
@ -281,7 +281,7 @@ API_CALLABLE(RoomVisibilityToggleImpl) {
if (script->functionTemp[1] >= 255) {
if (script->varTable[0] == ROOM_VISIBILITY_HIDE) {
// ROOM_DATA_MODEL_ID
func_8011B950(script->varTable[15], -1, FOG_MODE_0, 1);
func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, 1);
}
return ApiStatus_DONE2;
} else {

View File

@ -197,8 +197,8 @@ API_CALLABLE(func_802803C8) {
}
API_CALLABLE(func_80280410) {
static Evt* D_80286520;
static s32 D_80286524;
static Evt* ShopInteractScript;
static s32 ShopInteractScriptID;
Shop* shop = gGameStatusPtr->mapShop;
s32 currentItemSlot = evt_get_variable(script, *script->ptrReadPos);
@ -210,7 +210,6 @@ API_CALLABLE(func_80280410) {
shop->unk_358 = 5;
if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
Evt* childScript;
disable_player_input();
@ -218,14 +217,14 @@ API_CALLABLE(func_80280410) {
childScript = start_script(&BadgeShopInteract, EVT_PRIORITY_1, 0);
childScript->varTable[0] = currentItemSlot;
D_80286520 = childScript;
D_80286524 = childScript->id;
ShopInteractScript = childScript;
ShopInteractScriptID = childScript->id;
shop->flags |= SHOP_FLAG_8;
return ApiStatus_BLOCK;
} else {
return ApiStatus_DONE2;
}
} else if (does_script_exist(D_80286524)) {
} else if (does_script_exist(ShopInteractScriptID)) {
return ApiStatus_BLOCK;
}
@ -930,7 +929,7 @@ API_CALLABLE(MakeShop) {
gGameStatusPtr->shopItemEntities[numShopItems].pos.y = centerY;
gGameStatusPtr->shopItemEntities[numShopItems].pos.z = centerZ;
model = get_model_from_list_index(get_model_list_index_from_tree_index(itemDataPositions->posModelID));
model->flags |= MODEL_FLAG_FLAG_4;
model->flags |= MODEL_FLAG_INACTIVE;
gGameStatusPtr->shopItemEntities[numShopItems].index =
make_item_entity_nodelay(inventory->itemID | shop->inventoryItemFlags, centerX, centerY, centerZ, 1, 0);
set_item_entity_flags(gGameStatusPtr->shopItemEntities[numShopItems].index, ITEM_ENTITY_RESIZABLE);
@ -951,7 +950,7 @@ API_CALLABLE(MakeShop) {
gWindowStyles[11].defaultStyleID = WINDOW_STYLE_3;
shop->currentItemSlot = 0;
shop->selectedStoreItemSlot = 0;
shop->flags = SHOP_FLAG_0;
shop->flags = 0;
shop->owner = NULL;
return ApiStatus_DONE2;

View File

@ -101,19 +101,31 @@ def write_ninja_rules(
command=f"{cross}ld {ld_args}",
)
ninja.rule(
"shape_ld",
description="link($version) shape $out",
command=f"{cross}ld -T src/map_shape.ld $in -o $out",
)
ninja.rule(
"shape_objcopy",
description="objcopy($version) shape $out",
command=f"{cross}objcopy $in $out -O binary",
)
Z64_DEBUG = ""
if debug:
Z64_DEBUG = "-gS -R .data -R .note -R .eh_frame -R .gnu.attributes -R .comment -R .options"
Z64_DEBUG = " -gS -R .data -R .note -R .eh_frame -R .gnu.attributes -R .comment -R .options"
ninja.rule(
"z64",
description="rom $out",
command=f"{cross}objcopy $in $out -O binary {Z64_DEBUG} && {BUILD_TOOLS}/rom/n64crc $out",
command=f"{cross}objcopy $in $out -O binary{Z64_DEBUG} && {BUILD_TOOLS}/rom/n64crc $out",
)
ninja.rule(
"z64_ique",
description="rom $out",
command=f"{cross}objcopy $in $out -O binary {Z64_DEBUG}",
command=f"{cross}objcopy $in $out -O binary{Z64_DEBUG}",
)
ninja.rule(
@ -174,6 +186,12 @@ def write_ninja_rules(
command=f"{cross}ld -r -b binary $in -o $out",
)
ninja.rule(
"cp",
description="cp $in $out",
command=f"cp $in $out",
)
ninja.rule(
"as",
description="as $in",
@ -268,22 +286,24 @@ def write_ninja_rules(
"map_header", command=f"$python {BUILD_TOOLS}/mapfs/map_header.py $in > $out"
)
ninja.rule("pm_charset", command=f"$python {BUILD_TOOLS}/pm_charset.py $out $in")
ninja.rule("charset", command=f"$python {BUILD_TOOLS}/pm_charset.py $out $in")
ninja.rule(
"pm_charset_palettes",
"charset_palettes",
command=f"$python {BUILD_TOOLS}/pm_charset_palettes.py $out $in",
)
ninja.rule(
"pm_sprite_shading_profiles",
"sprite_shading_profiles",
command=f"$python {BUILD_TOOLS}/sprite/sprite_shading_profiles.py $in $out $header_path",
)
ninja.rule(
"pm_imgfx_data", command=f"$python {BUILD_TOOLS}/imgfx/imgfx_data.py $in $out"
"imgfx_data", command=f"$python {BUILD_TOOLS}/imgfx/imgfx_data.py $in $out"
)
ninja.rule("shape", command=f"$python {BUILD_TOOLS}/mapfs/shape.py $in $out")
with Path("tools/permuter_settings.toml").open("w") as f:
f.write(
f"compiler_command = \"{cc} {CPPFLAGS.replace('$version', 'pal')} {cflags} -DPERMUTER -fforce-addr\"\n"
@ -444,6 +464,7 @@ class Configure:
skip_outputs: Set[str],
non_matching: bool,
modern_gcc: bool,
c_maps: bool = False,
):
import segtypes
import segtypes.common.c
@ -906,7 +927,6 @@ class Configure:
build(bin_path, imgs, "pack_title_data")
elif name.endswith("_bg"):
compress = True
bin_path = self.build_path() / bin_path
build(
bin_path,
[path],
@ -929,34 +949,39 @@ class Configure:
},
asset_deps=[f"mapfs/tex/{name}"],
)
elif name.endswith("_shape"):
map_name = "_".join(name.split("_")[:-1])
# Handle map XML files, if they exist (TODO: have splat output these)
map_xml = self.resolve_asset_path(
Path(f"assets/{self.version}")
/ seg.dir
/ seg.name
/ (map_name + ".xml")
elif name.endswith("_shape_built"):
base_name = name[:-6]
raw_bin_path = self.resolve_asset_path(
f"assets/x/mapfs/geom/{base_name}.bin"
)
if map_xml.exists():
# Build a header file for this map
bin_path = bin_path.parent / "geom" / (base_name + ".bin")
if c_maps:
# raw bin -> c -> o -> elf -> objcopy -> final bin file
c_file_path = (
bin_path.parent / "geom" / base_name
).with_suffix(".c")
o_path = bin_path.parent / "geom" / (base_name + ".o")
elf_path = bin_path.parent / "geom" / (base_name + ".elf")
build(c_file_path, [raw_bin_path], "shape")
build(
self.build_path()
/ "include"
/ seg.dir
/ seg.name
/ (map_name + ".h"),
[map_xml],
"map_header",
o_path,
[c_file_path],
"cc" if not modern_gcc else "cc_modern",
variables={
"cflags": "",
"cppflags": f"-DVERSION_{self.version.upper()}",
"encoding": "CP932", # similar to SHIFT-JIS, but includes backslash and tilde
},
)
# NOTE: we don't build the map xml into a _shape or _hit file (yet); the Star Rod Map Editor
# is able to build the xml nonmatchingly into assets/star_rod_build/mapfs/*.bin for people
# who want that (i.e. modders). 'star_rod_build' should be added to asset_stack also.
build(elf_path, [o_path], "shape_ld")
build(bin_path, [elf_path], "shape_objcopy")
else:
build(bin_path, [raw_bin_path], "cp")
compress = True
bin_path = path
out_dir = out_dir / "geom"
else:
compress = True
bin_path = path
@ -994,7 +1019,7 @@ class Configure:
)
rasters.append(out_path)
build(entry.object_path.with_suffix(""), rasters, "pm_charset")
build(entry.object_path.with_suffix(""), rasters, "charset")
build(entry.object_path, [entry.object_path.with_suffix("")], "bin")
elif seg.type == "pm_charset_palettes":
palettes = []
@ -1018,9 +1043,7 @@ class Configure:
)
palettes.append(out_path)
build(
entry.object_path.with_suffix(""), palettes, "pm_charset_palettes"
)
build(entry.object_path.with_suffix(""), palettes, "charset_palettes")
build(entry.object_path, [entry.object_path.with_suffix("")], "bin")
elif seg.type == "pm_sprite_shading_profiles":
header_path = str(
@ -1029,7 +1052,7 @@ class Configure:
build(
entry.object_path.with_suffix(""),
entry.src_paths,
"pm_sprite_shading_profiles",
"sprite_shading_profiles",
implicit_outputs=[header_path],
variables={
"header_path": header_path,
@ -1040,7 +1063,7 @@ class Configure:
c_file_path = (
Path(f"assets/{self.version}") / "imgfx" / (seg.name + ".c")
)
build(c_file_path, entry.src_paths, "pm_imgfx_data")
build(c_file_path, entry.src_paths, "imgfx_data")
build(
entry.object_path,
@ -1163,6 +1186,11 @@ if __name__ == "__main__":
help="Use modern GCC instead of the original compiler",
)
parser.add_argument("--ccache", action="store_true", help="Use ccache")
parser.add_argument(
"--c-maps",
action="store_true",
help="Convert map binaries to C as part of the build process",
)
args = parser.parse_args()
exec_shell(["make", "-C", str(ROOT / args.splat)])
@ -1296,7 +1324,9 @@ if __name__ == "__main__":
configure.split(
not args.no_split_assets, args.split_code, args.shift, args.debug
)
configure.write_ninja(ninja, skip_files, non_matching, args.modern_gcc)
configure.write_ninja(
ninja, skip_files, non_matching, args.modern_gcc, args.c_maps
)
all_rom_oks.append(str(configure.rom_ok_path()))

715
tools/build/mapfs/shape.py Executable file
View File

@ -0,0 +1,715 @@
import argparse
from pathlib import Path
import struct
from abc import ABC
from collections import deque
from io import TextIOWrapper
from typing import List, Dict, Optional
BASE_ADDR = 0x80210000
NODE_TYPE_ROOT = 7
NODE_TYPE_MODEL = 2
NODE_TYPE_GROUP = 5
NODE_TYPE_SPECIAL_GROUP = 10
GFX_LOAD_VTX = 0x01
GFX_DRAW_TRI = 0x05
GFX_DRAW_TRIS = 0x06
GFX_RDP_PIPE_SYNC = 0xE7
GFX_POP_MATRIX = 0xD8
GFX_GEOMETRYMODE = 0xD9
GFX_LOAD_MATRIX = 0xDA
GFX_START_DL = 0xDE
GFX_END_DL = 0xDF
ALIGN_16 = "__attribute__ ((aligned (16))) "
def read_ascii_string(bytes: bytearray, addr: int) -> str:
start = addr - BASE_ADDR
length = 0
for char in bytes[start:]:
if char == 0:
break
length += 1
return bytes[start : start + length].decode("ascii")
def get_shape_type_name(id: int) -> str:
if id == NODE_TYPE_ROOT:
return "SHAPE_TYPE_ROOT"
elif id == NODE_TYPE_MODEL:
return "SHAPE_TYPE_MODEL"
elif id == NODE_TYPE_GROUP:
return "SHAPE_TYPE_GROUP"
elif id == NODE_TYPE_SPECIAL_GROUP:
return "SHAPE_TYPE_SPECIAL_GROUP"
raise Exception(f"Unknown shape type {id}")
class Segment(ABC):
def __init__(self, addr: int, name: str):
self.addr = addr
self.name = name
self.count = 0
self.model_name = ""
def get_sym(self) -> str:
if self.model_name != "":
return f"N({self.name}_{self.model_name})"
else:
return f"N({self.name})"
def __str__(self):
return str(self.__class__.__name__[:-7]) + " " + self.get_sym()
def scan(self, shape):
pass
def print(self, shape):
shape.print(hex(self.addr) + " : " + str(self))
class HeaderSegment(Segment):
def __init__(self, addr: int, name: str):
super().__init__(addr, name)
def scan(self, shape):
start = self.addr - BASE_ADDR
(
self.ptr_root_node,
self.ptr_vtx_table,
self.ptr_model_names,
self.ptr_collider_names,
self.ptr_zone_names,
) = struct.unpack(">IIIII", shape.file_bytes[start : start + 20])
# note: do not push model root yet
shape.root_node = NodeSegment(self.ptr_root_node, "Node")
shape.vtx_table = shape.push(
VertexTableSegment(self.ptr_vtx_table, "VertexTable")
)
shape.model_names = shape.push(
StringListSegment(self.ptr_model_names, "ModelNames")
)
shape.collider_names = shape.push(
StringListSegment(self.ptr_collider_names, "ColliderNames")
)
shape.zone_names = shape.push(
StringListSegment(self.ptr_zone_names, "ZoneNames")
)
def print(self, shape):
shape.print(f"ShapeFileHeader {self.get_sym()} = {{")
shape.print(f" .root = &{shape.get_symbol(self.ptr_root_node)},")
shape.print(f" .vertexTable = {shape.get_symbol(self.ptr_vtx_table)},")
shape.print(f" .modelNames = {shape.get_symbol(self.ptr_model_names)},")
shape.print(
f" .colliderNames = {shape.get_symbol(self.ptr_collider_names)},"
)
if self.ptr_zone_names != 0:
shape.print(f" .zoneNames = {shape.get_symbol(self.ptr_zone_names)},")
shape.print("};")
class VertexTableSegment(Segment):
def __init__(self, addr: int, name: str):
super().__init__(addr, name)
def print(self, shape):
pos = self.addr - BASE_ADDR
shape.print(f"Vtx_t {self.get_sym()}[] = {{")
for idx in range(self.count):
(
x,
y,
z,
flag,
u,
v,
r,
g,
b,
a,
) = struct.unpack(">hhhhhhBBBB", shape.file_bytes[pos : pos + 16])
pos += 16
shape.print(
f" {{{{ {x:4}, {y:4}, {z:4} }}, {flag}, {{ {u:6}, {v:6} }}, {{ {r:3}, {g:3}, {b:3}, {a:3} }}}},"
)
shape.print("};")
class VectorListSegment(Segment):
def __init__(self, addr: int, name: str):
super().__init__(addr, name)
def print(self, shape):
next = shape.get_segment_after(self)
pos = self.addr - BASE_ADDR
end = next.addr - BASE_ADDR
count = (end - pos) // 12
shape.print(f"Vec3f {self.get_sym()}[] = {{")
for _ in range(count):
(x, y, z) = struct.unpack(">fff", shape.file_bytes[pos : pos + 12])
pos += 12
shape.print(f" {{ {x}, {y}, {z} }},")
shape.print("};")
class StringListSegment(Segment):
def __init__(self, addr: int, name: str):
super().__init__(addr, name)
self.list: deque
def scan(self, shape):
self.list = deque()
pos = self.addr - BASE_ADDR
while True:
(ptr_str,) = struct.unpack(">I", shape.file_bytes[pos : pos + 4])
pos += 4
string = read_ascii_string(shape.file_bytes, ptr_str)
if string == "db":
break
self.list.append(string)
def print(self, shape):
align_attribute = ""
if self.name == "ModelNames":
align_attribute = ALIGN_16
shape.print(f"{align_attribute}char* {self.get_sym()}[] = {{")
for name in self.list:
shape.print(f' "{name}",')
shape.print(' "db",')
shape.print("};")
class NodeSegment(Segment):
def __init__(self, addr: int, name: str):
super().__init__(addr, name)
def scan(self, shape):
pos = self.addr - BASE_ADDR
(
self.node_type,
self.ptr_display_data,
self.num_properties,
self.ptr_property_list,
self.ptr_group_data,
) = struct.unpack(">IIIII", shape.file_bytes[pos : pos + 20])
self.model_name = shape.model_name_map[self.addr]
shape.push(GroupDataSegment(self.ptr_group_data, "GroupData", self.model_name))
shape.push(
DisplayDataSegment(self.ptr_display_data, "DisplayData", self.model_name)
)
shape.push(
PropertyListSegment(
self.ptr_property_list,
"Properties",
self.model_name,
self.num_properties,
)
)
def print(self, shape):
shape.print(f"ModelNode {self.get_sym()} = {{")
shape.print(f" .type = {get_shape_type_name(self.node_type)},")
if self.ptr_group_data != 0:
shape.print(f" .groupData = &{shape.get_symbol(self.ptr_group_data)},")
shape.print(f" .displayData = &{shape.get_symbol(self.ptr_display_data)},")
shape.print(f" .propertyList = {shape.get_symbol(self.ptr_property_list)},")
shape.print(f" .numProperties = {self.num_properties},")
shape.print("};")
class NodeListSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str, num_children: int):
super().__init__(addr, name)
self.model_name = model_name
self.count = num_children
self.children: List[NodeSegment] = []
def scan(self, shape):
pos = self.addr - BASE_ADDR
for _ in range(self.count):
(ptr_child,) = struct.unpack(">I", shape.file_bytes[pos : pos + 4])
pos += 4
self.children.append(ptr_child)
shape.push(NodeSegment(ptr_child, "Node"))
def print(self, shape):
shape.print(f"ModelNode* {self.get_sym()}[] = {{")
for addr in self.children:
shape.print(f" &{shape.get_symbol(addr)},")
shape.print("};")
class PropertyListSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str, count: int):
super().__init__(addr, name)
self.model_name = model_name
self.count = count
def print(self, shape):
pos = self.addr - BASE_ADDR
shape.print(f"ModelNodeProperty {self.get_sym()}[] = {{")
for _ in range(self.count):
(
key,
fmt,
value,
) = struct.unpack(">III", shape.file_bytes[pos : pos + 12])
pos += 12
if key == 0x5E:
if value == 0:
shape.print(
f" {{ .key = {hex(key)}, .dataType = {fmt}, .data = {{ .p = NULL }}}},"
)
else:
tex_name = read_ascii_string(shape.file_bytes, value)
shape.print(
f' {{ .key = {hex(key)}, .dataType = {fmt}, .data = {{ .p = "{tex_name}" }}}},'
)
elif key == 0x5F:
shape.print(
f" {{ .key = {hex(key)}, .dataType = {fmt}, .data = {{ .s = {hex(value)} }}}},"
)
else:
if fmt == 0: # int
shape.print(
f" {{ .key = {hex(key)}, .dataType = {fmt}, .data = {{ .s = {hex(value)} }}}},"
)
elif fmt == 1: # float
temp = struct.pack(">I", value)
(f,) = struct.unpack(">f", temp)
shape.print(
f" {{ .key = {hex(key)}, .dataType = {fmt}, .data = {{ .f = {f} }}}},"
)
elif fmt == 2: # pointer
shape.print(
f' {{ .key = {hex(key)}, .dataType = {fmt}, .data = {{ .p = "{shape.get_symbol(value)}" }}}},'
)
else:
raise Exception(
f"Invalid property: 0x{key:08X} 0x{fmt:08X} 0x{value:08X}"
)
shape.print("};")
class GroupDataSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str):
super().__init__(addr, name)
self.model_name = model_name
def scan(self, shape):
start = self.addr - BASE_ADDR
(
self.ptr_transform_mtx,
self.ptr_lights,
self.num_lights,
self.num_children,
self.ptr_children,
) = struct.unpack(">IIIII", shape.file_bytes[start : start + 20])
shape.push(
NodeListSegment(
self.ptr_children, "Children", self.model_name, self.num_children
)
)
shape.push(
LightSetSegment(self.ptr_lights, "Lights", self.model_name, self.num_lights)
)
shape.push(MatrixSegment(self.ptr_transform_mtx, "Mtx", self.model_name))
def print(self, shape):
shape.print(f"ModelGroupData {self.get_sym()} = {{")
if self.ptr_transform_mtx != 0:
shape.print(
f" .transformMatrix = (Mtx*) &{shape.get_symbol(self.ptr_transform_mtx)},"
)
shape.print(
f" .lightingGroup = (Lightsn*) &{shape.get_symbol(self.ptr_lights)},"
)
shape.print(f" .numLights = {self.num_lights},")
shape.print(f" .childList = {shape.get_symbol(self.ptr_children)},")
shape.print(f" .numChildren = {self.num_children},")
shape.print("};")
class LightSetSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str, count: int):
super().__init__(addr, name)
self.model_name = model_name
self.count = count
def print(self, shape):
next = shape.get_segment_after(self)
pos = self.addr - BASE_ADDR
end = next.addr - BASE_ADDR
shape.print(f"// num: {self.count}")
shape.print(f"s32 {self.get_sym()}[] = {{")
while pos < end:
(v,) = struct.unpack(">I", shape.file_bytes[pos : pos + 4])
pos += 4
shape.print(f" 0x{v:08X},")
shape.print("};")
class MatrixSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str):
super().__init__(addr, name)
self.model_name = model_name
def print(self, shape):
pos = self.addr - BASE_ADDR
shape.print(f"Matrix4s {self.get_sym()} = {{")
shape.print(" .whole = {")
for i in range(4):
(a, b, c, d) = struct.unpack(">hhhh", shape.file_bytes[pos : pos + 8])
pos += 8
shape.print(
f" {{ {hex(a):4}, {hex(b):4}, {hex(c):4}, {hex(d):4} }},"
)
shape.print(" },")
shape.print(" .frac = {")
for i in range(4):
(a, b, c, d) = struct.unpack(">hhhh", shape.file_bytes[pos : pos + 8])
pos += 8
shape.print(
f" {{ {hex(a):4}, {hex(b):4}, {hex(c):4}, {hex(d):4} }},"
)
shape.print(" },")
shape.print("};")
class DisplayDataSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str):
super().__init__(addr, name)
self.model_name = model_name
def scan(self, shape):
start = self.addr - BASE_ADDR
(self.ptr_display_list,) = struct.unpack(
">I", shape.file_bytes[start : start + 4]
)
gfx_segment = shape.push(
DisplayListSegment(self.ptr_display_list, "Gfx", self.model_name)
)
# Gfx segments may have been already visited during root Gfx traversal
# so we will now force the associated model name to be the current model
gfx_segment.model_name = self.model_name
def print(self, shape):
start = self.addr - BASE_ADDR
shape.print(f"ModelDisplayData {self.get_sym()} = {{")
shape.print(f" .displayList = {shape.get_symbol(self.ptr_display_list)},")
shape.print("};")
class DisplayListSegment(Segment):
def __init__(self, addr: int, name: str, model_name: str):
super().__init__(addr, name)
self.model_name = model_name
def scan(self, shape):
pos = self.addr - BASE_ADDR
while True:
(w1, w2) = struct.unpack(">II", shape.file_bytes[pos : pos + 8])
pos += 8
op = w1 >> 24
if op == GFX_END_DL:
break
elif op == GFX_START_DL:
shape.push(
DisplayListSegment(
w2, f"Gfx_{hex(w2)[2:].upper()}", self.model_name
)
)
elif op == GFX_LOAD_MATRIX:
shape.push(
MatrixSegment(w2, f"Mtx_{hex(w2)[2:]}", model_name=self.model_name)
)
elif op == GFX_LOAD_VTX:
num = (w1 >> 12) & 0xFFF
idx = (w2 - shape.vtx_table.addr) // 0x10
if shape.vtx_table.count < idx + num:
shape.vtx_table.count = idx + num
def get_geometry_flags(self, bits: int) -> str:
flags = []
if (bits & 0x00000400) != 0:
flags.append("G_CULL_BACK")
if (bits & 0x00020000) != 0:
flags.append("G_LIGHTING")
if (bits & 0x00200000) != 0:
flags.append("G_SHADING_SMOOTH")
return " | ".join(flags)
def print(self, shape):
pos = self.addr - BASE_ADDR
shape.print(f"Gfx {self.get_sym()}[] = {{")
while True:
(w1, w2) = struct.unpack(">II", shape.file_bytes[pos : pos + 8])
pos += 8
op = w1 >> 24
if op == GFX_LOAD_VTX:
num = (w1 >> 12) & 0x00000FFF
end = (w1 & 0x00000FFF) // 2
buf_pos = end - num
index = (w2 - shape.vtx_table.addr) // 0x10
shape.print(
f" gsSPVertex(&{shape.vtx_table.get_sym()}[{index}], {num}, {buf_pos}),"
)
elif op == GFX_DRAW_TRI:
i = (w1 & 0x00FF0000) >> 16
j = (w1 & 0x0000FF00) >> 8
k = w1 & 0x000000FF
shape.print(f" gsSP1Triangle({i // 2}, {j // 2}, {k // 2}, 0),")
elif op == GFX_DRAW_TRIS:
a = (w1 & 0x00FF0000) >> 16
b = (w1 & 0x0000FF00) >> 8
c = w1 & 0x000000FF
d = (w2 & 0x00FF0000) >> 16
e = (w2 & 0x0000FF00) >> 8
f = w2 & 0x000000FF
shape.print(
f" gsSP2Triangles({a // 2}, {b // 2}, {c // 2}, 0, {d // 2}, {e // 2}, {f // 2}, 0),"
)
elif op == GFX_RDP_PIPE_SYNC:
shape.print(" gsDPPipeSync(),")
elif op == GFX_POP_MATRIX:
shape.print(" gsSPPopMatrix(G_MTX_MODELVIEW),")
elif op == GFX_GEOMETRYMODE:
if w1 == 0xD9FFFFFF:
flags = self.get_geometry_flags(w2)
shape.print(f" gsSPSetGeometryMode({flags}),")
else:
flags = self.get_geometry_flags(~(w1 | 0xFF000000))
shape.print(f" gsSPClearGeometryMode({flags}),")
elif op == GFX_LOAD_MATRIX:
shape.print(
f" gsSPMatrix(&{shape.get_symbol(w2)}, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW),"
)
elif op == GFX_START_DL:
shape.print(f" gsSPDisplayList({shape.get_symbol(w2)}),")
elif op == GFX_END_DL:
shape.print(" gsSPEndDisplayList(),")
break
shape.print("};")
if self.model_name == "root":
next = shape.get_segment_after(self)
end = next.addr - BASE_ADDR
shape.print(f"\ns32 N(PostGfxPad)[] = {{")
while pos < end:
(v,) = struct.unpack(">I", shape.file_bytes[pos : pos + 4])
pos += 4
shape.print(f" 0x{v:08X},")
shape.print("};")
class ShapeFile:
def __init__(self, map_name: str, file_bytes: bytes):
self.map_name = map_name
self.file_bytes = file_bytes
self.out_file: TextIOWrapper
self.pending: List[Segment] = []
self.visited: Dict[int, Segment] = {}
self.model_name_map: Dict[int, str] = {}
self.root_node: Optional[Segment] = None
self.vtx_table: Optional[Segment] = None
self.model_names: Optional[StringListSegment] = None
self.collider_names: Optional[Segment] = None
self.zone_names: Optional[Segment] = None
def push(self, segment: Segment):
if segment.addr == 0:
return None
if segment.addr in self.visited:
return self.visited[segment.addr]
self.pending.append(segment)
self.visited[segment.addr] = segment
return segment
def get_symbol(self, addr) -> str:
if not addr in self.visited:
raise Exception(f"Encountered unknown pointer: {hex(addr)}")
return self.visited[addr].get_sym()
def print(self, string: str):
if self.out_file != None:
self.out_file.write(string + "\n")
else:
print(string)
# traverse the model tree and create a mapping from addr -> name which we will use during the second scan pass
def build_model_name_map(self, node_addr: int, names: deque):
node_start = node_addr - BASE_ADDR
(
node_type,
ptr_display_list,
num_properties,
ptr_property_list,
ptr_group_data,
) = struct.unpack(">IIIII", self.file_bytes[node_start : node_start + 20])
if node_type == NODE_TYPE_MODEL:
# set name for this model node
self.model_name_map[node_addr] = names.pop()
return
group_start = ptr_group_data - BASE_ADDR
(
ptr_transform_mtx,
ptr_lights,
num_lights,
num_children,
ptr_children,
) = struct.unpack(">IIIII", self.file_bytes[group_start : group_start + 20])
child_start = ptr_children - BASE_ADDR
for i in range(num_children):
(ptr_child,) = struct.unpack(
">I", self.file_bytes[child_start : child_start + 4]
)
self.build_model_name_map(ptr_child, names)
child_start += 4
# set name for this group node
if node_type == NODE_TYPE_ROOT:
self.model_name_map[node_addr] = "root"
else:
self.model_name_map[node_addr] = names.pop()
def print_prologue(self, segments):
assert self.root_node is not None
assert self.vtx_table is not None
assert self.model_names is not None
assert self.collider_names is not None
self.print('#include "common.h"')
self.print('#include "model.h"')
self.print("")
self.print(f"#define NAMESPACE {self.map_name}_shape")
self.print("")
self.print(f"extern ModelNode {self.root_node.get_sym()};")
self.print(f"extern Vtx_t {self.vtx_table.get_sym()}[];")
self.print(f"extern char* {self.model_names.get_sym()}[];")
self.print(f"extern char* {self.collider_names.get_sym()}[];")
if self.zone_names is not None:
self.print(f"extern char* {self.zone_names.get_sym()}[];")
for segment in segments:
if isinstance(segment, MatrixSegment):
self.print(f"extern Matrix4s {segment.get_sym()};")
self.print("")
def digest(self):
# first pass just scans the header and string lists
self.push(HeaderSegment(BASE_ADDR, "Header"))
while len(self.pending) > 0:
segment = self.pending.pop()
segment.scan(self)
assert self.model_names is not None
assert self.root_node is not None
# traverse the model tree to create initial name map
model_names = deque(self.model_names.list)
model_names.reverse()
self.build_model_name_map(self.root_node.addr, model_names)
# second pass scans the model tree and subordinate data structures
self.push(self.root_node)
self.push(VectorListSegment(self.root_node.addr + 0x14, "UnknownVectors"))
while len(self.pending) > 0:
segment = self.pending.pop()
segment.scan(self)
# create a sorted segment map
segment_addrs = list(self.visited.keys())
segment_addrs.sort()
self.sorted_segments = {i: self.visited[i] for i in segment_addrs}
def get_segment_after(self, seg: Segment) -> Optional[Segment]:
keys = list(self.sorted_segments.keys())
idx = keys.index(seg.addr)
if idx + 1 < len(keys):
next_addr = keys[idx + 1]
ret = self.sorted_segments[next_addr]
else:
ret = None
return ret
def write_to_c(self, out_file):
self.out_file = out_file
self.print_prologue(self.sorted_segments.values())
for addr, seg in self.sorted_segments.items():
self.print(f"// {hex(seg.addr - BASE_ADDR)}")
seg.print(self)
self.print("")
def run(in_bin: Path, out: Path) -> None:
map_name = "_".join(in_bin.stem.split("_")[:-1])
with open(in_bin, "rb") as f:
file_bytes = f.read()
shape = ShapeFile(map_name, file_bytes)
shape.digest()
with open(out, "w") as out_file:
shape.write_to_c(out_file)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("in_bin", type=Path, help="input binary file")
parser.add_argument("out_c", type=Path, help="output text file")
args = parser.parse_args()
run(args.in_bin, args.out_c)

28
tools/compare_shapes.py Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python3
import filecmp
import os
from pathlib import Path
total = 0
matching = 0
for root, dirs, files in os.walk("assets/us/mapfs/geom"):
for file in files:
if file.endswith("_shape.bin"):
total += 1
shape_file = os.path.join(root, file)
built_data_file = Path("ver/us/build") / shape_file.replace(
"_shape.bin", "_shape_data.bin"
)
if filecmp.cmp(shape_file, built_data_file, shallow=False):
matching += 1
else:
if total - matching == 10:
print("...")
if total - matching < 10:
print(file, "X")
print()
print(f"{matching} of {total} files match")

View File

@ -50,13 +50,17 @@ def parse_palette(data):
return palette
def add_file_ext(name: str) -> str:
def add_file_ext(name: str, linker: bool = False) -> str:
if name.startswith("party_"):
return "party/" + name + ".png"
elif name.endswith("_hit") or name.endswith("_shape"):
return "geom/" + name + ".bin" # TODO: xml
elif name.endswith("_hit"):
return "geom/" + name + ".bin"
elif name.endswith("_shape"):
if linker:
name += "_built"
return "geom/" + name + ".bin"
elif name.endswith("_tex"):
return "tex/" + name + ".bin" # TODO: texture archive
return "tex/" + name + ".bin"
elif name.endswith("_bg"):
return "bg/" + name + ".png"
else:
@ -228,7 +232,7 @@ class N64SegPm_map_data(N64Segment):
return [
LinkerEntry(
self,
[fs_dir / add_file_ext(name) for name in self.files],
[fs_dir / add_file_ext(name, linker=True) for name in self.files],
fs_dir.with_suffix(".dat"),
".data",
),

View File

@ -2,6 +2,7 @@
import struct
import sys
import re
import xml.etree.ElementTree as ET
from dataclasses import dataclass, field
from pathlib import Path
@ -99,6 +100,31 @@ SPECIAL_RASTER = 0x1F880
LIST_END_BYTES = b"\xFF\xFF\xFF\xFF"
def indent(elem, level=0):
i = "\n" + level*" "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
indent(elem, level+1)
if not elem.tail or not elem.tail.strip():
elem.tail = i
else:
if level and (not elem.tail or not elem.tail.strip()):
elem.tail = i
def pretty_print_xml(tree : ET.ElementTree, path : Path):
root = tree.getroot()
indent(root)
xml_str = ET.tostring(root, encoding="unicode")
xml_str = re.sub(" />", "/>", xml_str)
with open(path, "w") as f:
f.write(xml_str)
@dataclass
class RasterTableEntry:
offset: int
@ -319,12 +345,7 @@ def write_player_metadata(
)
xml = ET.ElementTree(Names)
# pretty print (Python 3.9+)
if hasattr(ET, "indent"):
ET.indent(xml, " ")
xml.write(str(out_path / PLAYER_SPRITE_MEDADATA_XML_FILENAME), encoding="unicode")
pretty_print_xml(xml, out_path / PLAYER_SPRITE_MEDADATA_XML_FILENAME)
def write_npc_metadata(
@ -342,12 +363,7 @@ def write_npc_metadata(
)
xml = ET.ElementTree(Names)
# pretty print (Python 3.9+)
if hasattr(ET, "indent"):
ET.indent(xml, " ")
xml.write(str(out_path / NPC_SPRITE_MEDADATA_XML_FILENAME), encoding="unicode")
pretty_print_xml(xml, out_path / NPC_SPRITE_MEDADATA_XML_FILENAME)
def write_player_xmls(
@ -472,12 +488,7 @@ def write_player_xmls(
)
xml = ET.ElementTree(SpriteSheet)
# pretty print (Python 3.9+)
if hasattr(ET, "indent"):
ET.indent(xml, " ")
xml.write(str(out_path / f"{cur_sprite_name}.xml"), encoding="unicode")
pretty_print_xml(xml, out_path / f"{cur_sprite_name}.xml")
if has_back:
sprite_idx += 2
@ -721,12 +732,7 @@ class NpcSprite:
)
xml = ET.ElementTree(SpriteSheet)
# pretty print (Python 3.9+)
if hasattr(ET, "indent"):
ET.indent(xml, " ")
xml.write(str(path / "SpriteSheet.xml"), encoding="unicode")
pretty_print_xml(xml, path / "SpriteSheet.xml")
class N64SegPm_sprites(N64Segment):

View File

@ -3,6 +3,19 @@ from itertools import zip_longest
import struct
from typing import Dict, List
import xml.etree.ElementTree as ET
from enum import IntEnum
class CMD(IntEnum):
WAIT = 0
SET_IMG = 1
GOTO = 2
SET_POS = 3
SET_ROT = 4
SET_SCALE = 5
SET_PAL = 6
LOOP = 7
SET_META = 8
def iter_in_groups(iterable, n, fillvalue=None):
@ -30,6 +43,16 @@ class Animation:
raise NotImplementedError()
@dataclass
class Label(Animation):
lbl_name: str
def get_attributes(self):
return {
"name": str(self.lbl_name),
}
@dataclass
class Wait(Animation):
duration: int
@ -62,24 +85,37 @@ class SetPalette(Animation):
@dataclass
class Goto(Animation):
dest: str
pos: int
def get_attributes(self):
if self.pos != 0:
return {
"pos": str(self.pos),
}
else:
return {
"dest": str(self.dest),
}
@dataclass
class Loop(Animation):
count: int
dest: str
pos: int
def get_attributes(self):
if self.pos != 0:
return {
"count": str(self.count),
"pos": str(self.pos),
}
else:
return {
"count": str(self.count),
"dest": str(self.dest),
}
@dataclass
@ -181,62 +217,105 @@ class AnimComponent:
def size(self):
return len(self.commands)
@staticmethod
def parse_commands(command_list: List[int]) -> List[Animation]:
ret: List[Animation] = []
labels = {}
boundaries = []
labels[0] = "Start"
i = 0
while i < len(command_list):
boundaries.append(i)
cmd_start = command_list[i]
cmd_op = cmd_start >> 12
cmd_arg = cmd_start & 0xFFF
if cmd_op == CMD.GOTO:
dest = cmd_arg
if dest in boundaries and dest not in labels:
labels[dest] = f"Pos_{dest}"
elif cmd_op == CMD.SET_POS:
i += 3
elif cmd_op == CMD.SET_ROT:
i += 2
elif cmd_op == CMD.SET_SCALE:
i += 1
elif cmd_op == CMD.LOOP:
dest = command_list[i + 1]
if dest in boundaries and dest not in labels:
labels[dest] = f"Pos_{dest}"
i += 1
i += 1
def to_signed(value):
return -(value & 0x8000) | (value & 0x7FFF)
i = 0
while i < len(command_list):
cmd_start = command_list[i]
cmd_op = cmd_start >> 12
cmd_arg = cmd_start & 0xFFF
if cmd_start <= 0xFFF:
if i in labels:
ret.append(Label(labels[i]))
if cmd_op == CMD.WAIT:
ret.append(Wait(cmd_start))
elif cmd_start <= 0x1FFF:
raster = cmd_start % 0x1000
elif cmd_op == CMD.SET_IMG:
raster = cmd_arg
if raster == 0xFFF:
raster = -1
ret.append(SetRaster(raster))
elif cmd_start <= 0x2FFF:
ret.append(Goto(cmd_start % 0x2000))
elif cmd_start <= 0x3FFF:
flag = cmd_start % 0x3000
elif cmd_op == CMD.GOTO:
dest = cmd_arg
if dest in labels:
lbl_name = labels[dest]
ret.append(Goto(lbl_name, 0))
else:
ret.append(Goto(None, dest))
elif cmd_op == CMD.SET_POS:
flag = cmd_arg
x, y, z = command_list[i + 1 : i + 4]
x = to_signed(x)
y = to_signed(y)
z = to_signed(z)
i += 3
ret.append(SetPos(flag, x, y, z))
elif cmd_start <= 0x4FFF:
elif cmd_op == CMD.SET_ROT:
x, y, z = command_list[i : i + 3]
x = ((x % 0x4000) << 20) >> 20
x = (cmd_arg << 20) >> 20
y = to_signed(y)
z = to_signed(z)
i += 2
ret.append(SetRot(x, y, z))
elif cmd_start <= 0x5FFF:
mode = cmd_start % 0x5000
elif cmd_op == CMD.SET_SCALE:
mode = cmd_arg
percent = command_list[i + 1]
i += 1
ret.append(SetScale(mode, percent))
elif cmd_start <= 0x6FFF:
palette = cmd_start % 0x6000
elif cmd_op == CMD.SET_PAL:
palette = cmd_arg
if palette == 0xFFF:
palette = -1
ret.append(SetPalette(palette))
elif cmd_start <= 0x7FFF:
count = cmd_start % 0x7000
pos = command_list[i + 1]
elif cmd_op == CMD.LOOP:
count = cmd_arg
dest = command_list[i + 1]
if dest in labels:
lbl_name = labels[dest]
ret.append(Loop(count, lbl_name, 0))
else:
ret.append(Loop(count, None, dest))
i += 1
ret.append(Loop(count, pos))
elif cmd_start <= 0x80FF:
ret.append(Unknown(cmd_start % 0x8000))
elif cmd_op == CMD.SET_META:
if cmd_start <= 0x80FF:
ret.append(Unknown(cmd_arg & 0xFF))
elif cmd_start <= 0x81FF:
ret.append(SetParent(cmd_start % 0x8100))
ret.append(SetParent(cmd_arg & 0xFF))
elif cmd_start <= 0x82FF:
ret.append(SetNotify(cmd_start % 0x8200))
ret.append(SetNotify(cmd_arg & 0xFF))
else:
raise Exception("Unknown command")
i += 1
@ -263,8 +342,12 @@ class AnimComponent:
@staticmethod
def from_xml(xml: ET.Element):
commands: List[int] = []
labels = {}
for cmd in xml:
if cmd.tag == "Wait":
if cmd.tag == "Label":
idx = len(commands)
labels[cmd.attrib["name"]] = idx
elif cmd.tag == "Wait":
duration = int(cmd.attrib["duration"])
commands.append(duration)
elif cmd.tag == "SetRaster":
@ -273,7 +356,16 @@ class AnimComponent:
raster = 0xFFF
commands.append(0x1000 + raster)
elif cmd.tag == "Goto":
commands.append(0x2000 + int(cmd.attrib["pos"]))
if "pos" in cmd.attrib:
# support hardcoded positions for glitched animations
pos = int(cmd.attrib["pos"])
else:
# properly formatted animations will have labels
lbl_name = cmd.attrib["dest"]
if not lbl_name in labels:
raise Exception("Label missing for Goto dest: " + lbl_name)
pos = labels[lbl_name]
commands.append(0x2000 + pos)
elif cmd.tag == "SetPos":
flag = int(cmd.attrib["flag"])
x, y, z = cmd.attrib["xyz"].split(",")
@ -298,7 +390,15 @@ class AnimComponent:
commands.append(0x6000 + palette)
elif cmd.tag == "Loop":
count = int(cmd.attrib["count"])
if "pos" in cmd.attrib:
# support hardcoded positions for glitched animations
pos = int(cmd.attrib["pos"])
else:
# properly formatted animations will have labels
lbl_name = cmd.attrib["dest"]
if not lbl_name in labels:
raise Exception("Label missing for Loop dest: " + lbl_name)
pos = labels[lbl_name]
commands.append(0x7000 + count)
commands.append(pos)
elif cmd.tag == "Unknown":

View File

@ -193,10 +193,10 @@ dlabel wTransformGroups
dlabel bTransformGroups
.space 0x00000010
dlabel wModelSpecialDls
dlabel wCustomModelGfx
.space 0x00000080
dlabel bModelSpecialDls
dlabel bCustomModelGfx
.space 0x00000080
dlabel wCustomModelGfxBuilders
@ -214,10 +214,10 @@ dlabel bModelLocalVtxBuffers
dlabel gCurrentModelLocalVtxBuffers
.space 4
dlabel D_80152214
dlabel wModelTreeRoot
.space 4
dlabel D_80152218
dlabel bModelTreeRoot
.space 4
dlabel D_8015221C
@ -271,19 +271,19 @@ dlabel texPannerAuxV
dlabel TextureHeapPos
.space 4
dlabel mdl_currentTransformGroupChildIndex
dlabel mtg_IterIdx
.space 2
dlabel D_8015336E
dlabel mtg_SearchModelID
.space 2
dlabel D_80153370
dlabel mtg_FoundModelNode
.space 4
dlabel D_80153374
dlabel mtg_MinChild
.space 2
dlabel D_80153376
dlabel mtg_MaxChild
.space 2
dlabel D_80153378

View File

@ -266,9 +266,9 @@ step_current_game_mode = 0x80118088;
state_render_backUI = 0x80118168;
state_render_frontUI = 0x801181D4;
clear_model_data = 0x8011AF54;
func_80116698 = 0x8011B8A8;
mdl_update_transform_matrices = 0x8011B8A8;
render_models = 0x8011BDA0;
func_8011BAE8 = 0x80120CF8;
mdl_reset_transform_flags = 0x80120CF8;
clear_render_tasks = 0x80122AA0;
execute_render_tasks = 0x80122BC8;
clear_animator_list = 0x80123434;

View File

@ -179,13 +179,13 @@ state_render_frontUI = 0x801181D4;
mdl_load_all_textures = 0x8011AE34;
clear_model_data = 0x8011AF54;
init_model_data = 0x8011B1F8;
calculate_model_sizes = 0x8011B33C;
mdl_calculate_model_sizes = 0x8011B33C;
iterate_models = 0x8011B884;
func_80116698 = 0x8011B8A8;
mdl_update_transform_matrices = 0x8011B8A8;
render_models = 0x8011BDA0;
get_model_from_list_index = 0x8011FF40;
load_data_for_models = 0x8011FF58;
func_8011BAE8 = 0x80120CF8;
mdl_reset_transform_flags = 0x80120CF8;
set_background_color_blend = 0x8012106C;
get_background_color_blend = 0x80121090;
mdl_set_all_fog_mode = 0x80122A3C;

View File

@ -193,10 +193,10 @@ dlabel wTransformGroups
dlabel bTransformGroups
.space 0x00000010
dlabel wModelSpecialDls
dlabel wCustomModelGfx
.space 0x00000080
dlabel bModelSpecialDls
dlabel bCustomModelGfx
.space 0x00000080
dlabel wCustomModelGfxBuilders
@ -214,10 +214,10 @@ dlabel bModelLocalVtxBuffers
dlabel gCurrentModelLocalVtxBuffers
.space 4
dlabel D_80152214
dlabel wModelTreeRoot
.space 4
dlabel D_80152218
dlabel bModelTreeRoot
.space 4
dlabel D_8015221C
@ -271,19 +271,19 @@ dlabel texPannerAuxV
dlabel TextureHeapPos
.space 4
dlabel mdl_currentTransformGroupChildIndex
dlabel mtg_IterIdx
.space 2
dlabel D_8015336E
dlabel mtg_SearchModelID
.space 2
dlabel D_80153370
dlabel mtg_FoundModelNode
.space 4
dlabel D_80153374
dlabel mtg_MinChild
.space 2
dlabel D_80153376
dlabel mtg_MaxChild
.space 2
dlabel D_80153378

View File

@ -4007,10 +4007,10 @@ mdl_load_all_textures = 0x80115C24; // type:func rom:0xAC324
mdl_get_child_count = 0x80115CA8; // type:func rom:0xAC3A8
clear_model_data = 0x80115D44; // type:func rom:0xAC444
init_model_data = 0x80115FE8; // type:func rom:0xAC6E8
calculate_model_sizes = 0x8011612C; // type:func rom:0xAC82C
mdl_calculate_model_sizes = 0x8011612C; // type:func rom:0xAC82C
mdl_create_model = 0x8011620C; // type:func rom:0xAC90C
iterate_models = 0x80116674; // type:func rom:0xACD74
func_80116698 = 0x80116698; // type:func rom:0xACD98
mdl_update_transform_matrices = 0x80116698; // type:func rom:0xACD98
render_models = 0x80116B90; // type:func rom:0xAD290
appendGfx_model_group = 0x80117C94; // type:func rom:0xAE394
func_80117D00 = 0x80117D00; // type:func rom:0xAE400
@ -4025,13 +4025,13 @@ get_transform_group_index = 0x8011B090; // type:func rom:0xB1790
get_model_center_and_size = 0x8011B0EC; // type:func rom:0xB17EC
get_transform_group = 0x8011B1C0; // type:func rom:0xB18C0
func_8011B1D8 = 0x8011B1D8; // type:func rom:0xB18D8
make_transform_group = 0x8011B37C; // type:func rom:0xB1A7C
mdl_make_transform_group = 0x8011B37C; // type:func rom:0xB1A7C
enable_transform_group = 0x8011B5D0; // type:func rom:0xB1CD0
disable_transform_group = 0x8011B660; // type:func rom:0xB1D60
clone_model = 0x8011B6F0; // type:func rom:0xB1DF0
set_model_group_visibility = 0x8011B7C0; // type:func rom:0xB1EC0
func_8011B950 = 0x8011B950; // type:func rom:0xB2050
func_8011BAE8 = 0x8011BAE8; // type:func rom:0xB21E8
mdl_reset_transform_flags = 0x8011BAE8; // type:func rom:0xB21E8
enable_world_fog = 0x8011BB50; // type:func rom:0xB2250
disable_world_fog = 0x8011BB64; // type:func rom:0xB2264
set_world_fog_dist = 0x8011BB74; // type:func rom:0xB2274
@ -4488,10 +4488,10 @@ bgm_set_battle_song = 0x8014AF8C; // type:func rom:0xE168C
func_8014AFA0 = 0x8014AFA0; // type:func rom:0xE16A0
D_8014AFB0 = 0x8014AFB0; // rom:0xE16B0
D_8014AFB4 = 0x8014AFB4; // rom:0xE16B4
D_8014AFC0 = 0x8014AFC0; // rom:0xE16C0
D_8014B0B8 = 0x8014B0B8; // rom:0xE17B8
ModelRenderModes = 0x8014AFC0; // rom:0xE16C0
ModelCombineModesA = 0x8014B0B8; // rom:0xE17B8
D_8014B0BC = 0x8014B0BC; // rom:0xE17BC
D_8014B400 = 0x8014B400; // rom:0xE1B00
ModelCombineModesB = 0x8014B400; // rom:0xE1B00
D_8014B404 = 0x8014B404; // rom:0xE1B04
TextureHeapBase = 0x8014B748; // rom:0xE1E48
mdl_bgMultiplyColorA = 0x8014B74C; // rom:0xE1E4C
@ -4870,9 +4870,9 @@ func_802C39F8 = 0x802C39F8; // type:func rom:0xE83A8
func_802C3C10 = 0x802C3C10; // type:func rom:0xE85C0
wTransformGroups = 0x80151F70; // rom:0xE8670
bTransformGroups = 0x80151F80; // rom:0xE8680
wModelSpecialDls = 0x80151F90; // rom:0xE8690
wCustomModelGfx = 0x80151F90; // rom:0xE8690
restart_script = 0x802C3D04; // type:func rom:0xE86B4
bModelSpecialDls = 0x80152010; // rom:0xE8710
bCustomModelGfx = 0x80152010; // rom:0xE8710
update_scripts = 0x802C3D74; // type:func rom:0xE8724
wCustomModelGfxBuilders = 0x80152090; // rom:0xE8790
bCustomModelGfxBuilders = 0x80152110; // rom:0xE8810
@ -4881,8 +4881,8 @@ func_802C3EE4 = 0x802C3EE4; // type:func rom:0xE8894
bModelLocalVtxBuffers = 0x801521D0; // rom:0xE88D0
kill_script = 0x802C3F3C; // type:func rom:0xE88EC
gCurrentModelLocalVtxBuffers = 0x80152210; // rom:0xE8910
D_80152214 = 0x80152214; // rom:0xE8914
D_80152218 = 0x80152218; // rom:0xE8918
wModelTreeRoot = 0x80152214; // rom:0xE8914
bModelTreeRoot = 0x80152218; // rom:0xE8918
D_8015221C = 0x8015221C; // rom:0xE891C
D_80152220 = 0x80152220; // rom:0xE8920
kill_script_by_ID = 0x802C40AC; // type:func rom:0xE8A5C
@ -4948,10 +4948,10 @@ texPannerAuxU = 0x801532E8; // rom:0xE99E8
texPannerAuxV = 0x80153328; // rom:0xE9A28
mdl_nextTextureAddress = 0x80153368; // rom:0xE9A68
evt_handle_case_not_equal = 0x802C50BC; // type:func rom:0xE9A6C
D_8015336E = 0x8015336E; // rom:0xE9A6E
D_80153370 = 0x80153370; // rom:0xE9A70
D_80153374 = 0x80153374; // rom:0xE9A74
D_80153376 = 0x80153376; // rom:0xE9A76
mtg_SearchModelID = 0x8015336E; // rom:0xE9A6E
mtg_FoundModelNode = 0x80153370; // rom:0xE9A70
mtg_MinChild = 0x80153374; // rom:0xE9A74
mtg_MaxChild = 0x80153376; // rom:0xE9A76
D_80153378 = 0x80153378; // rom:0xE9A78
depthCopyBuffer = 0x80153380; // rom:0xE9A80
mdl_renderTaskLists = 0x801533A0; // rom:0xE9AA0
@ -26031,7 +26031,7 @@ D_801512E8 = 0x801512E8; //
B_801512F0 = 0x801512F0; //
gBattleEntityList = 0x801513F8; //
mdl_treeIterPos = 0x80153224; //
mdl_currentTransformGroupChildIndex = 0x8015336C; //
mtg_IterIdx = 0x8015336C; //
gCurrentAnimMeshListPtr = 0x80153A40; //
gAnimRotMtx = 0x80153A68; //
gMessageDrawStatePtr = 0x80155D74; //
@ -26770,8 +26770,8 @@ ExitSingleDoor = 0x80285DAC; //
EnterSingleDoor = 0x80285DD4; //
ExitDoubleDoor = 0x80285E4C; //
EnterDoubleDoor = 0x80285E74; //
D_80286520 = 0x80286520; //
D_80286524 = 0x80286524; //
ShopInteractScript = 0x80286520; //
ShopInteractScriptID = 0x80286524; //
D_80286528 = 0x80286528; //
wShopBuyCallbackScript = 0x8028652C; //
wShopSelectedItem = 0x80286530; //