From 8f7109a3218050bb17f954ff739eb7cda1a39935 Mon Sep 17 00:00:00 2001 From: HailSanta Date: Mon, 20 Nov 2023 13:24:48 -0500 Subject: [PATCH 1/5] all over the place --- include/common_structs.h | 10 +- include/effects.h | 2 +- include/enums.h | 124 +-- include/functions.h | 4 +- include/macros.h | 123 ++- include/model.h | 18 +- src/43F0.c | 2 +- src/77480.c | 2 +- src/7B440.c | 8 +- src/7E9D0.c | 8 +- src/animator.c | 2 +- src/background.c | 44 +- src/background_gfx.c | 2 +- src/battle/16C8E0.c | 2 +- src/battle/190B20.c | 4 +- .../area/trd_part_2/actor/fake_bowser.c | 12 +- src/battle/btl_states_actions.c | 2 +- src/curtains.c | 4 +- src/effects/confetti.c | 6 +- src/effects/damage_indicator.c | 4 +- src/effects/disable_x.c | 2 +- src/effects/effect_65.c | 15 +- src/effects/gfx/flame.c | 6 +- src/effects/ice_shard.c | 2 +- src/effects/merlin_house_stars.c | 15 +- src/effects/radiating_energy_orb.c | 2 +- src/effects/recover.c | 2 +- src/effects/ring_blast.c | 4 +- src/effects/snowfall.c | 2 +- src/effects/stat_change.c | 2 +- src/effects/underwater.c | 2 +- src/entity.c | 2 +- src/entity/model/Tweester.c | 2 +- src/entity/sbk_omo/Tweester.c | 2 +- src/entity_model.c | 4 +- src/evt/virtual_entity.c | 2 +- src/filemenu/filemenu_gfx.c | 2 +- src/hud_element.c | 8 +- src/imgfx.c | 22 +- src/inventory.c | 4 +- src/item_entity.c | 4 +- src/main.c | 60 +- src/main_pre.c | 22 +- src/model.c | 785 +++++++++--------- src/msg.c | 2 +- src/pause/pause_gfx.c | 2 +- src/screen_overlays.c | 6 +- src/screen_render_util.c | 8 +- src/sprite.c | 4 +- src/sprite_shading.c | 8 +- src/state_battle.c | 8 +- src/state_demo.c | 2 +- src/state_file_select.c | 2 +- src/state_pause.c | 2 +- src/state_title_screen.c | 2 +- src/world/action/idle.c | 2 +- src/world/action/sneaky_parasol.c | 12 +- src/world/action/step_up.c | 2 +- src/world/action/walk.c | 4 +- src/world/area_dro/dro_01/dro_01_2_main.c | 6 +- src/world/area_dro/dro_02/dro_02_3_main.c | 6 +- .../area_end/end_01/end_01_4_opera_float.c | 6 +- .../area_end/end_01/end_01_6_shyguy_float.c | 8 +- src/world/area_flo/flo_10/flo_10_6_waterfx.c | 2 +- .../area_hos/hos_00/hos_00_7_shade_gfx.c | 2 +- src/world/area_hos/hos_05/hos_05_5_intro.c | 10 +- src/world/area_hos/hos_05/hos_05_7_model_fx.c | 6 +- .../area_hos/hos_06/hos_06_5_merluvlee.c | 36 +- src/world/area_isk/isk_16/isk_16_3_boss.c | 66 +- src/world/area_jan/jan_16/jan_16_2_main.c | 6 +- .../common/PreventNextPeachDisguise.inc.c | 8 + .../common/RestoreFromPeachState.inc.c | 2 +- src/world/area_kkj/common/SetPeachFlag8.inc.c | 8 - .../area_kkj/kkj_10/kkj_10_4_npcs_later.c | 4 +- .../area_kkj/kkj_11/kkj_11_6_npcs_later.c | 4 +- src/world/area_kkj/kkj_12/kkj_12_2_npc.c | 4 +- src/world/area_kkj/kkj_14/kkj_14_2_main.c | 2 +- .../area_kkj/kkj_14/kkj_14_3_interactables.c | 2 +- src/world/area_kkj/kkj_14/kkj_14_8_chapter0.c | 4 +- src/world/area_kkj/kkj_15/kkj_15_7_chapter3.c | 4 +- .../area_kkj/kkj_16/kkj_16_3_npcs_later.c | 4 +- src/world/area_kkj/kkj_19/kkj_19_2_main.c | 8 +- .../area_kkj/kkj_23/kkj_23_4_npcs_peach.c | 4 +- .../area_kkj/kkj_27/kkj_27_3_rotating_wall.c | 2 +- src/world/area_kmr/kmr_00/kmr_00_3_revival.c | 6 +- src/world/area_kmr/kmr_02/kmr_02_3_npc.c | 10 +- .../area_kmr/kmr_20/kmr_20_11_npc_intro.c | 2 +- .../area_kmr/kmr_20/kmr_20_12_npc_epilogue.c | 2 +- src/world/area_kmr/kmr_21/kmr_21_1_main.c | 2 +- src/world/area_kmr/kmr_23/kmr_23_2_npc.c | 4 +- .../area_kzn/common/LavaGlowLighting.inc.c | 10 +- src/world/area_kzn/kzn_06/kzn_06_3_extra.c | 4 +- src/world/area_kzn/kzn_08/kzn_08.h | 2 +- src/world/area_kzn/kzn_08/kzn_08_4_extra.c | 2 +- .../area_mac/mac_00/mac_00_9_water_gfx.c | 2 +- .../area_mac/mac_00/npc/dojo_members.inc.c | 2 +- .../mac_01/mac_01_6_crystal_ball_gfx.c | 2 +- src/world/area_mac/mac_01/mac_01_9_npc.c | 4 +- .../area_mac/mac_01/npc/flower_gate.inc.c | 2 +- .../area_mac/mac_01/npc/read_fortune.inc.c | 20 +- src/world/area_mac/mac_02/mac_02_3_rooms.c | 2 +- src/world/area_mac/mac_04/mac_04_2_main.c | 2 +- src/world/area_mac/mac_04/mac_04_3_rooms.c | 2 +- src/world/area_osr/osr_00/osr_00_5_scenes.c | 6 +- .../area_osr/osr_03/osr_03_5_interlude.c | 2 +- src/world/area_sam/sam_06/sam_06_4_npc.c | 4 +- src/world/area_sam/sam_11/sam_11_4_entity.c | 4 +- src/world/area_sbk/sbk_02/sbk_02_3_ruins.c | 22 +- src/world/area_sbk/sbk_30/sbk_30_2_main.c | 6 +- src/world/common/atomic/UnkFunc27.inc.c | 50 +- .../dead/area_flo/flo_10/flo_10_6_waterfx.c | 2 +- src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c | 2 +- src/world/menus.c | 2 +- src/world/script_api/rooms.c | 4 +- src/world/world.c | 2 +- ver/ique/asm/bss.s | 2 +- ver/jp/asm/main.bss.s | 2 +- ver/jp/symbol_addrs.txt | 8 +- ver/jp/undefined_syms.txt | 2 +- ver/us/asm/bss.s | 2 +- ver/us/splat.yaml | 8 +- ver/us/symbol_addrs.txt | 50 +- 122 files changed, 1026 insertions(+), 872 deletions(-) create mode 100644 src/world/area_kkj/common/PreventNextPeachDisguise.inc.c delete mode 100644 src/world/area_kkj/common/SetPeachFlag8.inc.c diff --git a/include/common_structs.h b/include/common_structs.h index 75246d51bb0..e0d5a176105 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -997,8 +997,8 @@ typedef struct TextureHeader { /* 0x26 */ u16 mainH; /* 0x28 */ u8 isVariant; /* 0x29 */ u8 extraTiles; // 0 - none, 1 - mipmap, 2 - ?, 3 - use aux tile - /* 0x2A */ u8 colorCombineType : 6; - /* 0x2A */ u8 colorCombineSubType : 2; + /* 0x2A */ u8 auxCombineType : 6; + /* 0x2A */ u8 auxCombineSubType : 2; /* 0x2B */ u8 auxFmt : 4; /* 0x2B */ u8 mainFmt : 4; /* 0x2C */ u8 auxBitDepth : 4; @@ -1399,9 +1399,9 @@ typedef struct GameStatus { /* 0x07B */ char unk_7B; /* 0x07C */ b8 healthBarsEnabled; /* 0x07D */ b8 keepUsingPartnerOnMapChange; - /* 0x07E */ u8 peachFlags; /* (1 = isPeach, 2 = isTransformed, 4 = hasUmbrella) */ - /* 0x07F */ s8 peachDisguise; /* (1 = koopatrol, 2 = hammer bros, 3 = clubba) */ - /* 0x080 */ u8 peachBakingIngredient; ///< @see enum PeachBakingItems + /* 0x07E */ u8 peachFlags; // see PeachFlags enum + /* 0x07F */ s8 peachDisguise; // see PeachDisguises enum + /* 0x080 */ u8 peachBakingIngredient; ///< @see PeachBakingItems enum /* 0x081 */ b8 multiplayerEnabled; /* 0x082 */ Vec2b altViewportOffset; /* 0x084 */ s8 playerSpriteSet; diff --git a/include/effects.h b/include/effects.h index 20d68ad5a13..86597127848 100644 --- a/include/effects.h +++ b/include/effects.h @@ -1410,7 +1410,7 @@ typedef struct MerlinHouseStarsFXData { /* 0x0C */ f32 unk_0C; /* 0x10 */ f32 unk_10; /* 0x14 */ f32 unk_14; - /* 0x18 */ s32 unk_18; + /* 0x18 */ s32 alpha; /* 0x1C */ f32 unk_1C; /* 0x20 */ f32 unk_20; /* 0x24 */ f32 unk_24; diff --git a/include/enums.h b/include/enums.h index 09280871afd..528ea3e6def 100644 --- a/include/enums.h +++ b/include/enums.h @@ -2487,12 +2487,12 @@ enum LandOnSwitchSubstate { LANDING_ON_SWITCH_SUBSTATE_2 = 2, }; -enum PeachStatusFlags { - PEACH_STATUS_FLAG_IS_PEACH = 0x01, - PEACH_STATUS_FLAG_DISGUISED = 0x02, - PEACH_STATUS_FLAG_HAS_PARASOL = 0x04, - PEACH_STATUS_FLAG_8 = 0x08, - PEACH_STATUS_FLAG_DEPRESSED = 0x10 +enum PeachFlags { + PEACH_FLAG_IS_PEACH = 0x01, + PEACH_FLAG_DISGUISED = 0x02, + PEACH_FLAG_HAS_PARASOL = 0x04, + PEACH_FLAG_BLOCK_NEXT_DISGUISE = 0x08, // next attempt to copy an NPC with parasol will fail + PEACH_FLAG_DEPRESSED = 0x10 }; enum PeachBakingItems { @@ -3192,6 +3192,7 @@ enum WindowPriority { }; enum RenderModeIndex { + // RM1 modes RENDER_MODE_IDX_00 = 0x00, RENDER_MODE_IDX_01 = 0x01, RENDER_MODE_IDX_02 = 0x02, @@ -3208,6 +3209,7 @@ enum RenderModeIndex { RENDER_MODE_IDX_0D = 0x0D, RENDER_MODE_IDX_0E = 0x0E, RENDER_MODE_IDX_0F = 0x0F, + // RM2 modes RENDER_MODE_IDX_10 = 0x10, RENDER_MODE_IDX_11 = 0x11, RENDER_MODE_IDX_12 = 0x12, @@ -3223,6 +3225,7 @@ enum RenderModeIndex { RENDER_MODE_IDX_1C = 0x1C, RENDER_MODE_IDX_1D = 0x1D, RENDER_MODE_IDX_1E = 0x1E, + // RM3 modes RENDER_MODE_IDX_1F = 0x1F, RENDER_MODE_IDX_20 = 0x20, RENDER_MODE_IDX_21 = 0x21, @@ -3247,6 +3250,7 @@ enum RenderModeIndex { RENDER_MODE_IDX_34 = 0x34, RENDER_MODE_IDX_35 = 0x35, RENDER_MODE_IDX_36 = 0x36, + // cloud render modes RENDER_MODE_IDX_37 = 0x37, RENDER_MODE_IDX_38 = 0x38, RENDER_MODE_IDX_39 = 0x39, @@ -3255,56 +3259,60 @@ enum RenderModeIndex { RENDER_MODE_IDX_3C = 0x3C, }; -/// not really +// predefined configurations for RDP geometry and render modes +// though these are called "render modes", they do not strictly correspond to the RDP render modes (as supplied to gDPSetRenderMode) enum RenderMode { - RENDER_MODE_SURF_SOLID_AA_ZB_LAYER0 = 0x00000000, - RENDER_MODE_SURFACE_OPA = 0x00000001, - RENDER_MODE_02_UNUSED = 0x00000002, - RENDER_MODE_SURFACE_OPA_NO_AA = 0x00000003, - RENDER_MODE_SURFACE_OPA_NO_ZB = 0x00000004, - RENDER_MODE_DECAL_OPA = 0x00000005, - RENDER_MODE_06_UNUSED = 0x00000006, - RENDER_MODE_DECAL_OPA_NO_AA = 0x00000007, - RENDER_MODE_08_UNUSED = 0x00000008, - RENDER_MODE_INTERSECTING_OPA = 0x00000009, - RENDER_MODE_0A_UNUSED = 0x0000000A, - RENDER_MODE_0B_UNUSED = 0x0000000B, - RENDER_MODE_0C_UNUSED = 0x0000000C, - RENDER_MODE_ALPHATEST = 0x0000000D, - RENDER_MODE_0E_UNUSED = 0x0000000E, - RENDER_MODE_ALPHATEST_ONESIDED = 0x0000000F, - RENDER_MODE_ALPHATEST_NO_ZB = 0x00000010, - RENDER_MODE_SURFACE_XLU_LAYER1 = 0x00000011, - RENDER_MODE_12_UNUSED = 0x00000012, - RENDER_MODE_SURFACE_XLU_NO_AA = 0x00000013, - RENDER_MODE_SURFACE_XLU_NO_ZB = 0x00000014, - RENDER_MODE_SURFACE_XLU_ZB_ZUPD = 0x00000015, - RENDER_MODE_SURFACE_XLU_LAYER2 = 0x00000016, - RENDER_MODE_17_UNUSED = 0x00000017, - RENDER_MODE_18_UNUSED = 0x00000018, - RENDER_MODE_19_UNUSED = 0x00000019, - RENDER_MODE_DECAL_XLU = 0x0000001A, - RENDER_MODE_1B_UNUSED = 0x0000001B, - RENDER_MODE_DECAL_XLU_NO_AA = 0x0000001C, - RENDER_MODE_1D_UNUSED = 0x0000001D, - RENDER_MODE_DECAL_XLU_AHEAD = 0x0000001E, // special case RENDER_MODE_DECAL_XLU for rendering in front of others - RENDER_MODE_1F_UNUSED = 0x0000001F, - RENDER_MODE_SHADOW = 0x00000020, - RENDER_MODE_21_UNUSED = 0x00000021, - RENDER_MODE_SURFACE_XLU_LAYER3 = 0x00000022, - RENDER_MODE_23_UNUSED = 0x00000023, - RENDER_MODE_24_UNUSED = 0x00000024, - RENDER_MODE_25_UNUSED = 0x00000025, - RENDER_MODE_INTERSECTING_XLU = 0x00000026, - RENDER_MODE_27_UNUSED = 0x00000027, - RENDER_MODE_PASS_THROUGH = 0x00000028, // no render mode is set, only geometry modes are initialized - RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD = 0x00000029, - RENDER_MODE_SURFACE_OPA_NO_ZB_BEHIND = 0x0000002A, - RENDER_MODE_ALPHATEST_NO_ZB_BEHIND = 0x0000002B, - RENDER_MODE_SURFACE_XLU_NO_ZB_BEHIND = 0x0000002C, - RENDER_MODE_CLOUD_NO_ZCMP = 0x0000002D, - RENDER_MODE_CLOUD = 0x0000002E, - RENDER_MODE_CLOUD_NO_ZB = 0x0000002F, + // opaque render modes + RENDER_MODE_SURF_SOLID_AA_ZB_LAYER0 = 0x00, + RENDER_MODE_SURFACE_OPA = 0x01, + RENDER_MODE_02_UNUSED = 0x02, + RENDER_MODE_SURFACE_OPA_NO_AA = 0x03, + RENDER_MODE_SURFACE_OPA_NO_ZB = 0x04, + RENDER_MODE_DECAL_OPA = 0x05, + RENDER_MODE_06_UNUSED = 0x06, + RENDER_MODE_DECAL_OPA_NO_AA = 0x07, + RENDER_MODE_08_UNUSED = 0x08, + RENDER_MODE_INTERSECTING_OPA = 0x09, + RENDER_MODE_0A_UNUSED = 0x0A, + RENDER_MODE_0B_UNUSED = 0x0B, + RENDER_MODE_0C_UNUSED = 0x0C, + RENDER_MODE_ALPHATEST = 0x0D, + RENDER_MODE_0E_UNUSED = 0x0E, + RENDER_MODE_ALPHATEST_ONESIDED = 0x0F, + RENDER_MODE_ALPHATEST_NO_ZB = 0x10, + // translucent render modes + RENDER_MODE_SURFACE_XLU_LAYER1 = 0x11, + RENDER_MODE_12_UNUSED = 0x12, + RENDER_MODE_SURFACE_XLU_NO_AA = 0x13, + RENDER_MODE_SURFACE_XLU_NO_ZB = 0x14, + RENDER_MODE_SURFACE_XLU_ZB_ZUPD = 0x15, + RENDER_MODE_SURFACE_XLU_LAYER2 = 0x16, + RENDER_MODE_17_UNUSED = 0x17, + RENDER_MODE_18_UNUSED = 0x18, + RENDER_MODE_19_UNUSED = 0x19, + RENDER_MODE_DECAL_XLU = 0x1A, + RENDER_MODE_1B_UNUSED = 0x1B, + RENDER_MODE_DECAL_XLU_NO_AA = 0x1C, + RENDER_MODE_1D_UNUSED = 0x1D, + RENDER_MODE_DECAL_XLU_AHEAD = 0x1E, // special case RENDER_MODE_DECAL_XLU for rendering in front of others + RENDER_MODE_1F_UNUSED = 0x1F, + RENDER_MODE_SHADOW = 0x20, + RENDER_MODE_21_UNUSED = 0x21, + RENDER_MODE_SURFACE_XLU_LAYER3 = 0x22, + RENDER_MODE_23_UNUSED = 0x23, + RENDER_MODE_24_UNUSED = 0x24, + RENDER_MODE_25_UNUSED = 0x25, + RENDER_MODE_INTERSECTING_XLU = 0x26, + RENDER_MODE_27_UNUSED = 0x27, + // unusual render modes + RENDER_MODE_PASS_THROUGH = 0x28, // no render mode is set, only geometry modes are initialized + RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD = 0x29, + RENDER_MODE_SURFACE_OPA_NO_ZB_BEHIND = 0x2A, + RENDER_MODE_ALPHATEST_NO_ZB_BEHIND = 0x2B, + RENDER_MODE_SURFACE_XLU_NO_ZB_BEHIND = 0x2C, + RENDER_MODE_CLOUD_NO_ZCMP = 0x2D, + RENDER_MODE_CLOUD = 0x2E, + RENDER_MODE_CLOUD_NO_ZB = 0x2F, }; enum RenderTaskFlags { @@ -5850,12 +5858,12 @@ enum BackgroundFlags { BACKGROUND_RENDER_STATE_MASK = 0xF0, }; -enum FogModes { +enum FogMode { FOG_MODE_UNCHANGED = -1, FOG_MODE_0 = 0, FOG_MODE_1 = 1, - FOG_MODE_2 = 2, - FOG_MODE_3 = 3, + FOG_MODE_2 = 2, // prim and fog colors are set + FOG_MODE_3 = 3, // prim and env colors are set }; enum EncounterStates { diff --git a/include/functions.h b/include/functions.h index 386c75bdc31..285e1c869f6 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1014,7 +1014,7 @@ void status_bar_start_blinking_sp_bars(s32 numBarsToBlink); void status_bar_draw_number(s32 iconID, s32 x, s32 y, s32 value, s32 numDigits); void status_bar_draw_stat(s32 id, s32 x, s32 y, s32, s32); void set_background_size(s16, s16, s16, s16); -void read_background_size(BackgroundHeader*); +void set_background(BackgroundHeader*); void set_max_star_power(s8); void sync_status_bar(void); void create_cameras_a(void); @@ -1080,7 +1080,7 @@ void partner_kill_ability_script(void); void func_800EF3D4(s32); void mdl_update_transform_matrices(void); -void func_8011B950(u16, s32, s32, s32); +void func_8011B950(u16, s32, s32, b32); void backup_map_collision_data(void); void reset_status_bar(void); diff --git a/include/macros.h b/include/macros.h index b2e27015286..62c8fd12759 100644 --- a/include/macros.h +++ b/include/macros.h @@ -285,8 +285,8 @@ #define PM_CC_05 TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0 #define PM_CC_06 COMBINED, 0, PRIMITIVE_ALPHA, 0, 0, 0, 0, COMBINED #define PM_CC_07 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0 -#define PM_CC_08 0, 0, 0, PRIMITIVE, 0, 0, 0, 1 -#define PM_CC_09 0, 0, 0, PRIMITIVE, 0, 0, 0, 0 +#define PM_CC_PRIM_FULL_ALPHA 0, 0, 0, PRIMITIVE, 0, 0, 0, 1 +#define PM_CC_PRIM_NO_ALPHA 0, 0, 0, PRIMITIVE, 0, 0, 0, 0 #define PM_CC_0A 0, 0, 0, 0, ENVIRONMENT, 0, TEXEL0, 0 #define PM_CC_0B 0, 0, 0, 0, ENVIRONMENT, 0, TEXEL1, 0 #define PM_CC_0C 0, 0, 0, 0, 0, 0, 0, COMBINED @@ -306,9 +306,79 @@ #define PM_CC_18 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED #define PM_CC_19 COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED -#define PM_CC_1A COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED +#define PM_CC_1B COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0 -#define PM_CC_ALT_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0 +#define PM_CC_1F NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1 + +#define PM_CC_1A TEXEL0, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, TEXEL0 +#define PM_CC_1C SHADE, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, SHADE +#define PM_CC_1D SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, SHADE +#define PM_CC_20 COMBINED, PRIMITIVE, PRIMITIVE_ALPHA, COMBINED, 0, 0, 0, COMBINED +#define PM_CC_21 COMBINED, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, COMBINED +#define PM_CC_22 TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0 +#define PM_CC_23 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0 +#define PM_CC_24 1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0 +#define PM_CC_25 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED +#define PM_CC_26 0, 0, 0, 0, TEXEL0, TEXEL1, SHADE +#define PM_CC_27 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED +#define PM_CC_28 0, SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED + +#define PM_CC1_29 TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1 +#define PM_CC2_29 TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0 + +#define PM_CC_ALT_INTERFERENCE TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0 + +#define PM_CC_2B PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, TEXEL1 +#define PM_CC_2C PRIMITIVE, 0, TEXEL1, 0, TEXEL1, 0, PRIMITIVE, 0 +#define PM_CC_2D PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0 +#define PM_CC_2E 0, 0, 0, TEXEL0, TEXEL1, 0, PRIMITIVE, 0 +#define PM_CC_2F PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0 +#define PM_CC_32 PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0 + +#define PM_CC_33 ENVIRONMENT, PRIMITIVE, COMBINED, PRIMITIVE, COMBINED, 0, PRIMITIVE, 0 + +#define PM_CC_34 TEXEL0, CENTER, SCALE, ENVIRONMENT, 0, 0, 0, TEXEL0 +#define PM_CC_35 0, PRIMITIVE, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED + +#define PM_CC_36 TEXEL0, TEXEL1, TEXEL0, TEXEL1, 1, TEXEL0, TEXEL1, 1 +#define PM_CC_37 0, 0, 0, COMBINED, COMBINED, TEXEL1, TEXEL1, TEXEL1 + +#define PM_CC_38 TEXEL1, K4, PRIMITIVE_ALPHA, TEXEL0, TEXEL0, TEXEL1, ENVIRONMENT, ENVIRONMENT +#define PM_CC_39 TEXEL1, K4, COMBINED_ALPHA, COMBINED, 0, 0, 0, 1 + +#define PM_CC_3A 0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIMITIVE, TEXEL0 +#define PM_CC_3B 0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0 + +#define PM_CC_3C 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0 + +#define PM_CC_3D SHADE, ENVIRONMENT, TEXEL0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0 + +#define PM_CC_3E 0, 0, 0, COMBINED, 0, 0, 0, PRIMITIVE + +#define PM_CC_3F TEXEL0, 0, SHADE, 0, SHADE, 0, PRIMITIVE, 0 + +// animated tiles spreading over the screen when the game is reset +// color = pure black +// alpha = texture +#define PM_CC_RESET_TILES 0, 0, 0, 0, 0, 0, 0, TEXEL0 + +// light with animated alpha surrounding the flower gate in mac_01 as it appears +// color = pure white +// alpha = SHADE * PRIM +#define PM_CC_FLOWER_GATE_GLOW 0, 0, 0, 1, SHADE, 0, PRIMITIVE, 0 + +// light with animated alpha pouring through the opening in kkj_27 as the secret wall rotates +// color = TEXEL0 * SHADE +// alpha = PRIM +#define PM_CC_KKJ_SPILL_LIGHT TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE + +// color = SHADE + PRIM +// alpha = PRIMITIVE * TEXEL0 +#define PM_CC_DAMAGE_INDICATOR 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0 + +// custom combine modes for shadows +#define PM_CC1_SHADOW 0, 0, 0, 0, PRIMITIVE, 0, TEXEL0, 0 +#define PM_CC2_SHADOW 0, 0, 0, 0, TEXEL0, 0, PRIMITIVE, 0 // custom cycle1 modes for window styles #define PM_CC_WINDOW_2 PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL1 @@ -337,6 +407,51 @@ #define PM_CC_BOX1_CYC2 TEXEL0, ENVIRONMENT, ENV_ALPHA, COMBINED, 0, 0, 0, COMBINED #define PM_CC_BOX2_CYC2 PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED +#define PM_CC_30 1, 0, TEXEL1, 0, 0, 0, 0, TEXEL1 +#define PM_CC_31 1, 0, TEXEL1, 0, TEXEL1, 0, PRIMITIVE, 0 + +#define PM_CC_42 TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0 + +#define PM_CC_43 PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1 +#define PM_CC_44 PRIMITIVE, TEXEL1, PRIMITIVE_ALPHA, TEXEL1, 0, 0, 0, 1 + +#define PM_CC_45 TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0 +#define PM_CC_46 TEXEL0, ENVIRONMENT, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0 +#define PM_CC_47 TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0 + +#define PM_CC_48 PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE + +#define PM_CC_49 TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0 + +#define PM_CC_4A TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0 +#define PM_CC_4B PRIMITIVE, CENTER, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED +#define PM_CC_4C 1, COMBINED, PRIMITIVE, COMBINED, 0, 0, 0, COMBINED +#define PM_CC_4D ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0 +#define PM_CC_4E SHADE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0 +#define PM_CC_4F 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0 + +#define PM_CC_50 TEXEL0, 0, TEXEL1, 0, 0, 0, 0, TEXEL1 +#define PM_CC_51 TEXEL0, 0, TEXEL1, 0, PRIMITIVE, 0, TEXEL1, 0 +#define PM_CC_52 SHADE, ENVIRONMENT, COMBINED, COMBINED, 0, 0, 0, COMBINED + +#define PM_CC_53 TEXEL1, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0 +#define PM_CC_54 COMBINED, TEXEL0, COMBINED_ALPHA, TEXEL0, PRIMITIVE, 0, TEXEL0, 0 +#define PM_CC_55 PRIMITIVE, ENVIRONMENT, TEXEL0_ALPHA, ENVIRONMENT, 0, 0, 0, 1 + +#define PM_CC_56 0, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, 0 +#define PM_CC_57 1, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, PRIMITIVE +#define PM_CC_58 0, 0, 0, 0, 1, 0, ENVIRONMENT, PRIMITIVE + +#define PM_CC_59 0, 0, 0, 0, SHADE, 0, TEXEL0, 0 +#define PM_CC_5A SHADE, ENVIRONMENT, TEXEL0, TEXEL0, 0, 0, 0, TEXEL0 + +#define PM_CC_5B 1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0 +#define PM_CC_5C 1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0 +#define PM_CC_5D 1, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0 +#define PM_CC_5E 1, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0 + +#define PM_CC_HOS_BG_SHADE 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0 + #define PM_CC_CONST_ALPHA_1 0, 0, 0, 0, 0, 0, 0, 1 #define PM_CC_CONST_0 0, 0, 0, 0, 0, 0, 0, 0 #define PM_CC_CONST_1 0, 0, 0, 1, 0, 0, 0, 1 diff --git a/include/model.h b/include/model.h index ed0d502c5e7..566d7ea14f4 100644 --- a/include/model.h +++ b/include/model.h @@ -161,11 +161,11 @@ typedef enum GroupTypes { } GroupTypes; typedef enum ExtraTileTypes { - EXTRA_TILE_NONE = 0, - EXTRA_TILE_MIPMAPS = 1, - EXTRA_TILE_AUX_SAME_AS_MAIN = 2, - EXTRA_TILE_AUX_INDEPENDENT = 3, - EXTRA_TILE_4 = 4, + EXTRA_TILE_NONE = 0, // texture contains only a single tile + EXTRA_TILE_MIPMAPS = 1, // texture contais mipmaps + EXTRA_TILE_AUX_SAME_AS_MAIN = 2, // texture contains main and aux images with identical fmt and size + EXTRA_TILE_AUX_INDEPENDENT = 3, // texture contains main and aux images with independent fmt and size + EXTRA_TILE_4 = 4, // only use-case may be a mistake? unused and mostly unimplemented } ExtraTileTypes; #define SHAPE_SIZE_LIMIT 0x8000 @@ -181,16 +181,16 @@ typedef struct ShapeFileHeader { typedef struct ShapeFile { /* 0x00 */ ShapeFileHeader header; - /* 0x20 */ u8 data[SHAPE_SIZE_LIMIT - 0x20]; + /* 0x20 */ u8 data[SHAPE_SIZE_LIMIT - sizeof(ShapeFileHeader)]; } ShapeFile; // size = variable typedef ModelTreeInfo ModelTreeInfoList[0x200]; extern ModelTreeInfoList* gCurrentModelTreeNodeInfo; extern ModelList* gCurrentModels; -void set_model_fog_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); -void set_model_env_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); -void get_model_env_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); +void mdl_set_fog2_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); +void mdl_set_fog3_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); +void mdl_get_fog3_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); void init_model_data(void); void update_model_animator(s32); diff --git a/src/43F0.c b/src/43F0.c index 599f0d55e4a..07f3cdc6db9 100644 --- a/src/43F0.c +++ b/src/43F0.c @@ -784,7 +784,7 @@ void appendGfx_startup_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 if (a == 255) { gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); - gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); diff --git a/src/77480.c b/src/77480.c index 669bace5336..b32aa70ba43 100644 --- a/src/77480.c +++ b/src/77480.c @@ -1730,7 +1730,7 @@ void update_player_shadow(void) { shadow->pos.y = y; shadow->alpha = (f64)playerStatus->curAlpha / 2; - if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH)) { + if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH)) { set_standard_shadow_scale(shadow, shadowScale); } else { set_peach_shadow_scale(shadow, shadowScale); diff --git a/src/7B440.c b/src/7B440.c index a48cadc887e..ad3784b34f9 100644 --- a/src/7B440.c +++ b/src/7B440.c @@ -69,17 +69,17 @@ void reset_player_status(void) { playerStatus->curAlpha = 255; playerStatus->prevAlpha = 255; - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_8; - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DEPRESSED; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_BLOCK_NEXT_DISGUISE; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DEPRESSED; one = 1.0f; - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) { playerStatus->colliderHeight = 55; playerStatus->colliderDiameter = 38; playerStatus->animFlags |= PA_FLAG_USING_PEACH_PHYSICS; - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DISGUISED) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_DISGUISED) { D_8010C92C = 2; playerStatus->peachDisguise = gGameStatusPtr->peachDisguise; } diff --git a/src/7E9D0.c b/src/7E9D0.c index 7b987baa9bd..bff02f5df52 100644 --- a/src/7E9D0.c +++ b/src/7E9D0.c @@ -564,7 +564,7 @@ void peach_force_disguise_action(s32 useParasol) { set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL); } else { playerStatus->animFlags &= ~PA_FLAG_INVISIBLE; - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DISGUISED; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DISGUISED; playerStatus->peachDisguise = PEACH_DISGUISE_NONE; free_npc_by_index(PeachDisguiseNpcIndex); set_action_state(ACTION_STATE_IDLE); @@ -582,9 +582,9 @@ void peach_check_for_parasol_input(void) { if (D_8010C92C != 0) { D_8010C92C--; if (D_8010C92C == 0) { - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DISGUISED) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_DISGUISED) { playerStatus->animFlags |= PA_FLAG_INVISIBLE; - gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_DISGUISED; + gGameStatusPtr->peachFlags |= PEACH_FLAG_DISGUISED; disguiseNpc = peach_make_disguise_npc(gGameStatusPtr->peachDisguise); if (disguiseNpc != NULL) { @@ -592,7 +592,7 @@ void peach_check_for_parasol_input(void) { } } } - } else if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_HAS_PARASOL && playerStatus->pressedButtons & BUTTON_B) { + } else if (gGameStatusPtr->peachFlags & PEACH_FLAG_HAS_PARASOL && playerStatus->pressedButtons & BUTTON_B) { set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL); } } diff --git a/src/animator.c b/src/animator.c index 8b06d4df5b4..ee2e1253c3a 100644 --- a/src/animator.c +++ b/src/animator.c @@ -874,7 +874,7 @@ void appendGfx_animator_node(ModelAnimator* animator, AnimatorNode* node, Matrix if (!gAnimModelFogEnabled) { gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA); } else { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC_18); } gDPPipeSync(gMainGfxPos++); diff --git a/src/background.c b/src/background.c index 64640dbc418..4aa2c315d3b 100644 --- a/src/background.c +++ b/src/background.c @@ -37,7 +37,7 @@ void reset_background_settings(void) { gGameStatusPtr->backgroundFlags &= BACKGROUND_RENDER_STATE_MASK; } -void read_background_size(BackgroundHeader* bg) { +void set_background(BackgroundHeader* bg) { gGameStatusPtr->backgroundMaxX = bg->width; gGameStatusPtr->backgroundMaxY = bg->height; gGameStatusPtr->backgroundMinX = bg->startX; @@ -83,9 +83,16 @@ void appendGfx_background_texture(void) { u8* newvar; + enum { + BG_BLEND_NONE = 0, + BG_BLEND_HAS_FOG = 1, + BG_BLEND_SHOULD_LERP = 2, + BG_BLEND_SHOULD_BLEND = 4, + }; + if (is_world_fog_enabled()) { get_world_fog_color(&fogR, &fogG, &fogB, &fogA); - flags = 1; + flags = BG_BLEND_HAS_FOG; fogA = gGameStatusPtr->backgroundDarkness; } @@ -94,41 +101,41 @@ void appendGfx_background_texture(void) { case FOG_MODE_1: get_background_color_blend(&r1, &g1, &b1, &a1); if (a1 != 0) { - flags |= 2; + flags |= BG_BLEND_SHOULD_LERP; } break; case FOG_MODE_2: case FOG_MODE_3: default: - get_model_env_color_parameters(&r1, &g1, &b1, &r2, &g2, &b2); + mdl_get_fog3_color_parameters(&r1, &g1, &b1, &r2, &g2, &b2); if (!(r1 == 255 && g1 == 255 && b1 == 255 && r2 == 0 && g2 == 0 && b2 == 0)) { - flags |= 4; + flags |= BG_BLEND_SHOULD_BLEND; } break; } switch (flags) { - case 0: + case BG_BLEND_NONE: gGameStatusPtr->backgroundFlags &= ~BACKGROUND_FLAG_FOG; break; - case 1: + case BG_BLEND_HAS_FOG: gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; break; - case 2: + case BG_BLEND_SHOULD_LERP: gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; fogR = r1; fogG = g1; fogB = b1; fogA = a1; break; - case 3: + case BG_BLEND_HAS_FOG | BG_BLEND_SHOULD_LERP: gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; fogR = (fogR * (255 - a1) + r1 * a1) / 255; fogG = (fogG * (255 - a1) + g1 * a1) / 255; fogB = (fogB * (255 - a1) + b1 * a1) / 255; fogA = (fogA * (255 - a1) + a1 * a1) / 255; break; - case 4: + case BG_BLEND_SHOULD_BLEND: gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; break; } @@ -142,7 +149,9 @@ void appendGfx_background_texture(void) { gBackgroundPalette[i] = 1; } } else { + // lerp from background palette color to fog color based on fog alpha for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { + // NOTE: values after UNPACK range from [0,31], so we need to shift fog color into that range u16 palColor = gGameStatusPtr->backgroundPalette[i]; blendedB = blend_background_channel(UNPACK_PAL_B(palColor), fogB >> 3, fogA); blendedG = blend_background_channel(UNPACK_PAL_G(palColor), fogG >> 3, fogA); @@ -154,11 +163,14 @@ void appendGfx_background_texture(void) { case FOG_MODE_2: case FOG_MODE_3: default: + // in these modes, the background color is modulated channel-wise by r1/g1/b1 and blended with env + // to prevent oversaturating channel x, users should ensure x2 + x1 <= 255 for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { + // NOTE: values after UNPACK range from [0,31], so we need to shift other colors into that range u16 palColor = gGameStatusPtr->backgroundPalette[i]; - blendedB = (b2 >> 3) + ((UNPACK_PAL_B(palColor) * b1) >> 8); - blendedG = (g2 >> 3) + ((UNPACK_PAL_G(palColor) * g1) >> 8); - blendedR = (r2 >> 3) + ((UNPACK_PAL_R(palColor) * r1) >> 8); + blendedB = (b2 >> 3) + ((UNPACK_PAL_B(palColor) * b1 >> 3) >> 5); + blendedG = (g2 >> 3) + ((UNPACK_PAL_G(palColor) * g1 >> 3) >> 5); + blendedR = (r2 >> 3) + ((UNPACK_PAL_R(palColor) * r1 >> 3) >> 5); if (blendedB > 0x1F) { blendedB = 0x1F; @@ -295,9 +307,6 @@ void appendGfx_background_texture(void) { } } -// TODO figure out why it is needed -static const f32 rodata_padding[] = { 0.0f, 0.0f }; - void enable_background_wave(void) { gBackroundWaveEnabled = TRUE; } @@ -305,3 +314,6 @@ void enable_background_wave(void) { void disable_background_wave(void) { gBackroundWaveEnabled = FALSE; } + +// TODO figure out why it is needed +static const f32 rodata_padding[] = { 0.0f, 0.0f }; diff --git a/src/background_gfx.c b/src/background_gfx.c index 6b507074c79..3693fac67ea 100644 --- a/src/background_gfx.c +++ b/src/background_gfx.c @@ -363,7 +363,7 @@ void gfx_draw_background(void) { // @bug In 1-cycle mode, the two combiner cycles should be identical. Using Texel1 here in the second cycle, // which is the actual cycle of the combiner used on hardware in 1-cycle mode, actually samples the next // pixel's texel value instead of the current pixel's. This results in a one-pixel offset. - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1, PRIMITIVE, TEXEL1, PRIMITIVE_ALPHA, TEXEL1, 0, 0, 0, 1); + gDPSetCombineMode(gMainGfxPos++, PM_CC_43, PM_CC_44); gDPSetPrimColor(gMainGfxPos++, 0, 0, 40, 40, 40, gPauseBackgroundFade); gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT); diff --git a/src/battle/16C8E0.c b/src/battle/16C8E0.c index 737a7e09d69..5487f530f76 100644 --- a/src/battle/16C8E0.c +++ b/src/battle/16C8E0.c @@ -190,7 +190,7 @@ void initialize_battle(void) { battleStatus->tattleFlags[i] = 0; } - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) { gBattleStatus.flags2 |= BS_FLAGS2_PEACH_BATTLE; increment_status_bar_disabled(); } else { diff --git a/src/battle/190B20.c b/src/battle/190B20.c index 3ba7085542d..79ee40e9951 100644 --- a/src/battle/190B20.c +++ b/src/battle/190B20.c @@ -991,7 +991,7 @@ s32 count_power_plus(s32 damageType) { s32 count; s32 i; - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) { return 0; } @@ -2998,7 +2998,7 @@ void btl_appendGfx_prim_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 righ if (a == 255) { gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); - gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); diff --git a/src/battle/area/trd_part_2/actor/fake_bowser.c b/src/battle/area/trd_part_2/actor/fake_bowser.c index cfa3257cd25..92ae88ecd6e 100644 --- a/src/battle/area/trd_part_2/actor/fake_bowser.c +++ b/src/battle/area/trd_part_2/actor/fake_bowser.c @@ -1409,13 +1409,13 @@ EvtScript N(EVS_FakeBowser_HandleEvent) = { EVT_CASE_OR_EQ(EVENT_BURN_DEATH) EVT_CALL(HideHealthBar, ACTOR_SELF) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_3) - EVT_CALL(N(UnkFunc26), 3, 35, 35, 35, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 35, 35, 35, 0, 0, 0, 0, 0, 0) EVT_END_IF EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT) EVT_WAIT(20) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_0) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) EVT_DIVF(LVar3, EVT_FLOAT(2.0)) @@ -1443,12 +1443,12 @@ EvtScript N(EVS_FakeBowser_HandleEvent) = { EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_BURN_CONTACT) EVT_CASE_OR_EQ(EVENT_BURN_HIT) - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_3) - EVT_CALL(N(UnkFunc26), 3, 35, 35, 35, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 35, 35, 35, 0, 0, 0, 0, 0, 0) EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT) EVT_WAIT(20) EVT_SET(ArrayVar(0), ANIM_BEGIN_IDLE) - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_0) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) EVT_DIVF(LVar3, EVT_FLOAT(2.0)) diff --git a/src/battle/btl_states_actions.c b/src/battle/btl_states_actions.c index 07f427fb624..01a352661e0 100644 --- a/src/battle/btl_states_actions.c +++ b/src/battle/btl_states_actions.c @@ -236,7 +236,7 @@ void btl_state_update_normal_start(void) { if (stage->bg != NULL) { load_map_bg(stage->bg); - read_background_size(&gBackgroundImage); + set_background(&gBackgroundImage); } if (gGameStatusPtr->demoBattleFlags & DEMO_BTL_FLAG_ENABLED) { diff --git a/src/curtains.c b/src/curtains.c index 5fe66609a14..42b2ec26c75 100644 --- a/src/curtains.c +++ b/src/curtains.c @@ -61,7 +61,7 @@ Gfx TheaterWallShadowsGfx[] = { Gfx TheaterCurtainGfx[] = { gsDPPipeSync(), gsDPSetRenderMode(G_RM_PASS, G_RM_XLU_SURF2), - gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_16), gsSPDisplayList(D_80075730), gsSPVertex(theater_curtain_vtx, 31, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), @@ -80,7 +80,7 @@ Gfx TheaterCurtainGfx[] = { Gfx TheaterInsetShadowsGfx[] = { gsDPPipeSync(), gsDPSetRenderMode(G_RM_PASS, G_RM_XLU_SURF2), - gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, SHADE, COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_SHADE, PM_CC_16), gsSPTexture(0x0080, 0x0080, 0, G_TX_RENDERTILE, G_OFF), gsSPVertex(theater_left_inset_shadow_vtx, 4, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), diff --git a/src/effects/confetti.c b/src/effects/confetti.c index fc35c389998..962cb44ce5a 100644 --- a/src/effects/confetti.c +++ b/src/effects/confetti.c @@ -290,13 +290,13 @@ void confetti_appendGfx(void* effect) { switch ((unk_24 + i) % 3) { case 0: - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_45, PM_CC_46); break; case 1: - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_45, PM_CC_45); break; case 2: - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_45, PM_CC_47); break; } uly = ((i + D_E0088D00[unk_24 % 6]) & 0xF) * 16; diff --git a/src/effects/damage_indicator.c b/src/effects/damage_indicator.c index 94a43666d50..1531f0f928c 100644 --- a/src/effects/damage_indicator.c +++ b/src/effects/damage_indicator.c @@ -217,10 +217,10 @@ void damage_indicator_render_impl(EffectInstance* effect) { if (part->alpha == 255) { gDPSetRenderMode(gMainGfxPos++, G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2); - gDPSetCombineLERP(gMainGfxPos++, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_DAMAGE_INDICATOR, PM_CC_DAMAGE_INDICATOR); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); - gDPSetCombineLERP(gMainGfxPos++, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_DAMAGE_INDICATOR, PM_CC_DAMAGE_INDICATOR); } for(i = 1; i < effect->numParts; i++, part--) { diff --git a/src/effects/disable_x.c b/src/effects/disable_x.c index 6342894d8a8..dbf8aadee71 100644 --- a/src/effects/disable_x.c +++ b/src/effects/disable_x.c @@ -248,7 +248,7 @@ void func_E00826C4(DisableXFXData* data) { gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_49, PM_CC_49); } } diff --git a/src/effects/effect_65.c b/src/effects/effect_65.c index add49ec0a7f..48c85898cb2 100644 --- a/src/effects/effect_65.c +++ b/src/effects/effect_65.c @@ -1,7 +1,8 @@ #include "common.h" #include "effects_internal.h" -#define MAX_POINTS (30) +#define MAX_POINTS 30 +#define VTX_BUF_SIZE 2 * MAX_POINTS * sizeof(Vtx) / sizeof(Gfx) void effect_65_init(EffectInstance* effect); void effect_65_update(EffectInstance* effect); @@ -256,17 +257,20 @@ void effect_65_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_E00CACB0[variation]); if (variation >= 2) { - gDPSetCombineLERP(gMainGfxPos++, SHADE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_4E, PM_CC_4F); } gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, primAlpha); gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, 0); - gSPBranchList(gMainGfxPos, gMainGfxPos + 0x79); + gSPBranchList(gMainGfxPos, gMainGfxPos + 1 + VTX_BUF_SIZE); + gMainGfxPos++; - vtxBuffer = (Vtx_t*) (gMainGfxPos + 1); + // reserve space in the display list for the vertices + vtxBuffer = (Vtx_t*)gMainGfxPos; + gMainGfxPos += VTX_BUF_SIZE; + firstPointIdx = -1; baseTexOffset = (lifeTime & 0x3F) << 5; - gMainGfxPos += 0x79; numPoints = 0; for (i = 0; i < MAX_POINTS; i++) { @@ -381,6 +385,7 @@ void effect_65_appendGfx(void* effect) { phase += 180; } + // gSPBranchList jumps to here (after the vertex array) for (i = firstPointIdx; i < MAX_POINTS - 1; i++) { gSPVertex(gMainGfxPos++, &vtxBuffer[i * 2], 4, 0); gSP2Triangles(gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0); diff --git a/src/effects/gfx/flame.c b/src/effects/gfx/flame.c index 9fdfb00702e..8fae6a95e0b 100644 --- a/src/effects/gfx/flame.c +++ b/src/effects/gfx/flame.c @@ -22,7 +22,7 @@ Gfx D_09000800_3543B0[] = { gsDPSetTextureLUT(G_TT_NONE), gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2), gsDPLoadTextureTile(OS_K0_TO_PHYSICAL(&D_800B32E0), G_IM_FMT_I, G_IM_SIZ_8b, 32, 0, 0, 0, 31, 63, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD), - gsDPSetCombineLERP(TEXEL0, CENTER, SCALE, ENVIRONMENT, 0, 0, 0, TEXEL0, 0, PRIMITIVE, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_34, PM_CC_35), gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING), gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH), gsSPEndDisplayList(), @@ -41,14 +41,14 @@ Gfx D_090009E0_354590[] = { gsDPSetCombineMode(PM_CC_CONST_ALPHA_1, PM_CC_CONST_ALPHA_1), gsSPTextureRectangle(0, 0, 0x0080, 0x0100, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400), gsDPPipeSync(), - gsDPSetCombineLERP(TEXEL0, TEXEL1, TEXEL0, TEXEL1, 1, TEXEL0, TEXEL1, 1, 0, 0, 0, COMBINED, COMBINED, TEXEL1, TEXEL1, TEXEL1), + gsDPSetCombineMode(PM_CC_36, PM_CC_37), gsSPTextureRectangle(0, 0, 0x0080, 0x0100, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400), gsDPPipeSync(), gsDPLoadTextureTile(OS_K0_TO_PHYSICAL(&D_800B3AE0), G_IM_FMT_I, G_IM_SIZ_8b, 32, 0, 0, 0, 31, 63, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD), gsDPSetColorImage(G_IM_FMT_I, G_IM_SIZ_8b, 32, OS_K0_TO_PHYSICAL(&D_800B32E0)), gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), gsDPSetTextureFilter(G_TF_POINT), - gsDPSetCombineLERP(TEXEL1, K4, PRIMITIVE_ALPHA, TEXEL0, TEXEL0, TEXEL1, ENVIRONMENT, ENVIRONMENT, TEXEL1, K4, COMBINED_ALPHA, COMBINED, 0, 0, 0, 1), + gsDPSetCombineMode(PM_CC_38, PM_CC_39), gsDPSetConvert(0, 0, 0, 0, 92, 0), gsDPSetPrimColor(0, 0, 0x00, 0x00, 0x00, 0x78), gsDPSetEnvColor(0x00, 0x00, 0x00, 0xA4), diff --git a/src/effects/ice_shard.c b/src/effects/ice_shard.c index 7d854156c88..01ba8e640f9 100644 --- a/src/effects/ice_shard.c +++ b/src/effects/ice_shard.c @@ -172,7 +172,7 @@ void ice_shard_appendGfx(void* effect) { if (type % 2 == 1 && (s32) (data->animFrame * 4.0f) == 3) { gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primCol.r, data->primCol.g, data->primCol.b, alpha * envAlpha / 255); - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_3C, PM_CC_3C); gSPDisplayList(gMainGfxPos++, D_09001168_3F9E28); } diff --git a/src/effects/merlin_house_stars.c b/src/effects/merlin_house_stars.c index 96097455336..68a452dc4e4 100644 --- a/src/effects/merlin_house_stars.c +++ b/src/effects/merlin_house_stars.c @@ -29,7 +29,7 @@ EffectInstance* merlin_house_stars_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) data->unk_04 = 100; data->unk_00 = arg0; - data->unk_18 = 255; + data->alpha = 255; data->unk_0C = arg1; data->unk_10 = arg2; data->unk_14 = arg3; @@ -75,11 +75,11 @@ void merlin_house_stars_update(EffectInstance* effect) { unk_04 = data->unk_04; if (data->unk_08 < 17) { - data->unk_18 = data->unk_08 * 16 - 1; + data->alpha = data->unk_08 * 16 - 1; } if (unk_04 < 16) { - data->unk_18 = unk_04 * 16; + data->alpha = unk_04 * 16; } if (data->unk_1C < 0.0f) { @@ -126,9 +126,12 @@ void merlin_house_stars_render(EffectInstance* effect) { void func_E00A639C(void) { } +#define PM_CC1_MERLIN_STARS 0, 0, 0, 1, TEXEL1, 0, PRIMITIVE, TEXEL0 +#define PM_CC2_MERLIN_STARS 0, 0, 0, COMBINED, COMBINED, 0, ENVIRONMENT, 0 + void merlin_house_stars_appendGfx(void* effect) { MerlinHouseStarsFXData* data = ((EffectInstance*)effect)->data.merlinHouseStars; - s32 unk_18 = data->unk_18; + s32 envAlpha = data->alpha; Matrix4f sp10; Matrix4f sp50; s32 uls; @@ -144,8 +147,8 @@ void merlin_house_stars_appendGfx(void* effect) { gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 127); - gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, unk_18); - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 1, TEXEL1, 0, PRIMITIVE, TEXEL0, 0, 0, 0, COMBINED, COMBINED, 0, ENVIRONMENT, 0); + gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, envAlpha); + gDPSetCombineMode(gMainGfxPos++, PM_CC1_MERLIN_STARS, PM_CC2_MERLIN_STARS); gSPDisplayList(gMainGfxPos++, D_09001000_3A6BE0); uls = data->unk_1C * 4.0f; diff --git a/src/effects/radiating_energy_orb.c b/src/effects/radiating_energy_orb.c index 99d7b0191dc..1afeb0c38aa 100644 --- a/src/effects/radiating_energy_orb.c +++ b/src/effects/radiating_energy_orb.c @@ -193,7 +193,7 @@ void radiating_energy_orb_appendGfx(void* effect) { gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 0, 255, (part->unk_14 * unk_14) >> 9); gDPSetEnvColor(gMainGfxPos++, 255, 128, 255, 0); - gDPSetCombineLERP(gMainGfxPos++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_4D, PM_CC_4D); guRotateF(sp18, part->unk_20 + 14.0f, 0.0f, 0.0f, 1.0f); guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f); diff --git a/src/effects/recover.c b/src/effects/recover.c index 89002f9df80..71519a5754c 100644 --- a/src/effects/recover.c +++ b/src/effects/recover.c @@ -196,7 +196,7 @@ void func_E0080448(EffectInstance* effect) { gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_49, PM_CC_49); } gSPDisplayList(gMainGfxPos++, (type == 0 || type == 2) ? diff --git a/src/effects/ring_blast.c b/src/effects/ring_blast.c index b9368060fda..6df7a1e55f8 100644 --- a/src/effects/ring_blast.c +++ b/src/effects/ring_blast.c @@ -119,9 +119,9 @@ void ring_blast_appendGfx(void* effect) { gDPSetEnvColor(gMainGfxPos++, var_f4 * 255.0f, var_f4 * 53.0f, var_f4 * 24.0f, envAlpha); gDPSetKeyR(gMainGfxPos++, var_f4 * 211.0f, 0, 0); gDPSetKeyGB(gMainGfxPos++, var_f4 * 255.0f, 0, 0, var_f4 * 216.0f, 0, 0); - gDPSetCombineLERP(gMainGfxPos++, TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, PRIMITIVE, CENTER, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_4A, PM_CC_4B); } else { - gDPSetCombineLERP(gMainGfxPos++, TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, 1, COMBINED, PRIMITIVE, COMBINED, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_4A, PM_CC_4C); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 40, 127); gDPSetEnvColor(gMainGfxPos++, 255, 255, 139, envAlpha); } diff --git a/src/effects/snowfall.c b/src/effects/snowfall.c index fcf8bf52045..eaa5ea77f80 100644 --- a/src/effects/snowfall.c +++ b/src/effects/snowfall.c @@ -177,7 +177,7 @@ void snowfall_appendGfx(void* effect) { bgAlpha = 255; unk_2C = data->unk_2C; dlist = D_E008AA50[data->unk_04]; - if (*gBackgroundFogModePtr == 1) { + if (*gBackgroundFogModePtr == FOG_MODE_1) { get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); unk_28 = 255 - bgAlpha; } diff --git a/src/effects/stat_change.c b/src/effects/stat_change.c index 88eee1a8b5e..47b7f1f288a 100644 --- a/src/effects/stat_change.c +++ b/src/effects/stat_change.c @@ -255,7 +255,7 @@ void func_E00AC2A4(EffectInstance* effect) { gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_49, PM_CC_49); } guTranslateF(sp20, 0.0f, data->unk_40, 0.0f); diff --git a/src/effects/underwater.c b/src/effects/underwater.c index 2b16fef8319..cdc5c3bee9c 100644 --- a/src/effects/underwater.c +++ b/src/effects/underwater.c @@ -187,7 +187,7 @@ void underwater_appendGfx(void* effect) { gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxCfb_ptr); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->waterColor.r, data->waterColor.g, data->waterColor.b, alpha >> 1); gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE, PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE); + gDPSetCombineMode(gMainGfxPos++, PM_CC_48, PM_CC_48); gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, OS_K0_TO_PHYSICAL(nuGfxZBuffer)); gDPSetRenderMode(gMainGfxPos++, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP); diff --git a/src/entity.c b/src/entity.c index 744a375aa49..62dab5bb1e5 100644 --- a/src/entity.c +++ b/src/entity.c @@ -333,7 +333,7 @@ void func_8010FE44(void* arg0) { void entity_model_set_shadow_color(void* data) { s32 alpha = (s32)data; - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC1_SHADOW, PM_CC2_SHADOW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha); } diff --git a/src/entity/model/Tweester.c b/src/entity/model/Tweester.c index 41d00dafc39..8a4163c0d3f 100644 --- a/src/entity/model/Tweester.c +++ b/src/entity/model/Tweester.c @@ -10,7 +10,7 @@ Gfx Entity_Tweester_LoadTextures[] = { gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), gsDPSetTextureDetail(G_TD_CLAMP), gsDPSetTextureLOD(G_TL_TILE), gsDPSetTextureImage(G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50), diff --git a/src/entity/sbk_omo/Tweester.c b/src/entity/sbk_omo/Tweester.c index ffac563cdf8..d426d3bdf97 100644 --- a/src/entity/sbk_omo/Tweester.c +++ b/src/entity/sbk_omo/Tweester.c @@ -82,7 +82,7 @@ void entity_Tweester_setupGfx(s32 entityIndex) { gDPPipeSync(gMainGfxPos++); gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE); gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); - gDPSetCombineLERP(gMainGfxPos++, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2); gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP); gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE); gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50); diff --git a/src/entity_model.c b/src/entity_model.c index e0babc75da5..b8cb2e91a52 100644 --- a/src/entity_model.c +++ b/src/entity_model.c @@ -346,7 +346,7 @@ void appendGfx_entity_model(EntityModel* model) { if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) { gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA); } else { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC_18); } } if (model->vertexArray != NULL) { @@ -660,7 +660,7 @@ void draw_entity_model_E(s32 modelIdx, Mtx* transformMtx) { if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) { gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA); } else { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC_18); } if (model->vertexArray != NULL) { gSPSegment(gMainGfxPos++, D_80154374, VIRTUAL_TO_PHYSICAL(model->vertexArray)); diff --git a/src/evt/virtual_entity.c b/src/evt/virtual_entity.c index 069524af6e0..b869c1f0b4e 100644 --- a/src/evt/virtual_entity.c +++ b/src/evt/virtual_entity.c @@ -11,7 +11,7 @@ void virtual_entity_appendGfx_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u1 gDPPipeSync(gMainGfxPos++); if (a == 0xFF) { - gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); diff --git a/src/filemenu/filemenu_gfx.c b/src/filemenu/filemenu_gfx.c index 64c00fe735f..a423540b498 100644 --- a/src/filemenu/filemenu_gfx.c +++ b/src/filemenu/filemenu_gfx.c @@ -15,7 +15,7 @@ Gfx filemenu_dl_copyarrow[] = { gsDPSetTextureFilter(G_TF_BILERP), gsDPSetTextureConvert(G_TC_FILT), gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, ENVIRONMENT, PRIMITIVE, COMBINED, PRIMITIVE, COMBINED, 0, PRIMITIVE, 0), + gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_33), gsDPSetTextureLUT(G_TT_NONE), gsDPLoadTextureTile_4b(D_8024A200, G_IM_FMT_IA, 64, 16, 0, 0, 63, 15, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_WRAP, 6, 4, G_TX_NOLOD, G_TX_NOLOD), gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA), diff --git a/src/hud_element.c b/src/hud_element.c index 57abbe7a549..f0ecd693e13 100644 --- a/src/hud_element.c +++ b/src/hud_element.c @@ -504,9 +504,9 @@ void hud_element_draw_rect(HudElement* hudElement, s16 texSizeX, s16 texSizeY, s case 1: if (!dropShadow) { if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) { - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32); } else { - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32); } if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) { @@ -550,7 +550,7 @@ void hud_element_draw_rect(HudElement* hudElement, s16 texSizeX, s16 texSizeY, s } break; case 2: - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_47, PM_CC_47); gDPSetPrimColor(gMainGfxPos++, 0, 0, hudElement->tint.r, hudElement->tint.g, hudElement->tint.b, hudElement->opacity); if (!flipX && !flipY) { @@ -1584,7 +1584,7 @@ void render_hud_element(HudElement* hudElement) { vtx[3].v.tc[1] = 0; gDPPipeSync(gMainGfxPos++); - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_47, PM_CC_47); gDPSetPrimColor(gMainGfxPos++, 0, 0, hudElement->tint.r, hudElement->tint.g, hudElement->tint.b, hudElement->opacity); diff --git a/src/imgfx.c b/src/imgfx.c index 8a5b91f608e..42131f2a993 100644 --- a/src/imgfx.c +++ b/src/imgfx.c @@ -915,9 +915,7 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) { case IMGFX_RENDER_MODULATE_PRIM_RGB: // color: lerp from prim color to 1 based on texture intensity // alpha: texture - gDPSetCombineLERP(gMainGfxPos++, - 1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0, - 1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_5B, PM_CC_5B); gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color.r, state->ints.color.g, state->ints.color.b, 0); break; @@ -927,9 +925,7 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) { if (primAlpha <= 0) { return; } - gDPSetCombineLERP(gMainGfxPos++, - 1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, - 1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_5C, PM_CC_5C); gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color.r, state->ints.color.g, state->ints.color.b, primAlpha); break; @@ -943,16 +939,14 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) { case IMGFX_RENDER_MODULATE_SHADE_RGB: // color: lerp from vtx color to 1 based on texture intensity // alpha: texture - gDPSetCombineLERP(gMainGfxPos++, - 1, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0, - 1, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_5D, PM_CC_5D); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING); break; case IMGFX_RENDER_MULTIPLY_SHADE_ALPHA: // color: texture // alpha: texture * vtx color - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_12, PM_CC_12); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING); break; @@ -966,9 +960,7 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) { case IMGFX_RENDER_MODULATE_SHADE_RGBA: // color: lerp from vtx color to 1 based on texture intensity // alpha: vtx color * texture - gDPSetCombineLERP(gMainGfxPos++, - 1, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0, - 1, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_5E, PM_CC_5E); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING); break; @@ -1591,7 +1583,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) { } if (alpha2 == -1) { - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, SHADE, 0, TEXEL0, 0, 0, 0, 0, 0, SHADE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_59, PM_CC_59); } else { gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, alpha2); gDPSetCombineMode(gMainGfxPos++, PM_CC_0A, PM_CC_0A); @@ -1609,7 +1601,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) { gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha2); - gDPSetCombineLERP(gMainGfxPos++, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, 0, 0, 0, TEXEL0, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, 0, 0, 0, TEXEL0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_5A, PM_CC_5A); gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ); } } diff --git a/src/inventory.c b/src/inventory.c index 85d18e85e97..d3c9264d013 100644 --- a/src/inventory.c +++ b/src/inventory.c @@ -575,7 +575,7 @@ void update_status_bar(void) { if (gGameStatusPtr->introPart >= INTRO_PART_0 || gGameStatusPtr->demoState != DEMO_STATE_NONE - || (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) + || (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) || evt_get_variable(NULL, GB_StoryProgress) >= STORY_EPILOGUE ) { return; @@ -1583,7 +1583,7 @@ s32 is_ability_active(s32 ability) { attackFXArray[i] = 0; } - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) { return 0; } diff --git a/src/item_entity.c b/src/item_entity.c index 695b155bc20..20300717048 100644 --- a/src/item_entity.c +++ b/src/item_entity.c @@ -963,7 +963,7 @@ void appendGfx_item_entity(void* data) { GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha); } } @@ -1176,7 +1176,7 @@ void render_item_entities(void) { } else { gDPSetRenderMode(gMainGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha); } } diff --git a/src/main.c b/src/main.c index f23cb74b213..fc83ad54091 100644 --- a/src/main.c +++ b/src/main.c @@ -94,7 +94,7 @@ s16 D_80074010 = 8; // might be an array, could be size 1-8 void gfxRetrace_Callback(s32); void gfxPreNMI_Callback(void); -void gfx_task_main(void); +void appendGfx_reset_tile_pattern(void); void gfx_draw_frame(void); void gfx_init_state(void); @@ -102,18 +102,25 @@ void gfx_init_state(void); void create_audio_system(void); void load_engine_data(void); -extern s32 D_80073E00; -extern u16* D_80073E04; +enum { + RESET_STATE_NONE = 0, + RESET_STATE_INIT = 1, + RESET_STATE_FADE = 2, +}; + +// TODO try uniting these two split files +extern s32 ResetGameState; +extern u16* ResetSavedFrameImg; extern s16 D_80073E08; extern s16 D_80073E0A; -extern s32 D_80073E10[]; +extern IMG_BIN D_80073E10[]; #ifdef SHIFT #define shim_create_audio_system_obfuscated create_audio_system #define shim_load_engine_data_obfuscated load_engine_data #endif -SHIFT_BSS u16* D_8009A680; +SHIFT_BSS u16* ResetFrameBufferArray; SHIFT_BSS u16* nuGfxZBuffer; void boot_main(void* data) { @@ -164,25 +171,25 @@ void boot_main(void* data) { while (TRUE) {} } -void gfxRetrace_Callback(s32 arg0) { - if (D_80073E00 != 0) { - if (D_80073E00 == 1) { +void gfxRetrace_Callback(s32 gfxTaskNum) { + if (ResetGameState != RESET_STATE_NONE) { + if (ResetGameState == RESET_STATE_INIT) { nuGfxTaskAllEndWait(); - if (arg0 == 0) { + if (gfxTaskNum == 0) { u16* fb = (u16*) osViGetCurrentFramebuffer(); - u16** temp_8009A680 = &D_8009A680; + u16** bufferSet = &ResetFrameBufferArray; - temp_8009A680[2] = fb; - temp_8009A680[1] = fb; - temp_8009A680[0] = fb; - D_80073E04 = fb; - nuGfxSetCfb(&D_8009A680, 3); - osViSwapBuffer(D_8009A680); - D_80073E00 = 2; + bufferSet[2] = fb; + bufferSet[1] = fb; + bufferSet[0] = fb; + ResetSavedFrameImg = fb; + nuGfxSetCfb(&ResetFrameBufferArray, 3); + osViSwapBuffer(ResetFrameBufferArray); + ResetGameState = RESET_STATE_FADE; } } - if (D_80073E00 == 2) { - gfx_task_main(); + if (ResetGameState == RESET_STATE_FADE) { + appendGfx_reset_tile_pattern(); } } else { D_80073E0A ^= 1; @@ -190,7 +197,7 @@ void gfxRetrace_Callback(s32 arg0) { step_game_loop(); D_80073E08 = 1; - if (arg0 < 3) { + if (gfxTaskNum < 3) { D_80073E08 = 0; gfx_task_background(); gfx_draw_frame(); @@ -199,20 +206,21 @@ void gfxRetrace_Callback(s32 arg0) { } } -void gfx_task_main(void) { +// on reset, draw a series of animated triangular black tiles emanating from the center of the screen +void appendGfx_reset_tile_pattern(void) { s16 t; s16 i; s16 j; - u16* temp; + u16* frozenFrame; gMatrixListPos = 0; gDisplayContext = &D_80164000[gCurrentDisplayContextIndex]; gMainGfxPos = gDisplayContext->mainGfx; - temp = D_80073E04; + frozenFrame = ResetSavedFrameImg; gfx_init_state(); gDPSetDepthImage(gMainGfxPos++, OS_K0_TO_PHYSICAL(nuGfxZBuffer)); - gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(temp)); + gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(frozenFrame)); gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON); gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); @@ -220,7 +228,7 @@ void gfx_task_main(void) { gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE); gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT); - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, 0, 0, 0, TEXEL0, 0, 0, 0, 0, 0, 0, 0, TEXEL0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_RESET_TILES, PM_CC_RESET_TILES); gDPSetAlphaCompare(gMainGfxPos++, G_AC_THRESHOLD); gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 127); gDPLoadTextureTile_4b(gMainGfxPos++, D_80073E10, G_IM_FMT_I, 128, 8, 0, 0, 127, 7, 0, G_TX_NOMIRROR | G_TX_WRAP, @@ -275,6 +283,6 @@ NOP_FIX #endif void gfxPreNMI_Callback(void) { - D_80073E00 = 1; + ResetGameState = RESET_STATE_INIT; nuContRmbForceStop(); } diff --git a/src/main_pre.c b/src/main_pre.c index 929ec88b2f4..096d7eaef34 100644 --- a/src/main_pre.c +++ b/src/main_pre.c @@ -1,26 +1,10 @@ #include "PR/ultratypes.h" -s32 D_80073E00 = 0; -s32 D_80073E04 = NULL; +s32 ResetGameState = 0; +u16* ResetSavedFrameImg = NULL; s16 D_80073E08 = 0; s16 D_80073E0A = 0; s32 D_80073E0C = 0; // unused? -s32 D_80073E10[] = { - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, - 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, - 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, - 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, - 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, - 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, - 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, - 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, - 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, - 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, -}; +#include "reset_tiles.png.inc.c" diff --git a/src/model.c b/src/model.c index fdf8b2ce8a0..7b1302b2108 100644 --- a/src/model.c +++ b/src/model.c @@ -6,9 +6,37 @@ #include "model_clear_render_tasks.h" #include "nu/nusys.h" +enum { + TEX_MODE_STRIDE = 3, + TEX_MODE_A0 = 1, // render modes are single-cycle + TEX_MODE_B0 = 2, // render modes are two-cycle, starting with G_RM_PASS + TEX_MODE_C0 = 3, // render modes are two-cycle, starting with G_RM_FOG_SHADE_A + TEX_MODE_A1 = 4, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite + TEX_MODE_B1 = 5, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite + TEX_MODE_C1 = 6, + TEX_MODE_A2 = 10, + TEX_MODE_B2 = 11, +}; + +enum { + AUX_COMBINE_SUB_0 = 0, + AUX_COMBINE_SUB_1 = 1, + AUX_COMBINE_SUB_2 = 2, + AUX_COMBINE_SUB_COUNT = 3, +}; + +enum { + FOG_COMBINE_NONE = 0, + FOG_COMBINE_0 = 1, + FOG_COMBINE_1 = 2, + FOG_COMBINE_2 = 3, + FOG_COMBINE_3 = 4, +}; + #define MAP_TEXTURE_MEMORY_SIZE 0x20000 #define BTL_TEXTURE_MEMORY_SIZE 0x8000 +// NOTE: the type for this is FogMode, UnkFunc27 SHIFT_BSS u8* gBackgroundFogModePtr; SHIFT_BSS ModelList* gCurrentModels; SHIFT_BSS ModelTreeInfoList* gCurrentModelTreeNodeInfo; @@ -150,150 +178,156 @@ Gfx* ModelRenderModes[] = { }; Gfx ModelCombineModesStandard[21][5] = { - { + [0] { gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), - gsDPSetCombineLERP(SHADE, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, SHADE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - }, { + gsDPSetCombineMode(PM_CC_1C, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_1D, G_CC_PASS2), + }, + + [1] { gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA), gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_PASS2), - gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, COMBINED, PRIMITIVE, PRIMITIVE_ALPHA, COMBINED, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_20), gsDPSetCombineMode(G_CC_MODULATEIA, PM_CC_17), - }, { + }, + [2] { gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_BLENDRGBA), gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_BLENDRGBDECALA, PM_CC_21), + gsDPSetCombineMode(G_CC_BLENDRGBA, PM_CC_17), }, - { + [3] { gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), - gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_1A, G_CC_PASS2), + gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_17), }, - { + + [4] { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_18), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_19), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_1A), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - { + [5] { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_18), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_19), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_1A), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - { + [6] { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_18), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_19), - gsDPSetCombineMode(PM_CC_ALT_TRILERP, PM_CC_1A), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), + + [7] { + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + [8] { + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + [9] { + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + + [10] { + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + [11] { + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + [12] { + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + [13] { + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_28), }, - { - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + [14] { + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, PM_CC_17), }, - { - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), + [15] { + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), }, - { - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + [16] { + gsDPSetCombineMode(PM_CC_23, PM_CC_23), + gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_23, PM_CC_17), }, - { - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), + [17] { + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), }, - { - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), + [18] { + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), }, - { - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), + [19] { + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), }, - { - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), + [20] { + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), }, }; @@ -302,148 +336,148 @@ Gfx ModelCombineModesAlphaTest[21][5] = { gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), - gsDPSetCombineLERP(SHADE, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, SHADE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_1C, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_1D, G_CC_PASS2), }, { gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA), gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), - gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, COMBINED, PRIMITIVE, PRIMITIVE_ALPHA, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_20), + gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_17), }, { gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_BLENDRGBA), gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_BLENDRGBDECALA, PM_CC_21), + gsDPSetCombineMode(G_CC_BLENDRGBA, PM_CC_17), }, { gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), - gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_1A, G_CC_PASS2), + gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_17), }, { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEI2), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEI2), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, { gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, { - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, { - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0, SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_27), + gsDPSetCombineMode(PM_CC_26, PM_CC_28), }, { - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_22, PM_CC_17), }, { - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0, 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), + gsDPSetCombineMode(PM_CC_24, PM_CC_25), }, { - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - gsDPSetCombineLERP(1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED), + gsDPSetCombineMode(PM_CC_23, PM_CC_23), + gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + gsDPSetCombineMode(PM_CC_23, PM_CC_17), }, { - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), - gsDPSetCombineLERP(TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1, TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), }, { - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), }, { - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), }, { - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), - gsDPSetCombineLERP(NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1, NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), }, }; @@ -454,25 +488,23 @@ u8 mdl_bgMultiplyColorR = 0; u8 mdl_bgMultiplyColorG = 0; u8 mdl_bgMultiplyColorB = 0; -s8 mdl_renderModelFogPrimColorR = 0; -s8 mdl_renderModelFogPrimColorG = 0; -s8 mdl_renderModelFogPrimColorB = 0; -s8 mdl_renderModelFogPrimColorA = 0; - -s8 mdl_renderModelFogColorR = 0; -s8 mdl_renderModelFogColorG = 0; -s8 mdl_renderModelFogColorB = 0; -s8 mdl_renderModelFogColorA = 0; // unused? - -s32 mdl_renderModelFogStart = 950; -s32 mdl_renderModelFogEnd = 1000; - -s8 gRenderModelPrimR = 255; -s8 gRenderModelPrimG = 255; -s8 gRenderModelPrimB = 255; -s8 gRenderModelEnvR = 0; -s8 gRenderModelEnvG = 0; -s8 gRenderModelEnvB = 0; +u8 mdl_Fog2PrimR = 0; +u8 mdl_Fog2PrimG = 0; +u8 mdl_Fog2PrimB = 0; +u8 mdl_Fog2PrimA = 0; +u8 mdl_Fog2ColR = 0; +u8 mdl_Fog2ColG = 0; +u8 mdl_Fog2ColB = 0; +u8 mdl_Fog2ColA = 0; // unused? +s32 mdl_Fog2Start = 950; +s32 mdl_Fog2End = 1000; + +u8 mdl_Fog3PrimR = 255; +u8 mdl_Fog3PrimG = 255; +u8 mdl_Fog3PrimB = 255; +u8 mdl_Fog3EnvR = 0; +u8 mdl_Fog3EnvG = 0; +u8 mdl_Fog3EnvB = 0; Mtx mdl_RDPIdentity = RDP_MATRIX( 1.000000, 0.000000, 0.000000, 0.000000, @@ -522,9 +554,9 @@ DepthFloatFactors depthFloatLookupTable[] = { s32 gLastRenderTaskCount = 0; // ---------------------------------------------------------------------------- -// TILE_MODE_1A, basic AA variants +// TEX_MODE_A0, basic AA variants -// RENDER_MODE_IDX_00: RENDER_MODE_SURFACE_OPA, TILE_MODE_1A +// RENDER_MODE_IDX_00: RENDER_MODE_SURFACE_OPA, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_SURFACE_OPA[] = { gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2), @@ -535,7 +567,7 @@ Gfx Gfx_RM1_SURFACE_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_02: RENDER_MODE_DECAL_OPA, TILE_MODE_1A +// RENDER_MODE_IDX_02: RENDER_MODE_DECAL_OPA, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_DECAL_OPA[] = { gsDPSetRenderMode(G_RM_AA_ZB_OPA_DECAL, G_RM_AA_ZB_OPA_DECAL2), @@ -546,7 +578,7 @@ Gfx Gfx_RM1_DECAL_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_04: RENDER_MODE_INTERSECTING_OPA, TILE_MODE_1A +// RENDER_MODE_IDX_04: RENDER_MODE_INTERSECTING_OPA, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_INTERSECTING_OPA[] = { gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_AA_ZB_OPA_INTER2), @@ -557,7 +589,7 @@ Gfx Gfx_RM1_INTERSECTING_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_06: RENDER_MODE_ALPHATEST, TILE_MODE_1A +// RENDER_MODE_IDX_06: RENDER_MODE_ALPHATEST, TEX_MODE_A0 // used by entity models and item entities Gfx Gfx_RM1_ALPHATEST[] = { gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2), @@ -567,7 +599,7 @@ Gfx Gfx_RM1_ALPHATEST[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_08: RENDER_MODE_SURFACE_XLU, TILE_MODE_1A +// RENDER_MODE_IDX_08: RENDER_MODE_SURFACE_XLU, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_SURFACE_XLU[] = { gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2), @@ -577,7 +609,7 @@ Gfx Gfx_RM1_SURFACE_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0C: RENDER_MODE_DECAL_XLU, TILE_MODE_1A +// RENDER_MODE_IDX_0C: RENDER_MODE_DECAL_XLU, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_DECAL_XLU[] = { gsDPSetRenderMode(G_RM_AA_ZB_XLU_DECAL, G_RM_AA_ZB_XLU_DECAL2), @@ -587,7 +619,7 @@ Gfx Gfx_RM1_DECAL_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0E: RENDER_MODE_INTERSECTING_XLU, TILE_MODE_1A +// RENDER_MODE_IDX_0E: RENDER_MODE_INTERSECTING_XLU, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_INTERSECTING_XLU[] = { gsDPSetRenderMode(G_RM_AA_ZB_XLU_INTER, G_RM_AA_ZB_XLU_INTER2), @@ -598,9 +630,9 @@ Gfx Gfx_RM1_INTERSECTING_XLU[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_1A, basic NO_AA variants +// TEX_MODE_A0, basic NO_AA variants -// RENDER_MODE_IDX_01: RENDER_MODE_SURFACE_OPA_NO_AA, TILE_MODE_1A +// RENDER_MODE_IDX_01: RENDER_MODE_SURFACE_OPA_NO_AA, TEX_MODE_A0 Gfx Gfx_RM1_SURFACE_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_OPA_SURF, G_RM_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -609,7 +641,7 @@ Gfx Gfx_RM1_SURFACE_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_03: RENDER_MODE_DECAL_OPA_NO_AA, TILE_MODE_1A +// RENDER_MODE_IDX_03: RENDER_MODE_DECAL_OPA_NO_AA, TEX_MODE_A0 Gfx Gfx_RM1_DECAL_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_OPA_DECAL, G_RM_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -627,7 +659,7 @@ Gfx Gfx_RM1_INTERSECTING_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_07: RENDER_MODE_ALPHATEST_ONESIDED, TILE_MODE_1A +// RENDER_MODE_IDX_07: RENDER_MODE_ALPHATEST_ONESIDED, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_ALPHATEST_ONESIDED[] = { gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2), @@ -637,7 +669,7 @@ Gfx Gfx_RM1_ALPHATEST_ONESIDED[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0A: RENDER_MODE_SURFACE_XLU_NO_AA, TILE_MODE_1A +// RENDER_MODE_IDX_0A: RENDER_MODE_SURFACE_XLU_NO_AA, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_SURFACE_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2), @@ -647,7 +679,7 @@ Gfx Gfx_RM1_SURFACE_XLU_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0D: RENDER_MODE_DECAL_XLU_NO_AA, TILE_MODE_1A +// RENDER_MODE_IDX_0D: RENDER_MODE_DECAL_XLU_NO_AA, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_DECAL_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_OVL_SURF, G_RM_ZB_OVL_SURF2), @@ -658,7 +690,7 @@ Gfx Gfx_RM1_DECAL_XLU_NO_AA[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_1A, special modes +// TEX_MODE_A0, special modes // RENDER_MODE_IDX_0F: unused // used by entity models for RENDER_MODE_PASS_THROUGH @@ -669,7 +701,7 @@ Gfx Gfx_RM1_PASS_THROUGH[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_09: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TILE_MODE_1A +// RENDER_MODE_IDX_09: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TEX_MODE_A0 Gfx Gfx_RM1_SURFACE_XLU_AA_ZB_ZUPD[] = { gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | Z_CMP | Z_UPD | IM_RD | @@ -681,7 +713,7 @@ Gfx Gfx_RM1_SURFACE_XLU_AA_ZB_ZUPD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2E: RENDER_MODE_SURFACE_OPA_NO_ZB, TILE_MODE_1A +// RENDER_MODE_IDX_2E: RENDER_MODE_SURFACE_OPA_NO_ZB, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_SURFACE_OPA_NO_ZB[] = { gsDPSetRenderMode(G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2), @@ -691,7 +723,7 @@ Gfx Gfx_RM1_SURFACE_OPA_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2F: RENDER_MODE_ALPHATEST_NO_ZB, TILE_MODE_1A +// RENDER_MODE_IDX_2F: RENDER_MODE_ALPHATEST_NO_ZB, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_ALPHATEST_NO_ZB[] = { gsDPSetRenderMode(G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2), @@ -701,7 +733,7 @@ Gfx Gfx_RM1_ALPHATEST_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_30: RENDER_MODE_SURFACE_XLU_NO_ZB, TILE_MODE_1A +// RENDER_MODE_IDX_30: RENDER_MODE_SURFACE_XLU_NO_ZB, TEX_MODE_A0 // used by entity models Gfx Gfx_RM1_SURFACE_XLU_NO_ZB[] = { gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2), @@ -711,7 +743,7 @@ Gfx Gfx_RM1_SURFACE_XLU_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0B: RENDER_MODE_SURFACE_XLU_ZB_ZUPD, TILE_MODE_1A +// RENDER_MODE_IDX_0B: RENDER_MODE_SURFACE_XLU_ZB_ZUPD, TEX_MODE_A0 // custom render mode similar to RM_AA_XLU_SURF, using ZMODE_XLU instead of ZMODE_OPA and setting Z_CMP | Z_UPD Gfx Gfx_RM1_SURFACE_XLU_ZB_ZUPD[] = { gsDPSetRenderMode(AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | Z_CMP | Z_UPD | @@ -738,7 +770,7 @@ Gfx Gfx_RM1_CLOUD_NO_ZCMP[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_37: RENDER_MODE_CLOUD, TILE_MODE_1A +// RENDER_MODE_IDX_37: RENDER_MODE_CLOUD, TEX_MODE_A0 Gfx Gfx_RM1_CLOUD[] = { gsDPSetRenderMode(G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -747,7 +779,7 @@ Gfx Gfx_RM1_CLOUD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_38: RENDER_MODE_CLOUD_NO_ZB, TILE_MODE_1A +// RENDER_MODE_IDX_38: RENDER_MODE_CLOUD_NO_ZB, TEX_MODE_A0 Gfx Gfx_RM1_CLOUD_NO_ZB[] = { gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -757,9 +789,9 @@ Gfx Gfx_RM1_CLOUD_NO_ZB[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_2A, basic AA variants +// TEX_MODE_B0, basic AA variants -// RENDER_MODE_IDX_10: RENDER_MODE_SURFACE_OPA, TILE_MODE_2A +// RENDER_MODE_IDX_10: RENDER_MODE_SURFACE_OPA, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_OPA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -768,7 +800,7 @@ Gfx Gfx_RM2_SURFACE_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_12: RENDER_MODE_DECAL_OPA, TILE_MODE_2A +// RENDER_MODE_IDX_12: RENDER_MODE_DECAL_OPA, TEX_MODE_B0 Gfx Gfx_RM2_DECAL_OPA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -777,7 +809,7 @@ Gfx Gfx_RM2_DECAL_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_14: RENDER_MODE_INTERSECTING_OPA, TILE_MODE_2A +// RENDER_MODE_IDX_14: RENDER_MODE_INTERSECTING_OPA, TEX_MODE_B0 Gfx Gfx_RM2_INTERSECTING_OPA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_INTER2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -786,7 +818,7 @@ Gfx Gfx_RM2_INTERSECTING_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_16: RENDER_MODE_ALPHATEST, TILE_MODE_2A +// RENDER_MODE_IDX_16: RENDER_MODE_ALPHATEST, TEX_MODE_B0 // used by entity models, item entities with shading Gfx Gfx_RM2_ALPHATEST[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2), @@ -796,7 +828,7 @@ Gfx Gfx_RM2_ALPHATEST[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_18: RENDER_MODE_SURFACE_XLU, TILE_MODE_2A +// RENDER_MODE_IDX_18: RENDER_MODE_SURFACE_XLU, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_XLU[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -805,7 +837,7 @@ Gfx Gfx_RM2_SURFACE_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1B: RENDER_MODE_DECAL_XLU, TILE_MODE_2A +// RENDER_MODE_IDX_1B: RENDER_MODE_DECAL_XLU, TEX_MODE_B0 Gfx Gfx_RM2_DECAL_XLU[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -814,7 +846,7 @@ Gfx Gfx_RM2_DECAL_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1D: RENDER_MODE_INTERSECTING_XLU, TILE_MODE_2A +// RENDER_MODE_IDX_1D: RENDER_MODE_INTERSECTING_XLU, TEX_MODE_B0 Gfx Gfx_RM2_INTERSECTING_XLU[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_INTER2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -824,9 +856,9 @@ Gfx Gfx_RM2_INTERSECTING_XLU[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_2A, basic NO_AA variants +// TEX_MODE_B0, basic NO_AA variants -// RENDER_MODE_IDX_11: RENDER_MODE_SURFACE_OPA_NO_AA, TILE_MODE_2A +// RENDER_MODE_IDX_11: RENDER_MODE_SURFACE_OPA_NO_AA, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -835,7 +867,7 @@ Gfx Gfx_RM2_SURFACE_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_13: RENDER_MODE_DECAL_OPA_NO_AA, TILE_MODE_2A +// RENDER_MODE_IDX_13: RENDER_MODE_DECAL_OPA_NO_AA, TEX_MODE_B0 Gfx Gfx_RM2_DECAL_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -854,7 +886,7 @@ Gfx Gfx_RM2_INTERSECTING_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_17: RENDER_MODE_ALPHATEST_ONESIDED, TILE_MODE_2A +// RENDER_MODE_IDX_17: RENDER_MODE_ALPHATEST_ONESIDED, TEX_MODE_B0 Gfx Gfx_RM2_ALPHATEST_ONESIDED[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -862,7 +894,7 @@ Gfx Gfx_RM2_ALPHATEST_ONESIDED[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1A: RENDER_MODE_SURFACE_XLU_NO_AA, TILE_MODE_2A +// RENDER_MODE_IDX_1A: RENDER_MODE_SURFACE_XLU_NO_AA, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -871,7 +903,7 @@ Gfx Gfx_RM2_SURFACE_XLU_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1C: RENDER_MODE_DECAL_XLU_NO_AA, TILE_MODE_2A +// RENDER_MODE_IDX_1C: RENDER_MODE_DECAL_XLU_NO_AA, TEX_MODE_B0 Gfx Gfx_RM2_DECAL_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_XLU_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -881,7 +913,7 @@ Gfx Gfx_RM2_DECAL_XLU_NO_AA[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_2A, special modes +// TEX_MODE_B0, special modes // RENDER_MODE_IDX_1E: unused Gfx Gfx_RM2_PASS_THROUGH[] = { @@ -891,7 +923,7 @@ Gfx Gfx_RM2_PASS_THROUGH[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_19: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TILE_MODE_2A +// RENDER_MODE_IDX_19: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_XLU_AA_ZB_ZUPD[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -900,7 +932,7 @@ Gfx Gfx_RM2_SURFACE_XLU_AA_ZB_ZUPD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_31: RENDER_MODE_SURFACE_OPA_NO_ZB, TILE_MODE_2A +// RENDER_MODE_IDX_31: RENDER_MODE_SURFACE_OPA_NO_ZB, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_OPA_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -909,7 +941,7 @@ Gfx Gfx_RM2_SURFACE_OPA_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_32: RENDER_MODE_ALPHATEST_NO_ZB, TILE_MODE_2A +// RENDER_MODE_IDX_32: RENDER_MODE_ALPHATEST_NO_ZB, TEX_MODE_B0 Gfx Gfx_RM2_ALPHATEST_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -918,7 +950,7 @@ Gfx Gfx_RM2_ALPHATEST_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_33: RENDER_MODE_SURFACE_XLU_NO_ZB, TILE_MODE_2A +// RENDER_MODE_IDX_33: RENDER_MODE_SURFACE_XLU_NO_ZB, TEX_MODE_B0 Gfx Gfx_RM2_SURFACE_XLU_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -927,7 +959,7 @@ Gfx Gfx_RM2_SURFACE_XLU_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_39: RENDER_MODE_CLOUD, TILE_MODE_2A +// RENDER_MODE_IDX_39: RENDER_MODE_CLOUD, TEX_MODE_B0 Gfx Gfx_RM2_CLOUD[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -936,7 +968,7 @@ Gfx Gfx_RM2_CLOUD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_3A: RENDER_MODE_CLOUD_NO_ZB, TILE_MODE_2A +// RENDER_MODE_IDX_3A: RENDER_MODE_CLOUD_NO_ZB, TEX_MODE_B0 Gfx Gfx_RM2_CLOUD_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -946,9 +978,9 @@ Gfx Gfx_RM2_CLOUD_NO_ZB[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_3A+, basic AA variants +// TEX_MODE_C0+, basic AA variants -// RENDER_MODE_IDX_1F: RENDER_MODE_SURFACE_OPA, TILE_MODE_3A / TILE_MODE_3B / TILE_MODE_1B / TILE_MODE_1C +// RENDER_MODE_IDX_1F: RENDER_MODE_SURFACE_OPA, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 // used by entity models Gfx Gfx_RM3_SURFACE_OPA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2), @@ -958,7 +990,7 @@ Gfx Gfx_RM3_SURFACE_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_21: RENDER_MODE_DECAL_OPA, TILE_MODE_3A / TILE_MODE_3B / TILE_MODE_1B / TILE_MODE_1C +// RENDER_MODE_IDX_21: RENDER_MODE_DECAL_OPA, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 // used by entity models Gfx Gfx_RM3_DECAL_OPA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_DECAL2), @@ -968,7 +1000,7 @@ Gfx Gfx_RM3_DECAL_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_23: RENDER_MODE_INTERSECTING_OPA, TILE_MODE_3A / TILE_MODE_3B / TILE_MODE_1B / TILE_MODE_1C +// RENDER_MODE_IDX_23: RENDER_MODE_INTERSECTING_OPA, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 // used by entity models Gfx Gfx_RM3_INTERSECTING_OPA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_INTER2), @@ -978,7 +1010,7 @@ Gfx Gfx_RM3_INTERSECTING_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_25: RENDER_MODE_ALPHATEST, TILE_MODE_3A / TILE_MODE_3B / TILE_MODE_1B / TILE_MODE_1C +// RENDER_MODE_IDX_25: RENDER_MODE_ALPHATEST, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 // used by entity models Gfx Gfx_RM3_ALPHATEST[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2), @@ -988,7 +1020,7 @@ Gfx Gfx_RM3_ALPHATEST[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_27: RENDER_MODE_SURFACE_XLU, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_27: RENDER_MODE_SURFACE_XLU, TEX_MODE_C0 / TEX_MODE_C1 // used by entity models Gfx Gfx_RM3_SURFACE_XLU[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2), @@ -998,7 +1030,7 @@ Gfx Gfx_RM3_SURFACE_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2A: RENDER_MODE_DECAL_XLU, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_2A: RENDER_MODE_DECAL_XLU, TEX_MODE_C0 / TEX_MODE_C1 // used by entity models Gfx Gfx_RM3_DECAL_XLU[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_DECAL2), @@ -1008,7 +1040,7 @@ Gfx Gfx_RM3_DECAL_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2C: RENDER_MODE_INTERSECTING_XLU, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_2C: RENDER_MODE_INTERSECTING_XLU, TEX_MODE_C0 / TEX_MODE_C1 // used by entity models Gfx Gfx_RM3_INTERSECTING_XLU[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_INTER2), @@ -1019,9 +1051,9 @@ Gfx Gfx_RM3_INTERSECTING_XLU[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_3A+, basic NO_AA variants +// TEX_MODE_C0+, basic NO_AA variants -//RENDER_MODE_IDX_20: RENDER_MODE_SURFACE_OPA_NO_AA, TILE_MODE_3A / TILE_MODE_3B +//RENDER_MODE_IDX_20: RENDER_MODE_SURFACE_OPA_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_SURFACE_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1030,7 +1062,7 @@ Gfx Gfx_RM3_SURFACE_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_22: RENDER_MODE_DECAL_OPA_NO_AA, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_22: RENDER_MODE_DECAL_OPA_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_DECAL_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1048,7 +1080,7 @@ Gfx Gfx_RM3_INTERSECTING_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_26: RENDER_MODE_ALPHATEST_ONESIDED, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_26: RENDER_MODE_ALPHATEST_ONESIDED, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_ALPHATEST_ONESIDED[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1056,7 +1088,7 @@ Gfx Gfx_RM3_ALPHATEST_ONESIDED[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_29: RENDER_MODE_SURFACE_XLU_NO_AA, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_29: RENDER_MODE_SURFACE_XLU_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_SURFACE_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1065,7 +1097,7 @@ Gfx Gfx_RM3_SURFACE_XLU_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2B: RENDER_MODE_DECAL_XLU_NO_AA, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_2B: RENDER_MODE_DECAL_XLU_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_DECAL_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1075,7 +1107,7 @@ Gfx Gfx_RM3_DECAL_XLU_NO_AA[] = { }; // ---------------------------------------------------------------------------- -// TILE_MODE_3A+, special modes +// TEX_MODE_C0+, special modes // RENDER_MODE_IDX_2D: unused Gfx Gfx_RM3_PASS_THROUGH[] = { @@ -1085,7 +1117,7 @@ Gfx Gfx_RM3_PASS_THROUGH[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_28: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_28: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_SURFACE_XLU_AA_ZB_ZUPD[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1094,7 +1126,7 @@ Gfx Gfx_RM3_SURFACE_XLU_AA_ZB_ZUPD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_34: RENDER_MODE_SURFACE_OPA_NO_ZB, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_34: RENDER_MODE_SURFACE_OPA_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_SURFACE_OPA_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1103,7 +1135,7 @@ Gfx Gfx_RM3_SURFACE_OPA_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_35: RENDER_MODE_ALPHATEST_NO_ZB, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_35: RENDER_MODE_ALPHATEST_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_ALPHATEST_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1112,7 +1144,7 @@ Gfx Gfx_RM3_ALPHATEST_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_36: RENDER_MODE_SURFACE_XLU_NO_ZB, TILE_MODE_3A / TILE_MODE_3B +// RENDER_MODE_IDX_36: RENDER_MODE_SURFACE_XLU_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 Gfx Gfx_RM3_SURFACE_XLU_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1121,7 +1153,7 @@ Gfx Gfx_RM3_SURFACE_XLU_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_3B: RENDER_MODE_CLOUD, TILE_MODE_3A / TILE_MODE_3B / TILE_MODE_1B / TILE_MODE_1C +// RENDER_MODE_IDX_3B: RENDER_MODE_CLOUD, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 Gfx Gfx_RM3_CLOUD[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1130,7 +1162,7 @@ Gfx Gfx_RM3_CLOUD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_3C: RENDER_MODE_CLOUD_NO_ZB, TILE_MODE_3A / TILE_MODE_3B / TILE_MODE_1B / TILE_MODE_1C +// RENDER_MODE_IDX_3C: RENDER_MODE_CLOUD_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 Gfx Gfx_RM3_CLOUD_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1256,18 +1288,6 @@ void build_custom_gfx(void); MATCHING_BSS(0x3A0); -enum { - TILE_MODE_STRIDE = 3, - TILE_MODE_1A = 1, // render modes are single-cycle - TILE_MODE_2A = 2, // render modes are two-cycle, starting with G_RM_PASS - TILE_MODE_3A = 3, // render modes are two-cycle, starting with G_RM_FOG_SHADE_A - TILE_MODE_1B = 4, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite - TILE_MODE_2B = 5, - TILE_MODE_3B = 6, - TILE_MODE_1C = 10, - TILE_MODE_2C = 11, -}; - void appendGfx_model(void* data) { Model* model = data; s32 mtxPushMode; @@ -1314,57 +1334,50 @@ void appendGfx_model(void* data) { if (textureHeader != NULL) { switch (extraTileType) { case EXTRA_TILE_NONE: - texturingMode = TILE_MODE_1A; + texturingMode = TEX_MODE_A0; break; case EXTRA_TILE_MIPMAPS: case EXTRA_TILE_AUX_SAME_AS_MAIN: case EXTRA_TILE_AUX_INDEPENDENT: - texturingMode = TILE_MODE_2A; + texturingMode = TEX_MODE_B0; break; default: - texturingMode = TILE_MODE_1A; + texturingMode = TEX_MODE_A0; break; } } else { - texturingMode = TILE_MODE_1A; + texturingMode = TEX_MODE_A0; } if (textureHeader != NULL || renderMode <= RENDER_MODE_ALPHATEST_NO_ZB) { if (gCurrentFogSettings->enabled && !(flags & MODEL_FLAG_40)) { - texturingMode = TILE_MODE_3A; - combineSubType = 1; + texturingMode = TEX_MODE_C0; + combineSubType = FOG_COMBINE_0; } } // fog mode switch ((u32)(model->customGfxIndex >> 4)) { case FOG_MODE_1: - texturingMode += TILE_MODE_STRIDE; - combineSubType = 2; + // promote TEX_MODE_X0 -> TEX_MODE_X1 + texturingMode += TEX_MODE_STRIDE; + combineSubType = FOG_COMBINE_1; break; case FOG_MODE_2: if (renderMode <= RENDER_MODE_ALPHATEST_NO_ZB) { - gDPSetPrimColor((*gfxPos)++, 0, 0, mdl_renderModelFogPrimColorR, - mdl_renderModelFogPrimColorG, - mdl_renderModelFogPrimColorB, - mdl_renderModelFogPrimColorA); - gDPSetFogColor((*gfxPos)++, mdl_renderModelFogColorR, - mdl_renderModelFogColorG, - mdl_renderModelFogColorB, 0); - gSPFogPosition((*gfxPos)++, mdl_renderModelFogStart, mdl_renderModelFogEnd); - texturingMode += TILE_MODE_STRIDE * 3; - combineSubType = 3; + gDPSetPrimColor((*gfxPos)++, 0, 0, mdl_Fog2PrimR, mdl_Fog2PrimG, mdl_Fog2PrimB, mdl_Fog2PrimA); + gDPSetFogColor((*gfxPos)++, mdl_Fog2ColR, mdl_Fog2ColG, mdl_Fog2ColB, 0); + gSPFogPosition((*gfxPos)++, mdl_Fog2Start, mdl_Fog2End); + // promote TEX_MODE_X0 -> TEX_MODE_A2 + texturingMode += TEX_MODE_STRIDE * 3; + combineSubType = FOG_COMBINE_2; } break; case FOG_MODE_3: - texturingMode = TILE_MODE_2A; - combineSubType = 4; - gDPSetPrimColor((*gfxPos)++, 0, 0, gRenderModelPrimR, - gRenderModelPrimG, - gRenderModelPrimB, 255); - gDPSetEnvColor((*gfxPos)++, gRenderModelEnvR, - gRenderModelEnvG, - gRenderModelEnvB, 255); + texturingMode = TEX_MODE_B0; + combineSubType = FOG_COMBINE_3; + gDPSetPrimColor((*gfxPos)++, 0, 0, mdl_Fog3PrimR, mdl_Fog3PrimG, mdl_Fog3PrimB, 255); + gDPSetEnvColor((*gfxPos)++, mdl_Fog3EnvR, mdl_Fog3EnvG, mdl_Fog3EnvB, 255); break; } @@ -1432,19 +1445,28 @@ void appendGfx_model(void* data) { gDPSetAlphaDither((*gfxPos)++, G_AD_PATTERN); } + // setup combine modes for main/aux texture blending when fog is enabled if (combineSubType != 0 || renderMode == RENDER_MODE_ALPHATEST || renderMode == RENDER_MODE_ALPHATEST_ONESIDED) { u32 combineType = 0; + // only the following aux combine modes are ever used: + // (A) 0x00 -> 0, 0 + // (B) 0x08 -> 2, 0 + // (C) 0x0D -> 3, 1 + // (D) 0x10 -> 4, 0 if (textureHeader != NULL) { - u32 colorCombineType = textureHeader->colorCombineType; - if (colorCombineType >= 3) { - combineType = colorCombineType + 10; + u32 auxCombineType = textureHeader->auxCombineType; + if (auxCombineType > 2) { + + combineType = 1 + 3 * AUX_COMBINE_SUB_COUNT + auxCombineType; } else { - combineType = extraTileType * 3 + 1 + textureHeader->colorCombineSubType; + // select based on aux combine subtypes + // in practice, auxCombineSubType is ALWAYS zero here since the only (A) and (B) may reach this block + combineType = 1 + extraTileType * AUX_COMBINE_SUB_COUNT + textureHeader->auxCombineSubType; } } - if (renderMode != RENDER_MODE_ALPHATEST && renderMode != RENDER_MODE_ALPHATEST_ONESIDED) { + if (!(renderMode == RENDER_MODE_ALPHATEST || renderMode == RENDER_MODE_ALPHATEST_ONESIDED)) { *(*gfxPos) = ModelCombineModesStandard[combineType][combineSubType]; } else { *(*gfxPos) = ModelCombineModesAlphaTest[combineType][combineSubType]; @@ -1453,7 +1475,7 @@ void appendGfx_model(void* data) { } switch (texturingMode) { - case TILE_MODE_1A: + case TEX_MODE_A0: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_00; @@ -1520,7 +1542,7 @@ void appendGfx_model(void* data) { } gSPDisplayList((*gfxPos)++, ModelRenderModes[renderModeIdx]); break; - case TILE_MODE_2A: + case TEX_MODE_B0: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_10; @@ -1584,7 +1606,7 @@ void appendGfx_model(void* data) { } gSPDisplayList((*gfxPos)++, ModelRenderModes[renderModeIdx]); break; - case TILE_MODE_3A: + case TEX_MODE_C0: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_1F; @@ -1653,8 +1675,8 @@ void appendGfx_model(void* data) { gCurrentFogSettings->color.a); gSPFogPosition((*gfxPos)++, gCurrentFogSettings->startDistance, gCurrentFogSettings->endDistance); break; - case TILE_MODE_1B: - case TILE_MODE_2B: + case TEX_MODE_A1: + case TEX_MODE_B1: if (mdl_bgMultiplyColorA == 255) { return; } @@ -1728,7 +1750,7 @@ void appendGfx_model(void* data) { 255); gSPFogPosition((*gfxPos)++, 970, 1000); break; - case TILE_MODE_3B: + case TEX_MODE_C1: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_1F; @@ -1802,8 +1824,8 @@ void appendGfx_model(void* data) { gDPSetFogColor(gMainGfxPos++, fogR, fogG, fogB, gCurrentFogSettings->color.a); gSPFogPosition((*gfxPos)++, fogMin, fogMax); break; - case TILE_MODE_1C: - case TILE_MODE_2C: + case TEX_MODE_A2: + case TEX_MODE_B2: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_1F; @@ -2315,12 +2337,12 @@ void clear_model_data(void) { } *gBackgroundFogModePtr = FOG_MODE_0; + gCurrentFogSettings->enabled = FALSE; gCurrentFogSettings->color.r = 10; gCurrentFogSettings->color.g = 10; gCurrentFogSettings->color.b = 10; - gCurrentFogSettings->startDistance = 950; - gCurrentFogSettings->enabled = FALSE; gCurrentFogSettings->color.a = 0; + gCurrentFogSettings->startDistance = 950; gCurrentFogSettings->endDistance = 1000; for (i = 0; i < ARRAY_COUNT(texPannerAuxV); i++) { @@ -2976,7 +2998,7 @@ void make_texture_gfx(TextureHeader* header, Gfx** gfxPos, IMG_PTR raster, PAL_P s32 mainWrapW, mainWrapH; s32 auxWrapW, auxWrapH; s32 extraTileType; - u32 renderType; + u32 auxCombineType; s32 lod; s32 lodDivisor; IMG_PTR rasterPtr; @@ -3048,14 +3070,14 @@ void make_texture_gfx(TextureHeader* header, Gfx** gfxPos, IMG_PTR raster, PAL_P lutMode = G_TT_NONE; } - renderType = header->colorCombineType; - if (renderType >= 3) { - renderType += 10; + auxCombineType = header->auxCombineType; + if (auxCombineType > 2) { + auxCombineType = 1 + 3 * AUX_COMBINE_SUB_COUNT + auxCombineType; } else { - renderType = header->extraTiles * 3 + 1 + header->colorCombineSubType; + auxCombineType = 1 + header->extraTiles * AUX_COMBINE_SUB_COUNT + header->auxCombineSubType; } - **gfxPos = ModelCombineModesStandard[renderType][0]; + **gfxPos = ModelCombineModesStandard[auxCombineType][0]; (*gfxPos)++; switch (extraTileType) { @@ -3602,13 +3624,13 @@ void set_model_group_visibility(u16 treeIndex, s32 flags, s32 mode) { } } -void func_8011B950(u16 modelID, s32 customGfxIndex, s32 fogType, s32 arg3) { +void func_8011B950(u16 modelID, s32 customGfxIndex, s32 fogType, b32 groupsOnly) { s32 maxGroupIndex = -1; s32 i; s32 minGroupIndex; s32 modelIndex = (*gCurrentModelTreeNodeInfo)[modelID].modelIndex; s32 siblingIndex; - s32 maskLow, maskHigh, packedFogType; + s32 maskLow, maskHigh, packed; if (modelIndex < MAX_MODELS - 1) { minGroupIndex = maxGroupIndex = modelIndex; @@ -3642,22 +3664,22 @@ void func_8011B950(u16 modelID, s32 customGfxIndex, s32 fogType, s32 arg3) { fogType = 0; } - packedFogType = customGfxIndex + (fogType << 4); + packed = customGfxIndex + (fogType << 4); - if (arg3 == 0) { + if (!groupsOnly) { for (i = minGroupIndex; i <= maxGroupIndex; i++) { Model* model = (*gCurrentModels)[i]; - model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packedFogType; + model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packed; } } else { for (i = 0; i < minGroupIndex; i++) { Model* model = (*gCurrentModels)[i]; - model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packedFogType; + model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packed; } for (i = maxGroupIndex + 1; i < MAX_MODELS; i++) { Model* model = (*gCurrentModels)[i]; if (model != NULL) { - model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packedFogType; + model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packed; } } } @@ -3741,14 +3763,14 @@ void set_aux_pan_v(s32 texPannerID, s32 value) { void set_mdl_custom_gfx_set(Model* model, s32 customGfxIndex, u32 fogType) { if (customGfxIndex == -1) { - customGfxIndex = model->customGfxIndex & 15; + customGfxIndex = model->customGfxIndex & 0xF; } if (fogType == -1) { - fogType = model->customGfxIndex / 16; + fogType = model->customGfxIndex >> 4; } - model->customGfxIndex = (customGfxIndex & 15) + ((fogType & 15) * 16); + model->customGfxIndex = (customGfxIndex & 0xF) + ((fogType & 0xF) << 4); } void set_custom_gfx(s32 customGfxIndex, Gfx* pre, Gfx* post) { @@ -3767,6 +3789,7 @@ void build_custom_gfx(void) { ModelCustomGfxBuilderFunc postFunc; s32 i; + // placeholder branch gSPBranchList(gMainGfxPos++, 0x00000000); for (i = 0; i < ARRAY_COUNT(*gCurrentCustomModelGfxPtr) / 2; i++) { @@ -3786,6 +3809,7 @@ void build_custom_gfx(void) { } } + // overwrite placeholder with final branch address gSPBranchList(gfx, gMainGfxPos); } @@ -3811,6 +3835,7 @@ s32 is_identity_fixed_mtx(Mtx* mtx) { return TRUE; } +// fog mode 1? void set_background_color_blend(u8 r, u8 g, u8 b, u8 a) { mdl_bgMultiplyColorR = r; mdl_bgMultiplyColorG = g; @@ -3825,47 +3850,47 @@ void get_background_color_blend(u8* r, u8* g, u8* b, u8* a) { *a = mdl_bgMultiplyColorA; } -void set_model_fog_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd) { - mdl_renderModelFogPrimColorR = primR; - mdl_renderModelFogPrimColorG = primG; - mdl_renderModelFogPrimColorB = primB; - mdl_renderModelFogPrimColorA = primA; - mdl_renderModelFogColorR = fogR; - mdl_renderModelFogColorG = fogG; - mdl_renderModelFogColorB = fogB; - mdl_renderModelFogStart = fogStart; - mdl_renderModelFogEnd = fogEnd; +void mdl_set_fog2_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd) { + mdl_Fog2PrimR = primR; + mdl_Fog2PrimG = primG; + mdl_Fog2PrimB = primB; + mdl_Fog2PrimA = primA; + mdl_Fog2ColR = fogR; + mdl_Fog2ColG = fogG; + mdl_Fog2ColB = fogB; + mdl_Fog2Start = fogStart; + mdl_Fog2End = fogEnd; } -void get_model_fog_color_parameters(u8* primR, u8* primG, u8* primB, u8* primA, u8* fogR, u8* fogG, u8* fogB, +void mdl_get_fog2_color_parameters(u8* primR, u8* primG, u8* primB, u8* primA, u8* fogR, u8* fogG, u8* fogB, s32* fogStart, s32* fogEnd) { - *primR = mdl_renderModelFogPrimColorR; - *primG = mdl_renderModelFogPrimColorG; - *primB = mdl_renderModelFogPrimColorB; - *primA = mdl_renderModelFogPrimColorA; - *fogR = mdl_renderModelFogColorR; - *fogG = mdl_renderModelFogColorG; - *fogB = mdl_renderModelFogColorB; - *fogStart = mdl_renderModelFogStart; - *fogEnd = mdl_renderModelFogEnd; + *primR = mdl_Fog2PrimR; + *primG = mdl_Fog2PrimG; + *primB = mdl_Fog2PrimB; + *primA = mdl_Fog2PrimA; + *fogR = mdl_Fog2ColR; + *fogG = mdl_Fog2ColG; + *fogB = mdl_Fog2ColB; + *fogStart = mdl_Fog2Start; + *fogEnd = mdl_Fog2End; } -void set_model_env_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { - gRenderModelPrimR = primR; - gRenderModelPrimG = primG; - gRenderModelPrimB = primB; - gRenderModelEnvR = envR; - gRenderModelEnvG = envG; - gRenderModelEnvB = envB; +void mdl_set_fog3_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { + mdl_Fog3PrimR = primR; + mdl_Fog3PrimG = primG; + mdl_Fog3PrimB = primB; + mdl_Fog3EnvR = envR; + mdl_Fog3EnvG = envG; + mdl_Fog3EnvB = envB; } -void get_model_env_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB) { - *primR = gRenderModelPrimR; - *primG = gRenderModelPrimG; - *primB = gRenderModelPrimB; - *envR = gRenderModelEnvR; - *envG = gRenderModelEnvG; - *envB = gRenderModelEnvB; +void mdl_get_fog3_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB) { + *primR = mdl_Fog3PrimR; + *primG = mdl_Fog3PrimG; + *primB = mdl_Fog3PrimB; + *envR = mdl_Fog3EnvR; + *envG = mdl_Fog3EnvG; + *envB = mdl_Fog3EnvB; } void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, Vtx** baseVtx, s32* gfxCount, Vtx* baseAddr) { @@ -4436,7 +4461,7 @@ void mdl_set_all_fog_mode(s32 fogMode) { model = (*modelList)[i]; if (model != NULL) { - set_mdl_custom_gfx_set(model, -1, fogType); + set_mdl_custom_gfx_set(model, CUSTOM_GFX_NONE, fogType); } } } diff --git a/src/msg.c b/src/msg.c index 3b399f72d3d..970f4ee13f3 100644 --- a/src/msg.c +++ b/src/msg.c @@ -3785,7 +3785,7 @@ void appendGfx_msg_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 ulX, u16 ulY, u16 lrX, gDPPipeSync(gMainGfxPos++); if (a == 255) { - gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA); } else { gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); diff --git a/src/pause/pause_gfx.c b/src/pause/pause_gfx.c index ad10d11fbfa..bb32439e55d 100644 --- a/src/pause/pause_gfx.c +++ b/src/pause/pause_gfx.c @@ -232,7 +232,7 @@ Gfx PauseGfxPathPoints[] = { gsDPSetTextureFilter(G_TF_POINT), gsDPSetTextureConvert(G_TC_FILT), gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), - gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0), + gsDPSetCombineMode(PM_CC_2F, PM_CC_2F), gsDPSetTextureLUT(G_TT_NONE), gsDPLoadTextureTile(pause_map_location_png, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, 0, 15, 15, 0, G_TX_CLAMP, G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD), gsDPSetTextureLUT(G_TT_NONE), diff --git a/src/screen_overlays.c b/src/screen_overlays.c index 45cf5a123f4..552fddc3e6b 100644 --- a/src/screen_overlays.c +++ b/src/screen_overlays.c @@ -34,7 +34,7 @@ Gfx Gfx_LoadStencilTex_CommonParams[] = { gsDPSetTexturePersp(G_TP_NONE), gsDPSetColorDither(G_CD_MAGICSQ), gsDPSetAlphaDither(G_AD_PATTERN), - gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIMITIVE, TEXEL0), + gsDPSetCombineMode(PM_CC_3A, PM_CC_3A), gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA), gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH), @@ -87,7 +87,7 @@ Gfx D_8014E8F0[] = { gsDPSetDepthSource(G_ZS_PRIM), gsDPSetPrimDepth(0, 0), gsDPSetRenderMode(Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_MEM, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_MEM, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), - gsDPSetCombineLERP(0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0), + gsDPSetCombineMode(PM_CC_3B, PM_CC_3B), gsDPSetTexturePersp(G_TP_PERSP), gsDPSetTextureDetail(G_TD_CLAMP), gsDPSetTextureLOD(G_TL_TILE), @@ -111,7 +111,7 @@ Gfx D_8014E9A8[] = { gsDPSetDepthSource(G_ZS_PRIM), gsDPSetPrimDepth(20, 0), gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2), - gsDPSetCombineLERP(0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0), + gsDPSetCombineMode(PM_CC_3B, PM_CC_3B), gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING | G_SHADING_SMOOTH), gsSPSetGeometryMode(G_ZBUFFER | G_SHADE), gsDPSetColorDither(G_CD_MAGICSQ), diff --git a/src/screen_render_util.c b/src/screen_render_util.c index 7044715ed1a..ea92f4064e8 100644 --- a/src/screen_render_util.c +++ b/src/screen_render_util.c @@ -158,7 +158,7 @@ void appendGfx_darkness_stencil(b32 isWorld, s32 posX, s32 posY, f32 alpha, f32 gSPDisplayList(gMainGfxPos++, Gfx_DarknessStencilQuad); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gDPPipeSync(gMainGfxPos++); - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_56, PM_CC_56); for (i = 0; i < 2; i++) { f32 f20; @@ -218,9 +218,9 @@ void appendGfx_darkness_stencil(b32 isWorld, s32 posX, s32 posY, f32 alpha, f32 gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); if (alpha != 255.0f || isWorld == 1) { - gDPSetCombineLERP(gMainGfxPos++, 1, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, PRIMITIVE, 1, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, PRIMITIVE); + gDPSetCombineMode(gMainGfxPos++, PM_CC_57, PM_CC_57); } else { - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, 1, 0, ENVIRONMENT, PRIMITIVE, 0, 0, 0, 0, 1, 0, ENVIRONMENT, PRIMITIVE); + gDPSetCombineMode(gMainGfxPos++, PM_CC_58, PM_CC_58); } alpha *= 0.5f; gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha * 0.5f * progress / 255.0f); @@ -269,7 +269,7 @@ void appendGfx_screen_transition_stencil(s32 arg0, s32 arg1, f32 progress, s32 p gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2); if (progress == 255.0f) { - gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA); } gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, primA); texScale = (255.0f - progress) * 10.5f / 255.0f + 0.09; // range from diff --git a/src/sprite.c b/src/sprite.c index afabc171234..3083048e6ae 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -294,7 +294,7 @@ void spr_appendGfx_component_flat( gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha); - gDPSetCombineLERP(gMainGfxPos++, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_3D, PM_CC_3D); gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ); } } @@ -782,7 +782,7 @@ void spr_init_sprites(s32 playerSpriteSet) { spr_playerMaxComponents = 0; - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { + if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) { playerSpriteSet = PLAYER_SPRITES_PEACH_WORLD; } diff --git a/src/sprite_shading.c b/src/sprite_shading.c index 6f9da93155d..4cf98bb4992 100644 --- a/src/sprite_shading.c +++ b/src/sprite_shading.c @@ -384,7 +384,7 @@ void appendGfx_shading_palette( } gDPSetPrimColor(gMainGfxPos++, 0, 0, shadowR, shadowG, shadowB, alpha); - gDPSetCombineLERP(gMainGfxPos++, TEXEL1, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, COMBINED, TEXEL0, COMBINED_ALPHA, TEXEL0, PRIMITIVE, 0, TEXEL0, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_53, PM_CC_54); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, SpriteShadingPalette); gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, 16, 1); @@ -396,7 +396,7 @@ void appendGfx_shading_palette( gDPSetPrimColor(gMainGfxPos++, 0, 0, shadowR, shadowG, shadowB, alpha); gDPSetEnvColor(gMainGfxPos++, highlightR, highlightG, highlightB, 0); - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, ENVIRONMENT, TEXEL0_ALPHA, ENVIRONMENT, 0, 0, 0, 1, PRIMITIVE, ENVIRONMENT, TEXEL0_ALPHA, ENVIRONMENT, 0, 0, 0, 1); + gDPSetCombineMode(gMainGfxPos++, PM_CC_55, PM_CC_55); gSPTextureRectangle(gMainGfxPos++, 0, 0, 16 << 2, 1 << 2, 2, 0, 0, 4 << 10, 1 << 10); gDPPipeSync(gMainGfxPos++); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr)); @@ -419,9 +419,9 @@ void appendGfx_shading_palette( gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255); if (alpha == 255) { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, TEXEL1, SHADE, ENVIRONMENT, COMBINED, COMBINED, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_50, PM_CC_52); } else { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, TEXEL1, 0, PRIMITIVE, 0, TEXEL1, 0, SHADE, ENVIRONMENT, COMBINED, COMBINED, 0, 0, 0, COMBINED); + gDPSetCombineMode(gMainGfxPos++, PM_CC_51, PM_CC_52); } offsetX = offsetXComp * facingDir; diff --git a/src/state_battle.c b/src/state_battle.c index 462351a5a77..1f74b1fe758 100644 --- a/src/state_battle.c +++ b/src/state_battle.c @@ -72,9 +72,9 @@ void state_step_battle(void) { currentBattleSelection = UNPACK_BTL_AREA(gCurrentBattleID); currentBattleIndex = UNPACK_BTL_INDEX(gCurrentBattleID); - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH || + if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH || (currentBattleSelection == BTL_AREA_KKJ && currentBattleIndex == 0)) { - gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_IS_PEACH; + gGameStatusPtr->peachFlags |= PEACH_FLAG_IS_PEACH; spr_init_sprites(PLAYER_SPRITES_PEACH_BATTLE); } else { spr_init_sprites(PLAYER_SPRITES_MARIO_BATTLE); @@ -152,7 +152,7 @@ void state_step_end_battle(void) { func_8005AF84(); func_8002ACDC(); sfx_clear_env_sounds(1); - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_IS_PEACH; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_IS_PEACH; battle_heap_create(); spr_init_sprites(gGameStatusPtr->playerSpriteSet); init_model_data(); @@ -190,7 +190,7 @@ void state_step_end_battle(void) { load_map_bg(mapConfig->bgName); if (mapSettings->background != NULL) { - read_background_size(mapSettings->background); + set_background(mapSettings->background); } else { set_background_size(296, 200, 12, 20); } diff --git a/src/state_demo.c b/src/state_demo.c index 034adf738fb..22041b3c7cf 100644 --- a/src/state_demo.c +++ b/src/state_demo.c @@ -247,7 +247,7 @@ void state_step_demo(void) { gGameStatusPtr->areaID = areaID; gGameStatusPtr->mapID = mapID; gGameStatusPtr->entryID = demoSceneData->index; - gGameStatusPtr->peachFlags = PEACH_STATUS_FLAG_IS_PEACH; + gGameStatusPtr->peachFlags = PEACH_FLAG_IS_PEACH; playerData->curPartner = demoSceneData->partnerID; set_cam_viewport(CAM_DEFAULT, 29, 20, -262, 177); evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress); diff --git a/src/state_file_select.c b/src/state_file_select.c index 2e4b77e8728..0a6a82fcd5f 100644 --- a/src/state_file_select.c +++ b/src/state_file_select.c @@ -323,7 +323,7 @@ void state_step_exit_language_select(void) { bgHeader = mapSettings->background; if (bgHeader != NULL) { - read_background_size(bgHeader); + set_background(bgHeader); } else { set_background_size(296, 200, 12, 20); } diff --git a/src/state_pause.c b/src/state_pause.c index 073fc58db5c..7c0539c214b 100644 --- a/src/state_pause.c +++ b/src/state_pause.c @@ -197,7 +197,7 @@ void state_step_unpause(void) { load_map_bg(mapConfig->bgName); if (mapSettings->background != NULL) { - read_background_size(mapSettings->background); + set_background(mapSettings->background); } else { set_background_size(296, 200, 12, 20); } diff --git a/src/state_title_screen.c b/src/state_title_screen.c index cc2f0a56c8b..4d2b41dbd0e 100644 --- a/src/state_title_screen.c +++ b/src/state_title_screen.c @@ -184,7 +184,7 @@ void state_init_title_screen(void) { gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME; game_mode_set_fpDrawAuxUI(0, appendGfx_title_screen); load_map_bg("title_bg"); - read_background_size(&gBackgroundImage); + set_background(&gBackgroundImage); bgm_set_song(0, SONG_MAIN_THEME, 0, 500, 8); TitleScreen_TimeLeft = 480; } diff --git a/src/world/action/idle.c b/src/world/action/idle.c index 14ca11edb72..8f0b714a0a8 100644 --- a/src/world/action/idle.c +++ b/src/world/action/idle.c @@ -115,7 +115,7 @@ void action_update_idle_peach(void) { playerStatus->flags &= ~PS_FLAG_AIRBORNE; if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { - if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { + if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_DEPRESSED)) { suggest_player_anim_allow_backward(IdlePeachAnims[gGameStatusPtr->peachBakingIngredient]); } else { suggest_player_anim_allow_backward(ANIM_Peach2_SadStill); diff --git a/src/world/action/sneaky_parasol.c b/src/world/action/sneaky_parasol.c index de3a668ea55..91493fc44f6 100644 --- a/src/world/action/sneaky_parasol.c +++ b/src/world/action/sneaky_parasol.c @@ -48,17 +48,17 @@ Npc* parasol_get_npc(void) { Npc* ret = NULL; do { // TODO fix this do...while if (playerStatus->availableDisguiseType != PEACH_DISGUISE_NONE) { - if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_8) { - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_8; + if (gGameStatusPtr->peachFlags & PEACH_FLAG_BLOCK_NEXT_DISGUISE) { + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_BLOCK_NEXT_DISGUISE; } else { ret = npc_find_closest(playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 100.0f); if (ret != 0) { if (fabs(ret->pos.y - playerStatus->pos.y) - 1.0 > 0.0) { - ret = 0; + ret = NULL; } else { angle = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, ret->pos.x, ret->pos.z)); if (fabs(angle - func_800E5348()) > 30.0) { - ret = 0; + ret = NULL; } } } @@ -189,7 +189,7 @@ void action_update_parasol(void) { case SUBSTATE_DISGUISE_MAKE_NPC: gameStatus = gGameStatusPtr; playerStatus->animFlags |= PA_FLAG_INVISIBLE; - gameStatus->peachFlags |= PEACH_STATUS_FLAG_DISGUISED; + gameStatus->peachFlags |= PEACH_FLAG_DISGUISED; playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_SPIN_DOWN case SUBSTATE_DISGUISE_SPIN_DOWN: if (--playerStatus->curStateTime == 0) { @@ -265,7 +265,7 @@ void action_update_parasol(void) { playerStatus->actionSubstate++; // SUBSTATE_SPIN_DOWN gameStatus2 = gGameStatusPtr; playerStatus->animFlags &= ~PA_FLAG_INVISIBLE; - gameStatus2->peachFlags &= ~PEACH_STATUS_FLAG_DISGUISED; + gameStatus2->peachFlags &= ~PEACH_FLAG_DISGUISED; playerStatus->peachDisguise = 0; free_npc_by_index(PeachDisguiseNpcIndex); playerStatus->colliderHeight = 55; diff --git a/src/world/action/step_up.c b/src/world/action/step_up.c index 82530640468..4a8705ba974 100644 --- a/src/world/action/step_up.c +++ b/src/world/action/step_up.c @@ -78,7 +78,7 @@ void action_update_step_up(void) { void func_802B6198_E24768(void) { if (!(gPlayerStatus.animFlags & PA_FLAG_INVISIBLE)) { - if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { + if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_DEPRESSED)) { suggest_player_anim_allow_backward(StepUpPeachAnims[gGameStatusPtr->peachBakingIngredient]); } else { suggest_player_anim_allow_backward(ANIM_Peach3_WalkSad); diff --git a/src/world/action/walk.c b/src/world/action/walk.c index 07bf721483d..70229c28c30 100644 --- a/src/world/action/walk.c +++ b/src/world/action/walk.c @@ -200,7 +200,7 @@ void action_update_run(void) { void func_802B6550_E23C30(void) { if (!(gPlayerStatus.animFlags & PA_FLAG_INVISIBLE)) { - if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { + if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_DEPRESSED)) { suggest_player_anim_allow_backward(WalkPeachAnims[gGameStatusPtr->peachBakingIngredient]); return; } @@ -263,7 +263,7 @@ static void action_update_run_peach(void) { if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { gameStatus = gGameStatusPtr; - if (!(gameStatus->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { + if (!(gameStatus->peachFlags & PEACH_FLAG_DEPRESSED)) { if (!gameStatus->peachBakingIngredient) { suggest_player_anim_allow_backward(ANIM_Peach1_Run); } else { diff --git a/src/world/area_dro/dro_01/dro_01_2_main.c b/src/world/area_dro/dro_01/dro_01_2_main.c index 65d15c2aba6..09d90199bc3 100644 --- a/src/world/area_dro/dro_01/dro_01_2_main.c +++ b/src/world/area_dro/dro_01/dro_01_2_main.c @@ -30,9 +30,9 @@ EvtScript N(EVS_Scene_RuinsRising) = { EVT_CALL(SetPanTarget, CAM_DEFAULT, 175, 0, -201) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc26), 3, 44, 32, 177, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2)) diff --git a/src/world/area_dro/dro_02/dro_02_3_main.c b/src/world/area_dro/dro_02/dro_02_3_main.c index 685deb8c96f..72fde551afa 100644 --- a/src/world/area_dro/dro_02/dro_02_3_main.c +++ b/src/world/area_dro/dro_02/dro_02_3_main.c @@ -26,9 +26,9 @@ EvtScript N(EVS_EnterScene) = { EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-10.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc26), 3, 44, 32, 177, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2)) diff --git a/src/world/area_end/end_01/end_01_4_opera_float.c b/src/world/area_end/end_01/end_01_4_opera_float.c index 8d24445d647..abadac9b08f 100644 --- a/src/world/area_end/end_01/end_01_4_opera_float.c +++ b/src/world/area_end/end_01/end_01_4_opera_float.c @@ -5,7 +5,7 @@ extern s32 N(SpotlightsAlpha); API_CALLABLE(N(SetWorldDark)) { - func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_1, 0); + func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_1, FALSE); 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, CUSTOM_GFX_NONE, FOG_MODE_0, 0); + func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_0, FALSE); return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; @@ -111,7 +111,7 @@ API_CALLABLE(N(SetSpotlightsAlpha)) { } void N(gfx_build_set_spotlight_alpha)(void) { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, SHADE, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_3F, PM_CC_3F); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, N(SpotlightsAlpha)); } diff --git a/src/world/area_end/end_01/end_01_6_shyguy_float.c b/src/world/area_end/end_01/end_01_6_shyguy_float.c index badea4be334..e1d74784a0a 100644 --- a/src/world/area_end/end_01/end_01_6_shyguy_float.c +++ b/src/world/area_end/end_01/end_01_6_shyguy_float.c @@ -32,7 +32,7 @@ EvtScript N(EVS_TexPan_ShyGuyFloat_Top) = { s32 N(ShyGuyFloat_InteriorModels)[] = { MODEL_omo7, MODEL_omo9, MODEL_omo10, MODEL_omo11, - MODEL_omo12, MODEL_omo13, MODEL_omo14, 0x0000FFFF + MODEL_omo12, MODEL_omo13, MODEL_omo14, 0xFFFF }; EvtScript N(EVS_ShyGuyFloat_Open) = { @@ -58,10 +58,10 @@ EvtScript N(EVS_ShyGuyFloat_Open) = { EVT_END_IF EVT_END_LOOP EVT_END_THREAD - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(ShyGuyFloat_InteriorModels)), FOG_MODE_3) - EVT_CALL(N(UnkFunc26), 3, 255, 255, 255, 120, 120, 80, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(ShyGuyFloat_InteriorModels)), FOG_MODE_3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 255, 255, 255, 120, 120, 80, 0, 0, 0) EVT_WAIT(30) - EVT_CALL(N(UnkFunc26), 3, 255, 255, 255, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 255, 255, 255, 0, 0, 0, 0, 0, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_flo/flo_10/flo_10_6_waterfx.c b/src/world/area_flo/flo_10/flo_10_6_waterfx.c index 2085d39c74c..25e226392cb 100644 --- a/src/world/area_flo/flo_10/flo_10_6_waterfx.c +++ b/src/world/area_flo/flo_10/flo_10_6_waterfx.c @@ -230,7 +230,7 @@ void N(UnkModelFunc001)(void) { gDPSetRenderMode(gMainGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer)); - gDPSetCombineMode(gMainGfxPos++, PM_CC_09, PM_CC_09); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_NO_ALPHA, PM_CC_PRIM_NO_ALPHA); gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 240, 0); gDPPipeSync(gMainGfxPos++); diff --git a/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c b/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c index 246f6846515..b7be63417c6 100644 --- a/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c +++ b/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c @@ -10,7 +10,7 @@ void N(setup_gfx_background_shade)(void) { alpha = 216; } gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_HOS_BG_SHADE, PM_CC_HOS_BG_SHADE); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha); } diff --git a/src/world/area_hos/hos_05/hos_05_5_intro.c b/src/world/area_hos/hos_05/hos_05_5_intro.c index f4f311b8fb9..1cb2d9170ae 100644 --- a/src/world/area_hos/hos_05/hos_05_5_intro.c +++ b/src/world/area_hos/hos_05/hos_05_5_intro.c @@ -217,7 +217,7 @@ API_CALLABLE(N(SetWorldFogParams)) { s32 fogStart = evt_get_variable(script, *args++); s32 fogEnd = evt_get_variable(script, *args++); - set_model_fog_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); + mdl_set_fog2_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); return ApiStatus_DONE2; } @@ -231,7 +231,7 @@ API_CALLABLE(N(SetWorldColorParams)) { args = script->ptrReadPos; if (isInitialCall) { - get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); newPrimR = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++); @@ -247,7 +247,7 @@ API_CALLABLE(N(SetWorldColorParams)) { return ApiStatus_DONE2; } time++; - set_model_env_color_parameters( + mdl_set_fog3_color_parameters( (oldPrimR + ((newPrimR - oldPrimR) * time) / duration), (oldPrimG + ((newPrimG - oldPrimG) * time) / duration), (oldPrimB + ((newPrimB - oldPrimB) * time) / duration), @@ -258,7 +258,7 @@ API_CALLABLE(N(SetWorldColorParams)) { return ApiStatus_DONE2; } } else { - set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return ApiStatus_DONE2; } return ApiStatus_BLOCK; @@ -1442,7 +1442,7 @@ void N(worker_draw_story_graphics)(void) { } get_screen_overlay_params(SCREEN_LAYER_BACK, &overlayType, &overlayAlpha); if (overlayAlpha != 0.0f) { - gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1); + gDPSetCombineMode(gMainGfxPos++, PM_CC_43, PM_CC_43); gDPSetPrimColor(gMainGfxPos++, 0, 0, 208, 208, 208, (s32) overlayAlpha); } diff --git a/src/world/area_hos/hos_05/hos_05_7_model_fx.c b/src/world/area_hos/hos_05/hos_05_7_model_fx.c index 0a6ecae9c35..5e3f537728b 100644 --- a/src/world/area_hos/hos_05/hos_05_7_model_fx.c +++ b/src/world/area_hos/hos_05/hos_05_7_model_fx.c @@ -20,7 +20,7 @@ API_CALLABLE(N(SetWorldColorParams)) { args = script->ptrReadPos; if (isInitialCall) { - get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); newPrimR = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++); @@ -33,7 +33,7 @@ API_CALLABLE(N(SetWorldColorParams)) { if (duration > 0) { time++; - set_model_env_color_parameters( + mdl_set_fog3_color_parameters( oldPrimR + ((newPrimR - oldPrimR) * time) / duration, oldPrimG + ((newPrimG - oldPrimG) * time) / duration, oldPrimB + ((newPrimB - oldPrimB) * time) / duration, @@ -44,7 +44,7 @@ API_CALLABLE(N(SetWorldColorParams)) { return ApiStatus_DONE2; } } else { - set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c index a07df90d9a8..fdc0cd058cd 100644 --- a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c +++ b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c @@ -418,14 +418,14 @@ API_CALLABLE(N(RefundHintCoins)) { API_CALLABLE(N(func_802418E8_A3ADC8)) { if (isInitialCall) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), -1, FOG_MODE_3); - set_model_env_color_parameters(255, 255, 255, 0, 0, 0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, FOG_MODE_3); + mdl_set_fog3_color_parameters(255, 255, 255, 0, 0, 0); script->functionTemp[0] = 255; } @@ -433,7 +433,7 @@ API_CALLABLE(N(func_802418E8_A3ADC8)) { if (script->functionTemp[0] < 64) { script->functionTemp[0] = 64; } - set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 64) { return ApiStatus_DONE2; } @@ -468,7 +468,7 @@ API_CALLABLE(N(func_80241A58_A3AF38)) { script->functionTemp[2] = 0; } } - set_model_env_color_parameters( + mdl_set_fog3_color_parameters( script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[2], script->functionTemp[2], script->functionTemp[2] ); @@ -487,16 +487,16 @@ API_CALLABLE(N(func_80241B74_A3B054)) { if (script->functionTemp[0] > 255) { script->functionTemp[0] = 255; } - set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 255) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), -1, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, FOG_MODE_0); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_isk/isk_16/isk_16_3_boss.c b/src/world/area_isk/isk_16/isk_16_3_boss.c index 6912801a20f..a0b012efbb0 100644 --- a/src/world/area_isk/isk_16/isk_16_3_boss.c +++ b/src/world/area_isk/isk_16/isk_16_3_boss.c @@ -6,9 +6,9 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePartnerAI, 0) - EVT_CALL(N(UnkFunc27), 0, -1, FOG_MODE_1) - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_1) - EVT_CALL(N(UnkFunc26), 1, 0, 0, 0, 255, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, -1, FOG_MODE_1) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_1) + EVT_CALL(N(UnkFunc26), FOG_MODE_1, 0, 0, 0, 255, 0, 0, 0, 0, 0) EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 410, -910, 410) EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0)) EVT_CALL(SetPanTarget, CAM_DEFAULT, 336, -910, 467) @@ -54,25 +54,21 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_CALL(SetNpcAnimation, NPC_Tutankoopa_02, ANIM_Tutankoopa_HeaddressWithEyes) EVT_CALL(MakeLerp, 0, 255, 100 * DT, EASING_QUADRATIC_IN) EVT_LABEL(2) - EVT_CALL(UpdateLerp) - EVT_CALL(SetNpcImgFXParams, NPC_Tutankoopa_02, IMGFX_SET_ALPHA, LVar0, 0, 0, 0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(2) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(SetNpcImgFXParams, NPC_Tutankoopa_02, IMGFX_SET_ALPHA, LVar0, 0, 0, 0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(2) + EVT_END_IF EVT_CALL(SetNpcImgFXParams, NPC_Tutankoopa_02, IMGFX_CLEAR, 0, 0, 0, 0) EVT_WAIT(30 * DT) EVT_SET(LVar0, 255) EVT_LOOP(60 * DT) -#if VERSION_PAL - EVT_ADD(LVar0, -5) -#else - EVT_ADD(LVar0, -4) -#endif - EVT_CALL(N(UnkFunc26), 1, 0, 0, 0, LVar0, 0, 0, 0, 0, 0) + EVT_ADD(LVar0, -4 * DT) + EVT_CALL(N(UnkFunc26), FOG_MODE_1, 0, 0, 0, LVar0, 0, 0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(N(UnkFunc26), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc26), FOG_MODE_1, 0, 0, 0, 0, 0, 0, 0, 0, 0) EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(530.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5 / DT)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) @@ -83,28 +79,28 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_CALL(GetNpcPos, NPC_Tutankoopa_02, LVar2, LVar3, LVar4) EVT_CALL(MakeLerp, 0, 110, 100 * DT, EASING_COS_IN_OUT) EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_ADD(LVar0, LVar3) - EVT_CALL(SetNpcPos, NPC_Tutankoopa_02, LVar2, LVar0, LVar4) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_ADD(LVar0, LVar3) + EVT_CALL(SetNpcPos, NPC_Tutankoopa_02, LVar2, LVar0, LVar4) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF EVT_CALL(GetNpcPos, NPC_Tutankoopa_02, LVar2, LVar3, LVar4) EVT_CALL(MakeLerp, 0, 100, 60 * DT, EASING_COS_IN_OUT) EVT_LABEL(1) - EVT_CALL(UpdateLerp) - EVT_SETF(LVar5, EVT_FLOAT(0.47)) - EVT_SETF(LVar6, EVT_FLOAT(-0.94)) - EVT_MULF(LVar5, LVar0) - EVT_MULF(LVar6, LVar0) - EVT_ADDF(LVar5, LVar2) - EVT_ADDF(LVar6, LVar4) - EVT_CALL(SetNpcPos, NPC_Tutankoopa_02, LVar5, LVar3, LVar6) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(1) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_SETF(LVar5, EVT_FLOAT(0.47)) + EVT_SETF(LVar6, EVT_FLOAT(-0.94)) + EVT_MULF(LVar5, LVar0) + EVT_MULF(LVar6, LVar0) + EVT_ADDF(LVar5, LVar2) + EVT_ADDF(LVar6, LVar4) + EVT_CALL(SetNpcPos, NPC_Tutankoopa_02, LVar5, LVar3, LVar6) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(1) + EVT_END_IF EVT_CALL(SetNpcPos, NPC_Tutankoopa_01, 457, -800, 316) EVT_CALL(SetNpcAnimation, NPC_Tutankoopa_01, ANIM_Tutankoopa_Idle) EVT_THREAD diff --git a/src/world/area_jan/jan_16/jan_16_2_main.c b/src/world/area_jan/jan_16/jan_16_2_main.c index 669c8828f0d..c25d9fe15bd 100644 --- a/src/world/area_jan/jan_16/jan_16_2_main.c +++ b/src/world/area_jan/jan_16/jan_16_2_main.c @@ -142,9 +142,9 @@ EvtScript N(EVS_Main) = { EVT_EXEC_WAIT(N(EVS_SetupMusic)) EVT_EXEC(N(EVS_SetupBushes)) EVT_EXEC(N(EVS_SpawnButterflies)) - EVT_CALL(N(UnkFunc27), 0, -1, 3) - EVT_CALL(N(UnkFunc27), 2, 0, 3) - EVT_CALL(N(UnkFunc26), 3, 255, 255, 255, 0, 0, 25, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, -1, 3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, 3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 255, 255, 255, 0, 0, 25, 0, 0, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kkj/common/PreventNextPeachDisguise.inc.c b/src/world/area_kkj/common/PreventNextPeachDisguise.inc.c new file mode 100644 index 00000000000..b410dfe4da3 --- /dev/null +++ b/src/world/area_kkj/common/PreventNextPeachDisguise.inc.c @@ -0,0 +1,8 @@ +#include "common.h" + +API_CALLABLE(N(PreventNextPeachDisguise)) { + GameStatus* gameStatus = gGameStatusPtr; + + gameStatus->peachFlags |= PEACH_FLAG_BLOCK_NEXT_DISGUISE; + return ApiStatus_DONE2; +} diff --git a/src/world/area_kkj/common/RestoreFromPeachState.inc.c b/src/world/area_kkj/common/RestoreFromPeachState.inc.c index 38a7e58e5eb..5d24394b44c 100644 --- a/src/world/area_kkj/common/RestoreFromPeachState.inc.c +++ b/src/world/area_kkj/common/RestoreFromPeachState.inc.c @@ -1,7 +1,7 @@ #include "common.h" API_CALLABLE(N(RestoreFromPeachState)) { - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_IS_PEACH; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_IS_PEACH; gPlayerData.curPartner = script->varTable[0]; return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/common/SetPeachFlag8.inc.c b/src/world/area_kkj/common/SetPeachFlag8.inc.c deleted file mode 100644 index 5d5d63c7522..00000000000 --- a/src/world/area_kkj/common/SetPeachFlag8.inc.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "common.h" - -API_CALLABLE(N(SetPeachFlag8)) { - GameStatus* gameStatus = gGameStatusPtr; - - gameStatus->peachFlags |= PEACH_STATUS_FLAG_8; - return ApiStatus_DONE2; -} diff --git a/src/world/area_kkj/kkj_10/kkj_10_4_npcs_later.c b/src/world/area_kkj/kkj_10/kkj_10_4_npcs_later.c index 02d6d3d44df..89bafcc484d 100644 --- a/src/world/area_kkj/kkj_10/kkj_10_4_npcs_later.c +++ b/src/world/area_kkj/kkj_10/kkj_10_4_npcs_later.c @@ -22,14 +22,14 @@ AnimID N(ExtraAnims_Koopatrol)[] = { #include "../common/Searchlights.inc.c" #include "world/common/todo/GetPeachDisguise.inc.c" -#include "../common/SetPeachFlag8.inc.c" +#include "../common/PreventNextPeachDisguise.inc.c" #include "../common/ApproachPlayer100Units.inc.c" EvtScript N(EVS_CapturePeach) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_SET_GROUP(EVT_GROUP_00) EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL) - EVT_CALL(N(SetPeachFlag8)) + EVT_CALL(N(PreventNextPeachDisguise)) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_EMOTE_IDEA, SOUND_SPACE_DEFAULT) EVT_CALL(ShowEmote, NPC_SELF, EMOTE_EXCLAMATION, 0, 20, EMOTER_NPC, 0, 0, 0, 0) EVT_CALL(NpcFacePlayer, NPC_SELF, 5) diff --git a/src/world/area_kkj/kkj_11/kkj_11_6_npcs_later.c b/src/world/area_kkj/kkj_11/kkj_11_6_npcs_later.c index bf6bf88d6e1..91eae9d64d9 100644 --- a/src/world/area_kkj/kkj_11/kkj_11_6_npcs_later.c +++ b/src/world/area_kkj/kkj_11/kkj_11_6_npcs_later.c @@ -3,7 +3,7 @@ #include "../common/Searchlights.inc.c" #include "world/common/todo/GetPeachDisguise.inc.c" -#include "../common/SetPeachFlag8.inc.c" +#include "../common/PreventNextPeachDisguise.inc.c" #include "../common/ApproachPlayer100Units.inc.c" #include "world/common/enemy/Koopatrol_Stationary.inc.c" @@ -26,7 +26,7 @@ AnimID N(ExtraAnims_Koopatrol)[] = { EvtScript N(EVS_CapturePeach) = { EVT_CALL(DisablePlayerInput, TRUE) - EVT_CALL(N(SetPeachFlag8)) + EVT_CALL(N(PreventNextPeachDisguise)) EVT_SET_GROUP(EVT_GROUP_00) EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_EMOTE_IDEA, SOUND_SPACE_DEFAULT) diff --git a/src/world/area_kkj/kkj_12/kkj_12_2_npc.c b/src/world/area_kkj/kkj_12/kkj_12_2_npc.c index a8a64b6b647..e59073437cb 100644 --- a/src/world/area_kkj/kkj_12/kkj_12_2_npc.c +++ b/src/world/area_kkj/kkj_12/kkj_12_2_npc.c @@ -4,7 +4,7 @@ #include "../common/Searchlights.inc.c" #include "world/common/todo/GetPeachDisguise.inc.c" -#include "../common/SetPeachFlag8.inc.c" +#include "../common/PreventNextPeachDisguise.inc.c" #include "../common/ApproachPlayer100Units.inc.c" API_CALLABLE(N(DisableLightSource1)) { @@ -114,7 +114,7 @@ EvtScript N(EVS_NpcInteract_Koopatrol_02) = { EvtScript N(EVS_CapturePeach) = { EVT_CALL(DisablePlayerInput, TRUE) - EVT_CALL(N(SetPeachFlag8)) + EVT_CALL(N(PreventNextPeachDisguise)) EVT_SET_GROUP(EVT_GROUP_00) EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_EMOTE_IDEA, SOUND_SPACE_DEFAULT) diff --git a/src/world/area_kkj/kkj_14/kkj_14_2_main.c b/src/world/area_kkj/kkj_14/kkj_14_2_main.c index a919deb6915..07f8666e4c8 100644 --- a/src/world/area_kkj/kkj_14/kkj_14_2_main.c +++ b/src/world/area_kkj/kkj_14/kkj_14_2_main.c @@ -4,7 +4,7 @@ #include "../common/RestoreFromPeachState.inc.c" API_CALLABLE(N(EnableParasol)) { - gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_HAS_PARASOL; + gGameStatusPtr->peachFlags |= PEACH_FLAG_HAS_PARASOL; return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c b/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c index 4668fd9164f..4e3a254acc8 100644 --- a/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c +++ b/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c @@ -212,7 +212,7 @@ API_CALLABLE(N(SetFireplaceAlpha)) { void N(setup_gfx_fireplace)(void) { gDPSetCycleType(gMainGfxPos++, G_CYC_2CYCLE); gDPSetRenderMode(gMainGfxPos++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2); - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, PRIMITIVE); + gDPSetCombineMode(gMainGfxPos++, G_CC_INTERFERENCE, PM_CC_3E); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, N(FireplaceAlpha)); } diff --git a/src/world/area_kkj/kkj_14/kkj_14_8_chapter0.c b/src/world/area_kkj/kkj_14/kkj_14_8_chapter0.c index 91aa64c49c8..c9b821a3853 100644 --- a/src/world/area_kkj/kkj_14/kkj_14_8_chapter0.c +++ b/src/world/area_kkj/kkj_14/kkj_14_8_chapter0.c @@ -2,12 +2,12 @@ #include "sprite/player.h" API_CALLABLE(N(SetPeachDepressed)) { - gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_DEPRESSED; + gGameStatusPtr->peachFlags |= PEACH_FLAG_DEPRESSED; return ApiStatus_DONE2; } API_CALLABLE(N(ClearPeachDepressed)) { - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DEPRESSED; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DEPRESSED; return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/kkj_15/kkj_15_7_chapter3.c b/src/world/area_kkj/kkj_15/kkj_15_7_chapter3.c index bf367234a44..820f72e6838 100644 --- a/src/world/area_kkj/kkj_15/kkj_15_7_chapter3.c +++ b/src/world/area_kkj/kkj_15/kkj_15_7_chapter3.c @@ -2,12 +2,12 @@ #include "sprite/player.h" API_CALLABLE(N(SetPeachDepressed)) { - gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_DEPRESSED; + gGameStatusPtr->peachFlags |= PEACH_FLAG_DEPRESSED; return ApiStatus_DONE2; } API_CALLABLE(N(ClearPeachDepressed)) { - gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DEPRESSED; + gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DEPRESSED; return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/kkj_16/kkj_16_3_npcs_later.c b/src/world/area_kkj/kkj_16/kkj_16_3_npcs_later.c index 60b3458a659..6a47c8302b5 100644 --- a/src/world/area_kkj/kkj_16/kkj_16_3_npcs_later.c +++ b/src/world/area_kkj/kkj_16/kkj_16_3_npcs_later.c @@ -21,7 +21,7 @@ AnimID N(ExtraAnims_HammerBros)[] = { #include "../common/Searchlights.inc.c" #include "world/common/todo/GetPeachDisguise.inc.c" -#include "../common/SetPeachFlag8.inc.c" +#include "../common/PreventNextPeachDisguise.inc.c" #include "../common/ApproachPlayer50Units.inc.c" EvtScript N(EVS_NpcInteract_HammerBros_01) = { @@ -68,7 +68,7 @@ EvtScript N(EVS_NpcInteract_HammerBros_03) = { EvtScript N(EVS_CapturePeach) = { EVT_CALL(DisablePlayerInput, TRUE) - EVT_CALL(N(SetPeachFlag8)) + EVT_CALL(N(PreventNextPeachDisguise)) EVT_SET_GROUP(EVT_GROUP_00) EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_EMOTE_IDEA, SOUND_SPACE_DEFAULT) diff --git a/src/world/area_kkj/kkj_19/kkj_19_2_main.c b/src/world/area_kkj/kkj_19/kkj_19_2_main.c index 488ae91b061..127745a0114 100644 --- a/src/world/area_kkj/kkj_19/kkj_19_2_main.c +++ b/src/world/area_kkj/kkj_19/kkj_19_2_main.c @@ -103,12 +103,8 @@ WindowStyleCustom N(IngredientNameWS) = { .size4 = { 16, 8}, .unk_0D = { 0, 0, 0} }, - .opaqueCombineMode = gsDPSetCombineLERP( - 1, 0, TEXEL1, 0, 0, 0, 0, TEXEL1, - PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED), - .transparentCombineMode = gsDPSetCombineLERP( - 1, 0, TEXEL1, 0, TEXEL1, 0, PRIMITIVE, 0, - PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED), + .opaqueCombineMode = gsDPSetCombineMode(PM_CC_30, PM_CC_BOX2_CYC2), + .transparentCombineMode = gsDPSetCombineMode(PM_CC_31, PM_CC_BOX2_CYC2), .color1 = { 255, 183, 181, 255 }, .color2 = { 122, 89, 63, 255 }, }; diff --git a/src/world/area_kkj/kkj_23/kkj_23_4_npcs_peach.c b/src/world/area_kkj/kkj_23/kkj_23_4_npcs_peach.c index 7b296c13778..e2a53163fd0 100644 --- a/src/world/area_kkj/kkj_23/kkj_23_4_npcs_peach.c +++ b/src/world/area_kkj/kkj_23/kkj_23_4_npcs_peach.c @@ -4,7 +4,7 @@ #include "../common/Searchlights.inc.c" #include "world/common/todo/GetPeachDisguise.inc.c" -#include "../common/SetPeachFlag8.inc.c" +#include "../common/PreventNextPeachDisguise.inc.c" #include "../common/ApproachPlayer50Units.inc.c" #include "world/common/enemy/Kammy.inc.c" @@ -44,7 +44,7 @@ EvtScript N(EVS_NpcInteract_Koopatrol_01) = { EvtScript N(EVS_CapturePeach) = { EVT_CALL(DisablePlayerInput, TRUE) - EVT_CALL(N(SetPeachFlag8)) + EVT_CALL(N(PreventNextPeachDisguise)) EVT_SET_GROUP(EVT_GROUP_00) EVT_CALL(SetTimeFreezeMode, TIME_FREEZE_PARTIAL) EVT_CALL(PlaySoundAtNpc, NPC_SELF, SOUND_EMOTE_IDEA, SOUND_SPACE_DEFAULT) diff --git a/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c b/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c index 8ddae67956b..6d2c686cf88 100644 --- a/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c +++ b/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c @@ -26,7 +26,7 @@ API_CALLABLE(N(SetSpillLightAmount)) { void N(setup_gfx_spill_light)(void) { if (N(SpillLightAmount) > 0) { - gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE); + gDPSetCombineMode(gMainGfxPos++, PM_CC_KKJ_SPILL_LIGHT, PM_CC_KKJ_SPILL_LIGHT); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, N(SpillLightAmount)); } } diff --git a/src/world/area_kmr/kmr_00/kmr_00_3_revival.c b/src/world/area_kmr/kmr_00/kmr_00_3_revival.c index 83b7b4848ea..5ab953bf450 100644 --- a/src/world/area_kmr/kmr_00/kmr_00_3_revival.c +++ b/src/world/area_kmr/kmr_00/kmr_00_3_revival.c @@ -13,7 +13,7 @@ API_CALLABLE(N(func_80240000_8ABF90)) { args = script->ptrReadPos; if (isInitialCall) { - get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); newPrimR = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++); @@ -26,7 +26,7 @@ API_CALLABLE(N(func_80240000_8ABF90)) { if (duration > 0) { time++; - set_model_env_color_parameters( + mdl_set_fog3_color_parameters( (oldPrimR + ((newPrimR - oldPrimR) * time) / duration), (oldPrimG + ((newPrimG - oldPrimG) * time) / duration), (oldPrimB + ((newPrimB - oldPrimB) * time) / duration), @@ -37,7 +37,7 @@ API_CALLABLE(N(func_80240000_8ABF90)) { return ApiStatus_DONE2; } } else { - set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c index 4236df47a64..8ef2e0a7eb1 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c +++ b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c @@ -1364,7 +1364,7 @@ API_CALLABLE(N(func_8024295C_8B29CC)) { NOP_UNFIX API_CALLABLE(N(func_80242BA8_8B2C18)) { - *gBackgroundFogModePtr = 1; + *gBackgroundFogModePtr = FOG_MODE_1; return ApiStatus_DONE2; } @@ -1384,11 +1384,11 @@ API_CALLABLE(N(func_80242BC0_8B2C30)) { newEnvB = evt_get_variable(script, *args++); duration = evt_get_variable(script, *args++); if (isInitialCall) { - get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); script->functionTemp[0] = 0; } if (duration > 0) { - set_model_env_color_parameters( + mdl_set_fog3_color_parameters( oldPrimR + ((newPrimR - oldPrimR) * script->functionTemp[0]) / duration, oldPrimG + ((newPrimG - oldPrimG) * script->functionTemp[0]) / duration, oldPrimB + ((newPrimB - oldPrimB) * script->functionTemp[0]) / duration, @@ -1400,7 +1400,7 @@ API_CALLABLE(N(func_80242BC0_8B2C30)) { return 2; } } else { - set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return 2; } return 0; @@ -1412,7 +1412,7 @@ API_CALLABLE(N(func_80242F08_8B2F78)) { } API_CALLABLE(N(func_80242F28_8B2F98)) { - func_8011B950(MODEL_kinopi, CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(MODEL_kinopi, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); set_background_color_blend(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; diff --git a/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c b/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c index 2bceac9c81e..0f6bd13396e 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c +++ b/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c @@ -8,7 +8,7 @@ #define NAME_SUFFIX API_CALLABLE(N(func_80241C9C_8EDABC)) { - func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); set_background_color_blend(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; diff --git a/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c b/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c index 592dbd1303f..85fdf7174ad 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c +++ b/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c @@ -7,7 +7,7 @@ #define NAME_SUFFIX API_CALLABLE(N(func_80242030_8EDE50)) { - func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_0, 1); + func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); set_background_color_blend(0, 0, 0, 0); gCameras[CAM_DEFAULT].bgColor[0] = 0; diff --git a/src/world/area_kmr/kmr_21/kmr_21_1_main.c b/src/world/area_kmr/kmr_21/kmr_21_1_main.c index 49caa63eae1..2e8f9303f14 100644 --- a/src/world/area_kmr/kmr_21/kmr_21_1_main.c +++ b/src/world/area_kmr/kmr_21/kmr_21_1_main.c @@ -19,7 +19,7 @@ Gfx N(Gfx_TexSetup_TitleImage)[] = { gsDPPipeSync(), gsDPSetCycleType(G_CYC_1CYCLE), gsDPSetRenderMode(G_RM_XLU_SURF, G_RM_XLU_SURF2), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, TEXEL1, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL1, 0, PRIMITIVE, 0), + gsDPSetCombineMode(PM_CC_2E, PM_CC_2E), gsDPSetTextureFilter(G_TF_POINT), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPSetTexturePersp(G_TP_NONE), diff --git a/src/world/area_kmr/kmr_23/kmr_23_2_npc.c b/src/world/area_kmr/kmr_23/kmr_23_2_npc.c index 5782ddfaa2f..e12600433d4 100644 --- a/src/world/area_kmr/kmr_23/kmr_23_2_npc.c +++ b/src/world/area_kmr/kmr_23/kmr_23_2_npc.c @@ -65,8 +65,8 @@ WindowStyleCustom D_802417D8_909208 = { .size3 = { 8, 8 }, .size4 = { 8, 8 }, }, - .opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), - .transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL1, 0, TEXEL1, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED), + .opaqueCombineMode = gsDPSetCombineMode(PM_CC_2B, G_CC_PASS2), + .transparentCombineMode = gsDPSetCombineMode(PM_CC_2C, G_CC_PASS2), .color1 = { 224, 224, 224, 255 }, .color2 = { 0, 0, 0, 255}, }; diff --git a/src/world/area_kzn/common/LavaGlowLighting.inc.c b/src/world/area_kzn/common/LavaGlowLighting.inc.c index d256cbdc439..a0adadd654a 100644 --- a/src/world/area_kzn/common/LavaGlowLighting.inc.c +++ b/src/world/area_kzn/common/LavaGlowLighting.inc.c @@ -33,14 +33,14 @@ API_CALLABLE(N(ApplyLavaGlowLighting)) { for (i = 0; i < modelIDs->count; i++, idList++) { s32 treeIndex = get_model_list_index_from_tree_index(*idList); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, -1, FOG_MODE_2); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_2); } } else { // list is NULL -> apply effect to ALL models Model** models = (Model**) gCurrentModels; for (i = 0; i < MAX_MODELS; i++, models++) { if (*models != NULL) { - set_mdl_custom_gfx_set(*models, -1, FOG_MODE_2); + set_mdl_custom_gfx_set(*models, CUSTOM_GFX_NONE, FOG_MODE_2); } } } @@ -83,7 +83,7 @@ API_CALLABLE(N(ApplyLavaGlowLighting)) { fastOsc = sin_deg(N(LavaGlowLightTime) * 8.0f); primA = baseAlpha + baseAlpha * (slowOsc * 0.5 + fastOsc * 0.5); - set_model_fog_color_parameters(60, 50, 30, primA, 20, 20, 20, fogStart, 1000); + mdl_set_fog2_color_parameters(60, 50, 30, primA, 20, 20, 20, fogStart, 1000); return ApiStatus_BLOCK; } @@ -98,14 +98,14 @@ API_CALLABLE(N(ClearLavaGlowLighting)) { for (i = 0; i < modelIDs->count; i++, idList++) { s32 treeIndex = get_model_list_index_from_tree_index(*idList); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, -1, FOG_MODE_0); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_0); } } else { // list is NULL -> clear effect from ALL models Model** models = (Model**) gCurrentModels; for (i = 0; i < MAX_MODELS; i++, models++) { if (*models != NULL) { - set_mdl_custom_gfx_set(*models, -1, FOG_MODE_0); + set_mdl_custom_gfx_set(*models, CUSTOM_GFX_NONE, FOG_MODE_0); } } } diff --git a/src/world/area_kzn/kzn_06/kzn_06_3_extra.c b/src/world/area_kzn/kzn_06/kzn_06_3_extra.c index e356d3db71d..12a43ec7899 100644 --- a/src/world/area_kzn/kzn_06/kzn_06_3_extra.c +++ b/src/world/area_kzn/kzn_06/kzn_06_3_extra.c @@ -24,7 +24,7 @@ API_CALLABLE(N(AdjustFog)) { for (i = 0; i < iterList->count; i++) { s32 treeIndex = get_model_list_index_from_tree_index(iterList->list[i]); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, -1, FOG_MODE_3); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_3); if (mode) { mdl->flags &= ~MODEL_FLAG_HIDDEN; } @@ -45,7 +45,7 @@ API_CALLABLE(N(AdjustFog)) { for (i = 0; i < iterList->count; i++) { s32 treeIndex = get_model_list_index_from_tree_index(iterList->list[i]); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, -1, FOG_MODE_0); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_0); if (!mode) { mdl->flags |= MODEL_FLAG_HIDDEN; } diff --git a/src/world/area_kzn/kzn_08/kzn_08.h b/src/world/area_kzn/kzn_08/kzn_08.h index ae518f9fcfe..9e323e7623e 100644 --- a/src/world/area_kzn/kzn_08/kzn_08.h +++ b/src/world/area_kzn/kzn_08/kzn_08.h @@ -29,4 +29,4 @@ extern API_CALLABLE(N(ApplyLavaGlowLighting)); extern API_CALLABLE(N(ClearLavaGlowLighting)); void disable_world_fog(void); -void get_model_fog_color_parameters(u8*, u8*, u8*, u8*, u8*, u8*, u8*, s32*, s32*); +void mdl_get_fog2_color_parameters(u8*, u8*, u8*, u8*, u8*, u8*, u8*, s32*, s32*); diff --git a/src/world/area_kzn/kzn_08/kzn_08_4_extra.c b/src/world/area_kzn/kzn_08/kzn_08_4_extra.c index f755dcfb050..7a98a08f169 100644 --- a/src/world/area_kzn/kzn_08/kzn_08_4_extra.c +++ b/src/world/area_kzn/kzn_08/kzn_08_4_extra.c @@ -16,7 +16,7 @@ API_CALLABLE(N(func_80243EE0_C75360)) { set_screen_overlay_center_worldpos(SCREEN_LAYER_BACK, 1, playerStatus->pos.x, playerStatus->pos.y + 8.0f, playerStatus->pos.z); - get_model_fog_color_parameters(&primR, &primG, &primB, &primA, + mdl_get_fog2_color_parameters(&primR, &primG, &primB, &primA, &fogR, &fogG, &fogB, &fogStart, &fogEnd); alpha = (((995 - fogStart) - 70.0f) * 255.0f) / 30.0f; diff --git a/src/world/area_mac/mac_00/mac_00_9_water_gfx.c b/src/world/area_mac/mac_00/mac_00_9_water_gfx.c index b715c1298df..c195a1af1b0 100644 --- a/src/world/area_mac/mac_00/mac_00_9_water_gfx.c +++ b/src/world/area_mac/mac_00/mac_00_9_water_gfx.c @@ -10,7 +10,7 @@ void N(gfx_build_water)(void) { gDPSetPrimDepth(gMainGfxPos++, 0x7FF0, 0); gDPSetRenderMode(gMainGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); - gDPSetCombineMode(gMainGfxPos++, PM_CC_09, PM_CC_09); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_NO_ALPHA, PM_CC_PRIM_NO_ALPHA); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 128, 0); gDPPipeSync(gMainGfxPos++); diff --git a/src/world/area_mac/mac_00/npc/dojo_members.inc.c b/src/world/area_mac/mac_00/npc/dojo_members.inc.c index 6e6fcbcb916..43062f24b0b 100644 --- a/src/world/area_mac/mac_00/npc/dojo_members.inc.c +++ b/src/world/area_mac/mac_00/npc/dojo_members.inc.c @@ -17,7 +17,7 @@ API_CALLABLE(N(SetDojoBattle)) { } API_CALLABLE(N(ResetBackgroundPostBattle)) { - func_8011B950(MODEL_minka_1, CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(MODEL_minka_1, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); set_background_color_blend(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; diff --git a/src/world/area_mac/mac_01/mac_01_6_crystal_ball_gfx.c b/src/world/area_mac/mac_01/mac_01_6_crystal_ball_gfx.c index ca1674e532a..1fa5a9cc28a 100644 --- a/src/world/area_mac/mac_01/mac_01_6_crystal_ball_gfx.c +++ b/src/world/area_mac/mac_01/mac_01_6_crystal_ball_gfx.c @@ -87,7 +87,7 @@ void N(gfx_build_inside_crystal_ball)(void) { gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); gDPSetRenderMode(gMainGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer)); - gDPSetCombineMode(gMainGfxPos++, PM_CC_09, PM_CC_09); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_NO_ALPHA, PM_CC_PRIM_NO_ALPHA); gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 240, 0); gDPPipeSync(gMainGfxPos++); gSPDisplayList(gMainGfxPos++, model->modelNode->displayData->displayList); diff --git a/src/world/area_mac/mac_01/mac_01_9_npc.c b/src/world/area_mac/mac_01/mac_01_9_npc.c index b7845a4abad..29fb397c8f7 100644 --- a/src/world/area_mac/mac_01/mac_01_9_npc.c +++ b/src/world/area_mac/mac_01/mac_01_9_npc.c @@ -256,7 +256,7 @@ API_CALLABLE(N(func_802448A0_805120)) { if (isInitialCall) { if (script->varTable[0] == 0) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); } 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], CUSTOM_GFX_NONE, FOG_MODE_0, 1); + func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); } return ApiStatus_DONE2; } diff --git a/src/world/area_mac/mac_01/npc/flower_gate.inc.c b/src/world/area_mac/mac_01/npc/flower_gate.inc.c index 568c83ffceb..76acaee2b27 100644 --- a/src/world/area_mac/mac_01/npc/flower_gate.inc.c +++ b/src/world/area_mac/mac_01/npc/flower_gate.inc.c @@ -197,7 +197,7 @@ API_CALLABLE(N(SetFlowerGateGlowAlpha)) { } void N(gfx_build_flower_gate_glow)(void) { - gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 1, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, 1, SHADE, 0, PRIMITIVE, 0); + gDPSetCombineMode(gMainGfxPos++, PM_CC_FLOWER_GATE_GLOW, PM_CC_FLOWER_GATE_GLOW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, N(FlowerGatePrimAlpha)); } diff --git a/src/world/area_mac/mac_01/npc/read_fortune.inc.c b/src/world/area_mac/mac_01/npc/read_fortune.inc.c index 5362ba5b955..3b7002d6a00 100644 --- a/src/world/area_mac/mac_01/npc/read_fortune.inc.c +++ b/src/world/area_mac/mac_01/npc/read_fortune.inc.c @@ -1,16 +1,16 @@ API_CALLABLE(N(func_802440FC_80497C)) { if (isInitialCall) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), -1, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), -1, FOG_MODE_3); - set_model_env_color_parameters(255, 255, 255, 0, 0, 0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), CUSTOM_GFX_NONE, FOG_MODE_3); + mdl_set_fog3_color_parameters(255, 255, 255, 0, 0, 0); script->functionTemp[0] = 255; } script->functionTemp[0] -= 4; if (script->functionTemp[0] < 64) { script->functionTemp[0] = 64; } - set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 64) { return ApiStatus_DONE2; } @@ -45,7 +45,7 @@ API_CALLABLE(N(func_802441EC_804A6C)) { script->functionTemp[2] = 0; } } - set_model_env_color_parameters( + mdl_set_fog3_color_parameters( script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[2], script->functionTemp[2], script->functionTemp[2] ); @@ -63,11 +63,11 @@ API_CALLABLE(N(func_80244308_804B88)) { if (script->functionTemp[0] > 255) { script->functionTemp[0] = 255; } - set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 255) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), -1, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), -1, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), CUSTOM_GFX_NONE, FOG_MODE_0); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_mac/mac_02/mac_02_3_rooms.c b/src/world/area_mac/mac_02/mac_02_3_rooms.c index 5a863e4c798..c80247b484a 100644 --- a/src/world/area_mac/mac_02/mac_02_3_rooms.c +++ b/src/world/area_mac/mac_02/mac_02_3_rooms.c @@ -5,7 +5,7 @@ API_CALLABLE(N(InitEntryFromTunnels)) { Npc* npc; s32 i; - func_8011B950(MODEL_souko, CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(MODEL_souko, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); set_background_color_blend(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; diff --git a/src/world/area_mac/mac_04/mac_04_2_main.c b/src/world/area_mac/mac_04/mac_04_2_main.c index 37f6de40eca..e8954510566 100644 --- a/src/world/area_mac/mac_04/mac_04_2_main.c +++ b/src/world/area_mac/mac_04/mac_04_2_main.c @@ -13,7 +13,7 @@ API_CALLABLE(N(SetNightFogParams)) { s32 fogStart = evt_get_variable(script, *args++); s32 fogEnd = evt_get_variable(script, *args++); - set_model_fog_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); + mdl_set_fog2_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); return ApiStatus_DONE2; } diff --git a/src/world/area_mac/mac_04/mac_04_3_rooms.c b/src/world/area_mac/mac_04/mac_04_3_rooms.c index 626b897180c..7f3d9b408ca 100644 --- a/src/world/area_mac/mac_04/mac_04_3_rooms.c +++ b/src/world/area_mac/mac_04/mac_04_3_rooms.c @@ -3,7 +3,7 @@ s32 set_background_color_blend(s32, s32, s32, s32); API_CALLABLE(N(InitEntryFromToybox)) { - func_8011B950(MODEL_heiho_house, CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(MODEL_heiho_house, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); set_background_color_blend(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; diff --git a/src/world/area_osr/osr_00/osr_00_5_scenes.c b/src/world/area_osr/osr_00/osr_00_5_scenes.c index 7b2dc226013..d84de533a68 100644 --- a/src/world/area_osr/osr_00/osr_00_5_scenes.c +++ b/src/world/area_osr/osr_00/osr_00_5_scenes.c @@ -14,7 +14,7 @@ API_CALLABLE(N(func_80240678_AACEA8)) { s32 envR = *args++; s32 envG = *args++; s32 envB = *args++; - set_model_env_color_parameters(primR, primG, primB, envR, envG, envB); + mdl_set_fog3_color_parameters(primR, primG, primB, envR, envG, envB); return ApiStatus_DONE2; } @@ -50,8 +50,8 @@ EvtScript N(EVS_Scene_ShowInvitation) = { EVT_CALL(SetCamDistance, CAM_DEFAULT, 775) EVT_CALL(SetCamPitch, CAM_DEFAULT, 20, -19) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) EVT_CALL(N(func_80240678_AACEA8), 200, 200, 200, 40, 40, 40) EVT_CALL(N(func_802406E0_AACF10)) EVT_WAIT(15 * DT) diff --git a/src/world/area_osr/osr_03/osr_03_5_interlude.c b/src/world/area_osr/osr_03/osr_03_5_interlude.c index e8aa5f72909..cde6a83cf80 100644 --- a/src/world/area_osr/osr_03/osr_03_5_interlude.c +++ b/src/world/area_osr/osr_03/osr_03_5_interlude.c @@ -2,7 +2,7 @@ #include "effects.h" API_CALLABLE(N(SetPlayerAsPeach)) { - gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_IS_PEACH; + gGameStatusPtr->peachFlags |= PEACH_FLAG_IS_PEACH; script->varTable[0] = gPlayerData.curPartner; gPlayerData.curPartner = PARTNER_TWINK; return ApiStatus_DONE2; diff --git a/src/world/area_sam/sam_06/sam_06_4_npc.c b/src/world/area_sam/sam_06/sam_06_4_npc.c index 2ca0017b26b..6478f358823 100644 --- a/src/world/area_sam/sam_06/sam_06_4_npc.c +++ b/src/world/area_sam/sam_06/sam_06_4_npc.c @@ -286,7 +286,7 @@ API_CALLABLE(N(func_80242538_D223C8)) { if (isInitialCall) { if (script->varTable[0] == 0) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); } 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], CUSTOM_GFX_NONE, FOG_MODE_0, 1); + func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); } return ApiStatus_DONE2; } diff --git a/src/world/area_sam/sam_11/sam_11_4_entity.c b/src/world/area_sam/sam_11/sam_11_4_entity.c index f2810c9d86d..c4408c68b2d 100644 --- a/src/world/area_sam/sam_11/sam_11_4_entity.c +++ b/src/world/area_sam/sam_11/sam_11_4_entity.c @@ -14,7 +14,7 @@ API_CALLABLE(N(UpdateHouseShowHide)) { s32 temp_a2; if (isInitialCall) { - func_8011B950(script->varTable[1], CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(script->varTable[1], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); script->functionTemp[0] = 0; get_background_color_blend(&r, &g, &b, &a); if ((script->varTable[0] == 0 && a == 255) || (script->varTable[0] == 1 && a == 0)) { @@ -41,7 +41,7 @@ API_CALLABLE(N(UpdateHouseShowHide)) { gCameras[CAM_DEFAULT].bgColor[2] = b; if (script->functionTemp[0] >= 255) { if (script->varTable[0] == 1) { - func_8011B950(script->varTable[1], CUSTOM_GFX_NONE, FOG_MODE_0, 1); + func_8011B950(script->varTable[1], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); } return ApiStatus_DONE2; diff --git a/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c b/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c index f951f398d41..87d73abd501 100644 --- a/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c +++ b/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c @@ -23,7 +23,7 @@ API_CALLABLE(N(InterpWorldEnvColor)) { s32 blendEnvR, blendEnvG, blendEnvB; if (isInitialCall) { - get_model_env_color_parameters(&savedPrimR, &savedPrimG, &savedPrimB, &savedEnvR, &savedEnvG, &savedEnvB); + mdl_get_fog3_color_parameters(&savedPrimR, &savedPrimG, &savedPrimB, &savedEnvR, &savedEnvG, &savedEnvB); targetPrimR = evt_get_variable(script, *args++); targetPrimG = evt_get_variable(script, *args++); targetPrimB = evt_get_variable(script, *args++); @@ -43,12 +43,12 @@ API_CALLABLE(N(InterpWorldEnvColor)) { blendEnvG = savedEnvG + ((targetEnvG - savedEnvG) * elapsed) / duration; blendEnvB = savedEnvB + ((targetEnvB - savedEnvB) * elapsed) / duration; - set_model_env_color_parameters(blendPrimR, blendPrimG, blendPrimB, blendEnvR, blendEnvG, blendEnvB); + mdl_set_fog3_color_parameters(blendPrimR, blendPrimG, blendPrimB, blendEnvR, blendEnvG, blendEnvB); if (elapsed >= duration) { return ApiStatus_DONE2; } } else { - set_model_env_color_parameters(targetPrimR, targetPrimG, targetPrimB, targetEnvR, targetEnvG, targetEnvB); + mdl_set_fog3_color_parameters(targetPrimR, targetPrimG, targetPrimB, targetEnvR, targetEnvG, targetEnvB); return ApiStatus_DONE2; } @@ -93,10 +93,10 @@ s32 N(ModelList_Translucent)[] = { }; EvtScript N(EVS_DarkenEnvironment) = { - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, EVT_PTR(N(ModelList_Solid)), FOG_MODE_0) - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(ModelList_Translucent)), FOG_MODE_0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, EVT_PTR(N(ModelList_Solid)), FOG_MODE_0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(ModelList_Translucent)), FOG_MODE_0) EVT_CALL(N(InterpWorldEnvColor), 255, 255, 255, 0, 0, 0, 0) EVT_WAIT(1) EVT_CALL(N(InterpWorldEnvColor), 44, 32, 177, 0, 0, 0, 60) @@ -695,10 +695,10 @@ EvtScript N(EVS_Ruins_Arise_Continued) = { EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(500.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, EVT_PTR(N(ModelList_Solid)), FOG_MODE_0) - EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(ModelList_Translucent)), FOG_MODE_0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, EVT_PTR(N(ModelList_Solid)), FOG_MODE_0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(ModelList_Translucent)), FOG_MODE_0) EVT_CALL(N(InterpWorldEnvColor), 44, 32, 177, 0, 0, 0, 0) EVT_EXEC(N(EVS_Ruins_FinishRising)) EVT_EXEC(N(EVS_Steps_FinishRising)) diff --git a/src/world/area_sbk/sbk_30/sbk_30_2_main.c b/src/world/area_sbk/sbk_30/sbk_30_2_main.c index 327ffcd392c..b6ef19c52b8 100644 --- a/src/world/area_sbk/sbk_30/sbk_30_2_main.c +++ b/src/world/area_sbk/sbk_30/sbk_30_2_main.c @@ -44,9 +44,9 @@ EvtScript N(EVS_Scene_RuinsRising) = { EVT_CALL(SetPanTarget, CAM_DEFAULT, 193, 0, -237) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc26), 3, 44, 32, 177, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) + EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) + EVT_CALL(N(UnkFunc26), FOG_MODE_3, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.25)) diff --git a/src/world/common/atomic/UnkFunc27.inc.c b/src/world/common/atomic/UnkFunc27.inc.c index d3a724da604..819b15b58de 100644 --- a/src/world/common/atomic/UnkFunc27.inc.c +++ b/src/world/common/atomic/UnkFunc27.inc.c @@ -2,6 +2,12 @@ #include "npc.h" #include "model.h" +enum { + FUNC27_MODE_0 = 0, + FUNC27_MODE_1 = 1, + FUNC27_MODE_2 = 2, +}; + API_CALLABLE(N(UnkFunc27)) { Bytecode* args = script->ptrReadPos; s32 mode = evt_get_variable(script, *args++); @@ -17,29 +23,29 @@ API_CALLABLE(N(UnkFunc27)) { } switch (mode) { - case 0: + case FUNC27_MODE_0: while (TRUE) { if (*modelIDList == 0xFFFF) { break; } listIndex = get_model_list_index_from_tree_index(*modelIDList); mdl = get_model_from_list_index(listIndex); - set_mdl_custom_gfx_set(mdl, -1, fogType); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, fogType); modelIDList++; }; break; - case 1: + case FUNC27_MODE_1: while (TRUE) { if (*modelIDList == 0xFFFF) { break; } - func_8011B950(*modelIDList, CUSTOM_GFX_NONE, fogType, 0); + func_8011B950(*modelIDList, CUSTOM_GFX_NONE, fogType, FALSE); modelIDList++; }; break; - case 2: + case FUNC27_MODE_2: *gBackgroundFogModePtr = fogType; break; @@ -49,26 +55,26 @@ API_CALLABLE(N(UnkFunc27)) { API_CALLABLE(N(UnkFunc26)) { 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 var4 = evt_get_variable(script, *args++); - s32 var5 = evt_get_variable(script, *args++); - s32 var6 = evt_get_variable(script, *args++); - s32 var7 = evt_get_variable(script, *args++); - s32 var8 = evt_get_variable(script, *args++); - s32 var9 = evt_get_variable(script, *args++); - s32 var10 = evt_get_variable(script, *args++); + s32 fogMode = evt_get_variable(script, *args++); + s32 arg0 = evt_get_variable(script, *args++); + s32 arg1 = evt_get_variable(script, *args++); + s32 arg2 = evt_get_variable(script, *args++); + s32 arg3 = evt_get_variable(script, *args++); + s32 arg4 = evt_get_variable(script, *args++); + s32 arg5 = evt_get_variable(script, *args++); + s32 arg6 = evt_get_variable(script, *args++); + s32 arg7 = evt_get_variable(script, *args++); + s32 arg8 = evt_get_variable(script, *args++); - switch (var1) { - case 1: - set_background_color_blend(var2, var3, var4, var5); + switch (fogMode) { + case FOG_MODE_1: + set_background_color_blend(arg0, arg1, arg2, arg3); break; - case 2: - set_model_fog_color_parameters(var2, var3, var4, var5, var6, var7, var8, var9, var10); + case FOG_MODE_2: + mdl_set_fog2_color_parameters(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); break; - case 3: - set_model_env_color_parameters(var2, var3, var4, var5, var6, var7); + case FOG_MODE_3: + mdl_set_fog3_color_parameters(arg0, arg1, arg2, arg3, arg4, arg5); break; } diff --git a/src/world/dead/area_flo/flo_10/flo_10_6_waterfx.c b/src/world/dead/area_flo/flo_10/flo_10_6_waterfx.c index 21895729b40..ea4eaaf4c20 100644 --- a/src/world/dead/area_flo/flo_10/flo_10_6_waterfx.c +++ b/src/world/dead/area_flo/flo_10/flo_10_6_waterfx.c @@ -308,7 +308,7 @@ void N(UnkModelFunc001)(void) { } gDPSetColorImage(new_var, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer)); - gDPSetCombineMode(gMainGfxPos++, PM_CC_09, PM_CC_09); + gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_NO_ALPHA, PM_CC_PRIM_NO_ALPHA); gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 240, 0); gDPPipeSync(gMainGfxPos++); diff --git a/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c b/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c index 6d88ba92557..2f5aeab7663 100644 --- a/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c +++ b/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c @@ -49,7 +49,7 @@ Gfx N(lava_piranha_vine_gfx)[] = { gsDPSetTextureFilter(G_TF_BILERP), gsDPSetTextureConvert(G_TC_FILT), gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM), AA_EN | Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)), - gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0), + gsDPSetCombineMode(PM_CC_2D, PM_CC_2D), gsDPSetPrimColor(0, 0, 0xFF, 0xA0, 0xA0, 0x00), gsDPSetTextureLUT(G_TT_RGBA16), gsDPLoadTLUT_pal16(0, N(lava_piranha_vine_pal)), diff --git a/src/world/menus.c b/src/world/menus.c index 2cdeafa09fa..3b1f33b515f 100644 --- a/src/world/menus.c +++ b/src/world/menus.c @@ -208,7 +208,7 @@ void check_input_open_menus(void) { popup = &WorldPopupMenu; if (gGameStatusPtr->debugScripts != DEBUG_SCRIPTS_NONE - || (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) + || (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) || evt_get_variable(NULL, GB_StoryProgress) == STORY_INTRO ) { return; diff --git a/src/world/script_api/rooms.c b/src/world/script_api/rooms.c index 57e34ecdadc..eb9547f802d 100644 --- a/src/world/script_api/rooms.c +++ b/src/world/script_api/rooms.c @@ -257,7 +257,7 @@ API_CALLABLE(RoomVisibilityToggleImpl) { if (isInitialCall) { if (script->varTable[0] == ROOM_VISIBILITY_SHOW) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, 1); + func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); } 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], CUSTOM_GFX_NONE, FOG_MODE_0, 1); + func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); } return ApiStatus_DONE2; } else { diff --git a/src/world/world.c b/src/world/world.c index 8d22298b657..7727ffea84d 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -210,7 +210,7 @@ void load_map_by_IDs(s16 areaID, s16 mapID, s16 loadType) { } if (mapSettings->background != NULL) { - read_background_size(mapSettings->background); + set_background(mapSettings->background); } else { set_background_size(296, 200, 12, 20); } diff --git a/ver/ique/asm/bss.s b/ver/ique/asm/bss.s index 850e5d0a0c3..63672b13466 100644 --- a/ver/ique/asm/bss.s +++ b/ver/ique/asm/bss.s @@ -180,7 +180,7 @@ dlabel D_8009A67C .space 8 -dlabel D_8009A680 +dlabel ResetFrameBufferArray .space 4 dlabel D_8009A684 diff --git a/ver/jp/asm/main.bss.s b/ver/jp/asm/main.bss.s index bc50a14a74f..48c914dd79c 100644 --- a/ver/jp/asm/main.bss.s +++ b/ver/jp/asm/main.bss.s @@ -136,7 +136,7 @@ dlabel gDisplayContext dlabel D_8009A678 .space 8 -dlabel D_8009A680 +dlabel ResetFrameBufferArray .space 0x00000010 dlabel SoftResetDelay diff --git a/ver/jp/symbol_addrs.txt b/ver/jp/symbol_addrs.txt index 9eaa4e7da01..32189703090 100644 --- a/ver/jp/symbol_addrs.txt +++ b/ver/jp/symbol_addrs.txt @@ -6,7 +6,7 @@ obfuscated_obfuscation_shims_VRAM = 0x7599F6D8; osTvType = 0x80000300; osMemSize = 0x80000318; D_80026040 = 0x80026040; -gfx_task_main = 0x80026148; // type:func rom:0x1548 +appendGfx_reset_tile_pattern = 0x80026148; // type:func rom:0x1548 step_game_loop = 0x80026710; // type:func rom:0x1B10 gfx_task_background = 0x800269C0; // type:func rom:0x1DC0 gfx_draw_frame = 0x80026AD4; @@ -153,8 +153,8 @@ osFlashSectorErase = 0x8006F404; osFlashWriteBuffer = 0x8006F530; osFlashWriteArray = 0x8006F5FC; osFlashReadArray = 0x8006F73C; -D_80073E00 = 0x80073DE0; -D_80073E04 = 0x80073DE4; +ResetGameState = 0x80073DE0; +ResetSavedFrameImg = 0x80073DE4; D_80073E08 = 0x80073DE8; D_80073E0A = 0x80073DEA; D_80073E10 = 0x80073DF0; @@ -206,7 +206,7 @@ gOverrideFlags = 0x8009A630; nuGfxCfb = 0x8009A638; gMainGfxPos = 0x8009A64C; gDisplayContext = 0x8009A654; -D_8009A680 = 0x8009A660; +ResetFrameBufferArray = 0x8009A660; SoftResetDelay = 0x8009A670; D_8009A6A0 = 0x8009A680; D_8009A6A2 = 0x8009A682; diff --git a/ver/jp/undefined_syms.txt b/ver/jp/undefined_syms.txt index 3cb0e3eda0c..e4561c0c92a 100644 --- a/ver/jp/undefined_syms.txt +++ b/ver/jp/undefined_syms.txt @@ -218,7 +218,7 @@ init_trigger_list = 0x8014A7D8; update_triggers = 0x8014A910; load_map_bg = 0x8014AE20; reset_background_settings = 0x8014AEA8; -read_background_size = 0x8014AED8; +set_background = 0x8014AED8; set_background_size = 0x8014AF20; appendGfx_background_texture = 0x8014AF70; reset_ambient_sounds = 0x8014C2E0; diff --git a/ver/us/asm/bss.s b/ver/us/asm/bss.s index 96425836d76..6f2a7250b19 100644 --- a/ver/us/asm/bss.s +++ b/ver/us/asm/bss.s @@ -165,7 +165,7 @@ dlabel D_8009A678 dlabel D_8009A67C .space 4 -dlabel D_8009A680 +dlabel ResetFrameBufferArray .space 4 dlabel D_8009A684 diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index 5fe1da007af..8fee4f6cfe5 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -337,8 +337,12 @@ segments: - [0x4AC90, pm_effect_loads, effect_loads] - [auto, c, battle/battle] - [0x4E5A0, bin, n_aspMain_text] - - [0x4F200] - - [auto, .data, main_pre] + - start: 0x4F200 + type: .data + name: main_pre + subsegments: + - [0x4F200] + - [0x4F210, i4, reset_tiles, 128, 8] - [auto, .data, main] - [auto, .data, main_loop] - [auto, .data, background_gfx] diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index b6749fcc5a9..1f9666ab659 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -15,7 +15,7 @@ is_debug_print = 0x80025D74; // type:func rom:0x1174 is_debug_panic = 0x80025F44; // type:func rom:0x1344 boot_main = 0x80025F70; // type:func rom:0x1370 gfxRetrace_Callback = 0x8002605C; // type:func rom:0x145C -gfx_task_main = 0x80026164; // type:func rom:0x1564 +appendGfx_reset_tile_pattern = 0x80026164; // type:func rom:0x1564 gfxPreNMI_Callback = 0x8002670C; // type:func rom:0x1B0C step_game_loop = 0x80026740; // type:func rom:0x1B40 gfx_task_background = 0x800269EC; // type:func rom:0x1DEC @@ -1292,8 +1292,8 @@ func_80072CEC = 0x80072CEC; // type:func rom:0x4E0EC func_80072CF4 = 0x80072CF4; // type:func rom:0x4E0F4 setup_demo_player = 0x80072D2C; // type:func rom:0x4E12C load_demo_battle = 0x80072E14; // type:func rom:0x4E214 -D_80073E00 = 0x80073E00; // rom:0x4F200 -D_80073E04 = 0x80073E04; // rom:0x4F204 +ResetGameState = 0x80073E00; // rom:0x4F200 +ResetSavedFrameImg = 0x80073E04; // rom:0x4F204 D_80073E08 = 0x80073E08; // rom:0x4F208 D_80073E0A = 0x80073E0A; // rom:0x4F20A D_80073E0C = 0x80073E0C; // rom:0x4F20C @@ -2597,7 +2597,7 @@ D_8009A670 = 0x8009A670; // rom:0x75A70 gDisplayContext = 0x8009A674; // rom:0x75A74 D_8009A678 = 0x8009A678; // rom:0x75A78 D_8009A67C = 0x8009A67C; // rom:0x75A7C -D_8009A680 = 0x8009A680; // rom:0x75A80 +ResetFrameBufferArray = 0x8009A680; // rom:0x75A80 D_8009A684 = 0x8009A684; // rom:0x75A84 SoftResetDelay = 0x8009A690; // rom:0x75A90 D_8009A694 = 0x8009A694; // rom:0x75A94 @@ -4011,10 +4011,10 @@ build_custom_gfx = 0x8011BCEC; // type:func rom:0xB23EC is_identity_fixed_mtx = 0x8011BE14; // type:func rom:0xB2514 set_background_color_blend = 0x8011BE5C; // type:func rom:0xB255C get_background_color_blend = 0x8011BE80; // type:func rom:0xB2580 -set_model_fog_color_parameters = 0x8011BEB4; // type:func rom:0xB25B4 -get_model_fog_color_parameters = 0x8011BF14; // type:func rom:0xB2614 -set_model_env_color_parameters = 0x8011BF98; // type:func rom:0xB2698 -get_model_env_color_parameters = 0x8011BFD4; // type:func rom:0xB26D4 +mdl_set_fog2_color_parameters = 0x8011BEB4; // type:func rom:0xB25B4 +mdl_get_fog2_color_parameters = 0x8011BF14; // type:func rom:0xB2614 +mdl_set_fog3_color_parameters = 0x8011BF98; // type:func rom:0xB2698 +mdl_get_fog3_color_parameters = 0x8011BFD4; // type:func rom:0xB26D4 mdl_get_vertex_count = 0x8011C028; // type:func rom:0xB2728 mdl_local_gfx_update_vtx_pointers = 0x8011C0DC; // type:func rom:0xB27DC mdl_local_gfx_copy_vertices = 0x8011C130; // type:func rom:0xB2830 @@ -4371,7 +4371,7 @@ get_trigger_by_id = 0x80145CD0; // type:func rom:0xDC3D0 should_collider_allow_interact = 0x80145CE8; // type:func rom:0xDC3E8 load_map_bg = 0x80145D70; // type:func rom:0xDC470 reset_background_settings = 0x80145DF8; // type:func rom:0xDC4F8 -read_background_size = 0x80145E28; // type:func rom:0xDC528 +set_background = 0x80145E28; // type:func rom:0xDC528 set_background_size = 0x80145E70; // type:func rom:0xDC570 blend_background_channel = 0x80145E98; // type:func rom:0xDC598 appendGfx_background_texture = 0x80145EC0; // type:func rom:0xDC5C0 @@ -4457,22 +4457,22 @@ mdl_bgMultiplyColorA = 0x8014B74C; // rom:0xE1E4C mdl_bgMultiplyColorR = 0x8014B74D; // rom:0xE1E4D mdl_bgMultiplyColorG = 0x8014B74E; // rom:0xE1E4E mdl_bgMultiplyColorB = 0x8014B74F; // rom:0xE1E4F -mdl_renderModelFogPrimColorR = 0x8014B750; // rom:0xE1E50 -mdl_renderModelFogPrimColorG = 0x8014B751; // rom:0xE1E51 -mdl_renderModelFogPrimColorB = 0x8014B752; // rom:0xE1E52 -mdl_renderModelFogPrimColorA = 0x8014B753; // rom:0xE1E53 -mdl_renderModelFogColorR = 0x8014B754; // rom:0xE1E54 -mdl_renderModelFogColorG = 0x8014B755; // rom:0xE1E55 -mdl_renderModelFogColorB = 0x8014B756; // rom:0xE1E56 -mdl_renderModelFogColorA = 0x8014B757; // rom:0xE1E57 -mdl_renderModelFogStart = 0x8014B758; // rom:0xE1E58 -mdl_renderModelFogEnd = 0x8014B75C; // rom:0xE1E5C -gRenderModelPrimR = 0x8014B760; // rom:0xE1E60 -gRenderModelPrimG = 0x8014B761; // rom:0xE1E61 -gRenderModelPrimB = 0x8014B762; // rom:0xE1E62 -gRenderModelEnvR = 0x8014B763; // rom:0xE1E63 -gRenderModelEnvG = 0x8014B764; // rom:0xE1E64 -gRenderModelEnvB = 0x8014B765; // rom:0xE1E65 +mdl_Fog2PrimR = 0x8014B750; // rom:0xE1E50 +mdl_Fog2PrimG = 0x8014B751; // rom:0xE1E51 +mdl_Fog2PrimB = 0x8014B752; // rom:0xE1E52 +mdl_Fog2PrimA = 0x8014B753; // rom:0xE1E53 +mdl_Fog2ColR = 0x8014B754; // rom:0xE1E54 +mdl_Fog2ColG = 0x8014B755; // rom:0xE1E55 +mdl_Fog2ColB = 0x8014B756; // rom:0xE1E56 +mdl_Fog2ColA = 0x8014B757; // rom:0xE1E57 +mdl_Fog2Start = 0x8014B758; // rom:0xE1E58 +mdl_Fog2End = 0x8014B75C; // rom:0xE1E5C +mdl_Fog3PrimR = 0x8014B760; // rom:0xE1E60 +mdl_Fog3PrimG = 0x8014B761; // rom:0xE1E61 +mdl_Fog3PrimB = 0x8014B762; // rom:0xE1E62 +mdl_Fog3EnvR = 0x8014B763; // rom:0xE1E63 +mdl_Fog3EnvG = 0x8014B764; // rom:0xE1E64 +mdl_Fog3EnvB = 0x8014B765; // rom:0xE1E65 D_8014B766 = 0x8014B766; // rom:0xE1E66 D_8014B767 = 0x8014B767; // rom:0xE1E67 mdl_RDPIdentity = 0x8014B768; // rom:0xE1E68 From 2e45a171b1193eb9014325c5022c26518221bc75 Mon Sep 17 00:00:00 2001 From: HailSanta Date: Thu, 23 Nov 2023 15:24:10 -0500 Subject: [PATCH 2/5] model roundup --- include/effect_shims.h | 4 +- include/enums.h | 23 +- include/functions.h | 8 +- include/macros.h | 30 +- include/model.h | 8 +- include/variables.h | 2 +- src/325AD0.c | 2 +- src/background.c | 27 +- src/battle/16C8E0.c | 2 +- .../area/trd_part_2/actor/fake_bowser.c | 14 +- src/battle/common/move/StarBeamSupport.inc.c | 4 +- src/battle/common/move/StarPowerSupport.inc.c | 10 +- src/battle/common/stage/area_hos/hos_01.inc.c | 20 +- src/battle/level_up.c | 10 +- src/battle/move/item/shooting_star.c | 12 +- src/battle/move/star_power/up_and_away.c | 14 +- src/battle/player_events.c | 24 +- src/common/FadeBackgroundDarken.inc.c | 8 +- src/common/FadeBackgroundLighten.inc.c | 4 +- src/common/SetBackgroundAlpha.inc.c | 2 +- src/common/UnkBackgroundFunc3.inc.c | 6 +- src/draw_box.c | 2 +- src/effect_shims.yaml | 2 +- src/effects/floating_flower.c | 4 +- src/effects/snowfall.c | 4 +- src/encounter.c | 12 +- src/evt/map_api.c | 2 +- src/item_entity.c | 4 +- src/model.c | 1313 +++++++++-------- src/model_clear_render_tasks.c | 2 +- src/model_clear_render_tasks.h | 2 +- src/npc.c | 2 +- src/texture_memory.c | 6 +- src/world/area_dro/dro_01/dro_01_2_main.c | 8 +- src/world/area_dro/dro_02/dro_02_3_main.c | 8 +- src/world/area_dro/dro_02/npc_merlee.c | 16 +- .../area_end/end_01/end_01_4_opera_float.c | 8 +- .../area_end/end_01/end_01_6_shyguy_float.c | 8 +- .../area_hos/hos_00/hos_00_7_shade_gfx.c | 2 +- src/world/area_hos/hos_01/hos_01_3_model_fx.c | 16 +- src/world/area_hos/hos_02/hos_02_3_model_fx.c | 46 +- src/world/area_hos/hos_03/hos_03_3_model_fx.c | 2 +- .../area_hos/hos_04/hos_04_3_fountains.c | 8 +- src/world/area_hos/hos_05/hos_05_3_misc.c | 2 +- src/world/area_hos/hos_05/hos_05_5_intro.c | 14 +- src/world/area_hos/hos_05/hos_05_7_model_fx.c | 18 +- .../area_hos/hos_06/hos_06_5_merluvlee.c | 36 +- src/world/area_isk/isk_16/isk_16_3_boss.c | 12 +- src/world/area_jan/jan_02/jan_02_2_main.c | 4 +- src/world/area_jan/jan_13/jan_13_2_puzzle.c | 12 +- src/world/area_jan/jan_16/jan_16_2_main.c | 8 +- src/world/area_kkj/kkj_03/kkj_03_2_main.c | 2 +- src/world/area_kkj/kkj_13/kkj_13_2_main.c | 2 +- src/world/area_kkj/kkj_14/kkj_14_2_main.c | 2 +- .../area_kkj/kkj_14/kkj_14_3_interactables.c | 2 +- src/world/area_kkj/kkj_15/kkj_15_2_main.c | 4 +- src/world/area_kkj/kkj_18/kkj_18_2_main.c | 2 +- src/world/area_kkj/kkj_27/kkj_27_2_main.c | 4 +- .../area_kkj/kkj_27/kkj_27_3_rotating_wall.c | 6 +- src/world/area_kmr/kmr_00/kmr_00_3_revival.c | 10 +- src/world/area_kmr/kmr_02/kmr_02_3_npc.c | 20 +- .../area_kmr/kmr_20/kmr_20_11_npc_intro.c | 4 +- .../area_kmr/kmr_20/kmr_20_12_npc_epilogue.c | 4 +- .../area_kzn/common/LavaGlowLighting.inc.c | 14 +- src/world/area_kzn/kzn_06/kzn_06_3_extra.c | 10 +- src/world/area_kzn/kzn_07/kzn_07_2_main.c | 2 +- src/world/area_kzn/kzn_08/kzn_08.h | 2 +- src/world/area_kzn/kzn_08/kzn_08_1_main.c | 41 +- src/world/area_kzn/kzn_08/kzn_08_4_extra.c | 2 +- .../area_mac/mac_00/npc/dojo_members.inc.c | 4 +- src/world/area_mac/mac_01/mac_01_9_npc.c | 6 +- .../area_mac/mac_01/npc/read_fortune.inc.c | 20 +- src/world/area_mac/mac_02/mac_02_3_rooms.c | 4 +- src/world/area_mac/mac_04/mac_04_2_main.c | 8 +- src/world/area_mac/mac_04/mac_04_3_rooms.c | 6 +- src/world/area_osr/osr_00/osr_00_5_scenes.c | 8 +- src/world/area_pra/pra_29/pra_29_4_bridge.c | 4 +- src/world/area_sam/sam_06/sam_06_4_npc.c | 6 +- src/world/area_sam/sam_11/sam_11_4_entity.c | 8 +- src/world/area_sbk/sbk_02/sbk_02_3_ruins.c | 28 +- src/world/area_sbk/sbk_30/sbk_30_2_main.c | 8 +- .../{UnkFunc27.inc.c => ApplyTint.inc.c} | 42 +- src/world/common/complete/Quizmo.inc.c | 16 +- src/world/script_api/rooms.c | 6 +- ver/ique/asm/bss3.s | 20 +- ver/ique/symbol_addrs.txt | 8 +- ver/jp/undefined_syms.txt | 8 +- ver/pal/asm/bss3.s | 20 +- ver/pal/undefined_syms.txt | 2 +- ver/us/asm/bss3.s | 20 +- ver/us/symbol_addrs.txt | 134 +- 91 files changed, 1214 insertions(+), 1122 deletions(-) rename src/world/common/atomic/{UnkFunc27.inc.c => ApplyTint.inc.c} (61%) diff --git a/include/effect_shims.h b/include/effect_shims.h index 885a060ac68..4682bd4ea09 100644 --- a/include/effect_shims.h +++ b/include/effect_shims.h @@ -35,7 +35,7 @@ void shim_draw_box( ); void shim_draw_msg(s32, s32, s32, s32, s32, s32); s32 shim_get_msg_width(s32, u16); -void shim_get_background_color_blend(u8* r, u8* g, u8* b, u8* a); +void shim_mdl_get_shroud_tint_params(u8* r, u8* g, u8* b, u8* a); void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ); #define guRotateF shim_guRotateF @@ -68,7 +68,7 @@ void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY #define draw_box shim_draw_box #define draw_msg shim_draw_msg #define get_msg_width shim_get_msg_width -#define get_background_color_blend shim_get_background_color_blend +#define mdl_get_shroud_tint_params shim_mdl_get_shroud_tint_params #define sfx_play_sound_at_position shim_sfx_play_sound_at_position #endif diff --git a/include/enums.h b/include/enums.h index 222c681b0b4..dde7b2d7983 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3280,6 +3280,7 @@ enum RenderMode { RENDER_MODE_0E_UNUSED = 0x0E, RENDER_MODE_ALPHATEST_ONESIDED = 0x0F, RENDER_MODE_ALPHATEST_NO_ZB = 0x10, + RENDER_MODES_LAST_OPAQUE = RENDER_MODE_ALPHATEST_NO_ZB, // translucent render modes RENDER_MODE_SURFACE_XLU_LAYER1 = 0x11, RENDER_MODE_12_UNUSED = 0x12, @@ -4349,6 +4350,20 @@ enum ModelGroupVisibility { MODEL_GROUP_OTHERS_VISIBLE = 3, }; +enum TintMode { + ENV_TINT_UNCHANGED = -1, + // no additional tint is applied (model is still be affected by world fog) + ENV_TINT_NONE = 0, + // additional fog which 'shrouds' the world during certain scenes + ENV_TINT_SHROUD = 1, + // adds depth-based tint using fog, overriding the world fog for affected models + ENV_TINT_DEPTH = 2, + // this mode remaps each color channel range from [0, 255] -> [min, max], + // setting a new white point and black point for the scene. + // the new max values are stored in PRIMITIVE and the new min values in ENV + ENV_TINT_REMAP = 3, +}; + enum TexPanner { //select pan unit TEX_PANNER_0 = 0x0, @@ -5861,14 +5876,6 @@ enum BackgroundFlags { BACKGROUND_RENDER_STATE_MASK = 0xF0, }; -enum FogMode { - FOG_MODE_UNCHANGED = -1, - FOG_MODE_0 = 0, - FOG_MODE_1 = 1, - FOG_MODE_2 = 2, // prim and fog colors are set - FOG_MODE_3 = 3, // prim and env colors are set -}; - enum EncounterStates { ENCOUNTER_STATE_NONE = 0, ENCOUNTER_STATE_CREATE = 1, diff --git a/include/functions.h b/include/functions.h index 285e1c869f6..b50c9197748 100644 --- a/include/functions.h +++ b/include/functions.h @@ -444,7 +444,7 @@ void set_peach_shadow_scale(Shadow* shadow, f32 scale); s32 is_block_on_ground(Entity* block); void set_actor_anim(s32 actorID, s32 partID, AnimID animID); void set_actor_anim_rate(s32 actorID, s32 partID, f32 rate); -void set_model_group_visibility(u16, s32, s32); +void mdl_group_set_visibility(u16, s32, s32); void init_enter_world_shared(void); s16 update_enter_map_screen_overlay(s16* progress); s16 update_exit_map_screen_overlay(s16* progress); @@ -820,7 +820,7 @@ 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); +void mdl_get_shroud_tint_params(u8* r, u8* g, u8* b, u8* a); s32 entity_base_block_idle(Entity* entity); void add_star_power(s32 amt); @@ -882,7 +882,7 @@ void btl_cam_use_preset_immediately(s32); s32 inflict_status(Actor*, s32, s32); s32 try_inflict_status(Actor*, s32, s32); s32 inflict_status_set_duration(Actor* actor, s32 statusTypeKey, s32 statusDurationKey, s32 duration); -void mdl_set_all_fog_mode(s32); +void mdl_set_all_tint_type(s32); void load_model_animator_tree(s32, StaticAnimatorNode**); s32 inflict_partner_ko(Actor* target, s32 statusTypeKey, s32 duration); @@ -1080,7 +1080,7 @@ void partner_kill_ability_script(void); void func_800EF3D4(s32); void mdl_update_transform_matrices(void); -void func_8011B950(u16, s32, s32, b32); +void mdl_group_set_custom_gfx(u16, s32, s32, b32); void backup_map_collision_data(void); void reset_status_bar(void); diff --git a/include/macros.h b/include/macros.h index 62c8fd12759..165c23980a3 100644 --- a/include/macros.h +++ b/include/macros.h @@ -302,26 +302,40 @@ #define PM_CC_15 PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1 #define PM_CC_16 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED + +// (COMB * PRIM) + ENV #define PM_CC_17 COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED #define PM_CC_18 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED #define PM_CC_19 COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED #define PM_CC_1B COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0 -#define PM_CC_1F NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1 +#define PM_CC_NOISE NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1 #define PM_CC_1A TEXEL0, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, TEXEL0 -#define PM_CC_1C SHADE, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, SHADE -#define PM_CC_1D SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, SHADE + +// implements ENV_TINT_DEPTH for untextured models +// applies just the base color; depth-based fog color will be added during RPD blend step +// color = SHADE * PRIM_ALPHA + PRIM +// alpha = SHADE +#define PM_CC_NOTEX_TINT_FOG \ + SHADE, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, SHADE + +// implements ENV_TINT_REMAP for untextured models +// color = SHADE * PRIM + ENV +// alpha = SHADE +#define PM_CC_NOTEX_TINT_REMAP \ + SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, SHADE + #define PM_CC_20 COMBINED, PRIMITIVE, PRIMITIVE_ALPHA, COMBINED, 0, 0, 0, COMBINED #define PM_CC_21 COMBINED, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, COMBINED #define PM_CC_22 TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0 #define PM_CC_23 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0 -#define PM_CC_24 1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0 -#define PM_CC_25 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED -#define PM_CC_26 0, 0, 0, 0, TEXEL0, TEXEL1, SHADE -#define PM_CC_27 0, 0, 0, 0, SHADE, 0, 0, 0, COMBINED -#define PM_CC_28 0, SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED +#define PM_CC1_24 1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0 +#define PM_CC2_24 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED +#define PM_CC_26 0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0 +#define PM_CC_27 0, 0, 0, SHADE, 0, 0, 0, COMBINED +#define PM_CC_28 SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED #define PM_CC1_29 TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1 #define PM_CC2_29 TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0 diff --git a/include/model.h b/include/model.h index 566d7ea14f4..2d73094f43f 100644 --- a/include/model.h +++ b/include/model.h @@ -188,9 +188,9 @@ typedef ModelTreeInfo ModelTreeInfoList[0x200]; extern ModelTreeInfoList* gCurrentModelTreeNodeInfo; extern ModelList* gCurrentModels; -void mdl_set_fog2_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); -void mdl_set_fog3_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); -void mdl_get_fog3_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); +void mdl_set_depth_tint_params(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); +void mdl_set_remap_tint_params(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); +void mdl_get_remap_tint_params(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); void init_model_data(void); void update_model_animator(s32); @@ -221,6 +221,6 @@ void set_custom_gfx_builders(s32 customGfxIndex, ModelCustomGfxBuilderFunc pre, void mdl_make_local_vertex_copy(s32 arg0, u16 treeIdx, s32); void play_model_animation_starting_from(s32 index, s16* animPos, s32 framesToSkip); -void set_background_color_blend(u8 r, u8 g, u8 b, u8 a); +void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a); #endif diff --git a/include/variables.h b/include/variables.h index 2b91df25895..163a17f5270 100644 --- a/include/variables.h +++ b/include/variables.h @@ -32,7 +32,7 @@ extern CollisionData gCollisionData; extern f32 GravityParamsStartFall[]; extern s16 FootstepSoundSelector; -extern u8* gBackgroundFogModePtr; +extern u8* gBackgroundTintModePtr; extern s32 gEntityHideMode; extern s32 D_8010C92C; diff --git a/src/325AD0.c b/src/325AD0.c index e821a8d2f53..eb0d0a41646 100644 --- a/src/325AD0.c +++ b/src/325AD0.c @@ -10,7 +10,7 @@ void* effectFuncs[] = { cos_deg, atan2, npc_raycast_down_sides, load_effect, sqrtf, mdl_draw_hidden_panel_surface, is_point_visible, guPerspectiveF, guMtxIdentF, transform_point, guLookAtHiliteF, set_screen_overlay_params_back, set_screen_overlay_center, set_screen_overlay_center_worldpos, mdl_get_next_texture_address, guPositionF, guOrthoF, - guFrustumF, draw_prev_frame_buffer_at_screen_pos, draw_box, draw_msg, get_msg_width, get_background_color_blend, sfx_play_sound_at_position + guFrustumF, draw_prev_frame_buffer_at_screen_pos, draw_box, draw_msg, get_msg_width, mdl_get_shroud_tint_params, sfx_play_sound_at_position }; s32 SimpleRandLUT[128] = { diff --git a/src/background.c b/src/background.c index 4aa2c315d3b..8a0ccab6a3e 100644 --- a/src/background.c +++ b/src/background.c @@ -96,18 +96,18 @@ void appendGfx_background_texture(void) { fogA = gGameStatusPtr->backgroundDarkness; } - switch (*gBackgroundFogModePtr) { - case FOG_MODE_0: - case FOG_MODE_1: - get_background_color_blend(&r1, &g1, &b1, &a1); + switch (*gBackgroundTintModePtr) { + case ENV_TINT_NONE: + case ENV_TINT_SHROUD: + mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1); if (a1 != 0) { flags |= BG_BLEND_SHOULD_LERP; } break; - case FOG_MODE_2: - case FOG_MODE_3: + case ENV_TINT_DEPTH: + case ENV_TINT_REMAP: default: - mdl_get_fog3_color_parameters(&r1, &g1, &b1, &r2, &g2, &b2); + mdl_get_remap_tint_params(&r1, &g1, &b1, &r2, &g2, &b2); if (!(r1 == 255 && g1 == 255 && b1 == 255 && r2 == 0 && g2 == 0 && b2 == 0)) { flags |= BG_BLEND_SHOULD_BLEND; } @@ -141,9 +141,9 @@ void appendGfx_background_texture(void) { } if (gGameStatusPtr->backgroundFlags & BACKGROUND_FLAG_FOG) { - switch (*gBackgroundFogModePtr) { - case FOG_MODE_0: - case FOG_MODE_1: + switch (*gBackgroundTintModePtr) { + case ENV_TINT_NONE: + case ENV_TINT_SHROUD: if (fogA == 255) { for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { gBackgroundPalette[i] = 1; @@ -160,11 +160,10 @@ void appendGfx_background_texture(void) { } } break; - case FOG_MODE_2: - case FOG_MODE_3: + case ENV_TINT_DEPTH: + case ENV_TINT_REMAP: default: - // in these modes, the background color is modulated channel-wise by r1/g1/b1 and blended with env - // to prevent oversaturating channel x, users should ensure x2 + x1 <= 255 + // the background color channels are remapped from [0,255] -> [min,max] for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { // NOTE: values after UNPACK range from [0,31], so we need to shift other colors into that range u16 palColor = gGameStatusPtr->backgroundPalette[i]; diff --git a/src/battle/16C8E0.c b/src/battle/16C8E0.c index 5487f530f76..cecf972a2c4 100644 --- a/src/battle/16C8E0.c +++ b/src/battle/16C8E0.c @@ -737,7 +737,7 @@ void tattle_cam_pre_render(Camera* camera) { fogEnabled = TRUE; get_world_fog_color(&fogR, &fogG, &fogB, &fogA); fogA = gGameStatusPtr->backgroundDarkness; - get_background_color_blend(&r1, &g1, &b1, &a1); + mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1); if (fogA == 255) { for (i = 0; i < ARRAY_COUNT(gTattleBgPalette); i++) { gTattleBgPalette[i] = 1; diff --git a/src/battle/area/trd_part_2/actor/fake_bowser.c b/src/battle/area/trd_part_2/actor/fake_bowser.c index 92ae88ecd6e..83aef868532 100644 --- a/src/battle/area/trd_part_2/actor/fake_bowser.c +++ b/src/battle/area/trd_part_2/actor/fake_bowser.c @@ -69,7 +69,7 @@ enum N(AnimState) { #include "common/StartRumbleWithParams.inc.c" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" s32 N(BowserDefense)[] = { ELEMENT_NORMAL, 1, @@ -1409,13 +1409,13 @@ EvtScript N(EVS_FakeBowser_HandleEvent) = { EVT_CASE_OR_EQ(EVENT_BURN_DEATH) EVT_CALL(HideHealthBar, ACTOR_SELF) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 35, 35, 35, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 35, 35, 35, 0, 0, 0, 0, 0, 0) EVT_END_IF EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT) EVT_WAIT(20) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_NONE) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) EVT_DIVF(LVar3, EVT_FLOAT(2.0)) @@ -1443,12 +1443,12 @@ EvtScript N(EVS_FakeBowser_HandleEvent) = { EVT_END_CASE_GROUP EVT_CASE_OR_EQ(EVENT_BURN_CONTACT) EVT_CASE_OR_EQ(EVENT_BURN_HIT) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 35, 35, 35, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 35, 35, 35, 0, 0, 0, 0, 0, 0) EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT) EVT_WAIT(20) EVT_SET(ArrayVar(0), ANIM_BEGIN_IDLE) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(BowserModels)), FOG_MODE_0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_NONE) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) EVT_DIVF(LVar3, EVT_FLOAT(2.0)) diff --git a/src/battle/common/move/StarBeamSupport.inc.c b/src/battle/common/move/StarBeamSupport.inc.c index 4e591c44416..c986e6a6f5d 100644 --- a/src/battle/common/move/StarBeamSupport.inc.c +++ b/src/battle/common/move/StarBeamSupport.inc.c @@ -520,11 +520,11 @@ API_CALLABLE(N(unkStarBeamBgFunc)) { script->functionTemp[0] = 230; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); script->functionTemp[0] -= 5; if (script->functionTemp[0] <= 200) { - set_background_color_blend(0, 0, 0, 200); + mdl_set_shroud_tint_params(0, 0, 0, 200); return ApiStatus_DONE2; } diff --git a/src/battle/common/move/StarPowerSupport.inc.c b/src/battle/common/move/StarPowerSupport.inc.c index fc12f969a53..acb9a808c8f 100644 --- a/src/battle/common/move/StarPowerSupport.inc.c +++ b/src/battle/common/move/StarPowerSupport.inc.c @@ -48,17 +48,17 @@ API_CALLABLE(N(SpawnStarSpiritDepartFX)) { API_CALLABLE(N(FadeBackgroundDarkenForBeam)) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); script->functionTemp[0] += 10; if (script->functionTemp[0] >= 230) { - set_background_color_blend(0, 0, 0, 230); + mdl_set_shroud_tint_params(0, 0, 0, 230); return ApiStatus_DONE2; } diff --git a/src/battle/common/stage/area_hos/hos_01.inc.c b/src/battle/common/stage/area_hos/hos_01.inc.c index e8ee03ccd07..b415eb3c08c 100644 --- a/src/battle/common/stage/area_hos/hos_01.inc.c +++ b/src/battle/common/stage/area_hos/hos_01.inc.c @@ -107,52 +107,52 @@ EvtScript N(EVS_PreBattle) = { EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o345, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o345, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o345, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o345, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o338, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o338, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o338, CUSTOM_GFX_2, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o338, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o344, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o344, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o344, CUSTOM_GFX_3, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o344, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o354, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o354, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o354, CUSTOM_GFX_4, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o354, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_4, MODEL_o341, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_5, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o341, CUSTOM_GFX_5, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o341, CUSTOM_GFX_5, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o341, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_5, MODEL_o352, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_6, EVT_PTR(N(build_gfx_blue_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o352, CUSTOM_GFX_6, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o352, CUSTOM_GFX_6, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o352, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_6, MODEL_o346, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_7, EVT_PTR(N(build_gfx_blue_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o346, CUSTOM_GFX_7, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o346, CUSTOM_GFX_7, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o346, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_7, MODEL_o349, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_8, EVT_PTR(N(build_gfx_green_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o349, CUSTOM_GFX_8, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o349, CUSTOM_GFX_8, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o349, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_8, MODEL_o353, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_9, EVT_PTR(N(build_gfx_green_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o353, CUSTOM_GFX_9, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o353, CUSTOM_GFX_9, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o353, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_9, MODEL_o347, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_A, EVT_PTR(N(build_gfx_pink_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_A, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_A, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o347, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_THREAD diff --git a/src/battle/level_up.c b/src/battle/level_up.c index 982b04ead0e..e5e194f4eb5 100644 --- a/src/battle/level_up.c +++ b/src/battle/level_up.c @@ -625,9 +625,9 @@ void btl_state_update_celebration(void) { LevelUpScriptID = LevelUpScriptPtr->id; CelebrateSubstateTime = 25; gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD; - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD: if (CelebrateSubstateTime == 18) { @@ -647,7 +647,7 @@ void btl_state_update_celebration(void) { if (CelebrateSubstateTime != 0) { CelebrateSubstateTime--; if (CelebrateSubstateTime < 10) { - set_background_color_blend(0, 0, 0, ((10 - CelebrateSubstateTime) * 16) & 0xF0); + mdl_set_shroud_tint_params(0, 0, 0, ((10 - CelebrateSubstateTime) * 16) & 0xF0); } } else { id = hud_element_create(&HES_level_up_heart); @@ -1115,7 +1115,7 @@ void btl_state_update_celebration(void) { } hud_element_free(LevelUpSelectTextID); - set_background_color_blend(0, 0, 0, 0); + mdl_set_shroud_tint_params(0, 0, 0, 0); btl_set_state(BATTLE_STATE_END_BATTLE); gBattleSubState = BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT; break; diff --git a/src/battle/move/item/shooting_star.c b/src/battle/move/item/shooting_star.c index dd85f5d0ab7..121df22d1c0 100644 --- a/src/battle/move/item/shooting_star.c +++ b/src/battle/move/item/shooting_star.c @@ -42,13 +42,13 @@ API_CALLABLE(N(SpawnDamageStarsFX)) { API_CALLABLE(N(CustomFadeBackgroundDarken)) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 10; } - set_background_color_blend(0, 0, 0, ((10 - script->functionTemp[0]) * 16) & 240); + mdl_set_shroud_tint_params(0, 0, 0, ((10 - script->functionTemp[0]) * 16) & 240); script->functionTemp[0]--; if (script->functionTemp[0] == 0) { @@ -62,11 +62,11 @@ API_CALLABLE(N(CustomFadeBackgroundLighten)) { if (isInitialCall) { script->functionTemp[0] = 10; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 16) & 240); + mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 16) & 240); script->functionTemp[0]--; if (script->functionTemp[0] == 0) { - set_background_color_blend(0, 0, 0, 0); + mdl_set_shroud_tint_params(0, 0, 0, 0); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/battle/move/star_power/up_and_away.c b/src/battle/move/star_power/up_and_away.c index 0880a74b535..831178e3173 100644 --- a/src/battle/move/star_power/up_and_away.c +++ b/src/battle/move/star_power/up_and_away.c @@ -13,17 +13,17 @@ extern EntityModelScript EMS_StarIcon; API_CALLABLE(N(DarkenBackground)) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 200; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); script->functionTemp[0] += 2; if (script->functionTemp[0] >= 254) { - set_background_color_blend(0, 0, 0, 254); + mdl_set_shroud_tint_params(0, 0, 0, 254); return ApiStatus_DONE2; } @@ -35,11 +35,11 @@ API_CALLABLE(N(RestoreBackground)) { script->functionTemp[0] = 254; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); script->functionTemp[0] -= 5; if (script->functionTemp[0] <= 200) { - set_background_color_blend(0, 0, 0, 200); + mdl_set_shroud_tint_params(0, 0, 0, 200); return ApiStatus_DONE2; } diff --git a/src/battle/player_events.c b/src/battle/player_events.c index 9ff6eb22bdf..c837aa4ed60 100644 --- a/src/battle/player_events.c +++ b/src/battle/player_events.c @@ -228,13 +228,13 @@ API_CALLABLE(GiveRefundCleanup) { API_CALLABLE(LifeShroomShroudWorld) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0]) * 12) & 0xFC); + mdl_set_shroud_tint_params(0, 0, 0, ((20 - script->functionTemp[0]) * 12) & 0xFC); script->functionTemp[0] -= 1; @@ -251,11 +251,11 @@ API_CALLABLE(LifeShroomRevealWorld) { btl_cam_unfreeze(); } - set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 12) & 0xFC); + mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 12) & 0xFC); script->functionTemp[0] -= 1; if (script->functionTemp[0] == 0) { - set_background_color_blend(0, 0, 0, 0); + mdl_set_shroud_tint_params(0, 0, 0, 0); return ApiStatus_DONE2; } @@ -343,13 +343,13 @@ API_CALLABLE(PlayBattleMerleeOrbFX) { API_CALLABLE(BattleMerleeFadeStageToBlack) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); + mdl_set_shroud_tint_params(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); script->functionTemp[0]--; if (script->functionTemp[0] == 0) { @@ -364,11 +364,11 @@ API_CALLABLE(BattleMerleeFadeStageFromBlack) { script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 0xFF); + mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 0xFF); script->functionTemp[0] -= 5; if (script->functionTemp[0] == 0) { - set_background_color_blend(0, 0, 0, 0); + mdl_set_shroud_tint_params(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/common/FadeBackgroundDarken.inc.c b/src/common/FadeBackgroundDarken.inc.c index 701986c4cd4..293d3f31727 100644 --- a/src/common/FadeBackgroundDarken.inc.c +++ b/src/common/FadeBackgroundDarken.inc.c @@ -4,13 +4,13 @@ API_CALLABLE(N(FadeBackgroundDarken)) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0]) * 10) & 254); + mdl_set_shroud_tint_params(0, 0, 0, ((20 - script->functionTemp[0]) * 10) & 254); script->functionTemp[0]--; if (script->functionTemp[0] == 0) { diff --git a/src/common/FadeBackgroundLighten.inc.c b/src/common/FadeBackgroundLighten.inc.c index cf45176d76c..0dd0151fd81 100644 --- a/src/common/FadeBackgroundLighten.inc.c +++ b/src/common/FadeBackgroundLighten.inc.c @@ -7,11 +7,11 @@ API_CALLABLE(N(FadeBackgroundLighten)) { script->functionTemp[0] = 20; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); + mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 254); script->functionTemp[0]--; if (script->functionTemp[0] == 0) { - set_background_color_blend(0, 0, 0, 0); + mdl_set_shroud_tint_params(0, 0, 0, 0); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/common/SetBackgroundAlpha.inc.c b/src/common/SetBackgroundAlpha.inc.c index 56a7be11986..f5739bcd2e6 100644 --- a/src/common/SetBackgroundAlpha.inc.c +++ b/src/common/SetBackgroundAlpha.inc.c @@ -4,6 +4,6 @@ API_CALLABLE(N(SetBackgroundAlpha)) { Bytecode* args = script->ptrReadPos; - set_background_color_blend(0, 0, 0, evt_get_variable(script, *args++)); + mdl_set_shroud_tint_params(0, 0, 0, evt_get_variable(script, *args++)); return ApiStatus_DONE2; } diff --git a/src/common/UnkBackgroundFunc3.inc.c b/src/common/UnkBackgroundFunc3.inc.c index 0cd37ab62cf..7b096852222 100644 --- a/src/common/UnkBackgroundFunc3.inc.c +++ b/src/common/UnkBackgroundFunc3.inc.c @@ -2,8 +2,8 @@ #include "model.h" API_CALLABLE(N(UnkBackgroundFunc3)) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); return ApiStatus_DONE2; } diff --git a/src/draw_box.c b/src/draw_box.c index d02cbcdfc86..ee5c9e42058 100644 --- a/src/draw_box.c +++ b/src/draw_box.c @@ -436,7 +436,7 @@ s32 draw_box(s32 flags, WindowStyle windowStyle, s32 posX, s32 posY, s32 posZ, s gDPSetCycleType(gMainGfxPos++, G_CYC_2CYCLE); gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 0); gDPSetFogColor(gMainGfxPos++, 0, 0, 0, darkening); - gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_XLU_SURF2); + gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_XLU_SURF2); if (!(flags & DRAW_FLAG_NO_CLIP)) { gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); } diff --git a/src/effect_shims.yaml b/src/effect_shims.yaml index d9748eb05fa..f8acc6294f9 100644 --- a/src/effect_shims.yaml +++ b/src/effect_shims.yaml @@ -36,5 +36,5 @@ - shim_draw_box - shim_draw_msg - shim_get_msg_width -- shim_get_background_color_blend +- shim_mdl_get_shroud_tint_params - shim_sfx_play_sound_at_position diff --git a/src/effects/floating_flower.c b/src/effects/floating_flower.c index 312cb2f08d5..4be78ed89a1 100644 --- a/src/effects/floating_flower.c +++ b/src/effects/floating_flower.c @@ -157,8 +157,8 @@ void floating_flower_appendGfx(void* effect) { gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - if (*gBackgroundFogModePtr == FOG_MODE_1) { - get_background_color_blend(&rgb, &rgb, &rgb, &a); + if (*gBackgroundTintModePtr == ENV_TINT_SHROUD) { + mdl_get_shroud_tint_params(&rgb, &rgb, &rgb, &a); alpha -= a; } diff --git a/src/effects/snowfall.c b/src/effects/snowfall.c index eaa5ea77f80..742aa565663 100644 --- a/src/effects/snowfall.c +++ b/src/effects/snowfall.c @@ -177,8 +177,8 @@ void snowfall_appendGfx(void* effect) { bgAlpha = 255; unk_2C = data->unk_2C; dlist = D_E008AA50[data->unk_04]; - if (*gBackgroundFogModePtr == FOG_MODE_1) { - get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); + if (*gBackgroundTintModePtr == ENV_TINT_SHROUD) { + mdl_get_shroud_tint_params(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); unk_28 = 255 - bgAlpha; } diff --git a/src/encounter.c b/src/encounter.c index 871d0adbbe6..5dd2e7f174c 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -242,13 +242,13 @@ ApiStatus ShowMerleeRanOutMessage(Evt* script, s32 isInitialCall) { ApiStatus FadeBackgroundDarken(Evt* script, s32 isInitialCall) { if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); + mdl_set_shroud_tint_params(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); script->functionTemp[0]--; if (script->functionTemp[0] == 0) { @@ -263,11 +263,11 @@ ApiStatus FadeBackgroundLighten(Evt* script, s32 isInitialCall) { script->functionTemp[0] = 25; } - set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); + mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 254); script->functionTemp[0] -= 5; if (script->functionTemp[0] == 0) { - set_background_color_blend(0, 0, 0, 0); + mdl_set_shroud_tint_params(0, 0, 0, 0); return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; diff --git a/src/evt/map_api.c b/src/evt/map_api.c index 81e4db9e39f..b3fbcd7d103 100644 --- a/src/evt/map_api.c +++ b/src/evt/map_api.c @@ -215,7 +215,7 @@ ApiStatus SetGroupVisibility(Evt* script, s32 isInitialCall) { Bytecode groupModelID = evt_get_variable(script, *args++); Bytecode enabled = evt_get_variable(script, *args++); - set_model_group_visibility(groupModelID, MODEL_FLAG_HIDDEN, enabled); + mdl_group_set_visibility(groupModelID, MODEL_FLAG_HIDDEN, enabled); return ApiStatus_DONE2; } diff --git a/src/item_entity.c b/src/item_entity.c index 2a0697664e2..8807e2675d5 100644 --- a/src/item_entity.c +++ b/src/item_entity.c @@ -910,7 +910,7 @@ void appendGfx_item_entity(void* data) { if (item->flags & ITEM_ENTITY_FLAG_HIDING) { u8 r, g, b, a; - get_background_color_blend(&r, &g, &b, &a); + mdl_get_shroud_tint_params(&r, &g, &b, &a); alpha = (alpha * (255 - a)) / 255; } } @@ -1161,7 +1161,7 @@ void render_item_entities(void) { alpha = item->alpha * alpha / 255; } if (item->flags & ITEM_ENTITY_FLAG_HIDING) { - get_background_color_blend(&r1, &g1, &b1, &a1); + mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1); alpha = alpha * (255 - a1) / 255; } if (item->flags & (ITEM_ENTITY_FLAG_TRANSPARENT | ITEM_ENTITY_FLAG_HIDING)) { diff --git a/src/model.c b/src/model.c index 7b1302b2108..067c0dd063e 100644 --- a/src/model.c +++ b/src/model.c @@ -6,49 +6,105 @@ #include "model_clear_render_tasks.h" #include "nu/nusys.h" +// models are rendered in two stages by the RDP: +// (1) main and aux textures are combined in the color combiner +// (2) the combined texture is blended with either tint or fog by the blender + +// supported values for auxCombineType +enum { + AUX_COMBINE_0 = 0, + AUX_COMBINE_1 = 1, + AUX_COMBINE_2 = 2, + AUX_COMBINE_3 = 3, + AUX_COMBINE_4 = 4, + AUX_COMBINE_5 = 5, + AUX_COMBINE_6 = 6, + AUX_COMBINE_7 = 7, + AUX_COMBINE_8 = 8, + AUX_COMBINE_9 = 9, + AUX_COMBINE_A = 10, +}; + +// supported values for auxCombineSubType +enum { + AUX_COMBINE_SUB_0 = 0, + AUX_COMBINE_SUB_1 = 1, + AUX_COMBINE_SUB_2 = 2, + AUX_COMBINE_SUB_COUNT = 3, +}; + +// different methods for combining main/aux texture maps +// derives from auxCombineType and auxCombineSubType enum { - TEX_MODE_STRIDE = 3, - TEX_MODE_A0 = 1, // render modes are single-cycle - TEX_MODE_B0 = 2, // render modes are two-cycle, starting with G_RM_PASS - TEX_MODE_C0 = 3, // render modes are two-cycle, starting with G_RM_FOG_SHADE_A - TEX_MODE_A1 = 4, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite - TEX_MODE_B1 = 5, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite - TEX_MODE_C1 = 6, - TEX_MODE_A2 = 10, - TEX_MODE_B2 = 11, + // no texture + TEX_COMBINE_NOTEX = 0, + + // extra tile mode = EXTRA_TILE_NONE + TEX_COMBINE_MAIN_ONLY_0 = 1, + TEX_COMBINE_MAIN_ONLY_1 = 2, + TEX_COMBINE_MAIN_ONLY_2 = 3, + + // extra tile mode = EXTRA_TILE_MIPMAPS + TEX_COMBINE_MIPMAPS_0 = 4, + TEX_COMBINE_MIPMAPS_1 = 5, + TEX_COMBINE_MIPMAPS_2 = 6, + + // extra tile mode = EXTRA_TILE_AUX_SAME_AS_MAIN + TEX_COMBINE_AUX_SHARED_0 = 7, + TEX_COMBINE_AUX_SHARED_1 = 8, + TEX_COMBINE_AUX_SHARED_2 = 9, + + // extra tile mode = EXTRA_TILE_AUX_INDEPENDENT + // NOTE: unused; copy of TEX_COMBINE_AUX_SHARED; may not work properly + TEX_COMBINE_AUX_IND_0 = 10, + TEX_COMBINE_AUX_IND_1 = 11, + TEX_COMBINE_AUX_IND_2 = 12, + + // special types selected by auxCombineType (these ignore auxCombineSubType) + TEX_COMBINE_3 = 13, + TEX_COMBINE_4 = 14, + TEX_COMBINE_5 = 15, + TEX_COMBINE_6 = 16, + TEX_COMBINE_7 = 17, + TEX_COMBINE_8 = 18, + TEX_COMBINE_9 = 19, + TEX_COMBINE_A = 20, }; enum { - AUX_COMBINE_SUB_0 = 0, - AUX_COMBINE_SUB_1 = 1, - AUX_COMBINE_SUB_2 = 2, - AUX_COMBINE_SUB_COUNT = 3, + TINT_COMBINE_NONE = 0, + TINT_COMBINE_FOG = 1, + TINT_COMBINE_SHROUD = 2, + TINT_COMBINE_DEPTH = 3, + TINT_COMBINE_REMAP = 4, }; enum { - FOG_COMBINE_NONE = 0, - FOG_COMBINE_0 = 1, - FOG_COMBINE_1 = 2, - FOG_COMBINE_2 = 3, - FOG_COMBINE_3 = 4, + RENDER_CLASS_1CYC = 1, // render modes are single-cycle + RENDER_CLASS_2CYC = 2, // render modes are two-cycle, starting with G_RM_PASS + RENDER_CLASS_FOG = 3, // render modes are two-cycle, starting with G_RM_FOG_SHADE_A + RENDER_CLASS_1CYC_SHROUD = 4, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite + RENDER_CLASS_2CYC_SHROUD = 5, // render modes use Gfx_RM2_SURFACE_OPA, but overwrite + RENDER_CLASS_FOG_SHROUD = 6, + RENDER_CLASS_1CYC_DEPTH = 10, + RENDER_CLASS_2CYC_DEPTH = 11, }; -#define MAP_TEXTURE_MEMORY_SIZE 0x20000 -#define BTL_TEXTURE_MEMORY_SIZE 0x8000 +#define WORLD_TEXTURE_MEMORY_SIZE 0x20000 +#define BATTLE_TEXTURE_MEMORY_SIZE 0x8000 -// NOTE: the type for this is FogMode, UnkFunc27 -SHIFT_BSS u8* gBackgroundFogModePtr; +SHIFT_BSS u8* gBackgroundTintModePtr; // NOTE: the type for this u8 is TintMode, as shown in SetModelTintMode SHIFT_BSS ModelList* gCurrentModels; SHIFT_BSS ModelTreeInfoList* gCurrentModelTreeNodeInfo; -extern Addr MapTextureMemory; +extern Addr TextureHeap; -typedef struct Fog { +typedef struct FogSettings { /* 0x00 */ s32 enabled; /* 0x04 */ Color4i color; /* 0x14 */ s32 startDistance; /* 0x18 */ s32 endDistance; -} Fog; // size = 0x1C +} FogSettings; // size = 0x1C extern Gfx Gfx_RM1_SURFACE_OPA[]; extern Gfx Gfx_RM1_DECAL_OPA[]; @@ -177,336 +233,350 @@ Gfx* ModelRenderModes[] = { [RENDER_MODE_IDX_3C] Gfx_RM3_CLOUD_NO_ZB, }; -Gfx ModelCombineModesStandard[21][5] = { - [0] { - gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), - gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), - gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_1C, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_1D, G_CC_PASS2), +Gfx SolidCombineModes[][5] = { + [TEX_COMBINE_NOTEX] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOTEX_TINT_FOG, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOTEX_TINT_REMAP, G_CC_PASS2), }, - [1] { - gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA), - gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_20), - gsDPSetCombineMode(G_CC_MODULATEIA, PM_CC_17), + [TEX_COMBINE_MAIN_ONLY_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_20), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_MODULATEIA, PM_CC_17), }, - [2] { - gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_BLENDRGBA), - gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_BLENDRGBDECALA, PM_CC_21), - gsDPSetCombineMode(G_CC_BLENDRGBA, PM_CC_17), + [TEX_COMBINE_MAIN_ONLY_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_BLENDRGBA), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_BLENDRGBDECALA, PM_CC_21), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_BLENDRGBA, PM_CC_17), }, - [3] { - gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), - gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_1A, G_CC_PASS2), - gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_17), + [TEX_COMBINE_MAIN_ONLY_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_1A, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_17), }, - [4] { - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), + // blend LODs in first cycle, tint in second cycle + [TEX_COMBINE_MIPMAPS_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - [5] { - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), + [TEX_COMBINE_MIPMAPS_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - [6] { - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), + [TEX_COMBINE_MIPMAPS_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - [7] { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + // blend main/aux textures in first cycle, tint in second cycle + [TEX_COMBINE_AUX_SHARED_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - [8] { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + [TEX_COMBINE_AUX_SHARED_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - [9] { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + [TEX_COMBINE_AUX_SHARED_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - [10] { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + // blend main/aux textures in first cycle, tint in second cycle + [TEX_COMBINE_AUX_IND_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - [11] { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + [TEX_COMBINE_AUX_IND_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - [12] { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + [TEX_COMBINE_AUX_IND_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - [13] { - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_28), + + // shaded color multiplied main/aux textures for alpha + [TEX_COMBINE_3] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_26, PM_CC_28), }, - [14] { - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, PM_CC_17), + // lerp between main/aux textures with shade alpha + [TEX_COMBINE_4] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_22, PM_CC_17), }, - [15] { - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), + [TEX_COMBINE_5] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), }, - [16] { - gsDPSetCombineMode(PM_CC_23, PM_CC_23), - gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_23, PM_CC_17), + [TEX_COMBINE_6] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_23, PM_CC_23), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_23, PM_CC_17), }, - [17] { - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TEX_COMBINE_7] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), }, - [18] { - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + [TEX_COMBINE_8] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), }, - [19] { - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + [TEX_COMBINE_9] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), }, - [20] { - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + [TEX_COMBINE_A] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), }, }; -Gfx ModelCombineModesAlphaTest[21][5] = { - { - gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), - gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), - gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_1C, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_1D, G_CC_PASS2), +Gfx AlphaTestCombineModes[][5] = { + [TEX_COMBINE_NOTEX] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_SHADE, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOTEX_TINT_FOG, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOTEX_TINT_REMAP, G_CC_PASS2), }, - { - gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA), - gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_20), - gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_17), + + [TEX_COMBINE_MAIN_ONLY_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_20), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_17), }, - { - gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_BLENDRGBA), - gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_BLENDRGBDECALA, PM_CC_21), - gsDPSetCombineMode(G_CC_BLENDRGBA, PM_CC_17), + [TEX_COMBINE_MAIN_ONLY_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_BLENDRGBA), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_BLENDRGBA, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_BLENDRGBDECALA, PM_CC_21), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_BLENDRGBA, PM_CC_17), }, - { - gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), - gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), - gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_1A, G_CC_PASS2), - gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_17), + [TEX_COMBINE_MAIN_ONLY_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_1A, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_17), }, - { - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEI2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEI2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), + + // blend LODs in first cycle, tint in second cycle + [TEX_COMBINE_MIPMAPS_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEI2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEI2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - { - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), + [TEX_COMBINE_MIPMAPS_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - { - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), - gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), - gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), + [TEX_COMBINE_MIPMAPS_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(G_CC_TRILERP, G_CC_MODULATEIA2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_19), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(G_CC_TRILERP, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), + + // blend main/aux textures in first cycle, tint in second cycle + [TEX_COMBINE_AUX_SHARED_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_1B), }, - { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), + [TEX_COMBINE_AUX_SHARED_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), + [TEX_COMBINE_AUX_SHARED_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), + + // blend main/aux textures in first cycle, tint in second cycle + [TEX_COMBINE_AUX_IND_0] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), + [TEX_COMBINE_AUX_IND_1] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), - gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), + [TEX_COMBINE_AUX_IND_2] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_FOG] gsDPSetCombineMode(G_CC_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_18), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_27), - gsDPSetCombineMode(PM_CC_26, PM_CC_28), + + [TEX_COMBINE_3] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_26, PM_CC_27), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_26, PM_CC_28), }, - { - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_22, PM_CC_17), + [TEX_COMBINE_4] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_22, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), - gsDPSetCombineMode(PM_CC_24, PM_CC_25), + [TEX_COMBINE_5] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC1_24, PM_CC2_24), }, - { - gsDPSetCombineMode(PM_CC_23, PM_CC_23), - gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), - gsDPSetCombineMode(PM_CC_23, PM_CC_17), + [TEX_COMBINE_6] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_23, PM_CC_23), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_23, G_CC_PASS2), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_23, PM_CC_17), }, - { - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), - gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TEX_COMBINE_7] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC1_29, PM_CC2_29), }, - { - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + [TEX_COMBINE_8] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), }, - { - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + [TEX_COMBINE_9] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), }, - { - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), - gsDPSetCombineMode(PM_CC_1F, PM_CC_1F), + [TEX_COMBINE_A] { + [TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), + [TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_NOISE, PM_CC_NOISE), }, }; -void* TextureHeapBase = (void*) &MapTextureMemory; - -u8 mdl_bgMultiplyColorA = 0; -u8 mdl_bgMultiplyColorR = 0; -u8 mdl_bgMultiplyColorG = 0; -u8 mdl_bgMultiplyColorB = 0; - -u8 mdl_Fog2PrimR = 0; -u8 mdl_Fog2PrimG = 0; -u8 mdl_Fog2PrimB = 0; -u8 mdl_Fog2PrimA = 0; -u8 mdl_Fog2ColR = 0; -u8 mdl_Fog2ColG = 0; -u8 mdl_Fog2ColB = 0; -u8 mdl_Fog2ColA = 0; // unused? -s32 mdl_Fog2Start = 950; -s32 mdl_Fog2End = 1000; - -u8 mdl_Fog3PrimR = 255; -u8 mdl_Fog3PrimG = 255; -u8 mdl_Fog3PrimB = 255; -u8 mdl_Fog3EnvR = 0; -u8 mdl_Fog3EnvG = 0; -u8 mdl_Fog3EnvB = 0; - -Mtx mdl_RDPIdentity = RDP_MATRIX( +void* TextureHeapBase = (void*) &TextureHeap; + +u8 ShroudTintAmt = 0; +u8 ShroudTintR = 0; +u8 ShroudTintG = 0; +u8 ShroudTintB = 0; + +u8 DepthTintBaseR = 0; +u8 DepthTintBaseG = 0; +u8 DepthTintBaseB = 0; +u8 DepthTintBaseA = 0; +u8 DepthTintColR = 0; +u8 DepthTintColG = 0; +u8 DepthTintColB = 0; +u8 DepthTintColA = 0; // unused? +s32 DepthTintStart = 950; +s32 DepthTintEnd = 1000; + +u8 RemapTintMaxR = 255; +u8 RemapTintMaxG = 255; +u8 RemapTintMaxB = 255; +u8 RemapTintMinR = 0; +u8 RemapTintMinG = 0; +u8 RemapTintMinB = 0; + +Mtx ReferenceIdentityMtx = 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, @@ -534,7 +604,7 @@ typedef struct DepthFloatFactors { /* 0x04 */ s32 bias; } DepthFloatFactors; -DepthFloatFactors depthFloatLookupTable[] = { +DepthFloatFactors DepthFloatLookupTable[] = { { 6, 0x00000 }, { 5, 0x20000 }, { 4, 0x30000 }, @@ -554,9 +624,9 @@ DepthFloatFactors depthFloatLookupTable[] = { s32 gLastRenderTaskCount = 0; // ---------------------------------------------------------------------------- -// TEX_MODE_A0, basic AA variants +// RENDER_CLASS_1CYC, basic AA variants -// RENDER_MODE_IDX_00: RENDER_MODE_SURFACE_OPA, TEX_MODE_A0 +// RENDER_MODE_IDX_00: RENDER_MODE_SURFACE_OPA, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_SURFACE_OPA[] = { gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2), @@ -567,7 +637,7 @@ Gfx Gfx_RM1_SURFACE_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_02: RENDER_MODE_DECAL_OPA, TEX_MODE_A0 +// RENDER_MODE_IDX_02: RENDER_MODE_DECAL_OPA, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_DECAL_OPA[] = { gsDPSetRenderMode(G_RM_AA_ZB_OPA_DECAL, G_RM_AA_ZB_OPA_DECAL2), @@ -578,7 +648,7 @@ Gfx Gfx_RM1_DECAL_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_04: RENDER_MODE_INTERSECTING_OPA, TEX_MODE_A0 +// RENDER_MODE_IDX_04: RENDER_MODE_INTERSECTING_OPA, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_INTERSECTING_OPA[] = { gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_AA_ZB_OPA_INTER2), @@ -589,7 +659,7 @@ Gfx Gfx_RM1_INTERSECTING_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_06: RENDER_MODE_ALPHATEST, TEX_MODE_A0 +// RENDER_MODE_IDX_06: RENDER_MODE_ALPHATEST, RENDER_CLASS_1CYC // used by entity models and item entities Gfx Gfx_RM1_ALPHATEST[] = { gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2), @@ -599,7 +669,7 @@ Gfx Gfx_RM1_ALPHATEST[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_08: RENDER_MODE_SURFACE_XLU, TEX_MODE_A0 +// RENDER_MODE_IDX_08: RENDER_MODE_SURFACE_XLU, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_SURFACE_XLU[] = { gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2), @@ -609,7 +679,7 @@ Gfx Gfx_RM1_SURFACE_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0C: RENDER_MODE_DECAL_XLU, TEX_MODE_A0 +// RENDER_MODE_IDX_0C: RENDER_MODE_DECAL_XLU, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_DECAL_XLU[] = { gsDPSetRenderMode(G_RM_AA_ZB_XLU_DECAL, G_RM_AA_ZB_XLU_DECAL2), @@ -619,7 +689,7 @@ Gfx Gfx_RM1_DECAL_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0E: RENDER_MODE_INTERSECTING_XLU, TEX_MODE_A0 +// RENDER_MODE_IDX_0E: RENDER_MODE_INTERSECTING_XLU, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_INTERSECTING_XLU[] = { gsDPSetRenderMode(G_RM_AA_ZB_XLU_INTER, G_RM_AA_ZB_XLU_INTER2), @@ -630,9 +700,9 @@ Gfx Gfx_RM1_INTERSECTING_XLU[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_A0, basic NO_AA variants +// RENDER_CLASS_1CYC, basic NO_AA variants -// RENDER_MODE_IDX_01: RENDER_MODE_SURFACE_OPA_NO_AA, TEX_MODE_A0 +// RENDER_MODE_IDX_01: RENDER_MODE_SURFACE_OPA_NO_AA, RENDER_CLASS_1CYC Gfx Gfx_RM1_SURFACE_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_OPA_SURF, G_RM_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -641,7 +711,7 @@ Gfx Gfx_RM1_SURFACE_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_03: RENDER_MODE_DECAL_OPA_NO_AA, TEX_MODE_A0 +// RENDER_MODE_IDX_03: RENDER_MODE_DECAL_OPA_NO_AA, RENDER_CLASS_1CYC Gfx Gfx_RM1_DECAL_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_OPA_DECAL, G_RM_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -659,7 +729,7 @@ Gfx Gfx_RM1_INTERSECTING_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_07: RENDER_MODE_ALPHATEST_ONESIDED, TEX_MODE_A0 +// RENDER_MODE_IDX_07: RENDER_MODE_ALPHATEST_ONESIDED, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_ALPHATEST_ONESIDED[] = { gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2), @@ -669,7 +739,7 @@ Gfx Gfx_RM1_ALPHATEST_ONESIDED[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0A: RENDER_MODE_SURFACE_XLU_NO_AA, TEX_MODE_A0 +// RENDER_MODE_IDX_0A: RENDER_MODE_SURFACE_XLU_NO_AA, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_SURFACE_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2), @@ -679,7 +749,7 @@ Gfx Gfx_RM1_SURFACE_XLU_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0D: RENDER_MODE_DECAL_XLU_NO_AA, TEX_MODE_A0 +// RENDER_MODE_IDX_0D: RENDER_MODE_DECAL_XLU_NO_AA, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_DECAL_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_ZB_OVL_SURF, G_RM_ZB_OVL_SURF2), @@ -690,7 +760,7 @@ Gfx Gfx_RM1_DECAL_XLU_NO_AA[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_A0, special modes +// RENDER_CLASS_1CYC, special modes // RENDER_MODE_IDX_0F: unused // used by entity models for RENDER_MODE_PASS_THROUGH @@ -701,7 +771,7 @@ Gfx Gfx_RM1_PASS_THROUGH[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_09: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TEX_MODE_A0 +// RENDER_MODE_IDX_09: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, RENDER_CLASS_1CYC Gfx Gfx_RM1_SURFACE_XLU_AA_ZB_ZUPD[] = { gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), AA_EN | Z_CMP | Z_UPD | IM_RD | @@ -713,7 +783,7 @@ Gfx Gfx_RM1_SURFACE_XLU_AA_ZB_ZUPD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2E: RENDER_MODE_SURFACE_OPA_NO_ZB, TEX_MODE_A0 +// RENDER_MODE_IDX_2E: RENDER_MODE_SURFACE_OPA_NO_ZB, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_SURFACE_OPA_NO_ZB[] = { gsDPSetRenderMode(G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2), @@ -723,7 +793,7 @@ Gfx Gfx_RM1_SURFACE_OPA_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2F: RENDER_MODE_ALPHATEST_NO_ZB, TEX_MODE_A0 +// RENDER_MODE_IDX_2F: RENDER_MODE_ALPHATEST_NO_ZB, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_ALPHATEST_NO_ZB[] = { gsDPSetRenderMode(G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2), @@ -733,7 +803,7 @@ Gfx Gfx_RM1_ALPHATEST_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_30: RENDER_MODE_SURFACE_XLU_NO_ZB, TEX_MODE_A0 +// RENDER_MODE_IDX_30: RENDER_MODE_SURFACE_XLU_NO_ZB, RENDER_CLASS_1CYC // used by entity models Gfx Gfx_RM1_SURFACE_XLU_NO_ZB[] = { gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2), @@ -743,7 +813,7 @@ Gfx Gfx_RM1_SURFACE_XLU_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_0B: RENDER_MODE_SURFACE_XLU_ZB_ZUPD, TEX_MODE_A0 +// RENDER_MODE_IDX_0B: RENDER_MODE_SURFACE_XLU_ZB_ZUPD, RENDER_CLASS_1CYC // custom render mode similar to RM_AA_XLU_SURF, using ZMODE_XLU instead of ZMODE_OPA and setting Z_CMP | Z_UPD Gfx Gfx_RM1_SURFACE_XLU_ZB_ZUPD[] = { gsDPSetRenderMode(AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | Z_CMP | Z_UPD | @@ -770,7 +840,7 @@ Gfx Gfx_RM1_CLOUD_NO_ZCMP[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_37: RENDER_MODE_CLOUD, TEX_MODE_A0 +// RENDER_MODE_IDX_37: RENDER_MODE_CLOUD, RENDER_CLASS_1CYC Gfx Gfx_RM1_CLOUD[] = { gsDPSetRenderMode(G_RM_ZB_CLD_SURF, G_RM_ZB_CLD_SURF2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -779,7 +849,7 @@ Gfx Gfx_RM1_CLOUD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_38: RENDER_MODE_CLOUD_NO_ZB, TEX_MODE_A0 +// RENDER_MODE_IDX_38: RENDER_MODE_CLOUD_NO_ZB, RENDER_CLASS_1CYC Gfx Gfx_RM1_CLOUD_NO_ZB[] = { gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), gsDPSetCycleType(G_CYC_1CYCLE), @@ -789,9 +859,9 @@ Gfx Gfx_RM1_CLOUD_NO_ZB[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_B0, basic AA variants +// RENDER_CLASS_2CYC, basic AA variants -// RENDER_MODE_IDX_10: RENDER_MODE_SURFACE_OPA, TEX_MODE_B0 +// RENDER_MODE_IDX_10: RENDER_MODE_SURFACE_OPA, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_OPA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -800,7 +870,7 @@ Gfx Gfx_RM2_SURFACE_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_12: RENDER_MODE_DECAL_OPA, TEX_MODE_B0 +// RENDER_MODE_IDX_12: RENDER_MODE_DECAL_OPA, RENDER_CLASS_2CYC Gfx Gfx_RM2_DECAL_OPA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -809,7 +879,7 @@ Gfx Gfx_RM2_DECAL_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_14: RENDER_MODE_INTERSECTING_OPA, TEX_MODE_B0 +// RENDER_MODE_IDX_14: RENDER_MODE_INTERSECTING_OPA, RENDER_CLASS_2CYC Gfx Gfx_RM2_INTERSECTING_OPA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_INTER2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -818,7 +888,7 @@ Gfx Gfx_RM2_INTERSECTING_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_16: RENDER_MODE_ALPHATEST, TEX_MODE_B0 +// RENDER_MODE_IDX_16: RENDER_MODE_ALPHATEST, RENDER_CLASS_2CYC // used by entity models, item entities with shading Gfx Gfx_RM2_ALPHATEST[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2), @@ -828,7 +898,7 @@ Gfx Gfx_RM2_ALPHATEST[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_18: RENDER_MODE_SURFACE_XLU, TEX_MODE_B0 +// RENDER_MODE_IDX_18: RENDER_MODE_SURFACE_XLU, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_XLU[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -837,7 +907,7 @@ Gfx Gfx_RM2_SURFACE_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1B: RENDER_MODE_DECAL_XLU, TEX_MODE_B0 +// RENDER_MODE_IDX_1B: RENDER_MODE_DECAL_XLU, RENDER_CLASS_2CYC Gfx Gfx_RM2_DECAL_XLU[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -846,7 +916,7 @@ Gfx Gfx_RM2_DECAL_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1D: RENDER_MODE_INTERSECTING_XLU, TEX_MODE_B0 +// RENDER_MODE_IDX_1D: RENDER_MODE_INTERSECTING_XLU, RENDER_CLASS_2CYC Gfx Gfx_RM2_INTERSECTING_XLU[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_INTER2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -856,9 +926,9 @@ Gfx Gfx_RM2_INTERSECTING_XLU[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_B0, basic NO_AA variants +// RENDER_CLASS_2CYC, basic NO_AA variants -// RENDER_MODE_IDX_11: RENDER_MODE_SURFACE_OPA_NO_AA, TEX_MODE_B0 +// RENDER_MODE_IDX_11: RENDER_MODE_SURFACE_OPA_NO_AA, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -867,7 +937,7 @@ Gfx Gfx_RM2_SURFACE_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_13: RENDER_MODE_DECAL_OPA_NO_AA, TEX_MODE_B0 +// RENDER_MODE_IDX_13: RENDER_MODE_DECAL_OPA_NO_AA, RENDER_CLASS_2CYC Gfx Gfx_RM2_DECAL_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -886,7 +956,7 @@ Gfx Gfx_RM2_INTERSECTING_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_17: RENDER_MODE_ALPHATEST_ONESIDED, TEX_MODE_B0 +// RENDER_MODE_IDX_17: RENDER_MODE_ALPHATEST_ONESIDED, RENDER_CLASS_2CYC Gfx Gfx_RM2_ALPHATEST_ONESIDED[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -894,7 +964,7 @@ Gfx Gfx_RM2_ALPHATEST_ONESIDED[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1A: RENDER_MODE_SURFACE_XLU_NO_AA, TEX_MODE_B0 +// RENDER_MODE_IDX_1A: RENDER_MODE_SURFACE_XLU_NO_AA, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -903,7 +973,7 @@ Gfx Gfx_RM2_SURFACE_XLU_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_1C: RENDER_MODE_DECAL_XLU_NO_AA, TEX_MODE_B0 +// RENDER_MODE_IDX_1C: RENDER_MODE_DECAL_XLU_NO_AA, RENDER_CLASS_2CYC Gfx Gfx_RM2_DECAL_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_XLU_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -913,7 +983,7 @@ Gfx Gfx_RM2_DECAL_XLU_NO_AA[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_B0, special modes +// RENDER_CLASS_2CYC, special modes // RENDER_MODE_IDX_1E: unused Gfx Gfx_RM2_PASS_THROUGH[] = { @@ -923,7 +993,7 @@ Gfx Gfx_RM2_PASS_THROUGH[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_19: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TEX_MODE_B0 +// RENDER_MODE_IDX_19: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_XLU_AA_ZB_ZUPD[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -932,7 +1002,7 @@ Gfx Gfx_RM2_SURFACE_XLU_AA_ZB_ZUPD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_31: RENDER_MODE_SURFACE_OPA_NO_ZB, TEX_MODE_B0 +// RENDER_MODE_IDX_31: RENDER_MODE_SURFACE_OPA_NO_ZB, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_OPA_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -941,7 +1011,7 @@ Gfx Gfx_RM2_SURFACE_OPA_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_32: RENDER_MODE_ALPHATEST_NO_ZB, TEX_MODE_B0 +// RENDER_MODE_IDX_32: RENDER_MODE_ALPHATEST_NO_ZB, RENDER_CLASS_2CYC Gfx Gfx_RM2_ALPHATEST_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -950,7 +1020,7 @@ Gfx Gfx_RM2_ALPHATEST_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_33: RENDER_MODE_SURFACE_XLU_NO_ZB, TEX_MODE_B0 +// RENDER_MODE_IDX_33: RENDER_MODE_SURFACE_XLU_NO_ZB, RENDER_CLASS_2CYC Gfx Gfx_RM2_SURFACE_XLU_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_AA_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -959,7 +1029,7 @@ Gfx Gfx_RM2_SURFACE_XLU_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_39: RENDER_MODE_CLOUD, TEX_MODE_B0 +// RENDER_MODE_IDX_39: RENDER_MODE_CLOUD, RENDER_CLASS_2CYC Gfx Gfx_RM2_CLOUD[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -968,7 +1038,7 @@ Gfx Gfx_RM2_CLOUD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_3A: RENDER_MODE_CLOUD_NO_ZB, TEX_MODE_B0 +// RENDER_MODE_IDX_3A: RENDER_MODE_CLOUD_NO_ZB, RENDER_CLASS_2CYC Gfx Gfx_RM2_CLOUD_NO_ZB[] = { gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -978,9 +1048,9 @@ Gfx Gfx_RM2_CLOUD_NO_ZB[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_C0+, basic AA variants +// RENDER_CLASS_FOG+, basic AA variants -// RENDER_MODE_IDX_1F: RENDER_MODE_SURFACE_OPA, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 +// RENDER_MODE_IDX_1F: RENDER_MODE_SURFACE_OPA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD / RENDER_CLASS_1CYC_SHROUD / RENDER_CLASS_1CYC_DEPTH // used by entity models Gfx Gfx_RM3_SURFACE_OPA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2), @@ -990,7 +1060,7 @@ Gfx Gfx_RM3_SURFACE_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_21: RENDER_MODE_DECAL_OPA, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 +// RENDER_MODE_IDX_21: RENDER_MODE_DECAL_OPA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD / RENDER_CLASS_1CYC_SHROUD / RENDER_CLASS_1CYC_DEPTH // used by entity models Gfx Gfx_RM3_DECAL_OPA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_DECAL2), @@ -1000,7 +1070,7 @@ Gfx Gfx_RM3_DECAL_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_23: RENDER_MODE_INTERSECTING_OPA, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 +// RENDER_MODE_IDX_23: RENDER_MODE_INTERSECTING_OPA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD / RENDER_CLASS_1CYC_SHROUD / RENDER_CLASS_1CYC_DEPTH // used by entity models Gfx Gfx_RM3_INTERSECTING_OPA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_INTER2), @@ -1010,7 +1080,7 @@ Gfx Gfx_RM3_INTERSECTING_OPA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_25: RENDER_MODE_ALPHATEST, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 +// RENDER_MODE_IDX_25: RENDER_MODE_ALPHATEST, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD / RENDER_CLASS_1CYC_SHROUD / RENDER_CLASS_1CYC_DEPTH // used by entity models Gfx Gfx_RM3_ALPHATEST[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2), @@ -1020,7 +1090,7 @@ Gfx Gfx_RM3_ALPHATEST[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_27: RENDER_MODE_SURFACE_XLU, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_27: RENDER_MODE_SURFACE_XLU, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD // used by entity models Gfx Gfx_RM3_SURFACE_XLU[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2), @@ -1030,7 +1100,7 @@ Gfx Gfx_RM3_SURFACE_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2A: RENDER_MODE_DECAL_XLU, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_2A: RENDER_MODE_DECAL_XLU, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD // used by entity models Gfx Gfx_RM3_DECAL_XLU[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_DECAL2), @@ -1040,7 +1110,7 @@ Gfx Gfx_RM3_DECAL_XLU[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2C: RENDER_MODE_INTERSECTING_XLU, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_2C: RENDER_MODE_INTERSECTING_XLU, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD // used by entity models Gfx Gfx_RM3_INTERSECTING_XLU[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_INTER2), @@ -1051,9 +1121,9 @@ Gfx Gfx_RM3_INTERSECTING_XLU[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_C0+, basic NO_AA variants +// RENDER_CLASS_FOG+, basic NO_AA variants -//RENDER_MODE_IDX_20: RENDER_MODE_SURFACE_OPA_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 +//RENDER_MODE_IDX_20: RENDER_MODE_SURFACE_OPA_NO_AA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_SURFACE_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1062,7 +1132,7 @@ Gfx Gfx_RM3_SURFACE_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_22: RENDER_MODE_DECAL_OPA_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_22: RENDER_MODE_DECAL_OPA_NO_AA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_DECAL_OPA_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_OPA_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1080,7 +1150,7 @@ Gfx Gfx_RM3_INTERSECTING_OPA_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_26: RENDER_MODE_ALPHATEST_ONESIDED, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_26: RENDER_MODE_ALPHATEST_ONESIDED, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_ALPHATEST_ONESIDED[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1088,7 +1158,7 @@ Gfx Gfx_RM3_ALPHATEST_ONESIDED[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_29: RENDER_MODE_SURFACE_XLU_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_29: RENDER_MODE_SURFACE_XLU_NO_AA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_SURFACE_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1097,7 +1167,7 @@ Gfx Gfx_RM3_SURFACE_XLU_NO_AA[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_2B: RENDER_MODE_DECAL_XLU_NO_AA, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_2B: RENDER_MODE_DECAL_XLU_NO_AA, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_DECAL_XLU_NO_AA[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_XLU_DECAL2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1107,7 +1177,7 @@ Gfx Gfx_RM3_DECAL_XLU_NO_AA[] = { }; // ---------------------------------------------------------------------------- -// TEX_MODE_C0+, special modes +// RENDER_CLASS_FOG+, special modes // RENDER_MODE_IDX_2D: unused Gfx Gfx_RM3_PASS_THROUGH[] = { @@ -1117,7 +1187,7 @@ Gfx Gfx_RM3_PASS_THROUGH[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_28: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_28: RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_SURFACE_XLU_AA_ZB_ZUPD[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1126,7 +1196,7 @@ Gfx Gfx_RM3_SURFACE_XLU_AA_ZB_ZUPD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_34: RENDER_MODE_SURFACE_OPA_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_34: RENDER_MODE_SURFACE_OPA_NO_ZB, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_SURFACE_OPA_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_OPA_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1135,7 +1205,7 @@ Gfx Gfx_RM3_SURFACE_OPA_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_35: RENDER_MODE_ALPHATEST_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_35: RENDER_MODE_ALPHATEST_NO_ZB, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_ALPHATEST_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_TEX_EDGE2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1144,7 +1214,7 @@ Gfx Gfx_RM3_ALPHATEST_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_36: RENDER_MODE_SURFACE_XLU_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 +// RENDER_MODE_IDX_36: RENDER_MODE_SURFACE_XLU_NO_ZB, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD Gfx Gfx_RM3_SURFACE_XLU_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_XLU_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1153,7 +1223,7 @@ Gfx Gfx_RM3_SURFACE_XLU_NO_ZB[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_3B: RENDER_MODE_CLOUD, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 +// RENDER_MODE_IDX_3B: RENDER_MODE_CLOUD, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD / RENDER_CLASS_1CYC_SHROUD / RENDER_CLASS_1CYC_DEPTH Gfx Gfx_RM3_CLOUD[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_ZB_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1162,7 +1232,7 @@ Gfx Gfx_RM3_CLOUD[] = { gsSPEndDisplayList(), }; -// RENDER_MODE_IDX_3C: RENDER_MODE_CLOUD_NO_ZB, TEX_MODE_C0 / TEX_MODE_C1 / TEX_MODE_A1 / TEX_MODE_A2 +// RENDER_MODE_IDX_3C: RENDER_MODE_CLOUD_NO_ZB, RENDER_CLASS_FOG / RENDER_CLASS_FOG_SHROUD / RENDER_CLASS_1CYC_SHROUD / RENDER_CLASS_1CYC_DEPTH Gfx Gfx_RM3_CLOUD_NO_ZB[] = { gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_CLD_SURF2), gsDPSetCycleType(G_CYC_2CYCLE), @@ -1251,12 +1321,12 @@ SHIFT_BSS ModelNode* bModelTreeRoot; SHIFT_BSS ModelTreeInfoList wModelTreeNodeInfo; SHIFT_BSS ModelTreeInfoList bModelTreeNodeInfo; -SHIFT_BSS s8 wBackgroundFogMode; -SHIFT_BSS s8 bBackgroundFogMode; -SHIFT_BSS s32 mdl_treeIterPos; -SHIFT_BSS Fog wFogSettings; -SHIFT_BSS Fog bFogSettings; -SHIFT_BSS Fog* gCurrentFogSettings; +SHIFT_BSS s8 wBackgroundTintMode; +SHIFT_BSS s8 bBackgroundTintMode; +SHIFT_BSS s32 TreeIterPos; +SHIFT_BSS FogSettings wFogSettings; +SHIFT_BSS FogSettings bFogSettings; +SHIFT_BSS FogSettings* gFogSettings; SHIFT_BSS s32 texPannerMainU[MAX_TEX_PANNERS]; SHIFT_BSS s32 texPannerMainV[MAX_TEX_PANNERS]; SHIFT_BSS s32 texPannerAuxU[MAX_TEX_PANNERS]; @@ -1267,13 +1337,13 @@ SHIFT_BSS ModelNode* mtg_FoundModelNode; SHIFT_BSS u16 mtg_MinChild; SHIFT_BSS u16 mtg_MaxChild; SHIFT_BSS u16 mtg_SearchModelID; -SHIFT_BSS RenderTask* mdl_renderTaskLists[3]; -SHIFT_BSS s32 mdl_renderTaskQueueIdx; -SHIFT_BSS s32 mdl_renderTaskCount; +SHIFT_BSS RenderTask* RenderTaskLists[3]; +SHIFT_BSS s32 RenderTaskListIdx; +SHIFT_BSS s32 RenderTaskCount; -SHIFT_BSS TextureHandle mdl_textureHandles[128]; +SHIFT_BSS TextureHandle TextureHandles[128]; -SHIFT_BSS u16 depthCopyBuffer[16]; +SHIFT_BSS u16 DepthCopyBuffer[16]; extern Addr BattleEntityHeapBottom; // todo ??? @@ -1295,14 +1365,14 @@ void appendGfx_model(void* data) { TextureHeader* textureHeader; u32 extraTileType; s8 renderMode; - s32 texturingMode; + s32 renderClass; s32 renderModeIdx; s32 flags = model->flags; ModelNode* modelNode; u16 customGfxIndex; s32 mtxLoadMode; - s32 combineSubType; + s32 tintCombineType; ModelNodeProperty* prop; s32 temp; @@ -1315,7 +1385,7 @@ void appendGfx_model(void* data) { modelNode = model->modelNode; if (model->textureID != 0) { - textureHandle = &mdl_textureHandles[model->textureID + model->textureVariation]; + textureHandle = &TextureHandles[model->textureID + model->textureVariation]; textureHeader = &textureHandle->header; if (textureHandle->gfx != NULL) { @@ -1329,55 +1399,53 @@ void appendGfx_model(void* data) { } renderMode = model->renderMode; - combineSubType = 0; + tintCombineType = 0; if (textureHeader != NULL) { switch (extraTileType) { case EXTRA_TILE_NONE: - texturingMode = TEX_MODE_A0; + renderClass = RENDER_CLASS_1CYC; break; case EXTRA_TILE_MIPMAPS: case EXTRA_TILE_AUX_SAME_AS_MAIN: case EXTRA_TILE_AUX_INDEPENDENT: - texturingMode = TEX_MODE_B0; + renderClass = RENDER_CLASS_2CYC; break; default: - texturingMode = TEX_MODE_A0; + renderClass = RENDER_CLASS_1CYC; break; } } else { - texturingMode = TEX_MODE_A0; + renderClass = RENDER_CLASS_1CYC; } - if (textureHeader != NULL || renderMode <= RENDER_MODE_ALPHATEST_NO_ZB) { - if (gCurrentFogSettings->enabled && !(flags & MODEL_FLAG_40)) { - texturingMode = TEX_MODE_C0; - combineSubType = FOG_COMBINE_0; + if (textureHeader != NULL || renderMode <= RENDER_MODES_LAST_OPAQUE) { + if (gFogSettings->enabled && !(flags & MODEL_FLAG_40)) { + renderClass = RENDER_CLASS_FOG; + tintCombineType = TINT_COMBINE_FOG; } } - // fog mode + // if a model has a tint applied, set it up now switch ((u32)(model->customGfxIndex >> 4)) { - case FOG_MODE_1: - // promote TEX_MODE_X0 -> TEX_MODE_X1 - texturingMode += TEX_MODE_STRIDE; - combineSubType = FOG_COMBINE_1; + case ENV_TINT_SHROUD: + renderClass += (RENDER_CLASS_1CYC_SHROUD - RENDER_CLASS_1CYC); + tintCombineType = TINT_COMBINE_SHROUD; break; - case FOG_MODE_2: - if (renderMode <= RENDER_MODE_ALPHATEST_NO_ZB) { - gDPSetPrimColor((*gfxPos)++, 0, 0, mdl_Fog2PrimR, mdl_Fog2PrimG, mdl_Fog2PrimB, mdl_Fog2PrimA); - gDPSetFogColor((*gfxPos)++, mdl_Fog2ColR, mdl_Fog2ColG, mdl_Fog2ColB, 0); - gSPFogPosition((*gfxPos)++, mdl_Fog2Start, mdl_Fog2End); - // promote TEX_MODE_X0 -> TEX_MODE_A2 - texturingMode += TEX_MODE_STRIDE * 3; - combineSubType = FOG_COMBINE_2; + case ENV_TINT_DEPTH: + if (renderMode <= RENDER_MODES_LAST_OPAQUE) { + gDPSetPrimColor((*gfxPos)++, 0, 0, DepthTintBaseR, DepthTintBaseG, DepthTintBaseB, DepthTintBaseA); + gDPSetFogColor((*gfxPos)++, DepthTintColR, DepthTintColG, DepthTintColB, 0); + gSPFogPosition((*gfxPos)++, DepthTintStart, DepthTintEnd); + renderClass += (RENDER_CLASS_1CYC_DEPTH - RENDER_CLASS_1CYC); + tintCombineType = TINT_COMBINE_DEPTH; } break; - case FOG_MODE_3: - texturingMode = TEX_MODE_B0; - combineSubType = FOG_COMBINE_3; - gDPSetPrimColor((*gfxPos)++, 0, 0, mdl_Fog3PrimR, mdl_Fog3PrimG, mdl_Fog3PrimB, 255); - gDPSetEnvColor((*gfxPos)++, mdl_Fog3EnvR, mdl_Fog3EnvG, mdl_Fog3EnvB, 255); + case ENV_TINT_REMAP: + renderClass = RENDER_CLASS_2CYC; + tintCombineType = TINT_COMBINE_REMAP; + gDPSetPrimColor((*gfxPos)++, 0, 0, RemapTintMaxR, RemapTintMaxG, RemapTintMaxB, 255); + gDPSetEnvColor((*gfxPos)++, RemapTintMinR, RemapTintMinG, RemapTintMinB, 255); break; } @@ -1446,8 +1514,11 @@ void appendGfx_model(void* data) { } // setup combine modes for main/aux texture blending when fog is enabled - if (combineSubType != 0 || renderMode == RENDER_MODE_ALPHATEST || renderMode == RENDER_MODE_ALPHATEST_ONESIDED) { - u32 combineType = 0; + if (tintCombineType != TINT_COMBINE_NONE + || renderMode == RENDER_MODE_ALPHATEST + || renderMode == RENDER_MODE_ALPHATEST_ONESIDED + ) { + u32 texCombineType = TEX_COMBINE_NOTEX; // only the following aux combine modes are ever used: // (A) 0x00 -> 0, 0 @@ -1456,26 +1527,27 @@ void appendGfx_model(void* data) { // (D) 0x10 -> 4, 0 if (textureHeader != NULL) { u32 auxCombineType = textureHeader->auxCombineType; - if (auxCombineType > 2) { - - combineType = 1 + 3 * AUX_COMBINE_SUB_COUNT + auxCombineType; + if (auxCombineType >= 3) { + // combine modes 3, 4, ... are directly appended to the end of the table and subtype is ignored + texCombineType = TEX_COMBINE_3 + (auxCombineType - 3); } else { // select based on aux combine subtypes // in practice, auxCombineSubType is ALWAYS zero here since the only (A) and (B) may reach this block - combineType = 1 + extraTileType * AUX_COMBINE_SUB_COUNT + textureHeader->auxCombineSubType; + texCombineType = 1 + extraTileType * AUX_COMBINE_SUB_COUNT + textureHeader->auxCombineSubType; } } if (!(renderMode == RENDER_MODE_ALPHATEST || renderMode == RENDER_MODE_ALPHATEST_ONESIDED)) { - *(*gfxPos) = ModelCombineModesStandard[combineType][combineSubType]; + *(*gfxPos) = SolidCombineModes[texCombineType][tintCombineType]; } else { - *(*gfxPos) = ModelCombineModesAlphaTest[combineType][combineSubType]; + *(*gfxPos) = AlphaTestCombineModes[texCombineType][tintCombineType]; } (*gfxPos)++; } - switch (texturingMode) { - case TEX_MODE_A0: + // setup geometry modes and render modes + switch (renderClass) { + case RENDER_CLASS_1CYC: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_00; @@ -1542,7 +1614,7 @@ void appendGfx_model(void* data) { } gSPDisplayList((*gfxPos)++, ModelRenderModes[renderModeIdx]); break; - case TEX_MODE_B0: + case RENDER_CLASS_2CYC: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_10; @@ -1606,7 +1678,7 @@ void appendGfx_model(void* data) { } gSPDisplayList((*gfxPos)++, ModelRenderModes[renderModeIdx]); break; - case TEX_MODE_C0: + case RENDER_CLASS_FOG: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_1F; @@ -1669,15 +1741,12 @@ void appendGfx_model(void* data) { break; } gSPDisplayList((*gfxPos)++, ModelRenderModes[renderModeIdx]); - gDPSetFogColor((*gfxPos)++, gCurrentFogSettings->color.r, - gCurrentFogSettings->color.g, - gCurrentFogSettings->color.b, - gCurrentFogSettings->color.a); - gSPFogPosition((*gfxPos)++, gCurrentFogSettings->startDistance, gCurrentFogSettings->endDistance); + gDPSetFogColor((*gfxPos)++, gFogSettings->color.r, gFogSettings->color.g, gFogSettings->color.b, gFogSettings->color.a); + gSPFogPosition((*gfxPos)++, gFogSettings->startDistance, gFogSettings->endDistance); break; - case TEX_MODE_A1: - case TEX_MODE_B1: - if (mdl_bgMultiplyColorA == 255) { + case RENDER_CLASS_1CYC_SHROUD: + case RENDER_CLASS_2CYC_SHROUD: + if (ShroudTintAmt == 255) { return; } gSPDisplayList((*gfxPos)++, ModelRenderModes[RENDER_MODE_IDX_10]); @@ -1740,17 +1809,11 @@ void appendGfx_model(void* data) { gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_CLD_SURF2); break; } - gDPSetFogColor((*gfxPos)++, gCurrentFogSettings->color.r, - gCurrentFogSettings->color.g, - gCurrentFogSettings->color.b, - mdl_bgMultiplyColorA); - gDPSetBlendColor((*gfxPos)++, mdl_bgMultiplyColorR, - mdl_bgMultiplyColorG, - mdl_bgMultiplyColorB, - 255); + gDPSetFogColor((*gfxPos)++, gFogSettings->color.r, gFogSettings->color.g, gFogSettings->color.b, ShroudTintAmt); + gDPSetBlendColor((*gfxPos)++, ShroudTintR, ShroudTintG, ShroudTintB, 255); gSPFogPosition((*gfxPos)++, 970, 1000); break; - case TEX_MODE_C1: + case RENDER_CLASS_FOG_SHROUD: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_1F; @@ -1814,18 +1877,19 @@ void appendGfx_model(void* data) { } gSPDisplayList((*gfxPos)++, ModelRenderModes[renderModeIdx]); - fogR = (gCurrentFogSettings->color.r * (255 - mdl_bgMultiplyColorA) + mdl_bgMultiplyColorR * mdl_bgMultiplyColorA) / 255; - fogG = (gCurrentFogSettings->color.g * (255 - mdl_bgMultiplyColorA) + mdl_bgMultiplyColorG * mdl_bgMultiplyColorA) / 255; - fogB = (gCurrentFogSettings->color.b * (255 - mdl_bgMultiplyColorA) + mdl_bgMultiplyColorB * mdl_bgMultiplyColorA) / 255; + // lerp between scene fog and shroud fog based on ShroudTintAmt + fogR = (gFogSettings->color.r * (255 - ShroudTintAmt) + ShroudTintR * ShroudTintAmt) / 255; + fogG = (gFogSettings->color.g * (255 - ShroudTintAmt) + ShroudTintG * ShroudTintAmt) / 255; + fogB = (gFogSettings->color.b * (255 - ShroudTintAmt) + ShroudTintB * ShroudTintAmt) / 255; - fogMin = (gCurrentFogSettings->startDistance * (255 - mdl_bgMultiplyColorA) + 900 * mdl_bgMultiplyColorA) / 255; - fogMax = (gCurrentFogSettings->endDistance * (255 - mdl_bgMultiplyColorA) + 1000 * mdl_bgMultiplyColorA) / 255; + fogMin = (gFogSettings->startDistance * (255 - ShroudTintAmt) + 900 * ShroudTintAmt) / 255; + fogMax = (gFogSettings->endDistance * (255 - ShroudTintAmt) + 1000 * ShroudTintAmt) / 255; - gDPSetFogColor(gMainGfxPos++, fogR, fogG, fogB, gCurrentFogSettings->color.a); + gDPSetFogColor(gMainGfxPos++, fogR, fogG, fogB, gFogSettings->color.a); gSPFogPosition((*gfxPos)++, fogMin, fogMax); break; - case TEX_MODE_A2: - case TEX_MODE_B2: + case RENDER_CLASS_1CYC_DEPTH: + case RENDER_CLASS_2CYC_DEPTH: switch (renderMode) { case RENDER_MODE_SURFACE_OPA: renderModeIdx = RENDER_MODE_IDX_1F; @@ -1986,7 +2050,7 @@ void load_texture_by_name(ModelNodeProperty* propertyName, s32 romOffset, s32 si s32 mainSize; if (textureName == NULL) { - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID = 0; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID = 0; return; } @@ -2083,17 +2147,17 @@ void load_texture_by_name(ModelNodeProperty* propertyName, s32 romOffset, s32 si if (romOffset >= startOffset + 0x40000) { // did not find the texture with `textureName` - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID = 0; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID = 0; return; } - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID = textureIdx + 1; - textureHandle = &mdl_textureHandles[(*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID]; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID = textureIdx + 1; + textureHandle = &TextureHandles[(*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID]; romOffset += sizeof(*header); if (textureHandle->gfx == NULL) { load_texture_impl(romOffset, textureHandle, header, rasterSize, paletteSize, auxRasterSize, auxPaletteSize); - load_texture_variants(romOffset + rasterSize + paletteSize + auxRasterSize + auxPaletteSize, (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID, startOffset, size); + load_texture_variants(romOffset + rasterSize + paletteSize + auxRasterSize + auxPaletteSize, (*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID, startOffset, size); } } @@ -2198,7 +2262,7 @@ void load_texture_variants(u32 romOffset, s32 textureID, s32 baseOffset, s32 siz textureID++; currentTextureID = textureID; - textureHandle = &mdl_textureHandles[currentTextureID]; + textureHandle = &TextureHandles[currentTextureID]; load_texture_impl(offset + sizeof(*header), textureHandle, header, rasterSize, paletteSize, auxRasterSize, auxPaletteSize); mainSize = rasterSize + paletteSize + sizeof(*header); @@ -2240,7 +2304,7 @@ void load_next_model_textures(ModelNode* model, s32 romOffset, s32 texSize) { load_texture_by_name(propTextureName, romOffset, texSize); } } - mdl_treeIterPos++; + TreeIterPos++; } // load all textures used by models, starting from the root @@ -2249,7 +2313,7 @@ void mdl_load_all_textures(ModelNode* rootModel, s32 romOffset, s32 size) { // textures are loaded to the upper half of the texture heap when not in the world if (gGameStatusPtr->isBattle != 0) { - baseOffset = MAP_TEXTURE_MEMORY_SIZE; + baseOffset = WORLD_TEXTURE_MEMORY_SIZE; } TextureHeapPos = TextureHeapBase + baseOffset; @@ -2257,11 +2321,11 @@ void mdl_load_all_textures(ModelNode* rootModel, s32 romOffset, s32 size) { if (rootModel != NULL && romOffset != 0 && size != 0) { s32 i; - for (i = 0; i < ARRAY_COUNT(mdl_textureHandles); i++) { - mdl_textureHandles[i].gfx = NULL; + for (i = 0; i < ARRAY_COUNT(TextureHandles); i++) { + TextureHandles[i].gfx = NULL; } - mdl_treeIterPos = 0; + TreeIterPos = 0; if (rootModel != NULL) { load_next_model_textures(rootModel, romOffset, size); } @@ -2297,12 +2361,12 @@ void clear_model_data(void) { gCurrentModelTreeRoot = &wModelTreeRoot; gCurrentModelLocalVtxBuffers = &wModelLocalVtxBuffers; gCurrentModelTreeNodeInfo = &wModelTreeNodeInfo; - gBackgroundFogModePtr = &wBackgroundFogMode; - mdl_bgMultiplyColorA = 0; - mdl_bgMultiplyColorR = 0; - mdl_bgMultiplyColorG = 0; - mdl_bgMultiplyColorB = 0; - gCurrentFogSettings = &wFogSettings; + gBackgroundTintModePtr = &wBackgroundTintMode; + ShroudTintAmt = 0; + ShroudTintR = 0; + ShroudTintG = 0; + ShroudTintB = 0; + gFogSettings = &wFogSettings; } else { gCurrentModels = &bModelList; gCurrentTransformGroups = &bTransformGroups; @@ -2311,8 +2375,8 @@ void clear_model_data(void) { gCurrentModelTreeRoot = &bModelTreeRoot; gCurrentModelLocalVtxBuffers = &bModelLocalVtxBuffers; gCurrentModelTreeNodeInfo = &bModelTreeNodeInfo; - gBackgroundFogModePtr = &bBackgroundFogMode; - gCurrentFogSettings = &bFogSettings; + gBackgroundTintModePtr = &bBackgroundTintMode; + gFogSettings = &bFogSettings; } for (i = 0; i < ARRAY_COUNT(*gCurrentModels); i++) { @@ -2336,14 +2400,14 @@ void clear_model_data(void) { (*gCurrentModelTreeNodeInfo)[i].textureID = 0; } - *gBackgroundFogModePtr = FOG_MODE_0; - gCurrentFogSettings->enabled = FALSE; - gCurrentFogSettings->color.r = 10; - gCurrentFogSettings->color.g = 10; - gCurrentFogSettings->color.b = 10; - gCurrentFogSettings->color.a = 0; - gCurrentFogSettings->startDistance = 950; - gCurrentFogSettings->endDistance = 1000; + *gBackgroundTintModePtr = ENV_TINT_NONE; + gFogSettings->enabled = FALSE; + gFogSettings->color.r = 10; + gFogSettings->color.g = 10; + gFogSettings->color.b = 10; + gFogSettings->color.a = 0; + gFogSettings->startDistance = 950; + gFogSettings->endDistance = 1000; for (i = 0; i < ARRAY_COUNT(texPannerAuxV); i++) { texPannerAuxV[i] = 0; @@ -2362,8 +2426,8 @@ void init_model_data(void) { gCurrentModelTreeRoot = &wModelTreeRoot; gCurrentModelLocalVtxBuffers = &wModelLocalVtxBuffers; gCurrentModelTreeNodeInfo = &wModelTreeNodeInfo; - gBackgroundFogModePtr = &wBackgroundFogMode; - gCurrentFogSettings = &wFogSettings; + gBackgroundTintModePtr = &wBackgroundTintMode; + gFogSettings = &wFogSettings; } else { gCurrentModels = &bModelList; gCurrentTransformGroups = &bTransformGroups; @@ -2372,8 +2436,8 @@ void init_model_data(void) { gCurrentModelTreeRoot = &bModelTreeRoot; gCurrentModelLocalVtxBuffers = &bModelLocalVtxBuffers; gCurrentModelTreeNodeInfo = &bModelTreeNodeInfo; - gBackgroundFogModePtr = &bBackgroundFogMode; - gCurrentFogSettings = &bFogSettings; + gBackgroundTintModePtr = &bBackgroundTintMode; + gFogSettings = &bFogSettings; } } @@ -2432,7 +2496,7 @@ void mdl_create_model(ModelBlueprint* bp, s32 unused) { (*gCurrentModels)[modelIdx] = model = heap_malloc(sizeof(*model)); model->flags = bp->flags | MODEL_FLAG_VALID; - model->modelID = mdl_treeIterPos; + model->modelID = TreeIterPos; model->modelNode = bp->mdlNode; model->groupData = bp->groupData; model->matrixFreshness = 0; @@ -2463,7 +2527,7 @@ void mdl_create_model(ModelBlueprint* bp, s32 unused) { model->renderMode = RENDER_MODE_SURFACE_OPA; } - model->textureID = (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID; + model->textureID = (*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID; model->textureVariation = 0; if (!is_identity_fixed_mtx(bp->mtx)) { @@ -2508,7 +2572,7 @@ void mdl_create_model(ModelBlueprint* bp, s32 unused) { if (model->bakedMtx == NULL && x < 100.0f && y < 100.0f && z < 100.0f) { model->flags |= MODEL_FLAG_DO_BOUNDS_CULLING; } - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].modelIndex = modelIdx; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].modelIndex = modelIdx; } // Mysterious no-op @@ -2873,7 +2937,7 @@ void appendGfx_model_group(void* data) { } } - mdl_treeIterPos = i + 1; + TreeIterPos = i + 1; func_80117D00(model); } @@ -2888,7 +2952,7 @@ void func_80117D00(Model* model) { if (numChildren != 0) { s32 i; - for (i = 0; i < numChildren; i++, mdl_treeIterPos++) { + for (i = 0; i < numChildren; i++, TreeIterPos++) { Model newModel = *mdl; ModelNodeProperty* prop; @@ -2910,7 +2974,7 @@ void func_80117D00(Model* model) { newModel.renderMode = 0; } - newModel.textureID = (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].textureID; + newModel.textureID = (*gCurrentModelTreeNodeInfo)[TreeIterPos].textureID; newModel.textureVariation = 0; func_80117D00(&newModel); } @@ -2998,7 +3062,7 @@ void make_texture_gfx(TextureHeader* header, Gfx** gfxPos, IMG_PTR raster, PAL_P s32 mainWrapW, mainWrapH; s32 auxWrapW, auxWrapH; s32 extraTileType; - u32 auxCombineType; + u32 texCombineType; s32 lod; s32 lodDivisor; IMG_PTR rasterPtr; @@ -3070,14 +3134,22 @@ void make_texture_gfx(TextureHeader* header, Gfx** gfxPos, IMG_PTR raster, PAL_P lutMode = G_TT_NONE; } - auxCombineType = header->auxCombineType; - if (auxCombineType > 2) { - auxCombineType = 1 + 3 * AUX_COMBINE_SUB_COUNT + auxCombineType; + // only the following aux combine modes are ever used: + // (A) 0x00 -> 0, 0 + // (B) 0x08 -> 2, 0 + // (C) 0x0D -> 3, 1 + // (D) 0x10 -> 4, 0 + texCombineType = header->auxCombineType; + if (texCombineType >= 3) { + // combine modes 3, 4, ... are directly appended to the end of the table and subtype is ignored + texCombineType = TEX_COMBINE_3 + (texCombineType - 3); } else { - auxCombineType = 1 + header->extraTiles * AUX_COMBINE_SUB_COUNT + header->auxCombineSubType; + // select based on aux combine subtypes + // in practice, auxCombineSubType is ALWAYS zero here since the only (A) and (B) may reach this block + texCombineType = 1 + header->extraTiles * AUX_COMBINE_SUB_COUNT + header->auxCombineSubType; } - **gfxPos = ModelCombineModesStandard[auxCombineType][0]; + *(*gfxPos) = SolidCombineModes[texCombineType][TINT_COMBINE_NONE]; (*gfxPos)++; switch (extraTileType) { @@ -3258,7 +3330,7 @@ void load_data_for_models(ModelNode* rootModel, s32 texturesOffset, s32 size) { } *gCurrentModelTreeRoot = rootModel; - mdl_treeIterPos = 0; + TreeIterPos = 0; if (rootModel != NULL) { load_model_transforms(rootModel, NULL, mtx, 0); @@ -3298,9 +3370,9 @@ void load_model_transforms(ModelNode* model, ModelNode* parent, Matrix4f mdlTran treeDepth + 1); } - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].modelIndex = -1; - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].treeDepth = treeDepth; - mdl_treeIterPos += 1; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].modelIndex = -1; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].treeDepth = treeDepth; + TreeIterPos += 1; return; } } @@ -3314,16 +3386,16 @@ void load_model_transforms(ModelNode* model, ModelNode* parent, Matrix4f mdlTran if (model->type == SHAPE_TYPE_GROUP) { s32 childCount = mdl_get_child_count(model); - for (i = mdl_treeIterPos; i < mdl_treeIterPos + childCount; i++) { + for (i = TreeIterPos; i < TreeIterPos + childCount; i++) { (*gCurrentModelTreeNodeInfo)[i].modelIndex = -1; (*gCurrentModelTreeNodeInfo)[i].treeDepth = treeDepth + 1; } - mdl_treeIterPos += childCount; + TreeIterPos += childCount; } mdl_create_model(modelBPptr, 4); - (*gCurrentModelTreeNodeInfo)[mdl_treeIterPos].treeDepth = treeDepth; - mdl_treeIterPos += 1; + (*gCurrentModelTreeNodeInfo)[TreeIterPos].treeDepth = treeDepth; + TreeIterPos += 1; } s32 get_model_list_index_from_tree_index(s32 treeIndex) { @@ -3396,7 +3468,7 @@ void func_8011B1D8(ModelNode* node) { // stop searching if node is a model if (node->type == SHAPE_TYPE_MODEL) { - mtg_MaxChild = mdl_treeIterPos; + mtg_MaxChild = TreeIterPos; return; } @@ -3404,8 +3476,8 @@ void func_8011B1D8(ModelNode* node) { if (node->type == SHAPE_TYPE_GROUP) { prop = get_model_property(node, MODEL_PROP_KEY_GROUP_INFO); if (prop != NULL && prop->data.s != GROUP_TYPE_0) { - mdl_treeIterPos += mdl_get_child_count(node); - mtg_MaxChild = mdl_treeIterPos; + TreeIterPos += mdl_get_child_count(node); + mtg_MaxChild = TreeIterPos; return; } } @@ -3415,7 +3487,7 @@ void func_8011B1D8(ModelNode* node) { if (numChildren != 0) { for (i = 0; i < numChildren; i++) { currentNode = node->groupData->childList[i]; - currentID = mdl_treeIterPos; + currentID = TreeIterPos; if (currentNode->type == SHAPE_TYPE_GROUP) { prop = get_model_property(currentNode, MODEL_PROP_KEY_GROUP_INFO); @@ -3431,20 +3503,20 @@ void func_8011B1D8(ModelNode* node) { } // the current model is the one we're looking for - if (mtg_SearchModelID == mdl_treeIterPos) { + if (mtg_SearchModelID == TreeIterPos) { mtg_FoundModelNode = currentNode; mtg_MinChild = currentID; return; } - mdl_treeIterPos++; + TreeIterPos++; } } } } void mdl_make_transform_group(u16 modelID) { - mdl_treeIterPos = 0; + TreeIterPos = 0; mtg_FoundModelNode = NULL; mtg_SearchModelID = modelID; mtg_MaxChild = 0; @@ -3566,7 +3638,7 @@ void clone_model(u16 srcModelID, u16 newModelID) { newModel->modelID = newModelID; } -void set_model_group_visibility(u16 treeIndex, s32 flags, s32 mode) { +void mdl_group_set_visibility(u16 treeIndex, s32 flags, s32 mode) { s32 maxGroupIndex = -1; s32 minGroupIndex; s32 modelIndex = (*gCurrentModelTreeNodeInfo)[treeIndex].modelIndex; @@ -3624,19 +3696,19 @@ void set_model_group_visibility(u16 treeIndex, s32 flags, s32 mode) { } } -void func_8011B950(u16 modelID, s32 customGfxIndex, s32 fogType, b32 groupsOnly) { +void mdl_group_set_custom_gfx(u16 groupModelID, s32 customGfxIndex, s32 tintType, b32 invertSelection) { s32 maxGroupIndex = -1; s32 i; s32 minGroupIndex; - s32 modelIndex = (*gCurrentModelTreeNodeInfo)[modelID].modelIndex; + s32 modelIndex = (*gCurrentModelTreeNodeInfo)[groupModelID].modelIndex; s32 siblingIndex; s32 maskLow, maskHigh, packed; if (modelIndex < MAX_MODELS - 1) { minGroupIndex = maxGroupIndex = modelIndex; } else { - s32 treeDepth = (*gCurrentModelTreeNodeInfo)[modelID].treeDepth; - for (i = modelID - 1; i >= 0; i--) { + s32 treeDepth = (*gCurrentModelTreeNodeInfo)[groupModelID].treeDepth; + for (i = groupModelID - 1; i >= 0; i--) { if ((*gCurrentModelTreeNodeInfo)[i].treeDepth <= treeDepth) { break; } @@ -3659,14 +3731,14 @@ void func_8011B950(u16 modelID, s32 customGfxIndex, s32 fogType, b32 groupsOnly) customGfxIndex = 0; } - if (fogType < 0) { + if (tintType < 0) { maskHigh = 0xF0; - fogType = 0; + tintType = 0; } - packed = customGfxIndex + (fogType << 4); + packed = customGfxIndex + (tintType << 4); - if (!groupsOnly) { + if (!invertSelection) { for (i = minGroupIndex; i <= maxGroupIndex; i++) { Model* model = (*gCurrentModels)[i]; model->customGfxIndex = (model->customGfxIndex & (maskLow + maskHigh)) + packed; @@ -3706,39 +3778,39 @@ void mdl_reset_transform_flags(void) { } void enable_world_fog(void) { - gCurrentFogSettings->enabled = TRUE; + gFogSettings->enabled = TRUE; } void disable_world_fog(void) { - gCurrentFogSettings->enabled = FALSE; + gFogSettings->enabled = FALSE; } void set_world_fog_dist(s32 start, s32 end) { - gCurrentFogSettings->startDistance = start; - gCurrentFogSettings->endDistance = end; + gFogSettings->startDistance = start; + gFogSettings->endDistance = end; } void set_world_fog_color(s32 r, s32 g, s32 b, s32 a) { - gCurrentFogSettings->color.r = r; - gCurrentFogSettings->color.g = g; - gCurrentFogSettings->color.b = b; - gCurrentFogSettings->color.a = a; + gFogSettings->color.r = r; + gFogSettings->color.g = g; + gFogSettings->color.b = b; + gFogSettings->color.a = a; } s32 is_world_fog_enabled(void) { - return gCurrentFogSettings->enabled; + return gFogSettings->enabled; } void get_world_fog_distance(s32* start, s32* end) { - *start = gCurrentFogSettings->startDistance; - *end = gCurrentFogSettings->endDistance; + *start = gFogSettings->startDistance; + *end = gFogSettings->endDistance; } void get_world_fog_color(s32* r, s32* g, s32* b, s32* a) { - *r = gCurrentFogSettings->color.r; - *g = gCurrentFogSettings->color.g; - *b = gCurrentFogSettings->color.b; - *a = gCurrentFogSettings->color.a; + *r = gFogSettings->color.r; + *g = gFogSettings->color.g; + *b = gFogSettings->color.b; + *a = gFogSettings->color.a; } void set_tex_panner(Model* model, s32 texPannerID) { @@ -3761,16 +3833,16 @@ void set_aux_pan_v(s32 texPannerID, s32 value) { texPannerAuxV[texPannerID] = value; } -void set_mdl_custom_gfx_set(Model* model, s32 customGfxIndex, u32 fogType) { +void set_mdl_custom_gfx_set(Model* model, s32 customGfxIndex, u32 tintType) { if (customGfxIndex == -1) { customGfxIndex = model->customGfxIndex & 0xF; } - if (fogType == -1) { - fogType = model->customGfxIndex >> 4; + if (tintType == -1) { + tintType = model->customGfxIndex >> 4; } - model->customGfxIndex = (customGfxIndex & 0xF) + ((fogType & 0xF) << 4); + model->customGfxIndex = (customGfxIndex & 0xF) + ((tintType & 0xF) << 4); } void set_custom_gfx(s32 customGfxIndex, Gfx* pre, Gfx* post) { @@ -3824,7 +3896,7 @@ s32 is_identity_fixed_mtx(Mtx* mtx) { return TRUE; } - identityIt = (s32*)&mdl_RDPIdentity; + identityIt = (s32*)&ReferenceIdentityMtx; for (i = 0; i < 16; i++, mtxIt++, identityIt++) { if (*mtxIt != *identityIt) { @@ -3835,62 +3907,61 @@ s32 is_identity_fixed_mtx(Mtx* mtx) { return TRUE; } -// fog mode 1? -void set_background_color_blend(u8 r, u8 g, u8 b, u8 a) { - mdl_bgMultiplyColorR = r; - mdl_bgMultiplyColorG = g; - mdl_bgMultiplyColorB = b; - mdl_bgMultiplyColorA = a; +void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a) { + ShroudTintR = r; + ShroudTintG = g; + ShroudTintB = b; + ShroudTintAmt = a; } -void get_background_color_blend(u8* r, u8* g, u8* b, u8* a) { - *r = mdl_bgMultiplyColorR; - *g = mdl_bgMultiplyColorG; - *b = mdl_bgMultiplyColorB; - *a = mdl_bgMultiplyColorA; +void mdl_get_shroud_tint_params(u8* r, u8* g, u8* b, u8* a) { + *r = ShroudTintR; + *g = ShroudTintG; + *b = ShroudTintB; + *a = ShroudTintAmt; } -void mdl_set_fog2_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd) { - mdl_Fog2PrimR = primR; - mdl_Fog2PrimG = primG; - mdl_Fog2PrimB = primB; - mdl_Fog2PrimA = primA; - mdl_Fog2ColR = fogR; - mdl_Fog2ColG = fogG; - mdl_Fog2ColB = fogB; - mdl_Fog2Start = fogStart; - mdl_Fog2End = fogEnd; +void mdl_set_depth_tint_params(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd) { + DepthTintBaseR = primR; + DepthTintBaseG = primG; + DepthTintBaseB = primB; + DepthTintBaseA = primA; + DepthTintColR = fogR; + DepthTintColG = fogG; + DepthTintColB = fogB; + DepthTintStart = fogStart; + DepthTintEnd = fogEnd; } -void mdl_get_fog2_color_parameters(u8* primR, u8* primG, u8* primB, u8* primA, u8* fogR, u8* fogG, u8* fogB, +void mdl_get_depth_tint_params(u8* primR, u8* primG, u8* primB, u8* primA, u8* fogR, u8* fogG, u8* fogB, s32* fogStart, s32* fogEnd) { - *primR = mdl_Fog2PrimR; - *primG = mdl_Fog2PrimG; - *primB = mdl_Fog2PrimB; - *primA = mdl_Fog2PrimA; - *fogR = mdl_Fog2ColR; - *fogG = mdl_Fog2ColG; - *fogB = mdl_Fog2ColB; - *fogStart = mdl_Fog2Start; - *fogEnd = mdl_Fog2End; + *primR = DepthTintBaseR; + *primG = DepthTintBaseG; + *primB = DepthTintBaseB; + *primA = DepthTintBaseA; + *fogR = DepthTintColR; + *fogG = DepthTintColG; + *fogB = DepthTintColB; + *fogStart = DepthTintStart; + *fogEnd = DepthTintEnd; } -void mdl_set_fog3_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB) { - mdl_Fog3PrimR = primR; - mdl_Fog3PrimG = primG; - mdl_Fog3PrimB = primB; - mdl_Fog3EnvR = envR; - mdl_Fog3EnvG = envG; - mdl_Fog3EnvB = envB; +void mdl_set_remap_tint_params(u8 maxR, u8 maxG, u8 maxB, u8 minR, u8 minG, u8 minB) { + RemapTintMaxR = maxR; + RemapTintMaxG = maxG; + RemapTintMaxB = maxB; + RemapTintMinR = minR; + RemapTintMinG = minG; + RemapTintMinB = minB; } -void mdl_get_fog3_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB) { - *primR = mdl_Fog3PrimR; - *primG = mdl_Fog3PrimG; - *primB = mdl_Fog3PrimB; - *envR = mdl_Fog3EnvR; - *envG = mdl_Fog3EnvG; - *envB = mdl_Fog3EnvB; +void mdl_get_remap_tint_params(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB) { + *primR = RemapTintMaxR; + *primG = RemapTintMaxG; + *primB = RemapTintMaxB; + *envR = RemapTintMinR; + *envG = RemapTintMinG; + *envB = RemapTintMinB; } void mdl_get_vertex_count(Gfx* gfx, s32* numVertices, Vtx** baseVtx, s32* gfxCount, Vtx* baseAddr) { @@ -4202,7 +4273,7 @@ void mdl_project_tex_coords(s32 modelID, Gfx* outGfx, Matrix4f arg2, Vtx* arg3) // Checks if the center of a model is visible. // If `depthQueryID` is nonnegative, the depth buffer is checked to see if the model's center is occluded by geometry. // Otherwise, the occlusion check is skipped. -// `depthQueryID` must be between 0 and the size of `depthCopyBuffer` minus 1. +// `depthQueryID` must be between 0 and the size of `DepthCopyBuffer` minus 1. // Every nonnegative value of `depthQueryID` must be unique within a frame, otherwise the result will corrupt the data // of the previous query that shared the same ID. // Occlusion visibility checks are always one frame out of date, as they reference the previous frame's depth buffer. @@ -4221,7 +4292,7 @@ s32 is_model_center_visible(u16 modelID, s32 depthQueryID, f32* screenX, f32* sc s32 scaledDepth; // If an invalid depth query id was provided, return false. - if (depthQueryID >= ARRAY_COUNT(depthCopyBuffer)) { + if (depthQueryID >= ARRAY_COUNT(DepthCopyBuffer)) { return FALSE; } // Transform the model's center into clip space. @@ -4267,7 +4338,7 @@ s32 is_model_center_visible(u16 modelID, s32 depthQueryID, f32* screenX, f32* sc G_TX_NOLOD, G_TX_NOLOD); gDPPipeSync(gMainGfxPos++); // Set the current color image to the buffer where copied depth values are stored. - gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, depthCopyBuffer); + gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, DepthCopyBuffer); gDPPipeSync(gMainGfxPos++); // Set up 1 cycle mode and all other relevant othermode params. // One cycle mode must be used here because only one pixel is copied, and copy mode only supports multiples of 4 pixels. @@ -4294,11 +4365,11 @@ s32 is_model_center_visible(u16 modelID, s32 depthQueryID, f32* screenX, f32* sc // The following code will use last frame's depth value, since the copy that was just written won't be executed until the current frame is drawn. // Extract the exponent and mantissa from the depth buffer value. - depthExponent = depthCopyBuffer[depthQueryID] >> DEPTH_EXPONENT_SHIFT; - depthMantissa = (depthCopyBuffer[depthQueryID] & (DEPTH_MANTISSA_MASK | DEPTH_DZ_MASK)) >> DEPTH_MANTISSA_SHIFT; + depthExponent = DepthCopyBuffer[depthQueryID] >> DEPTH_EXPONENT_SHIFT; + depthMantissa = (DepthCopyBuffer[depthQueryID] & (DEPTH_MANTISSA_MASK | DEPTH_DZ_MASK)) >> DEPTH_MANTISSA_SHIFT; // Convert the exponent and mantissa into a fixed-point value. - shiftedMantissa = depthMantissa << depthFloatLookupTable[depthExponent].shift; - mantissaBias = depthFloatLookupTable[depthExponent].bias; + shiftedMantissa = depthMantissa << DepthFloatLookupTable[depthExponent].shift; + mantissaBias = DepthFloatLookupTable[depthExponent].bias; // Remove the 3 fractional bits of precision. decodedDepth = (shiftedMantissa + mantissaBias) >> 3; // Convert the calculated screen depth into viewport depth. @@ -4313,7 +4384,7 @@ s32 is_model_center_visible(u16 modelID, s32 depthQueryID, f32* screenX, f32* sc // Checks if a point is visible on screen. // If `depthQueryID` is nonnegative, the depth buffer is checked to see if the point is occluded by geometry. // Otherwise, the occlusion check is skipped. -// `depthQueryID` must be between 0 and the size of `depthCopyBuffer` minus 1. +// `depthQueryID` must be between 0 and the size of `DepthCopyBuffer` minus 1. // Every nonnegative value of `depthQueryID` must be unique within a frame, otherwise the result will corrupt the data // of the previous query that shared the same ID. // Occlusion visibility checks are always one frame out of date, as they reference the previous frame's depth buffer. @@ -4331,7 +4402,7 @@ s32 is_point_visible(f32 x, f32 y, f32 z, s32 depthQueryID, f32* screenX, f32* s s32 scaledDepth; // If an invalid depth query id was provided, return false. - if (depthQueryID >= ARRAY_COUNT(depthCopyBuffer)) { + if (depthQueryID >= ARRAY_COUNT(DepthCopyBuffer)) { return FALSE; } // Transform the point into clip space. @@ -4373,7 +4444,7 @@ s32 is_point_visible(f32 x, f32 y, f32 z, s32 depthQueryID, f32* screenX, f32* s G_TX_NOLOD, G_TX_NOLOD); gDPPipeSync(gMainGfxPos++); // Set the current color image to the buffer where copied depth values are stored. - gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, depthCopyBuffer); + gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, DepthCopyBuffer); gDPPipeSync(gMainGfxPos++); // Set up 1 cycle mode and all other relevant othermode params. // One cycle mode must be used here because only one pixel is copied, and copy mode only supports multiples of 4 pixels. @@ -4400,11 +4471,11 @@ s32 is_point_visible(f32 x, f32 y, f32 z, s32 depthQueryID, f32* screenX, f32* s // The following code will use last frame's depth value, since the copy that was just written won't be executed until the current frame is drawn. // Extract the exponent and mantissa from the depth buffer value. - depthExponent = depthCopyBuffer[depthQueryID] >> DEPTH_EXPONENT_SHIFT; - depthMantissa = (depthCopyBuffer[depthQueryID] & (DEPTH_MANTISSA_MASK | DEPTH_DZ_MASK)) >> DEPTH_MANTISSA_SHIFT; + depthExponent = DepthCopyBuffer[depthQueryID] >> DEPTH_EXPONENT_SHIFT; + depthMantissa = (DepthCopyBuffer[depthQueryID] & (DEPTH_MANTISSA_MASK | DEPTH_DZ_MASK)) >> DEPTH_MANTISSA_SHIFT; // Convert the exponent and mantissa into a fixed-point value. - shiftedMantissa = depthMantissa << depthFloatLookupTable[depthExponent].shift; - mantissaBias = depthFloatLookupTable[depthExponent].bias; + shiftedMantissa = depthMantissa << DepthFloatLookupTable[depthExponent].shift; + mantissaBias = DepthFloatLookupTable[depthExponent].bias; // Remove the 3 fractional bits of precision. decodedDepth = (shiftedMantissa + mantissaBias) >> 3; // Convert the calculated screen depth into viewport depth. @@ -4444,24 +4515,24 @@ void* mdl_get_next_texture_address(s32 size) { offset = (offset >> 6) << 6; - if (size + offset > MAP_TEXTURE_MEMORY_SIZE + BTL_TEXTURE_MEMORY_SIZE) { + if (size + offset > WORLD_TEXTURE_MEMORY_SIZE + BATTLE_TEXTURE_MEMORY_SIZE) { return NULL; } else { return TextureHeapBase + offset; } } -void mdl_set_all_fog_mode(s32 fogMode) { +void mdl_set_all_tint_type(s32 tintType) { ModelList* modelList = gCurrentModels; Model* model; - s32 fogType = fogMode; // weirdness here and the next line needed to match - s32 i = fogMode; + s32 type = tintType; // weirdness here and the next line needed to match + s32 i = tintType; for (i = 0; i < ARRAY_COUNT(*modelList); i++) { model = (*modelList)[i]; if (model != NULL) { - set_mdl_custom_gfx_set(model, CUSTOM_GFX_NONE, fogType); + set_mdl_custom_gfx_set(model, CUSTOM_GFX_NONE, type); } } } @@ -4469,31 +4540,31 @@ void mdl_set_all_fog_mode(s32 fogMode) { void clear_render_tasks(void) { s32 i; - for (i = 0; i < ARRAY_COUNT(mdl_clearRenderTasks); i++) { - mdl_renderTaskLists[i] = mdl_clearRenderTasks[i]; + for (i = 0; i < ARRAY_COUNT(ClearRenderTaskLists); i++) { + RenderTaskLists[i] = ClearRenderTaskLists[i]; } - mdl_renderTaskQueueIdx = 0; - mdl_renderTaskCount = 0; + RenderTaskListIdx = 0; + RenderTaskCount = 0; } void clear_render_tasks_alt(void) { s32 i; - for (i = 0; i < ARRAY_COUNT(mdl_clearRenderTasks); i++) { - mdl_renderTaskLists[i] = mdl_clearRenderTasks[i]; + for (i = 0; i < ARRAY_COUNT(ClearRenderTaskLists); i++) { + RenderTaskLists[i] = ClearRenderTaskLists[i]; } - mdl_renderTaskQueueIdx = 0; - mdl_renderTaskCount = 0; + RenderTaskListIdx = 0; + RenderTaskCount = 0; } RenderTask* queue_render_task(RenderTask* task) { - RenderTask* ret = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; + RenderTask* ret = RenderTaskLists[RenderTaskListIdx]; - ASSERT(mdl_renderTaskCount < ARRAY_COUNT(*mdl_clearRenderTasks)); + ASSERT(RenderTaskCount < ARRAY_COUNT(*ClearRenderTaskLists)); - ret = &ret[mdl_renderTaskCount++]; + ret = &ret[RenderTaskCount++]; ret->renderMode = RENDER_TASK_FLAG_ENABLED; if (task->renderMode == RENDER_MODE_CLOUD_NO_ZCMP) { @@ -4509,23 +4580,23 @@ RenderTask* queue_render_task(RenderTask* task) { void execute_render_tasks(void) { s32 i, j, taskCount; - s32 sorted[ARRAY_COUNT(*mdl_clearRenderTasks)]; + s32 sorted[ARRAY_COUNT(*ClearRenderTaskLists)]; RenderTask* taskList; RenderTask* task; RenderTask* task2; Matrix4f mtxFlipY; void (*appendGfx)(void*); - if (mdl_renderTaskCount == 0) { + if (RenderTaskCount == 0) { return; } - for (i = taskCount = 0; i < mdl_renderTaskCount; i++) { + for (i = taskCount = 0; i < RenderTaskCount; i++) { sorted[taskCount++] = i; } // sort in ascending order - taskList = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; + taskList = RenderTaskLists[RenderTaskListIdx]; for (i = 0; i < taskCount - 1; i++) { for (j = i + 1; j < taskCount; j++) { s32 t1 = sorted[i]; @@ -4540,7 +4611,7 @@ void execute_render_tasks(void) { } // tasks with dist >= 3M sort in descending order - taskList = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; + taskList = RenderTaskLists[RenderTaskListIdx]; for (i = 0; i < taskCount - 1; i++) { task = &taskList[sorted[i]]; if (task->dist >= 3000000) { @@ -4558,7 +4629,7 @@ void execute_render_tasks(void) { } // tasks with dist <= 800k sort in descending order - taskList = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; + taskList = RenderTaskLists[RenderTaskListIdx]; for (i = 0; i < taskCount - 1; i++) { task = &taskList[sorted[i]]; if (task->dist > 800000) { @@ -4580,7 +4651,7 @@ void execute_render_tasks(void) { } gLastRenderTaskCount = taskCount; - taskList = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; + taskList = RenderTaskLists[RenderTaskListIdx]; if (gOverrideFlags & GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION) { Mtx* dispMtx; Gfx* savedGfxPos = NULL; @@ -4615,9 +4686,9 @@ void execute_render_tasks(void) { } } - mdl_renderTaskQueueIdx++; - if (mdl_renderTaskQueueIdx > ARRAY_COUNT(mdl_renderTaskLists) - 1) { - mdl_renderTaskQueueIdx = 0; + RenderTaskListIdx++; + if (RenderTaskListIdx > ARRAY_COUNT(RenderTaskLists) - 1) { + RenderTaskListIdx = 0; } - mdl_renderTaskCount = 0; + RenderTaskCount = 0; } diff --git a/src/model_clear_render_tasks.c b/src/model_clear_render_tasks.c index 1255bf293f2..7bed038bf13 100644 --- a/src/model_clear_render_tasks.c +++ b/src/model_clear_render_tasks.c @@ -1,3 +1,3 @@ #include "model_clear_render_tasks.h" -BSS RenderTask mdl_clearRenderTasks[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST]; +BSS RenderTask ClearRenderTaskLists[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST]; diff --git a/src/model_clear_render_tasks.h b/src/model_clear_render_tasks.h index d8686ef670a..60da72585c2 100644 --- a/src/model_clear_render_tasks.h +++ b/src/model_clear_render_tasks.h @@ -3,4 +3,4 @@ #define NUM_RENDER_TASK_LISTS 3 #define NUM_RENDER_TASKS_IN_LIST 0x100 -extern RenderTask mdl_clearRenderTasks[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST]; +extern RenderTask ClearRenderTaskLists[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST]; diff --git a/src/npc.c b/src/npc.c index 69f4ef6597d..0ffbd9f30a8 100644 --- a/src/npc.c +++ b/src/npc.c @@ -990,7 +990,7 @@ void render_npcs(void) { if (npc->flags & NPC_FLAG_HIDING) { u8 r, g, b, a; - get_background_color_blend(&r, &g, &b, &a); + mdl_get_shroud_tint_params(&r, &g, &b, &a); npc->hideAlpha = 255 - a; } else { npc->hideAlpha = 255; diff --git a/src/texture_memory.c b/src/texture_memory.c index 89f463ead35..362e652f633 100644 --- a/src/texture_memory.c +++ b/src/texture_memory.c @@ -1,6 +1,6 @@ #include "common.h" -#define MAP_TEXTURE_MEMORY_SIZE 0x20000 -#define BTL_TEXTURE_MEMORY_SIZE 0x8000 +#define WORLD_TEXTURE_MEMORY_SIZE 0x20000 +#define BATTLE_TEXTURE_MEMORY_SIZE 0x8000 -BSS u8 MapTextureMemory[MAP_TEXTURE_MEMORY_SIZE + BTL_TEXTURE_MEMORY_SIZE]; +BSS u8 TextureHeap[WORLD_TEXTURE_MEMORY_SIZE + BATTLE_TEXTURE_MEMORY_SIZE]; diff --git a/src/world/area_dro/dro_01/dro_01_2_main.c b/src/world/area_dro/dro_01/dro_01_2_main.c index 09d90199bc3..fc8ca8144f1 100644 --- a/src/world/area_dro/dro_01/dro_01_2_main.c +++ b/src/world/area_dro/dro_01/dro_01_2_main.c @@ -2,7 +2,7 @@ #include "world/common/entity/Pipe.inc.c" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" EvtScript N(EVS_ExitWalk_sbk_36_1) = { EVT_SET_GROUP(EVT_GROUP_1B) @@ -30,9 +30,9 @@ EvtScript N(EVS_Scene_RuinsRising) = { EVT_CALL(SetPanTarget, CAM_DEFAULT, 175, 0, -201) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 44, 32, 177, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2)) diff --git a/src/world/area_dro/dro_02/dro_02_3_main.c b/src/world/area_dro/dro_02/dro_02_3_main.c index 72fde551afa..1ee3d10767f 100644 --- a/src/world/area_dro/dro_02/dro_02_3_main.c +++ b/src/world/area_dro/dro_02/dro_02_3_main.c @@ -1,6 +1,6 @@ #include "dro_02.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" EvtScript N(EVS_ExitWalk_dro_01_1) = EVT_EXIT_WALK(60, dro_02_ENTRY_0, "dro_01", dro_01_ENTRY_1); @@ -26,9 +26,9 @@ EvtScript N(EVS_EnterScene) = { EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-10.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 44, 32, 177, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2)) diff --git a/src/world/area_dro/dro_02/npc_merlee.c b/src/world/area_dro/dro_02/npc_merlee.c index a7a957145ba..2588373c81c 100644 --- a/src/world/area_dro/dro_02/npc_merlee.c +++ b/src/world/area_dro/dro_02/npc_merlee.c @@ -115,9 +115,9 @@ API_CALLABLE(N(DarkenWorld)) { s32 i; if (isInitialCall) { - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); for (i = 0; i < MAX_NPCS; i++) { Npc* npc = get_npc_by_index(i); @@ -132,7 +132,7 @@ API_CALLABLE(N(DarkenWorld)) { if (script->functionTemp[0] > 255) { script->functionTemp[0] = 255; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); return (script->functionTemp[0] == 255) * ApiStatus_DONE2; } @@ -141,7 +141,7 @@ API_CALLABLE(N(UndarkenWorld)) { s32 i; if (isInitialCall) { - set_background_color_blend(0, 0, 0, 255); + mdl_set_shroud_tint_params(0, 0, 0, 255); script->functionTemp[0] = 255; script->functionTemp[1] = 0; } @@ -149,13 +149,13 @@ API_CALLABLE(N(UndarkenWorld)) { if (script->functionTemp[0] < 0) { script->functionTemp[0] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) { script->functionTemp[1] = 1; } else if (script->functionTemp[1] == 1) { - mdl_set_all_fog_mode(FOG_MODE_0); - *gBackgroundFogModePtr = FOG_MODE_0; + mdl_set_all_tint_type(ENV_TINT_NONE); + *gBackgroundTintModePtr = ENV_TINT_NONE; for (i = 0; i < MAX_NPCS; i++) { Npc* npc = get_npc_by_index(i); diff --git a/src/world/area_end/end_01/end_01_4_opera_float.c b/src/world/area_end/end_01/end_01_4_opera_float.c index abadac9b08f..731436369af 100644 --- a/src/world/area_end/end_01/end_01_4_opera_float.c +++ b/src/world/area_end/end_01/end_01_4_opera_float.c @@ -5,8 +5,8 @@ extern s32 N(SpotlightsAlpha); API_CALLABLE(N(SetWorldDark)) { - func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_1, FALSE); - set_background_color_blend(0, 0, 0, 255); + mdl_group_set_custom_gfx(MODEL_Root, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, FALSE); + mdl_set_shroud_tint_params(0, 0, 0, 255); return ApiStatus_DONE2; } @@ -20,10 +20,10 @@ API_CALLABLE(N(FadeInWorld)) { script->functionTemp[1] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[1]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[1]); if (script->functionTemp[1] == 0) { - func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_0, FALSE); + mdl_group_set_custom_gfx(MODEL_Root, CUSTOM_GFX_NONE, ENV_TINT_NONE, FALSE); return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; diff --git a/src/world/area_end/end_01/end_01_6_shyguy_float.c b/src/world/area_end/end_01/end_01_6_shyguy_float.c index e1d74784a0a..2d96a5d9997 100644 --- a/src/world/area_end/end_01/end_01_6_shyguy_float.c +++ b/src/world/area_end/end_01/end_01_6_shyguy_float.c @@ -1,6 +1,6 @@ #include "end_01.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" EvtScript N(EVS_TexPan_ShyGuyFloat_Sides) = { EVT_CALL(EnableTexPanning, MODEL_omo1, TRUE) @@ -58,10 +58,10 @@ EvtScript N(EVS_ShyGuyFloat_Open) = { EVT_END_IF EVT_END_LOOP EVT_END_THREAD - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(ShyGuyFloat_InteriorModels)), FOG_MODE_3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 255, 255, 255, 120, 120, 80, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(ShyGuyFloat_InteriorModels)), ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 255, 255, 255, 120, 120, 80, 0, 0, 0) EVT_WAIT(30) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 255, 255, 255, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 255, 255, 255, 0, 0, 0, 0, 0, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c b/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c index b7be63417c6..d48d63f5b2c 100644 --- a/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c +++ b/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c @@ -15,7 +15,7 @@ void N(setup_gfx_background_shade)(void) { } EvtScript N(EVS_SetupBackgroundShade) = { - EVT_CALL(SetModelCustomGfx, MODEL_g107, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_g107, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_background_shade)), NULL) EVT_RETURN EVT_END diff --git a/src/world/area_hos/hos_01/hos_01_3_model_fx.c b/src/world/area_hos/hos_01/hos_01_3_model_fx.c index 916fd52bd7b..b429243686d 100644 --- a/src/world/area_hos/hos_01/hos_01_3_model_fx.c +++ b/src/world/area_hos/hos_01/hos_01_3_model_fx.c @@ -144,16 +144,16 @@ EvtScript N(EVS_SetupModelFX) = { EVT_CALL(SetRenderMode, MODEL_5, RENDER_MODE_SURFACE_XLU_LAYER2) EVT_CALL(SetRenderMode, MODEL_6, RENDER_MODE_SURFACE_XLU_LAYER2) EVT_CALL(SetRenderMode, MODEL_7, RENDER_MODE_SURFACE_XLU_LAYER2) - EVT_CALL(SetModelCustomGfx, MODEL_1, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_2, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_3, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_4, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_5, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_6, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_7, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_1, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_2, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_3, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_4, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_5, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_6, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_7, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_glowing_star)), NULL) EVT_CALL(TranslateModel, MODEL_power, 0, 2, 0) - EVT_CALL(SetModelCustomGfx, MODEL_power, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_power, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_giving_power)), NULL) EVT_THREAD EVT_LOOP(0) diff --git a/src/world/area_hos/hos_02/hos_02_3_model_fx.c b/src/world/area_hos/hos_02/hos_02_3_model_fx.c index 21c84096733..36d41c35baf 100644 --- a/src/world/area_hos/hos_02/hos_02_3_model_fx.c +++ b/src/world/area_hos/hos_02/hos_02_3_model_fx.c @@ -158,12 +158,12 @@ EvtScript N(EVS_SetupModelFX) = { EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD // custom gfx for lantern glow halos, flags for the entire lamp posts - EVT_CALL(SetModelCustomGfx, MODEL_o414, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o415, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o399, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o398, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o348, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o414, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o415, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o399, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o398, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o348, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(build_gfx_lamp_halos)), NULL) EVT_CALL(SetModelFlags, MODEL_o414, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE) EVT_CALL(SetModelFlags, MODEL_o415, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE) @@ -183,17 +183,17 @@ EvtScript N(EVS_SetupModelFX) = { // yellow stars EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o466, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o466, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o467, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o468, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o470, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o471, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o472, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o541, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o542, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o545, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o548, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o466, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o467, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o468, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o470, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o471, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o472, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o541, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o542, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o545, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o548, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o466, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o467, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o468, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) @@ -208,22 +208,22 @@ EvtScript N(EVS_SetupModelFX) = { // blue stars EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o466, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_blue_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o543, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o539, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o543, CUSTOM_GFX_2, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o539, CUSTOM_GFX_2, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o543, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o539, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) // green stars EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o466, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_green_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o546, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o540, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o546, CUSTOM_GFX_3, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o540, CUSTOM_GFX_3, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o546, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o540, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) // pink stars EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o466, TRUE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_pink_stars)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o544, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o547, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o544, CUSTOM_GFX_4, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o547, CUSTOM_GFX_4, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_o544, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o547, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_THREAD diff --git a/src/world/area_hos/hos_03/hos_03_3_model_fx.c b/src/world/area_hos/hos_03/hos_03_3_model_fx.c index 0bd92a50a63..c7235079102 100644 --- a/src/world/area_hos/hos_03/hos_03_3_model_fx.c +++ b/src/world/area_hos/hos_03/hos_03_3_model_fx.c @@ -154,7 +154,7 @@ EvtScript N(EVS_SetupAurora) = { 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)), NULL) - EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_RETURN EVT_END }; diff --git a/src/world/area_hos/hos_04/hos_04_3_fountains.c b/src/world/area_hos/hos_04/hos_04_3_fountains.c index a6c1bedfe7f..9953e198470 100644 --- a/src/world/area_hos/hos_04/hos_04_3_fountains.c +++ b/src/world/area_hos/hos_04/hos_04_3_fountains.c @@ -40,10 +40,10 @@ EvtScript N(EVS_SetupFountains) = { EVT_CALL(EnableTexPanning, MODEL_o438, TRUE) EVT_CALL(EnableTexPanning, MODEL_o462, TRUE) EVT_CALL(EnableTexPanning, MODEL_o469, TRUE) - EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o462, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o465, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o461, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o462, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o465, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o461, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_fountain_water)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_fountain_stars)), NULL) EVT_RETURN diff --git a/src/world/area_hos/hos_05/hos_05_3_misc.c b/src/world/area_hos/hos_05/hos_05_3_misc.c index 5ecb0ee950a..35b09922933 100644 --- a/src/world/area_hos/hos_05/hos_05_3_misc.c +++ b/src/world/area_hos/hos_05/hos_05_3_misc.c @@ -1,6 +1,6 @@ #include "hos_05.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" #include "world/common/atomic/TexturePan.inc.c" diff --git a/src/world/area_hos/hos_05/hos_05_5_intro.c b/src/world/area_hos/hos_05/hos_05_5_intro.c index 1cb2d9170ae..34dca4671a8 100644 --- a/src/world/area_hos/hos_05/hos_05_5_intro.c +++ b/src/world/area_hos/hos_05/hos_05_5_intro.c @@ -217,7 +217,7 @@ API_CALLABLE(N(SetWorldFogParams)) { s32 fogStart = evt_get_variable(script, *args++); s32 fogEnd = evt_get_variable(script, *args++); - mdl_set_fog2_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); + mdl_set_depth_tint_params(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); return ApiStatus_DONE2; } @@ -231,7 +231,7 @@ API_CALLABLE(N(SetWorldColorParams)) { args = script->ptrReadPos; if (isInitialCall) { - mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_remap_tint_params(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); newPrimR = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++); @@ -247,7 +247,7 @@ API_CALLABLE(N(SetWorldColorParams)) { return ApiStatus_DONE2; } time++; - mdl_set_fog3_color_parameters( + mdl_set_remap_tint_params( (oldPrimR + ((newPrimR - oldPrimR) * time) / duration), (oldPrimG + ((newPrimG - oldPrimG) * time) / duration), (oldPrimB + ((newPrimB - oldPrimB) * time) / duration), @@ -258,7 +258,7 @@ API_CALLABLE(N(SetWorldColorParams)) { return ApiStatus_DONE2; } } else { - mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_remap_tint_params(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return ApiStatus_DONE2; } return ApiStatus_BLOCK; @@ -287,8 +287,8 @@ API_CALLABLE(N(ResumeIntro)) { return ApiStatus_DONE1; } -API_CALLABLE(N(InitWorldFogMode)) { - mdl_set_all_fog_mode(FOG_MODE_3); +API_CALLABLE(N(InitWorldTintMode)) { + mdl_set_all_tint_type(ENV_TINT_REMAP); return ApiStatus_DONE2; } @@ -1882,7 +1882,7 @@ EvtScript N(EVS_Intro_Main) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE) EVT_CALL(N(SetWorldFogParams), 0, 0, 0, 0, 0, 0, 0, 995, 1000) - EVT_CALL(N(InitWorldFogMode)) + EVT_CALL(N(InitWorldTintMode)) EVT_CALL(N(SetWorldColorParams), 255, 255, 255, 0, 0, 0, 0) EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE) EVT_CALL(N(AdjustCamVfov), 0, 62) diff --git a/src/world/area_hos/hos_05/hos_05_7_model_fx.c b/src/world/area_hos/hos_05/hos_05_7_model_fx.c index 5e3f537728b..e0919152700 100644 --- a/src/world/area_hos/hos_05/hos_05_7_model_fx.c +++ b/src/world/area_hos/hos_05/hos_05_7_model_fx.c @@ -7,7 +7,7 @@ extern u16 StarShrineLightBeamAlpha; MAP_RODATA_PAD(1,unk); #define NAME_SUFFIX _Starship -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" #include "world/common/atomic/TexturePan.inc.c" API_CALLABLE(N(SetWorldColorParams)) { @@ -20,7 +20,7 @@ API_CALLABLE(N(SetWorldColorParams)) { args = script->ptrReadPos; if (isInitialCall) { - mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_remap_tint_params(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); newPrimR = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++); @@ -33,7 +33,7 @@ API_CALLABLE(N(SetWorldColorParams)) { if (duration > 0) { time++; - mdl_set_fog3_color_parameters( + mdl_set_remap_tint_params( oldPrimR + ((newPrimR - oldPrimR) * time) / duration, oldPrimG + ((newPrimG - oldPrimG) * time) / duration, oldPrimB + ((newPrimB - oldPrimB) * time) / duration, @@ -44,7 +44,7 @@ API_CALLABLE(N(SetWorldColorParams)) { return ApiStatus_DONE2; } } else { - mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_remap_tint_params(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return ApiStatus_DONE2; } return ApiStatus_BLOCK; @@ -165,7 +165,7 @@ EvtScript N(EVS_SetupLightBeam) = { EVT_IF_LT(GB_StoryProgress, STORY_CH8_STAR_SHIP_ACTIVATED) EVT_CALL(EnableModel, MODEL_o8, FALSE) EVT_ELSE - EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL) EVT_CALL(EnableModel, MODEL_o8, TRUE) EVT_CALL(N(SetLightBeamAlpha), 127) @@ -183,8 +183,8 @@ EvtScript N(EVS_SetupLightBeam) = { EvtScript N(EVS_Starship_Summon) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD - EVT_CALL(N(UnkFunc27_Starship), 2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27_Starship), 1, EVT_PTR(N(MostSolidGeometry)), FOG_MODE_3) + EVT_CALL(N(SetModelTintMode_Starship), 2, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode_Starship), 1, EVT_PTR(N(MostSolidGeometry)), ENV_TINT_REMAP) EVT_CALL(N(SetWorldColorParams_Starship), 255, 255, 255, 0, 0, 0, 0) EVT_WAIT(1) EVT_CALL(N(SetWorldColorParams_Starship), 102, 102, 102, 0, 0, 0, 60) @@ -204,7 +204,7 @@ EvtScript N(EVS_Starship_Summon) = { EVT_CALL(PlaySoundAt, SOUND_STARSHIP_APPEARS, SOUND_SPACE_DEFAULT, 0, 250, 0) EVT_PLAY_EFFECT(EFFECT_LIGHT_RAYS, 2, 0, 250, 0, 10, LVar9) EVT_WAIT(20) - EVT_CALL(SetModelCustomGfx, MODEL_o646, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o646, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_starship_shimmer)), NULL) EVT_CALL(EnableGroup, MODEL_g279, TRUE) EVT_THREAD @@ -219,7 +219,7 @@ EvtScript N(EVS_Starship_Summon) = { EVT_END_LOOP EVT_END_THREAD EVT_WAIT(60) - EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL) EVT_CALL(EnableModel, MODEL_o8, TRUE) EVT_CALL(MakeLerp, 0, 127, 60, EASING_COS_IN_OUT) diff --git a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c index fdc0cd058cd..bf82fe5cf3d 100644 --- a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c +++ b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c @@ -418,14 +418,14 @@ API_CALLABLE(N(RefundHintCoins)) { API_CALLABLE(N(func_802418E8_A3ADC8)) { if (isInitialCall) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, FOG_MODE_3); - mdl_set_fog3_color_parameters(255, 255, 255, 0, 0, 0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + mdl_set_remap_tint_params(255, 255, 255, 0, 0, 0); script->functionTemp[0] = 255; } @@ -433,7 +433,7 @@ API_CALLABLE(N(func_802418E8_A3ADC8)) { if (script->functionTemp[0] < 64) { script->functionTemp[0] = 64; } - mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_remap_tint_params(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 64) { return ApiStatus_DONE2; } @@ -468,7 +468,7 @@ API_CALLABLE(N(func_80241A58_A3AF38)) { script->functionTemp[2] = 0; } } - mdl_set_fog3_color_parameters( + mdl_set_remap_tint_params( script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[2], script->functionTemp[2], script->functionTemp[2] ); @@ -487,16 +487,16 @@ API_CALLABLE(N(func_80241B74_A3B054)) { if (script->functionTemp[0] > 255) { script->functionTemp[0] = 255; } - mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_remap_tint_params(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 255) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, ENV_TINT_NONE); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_isk/isk_16/isk_16_3_boss.c b/src/world/area_isk/isk_16/isk_16_3_boss.c index a0b012efbb0..870b8c47c98 100644 --- a/src/world/area_isk/isk_16/isk_16_3_boss.c +++ b/src/world/area_isk/isk_16/isk_16_3_boss.c @@ -1,14 +1,14 @@ #include "isk_16.h" #include "sprite/player.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePartnerAI, 0) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, -1, FOG_MODE_1) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_1) - EVT_CALL(N(UnkFunc26), FOG_MODE_1, 0, 0, 0, 255, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, -1, ENV_TINT_SHROUD) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_SHROUD) + EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, 255, 0, 0, 0, 0, 0) EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 410, -910, 410) EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0)) EVT_CALL(SetPanTarget, CAM_DEFAULT, 336, -910, 467) @@ -65,10 +65,10 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_SET(LVar0, 255) EVT_LOOP(60 * DT) EVT_ADD(LVar0, -4 * DT) - EVT_CALL(N(UnkFunc26), FOG_MODE_1, 0, 0, 0, LVar0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, LVar0, 0, 0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP - EVT_CALL(N(UnkFunc26), FOG_MODE_1, 0, 0, 0, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, 0, 0, 0, 0, 0, 0) EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(530.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5 / DT)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) diff --git a/src/world/area_jan/jan_02/jan_02_2_main.c b/src/world/area_jan/jan_02/jan_02_2_main.c index 71e01b4cabc..1263bd662ce 100644 --- a/src/world/area_jan/jan_02/jan_02_2_main.c +++ b/src/world/area_jan/jan_02/jan_02_2_main.c @@ -15,12 +15,12 @@ API_CALLABLE(N(ManageBigPalmTreeVisibility)) { if (N(PrevPalmTreeVisibility) != 0) { if (currentFloor == COLLIDER_o327 || currentFloor == COLLIDER_o330) { - set_model_group_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_HIDDEN); + mdl_group_set_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_HIDDEN); N(PrevPalmTreeVisibility) = FALSE; } } else { if (currentFloor == COLLIDER_o319 || currentFloor == COLLIDER_o316) { - set_model_group_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_VISIBLE); + mdl_group_set_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_VISIBLE); N(PrevPalmTreeVisibility) = TRUE; } } diff --git a/src/world/area_jan/jan_13/jan_13_2_puzzle.c b/src/world/area_jan/jan_13/jan_13_2_puzzle.c index e90dbd25918..399d4ea2600 100644 --- a/src/world/area_jan/jan_13/jan_13_2_puzzle.c +++ b/src/world/area_jan/jan_13/jan_13_2_puzzle.c @@ -660,12 +660,12 @@ EvtScript N(EVS_SetupPuzzle) = { EVT_CALL(EnableTexPanning, MODEL_o75, TRUE) EVT_CALL(EnableTexPanning, MODEL_o76, TRUE) EVT_CALL(EnableTexPanning, MODEL_o71, TRUE) - EVT_CALL(SetModelCustomGfx, MODEL_o72, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o73, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o74, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o75, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o71, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o72, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o73, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o74, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o75, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o71, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_geyser)), NULL) EVT_SET(LVar0, 0) EVT_LOOP(0) diff --git a/src/world/area_jan/jan_16/jan_16_2_main.c b/src/world/area_jan/jan_16/jan_16_2_main.c index c25d9fe15bd..e4edee53752 100644 --- a/src/world/area_jan/jan_16/jan_16_2_main.c +++ b/src/world/area_jan/jan_16/jan_16_2_main.c @@ -120,7 +120,7 @@ EvtScript N(EVS_EnterFalling) = { EVT_END }; -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" EvtScript N(EVS_Main) = { EVT_SET(GB_WorldLocation, LOCATION_JADE_JUNGLE) @@ -142,9 +142,9 @@ EvtScript N(EVS_Main) = { EVT_EXEC_WAIT(N(EVS_SetupMusic)) EVT_EXEC(N(EVS_SetupBushes)) EVT_EXEC(N(EVS_SpawnButterflies)) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, -1, 3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, 3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 255, 255, 255, 0, 0, 25, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, -1, 3) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, 3) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 255, 255, 255, 0, 0, 25, 0, 0, 0) EVT_RETURN EVT_END }; diff --git a/src/world/area_kkj/kkj_03/kkj_03_2_main.c b/src/world/area_kkj/kkj_03/kkj_03_2_main.c index f0c2c5770a0..64b9e0d89cf 100644 --- a/src/world/area_kkj/kkj_03/kkj_03_2_main.c +++ b/src/world/area_kkj/kkj_03/kkj_03_2_main.c @@ -59,7 +59,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o715, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o715, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_EXEC(N(EVS_SetupMusic)) EVT_CALL(UseDoorSounds, DOOR_SOUNDS_LARGE) diff --git a/src/world/area_kkj/kkj_13/kkj_13_2_main.c b/src/world/area_kkj/kkj_13/kkj_13_2_main.c index b098c1da6de..76c0650a70f 100644 --- a/src/world/area_kkj/kkj_13/kkj_13_2_main.c +++ b/src/world/area_kkj/kkj_13/kkj_13_2_main.c @@ -82,7 +82,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o685, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o685, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_EXEC(N(EVS_SetupMusic)) EVT_BIND_TRIGGER(EVT_PTR(N(EVS_ExitDoors_kkj_12_1)), TRIGGER_WALL_PRESS_A, COLLIDER_deilit1, 1, 0) diff --git a/src/world/area_kkj/kkj_14/kkj_14_2_main.c b/src/world/area_kkj/kkj_14/kkj_14_2_main.c index 07f8666e4c8..c6069484fa2 100644 --- a/src/world/area_kkj/kkj_14/kkj_14_2_main.c +++ b/src/world/area_kkj/kkj_14/kkj_14_2_main.c @@ -224,7 +224,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o154, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o154, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_RETURN EVT_END diff --git a/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c b/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c index 4e3a254acc8..76026ea1ad8 100644 --- a/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c +++ b/src/world/area_kkj/kkj_14/kkj_14_3_interactables.c @@ -401,7 +401,7 @@ EvtScript N(EVS_SetupInteractables) = { EVT_IF_EQ(GF_KKJ14_OpenedPassage, FALSE) EVT_CALL(EnableGroup, MODEL_g27, FALSE) EVT_EXEC(N(EVS_TexPan_Fireplace)) - EVT_CALL(SetModelCustomGfx, MODEL_o157, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o157, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_fireplace)), NULL) EVT_SWITCH(GB_StoryProgress) EVT_CASE_LT(STORY_CH0_WAKE_UP) diff --git a/src/world/area_kkj/kkj_15/kkj_15_2_main.c b/src/world/area_kkj/kkj_15/kkj_15_2_main.c index 15021f1315f..f2ec41ca676 100644 --- a/src/world/area_kkj/kkj_15/kkj_15_2_main.c +++ b/src/world/area_kkj/kkj_15/kkj_15_2_main.c @@ -126,7 +126,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o151, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o151, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_CALL(SetTexPanner, MODEL_o152, TEX_PANNER_0) EVT_THREAD @@ -136,7 +136,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o152, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o152, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_CALL(UseDoorSounds, DOOR_SOUNDS_BASIC) EVT_EXEC(N(EVS_SetupMusic)) diff --git a/src/world/area_kkj/kkj_18/kkj_18_2_main.c b/src/world/area_kkj/kkj_18/kkj_18_2_main.c index 7f56d3b8cae..b08932e8cf3 100644 --- a/src/world/area_kkj/kkj_18/kkj_18_2_main.c +++ b/src/world/area_kkj/kkj_18/kkj_18_2_main.c @@ -119,7 +119,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o56, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o56, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_EXEC(N(EVS_SetupMusic)) EVT_CALL(UseDoorSounds, DOOR_SOUNDS_BASIC) diff --git a/src/world/area_kkj/kkj_27/kkj_27_2_main.c b/src/world/area_kkj/kkj_27/kkj_27_2_main.c index 20f9c1f9f86..6f464d0699a 100644 --- a/src/world/area_kkj/kkj_27/kkj_27_2_main.c +++ b/src/world/area_kkj/kkj_27/kkj_27_2_main.c @@ -55,7 +55,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o207, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o207, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_CALL(SetTexPanner, MODEL_o209, 0) EVT_THREAD @@ -65,7 +65,7 @@ EvtScript N(EVS_Main) = { TEX_PAN_PARAMS_INIT( 0, 0, 0, 0) EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_END_THREAD - EVT_CALL(SetModelCustomGfx, MODEL_o209, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o209, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfx, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_candle_lights)), NULL) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(3.0)) EVT_RETURN diff --git a/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c b/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c index 6d2c686cf88..39c01ee3256 100644 --- a/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c +++ b/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c @@ -128,9 +128,9 @@ EvtScript N(EVS_SetupRotatingWall) = { EVT_CALL(EnableModel, MODEL_o182, FALSE) EVT_CALL(EnableModel, MODEL_o184, FALSE) EVT_CALL(EnableModel, MODEL_o186, FALSE) - EVT_CALL(SetModelCustomGfx, MODEL_o182, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o184, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_o186, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o182, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o184, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_o186, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_spill_light)), NULL) EVT_IF_EQ(GB_StoryProgress, STORY_CH1_BEGAN_PEACH_MISSION) EVT_BIND_TRIGGER(EVT_PTR(N(EVS_UseRotatingWall_FirstTime)), TRIGGER_WALL_PRESS_A, COLLIDER_o193, 1, 0) diff --git a/src/world/area_kmr/kmr_00/kmr_00_3_revival.c b/src/world/area_kmr/kmr_00/kmr_00_3_revival.c index 5ab953bf450..ea1d1d3c50f 100644 --- a/src/world/area_kmr/kmr_00/kmr_00_3_revival.c +++ b/src/world/area_kmr/kmr_00/kmr_00_3_revival.c @@ -13,7 +13,7 @@ API_CALLABLE(N(func_80240000_8ABF90)) { args = script->ptrReadPos; if (isInitialCall) { - mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_remap_tint_params(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); newPrimR = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++); @@ -26,7 +26,7 @@ API_CALLABLE(N(func_80240000_8ABF90)) { if (duration > 0) { time++; - mdl_set_fog3_color_parameters( + mdl_set_remap_tint_params( (oldPrimR + ((newPrimR - oldPrimR) * time) / duration), (oldPrimG + ((newPrimG - oldPrimG) * time) / duration), (oldPrimB + ((newPrimB - oldPrimB) * time) / duration), @@ -37,15 +37,15 @@ API_CALLABLE(N(func_80240000_8ABF90)) { return ApiStatus_DONE2; } } else { - mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_remap_tint_params(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return ApiStatus_DONE2; } return ApiStatus_BLOCK; } API_CALLABLE(N(func_80240388_8AC318)) { - mdl_set_all_fog_mode(FOG_MODE_3); - *gBackgroundFogModePtr = FOG_MODE_3; + mdl_set_all_tint_type(ENV_TINT_REMAP); + *gBackgroundTintModePtr = ENV_TINT_REMAP; return ApiStatus_DONE2; } diff --git a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c index 8ef2e0a7eb1..b61bb69f6ae 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_3_npc.c +++ b/src/world/area_kmr/kmr_02/kmr_02_3_npc.c @@ -1339,12 +1339,12 @@ API_CALLABLE(N(func_8024295C_8B29CC)) { s32 duration = evt_get_variable(script, *args++); if (isInitialCall) { - get_background_color_blend(&N(savedColR), &N(savedColG), &N(savedColB), &N(savedColA)); + mdl_get_shroud_tint_params(&N(savedColR), &N(savedColG), &N(savedColB), &N(savedColA)); script->functionTemp[0] = 0; } if (duration > 0) { - set_background_color_blend( + mdl_set_shroud_tint_params( N(savedColR) + (((targetColR - N(savedColR)) * script->functionTemp[0]) / duration), N(savedColG) + (((targetColG - N(savedColG)) * script->functionTemp[0]) / duration), N(savedColB) + (((targetColB - N(savedColB)) * script->functionTemp[0]) / duration), @@ -1356,7 +1356,7 @@ API_CALLABLE(N(func_8024295C_8B29CC)) { return ApiStatus_DONE2; } } else { - set_background_color_blend(targetColR, targetColG, targetColB, targetColA); + mdl_set_shroud_tint_params(targetColR, targetColG, targetColB, targetColA); return ApiStatus_DONE2; } return ApiStatus_BLOCK; @@ -1364,7 +1364,7 @@ API_CALLABLE(N(func_8024295C_8B29CC)) { NOP_UNFIX API_CALLABLE(N(func_80242BA8_8B2C18)) { - *gBackgroundFogModePtr = FOG_MODE_1; + *gBackgroundTintModePtr = ENV_TINT_SHROUD; return ApiStatus_DONE2; } @@ -1384,11 +1384,11 @@ API_CALLABLE(N(func_80242BC0_8B2C30)) { newEnvB = evt_get_variable(script, *args++); duration = evt_get_variable(script, *args++); if (isInitialCall) { - mdl_get_fog3_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); + mdl_get_remap_tint_params(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); script->functionTemp[0] = 0; } if (duration > 0) { - mdl_set_fog3_color_parameters( + mdl_set_remap_tint_params( oldPrimR + ((newPrimR - oldPrimR) * script->functionTemp[0]) / duration, oldPrimG + ((newPrimG - oldPrimG) * script->functionTemp[0]) / duration, oldPrimB + ((newPrimB - oldPrimB) * script->functionTemp[0]) / duration, @@ -1400,20 +1400,20 @@ API_CALLABLE(N(func_80242BC0_8B2C30)) { return 2; } } else { - mdl_set_fog3_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); + mdl_set_remap_tint_params(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); return 2; } return 0; } API_CALLABLE(N(func_80242F08_8B2F78)) { - mdl_set_all_fog_mode(FOG_MODE_3); + mdl_set_all_tint_type(ENV_TINT_REMAP); return ApiStatus_DONE2; } API_CALLABLE(N(func_80242F28_8B2F98)) { - func_8011B950(MODEL_kinopi, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); - set_background_color_blend(0, 0, 0, 255); + mdl_group_set_custom_gfx(MODEL_kinopi, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); + mdl_set_shroud_tint_params(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; gCameras[CAM_DEFAULT].bgColor[2] = 0; diff --git a/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c b/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c index 0f6bd13396e..3b362911d54 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c +++ b/src/world/area_kmr/kmr_20/kmr_20_11_npc_intro.c @@ -8,8 +8,8 @@ #define NAME_SUFFIX API_CALLABLE(N(func_80241C9C_8EDABC)) { - func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); - set_background_color_blend(0, 0, 0, 255); + mdl_group_set_custom_gfx(MODEL_g62, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); + mdl_set_shroud_tint_params(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; diff --git a/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c b/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c index 85fdf7174ad..364352e0306 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c +++ b/src/world/area_kmr/kmr_20/kmr_20_12_npc_epilogue.c @@ -7,8 +7,8 @@ #define NAME_SUFFIX API_CALLABLE(N(func_80242030_8EDE50)) { - func_8011B950(MODEL_g62, CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); - set_background_color_blend(0, 0, 0, 0); + mdl_group_set_custom_gfx(MODEL_g62, CUSTOM_GFX_NONE, ENV_TINT_NONE, TRUE); + mdl_set_shroud_tint_params(0, 0, 0, 0); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; diff --git a/src/world/area_kzn/common/LavaGlowLighting.inc.c b/src/world/area_kzn/common/LavaGlowLighting.inc.c index a0adadd654a..b8b74d8e075 100644 --- a/src/world/area_kzn/common/LavaGlowLighting.inc.c +++ b/src/world/area_kzn/common/LavaGlowLighting.inc.c @@ -33,14 +33,14 @@ API_CALLABLE(N(ApplyLavaGlowLighting)) { for (i = 0; i < modelIDs->count; i++, idList++) { s32 treeIndex = get_model_list_index_from_tree_index(*idList); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_2); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, ENV_TINT_DEPTH); } } else { // list is NULL -> apply effect to ALL models Model** models = (Model**) gCurrentModels; for (i = 0; i < MAX_MODELS; i++, models++) { if (*models != NULL) { - set_mdl_custom_gfx_set(*models, CUSTOM_GFX_NONE, FOG_MODE_2); + set_mdl_custom_gfx_set(*models, CUSTOM_GFX_NONE, ENV_TINT_DEPTH); } } } @@ -64,15 +64,15 @@ API_CALLABLE(N(ApplyLavaGlowLighting)) { if (baseAlpha < 0.0f) { baseAlpha = 0.0f; } - fogStart = 970; baseAlpha *= 0.2 * evt_get_float_variable(NULL, MV_GlowIntensity); + fogStart = 970; break; case LAVA_GLOW_MODE_2: baseAlpha = 100.0f; fogStart = 995 - evt_get_variable(NULL, MV_GlowIntensity); break; case LAVA_GLOW_MODE_END: - return 0; + return ApiStatus_BLOCK; default: baseAlpha = 100.0f; fogStart = 970; @@ -83,7 +83,7 @@ API_CALLABLE(N(ApplyLavaGlowLighting)) { fastOsc = sin_deg(N(LavaGlowLightTime) * 8.0f); primA = baseAlpha + baseAlpha * (slowOsc * 0.5 + fastOsc * 0.5); - mdl_set_fog2_color_parameters(60, 50, 30, primA, 20, 20, 20, fogStart, 1000); + mdl_set_depth_tint_params(60, 50, 30, primA, 20, 20, 20, fogStart, 1000); return ApiStatus_BLOCK; } @@ -98,14 +98,14 @@ API_CALLABLE(N(ClearLavaGlowLighting)) { for (i = 0; i < modelIDs->count; i++, idList++) { s32 treeIndex = get_model_list_index_from_tree_index(*idList); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, ENV_TINT_NONE); } } else { // list is NULL -> clear effect from ALL models Model** models = (Model**) gCurrentModels; for (i = 0; i < MAX_MODELS; i++, models++) { if (*models != NULL) { - set_mdl_custom_gfx_set(*models, CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(*models, CUSTOM_GFX_NONE, ENV_TINT_NONE); } } } diff --git a/src/world/area_kzn/kzn_06/kzn_06_3_extra.c b/src/world/area_kzn/kzn_06/kzn_06_3_extra.c index 12a43ec7899..6872bd30d17 100644 --- a/src/world/area_kzn/kzn_06/kzn_06_3_extra.c +++ b/src/world/area_kzn/kzn_06/kzn_06_3_extra.c @@ -24,7 +24,7 @@ API_CALLABLE(N(AdjustFog)) { for (i = 0; i < iterList->count; i++) { s32 treeIndex = get_model_list_index_from_tree_index(iterList->list[i]); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_3); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, ENV_TINT_REMAP); if (mode) { mdl->flags &= ~MODEL_FLAG_HIDDEN; } @@ -33,10 +33,10 @@ API_CALLABLE(N(AdjustFog)) { } if (mode) { - set_background_color_blend(colR, colG, colB, + mdl_set_shroud_tint_params(colR, colG, colB, (script->functionTemp[0] * 255) / duration); } else { - set_background_color_blend(colR, colG, colB, + mdl_set_shroud_tint_params(colR, colG, colB, 255 - ((script->functionTemp[0] * 255) / duration)); } @@ -45,7 +45,7 @@ API_CALLABLE(N(AdjustFog)) { for (i = 0; i < iterList->count; i++) { s32 treeIndex = get_model_list_index_from_tree_index(iterList->list[i]); Model* mdl = get_model_from_list_index(treeIndex); - set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, ENV_TINT_NONE); if (!mode) { mdl->flags |= MODEL_FLAG_HIDDEN; } @@ -180,7 +180,7 @@ EvtScript N(EVS_SetupLavaPuzzle) = { EVT_END_IF EVT_THREAD EVT_SET_GROUP(EVT_GROUP_00) - EVT_CALL(N(ApplyLavaGlowLighting), LAVA_GLOW_MODE_1, 0) + EVT_CALL(N(ApplyLavaGlowLighting), LAVA_GLOW_MODE_1, NULL) EVT_END_THREAD EVT_THREAD EVT_CALL(N(ClearLavaGlowLighting), EVT_PTR(N(LavaModels))) diff --git a/src/world/area_kzn/kzn_07/kzn_07_2_main.c b/src/world/area_kzn/kzn_07/kzn_07_2_main.c index f49c46d0a83..108e795664a 100644 --- a/src/world/area_kzn/kzn_07/kzn_07_2_main.c +++ b/src/world/area_kzn/kzn_07/kzn_07_2_main.c @@ -67,7 +67,7 @@ EvtScript N(EVS_Main) = { EVT_WAIT(1) EVT_THREAD EVT_SET_GROUP(EVT_GROUP_00) - EVT_CALL(N(ApplyLavaGlowLighting), LAVA_GLOW_MODE_0, 0) + EVT_CALL(N(ApplyLavaGlowLighting), LAVA_GLOW_MODE_0, NULL) EVT_END_THREAD EVT_THREAD EVT_CALL(N(ClearLavaGlowLighting), EVT_PTR(N(LavaModelIDs))) diff --git a/src/world/area_kzn/kzn_08/kzn_08.h b/src/world/area_kzn/kzn_08/kzn_08.h index 9e323e7623e..35240f469dc 100644 --- a/src/world/area_kzn/kzn_08/kzn_08.h +++ b/src/world/area_kzn/kzn_08/kzn_08.h @@ -29,4 +29,4 @@ extern API_CALLABLE(N(ApplyLavaGlowLighting)); extern API_CALLABLE(N(ClearLavaGlowLighting)); void disable_world_fog(void); -void mdl_get_fog2_color_parameters(u8*, u8*, u8*, u8*, u8*, u8*, u8*, s32*, s32*); +void mdl_get_depth_tint_params(u8*, u8*, u8*, u8*, u8*, u8*, u8*, s32*, s32*); diff --git a/src/world/area_kzn/kzn_08/kzn_08_1_main.c b/src/world/area_kzn/kzn_08/kzn_08_1_main.c index fa059486349..6afd7cc8a9f 100644 --- a/src/world/area_kzn/kzn_08/kzn_08_1_main.c +++ b/src/world/area_kzn/kzn_08/kzn_08_1_main.c @@ -101,31 +101,32 @@ LavaReset N(SafeFloorColliders)[] = { { .colliderID = -1 } }; -EvtScript N(EVS_80244790) = { +// unused +EvtScript N(EVS_AnimateLavaScale) = { EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(MakeLerp, 1, 100, 200, EASING_LINEAR) EVT_LABEL(0) - EVT_CALL(UpdateLerp) - EVT_DIVF(LVar0, EVT_FLOAT(10.0)) - EVT_CALL(ScaleModel, MODEL_yougan1, LVar0, EVT_FLOAT(1.0), EVT_FLOAT(1.0)) - EVT_MULF(LVar0, EVT_FLOAT(-5.0)) - EVT_ADDF(LVar0, EVT_FLOAT(100.0)) - EVT_SET(MV_GlowIntensity, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(0) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_DIVF(LVar0, EVT_FLOAT(10.0)) + EVT_CALL(ScaleModel, MODEL_yougan1, LVar0, EVT_FLOAT(1.0), EVT_FLOAT(1.0)) + EVT_MULF(LVar0, EVT_FLOAT(-5.0)) + EVT_ADDF(LVar0, EVT_FLOAT(100.0)) + EVT_SET(MV_GlowIntensity, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(0) + EVT_END_IF EVT_CALL(MakeLerp, 0, 35, 100, EASING_LINEAR) EVT_LABEL(10) - EVT_CALL(UpdateLerp) - EVT_CALL(TranslateModel, MODEL_yougan, 0, LVar0, 0) - EVT_MULF(LVar0, EVT_FLOAT(-1.25)) - EVT_ADDF(LVar0, EVT_FLOAT(50.0)) - EVT_SET(MV_GlowIntensity, LVar0) - EVT_WAIT(1) - EVT_IF_EQ(LVar1, 1) - EVT_GOTO(10) - EVT_END_IF + EVT_CALL(UpdateLerp) + EVT_CALL(TranslateModel, MODEL_yougan, 0, LVar0, 0) + EVT_MULF(LVar0, EVT_FLOAT(-1.25)) + EVT_ADDF(LVar0, EVT_FLOAT(50.0)) + EVT_SET(MV_GlowIntensity, LVar0) + EVT_WAIT(1) + EVT_IF_EQ(LVar1, 1) + EVT_GOTO(10) + EVT_END_IF EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_CLEAR_BITS, COLLIDER_yougan_atari, COLLIDER_FLAGS_UPPER_MASK) EVT_CALL(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_SURFACE, COLLIDER_yougan_atari, SURFACE_TYPE_LAVA) EVT_THREAD diff --git a/src/world/area_kzn/kzn_08/kzn_08_4_extra.c b/src/world/area_kzn/kzn_08/kzn_08_4_extra.c index 7a98a08f169..2415fc414c7 100644 --- a/src/world/area_kzn/kzn_08/kzn_08_4_extra.c +++ b/src/world/area_kzn/kzn_08/kzn_08_4_extra.c @@ -16,7 +16,7 @@ API_CALLABLE(N(func_80243EE0_C75360)) { set_screen_overlay_center_worldpos(SCREEN_LAYER_BACK, 1, playerStatus->pos.x, playerStatus->pos.y + 8.0f, playerStatus->pos.z); - mdl_get_fog2_color_parameters(&primR, &primG, &primB, &primA, + mdl_get_depth_tint_params(&primR, &primG, &primB, &primA, &fogR, &fogG, &fogB, &fogStart, &fogEnd); alpha = (((995 - fogStart) - 70.0f) * 255.0f) / 30.0f; diff --git a/src/world/area_mac/mac_00/npc/dojo_members.inc.c b/src/world/area_mac/mac_00/npc/dojo_members.inc.c index 43062f24b0b..199bd6e5df4 100644 --- a/src/world/area_mac/mac_00/npc/dojo_members.inc.c +++ b/src/world/area_mac/mac_00/npc/dojo_members.inc.c @@ -17,8 +17,8 @@ API_CALLABLE(N(SetDojoBattle)) { } API_CALLABLE(N(ResetBackgroundPostBattle)) { - func_8011B950(MODEL_minka_1, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); - set_background_color_blend(0, 0, 0, 255); + mdl_group_set_custom_gfx(MODEL_minka_1, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); + mdl_set_shroud_tint_params(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; gCameras[CAM_DEFAULT].bgColor[2] = 0; diff --git a/src/world/area_mac/mac_01/mac_01_9_npc.c b/src/world/area_mac/mac_01/mac_01_9_npc.c index 29fb397c8f7..f9d2bab096e 100644 --- a/src/world/area_mac/mac_01/mac_01_9_npc.c +++ b/src/world/area_mac/mac_01/mac_01_9_npc.c @@ -256,7 +256,7 @@ API_CALLABLE(N(func_802448A0_805120)) { if (isInitialCall) { if (script->varTable[0] == 0) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); + mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); } script->functionTemp[0] = 0; } @@ -272,14 +272,14 @@ API_CALLABLE(N(func_802448A0_805120)) { alpha = 255 - script->functionTemp[0]; } - set_background_color_blend(0, 0, 0, alpha); + mdl_set_shroud_tint_params(0, 0, 0, alpha); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; gCameras[CAM_DEFAULT].bgColor[2] = 0; if (script->functionTemp[0] >= 255) { if (script->varTable[0] == 3) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); + mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_NONE, TRUE); } return ApiStatus_DONE2; } diff --git a/src/world/area_mac/mac_01/npc/read_fortune.inc.c b/src/world/area_mac/mac_01/npc/read_fortune.inc.c index 3b7002d6a00..496a93f63ad 100644 --- a/src/world/area_mac/mac_01/npc/read_fortune.inc.c +++ b/src/world/area_mac/mac_01/npc/read_fortune.inc.c @@ -1,16 +1,16 @@ API_CALLABLE(N(func_802440FC_80497C)) { if (isInitialCall) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), CUSTOM_GFX_NONE, FOG_MODE_3); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), CUSTOM_GFX_NONE, FOG_MODE_3); - mdl_set_fog3_color_parameters(255, 255, 255, 0, 0, 0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), CUSTOM_GFX_NONE, ENV_TINT_REMAP); + mdl_set_remap_tint_params(255, 255, 255, 0, 0, 0); script->functionTemp[0] = 255; } script->functionTemp[0] -= 4; if (script->functionTemp[0] < 64) { script->functionTemp[0] = 64; } - mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_remap_tint_params(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 64) { return ApiStatus_DONE2; } @@ -45,7 +45,7 @@ API_CALLABLE(N(func_802441EC_804A6C)) { script->functionTemp[2] = 0; } } - mdl_set_fog3_color_parameters( + mdl_set_remap_tint_params( script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[2], script->functionTemp[2], script->functionTemp[2] ); @@ -63,11 +63,11 @@ API_CALLABLE(N(func_80244308_804B88)) { if (script->functionTemp[0] > 255) { script->functionTemp[0] = 255; } - mdl_set_fog3_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); + mdl_set_remap_tint_params(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); if (script->functionTemp[0] == 255) { - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), CUSTOM_GFX_NONE, FOG_MODE_0); - set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), CUSTOM_GFX_NONE, FOG_MODE_0); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o283)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o279)), CUSTOM_GFX_NONE, ENV_TINT_NONE); + set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_dr_yuka)), CUSTOM_GFX_NONE, ENV_TINT_NONE); return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_mac/mac_02/mac_02_3_rooms.c b/src/world/area_mac/mac_02/mac_02_3_rooms.c index c80247b484a..ad0cf0ef41a 100644 --- a/src/world/area_mac/mac_02/mac_02_3_rooms.c +++ b/src/world/area_mac/mac_02/mac_02_3_rooms.c @@ -5,8 +5,8 @@ API_CALLABLE(N(InitEntryFromTunnels)) { Npc* npc; s32 i; - func_8011B950(MODEL_souko, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); - set_background_color_blend(0, 0, 0, 255); + mdl_group_set_custom_gfx(MODEL_souko, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); + mdl_set_shroud_tint_params(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; gCameras[CAM_DEFAULT].bgColor[2] = 0; diff --git a/src/world/area_mac/mac_04/mac_04_2_main.c b/src/world/area_mac/mac_04/mac_04_2_main.c index e8954510566..9a22ed0fd64 100644 --- a/src/world/area_mac/mac_04/mac_04_2_main.c +++ b/src/world/area_mac/mac_04/mac_04_2_main.c @@ -13,12 +13,12 @@ API_CALLABLE(N(SetNightFogParams)) { s32 fogStart = evt_get_variable(script, *args++); s32 fogEnd = evt_get_variable(script, *args++); - mdl_set_fog2_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); + mdl_set_depth_tint_params(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); return ApiStatus_DONE2; } -API_CALLABLE(N(SetNightFogMode)) { - mdl_set_all_fog_mode(FOG_MODE_3); +API_CALLABLE(N(SetNightTintMode)) { + mdl_set_all_tint_type(ENV_TINT_REMAP); return ApiStatus_DONE2; } @@ -51,7 +51,7 @@ EvtScript N(EVS_EnterMap) = { EVT_SET(MF_MusicMixTrigger, TRUE) EVT_END_THREAD EVT_CASE_EQ(mac_04_ENTRY_4) - EVT_CALL(N(SetNightFogMode)) + EVT_CALL(N(SetNightTintMode)) EVT_CALL(N(SetNightFogParams), 0, 0, 0, 0, 0, 0, 0, 950, 1000) EVT_EXEC(N(EVS_Scene_WishingToadKid)) EVT_CASE_EQ(mac_04_ENTRY_5) diff --git a/src/world/area_mac/mac_04/mac_04_3_rooms.c b/src/world/area_mac/mac_04/mac_04_3_rooms.c index 7f3d9b408ca..76709e58d53 100644 --- a/src/world/area_mac/mac_04/mac_04_3_rooms.c +++ b/src/world/area_mac/mac_04/mac_04_3_rooms.c @@ -1,10 +1,10 @@ #include "mac_04.h" -s32 set_background_color_blend(s32, s32, s32, s32); +s32 mdl_set_shroud_tint_params(s32, s32, s32, s32); API_CALLABLE(N(InitEntryFromToybox)) { - func_8011B950(MODEL_heiho_house, CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); - set_background_color_blend(0, 0, 0, 255); + mdl_group_set_custom_gfx(MODEL_heiho_house, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); + mdl_set_shroud_tint_params(0, 0, 0, 255); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; gCameras[CAM_DEFAULT].bgColor[2] = 0; diff --git a/src/world/area_osr/osr_00/osr_00_5_scenes.c b/src/world/area_osr/osr_00/osr_00_5_scenes.c index d84de533a68..27641f4a8a5 100644 --- a/src/world/area_osr/osr_00/osr_00_5_scenes.c +++ b/src/world/area_osr/osr_00/osr_00_5_scenes.c @@ -4,7 +4,7 @@ #include "sprite/npc/Luigi.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" API_CALLABLE(N(func_80240678_AACEA8)) { Bytecode* args = script->ptrReadPos; @@ -14,7 +14,7 @@ API_CALLABLE(N(func_80240678_AACEA8)) { s32 envR = *args++; s32 envG = *args++; s32 envB = *args++; - mdl_set_fog3_color_parameters(primR, primG, primB, envR, envG, envB); + mdl_set_remap_tint_params(primR, primG, primB, envR, envG, envB); return ApiStatus_DONE2; } @@ -50,8 +50,8 @@ EvtScript N(EVS_Scene_ShowInvitation) = { EVT_CALL(SetCamDistance, CAM_DEFAULT, 775) EVT_CALL(SetCamPitch, CAM_DEFAULT, 20, -19) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP) EVT_CALL(N(func_80240678_AACEA8), 200, 200, 200, 40, 40, 40) EVT_CALL(N(func_802406E0_AACF10)) EVT_WAIT(15 * DT) diff --git a/src/world/area_pra/pra_29/pra_29_4_bridge.c b/src/world/area_pra/pra_29/pra_29_4_bridge.c index ac4e2996520..013fd1881c4 100644 --- a/src/world/area_pra/pra_29/pra_29_4_bridge.c +++ b/src/world/area_pra/pra_29/pra_29_4_bridge.c @@ -79,8 +79,8 @@ EvtScript N(EVS_SetupBridge) = { EVT_CALL(EnableModel, MODEL_s00, FALSE) EVT_SET(MV_BridgeExtendAmt, 0) EVT_SET(MV_UnusedBridgeAlpha, 255) - EVT_CALL(SetModelCustomGfx, MODEL_u02, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) - EVT_CALL(SetModelCustomGfx, MODEL_s02, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_u02, CUSTOM_GFX_0, ENV_TINT_UNCHANGED) + EVT_CALL(SetModelCustomGfx, MODEL_s02, CUSTOM_GFX_1, ENV_TINT_UNCHANGED) EVT_CALL(SetModelFlags, MODEL_u02, MODEL_FLAG_USES_CUSTOM_GFX, FALSE) EVT_CALL(SetModelFlags, MODEL_s02, MODEL_FLAG_USES_CUSTOM_GFX, FALSE) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_bridge)), NULL) diff --git a/src/world/area_sam/sam_06/sam_06_4_npc.c b/src/world/area_sam/sam_06/sam_06_4_npc.c index 6478f358823..440b861c99d 100644 --- a/src/world/area_sam/sam_06/sam_06_4_npc.c +++ b/src/world/area_sam/sam_06/sam_06_4_npc.c @@ -286,7 +286,7 @@ API_CALLABLE(N(func_80242538_D223C8)) { if (isInitialCall) { if (script->varTable[0] == 0) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); + mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); } script->functionTemp[0] = 0; } @@ -302,14 +302,14 @@ API_CALLABLE(N(func_80242538_D223C8)) { alpha = 255 - script->functionTemp[0]; } - set_background_color_blend(0, 0, 0, alpha); + mdl_set_shroud_tint_params(0, 0, 0, alpha); gCameras[CAM_DEFAULT].bgColor[0] = 0; gCameras[CAM_DEFAULT].bgColor[1] = 0; gCameras[CAM_DEFAULT].bgColor[2] = 0; if (script->functionTemp[0] >= 255) { if (script->varTable[0] == 3) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); + mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_NONE, TRUE); } return ApiStatus_DONE2; } diff --git a/src/world/area_sam/sam_11/sam_11_4_entity.c b/src/world/area_sam/sam_11/sam_11_4_entity.c index c4408c68b2d..9fe394678f7 100644 --- a/src/world/area_sam/sam_11/sam_11_4_entity.c +++ b/src/world/area_sam/sam_11/sam_11_4_entity.c @@ -14,9 +14,9 @@ API_CALLABLE(N(UpdateHouseShowHide)) { s32 temp_a2; if (isInitialCall) { - func_8011B950(script->varTable[1], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); + mdl_group_set_custom_gfx(script->varTable[1], CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); script->functionTemp[0] = 0; - get_background_color_blend(&r, &g, &b, &a); + mdl_get_shroud_tint_params(&r, &g, &b, &a); if ((script->varTable[0] == 0 && a == 255) || (script->varTable[0] == 1 && a == 0)) { return ApiStatus_DONE2; } @@ -32,7 +32,7 @@ API_CALLABLE(N(UpdateHouseShowHide)) { alpha = ~script->functionTemp[0]; } a = alpha; - set_background_color_blend(0, 0, 0, a); + mdl_set_shroud_tint_params(0, 0, 0, a); r = (N(TargetBackgroundColR) * (255 - a)) / 255; g = (N(TargetBackgroundColG) * (255 - a)) / 255; b = (N(TargetBackgroundColB) * (255 - a)) / 255; @@ -41,7 +41,7 @@ API_CALLABLE(N(UpdateHouseShowHide)) { gCameras[CAM_DEFAULT].bgColor[2] = b; if (script->functionTemp[0] >= 255) { if (script->varTable[0] == 1) { - func_8011B950(script->varTable[1], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); + mdl_group_set_custom_gfx(script->varTable[1], CUSTOM_GFX_NONE, ENV_TINT_NONE, TRUE); } return ApiStatus_DONE2; diff --git a/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c b/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c index 87d73abd501..a15af0fe2a5 100644 --- a/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c +++ b/src/world/area_sbk/sbk_02/sbk_02_3_ruins.c @@ -2,7 +2,7 @@ #include "effects.h" #include "model.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" API_CALLABLE(N(HideSun)) { EffectInstance* effect = (EffectInstance*)evt_get_variable(script, MV_Unk_00); @@ -23,7 +23,7 @@ API_CALLABLE(N(InterpWorldEnvColor)) { s32 blendEnvR, blendEnvG, blendEnvB; if (isInitialCall) { - mdl_get_fog3_color_parameters(&savedPrimR, &savedPrimG, &savedPrimB, &savedEnvR, &savedEnvG, &savedEnvB); + mdl_get_remap_tint_params(&savedPrimR, &savedPrimG, &savedPrimB, &savedEnvR, &savedEnvG, &savedEnvB); targetPrimR = evt_get_variable(script, *args++); targetPrimG = evt_get_variable(script, *args++); targetPrimB = evt_get_variable(script, *args++); @@ -43,12 +43,12 @@ API_CALLABLE(N(InterpWorldEnvColor)) { blendEnvG = savedEnvG + ((targetEnvG - savedEnvG) * elapsed) / duration; blendEnvB = savedEnvB + ((targetEnvB - savedEnvB) * elapsed) / duration; - mdl_set_fog3_color_parameters(blendPrimR, blendPrimG, blendPrimB, blendEnvR, blendEnvG, blendEnvB); + mdl_set_remap_tint_params(blendPrimR, blendPrimG, blendPrimB, blendEnvR, blendEnvG, blendEnvB); if (elapsed >= duration) { return ApiStatus_DONE2; } } else { - mdl_set_fog3_color_parameters(targetPrimR, targetPrimG, targetPrimB, targetEnvR, targetEnvG, targetEnvB); + mdl_set_remap_tint_params(targetPrimR, targetPrimG, targetPrimB, targetEnvR, targetEnvG, targetEnvB); return ApiStatus_DONE2; } @@ -85,18 +85,18 @@ EvtScript N(EVS_Pedestal_Sink) = { }; s32 N(ModelList_Solid)[] = { - MODEL_ruins, MODEL_step, 0x0000FFFF + MODEL_ruins, MODEL_step, 0xFFFF }; s32 N(ModelList_Translucent)[] = { - MODEL_upper_light, MODEL_o225, 0x0000FFFF + MODEL_upper_light, MODEL_o225, 0xFFFF }; EvtScript N(EVS_DarkenEnvironment) = { - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, EVT_PTR(N(ModelList_Solid)), FOG_MODE_0) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(ModelList_Translucent)), FOG_MODE_0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, EVT_PTR(N(ModelList_Solid)), ENV_TINT_NONE) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(ModelList_Translucent)), ENV_TINT_NONE) EVT_CALL(N(InterpWorldEnvColor), 255, 255, 255, 0, 0, 0, 0) EVT_WAIT(1) EVT_CALL(N(InterpWorldEnvColor), 44, 32, 177, 0, 0, 0, 60) @@ -695,10 +695,10 @@ EvtScript N(EVS_Ruins_Arise_Continued) = { EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(500.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, EVT_PTR(N(ModelList_Solid)), FOG_MODE_0) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_0, EVT_PTR(N(ModelList_Translucent)), FOG_MODE_0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, EVT_PTR(N(ModelList_Solid)), ENV_TINT_NONE) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(ModelList_Translucent)), ENV_TINT_NONE) EVT_CALL(N(InterpWorldEnvColor), 44, 32, 177, 0, 0, 0, 0) EVT_EXEC(N(EVS_Ruins_FinishRising)) EVT_EXEC(N(EVS_Steps_FinishRising)) diff --git a/src/world/area_sbk/sbk_30/sbk_30_2_main.c b/src/world/area_sbk/sbk_30/sbk_30_2_main.c index b6ef19c52b8..906a0cde50e 100644 --- a/src/world/area_sbk/sbk_30/sbk_30_2_main.c +++ b/src/world/area_sbk/sbk_30/sbk_30_2_main.c @@ -1,6 +1,6 @@ #include "sbk_30.h" -#include "world/common/atomic/UnkFunc27.inc.c" +#include "world/common/atomic/ApplyTint.inc.c" #include "world/common/todo/SpawnSunEffect.inc.c" @@ -44,9 +44,9 @@ EvtScript N(EVS_Scene_RuinsRising) = { EVT_CALL(SetPanTarget, CAM_DEFAULT, 193, 0, -237) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_2, NULL, FOG_MODE_3) - EVT_CALL(N(UnkFunc27), FUNC27_MODE_1, -1, FOG_MODE_3) - EVT_CALL(N(UnkFunc26), FOG_MODE_3, 44, 32, 177, 0, 0, 0, 0, 0, 0) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP) + EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(DisablePlayerInput, TRUE) EVT_THREAD EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.25)) diff --git a/src/world/common/atomic/UnkFunc27.inc.c b/src/world/common/atomic/ApplyTint.inc.c similarity index 61% rename from src/world/common/atomic/UnkFunc27.inc.c rename to src/world/common/atomic/ApplyTint.inc.c index 819b15b58de..33f57f0f86a 100644 --- a/src/world/common/atomic/UnkFunc27.inc.c +++ b/src/world/common/atomic/ApplyTint.inc.c @@ -3,59 +3,59 @@ #include "model.h" enum { - FUNC27_MODE_0 = 0, - FUNC27_MODE_1 = 1, - FUNC27_MODE_2 = 2, + APPLY_TINT_MODELS = 0, + APPLY_TINT_GROUPS = 1, + APPLY_TINT_BG = 2, }; -API_CALLABLE(N(UnkFunc27)) { +API_CALLABLE(N(SetModelTintMode)) { Bytecode* args = script->ptrReadPos; s32 mode = evt_get_variable(script, *args++); s32 testS0 = evt_get_variable(script, *args++); - s32 fogType = evt_get_variable(script, *args++); + s32 tintType = evt_get_variable(script, *args++); s32* modelIDList = (s32*) testS0; s32 listIndex; Model* mdl; if (modelIDList == PTR_LIST_END) { - mdl_set_all_fog_mode(fogType); + mdl_set_all_tint_type(tintType); return ApiStatus_DONE2; } switch (mode) { - case FUNC27_MODE_0: + case APPLY_TINT_MODELS: while (TRUE) { if (*modelIDList == 0xFFFF) { break; } listIndex = get_model_list_index_from_tree_index(*modelIDList); mdl = get_model_from_list_index(listIndex); - set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, fogType); + set_mdl_custom_gfx_set(mdl, CUSTOM_GFX_NONE, tintType); modelIDList++; }; break; - case FUNC27_MODE_1: + case APPLY_TINT_GROUPS: while (TRUE) { if (*modelIDList == 0xFFFF) { break; } - func_8011B950(*modelIDList, CUSTOM_GFX_NONE, fogType, FALSE); + mdl_group_set_custom_gfx(*modelIDList, CUSTOM_GFX_NONE, tintType, FALSE); modelIDList++; }; break; - case FUNC27_MODE_2: - *gBackgroundFogModePtr = fogType; + case APPLY_TINT_BG: + *gBackgroundTintModePtr = tintType; break; } return ApiStatus_DONE2; } -API_CALLABLE(N(UnkFunc26)) { +API_CALLABLE(N(SetModelTintParams)) { Bytecode* args = script->ptrReadPos; - s32 fogMode = evt_get_variable(script, *args++); + s32 tintType = evt_get_variable(script, *args++); s32 arg0 = evt_get_variable(script, *args++); s32 arg1 = evt_get_variable(script, *args++); s32 arg2 = evt_get_variable(script, *args++); @@ -66,15 +66,15 @@ API_CALLABLE(N(UnkFunc26)) { s32 arg7 = evt_get_variable(script, *args++); s32 arg8 = evt_get_variable(script, *args++); - switch (fogMode) { - case FOG_MODE_1: - set_background_color_blend(arg0, arg1, arg2, arg3); + switch (tintType) { + case ENV_TINT_SHROUD: + mdl_set_shroud_tint_params(arg0, arg1, arg2, arg3); break; - case FOG_MODE_2: - mdl_set_fog2_color_parameters(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + case ENV_TINT_DEPTH: + mdl_set_depth_tint_params(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); break; - case FOG_MODE_3: - mdl_set_fog3_color_parameters(arg0, arg1, arg2, arg3, arg4, arg5); + case ENV_TINT_REMAP: + mdl_set_remap_tint_params(arg0, arg1, arg2, arg3, arg4, arg5); break; } diff --git a/src/world/common/complete/Quizmo.inc.c b/src/world/common/complete/Quizmo.inc.c index 1c6615433e6..b238e5363e3 100644 --- a/src/world/common/complete/Quizmo.inc.c +++ b/src/world/common/complete/Quizmo.inc.c @@ -233,9 +233,9 @@ API_CALLABLE(N(Quizmo_HideWorld)) { if (isInitialCall) { s32 i; - mdl_set_all_fog_mode(FOG_MODE_1); - *gBackgroundFogModePtr = FOG_MODE_1; - set_background_color_blend(0, 0, 0, 0); + mdl_set_all_tint_type(ENV_TINT_SHROUD); + *gBackgroundTintModePtr = ENV_TINT_SHROUD; + mdl_set_shroud_tint_params(0, 0, 0, 0); for (i = 0; i < MAX_NPCS; i++) { Npc* npc = get_npc_by_index(i); @@ -261,7 +261,7 @@ API_CALLABLE(N(Quizmo_HideWorld)) { script->functionTemp[0] = 255; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); if (script->functionTemp[0] == 255) { return ApiStatus_DONE2; @@ -274,7 +274,7 @@ API_CALLABLE(N(Quizmo_FadeInWorld)) { s32 i; if (isInitialCall) { - set_background_color_blend(0, 0, 0, 255); + mdl_set_shroud_tint_params(0, 0, 0, 255); script->functionTemp[0] = 255; script->functionTemp[1] = 0; } @@ -284,12 +284,12 @@ API_CALLABLE(N(Quizmo_FadeInWorld)) { script->functionTemp[0] = 0; } - set_background_color_blend(0, 0, 0, script->functionTemp[0]); + mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]); if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) { script->functionTemp[1] = 1; } else if (script->functionTemp[1] == 1) { - mdl_set_all_fog_mode(FOG_MODE_0); - *gBackgroundFogModePtr = FOG_MODE_0; + mdl_set_all_tint_type(ENV_TINT_NONE); + *gBackgroundTintModePtr = ENV_TINT_NONE; for (i = 0; i < MAX_NPCS; i++) { Npc* npc = get_npc_by_index(i); diff --git a/src/world/script_api/rooms.c b/src/world/script_api/rooms.c index eb9547f802d..467f95c8001 100644 --- a/src/world/script_api/rooms.c +++ b/src/world/script_api/rooms.c @@ -257,7 +257,7 @@ API_CALLABLE(RoomVisibilityToggleImpl) { if (isInitialCall) { if (script->varTable[0] == ROOM_VISIBILITY_SHOW) { - func_8011B950(script->varTable[15], CUSTOM_GFX_NONE, FOG_MODE_1, TRUE); + mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE); } script->functionTemp[1] = 0; } @@ -270,7 +270,7 @@ API_CALLABLE(RoomVisibilityToggleImpl) { } else { alpha = 255 - script->functionTemp[1]; } - set_background_color_blend(0, 0, 0, alpha); + mdl_set_shroud_tint_params(0, 0, 0, alpha); r = door->bgColor[0] * (255 - alpha) / 255; g = door->bgColor[1] * (255 - alpha) / 255; b = door->bgColor[2] * (255 - alpha) / 255; @@ -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], CUSTOM_GFX_NONE, FOG_MODE_0, TRUE); + mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_NONE, TRUE); } return ApiStatus_DONE2; } else { diff --git a/ver/ique/asm/bss3.s b/ver/ique/asm/bss3.s index e297315b70f..d4c003271e0 100644 --- a/ver/ique/asm/bss3.s +++ b/ver/ique/asm/bss3.s @@ -55,7 +55,7 @@ dlabel gCurrentCustomModelGfxPtr dlabel gLastCreatedEntityIndex .space 4 -dlabel gBackgroundFogModePtr +dlabel gBackgroundTintModePtr .space 4 dlabel gMsgVarImages @@ -222,10 +222,10 @@ dlabel wModelTreeNodeInfo dlabel bModelTreeNodeInfo .space 0x00000800 -dlabel wBackgroundFogMode +dlabel wBackgroundTintMode .space 1 -dlabel bBackgroundFogMode +dlabel bBackgroundTintMode .space 1 dlabel D_80153222 @@ -234,7 +234,7 @@ dlabel D_80153222 dlabel D_80153223 .space 1 -dlabel mdl_treeIterPos +dlabel TreeIterPos .space 4 dlabel wFogSettings @@ -243,7 +243,7 @@ dlabel wFogSettings dlabel bFogSettings .space 0x0000001c -dlabel gCurrentFogSettings +dlabel gFogSettings .space 4 dlabel texPannerMainU @@ -279,16 +279,16 @@ dlabel mtg_MaxChild dlabel D_80153378 .space 8 -dlabel depthCopyBuffer +dlabel DepthCopyBuffer .space 0x00000020 -dlabel mdl_renderTaskLists +dlabel RenderTaskLists .space 0x0000000c -dlabel mdl_renderTaskQueueIdx +dlabel RenderTaskListIdx .space 4 -dlabel mdl_renderTaskCount +dlabel RenderTaskCount .space 0x00000010 dlabel D_801533C0 @@ -664,7 +664,7 @@ dlabel gCurrentHiddenPanels .space 8 -dlabel mdl_textureHandles +dlabel TextureHandles .space 0x00002200 dlabel ScreenOverlays diff --git a/ver/ique/symbol_addrs.txt b/ver/ique/symbol_addrs.txt index b9c879f63c6..2e86b8de0e0 100644 --- a/ver/ique/symbol_addrs.txt +++ b/ver/ique/symbol_addrs.txt @@ -4192,7 +4192,7 @@ HES_StickTapLeft = 0x80107370; HES_StickTapRight = 0x801075C4; NpcHitQueryAheadCollider = 0x8010AD6C; gStatusBar = 0x8010D338; -gBackgroundFogModePtr = 0x8014FA80; +gBackgroundTintModePtr = 0x8014FA80; gMapShapeData = 0x80210000; battle_item_volt_shroom_EVS_UseItem = 0x802A183C; battle_item_repel_gel_EVS_UseItem = 0x802A185C; @@ -4410,9 +4410,9 @@ delete_shadow = 0x80110708; load_data_for_models = 0x80119128; is_world_fog_enabled = 0x80119F84; get_world_fog_color = 0x80119FB8; -set_background_color_blend = 0x8011A23C; -get_background_color_blend = 0x8011A260; -mdl_set_all_fog_mode = 0x8011BC0C; +mdl_set_shroud_tint_params = 0x8011A23C; +mdl_get_shroud_tint_params = 0x8011A260; +mdl_set_all_tint_type = 0x8011BC0C; load_entity_model = 0x8011F0C0; exec_entity_model_commandlist = 0x8011F2E4; draw_entity_model_A = 0x801200C8; diff --git a/ver/jp/undefined_syms.txt b/ver/jp/undefined_syms.txt index e4561c0c92a..99b3901cd92 100644 --- a/ver/jp/undefined_syms.txt +++ b/ver/jp/undefined_syms.txt @@ -148,9 +148,9 @@ render_models = 0x8011BDA0; get_model_from_list_index = 0x8011FF40; load_data_for_models = 0x8011FF58; mdl_reset_transform_flags = 0x80120CF8; -set_background_color_blend = 0x8012106C; -get_background_color_blend = 0x80121090; -mdl_set_all_fog_mode = 0x80122A3C; +mdl_set_shroud_tint_params = 0x8012106C; +mdl_get_shroud_tint_params = 0x80121090; +mdl_set_all_tint_type = 0x80122A3C; clear_render_tasks = 0x80122AA0; queue_render_task = 0x80122B20; execute_render_tasks = 0x80122BC8; @@ -253,7 +253,7 @@ bgm_push_battle_song = 0x8014FFA8; bgm_set_battle_song = 0x8015003C; gLastRenderTaskCount = 0x801508A0; D_8014C248 = 0x801512F8; -gBackgroundFogModePtr = 0x80156350; +gBackgroundTintModePtr = 0x80156350; gWindows = 0x8015ECD0; D_80164000 = 0x80164000; D_80197000 = 0x80197000; diff --git a/ver/pal/asm/bss3.s b/ver/pal/asm/bss3.s index e4d1f05620b..00220d73714 100644 --- a/ver/pal/asm/bss3.s +++ b/ver/pal/asm/bss3.s @@ -57,7 +57,7 @@ dlabel gCurrentCustomModelGfxPtr dlabel gLastCreatedEntityIndex .space 4 -dlabel gBackgroundFogModePtr +dlabel gBackgroundTintModePtr .space 4 dlabel gMsgVarImages @@ -224,10 +224,10 @@ dlabel wModelTreeNodeInfo dlabel bModelTreeNodeInfo .space 0x00000800 -dlabel wBackgroundFogMode +dlabel wBackgroundTintMode .space 1 -dlabel bBackgroundFogMode +dlabel bBackgroundTintMode .space 1 dlabel D_80153222 @@ -236,7 +236,7 @@ dlabel D_80153222 dlabel D_80153223 .space 1 -dlabel mdl_treeIterPos +dlabel TreeIterPos .space 4 dlabel wFogSettings @@ -245,7 +245,7 @@ dlabel wFogSettings dlabel bFogSettings .space 0x0000001c -dlabel gCurrentFogSettings +dlabel gFogSettings .space 4 dlabel texPannerMainU @@ -281,16 +281,16 @@ dlabel mtg_MaxChild dlabel D_80153378 .space 8 -dlabel depthCopyBuffer +dlabel DepthCopyBuffer .space 0x00000020 -dlabel mdl_renderTaskLists +dlabel RenderTaskLists .space 0x0000000c -dlabel mdl_renderTaskQueueIdx +dlabel RenderTaskListIdx .space 4 -dlabel mdl_renderTaskCount +dlabel RenderTaskCount .space 0x00000010 dlabel D_801533C0 @@ -664,7 +664,7 @@ dlabel gCurrentHiddenPanels .space 8 -dlabel mdl_textureHandles +dlabel TextureHandles .space 0x00002200 dlabel ScreenOverlays diff --git a/ver/pal/undefined_syms.txt b/ver/pal/undefined_syms.txt index 4bc751f5cdf..7f0d4289b5b 100644 --- a/ver/pal/undefined_syms.txt +++ b/ver/pal/undefined_syms.txt @@ -630,7 +630,7 @@ ExitSplitDoubleDoor = 0x80285EAC; EnterSplitDoubleDoor = 0x80285ED4; BaseExitDoor = 0x80285EFC; BaseEnterDoor = 0x802861C0; -MapTextureMemory = 0x8028E000; +TextureHeap = 0x8028E000; HES_AimMarkerA = 0x802933FC; HES_AimMarkerB = 0x80293494; HES_AimMarkerC = 0x8029352C; diff --git a/ver/us/asm/bss3.s b/ver/us/asm/bss3.s index 5148ddd9c0c..9be96e3f544 100644 --- a/ver/us/asm/bss3.s +++ b/ver/us/asm/bss3.s @@ -57,7 +57,7 @@ dlabel gCurrentCustomModelGfxPtr dlabel gLastCreatedEntityIndex .space 4 -dlabel gBackgroundFogModePtr +dlabel gBackgroundTintModePtr .space 4 dlabel gMsgVarImages @@ -224,10 +224,10 @@ dlabel wModelTreeNodeInfo dlabel bModelTreeNodeInfo .space 0x00000800 -dlabel wBackgroundFogMode +dlabel wBackgroundTintMode .space 1 -dlabel bBackgroundFogMode +dlabel bBackgroundTintMode .space 1 dlabel D_80153222 @@ -236,7 +236,7 @@ dlabel D_80153222 dlabel D_80153223 .space 1 -dlabel mdl_treeIterPos +dlabel TreeIterPos .space 4 dlabel wFogSettings @@ -245,7 +245,7 @@ dlabel wFogSettings dlabel bFogSettings .space 0x0000001c -dlabel gCurrentFogSettings +dlabel gFogSettings .space 4 dlabel texPannerMainU @@ -281,16 +281,16 @@ dlabel mtg_MaxChild dlabel D_80153378 .space 8 -dlabel depthCopyBuffer +dlabel DepthCopyBuffer .space 0x00000020 -dlabel mdl_renderTaskLists +dlabel RenderTaskLists .space 0x0000000c -dlabel mdl_renderTaskQueueIdx +dlabel RenderTaskListIdx .space 4 -dlabel mdl_renderTaskCount +dlabel RenderTaskCount .space 0x00000010 dlabel D_801533C0 @@ -661,7 +661,7 @@ dlabel gCurrentHiddenPanels .space 8 -dlabel mdl_textureHandles +dlabel TextureHandles .space 0x00002200 dlabel ScreenOverlays diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index 1f9666ab659..4e1ca4e66e8 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -3989,8 +3989,8 @@ 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 +mdl_group_set_visibility = 0x8011B7C0; // type:func rom:0xB1EC0 +mdl_group_set_custom_gfx = 0x8011B950; // type:func rom:0xB2050 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 @@ -4009,12 +4009,12 @@ set_custom_gfx = 0x8011BCB4; // type:func rom:0xB23B4 set_custom_gfx_builders = 0x8011BCD0; // type:func rom:0xB23D0 build_custom_gfx = 0x8011BCEC; // type:func rom:0xB23EC is_identity_fixed_mtx = 0x8011BE14; // type:func rom:0xB2514 -set_background_color_blend = 0x8011BE5C; // type:func rom:0xB255C -get_background_color_blend = 0x8011BE80; // type:func rom:0xB2580 -mdl_set_fog2_color_parameters = 0x8011BEB4; // type:func rom:0xB25B4 -mdl_get_fog2_color_parameters = 0x8011BF14; // type:func rom:0xB2614 -mdl_set_fog3_color_parameters = 0x8011BF98; // type:func rom:0xB2698 -mdl_get_fog3_color_parameters = 0x8011BFD4; // type:func rom:0xB26D4 +mdl_set_shroud_tint_params = 0x8011BE5C; // type:func rom:0xB255C +mdl_get_shroud_tint_params = 0x8011BE80; // type:func rom:0xB2580 +mdl_set_depth_tint_params = 0x8011BEB4; // type:func rom:0xB25B4 +mdl_get_depth_tint_params = 0x8011BF14; // type:func rom:0xB2614 +mdl_set_remap_tint_params = 0x8011BF98; // type:func rom:0xB2698 +mdl_get_remap_tint_params = 0x8011BFD4; // type:func rom:0xB26D4 mdl_get_vertex_count = 0x8011C028; // type:func rom:0xB2728 mdl_local_gfx_update_vtx_pointers = 0x8011C0DC; // type:func rom:0xB27DC mdl_local_gfx_copy_vertices = 0x8011C130; // type:func rom:0xB2830 @@ -4026,7 +4026,7 @@ is_model_center_visible = 0x8011C80C; // type:func rom:0xB2F0C is_point_visible = 0x8011CFBC; // type:func rom:0xB36BC mdl_draw_hidden_panel_surface = 0x8011D72C; // type:func rom:0xB3E2C mdl_get_next_texture_address = 0x8011D7E4; // type:func rom:0xB3EE4 -mdl_set_all_fog_mode = 0x8011D82C; // type:func rom:0xB3F2C +mdl_set_all_tint_type = 0x8011D82C; // type:func rom:0xB3F2C clear_render_tasks = 0x8011D890; // type:func rom:0xB3F90 clear_render_tasks_alt = 0x8011D8D0; // type:func rom:0xB3FD0 queue_render_task = 0x8011D910; // type:func rom:0xB4010 @@ -4448,35 +4448,35 @@ func_8014AFA0 = 0x8014AFA0; // type:func rom:0xE16A0 D_8014AFB0 = 0x8014AFB0; // rom:0xE16B0 D_8014AFB4 = 0x8014AFB4; // rom:0xE16B4 ModelRenderModes = 0x8014AFC0; // rom:0xE16C0 -ModelCombineModesStandard = 0x8014B0B8; // rom:0xE17B8 +SolidCombineModes = 0x8014B0B8; // rom:0xE17B8 D_8014B0BC = 0x8014B0BC; // rom:0xE17BC -ModelCombineModesAlphaTest = 0x8014B400; // rom:0xE1B00 +AlphaTestCombineModes = 0x8014B400; // rom:0xE1B00 D_8014B404 = 0x8014B404; // rom:0xE1B04 TextureHeapBase = 0x8014B748; // rom:0xE1E48 -mdl_bgMultiplyColorA = 0x8014B74C; // rom:0xE1E4C -mdl_bgMultiplyColorR = 0x8014B74D; // rom:0xE1E4D -mdl_bgMultiplyColorG = 0x8014B74E; // rom:0xE1E4E -mdl_bgMultiplyColorB = 0x8014B74F; // rom:0xE1E4F -mdl_Fog2PrimR = 0x8014B750; // rom:0xE1E50 -mdl_Fog2PrimG = 0x8014B751; // rom:0xE1E51 -mdl_Fog2PrimB = 0x8014B752; // rom:0xE1E52 -mdl_Fog2PrimA = 0x8014B753; // rom:0xE1E53 -mdl_Fog2ColR = 0x8014B754; // rom:0xE1E54 -mdl_Fog2ColG = 0x8014B755; // rom:0xE1E55 -mdl_Fog2ColB = 0x8014B756; // rom:0xE1E56 -mdl_Fog2ColA = 0x8014B757; // rom:0xE1E57 -mdl_Fog2Start = 0x8014B758; // rom:0xE1E58 -mdl_Fog2End = 0x8014B75C; // rom:0xE1E5C -mdl_Fog3PrimR = 0x8014B760; // rom:0xE1E60 -mdl_Fog3PrimG = 0x8014B761; // rom:0xE1E61 -mdl_Fog3PrimB = 0x8014B762; // rom:0xE1E62 -mdl_Fog3EnvR = 0x8014B763; // rom:0xE1E63 -mdl_Fog3EnvG = 0x8014B764; // rom:0xE1E64 -mdl_Fog3EnvB = 0x8014B765; // rom:0xE1E65 +ShroudTintAmt = 0x8014B74C; // rom:0xE1E4C +ShroudTintR = 0x8014B74D; // rom:0xE1E4D +ShroudTintG = 0x8014B74E; // rom:0xE1E4E +ShroudTintB = 0x8014B74F; // rom:0xE1E4F +DepthTintBaseR = 0x8014B750; // rom:0xE1E50 +DepthTintBaseG = 0x8014B751; // rom:0xE1E51 +DepthTintBaseB = 0x8014B752; // rom:0xE1E52 +DepthTintBaseA = 0x8014B753; // rom:0xE1E53 +DepthTintColR = 0x8014B754; // rom:0xE1E54 +DepthTintColG = 0x8014B755; // rom:0xE1E55 +DepthTintColB = 0x8014B756; // rom:0xE1E56 +DepthTintColA = 0x8014B757; // rom:0xE1E57 +DepthTintStart = 0x8014B758; // rom:0xE1E58 +DepthTintEnd = 0x8014B75C; // rom:0xE1E5C +RemapTintMaxR = 0x8014B760; // rom:0xE1E60 +RemapTintMaxG = 0x8014B761; // rom:0xE1E61 +RemapTintMaxB = 0x8014B762; // rom:0xE1E62 +RemapTintMinR = 0x8014B763; // rom:0xE1E63 +RemapTintMinG = 0x8014B764; // rom:0xE1E64 +RemapTintMinB = 0x8014B765; // rom:0xE1E65 D_8014B766 = 0x8014B766; // rom:0xE1E66 D_8014B767 = 0x8014B767; // rom:0xE1E67 -mdl_RDPIdentity = 0x8014B768; // rom:0xE1E68 -depthFloatLookupTable = 0x8014B7A8; // rom:0xE1EA8 +ReferenceIdentityMtx = 0x8014B768; // rom:0xE1E68 +DepthFloatLookupTable = 0x8014B7A8; // rom:0xE1EA8 gLastRenderTaskCount = 0x8014B7F0; // rom:0xE1EF0 Gfx_RM1_SURFACE_OPA = 0x8014B7F8; // rom:0xE1EF8 Gfx_RM1_DECAL_OPA = 0x8014B820; // rom:0xE1F20 @@ -4775,7 +4775,7 @@ gCurrentTransformGroups = 0x801512E0; // rom:0xE79E0 gMsgGlobalWaveCounter = 0x801512E4; // rom:0xE79E4 gCurrentCustomModelGfxPtr = 0x801512E8; // rom:0xE79E8 gLastCreatedEntityIndex = 0x801512EC; // rom:0xE79EC -gBackgroundFogModePtr = 0x801512F0; // rom:0xE79F0 +gBackgroundTintModePtr = 0x801512F0; // rom:0xE79F0 gMsgVarImages = 0x801512F4; // rom:0xE79F4 ItemEntitiesCreated = 0x801512F8; // rom:0xE79F8 gCurrentModelTreeRoot = 0x801512FC; // rom:0xE79FC @@ -4887,14 +4887,14 @@ evt_handle_if_AND = 0x802C4E90; // type:func rom:0xE9840 evt_handle_if_not_AND = 0x802C4EE8; // type:func rom:0xE9898 evt_handle_else = 0x802C4F40; // type:func rom:0xE98F0 evt_handle_end_if = 0x802C4F6C; // type:func rom:0xE991C -wBackgroundFogMode = 0x80153220; // rom:0xE9920 -bBackgroundFogMode = 0x80153221; // rom:0xE9921 +wBackgroundTintMode = 0x80153220; // rom:0xE9920 +bBackgroundTintMode = 0x80153221; // rom:0xE9921 D_80153222 = 0x80153222; // rom:0xE9922 D_80153223 = 0x80153223; // rom:0xE9923 evt_handle_switch = 0x802C4F74; // type:func rom:0xE9924 wFogSettings = 0x80153228; // rom:0xE9928 bFogSettings = 0x80153248; // rom:0xE9948 -gCurrentFogSettings = 0x80153264; // rom:0xE9964 +gFogSettings = 0x80153264; // rom:0xE9964 texPannerMainU = 0x80153268; // rom:0xE9968 evt_handle_switch_const = 0x802C4FE4; // type:func rom:0xE9994 texPannerMainV = 0x801532A8; // rom:0xE99A8 @@ -4908,10 +4908,10 @@ 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 -mdl_renderTaskQueueIdx = 0x801533AC; // rom:0xE9AAC -mdl_renderTaskCount = 0x801533B0; // rom:0xE9AB0 +DepthCopyBuffer = 0x80153380; // rom:0xE9A80 +RenderTaskLists = 0x801533A0; // rom:0xE9AA0 +RenderTaskListIdx = 0x801533AC; // rom:0xE9AAC +RenderTaskCount = 0x801533B0; // rom:0xE9AB0 D_801533C0 = 0x801533C0; // rom:0xE9AC0 evt_handle_case_less = 0x802C5148; // type:func rom:0xE9AF8 evt_handle_case_less_equal = 0x802C51D8; // type:func rom:0xE9B88 @@ -5230,7 +5230,7 @@ GetCamPosC = 0x802CC214; // type:func rom:0xF0BC4 gCollisionStatus = 0x8015A550; // rom:0xF0C50 size:0x28 GetCamPosition = 0x802CC2A4; // type:func rom:0xF0C54 gCurrentHiddenPanels = 0x8015A578; // rom:0xF0C78 -mdl_textureHandles = 0x8015A590; // rom:0xF0C90 +TextureHandles = 0x8015A590; // rom:0xF0C90 WaitForCam = 0x802CC354; // type:func rom:0xF0D04 SetCamProperties = 0x802CC3EC; // type:func rom:0xF0D9C AdjustCam = 0x802CC660; // type:func rom:0xF1010 @@ -7928,7 +7928,7 @@ shim_draw_prev_frame_buffer_at_screen_pos = 0xE0200630; // type:func rom:0x32610 shim_draw_box = 0xE0200640; // type:func rom:0x326110 shim_draw_msg = 0xE0200650; // type:func rom:0x326120 shim_get_msg_width = 0xE0200660; // type:func rom:0x326130 -shim_get_background_color_blend = 0xE0200670; // type:func rom:0x326140 +shim_mdl_get_shroud_tint_params = 0xE0200670; // type:func rom:0x326140 shim_sfx_play_sound_at_position = 0xE0200680; // type:func rom:0x326150 effect_prng_seed = 0xE0200690; // rom:0x326160 effectFuncs = 0xE0200694; // rom:0x326164 @@ -10531,8 +10531,8 @@ b_area_trd_part_1_trd_05f_EVS_PreBattle = 0x80227B94; // rom:0x4B0C34 b_area_trd_part_1_trd_05f_EVS_PostBattle = 0x80227C8C; // rom:0x4B0D2C b_area_trd_part_1_trd_05f = 0x80227C9C; // rom:0x4B0D3C b_area_trd_part_2_fake_bowser_StartRumbleWithParams = 0x80218000; // type:func rom:0x4B11F0 -b_area_trd_part_2_fake_bowser_UnkFunc27 = 0x80218058; // type:func rom:0x4B1248 -b_area_trd_part_2_fake_bowser_UnkFunc26 = 0x8021817C; // type:func rom:0x4B136C +b_area_trd_part_2_fake_bowser_SetModelTintMode = 0x80218058; // type:func rom:0x4B1248 +b_area_trd_part_2_fake_bowser_SetModelTintParams = 0x8021817C; // type:func rom:0x4B136C b_area_trd_part_2_PlayKoopaBrosSong = 0x80218350; // type:func rom:0x4B1540 b_area_trd_part_2_PlayLandOnTowerFX = 0x8021837C; // type:func rom:0x4B156C b_area_trd_part_2_green_ninja_koopa_StartRumbleWithParams = 0x802183E0; // type:func rom:0x4B15D0 @@ -15367,7 +15367,7 @@ mac_03_ItemChoice_SelectedItemID = 0x80248C70; // rom:0x83A470 D_8024F800_841000 = 0x8024F800; // rom:0x841000 mac_04_func_80240000_842BD0 = 0x80240000; // type:func rom:0x842BD0 mac_04_SetNightFogParams = 0x80240050; // type:func rom:0x842C20 -mac_04_SetNightFogMode = 0x80240194; // type:func rom:0x842D64 +mac_04_SetNightTintMode = 0x80240194; // type:func rom:0x842D64 mac_04_InitEntryFromToybox = 0x802401C0; // type:func rom:0x842D90 mac_04_foliage_setup_shear_mtx = 0x80240220; // type:func rom:0x842DF0 mac_04_TransformFoliage = 0x80240290; // type:func rom:0x842E60 @@ -16583,8 +16583,8 @@ sbk_01_npcGroup_802403F8 = 0x802403F8; // rom:0x929E88 sbk_01_npcGroup_802405E8 = 0x802405E8; // rom:0x92A078 sbk_01_npcGroupList_802407D8 = 0x802407D8; // rom:0x92A268 sbk_02_get_tattle = 0x80240000; // type:func rom:0x92A2B0 -sbk_02_UnkFunc27 = 0x80240040; // type:func rom:0x92A2F0 -sbk_02_UnkFunc26 = 0x80240164; // type:func rom:0x92A414 +sbk_02_SetModelTintMode = 0x80240040; // type:func rom:0x92A2F0 +sbk_02_SetModelTintParams = 0x80240164; // type:func rom:0x92A414 sbk_02_func_80240338_92A5E8 = 0x80240338; // type:func rom:0x92A5E8 sbk_02_InterpWorldEnvColor = 0x80240364; // type:func rom:0x92A614 sbk_02_GetNpcCollisionHeight = 0x802406F0; // type:func rom:0x92A9A0 @@ -16646,8 +16646,8 @@ sbk_26_SetInstigatorValue_3 = 0x80240140; // type:func rom:0x93DE10 sbk_26_foliage_setup_shear_mtx = 0x80240160; // type:func rom:0x93DE30 sbk_26_TransformFoliage = 0x802401D0; // type:func rom:0x93DEA0 sbk_30_get_tattle = 0x80240000; // type:func rom:0x93F5B0 -sbk_30_UnkFunc27 = 0x80240040; // type:func rom:0x93F5F0 -sbk_30_UnkFunc26 = 0x80240164; // type:func rom:0x93F714 +sbk_30_SetModelTintMode = 0x80240040; // type:func rom:0x93F5F0 +sbk_30_SetModelTintParams = 0x80240164; // type:func rom:0x93F714 sbk_30_SpawnSunEffect = 0x80240338; // type:func rom:0x93F8E8 sbk_30_GuardAI_IdleInit = 0x80240370; // type:func rom:0x93F920 sbk_30_GuardAI_Idle = 0x80240424; // type:func rom:0x93F9D4 @@ -16782,8 +16782,8 @@ dro_01_Pipe_AwaitDownInput = 0x80240034; // type:func rom:0x95B234 dro_01_Pipe_GetEntryPos = 0x802400F0; // type:func rom:0x95B2F0 dro_01_Pipe_GetCameraYaw = 0x802401D0; // type:func rom:0x95B3D0 dro_01_Pipe_GetPointAheadOfPlayer = 0x8024023C; // type:func rom:0x95B43C -dro_01_UnkFunc27 = 0x802402E0; // type:func rom:0x95B4E0 -dro_01_UnkFunc26 = 0x80240404; // type:func rom:0x95B604 +dro_01_SetModelTintMode = 0x802402E0; // type:func rom:0x95B4E0 +dro_01_SetModelTintParams = 0x80240404; // type:func rom:0x95B604 dro_01_PatrolAI_MoveInit = 0x802405E0; // type:func rom:0x95B7E0 dro_01_PatrolAI_Move = 0x80240738; // type:func rom:0x95B938 dro_01_PatrolAI_LoiterInit = 0x802409E0; // type:func rom:0x95BBE0 @@ -16993,8 +16993,8 @@ D_8024DDE0_968FE0 = 0x8024DDE0; // rom:0x968FE0 D_8024DDE8_968FE8 = 0x8024DDE8; // rom:0x968FE8 dro_01_pad_XXX = 0x8024DFAC; // rom:0x9691AC dro_01_dro_01_name_hack = 0x8024DFB0; // rom:0x9691B0 -dro_02_UnkFunc27 = 0x80240000; // type:func rom:0x9691C0 -dro_02_UnkFunc26 = 0x80240124; // type:func rom:0x9692E4 +dro_02_SetModelTintMode = 0x80240000; // type:func rom:0x9691C0 +dro_02_SetModelTintParams = 0x80240124; // type:func rom:0x9692E4 dro_02_StashVars = 0x80240300; // type:func rom:0x9694C0 dro_02_GetItemName = 0x802403B4; // type:func rom:0x969574 dro_02_Quizmo_HideEntities = 0x80240418; // type:func rom:0x9695D8 @@ -17347,8 +17347,8 @@ isk_16_StarSpiritEffectFunc3 = 0x802401AC; // type:func rom:0x99539C isk_16_StarSpiritEffectFunc4 = 0x802405BC; // type:func rom:0x9957AC isk_16_StarSpiritEffectFunc5 = 0x802405FC; // type:func rom:0x9957EC isk_16_StarSpiritEffectFunc6 = 0x80240708; // type:func rom:0x9958F8 -isk_16_UnkFunc27 = 0x80240800; // type:func rom:0x9959F0 -isk_16_UnkFunc26 = 0x80240924; // type:func rom:0x995B14 +isk_16_SetModelTintMode = 0x80240800; // type:func rom:0x9959F0 +isk_16_SetModelTintParams = 0x80240924; // type:func rom:0x995B14 isk_18_set_script_owner_npc_anim = 0x80240000; // type:func rom:0x997F70 isk_18_UnkDistFunc = 0x8024007C; // type:func rom:0x997FEC isk_18_UnkNpcAIFunc12 = 0x802401B0; // type:func rom:0x998120 @@ -18059,8 +18059,8 @@ D_80243258_A2A128 = 0x80243258; // rom:0xA2A128 D_80243284_A2A154 = 0x80243284; // rom:0xA2A154 D_80243300_A2A1D0 = 0x80243300; // rom:0xA2A1D0 D_80243328_A2A1F8 = 0x80243328; // rom:0xA2A1F8 -hos_05_UnkFunc27 = 0x80240000; // type:func rom:0xA2A240 -hos_05_UnkFunc26 = 0x80240124; // type:func rom:0xA2A364 +hos_05_SetModelTintMode = 0x80240000; // type:func rom:0xA2A240 +hos_05_SetModelTintParams = 0x80240124; // type:func rom:0xA2A364 hos_05_UpdateTexturePanSmooth = 0x802402F8; // type:func rom:0xA2A538 hos_05_UpdateTexturePanStepped = 0x8024041C; // type:func rom:0xA2A65C hos_05_AwaitScriptComplete = 0x80240604; // type:func rom:0xA2A844 @@ -18115,8 +18115,8 @@ func_80244934_A2EB74 = 0x80244934; // type:func rom:0xA2EB74 func_802449F0_A2EC30 = 0x802449F0; // type:func rom:0xA2EC30 func_80244C60_A2EEA0 = 0x80244C60; // type:func rom:0xA2EEA0 func_80244C8C_A2EECC = 0x80244C8C; // type:func rom:0xA2EECC -dup_hos_05_UnkFunc27 = 0x80244CC0; // type:func rom:0xA2EF00 -dup_hos_05_UnkFunc26 = 0x80244DE4; // type:func rom:0xA2F024 +dup_hos_05_SetModelTintMode = 0x80244CC0; // type:func rom:0xA2EF00 +dup_hos_05_SetModelTintParams = 0x80244DE4; // type:func rom:0xA2F024 dup_hos_05_UpdateTexturePanSmooth = 0x80244FB8; // type:func rom:0xA2F1F8 dup_hos_05_UpdateTexturePanStepped = 0x802450DC; // type:func rom:0xA2F31C func_802452C4_A2F504 = 0x802452C4; // type:func rom:0xA2F504 @@ -18769,8 +18769,8 @@ osr_00_UpdateTexturePanSmooth = 0x80240000; // type:func rom:0xAAC830 osr_00_UpdateTexturePanStepped = 0x80240124; // type:func rom:0xAAC954 func_8024030C_AACB3C = 0x8024030C; // type:func rom:0xAACB3C osr_00_SpawnSunEffect = 0x80240344; // type:func rom:0xAACB74 -osr_00_UnkFunc27 = 0x80240380; // type:func rom:0xAACBB0 -osr_00_UnkFunc26 = 0x802404A4; // type:func rom:0xAACCD4 +osr_00_SetModelTintMode = 0x80240380; // type:func rom:0xAACBB0 +osr_00_SetModelTintParams = 0x802404A4; // type:func rom:0xAACCD4 func_80240678_AACEA8 = 0x80240678; // type:func rom:0xAACEA8 func_802406E0_AACF10 = 0x802406E0; // type:func rom:0xAACF10 func_80240000_AAFFF0 = 0x80240000; // type:func rom:0xAAFFF0 @@ -19532,8 +19532,8 @@ D_80243880_B7D8D0 = 0x80243880; // rom:0xB7D8D0 jan_15_HeartPlant_SpawnHeart = 0x80240000; // type:func rom:0xB7D920 jan_15_foliage_setup_shear_mtx = 0x802400C0; // type:func rom:0xB7D9E0 jan_15_TransformFoliage = 0x80240130; // type:func rom:0xB7DA50 -jan_16_UnkFunc27 = 0x80240000; // type:func rom:0xB80000 -jan_16_UnkFunc26 = 0x80240124; // type:func rom:0xB80124 +jan_16_SetModelTintMode = 0x80240000; // type:func rom:0xB80000 +jan_16_SetModelTintParams = 0x80240124; // type:func rom:0xB80124 jan_16_foliage_setup_shear_mtx = 0x80240300; // type:func rom:0xB80300 jan_16_TransformFoliage = 0x80240370; // type:func rom:0xB80370 func_80240000_B837C0 = 0x80240000; // type:func rom:0xB837C0 @@ -24941,8 +24941,8 @@ end_01_SkateInCirclePenguin1 = 0x80242A68; // type:func rom:0xE07DC8 end_01_SkateInCirclePenguin2 = 0x80242B68; // type:func rom:0xE07EC8 end_01_SetSpotlightsAlpha = 0x80242C68; // type:func rom:0xE07FC8 end_01_gfx_build_set_spotlight_alpha = 0x80242C94; // type:func rom:0xE07FF4 -end_01_UnkFunc27 = 0x80242CF0; // type:func rom:0xE08050 -end_01_UnkFunc26 = 0x80242E14; // type:func rom:0xE08174 +end_01_SetModelTintMode = 0x80242CF0; // type:func rom:0xE08050 +end_01_SetModelTintParams = 0x80242E14; // type:func rom:0xE08174 end_01_CreditsViewport = 0x80243200; // rom:0xE08560 end_01_CreditsBufferIndex = 0x80243210; // rom:0xE08570 end_01_ParadeNpcsTable = 0x802441F0; // rom:0xE09550 @@ -26158,7 +26158,7 @@ Munchlesia_LaunchYaw = 0x802B62DC; // ParasolTransformation = 0x802B6E80; // SpinningFlower_EntityIndex = 0x802B6ED0; // SpinningFlower_AngleToCenter = 0x802B6EEC; // -mdl_clearRenderTasks = 0x802B7E00; // +ClearRenderTaskLists = 0x802B7E00; // GoompaTweesterPhysics = 0x802BD600; // world_goombario_HadSpeechPrompt = 0x802BDF30; // world_bow_IsHiding = 0x802BE0C0; // From cd4d6eeb08da8bfe53294aa3e3b8edf89d563bdb Mon Sep 17 00:00:00 2001 From: HailSanta Date: Thu, 23 Nov 2023 15:48:14 -0500 Subject: [PATCH 3/5] missing reset_tiles for jp/ique splat --- include/enums.h | 12 ++-- .../area/trd_part_2/actor/fake_bowser.c | 58 +++++++++---------- src/battle/popup_messages.c | 2 +- src/model.c | 4 +- ver/ique/splat.yaml | 8 ++- ver/jp/splat.yaml | 8 ++- 6 files changed, 50 insertions(+), 42 deletions(-) diff --git a/include/enums.h b/include/enums.h index dde7b2d7983..c8315118c03 100644 --- a/include/enums.h +++ b/include/enums.h @@ -4313,7 +4313,7 @@ enum GlobalOverrides { #define MODEL_FLAGS_MASK_FFF0 (\ MODEL_FLAG_USES_CUSTOM_GFX \ | MODEL_FLAG_20 \ - | MODEL_FLAG_40 \ + | MODEL_FLAG_IGNORE_FOG \ | MODEL_FLAG_HAS_LOCAL_VERTEX_COPY \ | MODEL_FLAG_USE_CAMERA_UNK_MATRIX \ | MODEL_FLAG_DO_BOUNDS_CULLING \ @@ -4321,8 +4321,8 @@ enum GlobalOverrides { | MODEL_FLAG_HAS_TEX_PANNER \ | MODEL_FLAG_MATRIX_DIRTY \ | MODEL_FLAG_IGNORE_MATRIX \ - | MODEL_FLAG_4000 \ - | MODEL_FLAG_8000) + | MODEL_FLAG_UNUSED_4000 \ + | MODEL_FLAG_UNUSED_8000) enum ModelFlags { MODEL_FLAG_VALID = 0x0001, @@ -4331,7 +4331,7 @@ enum ModelFlags { MODEL_FLAG_TRANSFORM_GROUP_MEMBER = 0x0008, MODEL_FLAG_USES_CUSTOM_GFX = 0x0010, MODEL_FLAG_20 = 0x0020, - MODEL_FLAG_40 = 0x0040, + MODEL_FLAG_IGNORE_FOG = 0x0040, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY = 0x0080, MODEL_FLAG_USE_CAMERA_UNK_MATRIX = 0x0100, MODEL_FLAG_DO_BOUNDS_CULLING = 0x0200, @@ -4339,8 +4339,8 @@ enum ModelFlags { MODEL_FLAG_HAS_TEX_PANNER = 0x0800, 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, + MODEL_FLAG_UNUSED_4000 = 0x4000, + MODEL_FLAG_UNUSED_8000 = 0x8000, }; enum ModelGroupVisibility { diff --git a/src/battle/area/trd_part_2/actor/fake_bowser.c b/src/battle/area/trd_part_2/actor/fake_bowser.c index 83aef868532..f04ad3daf35 100644 --- a/src/battle/area/trd_part_2/actor/fake_bowser.c +++ b/src/battle/area/trd_part_2/actor/fake_bowser.c @@ -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_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(SetModelFlags, MODEL_k1, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k2, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k3, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k4, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k5, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k6, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k7, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k8, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_k9, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_d2, MODEL_FLAG_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_d3, MODEL_FLAG_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_d1, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_d2, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_d3, MODEL_FLAG_IGNORE_FOG, 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_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(SetModelFlags, MODEL_s1, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_s2, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_s3, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_s4, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_s5, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_u2, MODEL_FLAG_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_u3, MODEL_FLAG_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_u1, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_u2, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_u3, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_p1, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_km1, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_km2, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_o172, MODEL_FLAG_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_o183, MODEL_FLAG_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_o171, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_o172, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_o183, MODEL_FLAG_IGNORE_FOG, 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_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_o120, MODEL_FLAG_40, TRUE) - EVT_CALL(SetModelFlags, MODEL_o165, MODEL_FLAG_40, TRUE) + EVT_CALL(SetModelFlags, MODEL_o118, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_o120, MODEL_FLAG_IGNORE_FOG, TRUE) + EVT_CALL(SetModelFlags, MODEL_o165, MODEL_FLAG_IGNORE_FOG, 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 diff --git a/src/battle/popup_messages.c b/src/battle/popup_messages.c index 052dd93cd5f..347400dbd79 100644 --- a/src/battle/popup_messages.c +++ b/src/battle/popup_messages.c @@ -404,7 +404,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_20); + clear_entity_model_flags(modelIdx, ENTITY_MODEL_FLAG_HIDDEN); } exec_entity_model_commandlist(modelIdx); break; diff --git a/src/model.c b/src/model.c index 067c0dd063e..e58f60788f0 100644 --- a/src/model.c +++ b/src/model.c @@ -1420,7 +1420,7 @@ void appendGfx_model(void* data) { } if (textureHeader != NULL || renderMode <= RENDER_MODES_LAST_OPAQUE) { - if (gFogSettings->enabled && !(flags & MODEL_FLAG_40)) { + if (gFogSettings->enabled && !(flags & MODEL_FLAG_IGNORE_FOG)) { renderClass = RENDER_CLASS_FOG; tintCombineType = TINT_COMBINE_FOG; } @@ -1513,7 +1513,7 @@ void appendGfx_model(void* data) { gDPSetAlphaDither((*gfxPos)++, G_AD_PATTERN); } - // setup combine modes for main/aux texture blending when fog is enabled + // setup combine modes for main/aux texture blending when fog or tint is enabled if (tintCombineType != TINT_COMBINE_NONE || renderMode == RENDER_MODE_ALPHATEST || renderMode == RENDER_MODE_ALPHATEST_ONESIDED diff --git a/ver/ique/splat.yaml b/ver/ique/splat.yaml index 02153a7b45a..974c8207e94 100644 --- a/ver/ique/splat.yaml +++ b/ver/ique/splat.yaml @@ -295,8 +295,12 @@ segments: - [auto, c, battle/battle] - [0x4D140, bin, rspboot] - [0x4D210, bin, n_aspMain_text] - - [0x4DE70] - - [auto, .data, main_pre] + - start: 0x4DE70 + type: .data + name: main_pre + subsegments: + - [0x4DE70] + - [0x4DE80, i4, reset_tiles, 128, 8] - [auto, .data, main] - [auto, .data, main_loop] - [auto, .data, background_gfx] diff --git a/ver/jp/splat.yaml b/ver/jp/splat.yaml index ab0cd0d73ee..89933e6b024 100644 --- a/ver/jp/splat.yaml +++ b/ver/jp/splat.yaml @@ -299,8 +299,12 @@ segments: - [0x4AC70, pm_effect_loads, effect_loads] - [auto, c, battle/battle] - [0x4E580, bin, n_aspMain_text] - - [0x4F1E0] - - [auto, .data, main_pre] + - start: 0x4F1E0 + type: .data + name: main_pre + subsegments: + - [0x4F1E0] + - [0x4F1F0, i4, reset_tiles, 128, 8] - [auto, .data, main] - [auto, .data, main_loop] - [auto, .data, background_gfx] From a9be5be89bcfd2223de277f75dce8bb1e31f935d Mon Sep 17 00:00:00 2001 From: HailSanta Date: Thu, 23 Nov 2023 15:59:13 -0500 Subject: [PATCH 4/5] fix pal --- src/world/area_isk/isk_16/isk_16_3_boss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/world/area_isk/isk_16/isk_16_3_boss.c b/src/world/area_isk/isk_16/isk_16_3_boss.c index 870b8c47c98..8aab2764a40 100644 --- a/src/world/area_isk/isk_16/isk_16_3_boss.c +++ b/src/world/area_isk/isk_16/isk_16_3_boss.c @@ -64,7 +64,11 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = { EVT_WAIT(30 * DT) EVT_SET(LVar0, 255) EVT_LOOP(60 * DT) - EVT_ADD(LVar0, -4 * DT) +#if VERSION_PAL + EVT_ADD(LVar0, -5) +#else + EVT_ADD(LVar0, -4) +#endif EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, LVar0, 0, 0, 0, 0, 0) EVT_WAIT(1) EVT_END_LOOP From 8f326045fcc3c9f1922cd5e2c78b7bf95ed9ccfd Mon Sep 17 00:00:00 2001 From: HailSanta Date: Thu, 23 Nov 2023 16:08:52 -0500 Subject: [PATCH 5/5] fix ique --- src/main.c | 4 ++-- ver/ique/undefined_syms.txt | 2 ++ ver/jp/symbol_addrs.txt | 2 +- ver/us/symbol_addrs.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index fc83ad54091..a51a7eb3878 100644 --- a/src/main.c +++ b/src/main.c @@ -113,7 +113,7 @@ extern s32 ResetGameState; extern u16* ResetSavedFrameImg; extern s16 D_80073E08; extern s16 D_80073E0A; -extern IMG_BIN D_80073E10[]; +extern IMG_BIN ResetTilesImg[]; #ifdef SHIFT #define shim_create_audio_system_obfuscated create_audio_system @@ -231,7 +231,7 @@ void appendGfx_reset_tile_pattern(void) { gDPSetCombineMode(gMainGfxPos++, PM_CC_RESET_TILES, PM_CC_RESET_TILES); gDPSetAlphaCompare(gMainGfxPos++, G_AC_THRESHOLD); gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 127); - gDPLoadTextureTile_4b(gMainGfxPos++, D_80073E10, G_IM_FMT_I, 128, 8, 0, 0, 127, 7, 0, G_TX_NOMIRROR | G_TX_WRAP, + gDPLoadTextureTile_4b(gMainGfxPos++, ResetTilesImg, G_IM_FMT_I, 128, 8, 0, 0, 127, 7, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); for (i = 0; i < 20; i++) { diff --git a/ver/ique/undefined_syms.txt b/ver/ique/undefined_syms.txt index 0d8d955d7da..466d3dd3ecc 100644 --- a/ver/ique/undefined_syms.txt +++ b/ver/ique/undefined_syms.txt @@ -36,5 +36,7 @@ D_B0000000 = 0xB0000000; D_B0000008 = 0xB0000008; D_B0000010 = 0xB0000010; +ResetTilesImg = 0x80072A80; + rspbootTextStart = rspboot_bin; rspbootTextEnd = rspboot_bin + 0xd0; diff --git a/ver/jp/symbol_addrs.txt b/ver/jp/symbol_addrs.txt index 32189703090..5b84a616253 100644 --- a/ver/jp/symbol_addrs.txt +++ b/ver/jp/symbol_addrs.txt @@ -157,7 +157,7 @@ ResetGameState = 0x80073DE0; ResetSavedFrameImg = 0x80073DE4; D_80073E08 = 0x80073DE8; D_80073E0A = 0x80073DEA; -D_80073E10 = 0x80073DF0; +ResetTilesImg = 0x80073DF0; D_80074010 = 0x80073FF0; gGameStatusPtr = 0x8007417C; SoftResetState = 0x80074182; diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index 4e1ca4e66e8..b121f3530b4 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -1297,7 +1297,7 @@ ResetSavedFrameImg = 0x80073E04; // rom:0x4F204 D_80073E08 = 0x80073E08; // rom:0x4F208 D_80073E0A = 0x80073E0A; // rom:0x4F20A D_80073E0C = 0x80073E0C; // rom:0x4F20C -D_80073E10 = 0x80073E10; // rom:0x4F210 +ResetTilesImg = 0x80073E10; // rom:0x4F210 D_80074010 = 0x80074010; // rom:0x4F410 gGameStepDelayAmount = 0x80074020; // rom:0x4F420 gGameStepDelayCount = 0x80074021; // rom:0x4F421