Warning Fixies (#826)

* warnings

* morenings

* more

* morz

* mor3

* PR
This commit is contained in:
Ethan Roseman 2022-10-16 10:22:18 -04:00 committed by GitHub
parent c700116f41
commit 46decfa258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 355 additions and 221 deletions

View File

@ -11,4 +11,7 @@ void update_camera_mode_5(Camera*);
void update_camera_mode_6(Camera*);
void create_camera_leadplayer_matrix(Camera*);
void update_camera_zone_interp(Camera* camera);
Camera* initialize_next_camera(CameraInitData* data);
#endif

View File

@ -127,9 +127,9 @@ typedef struct CamPosSettings {
} CamPosSettings; // size = 0x1C
typedef struct DmaTable {
/* 0x00 */ s32 start;
/* 0x04 */ s32 end;
/* 0x08 */ s32 dest;
/* 0x00 */ u8* start;
/* 0x04 */ u8* end;
/* 0x08 */ u8* dest;
} DmaTable;
typedef struct UseItemStruct {
@ -245,7 +245,7 @@ typedef struct Npc {
/* 0x0AC */ u8 alpha;
/* 0x0AD */ u8 alpha2; ///< Multiplied with Npc::alpha
/* 0x0AE */ char unk_AE[2];
/* 0x0B0 */ AnimID** extraAnimList;
/* 0x0B0 */ AnimID* extraAnimList;
/* 0x0B4 */ s8 palSwapType; // 0..4 inclusive
/* 0x0B5 */ s8 palSwapPrevType;
/* 0x0B6 */ s8 dirtyPalettes;
@ -394,7 +394,7 @@ typedef struct TriggerBlueprint {
/* 0x10 */ char unk_10[4];
/* 0x14 */ s32 unk_tr_2C;
/* 0x18 */ s32 hasPlayerInteractPrompt;
/* 0x1C */ s32 itemList;
/* 0x1C */ s32* itemList;
} TriggerBlueprint; // size = 0x20
typedef union X32 {
@ -776,7 +776,7 @@ typedef struct Camera {
/* 0x1D4 */ char unk_1D4[0x28];
/* 0x1FC */ void (*fpDoPreRender)(struct Camera*);
/* 0x200 */ void (*fpDoPostRender)(struct Camera*);
/* 0x204 */ Matrix4s* unkMatrix;
/* 0x204 */ Mtx* unkMatrix;
/* 0x208 */ s32 unk_208;
/* 0x20C */ Matrix4s* unkEffectMatrix;
/* 0x210 */ char unk_210[0x2];
@ -2511,4 +2511,13 @@ typedef struct CreditsUnkBeta {
/* 0x02 */ s16 size;
} CreditsUnkBeta; // size = 0x4
typedef struct GameMode {
/* 0x00 */ u16 flags;
/* 0x04 */ void (*init)(void);
/* 0x08 */ void (*step)(void);
/* 0x0C */ UNK_FUN_PTR(unk_0C);
/* 0x10 */ void (*render)(void);
/* 0x14 */ void (*renderAux)(void); ///< @see state_render_frontUI
} GameMode; // size = 0x18
#endif

View File

@ -15,13 +15,14 @@ f32 cosine(s16 arg0);
s32 strcmp(const char* str1, const char* str2);
void nuBoot(void);
void boot_idle(void);
void boot_idle(void* data);
void boot_main(void);
void is_debug_init(void);
f32 signF(f32 val);
s32 func_8002ACDC(void);
void func_8002D160(void);
void* heap_malloc(s32 size);
@ -108,6 +109,10 @@ void pause_handle_input(s32 buttonsPressed, s32 buttonsHeld);
void pause_cleanup(void);
// file menu stuff
void filemenu_init(s32);
void filemenu_cleanup(void);
void filemenu_update(void);
s32 func_80244BC4(void);
void filemenu_set_selected(MenuPanel* menu, s32 col, s32 row);
void filemenu_set_cursor_alpha(s32 arg0);
void filemenu_set_cursor_goal_pos(s32 windowIndex, s32 posX, s32 posY);
@ -132,6 +137,7 @@ void func_80258E14(void*);
void func_80254610(Actor*);
void func_800E315C(s32 colliderID);
f32 func_800E34D8(void);
void func_800E4AD8(s32 arg0);
f32 player_check_collision_below(f32, s32* colliderID);
@ -268,7 +274,6 @@ s32 sign(s32 value);
s32 func_800E0208(void);
s32 battle_heap_create(void);
void filemenu_init(s32);
s32 test_ray_zones(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, f32* hitY, f32* hitZ,
f32* hitDepth, f32* nx, f32* ny, f32* nz);
@ -448,7 +453,9 @@ s32 is_block_on_ground(Entity* block);
void set_animation(s32 actorID, s32, s32 animationIndex);
void set_animation_rate(s32 actorID, s32 partIndex, f32 rate);
void func_8011B7C0(u16, s32, s32);
ModelAnimator* get_animator_by_index(s32 arg0);
void init_enter_world_shared(void);
s16 update_enter_map_screen_overlay(s16* progress);
s32 update_exit_map_screen_overlay(s16* progress);
void set_screen_overlay_params_front(u8, f32);
void set_screen_overlay_params_back(u8, f32);
void set_screen_overlay_alpha(s32, f32);
@ -512,12 +519,20 @@ void disable_npc_blur(Npc* npc);
void enable_partner_blur(void);
void disable_partner_blur(void);
void partner_initialize_data(void);
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by);
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz);
void add_vec2D_polar(f32* x, f32* y, f32 r, f32 theta);
//TODO -- remove these and use audio/public.h instead
enum AuResult bgm_set_track_volumes(s32 playerIndex, s16 trackVolSet);
enum AuResult bgm_set_variation(s32 playerIndex, s16 arg1);
void bgm_quiet_max_volume(void);
void bgm_reset_max_volume(void);
void bgm_reset_volume(void);
s32 bgm_init_music_players(void);
s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume);
void bgm_set_battle_song(s32, s32);
void bgm_push_battle_song(void);
@ -549,6 +564,8 @@ void create_part_shadow(s32 actorID, s32 partIndex);
void remove_part_shadow(s32 actorID, s32 partIndex);
void create_part_shadow_by_ref(s32 arg0, ActorPart* part);
void spawn_drops(Enemy* enemy);
void func_80266D6C(ActorPart*, s32);
char* int_to_string(s32, char*, s32);
@ -629,6 +646,9 @@ void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angl
void func_80138D88(s32, s32, s32, s32, f32);
void func_8013A4D0(void);
void btl_draw_ui(void);
void btl_restore_world_cameras(void);
void btl_popup_messages_draw_ui(void);
void btl_cam_set_target_pos(f32, f32, f32);
void btl_cam_unfreeze(void);
@ -643,6 +663,7 @@ s32 btl_check_player_defeated(void);
void btl_show_battle_message(s32 messageIndex, s32 duration);
void btl_update_ko_status(void);
void reset_actor_turn_info(void);
void startup_draw_prim_rect(s16 left, s16 top, s16 right, s16 bottom, u16 r, u16 g, u16 b, u16 a);
void btl_draw_prim_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 arg6, u16 arg7);
void reset_all_actor_sounds(Actor*);
void decrement_status_menu_disabled(void);
@ -772,10 +793,12 @@ typedef union {
s32 create_generic_entity_world(WorldArgs, WorldArgs);
void init_entity_models(void);
EntityModel* get_entity_model(s32 idx);
f32 phys_get_spin_history(s32 lag, s32* x, s32* y, s32* z);
void fold_update(u32, FoldType, s32, s32, s32, s32, s32);
s32 fold_appendGfx_component(s32, FoldImageRecPart*, u32, Matrix4f);
void func_8013A6E8(void);
s32 func_8013A704(s32);
void free_generic_entity(s32);
@ -802,24 +825,34 @@ void mdl_draw_hidden_panel_surface(Gfx** arg0, u16 treeIndex);
s32 func_8011CFBC(void);
void set_screen_overlay_center_worldpos(s32 idx, s32 posIdx, s32 x, s32 y, s32 z);
void* mdl_get_next_texture_address(s32);
s32 cancel_current_message(void);
void draw_msg(s32 msgID, s32 posX, s32 posY, s32 opacity, s32 palette, u8 style);
void get_background_color_blend(u8* r, u8* g, u8* b, u8* a);
s32 entity_base_block_idle(Entity* entity);
void add_SP(s32 amt);
s32 recover_hp(s32 amt);
s32 recover_fp(s32 amt);
void entity_set_render_script(Entity* entity, u32* commandList);
s32 entity_can_collide_with_jumping_player(Entity* entity);
void entity_base_block_init(Entity* entity);
s32 entity_start_script(Entity* entity);
void init_item_entity_list(void);
void init_script_list(void);
void init_entity_data(void);
void init_trigger_list(void);
void partner_init_after_battle(s32 arg0);
void load_map_script_lib(void);
void remove_item_entity_by_index(s32 index);
void set_entity_commandlist(Entity* entity, s32* entityScript);
s32 func_800DFCF4(void);
void func_800EF300(void);
void func_800EF314(void);
void func_800EF43C(void);
void func_800EF3E4(void);
void func_80268858(void);
void func_80269118(void);
s32 func_80268224(s32);
void func_800EF300(void);
void enable_player_shadow(void);
s32 get_msg_lines(s32 messageID);
void set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void* drawContents, void* drawContentsArg, s8 parent);
@ -851,6 +884,8 @@ void btl_cam_set_zoom(s16);
void btl_cam_move(s16);
void func_8024E60C(void);
void initialize_battle(void);
void dispatch_event_actor(Actor*, s32);
s32 dispatch_damage_event_actor_1(Actor* actor, s32 damageAmount, s32 event);
@ -905,10 +940,13 @@ void player_reset_data(void);
void partner_reset_data(void);
s32 has_valid_conversation_npc(void);
s32 func_800E06D8(void);
void func_800E01DC(void);
void func_800E4F10(void);
void func_800E5520(void);
void func_800E6B68(void);
void func_800E9810(void);
void func_800E983C(void);
void func_800E984C(void);
s32 func_800E9860(void);
void func_800E98C4(void);
void func_800E98EC(void);
@ -995,6 +1033,7 @@ void set_max_SP(s8);
void sync_status_menu(void);
void create_cameras_a(void);
void func_80045AC0(void);
void func_8005AF84(void);
void func_8005DECC(Npc*, s32, s32*, f32, f32, s32, s32);
void func_8005DFD4(Npc*);
void func_8005E12C(Npc*);
@ -1044,6 +1083,7 @@ void clear_entity_models(void);
void bind_entity_model_setupGfx(s32 idx, void* setupGfxCallbackArg0, void (*fpSetupGfxCallback)(void*));
void clear_animator_list(void);
void clear_model_data(void);
void init_sprite_shading_data(void);
void clear_sprite_shading_data(void);
void clear_character_set(void);
void clear_game_modes(void);
@ -1059,6 +1099,18 @@ f32 get_player_normal_pitch(void);
void partner_kill_ability_script(void);
void func_800EF3D4(s32);
void func_80116698(void);
void func_8011B950(u16, s32, s32, s32);
void backup_map_collision_data(void);
void reset_status_menu(void);
void btl_save_world_cameras(void);
void load_battle_section(void);
void btl_update(void);
void update_item_entities(void);
void func_80116674(void);
void restore_map_collision_data(void);
void load_model_textures(struct ModelNode* model, s32 romOffset, s32 size);
void calculate_model_sizes(void);
#endif

View File

@ -146,6 +146,7 @@ typedef ModelTreeInfo ModelTreeInfoList[0x200];
extern ModelTreeInfoList* mdl_currentModelTreeNodeInfo;
extern ModelList* gCurrentModels;
void init_model_data(void);
void update_model_animator(s32);
void update_model_animator_with_transform(s32 animatorID, Mtx* mtx);
void set_mdl_custom_gfx_set(Model*, s32, u32);
@ -156,6 +157,9 @@ void animator_update_model_transforms(ModelAnimator* animator, Mtx* rootTransfor
void render_animated_model(s32 animatorID, Mtx* rootTransform);
void animator_node_update_model_transform(ModelAnimator* animator, f32 (*flipMtx)[4], AnimatorNode* node,
Mtx* rootTransform);
void init_generic_entity_list(void);
ModelAnimator* get_animator_by_index(s32 animModelID);
void reset_animator_list(void);
void delete_model_animator_node(AnimatorNode* node);
void delete_model_animator_nodes(ModelAnimator* animator);
void delete_model_animator(ModelAnimator* animator);
@ -164,4 +168,9 @@ void appendGfx_animator(ModelAnimator* animator);
ModelAnimator* set_animator_render_callback(s32 animModelID, s32 callbackArg, void (*callbackFunc)(void*));
void reload_mesh_animator_tree(ModelAnimator* animator);
s32 step_mesh_animator(ModelAnimator* animator);
void set_custom_gfx_builders(s32 customGfxIndex, ModelCustomGfxBuilderFunc pre, ModelCustomGfxBuilderFunc post);
void mdl_make_local_vertex_copy(s32 arg0, u16 treeIdx, s32);
void play_model_animation_starting_from(s32 index, s32 animPos, s32 framesToSkip);
#endif

View File

@ -434,7 +434,7 @@ void update_npcs(void);
f32 npc_get_render_yaw(Npc* npc);
void appendGfx_npc(Npc* npc);
void appendGfx_npc(void* data);
/// Renders all NPCs.
void render_npcs(void);
@ -452,7 +452,7 @@ void disable_npc_shadow(Npc* npc);
void update_npc_blur(Npc* npc);
void appendGfx_npc_blur(Npc* npc);
void appendGfx_npc_blur(void* data);
void npc_enable_collisions(void);
@ -649,4 +649,6 @@ Enemy* get_enemy(s32 npcID);
/// @returns pointer to Enemy struct, if one is found. Otherwise, NULL.
Enemy* get_enemy_safe(s32 npcID);
void set_npc_sprite(Npc* npc, s32 anim, AnimID* extraAnimList);
#endif

View File

@ -31,7 +31,7 @@ extern s32 D_800DC4EC;
extern s32 D_800DC4F0;
extern struct Battle* D_800DC4F4;
extern s32 D_800DC4F8;
extern s32 gBattleDmaDest;
extern u8* gBattleDmaDest;
extern ActionCommandStatus gActionCommandStatus;

View File

@ -1,10 +1,6 @@
#include "common.h"
#include "nu/nusys.h"
void init_enter_world_shared(void);
s16 update_enter_map_screen_overlay(s16* progress);
s32 update_exit_map_screen_overlay(s16* progress);
void set_map_change_fade_rate(s16 fadeRate) {
gMapTransitionFadeRate = fadeRate;
}

View File

@ -6,7 +6,7 @@
#include "battle/battle.h"
#include "model.h"
extern s32* D_800DC064;
extern StageListRow* D_800DC064;
extern s16 D_802809F6;
extern s16 D_802809F8;
@ -205,7 +205,7 @@ void btl_state_update_normal_start(void) {
if (D_800DC064 == NULL) {
stage = battle->stage;
} else {
stage = D_800DC064[1];
stage = D_800DC064->stage;
}
battleStatus->currentStage = stage;
@ -2048,7 +2048,7 @@ void btl_state_update_end_battle(void) {
if (D_800DC064 == NULL) {
stage = blah->stage;
} else {
stage = D_800DC064[1];
stage = D_800DC064->stage;;
}
if (stage->postBattle == NULL) {
gBattleState2 = BATTLE_STATE2_UNK_4;
@ -4284,7 +4284,7 @@ void btl_state_update_end_demo_battle(void) {
if (D_800DC064 == NULL) {
stage = blah->stage;
} else {
stage = D_800DC064[1]; // TODO cleanup
stage = D_800DC064->stage;
}
if (stage->postBattle == NULL) {

View File

@ -694,7 +694,7 @@ void func_8023ED5C(void) {
if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
renderTaskPtr->appendGfxArg = actor;
renderTaskPtr->appendGfx = appendGfx_player_actor_blur;
renderTaskPtr->appendGfx = (void (*) (void*)) appendGfx_player_actor_blur;
renderTaskPtr->distance = actor->currentPos.z;
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
queue_render_task(renderTaskPtr);

View File

@ -203,7 +203,7 @@ ApiStatus func_802535B4(Evt* script, s32 isInitialCall) {
}
ApiStatus OverrideBattleDmaDest(Evt* script, s32 isInitialCall) {
gBattleDmaDest = evt_get_variable(script, *script->ptrReadPos);
gBattleDmaDest = (u8*) evt_get_variable(script, *script->ptrReadPos);
return ApiStatus_DONE2;
}
@ -214,7 +214,7 @@ ApiStatus LoadBattleDmaData(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
if (gBattleDmaDest == 0) {
if (gBattleDmaDest == NULL) {
dma_copy(moveScript->start, moveScript->end, moveScript->dest);
} else {
dma_copy(moveScript->start, moveScript->end, gBattleDmaDest);

View File

@ -491,7 +491,7 @@ void func_80268C9C(void) {
void func_80268E88(void) {
ActionCommandStatus* actionCmdStatus = &gActionCommandStatus;
actionCmdStatus->unk_00 = create_generic_entity_frontUI(func_80268938, func_80268AF8);
actionCmdStatus->unk_00 = create_generic_entity_frontUI((s32 (*)(void)) func_80268938, func_80268AF8);
actionCmdStatus->actionCommandID = 0;
}

View File

@ -17,8 +17,6 @@ ApiStatus MerleeStopFX(Evt* script, s32 isInitialCall);
ApiStatus PlayMerleeGatherFX(Evt* script, s32 isInitialCall);
ApiStatus PlayMerleeOrbFX(Evt* script, s32 isInitialCall);
void spawn_drops(Enemy* enemy);
s32 D_80077C40 = 0;
EvtScript D_80077C44 = {

View File

@ -4,7 +4,6 @@
extern s32 D_8014B7F0;
void spawn_drops(Enemy* enemy);
INCLUDE_ASM(s32, "23680", spawn_drops);
s32 get_coin_drop_amount(Enemy* enemy) {

View File

@ -1,11 +1,11 @@
#include "common.h"
extern void(*obfuscated_create_audio_system)(void);
extern u8 obfuscated_create_audio_system[];
void func_80200000(void) {
u32 t0 = 0xAC29007B;
u32 t1 = 0xB00006A8;
void(*create_audio_system)(void) = &obfuscated_create_audio_system;
void (*create_audio_system)(void) = (void (*)(void)) obfuscated_create_audio_system;
while (IO_READ(PI_STATUS_REG) & 3);

View File

@ -3,12 +3,12 @@
#include "ld_addrs.h"
#include "mips.h"
extern s32 obfuscated_general_heap_create[];
extern u8 obfuscated_general_heap_create[];
void func_802AE000_316C00(void) {
s32(*readFunc)(OSPiHandle*, u32, u32*) = osEPiReadIo;
s32 seed = 0x3C016C07 + 0xFEFEFEF;
HeapNode*(*generalHeapCreate)(void) = obfuscated_general_heap_create; // general_heap_create - 0xFEFEFEF
HeapNode*(*generalHeapCreate)(void) = (HeapNode* (*)(void)) obfuscated_general_heap_create; // general_heap_create - 0xFEFEFEF
u32 hash = 0;
u32 thisInsn;
u32* it;
@ -19,8 +19,8 @@ void func_802AE000_316C00(void) {
prevInsn = 0;
for (it = _316A70_ROM_START; it < _316A70_ROM_END; it++) {
readFunc(nuPiCartHandle, it, &thisInsn);
for (it = (u32*) _316A70_ROM_START; it < (u32*) _316A70_ROM_END; it++) {
readFunc(nuPiCartHandle, (u32) it, &thisInsn);
hash += LOWER(thisInsn) + UPPER(thisInsn);
if (OPCODE(prevInsn) == LUI && (OPCODE(thisInsn) == ADDIU || OPCODE(thisInsn) == LW)) {

View File

@ -2,12 +2,12 @@
#include "ld_addrs.h"
#include "mips.h"
extern s32 obfuscated_load_engine_data[];
extern u8 obfuscated_load_engine_data[];
void func_80200080(void) {
s32 seed = 0x3C01A775;
u32 thisInsn = 0xB0018FFC;
HeapNode*(*load_engine_data)(s32) = obfuscated_load_engine_data; // load_engine_data - ????????
HeapNode*(*load_engine_data)(s32) = (HeapNode* (*)(s32)) obfuscated_load_engine_data; // load_engine_data - ????????
s32 hash = 0;
u32 prevInsn;
u32* it;
@ -17,7 +17,7 @@ void func_80200080(void) {
prevInsn = 0;
for (it = _3169F0_ROM_START; it < _3169F0_ROM_END; it++) {
for (it = (u32*) _3169F0_ROM_START; it < (u32*) _3169F0_ROM_END; it++) {
while (IO_READ(PI_STATUS_REG) & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY));
thisInsn = IO_READ(it + 0x4000000); // ???

View File

@ -8,7 +8,7 @@ extern s32 obfuscated_battle_heap_create[];
void func_802AE000(void) {
s32(*readFunc)(OSPiHandle*, u32, u32*) = osEPiReadIo;
s32 seed = 0x33F50000;
UNK_FUN_PTR(battle_heap_create) = obfuscated_battle_heap_create;
s32 (*battle_heap_create)(void) = (s32 (*) (void)) obfuscated_battle_heap_create;
u32 hash = 0;
u32 thisInsn;
u32* it;
@ -19,8 +19,8 @@ void func_802AE000(void) {
prevInsn = 0;
for (it = _316C00_ROM_START; it < _316C00_ROM_END; it++) {
readFunc(nuPiCartHandle, it, &thisInsn);
for (it = (u32*) _316C00_ROM_START; it < (u32*) _316C00_ROM_END; it++) {
readFunc(nuPiCartHandle, (u32) it, &thisInsn);
hash += LOWER(thisInsn) + UPPER(thisInsn);
if (OPCODE(prevInsn) == LUI && (OPCODE(thisInsn) == ADDIU || OPCODE(thisInsn) == LW)) {

View File

@ -159,11 +159,9 @@ s32 D_8008EEC0[] = { 0, 1, 2, 3, 4, 9, 6, 7, 8, 5, 10, 11 };
s32 D_8008EEF0[] = { 0, 1, 2, 3, 4, 0, 6, 7, 8, 5, 0, 0 };
const char D_800989A0[] = "なし";
s32 gPartnerPopupProperties[][4] = {
PartnerPopupProperties gPartnerPopupProperties[] = {
[PARTNER_NONE] {
&D_800989A0,
(s32) "なし",
0x00000000,
0x00000000,
0x00000000,

View File

@ -7,7 +7,6 @@ extern f32 JumpedOnSwitchX;
extern f32 JumpedOnSwitchZ;
extern f32 D_8010C984;
void func_800E315C(s32 colliderID);
s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 arg2);
s32 phys_check_interactable_collision(void);
void phys_save_ground_pos(void);

View File

@ -132,14 +132,15 @@ s32 setup_partner_popup(PopupMenu* menu) {
for (i = 1; i < ARRAY_COUNT(D_8008EEC0); i++) {
s32 partnerID = D_8008EEC0[i];
if (playerData->partners[partnerID].enabled && partnerID != PARTNER_GOOMPA) {
s32* properties = gPartnerPopupProperties[partnerID];
PartnerPopupProperties* properties = &gPartnerPopupProperties[partnerID];
menu->ptrIcon[optionCount] = wPartnerHudScripts[partnerID];
menu->userIndex[optionCount] = partnerID;
menu->enabled[optionCount] = TRUE;
menu->nameMsg[optionCount] = properties[0];
menu->descMsg[optionCount] = properties[2];
menu->nameMsg[optionCount] = properties->nameMsg;
menu->descMsg[optionCount] = properties->worldDescMsg;
menu->value[optionCount] = playerData->partners[partnerID].level;
if (playerData->currentPartner == partnerID) {
menu->enabled[optionCount] = FALSE;

View File

@ -15,7 +15,7 @@ extern s32 D_800F8000[];
extern s16 D_8010CD10;
extern s16 D_8010CD12;
extern s32 DigitHudScripts[10];
extern HudScript* DigitHudScripts[10];
extern HudScript HES_StatusHP;
extern HudScript HES_StatusHeart;

View File

@ -2,10 +2,13 @@
#include "camera.h"
#include "nu/nusys.h"
#include "hud_element.h"
#include "camera.h"
// D_8009A5EC bss here
f32 D_8009A5EC;
Camera* initialize_next_camera(CameraInitData* data);
void render_models(void);
void execute_render_tasks(void);
void render_item_entities(void);
void update_cameras(void) {
s32 i;

View File

@ -1,5 +1,6 @@
#include "model.h"
#include "animation_script.h"
#include "model.h"
AnimScript gAnimScriptDefault = {
AS_WAIT, 60,
@ -1014,8 +1015,8 @@ void play_model_animation(s32 index, s16* animPos) {
if (animator->animationBuffer != NULL) {
animPos = ((s32)animPos & 0xFFFFFF) + (s32)animator->animationBuffer; // TODO: array access?
}
animator->animReadPos = (s16*)animPos;
animator->savedReadPos = (s16*)animPos;
animator->animReadPos = animPos;
animator->savedReadPos = animPos;
animator->treeIndexPos = 0;
animator->nextUpdateTime = 1.0f;
}
@ -1026,11 +1027,11 @@ void play_model_animation_starting_from(s32 index, s32 animPos, s32 framesToSkip
s32 i;
if (animator->animationBuffer != NULL) {
animPos = (animPos & 0xFFFFFF) + (s32)animator->animationBuffer; // TODO: array access?
animPos = ((s32)animPos & 0xFFFFFF) + (s32)animator->animationBuffer; // TODO: array access?
}
animator->animReadPos = (s16*)animPos;
animator->savedReadPos = (s16*)animPos;
animator->animReadPos = (s16*) animPos;
animator->savedReadPos =(s16*) animPos;
animator->treeIndexPos = 0;
animator->nextUpdateTime = 1.0f;

View File

@ -6,15 +6,6 @@
#include "hud_element.h"
#include "effects.h"
typedef struct GameMode {
/* 0x00 */ u16 flags;
/* 0x04 */ void (*init)(void);
/* 0x08 */ void (*step)(void);
/* 0x0C */ UNK_FUN_PTR(unk_0C);
/* 0x10 */ void (*render)(void);
/* 0x14 */ void (*renderAux)(void); ///< @see state_render_frontUI
} GameMode; // size = 0x18
typedef struct Fog {
/* 0x00 */ s32 enabled;
/* 0x04 */ s32 r;
@ -2840,15 +2831,15 @@ GameMode* set_next_game_mode(GameMode* arg0) {
return gameMode;
}
GameMode* set_game_mode_slot(s32 i, GameMode* arg0) {
GameMode* set_game_mode_slot(s32 i, GameMode* mode) {
GameMode* gameMode = &gMainGameState[i];
ASSERT(i < ARRAY_COUNT(gMainGameState));
gameMode->flags = 1 | 2;
gameMode->init = arg0->init;
gameMode->step = arg0->step;
gameMode->render = arg0->render;
gameMode->init = mode->init;
gameMode->step = mode->step;
gameMode->render = mode->render;
gameMode->unk_0C = NULL;
if (gameMode->init == NULL) gameMode->init = state_delegate_NOP;
if (gameMode->step == NULL) gameMode->step = state_delegate_NOP;
@ -4311,7 +4302,7 @@ void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, Vtx** baseVtx, s32* gfxCou
}
}
// void mdl_local_gfx_update_vtx_pointers(Gfx* nodeDlist, Vtx* baseVtx, Gfx* arg2, Vtx* arg3);
void mdl_local_gfx_update_vtx_pointers(Gfx* nodeDlist, Vtx* baseVtx, Gfx* arg2, Vtx* arg3);
INCLUDE_ASM(s32, "a5dd0_len_114e0", mdl_local_gfx_update_vtx_pointers);
void mdl_local_gfx_copy_vertices(Vtx* from, s32 num, Vtx* to) {
@ -4322,6 +4313,7 @@ void mdl_local_gfx_copy_vertices(Vtx* from, s32 num, Vtx* to) {
}
}
void mdl_make_local_vertex_copy(s32 arg0, u16 treeIdx, s32 arg2) {
s32 numVertices;
Vtx* baseVtx;

View File

@ -121,7 +121,6 @@ extern s32 b_area_kzn2_lava_bud_idleAnimations_fiery[];
extern s32 N(defenseTable_fiery)[];
extern s32 b_area_kzn2_lava_bud_defenseTable_fiery[];
s32 bgm_init_music_players(void);
API_CALLABLE(SetAnimatorFlags);
API_CALLABLE(GetAnimatedPositionByTreeIndex);
API_CALLABLE(GetAnimatedRotationByTreeIndex);

View File

@ -48,9 +48,9 @@ StageList N(stageTable) = {
};
#define PIRANHA_DMA_ENTRY(name) \
{ (s32) world_model_anim_kzn_##name##_ROM_START,\
(s32) world_model_anim_kzn_##name##_ROM_END,\
(s32) world_model_anim_kzn_##name##_VRAM }
{ world_model_anim_kzn_##name##_ROM_START,\
world_model_anim_kzn_##name##_ROM_END,\
world_model_anim_kzn_##name##_VRAM }
DmaTable N(dmaTable)[] = {
PIRANHA_DMA_ENTRY(00),

View File

@ -6,7 +6,7 @@
#include "sprite.h"
extern s32 D_800DC060;
extern Stage* D_800DC064;
extern StageListRow* D_800DC064;
BattleArea gBattleAreas[] = {
[BTL_AREA_KMR_PART_1] = {

View File

@ -323,6 +323,18 @@ typedef struct FormationRow {
typedef FormationRow Formation[];
typedef struct StaticFormationActor {
/* 0x00 */ char unk_00[0x4];
} StaticFormationActor; // size = ??
typedef struct StaticFormationEntry {
/* 0x00 */ char* sjisName;
/* 0x04 */ s32 numActors;
/* 0x08 */ StaticFormationActor* actors;
/* 0x0C */ char* stageName;
/* 0x10 */ char unk_10[0x4];
} StaticFormationEntry; // size = 0x20
typedef struct Stage {
/* 0x00 */ char* texture;
/* 0x04 */ const char* shape;
@ -351,7 +363,9 @@ typedef Battle BattleList[];
typedef struct StageListRow {
/* 0x00 */ const char* id; ///< Map ID.
/* 0x04 */ Stage* stage;
} StageList[]; // size = 0x08 * n
} StageListRow; // size = 0x08
typedef StageListRow StageList[];
typedef struct BattleArea {
/* 0x00 */ char* name; ///< JP debug name.

View File

@ -42,7 +42,7 @@ Gfx N(displayList)[] = {
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), (s32) &N(displayList), 0x00000002, 0x00000000,
};
EvtScript N(main) = {

View File

@ -1,7 +1,7 @@
#include "dizzy_dial.h"
#include "camera.h"
static s32* D_802A1CD0;
static s32 D_802A1CD0;
#include "ItemRefund.inc.c"

View File

@ -41,7 +41,7 @@ Gfx N(displayList)[] = {
};
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), &N(displayList), 0x00000002, 0x00000000,
0x00000004, 0x0000000D, 0x00000001, sizeof(N(displayList)) / sizeof(s32), (s32) &N(displayList), 0x00000002, 0x00000000,
};
EvtScript N(main) = {

View File

@ -130,12 +130,12 @@ Gfx N(frame4_displayList)[] = {
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000001, 0x00000002, (s32) &N(frame2_displayList),
0x00000001, 0x00000002, (s32) &N(frame3_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, sizeof(N(frame4_displayList)) / sizeof(s32), &N(frame4_displayList),
0x00000001, sizeof(N(frame4_displayList)) / sizeof(s32), (s32) &N(frame4_displayList),
0x00000002, 0x00000000,
};
@ -147,7 +147,7 @@ EvtScript N(main) = {
EVT_CALL(SetAnimation, 0, 0, 65558)
EVT_CALL(PlaySound, 1018)
EVT_WAIT(3)
EVT_CALL(CreateVirtualEntity, LVarA, battle_item_egg_missile_modelCommandList)
EVT_CALL(CreateVirtualEntity, LVarA, (s32) battle_item_egg_missile_modelCommandList)
EVT_CALL(GetActorPos, 0, LVar0, LVar1, LVar2)
EVT_ADD(LVar0, 20)
EVT_ADD(LVar1, 42)

View File

@ -12,10 +12,10 @@ static s32 _pad = 0;
#include "battle/item/pebble.pal.inc.c"
Vtx N(model)[] = {
{ .v = { -16, -16, 0, FALSE, 0, 0, 0, 0, 0, 255 } },
{ .v = { 15, -16, 0, FALSE, 1024, 0, 0, 0, 0, 255 } },
{ .v = { 15, 15, 0, FALSE, 1024, 1024, 0, 0, 0, 255 } },
{ .v = { -16, 15, 0, FALSE, 0, 1024, 0, 0, 0, 255 } },
{ .v = { { -16, -16, 0 }, FALSE, { 0, 0 }, { 0, 0, 0, 255 }, } },
{ .v = { { 15, -16, 0 }, FALSE, { 1024, 0 }, { 0, 0, 0, 255 }, } },
{ .v = { { 15, 15, 0 }, FALSE, { 1024, 1024 }, { 0, 0, 0, 255 }, } },
{ .v = { { -16, 15, 0 }, FALSE, { 0, 1024 }, { 0, 0, 0, 255 }, } },
};
Gfx N(displayList)[] = {

View File

@ -314,24 +314,24 @@ Gfx N(frame3_displayList)[] = {
s32 N(modelCommandList)[] = {
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000001, 0x00000003, (s32) &N(frame2_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000001, 0x00000002, (s32) &N(frame3_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, (s32) &N(frame2_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000001, 0x00000002, (s32) &N(frame3_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000002, 0x00000000,
0x00000004, 0x0000000D,
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000002, &N(frame3_displayList),
0x00000001, 0x00000002, &N(frame1_displayList),
0x00000001, 0x00000003, &N(frame2_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000001, 0x00000002, (s32) &N(frame3_displayList),
0x00000001, 0x00000002, (s32) &N(frame1_displayList),
0x00000001, 0x00000003, (s32) &N(frame2_displayList),
0x00000002, 0x00000000,
};

View File

@ -104,7 +104,7 @@ void initialize_collision(void) {
void load_map_hit_asset(void) {
u32 assetSize;
MapSettings* map = get_current_map_settings();
void* compressedData = load_asset_by_name(&wMapHitName, &assetSize);
void* compressedData = load_asset_by_name(wMapHitName, &assetSize);
HitFile* uncompressedData = heap_malloc(assetSize);
decode_yay0(compressedData, uncompressedData);

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "stdlib/stdarg.h"
#include "PR/os_internal_thread.h"
typedef struct {
/* 0x000 */ OSThread thread;

View File

@ -14,7 +14,6 @@ extern int COMBINED_ALPHA;
extern int SHADE;
extern int TEXEL0_ALPHA;
void init_sprite_shading_data(void);
void appendGfx_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s32 alpha,
f32 shadowX, f32 shadowY, f32 shadowZ,
s32 shadowR, s32 shadowG, s32 shadowB,

View File

@ -27,7 +27,7 @@ void flame_render(EffectInstance* effect) {
f32 outZ;
f32 outS;
shim_transform_point(gCameras[gCurrentCameraID].perspectiveMatrix[0], data->pos.x, data->pos.y, data->pos.z, 1.0f, &outX, &outY, &outZ, &outS);
shim_transform_point(gCameras[gCurrentCameraID].perspectiveMatrix, data->pos.x, data->pos.y, data->pos.z, 1.0f, &outX, &outY, &outZ, &outS);
outDist = outZ + 5000;
if (outDist < 0) {

View File

@ -47,7 +47,7 @@ ApiStatus MakeNpcs(Evt* script, s32 isInitialCall) {
switch (script->functionTemp[0]) {
case 0:
make_npcs(evt_get_variable(script, *args++), gGameStatusPtr->mapID, evt_get_variable(script, *args++));
make_npcs(evt_get_variable(script, *args++), gGameStatusPtr->mapID, (s32*) evt_get_variable(script, *args++));
script->functionTemp[0] = 1;
break;
case 1:

View File

@ -3,6 +3,7 @@
#include "ld_addrs.h"
#include "animation_script.h"
#include "entity.h"
#include "model.h"
extern Gfx Entity_YellowBlock_Render[];
extern Gfx Entity_RedBlock_Render[];

View File

@ -3,6 +3,7 @@
#include "entity.h"
#include "animation_script.h"
#include "ld_addrs.h"
#include "model.h"
extern Gfx Entity_RenderNone[];
extern AnimScript Entity_CymbalPlant_AnimationIdle;

View File

@ -222,7 +222,7 @@ s32 step_entity_model_commandlist(EntityModel* entityModel) {
imageData = entityModel->gfx.imageData;
entityModel->nextFrameTime = *curPos++;
imageData->raster = (u8*)*curPos++;
imageData->defaultPal = (u8*)*curPos++;
imageData->defaultPal = (PAL_PTR) *curPos++;
imageData->width = *curPos++;
imageData->height = *curPos++;
entityModel->cmdListReadPos = curPos;
@ -880,11 +880,11 @@ s32 create_generic_entity_world(void (*updateFunc)(void), void (*drawFunc)(void)
newDynEntity->flags = ENTITY_FLAGS_HIDDEN | ENTITY_FLAGS_DRAW_IF_CLOSE_HIDE_MODE1;
newDynEntity->update = updateFunc;
if (updateFunc == NULL) {
newDynEntity->update = &stub_generic_entity_delegate;
newDynEntity->update = stub_generic_entity_delegate;
}
newDynEntity->draw = drawFunc;
if (drawFunc == NULL) {
newDynEntity->draw = &stub_generic_entity_delegate;
newDynEntity->draw = stub_generic_entity_delegate;
}
if (gGameStatusPtr->isBattle) {
@ -911,11 +911,11 @@ s32 create_generic_entity_frontUI(void (*updateFunc)(void), void (*drawFunc)(voi
newDynEntity->flags = ENTITY_FLAGS_HIDDEN | ENTITY_FLAGS_DRAW_IF_CLOSE_HIDE_MODE1 | ENTITY_FLAGS_HAS_DYNAMIC_SHADOW;
newDynEntity->update = updateFunc;
if (updateFunc == NULL) {
newDynEntity->update = &stub_generic_entity_delegate;
newDynEntity->update = stub_generic_entity_delegate;
}
newDynEntity->draw = drawFunc;
if (drawFunc == NULL) {
newDynEntity->draw = &stub_generic_entity_delegate;
newDynEntity->draw = stub_generic_entity_delegate;
}
if (gGameStatusPtr->isBattle) {

View File

@ -410,7 +410,7 @@ ApiStatus LoadSettings(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 id = evt_get_variable(script, *args++);
Camera* camera = &gCameras[id];
CameraControlSettings* settings = evt_get_variable(script, *args++);
CameraControlSettings* settings = (CameraControlSettings*) evt_get_variable(script, *args++);
camera->controlSettings = *settings;
return ApiStatus_DONE2;

View File

@ -659,12 +659,16 @@ ApiStatus evt_handle_divideF(Evt* script) {
}
ApiStatus evt_handle_set_int_buffer_ptr(Evt* script) {
script->buffer = evt_get_variable(script, *script->ptrReadPos);
Bytecode* args = script->ptrReadPos;
script->buffer = (s32*) evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
ApiStatus evt_handle_set_float_buffer_ptr(Evt* script) {
script->buffer = evt_get_variable(script, *script->ptrReadPos);
Bytecode* args = script->ptrReadPos;
script->buffer = (s32*) evt_get_variable(script, *args++);
return ApiStatus_DONE2;
}
@ -956,13 +960,17 @@ ApiStatus evt_handle_exec1_get_id(Evt* script) {
}
ApiStatus evt_handle_exec_wait(Evt* script) {
start_child_script(script, evt_get_variable(script, *script->ptrReadPos), 0);
Bytecode* args = script->ptrReadPos;
start_child_script(script, (EvtScript*) evt_get_variable(script, *args++), 0);
script->currentOpcode = 0;
return ApiStatus_FINISH;
}
ApiStatus evt_handle_jump(Evt* script) {
script->ptrFirstLine = (Bytecode*)evt_get_variable(script, *script->ptrReadPos);
Bytecode* args = script->ptrReadPos;
script->ptrFirstLine = (Bytecode*) evt_get_variable(script, *args++);
restart_script(script);
return ApiStatus_DONE2;
}
@ -1344,7 +1352,7 @@ s32 func_802C73B8(Evt* script) {
return 1;
}
s32 evt_execute_next_command(Evt *script) {
s32 evt_execute_next_command(Evt* script) {
while (TRUE) {
s32 status = ApiStatus_DONE2;
s32* lines;
@ -2016,7 +2024,7 @@ Bytecode* evt_find_label(Evt* script, s32 arg1) {
s32 i;
if (arg1 < EVT_LIMIT) {
return arg1;
return (Bytecode*) arg1;
}
for (i = 0; i < 0x10; i++) {

View File

@ -4,7 +4,6 @@
#include "world/partners.h"
ApiStatus PollMusicEvents(Evt* script, s32 isInitialCall);
AuResult bgm_set_track_volumes(s32 playerIndex, s16 trackVolSet);
extern MusicEvent* MusicEventList;
extern s32 D_802DB7D4; // unused?

View File

@ -441,7 +441,7 @@ ApiStatus PlayEffect(Evt* script, s32 isInitialCall) {
fx_lens_flare(iVar1, fVar2, fVar3, fVar4, iVar5);
break;
case EFFECT_GOT_ITEM_OUTLINE:
fx_got_item_outline(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
fx_got_item_outline(iVar1, fVar2, fVar3, fVar4, fVar5, (EffectInstance**) &sp34);
evt_set_variable(script, a6, sp34);
break;
case EFFECT_SPIKY_WHITE_AURA:
@ -451,7 +451,7 @@ ApiStatus PlayEffect(Evt* script, s32 isInitialCall) {
fx_smoke_impact(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6, fVar7, iVar8);
break;
case EFFECT_DAMAGE_INDICATOR:
fx_damage_indicator(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7, (EffectInstance**)&sp30);
fx_damage_indicator(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7, (EffectInstance**) &sp30);
evt_set_variable(script, a8, sp30);
break;
case EFFECT_PURPLE_RING:

View File

@ -244,11 +244,11 @@ ApiStatus SetCustomGfx(Evt* script, s32 isInitialCall) {
ApiStatus SetCustomGfxBuilders(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var1 = evt_get_variable(script, *args++);
s32 var2 = evt_get_variable(script, *args++);
s32 var3 = evt_get_variable(script, *args++);
s32 index = evt_get_variable(script, *args++);
ModelCustomGfxBuilderFunc pre = (ModelCustomGfxBuilderFunc) evt_get_variable(script, *args++);
ModelCustomGfxBuilderFunc post = (ModelCustomGfxBuilderFunc) evt_get_variable(script, *args++);
set_custom_gfx_builders(var1, var2, var3);
set_custom_gfx_builders(index, pre, post);
return ApiStatus_DONE2;
}

View File

@ -86,11 +86,11 @@ ApiStatus LoadAnimatedModel(Evt* script, s32 isInitialCall) {
ApiStatus LoadAnimatedMesh(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 index = evt_get_variable(script, *args++);
s32 var1 = evt_get_variable(script, *args++);
StaticAnimatorNode** tree = (StaticAnimatorNode**) evt_get_variable(script, *args++);
AnimatedModel* animModel = (*gCurrentMeshAnimationListPtr)[index];
s32 animModelID = create_model_animator(0);
load_mesh_animator_tree(animModelID, var1);
load_mesh_animator_tree(animModelID, tree);
animModel->animModelID = animModelID;
animModel->pos.x = 0;
animModel->pos.y = 0;

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "npc.h"
#include "world/partners.h"
extern s32 wExtraPartnerID;
extern s32 wExtraPartnerNpcID;

View File

@ -1,6 +1,7 @@
#include "common.h"
#include "npc.h"
#include "sprite.h"
#include "world/partners.h"
extern Npc playerNpcData;
extern u16 D_802DB5B0;
@ -13,6 +14,8 @@ Npc* playerNpc = &playerNpcData;
void virtual_entity_list_render_world(void);
void virtual_entity_list_render_UI(void);
s32 ALT_load_entity_model(s32* cmdList);
s32 create_generic_entity_backUI(void (*updateFunc)(void), void (*drawFunc)(void));
ApiStatus HidePlayerShadow(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
@ -524,7 +527,6 @@ ApiStatus UseEntryHeading(Evt *script, s32 isInitialCall) {
f32 cosTheta;
f32 sinTheta;
f32 exitTangentFrac;
f32* blah;
sin_cos_deg(clamp_angle((*mapSettings->entryList)[gGameStatusPtr->entryID].yaw + 180.0f), &sinTheta, &cosTheta);
@ -532,8 +534,7 @@ ApiStatus UseEntryHeading(Evt *script, s32 isInitialCall) {
gPlayerStatus.position.x = (entryX + (var1 * sinTheta)) - (exitTangentFrac * cosTheta);
gPlayerStatus.position.z = (entryZ - (var1 * cosTheta)) - (exitTangentFrac * sinTheta);
blah = &script->varTable[5];
*blah = dist2D(gPlayerStatus.position.x, gPlayerStatus.position.z, entryX, entryZ) / var2;
script->varTableF[5] = dist2D(gPlayerStatus.position.x, gPlayerStatus.position.z, entryX, entryZ) / var2;
gPlayerStatus.flags |= PS_FLAGS_CAMERA_DOESNT_FOLLOW;
return ApiStatus_DONE2;
@ -548,7 +549,7 @@ ApiStatus UseExitHeading(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
MapSettings* mapSettings = get_current_map_settings();
f32* varTableVar5 = &script->varTable[5];
f32* varTableVar5 = &script->varTableF[5];
if (can_trigger_loading_zone()) {
s32 var1 = evt_get_variable(script, *args++);

View File

@ -81,6 +81,8 @@ BSS u32 gBattleMapVars[MAX_MAPVARS];
BSS s32 DoorModelsSwingCCW[3];
BSS u32 gBattleMapFlags[MAX_MAPFLAGS];
//s32 evt_execute_next_command(Evt* script);
void sort_scripts(void) {
s32 temp_a0;
s32 temp_a1;

View File

@ -117,8 +117,6 @@ BSS s32 filemenu_hudElemIDs[20];
BSS s32 filemenu_createfile_hudElems[4];
BSS u8 filemenu_filename[8];
s32 func_80244BC4(void);
void filemenu_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy) {
if (ulx <= -2688 || uly <= -2688 || lrx <= 0 || lry <= 0) {
return;

View File

@ -76,6 +76,8 @@ StateFunc* gameModeMap[] = {
// BSS
extern s16 gameMode;
GameMode* set_game_mode_slot(s32 i, GameMode* mode);
void set_game_mode(s16 mode) {
gameMode = mode;
set_game_mode_slot(0, gameModeMap[mode]);

View File

@ -8,7 +8,7 @@ void* general_heap_malloc(s32 size) {
return _heap_malloc(&heap_generalHead, size);
}
s32 general_heap_malloc_tail(s32 size) {
void* general_heap_malloc_tail(s32 size) {
return _heap_malloc_tail(&heap_generalHead, size);
}

View File

@ -207,7 +207,14 @@ extern HudScript HES_StatusCoin;
extern HudScript HES_Refund;
extern HudScript HES_MenuTimes;
extern s32 gPartnerPopupProperties[13][4];
typedef struct PartnerPopupProperties {
/* 0x00 */ s32 nameMsg;
/* 0x04 */ s32 unk_04;
/* 0x08 */ s32 worldDescMsg;
/* 0x0C */ s32 battleDescMsg;
} PartnerPopupProperties; // size = 0x10
extern PartnerPopupProperties gPartnerPopupProperties[13];
extern HudScript* wDisabledPartnerHudScripts[];
extern HudScript* wPartnerHudScripts[];

View File

@ -4,6 +4,8 @@
// TODO
#define nuSiSendMesg func_800602C8
void func_800602C8(s32, s32);
void nuContRmbForceStop(void) {
nuSiSendMesg(NU_CONT_RMB_FORCESTOP_MSG, NULL);
}

View File

@ -550,7 +550,7 @@ MoveData gMoveTable[] = {
.costBP = 3
},
{ // move 37: Unused_37
.nameMsg = "つうじょう",
.nameMsg = (s32) "つうじょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = 0,
@ -570,7 +570,7 @@ MoveData gMoveTable[] = {
.costBP = 4
},
{ // move 39: Unused_39
.nameMsg = "つうじょう",
.nameMsg = (s32) "つうじょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_4 | MOVE_DATA_FLAG_10000,
@ -580,7 +580,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move 3A: Unused_3A
.nameMsg = "つうじょう",
.nameMsg = (s32) "つうじょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = 0,
@ -630,7 +630,7 @@ MoveData gMoveTable[] = {
.costBP = 2
},
{ // move 3F: Unused_3F
.nameMsg = "つうじょう",
.nameMsg = (s32) "つうじょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_4 | MOVE_DATA_FLAG_10000,
@ -750,7 +750,7 @@ MoveData gMoveTable[] = {
.costBP = 1
},
{ // move 4B: Unused_4B
.nameMsg = "つうじょう",
.nameMsg = (s32) "つうじょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = 0,
@ -810,7 +810,7 @@ MoveData gMoveTable[] = {
.costBP = 5
},
{ // move 51: Unused_51
.nameMsg = "つうじょう",
.nameMsg = (s32) "つうじょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_4 | MOVE_DATA_FLAG_10000,
@ -1110,7 +1110,7 @@ MoveData gMoveTable[] = {
.costBP = 1
},
{ // move 6F: Unused_FinalGoompa
.nameMsg = "ファイナルクリジイ",
.nameMsg = (s32) "ファイナルクリジイ",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_2,
@ -1120,7 +1120,7 @@ MoveData gMoveTable[] = {
.costBP = 1
},
{ // move 70: Unused_FinalBobomb
.nameMsg = "ファイナルボムヘイ",
.nameMsg = (s32) "ファイナルボムヘイ",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_2,
@ -1550,7 +1550,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move 9B: Unused_LoneFool1
.nameMsg = "ひとりぼけ",
.nameMsg = (s32) "ひとりぼけ",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_2,
@ -1560,7 +1560,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move 9C: Unused_LoneFool2
.nameMsg = "ひとりぼけ",
.nameMsg = (s32) "ひとりぼけ",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_2,
@ -1570,7 +1570,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move 9D: Unused_LoneFool3
.nameMsg = "ひとりぼけ",
.nameMsg = (s32) "ひとりぼけ",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_2,
@ -1580,7 +1580,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move 9E: Unused_Mumble
.nameMsg = "むにゃむにゃ",
.nameMsg = (s32) "むにゃむにゃ",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_4,
@ -1590,7 +1590,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move 9F: Unused_Preach
.nameMsg = "せっきょう",
.nameMsg = (s32) "せっきょう",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_2,
@ -1600,7 +1600,7 @@ MoveData gMoveTable[] = {
.costBP = 0
},
{ // move A0: Unused_Awakening
.nameMsg = "かくせい",
.nameMsg = (s32) "かくせい",
.fullDescMsg = 0,
.shortDescMsg = 0,
.flags = MOVE_DATA_FLAG_SINGLE_TARGET | MOVE_DATA_FLAG_2,

View File

@ -716,7 +716,8 @@ f32 npc_get_render_yaw(Npc* npc) {
INCLUDE_ASM(f32, "npc", npc_get_render_yaw);
#endif
void appendGfx_npc(Npc* npc) {
void appendGfx_npc(void* data) {
Npc* npc = data;
Matrix4f mtx1, mtx2;
f32 renderYaw = npc_get_render_yaw(npc);
@ -957,7 +958,7 @@ void disable_npc_shadow(Npc* npc) {
}
}
void set_npc_sprite(Npc* npc, s32 anim, u32** extraAnimList) {
void set_npc_sprite(Npc* npc, s32 anim, AnimID* extraAnimList) {
ASSERT((npc->flags & NPC_FLAG_1000000) || spr_free_sprite(npc->spriteInstanceID) == 0);
npc->extraAnimList = extraAnimList;
@ -1054,7 +1055,7 @@ void npc_reload_all(void) {
if (!(npc->flags & NPC_FLAG_1000000) && (npc->palSwapType != 0)) {
npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16);
npc->paletteCount = 0;
while (npc->spritePaletteList[npc->paletteCount] != -1) {
while (npc->spritePaletteList[npc->paletteCount] != (PAL_PTR) -1) {
npc->paletteCount++;
}
npc->unk_C0 = spr_get_npc_color_variations(npc->currentAnim >> 16);

View File

@ -13,7 +13,7 @@ void nuBoot(void) {
}
#ifdef NON_EQUIVALENT
void boot_idle(void) {
void boot_idle(void* data) {
nuIdleFunc = NULL;
nuPiInit();

View File

@ -1,14 +1,14 @@
#include "common.h"
#include "nu/nusys.h"
s32 contRetrace();
s32 contReadData();
s32 contReadNW();
s32 contQuery();
s32 contRetrace(void);
s32 contReadData(void);
s32 contReadNW(void);
s32 contQuery(void);
u32 D_80093D20 = 0;
UNK_FUN_PTR(D_80093D24[4]) = {
s32(*D_80093D24[4])(void) = {
contRetrace,
contReadData,
contReadNW,
@ -19,7 +19,7 @@ s32 D_80093D34 = 0;
NUCallBackList nuContCallBack = {
NULL,
D_80093D24,
&D_80093D24,
0x100,
0,
};

View File

@ -10,7 +10,10 @@ s32 contRmbForceStopEndMesg(NUSiCommonMesg* mesg);
u32 nuContRmbSearchTime = 300;
s32 D_80093CE4[] = { contRmbRetrace, contRmbCheckMesg, contRmbStartMesg, contRmbStopMesg, contRmbForceStopMesg, contRmbForceStopEndMesg, NULL};
s32 (*D_80093CE4[])(NUSiCommonMesg*) = {
contRmbRetrace, contRmbCheckMesg, contRmbStartMesg, contRmbStopMesg, contRmbForceStopMesg, contRmbForceStopEndMesg,
NULL
};
NUCallBackList nuContRmbCallBack = {.next = NULL, .func = D_80093CE4, .majorNo = 0x300, .funcNum = 0};

View File

@ -18,7 +18,7 @@ extern s32 D_800B91D0;
extern u8 rspbootUcodeBuffer[];
extern OSMesgQueue D_800DA47C;
void nuGfxTaskMgr(void) {
void nuGfxTaskMgr(void* data) {
NUScTask* task;
s16* msg;
OSIntMask mask;
@ -70,15 +70,15 @@ void nuGfxTaskMgrInit(void) {
nuGfxTask[i].list.t.type = M_GFXTASK;
nuGfxTask[i].list.t.flags = 0;
dma_copy((u8* )0xB0000B70, (u8* )0xB0000C70, rspbootUcodeBuffer);
nuGfxTask[i].list.t.ucode_boot = rspbootUcodeBuffer;
nuGfxTask[i].list.t.ucode_boot = (u64*) rspbootUcodeBuffer;
nuGfxTask[i].list.t.ucode_boot_size = 0x100;
nuGfxTask[i].list.t.ucode_size = SP_UCODE_SIZE;
nuGfxTask[i].list.t.ucode_data_size = SP_UCODE_DATA_SIZE;
nuGfxTask[i].list.t.dram_stack = &D_800DA040;
nuGfxTask[i].list.t.dram_stack = (u64*) &D_800DA040;
nuGfxTask[i].list.t.dram_stack_size = SP_DRAM_STACK_SIZE8;
nuGfxTask[i].list.t.output_buff = &D_800B91D0;
nuGfxTask[i].list.t.output_buff_size = &gZoneCollisionData;
nuGfxTask[i].list.t.yield_data_ptr = &nuYieldBuf;
nuGfxTask[i].list.t.output_buff = (u64*) &D_800B91D0;
nuGfxTask[i].list.t.output_buff_size = (u64*) &gZoneCollisionData;
nuGfxTask[i].list.t.yield_data_ptr = (u64*) &nuYieldBuf;
nuGfxTask[i].list.t.yield_data_size = NU_GFX_YIELD_BUF_SIZE;
}

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "nu/nusys.h"
void gfxThread(void);
void gfxThread(void*);
extern OSMesg nuContWaitMesgBuf;
extern OSThread D_800B1B90;
@ -12,15 +12,15 @@ void nuGfxThreadStart(void) {
osStartThread(&D_800B1B90);
}
void gfxThread(void) {
void gfxThread(void* data) {
NUScClient gfxClient;
NUScMsg* mesgType;
osCreateMesgQueue(&nuGfxMesgQ, &nuGfxMesgBuf, NU_GFX_MESGS);
osCreateMesgQueue(&nuGfxMesgQ, nuGfxMesgBuf, NU_GFX_MESGS);
nuScAddClient(&gfxClient, &nuGfxMesgQ, NU_SC_RETRACE_MSG | NU_SC_PRENMI_MSG);
while (TRUE) {
osRecvMesg(&nuGfxMesgQ, &mesgType, OS_MESG_BLOCK);
osRecvMesg(&nuGfxMesgQ, (OSMesg*) &mesgType, OS_MESG_BLOCK);
switch (*mesgType) {
case NU_SC_RETRACE_MSG:

View File

@ -14,7 +14,7 @@ u8 nuSiMgrInit(void) {
OSContStatus status[NU_CONT_MAXCONTROLLERS];
u32 i;
osCreateMesgQueue(&nuSiMesgQ, &nuSiMesgBuf, ARRAY_COUNT(nuSiMesgBuf));
osCreateMesgQueue(&nuSiMesgQ, nuSiMesgBuf, ARRAY_COUNT(nuSiMesgBuf));
osSetEventMesg(OS_EVENT_SI, &nuSiMesgQ, NULL);
osContInit(&nuSiMesgQ, &pattern, &status[0]);
@ -63,11 +63,11 @@ void nuSiMgrThread(void* arg) {
u16 majorNo;
u16 minorNo;
osCreateMesgQueue(&nuSiMgrMesgQ, &siMgrMesgBuf, NU_SI_MESG_MAX);
osCreateMesgQueue(&nuSiMgrMesgQ, siMgrMesgBuf, NU_SI_MESG_MAX);
nuScAddClient(&siClient, &nuSiMgrMesgQ, NU_SC_RETRACE_MSG);
while (TRUE) {
osRecvMesg(&nuSiMgrMesgQ, &siMesg, OS_MESG_BLOCK);
osRecvMesg(&nuSiMgrMesgQ, (OSMesg*) &siMesg, OS_MESG_BLOCK);
siCallBackListPtr = &nuSiCallBackList;

View File

@ -1,5 +1,6 @@
#include "pause_common.h"
#include "message_ids.h"
#include "hud_element.h"
#include "sprite.h"
#include "sprite/npc/WorldGoombario.h"
#include "sprite/npc/WorldKooper.h"
@ -10,7 +11,6 @@
#include "sprite/npc/WorldSushie.h"
#include "sprite/npc/WorldLakilester.h"
extern s32 gPartnerPopupProperties[13][4];
extern s8 gPauseBufferPal1[512];
extern s8 gPauseBufferImg1[15752];
extern s8 gPauseBufferPal2[512];
@ -400,7 +400,7 @@ void pause_partners_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 wid
}
void pause_partners_draw_title(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
s32 msgID = gPartnerPopupProperties[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]][0];
s32 msgID = gPartnerPopupProperties[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].nameMsg;
s32 level = get_player_data()->partners[gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[gPausePartnersCurrentPartnerIdx]]].level;
s32 msgWidth = get_msg_width(msgID, 0);
s32 offset = 16;

View File

@ -4,9 +4,10 @@
#include "ld_addrs.h"
#include "sprite.h"
#include "battle/battle.h"
#include "model.h"
s32 D_800778A0[] = {
&D_8038F800, &D_803B5000, &heap_battleHead,
u16* D_800778A0[] = {
D_8038F800, D_803B5000, &heap_battleHead,
};
s32 D_800778AC[] = {
@ -40,7 +41,7 @@ void state_step_battle(void) {
return;
} else {
D_800A0900 = -1;
nuGfxSetCfb(&D_800778A0, 2);
nuGfxSetCfb(D_800778A0, 2);
nuContRmbForceStopEnd();
sfx_stop_env_sounds();
func_8003B1A8();
@ -74,7 +75,7 @@ void state_step_battle(void) {
clear_npcs();
clear_entity_data(1);
clear_trigger_data();
dma_copy(&_16C8E0_ROM_START, &_16C8E0_ROM_END, &_16C8E0_VRAM);
dma_copy(_16C8E0_ROM_START, _16C8E0_ROM_END, _16C8E0_VRAM);
initialize_battle();
btl_save_world_cameras();
load_battle_section();
@ -129,7 +130,7 @@ void state_step_end_battle(void) {
sfx_stop_env_sounds();
mapSettings = get_current_map_settings();
mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
btl_restore_world_cameras(gGameStatusPtr);
btl_restore_world_cameras();
gGameStatusPtr->isBattle = FALSE;
func_8005AF84();
func_8002ACDC();
@ -160,7 +161,7 @@ void state_step_end_battle(void) {
partner_init_after_battle(playerData->currentPartner);
load_map_script_lib();
mapShape = load_asset_by_name(&wMapShapeName, &sizeTemp);
mapShape = load_asset_by_name(wMapShapeName, &sizeTemp);
decode_yay0(mapShape, &D_80210000);
general_heap_free(mapShape);
initialize_collision();
@ -177,7 +178,7 @@ void state_step_end_battle(void) {
set_background_size(296, 200, 12, 20);
}
load_model_textures(mapSettings->modelTreeRoot, get_asset_offset(&wMapTexName, &sizeTemp), sizeTemp);
load_model_textures(mapSettings->modelTreeRoot, get_asset_offset(wMapTexName, &sizeTemp), sizeTemp);
calculate_model_sizes();
npc_reload_all();

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "hud_element.h"
#include "battle/battle.h"
#include "sprite.h"
typedef struct DemoSceneData {
@ -12,32 +13,26 @@ typedef struct DemoSceneData {
/* 0x8 */ char* mapName;
} DemoSceneData; // size = 0xC;
// rodata for below map names
// the compiler deduplicates the two identical map name strings, but it's removing the wrong one
const char D_800983F8[] = {
"end\0kkj_26\0\0arn_08\0\0kkj_11\0\0nok_02\0\0mac_03\0\0kzn_02\0\0mac_00\0\0jan_04\0\0trd_09\0\0tik_03\0\0isk_04\0\0nok_12\0\0"
};
DemoSceneData D_80077AE0[20] = {
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_GOOMBARIO, .unk_6 = 0x9D, .mapName = &D_800983F8[0x5C] },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_GOOMBARIO, .unk_6 = 0x9D, .mapName = "nok_12" },
{ .unk_0 = 2, .entryID = 0, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0 },
{ .unk_0 = 0, .entryID = 5, .unk_4 = 0, .partnerID = PARTNER_PARAKARRY, .unk_6 = 0x9D, .mapName = &D_800983F8[0x54] },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_KOOPER, .unk_6 = 0x9D, .mapName = &D_800983F8[0x4C] },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_PARAKARRY, .unk_6 = 0xB3, .mapName = &D_800983F8[0x44] },
{ .unk_0 = 0, .entryID = 4, .unk_4 = 0, .partnerID = PARTNER_SUSHIE, .unk_6 = 0x9D, .mapName = &D_800983F8[0x3C] },
{ .unk_0 = 0, .entryID = 5, .unk_4 = 0, .partnerID = PARTNER_PARAKARRY, .unk_6 = 0x9D, .mapName = "isk_04" },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_KOOPER, .unk_6 = 0x9D, .mapName = "tik_03" },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_PARAKARRY, .unk_6 = 0xB3, .mapName = "trd_09" },
{ .unk_0 = 0, .entryID = 4, .unk_4 = 0, .partnerID = PARTNER_SUSHIE, .unk_6 = 0x9D, .mapName = "jan_04" },
{ .unk_0 = 2, .entryID = 1, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00 },
{ .unk_0 = 0, .entryID = 6, .unk_4 = 0, .partnerID = PARTNER_BOMBETTE, .unk_6 = 0x9D, .mapName = &D_800983F8[0x34] },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_KOOPER, .unk_6 = 0x1B, .mapName = &D_800983F8[0x2C] },
{ .unk_0 = 0, .entryID = 6, .unk_4 = 0, .partnerID = PARTNER_BOMBETTE, .unk_6 = 0x9D, .mapName = "mac_00" },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_KOOPER, .unk_6 = 0x1B, .mapName = "kzn_02" },
{ .unk_0 = 2, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00 },
{ .unk_0 = 0, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_BOMBETTE, .unk_6 = 0x9D, .mapName = &D_800983F8[0x24] },
{ .unk_0 = 0, .entryID = 4, .unk_4 = 0, .partnerID = PARTNER_GOOMBARIO, .unk_6 = 0x9D, .mapName = &D_800983F8[0x1C] },
{ .unk_0 = 0, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_BOMBETTE, .unk_6 = 0x9D, .mapName = "mac_03" },
{ .unk_0 = 0, .entryID = 4, .unk_4 = 0, .partnerID = PARTNER_GOOMBARIO, .unk_6 = 0x9D, .mapName = "nok_02" },
{ .unk_0 = 2, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00 },
{ .unk_0 = 1, .entryID = 8, .unk_4 = 0, .partnerID = PARTNER_TWINK, .unk_6 = 0x26, .mapName = &D_800983F8[0x14] },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_BOW, .unk_6 = 0xE8, .mapName = &D_800983F8[0xC] },
{ .unk_0 = 1, .entryID = 8, .unk_4 = 0, .partnerID = PARTNER_TWINK, .unk_6 = 0x26, .mapName = "kkj_11" },
{ .unk_0 = 0, .entryID = 2, .unk_4 = 0, .partnerID = PARTNER_BOW, .unk_6 = 0xE8, .mapName = "arn_08" },
{ .unk_0 = 2, .entryID = 4, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00 },
{ .unk_0 = 0, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_GOOMBARIO, .unk_6 = 0x9D, .mapName = &D_800983F8[0x5C] },
{ .unk_0 = 1, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x9D, .mapName = &D_800983F8[4] },
{ .unk_0 = 3, .entryID = 0, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00, .mapName = &D_800983F8[0] },
{ .unk_0 = 0, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_GOOMBARIO, .unk_6 = 0x9D, .mapName = "nok_12" },
{ .unk_0 = 1, .entryID = 3, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x9D, .mapName = "kkj_26" },
{ .unk_0 = 3, .entryID = 0, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00, .mapName = "end" },
{ .unk_0 = 0, .entryID = 0, .unk_4 = 0, .partnerID = PARTNER_NONE, .unk_6 = 0x00, },
};

View File

@ -4,8 +4,9 @@
#include "camera.h"
#include "hud_element.h"
#include "sprite.h"
#include "model.h"
s32 D_80077980[] = { &D_8038F800, &D_803B5000, &heap_battleHead, };
u16* D_80077980[] = { D_8038F800, D_803B5000, &heap_battleHead };
NUPiOverlaySegment D_8007798C = {
.romStart = filemenu_ROM_START,
@ -286,7 +287,7 @@ void state_step_exit_language_select(void) {
init_npc_list();
init_entity_data();
init_trigger_list();
mapShape = load_asset_by_name(&wMapShapeName, &mapShapeSize);
mapShape = load_asset_by_name(wMapShapeName, &mapShapeSize);
decode_yay0(mapShape, &D_80210000);
general_heap_free(mapShape);
initialize_collision();

View File

@ -4,8 +4,9 @@
#include "nu/nusys.h"
#include "hud_element.h"
#include "sprite.h"
#include "model.h"
s32* D_80077950[] = { &D_8038F800, &D_803B5000, &heap_battleHead };
u16* D_80077950[] = { D_8038F800, D_803B5000, (u16*) &heap_battleHead };
NUPiOverlaySegment D_8007795C = {
.romStart = pause_ROM_START,
@ -53,7 +54,7 @@ void state_step_pause(void) {
if (D_800A0920 == 0) {
D_800A0920 = -1;
nuGfxSetCfb(&D_80077950, 2);
nuGfxSetCfb(D_80077950, 2);
gGameStatusPtr->savedBackgroundDarkness = gGameStatusPtr->backgroundDarkness;
sfx_stop_env_sounds();
func_8003B1A8();
@ -130,11 +131,11 @@ void state_step_unpause(void) {
if (D_800A0920 == 0) {
MapSettings* mapSettings;
MapConfig* mapConfig;
s32 assetData;
void* assetData;
s32 assetSize;
D_800A0920 = -1;
nuGfxSetCfb(&D_80077950, ARRAY_COUNT(D_80077950));
nuGfxSetCfb(D_80077950, ARRAY_COUNT(D_80077950));
pause_cleanup();
gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
mapSettings = get_current_map_settings();
@ -161,7 +162,7 @@ void state_step_unpause(void) {
func_801497FC(D_800A0924);
bgm_reset_max_volume();
load_map_script_lib();
assetData = load_asset_by_name(&wMapShapeName, &assetSize);
assetData = load_asset_by_name(wMapShapeName, &assetSize);
decode_yay0(assetData, &D_80210000);
general_heap_free(assetData);
initialize_collision();

View File

@ -74,7 +74,7 @@ Trigger* create_trigger(TriggerBlueprint* bp) {
trigger->onActivateFunc = bp->onActivateFunc;
if (trigger->onActivateFunc == NULL) {
trigger->onActivateFunc = default_trigger_on_activate;
trigger->onActivateFunc = (s32 (*) (Trigger*)) default_trigger_on_activate;
}
return trigger;

View File

@ -24,6 +24,8 @@ AnimID StepUpPeachAnims[] = {
0x00000000
};
void func_802B6198_E24768(void);
void action_update_step_up(void) {
PlayerStatus* playerStatus = &gPlayerStatus;
f32 cosTheta;

View File

@ -16,7 +16,7 @@ ApiStatus func_80240000_800880(Evt* script, s32 isInitialCall) {
ApiStatus func_80240044_8008C4(Evt* script, s32 isInitialCall) {
s32 itemIndex = evt_get_variable(script, *script->ptrReadPos);
s32* var1 = evt_get_variable(NULL, MapVar(2));
s32* var1 = (s32*) evt_get_variable(NULL, MapVar(2));
set_item_entity_flags(gGameStatusPtr->shopItemEntities[itemIndex].index, 0x40);
evt_set_variable(NULL, var1[itemIndex], 1);

View File

@ -129,8 +129,8 @@ ApiStatus func_80243294_9DA2B4(Evt* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
s32 randRange = 10000;
Npc* npc1 = evt_get_variable(script, *args++);
Npc* npc2 = evt_get_variable(script, *args++);
Npc* npc1 = (Npc*) evt_get_variable(script, *args++);
Npc* npc2 = (Npc*) evt_get_variable(script, *args++);
f32 xDiff, zDiff;
f32 x, z;
f32 dist;
@ -177,7 +177,7 @@ ApiStatus func_8024351C_9DA53C(Evt* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* args = script->ptrReadPos;
s32 randRange = 10000;
Npc* npc = evt_get_variable(script, *args++);
Npc* npc = (Npc*) evt_get_variable(script, *args++);
f32 xDiff, zDiff;
f32 x, z;
f32 dist;
@ -222,7 +222,7 @@ ApiStatus func_80243754_9DA774(Evt* script, s32 isInitialCall) {
f32 yaw;
if (isInitialCall) {
script->functionTempPtr[1] = npc = evt_get_variable(script, *args++);
script->functionTempPtr[1] = npc = (Npc*) evt_get_variable(script, *args++);
npc->moveToPos.x = (evt_get_variable(script, *args++) + npc->pos.x) * 0.5f;
npc->moveToPos.z = (evt_get_variable(script, *args++) + npc->pos.z) * 0.5f;
npc->moveToPos.y = dist2D(npc->moveToPos.x, npc->moveToPos.z, npc->pos.x, npc->pos.z);

View File

@ -81,7 +81,7 @@ API_CALLABLE(N(SuperBlock_ShowSelectPartnerMenu)) {
partnerID = N(SuperBlock_PartnerIDs)[i];
if (playerData->partners[partnerID].enabled) {
popupMenu->userIndex[entryIndex] = partnerID;
popupMenu->nameMsg[entryIndex] = gPartnerPopupProperties[partnerID][0];
popupMenu->nameMsg[entryIndex] = gPartnerPopupProperties[partnerID].nameMsg;
canUpgradePartner = N(SuperBlock_get_partner_rank)(partnerID, hasUltraStone);
if (canUpgradePartner >= 0) {
popupMenu->ptrIcon[entryIndex] = wPartnerHudScripts[partnerID];
@ -122,7 +122,7 @@ API_CALLABLE(N(SuperBlock_ShowSelectPartnerMenu)) {
destroy_popup_menu();
if (script->functionTemp[1] != 255) {
script->varTable[0] = gPartnerPopupProperties[popupMenu->userIndex[script->functionTemp[1] - 1]][0];
script->varTable[0] = gPartnerPopupProperties[popupMenu->userIndex[script->functionTemp[1] - 1]].nameMsg;
script->varTable[1] = popupMenu->userIndex[script->functionTemp[1] - 1];
} else {
script->varTable[0] = -1;
@ -138,7 +138,7 @@ API_CALLABLE(N(SuperBlock_SwitchToPartner)) {
}
API_CALLABLE(N(SuperBlock_LoadCurrentPartnerName)) {
set_message_msg(gPartnerPopupProperties[gPlayerData.currentPartner][0], 0);
set_message_msg(gPartnerPopupProperties[gPlayerData.currentPartner].nameMsg, 0);
return ApiStatus_DONE2;
}

View File

@ -1,5 +1,7 @@
#include "dead_04.h"
extern s32 func_80059AC8(s32, s32);
ApiStatus func_80240340_EB5470(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;

View File

@ -2,6 +2,8 @@
#include "world/common/entity/Pipe.inc.c"
void fx_sun(s32, s32, s32, s32, s32, s32);
ApiStatus func_80240318_ED9138(Evt* script, s32 isInitialCall) {
fx_sun(0, 0, 0, 0, 0, 0);
return ApiStatus_DONE2;

View File

@ -46,7 +46,7 @@ INCLUDE_ASM(s32, "EDC020", func_80240614_EDC5F4);
ApiStatus func_8024064C_EDC62C(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32* ptr = evt_get_variable(script, *args);
s32* ptr = (s32*) evt_get_variable(script, *args);
s32 i;
if (ptr != NULL) {

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@ s32 partner_init_get_out(Npc*);
s32 partner_get_out(Npc*);
s32 partner_init_put_away(Npc* partner);
s32 partner_put_away(Npc* partner);
s32 partner_can_use_ability(void);
s32 partner_use_ability(void);
void partner_do_player_collision(Npc* partner);
void partner_walking_follow_player(Npc* partner);

View File

@ -28,7 +28,7 @@ void fio_deserialize_state(void);
void load_map_hit_asset(void);
void load_map_script_lib(void) {
dma_copy((u8 *) &world_script_api_ROM_START, (u8 *) &world_script_api_ROM_END, &world_script_api_VRAM);
dma_copy(world_script_api_ROM_START, world_script_api_ROM_END, world_script_api_VRAM);
}
void load_map_by_IDs(s16 areaID, s16 mapID, s16 loadType) {

View File

@ -767,7 +767,7 @@ if __name__ == "__main__":
cflags += " -ggdb3"
if not args.no_warn:
cflags += " -Wuninitialized -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes"
cflags += " -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes"
# add splat to python import path
sys.path.append(str((ROOT / args.splat).resolve()))

View File

@ -2508,7 +2508,6 @@ D_80098930 = 0x80098930; // type:data rom:0x73D30
D_80098938 = 0x80098938; // type:data rom:0x73D38
D_80098968 = 0x80098968; // type:data rom:0x73D68
D_80098990 = 0x80098990; // type:data rom:0x73D90
D_800989A0 = 0x800989A0; // type:data rom:0x73DA0
D_80098A10 = 0x80098A10; // type:data rom:0x73E10
D_80098A1C = 0x80098A1C; // type:data rom:0x73E1C
D_80098A24 = 0x80098A24; // type:data rom:0x73E24